nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchurl, lib, file
2, pkg-config, intltool
3, glib, dbus-glib, json-glib
4, gobject-introspection, vala
5, gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
6
7with lib;
8
9stdenv.mkDerivation rec {
10 pname = "libdbusmenu-${if gtkVersion == null then "glib" else "gtk${gtkVersion}"}";
11 version = "16.04.0";
12
13 src = fetchurl {
14 url = "https://launchpad.net/dbusmenu/${lib.versions.majorMinor version}/${version}/+download/libdbusmenu-${version}.tar.gz";
15 sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
16 };
17
18 nativeBuildInputs = [ vala pkg-config intltool gobject-introspection ];
19
20 buildInputs = [
21 glib dbus-glib json-glib
22 ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
23
24 postPatch = ''
25 for f in {configure,ltmain.sh,m4/libtool.m4}; do
26 substituteInPlace $f \
27 --replace /usr/bin/file ${file}/bin/file
28 done
29 '';
30
31 # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libdbusmenu
32 preConfigure = ''
33 export HAVE_VALGRIND_TRUE="#"
34 export HAVE_VALGRIND_FALSE=""
35 '';
36
37 configureFlags = [
38 "CFLAGS=-Wno-error"
39 "--sysconfdir=/etc"
40 "--localstatedir=/var"
41 (if gtkVersion == null then "--disable-gtk" else "--with-gtk=${gtkVersion}")
42 "--disable-scrollkeeper"
43 ] ++ optional (gtkVersion != "2") "--disable-dumper";
44
45 doCheck = false; # generates shebangs in check phase, too lazy to fix
46
47 installFlags = [
48 "sysconfdir=${placeholder "out"}/etc"
49 "localstatedir=\${TMPDIR}"
50 "typelibdir=${placeholder "out"}/lib/girepository-1.0"
51 ];
52
53 meta = {
54 description = "Library for passing menu structures across DBus";
55 homepage = "https://launchpad.net/dbusmenu";
56 license = with licenses; [ gpl3 lgpl21 lgpl3 ];
57 platforms = platforms.linux;
58 maintainers = [ maintainers.msteen ];
59 };
60}