@@ -1,35 +1,32 @@
1−{ stdenv, fetchurl, vpnc, intltool, pkgconfig, networkmanager, libsecret
2−, withGnome ? true, gnome3, procps, kmod, file }:
1+{ stdenv, fetchurl, substituteAll, vpnc, intltool, pkgconfig, networkmanager, libsecret
2+, withGnome ? true, gnome3, kmod, file }:
33let
4− pname = "NetworkManager-vpnc";
4+ pname = "NetworkManager-vpnc";
55 version = "1.2.6";
66in stdenv.mkDerivation rec {
7− name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
7+ name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
88
99 src = fetchurl {
10− url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
10+ url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
1111 sha256 = "1js5lwcsqws4klgypfxl4ikmakv7v7xgddij1fj6b0y0qicx0kyy";
1212 };
1313
14− buildInputs = [ vpnc networkmanager libsecret ]
15− ++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring
16− gnome3.networkmanagerapplet ];
14+ patches = [
15+ (substituteAll {
16+ src = ./fix-paths.patch;
17+ inherit vpnc kmod;
18+ })
19+ ];
20+
21+ buildInputs = [ vpnc networkmanager ]
22+ ++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret gnome3.networkmanagerapplet ];
1723
1824 nativeBuildInputs = [ intltool pkgconfig file ];
1925
2026 configureFlags = [
21− "${if withGnome then "--with-gnome --with-gtkver=3" else "--without-gnome"}"
22− "--disable-static"
27+ "--with-gnome=${if withGnome then "yes" else "no"}"
2328 ];
2429
25− preConfigure = ''
26− substituteInPlace "configure" \
27− --replace "/sbin/sysctl" "${procps}/bin/sysctl"
28− substituteInPlace "src/nm-vpnc-service.c" \
29− --replace "/sbin/vpnc" "${vpnc}/bin/vpnc" \
30− --replace "/sbin/modprobe" "${kmod}/bin/modprobe"
31− '';
32−
3330 passthru = {
3431 updateScript = gnome3.updateScript {
3532 packageName = pname;
@@ -37,9 +34,9 @@ in stdenv.mkDerivation rec {
3734 };
3835 };
3936
40− meta = {
37+ meta = with stdenv.lib; {
4138 description = "NetworkManager's VPNC plugin";
4239 inherit (networkmanager.meta) maintainers platforms;
40+ license = licenses.gpl2Plus;
4341 };
4442}
45−