diff options
author | Brandon Low <lostlogic@gentoo.org> | 2002-10-25 18:47:08 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@gentoo.org> | 2002-10-25 18:47:08 +0000 |
commit | 5797358a2d39777919fa2663ffa3a222df027faa (patch) | |
tree | c146735f1adde7bf23c3533f8751fcabbe16d202 /media-plugins/xmms-arts | |
parent | Initial ebuild per #8888 (diff) | |
download | gentoo-2-5797358a2d39777919fa2663ffa3a222df027faa.tar.gz gentoo-2-5797358a2d39777919fa2663ffa3a222df027faa.tar.bz2 gentoo-2-5797358a2d39777919fa2663ffa3a222df027faa.zip |
should work on bigendian machines now.
Diffstat (limited to 'media-plugins/xmms-arts')
-rw-r--r-- | media-plugins/xmms-arts/ChangeLog | 10 | ||||
-rw-r--r-- | media-plugins/xmms-arts/files/digest-xmms-arts-0.4-r5 | 1 | ||||
-rw-r--r-- | media-plugins/xmms-arts/files/xmms-arts-0.4-gentoo-endian.patch | 268 | ||||
-rw-r--r-- | media-plugins/xmms-arts/files/xmmsarts-0.4-nocmallocc.patch | 22 | ||||
-rw-r--r-- | media-plugins/xmms-arts/xmms-arts-0.4-r5.ebuild | 48 |
5 files changed, 348 insertions, 1 deletions
diff --git a/media-plugins/xmms-arts/ChangeLog b/media-plugins/xmms-arts/ChangeLog index 8afaaa9c45f2..1120ea63ccd0 100644 --- a/media-plugins/xmms-arts/ChangeLog +++ b/media-plugins/xmms-arts/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for media-plugins/xmms-arts # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-plugins/xmms-arts/ChangeLog,v 1.3 2002/10/15 14:42:34 lostlogic Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-plugins/xmms-arts/ChangeLog,v 1.4 2002/10/25 18:47:08 lostlogic Exp $ + +*xmms-arts-0.4-r4 (15 Oct 2002) + + 15 Oct 2002; Brandon Low <lostlogic@gentoo.org> xmms-arts-0.4-r4.ebuild: + + Add patches from RedHat's SRPM for big endianness and nocmallocc + thanks to Thomas Nilsson <thomas@xmms.org> for poking me and + making me do it and all that. *xmms-arts-0.4-r4 (15 Oct 2002) diff --git a/media-plugins/xmms-arts/files/digest-xmms-arts-0.4-r5 b/media-plugins/xmms-arts/files/digest-xmms-arts-0.4-r5 new file mode 100644 index 000000000000..c9c2e8766e08 --- /dev/null +++ b/media-plugins/xmms-arts/files/digest-xmms-arts-0.4-r5 @@ -0,0 +1 @@ +MD5 0339aec5d67315da4a8242271cfc9f05 xmmsarts-0.4.tar.gz 114602 diff --git a/media-plugins/xmms-arts/files/xmms-arts-0.4-gentoo-endian.patch b/media-plugins/xmms-arts/files/xmms-arts-0.4-gentoo-endian.patch new file mode 100644 index 000000000000..de198e4a3374 --- /dev/null +++ b/media-plugins/xmms-arts/files/xmms-arts-0.4-gentoo-endian.patch @@ -0,0 +1,268 @@ +diff -Nru xmms-arts-0.4-clean/audio.c xmms-arts-0.4/audio.c +--- xmms-arts-0.4-clean/audio.c 2002-10-25 13:11:54.000000000 -0500 ++++ xmms-arts-0.4/audio.c 2002-10-25 13:13:11.000000000 -0500 +@@ -1,4 +1,4 @@ +-/* xmms - esound output plugin ++/* xmms - artsd output plugin + * Copyright (C) 1999 Galex Yen + * + * this program is free software +@@ -11,11 +11,20 @@ + * + * Contains code Copyright (C) 1998-1999 Mikael Alm, Olle Hallnas, + * Thomas Nillson and 4Front Technologies ++ * ++ * ++ * 2002 Oct 13 Balint Cristian (rezso@rdsor.ro) ++ * - fix 16 bit endianess ++ * - change topic to "artsd" instead "esd" ++ * ++ * ++ * + */ + + #include "artsout.h" + #include "config.h" + ++ + static gpointer buffer; + static gboolean going = FALSE, prebuffer, paused = FALSE, remove_prebuffer = FALSE; + static gint buffer_size, prebuffer_size, blk_size = 4096; +@@ -30,10 +39,72 @@ + static arts_stream_t stream = 0; + static pthread_t buffer_thread; + static gboolean realtime = FALSE; ++static void *(*artsd_translate)(void *, gint); ++int artsd_format; ++ ++static void *artsd_stou8(void *data, gint length) ++{ ++ int len = length; ++ unsigned char *dat = (unsigned char *)data; ++ while (len-- > 0) ++ *dat++ ^= 0x80; ++ return data; ++} ++ ++static void *artsd_utos16sw(void *data, gint length) ++{ ++ int len = length; ++ short *dat = data; ++ while ( len > 0 ) { ++ *dat = GUINT16_SWAP_LE_BE( *dat ) ^ 0x8000; ++ dat++; ++ len-=2; ++ } ++ return data; ++} ++static void *artsd_utos16(void *data, gint length) ++{ ++ int len = length; ++ short *dat = data; ++ while ( len > 0 ) { ++ *dat ^= 0x8000; ++ dat++; ++ len-=2; ++ } ++ return data; ++} ++static void *artsd_16sw(void *data, gint length) ++{ ++ int len = length; ++ short *dat = data; ++ while ( len > 0 ) { ++ *dat = GUINT16_SWAP_LE_BE( *dat ); ++ dat++; ++ len-=2; ++ } ++ return data; ++} ++ ++static void *artsd_none(void *data, gint length) ++{ ++ int len = length; ++ short *dat = data; ++ while ( len > 0 ) { ++ *dat = *dat; ++ dat++; ++ len-=2; ++ } ++ return data; ++} ++ + + + static void artsd_setup_format(AFormat fmt,gint rate, gint nch) + { ++ ++ gboolean swap_sign = FALSE; ++ gboolean swap_16 = FALSE; ++ + format = fmt; + frequency = rate; + channels = nch; +@@ -41,14 +112,16 @@ + latency = arts_stream_get(stream,ARTS_P_SERVER_LATENCY) * frequency / 44100 * channels; + + switch(fmt) { +- case FMT_U8: +- case FMT_S8: ++ case FMT_S8: ++ swap_sign = TRUE; ++ case FMT_U8: + latency *= 2; + sample_width = 8; + break; + case FMT_U16_LE: + case FMT_U16_BE: + case FMT_U16_NE: ++ swap_sign = TRUE; + case FMT_S16_LE: + case FMT_S16_BE: + case FMT_S16_NE: +@@ -56,8 +129,19 @@ + bps *= 2; + break; + } +-} + ++if (sample_width == 16) ++ ++#ifdef WORDS_BIGENDIAN ++ artsd_translate = artsd_16sw; ++#else ++ artsd_translate = artsd_none; ++#endif ++ ++else ++ artsd_translate = artsd_none; ++ ++} + + gint artsd_get_written_time(void) + { +@@ -158,11 +242,12 @@ + if(effects_enabled() && ep && ep->mod_samples) + length = ep->mod_samples(&data,length, input_format, input_frequency, input_channels); + +- errorcode = arts_write(stream,data,length); ++ errorcode = arts_write(stream,artsd_translate(data,length),length); + if(errorcode < 0) + fprintf(stderr,"arts_write error: %s\n",arts_error_text(errorcode)); +- else ++ else + output_bytes += errorcode; ++ + } + + +diff -Nru xmms-arts-0.4-clean/configure xmms-arts-0.4/configure +--- xmms-arts-0.4-clean/configure 2002-10-25 13:11:56.000000000 -0500 ++++ xmms-arts-0.4/configure 2002-10-25 13:12:43.000000000 -0500 +@@ -2434,6 +2434,95 @@ + echo "${ECHO_T}no, using $LN_S" >&6 + fi + ++echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ++echo "configure:1409: checking whether byte ordering is bigendian" >&5 ++if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_cv_c_bigendian=unknown ++# See if sys/param.h defines the BYTE_ORDER macro. ++cat > conftest.$ac_ext <<EOF ++#line 1416 "configure" ++#include "confdefs.h" ++#include <sys/types.h> ++#include <sys/param.h> ++int main() { ++ ++#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN ++ bogus endian macros ++#endif ++; return 0; } ++EOF ++if { (eval echo configure:1427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ # It does; now see whether it defined to BIG_ENDIAN or not. ++cat > conftest.$ac_ext <<EOF ++#line 1431 "configure" ++#include "confdefs.h" ++#include <sys/types.h> ++#include <sys/param.h> ++int main() { ++ ++#if BYTE_ORDER != BIG_ENDIAN ++ not big endian ++#endif ++; return 0; } ++EOF ++if { (eval echo configure:1442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_c_bigendian=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_c_bigendian=no ++fi ++rm -f conftest* ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++fi ++rm -f conftest* ++if test $ac_cv_c_bigendian = unknown; then ++if test "$cross_compiling" = yes; then ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++else ++ cat > conftest.$ac_ext <<EOF ++#line 1462 "configure" ++#include "confdefs.h" ++main () { ++ /* Are we little or big endian? From Harbison&Steele. */ ++ union ++ { ++ long l; ++ char c[sizeof (long)]; ++ } u; ++ u.l = 1; ++ exit (u.c[sizeof (long) - 1] == 1); ++} ++EOF ++if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_c_bigendian=no ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_c_bigendian=yes ++fi ++rm -fr conftest* ++fi ++ ++fi ++fi ++ ++echo "$ac_t""$ac_cv_c_bigendian" 1>&6 ++if test $ac_cv_c_bigendian = yes; then ++ cat >> confdefs.h <<\EOF ++#define WORDS_BIGENDIAN 1 ++EOF ++ ++fi + + + # Check for any special flags to pass to ltconfig. +diff -Nru xmms-arts-0.4-clean/configure.in xmms-arts-0.4/configure.in +--- xmms-arts-0.4-clean/configure.in 2000-11-20 22:30:00.000000000 -0600 ++++ xmms-arts-0.4/configure.in 2002-10-25 13:12:58.000000000 -0500 +@@ -15,6 +15,7 @@ + dnl Checks for header files. + AC_STDC_HEADERS + AC_CHECK_HEADERS(fcntl.h sys/time.h) ++AC_C_BIGENDIAN + + dnl Checks for Gtk+ + AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR([*** GLIB >= 1.2.0 not installed - please install first ***])) diff --git a/media-plugins/xmms-arts/files/xmmsarts-0.4-nocmallocc.patch b/media-plugins/xmms-arts/files/xmmsarts-0.4-nocmallocc.patch new file mode 100644 index 000000000000..acfdbe7d731b --- /dev/null +++ b/media-plugins/xmms-arts/files/xmmsarts-0.4-nocmallocc.patch @@ -0,0 +1,22 @@ +--- xmms-1.2.4/xmms-arts-0.4/Makefile.am.build Mon Jan 8 15:52:12 2001 ++++ xmms-1.2.4/xmms-arts-0.4/Makefile.am Mon Jan 8 15:52:26 2001 +@@ -1,7 +1,7 @@ + lib_LTLIBRARIES = libartsout.la + CFLAGS = @CFLAGS@ @GTK_CFLAGS@ `artsc-config --cflags` + LIBS = @LIBS@ @GTK_LIBS@ @PTHREAD_LIBS@ +-libartsout_la_LDFLAGS = `artsc-config --libs` -lcmallocc ++libartsout_la_LDFLAGS = `artsc-config --libs` + libartsout_la_SOURCES = about.c artsout.c artsout.h audio.c configure.c init.c mixer.c + libdir = $(xmms_output_plugin_dir) + XMMSPATH = $(XMMS_PATH) +--- xmms-1.2.4/xmms-arts-0.4/Makefile.in.build Mon Jan 8 15:52:17 2001 ++++ xmms-1.2.4/xmms-arts-0.4/Makefile.in Mon Jan 8 15:52:33 2001 +@@ -83,7 +83,7 @@ + lib_LTLIBRARIES = libartsout.la + CFLAGS = @CFLAGS@ @GTK_CFLAGS@ `artsc-config --cflags` + LIBS = @LIBS@ @GTK_LIBS@ @PTHREAD_LIBS@ +-libartsout_la_LDFLAGS = `artsc-config --libs` -lcmallocc ++libartsout_la_LDFLAGS = `artsc-config --libs` + libartsout_la_SOURCES = about.c artsout.c artsout.h audio.c configure.c init.c mixer.c + libdir = $(xmms_output_plugin_dir) + XMMSPATH = $(XMMS_PATH) diff --git a/media-plugins/xmms-arts/xmms-arts-0.4-r5.ebuild b/media-plugins/xmms-arts/xmms-arts-0.4-r5.ebuild new file mode 100644 index 000000000000..4100c802925a --- /dev/null +++ b/media-plugins/xmms-arts/xmms-arts-0.4-r5.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-plugins/xmms-arts/xmms-arts-0.4-r5.ebuild,v 1.1 2002/10/25 18:47:08 lostlogic Exp $ +inherit kde-base libtool + +# Note: we set many vars e.g. DEPEND insteaed of extending them because this isn't a proper KDE app, +# it only links against arts. So we need set-kdedir, but almost nothing else. So make sure it continues +# to override e.g. src_install. + +DESCRIPTION="This output plugin allows xmms to work with arts, KDE's sound system" +SRC_URI="http://stukach.com/hosted/m.i.a/xmmsarts/xmmsarts-0.4.tar.gz" +# HOMEPAGE="http://home.earthlink.net/~bheath/xmms-arts/" #disappeared from the 'net? +HOMEPAGE="http://www.xmms.org/plugins_output.html" + +LICENSE="GPL-2" +KEYWORDS="~x86" + +newdepend ">=media-sound/xmms-1.2.5-r1 + kde-base/arts" + +set-kdedir 3 + +src_unpack() { + unpack ${A} + cd ${S} + patch -p2 < ${FILESDIR}/${PN/-/}-${PV}-nocmallocc.patch || die "Failed patch" + cp Makefile.am Makefile.orig + sed -e "s:artsc-config:${KDEDIR}/bin/artsc-config:" \ + Makefile.orig > Makefile.am + patch -p1 < ${FILESDIR}/${P}-gentoo.patch || die "Failed patch" + autoconf + patch -p1 < ${FILESDIR}/${P}-gentoo-endian.patch || die "Failed patch" +} + +src_compile() { + elibtoolize + + kde_src_compile myconf # calls set-kdedir + CFLAGS="$CFLAGS -I/usr/X11R6/include -I/usr/include -I${KDEDIR}/include -I${KDEDIR}/include/artsc" + econf || die + emake || die +} + +src_install() { + make DESTDIR=${D} install || die + dodoc AUTHORS COPYING NEWS README +} + |