Merge pull request #227939 from natsukium/bedops/darwin

bedops: fix build on darwin
This commit is contained in:
Weijia Wang 2023-04-26 01:14:58 +03:00 committed by GitHub
commit df05dd61c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
};
}