[neon/backports-noble/fwupd-noble/Neon/unstable] debian: another attemp to override distutils

Carlos De Maine null at kde.org
Wed Sep 16 01:51:35 BST 2026


Git commit 01197e1f9ff2dff8a74f59866cb79446b0a0b931 by Carlos De Maine.
Committed on 16/09/2026 at 00:51.
Pushed by carlosdem into branch 'Neon/unstable'.

another attemp to override distutils

M  +5    -4    debian/rules

https://invent.kde.org/neon/backports-noble/fwupd-noble/-/commit/01197e1f9ff2dff8a74f59866cb79446b0a0b931

diff --git a/debian/rules b/debian/rules
index 41a5f2f..6c6212b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,10 +49,11 @@ override_dh_auto_clean:
 	rm -fr debian/build
 
 override_dh_auto_configure:
-	mkdir -p /usr/lib/python3/dist-packages/distutils
-	touch /usr/lib/python3/dist-packages/distutils/__init__.py
-	echo "class MSVCCompiler: pass" > /usr/lib/python3/dist-packages/distutils/msvccompiler.py
-	cat /usr/lib/python3/dist-packages/distutils/__init__.py
+	@SETUPTOOLS_DISTUTILS=$$(python3 -c "import os, setuptools; print(os.path.join(os.path.dirname(setuptools.__file__), '_distutils'))" 2>/dev/null); \
+	if [ -d "$$SETUPTOOLS_DISTUTILS" ]; then \
+		echo "Injecting shim into setuptools vendored path: $$SETUPTOOLS_DISTUTILS"; \
+		echo "class MSVCCompiler: pass" > "$$SETUPTOOLS_DISTUTILS/msvccompiler.py"; \
+	fi
 
 	@echo "PYTHONPATH is: $(PYTHONPATH)"
 	dh_auto_configure -- $(CONFARGS)


More information about the Neon-commits mailing list