gimp: fix cross

This commit is contained in:
classabbyamp
2026-04-06 09:00:54 -04:00
parent 2fbc2eaeb4
commit 7114963a89
+6 -66
View File
@@ -1,74 +1,14 @@
horrible hack to allow for both building the splash image and generating gir in cross-builds
gimp tries to use target binaries without any exec wrapper that would let
them be run on cross-builds
--- a/meson.build
+++ b/meson.build
@@ -1964,6 +1964,19 @@
@@ -2028,7 +2028,7 @@
endif
gimp_run_env.set('GIMP_PYTHON_WITH_GI', python.full_path())
if meson.can_run_host_binaries() and have_gobject_introspection
+ if meson.is_cross_build()
+ native_gimp_exe = find_program([gimpconsole_exe_name, gimpmain_exe_name],
+ native: true, required: false)
+ native_gimp_run_env=environment()
+ native_gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root())
+ native_gimp_run_env.set('GIMP_GLOBAL_SOURCE_ROOT', meson.global_source_root())
+ if get_option('debug-self-in-build')
+ native_gimp_run_env.set('GIMP_DEBUG_SELF', '1')
+ endif
+ native_gimp_run_env.set('GIMP_SELF_IN_BUILD', native_gimp_exe.full_path())
+ native_gimp_exe_depends = [native_gimp_exe]
+ endif
+
-if meson.can_run_host_binaries() and have_gobject_introspection
+if not meson.is_cross_build() and have_gobject_introspection
if enable_console_bin
gimp_real_exe = gimpconsole_exe
else
--- a/gimp-data/images/meson.build
+++ b/gimp-data/images/meson.build
@@ -1,18 +1,34 @@
## Splash Image and Welcome Dialog ##
-splash = custom_target('gimp-splash.png',
- input : [ 'export-splash.py' ],
- output: [ 'gimp-splash.png', ],
- depends: [ gimp_exe_depends ],
- command: [ gimp_exe, '-nidfs',
- files('gimp-splash.xcf.xz'),
- '--batch-interpreter', 'python-fu-eval',
- '-b', '-', '--quit'],
- feed: true,
- build_by_default: true,
- env: gimp_run_env,
- install_dir: gimpdatadir / 'images',
- install: true)
+if not meson.is_cross_build()
+ splash = custom_target('gimp-splash.png',
+ input : [ 'export-splash.py' ],
+ output: [ 'gimp-splash.png', ],
+ depends: [ gimp_exe_depends ],
+ command: [ gimp_exe, '-nidfs',
+ files('gimp-splash.xcf.xz'),
+ '--batch-interpreter', 'python-fu-eval',
+ '-b', '-', '--quit'],
+ feed: true,
+ build_by_default: true,
+ env: gimp_run_env,
+ install_dir: gimpdatadir / 'images',
+ install: true)
+else
+ splash = custom_target('gimp-splash.png',
+ input : [ 'export-splash.py' ],
+ output: [ 'gimp-splash.png', ],
+ depends: [],
+ command: [ gimp_exe, '-nidfs',
+ files('gimp-splash.xcf.xz'),
+ '--batch-interpreter', 'python-fu-eval',
+ '-b', '-', '--quit'],
+ feed: true,
+ build_by_default: true,
+ env: native_gimp_run_env,
+ install_dir: gimpdatadir / 'images',
+ install: true)
+endif
## Windows Installer's Splash Image and Intro Banner ##