Skip to content

Commit

Permalink
gringo: add darwin platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
winniequinn authored and vbgl committed Sep 12, 2017
1 parent 6844b13 commit a101328
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions pkgs/tools/misc/gringo/default.nix
@@ -1,5 +1,6 @@
{ stdenv, fetchurl,
bison, re2c, scons
bison, re2c, scons,
libcxx
}:

let
Expand All @@ -21,6 +22,23 @@ stdenv.mkDerivation rec {
./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 = ''
scons WITH_PYTHON= --build-dir=release
'';
Expand All @@ -33,7 +51,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "Converts input programs with first-order variables to equivalent ground programs";
homepage = http://potassco.sourceforge.net/;
platforms = platforms.linux;
platforms = platforms.all;
maintainers = [ maintainers.hakuch ];
license = licenses.gpl3Plus;
};
Expand Down

0 comments on commit a101328

Please sign in to comment.