[tepl] meson: gtk-doc



commit c8a0736118cc26af738cc725e22af78a586d5cb3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Mar 29 14:15:52 2020 +0200

    meson: gtk-doc

 docs/reference/{intro.xml.in => intro.xml}         | 10 +++---
 docs/reference/meson.build                         | 42 ++++++++++++++++++++++
 docs/reference/{tepl-docs.xml.in => tepl-docs.xml} |  4 +--
 .../{tepl-4.0-sections.txt => tepl-sections.txt}   |  0
 docs/reference/xml/gtkdocentities.ent.in           |  2 ++
 docs/reference/xml/meson.build                     | 11 ++++++
 meson.build                                        |  4 +++
 tepl/meson.build                                   |  9 ++++-
 8 files changed, 74 insertions(+), 8 deletions(-)
---
diff --git a/docs/reference/intro.xml.in b/docs/reference/intro.xml
similarity index 95%
rename from docs/reference/intro.xml.in
rename to docs/reference/intro.xml
index 94b6201..a1dc117 100644
--- a/docs/reference/intro.xml.in
+++ b/docs/reference/intro.xml
@@ -149,7 +149,7 @@
   <refsect1>
     <title>GTK and GtkSourceView dependencies</title>
     <para>
-      Tepl&nbsp;@TEPL_API_VERSION@ depends on GTK&nbsp;3 and
+      Tepl&nbsp;&package_api_version; depends on GTK&nbsp;3 and
       GtkSourceView&nbsp;4.
     </para>
   </refsect1>
@@ -157,15 +157,15 @@
   <refsect1>
     <title>pkg-config name</title>
     <para>
-      For Tepl&nbsp;@TEPL_API_VERSION@, the pkg-config name is:
-      <code>tepl-@TEPL_API_VERSION@</code>
+      For Tepl&nbsp;&package_api_version;, the pkg-config name is:
+      <code>tepl-&package_api_version;</code>
     </para>
     <para>
-      To compile a program that uses Tepl&nbsp;@TEPL_API_VERSION@, you can for
+      To compile a program that uses Tepl&nbsp;&package_api_version;, you can for
       example use the following command:
     </para>
     <para>
-      <code>$ gcc hello.c `pkg-config --cflags --libs tepl-@TEPL_API_VERSION@` -o hello</code>
+      <code>$ gcc hello.c `pkg-config --cflags --libs tepl-&package_api_version;` -o hello</code>
     </para>
   </refsect1>
 </part>
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
new file mode 100644
index 0000000..5e292f7
--- /dev/null
+++ b/docs/reference/meson.build
@@ -0,0 +1,42 @@
+subdir('xml')
+
+configure_file(
+  input: 'tepl-sections.txt',
+  output: 'tepl-@0 -sections txt'.format(TEPL_API_VERSION),
+  copy: true
+)
+
+gtkdoc_module_name = 'tepl-@0@'.format(TEPL_API_VERSION)
+html_dir = get_option('prefix') / GNOME.gtkdoc_html_dir(gtkdoc_module_name)
+
+glib_docpath = dependency('glib-2.0').get_pkgconfig_variable('prefix') / 'share/gtk-doc/html/glib'
+gobject_docpath = dependency('gobject-2.0').get_pkgconfig_variable('prefix') / 'share/gtk-doc/html/gobject'
+gio_docpath = dependency('gio-2.0').get_pkgconfig_variable('prefix') / 'share/gtk-doc/html/gio'
+gtk_docpath = dependency('gtk+-3.0').get_pkgconfig_variable('prefix') / 'share/gtk-doc/html/gtk3'
+gsv_docpath = dependency('gtksourceview-4').get_pkgconfig_variable('prefix') / 
'share/gtk-doc/html/gtksourceview-4.0'
+amtk_docpath = dependency('amtk-5').get_pkgconfig_variable('prefix') / 'share/gtk-doc/html/amtk-5.0'
+
+GNOME.gtkdoc(
+  gtkdoc_module_name,
+  main_xml: 'tepl-docs.xml',
+  src_dir: include_directories('../../tepl/'),
+  dependencies: TEPL_SHARED_LIB_DEP,
+  scan_args: ['--rebuild-types'],
+  gobject_typesfile: 'tepl-@0@.types'.format(TEPL_API_VERSION),
+  fixxref_args: [
+    '--html-dir=@0@'.format(html_dir),
+    '--extra-dir=@0@'.format(glib_docpath),
+    '--extra-dir=@0@'.format(gobject_docpath),
+    '--extra-dir=@0@'.format(gio_docpath),
+    '--extra-dir=@0@'.format(gtk_docpath),
+    '--extra-dir=@0@'.format(gsv_docpath),
+    '--extra-dir=@0@'.format(amtk_docpath)
+  ],
+  content_files: [
+    'api-breaks.xml',
+    'intro.xml',
+    'porting-guides.xml'
+  ],
+  ignore_headers: TEPL_PRIVATE_HEADERS,
+  install: true
+)
diff --git a/docs/reference/tepl-docs.xml.in b/docs/reference/tepl-docs.xml
similarity index 96%
rename from docs/reference/tepl-docs.xml.in
rename to docs/reference/tepl-docs.xml
index 546c4e0..4bf62bd 100644
--- a/docs/reference/tepl-docs.xml.in
+++ b/docs/reference/tepl-docs.xml
@@ -8,8 +8,8 @@
 ]>
 <book id="index">
   <bookinfo>
-    <title>Tepl @TEPL_API_VERSION@ Reference Manual</title>
-    <releaseinfo>for Tepl &package_version;</releaseinfo>
+    <title>Tepl &package_api_version; Reference Manual</title>
+    <releaseinfo>for &package_string;</releaseinfo>
   </bookinfo>
 
   <xi:include href="intro.xml"/>
diff --git a/docs/reference/tepl-4.0-sections.txt b/docs/reference/tepl-sections.txt
similarity index 100%
rename from docs/reference/tepl-4.0-sections.txt
rename to docs/reference/tepl-sections.txt
diff --git a/docs/reference/xml/gtkdocentities.ent.in b/docs/reference/xml/gtkdocentities.ent.in
new file mode 100644
index 0000000..f4aca11
--- /dev/null
+++ b/docs/reference/xml/gtkdocentities.ent.in
@@ -0,0 +1,2 @@
+<!ENTITY package_string "@PACKAGE_STRING@">
+<!ENTITY package_api_version "@PACKAGE_API_VERSION@">
diff --git a/docs/reference/xml/meson.build b/docs/reference/xml/meson.build
new file mode 100644
index 0000000..8cfaa36
--- /dev/null
+++ b/docs/reference/xml/meson.build
@@ -0,0 +1,11 @@
+gtkdocentities_conf_data = configuration_data()
+gtkdocentities_conf_data.set('PACKAGE_STRING', 'Tepl @0@'.format(meson.project_version()))
+gtkdocentities_conf_data.set('PACKAGE_API_VERSION', TEPL_API_VERSION)
+
+gtkdocentities_filename = 'gtkdocentities.ent'
+
+configure_file(
+  input: gtkdocentities_filename + '.in',
+  output: gtkdocentities_filename,
+  configuration: gtkdocentities_conf_data
+)
diff --git a/meson.build b/meson.build
index af79c64..8a913f6 100644
--- a/meson.build
+++ b/meson.build
@@ -133,6 +133,10 @@ subdir('tepl')
 subdir('tests')
 subdir('testsuite')
 
+if get_option('gtk_doc')
+  subdir('docs/reference')
+endif
+
 summary('API version', TEPL_API_VERSION)
 summary('Prefix', get_option('prefix'))
 summary('GVfs metadata', get_option('gvfs_metadata'))
diff --git a/tepl/meson.build b/tepl/meson.build
index 8bc7080..d581049 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -56,7 +56,7 @@ tepl_public_c_files = [
   'tepl-view.c'
 ]
 
-tepl_private_headers = [
+TEPL_PRIVATE_HEADERS = [
   'tepl-buffer-input-stream.h',
   'tepl-close-confirm-dialog-single.h',
   'tepl-encoding-converter.h',
@@ -124,6 +124,13 @@ tepl_shared_lib = shared_library(
   install: true
 )
 
+TEPL_SHARED_LIB_DEP = declare_dependency(
+  include_directories: ROOT_INCLUDE_DIR,
+  link_with: tepl_shared_lib,
+  sources: tepl_enum_types[1],
+  dependencies: TEPL_DEPS
+)
+
 PKG_CONFIG.generate(
   filebase: 'tepl-@0@'.format(TEPL_API_VERSION),
   name: 'Tepl',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]