summaryrefslogtreecommitdiffstats
path: root/python/pypy/pypy.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'python/pypy/pypy.SlackBuild')
-rw-r--r--python/pypy/pypy.SlackBuild41
1 files changed, 30 insertions, 11 deletions
diff --git a/python/pypy/pypy.SlackBuild b/python/pypy/pypy.SlackBuild
index 7393156ba7..57b2b9f890 100644
--- a/python/pypy/pypy.SlackBuild
+++ b/python/pypy/pypy.SlackBuild
@@ -1,7 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for pypy
+# Copyright 2022 Yth | Pont-en-Royans, France | yth@ythogtha.org
# Copyright 2012-2017 Audrius Kažukauskas <audrius@neutrino.lt>
# All rights reserved.
#
@@ -22,10 +23,14 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=pypy
-VERSION=${VERSION:-5.9}
+VERSION=${VERSION:-7.3.16}
+SRCNAM=pypy2.7
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,11 +40,19 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+PARCH="32"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
@@ -49,6 +62,10 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+ PARCH="64"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
@@ -59,9 +76,9 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION-linux_$ARCH-portable
-tar xvf $CWD/$PRGNAM-$VERSION-linux_$ARCH-portable.tar.bz2
-cd $PRGNAM-$VERSION-linux_$ARCH-portable
+rm -rf $SRCNAM-v$VERSION-linux$PARCH
+tar xvf $CWD/$SRCNAM-v$VERSION-linux$PARCH.tar.bz2
+cd $SRCNAM-v$VERSION-linux$PARCH
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -69,17 +86,19 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# Use os.path.realpath to resolve symlink in the path.
-sed -i 's/abspath/realpath/' bin/virtualenv-pypy
-
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION
cp -a * $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION
+chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/*.debug
+
+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
# Create symlinks to pypy executables.
mkdir -p $PKG/usr/bin
( cd $PKG/usr/bin
ln -sf ../lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/pypy pypy
- ln -sf ../lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/virtualenv-pypy virtualenv-pypy
+ ln -sf ../lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/pypy2 pypy2
+ ln -sf ../lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/pypy2.7 pypy2.7
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -90,4 +109,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE