From a1013287f3e0ab14802e864541ebf197a0f47447 Mon Sep 17 00:00:00 2001 From: Winnie Quinn Date: Mon, 11 Sep 2017 16:07:08 -0400 Subject: [PATCH] gringo: add darwin platform support --- pkgs/tools/misc/gringo/default.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/gringo/default.nix b/pkgs/tools/misc/gringo/default.nix index 00879d9505b8..76c60023c063 100644 --- a/pkgs/tools/misc/gringo/default.nix +++ b/pkgs/tools/misc/gringo/default.nix @@ -1,5 +1,6 @@ { stdenv, fetchurl, - bison, re2c, scons + bison, re2c, scons, + libcxx }: let @@ -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 ''; @@ -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; };