Browse Source

l/opal: Added opal-3.6.8.

slackware-14.2
Damien Goutte-Gattat 11 years ago
parent
commit
b0f32bb644
  1. 97
      l/opal/opal-3.6.8-celt-0.11.diff
  2. 1
      l/opal/opal-3.6.8.tar.bz2.sha1
  3. 122
      l/opal/opal.SlackBuild
  4. 12
      l/opal/slack-desc

97
l/opal/opal-3.6.8-celt-0.11.diff

@ -0,0 +1,97 @@
--- opal-3.6.8.orig/plugins/audio/celt/celtcodec.c 2010-05-27 08:52:43.000000000 +0200
+++ opal-3.6.8/plugins/audio/celt/celtcodec.c 2011-12-30 14:58:55.852605998 +0100
@@ -52,16 +52,11 @@
{
int error = 0;
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->mode = celt_mode_create(codec->sampleRate, 1, codec->parm.audio.samplesPerFrame, &error);
-#else
celt->mode = celt_mode_create(codec->sampleRate, codec->parm.audio.samplesPerFrame, &error);
-#endif
if (celt->mode == NULL) {
return FALSE;
}
- celt_mode_info(celt->mode, CELT_GET_FRAME_SIZE, &celt->frame_size);
celt->bytes_per_packet = (codec->bitsPerSec * celt->frame_size/codec->sampleRate + 4) / 8;
return TRUE;
@@ -78,11 +73,7 @@
return NULL;
}
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->encoder_state = celt_encoder_create(celt->mode);
-#else
- celt->encoder_state = celt_encoder_create(celt->mode, 1, NULL);
-#endif
+ celt->encoder_state = celt_encoder_create_custom(celt->mode, 1, NULL);
if (celt->encoder_state == NULL ) {
celt_mode_destroy(celt->mode);
free(celt);
@@ -104,11 +95,7 @@
return NULL;
}
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->decoder_state = celt_decoder_create(celt->mode);
-#else
- celt->decoder_state = celt_decoder_create(celt->mode, 1, NULL);
-#endif
+ celt->decoder_state = celt_decoder_create_custom(celt->mode, 1, NULL);
if (celt->decoder_state == NULL ) {
celt_mode_destroy(celt->mode);
free(celt);
@@ -146,7 +133,7 @@
unsigned int * flag)
{
CELTContext *celt = (CELTContext *)context;
- unsigned byteCount;
+ int byteCount;
if (*fromLen < codec->parm.audio.samplesPerFrame*sizeof(short))
return FALSE;
@@ -154,16 +141,10 @@
if (*toLen < celt->bytes_per_packet)
return FALSE;
-#ifdef HAVE_CELT_0_4_OR_SOONER
- byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, (char *)toPtr, celt->bytes_per_packet);
-#elif HAVE_CELT_0_5_0_OR_0_6_0
- byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, NULL, (char *)toPtr, celt->bytes_per_packet);
-#else
- byteCount = celt_encode(celt->encoder_state, (void *)fromPtr, NULL, (unsigned char *)toPtr, celt->bytes_per_packet);
-#endif
- if (byteCount < 0) {
- return 0;
- }
+ byteCount = celt_encode(celt->encoder_state, (const celt_int16 *)fromPtr, *fromLen/2, (unsigned char *)toPtr, celt->bytes_per_packet);
+ if (byteCount < 0)
+ return 0;
+
*toLen = byteCount;
*fromLen = codec->parm.audio.samplesPerFrame*sizeof(short);
@@ -187,11 +168,7 @@
if (*fromLen == 0)
return FALSE;
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- if (celt_decode(celt->decoder_state, (char *)fromPtr, *fromLen, (short *)toPtr) < 0)
-#else
- if (celt_decode(celt->decoder_state, (unsigned char *)fromPtr, *fromLen, (short *)toPtr) < 0)
-#endif
+ if (celt_decode(celt->decoder_state, (unsigned char *)fromPtr, *fromLen, (short *)toPtr, *toLen) < 0)
return 0;
*toLen = codec->parm.audio.samplesPerFrame*sizeof(short);
@@ -207,7 +184,7 @@
void * parm,
unsigned * parmLen)
{
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
+#if CELT_VERSION<700
if (parmLen == NULL || parm == NULL || *parmLen != sizeof(char *))
#else
if (parmLen == NULL || parm == NULL || *parmLen != sizeof(unsigned char *))

1
l/opal/opal-3.6.8.tar.bz2.sha1

@ -0,0 +1 @@
c43826bc3e273df048f47a77c4affb36614f2b7e opal-3.6.8.tar.bz2

122
l/opal/opal.SlackBuild

@ -0,0 +1,122 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2011 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# 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.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest opal sourcecode is available at: <http://www.ekiga.org/>.
#
# Depends: l/ptlib, xap/ffmpeg
# Source package infos
NAMESRC=${NAMESRC:-opal}
VERSION=${VERSION:-3.6.8}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.bz2}
WGET=${WGET:-http://ftp.gnome.org/pub/gnome/sources/opal/3.6/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-opal}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exists or is not a directory!"
exit 1
fi
# Compilation flags
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
CPUOPT="-O2"
;;
esac
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/opal-3.6.8-celt-0.11.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--prefix=/usr \
--libdir=/usr/lib$LIBDIRSUFFIX
make -j $JOBS
make install DESTDIR=$PKG
# Strip binaries
find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \
xargs strip --strip-unneeded 2> /dev/null
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 mpl-1.0.htm docs/Overview.htm docs/diagram.gif \
$PKG/usr/doc/$NAME
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
l/opal/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler---------------------------------------------------------|
opal: opal (Open Phone Abstraction Library)
opal:
opal: Open Phone Abstraction Library, an implementation of the ITU H.323
opal: teleconferencing protocol, and successor of the openh323 library.
opal:
opal:
opal:
opal:
opal:
opal:
opal:
Loading…
Cancel
Save