diff --git a/pkgs/applications/science/logic/boolector/default.nix b/pkgs/applications/science/logic/boolector/default.nix index 9e40d0ce5f10..aa815e48db41 100644 --- a/pkgs/applications/science/logic/boolector/default.nix +++ b/pkgs/applications/science/logic/boolector/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, writeShellScriptBin }: stdenv.mkDerivation rec { name = "boolector-${version}"; @@ -8,8 +8,22 @@ stdenv.mkDerivation rec { sha256 = "0mdf7hwix237pvknvrpazcx6s3ininj5k7vhysqjqgxa7lxgq045"; }; - prePatch = '' - sed -i -e 's@mv lingeling\* lingeling@\0 \&\& sed -i -e "1i#include " lingeling/lglib.h@' makefile + prePatch = + let + lingelingPatch = writeShellScriptBin "lingeling-patch" '' + sed -i -e "1i#include " lingeling/lglib.h + + ${crossFix}/bin/crossFix lingeling + ''; + crossFix = writeShellScriptBin "crossFix" '' + # substituteInPlace not available here + sed -i $1/makefile.in \ + -e 's@ar rc@$(AR) rc@' \ + -e 's@ranlib@$(RANLIB)@' + ''; + in '' + sed -i -e 's@mv lingeling\* lingeling@\0 \&\& ${lingelingPatch}/bin/lingeling-patch@' makefile + sed -i -e 's@mv boolector\* boolector@\0 \&\& ${crossFix}/bin/crossFix boolector@' makefile ''; installPhase = ''