Package: nghttp2
Version: 1.64.0-1
Followup-For: Bug #1095360
X-Debbugs-Cc: sl...@ubuntu.com
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu plucky ubuntu-patch
Control: tags -1 patch ftbfs

Dear Maintainer,

This package fails to build from source in Debian and Ubuntu:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095360
https://bugs.launchpad.net/ubuntu/+source/nghttp2/+bug/2104171

Adding a Build-Depends-Indep on python3-pkg-resources fixes the build, but is 
deprecated.

According to setuptools:

def declare_namespace(packageName: str) -> None:
    """Declare that package 'packageName' is a namespace package"""

    msg = (
        f"Deprecated call to 
`pkg_resources.declare_namespace({packageName!r})`.\n"
        "Implementing implicit namespace packages (as specified in PEP 420) "
        "is preferred to `pkg_resources.declare_namespace`. "
        "See https://setuptools.pypa.io/en/latest/references/";
        "keywords.html#keyword-namespace-packages"
    )
    warnings.warn(msg, DeprecationWarning, stacklevel=2)


Here it looks like the explicit namespacing was only needed when extending the 
sphinxcontrib module, but it was renamed to be an independent module 
"rubydomain.rubydomain": a029f6e

So doc/_extrs/rubydomain/__init__.py should just be dropped to make it an 
implicit namespaced package in accordance with 
https://peps.python.org/pep-0420/.

I opened a case with upstream: https://github.com/nghttp2/nghttp2/pull/2318

In Ubuntu, the attached patch was applied to achieve the following:

  * Fix FTBFS due to rubydomain namespace. (LP: #2104171)
    - d/p/lp-2104171-avoid-rubydomain-namespace.patch


Thanks for considering the patch.

Cheers,
  Lukas


-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), 
(100, 'noble-proposed'), (100, 'noble-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 6.8.0-55-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE:en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
nghttp2-1.64.0/debian/patches/lp-2104171-avoid-rubydomain-namespace.patch 
nghttp2-1.64.0/debian/patches/lp-2104171-avoid-rubydomain-namespace.patch
--- nghttp2-1.64.0/debian/patches/lp-2104171-avoid-rubydomain-namespace.patch   
1970-01-01 01:00:00.000000000 +0100
+++ nghttp2-1.64.0/debian/patches/lp-2104171-avoid-rubydomain-namespace.patch   
2025-03-27 12:46:17.000000000 +0100
@@ -0,0 +1,28 @@
+Description: Fix FTBFS due to rubydomain namespace
+ Fixes FTBFS due to: "Could not import extension rubydomain.rubydomain"
+ (exception: No module named 'pkg_resources')
+
+Author: Lukas Märdian <sl...@ubuntu.com>
+Bug-Ubuntu: https://launchpad.net/bugs/2104171
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095360
+Origin: vendor, Ubuntu
+Forwarded: https://github.com/nghttp2/nghttp2/pull/2318
+Last-Update: 2025-03-27
+
+--- nghttp2-1.64.0.orig/doc/_exts/rubydomain/__init__.py
++++ nghttp2-1.64.0/doc/_exts/rubydomain/__init__.py
+@@ -1,14 +0,0 @@
+-# -*- coding: utf-8 -*-
+-"""
+-    sphinxcontrib
+-    ~~~~~~~~~~~~~
+-
+-    This package is a namespace package that contains all extensions
+-    distributed in the ``sphinx-contrib`` distribution.
+-
+-    :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
+-    :license: BSD, see LICENSE for details.
+-"""
+-
+-__import__('pkg_resources').declare_namespace(__name__)
+-
diff -Nru nghttp2-1.64.0/debian/patches/series 
nghttp2-1.64.0/debian/patches/series
--- nghttp2-1.64.0/debian/patches/series        2024-06-08 09:19:51.000000000 
+0200
+++ nghttp2-1.64.0/debian/patches/series        2025-03-27 12:46:17.000000000 
+0100
@@ -1,2 +1,3 @@
 0002-Workaround-for-963648.patch
 0002-add-munit-explicitly.patch
+lp-2104171-avoid-rubydomain-namespace.patch

Reply via email to