openconnect: adapt vpnc-script for use in nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
c2e076a767
commit
6160d7374f
@ -8,7 +8,7 @@
|
|||||||
, libxml2
|
, libxml2
|
||||||
, stoken
|
, stoken
|
||||||
, zlib
|
, zlib
|
||||||
, fetchgit
|
, vpnc-scripts
|
||||||
, PCSC
|
, PCSC
|
||||||
, head ? false
|
, head ? false
|
||||||
, fetchFromGitLab
|
, fetchFromGitLab
|
||||||
@ -17,13 +17,7 @@
|
|||||||
|
|
||||||
assert (openssl != null) == (gnutls == null);
|
assert (openssl != null) == (gnutls == null);
|
||||||
|
|
||||||
let vpnc = fetchgit {
|
stdenv.mkDerivation rec {
|
||||||
url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git";
|
|
||||||
rev = "c0122e891f7e033f35f047dad963702199d5cb9e";
|
|
||||||
sha256 = "11b1ls012mb704jphqxjmqrfbbhkdjb64j2q4k8wb5jmja8jnd14";
|
|
||||||
};
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "openconnect${lib.optionalString head "-head"}";
|
pname = "openconnect${lib.optionalString head "-head"}";
|
||||||
version = if head then "2021-05-05" else "8.10";
|
version = if head then "2021-05-05" else "8.10";
|
||||||
|
|
||||||
@ -42,7 +36,7 @@ in stdenv.mkDerivation rec {
|
|||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-vpnc-script=${vpnc}/vpnc-script"
|
"--with-vpnc-script=${vpnc-scripts}/bin/vpnc-script"
|
||||||
"--disable-nls"
|
"--disable-nls"
|
||||||
"--without-openssl-version-check"
|
"--without-openssl-version-check"
|
||||||
];
|
];
|
||||||
|
40
pkgs/tools/networking/vpnc-scripts/default.nix
Normal file
40
pkgs/tools/networking/vpnc-scripts/default.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{ lib, stdenv, fetchgit
|
||||||
|
, makeWrapper
|
||||||
|
, nettools, gawk, openresolv, coreutils, gnugrep
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "vpnc-scripts";
|
||||||
|
version = "unstable-2020-02-21";
|
||||||
|
src = fetchgit {
|
||||||
|
url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git";
|
||||||
|
rev = "c0122e891f7e033f35f047dad963702199d5cb9e";
|
||||||
|
sha256 = "11b1ls012mb704jphqxjmqrfbbhkdjb64j2q4k8wb5jmja8jnd14";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp vpnc-script $out/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
preFixup = ''
|
||||||
|
substituteInPlace $out/bin/vpnc-script \
|
||||||
|
--replace "which" "type -P"
|
||||||
|
'' + lib.optionalString stdenv.isLinux ''
|
||||||
|
substituteInPlace $out/bin/vpnc-script \
|
||||||
|
--replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf"
|
||||||
|
'' + ''
|
||||||
|
wrapProgram $out/bin/vpnc-script \
|
||||||
|
--prefix PATH : "${lib.makeBinPath ([ nettools gawk coreutils gnugrep ] ++ lib.optionals stdenv.isLinux [ openresolv ])}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "script for vpnc to configure the network routing and name service";
|
||||||
|
homepage = "https://www.infradead.org/openconnect/";
|
||||||
|
license = licenses.gpl2Only;
|
||||||
|
maintainers = with maintainers; [ jerith666 ];
|
||||||
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
@ -9456,6 +9456,8 @@ in
|
|||||||
|
|
||||||
vpnc = callPackage ../tools/networking/vpnc { };
|
vpnc = callPackage ../tools/networking/vpnc { };
|
||||||
|
|
||||||
|
vpnc-scripts = callPackage ../tools/networking/vpnc-scripts { };
|
||||||
|
|
||||||
vpn-slice = python3Packages.callPackage ../tools/networking/vpn-slice { };
|
vpn-slice = python3Packages.callPackage ../tools/networking/vpn-slice { };
|
||||||
|
|
||||||
vp = callPackage ../applications/misc/vp {
|
vp = callPackage ../applications/misc/vp {
|
||||||
|
Loading…
Reference in New Issue
Block a user