Skip to content

Commit

Permalink
Add python 3.13 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Dec 9, 2024
1 parent fc7aab2 commit 47850b7
Show file tree
Hide file tree
Showing 79 changed files with 2,434 additions and 27 deletions.
38 changes: 38 additions & 0 deletions build/python313/asn1crypto/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../../lib/build.sh

PKG=library/python-3/asn1crypto-313
PROG=asn1crypto
inherit_ver python312/asn1crypto
SUMMARY="asn1crypto - Fast ASN.1 parser..."
DESC="$SUMMARY"

. $SRCDIR/../common.sh

BUILD_DEPENDS_IPS+="library/python-$PYMVER/setuptools-$SPYVER"

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
14 changes: 14 additions & 0 deletions build/python313/asn1crypto/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE license=MIT

36 changes: 36 additions & 0 deletions build/python313/attrs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
#
. ../../../lib/build.sh

PKG=library/python-3/attrs-313
PROG=attrs
inherit_ver python312/attrs
SUMMARY="Python attrs"
DESC="Classes Without Boilerplate"

. $SRCDIR/../common.sh

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
18 changes: 18 additions & 0 deletions build/python313/attrs/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE license=MIT

<transform file path=usr/bin \
-> edit path usr/bin usr/lib/python$(PYTHONVER)/bin>

44 changes: 44 additions & 0 deletions build/python313/cffi/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../../lib/build.sh

PKG=library/python-3/cffi-313
PROG=cffi
inherit_ver python312/cffi
SUMMARY="cffi"
DESC="Foreign Function Interface for Python calling C code"

. $SRCDIR/../common.sh

CFLAGS[aarch64]+=" -mtls-dialect=trad"

RUN_DEPENDS_IPS+="
library/python-$PYMVER/pycparser-$SPYVER
"

REMOVE_PREVIOUS=1

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
14 changes: 14 additions & 0 deletions build/python313/cffi/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE license=MIT

3 changes: 3 additions & 0 deletions build/python313/coverage/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Coverage is needed in order to run the pkg(7) test-suite

36 changes: 36 additions & 0 deletions build/python313/coverage/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../../lib/build.sh

PKG=library/python-3/coverage-313
PROG=coverage
inherit_ver python312/coverage
SUMMARY="Python coverage module"
DESC="Code coverage testing for Python"

. $SRCDIR/../common.sh

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
18 changes: 18 additions & 0 deletions build/python313/coverage/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE.txt license=Apache2

<transform file path=usr/bin -> set pkg.depend.bypass-generate .* >
<transform file path=usr/bin \
-> edit path usr/bin usr/lib/python$(PYTHONVER)/bin>

36 changes: 36 additions & 0 deletions build/python313/crossenv/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../../lib/build.sh

PKG=library/python-3/crossenv-313
PROG=crossenv
inherit_ver python312/crossenv
SUMMARY="A cross-compiling tool for Python extension modules"
DESC="$SUMMARY"

. $SRCDIR/../common.sh

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
14 changes: 14 additions & 0 deletions build/python313/crossenv/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.

license LICENSE.txt license=MIT

12 changes: 12 additions & 0 deletions build/python313/crossenv/patches/illumos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -wpruN --no-dereference '--exclude=*.orig' a~/crossenv/__init__.py a/crossenv/__init__.py
--- a~/crossenv/__init__.py 1970-01-01 00:00:00
+++ a/crossenv/__init__.py 1970-01-01 00:00:00
@@ -520,6 +520,8 @@ class CrossEnvBuilder(venv.EnvBuilder):
self.host_machine = self.host_gnu_type.split('-')[0]

self.host_release = ''
+ if self.host_sysname == "sunos5":
+ self.host_release = '5.11'
if self.macosx_deployment_target:
try:
major, minor = self.macosx_deployment_target.split(".")
1 change: 1 addition & 0 deletions build/python313/crossenv/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
illumos.patch
77 changes: 77 additions & 0 deletions build/python313/cryptography/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
#
. ../../../lib/build.sh

PKG=library/python-3/cryptography-313
PROG=cryptography
inherit_ver python312/cryptography
SUMMARY="Cryptographic recipes and primitives"
DESC="$SUMMARY"

. $SRCDIR/../common.sh

if [ "$BUILDARCH" = aarch64 ]; then
# This is the last version that does not require rust to build, so we use
# that for aarch64 for now.
VER=3.4.8
export CRYPTOGRAPHY_DONT_BUILD_RUST=1
set_patchdir patches.aarch64
fi

RUN_DEPENDS_IPS+="
library/python-$PYMVER/six-$SPYVER
library/python-$PYMVER/cffi-$SPYVER
library/python-$PYMVER/asn1crypto-$SPYVER
library/python-$PYMVER/idna-$SPYVER
"

# As of version 3.4, the cryptography module includes Rust code
BUILD_DEPENDS_IPS+="
library/python-$PYMVER/setuptools-rust-$SPYVER
"

PATH+=:$OOCEBIN

# This package uses cffi as part of the build, and so the usual python cross
# compilation method (using the `crossenv` module) does not work.
# Somewhat surprisingly, this simple workaround does, although we have to
# use a compiler wrapper to strip options that are not applicable to
# the cross compiler and are otherwise picked by cffi from the native system
# info.
python_build_aarch64() {
typeset arch=aarch64

set_crossgcc $arch

CFLAGS[$arch]+=" -mtls-dialect=trad"

CC=$SRCDIR/files/gcc.aarch64 \
PLATFORM=$arch \
DESTDIR="$DESTDIR.$arch" \
python_build_arch $arch
}

init
download_source pymodules/$PROG $PROG $VER
patch_source
prep_build
python_build
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
9 changes: 9 additions & 0 deletions build/python313/cryptography/files/gcc.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/ksh

set -- `echo $@ | sed '
s/-m64//g
s/-msave-args//g
'`

exec /opt/cross/aarch64/bin/gcc "$@"

Loading

0 comments on commit 47850b7

Please sign in to comment.