diff --git a/hosts/common/programs/default.nix b/hosts/common/programs/default.nix index a6542525..b9b31012 100644 --- a/hosts/common/programs/default.nix +++ b/hosts/common/programs/default.nix @@ -19,6 +19,7 @@ ./git.nix ./gnome-feeds.nix ./gnome-keyring.nix + ./gnome-weather.nix ./gpodder.nix ./gthumb.nix ./helix.nix diff --git a/hosts/common/programs/gnome-weather.nix b/hosts/common/programs/gnome-weather.nix new file mode 100644 index 00000000..f3c8b212 --- /dev/null +++ b/hosts/common/programs/gnome-weather.nix @@ -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" + ]; + }; +} diff --git a/hosts/modules/gui/default.nix b/hosts/modules/gui/default.nix index 5494dd5e..c4b17fb4 100644 --- a/hosts/modules/gui/default.nix +++ b/hosts/modules/gui/default.nix @@ -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" diff --git a/overlays/cross.nix b/overlays/cross.nix index ebcba793..7bcffaf6 100644 --- a/overlays/cross.nix +++ b/overlays/cross.nix @@ -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): + 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): - # 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;