ship gnome-weather to all GUI platforms

This commit is contained in:
Colin 2023-08-24 11:00:38 +00:00
parent 5f808eab5c
commit 6eb3626203
4 changed files with 31 additions and 28 deletions

View File

@ -19,6 +19,7 @@
./git.nix
./gnome-feeds.nix
./gnome-keyring.nix
./gnome-weather.nix
./gpodder.nix
./gthumb.nix
./helix.nix

View File

@ -0,0 +1,10 @@
# preferences are saved via dconf; see `dconf dump /`
# cache dir is just for weather data (or maybe a http cache)
{ ... }:
{
sane.programs.gnome-weather = {
persist.plaintext = [
".cache/libgweather"
];
};
}

View File

@ -34,7 +34,7 @@
# "gnome-podcasts"
# "gnome.gnome-system-monitor"
# "gnome.gnome-terminal" # works on phosh
# "gnome.gnome-weather"
"gnome.gnome-weather"
"gpodder"
"gthumb"
"komikku"

View File

@ -940,6 +940,25 @@ in {
# # fixes "Run-time dependency vapigen found: NO (tried pkgconfig)"
# buildInputs = upstream.buildInputs ++ [ final.vala ];
# });
libgweather = (prev.libgweather.override {
# we need introspection for bindings, used by e.g.
# - gnome.gnome-weather (javascript)
# - sane-weather (python)
#
# enabling introspection on cross is tricky because `gen_locations_variant.py`
# outputs binary files (Locations.bin) which use the endianness of the build machine
# OTOH, aarch64 and x86_64 have same endianness: why not just ignore the issue, then?
# upstream issue (loosely related): <https://gitlab.gnome.org/GNOME/libgweather/-/issues/154>
withIntrospection = true;
}).overrideAttrs (upstream: {
# TODO: the `is_cross_build` change to meson.build is in nixpkgs, but specifies the wrong filepath
# (libgweather/meson.build instead of meson.build)
postPatch = (upstream.postPatch or "") + ''
sed -i '2i import os; os.environ["GI_TYPELIB_PATH"] = ""' build-aux/meson/gen_locations_variant.py
substituteInPlace meson.build \
--replace "g_ir_scanner.found() and not meson.is_cross_build()" "g_ir_scanner.found()"
'';
});
# libsForQt5 = prev.libsForQt5.overrideScope' (self: super: {
# qgpgme = super.qgpgme.overrideAttrs (orig: {
@ -1670,33 +1689,6 @@ in {
# '';
# });
sane-weather = prev.sane-weather.override {
# we need introspection to be able to call libgweather from python,
# but introspection's only built for non-cross.
# enabling introspection on cross is tricky because `gen_locations_variant.py`
# outputs binary files (Locations.bin) which use the endianness of the build machine
# OTOH, aarch64 and x86_64 have same endianness: why not just ignore the issue, then?
# upstream issue (loosely related): <https://gitlab.gnome.org/GNOME/libgweather/-/issues/154>
# libgweather = buildInQemu (final.libgweather.override {
# gobject-introspection = final.gobject-introspection.override {
# buildPackages = final;
# };
# python3.pythonForBuild = final.python3;
# # withIntrospection = false;
# });
libgweather = (final.libgweather.override {
withIntrospection = true;
}).overrideAttrs (upstream: {
# TODO: the `is_cross_build` change to meson.build is in nixpkgs, but specifies the wrong filepath
# (libgweather/meson.build instead of meson.build)
postPatch = (upstream.postPatch or "") + ''
sed -i '2i import os; os.environ["GI_TYPELIB_PATH"] = ""' build-aux/meson/gen_locations_variant.py
substituteInPlace meson.build \
--replace "g_ir_scanner.found() and not meson.is_cross_build()" "g_ir_scanner.found()"
'';
});
};
# sequoia = prev.sequoia.override {
# # fails to fix original error
# inherit (emulated) stdenv;