build/windows, data, extensions, plug-ins: Fix Build omissions

- Fix "no icons" errors generating loaders.cache with .cmd (CI-Cross).
  ! This is a sub-optimal fix, but it's better than a useless build.

- Fix "no interpreter" errors generating .interp with Meson (CI-Native)
  and generating .interp and copying .typelib with .cmd (Local-Native).
  ! This is a sub-optimal fix to Local-Native, but plug-ins will work.

- Fix "no iso" error copying iso_639.xml with Meson (Local-Native).
This commit is contained in:
Bruno Lopes 2023-12-17 11:06:22 -03:00 committed by Jehan
parent 9af3579f63
commit d5f41b296b
10 changed files with 181 additions and 50 deletions

View File

@ -42,14 +42,41 @@ if [ $? -ne 0 ]; then
exit 1;
fi
# Build (part of) GIMP
if [ "x$CROSSROAD_PLATFORM" = "xw64" ]; then
# Generate the loaders.cache file for GUI image support.
# Note: this is mostly for distribution so I initially wanted to
# have these in "win64-nightly" job but "win32-nightly" also
# requires the same file (and I fail to install wine32) whereas
# Gitlab "needs" field requires jobs to be from a prior stage. So I
# generate this here, with dependencies.
wine ${CROSSROAD_PREFIX}/bin/gdk-pixbuf-query-loaders.exe ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll > ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
sed -i "s&$CROSSROAD_PREFIX/&&" ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
sed -i '/.dll\"/s*/*\\\\*g' ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
## Generator of the gio 'giomodule.cache' to fix error about
## libgiognutls.dll that prevents generating loaders.cache
gio=''
gio+="libgiognomeproxy.dll: gio-proxy-resolver\n"
gio+="libgiognutls.dll: gio-tls-backend\n"
gio+="libgiolibproxy.dll: gio-proxy-resolver\n"
gio+="libgioopenssl.dll: gio-tls-backend\n"
printf "%b" "$gio" > ${CROSSROAD_PREFIX}/lib/gio/modules/giomodule.cache
## NOT WORKING: Fallback generator of the pixbuf 'loaders.cache' for GUI image support
export GDK_PATH=`echo ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-*/*/`
GDK_PATH=$(sed "s|${CROSSROAD_PREFIX}/||g" <<< $GDK_PATH)
wine ${CROSSROAD_PREFIX}/bin/gdk-pixbuf-query-loaders.exe ${CROSSROAD_PREFIX}/${GDK_PATH}loaders/*.dll > ${CROSSROAD_PREFIX}/${GDK_PATH}loaders.cache
sed -i "s&$CROSSROAD_PREFIX/&&" ${CROSSROAD_PREFIX}/${GDK_PATH}/loaders.cache
sed -i '/.dll\"/s*/*\\\\*g' ${CROSSROAD_PREFIX}/${GDK_PATH}/loaders.cache
## Generator of the glib 'gschemas.compiled'
export GLIB_PATH=`echo ${CROSSROAD_PREFIX}/share/glib-*/schemas/`
GLIB_PATH=$(sed "s|${CROSSROAD_PREFIX}/||g" <<< $GLIB_PATH)
wine glib-compile-schemas --targetdir=${CROSSROAD_PREFIX}/${GLIB_PATH} ${CROSSROAD_PREFIX}/${GLIB_PATH}
fi
## XXX Functional fix to the problem of non-configured interpreters
## XXX Also, functional generator of the pixbuf 'loaders.cache' for GUI image support
echo "@echo off
echo This is a CI crossbuild of GIMP.
:: Don't run this under PowerShell since it produces UTF-16 files.
echo .js (JavaScript) plug-ins ^|^ NOT supported!
echo .lua (Lua) plug-ins ^|^ NOT supported!
echo .py (Python) plug-ins ^|^ NOT supported!
echo .scm (ScriptFu) plug-ins ^|^ NOT supported!
echo .vala (Vala) plug-ins ^|^ NOT supported!
bin\gdk-pixbuf-query-loaders.exe lib\gdk-pixbuf-2.0\2.10.0\loaders\*.dll > lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
echo.
bin\gimp-2.99.exe" > ${CROSSROAD_PREFIX}/gimp.cmd
echo "Please run the gimp.cmd file to know the actual plug-in support." > ${CROSSROAD_PREFIX}/README.txt

View File

@ -16,3 +16,19 @@ cd ..
# Copy the required packages and (part of) GIMP from the deps artifact
cp -fr $CROSSROAD_PREFIX/ _install${ARTIFACTS_SUFFIX}/
if [[ "x$CROSSROAD_PLATFORM" = "xw32" ]]; then
# We fail to install wine32 in x86 dep job and Gitlab "needs" field
# requires jobs to be from a prior stage, so we take from the x64 dep job
export CROSSROAD_PREFIX=".local/share/crossroad/roads/w64/gimp"
cp ${CROSSROAD_PREFIX}/lib/gio/modules/giomodule.cache _install${ARTIFACTS_SUFFIX}/lib/gio/modules
export GDK_PATH=`echo ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-*/*/`
GDK_PATH=$(sed "s|${CROSSROAD_PREFIX}/||g" <<< $GDK_PATH)
cp ${CROSSROAD_PREFIX}/${GDK_PATH}loaders.cache _install${ARTIFACTS_SUFFIX}/${GDK_PATH}
export GLIB_PATH=`echo ${CROSSROAD_PREFIX}/share/glib-*/schemas/`
GLIB_PATH=$(sed "s|${CROSSROAD_PREFIX}/||g" <<< $GLIB_PATH)
cp ${CROSSROAD_PREFIX}/${GLIB_PATH}gschemas.compiled _install${ARTIFACTS_SUFFIX}/${GLIB_PATH}
fi

View File

@ -87,11 +87,55 @@ else
fi
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then
cd ..
# XXX Functional fix to the problem of non-configured interpreters
make_cmd() {
echo "@echo off
echo This is a $1 native build of GIMP.
:: Don't run this under PowerShell since it produces UTF-16 files.
echo .js (JavaScript) plug-ins ^|^ NOT supported!
(
echo lua=$2\bin\luajit.exe
echo luajit=$2\bin\luajit.exe
echo /usr/bin/lua=$2\bin\luajit.exe
echo /usr/bin/luajit=$2\bin\luajit.exe
echo :Lua:E::lua::luajit:
) >%cd%\lib\gimp\2.99\interpreters\lua.interp
echo .lua (Lua) plug-ins ^|^ supported.
(
echo python=$2\bin\python.exe
echo python3=$2\bin\python.exe
echo /usr/bin/python=$2\bin\python.exe
echo /usr/bin/python3=$2\bin\python.exe
echo :Python:E::py::python:
) >%cd%\lib\gimp\2.99\interpreters\pygimp.interp
echo .py (Python) plug-ins ^|^ supported.
(
echo gimp-script-fu-interpreter=%cd%\bin\gimp-script-fu-interpreter-3.0.exe
echo gimp-script-fu-interpreter-3.0=%cd%\bin\gimp-script-fu-interpreter-3.0.exe
echo /usr/bin/gimp-script-fu-interpreter=%cd%\bin\gimp-script-fu-interpreter-3.0.exe
echo :ScriptFu:E::scm::gimp-script-fu-interpreter-3.0.exe:
) >%cd%\lib\gimp\2.99\interpreters\gimp-script-fu-interpreter.interp
echo .scm (ScriptFu) plug-ins ^|^ supported.
echo .vala (Vala) plug-ins ^|^ supported.
echo.
@if not exist $2\lib\girepository-1.0\babl*.typelib (copy lib\girepository-1.0\babl*.typelib $2\lib\girepository-1.0) > nul
@if not exist $2\lib\girepository-1.0\gegl*.typelib (copy lib\girepository-1.0\gegl*.typelib $2\lib\girepository-1.0) > nul
@if not exist $2\lib\girepository-1.0\gimp*.typelib (copy lib\girepository-1.0\gimp*.typelib $2\lib\girepository-1.0) > nul
set PATH=%PATH%;$2\bin
bin\gimp-2.99.exe" > ${GIMP_PREFIX}/gimp.cmd
sed -i 's|c:/|c:\\|g;s|msys64/|msys64\\|g' ${GIMP_PREFIX}/gimp.cmd
echo "Please run the gimp.cmd file to get proper plug-in support."> ${GIMP_PREFIX}/README.txt
}
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then
make_cmd CI %cd%
cd ..
#ccache --show-stats
# XXX Moving back the prefix to be used as artifacts.
mv "${GIMP_PREFIX}" .
fi
else
make_cmd local $MSYS2_PREFIX
fi

View File

@ -26,3 +26,11 @@ configure_file(
install: true,
install_dir: gimpdatadir,
)
# Fix iso-codes warning (Local-Native only)
if platform_windows and not meson.is_cross_build()
install_data(
join_paths(isocodes_location, 'iso_639.xml'),
install_dir: join_paths(get_option('datadir'), 'xml/iso-codes')
)
endif

5
extensions/lua.interp.in Normal file
View File

@ -0,0 +1,5 @@
lua=@LUA_PATH@luajit.exe
luajit=@LUA_PATH@luajit.exe
/usr/bin/luajit=@LUA_PATH@luajit.exe
/usr/bin/lua=@LUA_PATH@luajit.exe
:Lua:E::lua::luajit:

View File

@ -1 +1,15 @@
subdir('goat-exercises')
# Fallback fix to the problem of non-configured interpreters
if platform_windows and not meson.is_cross_build() and lua.found()
lua_config = configuration_data()
lua_config.set('LUA_PATH', '')
configure_file(
input : 'lua.interp.in',
output: 'lua.interp',
configuration: lua_config,
install: true,
install_dir: gimpplugindir / 'interpreters',
)
endif

View File

@ -38,10 +38,10 @@ foreach plugin : plugins
endforeach
endforeach
if python.found()
# Fallback fix to the problem of non-configured interpreters
if platform_windows and not meson.is_cross_build() and python.found()
python_config = configuration_data()
python_config.set('PYTHON_PATH', python.full_path())
python_config.set('PYTHON_PATH', '')
configure_file(
input : 'pygimp.interp.in',

View File

@ -1,5 +1,5 @@
python=@PYTHON_PATH@
python3=@PYTHON_PATH@
/usr/bin/python=@PYTHON_PATH@
/usr/bin/python3=@PYTHON_PATH@
python=@PYTHON_PATH@python.exe
python3=@PYTHON_PATH@python.exe
/usr/bin/python=@PYTHON_PATH@python.exe
/usr/bin/python3=@PYTHON_PATH@python.exe
:Python:E::py::python3:

View File

@ -0,0 +1,4 @@
gimp-script-fu-interpreter=@SCRIPTFU_PATH@gimp-script-fu-interpreter-3.0.exe
gimp-script-fu-interpreter-3.0=@SCRIPTFU_PATH@gimp-script-fu-interpreter-3.0.exe
/usr/bin/gimp-script-fu-interpreter=@SCRIPTFU_PATH@gimp-script-fu-interpreter-3.0.exe
,ScriptFu,E,,scm,,@SCRIPTFU_PATH@gimp-script-fu-interpreter-3.0.exe,

View File

@ -28,38 +28,51 @@ plugin_sources = [
'script-fu.c',
]
if platform_windows
plugin_sources += windows.compile_resources(
plugin_rc,
args: [
'--define', 'ORIGINALFILENAME_STR="@0@"'.format(executable_name+'.exe'),
'--define', 'INTERNALNAME_STR="@0@"' .format(executable_name),
'--define', 'TOP_SRCDIR="@0@"' .format(meson.project_source_root()),
if not meson.is_cross_build()
if platform_windows
plugin_sources += windows.compile_resources(
plugin_rc,
args: [
'--define', 'ORIGINALFILENAME_STR="@0@"'.format(executable_name+'.exe'),
'--define', 'INTERNALNAME_STR="@0@"' .format(executable_name),
'--define', 'TOP_SRCDIR="@0@"' .format(meson.project_source_root()),
],
include_directories: [
rootInclude, appInclude,
],
)
# Fallback fix to the problem of non-configured interpreters
scriptfu_config = configuration_data()
scriptfu_config.set('SCRIPTFU_PATH', '')
configure_file(
input : 'gimp-script-fu-interpreter.interp.in',
output: 'gimp-script-fu-interpreter.interp',
configuration: scriptfu_config,
install: true,
install_dir: gimpplugindir / 'interpreters',
)
endif
# Several components use Gtk
# libscriptfu is installed to standard place; no rpath necessary
executable(executable_name,
plugin_sources,
dependencies: [
libgimpui_dep,
math,
gi,
],
c_args: [
'-DG_LOG_DOMAIN="scriptfu"',
],
include_directories: [
rootInclude, appInclude,
libscriptfuInclude,
],
link_with : [libscriptfuconsole, libscriptfu ],
install: true,
install_dir: gimpplugindir / 'plug-ins' / executable_name,
)
endif
# Several components use Gtk
# libscriptfu is installed to standard place; no rpath necessary
executable(executable_name,
plugin_sources,
dependencies: [
libgimpui_dep,
math,
gi,
],
c_args: [
'-DG_LOG_DOMAIN="scriptfu"',
],
include_directories: [
libscriptfuInclude,
],
link_with : [libscriptfuconsole, libscriptfu ],
install: true,
install_dir: gimpplugindir / 'plug-ins' / executable_name,
)
endif