1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 07:31:20 +00:00

boolector: patch usage of ar and ranlib for cross

eep.
This commit is contained in:
Will Dietz 2018-02-05 13:28:14 -06:00
parent 9138d055bf
commit 46cbded0de

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { stdenv, fetchurl, writeShellScriptBin }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "boolector-${version}"; name = "boolector-${version}";
@ -8,8 +8,22 @@ stdenv.mkDerivation rec {
sha256 = "0mdf7hwix237pvknvrpazcx6s3ininj5k7vhysqjqgxa7lxgq045"; sha256 = "0mdf7hwix237pvknvrpazcx6s3ininj5k7vhysqjqgxa7lxgq045";
}; };
prePatch = '' prePatch =
sed -i -e 's@mv lingeling\* lingeling@\0 \&\& sed -i -e "1i#include <stdint.h>" lingeling/lglib.h@' makefile let
lingelingPatch = writeShellScriptBin "lingeling-patch" ''
sed -i -e "1i#include <stdint.h>" 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 = '' installPhase = ''