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