summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2016-03-31 16:22:56 +0200
committerMichael Raskin <7c6f434c@mail.ru>2016-03-31 16:23:08 +0200
commit011f69992a37982974aabc80186b9d10a2d719af (patch)
tree0531805033419d3a5a13df5ac9601221286e00dc /pkgs/applications/science
parentfc1e886f1b97d5eebd267a6bf7af2205a889b381 (diff)
downloadnixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar.gz
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar.bz2
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar.lz
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar.xz
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.tar.zst
nixpkgs-011f69992a37982974aabc80186b9d10a2d719af.zip
satallax: 1.4 -> 2.7
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/logic/satallax/default.nix107
1 files changed, 51 insertions, 56 deletions
diff --git a/pkgs/applications/science/logic/satallax/default.nix b/pkgs/applications/science/logic/satallax/default.nix
index 89a214c3f47..7935be11926 100644
--- a/pkgs/applications/science/logic/satallax/default.nix
+++ b/pkgs/applications/science/logic/satallax/default.nix
@@ -1,71 +1,66 @@
-x@{builderDefsPackage
-  , sbcl, zlib
-  , ...}:
-builderDefsPackage
-(a :
-let
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
-    [];
+{stdenv, fetchurl, ocaml, zlib, which, eprover, makeWrapper, coq}:
+stdenv.mkDerivation rec {
+  name = "satallax-${version}";
+  version = "2.7";
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="satallax";
-    version="1.4";
-    name="${baseName}-${version}";
-    url="http://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${name}.tar.gz";
-    hash="0l8dq4nyfw2bdsyqmgb4v6fjw3739p8nqv4bh2gh2924ibzrq5fc";
+  buildInputs = [ocaml zlib which eprover makeWrapper coq];
+  src = fetchurl {
+    url = "http://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${name}.tar.gz";
+    sha256 = "1kvxn8mc35igk4vigi5cp7w3wpxk2z3bgwllfm4n3h2jfs0vkpib";
   };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
-  };
-
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
 
-  phaseNames = ["doDeployMinisat" "doDeploy"];
+  preConfigure = ''
+    mkdir fake-tools
+    echo "echo 'Nix-build-host.localdomain'" > fake-tools/hostname
+    chmod a+x fake-tools/hostname
+    export PATH="$PATH:$PWD/fake-tools"
 
-  doDeployMinisat = a.fullDepEntry (''
     (
-      cd minisat/simp
+      cd picosat-*
+      ./configure
+      make
+    )
+    export PATH="$PATH:$PWD/libexec/satallax"
+
+    mkdir -p "$out/libexec/satallax"
+    cp picosat-*/picosat picosat-*/picomus "$out/libexec/satallax"
+
+    ( 
+      cd minisat
+      export MROOT=$PWD
+      cd core
+      make
+      cd ../simp
       make
     )
+  '';
 
-    mkdir -p "$out/bin"
-    cp minisat/simp/minisat "$out/bin"
+  postBuild = "echo testing; ! (bash ./test | grep ERROR)";
 
-    echo "(setq *minisat-binary* \"$out/bin/minisat\")" > config.lisp
+  installPhase = ''
+    mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax"
+    cp bin/satallax.opt "$out/bin/satallax"
+    wrapProgram "$out/bin/satallax" \
+      --suffix PATH : "${coq}/bin:${eprover}/bin:$out/libexec/satallax" \
+      --add-flags "-M" --add-flags "$out/lib/satallax/modes"
 
-  '') ["defEnsureDir" "minInit" "addInputs" "doUnpack"];
-  doDeploy = a.fullDepEntry (''
-    mkdir -p "$out/share/satallax/build-dir"
-    cp -r * "$out/share/satallax/build-dir"
-    cd  "$out/share/satallax/build-dir"
+    cp LICENSE README "$out/share/doc/satallax"
 
-    sbcl --load make.lisp
-    ! ( ./test | grep ERROR )
+    cp bin/*.so "$out/lib"
 
-    mkdir -p "$out/bin"
-    cp bin/satallax "$out/bin"
-  '') ["defEnsureDir" "minInit" "addInputs" "doUnpack"];
+    cp -r modes "$out/lib/satallax/"
+    cp -r problems "$out/lib/satallax/"
+    cp -r coq* "$out/lib/satallax/"
+  '';
 
   meta = {
-    description = "A higher-order logic prover";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      unix;
-    license = a.lib.licenses.free;
-    homepage = "http://www.ps.uni-saarland.de/~cebrown/satallax/";
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://www.ps.uni-saarland.de/~cebrown/satallax/";
-    };
+    inherit version;
+    description = ''Automated theorem prover for higher-order logic'';
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    downloadPage = "http://www.ps.uni-saarland.de/~cebrown/satallax/downloads.php";
+    homepage = "http://www.ps.uni-saarland.de/~cebrown/satallax/index.php";
+    updateWalker = true;
   };
-}) x
+}