On 31.08.22 20:11, Andres Freund wrote:
>> doc/src/sgml/resolv.xsl: I don't understand what this is doing. Maybe
>> at least add a comment in the file.
> It's only used for building epubs. Perhaps I should extract that into a
> separate patch as well? The relevant section is:
>
>> #
>> # epub
>> #
>>
>> # This was previously implemented using dbtoepub - but that doesn't seem to
>> # support running in build != source directory (i.e. VPATH builds already
>> # weren't supported).
>> if pandoc.found() and xsltproc.found()
>> # XXX: Wasn't able to make pandoc successfully resolve entities
>> # XXX: Perhaps we should just make all targets use this, to avoid repeatedly
>> # building whole thing? It's comparatively fast though.
>> postgres_full_xml = custom_target('postgres-full.xml',
>> input: ['resolv.xsl', 'postgres.sgml'],
>> output: ['postgres-full.xml'],
>> depends: doc_generated + [postgres_sgml_valid],
>> command: [xsltproc, '--path', '@OUTDIR@/', xsltproc_flags,
>> '-o', '@OUTPUT@', '@INPUT@'],
>> build_by_default: false,
>> )
> A noted, I couldn't make pandoc resolve our entities, so I used resolv.xsl
> them, before calling pandoc.
>
> I'll rename it to resolve-entities.xsl and add a comment.
We can have xmllint do this. The following gets the epub build working
with vpath:
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 4ae7ca2be7..33b72d03db 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -184,8 +184,12 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path
'$(srcdir)/'
epub: postgres.epub
postgres.epub: postgres.sgml $(ALLSGML) $(ALL_IMAGES)
- $(XMLLINT) --noout --valid $<
- $(DBTOEPUB) -o $@ $<
+ $(XMLLINT) $(XMLINCLUDE) --output tmp.sgml --noent --valid $<
+ifeq ($(vpath_build),yes)
+ $(MKDIR_P) images
+ cp $(ALL_IMAGES) images/
+endif
+ $(DBTOEPUB) -o $@ tmp.sgml
This could also be combined with the idea of the postgres.sgml.valid
thing you have in the meson patch set.
I'll finish this up and produce a proper patch.