gringo: add darwin platform support

This commit is contained in:
Winnie Quinn 2017-09-11 16:07:08 -04:00 committed by vbgl
parent 6844b1375b
commit a1013287f3

View File

@ -1,5 +1,6 @@
{ stdenv, fetchurl, { stdenv, fetchurl,
bison, re2c, scons bison, re2c, scons,
libcxx
}: }:
let let
@ -21,6 +22,23 @@ stdenv.mkDerivation rec {
./gringo-4.5.4-to_string.patch ./gringo-4.5.4-to_string.patch
]; ];
patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
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']"
'';
buildPhase = '' buildPhase = ''
scons WITH_PYTHON= --build-dir=release scons WITH_PYTHON= --build-dir=release
''; '';
@ -33,7 +51,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Converts input programs with first-order variables to equivalent ground programs"; description = "Converts input programs with first-order variables to equivalent ground programs";
homepage = http://potassco.sourceforge.net/; homepage = http://potassco.sourceforge.net/;
platforms = platforms.linux; platforms = platforms.all;
maintainers = [ maintainers.hakuch ]; maintainers = [ maintainers.hakuch ];
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
}; };