1 { stdenv, fetchurl, lib, file
3 , glib, dbus-glib, json-glib
4 , gobject-introspection, vala
5 , gtkVersion ? null, gtk2, gtk3
9 stdenv.mkDerivation (finalAttrs: {
10 pname = "libdbusmenu-${if gtkVersion == null then "glib" else "gtk${gtkVersion}"}";
14 inherit (finalAttrs) version;
16 url = "https://launchpad.net/dbusmenu/${lib.versions.majorMinor version}/${version}/+download/libdbusmenu-${version}.tar.gz";
17 sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
20 nativeBuildInputs = [ vala pkg-config intltool gobject-introspection ];
23 glib dbus-glib json-glib
24 ] ++ lib.optional (gtkVersion != null)
28 }.${gtkVersion} or (throw "unknown GTK version ${gtkVersion}");
35 for f in {configure,ltmain.sh,m4/libtool.m4}; do
36 substituteInPlace $f \
37 --replace /usr/bin/file ${file}/bin/file
41 # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libdbusmenu
43 export HAVE_VALGRIND_TRUE="#"
44 export HAVE_VALGRIND_FALSE=""
50 "--localstatedir=/var"
51 # TODO use `lib.withFeatureAs`
52 (if gtkVersion == null then "--disable-gtk" else "--with-gtk=${gtkVersion}")
53 "--disable-scrollkeeper"
54 ] ++ lib.optional (gtkVersion != "2") "--disable-dumper";
56 doCheck = false; # generates shebangs in check phase, too lazy to fix
59 "sysconfdir=${placeholder "out"}/etc"
60 "localstatedir=\${TMPDIR}"
61 "typelibdir=${placeholder "out"}/lib/girepository-1.0"
64 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
67 description = "Library for passing menu structures across DBus";
68 homepage = "https://launchpad.net/dbusmenu";
69 license = with licenses; [ gpl3 lgpl21 lgpl3 ];
72 "dbusmenu-jsonloader-0.4"
73 ] ++ lib.optional (gtkVersion == "3") "dbusmenu-gtk${gtkVersion}-0.4";
74 platforms = platforms.linux;
75 maintainers = [ maintainers.msteen ];