@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fetchpatch, pkgconfig
1+{ stdenv, fetchurl, fetchpatch, pkgconfig, makeWrapper
22, iproute, lzo, openssl, pam
33, useSystemd ? stdenv.isLinux, systemd ? null, utillinux ? null
44, pkcs11Support ? false, pkcs11helper ? null,
@@ -10,11 +10,10 @@ assert pkcs11Support -> (pkcs11helper != null);
1010with stdenv.lib;
1111
1212let
13− # There is some fairly brittle string substitutions going on to replace paths,
14− # so please verify this script in case you are upgrading it
13+ # Check if the script needs to have other binaries wrapped when changing this.
1514 update-resolved = fetchurl {
16− url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.2.7/update-systemd-resolved";
17− sha256 = "12zfzh42apwbj7ks5kfxf3far7kaghlby4yapbhn00q8pbdlw7pq";
15+ url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.3.0/update-systemd-resolved";
16+ sha256 = "021qzv1k0zxgv1rmyfpqj3zlzqr28xa7zff1n7vrbjk36ijylpsc";
1817 };
1918
2019in stdenv.mkDerivation rec {
@@ -26,7 +25,7 @@ in stdenv.mkDerivation rec {
2625 sha256 = "1qpbllwlha7cffsd5dlddb8rl22g9rar5zflkz1wrcllhvfkl7v4";
2726 };
2827
29− nativeBuildInputs = [ pkgconfig ];
28+ nativeBuildInputs = [ makeWrapper pkgconfig ];
3029
3130 buildInputs = [ lzo openssl ]
3231 ++ optionals stdenv.isLinux [ pam iproute ]
@@ -45,16 +44,10 @@ in stdenv.mkDerivation rec {
4544 cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples
4645 cp -r sample/sample-keys/ $out/share/doc/openvpn/examples
4746 cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples
48−
49− ${optionalString useSystemd ''
50− install -Dm755 ${update-resolved} $out/libexec/update-systemd-resolved
51−
52− substituteInPlace $out/libexec/update-systemd-resolved \
53− --replace '/usr/bin/env bash' '${stdenv.shell} -e' \
54− --replace 'busctl call' '${getBin systemd}/bin/busctl call' \
55− --replace '(ip ' '(${getBin iproute}/bin/ip ' \
56− --replace 'logger ' '${getBin utillinux}/bin/logger '
57− ''}
47+ '' + optionalString useSystemd ''
48+ install -Dm555 ${update-resolved} $out/libexec/update-systemd-resolved
49+ wrapProgram $out/libexec/update-systemd-resolved \
50+ --prefix PATH : ${makeBinPath [ stdenv.shell iproute systemd utillinux ]}
5851 '';
5952
6053 enableParallelBuilding = true;