build/windows: Ship babl, gegl and gimp development files on Windows

Partly inspired by Infrastructure/gimp-macos-build#69

Now, we ship headers, static libraries and (relocatable) pkg-config files of
babl, gegl and gimp to make a bit easier building filters and plug-ins.

Developers will still need MSYS2 to install the compiler and the
other many dependencies.
This commit is contained in:
Bruno Lopes 2025-03-28 19:50:50 -03:00
parent 8719e231fd
commit 73c7d46829
No known key found for this signature in database
7 changed files with 39 additions and 17 deletions

View File

@ -508,6 +508,8 @@ gimp-win-x64-cross:
variables:
CC: cc
CXX: c++
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
before_script:
- $MSYS_ROOT = 'C:/msys64'
- $env:Path = "$MSYS_ROOT/$MSYSTEM_PREFIX/bin;$MSYS_ROOT/usr/bin;" + $env:Path

View File

@ -87,7 +87,7 @@ function self_build ([string]$dep, [string]$option1, [string]$option2)
## Configure and/or build
if (-not (Test-Path _build-$MSYSTEM_PREFIX\build.ninja -Type Leaf))
{
meson setup _build-$MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $option1 $option2
meson setup _build-$MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $PKGCONF_RELOCATABLE_OPTION $option1 $option2
}
Set-Location _build-$MSYSTEM_PREFIX
ninja

View File

@ -48,7 +48,7 @@ if (-not (Test-Path _build-$MSYSTEM_PREFIX\build.ninja -Type Leaf))
#FIXME: There is no GJS for Windows. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/5891
meson setup _build-$MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" -Djavascript=disabled `
-Ddirectx-sdk-dir="$MSYS_ROOT/$MSYSTEM_PREFIX" -Denable-default-bin=enabled `
-Dbuild-id='org.gimp.GIMP_official' $INSTALLER_OPTION $STORE_OPTION $NON_RELOCATABLE_OPTION
-Dbuild-id='org.gimp.GIMP_official' $INSTALLER_OPTION $STORE_OPTION $PKGCONF_RELOCATABLE_OPTION $NON_RELOCATABLE_OPTION
}
Set-Location _build-$MSYSTEM_PREFIX
ninja

View File

@ -96,14 +96,6 @@ bundle "$MSYSTEM_PREFIX" etc/fonts
sed -i "s|LOCAL_APPDATA_FONTCONFIG_CACHE|~/AppData/Local/GIMP/$GIMP_APP_VERSION/fontconfig/cache|" "$GIMP_DISTRIB/etc/fonts/fonts.conf"
## Headers (for use of gimptool).
bundle "$GIMP_PREFIX" include/gimp-*
bundle "$GIMP_PREFIX" include/babl-*
bundle "$GIMP_PREFIX" include/gegl-*
bundle "$MSYSTEM_PREFIX" include/exiv*
bundle "$MSYSTEM_PREFIX" include/gexiv*
## Library data.
bundle "$GIMP_PREFIX" lib/gimp
bundle "$GIMP_PREFIX" lib/babl-*
@ -120,7 +112,6 @@ bundle "$MSYSTEM_PREFIX" lib/gdk-pixbuf-*/*/loaders/libpixbufloader-bmp.dll
bundle "$MSYSTEM_PREFIX" lib/gdk-pixbuf-*/*/loaders/libpixbufloader-jpeg.dll
bundle "$MSYSTEM_PREFIX" lib/gdk-pixbuf-*/*/loaders/libpixbufloader-gif.dll
bundle "$MSYSTEM_PREFIX" lib/gdk-pixbuf-*/*/loaders/libpixbufloader-tiff.dll
clean "$GIMP_DISTRIB" lib/*.a
## Resources.
@ -230,3 +221,15 @@ done
#if [ "$CI_JOB_NAME" != "gimp-win-x64-cross" ]; then
# cp -fr ${GIMP_PREFIX}/bin/*.pdb ${GIMP_DISTRIB}/bin/
#fi
## Development files (to build GEGL filters and GIMP plug-ins).
clean "$GIMP_DISTRIB" lib/*.a
bundle "$GIMP_PREFIX" include/gimp-*
bundle "$GIMP_PREFIX" include/babl-*
bundle "$GIMP_PREFIX" include/gegl-*
bundle "$GIMP_PREFIX" lib/libgimp*.a
bundle "$GIMP_PREFIX" lib/libbabl*.a
bundle "$GIMP_PREFIX" lib/libgegl*.a
bundle "$GIMP_PREFIX" lib/pkgconfig/gimp-*
bundle "$GIMP_PREFIX" lib/pkgconfig/babl-*
bundle "$GIMP_PREFIX" lib/pkgconfig/gegl-*

View File

@ -30,13 +30,17 @@ Source: "{#GIMP_DIR}\{#DIR}\lib\gimp\*.exe"; DestDir: "{app}\lib\gimp"; Excludes
Source: "{#GIMP_DIR}\{#DIR}\lib\girepository-1.0\Gimp*.typelib"; DestDir: "{app}\lib\girepository-1.0"; Components: gimp{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR}\{#DDIR}\bin\*"; DestDir: "{app}\bin"; Excludes: "libgimp*.dll,gimp*.exe,*.debug,{#OPTIONAL_DLL},{#OPTIONAL_EXE}"; Components: deps{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR}\{#DDIR}\lib\*"; DestDir: "{app}\lib"; Excludes: "gimp,Gimp*.typelib,*.debug,lua,gluas.dll,python3.12"; Components: deps{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR}\{#DDIR}\lib\*"; DestDir: "{app}\lib"; Excludes: "gimp,Gimp*.typelib,*.debug,*.a,*.pc,lua,gluas.dll,python3.12"; Components: deps{#COMPONENT}; Flags: {#COMMON_FLAGS}
;Optional arch-specific components (full installation)
#ifdef DEBUG_SYMBOLS
Source: "{#GIMP_DIR}\{#DIR}\*.debug"; DestDir: "{app}"; Components: debug{#COMPONENT}; Flags: {#COMMON_FLAGS}
#endif
Source: "{#GIMP_DIR}\{#DIR}\*.h"; DestDir: "{app}"; Components: dev{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR}\{#DIR}\*.a"; DestDir: "{app}"; Components: dev{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR}\{#DIR}\*.pc"; DestDir: "{app}"; Components: dev{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR}\{#DDIR}\bin\libgs*.dll"; DestDir: "{app}\bin"; Components: gs{#COMPONENT}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR}\{#DIR}\lib\file-ps.exe"; DestDir: "{app}\lib"; Components: gs{#COMPONENT}; Flags: {#COMMON_FLAGS}

View File

@ -258,6 +258,10 @@ Name: debug32; Description: "{cm:ComponentsDebug}"; Types: full custom; Flags: d
Name: debug64; Description: "{cm:ComponentsDebug}"; Types: full custom; Flags: disablenouninstallwarning; Check: Check3264('x64')
Name: debugARM64; Description: "{cm:ComponentsDebug}"; Types: full custom; Flags: disablenouninstallwarning; Check: Check3264('arm64')
#endif
;Development files
Name: dev32; Description: "{cm:ComponentsDev}"; Types: full custom; Flags: disablenouninstallwarning; Check: Check3264('32')
Name: dev64; Description: "{cm:ComponentsDev}"; Types: full custom; Flags: disablenouninstallwarning; Check: Check3264('x64')
Name: devARM64; Description: "{cm:ComponentsDev}"; Types: full custom; Flags: disablenouninstallwarning; Check: Check3264('arm64')
;PostScript support
Name: gs32; Description: "{cm:ComponentsGhostscript}"; Types: full custom; Check: Check3264('32')
Name: gs64; Description: "{cm:ComponentsGhostscript}"; Types: full custom; Check: Check3264('x64')
@ -308,7 +312,6 @@ Source: "{#ASSETS_DIR}\installsplash_small.bmp"; Flags: dontcopy
#define GIMP_ARCHS="gimp32 or gimp64 or gimpARM64"
#define OPTIONAL_EXT="*.debug,*.lua,*.py"
Source: "{#GIMP_DIR32}\etc\gimp\*"; DestDir: "{app}\etc\gimp"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR32}\include\gimp-{#GIMP_PKGCONFIG_VERSION}\*"; DestDir: "{app}\include\gimp-{#GIMP_PKGCONFIG_VERSION}"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR32}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\environ\default.env"; DestDir: "{app}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\environ"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR32}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\interpreters\gimp-script-fu-interpreter.interp"; DestDir: "{app}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\interpreters"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#GIMP_DIR32}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\extensions\*"; DestDir: "{app}\lib\gimp\{#GIMP_PKGCONFIG_VERSION}\extensions"; Excludes: "*.dll,*.exe,{#OPTIONAL_EXT}"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
@ -318,7 +321,6 @@ Source: "{#GIMP_DIR32}\share\icons\hicolor\*"; DestDir: "{app}\share\icons\hicol
Source: "{#GIMP_DIR32}\share\metainfo\*"; DestDir: "{app}\share\metainfo"; Components: {#GIMP_ARCHS}; Flags: {#COMMON_FLAGS}
#define DEPS_ARCHS="deps32 or deps64 or depsARM64"
Source: "{#DEPS_DIR32}\etc\*"; DestDir: "{app}\etc"; Excludes: "gimp"; Components: {#DEPS_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR32}\include\*"; DestDir: "{app}\include"; Excludes: "gimp*"; Components: {#DEPS_ARCHS}; Flags: {#COMMON_FLAGS}
Source: "{#DEPS_DIR32}\share\*"; DestDir: "{app}\share"; Excludes: "gimp,icons\hicolor,metainfo,locale\*,mypaint-data"; Components: {#DEPS_ARCHS}; Flags: {#COMMON_FLAGS} createallsubdirs
;Optional arch-neutral files (full install)
@ -403,12 +405,15 @@ Type: files; Name: "{autodesktop}\{reg:HKA\SOFTWARE\Microsoft\Windows\CurrentVer
;remove old babl and gegl plugins
Type: filesandordirs; Name: "{app}\lib\babl-0.1"
Type: filesandordirs; Name: "{app}\lib\gegl-0.4"
;This was bunbled in RC1 but not needed since the "Debug" menu is hidden in stable releases
;This was bunbled in 3.0 RC1 but not needed since the "Debug" menu is hidden in stable releases
#if (!Defined(GIMP_UNSTABLE) || GIMP_UNSTABLE=="")
Type: files; Name: "{app}\bin\dot.exe"
#endif
;No need to all these python binaries shipped in RC1
;No need to all these python binaries shipped in 3.0 RC1
Type: files; Name: "{app}\bin\python3*.exe"
;Uneeded shipped headers in 3.0 RC3 (we now ship only babl, gegl and gimp)
Type: filesandordirs; Name: "{app}\include\exiv2"
Type: filesandordirs; Name: "{app}\include\gexiv2"
[UninstallDelete]
Type: files; Name: "{app}\uninst\uninst.inf"
@ -958,7 +963,7 @@ var i,j: Integer;
begin
DebugMsg('ComponentsListOnClick','');
Components := ['Gimp','Deps','Debug', 'Ghostscript','Lua','Python','Translations','MyPaint','Gimp32'];
Components := ['Gimp','Deps','Debug','Dev','Ghostscript','Lua','Python','Translations','MyPaint','Gimp32'];
ComponentDesc := '';
for i := 0 to TNewCheckListBox(pSender).Items.Count - 1 do

View File

@ -105,6 +105,14 @@
<value>Include information to help with debugging GIMP</value>
</config>
<!-- Components -->
<config name="ComponentsDev">
<value>Resource development files</value>
</config>
<!-- Components -->
<config name="ComponentsDevDescription">
<value>Include some files to help with building GEGL filters and GIMP plug-ins in MSYS2</value>
</config>
<!-- Components -->
<config name="ComponentsTranslations">
<value>Translations</value>
</config>