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

This commit is contained in:
obadz 2016-06-22 01:59:52 +01:00
parent b07051ce6c
commit 9191f09c05
2 changed files with 9 additions and 34 deletions

@ -1,26 +0,0 @@
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index 68a5759..568bbfe 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -730,9 +730,7 @@ nm_find_pppd (void)
{
static const char *pppd_binary_paths[] =
{
- "/sbin/pppd",
- "/usr/sbin/pppd",
- "/usr/local/sbin/pppd",
+ "@ppp@/sbin/pppd",
NULL
};
@@ -752,9 +750,7 @@ nm_find_pptp (void)
{
static const char *pptp_binary_paths[] =
{
- "/sbin/pptp",
- "/usr/sbin/pptp",
- "/usr/local/sbin/pptp",
+ "@pptp@/sbin/pptp",
NULL
};

@ -1,4 +1,4 @@
{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig, substituteAll
{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig
, libsecret, withGnome ? true, gnome3 }:
stdenv.mkDerivation rec {
@ -17,18 +17,19 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ intltool pkgconfig ];
postPatch = ''
sed -i -e 's%"\(/usr/sbin\|/usr/pkg/sbin\|/usr/local/sbin\)/[^"]*",%%g' ./src/nm-pptp-service.c
substituteInPlace ./src/nm-pptp-service.c \
--replace /sbin/pptp ${pptp}/bin/pptp \
--replace /sbin/pppd ${ppp}/bin/pppd
'';
configureFlags =
if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome";
postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile";
patches =
[ ( substituteAll {
src = ./pptp-purity.patch;
inherit ppp pptp;
})
];
meta = {
description = "PPtP plugin for NetworkManager";
inherit (networkmanager.meta) maintainers platforms;