-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzz-go.nix
More file actions
54 lines (45 loc) · 1.12 KB
/
fuzz-go.nix
File metadata and controls
54 lines (45 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ pkgs }:
let
name = "fuzz-go";
version = "0.0.1";
description = "Python-based Go fuzzing test runner";
in
pkgs.stdenvNoCC.mkDerivation {
pname = name;
inherit version;
src = ./.;
dontBuild = true;
doCheck = false;
nativeBuildInputs = with pkgs; [
makeWrapper
];
buildInputs = with pkgs; [
python3
go
];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/fuzz-go/config
# Copy the main script
cp scripts/fuzz_go.py $out/bin/${name}
chmod +x $out/bin/${name}
# Copy shared configuration files
if [ -d shared ]; then
find shared -maxdepth 1 -type f -exec cp {} $out/share/fuzz-go/config/ \;
fi
# Wrap the script to ensure all dependencies are in PATH and set config path
wrapProgram $out/bin/${name} \
--prefix PATH : ${pkgs.lib.makeBinPath [
pkgs.python3
pkgs.go
]} \
--set FUZZ_GO_CONFIG_DIR "$out/share/fuzz-go/config"
runHook postInstall
'';
meta = with pkgs.lib; {
inherit description;
platforms = platforms.unix;
maintainers = [ ];
license = licenses.mit;
};
}