diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/applications/science/programming | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/applications/science/programming')
4 files changed, 216 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/programming/fdr/default.nix b/nixpkgs/pkgs/applications/science/programming/fdr/default.nix new file mode 100644 index 000000000000..3bfb70f5ce8e --- /dev/null +++ b/nixpkgs/pkgs/applications/science/programming/fdr/default.nix @@ -0,0 +1,69 @@ +{stdenv, fetchurl, qtbase, qtx11extras, ncurses, xorg, zlib, python27Packages}: +stdenv.mkDerivation { + name = "fdr-4.2.3"; + src = fetchurl { + url = https://www.cs.ox.ac.uk/projects/fdr/downloads/fdr-3789-linux-x86_64.tar.gz; + sha256 = "0n2yqichym5xdawlgk3r7yha88k7ycnx6585jfrcm7043sls1i88"; + }; + + libPath = stdenv.lib.makeLibraryPath [ + stdenv.cc.cc + python27Packages.python + qtbase + qtx11extras + ncurses + xorg.libX11 + xorg.libXft + zlib + ]; + + phases = [ "unpackPhase" "installPhase" ]; + installPhase = '' + mkdir -p "$out" + + # shipped Qt is buggy + rm lib/libQt* + rm -r lib/qt_plugins + + cp -r * "$out" + # Hack around lack of libtinfo in NixOS + ln -s ${ncurses.out}/lib/libncursesw.so.6 $out/lib/libtinfo.so.5 + ln -s ${qtbase.bin}/${qtbase.qtPluginPrefix} $out/lib/qt_plugins + ln -s ${zlib.out}/lib/libz.so.1 $out/lib/libz.so.1 + + for b in fdr4 _fdr4 refines _refines cspmprofiler cspmexplorerprof + do + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + --set-rpath "$libPath:$out/lib" \ + "$out/bin/$b" + done + + for l in corei7/librefines.so \ + libcspm_process_compiler.so \ + libcsp_operators.so \ + _fdr.so \ + libfdr.so \ + libfdr_java.so \ + libprocess_compiler.so \ + librefines_gui.so \ + librefines_licensing.so \ + libboost_date_time.so.1.60.0 \ + libboost_filesystem.so.1.60.0 \ + libboost_iostreams.so.1.60.0 \ + libboost_program_options.so.1.60.0 \ + libboost_serialization.so.1.60.0 \ + libboost_system.so.1.60.0 + do + patchelf --set-rpath "$libPath:$out/lib" \ + "$out/lib/$l" + done + ''; + + meta = with stdenv.lib; { + homepage = https://www.cs.ox.ac.uk/projects/fdr/; + description = "The CSP refinement checker"; + license = licenses.unfreeRedistributable; + platforms = platforms.linux; + maintainers = with maintainers; [ nickhu ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/programming/plm/default.nix b/nixpkgs/pkgs/applications/science/programming/plm/default.nix new file mode 100644 index 000000000000..c454ad377686 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/programming/plm/default.nix @@ -0,0 +1,36 @@ +{stdenv, fetchurl, makeWrapper, jre, gcc, valgrind}: +# gcc and valgrind are not strict dependencies, they could be made +# optional. They are here because plm can only help you learn C if you +# have them installed. +stdenv.mkDerivation rec { + major = "2"; + minor = "5"; + version = "${major}-${minor}"; + name = "plm-${version}"; + + src = fetchurl { + url = "http://webloria.loria.fr/~quinson/Teaching/PLM/plm-${major}_${minor}.jar"; + sha256 = "0m17cxa3nxi2cbswqvlfzp0mlfi3wrkw8ry2xhkxy6aqzm2mlgcc"; + name = "${name}.jar"; + }; + + buildInputs = [ makeWrapper jre gcc valgrind ]; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p "$prefix/bin" + + makeWrapper ${jre}/bin/java $out/bin/plm \ + --add-flags "-jar $src" \ + --prefix PATH : "$PATH" + ''; + + meta = with stdenv.lib; { + description = "Free cross-platform programming exerciser"; + license = licenses.gpl3; + maintainers = [ ]; + platforms = stdenv.lib.platforms.all; + broken = true; + }; +} diff --git a/nixpkgs/pkgs/applications/science/programming/scyther/cli.nix b/nixpkgs/pkgs/applications/science/programming/scyther/cli.nix new file mode 100644 index 000000000000..152b71217743 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/programming/scyther/cli.nix @@ -0,0 +1,32 @@ +{ stdenv, glibc, flex, bison, cmake +, version, src, meta }: +stdenv.mkDerivation { + name = "scyther-cli-${version}"; + + inherit src meta; + + buildInputs = [ + cmake + glibc.static + flex + bison + ]; + + patchPhase = '' + # Since we're not in a git dir, the normal command this project uses to create this file wouldn't work + printf "%s\n" "#define TAGVERSION \"${version}\"" > src/version.h + ''; + + configurePhase = '' + (cd src && cmakeConfigurePhase) + ''; + + dontUseCmakeBuildDir = true; + cmakeFlags = [ "-DCMAKE_C_FLAGS=-std=gnu89" ]; + + installPhase = '' + mkdir -p "$out/bin" + mv src/scyther-linux "$out/bin/scyther-cli" + ln -s "$out/bin/scyther-cli" "$out/bin/scyther-linux" + ''; +} diff --git a/nixpkgs/pkgs/applications/science/programming/scyther/default.nix b/nixpkgs/pkgs/applications/science/programming/scyther/default.nix new file mode 100644 index 000000000000..e0993a580193 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/programming/scyther/default.nix @@ -0,0 +1,79 @@ +{ stdenv, lib, buildEnv, pkgsi686Linux, fetchFromGitHub, python27Packages, graphviz +, includeGUI ? true +, includeProtocols ? true +}: +let + version = "1.1.3"; + + src = fetchFromGitHub { + rev = "v${version}"; + sha256 = "0rb4ha5bnjxnwj4f3hciq7kyj96fhw14hqbwl5kr9cdw8q62mx0h"; + owner = "cascremers"; + repo = "scyther"; + }; + + meta = with lib; { + description = "Scyther is a tool for the automatic verification of security protocols."; + homepage = https://www.cs.ox.ac.uk/people/cas.cremers/scyther/; + license = licenses.gpl2; + maintainers = with maintainers; [ infinisil ]; + platforms = platforms.linux; + }; + + cli = pkgsi686Linux.callPackage ./cli.nix { + inherit version src meta; + }; + + gui = stdenv.mkDerivation { + name = "scyther-gui-${version}"; + inherit src meta; + buildInputs = [ + python27Packages.wrapPython + ]; + + patchPhase = '' + file=gui/Scyther/Scyther.py + + # 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 + substituteInPlace $file --replace "return getMyDir()" "return \"${cli}/bin\"" + + # Removes the Shebang from the file, as this would be wrapped wrongly + sed -i -e "1d" $file + ''; + + dontBuild = true; + + propagatedBuildInputs = [ + python27Packages.wxPython + graphviz + ]; + + installPhase = '' + mkdir -p "$out"/gui "$out"/bin + cp -r gui/* "$out"/gui + ln -s "$out"/gui/scyther-gui.py "$out/bin/scyther-gui" + ''; + + postFixup = '' + wrapPythonProgramsIn "$out/gui" "$out $pythonPath" + ''; + + doInstallCheck = true; + installCheckPhase = '' + "$out/gui/scyther.py" "$src/gui/Protocols/Demo/ns3.spdl" + ''; + }; +in + buildEnv { + name = "scyther-${version}"; + inherit meta; + paths = [ cli ] ++ lib.optional includeGUI gui; + pathsToLink = [ "/bin" ]; + + postBuild = '' + rm "$out/bin/scyther-linux" + '' + lib.optionalString includeProtocols '' + mkdir -p "$out/protocols" + cp -rv ${src}/protocols/* "$out/protocols" + ''; + } |