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