[gimp] icons, tools: fix the CI when building icon resources with vector icons.



commit ae6c58652e904282b410253c757a974d4d1fc8f7
Author: Jehan <jehan girinstud io>
Date:   Mon Jan 31 22:08:56 2022 +0100

    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/.

 configure.ac                | 26 +++++++++++++-------------
 icons/Color/12/meson.build  | 17 +++++++++++++++++
 icons/Color/128/meson.build | 17 +++++++++++++++++
 icons/Color/16/meson.build  | 17 +++++++++++++++++
 icons/Color/18/meson.build  | 17 +++++++++++++++++
 icons/Color/192/meson.build | 17 +++++++++++++++++
 icons/Color/20/meson.build  | 17 +++++++++++++++++
 icons/Color/22/meson.build  | 17 +++++++++++++++++
 icons/Color/24/meson.build  | 17 +++++++++++++++++
 icons/Color/256/meson.build | 17 +++++++++++++++++
 icons/Color/32/meson.build  | 17 +++++++++++++++++
 icons/Color/48/meson.build  | 17 +++++++++++++++++
 icons/Color/64/meson.build  | 41 +++++++++++++++++++++++++++++++++++++++++
 icons/Color/96/meson.build  | 17 +++++++++++++++++
 icons/Color/Makefile.am     |  4 ++++
 icons/Color/meson.build     |  3 +++
 meson.build                 |  6 +++---
 tools/Makefile.am           | 12 ++++--------
 tools/meson.build           | 20 +++++++++-----------
 19 files changed, 281 insertions(+), 35 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e2bb934db1..da57838ab4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
diff --git a/icons/Color/12/meson.build b/icons/Color/12/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/12/meson.build
@@ -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
+
diff --git a/icons/Color/128/meson.build b/icons/Color/128/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/128/meson.build
@@ -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
+
diff --git a/icons/Color/16/meson.build b/icons/Color/16/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/16/meson.build
@@ -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
+
diff --git a/icons/Color/18/meson.build b/icons/Color/18/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/18/meson.build
@@ -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
+
diff --git a/icons/Color/192/meson.build b/icons/Color/192/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/192/meson.build
@@ -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
+
diff --git a/icons/Color/20/meson.build b/icons/Color/20/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/20/meson.build
@@ -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
+
diff --git a/icons/Color/22/meson.build b/icons/Color/22/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/22/meson.build
@@ -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
+
diff --git a/icons/Color/24/meson.build b/icons/Color/24/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/24/meson.build
@@ -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
+
diff --git a/icons/Color/256/meson.build b/icons/Color/256/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/256/meson.build
@@ -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
+
diff --git a/icons/Color/32/meson.build b/icons/Color/32/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/32/meson.build
@@ -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
+
diff --git a/icons/Color/48/meson.build b/icons/Color/48/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/48/meson.build
@@ -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
+
diff --git a/icons/Color/64/meson.build b/icons/Color/64/meson.build
new file mode 100644
index 0000000000..09f2ff18d4
--- /dev/null
+++ b/icons/Color/64/meson.build
@@ -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
diff --git a/icons/Color/96/meson.build b/icons/Color/96/meson.build
new file mode 100644
index 0000000000..b867083a68
--- /dev/null
+++ b/icons/Color/96/meson.build
@@ -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
+
diff --git a/icons/Color/Makefile.am b/icons/Color/Makefile.am
index 0adf7327cb..007f7c9205 100644
--- a/icons/Color/Makefile.am
+++ b/icons/Color/Makefile.am
@@ -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)
 
 
diff --git a/icons/Color/meson.build b/icons/Color/meson.build
index ebeb3b76cb..405cbdcf5e 100644
--- a/icons/Color/meson.build
+++ b/icons/Color/meson.build
@@ -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', ],
diff --git a/meson.build b/meson.build
index 1de77eedf7..709c82260c 100644
--- a/meson.build
+++ b/meson.build
@@ -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'))
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 9390d800f3..eaf1b0ff8b 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -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@\"               \
diff --git a/tools/meson.build b/tools/meson.build
index 802f441925..0a18d66080 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -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,
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]