From 873996595cc920b561e27823e53f5eae240917d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Tue, 11 May 2021 20:56:43 +0200 Subject: [PATCH] acl2: fix darwin build --- .../acl2/libipasirglucose4/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix index b9a61b88a30..5c10c176c14 100644 --- a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix +++ b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix @@ -1,6 +1,11 @@ { lib, stdenv, fetchurl, zlib, unzip }: -stdenv.mkDerivation rec { +let + + cxx = "${stdenv.cc.targetPrefix}c++"; + libName = "libipasirglucose4" + stdenv.targetPlatform.extensions.sharedLibrary; + +in stdenv.mkDerivation rec { pname = "libipasirglucose4"; # This library has no version number AFAICT (beyond generally being based on # Glucose 4.x), but it was submitted to the 2017 SAT competition so let's use @@ -18,13 +23,16 @@ stdenv.mkDerivation rec { sourceRoot = "sat/glucose4"; patches = [ ./0001-Support-shared-library-build.patch ]; + makeFlags = [ "CXX=${cxx}" ]; + postBuild = '' - g++ -shared -Wl,-soname,libipasirglucose4.so -o libipasirglucose4.so \ + ${cxx} -shared -o ${libName} \ + ${if stdenv.cc.isClang then "" else "-Wl,-soname,${libName}"} \ ipasirglucoseglue.o libipasirglucose4.a ''; installPhase = '' - install -D libipasirglucose4.so $out/lib/libipasirglucose4.so + install -D ${libName} $out/lib/${libName} ''; meta = with lib; {