2015-11-02 14:23:35 +00:00
|
|
|
{ stdenv, fetchurl, lib, file
|
|
|
|
, pkgconfig, intltool
|
2018-02-25 02:23:58 +00:00
|
|
|
, glib, dbus-glib, json-glib
|
2019-03-14 04:03:42 +00:00
|
|
|
, gobject-introspection, vala, gnome-doc-utils
|
2015-11-02 14:23:35 +00:00
|
|
|
, gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = let postfix = if gtkVersion == null then "glib" else "gtk${gtkVersion}";
|
|
|
|
in "libdbusmenu-${postfix}-${version}";
|
|
|
|
version = "${versionMajor}.${versionMinor}";
|
2017-12-07 11:50:57 +00:00
|
|
|
versionMajor = "16.04";
|
|
|
|
versionMinor = "0";
|
2015-11-02 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${meta.homepage}/${versionMajor}/${version}/+download/libdbusmenu-${version}.tar.gz";
|
2017-12-07 11:50:57 +00:00
|
|
|
sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
|
2015-11-02 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2019-03-14 04:03:42 +00:00
|
|
|
nativeBuildInputs = [ vala pkgconfig intltool ];
|
2015-11-02 14:23:35 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2018-02-25 02:23:58 +00:00
|
|
|
glib dbus-glib json-glib
|
2019-03-14 04:03:42 +00:00
|
|
|
gobject-introspection gnome-doc-utils
|
2015-11-02 14:23:35 +00:00
|
|
|
] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-08-02 16:48:33 +01:00
|
|
|
for f in {configure,ltmain.sh,m4/libtool.m4}; do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace /usr/bin/file ${file}/bin/file
|
|
|
|
done
|
2015-11-02 14:23:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libdbusmenu
|
|
|
|
preConfigure = ''
|
|
|
|
export HAVE_VALGRIND_TRUE="#"
|
|
|
|
export HAVE_VALGRIND_FALSE=""
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CFLAGS=-Wno-error"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
(if gtkVersion == null then "--disable-gtk" else "--with-gtk=${gtkVersion}")
|
|
|
|
"--disable-scrollkeeper"
|
|
|
|
] ++ optional (gtkVersion != "2") "--disable-dumper";
|
|
|
|
|
2018-08-08 19:38:03 +01:00
|
|
|
doCheck = false; # generates shebangs in check phase, too lazy to fix
|
|
|
|
|
2015-11-02 14:23:35 +00:00
|
|
|
installFlags = [
|
2019-03-14 04:03:42 +00:00
|
|
|
"sysconfdir=${placeholder ''out''}/etc"
|
2015-11-02 14:23:35 +00:00
|
|
|
"localstatedir=\${TMPDIR}"
|
2019-03-14 04:03:42 +00:00
|
|
|
"typelibdir=${placeholder ''out''}/lib/girepository-1.0"
|
2015-11-02 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2017-12-07 11:50:57 +00:00
|
|
|
description = "Library for passing menu structures across DBus";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://launchpad.net/dbusmenu;
|
2015-11-02 14:23:35 +00:00
|
|
|
license = with licenses; [ gpl3 lgpl21 lgpl3 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.msteen ];
|
|
|
|
};
|
|
|
|
}
|