adns: clean‐ups and fixes (#355171)

authored by Emily and committed by GitHub 1d370645 da833f96

+52 -23
+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 +
+31 -23
pkgs/by-name/ad/adns/package.nix
··· 1 - { stdenv, lib, fetchurl, gnum4, gitUpdater }: 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + gnum4, 6 + autoreconfHook, 7 + gitUpdater, 8 + }: 2 9 3 - stdenv.mkDerivation rec { 10 + stdenv.mkDerivation (finalAttrs: { 4 11 pname = "adns"; 5 12 version = "1.6.1"; 6 13 7 14 src = fetchurl { 8 15 urls = [ 9 - "https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${version}.tar.gz" 10 - "mirror://gnu/adns/adns-${version}.tar.gz" 16 + "https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${finalAttrs.version}.tar.gz" 17 + "mirror://gnu/adns/adns-${finalAttrs.version}.tar.gz" 11 18 ]; 12 19 hash = "sha256-cTizeJt1Br1oP0UdT32FMHepGAO3s12G7GZ/D5zUAc0="; 13 20 }; 14 21 15 - nativeBuildInputs = [ gnum4 ]; 22 + patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ]; 23 + 24 + nativeBuildInputs = [ 25 + gnum4 26 + autoreconfHook 27 + ]; 16 28 17 29 configureFlags = lib.optional stdenv.hostPlatform.isStatic "--disable-dynamic"; 18 30 19 - preConfigure = 20 - lib.optionalString stdenv.hostPlatform.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure"; 21 - 22 - # Autogenerated headers miss interdependencies in Makefile, fail parallel build: 23 - # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51329 24 - enableParallelBuilding = false; 31 + enableParallelBuilding = true; 25 32 26 33 # https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details. 27 34 doCheck = false; 28 35 29 - postInstall = let suffix = lib.versions.majorMinor version; 30 - in lib.optionalString stdenv.hostPlatform.isDarwin '' 31 - install_name_tool -id $out/lib/libadns.so.${suffix} $out/lib/libadns.so.${suffix} 32 - ''; 36 + doInstallCheck = true; 33 37 34 - # darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib 35 - doInstallCheck = !stdenv.hostPlatform.isDarwin; 36 38 installCheckPhase = '' 37 - set -eo pipefail 39 + runHook preInstallCheck 38 40 39 41 for prog in $out/bin/*; do 40 42 $prog --help > /dev/null && echo $(basename $prog) shows usage 41 43 done 44 + 45 + runHook postInstallCheck 42 46 ''; 43 47 44 48 passthru.updateScript = gitUpdater { ··· 46 50 rev-prefix = "adns-"; 47 51 }; 48 52 49 - meta = with lib; { 53 + meta = { 50 54 homepage = "http://www.chiark.greenend.org.uk/~ian/adns/"; 51 - description = "Asynchronous DNS Resolver Library"; 52 - license = licenses.lgpl2; 55 + description = "Asynchronous DNS resolver library"; 56 + license = [ 57 + lib.licenses.gpl3Plus 53 58 54 - platforms = platforms.unix; 59 + # `adns.h` only 60 + lib.licenses.lgpl2Plus 61 + ]; 62 + platforms = lib.platforms.unix; 55 63 }; 56 - } 64 + })