summaryrefslogtreecommitdiffstats
path: root/xvidcore
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2021-12-29 14:27:54 +0000
committer Eric Hameleers <alien@slackware.com>2021-12-29 14:27:54 +0000
commit4a541bc27f0a4e0183531ee4258c6707ecc19175 (patch)
tree0b9714e7a4f550793fb7e70da5530cc09a3e99b1 /xvidcore
parentea3490e6688f7e2297d84942b9fd29925818a30a (diff)
downloadasb-4a541bc27f0a4e0183531ee4258c6707ecc19175.tar.gz
asb-4a541bc27f0a4e0183531ee4258c6707ecc19175.tar.xz
xvidcore: updated for Slackware 15.0
Diffstat (limited to 'xvidcore')
-rwxr-xr-xxvidcore/build/xvidcore.SlackBuild78
1 files changed, 33 insertions, 45 deletions
diff --git a/xvidcore/build/xvidcore.SlackBuild b/xvidcore/build/xvidcore.SlackBuild
index c772a6b0..b98d077f 100755
--- a/xvidcore/build/xvidcore.SlackBuild
+++ b/xvidcore/build/xvidcore.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright 2009, 2010, 2011, 2013 Eric Hameleers, Eindhoven, NL
+# Copyright 2009, 2010, 2011, 2013, 2021 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -27,7 +27,7 @@
# By: Eric Hameleers <alien@slackware.com>
# For: xvidcore
# Descr: MPEG-4 video codec
-# URL: http://www.xvid.org/
+# URL: https://www.xvid.com/
# Needs:
# Changelog:
# 1.2.1-1: 19/May/2009 by Eric Hameleers <alien@slackware.com>
@@ -40,11 +40,13 @@
# * Rebuilt for Slackware 13.1.
# 1.3.1-1: 11/may/2011 by Eric Hameleers <alien@slackware.com>
# * Update.
-# 1.3.2-1: 15/ocy/2013 by Eric Hameleers <alien@slackware.com>
+# 1.3.2-1: 15/oct/2013 by Eric Hameleers <alien@slackware.com>
# * Update.
+# 1.3.7-1: 29/dec/2021 by Eric Hameleers <alien@slackware.com>
+# * Updated for Slackware 15.0.
#
# Run 'sh xvidcore.SlackBuild' to build a Slackware package.
-# The package (.tgz) and .txt file as well as build logs are created in /tmp .
+# The package (.txz) and .txt file as well as build logs are created in /tmp .
# Install it using 'installpkg'.
#
# -----------------------------------------------------------------------------
@@ -52,9 +54,9 @@
# Set initial variables:
PRGNAM=xvidcore
-VERSION=${VERSION:-1.3.2}
+VERSION=${VERSION:-1.3.7}
BUILD=${BUILD:-1}
-NUMJOBS=${NUMJOBS:" -j4 "}
+NUMJOBS=${NUMJOBS:-" -j$(nproc) "}
TAG=${TAG:-alien}
DOCS="AUTHORS ChangeLog* CodingStyle LICENSE README TODO"
@@ -68,46 +70,36 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
-SRCURL="http://downloads.xvid.org/downloads/${PRGNAM}-${VERSION}.tar.gz"
+SRCURL="https://downloads.xvid.com/downloads/${PRGNAM}-${VERSION}.tar.gz"
##
## --- with a little luck, you won't have to edit below this point --- ##
##
# Automatically determine the architecture we're building on:
-MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i486 ;;
- armv7hl) export ARCH=$MARCH ;;
- armv6hl) export ARCH=$MARCH ;;
- arm*) export ARCH=arm ;;
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
+ *) ARCH=$(uname -m) ;;
esac
+ export ARCH
fi
+# Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
case "$ARCH" in
- i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ i?86) SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHOPTS=""
;;
- x86_64) SLKCFLAGS="-O2 -fPIC -DPIC"
+ x86_64) SLKCFLAGS="-O2 -fPIC"
SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
- #ARCHOPTS="--disable-assembly"
- ARCHOPTS=""
;;
armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHOPTS=""
;;
- armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHOPTS=""
- ;;
- *) SLKCFLAGS="-O2"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ARCHOPTS=""
+ *) SLKCFLAGS=${SLKCFLAGS:-"-O2"}
+ SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
;;
esac
@@ -116,6 +108,7 @@ case "$ARCH" in
*) TARGET=$ARCH-slackware-linux ;;
esac
+
# Exit the script on errors:
set -e
trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
@@ -138,12 +131,13 @@ rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
# Source file availability:
if ! [ -f ${SOURCE} ]; then
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi
if ! [ "x${SRCURL}" == "x" ]; then
- # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
- [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
- echo "Source '$(basename ${SOURCE})' not available yet..."
echo "Will download file to $(dirname $SOURCE)"
- wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
+ wget --no-check-certificate -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
mv -f "${SOURCE}" "${SOURCE}".FAIL
@@ -172,7 +166,7 @@ tar -xvf ${SOURCE}
mv ${PRGNAM} ${PRGNAM}-${VERSION}
cd ${PRGNAM}-${VERSION}
chown -R root:root .
-chmod -R u+w,go+r-w,a+X-s .
+chmod -R u+w,go+r-w,a+rX-st .
echo Building ...
cd build/generic
@@ -180,7 +174,6 @@ cd build/generic
CXXFLAGS="$SLKCFLAGS" \
CFLAGS="$SLKCFLAGS" \
./configure \
- ${ARCHOPTS} \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
@@ -194,12 +187,6 @@ cd build/generic
make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log
cd -
-# Fix missing symlink:
-( cd $PKG/usr/lib${LIBDIRSUFFIX}
- ln -s $(ls libxvidcore.so.*) libxvidcore.so
- ldconfig -n .
-)
-
# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
@@ -213,10 +200,11 @@ if [ -d $PKG/usr/man ]; then
for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi
-# Strip binaries:
-find $PKG | xargs file | grep -e "executable" -e "shared object" \
- | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find $PKG | xargs file | grep -e "current ar archive" \
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+# Strip binaries (if any):
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Add a package description:
@@ -225,9 +213,9 @@ cat $SRCDIR/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
-md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz.md5
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt