network-manager/l2tp: replace patch by substitutions to simplify upgrades

This commit is contained in:
obadz 2016-06-21 03:14:02 +01:00
parent 9191f09c05
commit b7731e446a
2 changed files with 17 additions and 44 deletions

View File

@ -1,26 +0,0 @@
diff --git a/src/nm-l2tp-service.c b/src/nm-l2tp-service.c
index d2c9dc4..e61d3d2 100644
--- a/src/nm-l2tp-service.c
+++ b/src/nm-l2tp-service.c
@@ -655,9 +655,7 @@ nm_find_ipsec (void)
{
static const char *ipsec_binary_paths[] =
{
- "/sbin/ipsec",
- "/usr/sbin/ipsec",
- "/usr/local/sbin/ipsec",
+ "@strongswan@/bin/ipsec",
NULL
};
@@ -677,9 +675,7 @@ nm_find_l2tpd (void)
{
static const char *l2tp_binary_paths[] =
{
- "/sbin/xl2tpd",
- "/usr/sbin/xl2tpd",
- "/usr/local/sbin/xl2tpd",
+ "@xl2tpd@/bin/xl2tpd",
NULL
};

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, substituteAll, automake, autoconf, libtool, intltool, pkgconfig
{ stdenv, fetchFromGitHub, automake, autoconf, libtool, intltool, pkgconfig
, networkmanager, ppp, xl2tpd, strongswan
, withGnome ? true, gnome3 }:
@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
version = "0.9.8.7";
src = fetchFromGitHub {
owner = "seriyps";
repo = "NetworkManager-l2tp";
rev = version;
owner = "seriyps";
repo = "NetworkManager-l2tp";
rev = version;
sha256 = "07gl562p3f6l2wn64f3vvz1ygp3hsfhiwh4sn04c3fahfdys69zx";
};
@ -19,30 +19,29 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ automake autoconf libtool intltool pkgconfig ];
configureScript = "./autogen.sh";
postPatch = ''
sed -i -e 's%"\(/usr/sbin\|/usr/pkg/sbin\|/usr/local/sbin\)/[^"]*",%%g' ./src/nm-l2tp-service.c
substituteInPlace ./src/nm-l2tp-service.c \
--replace /sbin/ipsec ${strongswan}/bin/ipsec \
--replace /sbin/xl2tpd ${xl2tpd}/bin/xl2tpd
# Workaround https://github.com/xelerance/xl2tpd/issues/108
substituteInPlace ./src/nm-l2tp-service.c --replace 'write_config_option (pppopt_fd, "lock\n");' ""
'';
preConfigure = "./autogen.sh";
configureFlags =
if withGnome then "--with-gnome" else "--without-gnome";
postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile";
patches =
[ ( substituteAll {
src = ./l2tp-purity.patch;
inherit xl2tpd strongswan;
})
];
# Workaround https://github.com/xelerance/xl2tpd/issues/108
postPatch = ''
substituteInPlace ./src/nm-l2tp-service.c --replace 'write_config_option (pppopt_fd, "lock\n");' ""
'';
meta = with stdenv.lib; {
description = "L2TP plugin for NetworkManager";
inherit (networkmanager.meta) platforms;
homepage = https://github.com/seriyps/NetworkManager-l2tp;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
maintainers = with maintainers; [ abbradar obadz ];
};
}