From f044fcb584eae1067526e3f8e21c694e121e12e6 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 11 Dec 2023 03:27:46 +0000 Subject: [PATCH] gnome-frog: fix cross compilation --- hosts/modules/gui/default.nix | 1 + nixpatches/list.nix | 5 +++++ overlays/cross.nix | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/hosts/modules/gui/default.nix b/hosts/modules/gui/default.nix index 8d0f804d..87c98ab9 100644 --- a/hosts/modules/gui/default.nix +++ b/hosts/modules/gui/default.nix @@ -78,6 +78,7 @@ in # "gnome.gnome-terminal" # works on phosh "gnome.gnome-weather" "gnome.seahorse" # keyring/secret manager + "gnome-frog" # OCR/QR decoder "gpodder" "gthumb" "gtkcord4" # Discord client. 2023/11/21: disabled because v0.0.12 leaks memory diff --git a/nixpatches/list.nix b/nixpatches/list.nix index aa7ac322..1027e862 100644 --- a/nixpatches/list.nix +++ b/nixpatches/list.nix @@ -28,6 +28,11 @@ in [ saneCommit = "8631ddfb99aa8e935276b27d55ef5e10f5ab0367"; hash = "sha256-AkxtrCJrf0wpTdty4SOIWBrWwqfG7rBI4ON38BjDi6s="; }) + (fetchpatch' { + title = "python3Packages.numpy: fix cross compilation"; + prUrl = "https://github.com/NixOS/nixpkgs/pull/268587"; + hash = "sha256-GRRLXwUw2JXEV6Ov0QiVTFwoi/ACManG2Qk7D3fzS8E="; + }) # (fetchpatch' { # title = "nixos/slskd: allow omitting username from yaml config"; # saneCommit = "541c37e8689b6422ea07be1395f1a63357bb0c63"; diff --git a/overlays/cross.nix b/overlays/cross.nix index 6ffe30ea..45f84871 100644 --- a/overlays/cross.nix +++ b/overlays/cross.nix @@ -872,6 +872,15 @@ in with final; { # 2023/12/08: upstreaming is unblocked (but requires building webkitgtk-4.0) gthumb = mvInputs { nativeBuildInputs = [ glib ]; } prev.gthumb; + gnome-frog = prev.gnome-frog.overrideAttrs (upstream: { + # blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host. + postPatch = (upstream.postPatch or "") + '' + substituteInPlace data/meson.build --replace \ + "find_program('blueprint-compiler')" \ + "'env', 'GI_TYPELIB_PATH=${buildPackages.gdk-pixbuf.out}/lib/girepository-1.0:${buildPackages.harfbuzz.out}/lib/girepository-1.0:${buildPackages.gtk4.out}/lib/girepository-1.0:${buildPackages.graphene}/lib/girepository-1.0:${buildPackages.libadwaita}/lib/girepository-1.0:${buildPackages.pango.out}/lib/girepository-1.0', find_program('blueprint-compiler')" + ''; + }); + gnome = prev.gnome.overrideScope' (self: super: { # dconf-editor = super.dconf-editor.override { # # fails to fix original error