control: retitle -1 Provide doc package on how to use python bindings
control: tags -1 patch

On Sat, 23 Jan 2021 18:40:05 +0000 Stephan Lachnit
<[email protected]> wrote:
> Just reading through this issues, and this seems to be fixed a while ago.
> 
> 1. The documentation for PyGObject is available now [1].

Ideally this should be build as a -doc package,
for which I've created a WIP MR on salsa [2].

I've also attached it as a patch, but I want to point out again, 
that this is not quite working, so any help would be appreciated.

> 2. Gtk bindings are now in a separate package, e.g. gir1.2-gtk-3.0
> 
> I think this can be closed by now.

I think this should only be closed once the (proposed) -doc package hits the
archive.

> [1] https://lazka.github.io/pgi-docs/
[2] https://salsa.debian.org/gnome-team/pygobject/-/merge_requests/7

-- 
Cheers,

Evangelos
PGP: B938 6554 B7DD 266B CB8E 29A9 90F0 C9B1 8A6B 4A19
From 97a672f0e2511df76f728e2bad398aeb06219697 Mon Sep 17 00:00:00 2001
From: Evangelos Ribeiro Tzaras <[email protected]>
Date: Sun, 4 Sep 2022 11:08:06 +0200
Subject: [PATCH] Install docs in new python-gi-doc package

Closes: #688228
---
 debian/control               | 19 +++++++++++++++++++
 debian/control.in            | 19 +++++++++++++++++++
 debian/python-gi-doc.install |  1 +
 debian/rules                 | 10 ++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 debian/python-gi-doc.install

diff --git a/debian/control b/debian/control
index 7201034e..c9b5c4e3 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: at-spi2-core <!nocheck>,
                debhelper-compat (= 13),
                dh-sequence-gnome,
                dh-sequence-python3,
+               dia <!nodoc>,
                dpkg-dev (>= 1.16.1~),
                gir1.2-gtk-3.0 <!nocheck>,
                libcairo2-dev,
@@ -25,6 +26,8 @@ Build-Depends: at-spi2-core <!nocheck>,
                python3-flake8 <!nocheck>,
                python3-pytest <!nocheck>,
                python3-setuptools,
+               python3-sphinx <!nodoc>,
+               python3-sphinx-rtd-theme <!nodoc>,
                xauth <!nocheck>,
                xvfb <!nocheck>
 Rules-Requires-Root: no
@@ -40,6 +43,7 @@ Depends: gir1.2-glib-2.0 (>= 1.48.0),
          ${misc:Depends},
          ${python3:Depends},
          ${shlibs:Depends}
+Suggests: python-gi-doc
 Description: Python 3 bindings for gobject-introspection libraries
  GObject is an abstraction layer that allows programming with an object
  paradigm that is compatible with many languages. It is a part of Glib,
@@ -96,3 +100,18 @@ Description: Python 3 Cairo bindings for the GObject library
  .
  This package contains the Python 3 Cairo bindings for GObject. It is mostly
  used by other bindings to map their GObjects to Python objects.
+
+Package: python-gi-doc
+Architecture: all
+Section: doc
+Build-Profiles: <!nodoc>
+Depends:
+ ${misc:Depends},
+ ${sphinxdoc:Depends},
+Description: Documentation for python3 bindinfs for gobject-introspection libraries
+ GObject is an abstraction layer that allows programming with an object
+ paradigm that is compatible with many languages. It is a part of Glib,
+ the core library used to build GTK+ and GNOME.
+ .
+ This package contains the documentation for how to use the
+ python3 bindings.
diff --git a/debian/control.in b/debian/control.in
index 5ea09bc9..688d4867 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -8,6 +8,7 @@ Build-Depends: at-spi2-core <!nocheck>,
                debhelper-compat (= 13),
                dh-sequence-gnome,
                dh-sequence-python3,
+               dia <!nodoc>,
                dpkg-dev (>= 1.16.1~),
                gir1.2-gtk-3.0 <!nocheck>,
                libcairo2-dev,
@@ -21,6 +22,8 @@ Build-Depends: at-spi2-core <!nocheck>,
                python3-flake8 <!nocheck>,
                python3-pytest <!nocheck>,
                python3-setuptools,
+               python3-sphinx <!nodoc>,
+               python3-sphinx-rtd-theme <!nodoc>,
                xauth <!nocheck>,
                xvfb <!nocheck>
 Rules-Requires-Root: no
@@ -36,6 +39,7 @@ Depends: gir1.2-glib-2.0 (>= 1.48.0),
          ${misc:Depends},
          ${python3:Depends},
          ${shlibs:Depends}
+Suggests: python-gi-doc
 Description: Python 3 bindings for gobject-introspection libraries
  GObject is an abstraction layer that allows programming with an object
  paradigm that is compatible with many languages. It is a part of Glib,
@@ -92,3 +96,18 @@ Description: Python 3 Cairo bindings for the GObject library
  .
  This package contains the Python 3 Cairo bindings for GObject. It is mostly
  used by other bindings to map their GObjects to Python objects.
+
+Package: python-gi-doc
+Architecture: all
+Section: doc
+Build-Profiles: <!nodoc>
+Depends:
+ ${misc:Depends},
+ ${sphinxdoc:Depends},
+Description: Documentation for python3 bindinfs for gobject-introspection libraries
+ GObject is an abstraction layer that allows programming with an object
+ paradigm that is compatible with many languages. It is a part of Glib,
+ the core library used to build GTK+ and GNOME.
+ .
+ This package contains the documentation for how to use the
+ python3 bindings.
diff --git a/debian/python-gi-doc.install b/debian/python-gi-doc.install
new file mode 100644
index 00000000..d9d4f6f8
--- /dev/null
+++ b/debian/python-gi-doc.install
@@ -0,0 +1 @@
+usr/share/doc/*
diff --git a/debian/rules b/debian/rules
index c2a3ef0a..3c710c2d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,6 +41,12 @@ ifeq ($(DEB_HOST_ARCH_OS), linux)
 endif
 endif
 
+override_dh_auto_build:
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+	make -C docs
+endif
+	dh_auto_build
+
 override_dh_python3:
 	dh_python3 -O--buildsystem=pybuild
 	find debian/python3-gi-cairo  debian/python3-gi -name '*.cpython-*dm-*so' | xargs -r rm -fv
@@ -57,6 +63,10 @@ override_dh_install:
 	rm -f debian/tmp/usr/lib/python*/dist-packages/*.pyc
 	rm -f debian/tmp/usr/lib/python*/dist-packages/*/*.pyc
 	rm -f debian/tmp/usr/lib/python*/dist-packages/*/*/*.pyc
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+	mkdir -p debian/tmp/usr/share/doc/python3-gi-doc/html
+	cp -r docs/_build debian/tmp/usr/share/doc/python3-gi-doc/html
+endif
 	dh_install
 
 override_dh_strip-arch:
-- 
2.37.2

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to