python: Fix creating RPMs from Python packages

This should enable (manual) building of RPMs from python projects using
the `python setup.py bdist_rpm` command on systems where `rpmbuild` is
not located in `/usr/bin/`. (e.g. NixOS)
The discovery of the rpmbuild command was fixed upstream in Python 3.8,
so this commit backports the relevant patch to our currently supported
Python 3 versions.

Fixes: #85204
This commit is contained in:
Josef Kemetmüller
2020-04-14 13:50:11 +02:00
committed by Frederik Rietdijk
parent 603ce3e259
commit 3818cd9049
2 changed files with 34 additions and 0 deletions

View File

@@ -103,6 +103,10 @@ in with passthru; stdenv.mkDerivation {
] ++ optionals isPy35 [
# Backports support for LD_LIBRARY_PATH from 3.6
./3.5/ld_library_path.patch
] ++ optionals (isPy35 || isPy36 || isPy37) [
# Backport a fix for discovering `rpmbuild` command when doing `python setup.py bdist_rpm` to 3.5, 3.6, 3.7.
# See: https://bugs.python.org/issue11122
./3.7/fix-hardcoded-path-checking-for-rpmbuild.patch
] ++ optionals (isPy37 || isPy38) [
# Fix darwin build https://bugs.python.org/issue34027
./3.7/darwin-libutil.patch