meson: docs: add texinfo target
authorAndres Freund <[email protected]>
Fri, 24 Mar 2023 06:08:06 +0000 (23:08 -0700)
committerAndres Freund <[email protected]>
Fri, 24 Mar 2023 06:14:31 +0000 (23:14 -0700)
doc/src/sgml/meson.build

index b728948af9eb6db73420391d9c53ea544d3bb01e..157b8589e55c7afb4ec54e3273df5215863f9b5a 100644 (file)
@@ -287,6 +287,39 @@ if pandoc.found() and xsltproc_bin.found()
   alldocs += postgres_epub
 endif
 
+
+##
+## Experimental Texinfo targets
+##
+
+db2x_xsltproc = find_program('db2x_xsltproc', native: true, required: false)
+db2x_texixml = find_program('db2x_texixml', native: true, required: false)
+makeinfo = find_program('makeinfo', native: true, required: false)
+
+if db2x_texixml.found() and db2x_xsltproc.found() and makeinfo.found()
+  postgres_texixml = custom_target('postgres.texixml',
+    output: 'postgres.texixml',
+    command: [db2x_xsltproc, '-s', 'texi',
+              '-g', 'output-file=postgres',
+              postgres_full_xml, '-o', '@OUTPUT@'],
+    build_by_default: false,
+  )
+  postgres_texi = custom_target('postgres.texi',
+    output: 'postgres.texi',
+    command: [db2x_texixml, '--encoding=utf-8', postgres_texixml,
+              '--output-dir=@OUTDIR@'],
+    build_by_default: false,
+  )
+  postgres_info = custom_target('postgres.info',
+    output: 'postgres.info',
+    command: [makeinfo, '--enable-encoding', '--no-split', '--no-validate',
+              postgres_texi, '-o', '@OUTPUT0@'],
+    build_by_default: false,
+  )
+  alldocs += postgres_info
+endif
+
+
 if docs.length() == 0
   run_target('docs', command: [missing, 'xsltproc'])
 else