diff --git a/pkgs/by-name/ep/eprover/fix-cross-toolchains.patch b/pkgs/by-name/ep/eprover/fix-cross-toolchains.patch new file mode 100644 index 000000000000..b2e316fcd665 --- /dev/null +++ b/pkgs/by-name/ep/eprover/fix-cross-toolchains.patch @@ -0,0 +1,25 @@ +--- a/CONTRIB/picosat-965/makefile.in ++++ b/CONTRIB/picosat-965/makefile.in +@@ -49,8 +49,7 @@ config.h: makefile VERSION mkconfig.sh # and actually picosat.c + rm -f $@; ./mkconfig.sh > $@ + + libpicosat.a: picosat.o version.o +- ar rc $@ picosat.o version.o +- ranlib $@ ++ $(AR) $@ picosat.o version.o + + SONAME=-Xlinker -soname -Xlinker libpicosat.so + libpicosat.so: picosat.o version.o +--- a/Makefile.vars ++++ b/Makefile.vars +@@ -160,8 +160,8 @@ LD = $(CC) $(LDFLAGS) + + # Generic + # AR = sleep 1;ar rcs +- AR = ar rcs +- CC = gcc ++# AR = ar rcs ++# CC = gcc + + # Builds with link time optimization + # diff --git a/pkgs/by-name/ep/eprover/package.nix b/pkgs/by-name/ep/eprover/package.nix index e9153ef2ddae..8beb6a794c8d 100644 --- a/pkgs/by-name/ep/eprover/package.nix +++ b/pkgs/by-name/ep/eprover/package.nix @@ -17,9 +17,11 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ which ]; - preConfigure = '' - sed -e 's/ *CC *= *gcc$//' -i Makefile.vars - ''; + patches = [ + ./fix-cross-toolchains.patch + ]; + + configurePlatforms = [ ]; configureFlags = [ "--exec-prefix=$(out)" @@ -29,6 +31,14 @@ stdenv.mkDerivation (finalAttrs: { "--enable-ho" ]; + # need to directly insert into makeFlagsArray as the makefile expects the binary + # in the AR variable to already be passed the `rcs` flags, which requires us to + # specify them. As this requires spaces, we need makeFlagsArray, as makeFlags + # will just make the make script see the `rcs` as a target + preBuild = '' + makeFlagsArray+=(CC="${stdenv.cc.targetPrefix}cc" AR="${stdenv.cc.targetPrefix}ar rcs") + ''; + meta = { description = "Automated theorem prover for full first-order logic with equality"; homepage = "http://www.eprover.org/";