[gimp/meson: 121/128] Remove 'find' calls, use hard-coded names and install_subdir
- From: Félix Piédallu <fpiedallu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/meson: 121/128] Remove 'find' calls, use hard-coded names and install_subdir
- Date: Mon, 12 Feb 2018 13:49:59 +0000 (UTC)
commit 77970234a2f3a18bd3b5a797e9db7059f9f4529a
Author: Félix Piédallu <felix piedallu me>
Date: Fri Feb 2 10:35:03 2018 +0100
Remove 'find' calls, use hard-coded names and install_subdir
data/brushes/meson.build | 41 +++++++++++++++++---------------------
data/dynamics/Basic/meson.build | 12 -----------
data/dynamics/FX/meson.build | 7 ------
data/dynamics/meson.build | 27 +++++++++++++------------
data/patterns/meson.build | 38 ++++++++++++++++++++----------------
data/tool-presets/meson.build | 33 +++++++++++++++----------------
meson.build | 4 ---
7 files changed, 69 insertions(+), 93 deletions(-)
---
diff --git a/data/brushes/meson.build b/data/brushes/meson.build
index 549ce14..ccf5bdd 100644
--- a/data/brushes/meson.build
+++ b/data/brushes/meson.build
@@ -1,27 +1,22 @@
-brushes = run_command(find,
- meson.current_source_dir(),
- '-maxdepth', '1',
- '-mindepth', '1',
- '-type', 'd',
- '-printf', '%f'+findsep
-).stdout().strip().split('\n')
+brushes_types = [
+ 'Basic',
+ 'gimp-obsolete-files',
+ 'Legacy',
+ 'Media',
+ 'Sketch',
+ 'Splatters',
+ 'Texture',
+]
-foreach brush : brushes
- files = run_command(find,
- join_paths(meson.current_source_dir(), brush),
- '-type', 'f',
- '(',
- '-name', '*.gbr',
- '-o',
- '-name', '*.gih',
- '-o',
- '-name', '*.vbr',
- ')',
- '-printf', brush + '/%f'+findsep
- ).stdout().strip().split('\n')
+foreach brushes_type : brushes_types
-
- install_data(files,
- install_dir: join_paths(gimpdatadir, 'brushes', brush)
+ install_subdir(brushes_type,
+ install_dir: join_paths(gimpdatadir, 'brushes'),
+ exclude_files: [
+ '.gitignore',
+ 'Makefile.am',
+ 'Makefile.in',
+ ],
)
+
endforeach
diff --git a/data/dynamics/meson.build b/data/dynamics/meson.build
index 46ead86..c9b7736 100644
--- a/data/dynamics/meson.build
+++ b/data/dynamics/meson.build
@@ -1,15 +1,16 @@
-install_data([
- 'Basic-Dynamics.gdyn',
- 'Color-From-Gradient.gdyn',
- 'Dynamics-Off.gdyn',
- 'Fade-Tapering.gdyn',
- 'Random-Color.gdyn',
- 'Tilt-Angle.gdyn',
- 'Track-Direction.gdyn',
- 'Velocity-Tapering.gdyn',
+
+install_subdir('.',
+ install_dir: join_paths(gimpdatadir, 'dynamics'),
+ exclude_files: [
+ '.gitignore',
+ 'meson.build',
+ 'Makefile.am',
+ 'Makefile.in',
+ 'Basic/.gitignore',
+ 'Basic/Makefile.am',
+ 'Basic/Makefile.in',
+ 'FX/.gitignore',
+ 'FX/Makefile.am',
+ 'FX/Makefile.in',
],
- install_dir: join_paths(gimpdatadir, 'dynamics')
)
-
-subdir('Basic')
-subdir('FX')
diff --git a/data/patterns/meson.build b/data/patterns/meson.build
index fb1acca..29d11ce 100644
--- a/data/patterns/meson.build
+++ b/data/patterns/meson.build
@@ -1,21 +1,25 @@
-patterns = run_command(find,
- meson.current_source_dir(),
- '-maxdepth', '1',
- '-mindepth', '1',
- '-type', 'd',
- '-printf', '%f'+findsep
-).stdout().strip().split('\n')
+patterns_types = [
+ 'Animal',
+ 'Fabric',
+ 'Food',
+ 'Legacy',
+ 'Paper',
+ 'Plant',
+ 'Sky',
+ 'Stone',
+ 'Water',
+ 'Wood',
+]
-foreach pattern : patterns
- files = run_command(find,
- join_paths(meson.current_source_dir(), pattern),
- '-type', 'f',
- '-name', '*.pat',
- '-printf', pattern + '/%f'+findsep
- ).stdout().strip().split('\n')
+foreach patterns_type : patterns_types
-
- install_data(files,
- install_dir: join_paths(gimpdatadir, 'patterns', pattern)
+ install_subdir(patterns_type,
+ install_dir: join_paths(gimpdatadir, 'patterns'),
+ exclude_files: [
+ '.gitignore',
+ 'Makefile.am',
+ 'Makefile.in',
+ ],
)
+
endforeach
diff --git a/data/tool-presets/meson.build b/data/tool-presets/meson.build
index 6961600..4d29eaf 100644
--- a/data/tool-presets/meson.build
+++ b/data/tool-presets/meson.build
@@ -1,21 +1,20 @@
-presets = run_command(find,
- meson.current_source_dir(),
- '-maxdepth', '1',
- '-mindepth', '1',
- '-type', 'd',
- '-printf', '%f'+findsep
-).stdout().strip().split('\n')
+tools_presets_types = [
+ 'Crop',
+ 'FX',
+ 'Paint',
+ 'Selection',
+ 'Sketch',
+]
-foreach preset : presets
- files = run_command(find,
- join_paths(meson.current_source_dir(), preset),
- '-type', 'f',
- '-name', '*.gtp',
- '-printf', preset + '/%f'+findsep
- ).stdout().strip().split('\n')
+foreach tools_presets_type : tools_presets_types
-
- install_data(files,
- install_dir: join_paths(gimpdatadir, 'tool-presets', preset)
+ install_subdir(tools_presets_type,
+ install_dir: join_paths(gimpdatadir, 'tools-presets'),
+ exclude_files: [
+ '.gitignore',
+ 'Makefile.am',
+ 'Makefile.in',
+ ],
)
+
endforeach
diff --git a/meson.build b/meson.build
index ed4eb8c..4bf37e1 100644
--- a/meson.build
+++ b/meson.build
@@ -106,10 +106,6 @@ if platform_win32
windows = import('windows')
endif
-# Find utils
-find = find_program('find')
-findsep = platform_win32 ? '\r\n' : '\n'
-
################################################################################
# Dependencies
math = cc.find_library('m')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]