Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 72 lines 1.6 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchpatch, 6 makeWrapper, 7 eprover, 8 ocaml, 9 camlp4, 10 perl, 11 zlib, 12}: 13 14stdenv.mkDerivation rec { 15 pname = "leo2"; 16 version = "1.7.0"; 17 18 src = fetchurl { 19 url = "https://page.mi.fu-berlin.de/cbenzmueller/leo/leo2_v${version}.tgz"; 20 sha256 = "sha256:1b2q7vsz6s9ighypsigqjm1mzjiq3xgnz5id5ssb4rh9zm190r82"; 21 }; 22 23 strictDeps = true; 24 25 nativeBuildInputs = [ 26 makeWrapper 27 eprover 28 ocaml 29 camlp4 30 perl 31 ]; 32 buildInputs = [ zlib ]; 33 34 patches = [ 35 (fetchpatch { 36 url = "https://github.com/niklasso/minisat/commit/7eb6015313561a2586032574788fcb133eeaa19f.patch"; 37 stripLen = 1; 38 extraPrefix = "lib/"; 39 sha256 = "sha256:01ln7hi6nvvkqkhn9hciqizizz5qspvqffgksvgmzn9x7kdd9pnh"; 40 }) 41 ]; 42 43 preConfigure = '' 44 cd src 45 patchShebangs configure 46 substituteInPlace Makefile.pre \ 47 --replace '+camlp4' "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4" 48 ''; 49 50 buildFlags = [ "opt" ]; 51 52 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-reserved-user-defined-literal"; 53 54 preInstall = "mkdir -p $out/bin"; 55 56 postInstall = '' 57 mkdir -p "$out/etc" 58 echo -e "e = ${eprover}/bin/eprover\\nepclextract = ${eprover}/bin/epclextract" > "$out/etc/leoatprc" 59 60 wrapProgram $out/bin/leo \ 61 --add-flags "--atprc $out/etc/leoatprc" 62 ''; 63 64 meta = with lib; { 65 description = "High-performance typed higher order prover"; 66 mainProgram = "leo"; 67 maintainers = [ maintainers.raskin ]; 68 platforms = platforms.unix; 69 license = licenses.bsd3; 70 homepage = "http://www.leoprover.org/"; 71 }; 72}