From c7e102a61a6da95e5d6164360258ce86ea4cd9f1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 13 Feb 2023 18:23:21 +0100 Subject: [PATCH 1/2] python: build script cleanup * remove sed for cgi, cgi is deprecated and about to be dropped * remove CPPFLAGS/LDFLAGS. it leaks into sysconfig and builds fine without it * don't set CXX (defaults to g++ otherwise). nure sure why an absolute path is needed here and not for CC. It builds fine without it. * remove ac_cv_func_bind_textdomain_codeset override, gets detected correctly * drop LC_CTYPE, we default to utf-8 * remove EXTRA_CFLAGS, cpython supports CFLAGS since forever * remove some optdepends commented code --- python/PKGBUILD | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/python/PKGBUILD b/python/PKGBUILD index 772bd650..d339c7d2 100644 --- a/python/PKGBUILD +++ b/python/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=python pkgname=('python' 'python-devel') pkgver=3.10.10 -pkgrel=1 +pkgrel=2 _pybasever=${pkgver%.*} pkgdesc="Next generation of the python high-level scripting language" arch=('i686' 'x86_64') @@ -82,9 +82,6 @@ apply_patch_with_msg() { prepare() { cd "${srcdir}/Python-${pkgver}" - # FS#23997 - sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py - apply_patch_with_msg \ 001-3.1-enable-new-dtags.patch \ 003-3.4-select-cygwin.patch \ @@ -125,11 +122,7 @@ prepare() { build() { cd "${srcdir}/Python-${pkgver}" - CPPFLAGS+=" -I/usr/include/ncursesw" - LDFLAGS+=" -L." - local CYGWIN_CHOST="${CHOST/-msys/-cygwin}" - CXX=/usr/bin/g++ \ ./configure \ --prefix=/usr \ --build=${CYGWIN_CHOST} \ @@ -143,10 +136,9 @@ build() { --with-system-ffi \ --with-system-libmpdec \ --enable-loadable-sqlite-extensions \ - --without-ensurepip \ - ac_cv_func_bind_textdomain_codeset=yes + --without-ensurepip - LC_CTYPE=en_US.UTF-8 make EXTRA_CFLAGS="$CFLAGS" > >(tee make-python.log) + make > >(tee make-python.log) sed -ne '/^\s*Failed to build these modules/,$ {p; /^\s*$/q42}' make-python.log } @@ -156,13 +148,12 @@ check() { } package_python() { - #optdepends=('tk: for tkinter' 'sqlite') depends=('libbz2' 'libexpat' 'libffi' 'liblzma' 'ncurses' 'libopenssl' 'libreadline' 'mpdecimal' 'libsqlite' 'zlib') provides=('python3') replaces=('python3') cd "${srcdir}/Python-${pkgver}" - make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" install + make DESTDIR="${pkgdir}" install # Why are these not done by default... ln -sf python3 "${pkgdir}"/usr/bin/python.exe From 34a49bb1b3b5fd1596fb03481855401f50e14401 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 13 Feb 2023 19:10:27 +0100 Subject: [PATCH 2/2] python: more msysize cleanup change uname to cygwin and drop all build time patches depending on uname. This shouldn't change anything in the build result in theory. --- python/900-msysize.patch | 103 ++------------------------------------- python/PKGBUILD | 3 +- 2 files changed, 6 insertions(+), 100 deletions(-) diff --git a/python/900-msysize.patch b/python/900-msysize.patch index 22112c7a..645f5640 100644 --- a/python/900-msysize.patch +++ b/python/900-msysize.patch @@ -1,14 +1,5 @@ --- Python-3.8.7.cygwin/configure.ac 2021-05-11 21:07:52.839122100 +0200 +++ Python-3.8.7/configure.ac 2021-05-11 21:10:48.366063600 +0200 -@@ -401,7 +401,7 @@ - case $MACHDEP in - aix*) MACHDEP="aix";; - linux*) MACHDEP="linux";; -- cygwin*) MACHDEP="cygwin";; -+ cygwin*|msys*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; - '') MACHDEP="unknown";; - esac @@ -845,6 +845,14 @@ darwin #elif defined(__VXWORKS__) @@ -24,89 +15,15 @@ #elif defined(__CYGWIN__) # if defined(__x86_64__) x86_64-cygwin -@@ -1064,7 +1072,7 @@ - if test -z "$enable_shared" - then +@@ -1137,7 +1148,7 @@ case $ac_sys_system in -- CYGWIN*) -+ CYGWIN*|MSYS*) - enable_shared="yes";; - *) - enable_shared="no";; -@@ -1118,6 +1126,10 @@ + CYGWIN*) LDLIBRARY='libpython$(LDVERSION).dll.a' - DLLLIBRARY='libpython$(LDVERSION).dll' - ;; -+ MSYS*) -+ LDLIBRARY='libpython$(LDVERSION).dll.a' +- DLLLIBRARY='libpython$(LDVERSION).dll' + DLLLIBRARY='msys-python$(LDVERSION).dll' -+ ;; + ;; SunOS*) LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' -@@ -1164,7 +1176,7 @@ - else # shared is disabled - PY_ENABLE_SHARED=0 - case $ac_sys_system in -- CYGWIN*) -+ CYGWIN*|MSYS*) - BLDLIBRARY='$(LIBRARY)' - LDLIBRARY='libpython$(LDVERSION).dll.a' - ;; -@@ -1213,7 +1225,7 @@ - AC_SUBST(LN) - if test -z "$LN" ; then - case $ac_sys_system in -- CYGWIN*) LN="ln -s";; -+ CYGWIN*|MSYS*) LN="ln -s";; - *) LN=ln;; - esac - fi -@@ -2514,7 +2526,7 @@ - *) SHLIB_SUFFIX=.sl;; - esac - ;; -- CYGWIN*) SHLIB_SUFFIX=.dll;; -+ CYGWIN*|MSYS*) SHLIB_SUFFIX=.dll;; - *) SHLIB_SUFFIX=.so;; - esac - fi -@@ -2648,7 +2660,7 @@ - SCO_SV*) - LDSHARED='$(CC) -Wl,-G,-Bexport' - LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; -- CYGWIN*) -+ CYGWIN*|MSYS*) - LDSHARED="gcc -shared -Wl,--enable-auto-image-base" - LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; - *) LDSHARED="ld";; -@@ -2734,7 +2746,7 @@ - LINKFORSHARED="-Xlinker --export-dynamic" - fi;; - esac;; -- CYGWIN*) -+ CYGWIN*|MSYS*) - if test $enable_shared = "no" - then - LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' -@@ -2758,7 +2770,7 @@ - if test ! "$LIBRARY" = "$LDLIBRARY" - then - case $ac_sys_system in -- CYGWIN*) -+ CYGWIN*|MSYS*) - # Cygwin needs CCSHARED when building extension DLLs - # but not when building the interpreter DLL. - CFLAGSFORSHARED='';; -@@ -3228,7 +3240,7 @@ - fi - AC_CHECK_FUNCS(pthread_sigmask, - [case $ac_sys_system in -- CYGWIN*) -+ CYGWIN*|MSYS*) - AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1, - [Define if pthread_sigmask() does not work on your system.]) - ;; --- Python-3.8.7.orig/Lib/ctypes/__init__.py 2020-12-21 17:25:24.000000000 +0100 +++ Python-3.8.7/Lib/ctypes/__init__.py 2021-05-11 22:26:25.866873900 +0200 @@ -456,7 +456,7 @@ @@ -184,15 +101,3 @@ diff -Naur Python-3.8.2-orig/Lib/sysconfig.py Python-3.8.2/Lib/sysconfig.py elif osname[:6] == "darwin": import _osx_support osname, release, machine = _osx_support.get_platform_osx( -diff -Naur Python-3.8.2-orig/Modules/makesetup Python-3.8.2/Modules/makesetup ---- Python-3.8.2-orig/Modules/makesetup 2020-02-25 00:36:25.000000000 +0300 -+++ Python-3.8.2/Modules/makesetup 2020-04-16 11:24:20.926282900 +0300 -@@ -88,7 +88,7 @@ - # Setup to link with extra libraries when making shared extensions. - # Currently, only Cygwin needs this baggage. - case `uname -s` in --CYGWIN*) if test $libdir = . -+CYGWIN*|MSYS*) if test $libdir = . - then - ExtraLibDir=. - else diff --git a/python/PKGBUILD b/python/PKGBUILD index d339c7d2..e02eb14c 100644 --- a/python/PKGBUILD +++ b/python/PKGBUILD @@ -63,7 +63,7 @@ sha256sums=('0419e9085bf51b7a672009b3f50dbf1859acdf18ba725d0ec19aa5c8503f0ea3' '437332e1a7195dd0adcd505ecdeab5c3a7a793efdd7fea7bec55f97957bb8934' '3e6c115c9b8e044193c0524b94275dfb13c1adfba3d250131b065f632b6d5512' '9d0efb7e7e913e96b9f7953802311bbc2d046a7bfdcc3ffaf11fc509731b4d18' - 'ce55a5e343158d7b1cd114cc7d7d53bcedfcd8616c533f816b3a0f1b2fe13682' + '5dfed4be015e93ab6f4e99a69fc5b3eece9c801ea504c8d0517c3cb6bb7dbe89' '85d9d042e0fa3493ec54b364e6b4fb6d2b12ba09641e01047bc84a09605ef76b' '17e4ac1b5f0fa8a6c410fb80d1ad99ec9185efef51b8450a31932b553c354ed1' 'b439ff4f0a1f13858f8fb596414b74ed2c14fc3103d90287bb8e461ee89288b9' @@ -122,6 +122,7 @@ prepare() { build() { cd "${srcdir}/Python-${pkgver}" + export MSYSTEM=CYGWIN local CYGWIN_CHOST="${CHOST/-msys/-cygwin}" ./configure \ --prefix=/usr \