libphonenumber: use a better patch for cross (CMAKE_CROSSCOMPILING_EMULATOR)

This commit is contained in:
Colin 2024-05-31 06:27:10 +00:00
parent c7fd3d2217
commit a2dfd8f08e
2 changed files with 31 additions and 23 deletions

View File

@ -32,6 +32,12 @@ in [
# etc, where "date" is like "20240228181608"
# and can be found with `nix-repl > :lf . > lastModifiedDate`
(fetchpatch' {
title = "libphonenumber: fix cross compilation";
saneCommit = "151fb5ea9c43847dbd114cb80c04ce7118fef95d";
hash = "sha256-dvgpuldhBlSrpwkqNEtgAHqhaGsrMwoAT+Q5J27NYrQ=";
})
(fetchpatch' {
title = "passt: support cross compilation";
saneCommit = "3ef36d3aa139f94e8716b0721856c5808937c9f2";

View File

@ -1154,29 +1154,31 @@ in with final; {
# callPackage = self.newScope { inherit (self) qtCompatVersion qtModule srcs; inherit stdenv; };
# });
libphonenumber = prev.libphonenumber.overrideAttrs (upstream: {
# fix that phone number geolocation binary doesn't cross compile.
# it's CMAKE, and a google project, so the fix to cross compile is unlikely to *ever* make it upstream.
# see: <https://github.com/google/libphonenumber/pull/2604>
#
# the main (only?) user of this library is evolution-data-server,
# which is consumed by gnome-calender, calls, planify.
# maybe i can purge EDS from my system somehow.
# - geary: package doesn't even have EDS as an input; it speaks to it over dbus.
# - calls: package has EDS as input (unused?); speaks to it over dbus.
# - it actually needs EDS though, for its `libebook-contacts` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libebook-contacts/>
# - gnome-calendar: package has EDS as input (unused?); speaks to it over dbus.
# - it actually needs EDS though, for its `libedataserverui4` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libedataserverui4/>
# - planify: package has EDS as input (unused?); speaks to it over dbus.
# - it actually needs EDS though, for its `libecal` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libecal/>
# - it could be using evolution-data-server-gtk4 instead of EDS gtk3 though
#
# or build EDS with `-DWITH_PHONENUMBER=OFF`
cmakeFlags = (upstream.cmakeFlags or []) ++ [
"-DPROTOC_BIN=${lib.getExe buildPackages.protobuf}"
"-DBUILD_GEOCODER=OFF"
];
});
# 2024/05/31: better fix is to use CMAKE_CROSSCOMPILING_EMULATOR
# - <https://github.com/uninsane/nixpkgs/pull/new/pr-libphonenumber-cross>
# libphonenumber = prev.libphonenumber.overrideAttrs (upstream: {
# # fix that phone number geolocation binary doesn't cross compile.
# # it's CMAKE, and a google project, so the fix to cross compile is unlikely to *ever* make it upstream.
# # see: <https://github.com/google/libphonenumber/pull/2604>
# #
# # the main (only?) user of this library is evolution-data-server,
# # which is consumed by gnome-calender, calls, planify.
# # maybe i can purge EDS from my system somehow.
# # - geary: package doesn't even have EDS as an input; it speaks to it over dbus.
# # - calls: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libebook-contacts` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libebook-contacts/>
# # - gnome-calendar: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libedataserverui4` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libedataserverui4/>
# # - planify: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libecal` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libecal/>
# # - it could be using evolution-data-server-gtk4 instead of EDS gtk3 though
# #
# # or build EDS with `-DWITH_PHONENUMBER=OFF`
# cmakeFlags = (upstream.cmakeFlags or []) ++ [
# "-DPROTOC_BIN=${lib.getExe buildPackages.protobuf}"
# "-DBUILD_GEOCODER=OFF"
# ];
# });
# 2024/02/27: upstreaming is unblocked, out for PR: <https://github.com/NixOS/nixpkgs/pull/291947>
# but i don't think either the pkg-config fix (which breaks binfmt cross) nor disabling docs is the right fix.