diff options
author | Igor Alexandrov <igor.alexandrov@outlook.com> | 2020-12-26 16:05:13 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-12-26 16:05:13 +0700 |
commit | 6939dfa43775c5c3f28f2f39ded47178a156d55f (patch) | |
tree | 608dc579d4fd6b54477880294c626f2a6ad367e8 /libraries/libsidplay | |
parent | b5ad2650466f4b9e06ddce423aece8930df35287 (diff) | |
download | slackbuilds-6939dfa43775c5c3f28f2f39ded47178a156d55f.tar.gz |
libraries/libsidplay: Added (library for playing SID music files).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/libsidplay')
-rw-r--r-- | libraries/libsidplay/README | 4 | ||||
-rw-r--r-- | libraries/libsidplay/files/avoid_narrowing_conversion.patch | 20 | ||||
-rw-r--r-- | libraries/libsidplay/files/remove_sid_have_ios_bin_block.patch | 38 | ||||
-rw-r--r-- | libraries/libsidplay/libsidplay.SlackBuild | 102 | ||||
-rw-r--r-- | libraries/libsidplay/libsidplay.info | 10 | ||||
-rw-r--r-- | libraries/libsidplay/slack-desc | 19 |
6 files changed, 193 insertions, 0 deletions
diff --git a/libraries/libsidplay/README b/libraries/libsidplay/README new file mode 100644 index 0000000000..90768f0038 --- /dev/null +++ b/libraries/libsidplay/README @@ -0,0 +1,4 @@ +libsidplay is a library for playing SID music files, and it emulates +the sound chip for the vintage Commodore 64. + +This library is an optional dependency for gst-plugins-ugly diff --git a/libraries/libsidplay/files/avoid_narrowing_conversion.patch b/libraries/libsidplay/files/avoid_narrowing_conversion.patch new file mode 100644 index 0000000000..07480518c6 --- /dev/null +++ b/libraries/libsidplay/files/avoid_narrowing_conversion.patch @@ -0,0 +1,20 @@ +--- a/src/samples.cpp ++++ b/src/samples.cpp +@@ -75,7 +75,7 @@ struct sampleChannel + sampleChannel ch4, ch5; + + +-const sbyte galwayNoiseTab1[16] = ++const ubyte galwayNoiseTab1[16] = + { + 0x80,0x91,0xa2,0xb3,0xc4,0xd5,0xe6,0xf7, + 0x08,0x19,0x2a,0x3b,0x4c,0x5d,0x6e,0x7f +@@ -84,7 +84,7 @@ const sbyte galwayNoiseTab1[16] = + ubyte galwayNoiseVolTab[16]; + sbyte galwayNoiseSamTab[16]; + +-const sbyte sampleConvertTab[16] = ++const ubyte sampleConvertTab[16] = + { + // 0x81,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff, + // 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x7f diff --git a/libraries/libsidplay/files/remove_sid_have_ios_bin_block.patch b/libraries/libsidplay/files/remove_sid_have_ios_bin_block.patch new file mode 100644 index 0000000000..f1fcc41cca --- /dev/null +++ b/libraries/libsidplay/files/remove_sid_have_ios_bin_block.patch @@ -0,0 +1,38 @@ +--- a/src/sidtune.cpp ++++ b/src/sidtune.cpp +@@ -306,11 +306,7 @@ udword sidTune::loadFile(const char* fileName, ubyte** bufferRef) + return 0; + } + // Open binary input file stream at end of file. +-#if defined(SID_HAVE_IOS_BIN) +- ifstream myIn( fileName, ios::in|ios::bin|ios::ate ); +-#else + ifstream myIn( fileName, ios::in|ios::binary|ios::ate ); +-#endif + // As a replacement for !is_open(), bad() and the NOT-operator + // don't seem to work on all systems. + #if defined(SID_DONT_HAVE_IS_OPEN) +@@ -972,11 +968,7 @@ bool sidTune::saveC64dataFile( const char* fileName, bool overWriteFlag ) + } + // Open binary output file stream. + else +-#if defined(SID_HAVE_IOS_BIN) +- fMyOut.open( fileName, ios::out|ios::bin|ios::trunc ); +-#else + fMyOut.open( fileName, ios::out|ios::binary|ios::trunc ); +-#endif + if ( !fMyOut ) + { + info.statusString = text_cantCreateFile; +@@ -1061,11 +1053,7 @@ bool sidTune::savePSIDfile( const char* fileName, bool overWriteFlag ) + } + // Open binary output file stream. + else +-#if defined(SID_HAVE_IOS_BIN) +- fMyOut.open( fileName, ios::out|ios::bin|ios::trunc ); +-#else + fMyOut.open( fileName, ios::out|ios::binary|ios::trunc ); +-#endif + if ( !fMyOut ) + { + info.statusString = text_cantCreateFile; diff --git a/libraries/libsidplay/libsidplay.SlackBuild b/libraries/libsidplay/libsidplay.SlackBuild new file mode 100644 index 0000000000..a079e4b64a --- /dev/null +++ b/libraries/libsidplay/libsidplay.SlackBuild @@ -0,0 +1,102 @@ +#!/bin/sh + +# Slackware build script for libsidplay + +# Copyright 2020 Igor Alexandrov <igor.alexandrov@outlook.com> +# 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. + +PRGNAM=libsidplay +VERSION=${VERSION:-1.36.59} +BUILD=${BUILD:-1} +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 -eu + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tgz +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 \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 -i $CWD/files/remove_sid_have_ios_bin_block.patch +patch -p1 -i $CWD/files/avoid_narrowing_conversion.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --disable-static \ + --build=$ARCH-slackware-linux +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +# remove .la file +rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/libsidplay.la + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING DEVELOPER INSTALL $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +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} diff --git a/libraries/libsidplay/libsidplay.info b/libraries/libsidplay/libsidplay.info new file mode 100644 index 0000000000..3411a2e185 --- /dev/null +++ b/libraries/libsidplay/libsidplay.info @@ -0,0 +1,10 @@ +PRGNAM="libsidplay" +VERSION="1.36.59" +HOMEPAGE="https://critical.ch/distfiles/" +DOWNLOAD="https://critical.ch/distfiles/libsidplay-1.36.59.tgz" +MD5SUM="37c51ba4bd57164b1b0bb7b43b9adece" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="%README%" +MAINTAINER="Igor Alexandrov" +EMAIL="igor.alexandrov@outlook.com" diff --git a/libraries/libsidplay/slack-desc b/libraries/libsidplay/slack-desc new file mode 100644 index 0000000000..8af5e4a38e --- /dev/null +++ b/libraries/libsidplay/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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +libsidplay: libsidplay (library for playing SID music files) +libsidplay: +libsidplay: Library that emulates the sound chip for the vintage Commodore 64. +libsidplay: +libsidplay: +libsidplay: +libsidplay: +libsidplay: +libsidplay: +libsidplay: +libsidplay: |