Merge pull request #186216 from viraptor/udns-darwin

udns: fix darwin build
This commit is contained in:
Jörg Thalheim 2022-08-12 10:15:04 +01:00 committed by GitHub
commit 4860ff19f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,20 @@ stdenv.mkDerivation rec {
sha256 = "0447fv1hmb44nnchdn6p5pd9b44x8p5jn0ahw6crwbqsg7f0hl8i";
};
# udns uses a very custom build and hardcodes a .so name in a few places.
# Instead of fighting with it to apply the standard dylib script, change
# the right place in the Makefile itself.
postPatch =
if stdenv.isDarwin
then
''
substituteInPlace Makefile.in \
--replace --soname, -install_name,$out/lib/
''
else "";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/include
mkdir -p $out/lib
@ -30,6 +43,7 @@ stdenv.mkDerivation rec {
ln -rs $out/lib/libudns.so.0 $out/lib/libudns.so
cp dnsget.1 rblcheck.1 $out/share/man/man1
cp udns.3 $out/share/man/man3
runHook postInstall
'';
# keep man3
@ -40,7 +54,7 @@ stdenv.mkDerivation rec {
description = "Async-capable DNS stub resolver library";
license = licenses.lgpl21Plus;
maintainers = [ maintainers.womfoo ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}