From 24b737f2813a2c7d0f9d7d888473e6cbaa6b1f95 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Sat, 14 Apr 2018 12:30:36 +0300 Subject: build: Fix icon renaming Currently, when looping over icon sizes, each icon is copied to $MESON_BUILD_ROOT/@appid@.png, meaning that the file is overwritten on every iteration. This commit fixes that by copying to a subdirectory under the build root and installing from there. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/364 (cherry picked from commit 5633b13f92ad736f5e8f6311253d31e68d40d057) --- data/meson.build | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/data/meson.build b/data/meson.build index ab9b853a9..ff83bdb12 100644 --- a/data/meson.build +++ b/data/meson.build @@ -7,16 +7,28 @@ # # https://gitlab.gnome.org/GNOME/nautilus/merge_requests/144 ########## + +cp = find_program('cp') +mkdir = find_program('mkdir') + foreach icon_size: ['16x16', '22x22', '24x24', '32x32', '48x48', '512x512'] - configure_file( - command: [ - 'cp', '@INPUT@', '@OUTPUT@' - ], - input: files( - join_paths('icons', 'hicolor', icon_size, 'apps', 'org.gnome.Nautilus.png') - ), - install_dir: join_paths(datadir, 'icons', 'hicolor', icon_size, 'apps'), - output: '@0@.png'.format(application_id) + icon_path = join_paths('icons', 'hicolor', icon_size, 'apps') + output_icon_path = join_paths(meson.build_root(), 'data', icon_path) + + run_command( + mkdir, [ + '-p', output_icon_path + ] + ) + run_command( + cp, + join_paths(icon_path, 'org.gnome.Nautilus.png'), + join_paths(output_icon_path, '@0@.png'.format(application_id)) + ) + + install_subdir( + join_paths(meson.build_root(), 'data', 'icons'), + install_dir: datadir ) endforeach -- cgit v1.2.1