adns: clean‐ups and fixes (#355171)
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'
|
||||
|
||||
@@ -1,44 +1,48 @@
|
||||
{ stdenv, lib, fetchurl, gnum4, gitUpdater }:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
gnum4,
|
||||
autoreconfHook,
|
||||
gitUpdater,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "adns";
|
||||
version = "1.6.1";
|
||||
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${version}.tar.gz"
|
||||
"mirror://gnu/adns/adns-${version}.tar.gz"
|
||||
"https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${finalAttrs.version}.tar.gz"
|
||||
"mirror://gnu/adns/adns-${finalAttrs.version}.tar.gz"
|
||||
];
|
||||
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";
|
||||
|
||||
preConfigure =
|
||||
lib.optionalString stdenv.hostPlatform.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure";
|
||||
|
||||
# Autogenerated headers miss interdependencies in Makefile, fail parallel build:
|
||||
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51329
|
||||
enableParallelBuilding = false;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details.
|
||||
doCheck = false;
|
||||
|
||||
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;
|
||||
|
||||
# darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib
|
||||
doInstallCheck = !stdenv.hostPlatform.isDarwin;
|
||||
installCheckPhase = ''
|
||||
set -eo pipefail
|
||||
runHook preInstallCheck
|
||||
|
||||
for prog in $out/bin/*; do
|
||||
$prog --help > /dev/null && echo $(basename $prog) shows usage
|
||||
done
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru.updateScript = gitUpdater {
|
||||
@@ -46,11 +50,15 @@ stdenv.mkDerivation rec {
|
||||
rev-prefix = "adns-";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
homepage = "http://www.chiark.greenend.org.uk/~ian/adns/";
|
||||
description = "Asynchronous DNS Resolver Library";
|
||||
license = licenses.lgpl2;
|
||||
description = "Asynchronous DNS resolver library";
|
||||
license = [
|
||||
lib.licenses.gpl3Plus
|
||||
|
||||
platforms = platforms.unix;
|
||||
# `adns.h` only
|
||||
lib.licenses.lgpl2Plus
|
||||
];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user