icons: remove use of meson 'fs' module.

I realize that this module is available since meson 0.53.0 though our
current requirement is meson 0.50.0.
Note sure why meson was not popping any warning (normally it does when
we use a feature younger than the minimum requirement; but maybe this
doesn't work for modules).

Anyway this does the same thing without the 'fs' module, and maybe even
better (we know which icons should be converted or used from source, no
need to add any test logics here).
This commit is contained in:
Jehan 2022-01-26 12:43:02 +01:00
parent 8f0d67779c
commit 8aee873c95
3 changed files with 27 additions and 36 deletions

View File

@ -4,20 +4,13 @@ foreach icon : source_icons
icon_name = icon + '-symbolic.symbolic.png'
input_path = '../scalable/' + icon + '-symbolic.svg'
if fs.exists(input_path)
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
gtk_encode_symbolic_svg, '-o', '@OUTDIR@', '@INPUT@', icons_dir
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
else
# In size 64, some icons are not generated from vector images.
install_data(icon + '.png',
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endif
custom_target(icon_name,
input : [ input_path ],
output: [ icon_name ],
command: [
gtk_encode_symbolic_svg, '-o', '@OUTDIR@', '@INPUT@', icons_dir
],
install: true,
install_dir: gimpiconsdir / theme / icons_dir / 'apps',
)
endforeach

View File

@ -6,19 +6,6 @@ if have_vector_icons
#'bitmap_64-system': [ '64x64', '64', '.png' ],
'bitmap_64-always': [ '64x64', '64', '.png' ],
}
foreach source, out : source_icons
outdir = out[0]
indir = out[1]
suffix = out[2]
icon_list = '../icon-lists/@0@.list'.format(source)
cmd = run_command('python3', '-c',
'print(",".join(["@0@/" + line.strip() + "@1@" for line in open("@2@")]))'.format(indir, suffix, icon_list),
check: true)
source_icons = cmd.stdout().strip().split(',')
install_data(source_icons, install_dir: gimpiconsdir / theme / outdir / 'apps')
endforeach
else
gtk_encode_symbolic_svg = find_program('gtk-encode-symbolic-svg')
@ -33,12 +20,6 @@ else
source_icons = cmd.stdout().strip().split(',')
if size == '64'
icon_list = '../icon-lists/bitmap_64-always.list'
cmd = run_command('python3', '-c',
'print(",".join([line.strip() for line in open("@0@")]))'.format(icon_list),
check: true)
source_icons += cmd.stdout().strip().split(',')
icon_list = '../icon-lists/bitmap_64-system.list'
cmd = run_command('python3', '-c',
'print(",".join([line.strip() for line in open("@0@")]))'.format(icon_list),
@ -54,12 +35,30 @@ else
# meson.build as it also installs some non-symbolic images.
subdir(size)
endforeach
# Install these directly from PNG sources.
source_icons = {
'bitmap_64-always': [ '64x64', '64', '.png' ],
}
endif
install_data('index.theme',
install_dir: gimpiconsdir / theme,
)
foreach source, out : source_icons
outdir = out[0]
indir = out[1]
suffix = out[2]
icon_list = '../icon-lists/@0@.list'.format(source)
cmd = run_command('python3', '-c',
'print(",".join(["@0@/" + line.strip() + "@1@" for line in open("@2@")]))'.format(indir, suffix, icon_list),
check: true)
source_icons = cmd.stdout().strip().split(',')
install_data(source_icons, install_dir: gimpiconsdir / theme / outdir / 'apps')
endforeach
icons_core = [ '64/gimp-question.png', ]
icons_imgs = [ '64/gimp-wilber-eek.png', ]

View File

@ -87,7 +87,6 @@ i18n = import('i18n')
gnome = import('gnome')
pythonmod = import('python')
simd = import('unstable-simd')
fs = import('fs')
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')