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.

Emily 4f0ff90a e7e4bcc6

+29 -13
+21
pkgs/by-name/ad/adns/darwin.patch
··· 1 + diff --git a/configure.in b/configure.in 2 + index b753a5bb3e..ee7d546984 100644 3 + --- a/configure.in 4 + +++ b/configure.in 5 + @@ -134,12 +134,12 @@ 6 + AC_SUBST(SHLIBFILE) 7 + AC_SUBST(SHLIBSONAME) 8 + 9 + -SHLIBFORLINK='libadns.so' 10 + -SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)' 11 + -SHLIBFILE='$(SHLIBSONAME).$(MINOR)' 12 + +SHLIBFORLINK='libadns.dylib' 13 + +SHLIBSONAME='libadns.$(MAJOR).dylib' 14 + +SHLIBFILE='libadns.$(MAJOR).$(MINOR).dylib' 15 + 16 + SHLIBCC='$(CC) $(CFLAGS) -fpic' 17 + -MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o' 18 + +MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-install_name,$(libdir)/$(SHLIBFILE) -o' 19 + MKSHLIB_2='' 20 + MKSHLIB_3='-lc' 21 +
+8 -13
pkgs/by-name/ad/adns/package.nix
··· 3 3 stdenv, 4 4 fetchurl, 5 5 gnum4, 6 + autoreconfHook, 6 7 gitUpdater, 7 8 }: 8 9 ··· 18 19 hash = "sha256-cTizeJt1Br1oP0UdT32FMHepGAO3s12G7GZ/D5zUAc0="; 19 20 }; 20 21 21 - nativeBuildInputs = [ gnum4 ]; 22 + patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ]; 23 + 24 + nativeBuildInputs = [ 25 + gnum4 26 + autoreconfHook 27 + ]; 22 28 23 29 configureFlags = lib.optional stdenv.hostPlatform.isStatic "--disable-dynamic"; 24 30 ··· 27 33 # https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details. 28 34 doCheck = false; 29 35 30 - # darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib 31 - doInstallCheck = !stdenv.hostPlatform.isDarwin; 32 - 33 - preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure"; 34 - 35 - postInstall = 36 - let 37 - suffix = lib.versions.majorMinor version; 38 - in 39 - lib.optionalString stdenv.hostPlatform.isDarwin '' 40 - install_name_tool -id $out/lib/libadns.so.${suffix} $out/lib/libadns.so.${suffix} 41 - ''; 36 + doInstallCheck = true; 42 37 43 38 installCheckPhase = '' 44 39 runHook preInstallCheck