"
5 | fi
6 |
7 | for DIR in $(find "$1" -path "$1"/.git -prune -o -type d); do
8 | {
9 | echo -e '\n\nDirectory listing
\n
\n'
10 | ls -1pa -I.git "$DIR" | grep -v "^\./$" | grep -v "^index\.html$" | awk '{ printf "%s\n",$1,$1 }'
11 | echo -e '
\n\n'
12 | } > "$DIR"/index.html
13 | done
14 |
--------------------------------------------------------------------------------
/install-all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | sudo pacman --noconfirm --needed -U python*/*.pkg.tar.zst
4 |
--------------------------------------------------------------------------------
/python310/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=310
9 | pkgname=python$_py_ver
10 | pkgver=3.10.14
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('adee638aeca898743da4b8245c0fa1e9b94b516f22e716e60c99038f0bb3dcbf726317aa86656404be1719b5a7c58eb09533720ebc0badbb04bd9a534dd48fef'
30 | 'SKIP')
31 | validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D') # Pablo Galindo Salgado
32 |
33 | prepare() {
34 | cd Python-$pkgver
35 |
36 | # https://bugs.python.org/issue34587
37 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
38 |
39 | # FS#23997
40 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
41 |
42 | # Speed up LTO
43 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
44 |
45 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
46 | # rather than copies shipped in the tarball
47 | rm -r Modules/expat
48 | rm -r Modules/_ctypes/{darwin,libffi}*
49 | rm -r Modules/_decimal/libmpdec
50 | }
51 |
52 | build() {
53 | cd Python-$pkgver
54 |
55 | # PGO should be done with -O3
56 | # Also included the -fno-semantic-interposition optimization:
57 | # https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
58 | CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition"
59 | LDFLAGS="$LDFLAGS -fno-semantic-interposition"
60 |
61 | # Disable bundled pip & setuptools
62 | ./configure --prefix=/usr \
63 | -enable-shared \
64 | --with-computed-gotos \
65 | --with-lto \
66 | --enable-ipv6 \
67 | --with-system-expat \
68 | --with-dbmliborder=gdbm:ndbm \
69 | --with-system-ffi \
70 | --with-system-libmpdec \
71 | --enable-loadable-sqlite-extensions \
72 | --without-ensurepip \
73 | --with-tzpath=/usr/share/zoneinfo \
74 | ax_cv_c_float_words_bigendian=no
75 |
76 | # --enable-optimizations \
77 |
78 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
79 | export servernum=99
80 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
81 |
82 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
83 | }
84 |
85 |
86 | #check() {
87 | # # test_tk and test_ttk_guionly: https://bugs.python.org/issue43139
88 | #
89 | # cd Python-${pkgver}
90 | #
91 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
92 | # export servernum=99
93 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
94 | #
95 | # LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \
96 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1920x1080x16 -ac +extension GLX" -a -n "$servernum" \
97 | # "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall -x test_tk -x test_ttk_guionly
98 | #}
99 |
100 | package() {
101 | cd Python-${pkgver}
102 |
103 | # Hack to avoid building again
104 | sed -i 's/^all:.*$/all: build_all/' Makefile
105 |
106 | # PGO should be done with -O3
107 | CFLAGS="${CFLAGS/-O2/-O3}"
108 |
109 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
110 |
111 | # some useful "stuff" FS#46146
112 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
113 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
114 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
115 |
116 | # fix conflicts with python
117 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
118 | rm -f "$pkgdir"/usr/bin/2to3{,3}
119 | rm -f "$pkgdir"/usr/bin/idle{,3}
120 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
121 | rm -f "$pkgdir"/usr/bin/python{,3}
122 | rm -f "$pkgdir"/usr/bin/python{,3}-config
123 | rm -f "$pkgdir"/usr/lib/libpython3.so
124 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3{,-embed}.pc
125 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
126 |
127 | # License
128 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
129 | }
130 |
--------------------------------------------------------------------------------
/python311/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=311
9 | pkgname=python$_py_ver
10 | pkgver=3.11.9
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('2b0a1d936b4ef8376f9655797aece8ffdff75031ad7bfa840f330cac2aed189aecc80c163edc12ea772851d7a011f3fc1960470a73d9d4290cf3ab8ad6ed7e6a'
30 | 'SKIP')
31 | validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D') # Pablo Galindo Salgado
32 |
33 | prepare() {
34 | cd Python-$pkgver
35 |
36 | # https://bugs.python.org/issue34587
37 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
38 |
39 | # FS#23997
40 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
41 |
42 | # Speed up LTO
43 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
44 |
45 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
46 | # rather than copies shipped in the tarball
47 | rm -r Modules/expat
48 | rm -r Modules/_ctypes/{darwin,libffi}*
49 | rm -r Modules/_decimal/libmpdec
50 | }
51 |
52 | build() {
53 | cd Python-$pkgver
54 |
55 | # PGO should be done with -O3
56 | # Also included the -fno-semantic-interposition optimization:
57 | # https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
58 | CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition"
59 | LDFLAGS="$LDFLAGS -fno-semantic-interposition"
60 |
61 | # Disable bundled pip & setuptools
62 | ./configure --prefix=/usr \
63 | -enable-shared \
64 | --with-computed-gotos \
65 | --with-lto \
66 | --enable-ipv6 \
67 | --with-system-expat \
68 | --with-dbmliborder=gdbm:ndbm \
69 | --with-system-ffi \
70 | --with-system-libmpdec \
71 | --enable-loadable-sqlite-extensions \
72 | --without-ensurepip \
73 | --with-tzpath=/usr/share/zoneinfo \
74 | ax_cv_c_float_words_bigendian=no
75 |
76 | # --enable-optimizations \
77 |
78 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
79 | export servernum=99
80 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
81 |
82 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
83 | }
84 |
85 |
86 | #check() {
87 | # # test_tk and test_ttk_guionly: https://bugs.python.org/issue43139
88 | #
89 | # cd Python-${pkgver}
90 | #
91 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
92 | # export servernum=99
93 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
94 | #
95 | # LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \
96 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1920x1080x16 -ac +extension GLX" -a -n "$servernum" \
97 | # "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall -x test_tk -x test_ttk_guionly
98 | #}
99 |
100 | package() {
101 | cd Python-${pkgver}
102 |
103 | # Hack to avoid building again
104 | sed -i 's/^all:.*$/all: build_all/' Makefile
105 |
106 | # PGO should be done with -O3
107 | CFLAGS="${CFLAGS/-O2/-O3}"
108 |
109 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
110 |
111 | # some useful "stuff" FS#46146
112 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
113 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
114 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
115 |
116 | # fix conflicts with python
117 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
118 | rm -f "$pkgdir"/usr/bin/2to3{,3}
119 | rm -f "$pkgdir"/usr/bin/idle{,3}
120 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
121 | rm -f "$pkgdir"/usr/bin/python{,3}
122 | rm -f "$pkgdir"/usr/bin/python{,3}-config
123 | rm -f "$pkgdir"/usr/lib/libpython3.so
124 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3{,-embed}.pc
125 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
126 |
127 | # License
128 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
129 | }
130 |
--------------------------------------------------------------------------------
/python34/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=34
9 | pkgname=python$_py_ver
10 | pkgver=3.4.10
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('d5d27d68049b61f135e21b12a800dbd4fc521d6935de178de6e2e88a989cda511d3c8fead90d14e38d2db0e528a74b22674e0da01c51ff4fad7d335ec6c3dbbc'
30 | 'SKIP')
31 | validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key)
32 | '97FC712E4C024BBEA48A61ED3A5CA953F73C700D') # Larry Hastings
33 |
34 | prepare() {
35 | cd Python-$pkgver
36 |
37 | # https://bugs.python.org/issue34587
38 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
39 |
40 | # FS#23997
41 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
42 |
43 | # Speed up LTO
44 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
45 |
46 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
47 | # rather than copies shipped in the tarball
48 | rm -r Modules/expat
49 | rm -r Modules/_ctypes/{darwin,libffi}*
50 | rm -r Modules/_decimal/libmpdec
51 | }
52 |
53 | build() {
54 | cd Python-$pkgver
55 |
56 | # PGO should be done with -O3
57 | CFLAGS="${CFLAGS/-O2/-O3}"
58 |
59 | # Disable bundled pip & setuptools
60 | ./configure --prefix=/usr \
61 | --enable-shared \
62 | --with-threads \
63 | --with-computed-gotos \
64 | --with-lto \
65 | --enable-ipv6 \
66 | --with-system-expat \
67 | --with-dbmliborder=gdbm:ndbm \
68 | --with-system-ffi \
69 | --with-system-libmpdec \
70 | --enable-loadable-sqlite-extensions \
71 | --without-ensurepip
72 |
73 | # --enable-optimizations \
74 |
75 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
76 | export servernum=99
77 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
78 |
79 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
80 | }
81 |
82 | check() {
83 | # test_gdb is expected to fail with LTO
84 | # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
85 |
86 | # https://bugs.python.org/issue34022
87 | # test_cmd_line_script, test_compileall, test_importlib,
88 | # test_multiprocessing_main_handling, test_py_compile, test_runpy
89 |
90 | cd Python-${pkgver}
91 |
92 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
93 | export servernum=99
94 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
95 |
96 | LD_LIBRARY_PATH="$srcdir/Python-$pkgver":$LD_LIBRARY_PATH \
97 | LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
98 | "$srcdir/Python-$pkgver/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
99 | -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
100 | -x test_httplib
101 | }
102 |
103 | package() {
104 | cd Python-${pkgver}
105 |
106 | # Hack to avoid building again
107 | sed -i 's/^all:.*$/all: build_all/' Makefile
108 |
109 | # PGO should be done with -O3
110 | CFLAGS="${CFLAGS/-O2/-O3}"
111 |
112 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
113 |
114 | # some useful "stuff" FS#46146
115 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
116 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
117 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
118 |
119 | # fix conflicts with python
120 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
121 | rm -f "$pkgdir"/usr/bin/2to3{,3}
122 | rm -f "$pkgdir"/usr/bin/idle{,3}
123 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
124 | rm -f "$pkgdir"/usr/bin/python{,3}
125 | rm -f "$pkgdir"/usr/bin/python{,3}-config
126 | rm -f "$pkgdir"/usr/lib/libpython3.so
127 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3.pc
128 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
129 |
130 | rm -f "$pkgdir"/usr/bin/pyenv
131 |
132 | # License
133 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
134 | }
135 |
--------------------------------------------------------------------------------
/python35/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=35
9 | pkgname=python$_py_ver
10 | pkgver=3.5.10
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('a3f584b1da8889ad72665ba8863dfb73c800720efa67ea29315c4cafa92eacf5f4313ffa59fe3b19ed614770dbcb0e5710db9bc30e216d3edaa9a07ca156182e'
30 | 'SKIP')
31 | validpgpkeys=('97FC712E4C024BBEA48A61ED3A5CA953F73C700D') # Larry Hastings
32 |
33 | prepare() {
34 | cd Python-$pkgver
35 |
36 | # https://bugs.python.org/issue34587
37 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
38 |
39 | # FS#23997
40 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
41 |
42 | # Speed up LTO
43 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
44 |
45 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
46 | # rather than copies shipped in the tarball
47 | rm -r Modules/expat
48 | rm -r Modules/_ctypes/{darwin,libffi}*
49 | rm -r Modules/_decimal/libmpdec
50 | }
51 |
52 | build() {
53 | cd Python-$pkgver
54 |
55 | # PGO should be done with -O3
56 | CFLAGS="${CFLAGS/-O2/-O3}"
57 |
58 | # Disable bundled pip & setuptools
59 | ./configure --prefix=/usr \
60 | --enable-shared \
61 | --with-threads \
62 | --with-computed-gotos \
63 | --with-lto \
64 | --enable-ipv6 \
65 | --with-system-expat \
66 | --with-dbmliborder=gdbm:ndbm \
67 | --with-system-ffi \
68 | --with-system-libmpdec \
69 | --enable-loadable-sqlite-extensions \
70 | --without-ensurepip
71 |
72 | # --enable-optimizations \
73 |
74 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
75 | export servernum=99
76 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
77 |
78 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
79 | }
80 |
81 | #check() {
82 | # # test_gdb is expected to fail with LTO
83 | # # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
84 | #
85 | # # https://bugs.python.org/issue34022
86 | # # test_cmd_line_script, test_compileall, test_importlib,
87 | # # test_multiprocessing_main_handling, test_py_compile, test_runpy
88 | #
89 | # cd Python-${pkgver}
90 | #
91 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
92 | # export servernum=99
93 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
94 | #
95 | # LD_LIBRARY_PATH="$srcdir/Python-$pkgver":$LD_LIBRARY_PATH \
96 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
97 | # "$srcdir/Python-$pkgver/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
98 | # -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
99 | # -x test_httplib
100 | #}
101 |
102 | package() {
103 | cd Python-${pkgver}
104 |
105 | # Hack to avoid building again
106 | sed -i 's/^all:.*$/all: build_all/' Makefile
107 |
108 | # PGO should be done with -O3
109 | CFLAGS="${CFLAGS/-O2/-O3}"
110 |
111 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
112 |
113 | # some useful "stuff" FS#46146
114 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
115 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
116 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
117 |
118 | # fix conflicts with python
119 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
120 | rm -f "$pkgdir"/usr/bin/2to3{,3}
121 | rm -f "$pkgdir"/usr/bin/idle{,3}
122 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
123 | rm -f "$pkgdir"/usr/bin/python{,3}
124 | rm -f "$pkgdir"/usr/bin/python{,3}-config
125 | rm -f "$pkgdir"/usr/lib/libpython3.so
126 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3.pc
127 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
128 |
129 | rm -f "$pkgdir"/usr/bin/pyenv
130 |
131 | # License
132 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
133 | }
134 |
--------------------------------------------------------------------------------
/python36/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=36
9 | pkgname=python$_py_ver
10 | pkgver=3.6.15
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('f1894d704c91669d94ec83b5631288bf1e0c73ddcf33cea0977575f262eb672caebc8ac00e34e9b99c321c19cc9a71d6081fa957bb8e23cf5bfba50f345145ef'
30 | 'SKIP')
31 | validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D') # Ned Deily (Python release signing key)
32 |
33 | prepare() {
34 | cd Python-$pkgver
35 |
36 | # https://bugs.python.org/issue34587
37 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
38 |
39 | # FS#23997
40 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
41 |
42 | # Speed up LTO
43 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
44 |
45 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
46 | # rather than copies shipped in the tarball
47 | rm -r Modules/expat
48 | rm -r Modules/_ctypes/{darwin,libffi}*
49 | rm -r Modules/_decimal/libmpdec
50 | }
51 |
52 | build() {
53 | cd Python-$pkgver
54 |
55 | # PGO should be done with -O3
56 | CFLAGS="${CFLAGS/-O2/-O3}"
57 |
58 | # Disable bundled pip & setuptools
59 | ./configure --prefix=/usr \
60 | --enable-shared \
61 | --with-threads \
62 | --with-computed-gotos \
63 | --with-lto \
64 | --enable-ipv6 \
65 | --with-system-expat \
66 | --with-dbmliborder=gdbm:ndbm \
67 | --with-system-ffi \
68 | --with-system-libmpdec \
69 | --enable-loadable-sqlite-extensions \
70 | --without-ensurepip
71 |
72 | # --enable-optimizations \
73 |
74 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
75 | export servernum=99
76 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
77 |
78 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
79 | }
80 |
81 | #check() {
82 | # # test_gdb is expected to fail with LTO
83 | # # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
84 | #
85 | # # https://bugs.python.org/issue34022
86 | # # test_cmd_line_script, test_compileall, test_importlib,
87 | # # test_multiprocessing_main_handling, test_py_compile, test_runpy
88 | #
89 | # cd Python-${pkgver}
90 | #
91 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
92 | # export servernum=99
93 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
94 | #
95 | # LD_LIBRARY_PATH="$srcdir/Python-$pkgver":$LD_LIBRARY_PATH \
96 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
97 | # "$srcdir/Python-$pkgver/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
98 | # -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
99 | # -x test_httplib
100 | #}
101 |
102 | package() {
103 | cd Python-${pkgver}
104 |
105 | # Hack to avoid building again
106 | sed -i 's/^all:.*$/all: build_all/' Makefile
107 |
108 | # PGO should be done with -O3
109 | CFLAGS="${CFLAGS/-O2/-O3}"
110 |
111 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
112 |
113 | # some useful "stuff" FS#46146
114 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
115 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
116 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
117 |
118 | # fix conflicts with python
119 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
120 | rm -f "$pkgdir"/usr/bin/2to3{,3}
121 | rm -f "$pkgdir"/usr/bin/idle{,3}
122 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
123 | rm -f "$pkgdir"/usr/bin/python{,3}
124 | rm -f "$pkgdir"/usr/bin/python{,3}-config
125 | rm -f "$pkgdir"/usr/lib/libpython3.so
126 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3.pc
127 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
128 |
129 | rm -f "$pkgdir"/usr/bin/pyenv
130 |
131 | # License
132 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
133 | }
134 |
--------------------------------------------------------------------------------
/python37/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=37
9 | pkgname=python$_py_ver
10 | pkgver=3.7.17
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('86ba1c953e7b4bce70445d1616cc0d428b50937f6a874811584df8bf23c3e2ba3e5d48dec00e629a47f4216f3ca50dc5389cd485fbc315f51000d8750403b5f0'
30 | 'SKIP')
31 | validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D') # Ned Deily (Python release signing key)
32 |
33 | prepare() {
34 | cd Python-$pkgver
35 |
36 | # https://bugs.python.org/issue34587
37 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
38 |
39 | # FS#23997
40 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
41 |
42 | # Speed up LTO
43 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
44 |
45 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
46 | # rather than copies shipped in the tarball
47 | rm -r Modules/expat
48 | rm -r Modules/_ctypes/{darwin,libffi}*
49 | rm -r Modules/_decimal/libmpdec
50 | }
51 |
52 | build() {
53 | cd Python-$pkgver
54 |
55 | # PGO should be done with -O3
56 | CFLAGS="${CFLAGS/-O2/-O3}"
57 |
58 | # Disable bundled pip & setuptools
59 | ./configure --prefix=/usr \
60 | --enable-shared \
61 | --with-threads \
62 | --with-computed-gotos \
63 | --with-lto \
64 | --enable-ipv6 \
65 | --with-system-expat \
66 | --with-dbmliborder=gdbm:ndbm \
67 | --with-system-ffi \
68 | --with-system-libmpdec \
69 | --enable-loadable-sqlite-extensions \
70 | --without-ensurepip
71 |
72 | # --enable-optimizations \
73 |
74 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
75 | export servernum=99
76 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
77 |
78 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
79 | }
80 |
81 | #check() {
82 | # # test_gdb is expected to fail with LTO
83 | # # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
84 | #
85 | # # https://bugs.python.org/issue34022
86 | # # test_cmd_line_script, test_compileall, test_importlib,
87 | # # test_multiprocessing_main_handling, test_py_compile, test_runpy
88 | #
89 | # cd Python-${pkgver}
90 | #
91 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
92 | # export servernum=99
93 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
94 | #
95 | # LD_LIBRARY_PATH="$srcdir/Python-$pkgver":$LD_LIBRARY_PATH \
96 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
97 | # "$srcdir/Python-$pkgver/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
98 | # -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
99 | # -x test_httplib
100 | #}
101 |
102 | package() {
103 | cd Python-${pkgver}
104 |
105 | # Hack to avoid building again
106 | sed -i 's/^all:.*$/all: build_all/' Makefile
107 |
108 | # PGO should be done with -O3
109 | CFLAGS="${CFLAGS/-O2/-O3}"
110 |
111 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
112 |
113 | # some useful "stuff" FS#46146
114 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
115 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
116 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
117 |
118 | # fix conflicts with python
119 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
120 | rm -f "$pkgdir"/usr/bin/2to3{,3}
121 | rm -f "$pkgdir"/usr/bin/idle{,3}
122 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
123 | rm -f "$pkgdir"/usr/bin/python{,3}
124 | rm -f "$pkgdir"/usr/bin/python{,3}-config
125 | rm -f "$pkgdir"/usr/lib/libpython3.so
126 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3.pc
127 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
128 |
129 | # License
130 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
131 | }
132 |
--------------------------------------------------------------------------------
/python38/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=38
9 | pkgname=python$_py_ver
10 | pkgver=3.8.19
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('1d2a57fa15ccdaec8cdca508ba2ffb01e1ae053a3446ac709bc334480f8e913070899f01ed680cce6dc7ddfddcb27ef402fe206562249fa4c4e87be21ece0625'
30 | 'SKIP')
31 | validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key)
32 | 'E3FF2839C048B25C084DEBE9B26995E310250568') # Łukasz Langa (GPG langa.pl)
33 |
34 | prepare() {
35 | cd Python-$pkgver
36 |
37 | # https://bugs.python.org/issue34587
38 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
39 |
40 | # FS#23997
41 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
42 |
43 | # Speed up LTO
44 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
45 |
46 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
47 | # rather than copies shipped in the tarball
48 | rm -r Modules/expat
49 | rm -r Modules/_ctypes/{darwin,libffi}*
50 | rm -r Modules/_decimal/libmpdec
51 | }
52 |
53 | build() {
54 | cd Python-$pkgver
55 |
56 | # PGO should be done with -O3
57 | CFLAGS="${CFLAGS/-O2/-O3}"
58 |
59 | # Disable bundled pip & setuptools
60 | ./configure --prefix=/usr \
61 | --enable-shared \
62 | --with-threads \
63 | --with-computed-gotos \
64 | --with-lto \
65 | --enable-ipv6 \
66 | --with-system-expat \
67 | --with-dbmliborder=gdbm:ndbm \
68 | --with-system-ffi \
69 | --with-system-libmpdec \
70 | --enable-loadable-sqlite-extensions \
71 | --without-ensurepip \
72 | ax_cv_c_float_words_bigendian=no
73 |
74 | # --enable-optimizations \
75 |
76 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
77 | export servernum=99
78 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
79 |
80 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
81 | }
82 |
83 | #check() {
84 | # # test_gdb is expected to fail with LTO
85 | # # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
86 | #
87 | # # https://bugs.python.org/issue34022
88 | # # test_cmd_line_script, test_compileall, test_importlib,
89 | # # test_multiprocessing_main_handling, test_py_compile, test_runpy
90 | #
91 | # cd Python-${pkgver}
92 | #
93 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
94 | # export servernum=99
95 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
96 | #
97 | # LD_LIBRARY_PATH="$srcdir/Python-$pkgver":$LD_LIBRARY_PATH \
98 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
99 | # "$srcdir/Python-$pkgver/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
100 | # -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
101 | # -x test_httplib
102 | #}
103 |
104 | package() {
105 | cd Python-${pkgver}
106 |
107 | # Hack to avoid building again
108 | sed -i 's/^all:.*$/all: build_all/' Makefile
109 |
110 | # PGO should be done with -O3
111 | CFLAGS="${CFLAGS/-O2/-O3}"
112 |
113 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
114 |
115 | # some useful "stuff" FS#46146
116 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
117 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
118 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
119 |
120 | # fix conflicts with python
121 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
122 | rm -f "$pkgdir"/usr/bin/2to3{,3}
123 | rm -f "$pkgdir"/usr/bin/idle{,3}
124 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
125 | rm -f "$pkgdir"/usr/bin/python{,3}
126 | rm -f "$pkgdir"/usr/bin/python{,3}-config
127 | rm -f "$pkgdir"/usr/lib/libpython3.so
128 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3{,-embed}.pc
129 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
130 |
131 | # License
132 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
133 | }
134 |
--------------------------------------------------------------------------------
/python39/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: Filipe Laíns
2 | # Contributor: Angel Velasquez
3 | # Contributor: Felix Yan
4 | # Contributor: Stéphane Gaudreault
5 | # Contributor: Allan McRae
6 | # Contributor: Jason Chu
7 |
8 | _py_ver=39
9 | pkgname=python$_py_ver
10 | pkgver=3.9.19
11 | pkgrel=2
12 | _pybasever=${pkgver%.*}
13 | pkgdesc='Next generation of the python high-level scripting language'
14 | arch=('x86_64')
15 | license=('custom')
16 | groups=('python-versions')
17 | url='https://www.python.org/'
18 | depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
19 | makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
20 | optdepends=('python-setuptools'
21 | 'python-pip'
22 | 'sqlite'
23 | 'mpdecimal: for decimal'
24 | 'xz: for lzma'
25 | 'tk: for tkinter')
26 | provides=('python3')
27 | replaces=('python3')
28 | source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-$pkgver.tar.xz"{,.asc})
29 | sha512sums=('5577830c734e63a70bbc62cd33d263b9aa87c4381b49cb694c3559067c4c682a55506b65ec5514a8e0a5abf6294dc728e909385d449ae1c388e62f83cea9bb89'
30 | 'SKIP')
31 | validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key)
32 | 'E3FF2839C048B25C084DEBE9B26995E310250568') # Łukasz Langa (GPG langa.pl)
33 |
34 | prepare() {
35 | cd Python-$pkgver
36 |
37 | # https://bugs.python.org/issue34587
38 | sed -i -e 's|testCongestion|disabled_&|' Lib/test/test_socket.py
39 |
40 | # FS#23997
41 | sed -i -e 's|^#.* /usr/local/bin/python|#!/usr/bin/python|' Lib/cgi.py
42 |
43 | # Speed up LTO
44 | sed -i -e 's|-flto |-flto=4 |g' configure configure.ac
45 |
46 | # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
47 | # rather than copies shipped in the tarball
48 | rm -r Modules/expat
49 | rm -r Modules/_ctypes/{darwin,libffi}*
50 | rm -r Modules/_decimal/libmpdec
51 | }
52 |
53 | build() {
54 | cd Python-$pkgver
55 |
56 | # PGO should be done with -O3
57 | # Also included the -fno-semantic-interposition optimization:
58 | # https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
59 | CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition"
60 | LDFLAGS="$LDFLAGS -fno-semantic-interposition"
61 |
62 | # Disable bundled pip & setuptools
63 | ./configure --prefix=/usr \
64 | -enable-shared \
65 | --with-computed-gotos \
66 | --with-lto \
67 | --enable-ipv6 \
68 | --with-system-expat \
69 | --with-dbmliborder=gdbm:ndbm \
70 | --with-system-ffi \
71 | --with-system-libmpdec \
72 | --enable-loadable-sqlite-extensions \
73 | --without-ensurepip \
74 | --with-tzpath=/usr/share/zoneinfo \
75 | ax_cv_c_float_words_bigendian=no
76 |
77 | # --enable-optimizations \
78 |
79 | # Obtain next free server number for xvfb-run; this even works in a chroot environment.
80 | export servernum=99
81 | while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
82 |
83 | LC_CTYPE=en_US.UTF-8 xvfb-run -s '-screen 0 1280x720x24 -ac +extension GLX' -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
84 | }
85 |
86 |
87 | #check() {
88 | # # test_tk and test_ttk_guionly: https://bugs.python.org/issue43139
89 | #
90 | # cd Python-${pkgver}
91 | #
92 | # # Obtain next free server number for xvfb-run; this even works in a chroot environment.
93 | # export servernum=99
94 | # while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
95 | #
96 | # LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \
97 | # LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1920x1080x16 -ac +extension GLX" -a -n "$servernum" \
98 | # "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall -x test_tk -x test_ttk_guionly
99 | #}
100 |
101 | package() {
102 | cd Python-${pkgver}
103 |
104 | # Hack to avoid building again
105 | sed -i 's/^all:.*$/all: build_all/' Makefile
106 |
107 | # PGO should be done with -O3
108 | CFLAGS="${CFLAGS/-O2/-O3}"
109 |
110 | make DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install
111 |
112 | # some useful "stuff" FS#46146
113 | install -dm 755 "$pkgdir"/usr/lib/python$_pybasever/Tools/{i18n,scripts}
114 | install -m 755 Tools/i18n/{msgfmt,pygettext}.py "$pkgdir"/usr/lib/python$_pybasever/Tools/i18n/
115 | install -m 755 Tools/scripts/{README,*py} "$pkgdir"/usr/lib/python$_pybasever/Tools/scripts/
116 |
117 | # fix conflicts with python
118 | rm -f "$pkgdir"/usr/bin/pyvenv{,3}
119 | rm -f "$pkgdir"/usr/bin/2to3{,3}
120 | rm -f "$pkgdir"/usr/bin/idle{,3}
121 | rm -f "$pkgdir"/usr/bin/pydoc{,3}
122 | rm -f "$pkgdir"/usr/bin/python{,3}
123 | rm -f "$pkgdir"/usr/bin/python{,3}-config
124 | rm -f "$pkgdir"/usr/lib/libpython3.so
125 | rm -f "$pkgdir"/usr/lib/pkgconfig/python3{,-embed}.pc
126 | rm -f "$pkgdir"/usr/share/man/man1/python3.1
127 |
128 | # License
129 | install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
130 | }
131 |
--------------------------------------------------------------------------------
/sync-repo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | MAGENTA='\e[35m'
4 | BOLD='\e[1m'
5 | RESET='\e[0m'
6 |
7 | msg() {
8 | echo -e "$MAGENTA$BOLD$@$RESET"
9 | }
10 |
11 | sync() {
12 | rsync -a --delete --progress $@
13 | }
14 |
15 | msg 'Syncing local repo with remote...'
16 | sync homedir:public_html/python-repo/ repo/
17 |
18 | msg 'Deleting old packages...'
19 | for package in python*; do
20 | for pkg in repo/$package-*.*.pkg.tar.zst; do
21 | if [ -f $pkg ]; then
22 | rm -rf pkg{,.sig}
23 | echo "Removed $pkg"
24 | fi
25 | done
26 | done
27 |
28 | msg 'Copying packages to repo...'
29 | sync */*.pkg.tar.zst repo/
30 |
31 | msg 'Signing packages...'
32 | for file in repo/*.pkg.tar.zst; do
33 | gpg --batch --detach-sign --no-armor --output $file.sig $file 2>/dev/null
34 | echo "Signed $file."
35 | done
36 |
37 | msg 'Updating repo...'
38 | repo-add \
39 | --new \
40 | --prevent-downgrade \
41 | --include-sigs \
42 | --sign \
43 | repo/python.db.tar.gz */*.pkg.tar.zst
44 | rm -rf repo/*.old{,.sig}
45 |
46 | msg 'Syncing remote repo with local...'
47 | sync repo/ homedir:public_html/python-repo/
48 |
--------------------------------------------------------------------------------