mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
bundle patches into python-build repository
This commit is contained in:
parent
e9db2caace
commit
fe50ed29ea
11 changed files with 137 additions and 16 deletions
47
plugins/python-build/patches/all/common/patch-setup.py.diff
Normal file
47
plugins/python-build/patches/all/common/patch-setup.py.diff
Normal file
|
@ -0,0 +1,47 @@
|
|||
|
||||
# HG changeset patch
|
||||
# User Barry Warsaw <barry@python.org>
|
||||
# Date 1302190091 14400
|
||||
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||
multiarch Debian/Ubuntu.
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
--- setup.py.orig
|
||||
+++ setup.py
|
||||
@@ -345,10 +345,33 @@ class PyBuildExt(build_ext):
|
||||
return platform
|
||||
return sys.platform
|
||||
|
||||
+ def add_multiarch_paths(self):
|
||||
+ # Debian/Ubuntu multiarch support.
|
||||
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||
+ if not find_executable('dpkg-architecture'):
|
||||
+ return
|
||||
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||
+ if not os.path.exists(self.build_temp):
|
||||
+ os.makedirs(self.build_temp)
|
||||
+ ret = os.system(
|
||||
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||
+ tmpfile)
|
||||
+ try:
|
||||
+ if ret >> 8 == 0:
|
||||
+ with open(tmpfile) as fp:
|
||||
+ multiarch_path_component = fp.readline().strip()
|
||||
+ add_dir_to_list(self.compiler.library_dirs,
|
||||
+ '/usr/lib/' + multiarch_path_component)
|
||||
+ add_dir_to_list(self.compiler.include_dirs,
|
||||
+ '/usr/include/' + multiarch_path_component)
|
||||
+ finally:
|
||||
+ os.unlink(tmpfile)
|
||||
+
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used
|
||||
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
+ self.add_multiarch_paths()
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
--- setup.py.orig 2011-07-07 19:41:48.610196111 +0900
|
||||
+++ setup.py 2011-07-07 19:46:44.986310031 +0900
|
||||
@@ -14,6 +14,7 @@
|
||||
from distutils.command.build_ext import build_ext
|
||||
from distutils.command.install import install
|
||||
from distutils.command.install_lib import install_lib
|
||||
+from distutils.spawn import find_executable
|
||||
|
||||
# This global variable is used to hold the list of modules to be disabled.
|
||||
disabled_module_list = []
|
||||
@@ -308,10 +309,33 @@
|
||||
return platform
|
||||
return sys.platform
|
||||
|
||||
+ def add_multiarch_paths(self):
|
||||
+ # Debian/Ubuntu multiarch support.
|
||||
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||
+ if not find_executable('dpkg-architecture'):
|
||||
+ return
|
||||
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||
+ if not os.path.exists(self.build_temp):
|
||||
+ os.makedirs(self.build_temp)
|
||||
+ ret = os.system(
|
||||
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||
+ tmpfile)
|
||||
+ try:
|
||||
+ if ret >> 8 == 0:
|
||||
+ with open(tmpfile) as fp:
|
||||
+ multiarch_path_component = fp.readline().strip()
|
||||
+ add_dir_to_list(self.compiler.library_dirs,
|
||||
+ '/usr/lib/' + multiarch_path_component)
|
||||
+ add_dir_to_list(self.compiler.include_dirs,
|
||||
+ '/usr/include/' + multiarch_path_component)
|
||||
+ finally:
|
||||
+ os.unlink(tmpfile)
|
||||
+
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used
|
||||
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
+ self.add_multiarch_paths()
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
|
@ -0,0 +1,38 @@
|
|||
--- setup.py.orig 2011-07-07 20:26:15.000000000 +0900
|
||||
+++ setup.py 2011-07-07 20:29:28.735543350 +0900
|
||||
@@ -370,12 +370,35 @@
|
||||
return platform
|
||||
return sys.platform
|
||||
|
||||
+ def add_multiarch_paths(self):
|
||||
+ # Debian/Ubuntu multiarch support.
|
||||
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||
+ if not find_executable('dpkg-architecture'):
|
||||
+ return
|
||||
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||
+ if not os.path.exists(self.build_temp):
|
||||
+ os.makedirs(self.build_temp)
|
||||
+ ret = os.system(
|
||||
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||
+ tmpfile)
|
||||
+ try:
|
||||
+ if ret >> 8 == 0:
|
||||
+ with open(tmpfile) as fp:
|
||||
+ multiarch_path_component = fp.readline().strip()
|
||||
+ add_dir_to_list(self.compiler.library_dirs,
|
||||
+ '/usr/lib/' + multiarch_path_component)
|
||||
+ add_dir_to_list(self.compiler.include_dirs,
|
||||
+ '/usr/include/' + multiarch_path_component)
|
||||
+ finally:
|
||||
+ os.unlink(tmpfile)
|
||||
+
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used, but the local build
|
||||
# directories (i.e. '.' and 'Include') must be first. See issue
|
||||
# 10520.
|
||||
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
+ self.add_multiarch_paths()
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/python30/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/python30/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/common/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ before_install_package() {
|
|||
local package_name="$1"
|
||||
case "$package_name" in
|
||||
Python*)
|
||||
http get "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/python32/patch-setup.py.diff" setup.patch
|
||||
patch -p0 < setup.patch
|
||||
patch -p0 < "${PYTHON_BUILD_ROOT}/patches/all/python32/patch-setup.py.diff"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue