[Buildroot] [PATCH v2 1/1] package/libsidplay2: new package

Bernd Kuhls bernd.kuhls at t-online.de
Sun Mar 22 21:52:22 UTC 2015


Needed for upcoming kodi-audiodecoder-sidplay package

Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
---
v2: removed large portions of upstream 0001-sidplay2-libs-2.1.1.patch
    since we update config.guess/sub and reconfigure the package anyway

 package/Config.in                                  |    1 +
 package/libsidplay2/0001-sidplay2-libs-2.1.1.patch |  331 ++++++++++++++++++++
 package/libsidplay2/0002-pkg-config.patch          |   25 ++
 package/libsidplay2/Config.in                      |   13 +
 package/libsidplay2/libsidplay2.hash               |    2 +
 package/libsidplay2/libsidplay2.mk                 |   15 +
 6 files changed, 387 insertions(+)
 create mode 100644 package/libsidplay2/0001-sidplay2-libs-2.1.1.patch
 create mode 100644 package/libsidplay2/0002-pkg-config.patch
 create mode 100644 package/libsidplay2/Config.in
 create mode 100644 package/libsidplay2/libsidplay2.hash
 create mode 100644 package/libsidplay2/libsidplay2.mk

diff --git a/package/Config.in b/package/Config.in
index ed8b123..1c21500 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -623,6 +623,7 @@ menu "Audio/Sound"
 	source "package/libmpdclient/Config.in"
 	source "package/libreplaygain/Config.in"
 	source "package/libsamplerate/Config.in"
+	source "package/libsidplay2/Config.in"
 	source "package/libsndfile/Config.in"
 	source "package/libsoxr/Config.in"
 	source "package/libvorbis/Config.in"
diff --git a/package/libsidplay2/0001-sidplay2-libs-2.1.1.patch b/package/libsidplay2/0001-sidplay2-libs-2.1.1.patch
new file mode 100644
index 0000000..3f76644
--- /dev/null
+++ b/package/libsidplay2/0001-sidplay2-libs-2.1.1.patch
@@ -0,0 +1,331 @@
+Various fixes to compile libsidplay2 with newer gcc compilers
+
+Downloaded from
+http://tsubasa.googlecode.com/svn/trunk/tsubasa/sidplay2-libs/sidplay2-libs-2.1.1.diff
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
+
+--- sidplay-libs-2.1.1.orig/Makefile.in
++++ sidplay-libs-2.1.1/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated by automake 1.8.4 from Makefile.am.
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+@@ -253,7 +253,7 @@
+ 	fi; \
+ 	list='$(SUBDIRS)'; for subdir in $$list; do \
+ 	  if test "$$subdir" = .; then :; else \
+-	    test -f $$subdir/TAGS && \
++	    test ! -f $$subdir/TAGS || \
+ 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ 	  fi; \
+ 	done; \
+@@ -264,7 +264,7 @@
+ 	  $(AWK) '    { files[$$0] = 1; } \
+ 	       END { for (i in files) print i; }'`; \
+ 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+-	  test -z "$$unique" && unique=$$empty_fix; \
++	  test -n "$$unique" || unique=$$empty_fix; \
+ 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ 	    $$tags $$unique; \
+ 	fi
+--- sidplay-libs-2.1.1.orig/aclocal.m4
++++ sidplay-libs-2.1.1/aclocal.m4
+@@ -1,4 +1,4 @@
+-# generated automatically by aclocal 1.8.4 -*- Autoconf -*-
++# generated automatically by aclocal 1.8.5 -*- Autoconf -*-
+ 
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ # Free Software Foundation, Inc.
+@@ -40,7 +40,7 @@
+ # Call AM_AUTOMAKE_VERSION so it can be traced.
+ # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+-	 [AM_AUTOMAKE_VERSION([1.8.4])])
++	 [AM_AUTOMAKE_VERSION([1.8.5])])
+ 
+ # AM_AUX_DIR_EXPAND
+ 
+--- sidplay-libs-2.1.1.orig/builders/Makefile.in
++++ sidplay-libs-2.1.1/builders/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated by automake 1.8.4 from Makefile.am.
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+@@ -130,9 +130,9 @@
+ 	      exit 1;; \
+ 	  esac; \
+ 	done; \
+-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  builders/Makefile'; \
++	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  builders/Makefile'; \
+ 	cd $(top_srcdir) && \
+-	  $(AUTOMAKE) --gnu  builders/Makefile
++	  $(AUTOMAKE) --foreign  builders/Makefile
+ .PRECIOUS: Makefile
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ 	@case '$?' in \
+@@ -234,7 +234,7 @@
+ 	fi; \
+ 	list='$(SUBDIRS)'; for subdir in $$list; do \
+ 	  if test "$$subdir" = .; then :; else \
+-	    test -f $$subdir/TAGS && \
++	    test ! -f $$subdir/TAGS || \
+ 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ 	  fi; \
+ 	done; \
+@@ -245,7 +245,7 @@
+ 	  $(AWK) '    { files[$$0] = 1; } \
+ 	       END { for (i in files) print i; }'`; \
+ 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+-	  test -z "$$unique" && unique=$$empty_fix; \
++	  test -n "$$unique" || unique=$$empty_fix; \
+ 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ 	    $$tags $$unique; \
+ 	fi
+--- sidplay-libs-2.1.1.orig/builders/hardsid-builder/src/hardsid-builder.cpp
++++ sidplay-libs-2.1.1/builders/hardsid-builder/src/hardsid-builder.cpp
+@@ -47,6 +47,7 @@
+  ***************************************************************************/
+ 
+ #include <stdio.h>
++#include <cstring>
+ #include "config.h"
+ 
+ #ifdef HAVE_EXCEPTIONS
+--- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid-builder.cpp
++++ sidplay-libs-2.1.1/builders/resid-builder/src/resid-builder.cpp
+@@ -37,6 +37,7 @@
+  ***************************************************************************/
+ 
+ #include <stdio.h>
++#include <cstring>
+ 
+ #include "config.h"
+ #ifdef HAVE_EXCEPTIONS
+--- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid.cpp
++++ sidplay-libs-2.1.1/builders/resid-builder/src/resid.cpp
+@@ -16,6 +16,7 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
++#include <cstring>
+ #include "config.h"
+ 
+ #ifdef HAVE_EXCEPTIONS
+--- sidplay-libs-2.1.1.orig/configure.ac
++++ sidplay-libs-2.1.1/configure.ac
+@@ -2,7 +2,7 @@
+ 
+ #Variables
+ pwd=`pwd`
+-builders='${libdir}'/sidplay/builders
++builders='${libdir}'/
+ ac_configure_args="$ac_configure_args --disable-library-checks"
+ 
+ AC_CONFIG_AUX_DIR(unix)
+@@ -11,7 +11,7 @@
+ 
+ hardsid=false
+ case "$host" in
+-    *linux*) hardsid=true
++    *linux*|*-k*bsd*-gnu) hardsid=true
+         ;;
+ esac
+ AM_CONDITIONAL(HARDSID, test x$hardsid = xtrue)
+--- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/SmartPtr.h
++++ sidplay-libs-2.1.1/libsidplay/include/sidplay/SmartPtr.h
+@@ -17,16 +17,16 @@
+ 		doFree = bufOwner;
+ 		if ( bufferLen >= 1 )
+ 		{
+-			pBufCurrent = ( bufBegin = buffer );
+-			bufEnd = bufBegin + bufferLen;
+-			bufLen = bufferLen;
+-			status = true;
++			this->pBufCurrent = ( this->bufBegin = buffer );
++			this->bufEnd = this->bufBegin + bufferLen;
++			this->bufLen = bufferLen;
++			this->status = true;
+ 		}
+ 		else
+ 		{
+-			pBufCurrent = ( bufBegin = ( bufEnd = 0 ));
+-			bufLen = 0;
+-			status = false;
++			this->pBufCurrent = ( this->bufBegin = ( this->bufEnd = 0 ));
++			this->bufLen = 0;
++			this->status = false;
+ 		}
+ 	}
+ 	
+@@ -211,16 +211,16 @@
+ 	{
+ 		if ( bufferLen >= 1 )
+ 		{
+-			pBufCurrent = ( bufBegin = buffer );
+-			bufEnd = bufBegin + bufferLen;
+-			bufLen = bufferLen;
+-			status = true;
++			this->pBufCurrent = ( this->bufBegin = buffer );
++			this->bufEnd = this->bufBegin + bufferLen;
++			this->bufLen = bufferLen;
++			this->status = true;
+ 		}
+ 		else
+ 		{
+-			pBufCurrent = bufBegin = bufEnd = 0;
+-			bufLen = 0;
+-			status = false;
++			this->pBufCurrent = this->bufBegin = this->bufEnd = 0;
++			this->bufLen = 0;
++			this->status = false;
+ 		}
+ 	}
+ };
+--- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/sidendian.h
++++ sidplay-libs-2.1.1/libsidplay/include/sidplay/sidendian.h
+@@ -16,6 +16,10 @@
+  ***************************************************************************/
+ /***************************************************************************
+  *  $Log: sidendian.h,v $
++ *  Revision 1.6  2005/11/20 11:02:06  s_a_white
++ *  Work around for bug in gcc 4 (optimiser breaks if variable never has a
++ *  direct assignment).
++ *
+  *  Revision 1.5  2001/07/03 22:44:13  s_a_white
+  *  Added endian_16 to convert a 16 bit value to an array of 8s.
+  *
+@@ -141,7 +145,7 @@
+ // Convert high-byte and low-byte to 16-bit word.
+ inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo)
+ {
+-    uint_least16_t word;
++    uint_least16_t word = 0;
+     endian_16lo8 (word, lo);
+     endian_16hi8 (word, hi);
+     return word;
+@@ -165,7 +169,7 @@
+ 
+ inline void endian_16 (char ptr[2], uint_least16_t word)
+ {
+-	endian_16 ((uint8_t *) ptr, word);
++    endian_16 ((uint8_t *) ptr, word);
+ }
+ 
+ // Convert high-byte and low-byte to 16-bit little endian word.
+@@ -334,7 +338,7 @@
+ // Swap word endian.
+ inline void endian_32swap8 (uint_least32_t &dword)
+ {
+-    uint_least16_t lo, hi;
++    uint_least16_t lo = 0, hi = 0;
+     lo = endian_32lo16 (dword);
+     hi = endian_32hi16 (dword);
+     endian_16swap8 (lo);
+@@ -346,8 +350,8 @@
+ // Convert high-byte and low-byte to 32-bit word.
+ inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo)
+ {
+-    uint_least32_t dword;
+-    uint_least16_t word;
++    uint_least32_t dword = 0;
++    uint_least16_t word  = 0;
+     endian_32lo8  (dword, lo);
+     endian_32hi8  (dword, hi);
+     endian_16lo8  (word,  hilo);
+@@ -374,7 +378,7 @@
+     defined(SID_WORDS_LITTLEENDIAN)
+     *((uint_least32_t *) ptr) = dword;
+ #else
+-    uint_least16_t word;
++    uint_least16_t word = 0;
+     ptr[0] = endian_32lo8  (dword);
+     ptr[1] = endian_32hi8  (dword);
+     word   = endian_32hi16 (dword);
+@@ -401,7 +405,7 @@
+     defined(SID_WORDS_BIGENDIAN)
+     *((uint_least32_t *) ptr) = dword;
+ #else
+-    uint_least16_t word;
++    uint_least16_t word = 0;
+     word   = endian_32hi16 (dword);
+     ptr[1] = endian_16lo8  (word);
+     ptr[0] = endian_16hi8  (word);
+--- sidplay-libs-2.1.1.orig/libsidplay/unix/config.h.in
++++ sidplay-libs-2.1.1/libsidplay/unix/config.h.in
+@@ -72,22 +72,22 @@
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+ 
+-/* The size of a `char', as computed by sizeof. */
++/* The size of `char', as computed by sizeof. */
+ #undef SIZEOF_CHAR
+ 
+-/* The size of a `int', as computed by sizeof. */
++/* The size of `int', as computed by sizeof. */
+ #undef SIZEOF_INT
+ 
+ /* The number of bytes in type long */
+ #undef SIZEOF_LONG
+ 
+-/* The size of a `long int', as computed by sizeof. */
++/* The size of `long int', as computed by sizeof. */
+ #undef SIZEOF_LONG_INT
+ 
+ /* The number of bytes in type short */
+ #undef SIZEOF_SHORT
+ 
+-/* The size of a `short int', as computed by sizeof. */
++/* The size of `short int', as computed by sizeof. */
+ #undef SIZEOF_SHORT_INT
+ 
+ /* The number of bytes in type void* */
+--- sidplay-libs-2.1.1.orig/libsidplay/unix/my_macros.m4
++++ sidplay-libs-2.1.1/libsidplay/unix/my_macros.m4
+@@ -105,8 +105,9 @@
+     AC_CACHE_VAL(test_cv_have_ios_openmode,
+     [
+         AC_TRY_COMPILE(
+-            [#include <fstream.h>
+-             #include <iomanip.h>],
++            [#include <fstream>
++             #include <iomanip>
++	     using namespace std;],
+             [ios::openmode myTest = ios::in;],
+             [test_cv_have_ios_openmode=yes],
+             [test_cv_have_ios_openmode=no]
+--- sidplay-libs-2.1.1.orig/libsidplay/unix/sidint.h
++++ sidplay-libs-2.1.1/libsidplay/unix/sidint.h
+@@ -0,0 +1,17 @@
++#ifndef _UNIX_SIDINT_H
++#define _UNIX_SIDINT_H 1
++#ifndef _GENERATED_STDINT_H
++#define _GENERATED_STDINT_H "libsidplay 2.1.1"
++/* generated using a gnu compiler version gcc (Debian 4.3-20080219-1) 4.3.0 20080219 (prerelease) [gcc-4_3-branch revision 132456] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
++
++#include <stdint.h>
++
++
++/* system headers have good uint64_t */
++#ifndef _HAVE_UINT64_T
++#define _HAVE_UINT64_T
++#endif
++
++  /* once */
++#endif
++#endif
+--- sidplay-libs-2.1.1.orig/libsidutils/include/sidplay/utils/SidUsage.h
++++ sidplay-libs-2.1.1/libsidutils/include/sidplay/utils/SidUsage.h
+@@ -33,7 +33,7 @@
+     uint_least16_t length;  // usage scan length
+ 
+     // Copy common parts of basic usage to extended usage.
+-    sid2_usage_t &sid2_usage_t::operator= (const sid_usage_t &usage)
++    sid2_usage_t &operator= (const sid_usage_t &usage)
+     {
+         *((sid_usage_t *) this) = usage;
+         return *this;
diff --git a/package/libsidplay2/0002-pkg-config.patch b/package/libsidplay2/0002-pkg-config.patch
new file mode 100644
index 0000000..ce37e94
--- /dev/null
+++ b/package/libsidplay2/0002-pkg-config.patch
@@ -0,0 +1,25 @@
+Include correct libdir in pkgconfig files
+
+Downloaded from
+https://sources.debian.net/src/sidplay-libs/2.1.1-14/debian/patches/pkg-config.patch/
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
+
+--- sidplay-libs-2.1.1.orig/libsidplay/unix/libsidplay2.pc.in
++++ sidplay-libs-2.1.1/libsidplay/unix/libsidplay2.pc.in
+@@ -7,5 +7,5 @@ builders=@builders@
+ Name: @PACKAGE@
+ Description: C64 cycle exact stereo sidplayer library.
+ Version: @VERSION@
+-Libs: ${libdir}/libsidplay2.la
++Libs: -L${libdir} -lsidplay2
+ Cflags: -DHAVE_UNIX -I${includedir}
+--- sidplay-libs-2.1.1.orig/libsidutils/unix/libsidutils.pc.in
++++ sidplay-libs-2.1.1/libsidutils/unix/libsidutils.pc.in
+@@ -6,5 +6,5 @@ includedir=@includedir@
+ Name: @PACKAGE@
+ Description: Utils for supporting the libsidplay2 library.
+ Version: @VERSION@
+-Libs: ${libdir}/libsidutils.la
++Libs: -L${libdir} -lsidutils
+ Cflags: -DHAVE_UNIX -I${includedir}
diff --git a/package/libsidplay2/Config.in b/package/libsidplay2/Config.in
new file mode 100644
index 0000000..5698367
--- /dev/null
+++ b/package/libsidplay2/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_LIBSIDPLAY2
+	bool "libsidplay2"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Sidplay 2 is the second in the Sidplay series originally developed by
+	  Michael Schwendt. This version is written by Simon White and is cycle
+	  accurate for improved sound reproduction. Sidplay 2 is capable of
+	  playing all C64 mono and stereo file formats.
+
+	  http://sourceforge.net/projects/sidplay2
+
+comment "libsidplay2 needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/libsidplay2/libsidplay2.hash b/package/libsidplay2/libsidplay2.hash
new file mode 100644
index 0000000..1b45cb8
--- /dev/null
+++ b/package/libsidplay2/libsidplay2.hash
@@ -0,0 +1,2 @@
+# From http://sourceforge.net/projects/sidplay2/files/sidplay2/sidplay-libs-2.1.1/
+sha1	8af6350866edc30b0d331e075fa97292f6f645a5	sidplay-libs-2.1.1.tar.gz
diff --git a/package/libsidplay2/libsidplay2.mk b/package/libsidplay2/libsidplay2.mk
new file mode 100644
index 0000000..b294964
--- /dev/null
+++ b/package/libsidplay2/libsidplay2.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libsidplay2
+#
+################################################################################
+
+LIBSIDPLAY2_VERSION = 2.1.1
+LIBSIDPLAY2_SOURCE = sidplay-libs-$(LIBSIDPLAY2_VERSION).tar.gz
+LIBSIDPLAY2_SITE = http://downloads.sourceforge.net/project/sidplay2/sidplay2/sidplay-libs-$(LIBSIDPLAY2_VERSION)
+LIBSIDPLAY2_LICENSE = GPLv2+
+LIBSIDPLAY2_LICENSE_FILES = libsidplay/COPYING
+LIBSIDPLAY2_AUTORECONF = YES
+LIBSIDPLAY2_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
-- 
1.7.10.4



More information about the buildroot mailing list