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