[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python dependency when building



On 2025-04-16, at 14:07:46 +0200, Hilmar Preusse wrote:
I hope this question is easy to answer, maybe I'm on the wrong list.

The lintian report for package asymptote-x11 says:

E: asymptote-x11: python3-script-but-no-python3-dep python3 (does not satisfy python3:any | python3-minimal:any) [usr/share/asymptote/GUI/xasy.py]
N:
<snip>
N:
N:   If you are using debhelper, adding ${python3:Depends} to the Depends field
N:   and ensuring dh_python3 is run during the build should take care of adding
N:   the correct dependency.
N:

The debian/control of the source package reads:

Package: asymptote-x11
Architecture: all
Depends: ${misc:Depends},
        ${python3:Depends},
        asymptote (>= ${binary:Version}),
        <snip>

and the d/rules uses the dh sequencer: dh $@ --with python3

Looking at the build log I see that dh_python3 is called, nevertheless
dpkg-gencontrol reports:

dpkg-gencontrol: warning: Depends field of package asymptote-x11: substitution
variable ${python3:Depends} used, but is not defined.

The python related BD's of the source package are dh-python & python3.
I replaced the "#!/usr/bin/env python3" shebang in the script by
"#!/usr/bin/python3", but this did not solve the issue.

What am I missing? Many thanks!

From the dh_python3 man-page:

    private dirs
       /usr/share/foo, /usr/share/games/foo, /usr/lib/foo and
       /usr/lib/games/foo private directories are scanned for Python
       files by default (where foo is bi‐ nary package name). If your
       package ships Python files in some other directory, add another
       dh_python3 call in debian/rules with directory name as an
       argument - you can use different set of options in this call. If
       you need to change options (f.e. a list of supported Python 3
       versions) for a private directory that is checked by default,
       invoke dh_python3 with --skip-private option and add another call
       with a path to this directory and new options.


I've attached a patch.

J.
diff --git a/debian/rules b/debian/rules
index 0ce2ee396331..4387ffd436d4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,8 @@
 # Avoid unneeded library dependencies reported by dpkg-shlibdeps.
 DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
 DEB_BUILD_MAINT_OPTIONS := hardening=+all
+
+include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/buildflags.mk
 include /usr/share/dpkg/pkg-info.mk
 
@@ -40,6 +42,10 @@ override_dh_auto_install:
 #override_dh_auto_test:
 #	: do nothing here, otherwise make tries to compile prc/test.cc
 
+override_dh_python3:
+	dh_python3 -Nasymptote-x11
+	dh_python3 -pasymptote-x11 /usr/share/asymptote/GUI
+
 override_dh_compress:
 	dh_compress -X.pdf
 

Attachment: signature.asc
Description: PGP signature


Reply to: