Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: python3.11 3.11.6 #46631

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions srcpkgs/electron19/template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hostmakedepends="$(vopt_if clang "clang lld") python pkgconf perl gperf bison ni
pciutils-devel ffmpeg-devel libxml2-devel libglib-devel yarn openjdk libxslt-devel
opus-devel libXcursor-devel libXcomposite-devel libXtst-devel libXrandr-devel libXScrnSaver-devel
alsa-lib-devel re2-devel snappy-devel mit-krb5-devel $(vopt_if pulseaudio pulseaudio-devel)
$(vopt_if sndio sndio-devel) jq"
$(vopt_if sndio sndio-devel) jq python3.11"
makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
Expand Down Expand Up @@ -190,6 +190,8 @@ post_patch() {
}

pre_configure() {
ln -s "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"

cd "$wrksrc/$build_wrksrc"

# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
Expand Down Expand Up @@ -262,8 +264,8 @@ pre_configure() {


msg_normal "Replacing gn files\n"
python3 build/linux/unbundle/replace_gn_files.py --system-libraries \
$use_system
python3.11 build/linux/unbundle/replace_gn_files.py \
--system-libraries $use_system
third_party/libaddressinput/chromium/tools/update-strings.py
}

Expand Down Expand Up @@ -399,6 +401,10 @@ do_build() {
export BUILD_AR="$AR_host"
export BUILD_NM="$NM_host"
fi

# Prevent ERR_OSSL_EVP_UNSUPPORTED
export NODE_OPTIONS=--openssl-legacy-provider

msg_normal "Ninja turtles GO!\n"
ninja ${makejobs} -C out/$_buildtype electron third_party/electron_node:headers
# finish rest of the build
Expand Down
8 changes: 5 additions & 3 deletions srcpkgs/electron24/template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hostmakedepends="$(vopt_if clang "clang lld") python pkgconf perl gperf bison ni
pciutils-devel ffmpeg-devel libxml2-devel libglib-devel yarn openjdk libxslt-devel
opus-devel libXcursor-devel libXcomposite-devel libXtst-devel libXrandr-devel libXScrnSaver-devel
alsa-lib-devel re2-devel snappy-devel mit-krb5-devel $(vopt_if pulseaudio pulseaudio-devel)
$(vopt_if sndio sndio-devel) jq"
$(vopt_if sndio sndio-devel) jq python3.11"
makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
Expand Down Expand Up @@ -206,6 +206,8 @@ post_patch() {
}

pre_configure() {
ln -s "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"

cd "$wrksrc/$build_wrksrc"

# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
Expand Down Expand Up @@ -275,8 +277,8 @@ pre_configure() {


msg_normal "Replacing gn files\n"
python3 build/linux/unbundle/replace_gn_files.py --system-libraries \
$use_system
python3.11 build/linux/unbundle/replace_gn_files.py \
--system-libraries $use_system
third_party/libaddressinput/chromium/tools/update-strings.py

# Satisfy some scripts that use git describe to figure out the electron version
Expand Down
6 changes: 4 additions & 2 deletions srcpkgs/firefox/template
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ checksum=d0f996116ae234dc7bd59e0d77ddefe268179d7500d16a9488309c826547c97c

lib32disabled=yes

hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo
llvm clang lld nodejs cbindgen nasm which tar"
hostmakedepends="autoconf213 unzip zip pkg-config perl python3.11 yasm rust
cargo llvm clang lld nodejs cbindgen nasm which tar"
makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
Expand Down Expand Up @@ -63,6 +63,8 @@ post_patch() {
}

do_build() {
ln -s "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"

if [ "$build_option_clang" ]; then
export CC=clang
export CXX=clang++
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/python3.11-devel
29 changes: 29 additions & 0 deletions srcpkgs/python3.11/files/EXTERNALLY-MANAGED
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[externally-managed]
Error=
This system-wide Python installation is managed by the Void Linux package
manager, XBPS. Installation of Python packages from other sources is not
normally allowed.

To install a Python package not offered by Void Linux, consider using a virtual
environment, e.g.:

python3 -m venv /path/to/venv
/path/to/venv/pip install <package>

Appending the flag --system-site-packages to the first command will give the
virtual environment access to any Python package installed via XBPS.

Invoking python, pip, and executables installed by pip in /path/to/venv/bin
should automatically use the virtual environment. Alternatively, source its
activation script to add the environment to the command search path for a shell:

. /path/to/venv/activate

After activation, running

deactivate

will remove the environment from the search path without destroying it.

The XBPS package python3-pipx provides pipx, a convenient tool to automatically
manage virtual environments for individual Python applications.
21 changes: 21 additions & 0 deletions srcpkgs/python3.11/files/cross.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -ur a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1901,8 +1901,6 @@
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
- $$ensurepip --root=$(DESTDIR)/ ; \
fi

.PHONY: altinstall
@@ -1912,8 +1910,6 @@
upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \
esac; \
- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
- $$ensurepip --root=$(DESTDIR)/ ; \
fi

.PHONY: commoninstall
44 changes: 44 additions & 0 deletions srcpkgs/python3.11/patches/musl-find_library.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -265,6 +265,41 @@
def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

+ elif True:
+
+ # Patched for Alpine Linux / musl - search manually system paths
+ def _is_elf(filepath):
+ try:
+ with open(filepath, 'rb') as fh:
+ return fh.read(4) == b'\x7fELF'
+ except:
+ return False
+
+ def find_library(name):
+ from glob import glob
+ # absolute name?
+ if os.path.isabs(name):
+ return name
+ # special case for libm, libcrypt and libpthread and musl
+ if name in ['m', 'crypt', 'pthread']:
+ name = 'c'
+ elif name in ['libm.so', 'libcrypt.so', 'libpthread.so']:
+ name = 'libc.so'
+ # search in standard locations (musl order)
+ paths = ['/lib', '/usr/local/lib', '/usr/lib']
+ if 'LD_LIBRARY_PATH' in os.environ:
+ paths = os.environ['LD_LIBRARY_PATH'].split(':') + paths
+ for d in paths:
+ f = os.path.join(d, name)
+ if _is_elf(f):
+ return os.path.basename(f)
+
+ prefix = os.path.join(d, 'lib'+name)
+ for suffix in ['.so', '.so.*']:
+ for f in glob('{0}{1}'.format(prefix, suffix)):
+ if _is_elf(f):
+ return os.path.basename(f)
+
else:

def _findSoname_ldconfig(name):
45 changes: 45 additions & 0 deletions srcpkgs/python3.11/patches/ppc-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff -ur a/configure b/configure
--- a/configure
+++ b/configure
@@ -5952,6 +5952,14 @@
printf "%s\n" "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"

+if test x$MULTIARCH = xpowerpc-linux-musl
+then
+ MULTIARCH="powerpc-linux-gnu"
+fi
+if test x$MULTIARCH = xpowerpcle-linux-musl
+then
+ MULTIARCH="powerpcle-linux-gnu"
+fi


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CC compiler name" >&5
@@ -6859,7 +6867,11 @@
powerpc64-linux-gnu
# endif
# elif defined(__powerpc__)
+# if defined(__LITTLE_ENDIAN__)
+ powerpcle-linux-gnu
+# else
powerpc-linux-gnu
+# endif
# elif defined(__s390x__)
s390x-linux-gnu
# elif defined(__s390__)
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1039,7 +1039,11 @@
powerpc64-linux-gnu
# endif
# elif defined(__powerpc__)
+# if defined(__LITTLE_ENDIAN__)
+ powerpcle-linux-gnu
+# else
powerpc-linux-gnu
+# endif
# elif defined(__s390x__)
s390x-linux-gnu
# elif defined(__s390__)
144 changes: 144 additions & 0 deletions srcpkgs/python3.11/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Template file for 'python3.11'
pkgname=python3.11
version=3.11.6
revision=1
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6 --enable-optimizations
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat --with-system-ffi
--without-ensurepip ac_cv_working_tzset=yes"
hostmakedepends="pkgconf"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel"
depends="ca-certificates"
checkdepends="$depends iana-etc"
short_desc="Python ${version%.*} (limited install; not for regular use)"
maintainer="Andrew J. Hesford <[email protected]>"
license="Python-2.0"
homepage="https://www.python.org"
_bluez="bluez-5.64"
distfiles="
https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz
${KERNEL_SITE}/bluetooth/${_bluez}.tar.xz
"
checksum="0fab78fa7f133f4f38210c6260d90d7c0d5c7198446419ce057ec7ac2e6f5f38
ae437e65b6b3070c198bc5b0109fe9cdeb9eaa387380e2072f9de65fe8a1de34"
skip_extraction="${_bluez}.tar.xz"

if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" python3.11"
configure_args+=" --with-build-python=python${version%.*}"
configure_args+=" ac_cv_broken_sem_getvalue=no"
fi

post_extract() {
# Ensure that the internal copy of expat is not used
rm -r Modules/expat

# Extract Bluetooth headers
local _srcdistdir="${XBPS_SRCDISTDIR}/${sourcepkg}-${version}"
mkdir External
bsdtar -C External --strip-components=1 -x \
-f "${_srcdistdir}/${_bluez}.tar.xz" "${_bluez}/lib/*.h"
mv External/lib External/bluetooth
}

post_patch() {
if [ -n "$CROSS_BUILD" ]; then
patch -Np1 -i ${FILESDIR}/cross.patch
fi
}

do_configure() {
# If these are set, distutils will default to cc and attempt to pass
# `-R<path>` to the compiler for every compiled extension that sets an
# rpath rather than the '-Wl,-R<path>' argument that GCC requires
unset GCC CC CXX CPP LD AR AS RANLIB

# Make sure configure can find Bluetooth headers
CFLAGS+=" -I./External"
CPPFLAGS+=" -I./External"
./configure ${configure_args}
}

do_check() {
local opts

# relies on sane group membership not found in xbps-src
opts="-i test_chown_*"
# expects shadow passwd db unreadable by user
opts+=" -i test_getspnam_exception"
# expects functionality patched out for musl
opts+=" -i test_find_library_with_*"
# SSL advertises unexpected ciphers
opts+=" -i test_shared_ciphers"
# requires in-tree expat, which we removed
opts+=" -i test_freeze_simple_script"
# anomalies in SSL session handling
opts+=" -i test_session*"
# overflow in datetime.time.mktime
opts+=" -i test_localtime_daylight_*_dst_true"

if [ "${XBPS_TARGET_LIBC}" = "musl" ]; then
# musl doesn't work with locales
opts+=" -i test_locale* -i test_c_locale* -i test__locale"
opts+=" -i test_fpathconf"
fi

make ${makejobs} EXTRATESTOPTS="${opts}" quicktest
}

do_install() {
make DESTDIR=${DESTDIR} install maninstall

# Put the license in the usual location and remove from the libdir
# to prevent the XBPS trigger from attempting to byte-compile it
vlicense LICENSE
rm ${DESTDIR}/usr/lib/python${version%.*}/LICENSE.txt

# Remove major-only components that conflict with python3 packages
rm ${DESTDIR}/usr/bin/{pydoc3,python3,2to3,python3-config}
rm ${DESTDIR}/usr/lib/libpython3.so
rm ${DESTDIR}/usr/lib/pkgconfig/python3{,-embed}.pc
rm ${DESTDIR}/usr/share/man/man1/python3.1

# Remove files that belong to idle
rm ${DESTDIR}/usr/bin/idle3*
rm -r ${DESTDIR}/usr/lib/python${version%.*}/idlelib

# Remove test module and tests that fail to be byte-compiled.
rm -r ${DESTDIR}/usr/lib/python${version%.*}/test
rm -r ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests

# Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile

if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config
fi

# https://peps.python.org/pep-0668/
vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 usr/lib/python${version%.*}
}

python3.11-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}-${version}_${revision}"
pkg_install() {
vmove usr/bin/python*-config
vmove usr/lib/pkgconfig
vmove usr/include
mv ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/libpython${version%.*}*.a \
${PKGDESTDIR}/usr/lib
mkdir -p ${DESTDIR}/usr/include/python${version%.*}
mv ${PKGDESTDIR}/usr/include/python${version%.*}/pyconfig.h \
${DESTDIR}/usr/include/python${version%.*}
}
}
3 changes: 3 additions & 0 deletions srcpkgs/python3.11/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pkgname=Python
site="${homepage}/downloads/source/"
pattern='Python-\K3\.11\.[0-9]+(?=\.tgz)'