aboutsummaryrefslogtreecommitdiff
path: root/audio/sbagen
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-03-22 22:07:51 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-03-26 01:20:10 +0700
commitfd1bb36ac97d726edf7ff914b53bc714158bf676 (patch)
treec070552e6927cf7ae69b99972c17233adb491283 /audio/sbagen
parent166783a0b1908e845a3122476726fc555db7a560 (diff)
audio/sbagen: Fix 32-bit build.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
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.SlackBuild21
3 files changed, 46 insertions, 11 deletions
diff --git a/audio/sbagen/README b/audio/sbagen/README
index c8e27da6326a3..bf2f5c0f434a3 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 0000000000000..a7042bd19deab
--- /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 f131fe657fc36..34602fbd21be4 100644
--- a/audio/sbagen/sbagen.SlackBuild
+++ b/audio/sbagen/sbagen.SlackBuild
@@ -22,6 +22,8 @@
# 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
@@ -39,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
;;
@@ -48,9 +50,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
@@ -60,8 +59,8 @@ 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"
@@ -82,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"
@@ -105,6 +108,8 @@ 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