1 { lib, stdenv, fetchurl,
2 bison, re2c, sconsPackages,
6 stdenv.mkDerivation rec {
11 url = "mirror://sourceforge/project/potassco/gringo/${version}/gringo-${version}-source.tar.gz";
12 sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41";
15 buildInputs = [ bison re2c sconsPackages.scons_3_1_2 ];
18 ./gringo-4.5.4-cmath.patch
19 ./gringo-4.5.4-to_string.patch
22 postPatch = lib.optionalString stdenv.isDarwin ''
23 substituteInPlace ./SConstruct \
25 "env['CXX'] = 'g++'" \
28 substituteInPlace ./SConstruct \
30 "env['CPPPATH'] = []" \
31 "env['CPPPATH'] = ['${lib.getDev libcxx}/include/c++/v1']"
33 substituteInPlace ./SConstruct \
35 "env['LIBPATH'] = []" \
36 "env['LIBPATH'] = ['${lib.getLib libcxx}/lib', '${lib.getLib libcxxabi}/lib']"
38 sed '1i#include <limits>' -i libgringo/gringo/{control,term}.hh
42 scons WITH_PYTHON= --build-dir=release
47 cp build/release/gringo $out/bin/gringo
51 description = "Converts input programs with first-order variables to equivalent ground programs";
52 homepage = "http://potassco.sourceforge.net/";
53 platforms = platforms.all;
54 maintainers = [ maintainers.hakuch ];
55 license = licenses.gpl3Plus;