summaryrefslogtreecommitdiff
path: root/meson.build
blob: 00408d894c7f156098c73bf63c0a77d0fefc2026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
project('nautilus', 'c',
  version: '3.28.0.1',
  meson_version: '>= 0.41.0',
  license: 'GPL3+'
)

# Directory variables
bindir = get_option('bindir')
datadir = get_option('datadir')
desktopdir = join_paths(datadir, 'applications')
includedir = get_option('includedir')
libdir = get_option('libdir')
extensiondir = join_paths(libdir, 'nautilus', 'extensions-3.0')
prefix = get_option('prefix')
servicedir = join_paths(datadir, 'dbus-1', 'services')
#

# Compiler variables
cc = meson.get_compiler('c')
#

add_global_arguments(
  cc.get_supported_arguments([
    '-Wno-deprecated-declarations',
  ]),
  language: 'c'
)
add_project_arguments(
  cc.get_supported_arguments([
    '-Wall',
    '-Wduplicated-branches',
    '-Wlogical-op',
    '-Werror=declaration-after-statement',
    '-Werror=empty-body',
    '-Werror=format=2',
    '-Werror=implicit-function-declaration',
    '-Werror=init-self',
    '-Werror=missing-include-dirs',
    '-Werror=missing-prototypes',
    '-Werror=pointer-arith',
    '-Werror=sequence-point',
    '-Werror=shadow',
    '-Werror=strict-prototypes',
    '-Werror=undef',
    '-Werror=uninitialized',
  ]),
  language: 'c'
)

# Imports
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
#

# Dependencies
glib_ver = '>= 2.55.1'

libgd = subproject(
  'libgd',
  default_options: [
    'static=true',
    'with-gtk-hacks=true',
    'with-main-view=true',
    'with-tagged-entry=true'
  ]
)
libgd_dep = libgd.get_variable('libgd_dep')

libm = cc.find_library('libm')

gail = dependency('gail-3.0')
if get_option('extensions')
  gexiv = dependency('gexiv2', version: '>= 0.10.0')
endif
gio = dependency('gio-2.0', version: glib_ver)
gio_unix = dependency('gio-unix-2.0', version: glib_ver)
glib = dependency('glib-2.0', version: glib_ver)
gmodule = dependency('gmodule-no-export-2.0', version: glib_ver)
gnome_autoar = dependency('gnome-autoar-0', version: '>= 0.2.1')
gnome_desktop = dependency('gnome-desktop-3.0', version: '>= 3.0.0')
gtk = dependency('gtk+-3.0', version: '>= 3.22.26')
selinux = []
if get_option('selinux')
  selinux = dependency('libselinux', version: '>= 2.0')
endif
tracker_sparql = dependency('tracker-sparql-2.0')
x11 = dependency('x11')
xml = dependency('libxml-2.0', version: '>= 2.7.8')
#

# Configuration
conf = configuration_data()

if get_option('profile') == 'development'
  version = '@0@-@VCS_TAG@'.format(meson.project_version())
  conf.set_quoted('NAME_SUFFIX', ' (Development Snapshot)')
  profile = 'Devel'
else
  if get_option('profile') == 'stable-flatpak'
    version = '@0@-flatpak'.format(meson.project_version())
    profile = 'Stable'
  else
    version = meson.project_version()
    profile = ''
  endif
  conf.set_quoted('NAME_SUFFIX', '')
endif

application_id = 'org.gnome.Nautilus@0@'.format(profile)

conf.set_quoted('VERSION', version)
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('GETTEXT_PACKAGE', 'nautilus')
conf.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
conf.set_quoted('NAUTILUS_DATADIR', join_paths(datadir, 'nautilus'))
conf.set_quoted('NAUTILUS_EXTENSIONDIR', join_paths(prefix, extensiondir))
conf.set_quoted('APPLICATION_ID', application_id)
conf.set_quoted('PROFILE', profile)

if get_option('packagekit')
  conf.set10('ENABLE_PACKAGEKIT', true)
endif
if get_option('profiling')
  conf.set10('ENABLE_PROFILING', true)
endif
if get_option('selinux')
  conf.set10('HAVE_SELINUX', true)
endif

if get_option('profile') == 'development'
  config_h = declare_dependency(
    sources: vcs_tag(
      command: ['git', 'rev-parse', '--short', 'HEAD'],
      fallback: 'devel',
      input: configure_file(
        output: 'config.h.in',
        configuration: conf
      ),
      output: 'config.h'
    )
  )
else
  configure_file(
    output: 'config.h',
    configuration: conf
  )
  config_h = dependency('', required: false)
endif
#

nautilus_include_dirs = include_directories(
  '.',
  'libnautilus-extension'
)

subdir('eel')
subdir('libnautilus-extension')

subdir('src')
if get_option('tests') != 'none'
  subdir('test')
endif
subdir('data')
subdir('po')
if get_option('docs')
  subdir('docs')
endif
if get_option('extensions')
  subdir('extensions')
endif

# Compile GSettings schemas when installing from source.
meson.add_install_script('build-aux/meson/postinstall.py')