audio/sbagen: Fix 32-bit build.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2022-03-22 22:07:51 -04:00 committed by Willy Sudiarto Raharjo
parent 166783a0b1
commit fd1bb36ac9
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
3 changed files with 46 additions and 11 deletions

View File

@ -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!

View File

@ -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);

View File

@ -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