nixpkgs/pkgs/tools/misc/gringo/default.nix

56 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl,
bison, re2c, sconsPackages,
2017-09-11 20:07:08 +00:00
libcxx
}:
2021-07-14 15:10:11 +00:00
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "gringo";
2021-07-14 15:10:11 +00:00
version = "4.5.4";
src = fetchurl {
url = "mirror://sourceforge/project/potassco/gringo/${version}/gringo-${version}-source.tar.gz";
sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41";
};
buildInputs = [ bison re2c sconsPackages.scons_3_1_2 ];
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 20:07:08 +00:00
substituteInPlace ./SConstruct \
--replace \
"env['CXX'] = 'g++'" \
"env['CXX'] = '$CXX'"
substituteInPlace ./SConstruct \
--replace \
"env['CPPPATH'] = []" \
"env['CPPPATH'] = ['${lib.getDev libcxx}/include/c++/v1']"
2017-09-11 20:07:08 +00:00
substituteInPlace ./SConstruct \
--replace \
"env['LIBPATH'] = []" \
"env['LIBPATH'] = ['${lib.getLib libcxx}/lib']"
2017-09-11 20:07:08 +00:00
'';
buildPhase = ''
scons WITH_PYTHON= --build-dir=release
'';
installPhase = ''
mkdir -p $out/bin
cp build/release/gringo $out/bin/gringo
'';
meta = with lib; {
description = "Converts input programs with first-order variables to equivalent ground programs";
homepage = "http://potassco.sourceforge.net/";
2017-09-11 20:07:08 +00:00
platforms = platforms.all;
maintainers = [ maintainers.hakuch ];
license = licenses.gpl3Plus;
};
}