traversity/traversity

Parents c907ae0b1b01
Children 76bc12bbf02e
Add version info, add a pkg-config file, and make the docs actually build

Testing Done:
Compiled with docs and introspection on and off.

Reviewed at https://reviews.imfreedom.org/r/1885/
--- a/meson.build Tue Oct 04 02:26:34 2022 -0500
+++ b/meson.build Tue Oct 04 02:29:15 2022 -0500
@@ -1,9 +1,39 @@
project('libtraversity', 'C', version : '0.0.1')
###############################################################################
+# Version Stuff
+###############################################################################
+traversity_soversion = 0
+
+parts = meson.project_version().split('-')
+if parts.length() > 1
+ traversity_extra_version = parts[1]
+else
+ traversity_extra_version = ''
+endif
+
+parts = parts[0].split('.')
+traversity_major_version = parts[0]
+traversity_minor_version = parts[1]
+traversity_micro_version = parts[2]
+
+LIBTRAVERSITY_VERSION = '@0@.@1@.@2@'.format(traversity_soversion,
+ traversity_minor_version,
+ traversity_micro_version)
+
+version_conf = configuration_data()
+version_conf.set('TRAVERSITY_MAJOR_VERSION', traversity_major_version)
+version_conf.set('TRAVERSITY_MINOR_VERSION', traversity_minor_version)
+version_conf.set('TRAVERSITY_MICRO_VERSION', traversity_micro_version)
+version_conf.set('TRAVERSITY_EXTRA_VERSION', traversity_extra_version)
+version_conf.set('TRAVERSITY_VERSION', meson.project_version())
+version_conf.set('TRAVERSITY_API_VERSION', traversity_soversion)
+
+###############################################################################
# Module imports
###############################################################################
gnome = import('gnome')
+pkgconfig = import('pkgconfig')
###############################################################################
# Basic Variables
--- a/traversity/meson.build Tue Oct 04 02:26:34 2022 -0500
+++ b/traversity/meson.build Tue Oct 04 02:29:15 2022 -0500
@@ -43,6 +43,7 @@
TRAVERSITY_ALL_SOURCES,
dependencies : [GLIB, GOBJECT, TEMPLATE_GLIB],
c_args : ['-DTRAVERSITY_COMPILATION'],
+ version : LIBTRAVERSITY_VERSION,
include_directories : [toplevel_inc, traversity_inc],
)
@@ -55,6 +56,15 @@
meson.override_dependency(traversity_filebase, traversity_dep)
+pkgconfig.generate(
+ libtraversity,
+ name : 'libtraversity',
+ description : 'NAT traversal library',
+ version : meson.project_version(),
+ filebase : traversity_filebase,
+ subdirs : [traversity_filebase],
+ requires : [GLIB, GOBJECT, TEMPLATE_GLIB])
+
if get_option('introspection')
traversity_gir = gnome.generate_gir(libtraversity,
sources : TRAVERSITY_ALL_SOURCES,
@@ -68,3 +78,5 @@
install : true,
extra_args : ['-DTRAVERSITY_COMPILATION', '--quiet'])
endif
+
+subdir('reference')