summaryrefslogtreecommitdiff
path: root/libraries/tre/tre.SlackBuild
diff options
context:
space:
mode:
authorBenjamin Trigona-Harany <bosth@alumni.sfu.ca>2018-03-15 23:39:57 -0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-03-17 08:51:43 +0700
commitabb617ff62cffc1ec67f152f2f939621f439f807 (patch)
tree0f5bb1f945470969ac8b6262678ef50091ae12d8 /libraries/tre/tre.SlackBuild
parenta453472a1a3c2f235606b053e6f8880e88268fe1 (diff)
downloadslackbuilds-abb617ff62cffc1ec67f152f2f939621f439f807.tar.gz
libraries/tre: Add Python 3 support.
Signed-off-by: Benjamin Trigona-Harany <bosth@alumni.sfu.ca>
Diffstat (limited to 'libraries/tre/tre.SlackBuild')
-rw-r--r--libraries/tre/tre.SlackBuild30
1 files changed, 20 insertions, 10 deletions
diff --git a/libraries/tre/tre.SlackBuild b/libraries/tre/tre.SlackBuild
index 504818c7c1..54560e0c0c 100644
--- a/libraries/tre/tre.SlackBuild
+++ b/libraries/tre/tre.SlackBuild
@@ -29,7 +29,7 @@ TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -40,8 +40,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -60,14 +60,14 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
./configure \
@@ -78,14 +78,24 @@ CFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--build=$ARCH-slackware-linux
-make
make install-strip DESTDIR=$PKG
+cp -r python python3
cd python
CFLAGS="-I$PKG/usr/include" \
LDFLAGS="-L$PKG/usr/lib$LIBDIRSUFFIX" \
python setup.py install --root=$PKG
-cd ..
+cd -
+
+if $(python3 -c 'import sys' 2>/dev/null); then
+ cd python3
+ # Python 3 support from https://github.com/ahomansikka/tre/commit/d6a0220
+ patch -p0 < $CWD/python3.patch
+ CFLAGS="-I$PKG/usr/include" \
+ LDFLAGS="-L$PKG/usr/lib$LIBDIRSUFFIX" \
+ python3 setup.py install --root=$PKG
+ cd -
+fi
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done