-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathtemplate
More file actions
178 lines (153 loc) · 5.36 KB
/
template
File metadata and controls
178 lines (153 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Template file for 'python3'
#
# THIS PACKAGE MUST BE SYNCHRONIZED WITH "srcpkgs/python3-tkinter".
# Also rebuild those packages on minor version update:
# - coccinelle
#
pkgname=python3
version=3.14.3
revision=1
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat
--without-ensurepip ac_cv_working_tzset=yes"
pycompile_dirs="${py3_lib}"
hostmakedepends="pkgconf autoconf-archive automake"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel libzstd-devel"
depends="ca-certificates"
checkdepends="$depends iana-etc"
short_desc="Python programming language (${version%.*} series)"
maintainer="Andrew J. Hesford <[email protected]>"
license="Python-2.0"
homepage="https://www.python.org"
_bluez="bluez-5.78"
distfiles="
https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz
${KERNEL_SITE}/bluetooth/${_bluez}.tar.xz
"
checksum="a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b
830fed1915c5d375b8de0f5e6f45fcdea0dcc5ff5ffb3d31db6ed0f00d73c5e3"
skip_extraction="${_bluez}.tar.xz"
alternatives="
python:pydoc:/usr/bin/pydoc${version%.*}
python:python:/usr/bin/python${version%.*}
python:python.1:/usr/share/man/man1/python${version%.*}.1"
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
makedepends+=" libxcrypt-devel"
fi
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" python3"
configure_args+=" --with-build-python=python${py3_ver}"
configure_args+=" ac_cv_broken_sem_getvalue=no"
else
configure_args+=" --enable-optimizations"
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
}
# https://github.com/python/cpython/issues/89640
pre_configure() {
autoreconf -vfi
}
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"
# error handling raises exceptions
opts+=" -i test_ftp*"
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"
else
# ctypes libm imports misbehave with glibc linker scripts
opts+=" -i test_issue18060_*"
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}/${py3_lib}/LICENSE.txt
rm -f ${DESTDIR}/usr/bin/2to3
local _dst_py3_lib="${DESTDIR}/${py3_lib}"
# Remove files that belong to python3-tkinter and idle-python3
rm ${DESTDIR}/usr/bin/idle3*
rm ${_dst_py3_lib}/turtle.py
rm -r ${_dst_py3_lib}/idlelib
rm -r ${_dst_py3_lib}/tkinter
rm -r ${_dst_py3_lib}/turtledemo
# Remove test module and tests that fail to be byte-compiled.
rm -rf ${_dst_py3_lib}/test
rm -rf ${_dst_py3_lib}/lib2to3/tests
# Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config
fi
sed -i -e "s,-I./External,," \
-e "s,-ffile-prefix-map=[^[:space:]]*=[.],," \
-e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
${DESTDIR}/usr/bin/python${version%.*}-config \
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
# https://peps.python.org/pep-0668/
vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 "${py3_lib}"
}
python3-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}/${py3_lib}"/config-*/libpython*.a "${PKGDESTDIR}/usr/lib"
mkdir -p "${DESTDIR}/${py3_inc}"
mv "${PKGDESTDIR}/${py3_inc}/pyconfig.h" "${DESTDIR}/${py3_inc}"
}
}