Skip to content
Snippets Groups Projects
Commit 40d10fdd authored by alice's avatar alice
Browse files

main/python3: add system site-packages guard against pip installs

supported by pip 23
parent 478728f3
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ pkgname=python3 ...@@ -4,7 +4,7 @@ pkgname=python3
# the python3-tkinter's pkgver needs to be synchronized with this. # the python3-tkinter's pkgver needs to be synchronized with this.
pkgver=3.11.1 pkgver=3.11.1
_basever="${pkgver%.*}" _basever="${pkgver%.*}"
pkgrel=2 pkgrel=3
pkgdesc="A high-level scripting language" pkgdesc="A high-level scripting language"
url="https://www.python.org/" url="https://www.python.org/"
arch="all" arch="all"
...@@ -37,6 +37,7 @@ makedepends=" ...@@ -37,6 +37,7 @@ makedepends="
source="https://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz source="https://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz
fix-xattrs-glibc.patch fix-xattrs-glibc.patch
musl-find_library.patch musl-find_library.patch
externally-managed
" "
options="net" # Required for tests options="net" # Required for tests
builddir="$srcdir/Python-$pkgver" builddir="$srcdir/Python-$pkgver"
...@@ -175,6 +176,10 @@ package() { ...@@ -175,6 +176,10 @@ package() {
make -j1 DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install maninstall make -j1 DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install maninstall
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
local pyver="${pkgver%.*}"
install -Dm644 "$srcdir"/externally-managed \
"$pkgdir"/usr/lib/python$pyver/EXTERNALLY-MANAGED
# those are provided by python3-tkinter # those are provided by python3-tkinter
rm -r "$pkgdir"/usr/bin/idle* "$pkgdir"/usr/lib/python*/idlelib \ rm -r "$pkgdir"/usr/bin/idle* "$pkgdir"/usr/lib/python*/idlelib \
"$pkgdir"/usr/lib/python*/tkinter "$pkgdir"/usr/lib/python*/tkinter
...@@ -215,4 +220,5 @@ sha512sums=" ...@@ -215,4 +220,5 @@ sha512sums="
5edd70c881e083c96199c60471f18f9ebc4c97a2d45dc66f89e16d7c3638d8a5d2cbf2e84b1be3d7f1178ce9f7fa4197884385c1ee3618ff66a538f872f318ed Python-3.11.1.tar.xz 5edd70c881e083c96199c60471f18f9ebc4c97a2d45dc66f89e16d7c3638d8a5d2cbf2e84b1be3d7f1178ce9f7fa4197884385c1ee3618ff66a538f872f318ed Python-3.11.1.tar.xz
fe123dd871f7a3fa868c499a957b94f1d815a1e1de964aaff1116c579defd4d9d1e9b7eb418cf114b169b97426ed603bf4b1e61b45ec483df06abe988c6a30ee fix-xattrs-glibc.patch fe123dd871f7a3fa868c499a957b94f1d815a1e1de964aaff1116c579defd4d9d1e9b7eb418cf114b169b97426ed603bf4b1e61b45ec483df06abe988c6a30ee fix-xattrs-glibc.patch
ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch
af687985b29405b00d645034d33691b9717e4c59a1d13e711ca044575667013f7fd6849f293ada69769456e287eb0bfd362f6aabd307d59c2e276680a70b19da externally-managed
" "
[externally-managed]
Error=
The system-wide Python installation in Alpine is managed
by using the system package manager (apk).
It appears you are installing to this system-wide location using
a different package manager. Please use a virtualenv instead:
python3 -m venv /path/to/venv
. /path/to/venv/bin/activate
pip install mypackage
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment