summaryrefslogtreecommitdiffstats
path: root/audio/sbagen
diff options
context:
space:
mode:
Diffstat (limited to 'audio/sbagen')
-rw-r--r--audio/sbagen/README6
-rw-r--r--audio/sbagen/no_inline_calcnow.diff30
-rw-r--r--audio/sbagen/sbagen.SlackBuild35
3 files changed, 58 insertions, 13 deletions
diff --git a/audio/sbagen/README b/audio/sbagen/README
index c8e27da632..bf2f5c0f43 100644
--- a/audio/sbagen/README
+++ b/audio/sbagen/README
@@ -8,8 +8,8 @@ To use this, pass NONFREE=yes option to SlackBuild script (requires
libvorbisidec).
READ the following documents to understand how this program works:
- * /usr/share/doc/sbagen-VERSION/theory.txt
- * /usr/share/doc/sbagen-VERSION/theory2.txt
- * /usr/share/doc/sbagen-VERSION/SBAGEN.txt
+ * /usr/doc/sbagen-$VERSION/theory.txt
+ * /usr/doc/sbagen-$VERSION/theory2.txt
+ * /usr/doc/sbagen-$VERSION/SBAGEN.txt
USE AND EXPERIMENT WITH THIS UTILITY AT YOUR OWN RISK!
diff --git a/audio/sbagen/no_inline_calcnow.diff b/audio/sbagen/no_inline_calcnow.diff
new file mode 100644
index 0000000000..a7042bd19d
--- /dev/null
+++ b/audio/sbagen/no_inline_calcnow.diff
@@ -0,0 +1,30 @@
+diff -Naur sbagen-1.4.5/sbagen.c sbagen-1.4.5.patched/sbagen.c
+--- sbagen-1.4.5/sbagen.c 2011-08-07 20:12:21.000000000 -0400
++++ sbagen-1.4.5.patched/sbagen.c 2022-03-22 22:02:03.585606715 -0400
+@@ -181,7 +181,7 @@
+ void warn(char *fmt, ...) ;
+ void * Alloc(size_t len) ;
+ char * StrDup(char *str) ;
+-inline int calcNow() ;
++int calcNow() ;
+ void loop() ;
+ void outChunk() ;
+ void corrVal(int ) ;
+@@ -1207,7 +1207,7 @@
+ time_ref_ms= 1000*tt->tm_sec + 60000*tt->tm_min + 3600000*tt->tm_hour;
+ }
+
+-inline int
++int
+ calcNow() {
+ struct timeval tv;
+ if (0 != gettimeofday(&tv, 0)) error("Can't get current time");
+@@ -1217,7 +1217,7 @@
+ #endif
+
+ #ifdef WIN_TIME
+-inline int
++int
+ calcNow() {
+ SYSTEMTIME st;
+ GetLocalTime(&st);
diff --git a/audio/sbagen/sbagen.SlackBuild b/audio/sbagen/sbagen.SlackBuild
index ad3d02e1c4..34602fbd21 100644
--- a/audio/sbagen/sbagen.SlackBuild
+++ b/audio/sbagen/sbagen.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for sbagen
@@ -22,10 +22,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220322 bkw: Modified by SlackBuilds.org: fix 32-bit build.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=sbagen
VERSION=${VERSION:-1.4.5}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
DOCS="COPYING.txt ChangeLog.txt README.txt SBAGEN.txt TODO.txt focus.txt focus2.txt holosync.txt theory.txt theory2.txt wave.txt"
BINNAME=${PRGNAM}-bin
@@ -36,7 +41,7 @@ RIVERSOUNDS="sbagen-river-1.4.1.tgz"
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486
+ i?86) ARCH=i586
;;
x86_64) ARCH=x86_64
;;
@@ -45,13 +50,17 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -72,9 +81,13 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -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 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+
+# 20220323 bkw: for some reason, inlining the calcNow() function
+# causes the build to fail on 32-bit.
+patch -p1 < $CWD/no_inline_calcnow.diff
if [ "$NONFREE" = "yes" ]; then
LIBS="/usr/lib${LIBDIRSUFFIX}/libvorbisidec.so.1 /usr/lib${LIBDIRSUFFIX}/libmad.so"
@@ -95,11 +108,13 @@ cp -ar $DOCS examples \
$PKG/usr/doc/$PRGNAM-$VERSION
cp -ar scripts river{1,2}.ogg \
$PKG/usr/share/$PRGNAM
+
+# 20220323 bkw: why are we installing the source?
cp -ar *.c mk-* libs \
$PKG/usr/share/$PRGNAM/src
-install -m0755 -o 0:0 $CWD/$PRGNAM $PKG/usr/bin
-install -m0755 -o 0:0 $BINNAME $PKG/usr/bin/$BINNAME
+install -m0755 -oroot -groot $CWD/$PRGNAM $PKG/usr/bin
+install -m0755 -oroot -groot $BINNAME $PKG/usr/bin/$BINNAME
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -107,5 +122,5 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE