summaryrefslogtreecommitdiffstats
path: root/development/python3-hylang
diff options
context:
space:
mode:
author Andrew Clemons2023-12-03 12:45:31 +0100
committer Willy Sudiarto Raharjo2023-12-09 01:50:06 +0100
commita21cd2456a561a80a305c6e8cb0b7e6fb76290ea (patch)
treee691e7df493910bc02ce38e1dc504b67b965c0fa /development/python3-hylang
parent511c7f7e87dafb1fe998cfd8c25971a8a4735260 (diff)
downloadslackbuilds-a21cd2456a561a80a305c6e8cb0b7e6fb76290ea.tar.gz
development/python3-hylang: Avoid hard-coded python version.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/python3-hylang')
-rw-r--r--development/python3-hylang/python3-hylang.SlackBuild12
1 files changed, 7 insertions, 5 deletions
diff --git a/development/python3-hylang/python3-hylang.SlackBuild b/development/python3-hylang/python3-hylang.SlackBuild
index 8afd062cad..5f4c3bee32 100644
--- a/development/python3-hylang/python3-hylang.SlackBuild
+++ b/development/python3-hylang/python3-hylang.SlackBuild
@@ -88,12 +88,14 @@ find -L . \
python3 setup.py install --root=$PKG
rm -rf $PKG/usr/get_version
-rm $PKG/usr/lib${LIBDIRSUFFIX}/python3.9/site-packages/hy/core/__pycache__/util.cpython-39.pyc
-rm $PKG/usr/lib${LIBDIRSUFFIX}/python3.9/site-packages/hy/core/__pycache__/macros.cpython-39.pyc
-rm $PKG/usr/lib${LIBDIRSUFFIX}/python3.9/site-packages/hy/core/__pycache__/hy_repr.cpython-39.pyc
-rm $PKG/usr/lib${LIBDIRSUFFIX}/python3.9/site-packages/hy/__pycache__/reserved.cpython-39.pyc
-rm $PKG/usr/lib${LIBDIRSUFFIX}/python3.9/site-packages/hy/__pycache__/pyops.cpython-39.pyc
+PYTHONVER=$(python3 -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")')
+PYTHONVER_SHORT=${PYTHONVER//[.]/}
+rm $PKG/usr/lib${LIBDIRSUFFIX}/python$PYTHONVER/site-packages/hy/core/__pycache__/util.cpython-$PYTHONVER_SHORT.pyc
+rm $PKG/usr/lib${LIBDIRSUFFIX}/python$PYTHONVER/site-packages/hy/core/__pycache__/macros.cpython-$PYTHONVER_SHORT.pyc
+rm $PKG/usr/lib${LIBDIRSUFFIX}/python$PYTHONVER/site-packages/hy/core/__pycache__/hy_repr.cpython-$PYTHONVER_SHORT.pyc
+rm $PKG/usr/lib${LIBDIRSUFFIX}/python$PYTHONVER/site-packages/hy/__pycache__/reserved.cpython-$PYTHONVER_SHORT.pyc
+rm $PKG/usr/lib${LIBDIRSUFFIX}/python$PYTHONVER/site-packages/hy/__pycache__/pyops.cpython-$PYTHONVER_SHORT.pyc
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true