diff --git a/bindings/vala/meson.build b/bindings/vala/meson.build index 3190f00f7a0c924cdddacbb1aef7b5272ae212f3..9c2d9c0a287bb6aaaba08572837caf465d479728 100644 --- a/bindings/vala/meson.build +++ b/bindings/vala/meson.build @@ -5,13 +5,6 @@ # # Copyright (C) 2016 Igalia S.L. All rights reserved. -vapidir = join_paths([ - prefix, - get_option('datadir'), - 'vala', - 'vapi', -]) - vala_sources = [ # LIBRARY, GIR, DEPS ['grilo-@0@'.format(grl_majorminor), grl_gir[0], ['gmodule-2.0', 'gio-2.0']], ['grilo-net-@0@'.format(grl_majorminor), grlnet_gir[0], ['gio-2.0']], @@ -26,6 +19,7 @@ foreach s: vala_sources gnome.generate_vapi(lib, sources: [custom_vala, gir], packages: deps, - install: true) + install: true, + install_dir: vapidir) endforeach diff --git a/doc/meson.build b/doc/meson.build index 6872d8c8ee1951a22ff85bfbd8772ff857d37d72..00ffb4a536b8631b86080776fb518c7b27c812c1 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -7,6 +7,6 @@ subdir('man') -if get_option('enable-gtk-doc') +if get_option('gtk_doc') subdir('grilo') endif diff --git a/meson.build b/meson.build index 7f237c68e93be435b98b80cdf82614d82e7ca2b3..4a1c66059a2394ff3274277c889575550d4a65cb 100644 --- a/meson.build +++ b/meson.build @@ -46,36 +46,54 @@ gmodule_dep = dependency('gmodule-2.0', version: glib2_required_info, required: gobject_dep = dependency('gobject-2.0', version: glib2_required_info, required: true) libxml_dep = dependency('libxml-2.0', required: true) -enable_grlnet = get_option('enable-grl-net') +enable_grlnet = get_option('grl_net') if enable_grlnet libsoup_dep = dependency('libsoup-2.4', version: '>= 2.41.3', required: true) endif -enable_grlpls = get_option('enable-grl-pls') +enable_grlpls = get_option('grl_pls') if enable_grlpls totem_plparser_dep = dependency('totem-plparser', version: '>= 3.4.1', required: true) endif -enable_gir = get_option('enable-introspection') or get_option('enable-vala') +enable_gir = get_option('introspection') or get_option('vapi') if enable_gir - find_program('g-ir-scanner', required: true) + find_program('g-ir-scanner', required: true) endif -enable_vala = get_option('enable-vala') +enable_vala = get_option('vapi') if enable_vala - vapigen = find_program('vapigen', required: true) + find_program('vapigen', required: true) endif -enable_testui = get_option('enable-test-ui') +enable_testui = get_option('test_ui') if enable_testui gtk_dep = dependency('gtk+-3.0', version: '>= 3.14', required: true) oauth_dep = dependency('oauth', required: false) endif prefix = get_option('prefix') +includedir = join_paths(prefix, get_option('includedir')) libdir = join_paths(prefix, get_option('libdir')) plugins_dir = join_paths(libdir, grl_name) localedir = join_paths(prefix, get_option('localedir')) +datadir = join_paths(prefix, get_option('datadir')) + +gobject_introspection = dependency('gobject-introspection-1.0', required: false) +if gobject_introspection.found() + girdir = gobject_introspection.get_pkgconfig_variable('girdir', define_variable: ['datadir', datadir]) + typelibdir = gobject_introspection.get_pkgconfig_variable('typelibdir', define_variable: ['libdir', libdir]) +else + girdir = join_paths(datadir, 'gir-1.0') + typelibdir = join_paths(libdir, 'girepository-1.0') +endif + +vapigen = dependency('vapigen', required: false) +if vapigen.found() + vapidir = vapigen.get_pkgconfig_variable('vapidir', define_variable: ['datadir', datadir]) +else + vapidir = join_paths(datadir, 'vala', 'vapi') +endif cdata = configuration_data() cdata.set_quoted('VERSION', grilo_version) @@ -99,11 +117,11 @@ pkgconf = configuration_data() pkgconf.set('prefix', prefix) pkgconf.set('exec_prefix', '${prefix}') pkgconf.set('libdir', libdir) -pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) +pkgconf.set('includedir', join_paths('${prefix}', includedir)) pkgconf.set('GRL_NAME', grl_name) pkgconf.set('GRL_PLUGINS_DIR', plugins_dir) -pkgconf.set('INTROSPECTION_GIRDIR', '${datarootdir}/gir-1.0') -pkgconf.set('INTROSPECTION_TYPELIBDIR', '${libdir}/girepository-1.0'.format(get_option('libdir'))) +pkgconf.set('INTROSPECTION_GIRDIR', join_paths('${prefix}', girdir)) +pkgconf.set('INTROSPECTION_TYPELIBDIR', join_paths('${prefix}', typelibdir)) pkgconf.set('VERSION', grilo_version) pkgconf.set('GRLNET_VERSION', grlnet_version) pkgconf.set('GRLPLS_VERSION', grlpls_version) @@ -114,7 +132,7 @@ foreach p: pkgconfig_files configure_file(input: infile, output: outfile, configuration: pkgconf, - install_dir: '@0@/pkgconfig'.format(get_option('libdir'))) + install_dir: join_paths(libdir, 'pkgconfig')) endforeach gnome = import('gnome') diff --git a/meson_options.txt b/meson_options.txt index 5f396a1081256744461167629e230816edc86b2a..d4800f1bd1eb231339e076f0123c26e1a0fcd828 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,6 @@ -option('enable-grl-net', type: 'boolean', value: true, description: 'Enable Grilo Net library') -option('enable-grl-pls', type: 'boolean', value: true, description: 'Enable Grilo Pls library') -option('enable-gtk-doc', type: 'boolean', value: false, description: 'Enable generating the API reference') -option('enable-introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection') -option('enable-test-ui', type: 'boolean', value: true, description: 'Build Test UI') -option('enable-vala', type: 'boolean', value: true, description: 'Enable Vala (enables GObject Introspection)') +option('grl_net', type: 'boolean', value: true, description: 'Enable Grilo Net library') +option('grl_pls', type: 'boolean', value: true, description: 'Enable Grilo Pls library') +option('gtk_doc', type: 'boolean', value: false, description: 'Enable generating the API reference') +option('introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection') +option('test_ui', type: 'boolean', value: true, description: 'Build Test UI') +option('vapi', type: 'boolean', value: true, description: 'Enable Vala (enables GObject Introspection)') diff --git a/src/meson.build b/src/meson.build index 36c34b316b70518b90648aa4713d84aaa9b8e3e9..2eb46f6c45bbc02517ae84a73f525d614a397b84 100644 --- a/src/meson.build +++ b/src/meson.build @@ -120,5 +120,7 @@ if enable_gir dependencies: [ gobject_dep, gmodule_dep, gio_dep ], includes: [ 'GObject-2.0', 'GModule-2.0', 'Gio-2.0' ], install: true, + install_dir_gir: girdir, + install_dir_typelib: typelibdir, extra_args: gir_extra_args) endif