diff --git a/data/meson.build b/data/meson.build index 74217a00f572763468fdc45ce605f25d598c96ea..70a7b0842dca0127d9672ee2c4d3855b3d171a79 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,8 +1,5 @@ # SPDX-FileCopyrightText: 2016, 2018 Bruce Cowan <bruce@bcowan.me.uk> # SPDX-License-Identifier: CC0-1.0 - -gnome = import('gnome') - resources = gnome.compile_resources('gen-resources', 'rugby.gresource.xml', source_dir: 'data') diff --git a/meson.build b/meson.build index 87b3dfb6ad985af4e73a7b043ca0b2ec41d99b31..d199a66f500f477f28af566f191bc3e8cfc77a37 100644 --- a/meson.build +++ b/meson.build @@ -1,16 +1,26 @@ -# SPDX-FileCopyrightText: 2016-2019 Bruce Cowan <bruce@bcowan.me.uk> +# SPDX-FileCopyrightText: 2016-2020 Bruce Cowan <bruce@bcowan.me.uk> # SPDX-License-Identifier: CC0-1.0 +project('rugby', 'c', + license:'GPL') -project('rugby', 'c', license:'GPL', meson_version: '>=0.45.0') +gnome = import('gnome') -add_project_arguments('-Wdeprecated-declarations', language: 'c') -add_project_arguments('-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46', language: 'c') -add_project_arguments('-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_46', language: 'c') -add_project_arguments('-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_16', language: 'c') -add_project_arguments('-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_16', language: 'c') +gio_dep = dependency('gio-2.0', version: '>= 2.46') +gtk_dep = dependency('gtk+-3.0', version: '>= 3.16') -gio_dep = dependency('gio-2.0', version: '>=2.46') -gtk_dep = dependency('gtk+-3.0', version: '>=3.16') +conf = configuration_data() +conf.set('TRY_POINTS', get_option('try_points')) +conf.set('UTRY_POINTS', get_option('utry_points')) +conf.set('KICK_POINTS', get_option('kick_points')) + +git = find_program('git', required: false) +if git.found() + VERSION = run_command('git', 'describe', '--always').stdout().strip() +else + VERSION = 'unknown' +endif + +conf.set_quoted('VERSION', VERSION) subdir('data') subdir('src') diff --git a/meson_options.txt b/meson_options.txt index b262aa440106450d1142260aba444eb14825adb7..368fd1abec872807576d28247783597f73f29cbc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,5 @@ -# SPDX-FileCopyrightText: 2018, 2019 Bruce Cowan <bruce@bcowan.me.uk> +# SPDX-FileCopyrightText: 2018-2020 Bruce Cowan <bruce@bcowan.me.uk> # SPDX-License-Identifier: CC0-1.0 - -option('try_points', type: 'string', value: '7') -option('utry_points', type: 'string', value: '5') -option('kick_points', type: 'string', value: '3') +option('try_points', type: 'integer', value: 7) +option('utry_points', type: 'integer', value: 5) +option('kick_points', type: 'integer', value: 3) diff --git a/src/main.c b/src/main.c index a71a53f5e54ed5dcf56324108e33952697d99cfb..a783419efb449e56eb5e9e5ccd7437d1764fd07d 100644 --- a/src/main.c +++ b/src/main.c @@ -33,7 +33,7 @@ about_activated (GSimpleAction *simple, "license-type", GTK_LICENSE_GPL_3_0, "authors", authors, "comments", "Rugby scores possiblities program", - "version", PACKAGE_VERSION, + "version", VERSION, NULL); } diff --git a/src/meson.build b/src/meson.build index 6a3b7bcad4147a96f98f974332315f5a61b24c4e..7d11fb6d10877e7edb8916407d3ea3e6709af2df 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,42 +1,17 @@ # SPDX-FileCopyrightText: 2016-2020 Bruce Cowan <bruce@bcowan.me.uk> # SPDX-License-Identifier: CC0-1.0 - -gnome = import('gnome') - -conf = configuration_data() -conf.set('TRY_POINTS', get_option('try_points')) -conf.set('UTRY_POINTS', get_option('utry_points')) -conf.set('KICK_POINTS', get_option('kick_points')) - -VCS_TAG = '' -COPYRIGHT_YEAR = '?' - -git = find_program('git', required: false) -if git.found() - VCS_TAG = run_command('git', 'describe', '--always').stdout().strip() -else - VCS_TAG = 'unknown' -endif - -conf.set_quoted('PACKAGE_VERSION', VCS_TAG) -conf.set_quoted('COPYRIGHT_YEAR', COPYRIGHT_YEAR) - -config_h = configure_file(configuration: conf, output: 'config.h') - -sources = files( +sources = [ 'main.c', 'rugby-app-window.c', 'rugby-list-store.c', 'rugby-possibility.c', 'rugby-possibility-widget.c' -) +] -sources += config_h -sources += resources - -deps = [gio_dep, gtk_dep] +config_h = configure_file(configuration: conf, output: 'config.h') executable('rugby', - sources, - dependencies: deps, + sources, resources, config_h, + dependencies: [gio_dep, gtk_dep], + install_dir: get_option('bindir'), install: true)