Upgraded python2 to 2.7.18

This commit is contained in:
Derrick
2020-10-23 14:19:24 -05:00
parent 5b445207b2
commit ae0aa3daff
5 changed files with 72 additions and 79 deletions

View File

@ -1,22 +0,0 @@
#! /bin/bash
# Python 2.7.16
# Source: https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tar.xz
patch -Np0 -i ../patches/Python-2.7.16-void-fix-i686-rlock.patch &&
patch -Np0 -i ../patches/Python-2.7.16-void-musl-find_library.patch &&
rm -vr Modules/expat
rm -vr Modules/_ctypes/libffi*
rm -vr Modules/zlib
sed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--with-ensurepip=yes \
--enable-unicode=ucs4 \
--enable-ipv6 --with-threads --with-computed-gotos --with-wctype-functions $BUILDTRUPLE &&
read -p "Compile?" && make -j2
read -p "Install?" && sudo -S porg -lD "make -j1 install" && \
sudo -S chmod -v 755 /usr/lib/libpython2.7.so.1.0

View File

@ -0,0 +1,58 @@
#! /bin/bash
# Python 2
# Source: https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: Bluez, Valgrind, SQLite, Tk
patch -Np1 -i ../patches/python2-alpine/musl-find_library.patch
patch -Np1 -i ../patches/python2-alpine/unchecked-ioctl.patch
rm -r Modules/expat Modules/_ctypes/libffi* Modules/zlib &&
export OPT="$CFLAGS -DTHREAD_STACK_SIZE=0x100000" &&
./configure \
--prefix=/usr \
--enable-ipv6 \
--enable-optimizations \
--enable-shared \
--enable-unicode=ucs4 \
--with-system-expat \
--with-system-ffi \
--with-system-zlib \
--with-threads $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
unset OPT &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
python2: python 2 (object-oriented interpreted programming language)
python2:
python2: Python is an interpreted, interactive, object-oriented programming
python2: language that combines remarkable power with very clear syntax.
python2: Python's basic power can be extended with your own modules written in
python2: C or C++. Python is also adaptable as an extension language for
python2: existing applications.
python2:
python2:
python2:
python2:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/python2-2.7.18-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*

View File

@ -1,55 +0,0 @@
It seems that avoiding to create local aliases for the self._rlock and
self._wlock methods prevents the strange errors on i686 related to
semaphore locking and unlocking.
One example of failing builds is firefox-esr running gyp in an i686 environment.
--- Lib/multiprocessing/queues.py 2017-09-16 19:38:35.000000000 +0200
+++ Lib/multiprocessing/queues.py 2017-10-24 19:49:06.291351206 +0200
@@ -369,13 +369,11 @@
def _make_methods(self):
- recv = self._reader.recv
- racquire, rrelease = self._rlock.acquire, self._rlock.release
def get():
- racquire()
- try:
- return recv()
- finally:
- rrelease()
+ self._rlock.acquire()
+ try:
+ return self._reader.recv()
+ finally:
+ self._rlock.release()
self.get = get
if self._wlock is None:
@@ -383,11 +382,9 @@
self.put = self._writer.send
else:
- send = self._writer.send
- wacquire, wrelease = self._wlock.acquire, self._wlock.release
def put(obj):
- wacquire()
- try:
- return send(obj)
- finally:
- wrelease()
+ self._wlock.acquire()
+ try:
+ return self._writer.send(obj)
+ finally:
+ self._wlock.release()
self.put = put
--- Modules/_multiprocessing/semaphore.c 2017-09-16 19:38:35.000000000 +0200
+++ Modules/_multiprocessing/semaphore.c 2017-10-28 10:49:56.944993401 +0200
@@ -378,7 +378,7 @@
}
}
#else
- int sval;
+ int sval = -1;
/* This check is not an absolute guarantee that the semaphore
does not rise above maxvalue. */

View File

@ -1,5 +1,6 @@
--- Lib/ctypes/util.py.orig
+++ Lib/ctypes/util.py
diff -ru Python-2.7.12.orig/Lib/ctypes/util.py Python-2.7.12/Lib/ctypes/util.py
--- Python-2.7.12.orig/Lib/ctypes/util.py 2016-06-26 00:49:30.000000000 +0300
+++ Python-2.7.12/Lib/ctypes/util.py 2016-11-03 16:05:46.954665040 +0200
@@ -204,6 +204,41 @@
def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

View File

@ -0,0 +1,11 @@
--- ./Modules/fcntlmodule.c.orig
+++ ./Modules/fcntlmodule.c
@@ -118,7 +118,7 @@
int mutate_arg = 1;
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
- if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl",
+ if (PyArg_ParseTuple(args, "O&Iw#|n:ioctl",
conv_descriptor, &fd, &code,
&str, &len, &mutate_arg)) {
char *arg;