diff --git a/PKGBUILD b/PKGBUILD index 72cc232..7b455d4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -14,12 +14,20 @@ depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib') makedepends=('tk' 'sqlite' 'bluez-libs' 'mpdecimal') optdepends=('tk: for tkinter' 'sqlite') options=('!makeflags') -source=(https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz) -sha256sums=('9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854') +source=( + https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz + mpdecimal-2.5.1.patch +) +sha256sums=( + '9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854' + '8eb389be1babe03a0231001dc16dd2d69a3ea0fbf6b8c976a580787e7ff1594c' +) prepare() { cd "${srcdir}/Python-${pkgver}" + patch -p1 -i "${srcdir}/mpdecimal-2.5.1.patch" + # FS#23997 sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py diff --git a/mpdecimal-2.5.1.patch b/mpdecimal-2.5.1.patch new file mode 100644 index 0000000..47e427c --- /dev/null +++ b/mpdecimal-2.5.1.patch @@ -0,0 +1,45 @@ +From dd436be488bdca2123d12d1e148d85cb6f98be5f Mon Sep 17 00:00:00 2001 +From: Stefan Krah +Date: Sun, 10 Jan 2021 16:35:48 +0100 +Subject: [PATCH] Portability fixes. + +--- + Modules/_decimal/_decimal.c | 4 ++-- + setup.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c +index 664d45a90481d..bbd540bc376e2 100644 +--- a/Modules/_decimal/_decimal.c ++++ b/Modules/_decimal/_decimal.c +@@ -3295,7 +3295,7 @@ dec_format(PyObject *dec, PyObject *args) + } + else { + size_t n = strlen(spec.dot); +- if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) { ++ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) { + /* fix locale dependent non-ascii characters */ + dot = dotsep_as_utf8(spec.dot); + if (dot == NULL) { +@@ -3304,7 +3304,7 @@ dec_format(PyObject *dec, PyObject *args) + spec.dot = PyBytes_AS_STRING(dot); + } + n = strlen(spec.sep); +- if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) { ++ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) { + /* fix locale dependent non-ascii characters */ + sep = dotsep_as_utf8(spec.sep); + if (sep == NULL) { +diff --git a/setup.py b/setup.py +index ddc0bd067d4e4..c547a68664e8c 100644 +--- a/setup.py ++++ b/setup.py +@@ -2199,7 +2199,7 @@ def detect_decimal(self): + undef_macros = [] + if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): + include_dirs = [] +- libraries = [':libmpdec.so.2'] ++ libraries = ['mpdec'] + sources = ['_decimal/_decimal.c'] + depends = ['_decimal/docstrings.h'] + else: