tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
scyther: init at 1.1.3
Silvan Mosberger
8 years ago
75fde413
20d31d7f
+84
2 changed files
expand all
collapse all
unified
split
pkgs
applications
science
programming
scyther
default.nix
top-level
all-packages.nix
+82
pkgs/applications/science/programming/scyther/default.nix
···
1
1
+
{ stdenv, lib, fetchFromGitHub, glibc, flex, bison, python27Packages, graphviz, cmake
2
2
+
, includeGUI ? true
3
3
+
, includeProtocols ? true
4
4
+
}:
5
5
+
let
6
6
+
version = "1.1.3";
7
7
+
in
8
8
+
stdenv.mkDerivation {
9
9
+
name = "scyther-${version}";
10
10
+
src = fetchFromGitHub {
11
11
+
rev = "v${version}";
12
12
+
sha256 = "0rb4ha5bnjxnwj4f3hciq7kyj96fhw14hqbwl5kr9cdw8q62mx0h";
13
13
+
owner = "cascremers";
14
14
+
repo = "scyther";
15
15
+
};
16
16
+
17
17
+
buildInputs = [
18
18
+
cmake
19
19
+
glibc.static
20
20
+
flex
21
21
+
bison
22
22
+
] ++ lib.optional includeGUI [
23
23
+
python27Packages.wrapPython
24
24
+
];
25
25
+
26
26
+
patchPhase = ''
27
27
+
# Since we're not in a git dir, the normal command this project uses to create this file wouldn't work
28
28
+
printf "%s\n" "#define TAGVERSION \"${version}\"" > src/version.h
29
29
+
'' + lib.optionalString includeGUI ''
30
30
+
file=gui/Scyther/Scyther.py
31
31
+
32
32
+
# By default the scyther binary is looked for in the directory of the python script ($out/gui), but we want to have it look where our cli package is
33
33
+
substituteInPlace $file --replace "return getMyDir()" "return \"$out/bin\""
34
34
+
35
35
+
# Removes the Shebang from the file, as this would be wrapped wrongly
36
36
+
sed -i -e "1d" $file
37
37
+
'';
38
38
+
39
39
+
configurePhase = ''
40
40
+
(cd src && cmakeConfigurePhase)
41
41
+
'';
42
42
+
43
43
+
propagatedBuildInputs = lib.optional includeGUI [
44
44
+
python27Packages.wxPython
45
45
+
graphviz
46
46
+
];
47
47
+
48
48
+
dontUseCmakeBuildDir = true;
49
49
+
cmakeFlags = [ "-DCMAKE_C_FLAGS=-std=gnu89" ];
50
50
+
51
51
+
installPhase = ''
52
52
+
mkdir -p "$out/bin"
53
53
+
cp src/scyther-linux "$out/bin/scyther-cli"
54
54
+
'' + lib.optionalString includeGUI ''
55
55
+
mkdir -p "$out/gui"
56
56
+
cp -r gui/* "$out/gui"
57
57
+
ln -s ../gui/scyther-gui.py "$out/bin/scyther-gui"
58
58
+
ln -s ../bin/scyther-cli "$out/bin/scyther-linux"
59
59
+
'' + lib.optionalString includeProtocols (if includeGUI then ''
60
60
+
ln -s ./gui/Protocols "$out/protocols"
61
61
+
'' else ''
62
62
+
mkdir -p "$out/protocols"
63
63
+
cp -r gui/Protocols/* "$out/protocols"
64
64
+
'');
65
65
+
66
66
+
postFixup = lib.optionalString includeGUI ''
67
67
+
wrapPythonProgramsIn "$out/gui" "$out $pythonPath"
68
68
+
'';
69
69
+
70
70
+
doInstallCheck = includeGUI;
71
71
+
installCheckPhase = ''
72
72
+
"$out/gui/scyther.py" "$src/gui/Protocols/Demo/ns3.spdl"
73
73
+
'';
74
74
+
75
75
+
meta = with lib; {
76
76
+
description = "Scyther is a tool for the automatic verification of security protocols.";
77
77
+
homepage = https://www.cs.ox.ac.uk/people/cas.cremers/scyther/;
78
78
+
license = licenses.gpl2;
79
79
+
maintainers = with maintainers; [ infinisil ];
80
80
+
platforms = platforms.linux;
81
81
+
};
82
82
+
}
+2
pkgs/top-level/all-packages.nix
···
17852
17852
17853
17853
plm = callPackage ../applications/science/programming/plm { };
17854
17854
17855
17855
+
scyther = callPackage_i686 ../applications/science/programming/scyther { };
17856
17856
+
17855
17857
### SCIENCE/LOGIC
17856
17858
17857
17859
abc-verifier = callPackage ../applications/science/logic/abc {};