Skip to content

Commit

Permalink
lang/python38: Use libmpdec from ports
Browse files Browse the repository at this point in the history
- Bump PORTREVISION for dependency and package change

PR:		253603
  • Loading branch information
skrah authored and sunpoet committed May 16, 2021
1 parent 797b898 commit 09397e7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lang/python38/Makefile
Expand Up @@ -48,13 +48,14 @@ PLIST_SUB= ABI=${ABIFLAGS} \
XYZDOT=${PORTVERSION} \
OSMAJOR=${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} # For plat-freebsd* in pkg-plist. https://bugs.python.org/issue19554

OPTIONS_DEFINE= DEBUG IPV6 LIBFFI NLS PYMALLOC
OPTIONS_DEFAULT= LIBFFI PYMALLOC
OPTIONS_DEFINE= DEBUG IPV6 LIBFFI LIBMPDEC NLS PYMALLOC
OPTIONS_DEFAULT= LIBFFI LIBMPDEC PYMALLOC
OPTIONS_RADIO= HASH
OPTIONS_RADIO_HASH= FNV SIPHASH
OPTIONS_SUB= yes

LIBFFI_DESC= Use libffi from ports instead of bundled version
LIBMPDEC_DESC= Use libmpdec from ports instead of bundled version
NLS_DESC= Enable gettext support for the locale module
PYMALLOC_DESC= Enable specialized mallocs

Expand All @@ -71,6 +72,9 @@ IPV6_CONFIGURE_ENABLE= ipv6
LIBFFI_CONFIGURE_ON= --with-system-ffi
LIBFFI_LIB_DEPENDS= libffi.so:devel/libffi

LIBMPDEC_CONFIGURE_ON= --with-system-libmpdec
LIBMPDEC_LIB_DEPENDS= libmpdec.so:math/mpdecimal

# Use CPPFLAGS over CFLAGS due to -I ordering, causing elementtree and pyexpat
# to break in Python 2.7, or preprocessor complaints in Python >= 3.3
# Upstream Issue: https://bugs.python.org/issue6299
Expand Down
20 changes: 20 additions & 0 deletions lang/python38/files/patch-Modules___decimal___decimal.c
@@ -0,0 +1,20 @@
--- Modules/_decimal/_decimal.c.orig 2021-02-17 20:39:05 UTC
+++ Modules/_decimal/_decimal.c
@@ -3284,7 +3284,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) {
@@ -3293,7 +3293,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) {
11 changes: 11 additions & 0 deletions lang/python38/files/patch-setup.py
@@ -0,0 +1,11 @@
--- setup.py.orig 2021-05-03 09:47:56 UTC
+++ setup.py
@@ -2051,7 +2051,7 @@ class PyBuildExt(build_ext):
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:

0 comments on commit 09397e7

Please sign in to comment.