linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / libdbusmenu / default.nix
blob8e9fe4de88ae96cc1cd3fef65ee5f72032dd40dd
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 }:
7 with lib;
9 stdenv.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";
16   src = fetchurl {
17     url = "${meta.homepage}/${versionMajor}/${version}/+download/libdbusmenu-${version}.tar.gz";
18     sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
19   };
21   nativeBuildInputs = [ vala pkg-config intltool gobject-introspection ];
23   buildInputs = [
24     glib dbus-glib json-glib
25   ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
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   '';
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   '';
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";
48   doCheck = false; # generates shebangs in check phase, too lazy to fix
50   installFlags = [
51     "sysconfdir=${placeholder "out"}/etc"
52     "localstatedir=\${TMPDIR}"
53     "typelibdir=${placeholder "out"}/lib/girepository-1.0"
54   ];
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   };