Merge pull request #88498 from peterhoeg/master

openvpn: update and wrap update-systemd-resolved
This commit is contained in:
Peter Hoeg 2020-05-22 08:56:21 +08:00 committed by GitHub
commit 92ec704a5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig { stdenv, fetchurl, fetchpatch, pkgconfig, makeWrapper
, iproute, lzo, openssl, pam , iproute, lzo, openssl, pam
, useSystemd ? stdenv.isLinux, systemd ? null, utillinux ? null , useSystemd ? stdenv.isLinux, systemd ? null, utillinux ? null
, pkcs11Support ? false, pkcs11helper ? null, , pkcs11Support ? false, pkcs11helper ? null,
@ -10,11 +10,10 @@ assert pkcs11Support -> (pkcs11helper != null);
with stdenv.lib; with stdenv.lib;
let let
# There is some fairly brittle string substitutions going on to replace paths, # Check if the script needs to have other binaries wrapped when changing this.
# so please verify this script in case you are upgrading it
update-resolved = fetchurl { update-resolved = fetchurl {
url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.2.7/update-systemd-resolved"; url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.3.0/update-systemd-resolved";
sha256 = "12zfzh42apwbj7ks5kfxf3far7kaghlby4yapbhn00q8pbdlw7pq"; sha256 = "021qzv1k0zxgv1rmyfpqj3zlzqr28xa7zff1n7vrbjk36ijylpsc";
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
@ -26,7 +25,7 @@ in stdenv.mkDerivation rec {
sha256 = "1qpbllwlha7cffsd5dlddb8rl22g9rar5zflkz1wrcllhvfkl7v4"; sha256 = "1qpbllwlha7cffsd5dlddb8rl22g9rar5zflkz1wrcllhvfkl7v4";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ makeWrapper pkgconfig ];
buildInputs = [ lzo openssl ] buildInputs = [ lzo openssl ]
++ optionals stdenv.isLinux [ pam iproute ] ++ optionals stdenv.isLinux [ pam iproute ]
@ -45,16 +44,10 @@ in stdenv.mkDerivation rec {
cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples
cp -r sample/sample-keys/ $out/share/doc/openvpn/examples cp -r sample/sample-keys/ $out/share/doc/openvpn/examples
cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples
'' + optionalString useSystemd ''
${optionalString useSystemd '' install -Dm555 ${update-resolved} $out/libexec/update-systemd-resolved
install -Dm755 ${update-resolved} $out/libexec/update-systemd-resolved wrapProgram $out/libexec/update-systemd-resolved \
--prefix PATH : ${makeBinPath [ stdenv.shell iproute systemd utillinux ]}
substituteInPlace $out/libexec/update-systemd-resolved \
--replace '/usr/bin/env bash' '${stdenv.shell} -e' \
--replace 'busctl call' '${getBin systemd}/bin/busctl call' \
--replace '(ip ' '(${getBin iproute}/bin/ip ' \
--replace 'logger ' '${getBin utillinux}/bin/logger '
''}
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;