Commit Graph

2079 Commits

Author SHA1 Message Date
Bruno Lopes 28fc941c53 build, devel-docs, po-*, tools: remove Autotools remnants
- Remove files not used by meson
- Remove autotools references in texts
2024-01-14 10:38:12 -03:00
Jehan d88f6f9733 app, devel-socs, icons, plug-ins, tools: remove various autotools artifacts.
* generate-icon-makefiles.py was a tool to generate the icon-list.mk files.
* mkgen.pl was used to generate plug-ins/common/Makefile.am
2023-09-27 15:39:39 +02:00
Jacob Boerema 18408ce966 app, libgimp, libgimpwidgets, plug-ins, etc: rename behaviour to behavior
We use US English which uses behavior. So we replace all occurrences of
behaviour.

Most notable is File Open behavior in preferences. Besides that several
mentions in function documentation and a few in comments.
2023-07-21 15:35:23 -04:00
Jehan c21dbc8a20 tools: better support of using --runtime with --beta or --nightly. 2023-06-30 18:35:06 +02:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Simon Budig 41b47d1dde colorsvg2png: fix deprecation, slightly changing the behaviour 2023-05-21 01:10:51 +02:00
Alx Sa b2874464f5 icons: Revert most of !909
Per @Jehan, this solution would prevent default icons from being loaded
in custom themes if they did not include their own version.
The only thing kept from !909 is the replacement of hardcoded strings
in a few files with constants defined in gimpicons.h.
2023-05-14 21:54:41 -04:00
Alx Sa bca4535c40 icons: Restore GIMP icons replaced by GTK defaults
Five icons in the Layer dockable were being replaced by GTK defaults at
runtime. A "gimp-" prefix was added so that GIMP's version would always
be used. A few dialogues were fixed to use constants rather than
hardcoding the filename, to make it easier to update the icon in the
future.
2023-04-30 13:58:39 +00:00
Jehan 0b75fbd91c tools: do not sanitize build tools. It's OK if they leak a bit.
Especially as our code does not actually leak as far as we can see. It looks
like librsvg might not play well with -fsanitize=address (possibly having real
leaks or false positives).
2023-02-22 10:57:36 +01:00
Jehan 31672ee340 tools: avoid build-only tool with memory issues. to break the whole build.
Cf. the previous commit: colorsvg2png has a memory leak in librsvg (so we can't
fix it easily). In any case, it's just a one-time-use tool, we don't really need
to focus on its memory bugs as long as it does its job to make icons.
2023-02-16 20:07:41 +01:00
Jehan 8e32da9889 tools: better memory handling in colorsvg2png.
Actually even with this, b_sanitize=address still detects a memory leak. After
some testing, it seems that just creating a RsvgHandle, then freeing it
immediately is enough to leak some data, which means the leak is in librsvg.
2023-02-16 20:07:41 +01:00
Jehan c6bc4fbe38 tools: add a --runtime option to flatpak-releases script.
This will allow to also check the list of runtime builds. We could see an
example in a report (#8993) where someone had the latest flatpak build of GIMP
but an older build of the runtime flatpak. So they had a bug because of a
dependency which got updated since then.
2022-12-26 18:53:51 +01:00
Jehan 9347c9d5fd tools: add the flatpak commit info to flatpak-releases script output.
This is useful when wanting to check someone is using the last flatpak build in
a bug report.
2022-12-26 18:18:54 +01:00
Thomas Klausner 22dee60a9d Issue #8605: Unportable test(1) operator in tools/extract-vector-icon.sh 2022-09-10 23:08:06 +02:00
Hanabishi 358ba0991f Cleanup meson symlinks
More elegant solution to avoid platform-dependent executable extension detection
2022-08-31 13:10:13 +00:00
Jehan 9ff1358e0b Issue #8552: Failed to build using gimp-2.99.12-autotools.tar.bz2 tarball. 2022-08-31 00:46:29 +02:00
Jehan 9ce27be989 meson: improve/fix previous commit from MR !725.
- Setting an exec_dir variable is an error. As meson docs says, if
  relative, it is installed relatively to prefix anyway: "If this is a
  relative path, it is assumed to be relative to the prefix."
  On the other hand, it would make problems if someone tried to set an
  absolute bindir.
  Moreover it is a lot clearer now. When we want to install in the
  binary directory unconditionally, then get_option('bindir') is the
  meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
  for Windows or macOS and libexecdir for all other platforms, at least
  that's how it's set in the autotools build. So let's keep both builds
  consistent.
- Make a hopefully clearer description for enable-default-bin option.
  Let's clarify this is just about creating unversionning links pointing
  to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
  during meson configure, for better discovery.

For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
2022-08-29 15:43:25 +02:00
Hanabishi 879f7b48de Issue #8546: Meson options fixes
- Implement `enable-console-bin` meson option
- Fix wrong `enable-default-bin` behavior in docs
- Implement `enable-default-bin` meson option
2022-08-29 13:41:08 +00:00
Jehan efbc422a9d tools: small update to the stats script.
- GTK+3 themes are CSS.
- Also check for cursor updates.
2022-08-28 15:17:19 +02:00
Jehan 20d6ae85ea tools: fix generation of welcome-dialog-data.[ch].
This was broken because of the port to gettext (XML tag names for
translatable text were not prefixed by an underscore anymore).
2022-08-21 21:21:38 +02:00
Jehan 106f2a061d Issue #8145: meson: generation of '*-enums.c' files.
Our meson build system was not properly building the enums.c file,
because they are versionned.

I did a similar trick as what I did for the pdbgen, which is that I used
a wrapper script around the existing perl script, which sets proper
options and generate a stamp file in the end (which is considered by
meson as the actual custom target, not the C file since it is generated
in the source dir).

The most important part is that the stamp file is a generated header
source (not just a random text file) which is **included** by the
generated C file. This is what will force meson to regenerate the C file
if the header is updated, **then** build using this new version, not use
an outdated versionned version (which would make for hard to diagnose
bugs), through the indirection of the intermediate stamp header.

See #4201.
See also: https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080742592
2022-08-01 19:59:53 +02:00
Jehan f22b82f22f tools: only display "trouble reading […]" message when the script fails.
Displaying it all the time when we fail the first attempt is confusing
as it is expected to fail in the meson build (since build libraries are
in different folders). Instead only output the error message when both
known paths failed, i.e. when we fail the script (and write down both
attempted path in the error message).
2022-08-01 17:07:30 +02:00
Jehan 4c77c5acaf issue #8274: Port .def files check in meson.
The check script now takes into account both the autotools and meson
file hierarchy (in autotools, built libs are in .libs/ subdirs).

Also it now properly fails on missing lib.
2022-07-31 20:05:40 +02:00
Jehan 1866b4c5f8 configure, tools: colorsvg2png must be built as native build executable. 2022-04-01 18:11:55 +02:00
Jan Tojnar 3279bb3351 tools: Use env in shebangs
Having perl and bash in /usr/bin/ is less common than having them on PATH
(e.g. Nix does not have them there).
2022-03-18 16:05:58 +00:00
Jehan 10d8765101 app, tools: pre-process release items from AppStream as well.
Since we are pre-processing anyway the AppStream metadata file (because
appstream-glib doesn't pass unknown XML attributes, cf. a previous
commit), it does feel silly now to continue loading the file at runtime
too. Let's just pre-process more data into the constructed C files, i.e.
get the introduction paragraphs and the change items too.

The only other remaining advantage of appstream-glib was that it was
handling the localization but since we also have these localized strings
in our gettext files, we can as well translate with gettext as any other
strings and it works just fine.

It will also get rid of any packaging issue, forgetting to package the
metadata file (as we had on the Windows installer, and still have on the
macOS package). Now it will just always work because data is internal.
2022-03-08 16:32:58 +01:00
Jehan 3904c40dc1 app, tools: allow creating demo "scenarios" from the AppStream metadata.
The idea is to add some "demo" attribute to a list item inside the
<release> tag, since we already decided that (for now at least) we'd
keep a strict "intro + list" logics, as we did until now.

This demo attribute uses an internal format to specify successive
widgets to blink (like a demo path towards a feature). For now, what it
allows is:

* raise the toolbox, select a tool and blink the tool button.
* raise a dockable, blink any widgets in there.

Now it is still limited and needs to evolve. In particular:

* What happens if the blinked tool button was explicitly removed from
  Preferences? Should we re-add it for the demo? And once done, should
  we remove it again? Then should we select back the tool previously
  selected?
* What happens if the dockable widget is not visible? Should we allow
  changing the settings to be able to demo correctly the new/changed
  settings? Should it be temporary? If temporary, it can be annoying as
  you'd still have to look attentively the demo to find back the path to
  the new settings. If not temporary, some people may dislike we touch
  their settings.
* What if docks are hidden? Should we unhide them, then hide them back
  after demo time?

Also regarding the implementation: originally I wanted to just grab the
demo attribute directly from the AppStream metadata file, but I realized
that appstream-glib cleans out unknown attribute from the XML. I could
then simply parse the file with a generic XML parser, but I found
simpler to pre-parse it into a header built within GIMP. I still use
appstream-glib at runtime as it takes care of localization for us
(though in the same time, we also have the localization in the main po
files, so maybe we could just embed the release note strings as well).

See appstream-glib report: https://github.com/hughsie/appstream-glib/issues/431
2022-03-05 23:39:14 +01:00
Jehan 63a17608ef icons, tools: review visible, linked and lock icons.
They all seem to only be needed in 16x16. As a consequence, the 20x20
category disappears.
2022-02-01 15:31:49 +01:00
Jehan 03272a9d54 devel-docs, tools: move the release-stats script to tools/.
Makes more sense and I am trying to make the devel-docs more readable
(which includes less crowded, especially with scripts which are not
really docs).
2022-02-01 14:34:46 +01:00
Jehan ae6c58652e icons, tools: fix the CI when building icon resources with vector icons.
Ok that was a bit of a mess with the 4 build cases (combinations of
meson, autotools, vector and raster icons). I *think* this is now OK.

Basically we still need to build the colorsvg2png tool even when
installing vector icons, just for the purpose of the 2 icons
dialog-question and gimp-wilber-eek which we compile into GLib resources
from PNG images.

Also it looks like I completely forgot to add the subdir meson.build in
icons/Color/.
2022-01-31 22:33:30 +01:00
Jehan 92a919aee1 icons, tools: touch the meson.build files when regenerating icon list.
Even though we only generate makefiles, we actually want to make meson
aware of the list change because it continues using the file list from
the previous configuration. We do this by "touching" the meson.build
files, i.e. editing their access time.

Also rebuild the icon-list as there are small changes forgotten.
2022-01-31 21:52:26 +01:00
Jehan ddd9fe8bdc icons, tools: new icon lists for modules. 2022-01-31 17:59:11 +01:00
Jehan c0431df6f5 icons, tools: new 'templates' icon list.
Some points to note:
- gimp-web and gimp-toilet-paper had some usage elsewhere so I also left
  them in 2 of the more generic size files.
- I remove gimp-floppy altogether as it's used nowhere in any of our
  code or data files.
2022-01-31 16:12:19 +01:00
Jehan 9052762225 icons: tool icons are another big group of icons handled all the same. 2022-01-31 15:18:10 +01:00
Jehan d2db539591 icons, tools: start grouping icons by their usage.
There are some clear and obvious groups in the icons. For instance, the
Preferences icons are one of them. Looking up the code, we only use them
in 16px (in Preferences side menu) and 48px (in Preferences page
headers). Until now, we were storing in other unrelated size (22px) and
also the lists per-sizes were not consistent. Some icons were missing
here, other there.

With this new organization, the Preferences icons are listed in a single
file, ensuring usage and contents consistency. Also it allows to install
them only for the needed sizes (note that it is possible that they might
be needed in different size, for instance with custom themes; but we
can't just randomly distribute icons in all sizes; or to be more
accurate, this is exactly why we encourage rather the SVG/scalable
icons, so if some people explicitly go for raster icons, they also get
the drawbacks which come with).

Last note: it may be possible that some icons end up in different
"semantic" icon group. This is not a problem with this new organization
as my scripts handle duplicates gracefully.
2022-01-31 14:52:42 +01:00
Jehan bc999325be icons, tools: new colorsvg2png tool to build PNG out of SVG.
Build-time tool, which basically just rasterize SVG images (it doesn't
do anything special like gtk-encode-symbolic-svg which creates special
PNG for GTK to recolor them).

It looks like I had this prepared since 2018 according to file header,
but I just never finished doing it! :P

Basically now PNG icons of the Color icon themes do not need anymore to
be committed in the repository. They will be generated from the SVG
icons.

Also adding a missing icon from the 16px list (the Playground icon for
Preferences dialog was needed in 16x16 as well, yet missing).
2022-01-31 14:52:42 +01:00
Jehan 0747db5bff icons: 24x24 SVG icons are redundant.
It may actually be meaningful to have redundant vector icons at specific
size, for instance when you want sligthly different designs (e.g. more
details at bigger size). But here looking at our 24x24 vector icons, it
doesn't look like it at all. It's mostly the exact same icons,
duplicated (with some forgotten).

Makes no sense here. So let's simply install the scalable/ icons for all
size, and that's it.
2022-01-31 14:52:42 +01:00
Jehan 6e9b137f50 icons, tools: allow newlines in the icon lists.
This is nicer for icon organization, allowing to group them by
categories (Freedesktop, GTK and GIMP namespace icons).
2022-01-27 16:18:55 +01:00
Jehan 7a2f4b82f0 icons, tools: add a comment to generated icon-list.mk.
Just so that someone who happens to look in there is not tempted to
modify these files directly and get some instructions.
The comment is inspired from other similarly generated Makefile.am (i.e.
in plug-ins/commons/).
2022-01-27 01:00:20 +01:00
Jehan fc12d9e414 tools: new tool to generate the icon-list.mk-s from icons/icon-lists/…
… listing.

This way, both the Color and Symbolic icon themes, both on meson and
autotools build systems all share the exact same list of icons.

I think there are still improvements to be done on what we list and
chosen sizes and icon categories. But this step is about just getting on
the same state as we currently are, simply with shared listings. Once we
are there, we can go forward.
2022-01-27 00:49:12 +01:00
Jehan 66cfa75291 tools: add a `flatpak-releases` tool for quick testing with Flatpak.
Sometimes we want to make quick tests on old versions of GIMP.
Rebuilding from source is definitely still an option, yet with flatpak,
we have many past builds available easily to us (at time of writing: 19
stable builds, 12 dev point-release builds and at least 3 nightlies —
though I seem to have issues with signatures on gnome-nightly right now,
so maybe there are more!).

There are some command lines needed to check the build history, then to
install a specific build, which I explained in developer docs (see
devel-docs/debugging-tips.txt, section "Testing older GIMP versions").
Yet it's clearly cumbersome and slow so I wrote this script today to
automatize the process a bit.

Running simply this command will list all available releases on the
Flathub repository (adding --beta or --nightly will list the development
releases and nightly builds instead):

$ tools/flatpak-releases

The listing will contain a topic describing the build as well as the
date, all this prefixed by a number. For instance, this is an excerpt of
the output for the dev releases:

$ tools/flatpak-releases --beta
 0: Update dependencies (127a0fa7) [2022-01-13 16:59:43 +0000]
 1: Issue #106:  File->Create->From Screenshot not working. (9c831b14) [2021-12-14 21:46:52 +0000]
 2: Release GIMP 2.99.8. (908bf5b0) [2021-10-20 20:29:00 +0000]
 3: Release GIMP 2.99.6. (e04355dd) [2021-04-26 14:08:32 +0000]
 …

The last build updates dependencies, the previous one fixes some
specific issue and the 2 previous ones are point releases.
Now say I needed to test/compare some behavior with how it was in 2.99.6
(e.g. to verify a regression), I would then run:

$ tools/flatpak-releases --beta -3

This would install this specific dev build number 3. In just 2
easy-to-remember commands and a few seconds, we can therefore list and
install specific Flatpak builds.
2022-01-22 16:04:35 +01:00
Jehan 99202c43a4 tools: win32_command() return value is never freed.
On Windows, the macros COPY, REMOVE and REMOVE_DIR are allocated
strings, unlike on other platforms, so the way we use these returned
values, they are never freed.
Instead make win32_command() keep a copy of the allocated string as
static to the function and free it there at each next call (the returned
value being type-casted to (const gchar *)). It will still leak the last
string, but anyway gimptool is short-lived.

Also it should silence static analyzers.
2021-10-21 12:31:55 +02:00
Jehan cb1f01a42b tools: update the build-only tool compute-svg-viewbox.
It now uses rsvg_handle_get_geometry_for_layer() instead of
rsvg_handle_get_(position|dimensions)_sub() which have been deprecated
in favor of the new function which returns accurate (double) positioning
and size.

Back when I first made this build tool, librsvg had several blocking
bugs to make icon extraction work properly. This seems to improve
nicely.

Nevertheless I still don't build this tool because after testing, more
bugs remain and icon extraction is still not right. Just updating the
code to undeprecate it but leave the build commented out for now. ;-(

See librsvg#134, librsvg#128 and librsvg#250 for bug reports following
these issues.
2020-08-28 20:25:40 +02:00
Ell 76f9e5feaf tools: add performance-log-progressive-coalesce.py; use in performance-log-viewer
Add a new performance-log-progressive-coalesce.py tool, which
coalesces partial address maps in progressive performacne logs into
a single global address map, suitable for processing by the rest of
the tools.

Use the new tool as part of the pipeline in performance-log-viewer.
2020-07-30 01:04:40 +03:00
Ell e5fe1ef152 tools: add performance-log-close-tags.py, use in performance-log-viewer
Add a new performance-log-close-tags.py tool, which closes unclosed
tags in incomplete performance logs, allowing the rest of the
perofmance-log tools to process them.  This is necessary for
unfinished progressive logs.

Use the new tool as part of the pipeline in performance-log-viewer.
2020-07-30 01:03:38 +03:00
Ell 84ff130e18 tools: in performance-log-viewer.py, handle markers with > INT_MAX timestamps 2020-03-06 12:37:06 +02:00
lillolollo bed5fe37d8 tools, fix implicit declaration of function atoi warning
(cherry picked from commit 1ca3d99fbc)
2019-12-11 21:59:11 +01:00
luzpaz 44d10e458c Fix various typos
Found via `codespell` (v1.17.0.dev0)
2019-09-21 17:10:46 +00:00
Jehan 8fa7b5bc74 tools: clean up patch from merge request !36.
Commit 283ec1da0f previously pushed had some coding style bugs, which
unfortunately couldn't be fixed before pushing because the platform
doesn't allow it and the original contributor is not available lately.
Let's fix these.
2019-09-16 09:53:24 +02:00
Sergio Jiménez Herena 283ec1da0f issue #2221: gimptool should install plug-ins into subfolders 2019-09-16 07:26:56 +00:00