about summary refs log tree commit diff
path: root/pkgs/tools/misc/gringo/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/gringo/default.nix')
-rw-r--r--pkgs/tools/misc/gringo/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/tools/misc/gringo/default.nix b/pkgs/tools/misc/gringo/default.nix
new file mode 100644
index 000000000000..00879d9505b8
--- /dev/null
+++ b/pkgs/tools/misc/gringo/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl,
+  bison, re2c, scons
+}:
+
+let
+  version = "4.5.4";
+in
+
+stdenv.mkDerivation rec {
+  name = "gringo-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/potassco/gringo/${version}/gringo-${version}-source.tar.gz";
+    sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41";
+  };
+
+  buildInputs = [ bison re2c scons ];
+
+  patches = [
+    ./gringo-4.5.4-cmath.patch
+    ./gringo-4.5.4-to_string.patch
+  ];
+
+  buildPhase = ''
+    scons WITH_PYTHON= --build-dir=release
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp build/release/gringo $out/bin/gringo
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Converts input programs with first-order variables to equivalent ground programs";
+    homepage = http://potassco.sourceforge.net/;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.hakuch ];
+    license = licenses.gpl3Plus;
+  };
+}