bedops: fix build on darwin

This commit is contained in:
natsukium 2023-04-24 18:49:37 +09:00
parent 329f906775
commit 8d40a0ecaa
No known key found for this signature in database
GPG Key ID: 9EA45A31DB994C53

View File

@ -18,7 +18,20 @@ stdenv.mkDerivation rec {
# We use nixpkgs versions of these libraries
rm -r third-party
sed -i '/^LIBS/d' system.mk/*
sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile
sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile*
# `make support` installs above libraries
substituteInPlace system.mk/* \
--replace ": support" ":"
# Variable name is different in this makefile
substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
--replace "DIST_DIR" "BINDIR"
# `mkdir -p $BINDIR` is missing
substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
--replace 'mkdir -p ''${OBJ_DIR}' 'mkdir -p ''${OBJ_DIR} ''${BINDIR}'
substituteInPlace applications/bed/starch/src/Makefile --replace '$(LIBRARIES)' ""
# Function name is different in nixpkgs provided libraries
@ -27,7 +40,7 @@ stdenv.mkDerivation rec {
done
# Don't force static
for f in */*/*/*/Makefile ; do
for f in */*/*/*/Makefile* ; do
substituteInPlace $f --replace '-static' ""
done
'';
@ -46,6 +59,5 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Only;
maintainers = with maintainers; [ jbedo ];
platforms = platforms.x86_64;
broken = stdenv.isDarwin;
};
}