Skip to content

Commit 2855529

Browse files
committed
nixos/i18n/input-method: Fix cross
If the gtk2 and gtk3 are moved to `nativeBuildInputs` then this happens ``` Cannot load module /nix/store/sn268l2xkdvkvagq1r35xy9071zns4hx-ibus-with-plugins-1.5.32/lib/gtk-3.0/3.0.0/immodules/im-ibus.so: /nix/store/sn268l2xkdvkvagq1r35xy9071zns4hx-ibus-with-plugins-1.5.32/lib/gtk-3.0/3.0.0/immodules/im-ibus.so: cannot open shared object file: No such file or directory > /nix/store/sn268l2xkdvkvagq1r35xy9071zns4hx-ibus-with-plugins-1.5.32/lib/gtk-3.0/3.0.0/immodules/im-ibus.so does not export GTK+ IM module API: /nix/store/sn268l2xkdvkvagq1r35xy9071zns4hx-ibus-with-plugins-1.5.32/lib/gtk-3.0/3.0.0/immodules/im-ibus.so: cannot open shared object file: No such file or directory ```
1 parent 68693c4 commit 2855529

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

nixos/modules/i18n/input-method/default.nix

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ let
2222
preferLocalBuild = true;
2323
allowSubstitutes = false;
2424
buildInputs = [
25-
pkgs.gtk2
2625
cfg.package
2726
];
2827
}
2928
''
3029
mkdir -p $out/etc/gtk-2.0/
31-
GTK_PATH=${cfg.package}/lib/gtk-2.0/ gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
30+
GTK_PATH=${cfg.package}/lib/gtk-2.0/ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${lib.getExe' pkgs.gtk2.dev "gtk-query-immodules-2.0"} > $out/etc/gtk-2.0/immodules.cache
3231
'';
3332

3433
gtk3_cache =
@@ -37,13 +36,12 @@ let
3736
preferLocalBuild = true;
3837
allowSubstitutes = false;
3938
buildInputs = [
40-
pkgs.gtk3
4139
cfg.package
4240
];
4341
}
4442
''
4543
mkdir -p $out/etc/gtk-3.0/
46-
GTK_PATH=${cfg.package}/lib/gtk-3.0/ gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
44+
GTK_PATH=${cfg.package}/lib/gtk-3.0/ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${lib.getExe' pkgs.gtk3.dev "gtk-query-immodules-3.0"} > $out/etc/gtk-3.0/immodules.cache
4745
'';
4846

4947
in
@@ -107,8 +105,12 @@ in
107105
environment.systemPackages = [
108106
cfg.package
109107
]
110-
++ lib.optional cfg.enableGtk2 gtk2_cache
111-
++ lib.optional cfg.enableGtk3 gtk3_cache;
108+
++ lib.optional (
109+
cfg.enableGtk2 && (pkgs.stdenv.hostPlatform.emulatorAvailable pkgs.buildPackages)
110+
) gtk2_cache
111+
++ lib.optional (
112+
cfg.enableGtk3 && (pkgs.stdenv.hostPlatform.emulatorAvailable pkgs.buildPackages)
113+
) gtk3_cache;
112114
};
113115

114116
meta = {

0 commit comments

Comments
 (0)