summaryrefslogtreecommitdiffstats
path: root/source/l/zstd/zstd.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/zstd/zstd.SlackBuild')
-rwxr-xr-xsource/l/zstd/zstd.SlackBuild31
1 files changed, 18 insertions, 13 deletions
diff --git a/source/l/zstd/zstd.SlackBuild b/source/l/zstd/zstd.SlackBuild
index bc90631b4..e9eb64503 100755
--- a/source/l/zstd/zstd.SlackBuild
+++ b/source/l/zstd/zstd.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright 2018 Eric Hameleers, Eindhoven, Netherlands
-# Copyright 2018 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2018, 2023 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
# Redistribution and use of this script, with or without modification, is
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=zstd
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
@@ -85,7 +85,6 @@ rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
cd $PKGNAM-$VERSION || exit 1
-zcat $CWD/zstd.dont.link.pzstd.to.static.libzstd.a.diff.gz | patch -p1 --verbose || exit 1
# Make sure ownerships and permissions are sane:
chown -R root:root .
@@ -95,18 +94,24 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
-# Compile it:
+# Compile and install:
+mkdir build/cmake/build
+cd build/cmake/build
+cmake \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX="$LIBDIRSUFFIX" \
+ -DDOC_INSTALL_DIR="doc" \
+ -DMAN_INSTALL_DIR=/usr/man/man1 \
+ .. || exit 1
make $NUMJOBS CFLAGS="$SLKCFLAGS" || exit 1
-make $NUMJOBS CFLAGS="$SLKCFLAGS" -C contrib/pzstd || exit 1
+make install DESTDIR=$PKG || exit 1
+cd ../../..
-# Install it:
-make \
- $NUMJOBS \
- prefix=/usr \
- libdir=/usr/lib${LIBDIRSUFFIX} \
- mandir=/usr/man \
- DESTDIR=$PKG \
- install || exit 1
+# Compile and install pzstd:
+zcat $CWD/zstd.dont.link.pzstd.to.static.libzstd.a.diff.gz | patch -p1 --verbose || exit 1
+make $NUMJOBS CFLAGS="$SLKCFLAGS" -C contrib/pzstd || exit 1
install -Dm755 contrib/pzstd/pzstd $PKG/usr/bin/pzstd || exit 1
# Don't ship static library: