academic/wxMaxima: Use DESTDIR properly.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-06-27 02:58:04 -04:00 committed by Willy Sudiarto Raharjo
parent 76828fdad0
commit 37a52401c5
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -22,6 +22,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20230627 bkw: Modified by SlackBuilds.org, BUILD=2:
# - use DESTDIR properly, to avoid baking $PKG into the binary.
# Mar 2021 - updated for v. 21.01, Judah Milgram, milgram at cgpp com # Mar 2021 - updated for v. 21.01, Judah Milgram, milgram at cgpp com
cd $(dirname $0) ; CWD=$(pwd) cd $(dirname $0) ; CWD=$(pwd)
@ -29,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=wxMaxima PRGNAM=wxMaxima
SRCNAM=wxmaxima SRCNAM=wxmaxima
VERSION=${VERSION:-21.01.0} VERSION=${VERSION:-21.01.0}
BUILD=${BUILD:-1} BUILD=${BUILD:-2}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz} PKGTYPE=${PKGTYPE:-tgz}
@ -41,9 +44,6 @@ if [ -z "$ARCH" ]; then
esac esac
fi fi
# 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 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0 exit 0
@ -55,16 +55,12 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686" SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686" SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC" SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else else
SLKCFLAGS="-O2" SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi fi
set -e set -e
@ -78,9 +74,9 @@ cd $SRCNAM-Version-$VERSION
chown -R root:root . chown -R root:root .
find -L . \ find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \ -o -perm 511 \) -exec chmod 755 {} + -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -o -perm 440 -o -perm 400 \) -exec chmod 644 {} +
BUILDDIR=build BUILDDIR=build
mkdir -p $BUILDDIR mkdir -p $BUILDDIR
@ -88,11 +84,11 @@ mkdir -p $BUILDDIR
export PATH="/opt/cmake-202x/bin:$PATH" export PATH="/opt/cmake-202x/bin:$PATH"
cmake \ cmake \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=$PKG/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-G Ninja -S . -B $BUILDDIR -G Ninja -S . -B $BUILDDIR
cmake --build $BUILDDIR cmake --build $BUILDDIR
cmake --install $BUILDDIR DESTDIR=$PKG cmake --install $BUILDDIR
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ 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 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true