mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
meson: icons are now installed by making gimp-data a meson subproject.
This commit is separate from the previous to make it immediately clear (by comparing files) that the previous commit is a simple move with no modification whatsoever of the icons/ directory, i.e. the symmetrical removal of add commit gimp-data@8b54490. We now clone gimp-data as a meson subproject. I am currently testing the subproject feature though I am doubting a bit because of its limitations: the git clone is not updated automatically, nor are errors clear. Therefore it would be easy to end up with outdated data for developers not manually and regularly running: > meson subprojects update Worse, it looks like even when updating the suproject, it fails to be properly reconfigured. See: https://github.com/mesonbuild/meson/issues/12898
This commit is contained in:
@@ -255,7 +255,8 @@ icons_apply_theme (Gimp *gimp,
|
||||
gchar *path;
|
||||
|
||||
path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
|
||||
"icons", icon_theme_name, NULL);
|
||||
"subprojects", "gimp-data", "icons",
|
||||
icon_theme_name, NULL);
|
||||
file = g_file_new_for_path (path);
|
||||
|
||||
applied = gimp_icons_set_icon_theme (file);
|
||||
|
13
meson.build
13
meson.build
@@ -1203,10 +1203,6 @@ else
|
||||
warnings += vec_warning
|
||||
endif
|
||||
|
||||
native_glib_minver = '2.2.0'
|
||||
native_glib = dependency('glib-2.0', version: '>='+native_glib_minver, native: true)
|
||||
native_rsvg = dependency('librsvg-2.0', version: '>='+rsvg_minver, native: true)
|
||||
|
||||
# Running tests headless
|
||||
xvfb_run = find_program('xvfb-run', required: get_option('headless-tests'))
|
||||
dbus_run_session = find_program('dbus-run-session', required: get_option('headless-tests'))
|
||||
@@ -1820,10 +1816,17 @@ subdir('cursors')
|
||||
subdir('data')
|
||||
subdir('desktop')
|
||||
subdir('etc')
|
||||
subdir('icons')
|
||||
subdir('menus')
|
||||
subdir('themes')
|
||||
|
||||
# Loading gimp-data subproject, the versions must be in sync.
|
||||
gimp_data = subproject('gimp-data', version: '=' + gimp_version,
|
||||
default_options: [
|
||||
'gimp-datadir=' + gimpdatadir,
|
||||
])
|
||||
icons_imgs_sources = gimp_data.get_variable('icons_imgs_sources')
|
||||
icons_core_sources = gimp_data.get_variable('icons_core_sources')
|
||||
|
||||
# Libraries (order here is important!)
|
||||
subdir('libgimpcolor')
|
||||
subdir('libgimpmath')
|
||||
|
4
subprojects/gimp-data.wrap
Normal file
4
subprojects/gimp-data.wrap
Normal file
@@ -0,0 +1,4 @@
|
||||
[wrap-git]
|
||||
url = https://gitlab.gnome.org/GNOME/gimp-data
|
||||
revision = main
|
||||
depth = 1
|
@@ -1,88 +0,0 @@
|
||||
/* colorsvg2png.c
|
||||
* Copyright (C) 2018 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <glib/gprintf.h>
|
||||
#include <librsvg/rsvg.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GError *error = NULL;
|
||||
RsvgHandle *handle;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
RsvgRectangle target_rect;
|
||||
|
||||
gchar *input;
|
||||
gchar *output;
|
||||
gint dim;
|
||||
gint retval = 0;
|
||||
|
||||
if (argc != 4)
|
||||
{
|
||||
g_fprintf (stderr, "Usage: colorsvg2png svg-image png-output size\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
input = argv[1];
|
||||
output = argv[2];
|
||||
dim = (gint) g_ascii_strtoull (argv[3], NULL, 10);
|
||||
if (dim < 1)
|
||||
{
|
||||
g_fprintf (stderr, "Usage: invalid dimension %d\n", dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
handle = rsvg_handle_new_from_file (input, &error);
|
||||
if (! handle)
|
||||
{
|
||||
g_fprintf (stderr,
|
||||
"Error: failed to load '%s' as SVG: %s\n",
|
||||
input, error->message);
|
||||
g_error_free (error);
|
||||
return 1;
|
||||
}
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dim, dim);
|
||||
cr = cairo_create (surface);
|
||||
|
||||
target_rect.x = target_rect.y = 0;
|
||||
target_rect.width = target_rect.height = dim;
|
||||
|
||||
if (! rsvg_handle_render_document (handle, cr, &target_rect, NULL))
|
||||
{
|
||||
g_fprintf (stderr,
|
||||
"Error: failed to render '%s'\n",
|
||||
input);
|
||||
retval = 1;
|
||||
}
|
||||
|
||||
if (retval == 0 &&
|
||||
cairo_surface_write_to_png (surface, output) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
g_fprintf (stderr,
|
||||
"Error: failed to write '%s'\n",
|
||||
output);
|
||||
retval = 1;
|
||||
}
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
cairo_destroy (cr);
|
||||
g_object_unref (handle);
|
||||
|
||||
return retval;
|
||||
}
|
@@ -46,17 +46,3 @@ executable('kernelgen',
|
||||
include_directories: rootInclude,
|
||||
install: false,
|
||||
)
|
||||
|
||||
colorsvg2png = executable('colorsvg2png',
|
||||
'colorsvg2png.c',
|
||||
native: true,
|
||||
dependencies: [
|
||||
native_glib,
|
||||
native_rsvg
|
||||
],
|
||||
# In case b_sanitize was set, we don't really care if the tool has issues (in
|
||||
# particular we experienced some memory leaks with b_sanitize=address, within
|
||||
# librsvg and we don't want this to break the build).
|
||||
override_options: [ 'b_sanitize=none' ],
|
||||
install: false,
|
||||
)
|
||||
|
Reference in New Issue
Block a user