networkmanager-iodine: clean up

This commit is contained in:
Jan Tojnar 2018-08-09 16:52:41 +02:00
parent 3fa8a478e3
commit cb32ca2645
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 27 additions and 15 deletions

View File

@ -1,20 +1,26 @@
{ stdenv, fetchurl, iodine, intltool, pkgconfig, networkmanager, libsecret
{ stdenv, fetchurl, substituteAll, iodine, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3 }:
let
pname = "NetworkManager-iodine";
pname = "NetworkManager-iodine";
version = "1.2.0";
in stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "0njdigakidji6mfmbsp8lfi8wl88z1dk8cljbva2w0xazyddbwyh";
};
buildInputs = [ iodine networkmanager libsecret ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome-keyring
gnome3.networkmanagerapplet ];
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit iodine;
})
];
buildInputs = [ iodine networkmanager ]
++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret gnome3.networkmanagerapplet ];
nativeBuildInputs = [ intltool pkgconfig ];
@ -22,16 +28,10 @@ in stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
configureFlags = [
"${if withGnome then "--with-gnome" else "--without-gnome"}"
"--disable-static"
"--with-gnome=${if withGnome then "yes" else "no"}"
"--localstatedir=/" # needed for the management socket under /run/NetworkManager
];
preConfigure = ''
substituteInPlace "src/nm-iodine-service.c" \
--replace "/usr/bin/iodine" "${iodine}/bin/iodine"
'';
passthru = {
updateScript = gnome3.updateScript {
packageName = pname;
@ -39,8 +39,9 @@ in stdenv.mkDerivation rec {
};
};
meta = {
meta = with stdenv.lib; {
description = "NetworkManager's iodine plugin";
inherit (networkmanager.meta) maintainers platforms;
license = licenses.gpl2Plus;
};
}

View File

@ -0,0 +1,11 @@
--- a/src/nm-iodine-service.c
+++ b/src/nm-iodine-service.c
@@ -62,7 +62,7 @@
static const char *iodine_binary_paths[] =
{
- "/usr/bin/iodine",
+ "@iodine@/bin/iodine",
"/usr/sbin/iodine",
"/usr/local/bin/iodine",
"/usr/local/sbin/iodine",