[gnome-documents] build: Rename the names of the icons' files
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] build: Rename the names of the icons' files
- Date: Sat, 13 Jan 2018 12:45:41 +0000 (UTC)
commit 759f193b62f363d312740d43a1453f8d8d3b0a0b
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Thu Sep 14 17:45:42 2017 +0200
build: Rename the names of the icons' files
The names of icons' files, besides containing the final names, they
also contained the path in which they were going to be installed.
This implies that they have to be renamed on the installation
process.
This patch creates the proper directory tree needed on the
installation process and renames all files' names to their final
names.
https://bugzilla.gnome.org/show_bug.cgi?id=787013
data/icons/Makefile.am | 94 +++++++++++---------
.../16x16/apps/org.gnome.Books.png} | Bin 820 -> 820 bytes
.../16x16/apps/org.gnome.Documents.png} | Bin 1024 -> 1024 bytes
.../22x22/apps/org.gnome.Books.png} | Bin 1024 -> 1024 bytes
.../22x22/apps/org.gnome.Documents.png} | Bin 1524 -> 1524 bytes
.../24x24/apps/org.gnome.Books.png} | Bin 1034 -> 1034 bytes
.../24x24/apps/org.gnome.Documents.png} | Bin 1565 -> 1565 bytes
.../256x256/apps/org.gnome.Books.png} | Bin 57584 -> 57584 bytes
.../256x256/apps/org.gnome.Documents.png} | Bin 40339 -> 40339 bytes
.../32x32/apps/org.gnome.Books.png} | Bin 2160 -> 2160 bytes
.../32x32/apps/org.gnome.Documents.png} | Bin 2479 -> 2479 bytes
.../48x48/apps/org.gnome.Books.png} | Bin 4054 -> 4054 bytes
.../48x48/apps/org.gnome.Documents.png} | Bin 3985 -> 3985 bytes
.../512x512/apps/org.gnome.Books.png} | Bin 204806 -> 204806 bytes
.../512x512/apps/org.gnome.Documents.png} | Bin 103128 -> 103128 bytes
.../scalable/apps/org.gnome.Books-symbolic.svg} | 0
.../apps/org.gnome.Documents-symbolic.svg} | 0
data/icons/meson.build | 34 +------
meson.build | 1 -
meson_post_install.py | 7 --
20 files changed, 55 insertions(+), 81 deletions(-)
---
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index f19990f..cf2f2af 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -4,24 +4,45 @@ public_icons_themes = \
hicolor \
$(NULL)
-public_icons = \
- hicolor_apps_scalable_org.gnome.Books-symbolic.svg \
- hicolor_apps_scalable_org.gnome.Documents-symbolic.svg \
- hicolor_apps_16x16_org.gnome.Books.png \
- hicolor_apps_22x22_org.gnome.Books.png \
- hicolor_apps_24x24_org.gnome.Books.png \
- hicolor_apps_32x32_org.gnome.Books.png \
- hicolor_apps_48x48_org.gnome.Books.png \
- hicolor_apps_256x256_org.gnome.Books.png \
- hicolor_apps_512x512_org.gnome.Books.png \
- hicolor_apps_16x16_org.gnome.Documents.png \
- hicolor_apps_22x22_org.gnome.Documents.png \
- hicolor_apps_24x24_org.gnome.Documents.png \
- hicolor_apps_32x32_org.gnome.Documents.png \
- hicolor_apps_48x48_org.gnome.Documents.png \
- hicolor_apps_256x256_org.gnome.Documents.png \
- hicolor_apps_512x512_org.gnome.Documents.png \
- $(NULL)
+public_scalable_iconsdir = $(datadir)/icons/hicolor/scalable/apps
+public_scalable_icons_DATA = \
+ hicolor/scalable/apps/org.gnome.Books-symbolic.svg \
+ hicolor/scalable/apps/org.gnome.Documents-symbolic.svg
+
+public_16x16_iconsdir = $(datadir)/icons/hicolor/16x16/apps
+public_16x16_icons_DATA = \
+ hicolor/16x16/apps/org.gnome.Books.png \
+ hicolor/16x16/apps/org.gnome.Documents.png
+
+public_22x22_iconsdir = $(datadir)/icons/hicolor/22x22/apps
+public_22x22_icons_DATA = \
+ hicolor/22x22/apps/org.gnome.Books.png \
+ hicolor/22x22/apps/org.gnome.Documents.png
+
+public_24x24_iconsdir = $(datadir)/icons/hicolor/24x24/apps
+public_24x24_icons_DATA = \
+ hicolor/24x24/apps/org.gnome.Books.png \
+ hicolor/24x24/apps/org.gnome.Documents.png
+
+public_32x32_iconsdir = $(datadir)/icons/hicolor/32x32/apps
+public_32x32_icons_DATA = \
+ hicolor/32x32/apps/org.gnome.Books.png \
+ hicolor/32x32/apps/org.gnome.Documents.png
+
+public_48x48_iconsdir = $(datadir)/icons/hicolor/48x48/apps
+public_48x48_icons_DATA = \
+ hicolor/48x48/apps/org.gnome.Books.png \
+ hicolor/48x48/apps/org.gnome.Documents.png
+
+public_256x256_iconsdir = $(datadir)/icons/hicolor/256x256/apps
+public_256x256_icons_DATA = \
+ hicolor/256x256/apps/org.gnome.Books.png \
+ hicolor/256x256/apps/org.gnome.Documents.png
+
+public_512x512_iconsdir = $(datadir)/icons/hicolor/512x512/apps
+public_512x512_icons_DATA = \
+ hicolor/512x512/apps/org.gnome.Books.png \
+ hicolor/512x512/apps/org.gnome.Documents.png
noinst_DATA = \
hicolor_org.gnome.Books.blend \
@@ -30,9 +51,15 @@ noinst_DATA = \
$(NULL)
EXTRA_DIST = \
- $(public_icons) \
- $(noinst_DATA) \
- meson.build \
+ $(public_scalable_icons_DATA) \
+ $(public_16x16_icons_DATA) \
+ $(public_22x22_icons_DATA) \
+ $(public_24x24_icons_DATA) \
+ $(public_48x48_icons_DATA) \
+ $(public_256x256_icons_DATA) \
+ $(public_512x512_icons_DATA) \
+ $(noinst_DATA) \
+ meson.build \
$(NULL)
###############################################################################
@@ -52,27 +79,8 @@ update-icon-cache:
done; \
fi
-install-icons:
- for icon in $(public_icons); do \
- THEME=`echo $$icon | cut -d_ -f1`; \
- CONTEXT=`echo $$icon | cut -d_ -f2`; \
- SIZE=`echo $$icon | cut -d_ -f3`; \
- ICONFILE=`echo $$icon | cut -d_ -f4`; \
- mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
- $(INSTALL_DATA) $(srcdir)/$$icon
$(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
- done
-
-uninstall-icons:
- -for icon in $(public_icons); do \
- THEME=`echo $$icon | cut -d_ -f1`; \
- CONTEXT=`echo $$icon | cut -d_ -f2`; \
- SIZE=`echo $$icon | cut -d_ -f3`; \
- ICONFILE=`echo $$icon | cut -d_ -f4`; \
- rm -f $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
- done
-
-install-data-local: install-icons update-icon-cache
-
-uninstall-local: uninstall-icons update-icon-cache
+install-data-hook: update-icon-cache
+
+uninstall-hook: update-icon-cache
-include $(top_srcdir)/git.mk
diff --git a/data/icons/hicolor_apps_scalable_org.gnome.Books-symbolic.svg
b/data/icons/hicolor/scalable/apps/org.gnome.Books-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_scalable_org.gnome.Books-symbolic.svg
rename to data/icons/hicolor/scalable/apps/org.gnome.Books-symbolic.svg
diff --git a/data/icons/hicolor_apps_scalable_org.gnome.Documents-symbolic.svg
b/data/icons/hicolor/scalable/apps/org.gnome.Documents-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_scalable_org.gnome.Documents-symbolic.svg
rename to data/icons/hicolor/scalable/apps/org.gnome.Documents-symbolic.svg
diff --git a/data/icons/meson.build b/data/icons/meson.build
index be0003f..c5c35fc 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,30 +1,4 @@
-names = [
- 'org.gnome.Books',
- 'org.gnome.Documents'
-]
-
-icon_sizes = [
- '16x16',
- '22x22',
- '24x24',
- '32x32',
- '48x48',
- '256x256',
- '512x512'
-]
-
-foreach icon_size: icon_sizes
- foreach name: names
- install_data(
- '_'.join(['hicolor', 'apps', icon_size, name + '.png']),
- install_dir: join_paths(documents_icondir, 'hicolor', icon_size, 'apps')
- )
- endforeach
-endforeach
-
-foreach name: names
- install_data(
- '_'.join(['hicolor', 'apps', 'scalable', name + '-symbolic.svg']),
- install_dir: join_paths(documents_icondir, 'hicolor', 'scalable', 'apps')
- )
-endforeach
+install_subdir(
+ 'hicolor',
+ install_dir: join_paths(documents_datadir, 'icons')
+)
diff --git a/meson.build b/meson.build
index 39d63a9..1f44272 100644
--- a/meson.build
+++ b/meson.build
@@ -21,7 +21,6 @@ documents_pkgdatadir = join_paths(documents_datadir, meson.project_name())
documents_pkglibdir = join_paths(documents_libdir, meson.project_name())
documents_desktopdir = join_paths(documents_datadir, 'applications')
-documents_icondir = join_paths(documents_datadir, 'icons')
documents_schemadir = join_paths(documents_datadir, 'glib-2.0', 'schemas')
documents_debug = get_option('buildtype').contains('debug')
diff --git a/meson_post_install.py b/meson_post_install.py
index f2f787e..2767a94 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -24,13 +24,6 @@ if not os.environ.get('DESTDIR'):
subprocess.call(['ln', '-s', '-f', src, dest])
icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
-
- name_pattern = re.compile('hicolor_(?:apps)_(?:\d+x\d+|scalable)_(.*)')
- search_pattern = '/**/hicolor_*'
-
- [os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1)))
- for file in glob.glob(icondir + search_pattern, recursive=True)]
-
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]