cdstatus: updated to 0.97.01
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Sun, 18 Oct 2009 12:39:22 +0000 (14:39 +0200)
committerFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Sun, 18 Oct 2009 12:39:22 +0000 (14:39 +0200)
conf/checksums.ini
recipes/cdstatus/cdstatus-0.97.01/Makefile.am.patch [new file with mode: 0644]
recipes/cdstatus/cdstatus-0.97.01/cddb_connect_to_server.c.patch [new file with mode: 0644]
recipes/cdstatus/cdstatus-0.97.01/cdstatus.patch [new file with mode: 0644]
recipes/cdstatus/cdstatus_0.97.01.bb [new file with mode: 0644]

index a22411f..736de29 100644 (file)
@@ -3694,6 +3694,10 @@ sha256=f33cbb551e494747b76bfbeba3954b4839fe7c849f200746fd7dc21bd665aa56
 md5=cd7ea4ef72a08b388523c528d81ba3ca
 sha256=f33cbb551e494747b76bfbeba3954b4839fe7c849f200746fd7dc21bd665aa56
 
+[http://downloads.sourceforge.net/cdstatus/cdstatus-0.97.01.tar.gz]
+md5=e53d3f8759251603c980b38982a85f1e
+sha256=548b5b402ee5fff34fe428eb69de560b56709337cd70c600ad21686c1321dd66
+
 [http://hinterhof.net/cdtool/dist/cdtool-2.1.8.tar.gz]
 md5=7b19b6f68d2c648296378b784d5f7681
 sha256=73de81ea2de2eae64b888e1b2739ef643ccea13c79790569f8e6278369976a21
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 (file)
index 0000000..b438736
--- /dev/null
@@ -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 (file)
index 0000000..96437e4
--- /dev/null
@@ -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 (file)
index 0000000..913cd72
--- /dev/null
@@ -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 (file)
index 0000000..dd20e04
--- /dev/null
@@ -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}
+
+}