#!/bin/sh # Slackware build script for espeak # Written by B. Watson (yalhcru@gmail.com) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20200822 bkw: # - BUILD=3 # - Fix PORTAUDIO=no builds, thanks to timsoft for reporting this. # 20191218 bkw: # - BUILD=2 # - Update man page (still using the one from Debian). # - It turns out espeak supports PulseAudio, so that's now the default. # - Remove portaudio from REQUIRES. # - Add PULSE and PORTAUDIO environment variables, update README. # - Simplify the script (unfortunately it had to get more complex # again to support the new variables). PRGNAM=espeak VERSION=${VERSION:-1.48.04} BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e # Support old WAVONLY variable, but don't mention it in README. if [ "${WAVONLY:-no}" = "yes" ]; then PULSE=no PORTAUDIO=no fi # Preemptively support -current's pure-alsa-system: if pulseaudio's # not installed (it normally is on 14.2), just build without it. PULSE="${PULSE:-yes}" pkg-config --exists libpulse || PULSE=no case "${PORTAUDIO:-auto}" in yes) if ! pkg-config --exists portaudio-2.0; then cat < $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # Man page from Debian mkdir -p $PKG/usr/man/man1 gzip -9c $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz mkdir -p $PKG/install sed "s,@DRIVERS@,$DRIVERS," \ $CWD/slack-desc \ > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}