3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix

63 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, lib, file
, pkgconfig, intltool
, glib, dbus-glib, json-glib
, gobjectIntrospection, vala_0_38, gnome-doc-utils
, 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";
src = fetchurl {
url = "${meta.homepage}/${versionMajor}/${version}/+download/libdbusmenu-${version}.tar.gz";
2017-12-07 11:50:57 +00:00
sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
};
nativeBuildInputs = [ pkgconfig intltool ];
buildInputs = [
glib dbus-glib json-glib
gobjectIntrospection vala_0_38 gnome-doc-utils
] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
postPatch = ''
for f in {configure,ltmain.sh,m4/libtool.m4}; do
substituteInPlace $f \
--replace /usr/bin/file ${file}/bin/file
done
'';
# 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";
installFlags = [
"sysconfdir=\${out}/etc"
"localstatedir=\${TMPDIR}"
2017-12-07 11:50:57 +00:00
"typelibdir=\${out}/lib/girepository-1.0"
];
meta = {
2017-12-07 11:50:57 +00:00
description = "Library for passing menu structures across DBus";
homepage = https://launchpad.net/dbusmenu;
license = with licenses; [ gpl3 lgpl21 lgpl3 ];
platforms = platforms.linux;
maintainers = [ maintainers.msteen ];
};
}