nixpkgs/pkgs/tools/networking/network-manager/pptp.nix

36 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig
2015-04-08 16:45:41 +01:00
, libsecret, withGnome ? true, gnome3 }:
stdenv.mkDerivation rec {
2016-06-22 02:03:11 +01:00
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-pptp";
2015-04-08 16:45:41 +01:00
version = networkmanager.version;
src = fetchurl {
2016-06-22 02:03:11 +01:00
url = "mirror://gnome/sources/${pname}/${networkmanager.major}/${pname}-${version}.tar.xz";
sha256 = "a72cb88ecc0a9edec836e8042c592d68b8b290c0d78082e6b25cf08b46c6be5d";
};
2015-04-08 16:45:41 +01:00
buildInputs = [ networkmanager pptp ppp libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome_keyring
gnome3.networkmanagerapplet ];
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";
meta = {
description = "PPtP plugin for NetworkManager";
inherit (networkmanager.meta) maintainers platforms;
};
}