adns: fix Darwin properly
The post‐facto install name replacement was unpredictably running out of space; just patch the build system to do the right thing instead. And don’t use `.so` on Darwin, either.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
diff --git a/configure.in b/configure.in
|
||||
index b753a5bb3e..ee7d546984 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -134,12 +134,12 @@
|
||||
AC_SUBST(SHLIBFILE)
|
||||
AC_SUBST(SHLIBSONAME)
|
||||
|
||||
-SHLIBFORLINK='libadns.so'
|
||||
-SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
|
||||
-SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
|
||||
+SHLIBFORLINK='libadns.dylib'
|
||||
+SHLIBSONAME='libadns.$(MAJOR).dylib'
|
||||
+SHLIBFILE='libadns.$(MAJOR).$(MINOR).dylib'
|
||||
|
||||
SHLIBCC='$(CC) $(CFLAGS) -fpic'
|
||||
-MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o'
|
||||
+MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-install_name,$(libdir)/$(SHLIBFILE) -o'
|
||||
MKSHLIB_2=''
|
||||
MKSHLIB_3='-lc'
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
fetchurl,
|
||||
gnum4,
|
||||
autoreconfHook,
|
||||
gitUpdater,
|
||||
}:
|
||||
|
||||
@@ -18,7 +19,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-cTizeJt1Br1oP0UdT32FMHepGAO3s12G7GZ/D5zUAc0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ gnum4 ];
|
||||
patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
gnum4
|
||||
autoreconfHook
|
||||
];
|
||||
|
||||
configureFlags = lib.optional stdenv.hostPlatform.isStatic "--disable-dynamic";
|
||||
|
||||
@@ -27,18 +33,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details.
|
||||
doCheck = false;
|
||||
|
||||
# darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib
|
||||
doInstallCheck = !stdenv.hostPlatform.isDarwin;
|
||||
|
||||
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure";
|
||||
|
||||
postInstall =
|
||||
let
|
||||
suffix = lib.versions.majorMinor version;
|
||||
in
|
||||
lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
install_name_tool -id $out/lib/libadns.so.${suffix} $out/lib/libadns.so.${suffix}
|
||||
'';
|
||||
doInstallCheck = true;
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
Reference in New Issue
Block a user