lol

openvpn: use update-systemd-resolved instead of vendoring it

+12 -17
+12 -17
pkgs/tools/networking/openvpn/default.nix
··· 1 - { lib, stdenv 1 + { lib 2 + , stdenv 2 3 , fetchurl 3 4 , pkg-config 4 - , makeWrapper 5 - , runtimeShell 6 5 , iproute2 7 6 , lzo 8 7 , openssl 9 8 , pam 10 9 , useSystemd ? stdenv.isLinux 11 10 , systemd 11 + , update-systemd-resolved 12 12 , util-linux 13 13 , pkcs11Support ? false 14 14 , pkcs11helper 15 15 }: 16 16 17 - with lib; 18 17 let 19 - # Check if the script needs to have other binaries wrapped when changing this. 20 - update-resolved = fetchurl { 21 - url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.3.0/update-systemd-resolved"; 22 - sha256 = "021qzv1k0zxgv1rmyfpqj3zlzqr28xa7zff1n7vrbjk36ijylpsc"; 23 - }; 18 + inherit (lib) versionOlder optional optionals optionalString; 24 19 25 20 generic = { version, sha256 }: 26 21 let ··· 36 31 inherit sha256; 37 32 }; 38 33 39 - nativeBuildInputs = [ makeWrapper pkg-config ]; 34 + nativeBuildInputs = [ pkg-config ]; 40 35 41 36 buildInputs = [ lzo openssl ] 42 37 ++ optional stdenv.isLinux pam ··· 52 47 ++ optional pkcs11Support "--enable-pkcs11" 53 48 ++ optional stdenv.isDarwin "--disable-plugin-auth-pam"; 54 49 50 + # We used to vendor the update-systemd-resolved script inside libexec, 51 + # but a separate package was made, that uses libexec/openvpn. Copy it 52 + # into libexec in case any consumers expect it to be there even though 53 + # they should use the update-systemd-resolved package instead. 55 54 postInstall = '' 56 55 mkdir -p $out/share/doc/openvpn/examples 57 - cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples 58 - cp -r sample/sample-keys/ $out/share/doc/openvpn/examples 59 - cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples 56 + cp -r sample/sample-{config-files,keys,scripts}/ $out/share/doc/openvpn/examples 60 57 '' + optionalString useSystemd '' 61 - install -Dm555 ${update-resolved} $out/libexec/update-systemd-resolved 62 - wrapProgram $out/libexec/update-systemd-resolved \ 63 - --prefix PATH : ${makeBinPath [ runtimeShell iproute2 systemd util-linux ]} 58 + install -Dm555 -t $out/libexec ${update-systemd-resolved}/libexec/openvpn/* 64 59 ''; 65 60 66 61 enableParallelBuilding = true; ··· 69 64 description = "A robust and highly flexible tunneling application"; 70 65 downloadPage = "https://openvpn.net/community-downloads/"; 71 66 homepage = "https://openvpn.net/"; 72 - license = licenses.gpl2; 67 + license = licenses.gpl2Only; 73 68 maintainers = with maintainers; [ viric peterhoeg ]; 74 69 platforms = platforms.unix; 75 70 };