Merge pull request #132811 from vlaci/fix-pyunbound

pythonPackages.pyunbound: 1.9.3 -> 1.13.1 and fix build

authored by Jörg Thalheim and committed by GitHub e4f36dc7 13f95ae8

+20 -12
+20 -12
pkgs/tools/networking/unbound/python.nix
··· 4 inherit (pythonPackages) python; 5 in stdenv.mkDerivation rec { 6 pname = "pyunbound"; 7 - version = "1.9.3"; 8 9 src = fetchurl { 10 url = "http://unbound.net/downloads/unbound-${version}.tar.gz"; 11 - sha256 = "1ykdy62sgzv33ggkmzwx2h0ifm7hyyxyfkb4zckv7gz4f28xsm8v"; 12 }; 13 14 - buildInputs = [ openssl expat libevent swig python ]; 15 16 - patchPhase = ''substituteInPlace Makefile.in \ 17 --replace "\$(DESTDIR)\$(PYTHON_SITE_PKG)" "$out/${python.sitePackages}" \ 18 --replace "\$(LIBTOOL) --mode=install cp _unbound.la" "cp _unbound.la" 19 - ''; 20 21 preConfigure = "export PYTHON_VERSION=${python.pythonVersion}"; 22 ··· 30 "--enable-pie" 31 "--enable-relro-now" 32 "--with-pyunbound" 33 - "DESTDIR=$out PREFIX=" 34 ]; 35 36 preInstall = '' 37 mkdir -p $out/${python.sitePackages} $out/etc/${pname} 38 cp .libs/_unbound.so .libs/libunbound.so* $out/${python.sitePackages} 39 substituteInPlace _unbound.la \ 40 - --replace "-L.libs $PWD/libunbound.la" "-L$out/${python.sitePackages}" \ 41 - --replace "libdir=\'$PWD/${python.sitePackages}\'" "libdir=\'$out/${python.sitePackages}\'" 42 ''; 43 44 - installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf pyunbound-install lib" ]; 45 46 # All we want is the Unbound Python module 47 postInstall = '' ··· 51 $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key 52 # We don't need anything else 53 rm -fR $out/bin $out/share $out/include $out/etc/unbound 54 - patchelf --replace-needed libunbound.so.2 $out/${python.sitePackages}/libunbound.so.2 $out/${python.sitePackages}/_unbound.so 55 - ''; 56 57 meta = with lib; { 58 description = "Python library for Unbound, the validating, recursive, and caching DNS resolver"; ··· 60 homepage = "http://www.unbound.net"; 61 maintainers = with maintainers; [ leenaars ]; 62 platforms = lib.platforms.unix; 63 - broken = true; 64 }; 65 }
··· 4 inherit (pythonPackages) python; 5 in stdenv.mkDerivation rec { 6 pname = "pyunbound"; 7 + version = "1.13.1"; 8 9 src = fetchurl { 10 url = "http://unbound.net/downloads/unbound-${version}.tar.gz"; 11 + sha256 = "sha256-hQTZe4/FvYlzRcldEW4O4N34yP+ZWQqytL0TJ4yfULg="; 12 }; 13 14 + nativeBuildInputs = [ swig ]; 15 16 + buildInputs = [ openssl expat libevent python ]; 17 + 18 + postPatch = ''substituteInPlace Makefile.in \ 19 --replace "\$(DESTDIR)\$(PYTHON_SITE_PKG)" "$out/${python.sitePackages}" \ 20 --replace "\$(LIBTOOL) --mode=install cp _unbound.la" "cp _unbound.la" 21 + ''; 22 23 preConfigure = "export PYTHON_VERSION=${python.pythonVersion}"; 24 ··· 32 "--enable-pie" 33 "--enable-relro-now" 34 "--with-pyunbound" 35 + "DESTDIR=$out" 36 + "PREFIX=" 37 ]; 38 39 preInstall = '' 40 mkdir -p $out/${python.sitePackages} $out/etc/${pname} 41 cp .libs/_unbound.so .libs/libunbound.so* $out/${python.sitePackages} 42 substituteInPlace _unbound.la \ 43 + --replace "-L.libs $PWD/libunbound.la" "-L$out/${python.sitePackages}" 44 ''; 45 46 + installFlags = [ 47 + "configfile=\${out}/etc/unbound/unbound.conf" 48 + "pyunbound-install" 49 + "lib" 50 + ]; 51 52 # All we want is the Unbound Python module 53 postInstall = '' ··· 57 $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key 58 # We don't need anything else 59 rm -fR $out/bin $out/share $out/include $out/etc/unbound 60 + '' 61 + # patchelf is only available on Linux and no patching is needed on darwin 62 + + lib.optionalString stdenv.isLinux '' 63 + patchelf --replace-needed libunbound.so.8 $out/${python.sitePackages}/libunbound.so.8 $out/${python.sitePackages}/_unbound.so 64 + ''; 65 66 meta = with lib; { 67 description = "Python library for Unbound, the validating, recursive, and caching DNS resolver"; ··· 69 homepage = "http://www.unbound.net"; 70 maintainers = with maintainers; [ leenaars ]; 71 platforms = lib.platforms.unix; 72 }; 73 }