summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2009-10-18 14:39:22 +0200
committerFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2009-10-18 14:39:22 +0200
commitcc9e1d405e9336bf771bba2e2125c38fdde5aa10 (patch)
treefcf7696878d91dafc80d375611ee110032c93447 /recipes
parent99d5ba358e3f063f87300fa4598f331431303217 (diff)
cdstatus: updated to 0.97.01
Diffstat (limited to 'recipes')
-rw-r--r--recipes/cdstatus/cdstatus-0.97.01/Makefile.am.patch10
-rw-r--r--recipes/cdstatus/cdstatus-0.97.01/cddb_connect_to_server.c.patch13
-rw-r--r--recipes/cdstatus/cdstatus-0.97.01/cdstatus.patch131
-rw-r--r--recipes/cdstatus/cdstatus_0.97.01.bb27
4 files changed, 181 insertions, 0 deletions
diff --git a/recipes/cdstatus/cdstatus-0.97.01/Makefile.am.patch b/recipes/cdstatus/cdstatus-0.97.01/Makefile.am.patch
new file mode 100644
index 0000000000..b438736d73
--- /dev/null
+++ b/recipes/cdstatus/cdstatus-0.97.01/Makefile.am.patch
@@ -0,0 +1,10 @@
+Index: cdstatus-0.97.01/src/Makefile.am
+===================================================================
+--- cdstatus-0.97.01.orig/src/Makefile.am
++++ cdstatus-0.97.01/src/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CFLAGS = -O2 -funroll-loops -finline-functions --std=c99
++AM_CFLAGS = -O2 -funroll-loops -finline-functions
+ bin_PROGRAMS = cdstatus
+ cdstatus_SOURCES = \
+ args.h \
diff --git a/recipes/cdstatus/cdstatus-0.97.01/cddb_connect_to_server.c.patch b/recipes/cdstatus/cdstatus-0.97.01/cddb_connect_to_server.c.patch
new file mode 100644
index 0000000000..96437e4f26
--- /dev/null
+++ b/recipes/cdstatus/cdstatus-0.97.01/cddb_connect_to_server.c.patch
@@ -0,0 +1,13 @@
+Index: cdstatus-0.97.01/src/cddb_connect_to_server.c
+===================================================================
+--- cdstatus-0.97.01.orig/src/cddb_connect_to_server.c
++++ cdstatus-0.97.01/src/cddb_connect_to_server.c
+@@ -54,7 +54,7 @@ int cddbConnectToServer(const char * cdd
+ }
+ return 0;
+ }
+- memcpy(&(dest_addr.sin_addr.s_addr), host_info->h_addr, (size_t)host_info->h_length);
++ memcpy(&(dest_addr.sin_addr.s_addr), host_info->h_addr_list[0], (size_t)host_info->h_length);
+ /*I hope this doesn't break stuff... */
+ /*free(host_info->h_name);
+ free(host_info);*/
diff --git a/recipes/cdstatus/cdstatus-0.97.01/cdstatus.patch b/recipes/cdstatus/cdstatus-0.97.01/cdstatus.patch
new file mode 100644
index 0000000000..913cd721e0
--- /dev/null
+++ b/recipes/cdstatus/cdstatus-0.97.01/cdstatus.patch
@@ -0,0 +1,131 @@
+*** cdstatus-0.96.05/src/cdstatus.c.orig 2005-11-26 16:23:27.000000000 +0100
+--- cdstatus-0.96.05/src/cdstatus.c 2005-11-26 19:06:57.000000000 +0100
+***************
+*** 436,441 ****
+--- 436,501 ----
+ return 0;
+ }
+
++ /* following code copied from
++ http://www.gamedev.net/reference/articles/article2091.asp
++ it has been slightly modified as we did not have a reason to output
++ big endian or float
++ */
++ static short ShortSwap( short s )
++ {
++ unsigned char b1, b2;
++
++ b1 = s & 255;
++ b2 = (s >> 8) & 255;
++
++ return (b1 << 8) + b2;
++ }
++
++ static short ShortNoSwap( short s )
++ {
++ return s;
++ }
++
++ static int LongSwap (int i)
++ {
++ unsigned char b1, b2, b3, b4;
++
++ b1 = i & 255;
++ b2 = ( i >> 8 ) & 255;
++ b3 = ( i>>16 ) & 255;
++ b4 = ( i>>24 ) & 255;
++
++ return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4;
++ }
++
++ static int LongNoSwap( int i )
++ {
++ return i;
++ }
++
++ static short (*LittleShort) ( short s );
++ static int (*LittleLong) ( int i );
++
++ static void InitEndian( void )
++ {
++ char SwapTest[2] = { 1, 0 };
++
++ if( *(short *) SwapTest == 1 )
++ {
++ // little endian
++ //set func pointers to correct funcs
++ LittleShort = ShortNoSwap;
++ LittleLong = LongNoSwap;
++ }
++ else
++ {
++ // big endian
++ LittleShort = ShortSwap;
++ LittleLong = LongSwap;
++ }
++ }
++ /* end of copied code */
++
+ static void writeWavHeader(unsigned int readframes, FILE * audio_out)
+ {
+ long int chunksize;
+***************
+*** 456,478 ****
+
+ wavHeader wHeader;
+
+ /* "RIFF" */
+! wHeader.RIFF_header = 0x46464952;
+
+ chunksize = readframes * CD_FRAMESIZE_RAW;
+! wHeader.total_size = (int32_t)(chunksize + sizeof(wavHeader));
+
+ /* "WAVEfmt " */
+! wHeader.WAVE = 0x45564157;
+! wHeader.fmt = 0x20746D66;
+
+! wHeader.subchunk_size = 16;
+! wHeader.audio_format = 1;
+! wHeader.number_channels = 2;
+! wHeader.sampling_rate = 44100;
+! wHeader.byte_rate = 176400;
+! wHeader.block_align = 4;
+! wHeader.bits_per_sample = 16;
+
+ if(fwrite((const void *) &wHeader, sizeof(wavHeader), (size_t) 1, audio_out)!=1)
+ {
+--- 516,539 ----
+
+ wavHeader wHeader;
+
++ InitEndian();
+ /* "RIFF" */
+! wHeader.RIFF_header = LittleLong(0x46464952);
+
+ chunksize = readframes * CD_FRAMESIZE_RAW;
+! wHeader.total_size = LittleLong((int32_t)(chunksize + sizeof(wavHeader)));
+
+ /* "WAVEfmt " */
+! wHeader.WAVE = LittleLong(0x45564157);
+! wHeader.fmt = LittleLong(0x20746D66);
+
+! wHeader.subchunk_size = LittleLong(16);
+! wHeader.audio_format = LittleShort(1);
+! wHeader.number_channels = LittleShort(2);
+! wHeader.sampling_rate = LittleLong(44100);
+! wHeader.byte_rate = LittleLong(176400);
+! wHeader.block_align = LittleShort(4);
+! wHeader.bits_per_sample = LittleShort(16);
+
+ if(fwrite((const void *) &wHeader, sizeof(wavHeader), (size_t) 1, audio_out)!=1)
+ {
+***************
+*** 492,497 ****
+--- 553,559 ----
+ }
+ exit(EXIT_FAILURE);
+ }
++ chunksize = LittleLong(chunksize);
+ if(fwrite((const void *) &chunksize, sizeof(long int), (size_t) 1, audio_out)!=1)
+ {
+ perror("Error writing wav file chunksize header");
diff --git a/recipes/cdstatus/cdstatus_0.97.01.bb b/recipes/cdstatus/cdstatus_0.97.01.bb
new file mode 100644
index 0000000000..dd20e04aa1
--- /dev/null
+++ b/recipes/cdstatus/cdstatus_0.97.01.bb
@@ -0,0 +1,27 @@
+# cdstatus OE build file
+
+PR ="r0"
+LICENSE="GPL"
+HOMEPAGE = "http://cdstatus.sourceforge.net/"
+FILES_${PN} += "${datadir}/cdstatus.cfg"
+# need __USE_MISC to get h_addr macro in netdb.h
+CFLAGS += -D__USE_MISC
+
+SRC_URI="${SOURCEFORGE_MIRROR}/cdstatus/cdstatus-0.97.01.tar.gz \
+ file://Makefile.am.patch;patch=1 \
+ file://cddb_connect_to_server.c.patch;patch=1 \
+ file://cdstatus.patch;patch=1"
+
+S="${WORKDIR}/cdstatus-0.97.01"
+
+inherit autotools
+
+do_install() {
+ install -d 0755 ${D}/${bindir}
+ install -d 0755 ${D}/${datadir}
+ install -d 0755 ${D}/${mandir}
+ install -m 0755 src/cdstatus ${D}/${bindir}
+ install -m 0644 cdstatus.cfg ${D}/${datadir}
+ install -m 0644 cdstatus.1 ${D}/${mandir}
+
+}