summaryrefslogtreecommitdiff
path: root/source/ap/vorbis-tools
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2018-05-28 19:12:29 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 23:39:35 +0200
commit646a5c1cbfd95873950a87b5f75d52073a967023 (patch)
treeb8b8d2ab3b0d432ea69ad1a64d1c789649d65020 /source/ap/vorbis-tools
parentd31c50870d0bee042ce660e445c9294a59a3a65b (diff)
downloadcurrent-646a5c1cbfd95873950a87b5f75d52073a967023.tar.gz
Mon May 28 19:12:29 UTC 201820180528191229
a/pkgtools-15.0-noarch-13.txz: Rebuilt. installpkg: default line length for --terselength is the number of columns. removepkg: added --terse mode. upgradepkg: default line length for --terselength is the number of columns. upgradepkg: accept -option in addition to --option. ap/vim-8.1.0026-x86_64-1.txz: Upgraded. d/bison-3.0.5-x86_64-1.txz: Upgraded. e/emacs-26.1-x86_64-1.txz: Upgraded. kde/kopete-4.14.3-x86_64-8.txz: Rebuilt. Recompiled against libidn-1.35. n/conntrack-tools-1.4.5-x86_64-1.txz: Upgraded. n/libnetfilter_conntrack-1.0.7-x86_64-1.txz: Upgraded. n/libnftnl-1.1.0-x86_64-1.txz: Upgraded. n/links-2.16-x86_64-2.txz: Rebuilt. Rebuilt to enable X driver for -g mode. n/lynx-2.8.9dev.19-x86_64-1.txz: Upgraded. n/nftables-0.8.5-x86_64-1.txz: Upgraded. n/p11-kit-0.23.11-x86_64-1.txz: Upgraded. n/ulogd-2.0.7-x86_64-1.txz: Upgraded. n/whois-5.3.1-x86_64-1.txz: Upgraded. xap/network-manager-applet-1.8.12-x86_64-1.txz: Upgraded. xap/vim-gvim-8.1.0026-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/ap/vorbis-tools')
-rw-r--r--source/ap/vorbis-tools/ogg123.opus.diff544
-rw-r--r--source/ap/vorbis-tools/slack-desc14
-rwxr-xr-xsource/ap/vorbis-tools/vorbis-tools.SlackBuild56
3 files changed, 596 insertions, 18 deletions
diff --git a/source/ap/vorbis-tools/ogg123.opus.diff b/source/ap/vorbis-tools/ogg123.opus.diff
new file mode 100644
index 00000000..894845bc
--- /dev/null
+++ b/source/ap/vorbis-tools/ogg123.opus.diff
@@ -0,0 +1,544 @@
+diff --git a/configure.ac b/configure.ac
+index 800d3b8..0ba91ce 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,16 +159,26 @@ then
+ if test "x$ac_cv_have_decl_OV_ECTL_COUPLING_SET" = "xno"
+ then
+ AC_MSG_ERROR([Vorbis >= 1.3.0 required !])
+ HAVE_VORBIS=no
+ fi
+ fi
+ AM_CONDITIONAL(HAVE_OV_READ_FILTER, test "x$have_ov_read_filter" = "xyes")
+
++if test "x$HAVE_PKG_CONFIG" = "xyes"
++then
++ PKG_CHECK_MODULES(OPUSFILE, opusfile >= 0.2, HAVE_LIBOPUSFILE=yes, HAVE_LIBOPUSFILE=no)
++ AC_SUBST(OPUSFILE_LIBS)
++ if test "x$HAVE_LIBOPUSFILE" = xyes; then
++ AC_DEFINE(HAVE_LIBOPUSFILE, 1, [Defined if we have libopusfile])
++ fi
++fi
++AM_CONDITIONAL(HAVE_LIBOPUSFILE, test "x$HAVE_LIBOPUSFILE" = "xyes")
++
+
+ SHARE_LIBS='$(top_builddir)/share/libutf8.a $(top_builddir)/share/libgetopt.a'
+ SHARE_CFLAGS='-I$(top_srcdir)/include'
+
+ I18N_CFLAGS='-I$(top_srcdir)/intl'
+ I18N_LIBS=$INTLLIBS
+
+ SOCKET_LIBS=
+diff --git a/ogg123/Makefile.am b/ogg123/Makefile.am
+index f7c5b46..df39c91 100644
+--- a/ogg123/Makefile.am
++++ b/ogg123/Makefile.am
+@@ -4,50 +4,58 @@ flac_sources = flac_format.c easyflac.c easyflac.h
+ else
+ flac_sources =
+ endif
+ if HAVE_LIBSPEEX
+ speex_sources = speex_format.c
+ else
+ speex_sources =
+ endif
++if HAVE_LIBOPUSFILE
++opus_sources = opus_format.c
++else
++opus_sources =
++endif
++
+ if HAVE_OV_READ_FILTER
+ vgfilter_sources = vgfilter.c vgfilter.h
+ else
+ vgfilter_sources =
+ endif
+
+ datadir = @datadir@
+ localedir = $(datadir)/locale
+ DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+ docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
+ mandir = @MANDIR@
+
+ bin_PROGRAMS = ogg123
+
+-INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
++INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @OPUSFILE_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
+ @PTHREAD_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@
+
+ ogg123_LDADD = @SHARE_LIBS@ \
+ @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
+ @SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
+- @PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@
++ @PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@ \
++ @OPUSFILE_LIBS@
+
+ ogg123_DEPENDENCIES = @SHARE_LIBS@
+ ogg123_SOURCES = audio.c buffer.c callbacks.c \
+ cfgfile_options.c cmdline_options.c \
+ file_transport.c format.c http_transport.c \
+ ogg123.c oggvorbis_format.c playlist.c \
+ status.c remote.c transport.c vorbis_comments.c \
+ audio.h buffer.h callbacks.h compat.h \
+ cfgfile_options.h cmdline_options.h \
+ format.h ogg123.h playlist.h status.h \
+ transport.h remote.h vorbis_comments.h \
+- $(flac_sources) $(speex_sources) $(vgfilter_sources)
++ $(flac_sources) $(speex_sources) $(vgfilter_sources) \
++ $(opus_sources)
+
+ man_MANS = ogg123.1
+ doc_DATA = ogg123rc-example
+
+ EXTRA_ogg123_SOURCES = \
+ $(man_MANS) $(doc_DATA)
+
+ debug:
+diff --git a/ogg123/cmdline_options.c b/ogg123/cmdline_options.c
+index f3107f9..2194ffc 100644
+--- a/ogg123/cmdline_options.c
++++ b/ogg123/cmdline_options.c
+@@ -314,16 +314,20 @@ void cmdline_usage (void)
+ #ifdef HAVE_LIBFLAC
+ printf (_("FLAC, "));
+ #endif
+
+ #ifdef HAVE_LIBSPEEX
+ printf (_("Speex, "));
+ #endif
+
++#ifdef HAVE_LIBOPUSFILE
++ printf (_("Opus, "));
++#endif
++
+ printf (_("Ogg Vorbis.\n\n"));
+
+ printf (_("Output options\n"));
+ printf (_(" -d dev, --device dev Use output device \"dev\". Available devices:\n"));
+ printf (" ");
+ printf (_("Live:"));
+
+ for(i = 0, j = 0; i < driver_count; i++) {
+diff --git a/ogg123/format.c b/ogg123/format.c
+index 8392afd..6e8c449 100644
+--- a/ogg123/format.c
++++ b/ogg123/format.c
+@@ -33,24 +33,32 @@ extern format_t speex_format;
+ extern format_t flac_format;
+ extern format_t oggflac_format;
+ #endif
+
+ #ifdef HAVE_LIBSPEEX
+ extern format_t speex_format;
+ #endif
+
++#ifdef HAVE_LIBOPUSFILE
++extern format_t opus_format;
++#endif
++
++
+ format_t *formats[] = {
+ #ifdef HAVE_LIBFLAC
+ &flac_format,
+ &oggflac_format,
+ #endif
+ #ifdef HAVE_LIBSPEEX
+ &speex_format,
+ #endif
++#ifdef HAVE_LIBOPUSFILE
++ &opus_format,
++#endif
+ &oggvorbis_format,
+ NULL };
+
+
+ format_t *get_format_by_name (char *name)
+ {
+ int i = 0;
+
+diff --git a/ogg123/opus_format.c b/ogg123/opus_format.c
+new file mode 100644
+index 0000000..98298e9
+--- /dev/null
++++ b/ogg123/opus_format.c
+@@ -0,0 +1,379 @@
++/********************************************************************
++ * *
++ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
++ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
++ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
++ * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
++ * *
++ * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2003 *
++ * by Stan Seibert <volsung@xiph.org> AND OTHER CONTRIBUTORS *
++ * http://www.xiph.org/ *
++ * *
++ ********************************************************************
++
++ last mod: $Id: opus_format.c 16825 2010-01-27 04:14:08Z xiphmont $
++
++ ********************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <ctype.h>
++#include <ogg/ogg.h>
++#include <opus/opusfile.h>
++#include "transport.h"
++#include "format.h"
++#include "vorbis_comments.h"
++#include "utf8.h"
++#include "i18n.h"
++
++typedef struct opf_private_t {
++ OggOpusFile *of;
++ const OpusTags *ot;
++ const OpusHead *oh;
++ int current_section;
++
++ int bos; /* At beginning of logical bitstream */
++
++ decoder_stats_t stats;
++} opf_private_t;
++
++/* Forward declarations */
++format_t opus_format;
++OpusFileCallbacks opusfile_callbacks;
++
++
++void print_opus_stream_info (decoder_t *decoder);
++void print_opus_comments (const OpusTags *ot, decoder_callbacks_t *cb,
++ void *callback_arg);
++
++
++/* ----------------------------------------------------------- */
++
++
++int opf_can_decode (data_source_t *source)
++{
++ char buf[36];
++ int len;
++
++ len = source->transport->peek(source, buf, sizeof(char), 36);
++
++ if (len >= 32 && memcmp(buf, "OggS", 4) == 0
++ && memcmp(buf+28, "OpusHead", 8) == 0) /* 3 trailing spaces */
++ return 1;
++ else
++ return 0;
++}
++
++
++decoder_t* opf_init (data_source_t *source, ogg123_options_t *ogg123_opts,
++ audio_format_t *audio_fmt,
++ decoder_callbacks_t *callbacks, void *callback_arg)
++{
++ decoder_t *decoder;
++ opf_private_t *private;
++ int ret;
++
++
++ /* Allocate data source structures */
++ decoder = malloc(sizeof(decoder_t));
++ private = malloc(sizeof(opf_private_t));
++
++ if (decoder != NULL && private != NULL) {
++ decoder->source = source;
++ decoder->actual_fmt = decoder->request_fmt = *audio_fmt;
++ decoder->format = &opus_format;
++ decoder->callbacks = callbacks;
++ decoder->callback_arg = callback_arg;
++ decoder->private = private;
++
++ private->bos = 1;
++ private->current_section = -1;
++
++ private->stats.total_time = 0.0;
++ private->stats.current_time = 0.0;
++ private->stats.instant_bitrate = 0;
++ private->stats.avg_bitrate = 0;
++
++ } else {
++ fprintf(stderr, _("ERROR: Out of memory.\n"));
++ exit(1);
++ }
++
++ /* Initialize opusfile decoder */
++
++ private->of = op_open_callbacks (decoder, &opusfile_callbacks, NULL, 0, &ret);
++
++ if (private->of == NULL) {
++ free(private);
++/* free(source); nope. caller frees. */
++ return NULL;
++ }
++
++ return decoder;
++}
++
++
++int opf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
++ audio_format_t *audio_fmt)
++{
++ opf_private_t *priv = decoder->private;
++ decoder_callbacks_t *cb = decoder->callbacks;
++ int bytes_read = 0;
++ int ret;
++ int old_section;
++
++ /* Read comments and audio info at the start of a logical bitstream */
++ if (priv->bos) {
++ priv->ot = op_tags(priv->of, -1);
++ priv->oh = op_head(priv->of, -1);
++
++ decoder->actual_fmt.channels = priv->oh->channel_count;
++ decoder->actual_fmt.rate = 48000;
++
++ switch(decoder->actual_fmt.channels){
++ case 1:
++ decoder->actual_fmt.matrix="M";
++ break;
++ case 2:
++ decoder->actual_fmt.matrix="L,R";
++ break;
++ case 3:
++ decoder->actual_fmt.matrix="L,C,R";
++ break;
++ case 4:
++ decoder->actual_fmt.matrix="L,R,BL,BR";
++ break;
++ case 5:
++ decoder->actual_fmt.matrix="L,C,R,BL,BR";
++ break;
++ case 6:
++ decoder->actual_fmt.matrix="L,C,R,BL,BR,LFE";
++ break;
++ case 7:
++ decoder->actual_fmt.matrix="L,C,R,SL,SR,BC,LFE";
++ break;
++ case 8:
++ decoder->actual_fmt.matrix="L,C,R,SL,SR,BL,BR,LFE";
++ break;
++ default:
++ decoder->actual_fmt.matrix=NULL;
++ break;
++ }
++
++
++ print_opus_stream_info(decoder);
++ print_opus_comments(priv->ot, cb, decoder->callback_arg);
++ priv->bos = 0;
++ }
++
++ *audio_fmt = decoder->actual_fmt;
++
++ /* Attempt to read as much audio as is requested */
++ while (nbytes >= audio_fmt->word_size * audio_fmt->channels) {
++
++ old_section = priv->current_section;
++ ret = op_read(priv->of, ptr, nbytes/2, NULL);
++
++ if (ret == 0) {
++
++ /* EOF */
++ *eos = 1;
++ break;
++
++ } else if (ret == OP_HOLE) {
++
++ if (cb->printf_error != NULL)
++ cb->printf_error(decoder->callback_arg, INFO,
++ _("--- Hole in the stream; probably harmless\n"));
++
++ } else if (ret < 0) {
++
++ if (cb->printf_error != NULL)
++ cb->printf_error(decoder->callback_arg, ERROR,
++ _("=== Vorbis library reported a stream error.\n"));
++
++ /* EOF */
++ *eos = 1;
++ break;
++ } else {
++
++ bytes_read += ret*2*audio_fmt->channels;
++ ptr = (void *)((unsigned char *)ptr + ret*2*audio_fmt->channels);
++ nbytes -= ret*2*audio_fmt->channels;
++
++ /* did we enter a new logical bitstream? */
++ if (old_section != priv->current_section && old_section != -1) {
++
++ *eos = 1;
++ priv->bos = 1; /* Read new headers next time through */
++ break;
++ }
++ }
++
++ }
++
++ return bytes_read;
++}
++
++
++int opf_seek (decoder_t *decoder, double offset, int whence)
++{
++ opf_private_t *priv = decoder->private;
++ int ret;
++ int cur;
++ int samples = offset * 48000;
++
++ if (whence == DECODER_SEEK_CUR) {
++ cur = op_pcm_tell(priv->of);
++ if (cur >= 0)
++ samples += cur;
++ else
++ return 0;
++ }
++
++ ret = op_pcm_seek(priv->of, samples);
++ if (ret == 0)
++ return 1;
++ else
++ return 0;
++}
++
++
++decoder_stats_t *opf_statistics (decoder_t *decoder)
++{
++ opf_private_t *priv = decoder->private;
++ long instant_bitrate;
++ long avg_bitrate;
++
++ /* ov_time_tell() doesn't work on non-seekable streams, so we use
++ ov_pcm_tell() */
++ priv->stats.total_time = (double) op_pcm_total(priv->of, -1) /
++ (double) decoder->actual_fmt.rate;
++ priv->stats.current_time = (double) op_pcm_tell(priv->of) /
++ (double) decoder->actual_fmt.rate;
++
++ /* opusfile returns 0 when no bitrate change has occurred */
++ instant_bitrate = op_bitrate_instant(priv->of);
++ if (instant_bitrate > 0)
++ priv->stats.instant_bitrate = instant_bitrate;
++
++ avg_bitrate = op_bitrate(priv->of, priv->current_section);
++ /* Catch error case caused by non-seekable stream */
++ priv->stats.avg_bitrate = avg_bitrate > 0 ? avg_bitrate : 0;
++
++
++ return malloc_decoder_stats(&priv->stats);
++}
++
++
++void opf_cleanup (decoder_t *decoder)
++{
++ opf_private_t *priv = decoder->private;
++
++ op_free(priv->of);
++
++ free(decoder->private);
++ free(decoder);
++}
++
++
++format_t opus_format = {
++ "oggopus",
++ &opf_can_decode,
++ &opf_init,
++ &opf_read,
++ &opf_seek,
++ &opf_statistics,
++ &opf_cleanup,
++};
++
++
++/* ------------------- Opusfile Callbacks ----------------- */
++
++int opusfile_cb_read (void *stream, unsigned char *ptr, int nbytes)
++{
++ decoder_t *decoder = stream;
++
++ return decoder->source->transport->read(decoder->source, ptr, 1, nbytes);
++}
++
++int opusfile_cb_seek (void *arg, opus_int64 offset, int whence)
++{
++ decoder_t *decoder = arg;
++
++ return decoder->source->transport->seek(decoder->source, offset, whence);
++}
++
++int opusfile_cb_close (void *arg)
++{
++ return 1; /* Ignore close request so transport can be closed later */
++}
++
++opus_int64 opusfile_cb_tell (void *arg)
++{
++ decoder_t *decoder = arg;
++
++ return decoder->source->transport->tell(decoder->source);
++}
++
++
++OpusFileCallbacks opusfile_callbacks = {
++ &opusfile_cb_read,
++ &opusfile_cb_seek,
++ &opusfile_cb_tell,
++ &opusfile_cb_close
++};
++
++
++/* ------------------- Private functions -------------------- */
++
++
++void print_opus_stream_info (decoder_t *decoder)
++{
++ opf_private_t *priv = decoder->private;
++ decoder_callbacks_t *cb = decoder->callbacks;
++
++
++ if (cb == NULL || cb->printf_metadata == NULL)
++ return;
++
++ cb->printf_metadata(decoder->callback_arg, 2,
++ _("Ogg Opus stream: %d channel, 48000 Hz"),
++ priv->oh->channel_count);
++
++ cb->printf_metadata(decoder->callback_arg, 3,
++ _("Vorbis format: Version %d"),
++ priv->oh->version);
++
++ cb->printf_metadata(decoder->callback_arg, 3,
++ _("Encoded by: %s"), priv->ot->vendor);
++}
++
++void print_opus_comments (const OpusTags *ot, decoder_callbacks_t *cb,
++ void *callback_arg)
++{
++ int i;
++ char *temp = NULL;
++ int temp_len = 0;
++
++ for (i = 0; i < ot->comments; i++) {
++
++ /* Gotta null terminate these things */
++ if (temp_len < ot->comment_lengths[i] + 1) {
++ temp_len = ot->comment_lengths[i] + 1;
++ temp = realloc(temp, sizeof(char) * temp_len);
++ }
++
++ strncpy(temp, ot->user_comments[i], ot->comment_lengths[i]);
++ temp[ot->comment_lengths[i]] = '\0';
++
++ print_vorbis_comment(temp, cb, callback_arg);
++ }
++
++ free(temp);
++}
diff --git a/source/ap/vorbis-tools/slack-desc b/source/ap/vorbis-tools/slack-desc
index c55a780c..b03c00cf 100644
--- a/source/ap/vorbis-tools/slack-desc
+++ b/source/ap/vorbis-tools/slack-desc
@@ -1,8 +1,8 @@
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
+# 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
+# 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 ':'.
|-----handy-ruler------------------------------------------------------|
@@ -11,9 +11,9 @@ vorbis-tools:
vorbis-tools: The vorbis-tools package contains several basic tools for working with
vorbis-tools: compressed audio files in the Ogg Vorbis (.ogg) format:
vorbis-tools:
-vorbis-tools: oggenc (an .ogg encoder), ogg123 (a playback tool), vorbiscomment
-vorbis-tools: (add comments to vorbis files), ogginfo (show information about an
-vorbis-tools: ogg file), oggdec (a command line decoder), and vcut (a tool for
-vorbis-tools: splitting vorbis files).
+vorbis-tools: oggenc (an .ogg encoder), ogg123 (a playback tool), vorbiscomment
+vorbis-tools: (add comments to vorbis files), ogginfo (show information about an
+vorbis-tools: ogg file), oggdec (a command line decoder), and vcut (a tool for
+vorbis-tools: splitting vorbis files).
vorbis-tools:
vorbis-tools: These tools require the libao, libogg, and libvorbis libraries.
diff --git a/source/ap/vorbis-tools/vorbis-tools.SlackBuild b/source/ap/vorbis-tools/vorbis-tools.SlackBuild
index 4e0534c6..cdb544e1 100755
--- a/source/ap/vorbis-tools/vorbis-tools.SlackBuild
+++ b/source/ap/vorbis-tools/vorbis-tools.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,26 +20,55 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
-VERSION=1.4.0
-BUILD=${BUILD:-1}
+PKGNAM=vorbis-tools
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
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 "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-vorbis-tools
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG
@@ -54,12 +83,17 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Add Opus support for ogg123:
+zcat $CWD/ogg123.opus.diff.gz | patch -p1 --verbose || exit 1
+autoreconf -vif || exit 1
+
+CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--mandir=/usr/man \
--program-prefix="" \
--program-suffix="" \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -67,9 +101,9 @@ make install DESTDIR=$PKG || exit 1
# No idea why this isn't built automatically any more...
if [ ! -r $PKG/usr/bin/vcut ]; then
( cd vcut
- make
- make install DESTDIR=$PKG
- )
+ make || exit 1
+ make install DESTDIR=$PKG || exit 1
+ ) || exit 1
fi
find $PKG | xargs file | grep -e "executable" -e "shared object" \
@@ -79,7 +113,7 @@ gzip -9 $PKG/usr/man/man?/*.?
mv $PKG/usr/share/doc $PKG/usr
cp -a \
- AUTHORS COPYING README \
+ AUTHORS COPYING* README* \
$PKG/usr/doc/vorbis-tools-$VERSION
mkdir -p $PKG/install