summaryrefslogtreecommitdiffstats
path: root/graphics/mozjpeg/mozjpeg.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/mozjpeg/mozjpeg.SlackBuild')
-rw-r--r--graphics/mozjpeg/mozjpeg.SlackBuild98
1 files changed, 56 insertions, 42 deletions
diff --git a/graphics/mozjpeg/mozjpeg.SlackBuild b/graphics/mozjpeg/mozjpeg.SlackBuild
index 8452093290..a175e3cd8f 100644
--- a/graphics/mozjpeg/mozjpeg.SlackBuild
+++ b/graphics/mozjpeg/mozjpeg.SlackBuild
@@ -2,28 +2,23 @@
# Slackware build script for mozjpeg
-# Originally written by:
-# Ryan P.C. McQuen | Everett, WA | <email removed>
+# Originally written by Ryan P.C. McQuen
+# Now maintained by B. Watson (urchlay@slackware.uk)
-# Now maintained by B. Watson (yalhcru@gmail.com)
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version, with the following exception:
-# the text of the GPL license may be omitted.
+# 20240317 bkw: update for v4.1.5.
+# 20230912 bkw: update for v4.1.4.
-# This program is distributed in the hope that it will be useful, but
-# without any warranty; without even the implied warranty of
-# merchantability or fitness for a particular purpose. Compiling,
-# interpreting, executing or merely reading the text of the program
-# may result in lapses of consciousness and/or very being, up to and
-# including the end of all existence and the Universe as we know it.
-# See the GNU General Public License for more details.
+# 20230710 bkw:
+# - update for v4.1.3.
+# - fail if API in env is bad (not blank, 6b, 7, or 8).
+# - add zulu-openjdk11 and 17 to JDK search.
+# - fail if JAVA=yes but we can't find a JDK.
-# You may have received a copy of the GNU General Public License along
-# with this program (most likely, a file named COPYING). If not, see
-# <http://www.gnu.org/licenses/>.
+# 20230105 bkw: update for v4.1.1, fix doc symlink.
+# 20220318 bkw: fix 32-bit lib vs. lib32 install path mess.
+# 20210909 bkw: relicense as WTFPL, w/permission from original author.
# 20210310 bkw: update for v4.0.3.
# - upstream switched from autoconf to cmake, so this script can't
@@ -59,7 +54,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=mozjpeg
-VERSION=${VERSION:-4.0.3}
+VERSION=${VERSION:-4.1.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -72,9 +67,6 @@ if [ -z "$ARCH" ]; then
esac
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
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -100,23 +92,24 @@ fi
set -e
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
-chown -R root:root .
-find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
- \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-
ARGS=""
+# 20230710 bkw: sanity-check the API environment variable.
+API="${API:-6b}"
+case "$API" in
+ 6b) ARGS="" ;; # this is the default.
+ 7) ARGS="-DWITH_JPEG7=TRUE " ;;
+ 8) ARGS="-DWITH_JPEG8=TRUE " ;;
+ *) echo "*** $0: invalid API. must be one of: 6b (default), 7, 8."
+ exit 1 ;;
+esac
+
# JAVA=yes only tested with openjdk8. We source the profile.d script
# here in case someone's *just* installed jdk|openjdk, so they won't
# have to log out & back in to get this built. This mostly helps out
# sbopkg users.
JAVA="${JAVA:-no}"
+javafound=no
if [ "$JAVA" = "yes" ]; then
ARGS+="-DWITH_JAVA=TRUE "
@@ -126,17 +119,29 @@ if [ "$JAVA" = "yes" ]; then
# sure it actually matters that much ("write once, run anywhere" should
# mean a .jar built with openjdk will run with Oracle's jdk, right? But
# there's JNI (native code) involved...)
- for i in jdk openjdk8 openjdk7 openjdk6; do
+ for i in jdk openjdk8 openjdk7 openjdk6 zulu-openjdk{6,8,11,17}; do
if [ -x /etc/profile.d/$i.sh ]; then
+ javafound="$i"
source /etc/profile.d/$i.sh
break
fi
done
+ if [ "$javafound" = "no" ]; then
+ echo "*** $0: you set JAVA=yes, but I can't find a JDK to build with"
+ exit 1
+ fi
+ javafound="yes ($javafound)"
fi
-API="${API:-6b}"
-[ "$API" = "7" ] && ARGS+="-DWITH_JPEG7=TRUE "
-[ "$API" = "8" ] && ARGS+="-DWITH_JPEG8=TRUE "
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
mkdir -p build
cd build
@@ -154,18 +159,27 @@ cd build
make install/strip DESTDIR=$PKG
cd ..
+# Grr.
+if [ -e $PKG/opt/$PRGNAM/lib32 ]; then
+ cd $PKG/opt/$PRGNAM
+ mv lib32 lib
+ ln -s lib lib32
+ cd -
+fi
+
# Slackware has these man pages already.
rm -rf $PKG/opt/$PRGNAM/man
# most of the docs are installed in /opt already, but not all.
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKG/usr/doc
-mv $PKG/opt/$PRGNAM/doc $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/opt/$PRGNAM/doc $PKGDOC
rm -f CMakeLists.txt BUILDING.* jconfig.txt # do not want
-cp -a *.txt *.md tjexample.c doc/html $PKG/usr/doc/$PRGNAM-$VERSION
-ln -s ../../../usr/doc/$PRGNAM-$VERSION $PKG/opt/$PRGNAM/doc
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cp -a *.txt *.md tjexample.c doc/html $PKGDOC
+ln -s ../../usr/doc/$PRGNAM-$VERSION $PKG/opt/$PRGNAM/doc
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
-[ "$JAVA" = "yes" ] && cp -a java/doc $PKG/usr/doc/$PRGNAM-$VERSION/javadoc
+[ "$JAVA" = "yes" ] && cp -a java/doc $PKGDOC/javadoc
# 20210312 bkw: profile script is new with v4.0.x. It's installed without +x
# permission (see README).
@@ -177,7 +191,7 @@ sed -i '/^Libs:/s|$| -lm -Wl,-rpath,${libdir}|' \
$PKG/opt/$PRGNAM/lib$LIBDIRSUFFIX/pkgconfig/*.pc
mkdir -p $PKG/install
-sed -e "s,@API@,$API," -e "s,@JAVA@,$JAVA," \
+sed -e "s,@API@,$API," -e "s,@JAVA@,$javafound," \
$CWD/slack-desc > \
$PKG/install/slack-desc