diff --git a/po/meson.build b/po/meson.build index 5bdbecc..91918ba 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,2 +1,2 @@ i18n = import('i18n') -i18n.gettext(gettext_package, preset: 'glib') \ No newline at end of file +i18n.gettext(meson.project_name() + api_version, preset: 'glib') \ No newline at end of file diff --git a/meson.build b/meson.build index dc21fcd..b009130 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,11 @@ project( meson_version: '>= 1.1', ) +library_version = '4.1.0' +soversion = library_version.split('.')[0] + +api_version = '3' + cc = meson.get_compiler('c') valac = meson.get_compiler('vala') @@ -16,14 +21,14 @@ gtk_dependency = dependency('gtk4', version: '>= 4.2.0') includedir = join_paths(get_option('prefix'), get_option('includedir')) localedir = join_paths(get_option('prefix'), get_option('localedir')) -gettext_package = get_option('superproject_name') + '_' + meson.project_name() + +conf = configuration_data() +conf.set_quoted('VERSION', meson.project_version()) +conf.set_quoted('GETTEXT_PACKAGE', meson.project_name() + api_version) +conf.set_quoted('LOCALEDIR', localedir) + +configure_file(output: 'config.h', configuration: conf) subdir('po') subdir('games') - -lggs_dependency = declare_dependency( - link_with: lggs, - include_directories: include_directories('games/'), -) - subdir('tests') \ No newline at end of file diff --git a/games/meson.build b/games/meson.build index 6c3f95b..dd07492 100644 --- a/games/meson.build +++ b/games/meson.build @@ -1,4 +1,4 @@ -includesubdir = get_option('superproject_name') + '_gnome-games-support' +includesubdir = 'gnome-games-support-3' lggs_interface_deps = [ adw_dependency, @@ -8,8 +8,8 @@ lggs_interface_deps = [ gtk_dependency, ] -lggs = static_library('gnome-games-support-3', - [ +lggs = library('gnome-games-support-3', + [ 'config.vapi', 'gridframe.vala', 'scores/category.vala', @@ -25,9 +25,31 @@ lggs = static_library('gnome-games-support-3', ], c_args: [ '-w', - '-DGETTEXT_PACKAGE="@0@"'.format (gettext_package), - '-DLOCALEDIR="@0@"'.format (localedir), + # https://github.com/mesonbuild/meson/issues/4763 + '-include', 'config.h' ], vala_header: 'libgnome-games-support.h', + vala_vapi: 'libgnome-games-support-3.vapi', + vala_args: [ + '--abi-stability', + '--target-glib=2.44', + ], + soversion: soversion, + version: library_version, dependencies: lggs_interface_deps, ) + +lggs_dependency = declare_dependency( + link_with: lggs, + include_directories: include_directories('.'), +) + +pkg = import('pkgconfig') +pkg.generate( + lggs, + filebase: 'libgnome-games-support-3', + requires: lggs_interface_deps, + name: meson.project_name(), + description: 'Useful functionality shared among GNOME games', + subdirs: includesubdir, +) \ No newline at end of file diff --git a/games/meson.build b/games/meson.build index dd07492..b597a47 100644 --- a/games/meson.build +++ b/games/meson.build @@ -15,6 +15,9 @@ lggs = library('gnome-games-support-3', 'scores/category.vala', 'scores/context.vala', 'scores/dialog.vala', + 'scores/directory-importer.vala', + 'scores/history-file-importer.vala', + 'scores/importer.vala', 'scores/score.vala', ], install: true,