Commit graph

2178 commits

Author SHA1 Message Date
Bruno Lopes
43a7d725bf tools: Support alternative iso_639-3 domain
This is one of the official filenames listed on iso-codes meson.build and
it is needed to work with iso-codes from vcpkg which uses that domain.
https://salsa.debian.org/iso-codes-team/iso-codes/-/blob/main/meson.build?ref_type=heads

The reason it was working with MSYS2 until now is that somehow
meson from MSYS2 manually copy the symlinks as files.
2026-04-06 21:33:33 -03:00
Jehan
9cab16c193 tools: fix defcheck.
We don't have excluded symbols in GIMP codebase.
2026-04-06 16:29:40 +02:00
Jehan
04ae810258 tools: add newline to debug strings.
Unlike print(), sys.std*.write() does not add a newline, which makes for
hard-to-visually-parse debug lines, all clumped up together.
2026-04-04 23:05:26 +02:00
Bruno Lopes
8b9ee6d2a8 app, tools: Use cross-platform g_getenv, not getenv
It uses the safe URCT function under the hood.
2026-03-30 21:36:54 -03:00
Jehan
0148fcbac1 docs, tools: generate Mardown versions of the man pages directly…
… from the main repository.

The new script is basically a copy of tools/man_to_md.py from the
gimp-web repository, with a few improvements.

This is meant to improve our release procedure, with much more
automatization and less manual steps.
2026-03-30 11:34:25 +02:00
Jehan
9bf31a4d55 tools: don't load fcntl on platforms where it's unavailable.
In particular, on Windows, we get this error:

> ModuleNotFoundError: No module named 'fcntl'

But we don't care about this module there anyway. This is only for macOS
builds.
2026-03-27 22:08:14 +01:00
Jehan
a7e39c16b1 tools: lock the script so that it can only be run once at a time on macOS.
This will be an alternative way to fix #14236, without needing to have
every usage depend on another (which is messy and bug-prone because then
we have to follow the list of dependencies and see which was the last
use of gimp_exe, and with the risk of errors depending on which build
options are ON or OFF).

This fixes such errors:

> error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
> for: /Users/Shared/work/GNOME/gimp/_build-x86_64/plug-ins/common/test-plug-ins/film/film (for architecture x86_64)
> option "-add_rpath /Users/Shared/work/GNOME/gimp/_build-x86_64/libgimpcolor" would duplicate path, file already
> has LC_RPATH for: /Users/Shared/work/GNOME/gimp/_build-x86_64/libgimpcolor
2026-03-27 16:03:33 +00:00
Jehan
d2f6867064 tools: print both errors and informational messages to stderr.
This script is now also used for usage where we pipe directly the stdout
output to a file, e.g. now to create the gimprc man page. We don't want
to have INFO messages in there.
2026-03-27 16:03:33 +00:00
Bruno Lopes
aba2a9b852 meson, tools: Add check for GDB when debug-self-in-build option is set 2026-03-24 06:58:30 -03:00
Bruno Lopes
4f76429885 tools: Fix GIMP_PYTHON_WITH_GI breaking cross-building
Closes: https://gitlab.gnome.org/GNOME/gimp/-/issues/16085
2026-03-22 16:32:38 -03:00
Bruno Lopes
e453dac63b tools: Forgot to exclude Windows from a section 2026-03-21 07:37:48 -03:00
Bruno Lopes
e83eef67a9 tools: Ensure python3 in-build symlinking does not run on Windows 2026-03-20 22:56:31 -03:00
Bruno Lopes
50627a445c meson: Restore virtual support to install .pdb generated by GCC
We will not use it since GCC is still broken (59d0e828)
but it is always good to have a complete script.
2026-03-17 18:59:18 -03:00
Bruno Lopes
6ec98fac00 tools: Support GNU objdump (from MSYS2) on defcheck.py 2026-03-17 12:56:34 -03:00
Alfred Wingate
2185168536 tools: include error message to ease debugging
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2026-03-15 18:24:30 -03:00
Alfred Wingate
4828b2d3f7 tools: allow use of NM env variable
Bug: https://bugs.gentoo.org/968162
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2026-03-15 18:24:30 -03:00
Bruno Lopes
755642e76a meson, app, tools: Organize ISO_CODES* macros after build failure report
I don't get how this could be failing because config.h is included on main.c,
but it it: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/2664#note_2699194
So, I noticed that that the macro prefix ISOCODES_ is "new", being introduced
with aba7316e. The pre-existing is ISOE_CODES. Let's unify trying to fix build.
2026-03-06 14:09:35 -03:00
Jehan
0587cbbc9b Issue #15713: Text tool "Language" names not localized on relocatable builds. 2026-03-05 16:29:14 -03:00
Bruno Lopes
605470cc05 tools: Add dumpbin support to defcheck.py
This is needed for MSVC environment.
2026-03-02 22:21:29 -03:00
Bruno Lopes
59f2fa45ca tools: Make defcheck.py CWD unambiguous
This is better for debugging when some error happens.
2026-03-02 16:50:41 -03:00
Bruno Lopes
d6f5205a89 tools: Port improved defcheck.py from gegl 2026-03-01 18:30:54 -03:00
Bruno Lopes
b7d89728c4 app, libgimpthumb, plug-ins, tools: Fix POSIX namespace warnings on MSVC 2026-02-28 10:06:46 -03:00
Bruno Lopes
6df22e2ba0 tools: Try to prevent race conditions on python3 symlink handling 2026-02-15 23:09:34 -03:00
Alfred Wingate
cae3be98df tools/gen-languages: query user locale before falling back to en_US
setlocale(LC_ALL, "") queries the user locale.

setlocale(LC_ALL, NULL) also queries the locale, but not the user
locale. It actually queries the programs locale, which by default is C.

Otherwise the user would need to have en_US.UTF-8 available no matter
what.

Check that derivates UTF8 of C locale aren't used as well.

Bug: https://bugs.gentoo.org/969468
Fixes: 88261f8b4c
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2026-02-02 17:25:49 +00:00
Bruno Lopes
61c078fa43 meson, tools: sys.executable is not the same as python.full_path()
This avoids using the python chosen by Meson's find_program(),
which is not the one from find_installation() and can not have GI.
2026-01-22 18:40:36 -03:00
Bruno Lopes
c8fd1d356a tools: Check LC_BUILD_VERSION before copying .dylibs
We should avoid macOS version mismatch on custom built libraries.
2026-01-05 22:20:03 -03:00
Bruno Lopes
391008e42f tools: Handle installations where Meson python do not have python3 symlink
We do check for python with import('python').find_installation() then
check for GI module support for introspection. However, this python is
not necessarely the one that will be found by .py plugins at build-time.
That is because the found python by Meson can not have a python3 symlink
but the python3 symlink is the one in-build GIMP uses fowlloing the shebang.

So, to we proper build GIMP on such environments, we can create a symlink.
That is needed for MacPorts where multiple pythons exist without a symlink
but this is useful for all environments because python3 is now unambiguous.
2026-01-04 17:56:32 -03:00
Bruno Lopes
c9ce259e9c gimp-data, tools: macOS assets are now built from Meson
Adresses #14236

We used to call ninja at Portfile, which is way suboptimal.
Now, we properly generate them from Meson if -Ddmg is true.
2026-01-03 22:17:18 -03:00
Bruno Lopes
cd4af46675 tools: Check for GIMP_TEMP_UPDATE_RPATH" binaries before patching
Similarly to what we do on tools/lib_bundle.py when setting LC_RPATH.
This is needed to avoid multiple install_name_tool conflicting.
2026-01-03 18:09:13 -03:00
Bruno Lopes
9a598a6fcd tools: Support for .framework on LC_LOAD_DYLIB section of lib_bundle.py
It will not bundle the framework but now correctly point to @rpath.

This will be specially useful since we do use Python.framework on macOS.
2026-01-03 15:10:21 -03:00
Bruno Lopes
c51fd7843f tools: Some libraries can have LC_RPATH set
I confirmed that few dependencies have LC_RPATH set so
we need to change these too, not only executables.
2025-12-30 19:28:42 -03:00
Bruno Lopes
cc44ae4579 tools: Add comment and fix variable on "codesign" section 2025-12-30 15:36:06 -03:00
Bruno Lopes
45c76ffb16 tools: Ad-hoc sign macOS binaries after LC_RPATH wizardry
This is needed for M-series chips.
2025-12-30 10:36:13 -03:00
Bruno Lopes
eb621a13b7 tools: Set LC_RPATH on binaries pointing to .dylib path
And also set the adjacent LC_LOAD_DYLIB and LC_ID_DYLIB.
All the 3 vars are needed for relocatable .app bundles.
2025-12-29 13:09:47 -03:00
Bruno Lopes
1b0492aff9 tools: Contents/Frameworks is the standard for libraries on macOS
See: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

I confirmed checking some 3P .app bundles and
indeed they do not use Contents/Resources/lib for libs.
2025-12-29 13:09:04 -03:00
Bruno Lopes
381ea0c6d2 build/windows: Move Windows .pdb utility to tools/
This reverts 63f5ea9d regarding the file naming

Since the script is an utility pretty much one-task, it suits better on tools,
similarly to what we do on babl and meson (but on these we put on root).
And, along with 8c0f92b3, it makes build/windows less scary with less files.
2025-12-26 19:15:15 -03:00
Bruno Lopes
4356895b73 tools: Add MSVC's dumpbin support to lib_bundle.py 2025-12-26 15:22:14 -03:00
Bruno Lopes
8c0f92b39a build, tools: Add initial macOS support to lib_bundle.py
It will be useful later in my WIP work to move macOS scripts to GIMP infra.
2025-12-26 15:22:02 -03:00
Jehan
10cf3f05ee tools: remove generate_changelog.sh.
We have not used this script since 2009.
2025-12-15 13:17:28 +01:00
Jehan
923b7e09b5 tools: fix versioning on successive RC releases. 2025-12-14 23:11:35 +01:00
Bruno Lopes
8748b8bb41
app, libgimpbase, plug-ins, tools: Include missing IO headers if on Windows
Otherwise, gimp fails to build on MSVC
2025-11-29 18:16:54 -03:00
Jehan
88261f8b4c Issue #13774: languages list is not localized on AppImage.
Seems like our CI runners are configured with POSIX locale. Both C and
POSIX locales are basically overriding any attempt to localize during
the build (setting LANGUAGE doesn't work) and unfortunately we are now
self-localizing the list of languages during build.

So let's add a bogus en_US.UTF-8 locale before setting LANGUAGE. This
should fix the issue. It would probably also fix the same issue for
various third-party packages if distributions' build machines are set
similarly!
2025-11-23 17:13:38 +00:00
Jehan
1ad2627eca tools: correctly parse RC versions. 2025-11-17 23:28:38 +01:00
Bruno Lopes
f09007507f
Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.
2025-10-03 18:31:53 -03:00
Bruno Lopes
ad9dbf2c8b
tools: Drop bashism/gnushism in read command 2025-10-01 21:26:25 -03:00
Jehan
8c910c2b6b tools: improve release stats.
- Interactively query the release version from standard input.
- Compute the logical previous version but also the previous release in
  time. For instance the logical previous release of GIMP 3.0.6 will be
  3.0.4 but the time-wise previous release will be 3.1.4.
- Some statistics will use the logical previous release whereas others
  the time-wise one.
2025-10-01 14:39:51 +02:00
Bruno Lopes
c13bf1af19
build: Move loose scripts in meson subdir to tools
The build dir looks "prettier" without the meson subdir.
With prettier I mean: just the OSes subdirs.
2025-09-24 09:07:47 -03:00
Jehan
aa9e437d42 tools: better logic for the splash image text.
Change of series must always have their own splash image (which will
stay the same within the whole series).
Development releases though will have a new splash image most of the
time (but it is not mandatory).

See rule edicted in commit Infrastructure/gimp-web-devel@061f544.
2025-09-22 12:39:23 +02:00
Jehan
ec4daa643e tools: use release news alias URL.
While we don't know the accurate URL of every release before
publication, we now know the alias it will have in the shape:
https://www.gimp.org/release/<version>

Cf. commit Infrastructure/gimp-web@bca40810
2025-09-22 12:30:08 +02:00
Alx Sa
c8cf2219ce libgimpbase, libgimpwidgets, tools, app: Remove warnings
This patch fixes a few (mostly Windows-specific) warnings on build.
* Hides functions like gimp_get_foreign_window () and variables
like transient_set that aren't used in Windows.
* Changes hollow_g_shell_quote () to not return a const gchar *,
since the value it returns is actually not const.
* Cast update_interval to double to remove warning about mixing
enums and doubles in division.
2025-09-07 18:41:13 +00:00