From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SG8Xe-0004hk-OE for ptxdist@pengutronix.de; Fri, 06 Apr 2012 14:45:26 +0200 Received: from jbe by dude.hi.pengutronix.de with local (Exim 4.77) (envelope-from ) id 1SG8Xe-00024U-N7 for ptxdist@pengutronix.de; Fri, 06 Apr 2012 14:45:26 +0200 From: Juergen Beisert Date: Fri, 6 Apr 2012 14:45:16 +0200 Message-Id: <1333716320-7923-2-git-send-email-jbe@pengutronix.de> In-Reply-To: <1333716320-7923-1-git-send-email-jbe@pengutronix.de> References: <1333716320-7923-1-git-send-email-jbe@pengutronix.de> Subject: [ptxdist] [PATCH 1/5] Add the 'libshout' Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Signed-off-by: Juergen Beisert --- patches/libshout-2.2.2/autogen.sh | 1 + patches/libshout-2.2.2/fix_buildsystem.diff | 210 +++++++++++++++++++++++++++ patches/libshout-2.2.2/series | 1 + rules/libshout.in | 34 +++++ rules/libshout.make | 67 +++++++++ 5 files changed, 313 insertions(+) create mode 120000 patches/libshout-2.2.2/autogen.sh create mode 100644 patches/libshout-2.2.2/fix_buildsystem.diff create mode 100644 patches/libshout-2.2.2/series create mode 100644 rules/libshout.in create mode 100644 rules/libshout.make diff --git a/patches/libshout-2.2.2/autogen.sh b/patches/libshout-2.2.2/autogen.sh new file mode 120000 index 0000000..9f8a4cb --- /dev/null +++ b/patches/libshout-2.2.2/autogen.sh @@ -0,0 +1 @@ +../autogen.sh \ No newline at end of file diff --git a/patches/libshout-2.2.2/fix_buildsystem.diff b/patches/libshout-2.2.2/fix_buildsystem.diff new file mode 100644 index 0000000..a1d0e0b --- /dev/null +++ b/patches/libshout-2.2.2/fix_buildsystem.diff @@ -0,0 +1,210 @@ +From: Juergen Beisert +Subject: Make external components really optional + +Singed-off-by: Juergen Beisert + +--- + configure.ac | 85 ++++++++++++++++++++++++++++++++++---------------------- + m4/ogg.m4 | 5 +++ + m4/vorbis.m4 | 7 ++++ + src/Makefile.am | 6 +++ + src/ogg.c | 2 + + 5 files changed, 72 insertions(+), 33 deletions(-) + +Index: libshout-2.2.2/m4/ogg.m4 +=================================================================== +--- libshout-2.2.2.orig/m4/ogg.m4 ++++ libshout-2.2.2/m4/ogg.m4 +@@ -15,6 +15,10 @@ AC_ARG_WITH(ogg, + ogg_prefix="$withval", + ogg_prefix="$OGG_PREFIX" + ) ++if test "x$with_ogg" = "xno" ++then ++ AC_MSG_RESULT([OGG support disabled by request]) ++else + if test "x$ogg_prefix" = "x" -o "x$ogg_prefix" = "xyes"; then + if test "x$prefix" = "xNONE"; then + ogg_prefix=/usr/local +@@ -59,6 +63,7 @@ else + OGG_LDFLAGS="" + ifelse([$2],,,[$2]) + fi ++fi + AC_SUBST(OGG_LIBS) + AC_SUBST(OGG_CFLAGS) + AC_SUBST(OGG_LDFLAGS) +Index: libshout-2.2.2/m4/vorbis.m4 +=================================================================== +--- libshout-2.2.2.orig/m4/vorbis.m4 ++++ libshout-2.2.2/m4/vorbis.m4 +@@ -21,6 +21,12 @@ AC_ARG_WITH(vorbis, + vorbis_prefix="$withval", + vorbis_prefix="$VORBIS_PREFIX" + ) ++ ++if test "x$vorbis_prefix" = "xno" ++then ++ AC_MSG_RESULT([Vorbis support disabled by request]) ++else ++ + if test "x$vorbis_prefix" = "x" -o "x$vorbis_prefix" = "xyes"; then + if test "x$prefix" = "xNONE"; then + vorbis_prefix="/usr/local" +@@ -83,6 +89,7 @@ else + VORBISENC_LIBS="" + ifelse([$2], ,, [$2]) + fi ++fi + AC_SUBST(VORBIS_CFLAGS) + AC_SUBST(VORBIS_LDFLAGS) + AC_SUBST(VORBIS_LIBS) +Index: libshout-2.2.2/configure.ac +=================================================================== +--- libshout-2.2.2.orig/configure.ac ++++ libshout-2.2.2/configure.ac +@@ -111,45 +111,66 @@ then + AC_DEFINE([NO_THREAD], 1, [Define if you don't want to use the thread library]) + fi + ++AC_ARG_WITH([ogg], AS_HELP_STRING([--with-ogg], [Build with ogg support])) ++if test "x$with_ogg" != xno; then ++PKG_CHECK_MODULES(OGG, ogg, ++ [AC_DEFINE([HAVE_OGG], 1, [Define if you want ogg streams supported])], ++ [AC_MSG_ERROR([requisite ogg library not found])]) ++AC_SUBST(OGG_LIBS) ++AC_SUBST(OGG_CFLAGS) ++AM_CONDITIONAL(HAVE_OGG, [true]) + SHOUT_REQUIRES="ogg" ++else ++AM_CONDITIONAL(HAVE_OGG, [false]) ++fi ++ ++XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS" ++ ++AC_ARG_WITH([vorbis], AS_HELP_STRING([--with-vorbis], [Build with vorbis support])) ++if test "x$with_vorbis" != xno; then ++PKG_CHECK_MODULES(VORBIS, vorbis, ++ [AC_DEFINE([HAVE_VORBIS], 1, [Define if you want vorbis streams supported])], ++ [AC_MSG_RESULT([vorbis not found. Disabled])]) ++AC_SUBST(VORBIS_LIBS) ++AC_SUBST(VORBIS_CFLAGS) ++AM_CONDITIONAL(HAVE_VORBIS, [true]) ++SHOUT_REQUIRES="${SHOUT_REQUIRES}, vorbis" ++else ++AM_CONDITIONAL(HAVE_VORBIS, [false]) ++fi + +-PKG_CHECK_MODULES(VORBIS, vorbis, [ +- HAVE_VORBIS="yes" +- SHOUT_REQUIRES="$SHOUT_REQUIRES, vorbis" +- ], [ +- XIPH_PATH_VORBIS(, [AC_MSG_ERROR([requisite Ogg Vorbis library not found])]) +- ]) +-VORBIS_LIBS="$VORBIS_LDFLAGS $VORBIS_LIBS" + XIPH_CFLAGS="$XIPH_CFLAGS $VORBIS_CFLAGS" + +-PKG_CHECK_MODULES(THEORA, theora, [ +- HAVE_THEORA="yes" +- SHOUT_REQUIRES="$SHOUT_REQUIRES, theora" +- ], [ +- XIPH_PATH_THEORA(, [AC_MSG_WARN([Theora library not found, disabling])]) +- ]) +-XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$THEORA_CFLAGS]) +-XIPH_VAR_PREPEND([XIPH_LIBS],[$THEORA LDFLAGS $THEORA_LIBS]) +-AM_CONDITIONAL([HAVE_THEORA], [test -n "$THEORA_LIBS"]) +-if test -n "$THEORA_LIBS" +-then +- AC_DEFINE([HAVE_THEORA], 1, [Define if you want theora streams supported]) ++AC_ARG_WITH([theora], AS_HELP_STRING([--with-theora], [Build with theora support])) ++if test "x$with_theora" != xno; then ++PKG_CHECK_MODULES(THEORA, theora, ++ [AC_DEFINE([HAVE_THEORA], 1, [Define if you want theora streams supported])], ++ [AC_MSG_RESULT([theora not found. Disabled])]) ++AC_SUBST(THEORA_LIBS) ++AC_SUBST(THEORA_CFLAGS) ++AM_CONDITIONAL(HAVE_THEORA, [true]) ++SHOUT_REQUIRES="${SHOUT_REQUIRES}, theora" ++else ++AM_CONDITIONAL(HAVE_THEORA, [false]) + fi + +-PKG_CHECK_MODULES(SPEEX, speex, [ +- HAVE_SPEEX="yes" +- SHOUT_REQUIRES="$SHOUT_REQUIRES, speex" +- ], [ +- XIPH_PATH_SPEEX(, [AC_MSG_WARN([Speex library not found, disabling])]) +- ]) +-XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$SPEEX_CFLAGS]) +-XIPH_VAR_PREPEND([XIPH_LIBS],[$SPEEX LDFLAGS $SPEEX_LIBS]) +-AM_CONDITIONAL([HAVE_SPEEX], [test -n "$SPEEX_LIBS"]) +-if test -n "$SPEEX_LIBS" +-then +- AC_DEFINE([HAVE_SPEEX], 1, [Define if you want speex streams supported]) ++XIPH_CFLAGS="$XIPH_CFLAGS $THEORA_CFLAGS" ++ ++AC_ARG_WITH([speex], AS_HELP_STRING([--with-speex], [Build with speex support])) ++if test "x$with_speex" != xno; then ++PKG_CHECK_MODULES(SPEEX, speex, ++ [AC_DEFINE([HAVE_SPEEX], 1, [Define if you want speex streams supported])], ++ [AC_MSG_RESULT([speex not found. Disabled])]) ++AC_SUBST(SPEEX_LIBS) ++AC_SUBST(SPEEX_CFLAGS) ++AM_CONDITIONAL(HAVE_SPEEX, [true]) ++SHOUT_REQUIRES="${SHOUT_REQUIRES}, speex" ++else ++AM_CONDITIONAL(HAVE_SPEEX, [false]) + fi + ++XIPH_CFLAGS="$XIPH_CFLAGS $SPEEX_CFLAGS" ++ + dnl pkgconfig/shout-config. + dnl If pkgconfig is found, use it and disable shout-config, otherwise do the + dnl opposite, unless the user overrides. +@@ -185,7 +206,7 @@ SHOUT_LIBS="-lshout" + + XIPH_CLEAN_CCFLAGS([$SHOUT_CPPFLAGS], [SHOUT_CPPFLAGS]) + XIPH_CLEAN_CCFLAGS([$SHOUT_CFLAGS], [SHOUT_CFLAGS]) +-XIPH_CLEAN_CCFLAGS([$VORBIS_LIBS $THEORA_LIBS $SPEEX_LIBS $PTHREAD_LIBS $LIBS], [SHOUT_LIBDEPS]) ++XIPH_CLEAN_CCFLAGS([$OGG_LIBS $VORBIS_LIBS $THEORA_LIBS $SPEEX_LIBS $PTHREAD_LIBS $LIBS], [SHOUT_LIBDEPS]) + AC_SUBST(PTHREAD_CPPFLAGS) + AC_SUBST(SHOUT_LIBDEPS) + AC_SUBST(SHOUT_REQUIRES) +Index: libshout-2.2.2/src/Makefile.am +=================================================================== +--- libshout-2.2.2.orig/src/Makefile.am ++++ libshout-2.2.2/src/Makefile.am +@@ -15,6 +15,10 @@ if HAVE_SPEEX + MAYBE_SPEEX = speex.c + endif + ++if HAVE_VORBIS ++ MAYBE_VORBIS = vorbis.c ++endif ++ + SUBDIRS = avl net timing httpp $(MAYBE_THREAD) + + lib_LTLIBRARIES = libshout.la +@@ -22,7 +26,7 @@ libshout_la_LDFLAGS = -version-info 5:0: + + EXTRA_DIST = theora.c speex.c + noinst_HEADERS = shout_ogg.h shout_private.h util.h +-libshout_la_SOURCES = shout.c util.c ogg.c vorbis.c mp3.c $(MAYBE_THEORA) $(MAYBE_SPEEX) ++libshout_la_SOURCES = shout.c util.c ogg.c $(MAYBE_VORBIS) mp3.c $(MAYBE_THEORA) $(MAYBE_SPEEX) + AM_CFLAGS = @XIPH_CFLAGS@ + + libshout_la_LIBADD = net/libicenet.la timing/libicetiming.la avl/libiceavl.la\ +Index: libshout-2.2.2/src/ogg.c +=================================================================== +--- libshout-2.2.2.orig/src/ogg.c ++++ libshout-2.2.2/src/ogg.c +@@ -53,7 +53,9 @@ static int send_page(shout_t *self, ogg_ + + typedef int (*codec_open_t)(ogg_codec_t *codec, ogg_page *page); + static codec_open_t codecs[] = { ++#ifdef HAVE_VORBIS + _shout_open_vorbis, ++#endif + #ifdef HAVE_THEORA + _shout_open_theora, + #endif diff --git a/patches/libshout-2.2.2/series b/patches/libshout-2.2.2/series new file mode 100644 index 0000000..aaa56f7 --- /dev/null +++ b/patches/libshout-2.2.2/series @@ -0,0 +1 @@ +fix_buildsystem.diff diff --git a/rules/libshout.in b/rules/libshout.in new file mode 100644 index 0000000..b1dcc54 --- /dev/null +++ b/rules/libshout.in @@ -0,0 +1,34 @@ +## SECTION=multimedia_sound + +menuconfig LIBSHOUT + tristate + prompt "libshout " + select LIBOGG if ICEGENERATOR_VORBIS + select LIBVORBIS if ICEGENERATOR_VORBIS + select LIBTHEORA if ICEGENERATOR_THEORA + select SPEEX if ICEGENERATOR_SPEEX + help + Library which can be used to write a source client like 'ices' for + the 'icecast' streaming server + +if LIBSHOUT + +config ICEGENERATOR_VORBIS + bool + prompt "use VORBIS" + help + Enable support for VORBIS data format + +config ICEGENERATOR_THEORA + bool + prompt "use THEORA" + help + Enable support for THEORA data format + +config ICEGENERATOR_SPEEX + bool + prompt "use SPEEX" + help + Enable support for SPEEX data format + +endif diff --git a/rules/libshout.make b/rules/libshout.make new file mode 100644 index 0000000..f3d5e7e --- /dev/null +++ b/rules/libshout.make @@ -0,0 +1,67 @@ +# -*-makefile-*- +# +# Copyright (C) 2012 by Juergen Beisert +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_LIBSHOUT) += libshout + +# +# Paths and names +# +LIBSHOUT_VERSION := 2.2.2 +LIBSHOUT_MD5 := 4f75fc9901c724b712c371c9a1e782d3 +LIBSHOUT := libshout-$(LIBSHOUT_VERSION) +LIBSHOUT_SUFFIX := tar.gz +LIBSHOUT_URL := http://downloads.us.xiph.org/releases/libshout/$(LIBSHOUT).$(LIBSHOUT_SUFFIX) +LIBSHOUT_SOURCE := $(SRCDIR)/$(LIBSHOUT).$(LIBSHOUT_SUFFIX) +LIBSHOUT_DIR := $(BUILDDIR)/$(LIBSHOUT) +LIBSHOUT_LICENSE := LGPLv2 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +#LIBSHOUT_CONF_ENV := $(CROSS_ENV) + +# +# autoconf +# +LIBSHOUT_CONF_TOOL := autoconf +LIBSHOUT_CONF_OPT := \ + $(CROSS_AUTOCONF_USR) \ + --enable-shared \ + --disable-static \ + --enable-pkgconfig \ + --with-ogg \ + --$(call ptx/wwo, PTXCONF_ICEGENERATOR_VORBIS)-vorbis \ + --$(call ptx/wwo, PTXCONF_ICEGENERATOR_THEORA)-theora \ + --$(call ptx/wwo, PTXCONF_ICEGENERATOR_SPEEX)-speex + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/libshout.targetinstall: + @$(call targetinfo) + + @$(call install_init, libshout) + @$(call install_fixup, libshout,PRIORITY,optional) + @$(call install_fixup, libshout,SECTION,base) + @$(call install_fixup, libshout,AUTHOR,"Juergen Beisert ") + @$(call install_fixup, libshout,DESCRIPTION,missing) + + @$(call install_lib, libshout, 0, 0, 0644, libshout) + + @$(call install_finish, libshout) + + @$(call touch) + +# vim: syntax=make -- 1.7.9.5 -- ptxdist mailing list ptxdist@pengutronix.de