diff options
author | Soapux <35306504+Soapux@users.noreply.github.com> | 2018-03-23 21:30:47 -0500 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2018-03-27 09:33:04 +0100 |
commit | 6a16dad69dd11f07f4a9fea9a94901df36665018 (patch) | |
tree | 1a69b28af4d8d86e9ee3bf978e975c49d986f141 | |
parent | f919d587e853f4c4485272708a069eb175353421 (diff) | |
download | colord-6a16dad69dd11f07f4a9fea9a94901df36665018.tar.gz |
Update style of Meson build options
Following the style guidelines here: https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
Also update the README with meson instructions for compiling on Linux.
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | contrib/ci/build_and_test.sh | 10 | ||||
-rw-r--r-- | contrib/colord.spec.in | 16 | ||||
-rw-r--r-- | contrib/meson.build | 2 | ||||
-rw-r--r-- | contrib/session-helper/meson.build | 4 | ||||
-rw-r--r-- | data/meson.build | 8 | ||||
-rw-r--r-- | data/profiles/meson.build | 2 | ||||
-rw-r--r-- | data/tests/meson.build | 2 | ||||
-rw-r--r-- | lib/colord/meson.build | 6 | ||||
-rw-r--r-- | lib/colorhug/meson.build | 2 | ||||
-rw-r--r-- | lib/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 36 | ||||
-rw-r--r-- | meson_options.txt | 32 | ||||
-rw-r--r-- | policy/meson.build | 2 | ||||
-rw-r--r-- | rules/meson.build | 2 | ||||
-rw-r--r-- | src/meson.build | 4 | ||||
-rw-r--r-- | src/plugins/meson.build | 2 | ||||
-rw-r--r-- | src/sensors/meson.build | 2 | ||||
-rw-r--r-- | src/sensors/munki/meson.build | 2 |
19 files changed, 69 insertions, 69 deletions
@@ -41,7 +41,7 @@ Ensure the following packages are installed: * systemd-devel * vala-tools -Then just do `./autogen.sh && make` +Then just do `mkdir build && cd build && meson --prefix=/usr .. && ninja` Compiling for Microsoft Windows =============================== diff --git a/contrib/ci/build_and_test.sh b/contrib/ci/build_and_test.sh index 5ae9515..4e97f75 100755 --- a/contrib/ci/build_and_test.sh +++ b/contrib/ci/build_and_test.sh @@ -4,11 +4,11 @@ export LC_ALL=C.UTF-8 mkdir -p build && cd build rm * -rf meson .. \ - -Denable-vala=true \ - -Denable-print-profiles=false \ - -Denable-argyllcms-sensor=false \ - -Denable-sane=true \ - -Denable-libcolordcompat=true $@ + -Dvapi=true \ + -Dprint_profiles=false \ + -Dargyllcms_sensor=false \ + -Dsane=true \ + -Dlibcolordcompat=true $@ ninja -v || bash ninja test -v DESTDIR=/tmp/install-ninja ninja install diff --git a/contrib/colord.spec.in b/contrib/colord.spec.in index 2225424..c61e19e 100644 --- a/contrib/colord.spec.in +++ b/contrib/colord.spec.in @@ -116,23 +116,23 @@ This may be useful for CMYK soft-proofing or for extra device support. ulimit -Sv 2000000 %meson \ - -Denable-vala=true \ + -Dvapi=true \ %if 0%{?build_print_profiles} - -Denable-print-profiles=true \ + -Dprint_profiles=true \ %else - -Denable-print-profiles=false \ + -Dprint_profiles=false \ %endif %if 0%{?enable_sane} - -Denable-sane=true \ + -Dsane=true \ %endif %if 0%{?rhel} - -Denable-bash-completion=false \ - -Denable-argyllcms-sensor=false \ + -Dbash_completion=false \ + -Dargyllcms_sensor=false \ %endif %if !0%{?rhel} - -Denable-libcolordcompat=true \ + -Dlibcolordcompat=true \ %endif - -Dwith-daemon-user=colord + -Ddaemon_user=colord %meson_build diff --git a/contrib/meson.build b/contrib/meson.build index 740bf14..bb524bf 100644 --- a/contrib/meson.build +++ b/contrib/meson.build @@ -1,5 +1,5 @@ subdir('session-helper') -if get_option('enable-sane') +if get_option('sane') subdir('colord-sane') endif diff --git a/contrib/session-helper/meson.build b/contrib/session-helper/meson.build index 2ce7b23..66e6e5b 100644 --- a/contrib/session-helper/meson.build +++ b/contrib/session-helper/meson.build @@ -13,7 +13,7 @@ con2 = configuration_data() con2.set('servicedir', libexecdir) # replace @servicedir@ -if get_option('enable-systemd') +if get_option('systemd') configure_file( input : 'colord-session.service.in', output : 'colord-session.service', @@ -63,7 +63,7 @@ executable( install_data('org.freedesktop.ColorHelper.gschema.xml', install_dir : 'share/glib-2.0/schemas') -if get_option('enable-session-example') +if get_option('session_example') executable( 'colord-session-example', sources : [ diff --git a/data/meson.build b/data/meson.build index c27bfcd..e9bf87b 100644 --- a/data/meson.build +++ b/data/meson.build @@ -6,13 +6,13 @@ subdir('ref') subdir('tests') subdir('ti1') -if get_option('enable-systemd') +if get_option('systemd') install_data('colord.conf', install_dir: systemd.get_pkgconfig_variable('tmpfilesdir') ) endif -if get_option('enable-bash-completion') +if get_option('bash_completion') install_data('colormgr', install_dir: bash_completion.get_pkgconfig_variable('completionsdir') ) @@ -20,10 +20,10 @@ endif con2 = configuration_data() con2.set('servicedir', libexecdir) -con2.set('daemon_user', get_option('with-daemon-user')) +con2.set('daemon_user', get_option('daemon_user')) # replace @servicedir@ and @daemon_user@ -if get_option('enable-systemd') +if get_option('systemd') configure_file( input : 'colord.service.in', output : 'colord.service', diff --git a/data/profiles/meson.build b/data/profiles/meson.build index 37c1b62..591b97d 100644 --- a/data/profiles/meson.build +++ b/data/profiles/meson.build @@ -43,7 +43,7 @@ icc_print_profiles = [ ] icc_profiles = icc_display_profiles -if get_option('enable-print-profiles') +if get_option('print_profiles') icc_profiles += icc_print_profiles endif diff --git a/data/tests/meson.build b/data/tests/meson.build index dee394d..8b38f10 100644 --- a/data/tests/meson.build +++ b/data/tests/meson.build @@ -1,4 +1,4 @@ -if get_option('enable-installed-tests') +if get_option('installed_tests') install_data([ 'calibration.ccmx', 'corrupt-dict.icc', diff --git a/lib/colord/meson.build b/lib/colord/meson.build index 47ff08c..e763bcb 100644 --- a/lib/colord/meson.build +++ b/lib/colord/meson.build @@ -202,7 +202,7 @@ libcolord_girtarget = gnome.generate_gir(colord, libcolord_gir = libcolord_girtarget[0] libcolord_typelib = libcolord_girtarget[1] -if get_option('enable-vala') +if get_option('vapi') gnome.generate_vapi('colord', sources: libcolord_girtarget[0], packages: ['gio-2.0'], @@ -210,7 +210,7 @@ gnome.generate_vapi('colord', ) endif -if get_option('enable-installed-tests') +if get_option('installed_tests') con2 = configuration_data() con2.set('installedtestsdir', join_paths(libexecdir, 'installed-tests', 'colord')) @@ -230,7 +230,7 @@ configure_file( ) endif -if get_option('enable-tests') +if get_option('tests') testdatadir = join_paths(meson.source_root(), 'data', 'tests') e = executable( 'colord-self-test-private', diff --git a/lib/colorhug/meson.build b/lib/colorhug/meson.build index 054e499..e555673 100644 --- a/lib/colorhug/meson.build +++ b/lib/colorhug/meson.build @@ -104,7 +104,7 @@ libcolorhug_gir = gnome.generate_gir(colorhug, install : true ) -if get_option('enable-tests') +if get_option('tests') testdatadir = join_paths(meson.source_root(), 'data', 'tests') e = executable( 'ch-self-test', diff --git a/lib/meson.build b/lib/meson.build index 8c3e545..a25a5e1 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -3,6 +3,6 @@ lib_incdir = include_directories('.') subdir('colord') subdir('colorhug') -if get_option('enable-libcolordcompat') +if get_option('libcolordcompat') subdir('compat') endif diff --git a/meson.build b/meson.build index a40dc23..b40c996 100644 --- a/meson.build +++ b/meson.build @@ -119,11 +119,11 @@ gudev = dependency('gudev-1.0') libm = cc.find_library('m', required: false) libudev = dependency('libudev') -if get_option('enable-udev-rules') +if get_option('udev_rules') udev = dependency('udev') endif -if get_option('enable-systemd') +if get_option('systemd') systemd = dependency('systemd') libsystemd = dependency('libsystemd') conf.set('HAVE_SYSTEMD', '1') @@ -142,48 +142,48 @@ if cc.has_function('getuid', prefix : '#include<unistd.h>') conf.set('HAVE_GETUID', '1') endif -if get_option('enable-libcolordcompat') +if get_option('libcolordcompat') conf.set('BUILD_LIBCOLORDCOMPAT', '1') endif -if get_option('enable-session-example') +if get_option('session_example') gnome_desktop = dependency('gnome-desktop-3.0', version : '>= 0.2.7') colord_gtk = dependency('colord-gtk', version : '>= 0.1.24') endif -if get_option('enable-bash-completion') +if get_option('bash_completion') bash_completion = dependency('bash-completion', version : '>= 2.0') endif -if get_option('enable-sane') +if get_option('sane') sane = dependency('sane-backends') dbus = dependency('dbus-1') conf.set('HAVE_SANE', '1') endif -if get_option('enable-argyllcms-sensor') +if get_option('argyllcms_sensor') spotread = find_program('spotread') conf.set('HAVE_ARGYLLCMS_SENSOR', '1') endif -if get_option('enable-print-profiles') +if get_option('print_profiles') colprof = find_program('colprof') conf.set_quoted('TOOL_COLPROF', colprof.path()) endif -if get_option('enable-vala') +if get_option('vapi') vapigen = find_program('vapigen') endif -if get_option('enable-reverse') +if get_option('reverse') conf.set('CD_BUILD_REVERSE', '1') endif -conf.set_quoted('DAEMON_USER', get_option('with-daemon-user')) -if get_option('with-daemon-user') == 'root' +conf.set_quoted('DAEMON_USER', get_option('daemon_user')) +if get_option('daemon_user') == 'root' message('RUNNING THIS AS root IS NOT A GOOD IDEA SEE --with-daemon-user') endif -if get_option('with-pnp-ids') != '' - conf.set_quoted('PNP_IDS', get_option('with-pnp-ids')) +if get_option('pnp_ids') != '' + conf.set_quoted('PNP_IDS', get_option('pnp_ids')) endif polkit = dependency('polkit-gobject-1', version : '>= 0.103') @@ -248,7 +248,7 @@ subdir('po') # this needs libcolord subdir('client') subdir('contrib') -if get_option('enable-docs') +if get_option('docs') subdir('doc') endif @@ -256,14 +256,14 @@ endif subdir('data') # this needs data/profiles/*.icc -if get_option('enable-man') +if get_option('man') subdir('man') endif subdir('policy') -if get_option('enable-udev-rules') +if get_option('udev_rules') subdir('rules') endif subdir('src') meson.add_install_script('meson_post_install.sh', - localstatedir, get_option('with-daemon-user')) + localstatedir, get_option('daemon_user')) diff --git a/meson_options.txt b/meson_options.txt index 1731380..fde9ae6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,16 +1,16 @@ -option('enable-session-example', type : 'boolean', value : false, description : 'Enable session example') -option('enable-bash-completion', type : 'boolean', value : true, description : 'Enable bash completion') -option('enable-udev-rules', type: 'boolean', value: true, description: 'Install udev rules') -option('enable-systemd', type : 'boolean', value : true, description : 'Enable systemd integration') -option('enable-libcolordcompat', type : 'boolean', value : false, description : 'Enable libcolordcompat.so which is used by ArgyllCMS') -option('enable-argyllcms-sensor', type : 'boolean', value : true, description : 'Enable ArgllCMS sensor') -option('enable-reverse', type : 'boolean', value : false, description : 'Enable reverse engineering tools') -option('enable-sane', type : 'boolean', value : false, description : 'Enable SANE support') -option('enable-vala', type : 'boolean', value : false, description : 'Build vala bindings') -option('enable-print-profiles', type : 'boolean', value : false, description : 'Build extra print profiles') -option('enable-tests', type : 'boolean', value : true, description : 'Build self tests') -option('enable-installed-tests', type : 'boolean', value : false, description : 'Install tests') -option('with-daemon-user', type : 'string', value : 'root', description : 'User for running the colord daemon') -option('with-pnp-ids', type : 'string', value : '', description : 'Location of pnp.ids if hwdb is not available') -option('enable-man', type : 'boolean', value : true, description : 'Generate man pages') -option('enable-docs', type : 'boolean', value : true, description : 'Generate documentation') +option('session_example', type : 'boolean', value : false, description : 'Enable session example') +option('bash_completion', type : 'boolean', value : true, description : 'Enable bash completion') +option('udev_rules', type: 'boolean', value: true, description: 'Install udev rules') +option('systemd', type : 'boolean', value : true, description : 'Enable systemd integration') +option('libcolordcompat', type : 'boolean', value : false, description : 'Enable libcolordcompat.so which is used by ArgyllCMS') +option('argyllcms_sensor', type : 'boolean', value : true, description : 'Enable ArgllCMS sensor') +option('reverse', type : 'boolean', value : false, description : 'Enable reverse engineering tools') +option('sane', type : 'boolean', value : false, description : 'Enable SANE support') +option('vapi', type : 'boolean', value : false, description : 'Build vala bindings') +option('print_profiles', type : 'boolean', value : false, description : 'Build extra print profiles') +option('tests', type : 'boolean', value : true, description : 'Build self tests') +option('installed_tests', type : 'boolean', value : false, description : 'Install tests') +option('daemon_user', type : 'string', value : 'root', description : 'User for running the colord daemon') +option('pnp_ids', type : 'string', value : '', description : 'Location of pnp.ids if hwdb is not available') +option('man', type : 'boolean', value : true, description : 'Generate man pages') +option('docs', type : 'boolean', value : true, description : 'Generate documentation') diff --git a/policy/meson.build b/policy/meson.build index 8880b23..1c9580e 100644 --- a/policy/meson.build +++ b/policy/meson.build @@ -1,5 +1,5 @@ con2 = configuration_data() -con2.set('DAEMON_USER', get_option('with-daemon-user')) +con2.set('DAEMON_USER', get_option('daemon_user')) policy_in = configure_file( input : 'org.freedesktop.color.policy.in.in', output : 'org.freedesktop.color.policy.in', diff --git a/rules/meson.build b/rules/meson.build index 4e7800e..7985e1d 100644 --- a/rules/meson.build +++ b/rules/meson.build @@ -1,5 +1,5 @@ con2 = configuration_data() -con2.set('DAEMON_USER', get_option('with-daemon-user')) +con2.set('DAEMON_USER', get_option('daemon_user')) sensor_rules_in = configure_file( input : '69-cd-sensors.rules.in', output : '69-cd-sensors.rules', diff --git a/src/meson.build b/src/meson.build index a3324ab..afe3b2c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -26,7 +26,7 @@ resources_src = gnome.compile_resources( ) colord_extra_deps = [] -if get_option('enable-systemd') +if get_option('systemd') colord_extra_deps += libsystemd endif @@ -74,7 +74,7 @@ executable( install_dir : libexecdir ) -if get_option('enable-tests') +if get_option('tests') e = executable( 'cd-self-test', resources_src, diff --git a/src/plugins/meson.build b/src/plugins/meson.build index 80572bd..68719cb 100644 --- a/src/plugins/meson.build +++ b/src/plugins/meson.build @@ -51,7 +51,7 @@ shared_module('colord_sensor_scanner', gudev, ], ) -if get_option('enable-sane') +if get_option('sane') shared_module('colord_sensor_sane', sources : [ 'cd-plugin-sane.c', diff --git a/src/sensors/meson.build b/src/sensors/meson.build index b9c9253..9c89cec 100644 --- a/src/sensors/meson.build +++ b/src/sensors/meson.build @@ -8,7 +8,7 @@ subdir('munki') cargs = ['-DG_LOG_DOMAIN="Cd"'] -if get_option('enable-reverse') +if get_option('reverse') executable( 'cd-parse-beagle', sources : [ diff --git a/src/sensors/munki/meson.build b/src/sensors/munki/meson.build index 784ce06..f93fbba 100644 --- a/src/sensors/munki/meson.build +++ b/src/sensors/munki/meson.build @@ -1,4 +1,4 @@ -if get_option('enable-reverse') +if get_option('reverse') shared_module('colord_sensor_munki', sources : [ 'cd-sensor-munki.c', |