aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2023-01-31 17:30:21 +0000
committerpsykose <alice@ayaya.dev>2023-01-31 18:30:21 +0100
commit40d10fdde2b1181d6c3a680ab846855f3e078e47 (patch)
treee3be802abc2c2fb0c7e7ab379acf9daa7ad88ca4
parent478728f328e2508f9136fa3d5e49b3d3c0890e0a (diff)
downloadaports-40d10fdde2b1181d6c3a680ab846855f3e078e47.tar.gz
aports-40d10fdde2b1181d6c3a680ab846855f3e078e47.tar.bz2
aports-40d10fdde2b1181d6c3a680ab846855f3e078e47.tar.xz
main/python3: add system site-packages guard against pip installs
supported by pip 23
-rw-r--r--main/python3/APKBUILD8
-rw-r--r--main/python3/externally-managed9
2 files changed, 16 insertions, 1 deletions
diff --git a/main/python3/APKBUILD b/main/python3/APKBUILD
index 6e0887305e3..f4061a70fe5 100644
--- a/main/python3/APKBUILD
+++ b/main/python3/APKBUILD
@@ -4,7 +4,7 @@ pkgname=python3
# the python3-tkinter's pkgver needs to be synchronized with this.
pkgver=3.11.1
_basever="${pkgver%.*}"
-pkgrel=2
+pkgrel=3
pkgdesc="A high-level scripting language"
url="https://www.python.org/"
arch="all"
@@ -37,6 +37,7 @@ makedepends="
source="https://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz
fix-xattrs-glibc.patch
musl-find_library.patch
+ externally-managed
"
options="net" # Required for tests
builddir="$srcdir/Python-$pkgver"
@@ -175,6 +176,10 @@ package() {
make -j1 DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install maninstall
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
rm -r "$pkgdir"/usr/bin/idle* "$pkgdir"/usr/lib/python*/idlelib \
"$pkgdir"/usr/lib/python*/tkinter
@@ -215,4 +220,5 @@ sha512sums="
5edd70c881e083c96199c60471f18f9ebc4c97a2d45dc66f89e16d7c3638d8a5d2cbf2e84b1be3d7f1178ce9f7fa4197884385c1ee3618ff66a538f872f318ed Python-3.11.1.tar.xz
fe123dd871f7a3fa868c499a957b94f1d815a1e1de964aaff1116c579defd4d9d1e9b7eb418cf114b169b97426ed603bf4b1e61b45ec483df06abe988c6a30ee fix-xattrs-glibc.patch
ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch
+af687985b29405b00d645034d33691b9717e4c59a1d13e711ca044575667013f7fd6849f293ada69769456e287eb0bfd362f6aabd307d59c2e276680a70b19da externally-managed
"
diff --git a/main/python3/externally-managed b/main/python3/externally-managed
new file mode 100644
index 00000000000..d01dcde20e6
--- /dev/null
+++ b/main/python3/externally-managed
@@ -0,0 +1,9 @@
+[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