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

48 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, automake, autoconf, libtool, intltool, pkgconfig
2015-03-24 12:07:27 +01:00
, networkmanager, ppp, xl2tpd, strongswan
, withGnome ? true, gnome3 }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
pname = "NetworkManager-l2tp";
version = "0.9.8.7";
src = fetchFromGitHub {
owner = "seriyps";
repo = "NetworkManager-l2tp";
rev = version;
2015-03-24 12:07:27 +01:00
sha256 = "07gl562p3f6l2wn64f3vvz1ygp3hsfhiwh4sn04c3fahfdys69zx";
};
buildInputs = [ networkmanager ppp ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome_keyring ];
nativeBuildInputs = [ automake autoconf libtool intltool pkgconfig ];
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";
2015-03-24 12:07:27 +01:00
configureFlags =
if withGnome then "--with-gnome" else "--without-gnome";
postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile";
meta = with stdenv.lib; {
description = "L2TP plugin for NetworkManager";
inherit (networkmanager.meta) platforms;
2015-05-18 16:07:03 +02:00
homepage = https://github.com/seriyps/NetworkManager-l2tp;
2015-03-24 12:07:27 +01:00
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar obadz ];
2015-03-24 12:07:27 +01:00
};
}