Merge pull request #180386 from sikmir/foma

foma: fix cross-compilation
This commit is contained in:
Rick van Schijndel 2022-07-07 08:29:41 +02:00 committed by GitHub
commit 1087022693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,20 +11,23 @@ stdenv.mkDerivation rec {
sha256 = "1vf01l18j8cksnavbabcckp9gg692w6v5lg81xrzv6f5v14zp4nr";
};
sourceRoot = "source/foma";
sourceRoot = "${src.name}/foma";
nativeBuildInputs = [ flex bison ]
++ lib.optional stdenv.isDarwin darwin.cctools;
buildInputs = [ zlib readline ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"CC:=$(CC)"
"RANLIB:=$(RANLIB)"
"prefix=$(out)"
] ++ lib.optionals (!stdenv.isDarwin) [
"AR:=$(AR)" # libtool is used for darwin
];
patchPhase = ''
substituteInPlace Makefile \
--replace '-ltermcap' ' ' \
--replace '/usr/local' '$(out)'
--replace '-ltermcap' ' '
'';
meta = with lib; {