diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-04-14 12:30:36 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestas.kulik@gmail.com> | 2018-05-11 05:52:54 +0000 |
commit | 24b737f2813a2c7d0f9d7d888473e6cbaa6b1f95 (patch) | |
tree | 1df1f2cf9f60edf1598f94cb956ed877ef170047 | |
parent | a60ef55d75d508d50251d7b9e61751cee145c021 (diff) | |
download | nautilus-24b737f2813a2c7d0f9d7d888473e6cbaa6b1f95.tar.gz |
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)
-rw-r--r-- | data/meson.build | 30 |
1 files 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 |