summaryrefslogtreecommitdiffstats
path: root/source/l/aom
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/aom')
-rwxr-xr-xsource/l/aom/aom.SlackBuild123
-rwxr-xr-xsource/l/aom/fetch-aom.sh52
-rw-r--r--source/l/aom/slack-desc19
3 files changed, 194 insertions, 0 deletions
diff --git a/source/l/aom/aom.SlackBuild b/source/l/aom/aom.SlackBuild
new file mode 100755
index 000000000..b56ea9d40
--- /dev/null
+++ b/source/l/aom/aom.SlackBuild
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# Copyright 2018-2023 Andrew Strong, Blue Mountains, Australia
+# Copyright 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=aom
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i686 ;;
+ 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:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+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 "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
+
+if [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=pentium4 -mtune=generic"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -march=x86-64 -mtune=generic -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -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 {} \+
+
+# Configure, build, and install:
+mkdir cmake-build
+cd cmake-build
+ cmake \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX="$LIBDIRSUFFIX" \
+ -DDOC_INSTALL_DIR="doc" \
+ -DENABLE_NASM=1 \
+ -DENABLE_DOCS=0 \
+ -DBUILD_SHARED_LIBS=1 \
+ -DENABLE_TESTS=0 \
+ .. || exit 1
+ make $NUMJOBS || make || exit 1
+ make install DESTDIR=$PKG || exit 1
+cd ..
+
+# No static libraries:
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/lib*.a
+
+# 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
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS* CHANGELOG* LICENSE* PATENTS* README* \
+ doc/AlgorithmDescription* \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+# If there's a CHANGELOG file, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r CHANGELOG ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat CHANGELOG | head -n 1000 > $DOCSDIR/CHANGELOG
+ touch -r CHANGELOG $DOCSDIR/CHANGELOG
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/source/l/aom/fetch-aom.sh b/source/l/aom/fetch-aom.sh
new file mode 100755
index 000000000..66fdc3e05
--- /dev/null
+++ b/source/l/aom/fetch-aom.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# Copyright 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=aom
+
+# Pull a stable branch + patches
+BRANCH=${1:-3.10.0}
+
+# Clear download area:
+rm -rf ${PKGNAM}
+
+# Clone repository:
+git clone https://aomedia.googlesource.com/aom
+
+# checkout $BRANCH:
+( cd ${PKGNAM}
+ git checkout v${BRANCH} || exit 1
+)
+
+HEADISAT="$( cd ${PKGNAM} && git log -1 --format=%h )"
+DATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%Y%m%d )"
+LONGDATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%c )"
+# Cleanup. We're not packing up the whole git repo.
+( cd ${PKGNAM} && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
+mv ${PKGNAM} ${PKGNAM}-${BRANCH}
+tar cf ${PKGNAM}-${BRANCH}.tar ${PKGNAM}-${BRANCH}
+plzip -9 -f ${PKGNAM}-${BRANCH}.tar
+rm -rf ${PKGNAM}-${BRANCH}
+touch -d "$LONGDATE" ${PKGNAM}-${BRANCH}.tar.lz
+echo
+echo "${PKGNAM} branch $BRANCH with HEAD at $HEADISAT packaged as ${PKGNAM}-${BRANCH}.tar.lz"
+echo
diff --git a/source/l/aom/slack-desc b/source/l/aom/slack-desc
new file mode 100644
index 000000000..b87dcaf2a
--- /dev/null
+++ b/source/l/aom/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+aom: aom (AV1 video codec library)
+aom:
+aom: AOMedia Video 1 (AV1) is an open and royalty free video encoding
+aom: format optimized for the Internet and the successor of VP9. aom is the
+aom: reference encoder and decoder implementation published by the Alliance
+aom: for Open Media.
+aom:
+aom: Homepage: https://aomedia.org/av1/
+aom:
+aom:
+aom: