Commit 4ffde65f authored by Richard Hughes's avatar Richard Hughes

Use meson arguments of a standard style

http://mesonbuild.com/Style-guide.html provides some guidelines on how to name
meson options.

Fixes #299
parent a1df021a
......@@ -104,14 +104,14 @@ Adds support for Snap packages from the Snap store.
%build
%meson \
-Denable-snap=false \
-Denable-gudev=true \
-Denable-packagekit=true \
-Denable-external-appstream=false \
-Denable-rpm-ostree=true \
-Denable-tests=false \
-Denable-ubuntuone=false \
-Denable-ubuntu-reviews=false
-Dsnap=false \
-Dgudev=true \
-Dpackagekit=true \
-Dexternal_appstream=false \
-Drpm_ostree=true \
-Dtests=false \
-Dubuntuone=false \
-Dubuntu_reviews=false
%meson_build
%install
......
......@@ -6,7 +6,7 @@ compiled_schemas = gnome.compile_schemas()
install_data('org.gnome.software.gschema.xml',
install_dir : 'share/glib-2.0/schemas')
if get_option('enable-external-appstream')
if get_option('external_appstream')
# replace @libexecdir@
conf_data = configuration_data()
conf_data.set('libexecdir', join_paths(get_option('prefix'),
......
if get_option('enable-gtk-doc')
if get_option('gtk_doc')
subdir('api')
endif
......@@ -65,7 +65,7 @@ librarydeps = [
valgrind,
]
if get_option('enable-polkit')
if get_option('polkit')
librarydeps += polkit
endif
......@@ -121,7 +121,7 @@ executable(
install_dir : get_option('libexecdir')
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), '..', 'data') + '"']
e = executable(
'gs-self-test',
......
......@@ -103,7 +103,7 @@ libsecret = dependency('libsecret-1')
libsoup = dependency('libsoup-2.4', version : '>= 2.52.0')
sqlite3 = dependency('sqlite3')
if get_option('enable-valgrind')
if get_option('valgrind')
message(meson.version())
# urgh, meson is broken
if meson.version().version_compare('>0.41.0')
......@@ -118,55 +118,55 @@ else
valgrind = []
endif
if get_option('enable-gnome-desktop')
if get_option('gnome_desktop')
gnome_desktop = dependency('gnome-desktop-3.0', version : '>= 3.18.0')
conf.set('HAVE_GNOME_DESKTOP', 1)
endif
if get_option('enable-gspell')
if get_option('gspell')
gspell = dependency('gspell-1')
conf.set('HAVE_GSPELL', 1)
endif
if get_option('enable-polkit')
if get_option('polkit')
polkit = dependency('polkit-gobject-1')
conf.set('HAVE_POLKIT', 1)
endif
if get_option('enable-packagekit')
if get_option('packagekit')
packagekit = dependency('packagekit-glib2', version : '>= 1.1.0')
conf.set('HAVE_PACKAGEKIT', '1')
add_project_arguments('-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE',
language : 'c')
if get_option('enable-packagekit-autoremove')
if get_option('packagekit_autoremove')
conf.set('GS_PACKAGEKIT_AUTOREMOVE', 'TRUE')
else
conf.set('GS_PACKAGEKIT_AUTOREMOVE', 'FALSE')
endif
endif
if get_option('enable-fwupd')
if get_option('fwupd')
fwupd = dependency('fwupd', version : '>= 1.0.3')
endif
if get_option('enable-flatpak')
if get_option('flatpak')
flatpak = dependency('flatpak', version : '>= 0.99.3')
endif
if get_option('enable-rpm-ostree')
if get_option('rpm_ostree')
ostree = dependency('ostree-1')
rpm_ostree = dependency('rpm-ostree-1', version : '>= 2018.4')
endif
if get_option('enable-ubuntu-reviews')
if get_option('ubuntu_reviews')
oauth = dependency('oauth')
endif
if get_option('enable-gudev')
if get_option('gudev')
gudev = dependency('gudev-1.0')
endif
if get_option('enable-snap')
if get_option('snap')
snap = dependency('snapd-glib', version : '>= 1.41')
endif
......
option('enable-tests', type : 'boolean', value : true, description : 'enable tests')
option('enable-gspell', type : 'boolean', value : true, description : 'enable gspell')
option('enable-gnome-desktop', type : 'boolean', value : true, description : 'enable gnome-desktop')
option('enable-man', type : 'boolean', value : true, description : 'enable man pages')
option('enable-packagekit', type : 'boolean', value : true, description : 'enable PackageKit support')
option('enable-packagekit-autoremove', type : 'boolean', value : false, description : 'autoremove packages in PackageKit')
option('enable-polkit', type : 'boolean', value : true, description : 'enable PolKit support')
option('enable-fwupd', type : 'boolean', value : true, description : 'enable fwupd support')
option('enable-flatpak', type : 'boolean', value : true, description : 'enable Flatpak support')
option('enable-rpm-ostree', type : 'boolean', value : false, description : 'enable rpm-ostree support')
option('enable-steam', type : 'boolean', value : true, description : 'enable Steam support')
option('enable-shell-extensions', type : 'boolean', value : true, description : 'enable shell extensions support')
option('enable-odrs', type : 'boolean', value : true, description : 'enable ODRS support')
option('enable-ubuntuone', type : 'boolean', value : true, description : 'enable UbuntuOne support')
option('enable-ubuntu-reviews', type : 'boolean', value : true, description : 'enable Ubuntu reviews support')
option('enable-webapps', type : 'boolean', value : true, description : 'enable webapps support')
option('enable-gudev', type : 'boolean', value : true, description : 'enable GUdev support')
option('enable-snap', type : 'boolean', value : false, description : 'enable Snap support')
option('enable-external-appstream', type : 'boolean', value : false, description : 'enable external AppStream support')
option('enable-valgrind', type : 'boolean', value : true, description : 'enable Valgrind debugging integration')
option('enable-gtk-doc', type : 'boolean', value : true, description : 'enable API reference')
option('tests', type : 'boolean', value : true, description : 'enable tests')
option('gspell', type : 'boolean', value : true, description : 'enable gspell')
option('gnome_desktop', type : 'boolean', value : true, description : 'enable gnome-desktop')
option('man', type : 'boolean', value : true, description : 'enable man pages')
option('packagekit', type : 'boolean', value : true, description : 'enable PackageKit support')
option('packagekit_autoremove', type : 'boolean', value : false, description : 'autoremove packages in PackageKit')
option('polkit', type : 'boolean', value : true, description : 'enable PolKit support')
option('fwupd', type : 'boolean', value : true, description : 'enable fwupd support')
option('flatpak', type : 'boolean', value : true, description : 'enable Flatpak support')
option('rpm_ostree', type : 'boolean', value : false, description : 'enable rpm-ostree support')
option('steam', type : 'boolean', value : true, description : 'enable Steam support')
option('shell_extensions', type : 'boolean', value : true, description : 'enable shell extensions support')
option('odrs', type : 'boolean', value : true, description : 'enable ODRS support')
option('ubuntuone', type : 'boolean', value : true, description : 'enable UbuntuOne support')
option('ubuntu_reviews', type : 'boolean', value : true, description : 'enable Ubuntu reviews support')
option('webapps', type : 'boolean', value : true, description : 'enable webapps support')
option('gudev', type : 'boolean', value : true, description : 'enable GUdev support')
option('snap', type : 'boolean', value : false, description : 'enable Snap support')
option('external_appstream', type : 'boolean', value : false, description : 'enable external AppStream support')
option('valgrind', type : 'boolean', value : true, description : 'enable Valgrind debugging integration')
option('gtk_doc', type : 'boolean', value : true, description : 'enable API reference')
......@@ -192,7 +192,7 @@ shared_module(
dependencies : plugin_libs
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DLOCALPLUGINDIR="' + meson.current_build_dir() + '"']
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), 'tests') + '"']
e = executable(
......
......@@ -13,7 +13,7 @@ shared_module(
dependencies : plugin_libs
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DLOCALPLUGINDIR="' + meson.current_build_dir() + '"']
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), 'tests') + '"']
e = executable(
......
......@@ -15,7 +15,7 @@ shared_module(
dependencies : [appstream_glib, gio_unix, gtk, libsoup]
)
if get_option('enable-tests')
if get_option('tests')
e = executable(
'gs-self-test-dummy',
compiled_schemas,
......
......@@ -25,7 +25,7 @@ i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), '..', '..', 'data') + '"']
e = executable(
'gs-self-test-epiphany',
......
......@@ -32,7 +32,7 @@ i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DLOCALPLUGINDIR="' + meson.current_build_dir() + '"']
cargs += ['-DLOCALPLUGINDIR_CORE="' + meson.current_build_dir() + '/../core"']
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_build_dir(), 'tests') + '"']
......
......@@ -27,7 +27,7 @@ i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), 'tests') + '"']
e = executable(
'gs-self-test-fwupd',
......
......@@ -13,40 +13,40 @@ subdir('dummy')
subdir('epiphany')
subdir('fedora-pkgdb-collections')
if get_option('enable-flatpak')
if get_option('flatpak')
subdir('flatpak')
endif
if get_option('enable-fwupd')
if get_option('fwupd')
subdir('fwupd')
endif
if get_option('enable-gudev')
if get_option('gudev')
subdir('modalias')
endif
if get_option('enable-odrs')
if get_option('odrs')
subdir('odrs')
endif
if get_option('enable-packagekit')
if get_option('packagekit')
subdir('packagekit')
endif
subdir('repos')
if get_option('enable-rpm-ostree')
if get_option('rpm_ostree')
subdir('rpm-ostree')
endif
if get_option('enable-shell-extensions')
if get_option('shell_extensions')
subdir('shell-extensions')
endif
if get_option('enable-snap')
if get_option('snap')
subdir('snap')
endif
if get_option('enable-steam')
if get_option('steam')
subdir('steam')
endif
if get_option('enable-ubuntuone')
if get_option('ubuntuone')
subdir('ubuntuone')
endif
if get_option('enable-ubuntu-reviews')
if get_option('ubuntu_reviews')
subdir('ubuntu-reviews')
endif
if get_option('enable-external-appstream')
if get_option('external_appstream')
subdir('external-appstream')
endif
......@@ -16,7 +16,7 @@ sources : 'gs-plugin-modalias.c',
dependencies : [ plugin_libs, gudev ]
)
if get_option('enable-tests')
if get_option('tests')
e = executable(
'gs-self-test-modalias',
compiled_schemas,
......
......@@ -176,7 +176,7 @@ shared_module(
dependencies : [ plugin_libs, packagekit ]
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), 'tests') + '"']
e = executable(
'gs-self-test-packagekit',
......
......@@ -14,7 +14,7 @@ shared_module(
dependencies : plugin_libs
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), 'tests') + '"']
e = executable(
'gs-self-test-repos',
......
......@@ -14,7 +14,7 @@ sources : 'gs-plugin-shell-extensions.c',
dependencies : plugin_libs
)
if get_option('enable-tests')
if get_option('tests')
e = executable(
'gs-self-test-shell-extensions',
compiled_schemas,
......
......@@ -25,7 +25,7 @@ i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DLOCALPLUGINDIR="' + meson.current_build_dir() + '"']
cargs += ['-DLOCALPLUGINDIR_CORE="' + meson.current_build_dir() + '/../core"']
e = executable(
......
......@@ -80,7 +80,7 @@ gnome_software_dependencies = [
libsoup
]
if get_option('enable-packagekit')
if get_option('packagekit')
gnome_software_sources += [
'gs-dbus-helper.c',
]
......@@ -99,11 +99,11 @@ if get_option('enable-packagekit')
gnome_software_dependencies += [packagekit]
endif
if get_option('enable-gnome-desktop')
if get_option('gnome_desktop')
gnome_software_dependencies += [gnome_desktop]
endif
if get_option('enable-gspell')
if get_option('gspell')
gnome_software_dependencies += [gspell]
endif
......@@ -226,7 +226,7 @@ i18n.merge_file(
install_data('org.gnome.Software-search-provider.ini',
install_dir : 'share/gnome-shell/search-providers')
if get_option('enable-man')
if get_option('man')
xsltproc = find_program('xsltproc')
custom_target('manfile-gnome-software',
input: 'gnome-software.xml',
......@@ -266,7 +266,7 @@ if get_option('enable-man')
)
endif
if get_option('enable-packagekit')
if get_option('packagekit')
# replace @bindir@
configure_file(
input : 'org.freedesktop.PackageKit.service.in',
......@@ -277,7 +277,7 @@ if get_option('enable-packagekit')
)
endif
if get_option('enable-tests')
if get_option('tests')
cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), '..', 'data') + '"']
e = executable(
'gs-self-test-src',
......
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