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/.
This commit is contained in:
Jehan 2022-01-31 22:08:56 +01:00
parent 92a919aee1
commit ae6c58652e
19 changed files with 281 additions and 35 deletions

View File

@ -2601,22 +2601,22 @@ WARNING: vector icons are disabled. Be aware that librsvg is still
add_deps_error([gtk-encode-symbolic-svg],
[Could not find gtk-encode-symbolic-svg in your PATH.])
fi
fi
if pkg-config --atleast-version=glib_required_version glib-2.0 &&
pkg-config gio-2.0; then
NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0`
NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0`
if pkg-config --atleast-version=rsvg_required_version librsvg-2.0; then
NATIVE_SVG_LIBS=`pkg-config --libs librsvg-2.0`
NATIVE_SVG_CFLAGS=`pkg-config --cflags librsvg-2.0`
AC_SUBST(NATIVE_SVG_CFLAGS)
AC_SUBST(NATIVE_SVG_LIBS)
else
add_deps_error([native librsvg-2.0], [Could not find librsvg for the build system.])
fi
if pkg-config --atleast-version=glib_required_version glib-2.0 &&
pkg-config gio-2.0; then
NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0`
NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0`
if pkg-config --atleast-version=rsvg_required_version librsvg-2.0; then
NATIVE_SVG_LIBS=`pkg-config --libs librsvg-2.0`
NATIVE_SVG_CFLAGS=`pkg-config --cflags librsvg-2.0`
AC_SUBST(NATIVE_SVG_CFLAGS)
AC_SUBST(NATIVE_SVG_LIBS)
else
add_deps_error([native glib], [Could not find GLib for the build system.])
add_deps_error([native librsvg-2.0], [Could not find librsvg for the build system.])
fi
else
add_deps_error([native glib], [Could not find GLib for the build system.])
fi
AC_SUBST(NATIVE_GLIB_LIBS)

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -0,0 +1,41 @@
icons_dir = size + 'x' + size
if have_vector_icons
icon_dialog_question = custom_target('icon-dialog-question',
input : [ '../scalable/dialog-question.svg' ],
output: [ 'dialog-question.png' ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: false,
)
icon_wilber_eek = custom_target('icon-wilber-eek',
input : [ '../scalable/gimp-wilber-eek.svg' ],
output: [ 'gimp-wilber-eek.png' ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: false,
)
else
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
icon_tgt = custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
if icon == 'dialog-question'
icon_dialog_question = icon_tgt
elif icon == 'gimp-wilber-eek'
icon_wilber_eek = icon_tgt
endif
endforeach
endif

View File

@ -0,0 +1,17 @@
icons_dir = size + 'x' + size
foreach icon : source_icons
icon_name = icon + '.png'
input_path = '../scalable/' + icon + '.svg'
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
colorsvg2png, '@INPUT@', '@OUTPUT@', size,
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -79,6 +79,10 @@ noinst_DATA = \
gimp-core-pixbufs.gresource.xml \
gimp-icon-pixbufs.gresource.xml
if ENABLE_VECTOR_ICONS
noinst_DATA += $(CORE_IMAGES) $(ICON_IMAGES)
endif
CLEANFILES = $(noinst_DATA)

View File

@ -16,6 +16,9 @@ if have_vector_icons
'files': [ 'bitmap_64-always', ],
},
]
# Only process the 64x64 icons for the 2 resource icons.
subdir('64')
else
build_icons = {
'12': [ 'bitmap_12', ],

View File

@ -1048,11 +1048,11 @@ else
'''
warning(vec_warning)
warnings += vec_warning
native_glib = dependency('glib-2.0', version: '>='+glib_minver, native: true)
native_rsvg = dependency('librsvg-2.0', version: '>='+rsvg_minver, native: true)
endif
native_glib = dependency('glib-2.0', version: '>='+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'))

View File

@ -61,21 +61,17 @@ if ENABLE_VECTOR_ICONS
#noinst_PROGRAMS = compute-svg-viewbox
#DISTCLEANFILES = compute-svg-viewbox$(BUILD_EXEEXT)
else
colorsvg2png_SOURCES = colorsvg2png.c
colorsvg2png_CFLAGS = $(NATIVE_GLIB_CFLAGS) $(NATIVE_SVG_CFLAGS)
colorsvg2png_LDADD = $(NATIVE_GLIB_LIBS) $(NATIVE_SVG_LIBS)
endif
# Build tools which must be built for the build platform.
colorsvg2png_SOURCES = colorsvg2png.c
colorsvg2png_CFLAGS = $(NATIVE_GLIB_CFLAGS) $(NATIVE_SVG_CFLAGS)
colorsvg2png_LDADD = $(NATIVE_GLIB_LIBS) $(NATIVE_SVG_LIBS)
all-local: colorsvg2png$(BUILD_EXEEXT)
noinst_PROGRAMS = colorsvg2png
DISTCLEANFILES = colorsvg2png$(BUILD_EXEEXT)
endif
AM_CPPFLAGS = \
-DGIMP_APP_VERSION=\"@GIMP_APP_VERSION@\" \

View File

@ -36,14 +36,12 @@ executable('kernelgen',
install: false,
)
if not have_vector_icons
colorsvg2png = executable('colorsvg2png',
'colorsvg2png.c',
native: true,
dependencies: [
native_glib,
native_rsvg
],
install: false,
)
endif
colorsvg2png = executable('colorsvg2png',
'colorsvg2png.c',
native: true,
dependencies: [
native_glib,
native_rsvg
],
install: false,
)