2021-04-13 20:19:46 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-03 19:05:30 +01:00
|
|
|
, fetchurl
|
|
|
|
, meson
|
|
|
|
, ninja
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-07-03 19:05:30 +01:00
|
|
|
, gobject-introspection
|
|
|
|
, vala
|
|
|
|
, gtk-doc
|
2021-04-13 20:19:46 +01:00
|
|
|
, docbook-xsl-nons
|
2020-07-03 19:05:30 +01:00
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, gtk3
|
2021-04-13 21:14:22 +01:00
|
|
|
, enableGlade ? false
|
2020-07-03 19:05:30 +01:00
|
|
|
, glade
|
|
|
|
, dbus
|
2021-05-08 14:45:03 +01:00
|
|
|
, xvfb-run
|
2020-07-03 19:05:30 +01:00
|
|
|
, libxml2
|
|
|
|
, gdk-pixbuf
|
|
|
|
, librsvg
|
2019-01-20 19:39:00 +00:00
|
|
|
, hicolor-icon-theme
|
2020-11-04 00:07:10 +00:00
|
|
|
, at-spi2-atk
|
|
|
|
, at-spi2-core
|
2021-05-07 22:18:14 +01:00
|
|
|
, gnome
|
2021-04-13 21:14:22 +01:00
|
|
|
, libhandy
|
2021-04-28 10:47:37 +01:00
|
|
|
, runCommand
|
2018-08-12 18:38:57 +01:00
|
|
|
}:
|
|
|
|
|
2019-08-31 09:04:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2018-08-12 18:38:57 +01:00
|
|
|
pname = "libhandy";
|
2021-09-12 05:58:22 +01:00
|
|
|
version = "1.4.0";
|
2018-08-12 18:38:57 +01:00
|
|
|
|
2021-04-13 21:14:22 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
"devdoc"
|
|
|
|
] ++ lib.optionals enableGlade [
|
|
|
|
"glade"
|
|
|
|
];
|
2018-08-12 18:38:57 +01:00
|
|
|
outputBin = "dev";
|
|
|
|
|
2020-07-03 19:05:30 +01:00
|
|
|
src = fetchurl {
|
2021-01-21 17:00:13 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2021-09-12 05:58:22 +01:00
|
|
|
sha256 = "sha256-JnbVH6H6QP3udJfT52P++hiwM4v/zS7jLn9+YzyIVEY=";
|
2018-08-12 18:38:57 +01:00
|
|
|
};
|
|
|
|
|
2020-07-03 19:05:30 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
docbook_xml_dtd_43
|
2021-04-13 20:19:46 +01:00
|
|
|
docbook-xsl-nons
|
2020-07-03 19:05:30 +01:00
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
libxml2
|
|
|
|
meson
|
|
|
|
ninja
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2020-07-03 19:05:30 +01:00
|
|
|
vala
|
2020-05-15 17:29:11 +01:00
|
|
|
];
|
|
|
|
|
2020-07-03 19:05:30 +01:00
|
|
|
buildInputs = [
|
|
|
|
gdk-pixbuf
|
|
|
|
gtk3
|
|
|
|
libxml2
|
2021-04-13 21:14:22 +01:00
|
|
|
] ++ lib.optionals enableGlade [
|
|
|
|
glade
|
2020-07-03 19:05:30 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
dbus
|
2021-05-08 14:45:03 +01:00
|
|
|
xvfb-run
|
2020-11-04 00:07:10 +00:00
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
|
|
|
librsvg
|
|
|
|
hicolor-icon-theme
|
2018-08-12 18:38:57 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dgtk_doc=true"
|
2021-04-13 21:14:22 +01:00
|
|
|
"-Dglade_catalog=${if enableGlade then "enabled" else "disabled"}"
|
2018-08-12 18:38:57 +01:00
|
|
|
];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
# Uses define_variable in pkg-config, but we still need it to use the glade output
|
2018-08-12 18:38:57 +01:00
|
|
|
PKG_CONFIG_GLADEUI_2_0_MODULEDIR = "${placeholder "glade"}/lib/glade/modules";
|
|
|
|
PKG_CONFIG_GLADEUI_2_0_CATALOGDIR = "${placeholder "glade"}/share/glade/catalogs";
|
|
|
|
|
2021-09-10 20:18:45 +01:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2018-08-12 18:38:57 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
2019-02-11 02:40:18 +00:00
|
|
|
NO_AT_BRIDGE=1 \
|
2020-11-04 00:07:10 +00:00
|
|
|
XDG_DATA_DIRS="$XDG_DATA_DIRS:${hicolor-icon-theme}/share" \
|
2020-07-03 19:05:30 +01:00
|
|
|
GDK_PIXBUF_MODULE_FILE="${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
|
2018-08-12 18:38:57 +01: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 20:19:46 +01:00
|
|
|
passthru = {
|
2021-05-07 22:18:14 +01:00
|
|
|
updateScript = gnome.updateScript {
|
2021-04-13 20:19:46 +01:00
|
|
|
packageName = pname;
|
|
|
|
};
|
2021-04-13 21:14:22 +01:00
|
|
|
} // lib.optionalAttrs (!enableGlade) {
|
|
|
|
glade =
|
|
|
|
let
|
|
|
|
libhandyWithGlade = libhandy.override {
|
|
|
|
enableGlade = true;
|
|
|
|
};
|
2021-04-28 10:47:37 +01:00
|
|
|
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 20:19:46 +01:00
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-07-03 19:05:30 +01:00
|
|
|
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 18:38:57 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-07-03 19:05:30 +01:00
|
|
|
maintainers = teams.gnome.members;
|
2021-09-10 20:18:45 +01:00
|
|
|
platforms = platforms.unix;
|
2018-08-12 18:38:57 +01:00
|
|
|
};
|
|
|
|
}
|