2017-07-21 18:18:54 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, libtool, intltool, pkgconfig
|
2016-08-04 00:47:42 +02:00
|
|
|
, networkmanager, ppp, xl2tpd, strongswan, libsecret
|
|
|
|
, withGnome ? true, gnome3, networkmanagerapplet }:
|
2015-03-24 12:07:27 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-06-22 02:53:23 +02:00
|
|
|
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
|
|
|
|
pname = "NetworkManager-l2tp";
|
2017-11-11 00:31:23 +01:00
|
|
|
version = "1.2.8";
|
2015-03-24 12:07:27 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2016-06-22 02:53:23 +02:00
|
|
|
owner = "nm-l2tp";
|
|
|
|
repo = "network-manager-l2tp";
|
2017-04-04 14:46:17 +02:00
|
|
|
rev = "${version}";
|
2017-11-11 00:31:23 +01:00
|
|
|
sha256 = "110157dpamgr7r5kb8aidi0a2ap9z2m52bff94fb4nhxacz69yv8";
|
2015-03-24 12:07:27 +01:00
|
|
|
};
|
|
|
|
|
2016-08-04 00:47:42 +02:00
|
|
|
buildInputs = [ networkmanager ppp libsecret ]
|
2018-02-25 03:23:58 +01:00
|
|
|
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring networkmanagerapplet ];
|
2015-03-24 12:07:27 +01:00
|
|
|
|
2017-07-21 18:18:54 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook libtool intltool pkgconfig ];
|
2015-03-24 12:07:27 +01:00
|
|
|
|
2016-06-21 04:14:02 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's%"\(/usr/sbin\|/usr/pkg/sbin\|/usr/local/sbin\)/[^"]*",%%g' ./src/nm-l2tp-service.c
|
|
|
|
|
2017-10-31 12:08:05 +01:00
|
|
|
substituteInPlace ./Makefile.am \
|
|
|
|
--replace '$(sysconfdir)/dbus-1/system.d' "$out/etc/dbus-1/system.d"
|
|
|
|
|
2016-06-21 04:14:02 +02:00
|
|
|
substituteInPlace ./src/nm-l2tp-service.c \
|
|
|
|
--replace /sbin/ipsec ${strongswan}/bin/ipsec \
|
|
|
|
--replace /sbin/xl2tpd ${xl2tpd}/bin/xl2tpd
|
|
|
|
'';
|
|
|
|
|
2017-07-21 18:18:54 +02:00
|
|
|
preConfigure = ''
|
|
|
|
intltoolize -f
|
|
|
|
'';
|
2015-03-24 12:07:27 +01:00
|
|
|
|
2017-11-11 00:31:23 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-gnome=${if withGnome then "yes" else "no"}"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=$(out)/etc"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2015-03-24 12:07:27 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "L2TP plugin for NetworkManager";
|
|
|
|
inherit (networkmanager.meta) platforms;
|
2017-11-11 00:31:23 +01:00
|
|
|
homepage = https://github.com/nm-l2tp/network-manager-l2tp;
|
2015-03-24 12:07:27 +01:00
|
|
|
license = licenses.gpl2;
|
2016-06-21 04:14:02 +02:00
|
|
|
maintainers = with maintainers; [ abbradar obadz ];
|
2015-03-24 12:07:27 +01:00
|
|
|
};
|
|
|
|
}
|