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