summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2017-12-13 20:13:54 +0200
committerErnestas Kulik <ernestask@gnome.org>2018-01-02 12:51:32 +0200
commit983892a656743cf2db89e6f824a9afb25c71b075 (patch)
tree80e657d23d6ce20fdbe62269149672eb5114fa59 /meson.build
parent2ad72d3997a6f433716cb027be963c0748379095 (diff)
downloadnautilus-983892a656743cf2db89e6f824a9afb25c71b075.tar.gz
build: general cleanups
This commit does the following: * Canonicalize the style: * Use two-space indentations. * Un-Autotools-ify option names. * Don’t align arguments, simply increase indentation. * Don’t add a space before opening parenthesis in calls. * Remove unused variables. * Remove unused dependencies. * Remove config.h.meson. * Optimize dependencies. * Use disabler functionality for libselinux dependency, to save lines.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build194
1 files changed, 95 insertions, 99 deletions
diff --git a/meson.build b/meson.build
index fbc57b034..df05c022b 100644
--- a/meson.build
+++ b/meson.build
@@ -1,110 +1,106 @@
-project ('nautilus', 'c',
- version: '3.27.2',
- meson_version: '>=0.40.0',
- license: 'GPL3+')
-
-add_global_arguments ('-Wno-deprecated-declarations', language:'c')
-
-bindir = get_option ('bindir')
-datadir = get_option ('datadir')
-appdatadir = join_paths (datadir, 'metainfo')
-desktopdir = join_paths (datadir, 'applications')
-icondir = join_paths (datadir, 'icons')
-includedir = get_option ('includedir')
-libdir = get_option ('libdir')
-extensiondir = join_paths (libdir, 'nautilus', 'extensions-3.0')
-localedir = get_option ('localedir')
-prefix = get_option ('prefix')
-schemadir = join_paths (datadir, 'glib-2.0', 'schemas')
-searchproviderdir = join_paths (datadir, 'gnome-shell', 'search-providers')
-servicedir = join_paths (datadir, 'dbus-1', 'services')
-sysconfdir = get_option ('sysconfdir')
-
-glib_ver = '>=2.51.2'
-gnome_desktop_ver = '>=3.0.0'
-pango_ver = '1.28.3'
-gtk_ver = '>=3.22.26'
-xml_ver = '>=2.7.8'
-notify_ver = '0.7.0'
-schemas_ver = '>=3.8.0'
-autoar_ver = '>=0.2.1'
-selinux_ver = '>=2.0'
-gexiv2_ver = '>= 0.10.0'
-
-cc = meson.get_compiler ('c')
-
-gnome = import ('gnome')
-i18n = import ('i18n')
-
-glib = dependency ('glib-2.0', version: glib_ver)
-gtk = dependency ('gtk+-3.0', version: gtk_ver)
-autoar = dependency ('gnome-autoar-0', version: autoar_ver)
-
-gail = dependency ('gail-3.0')
-gnome_desktop = dependency ('gnome-desktop-3.0', version: gnome_desktop_ver)
-xml = dependency ('libxml-2.0', version: xml_ver)
-x11 = dependency ('x11')
-
-gthread = dependency ('gthread-2.0', version: glib_ver)
-gmodule_no_export = dependency ('gmodule-no-export-2.0', version: glib_ver)
-gio = dependency ('gio-2.0', version: glib_ver)
-gio_unix = dependency ('gio-unix-2.0', version: glib_ver)
-gsettings_desktop_schemas = dependency ('gsettings-desktop-schemas',
- version: schemas_ver)
-gexiv2 = dependency('gexiv2', version : gexiv2_ver)
-
-libm = cc.find_library ('libm')
-
-conf = configuration_data ()
-conf.set_quoted ('VERSION', meson.project_version ())
-conf.set_quoted ('PACKAGE_VERSION', meson.project_version ())
-conf.set_quoted ('GETTEXT_PACKAGE', 'nautilus')
-conf.set_quoted ('LOCALEDIR', join_paths (prefix, localedir))
-conf.set_quoted ('NAUTILUS_DATADIR', join_paths (datadir, 'nautilus'))
-conf.set_quoted ('NAUTILUS_EXTENSIONDIR', join_paths (prefix, extensiondir))
-
-if get_option ('enable-packagekit')
- conf.set10 ('ENABLE_PACKAGEKIT', true)
+project('nautilus', 'c',
+ version: '3.27.2',
+ meson_version: '>= 0.44.0',
+ license: 'GPL3+'
+)
+
+add_global_arguments('-Wno-deprecated-declarations', language: 'c')
+
+# 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')
+#
+
+# Imports
+gnome = import('gnome')
+i18n = import('i18n')
+#
+
+# Dependencies
+glib_ver = '>= 2.51.2'
+
+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')
+gexiv = dependency('gexiv2', version: '>= 0.10.0')
+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 = disabler()
+if get_option('selinux')
+ selinux = dependency('libselinux', version: '>= 2.0')
endif
-
-if get_option ('enable-selinux')
- selinux = dependency ('libselinux', version: selinux_ver)
- conf.set10 ('HAVE_SELINUX', true)
-endif
-
-tracker_sparql = dependency ('tracker-sparql-2.0', required: false)
+tracker_sparql = dependency('tracker-sparql-2.0', required: false)
if not tracker_sparql.found()
- tracker_sparql = dependency ('tracker-sparql-1.0')
+ tracker_sparql = dependency('tracker-sparql-1.0')
+endif
+x11 = dependency('x11')
+xml = dependency('libxml-2.0', version: '>= 2.7.8')
+#
+
+# Configuration
+conf = configuration_data()
+
+conf.set_quoted('VERSION', meson.project_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))
+
+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
-configure_file (input: 'config.h.meson',
- output: 'config.h',
- configuration: conf)
-
-nautilus_include_dirs = include_directories ('.')
-
-subdir ('eel')
-subdir ('libnautilus-extension')
+configure_file(output: 'config.h', configuration: conf)
+#
-libgd_options = ['static=true',
- 'with-gtk-hacks=true',
- 'with-main-view=true',
- 'with-tagged-entry=true']
-libgd = subproject('libgd', default_options: libgd_options)
-libgd_dep = libgd.get_variable ('libgd_dep')
+nautilus_include_dirs = include_directories('.')
-subdir ('src')
-subdir ('test')
-subdir ('data')
-subdir ('po')
+subdir('eel')
+subdir('libnautilus-extension')
-if get_option ('enable-gtk-doc')
- subdir ('docs')
+subdir('src')
+subdir('test')
+subdir('data')
+subdir('po')
+if get_option('docs')
+ subdir('docs')
endif
-
-if get_option ('enable-nst-extension')
- subdir ('nautilus-sendto-extension')
+if get_option('nst_extension')
+ subdir('nautilus-sendto-extension')
endif
# Compile GSettings schemas when installing from source.
-meson.add_install_script ('build-aux/meson/postinstall.py')
+meson.add_install_script('build-aux/meson/postinstall.py')