Skip to content

Commit 8718153

Browse files
Salamandarmtwebster
authored andcommitted
Add Meson build system
1 parent 76d3b07 commit 8718153

40 files changed

+1137
-0
lines changed

nemo-dropbox/data/meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
install_subdir('emblems',
2+
install_dir: project_datadir,
3+
)
4+
5+
if get_option('install-dropbox-files')
6+
install_subdir('icons/hicolor',
7+
install_dir: get_option('datadir') / 'icons',
8+
)
9+
install_data('icons/nemo-dropbox/nemo-dropbox-symbolic.svg',
10+
install_dir: project_datadir / 'icons',
11+
)
12+
endif

nemo-dropbox/meson.build

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
project('nemo-dropbox',
2+
'c',
3+
version: '4.8.0',
4+
meson_version: '>=0.49.0'
5+
)
6+
7+
project_url = 'https://github.com/linuxmint/nemo-extensions'
8+
9+
10+
cc = meson.get_compiler('c')
11+
12+
config = configuration_data()
13+
14+
15+
################################################################################
16+
# Find libnemo-extensions
17+
18+
libnemo = dependency('libnemo-extension', version: '>=2.0.0')
19+
libnemo_extension_dir = libnemo.get_pkgconfig_variable('extensiondir')
20+
libnemo_extension_ver = libnemo.version().split('.')
21+
22+
config.set('NEMO_VERSION_MAJOR', libnemo_extension_ver[0])
23+
config.set('NEMO_VERSION_MINOR', libnemo_extension_ver[1])
24+
config.set('NEMO_VERSION_MICRO', libnemo_extension_ver[2])
25+
26+
glib = dependency('glib-2.0', version: '>=2.14.0')
27+
28+
################################################################################
29+
# Project configuration
30+
31+
project_datadir = get_option('datadir') / meson.project_name()
32+
33+
config.set_quoted('PACKAGE_STRING', meson.project_name() )
34+
config.set_quoted('EMBLEMDIR', get_option('prefix') / project_datadir / 'emblems')
35+
config.set_quoted('NEMOICONDIR', get_option('datadir') / 'nemo-dropbox' / 'icons')
36+
37+
c_args = []
38+
c_args += cc.get_supported_arguments('-Wno-deprecated-declarations')
39+
40+
if [ 'debug', 'relwithdebinfo'].contains(get_option('buildtype'))
41+
c_args += [ '-DND_DEBUG', ]
42+
else
43+
c_args += [ '-DG_DISABLE_ASSERT', '-DG_DISABLE_CHECKS', ]
44+
endif
45+
46+
add_project_arguments(c_args, language: 'c')
47+
48+
################################################################################
49+
# Generic stuff
50+
51+
52+
add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
53+
configure_file(
54+
output: 'config.h',
55+
configuration: config,
56+
)
57+
58+
rootInclude = include_directories('.')
59+
60+
subdir('data')
61+
subdir('src')
62+
63+
install_data('COPYING',
64+
install_dir: get_option('datadir') / 'licenses' / meson.project_name(),
65+
)

nemo-dropbox/meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('install-dropbox-files', type : 'boolean', value : true)

nemo-dropbox/src/meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
nemo_dropbox_sources = [
2+
'dropbox-client-util.c',
3+
'dropbox-client.c',
4+
'dropbox-command-client.c',
5+
'dropbox.c',
6+
'nemo-dropbox-hooks.c',
7+
'nemo-dropbox.c',
8+
]
9+
10+
libnemo_dropbox = shared_library('nemo-dropbox',
11+
nemo_dropbox_sources,
12+
include_directories: rootInclude,
13+
dependencies: [
14+
glib,
15+
libnemo,
16+
],
17+
install: true,
18+
install_dir: libnemo_extension_dir,
19+
)

nemo-fileroller/meson.build

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
project('nemo-fileroller',
2+
'c',
3+
version: '4.8.0',
4+
meson_version: '>=0.49.0'
5+
)
6+
7+
project_url = 'https://github.com/linuxmint/nemo-extensions'
8+
9+
10+
gnome = import('gnome')
11+
pkgconfig = import('pkgconfig')
12+
13+
config = configuration_data()
14+
15+
################################################################################
16+
# Find libnemo-extensions
17+
18+
libnemo = dependency('libnemo-extension', version: '>=2.0.0')
19+
libnemo_extension_dir = libnemo.get_pkgconfig_variable('extensiondir')
20+
libnemo_extension_ver = libnemo.version().split('.')
21+
22+
config.set('NEMO_VERSION_MAJOR', libnemo_extension_ver[0])
23+
config.set('NEMO_VERSION_MINOR', libnemo_extension_ver[1])
24+
config.set('NEMO_VERSION_MICRO', libnemo_extension_ver[2])
25+
26+
glib = dependency('glib-2.0', version: '>=2.14.0')
27+
28+
################################################################################
29+
# Generic stuff
30+
31+
config.set_quoted('GETTEXT_PACKAGE', 'nemo-extensions')
32+
config.set_quoted('GNOMELOCALEDIR', get_option('prefix')/get_option('datadir')/'locale')
33+
34+
add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
35+
configure_file(
36+
output: 'config.h',
37+
configuration: config,
38+
)
39+
40+
rootInclude = include_directories('.')
41+
42+
subdir('src')

nemo-fileroller/meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('gtk-doc', type: 'boolean', value: false)

nemo-fileroller/src/meson.build

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
nemo_fileroller_sources = [
2+
'fileroller-module.c',
3+
'nemo-fileroller.c',
4+
]
5+
6+
libnemo_fileroller = shared_library('nemo-fileroller',
7+
nemo_fileroller_sources,
8+
include_directories: rootInclude,
9+
dependencies: [
10+
libnemo,
11+
],
12+
13+
install: true,
14+
install_dir: libnemo_extension_dir,
15+
)

nemo-gtkhash/data/meson.build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if build_nautilus
2+
subdir('nautilus')
3+
endif
4+
5+
if build_gtkhash
6+
7+
custom_target('gtkhash.xml.gz',
8+
input: 'gtkhash.xml',
9+
output: 'gtkhash.xml.gz',
10+
command: [ gzip, '-c9', '@INPUT@' ],
11+
capture: true,
12+
install: true,
13+
install_dir: get_option('datadir') / meson.project_name()
14+
)
15+
16+
install_data(
17+
'app.gtkhash.gschema.xml',
18+
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
19+
)
20+
21+
endif
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
custom_target('gtkhash-properties.xml.gz',
3+
input: 'gtkhash-properties.xml',
4+
output: 'gtkhash-properties.xml.gz',
5+
command: [ gzip, '-c9', '@INPUT@' ],
6+
capture: true,
7+
install: true,
8+
install_dir: get_option('datadir') / meson.project_name() / 'nautilus'
9+
)
10+
11+
12+
install_data(
13+
'org.nemo.extensions.gtkhash.gschema.xml',
14+
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
15+
)

nemo-gtkhash/meson.build

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
project('nemo-gtkhash',
2+
'c',
3+
version: '4.8.0',
4+
meson_version: '>=0.50.0'
5+
)
6+
7+
project_url = 'https://github.com/linuxmint/nemo-extensions'
8+
9+
10+
gnome = import('gnome')
11+
pkgconfig = import('pkgconfig')
12+
cc = meson.get_compiler('c')
13+
14+
config = configuration_data()
15+
16+
################################################################################
17+
# Find libnemo-extensions
18+
19+
libnemo = dependency('libnemo-extension', version: '>=2.0.0')
20+
libnemo_extension_dir = libnemo.get_pkgconfig_variable('extensiondir')
21+
libnemo_extension_ver = libnemo.version().split('.')
22+
23+
config.set('NEMO_VERSION_MAJOR', libnemo_extension_ver[0])
24+
config.set('NEMO_VERSION_MINOR', libnemo_extension_ver[1])
25+
config.set('NEMO_VERSION_MICRO', libnemo_extension_ver[2])
26+
27+
glib = dependency('glib-2.0', version: '>=2.14.0')
28+
29+
################################################################################
30+
# Extension dependencies
31+
32+
gzip = find_program('gzip')
33+
34+
gtk3 = dependency('gtk+-3.0', version: '>=3.0')
35+
36+
37+
if [ 'debug', 'relwithdebinfo'].contains(get_option('buildtype'))
38+
config.set('G_DISABLE_DEPRECATED', 1)
39+
config.set('GDK_DISABLE_DEPRECATED', 1)
40+
config.set('GTK_DISABLE_DEPRECATED', 1)
41+
else
42+
config.set('G_DISABLE_ASSERT', 1)
43+
config.set('G_DISABLE_CAST_CHECKS', 1)
44+
endif
45+
46+
no_dep = dependency('', required: false)
47+
48+
zlib = get_option('zlib') ? dependency('zlib') : no_dep
49+
config.set10('ENABLE_ZLIB', zlib.found())
50+
51+
libgcrypt = get_option('gcrypt') ? dependency('libgcrypt') : no_dep
52+
config.set10('ENABLE_GCRYPT', libgcrypt.found())
53+
54+
libcrypto = get_option('libcrypto') ? dependency('libcrypto') : no_dep
55+
config.set10('ENABLE_LIBCRYPTO', libcrypto.found())
56+
57+
nettle = get_option('nettle') ? dependency('nettle') : no_dep
58+
config.set10('ENABLE_NETTLE', nettle.found())
59+
60+
nss = get_option('nss') ? dependency('nss') : no_dep
61+
config.set10('ENABLE_NSS', nss.found())
62+
63+
mhash = get_option('mhash') ? cc.find_library('mhash', has_headers: 'mhash.h') : no_dep
64+
config.set10('ENABLE_MHASH', mhash.found())
65+
66+
67+
if get_option('linux-crypto')
68+
if not cc.has_header('linux/if_alg.h')
69+
error('Header if_alg.h not found !')
70+
endif
71+
endif
72+
config.set10('ENABLE_LINUX_CRYPTO', get_option('linux-crypto'))
73+
74+
75+
if get_option('mbedtls')
76+
mbedtls = cc.find_library('mbedcrypto', has_headers: 'mbedtls/md.h', required: false)
77+
mbedtls_version = 2
78+
if not mbedtls.found()
79+
mbedtls = cc.find_library('polarssl', has_headers: 'polarssl/md.h', required: false)
80+
mbedtls_version = 1
81+
endif
82+
if not mbedtls.found()
83+
error('Could not find mbedtls or polarssl !')
84+
endif
85+
else
86+
mbedtls = no_dep
87+
endif
88+
config.set10('ENABLE_MBEDTLS', mbedtls.found())
89+
config.set10('HAVE_MBEDTLS_2_0_0', mbedtls_version == 2)
90+
91+
92+
config.set10('ENABLE_GLIB_CHECKSUMS', get_option('glib-checksums'))
93+
94+
config.set10('ENABLE_MD6', get_option('internal-md6'))
95+
96+
97+
build_gtkhash = get_option('build-gtkhash')
98+
build_nautilus = get_option('build-nautilus')
99+
build_nemo = get_option('build-nemo')
100+
build_thunar = get_option('build-thunar')
101+
102+
103+
config.set('HASH_FILE_BUFFER_SIZE', 131072)
104+
config.set('HASH_FILE_REPORT_INTERVAL', 166)
105+
106+
################################################################################
107+
# Generic stuff
108+
109+
config.set_quoted('GETTEXT_PACKAGE', 'nemo-extensions')
110+
config.set_quoted('GNOMELOCALEDIR', get_option('prefix')/get_option('datadir')/'locale')
111+
112+
add_project_arguments('-DG_LOG_DOMAIN="nemo-gtkhash"', language: 'c')
113+
114+
add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
115+
configure_file(
116+
output: 'config.h',
117+
configuration: config,
118+
)
119+
120+
rootInclude = include_directories('.')
121+
122+
subdir('src')
123+
subdir('data')
124+
125+
126+
127+
# -fno-common \
128+
# -fvisibility=hidden \
129+
# -pedantic \
130+
# -Wall \
131+
# -Wextra \
132+
# -Waggregate-return \
133+
# -Wbad-function-cast \
134+
# -Wcast-align \
135+
# -Winit-self \
136+
# -Wfloat-equal \
137+
# -Wlogical-op \
138+
# -Wmissing-declarations \
139+
# -Wmissing-noreturn \
140+
# -Wredundant-decls \
141+
# -Wshadow \
142+
# -Wswitch-default \
143+
# -Wwrite-strings \
144+
# -Werror=implicit-function-declaration

0 commit comments

Comments
 (0)