hasl/hasl

Add a test to run `gi-docgen check` and fix the issues it found

Testing Done:
Ran the unit tests.

Reviewed at https://reviews.imfreedom.org/r/3038/
project('hasl', 'c',
default_options : ['c_std=c17', 'warning_level=3'],
license : 'LGPL-2.1-or-later',
meson_version : '>=0.58.0',
version : '0.3.0-dev')
gnome = import('gnome')
pkgconfig = import('pkgconfig')
toplevel_inc = include_directories('.')
###############################################################################
# Version Stuff
###############################################################################
parts = meson.project_version().split('-')
if parts.length() > 1
extra = parts[1]
else
extra = ''
endif
parts = parts[0].split('.')
HASL_MAJOR_VERSION = parts[0]
HASL_MINOR_VERSION = parts[1]
HASL_MICRO_VERSION = parts[2]
HASL_LIB_VERSION = f'@HASL_MAJOR_VERSION@.@HASL_MINOR_VERSION@.@HASL_MICRO_VERSION@'
version_config = configuration_data()
version_config.set('HASL_MAJOR_VERSION', HASL_MAJOR_VERSION)
version_config.set('HASL_MINOR_VERSION', HASL_MINOR_VERSION)
version_config.set('HASL_MICRO_VERSION', HASL_MICRO_VERSION)
version_config.set('HASL_EXTRA_VERSION', extra)
version_config.set('HASL_VERSION', meson.project_version())
###############################################################################
# Dependencies
###############################################################################
glib = dependency('glib-2.0', version : '>= 2.70')
gobject = dependency('gobject-2.0', version : '>= 2.70')
libidn = dependency('libidn', version : '>= 1.38')
###############################################################################
# NLS
###############################################################################
GETTEXT_PACKAGE = 'hasl'
LOCALE_DIR = get_option('prefix') / get_option('localedir')
add_project_arguments(f'-DLOCALEDIR="@LOCALE_DIR@"', language : 'c')
add_project_arguments(f'-DGETTEXT_PACKAGE="@GETTEXT_PACKAGE@"', language : 'c')
###############################################################################
# Documentation
###############################################################################
if get_option('doc') and not get_option('introspection')
error('Documentation requires GObject Introspection.')
endif
dependency(
'gi-docgen', version: '>= 2021.1',
fallback: ['gi-docgen', 'dummy_dep'],
required: get_option('doc')
)
gidocgen = find_program('gi-docgen', required : get_option('doc'))
docs_dir = get_option('prefix') / get_option('datadir') / 'doc'
doc_targets = []
if meson.backend() == 'ninja'
run_target('turtles',
command : ['ninja', '-C', '@BUILD_ROOT@', 'hasl-pot', 'all', 'test'])
endif
###############################################################################
# Sub-directories
###############################################################################
subdir('hasl')
subdir('po')
# This needs to be after all of the sub-directories have been processed.
if get_option('doc')
alias_target('doc', doc_targets)
endif