Source: nmap
Version: 7.94+git20230807.3be01efb1+dfsg-4
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: cross-satisfiability
X-Debbugs-Cc: st...@kali.org

Hi,

Steev noticed that nmap could not be cross built. While the initial
diagnosis was a zlib conflict, which is temporary in nature and caused
by the PAC/BTI rebuilds, there is a persistent issue with the python3
dependency. What is requested is the host architecture python3
interpreter and that fails to install if apt ever figures satisfying
depedencies.

Fortunately, we don't have to think much about what kind of Python
interpreter as the answer simply is "none". It is used to build ndiff
and zenmap both of which are Arch:all packages, so we can entirely
sidestep the problem by better separating the indep build from the
arch-only build.

I'm attaching a patch that performs this separation and thus moves
python3 and python3-gi to B-D-I. As a result, cross build depeneds
become satisfiable right now for e.g. amd64 -> ppc64el. It doesn't cross
build just yet, but one may now attempt building it. Please consider
applying the patch.

Helmut
diff --minimal -Nru nmap-7.94+git20230807.3be01efb1+dfsg/debian/changelog 
nmap-7.94+git20230807.3be01efb1+dfsg/debian/changelog
--- nmap-7.94+git20230807.3be01efb1+dfsg/debian/changelog       2024-06-04 
18:40:09.000000000 +0200
+++ nmap-7.94+git20230807.3be01efb1+dfsg/debian/changelog       2024-11-02 
22:41:42.000000000 +0100
@@ -1,3 +1,10 @@
+nmap (7.94+git20230807.3be01efb1+dfsg-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: Demote python dependencies to B-D-I. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 02 Nov 2024 22:41:42 +0100
+
 nmap (7.94+git20230807.3be01efb1+dfsg-4) unstable; urgency=medium
 
   [ Hilko Bengen ]
diff --minimal -Nru nmap-7.94+git20230807.3be01efb1+dfsg/debian/control 
nmap-7.94+git20230807.3be01efb1+dfsg/debian/control
--- nmap-7.94+git20230807.3be01efb1+dfsg/debian/control 2024-06-04 
18:40:09.000000000 +0200
+++ nmap-7.94+git20230807.3be01efb1+dfsg/debian/control 2024-11-02 
22:41:42.000000000 +0100
@@ -15,14 +15,15 @@
                libssh2-1-dev,
                libssl-dev,
                lua-lpeg-dev,
-               python3,
-               python3-gi, 
                gir1.2-gtk-3.0,
                gir1.2-pango-1.0,
                gir1.2-glib-2.0,
                gir1.2-gdkpixbuf-2.0,
 Build-Depends-Indep: default-jdk-headless,
-                     gcc-mingw-w64-i686
+                     dh-sequence-python3,
+                     gcc-mingw-w64-i686,
+                     python3,
+                     python3-gi,
 Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Homepage: https://nmap.org/
diff --minimal -Nru nmap-7.94+git20230807.3be01efb1+dfsg/debian/rules 
nmap-7.94+git20230807.3be01efb1+dfsg/debian/rules
--- nmap-7.94+git20230807.3be01efb1+dfsg/debian/rules   2024-06-04 
18:40:09.000000000 +0200
+++ nmap-7.94+git20230807.3be01efb1+dfsg/debian/rules   2024-11-02 
22:41:42.000000000 +0100
@@ -3,7 +3,7 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
-       dh $@ --with=python3
+       dh $@
 
 override_dh_auto_clean:
        dh_auto_clean
@@ -19,13 +19,14 @@
                --without-ndiff \
                --enable-ipv6 \
                STRIP=/bin/true
+
+execute_after_dh_auto_configure-indep:
        dh_auto_configure --sourcedir=ndiff --buildsystem=pybuild
        dh_auto_configure --sourcedir=zenmap --buildsystem=pybuild
 
 mingw_CFLAGS = $(filter-out -mbranch-protection=standard,$(CFLAGS))
 
-override_dh_auto_build-indep:
-       dh_auto_build
+execute_after_dh_auto_build-indep:
        dh_auto_build --sourcedir=ndiff --buildsystem=pybuild
        dh_auto_build --sourcedir=zenmap --buildsystem=pybuild
        cd nselib/data/jdwp-class && /usr/lib/jvm/default-java/bin/javac *.java
@@ -33,12 +34,15 @@
                i686-w64-mingw32-gcc ${CPPFLAGS} ${mingw_CFLAGS} -o 
nmap_service.exe nmap_service.c && \
                gzip -c -n9 nmap_service.exe | base64 | tac > nmap_service.ex_
 
-override_dh_auto_test:
+override_dh_auto_test-arch:
+
+override_dh_auto_test-indep:
        dh_auto_test --sourcedir=ndiff --buildsystem=pybuild
        dh_auto_test --sourcedir=zenmap --buildsystem=pybuild
 
-override_dh_auto_install:
-       dh_auto_install
+execute_after_dh_auto_install-arch:
+       mv debian/tmp/usr/share/man/pt_PT debian/tmp/usr/share/man/pt
+
+execute_after_dh_auto_install-indep:
        dh_auto_install --sourcedir=ndiff --buildsystem=pybuild
        dh_auto_install --sourcedir=zenmap --buildsystem=pybuild
-       mv debian/tmp/usr/share/man/pt_PT debian/tmp/usr/share/man/pt

Reply via email to