Commit 983892a6 authored by Ernestas Kulik's avatar Ernestas Kulik 🦑

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.
parent 2ad72d39
#mesondefine VERSION
#mesondefine PACKAGE_VERSION
#mesondefine GETTEXT_PACKAGE
#mesondefine HAVE_EXEMPI
#mesondefine HAVE_SELINUX
#mesondefine ENABLE_PACKAGEKIT
#mesondefine LOCALEDIR
#mesondefine NAUTILUS_DATADIR
#mesondefine NAUTILUS_EXTENSIONDIR
install_subdir ('hicolor',
install_dir: icondir)
subdir ('icons')
po_dir = join_paths (meson.source_root (), 'po')
line_up_parameters = executable ('lineup-parameters',
'lineup-parameters.c',
dependencies: [gio, gio_unix])
desktop = i18n.merge_file ('desktop',
input: 'org.gnome.Nautilus.desktop.in',
output: 'org.gnome.Nautilus.desktop',
install: true,
install_dir: desktopdir,
po_dir: po_dir,
type: 'desktop')
desktop_autorun_software = i18n.merge_file ('desktop-autorun-software',
input: 'nautilus-autorun-software.desktop.in',
output: 'nautilus-autorun-software.desktop',
install: true,
install_dir: desktopdir,
po_dir: po_dir,
type: 'desktop')
appdata = i18n.merge_file ('appdata',
input: 'org.gnome.Nautilus.appdata.xml.in',
output: 'org.gnome.Nautilus.appdata.xml',
install: true,
install_dir: appdatadir,
po_dir: po_dir,)
service_conf = configuration_data ()
service_conf.set ('bindir', join_paths (prefix, bindir))
configure_file (input: 'org.gnome.Nautilus.service.in',
output: 'org.gnome.Nautilus.service',
configuration: service_conf,
install_dir: servicedir)
configure_file (input: 'org.freedesktop.FileManager1.service.in',
output: 'org.freedesktop.FileManager1.service',
configuration: service_conf,
install_dir: servicedir)
install_data ('nautilus-search-provider.ini',
install_dir: searchproviderdir)
install_data ('org.gnome.nautilus.gschema.xml',
install_dir: schemadir)
desktop_file_validate = find_program ('desktop-file-validate', required: false)
if desktop_file_validate.found ()
test ('validate-desktop', desktop_file_validate,
args: [desktop.full_path ()])
test ('validate-desktop-autorun-software', desktop_file_validate,
args: [desktop_autorun_software.full_path ()])
install_subdir(
join_paths('icons', 'hicolor'),
install_dir: join_paths(datadir, 'icons')
)
po_dir = join_paths(meson.source_root(), 'po')
line_up_parameters = executable(
'lineup-parameters',
'lineup-parameters.c',
dependencies: [
gio,
gio_unix,
]
)
desktop = i18n.merge_file(
'desktop',
input: 'org.gnome.Nautilus.desktop.in',
output: 'org.gnome.Nautilus.desktop',
install: true,
install_dir: desktopdir,
po_dir: po_dir,
type: 'desktop'
)
desktop_autorun_software = i18n.merge_file(
'desktop-autorun-software',
input: 'nautilus-autorun-software.desktop.in',
output: 'nautilus-autorun-software.desktop',
install: true,
install_dir: desktopdir,
po_dir: po_dir,
type: 'desktop'
)
appdata = i18n.merge_file(
'appdata',
input: 'org.gnome.Nautilus.appdata.xml.in',
output: 'org.gnome.Nautilus.appdata.xml',
install: true,
install_dir: join_paths(datadir, 'appdata'),
po_dir: po_dir
)
service_conf = configuration_data()
service_conf.set('bindir', join_paths(prefix, bindir))
configure_file(
input: 'org.gnome.Nautilus.service.in',
output: 'org.gnome.Nautilus.service',
configuration: service_conf,
install_dir: servicedir
)
configure_file(
input: 'org.freedesktop.FileManager1.service.in',
output: 'org.freedesktop.FileManager1.service',
configuration: service_conf,
install_dir: servicedir
)
install_data(
'nautilus-search-provider.ini',
install_dir: join_paths(datadir, 'gnome-shell', 'search-providers')
)
install_data(
'org.gnome.nautilus.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
)
desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
test(
'validate-desktop',
desktop_file_validate,
args: [
desktop.full_path()
]
)
test(
'validate-desktop-autorun-software',
desktop_file_validate,
args: [
desktop_autorun_software.full_path()
]
)
endif
appstream_util = find_program ('appstream-util', required: false)
if appstream_util.found ()
test ('validate-appdata', appstream_util,
args: ['validate-relax', appdata.full_path ()])
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test(
'validate-appdata', appstream_util,
args: [
'validate-relax', appdata.full_path()
]
)
endif
install_man ('nautilus.1')
install_man('nautilus.1')
subdir ('reference')
subdir('reference')
docs_conf = configuration_data ()
docs_conf.set ('NAUTILUS_EXTENSION_VERSION_INFO', nautilus_extension_version)
docs_conf = configuration_data()
docs_conf.set('NAUTILUS_EXTENSION_VERSION_INFO', nautilus_extension_version)
docs_version = configure_file (input: 'version.xml.in',
output: 'version.xml',
configuration: docs_conf)
configure_file(
input: 'version.xml.in',
output: 'version.xml',
configuration: docs_conf
)
gnome.gtkdoc ('libnautilus-extension',
main_xml: 'libnautilus-extension-docs.xml',
src_dir: join_paths (meson.source_root (), 'libnautilus-extension'),
dependencies: nautilus_extension,
gobject_typesfile: 'libnautilus-extension.types',
install: true,
scan_args: ['--ignore-headers=nautilus-extension-private.h',
'--rebuild-types'])
gnome.gtkdoc(
'libnautilus-extension',
main_xml: 'libnautilus-extension-docs.xml',
src_dir: join_paths(meson.source_root(), 'libnautilus-extension'),
dependencies: nautilus_extension,
gobject_typesfile: 'libnautilus-extension.types',
install: true,
scan_args: [
'--ignore-headers=nautilus-extension-private.h',
'--rebuild-types'
]
)
subdir ('libnautilus-extension')
subdir('libnautilus-extension')
libeel_2_sources = [
'eel-accessibility.h',
'eel-accessibility.c',
'eel-art-extensions.h',
'eel-art-extensions.c',
'eel-canvas.h',
'eel-canvas.c',
'eel-debug.h',
'eel-debug.c',
'eel-gdk-extensions.h',
'eel-gdk-extensions.c',
'eel-glib-extensions.h',
'eel-glib-extensions.c',
'eel-gnome-extensions.h',
'eel-gnome-extensions.c',
'eel-graphic-effects.h',
'eel-graphic-effects.c',
'eel-gtk-extensions.h',
'eel-self-checks.h',
'eel-self-checks.c',
'eel-stock-dialogs.h',
'eel-stock-dialogs.c',
'eel-string.h',
'eel-string.c',
'eel-vfs-extensions.h',
'eel-vfs-extensions.c',
'eel.h',
'eel-gtk-extensions.c',
'eel-lib-self-check-functions.h',
'eel-lib-self-check-functions.c',
'eel-accessibility.h',
'eel-accessibility.c',
'eel-art-extensions.h',
'eel-art-extensions.c',
'eel-canvas.h',
'eel-canvas.c',
'eel-debug.h',
'eel-debug.c',
'eel-gdk-extensions.h',
'eel-gdk-extensions.c',
'eel-glib-extensions.h',
'eel-glib-extensions.c',
'eel-gnome-extensions.h',
'eel-gnome-extensions.c',
'eel-graphic-effects.h',
'eel-graphic-effects.c',
'eel-gtk-extensions.h',
'eel-self-checks.h',
'eel-self-checks.c',
'eel-stock-dialogs.h',
'eel-stock-dialogs.c',
'eel-string.h',
'eel-string.c',
'eel-vfs-extensions.h',
'eel-vfs-extensions.c',
'eel.h',
'eel-gtk-extensions.c',
'eel-lib-self-check-functions.h',
'eel-lib-self-check-functions.c',
]
libeel_2_deps = [glib, gtk, gail, libm, x11]
libeel_2_deps = [
gail,
glib,
gtk,
libm,
x11
]
libeel_2 = static_library ('eel-2', libeel_2_sources,
dependencies: libeel_2_deps,
include_directories: nautilus_include_dirs)
libeel_2 = static_library(
'eel-2',
libeel_2_sources,
dependencies: libeel_2_deps,
include_directories: nautilus_include_dirs
)
eel_2 = declare_dependency (link_with: libeel_2,
include_directories: nautilus_include_dirs,
dependencies: libeel_2_deps)
eel_2 = declare_dependency(
link_with: libeel_2,
include_directories: nautilus_include_dirs,
dependencies: libeel_2_deps
)
check_eel = executable ('check-eel',
'check-program.c',
dependencies: [eel_2, xml])
check_eel = executable(
'check-eel',
'check-program.c',
dependencies: [
eel_2,
xml
]
)
test ('check-eel', check_eel)
test('check-eel', check_eel)
nautilus_extension_version = '1.4.0'
libnautilus_extension_headers = [
'nautilus-column-provider.h',
'nautilus-column.h',
'nautilus-extension-types.h',
'nautilus-file-info.h',
'nautilus-info-provider.h',
'nautilus-location-widget-provider.h',
'nautilus-menu-item.h',
'nautilus-menu-provider.h',
'nautilus-property-page-provider.h',
'nautilus-property-page.h',
'nautilus-menu.h'
'nautilus-column-provider.h',
'nautilus-column.h',
'nautilus-extension-types.h',
'nautilus-file-info.h',
'nautilus-info-provider.h',
'nautilus-location-widget-provider.h',
'nautilus-menu-item.h',
'nautilus-menu-provider.h',
'nautilus-property-page-provider.h',
'nautilus-property-page.h',
'nautilus-menu.h'
]
install_headers (libnautilus_extension_headers,
subdir: join_paths ('nautilus', 'libnautilus-extension'))
install_headers(
libnautilus_extension_headers,
subdir: join_paths('nautilus', 'libnautilus-extension')
)
libnautilus_extension_sources = [
'nautilus-column-provider.c',
'nautilus-column.c',
'nautilus-extension-types.c',
'nautilus-extension-private.h',
'nautilus-file-info.c',
'nautilus-info-provider.c',
'nautilus-location-widget-provider.c',
'nautilus-menu-item.c',
'nautilus-menu-provider.c',
'nautilus-property-page-provider.c',
'nautilus-property-page.c',
'nautilus-menu.c'
'nautilus-column-provider.c',
'nautilus-column.c',
'nautilus-extension-types.c',
'nautilus-extension-private.h',
'nautilus-file-info.c',
'nautilus-info-provider.c',
'nautilus-location-widget-provider.c',
'nautilus-menu-item.c',
'nautilus-menu-provider.c',
'nautilus-property-page-provider.c',
'nautilus-property-page.c',
'nautilus-menu.c'
]
libnautilus_extension_deps = [glib, gtk]
libnautilus_extension_deps = [
glib,
gtk
]
libnautilus_extension = shared_library ('nautilus-extension',
libnautilus_extension_sources,
dependencies: libnautilus_extension_deps,
include_directories: nautilus_include_dirs,
version: nautilus_extension_version,
install: true)
libnautilus_extension = shared_library(
'nautilus-extension',
libnautilus_extension_sources,
dependencies: libnautilus_extension_deps,
include_directories: nautilus_include_dirs,
version: nautilus_extension_version,
install: true
)
gnome.generate_gir (libnautilus_extension,
sources: libnautilus_extension_headers + libnautilus_extension_sources,
nsversion: '3.0',
namespace: 'Nautilus',
includes: ['Gtk-3.0', 'Gio-2.0', 'GLib-2.0'],
install: true)
gnome.generate_gir(
libnautilus_extension,
sources: [
libnautilus_extension_headers,
libnautilus_extension_sources
],
nsversion: '3.0',
namespace: 'Nautilus',
includes: [
'Gtk-3.0',
'Gio-2.0',
'GLib-2.0'
],
install: true
)
nautilus_extension = declare_dependency (link_with: libnautilus_extension,
dependencies: libnautilus_extension_deps,
include_directories: nautilus_include_dirs)
nautilus_extension = declare_dependency(
link_with: libnautilus_extension,
dependencies: libnautilus_extension_deps,
include_directories: nautilus_include_dirs
)
pkgconfig_data = configuration_data ()
pkgconfig_data = configuration_data()
pkgconfig_data.set ('prefix', prefix)
pkgconfig_data.set ('exec_prefix', '${prefix}')
pkgconfig_data.set ('libdir', join_paths ('${exec_prefix}', libdir))
pkgconfig_data.set ('includedir', join_paths ('${prefix}', includedir))
pkgconfig_data.set ('extensiondir', join_paths ('${exec_prefix}', extensiondir))
pkgconfig_data.set ('VERSION', meson.project_version ())
pkgconfig_data.set('prefix', prefix)
pkgconfig_data.set('exec_prefix', '${prefix}')
pkgconfig_data.set('libdir', join_paths('${exec_prefix}', libdir))
pkgconfig_data.set('includedir', join_paths('${prefix}', includedir))
pkgconfig_data.set('extensiondir', join_paths('${exec_prefix}', extensiondir))
pkgconfig_data.set('VERSION', meson.project_version())
configure_file (input: 'libnautilus-extension.pc.in',
output: 'libnautilus-extension.pc',
configuration: pkgconfig_data,
install_dir: join_paths (libdir, 'pkgconfig'))
configure_file(
input: 'libnautilus-extension.pc.in',
output: 'libnautilus-extension.pc',
configuration: pkgconfig_data,
install_dir: join_paths(libdir, 'pkgconfig')
)
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')
option ('enable-profiling',
type: 'boolean',
value: false)
option ('enable-nst-extension',
type: 'boolean',
value: true)
option ('enable-selinux',
type: 'boolean',
value: true)
option ('enable-packagekit',
type: 'boolean',
value: true)
option ('enable-gtk-doc',
type: 'boolean',
value: false)
option('docs', type: 'boolean', value: false)
option('profiling', type: 'boolean', value: false)
option('nst_extension', type: 'boolean', value: true)
option('packagekit', type: 'boolean', value: true)
option('selinux', type: 'boolean', value: true)
libnautilus_sendto_sources = [
'nautilus-nste.c',
'nautilus-nste.h',
'nautilus-sendto-module.c'
'nautilus-nste.c',
'nautilus-nste.h',
'nautilus-sendto-module.c'
]
libnautilus_sendto = shared_library ('nautilus-sendto',
libnautilus_sendto_sources,
dependencies: nautilus_extension,
install: true,
install_dir: extensiondir)
libnautilus_sendto = shared_library(
'nautilus-sendto',
libnautilus_sendto_sources,
dependencies: nautilus_extension,
install: true,
install_dir: extensiondir
)
i18n.gettext ('nautilus', preset: 'glib')
i18n.gettext('nautilus', preset: 'glib')
This diff is collapsed.
test_copy = executable ('test-copy',
['test-copy.c',
'test.c',
'test.h'],
dependencies: libnautilus_dep)
test_copy = executable(
'test-copy', [
'test-copy.c',
'test.c',
'test.h'
],
dependencies: libnautilus_dep
)
test_nautilus_search_engine = executable ('test-nautilus-search-engine',
'test-nautilus-search-engine.c',
dependencies: libnautilus_dep)
tests = [
['test-nautilus-search-engine', [
'test-nautilus-search-engine.c'
]],
['test-nautilus-directory-async', [
'test-nautilus-directory-async.c'
]],
['test-file-utilities-get-common-filename-prefix', [
'test-file-utilities-get-common-filename-prefix.c'
]],
['test-eel-string-get-common-prefix', [
'test-eel-string-get-common-prefix.c'
]]
]
test_nautilus_directory_async = executable ('test-nautilus-directory-async',
'test-nautilus-directory-async.c',
dependencies: libnautilus_dep)
test_file_utilities_get_common_filename_prefix = executable ('test-file-utilities-get-common-filename-prefix',
'test-file-utilities-get-common-filename-prefix.c',
dependencies: libnautilus_dep)
test_eel_string_get_common_prefix = executable ('test-eel-string-get-common-prefix',
'test-eel-string-get-common-prefix.c',
dependencies: libnautilus_dep)
test ('test-nautilus-search-engine', test_nautilus_search_engine)
test ('test-nautilus-directory-async', test_nautilus_directory_async)
test ('test-file-utilities-get-common-filename-prefix', test_file_utilities_get_common_filename_prefix)
test ('test-eel-string-get-common-prefix', test_eel_string_get_common_prefix)
foreach t: tests
test(t[0], executable(t[0], t[1], dependencies: libnautilus_dep))
endforeach
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment