2021-05-02 18:22:58 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2021-05-28 11:51:59 +00:00
|
|
|
, gi-docgen
|
2022-01-09 18:14:38 +00:00
|
|
|
, meson
|
2021-05-02 18:22:58 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, sassc
|
|
|
|
, vala
|
|
|
|
, gobject-introspection
|
2021-05-28 11:51:59 +00:00
|
|
|
, fribidi
|
2021-10-03 01:30:11 +00:00
|
|
|
, glib
|
2021-05-02 18:22:58 +00:00
|
|
|
, gtk4
|
2021-10-03 01:30:11 +00:00
|
|
|
, gnome
|
|
|
|
, gsettings-desktop-schemas
|
2021-05-08 13:45:03 +00:00
|
|
|
, xvfb-run
|
2022-08-02 19:41:33 +00:00
|
|
|
, AppKit
|
|
|
|
, Foundation
|
2021-05-02 18:22:58 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libadwaita";
|
2022-07-23 15:47:50 +00:00
|
|
|
version = "1.2.0";
|
2021-05-02 18:22:58 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2021-05-28 11:51:59 +00:00
|
|
|
outputBin = "devdoc"; # demo app
|
2021-05-02 18:22:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.gnome.org";
|
|
|
|
owner = "GNOME";
|
|
|
|
repo = "libadwaita";
|
2021-05-28 11:51:59 +00:00
|
|
|
rev = version;
|
2022-07-23 15:47:50 +00:00
|
|
|
hash = "sha256-3lH7Vi9M8k+GSrCpvruRpLrIpMoOakKbcJlaAc/FK+U=";
|
2021-05-02 18:22:58 +00:00
|
|
|
};
|
|
|
|
|
2022-08-06 22:48:42 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-05-02 18:22:58 +00:00
|
|
|
nativeBuildInputs = [
|
2021-05-28 11:51:59 +00:00
|
|
|
gi-docgen
|
2022-01-09 18:14:38 +00:00
|
|
|
meson
|
2021-05-02 18:22:58 +00:00
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
sassc
|
|
|
|
vala
|
2022-08-06 22:48:42 +00:00
|
|
|
gobject-introspection
|
2021-05-02 18:22:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dgtk_doc=true"
|
2022-08-02 19:41:33 +00:00
|
|
|
] ++ lib.optionals (!doCheck) [
|
|
|
|
"-Dtests=false"
|
2021-05-02 18:22:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-28 11:51:59 +00:00
|
|
|
fribidi
|
2022-08-02 19:41:33 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
Foundation
|
2022-01-22 18:44:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-05-02 18:22:58 +00:00
|
|
|
gtk4
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2021-10-03 01:30:11 +00:00
|
|
|
gnome.adwaita-icon-theme
|
2022-08-02 19:41:33 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2021-05-08 13:45:03 +00:00
|
|
|
xvfb-run
|
2021-05-02 18:22:58 +00:00
|
|
|
];
|
|
|
|
|
2022-08-02 19:41:33 +00:00
|
|
|
# Tests had to be disabled on Darwin because they fail with the same error as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264947 on Hydra:
|
|
|
|
#
|
|
|
|
# In file included from ../tests/test-style-manager.c:10:
|
|
|
|
# ../src/adw-settings-private.h:16:10: fatal error: 'adw-enums-private.h' file not found
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2021-05-02 18:22:58 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2021-10-03 01:30:11 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
testEnvironment=(
|
|
|
|
# Disable portal since we cannot run it in tests.
|
|
|
|
ADW_DISABLE_PORTAL=1
|
|
|
|
|
|
|
|
# AdwSettings needs to be initialized from “org.gnome.desktop.interface” GSettings schema when portal is not used for color scheme.
|
|
|
|
# It will not actually be used since the “color-scheme” key will only have been introduced in GNOME 42, falling back to detecting theme name.
|
|
|
|
# See adw_settings_constructed function in https://gitlab.gnome.org/GNOME/libadwaita/commit/60ec69f0a5d49cad8a6d79e4ecefd06dc6e3db12
|
2022-01-02 19:34:53 +00:00
|
|
|
"XDG_DATA_DIRS=${glib.getSchemaDataDirPath gsettings-desktop-schemas}"
|
2021-10-03 01:30:11 +00:00
|
|
|
|
|
|
|
# Tests need a cache directory
|
|
|
|
"HOME=$TMPDIR"
|
|
|
|
)
|
2022-08-02 19:41:33 +00:00
|
|
|
env "''${testEnvironment[@]}" ${lib.optionalString (!stdenv.isDarwin) "xvfb-run"} \
|
2021-10-03 01:30:11 +00:00
|
|
|
meson test --print-errorlogs
|
|
|
|
|
|
|
|
runHook postCheck
|
2021-05-02 18:22:58 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-29 18:51:36 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
2021-05-28 11:51:59 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-17 00:58:00 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-05-02 18:22:58 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Library to help with developing UI for mobile devices using GTK/GNOME";
|
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/libadwaita";
|
|
|
|
license = licenses.lgpl21Plus;
|
2021-12-31 14:41:54 +00:00
|
|
|
maintainers = teams.gnome.members ++ (with maintainers; [ dotlambda ]);
|
2022-08-02 19:41:33 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-02 18:22:58 +00:00
|
|
|
};
|
|
|
|
}
|