nixpkgs/pkgs/development/libraries/libhandy/default.nix

121 lines
2.6 KiB
Nix
Raw Normal View History

2021-04-13 19:19:46 +00:00
{ lib
, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gobject-introspection
, vala
, gtk-doc
2021-04-13 19:19:46 +00:00
, docbook-xsl-nons
, docbook_xml_dtd_43
, gtk3
, enableGlade ? false
, glade
, dbus
2021-05-08 13:45:03 +00:00
, xvfb-run
, libxml2
, gdk-pixbuf
, librsvg
, hicolor-icon-theme
, at-spi2-atk
, at-spi2-core
, gnome
, libhandy
, runCommand
2018-08-12 17:38:57 +00:00
}:
2019-08-31 08:04:20 +00:00
stdenv.mkDerivation rec {
2018-08-12 17:38:57 +00:00
pname = "libhandy";
2021-04-13 19:19:46 +00:00
version = "1.2.2";
2018-08-12 17:38:57 +00:00
outputs = [
"out"
"dev"
"devdoc"
] ++ lib.optionals enableGlade [
"glade"
];
2018-08-12 17:38:57 +00:00
outputBin = "dev";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
2021-04-13 19:19:46 +00:00
sha256 = "sha256-R//Shl0CvRyleVIt6t1+L5U2Lx8gJGL9XuriuBZosEg=";
2018-08-12 17:38:57 +00:00
};
nativeBuildInputs = [
docbook_xml_dtd_43
2021-04-13 19:19:46 +00:00
docbook-xsl-nons
gobject-introspection
gtk-doc
libxml2
meson
ninja
pkg-config
vala
];
buildInputs = [
gdk-pixbuf
gtk3
libxml2
] ++ lib.optionals enableGlade [
glade
];
checkInputs = [
dbus
2021-05-08 13:45:03 +00:00
xvfb-run
at-spi2-atk
at-spi2-core
librsvg
hicolor-icon-theme
2018-08-12 17:38:57 +00:00
];
mesonFlags = [
"-Dgtk_doc=true"
"-Dglade_catalog=${if enableGlade then "enabled" else "disabled"}"
2018-08-12 17:38:57 +00:00
];
# Uses define_variable in pkg-config, but we still need it to use the glade output
2018-08-12 17:38:57 +00:00
PKG_CONFIG_GLADEUI_2_0_MODULEDIR = "${placeholder "glade"}/lib/glade/modules";
PKG_CONFIG_GLADEUI_2_0_CATALOGDIR = "${placeholder "glade"}/share/glade/catalogs";
doCheck = true;
2018-08-12 17:38:57 +00:00
checkPhase = ''
NO_AT_BRIDGE=1 \
XDG_DATA_DIRS="$XDG_DATA_DIRS:${hicolor-icon-theme}/share" \
GDK_PIXBUF_MODULE_FILE="${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
2018-08-12 17:38:57 +00:00
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
meson test --print-errorlogs
'';
2021-04-13 19:19:46 +00:00
passthru = {
updateScript = gnome.updateScript {
2021-04-13 19:19:46 +00:00
packageName = pname;
};
} // lib.optionalAttrs (!enableGlade) {
glade =
let
libhandyWithGlade = libhandy.override {
enableGlade = true;
};
in runCommand "${libhandy.name}-glade" {} ''
cp -r "${libhandyWithGlade.glade}" "$out"
chmod -R +w "$out"
sed -e "s#${libhandyWithGlade.out}#${libhandy.out}#g" -e "s#${libhandyWithGlade.glade}#$out#g" -i $(find "$out" -type f)
'';
2021-04-13 19:19:46 +00:00
};
meta = with lib; {
changelog = "https://gitlab.gnome.org/GNOME/libhandy/-/tags/${version}";
description = "Building blocks for modern adaptive GNOME apps";
homepage = "https://gitlab.gnome.org/GNOME/libhandy";
2018-08-12 17:38:57 +00:00
license = licenses.lgpl21Plus;
maintainers = teams.gnome.members;
2018-08-12 17:38:57 +00:00
platforms = platforms.linux;
};
}