Skip to content

Commit 3f67925

Browse files
committed
python39: imported from AUR
1 parent 6c791c4 commit 3f67925

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

archlinuxcn/python39/PKGBUILD

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Maintainer: Tobias Kunze <r@rixx.de>
2+
# Maintained at https://github.com/rixx/pkgbuilds, feel free to submit patches
3+
4+
pkgname=python39
5+
pkgver=3.9.16
6+
pkgrel=2
7+
_pybasever=3.9
8+
_pymajver=3
9+
pkgdesc="Major release 3.9 of the Python high-level programming language"
10+
arch=('i686' 'x86_64')
11+
license=('custom')
12+
url="https://www.python.org/"
13+
depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'libxcrypt' 'openssl' 'zlib')
14+
makedepends=('bluez-libs' 'mpdecimal' 'gdb')
15+
optdepends=('sqlite' 'mpdecimal: for decimal' 'xz: for lzma' 'tk: for tkinter')
16+
source=(
17+
https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz
18+
mpdecimal-2.5.1.patch
19+
)
20+
sha256sums=(
21+
'22dddc099246dd2760665561e8adb7394ea0cc43a72684c6480f9380f7786439'
22+
'8eb389be1babe03a0231001dc16dd2d69a3ea0fbf6b8c976a580787e7ff1594c'
23+
)
24+
validpgpkeys=(
25+
'0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key) <nad@python.org>
26+
'E3FF2839C048B25C084DEBE9B26995E310250568' # Łukasz Langa (GPG langa.pl) <lukasz@langa.pl>
27+
)
28+
provides=("python=$pkgver")
29+
30+
prepare() {
31+
cd "${srcdir}/Python-${pkgver}"
32+
33+
patch -p1 -i "${srcdir}/mpdecimal-2.5.1.patch"
34+
35+
# FS#23997
36+
sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py
37+
38+
# Ensure that we are using the system copy of various libraries (expat, zlib and libffi),
39+
# rather than copies shipped in the tarball
40+
rm -rf Modules/expat
41+
rm -rf Modules/zlib
42+
rm -rf Modules/_ctypes/{darwin,libffi}*
43+
rm -rf Modules/_decimal/libmpdec
44+
}
45+
46+
build() {
47+
cd "${srcdir}/Python-${pkgver}"
48+
CFLAGS="${CFLAGS} -fno-semantic-interposition"
49+
50+
export ax_cv_c_float_words_bigendian=no
51+
./configure --prefix=/usr \
52+
--enable-shared \
53+
--with-computed-gotos \
54+
--with-lto \
55+
--enable-ipv6 \
56+
--with-system-expat \
57+
--with-dbmliborder=gdbm:ndbm \
58+
--with-system-ffi \
59+
--with-system-libmpdec \
60+
--enable-loadable-sqlite-extensions \
61+
--without-ensurepip \
62+
--with-tzpath=/usr/share/zoneinfo
63+
64+
make EXTRA_CFLAGS="$CFLAGS"
65+
}
66+
67+
package() {
68+
cd "${srcdir}/Python-${pkgver}"
69+
# altinstall: /usr/bin/pythonX.Y but not /usr/bin/python or /usr/bin/pythonX
70+
make DESTDIR="${pkgdir}" altinstall maninstall
71+
72+
# Split tests
73+
rm -r "$pkgdir"/usr/lib/python*/{test,ctypes/test,distutils/tests,idlelib/idle_test,lib2to3/tests,sqlite3/test,tkinter/test,unittest/test}
74+
75+
# Avoid conflicts with the main 'python' package.
76+
rm -f "${pkgdir}/usr/lib/libpython${_pymajver}.so"
77+
rm -f "${pkgdir}/usr/share/man/man1/python${_pymajver}.1"
78+
79+
# Clean-up reference to build directory
80+
sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}-${CARCH}-linux-gnu/Makefile"
81+
82+
# Add useful scripts FS#46146
83+
install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts}
84+
install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/
85+
install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/
86+
87+
# License
88+
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
89+
}

archlinuxcn/python39/lilac.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
maintainers:
2+
- github: yan12125
3+
email: f2q9sf79f9owdg2o@chyen.cc
4+
5+
build_prefix: extra-x86_64
6+
7+
pre_build_script: |
8+
aur_pre_build(maintainers="rixx")
9+
10+
post_build_script: |
11+
aur_post_build()
12+
13+
update_on:
14+
- source: aur
15+
aur: python39
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From dd436be488bdca2123d12d1e148d85cb6f98be5f Mon Sep 17 00:00:00 2001
2+
From: Stefan Krah <skrah@bytereef.org>
3+
Date: Sun, 10 Jan 2021 16:35:48 +0100
4+
Subject: [PATCH] Portability fixes.
5+
6+
---
7+
Modules/_decimal/_decimal.c | 4 ++--
8+
setup.py | 2 +-
9+
2 files changed, 3 insertions(+), 3 deletions(-)
10+
11+
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
12+
index 664d45a90481d..bbd540bc376e2 100644
13+
--- a/Modules/_decimal/_decimal.c
14+
+++ b/Modules/_decimal/_decimal.c
15+
@@ -3295,7 +3295,7 @@ dec_format(PyObject *dec, PyObject *args)
16+
}
17+
else {
18+
size_t n = strlen(spec.dot);
19+
- if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) {
20+
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) {
21+
/* fix locale dependent non-ascii characters */
22+
dot = dotsep_as_utf8(spec.dot);
23+
if (dot == NULL) {
24+
@@ -3304,7 +3304,7 @@ dec_format(PyObject *dec, PyObject *args)
25+
spec.dot = PyBytes_AS_STRING(dot);
26+
}
27+
n = strlen(spec.sep);
28+
- if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) {
29+
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) {
30+
/* fix locale dependent non-ascii characters */
31+
sep = dotsep_as_utf8(spec.sep);
32+
if (sep == NULL) {
33+
diff --git a/setup.py b/setup.py
34+
index ddc0bd067d4e4..c547a68664e8c 100644
35+
--- a/setup.py
36+
+++ b/setup.py
37+
@@ -2199,7 +2199,7 @@ def detect_decimal(self):
38+
undef_macros = []
39+
if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
40+
include_dirs = []
41+
- libraries = [':libmpdec.so.2']
42+
+ libraries = ['mpdec']
43+
sources = ['_decimal/_decimal.c']
44+
depends = ['_decimal/docstrings.h']
45+
else:

0 commit comments

Comments
 (0)