summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2017-07-13 16:57:52 -0300
committerGuilherme Iscaro <iscaro@profusion.mobi>2017-07-20 14:17:33 -0300
commit1b4ab6036c1de99eee0843a79c35b1b0a3b8d9c9 (patch)
treeb931b639c6ab952922330453bdcf6cf7cfbe85cd
parente7b3265662cb122a401c2e6e49cdac985e4d6d0d (diff)
Add support for the Meson build system.devs/iscaro/meson
-rw-r--r--README7
-rw-r--r--data/backgrounds/meson.build4
-rw-r--r--data/desktop/meson.build2
-rw-r--r--data/fonts/meson.build27
-rw-r--r--data/icons/meson.build2
-rw-r--r--data/images/meson.build3
-rw-r--r--data/meson.build6
-rw-r--r--data/themes/meson.build35
-rw-r--r--data/themes/nyanology/meson.build19
-rw-r--r--man/meson.build1
-rw-r--r--meson.build158
-rwxr-xr-xmeson_install_themes.sh5
-rw-r--r--meson_options.txt7
-rw-r--r--po/meson.build29
-rw-r--r--src/bin/meson.build104
15 files changed, 409 insertions, 0 deletions
diff --git a/README b/README
index 36a82ae..78bb343 100644
--- a/README
+++ b/README
@@ -29,6 +29,13 @@ Once you have met requirements, compiling and installing is simple:
29 make 29 make
30 make install 30 make install
31 31
32To build using meson:
33
34 meson build
35 cd build
36 ninja
37 ninja install
38
32Note: to make terminology work with input methods in general you need: 39Note: to make terminology work with input methods in general you need:
33 40
34export ECORE_IMF_MODULE="xim" 41export ECORE_IMF_MODULE="xim"
diff --git a/data/backgrounds/meson.build b/data/backgrounds/meson.build
new file mode 100644
index 0000000..2ad48b7
--- /dev/null
+++ b/data/backgrounds/meson.build
@@ -0,0 +1,4 @@
1files = ['mystic.png', 'texture_background.png']
2install_data(files,
3 install_dir: join_paths(get_option('datadir'),
4 'terminology', 'backgrounds'))
diff --git a/data/desktop/meson.build b/data/desktop/meson.build
new file mode 100644
index 0000000..1eb4019
--- /dev/null
+++ b/data/desktop/meson.build
@@ -0,0 +1,2 @@
1install_data('terminology.desktop',
2 install_dir: join_paths(get_option('datadir'), 'applications'))
diff --git a/data/fonts/meson.build b/data/fonts/meson.build
new file mode 100644
index 0000000..9ff380d
--- /dev/null
+++ b/data/fonts/meson.build
@@ -0,0 +1,27 @@
1files = ['10x20.pcf',
2 '4x6.pcf',
3 '5x7.pcf',
4 '5x8.pcf',
5 '6x10.pcf',
6 '6x12.pcf',
7 '6x13.pcf',
8 '6x9.pcf',
9 '7x13.pcf',
10 '7x14.pcf',
11 '8x13.pcf',
12 '9x15.pcf',
13 '9x18.pcf',
14 'nexus.pcf',
15 'terminus-12.pcf',
16 'terminus-14-bold.pcf',
17 'terminus-14.pcf',
18 'terminus-16-bold.pcf',
19 'terminus-16.pcf',
20 'terminus-18-bold.pcf',
21 'terminus-18.pcf',
22 'terminus-20-bold.pcf',
23 'terminus-20.pcf',
24 'TERMINUS.txt',
25 'XFONT.txt']
26install_data(files, install_dir: join_paths(get_option('datadir'),
27 meson.project_name(), 'fonts'))
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..98afff7
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,2 @@
1install_data('terminology.png',
2 install_dir: join_paths(get_option('datadir'), 'icons'))
diff --git a/data/images/meson.build b/data/images/meson.build
new file mode 100644
index 0000000..6af298f
--- /dev/null
+++ b/data/images/meson.build
@@ -0,0 +1,3 @@
1install_data('terminology.png',
2 install_dir: join_paths(get_option('datadir'),
3 meson.project_name(), 'images'))
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..8eec325
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,6 @@
1subdir('desktop')
2subdir('icons')
3subdir('images')
4subdir('fonts')
5subdir('themes')
6subdir('backgrounds')
diff --git a/data/themes/meson.build b/data/themes/meson.build
new file mode 100644
index 0000000..8721f0f
--- /dev/null
+++ b/data/themes/meson.build
@@ -0,0 +1,35 @@
1command = [edje_cc,
2 '-id', join_paths(meson.source_root(), 'data', 'themes', 'images'),
3 '-fd', join_paths(meson.source_root(), 'data', 'fonts'),
4 '-sd', join_paths(meson.source_root(), 'data', 'themes', 'sounds'),
5 '@INPUT@',
6 '@OUTPUT@']
7
8edje_to_compile = [
9 ['default', ['default_colors.in.edc']],
10 ['mild', ['default_colors.in.edc']],
11 ['black', ['default_colors.in.edc', 'mild.edc']],
12 ['solarized', ['default_colors.in.edc', 'default.edc']],
13 ['solarized_light', ['default_colors.in.edc', 'default.edc']],
14 ['mustang',['default_colors.in.edc', 'mild.edc']],
15 ['base16_ocean_dark', ['default_colors.in.edc']],
16 ['smyck', ['default_colors.in.edc', 'mild.edc']]
17]
18
19edje_install_dir = join_paths(get_option('datadir'),
20 meson.project_name(), 'themes')
21
22foreach to_compile: edje_to_compile
23 out = to_compile[0] + '.edj'
24 in = to_compile[0] + '.edc'
25 edj_targets += [custom_target(out,
26 install:true,
27 install_dir: edje_install_dir,
28 depend_files: files(to_compile[1]),
29 command: command,
30 input: in,
31 output: out)]
32 edj_files += [join_paths(edje_install_dir, out)]
33endforeach
34
35subdir('nyanology')
diff --git a/data/themes/nyanology/meson.build b/data/themes/nyanology/meson.build
new file mode 100644
index 0000000..2cd5aa6
--- /dev/null
+++ b/data/themes/nyanology/meson.build
@@ -0,0 +1,19 @@
1command = [edje_cc,
2 '-id', join_paths(meson.source_root(), 'data', 'themes',
3 'nyanology', 'images'),
4 '-id', join_paths(meson.source_root(), 'data', 'themes', 'images'),
5 '-fd', join_paths(meson.source_root(), 'data', 'fonts'),
6 '-sd', join_paths(meson.source_root(), 'data', 'themes', 'sounds'),
7 '@INPUT@',
8 '@OUTPUT@']
9
10edj_targets += [custom_target('nyanology.edj',
11 install:true,
12 depend_files: files(['about.edc',
13 'nyancursor.edc']),
14 install_dir: edje_install_dir,
15 command: command,
16 input:'nyanology.edc',
17 output:'nyanology.edj')]
18
19edj_files += [join_paths(edje_install_dir, 'nyanology.edj')]
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 0000000..b5c7425
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1 @@
install_man('terminology.1')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..2e46e22
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,158 @@
1project('terminology', 'c',
2 version: '1.0.99',
3 default_options: ['c_std=gnu99'],
4 license: 'BSD')
5
6spec_data = configuration_data()
7spec_data.set('PACKAGE', meson.project_name())
8spec_data.set('VERSION', meson.project_version())
9
10cc = meson.get_compiler('c')
11
12prefix = get_option('prefix')
13add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
14config_data = configuration_data()
15config_data.set('EFL_BETA_API_SUPPORT', 1)
16config_data.set('EFL_EO_API_SUPPORT', 1)
17config_data.set_quoted('PACKAGE_VERSION', meson.project_version())
18config_data.set_quoted('PACKAGE', meson.project_name())
19config_data.set_quoted('PACKAGE_BUGREPORT',
20 'enlightenment-devel@lists.sourceforge.net')
21config_data.set_quoted('PACKAGE_NAME', meson.project_name())
22config_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
23config_data.set_quoted('PACKAGE_URL',
24 'https://www.enlightenment.org/about-terminology')
25config_data.set_quoted('PACKAGE_BIN_DIR',
26 join_paths(prefix, get_option('bindir')))
27config_data.set_quoted('PACKAGE_DATA_DIR',
28 join_paths(prefix, get_option('datadir'),
29 meson.project_name()))
30config_data.set_quoted('PACKAGE_LIB_DIR',
31 join_paths(prefix, get_option('libdir')))
32config_data.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
33config_data.set('_GNU_SOURCE', 1)
34config_data.set('__EXTENSIONS__', 1)
35config_data.set('_POSIX_PTHREAD_SEMANTICS', 1)
36config_data.set('_TANDEM_SOURCE', 1)
37config_data.set('_ALL_SOURCE', 1)
38config_data.set('_POSIX_SOURCE', 1)
39config_data.set('_POSIX_1_SOURCE', 1)
40
41efl_version = '1.8.0'
42efl_deps = ['edje',
43 'elementary',
44 'eina',
45 'eet',
46 'evas',
47 'ecore',
48 'ecore-evas',
49 'ecore-file',
50 'emotion',
51 'ecore-input',
52 'ecore-imf',
53 'ecore-imf-evas',
54 'ecore-ipc',
55 'efreet',
56 'ecore-con',
57 'ethumb_client']
58terminology_dependencies = []
59edje_cc_path = ''
60edj_targets = []
61edj_files = []
62use_translations = false
63intl_lib = cc.find_library('intl', required: false)
64if intl_lib.found()
65 config_data.set('HAVE_GETTEXT', 1)
66 config_data.set('ENABLE_NLS', 1)
67 terminology_dependencies += [intl_lib]
68 use_translations = true
69else
70 gettext_code = '''
71 #include <libintl.h>
72 int main(int argc, char *argv[]) {
73 (void)ngettext("", "", 0);
74 return 0;
75 }
76 '''
77 if cc.links(gettext_code)
78 config_data.set('HAVE_GETTEXT', 1)
79 config_data.set('ENABLE_NLS', 1)
80 use_translations = true
81 endif
82endif
83
84foreach efl_dep: efl_deps
85 dep = dependency(efl_dep, version: '>=' + efl_version)
86 terminology_dependencies += [dep]
87 if efl_dep == 'edje'
88 edje_cc_path = dep.get_pkgconfig_variable('prefix') + '/bin/edje_cc'
89 endif
90endforeach
91
92if cc.has_function('mkstemps')
93 config_data.set('HAVE_MKSTEMPS', 1)
94endif
95
96url_head_code = '''#include <Ecore_Con.h>
97int main(int argc, char *argv[]) { ecore_con_url_head(NULL); return 0; }
98'''
99
100elementary_teamwork_code = '''#include <Elementary.h>
101int main(int argc, char *argv[]) { elm_win_teamwork_uri_show(NULL); return 0; }
102'''
103
104found = 'Not found'
105
106if cc.links(url_head_code, dependencies: terminology_dependencies)
107 config_data.set('HAVE_ECORE_CON_URL_HEAD', 1)
108 found = 'Found'
109endif
110
111message('Checking for ecore_con_url_head: ' + found)
112
113if cc.links(elementary_teamwork_code, dependencies: terminology_dependencies)
114 config_dat.set('HAVE_ELM_WIN_TEAMWORK', 1)
115 found = 'Found'
116else
117 found = 'Not Found'
118endif
119
120message('Checking for elm_win_teamwork_uri_show: ' + found)
121
122edje_cc = get_option('edje-cc')
123
124if edje_cc == ''
125 edje_cc = edje_cc_path
126endif
127
128fuzzing = get_option('fuzzing')
129
130if fuzzing
131 config_data.set('ENABLE_FUZZING', 1)
132 message('Fuzzing is enabled')
133else
134 message('Fuzzing is disbled')
135endif
136
137message('edje_cc set to:' + edje_cc)
138
139configure_file(output: 'terminology_config.h',
140 configuration: config_data)
141
142configure_file(input: 'terminology.spec.in',
143 output: 'terminology.spec',
144 configuration: spec_data)
145
146configure_file(input: join_paths('pkgbuild', 'PKGBUILD.in'),
147 output: 'PKGBUILD',
148 configuration: spec_data)
149
150config_dir = include_directories('.')
151subdir('data')
152subdir('man')
153if use_translations
154 subdir('po')
155endif
156subdir('src/bin')
157
158meson.add_install_script('meson_install_themes.sh', edj_files)
diff --git a/meson_install_themes.sh b/meson_install_themes.sh
new file mode 100755
index 0000000..7bc6905
--- /dev/null
+++ b/meson_install_themes.sh
@@ -0,0 +1,5 @@
1#!/bin/sh
2
3for x in "$@" ; do
4 chmod 644 "$MESON_INSTALL_DESTDIR_PREFIX/$x"
5done
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..6b6b04a
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,7 @@
1option('edje-cc',
2 type: 'string',
3 description: 'A path to a edje_cc. Defaults to system\'s edje_cc')
4option('fuzzing',
5 type: 'boolean',
6 value: false,
7 description: 'Enable fuzzing on terminology. Binaries are not suited for production.')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..6cb7469
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,29 @@
1i18n = import('i18n')
2i18n.gettext('terminology',
3 languages: [
4 'ca',
5 'de',
6 'el',
7 'eo',
8 'es',
9 'fi',
10 'fr',
11 'hi',
12 'it',
13 'ko',
14 'ms',
15 'sl',
16 'sr',
17 'tr',
18 'vi'
19 ],
20 args: [
21 '--keyword=_',
22 '--keyword=d_:1',
23 '--keyword=P_:1,2',
24 '--keyword=dP_:1,2',
25 '--keyword=N_',
26 '--keyword=NP_:1,2',
27 '--from-code=UTF-8',
28 '--foreign-user'
29 ])
diff --git a/src/bin/meson.build b/src/bin/meson.build
new file mode 100644
index 0000000..3d20fd5
--- /dev/null
+++ b/src/bin/meson.build
@@ -0,0 +1,104 @@
1terminology_sources = ['private.h',
2 'about.c', 'about.h',
3 'col.c', 'col.h',
4 'config.c', 'config.h',
5 'controls.c', 'controls.h',
6 'ipc.c', 'ipc.h',
7 'keyin.c', 'keyin.h',
8 'main.c', 'main.h',
9 'media.c', 'media.h',
10 'options.c', 'options.h',
11 'options_font.c', 'options_font.h',
12 'options_theme.c', 'options_theme.h',
13 'options_themepv.c', 'options_themepv.h',
14 'options_wallpaper.c', 'options_wallpaper.h',
15 'options_colors.c', 'options_colors.h',
16 'options_behavior.c', 'options_behavior.h',
17 'options_keys.c', 'options_keys.h',
18 'options_helpers.c', 'options_helpers.h',
19 'options_video.c', 'options_video.h',
20 'options_elm.c', 'options_elm.h',
21 'sel.c', 'sel.h',
22 'miniview.c', 'miniview.h',
23 'termio.c', 'termio.h',
24 'termcmd.c', 'termcmd.h',
25 'term_container.h',
26 'termiolink.c', 'termiolink.h',
27 'termpty.c', 'termpty.h',
28 'termptydbl.c', 'termptydbl.h',
29 'termptyesc.c', 'termptyesc.h',
30 'termptyops.c', 'termptyops.h',
31 'termptygfx.c', 'termptygfx.h',
32 'termptyext.c', 'termptyext.h',
33 'termptysave.c', 'termptysave.h',
34 'lz4/lz4.c', 'lz4/lz4.h',
35 'md5/md5.c', 'md5/md5.h',
36 'utf8.c', 'utf8.h',
37 'win.c', 'win.h',
38 'utils.c', 'utils.h',
39 'extns.c', 'extns.h',
40 'gravatar.c', 'gravatar.h',
41 'tty_keys.h',
42 'sb.c', 'sb.h']
43
44tybg_sources = ['tycommon.c', 'tycommon.h', 'tybg.c']
45tyalpha_sources = ['tycommon.c', 'tycommon.h', 'tyalpha.c']
46typop_sources = ['tycommon.c', 'tycommon.h', 'typop.c']
47tyq_sources = ['tycommon.c', 'tycommon.h', 'tyq.c']
48tycat_sources = ['tycommon.c', 'tycommon.h', 'tycat.c', 'extns.c', 'extns.h']
49tyls_sources = ['extns.c', 'extns.h', 'tyls.c', 'tycommon.c', 'tycommon.h']
50tyfuzz_sources = ['termptyesc.c', 'termptyesc.h',
51 'termptysave.c', 'termptysave.h',
52 'termptyops.c', 'termptyops.h',
53 'termptydbl.c', 'termptydbl.h',
54 'termptyext.c', 'termptyext.h',
55 'termptygfx.c', 'termptygfx.h',
56 'termpty.c', 'termpty.h',
57 'config.c', 'config.h',
58 'col.c', 'col.h',
59 'tyfuzz.c']
60
61executable('terminology',
62 terminology_sources,
63 edj_targets,
64 install: true,
65 include_directories: config_dir,
66 dependencies: terminology_dependencies)
67executable('tybg',
68 tybg_sources,
69 install: true,
70 include_directories: config_dir,
71 dependencies: terminology_dependencies)
72executable('tyalpha',
73 tyalpha_sources,
74 install: true,
75 include_directories: config_dir,
76 dependencies: terminology_dependencies)
77executable('typop',
78 typop_sources,
79 install: true,
80 include_directories: config_dir,
81 dependencies: terminology_dependencies)
82executable('tyq',
83 tyq_sources,
84 install: true,
85 include_directories: config_dir,
86 dependencies: terminology_dependencies)
87executable('tycat',
88 tycat_sources,
89 install: true,
90 include_directories: config_dir,
91 dependencies: terminology_dependencies)
92executable('tyls',
93 tyls_sources,
94 install: true,
95 include_directories: config_dir,
96 dependencies: terminology_dependencies)
97
98if fuzzing
99 executable('tyfuzz',
100 tyfuzz_sources,
101 install: true,
102 include_directories: config_dir,
103 dependencies: terminology_dependencies)
104endif