mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Fix build of ossaudiodev in Linux/FreeBSD for Python 3.1 (#2047)
With the normal `setup.py`, the installation of the `ossaudiodev` module is skipped under GNU/Linux with newer kernel versions because Python 3.1 appends the major kernel version to the result of `build_ext.get_platform` and later `ossaudiodev` is skipped if the major kernel version is not 2. A similar problem might occur if installing in FreeBSD. This problem may even occur if installing Python 3.1 in a Docker image of an old OS (e.g. prehistoric Debian or CentOS), because the major kernel version is still the one of the host system. The solution is to use `str.startswith` and only check that the platform starts with 'linux' or 'freebsd'.
This commit is contained in:
parent
2d64fb1cb9
commit
22e1aa6e9d
6 changed files with 64 additions and 1 deletions
|
@ -43,3 +43,13 @@ diff -r -u ../Python-3.1/setup.py ./setup.py
|
||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1203,8 +1203,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|
|
@ -43,3 +43,13 @@ diff -r -u ../Python-3.1/setup.py ./setup.py
|
||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1203,8 +1203,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|
|
@ -43,3 +43,13 @@ diff -r -u ../Python-3.1/setup.py ./setup.py
|
||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1207,8 +1207,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|
|
@ -44,4 +44,13 @@ diff -r -u setup.py setup.py
|
||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1321,8 +1321,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- setup.py.orig 2012-04-10 01:25:37.000000000 +0200
|
||||||
|
+++ setup.py 2021-09-03 10:16:58.575042300 +0200
|
||||||
|
@@ -1344,8 +1344,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- setup.py.orig 2012-04-10 01:25:37.000000000 +0200
|
||||||
|
+++ setup.py 2021-09-03 10:16:58.575042300 +0200
|
||||||
|
@@ -1344,8 +1344,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
Loading…
Reference in a new issue