sane-weather: enable cross compilation

This commit is contained in:
Colin 2023-08-23 13:31:45 +00:00
parent 681d3d5520
commit 91c02aec9a

View File

@ -224,6 +224,10 @@ let
stdenvNoCC = emulated.stdenvNoCC;
buildPackages = final.hostPackages; # TODO: just `final`?
}
# else if p.pname == final.python3.pname then
# p // {
# pythonForBuild = p;
# }
# else if p.pname == "wrap-gapps-hook" then
# # avoid faulty propagated gtk3/gtk4
# final.wrapGAppsNoGuiHook
@ -1649,6 +1653,34 @@ in {
# exec ${lib.getBin final.stdenv.cc}/bin/${final.stdenv.cc.targetPrefix}cc -E $@;
# '';
# });
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;