From 075d0b37049244429b7d709dc8c21f67023bc048 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 21 Feb 2021 20:05:43 +0100 Subject: all: Initial port for gtk4 Add meson changes to build a gtk4 variant of libvte, plus a gtk4 variant of the test application. Make the minimal code changes required to successfully build and run on gtk4. No event handlers yet, and no public API to replace the gtk3 specific APIs. That will come later. This should be good enough to get non-terminal users of libvte started on porting to gtk4. https://gitlab.gnome.org/GNOME/vte/-/issues/12 --- doc/reference/Makefile.docs | 518 +++++++++++++++++++++++++++++++++++++ doc/reference/gtk3/meson.build | 55 ++++ doc/reference/gtk4/meson.build | 55 ++++ doc/reference/meson.build | 94 +------ doc/reference/version.xml.in | 1 - doc/reference/vte-docs.xml | 16 +- doc/reference/vte-overrides.txt | 0 doc/reference/vte-overrides.txt.in | 0 doc/reference/vte-sections.txt | 249 ------------------ doc/reference/vte-sections.txt.in | 261 +++++++++++++++++++ doc/reference/vte.types | 17 -- doc/reference/vte.types.in | 17 ++ 12 files changed, 925 insertions(+), 358 deletions(-) create mode 100644 doc/reference/Makefile.docs create mode 100644 doc/reference/gtk3/meson.build create mode 100644 doc/reference/gtk4/meson.build delete mode 100644 doc/reference/version.xml.in delete mode 100644 doc/reference/vte-overrides.txt create mode 100644 doc/reference/vte-overrides.txt.in delete mode 100644 doc/reference/vte-sections.txt create mode 100644 doc/reference/vte-sections.txt.in delete mode 100644 doc/reference/vte.types create mode 100644 doc/reference/vte.types.in (limited to 'doc') diff --git a/doc/reference/Makefile.docs b/doc/reference/Makefile.docs new file mode 100644 index 00000000..7193bd16 --- /dev/null +++ b/doc/reference/Makefile.docs @@ -0,0 +1,518 @@ +# -*- mode: makefile -*- +# +# Copyright © 2020, 2021 Christian Persch +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +NULL = +V ?= 0 + +abs_srcdir ?= $(srcdir) +abs_builddir ?= $(builddir) +top_srcdir ?= $(abs_top_srcdir) +top_builddir ?= $(abs_top_builddir) + +datadir ?= /usr/share + +CPP = cpp +CPPFLAGS = + +GREP ?= grep +GREPFLAGS = + +LN_S = ln -s + +PACKAGE ?= vte +PACKAGE_BUGREPORT ?= https://gitlab.gnome.org/GNOME/vte/issues/ +PACKAGE_NAME ?= vte +PACKAGE_STRING ?= vte +PACKAGE_TARNAME ?= vte +PACKAGE_URL ?= https://gitlab.gnome.org/GNOME/vte/ +PACKAGE_VERSION ?= $(VERSION) + +DOC_MODULE = vte-gtk$(VTE_GTK) + +DOC_MODULE_VERSION = $(VTE_API_VERSION) + +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +DOC_SOURCE_DIR = \ + $(top_srcdir)/src \ + $(top_srcdir)/src/vte \ + $(top_builddir)/src \ + $(top_builddir)/src/vte \ + $(NULL) + +SCANGOBJ_OPTIONS = + +SCAN_OPTIONS = \ + --deprecated-guards="VTE_DISABLE_DEPRECATED" \ + --ignore-decorators='_VTE_GNUC_NONNULL()|_VTE_PUBLIC|_VTE_DEPRECATED|_VTE_CXX_NOEXCEPT' \ + $(NULL) + +MKDB_OPTIONS = \ + --source-suffixes=c,cc,h,hh \ + --xml-mode \ + --output-format=xml \ + --name-space=vte \ + $(NULL) + +MKTMPL_OPTIONS = + +MKHTML_OPTIONS = \ + --path="$(abs_builddir)" \ + $(NULL) + +MKPDF_OPTIONS = \ + --path="$(abs_builddir)" \ + $(NULL) + +FIXXREF_OPTIONS = \ + --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo \ + --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ + --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \ + --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gio \ + --extra-dir=$(PANGO_PREFIX)/share/gtk-doc/html/pango \ + $(NULL) + +ifeq ($(VTE_GTK),3) +FIXXREF_OPTIONS += \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/gdk3 \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/gtk3 \ + $(NULL) +endif + +ifeq ($(VTE_GTK),4) +FIXXREF_OPTIONS += \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/graphene \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/gdk4 \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/gsk4 \ + --extra-dir=$(GTK_PREFIX)/share/gtk-doc/html/gtk4 \ + $(NULL) +endif + +HFILE_GLOB = \ + $(top_builddir)/src/vte/*.h \ + $(top_srcdir)/src/vte/*.h \ + $(NULL) + +CFILE_GLOB = \ + $(top_builddir)/src/*.c \ + $(top_srcdir)/src/*.c \ + $(top_srcdir)/src/*.cc \ + $(NULL) + +EXTRA_HFILES = + +IGNORE_HFILES = \ + buffer.h \ + caps.hh \ + cell.hh \ + config.h \ + debug.h \ + keymap.h \ + marshal.h \ + modes.hh \ + modes-ecma.hh \ + modes-private.hh \ + parser.hh \ + parser-arg.hh \ + parser-c01.hh \ + parser-charset.hh \ + parser-charset-tables.hh \ + parser-cmd.hh \ + parser-csi.hh \ + parser-dcs.hh \ + parser-esc.hh \ + parser-glue.hh \ + parser-osc.hh \ + parser-reply.hh \ + parser-string.hh \ + ring.hh \ + tabstops.hh \ + vteconv.h \ + vtedraw.h \ + vteinternal.hh \ + vterowdata.hh \ + vtestream-base.h \ + vtestream-file.h \ + vtestream.h \ + vtetypebuiltins.h \ + vteunistr.h \ + $(NULL) + +HTML_IMAGES = + +content_files = + +expand_content_files = + +GTKDOC_CFLAGS = \ + -DVTE_COMPILATION \ + $(shell pkg-config --cflags --libs glib-2.0 gobject-2.0) \ + $(NULL) + +VTE_LIB_PATH = $(shell dirname $(VTE_LIB)) + +ifeq ($(VTE_GTK),3) +VTE_LIB_NAME = vte-$(VTE_API_VERSION) +endif +ifeq ($(VTE_GTK),4) +VTE_LIB_NAME = vte-$(VTE_API_VERSION)-gtk4 +endif + +GTKDOC_LIBS = \ + -L$(VTE_LIB_PATH) -l$(VTE_LIB_NAME) \ + $(shell pkg-config --libs --libs glib-2.0 gobject-2.0) \ + $(NULL) + +# Rules for building gtk3/4 versions of the gtk-doc inputs + +AM_V_at = $(AM_V_at_$(V)) +AM_V_at_0 = @ +AM_V_at_1 = + +AM_V_GEN = $(AM_V_GEN_$(V)) +AM_V_GEN_0 = @echo " GEN " $@; +AM_V_GEN_1 = + +vte-gtk$(VTE_GTK)-sections.txt: $(srcdir)/../vte-sections.txt.in + $(AM_V_GEN)$(CPP) -E $(CPPFLAGS) -DVTE_GTK=$(VTE_GTK) $< | $(GREP) $(GREPFLAGS) -Ev '^\s*#|^$$' > $@ + +vte-gtk$(VTE_GTK)-overrides.txt: $(srcdir)/../vte-overrides.txt.in + $(AM_V_GEN)$(CPP) -E $(CPPFLAGS) -DVTE_GTK=$(VTE_GTK) $< | $(GREP) $(GREPFLAGS) -Ev '^\s*#|^$$' > $@ || true + +vte-gtk$(VTE_GTK).types: $(srcdir)/../vte.types.in + $(AM_V_GEN)$(CPP) -E -fpreprocessed $(CPPFLAGS) -DVTE_GTK=$(VTE_GTK) $< | $(GREP) $(GREPFLAGS) -Ev '^\s*#|^$$' > $@ + +$(DOC_MAIN_SGML_FILE): $(srcdir)/../vte-docs.xml + $(AM_V_GEN)cp -f $< $@ + +# The following is copied from gtk-doc, and adapted to work with +# plain make instead of requiring automake. +# +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#################################### +# Everything below here is generic # +#################################### + +CC ?= cc +CFLAGS ?= + +INSTALL = install -c +INSTALL_DATA = $(INSTALL) -m 644 + +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(CPPFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(CFLAGS) $(LDFLAGS) +GTKDOC_RUN = + +GTKDOC_CHECK_PATH = gtkdoc-check +GTKDOC_REBASE = gtkdoc-rebase + +MKDIR_P ?= mkdir -p + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +HTML_DIR = $(datadir)/gtk-doc/html + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +SETUP_FILES_GENERATED = \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE).types \ + $(DOC_MAIN_SGML_FILE) + +EXTRA_DIST = \ + $(HTML_IMAGES) \ + $(SETUP_FILES) + +DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).actions \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +gtkdoc-check.test: + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test + +HTML_BUILD_STAMP=html-build.stamp +#PDF_BUILD_STAMP=pdf-build.stamp +PDF_BUILD_STAMP= + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +all-local: all-gtk-doc + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### setup #### + +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) +GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; +GTK_DOC_V_SETUP_1= + +setup-build.stamp: $(SETUP_FILES_GENERATED) + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || $(MKDIR_P) "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +#### scan #### + +GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) +GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; +GTK_DOC_V_SCAN_1= + +GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) +GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; +GTK_DOC_V_INTROSPECT_1= + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" LD_LIBRARY_PATH="$(VTE_LIB_PATH)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp + @true + +#### xml #### + +GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) +GTK_DOC_V_XML_0=@echo " DOC Building XML"; +GTK_DOC_V_XML_1= + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(DOC_MAIN_SGML_FILE) + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +xml/gtkdocentities.ent: + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + + +#### html #### + +GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) +GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; +GTK_DOC_V_HTML_1= + +GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) +GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; +GTK_DOC_V_XREF_1= + +GTKDOC_MKHTML = gtkdoc-mkhtml + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + $(GTKDOC_MKHTML) 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + $(GTKDOC_MKHTML) 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && $(GTKDOC_MKHTML) $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + test -f $$file && cp $$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +#### pdf #### + +GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) +GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; +GTK_DOC_V_PDF_1= + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(MKDIR_P) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +dist-check-gtkdoc: docs + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @$(MKDIR_P) $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +meson.stamp: docs + @touch meson.stamp diff --git a/doc/reference/gtk3/meson.build b/doc/reference/gtk3/meson.build new file mode 100644 index 00000000..f03b2580 --- /dev/null +++ b/doc/reference/gtk3/meson.build @@ -0,0 +1,55 @@ +# Copyright © 2020, 2021 Christian Persch +# +# This library is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see . + +make_args_gtk3 = [ + '-f', meson.current_source_dir() / '..' / 'Makefile.docs', + '--directory', meson.current_build_dir(), + 'srcdir=' + meson.current_source_dir(), + 'builddir=' + meson.current_build_dir(), + 'abs_top_srcdir=' + meson.source_root(), + 'abs_top_builddir=' + meson.build_root(), + 'datadir=' + vte_prefix / vte_datadir, + 'CAIRO_PREFIX=' + cairo_dep.get_pkgconfig_variable('prefix'), + 'GLIB_PREFIX=' + glib_dep.get_pkgconfig_variable('prefix'), + 'GTK_PREFIX=' + gtk3_dep.get_pkgconfig_variable('prefix'), + 'PANGO_PREFIX=' + pango_dep.get_pkgconfig_variable('prefix'), + 'CC=' + ' '.join(cc.cmd_array()), + 'VERSION=' + meson.project_version(), + 'VTE_API_VERSION=' + vte_api_version, + 'VTE_GTK=3', + 'VTE_LIB=' + libvte_gtk3.full_path(), +] + +stamp = custom_target( + 'meson.stamp', + build_by_default: true, + capture: false, + command: [make] + make_args_gtk3 + [ + 'meson.stamp', + ], + depends: [ + libvte_gtk3, + ], + install: false, + output: 'meson.stamp', +) + +meson.add_install_script( + make, + make_args_gtk3, + 'install-data-local', +) + +# Unfortunately, there's no way to hook up the 'clean-local' target diff --git a/doc/reference/gtk4/meson.build b/doc/reference/gtk4/meson.build new file mode 100644 index 00000000..7f42e86f --- /dev/null +++ b/doc/reference/gtk4/meson.build @@ -0,0 +1,55 @@ +# Copyright © 2020, 2021 Christian Persch +# +# This library is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see . + +make_args_gtk4 = [ + '-f', meson.current_source_dir() / '..' / 'Makefile.docs', + '--directory', meson.current_build_dir(), + 'srcdir=' + meson.current_source_dir(), + 'builddir=' + meson.current_build_dir(), + 'abs_top_srcdir=' + meson.source_root(), + 'abs_top_builddir=' + meson.build_root(), + 'datadir=' + vte_prefix / vte_datadir, + 'CAIRO_PREFIX=' + cairo_dep.get_pkgconfig_variable('prefix'), + 'GLIB_PREFIX=' + glib_dep.get_pkgconfig_variable('prefix'), + 'GTK_PREFIX=' + gtk4_dep.get_pkgconfig_variable('prefix'), + 'PANGO_PREFIX=' + pango_dep.get_pkgconfig_variable('prefix'), + 'CC=' + ' '.join(cc.cmd_array()), + 'VERSION=' + meson.project_version(), + 'VTE_API_VERSION=' + vte_api_version, + 'VTE_GTK=4', + 'VTE_LIB=' + libvte_gtk4.full_path(), +] + +stamp = custom_target( + 'meson.stamp', + build_by_default: true, + capture: false, + command: [make] + make_args_gtk4 + [ + 'meson.stamp', + ], + depends: [ + libvte_gtk4, + ], + install: false, + output: 'meson.stamp', +) + +meson.add_install_script( + make, + make_args_gtk4, + 'install-data-local', +) + +# Unfortunately, there's no way to hook up the 'clean-local' target diff --git a/doc/reference/meson.build b/doc/reference/meson.build index b47bc7ed..793bed5d 100644 --- a/doc/reference/meson.build +++ b/doc/reference/meson.build @@ -1,4 +1,4 @@ -# Copyright © 2018, 2019 Iñigo Martínez +# Copyright © 2021 Christian Persch # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published @@ -13,96 +13,18 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -# Meson insufficiency! Would be so much easier to just make this -# (vte_gtk3_sources - vte_gtk3_public_headers).filter('.h'), but -# but there is no array subtraction or filtering. Or just allow listing the -# headers that we DO want to get scanned. -# So instead just list all the headers here again... :-( +# It turned out to be impossible to build gtk3 and gtk4 versions of the +# docs from the same source using meson's gnome.gtkdoc(). Instead, build +# using make with a gtk-doc.make-derived Makefile. -private_headers = [ - 'buffer.h', - 'caps.hh', - 'cell.hh', - 'config.h', - 'debug.h', - 'keymap.h', - 'marshal.h', - 'modes.hh', - 'modes-ecma.hh', - 'modes-private.hh', - 'parser.hh', - 'parser-arg.hh', - 'parser-c01.hh', - 'parser-charset.hh', - 'parser-charset-tables.hh', - 'parser-cmd.hh', - 'parser-csi.hh', - 'parser-dcs.hh', - 'parser-esc.hh', - 'parser-glue.hh', - 'parser-osc.hh', - 'parser-reply.hh', - 'parser-string.hh', - 'ring.hh', - 'tabstops.hh', - 'vteconv.h', - 'vtedraw.h', - 'vteinternal.hh', - 'vterowdata.hh', - 'vtestream-base.h', - 'vtestream-file.h', - 'vtestream.h', - 'vtetypebuiltins.h', - 'vteunistr.h', -] +make = find_program('gmake', 'make') -scan_args = [ - '--deprecated-guards="VTE_DISABLE_DEPRECATED"', - '--ignore-decorators=_VTE_GNUC_NONNULL\s*\([^)]*\)|_VTE_CXX_NOEXCEPT', -] - -glib_prefix = glib_dep.get_pkgconfig_variable('prefix') - -version_conf = configuration_data() -version_conf.set('VERSION', vte_version) - -content_files = configure_file( - input: 'version.xml.in', - output: '@BASENAME@', - configuration: version_conf -) +cairo_dep = dependency('cairo') if get_option('gtk3') - gtk3_prefix = gtk3_dep.get_pkgconfig_variable('prefix') - - fixxref_args = [ - '--html-dir=' + (vte_prefix / gnome.gtkdoc_html_dir(vte_gtk3_api_name)), - '--extra-dir=' + (glib_prefix / gnome.gtkdoc_html_dir('glib')), - '--extra-dir=' + (glib_prefix / gnome.gtkdoc_html_dir('gio')), - '--extra-dir=' + (gtk3_prefix / gnome.gtkdoc_html_dir('gdk')), - '--extra-dir=' + (gtk3_prefix / gnome.gtkdoc_html_dir('gdk-pixbuf')), - '--extra-dir=' + (gtk3_prefix / gnome.gtkdoc_html_dir('gtk')), - ] - - gnome.gtkdoc( - 'vte', - main_xml: 'vte-docs.xml', - module_version: vte_api_version, - src_dir: [src_inc, vte_inc], - ignore_headers: private_headers, - include_directories: top_inc, - dependencies: libvte_gtk3_dep, - c_args: '-DVTE_COMPILATION', - namespace: 'vte', - scan_args: scan_args, - mkdb_args: '--source-suffixes=h,hh,c,cc', - fixxref_args: fixxref_args, - gobject_typesfile: 'vte.types', - content_files: content_files, - install: true, - ) + subdir('gtk3') endif if get_option('gtk4') - assert(false, 'not yet supported') + subdir('gtk4') endif diff --git a/doc/reference/version.xml.in b/doc/reference/version.xml.in deleted file mode 100644 index d78bda93..00000000 --- a/doc/reference/version.xml.in +++ /dev/null @@ -1 +0,0 @@ -@VERSION@ diff --git a/doc/reference/vte-docs.xml b/doc/reference/vte-docs.xml index e3cd5180..0479d58c 100644 --- a/doc/reference/vte-docs.xml +++ b/doc/reference/vte-docs.xml @@ -1,7 +1,9 @@ + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" +[ + + %gtkdocentities; ]>