2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl,
|
2020-07-18 00:30:28 +01:00
|
|
|
bison, re2c, sconsPackages,
|
2017-09-11 21:07:08 +01:00
|
|
|
libcxx
|
2016-11-12 12:26:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "4.5.4";
|
|
|
|
in
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "gringo";
|
|
|
|
inherit version;
|
2016-11-12 12:26:30 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/project/potassco/gringo/${version}/gringo-${version}-source.tar.gz";
|
|
|
|
sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41";
|
|
|
|
};
|
|
|
|
|
2020-07-18 00:30:28 +01:00
|
|
|
buildInputs = [ bison re2c sconsPackages.scons_3_1_2 ];
|
2016-11-12 12:26:30 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./gringo-4.5.4-cmath.patch
|
|
|
|
./gringo-4.5.4-to_string.patch
|
|
|
|
];
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
2017-09-11 21:07:08 +01:00
|
|
|
substituteInPlace ./SConstruct \
|
|
|
|
--replace \
|
|
|
|
"env['CXX'] = 'g++'" \
|
|
|
|
"env['CXX'] = '$CXX'"
|
|
|
|
|
|
|
|
substituteInPlace ./SConstruct \
|
|
|
|
--replace \
|
|
|
|
"env['CPPPATH'] = []" \
|
|
|
|
"env['CPPPATH'] = ['${libcxx}/include/c++/v1']"
|
|
|
|
|
|
|
|
substituteInPlace ./SConstruct \
|
|
|
|
--replace \
|
|
|
|
"env['LIBPATH'] = []" \
|
|
|
|
"env['LIBPATH'] = ['${libcxx}/lib']"
|
|
|
|
'';
|
|
|
|
|
2016-11-12 12:26:30 +00:00
|
|
|
buildPhase = ''
|
|
|
|
scons WITH_PYTHON= --build-dir=release
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp build/release/gringo $out/bin/gringo
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-11-12 12:26:30 +00:00
|
|
|
description = "Converts input programs with first-order variables to equivalent ground programs";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://potassco.sourceforge.net/";
|
2017-09-11 21:07:08 +01:00
|
|
|
platforms = platforms.all;
|
2016-11-12 12:26:30 +00:00
|
|
|
maintainers = [ maintainers.hakuch ];
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|