cdparanoia stable port information

Package: cdparanoia
Version: 3a9.8
Revision: 15
Source: http://www.buserror.net/cdparanoia/%n-osx-5.tar.gz
SourceDirectory: %n-osx-5
Source-MD5: 26c82a4841567087b79318e1f72afc2e
NoSetMAKEFLAGS: true
SetMAKEFLAGS: -j1
ConfigureParams: --mandir=%i/share/man
Depends: libcdparanoia0-shlibs
BuildDepends: fink (>= 0.24.12)
DocFiles: FAQ.txt README GPL README.OSX
Description: Audio extraction tool for sampling CDs
DescDetail: <<
Unlike similar programs such as cdda2wav, cdparanoia goes to great
lengths to try to extract the audio information without any artifacts
such as jitter.
<<
PatchFile: %n.patch
PatchFile-MD5: 71a93b28d71e22f3e9d14d8cf812060a
PatchScript: <<
%{default_script}
perl -pi -e 's,scsi-commands/SCSITaskLib.h,scsi/SCSITaskLib.h,g' interface/*.h interface/*.c
perl -pi -e 's,-O20,-O3,g' configure
<<
CompileScript: <<
#!/bin/sh -ev
./configure %c
DISTCC_HOSTS='' MAKEFLAGS='-j1' make
<<
InstallScript: <<
make install prefix=%i
mkdir %i/include/libcdparanoia
mv %i/include/*.h %i/include/libcdparanoia
<<
Splitoff: <<
Package: libcdparanoia0-shlibs
Description: Shared libraries for cdparanoia (runtime lib)
Files: lib/libcdda_*.0.*
DocFiles: FAQ.txt README GPL README.OSX
Shlibs: <<
%p/lib/libcdda_interface.0.dylib 9.8.0 libcdparanoia0-shlibs (>= 3a9.8-1)
%p/lib/libcdda_paranoia.0.dylib 9.8.0 libcdparanoia0-shlibs (>= 3a9.8-1)
<<

<<
Splitoff2: <<
Package: libcdparanoia0-dev
Depends: libcdparanoia0-shlibs (= %v-%r)
BuildDependsOnly: true
Description: Development files needed to compile programs that use libcdparanoia.
DocFiles: FAQ.txt README GPL README.OSX
Files: include lib

<<

DescPort: <<
dmacks (as of 3a9.8-15) with pogma's help...
In xcode4 (and maybe others) cpp doesn't like foo({a,b,c})
when foo() is a macro (doesn't treat {} as a grouping, so
thinks it's 3 parameters). And memcpy() is a compiler builtin.
Move the {} array definition into a temp variable and pass the
array address instead of passing a cast of the array itself.
<<
DescPackaging: <<
Starting in 3a9.8-11, headers are in %p/include/libcdparanoia,
not loose in %p/include, because some have generic names that
are confusing other packages' build processes.
<<
License: GPL
Maintainer: Chris Zubrzycki
Homepage: http://www.buserror.net/cdparanoia/

cdparanoia stable port .patch

diff -Nurd -x'*~' cdparanoia-osx-5.orig/interface/osx_scsi_interface.c cdparanoia-osx-5/interface/osx_scsi_interface.c
--- cdparanoia-osx-5.orig/interface/osx_scsi_interface.c 2005-01-21 21:37:15.000000000 -0500
+++ cdparanoia-osx-5/interface/osx_scsi_interface.c 2011-06-06 13:27:19.000000000 -0400
@@ -174,7 +174,7 @@

static int mode_sense_atapi(cdrom_drive *d, int size, int page)
{
- memcpy(d->cmdbuf, (char[]) {
+ static char memblob[] = {
0x5A, /* MODE_SENSE */
0x00, /* reserved */
0x00, /* page */
@@ -184,7 +184,8 @@
0, /* reserved */
0, /* MSB (0) */
0, /* sizeof(modesense - SG_OFF) */
- 0}, /* reserved */
+ 0}; /* reserved */
+ memcpy(d->cmdbuf, memblob,
10);

d->cmdbuf[1] = d->lun << 5;
@@ -216,13 +217,14 @@

static int mode_sense_scsi(cdrom_drive *d, int size, int page)
{
- memcpy(d->cmdbuf,
- (char[]) {0x1A, /* MODE_SENSE */
+ static char memblob[] =
+ {0x1A, /* MODE_SENSE */
0x00, /* return block descriptor/lun */
0x00, /* page */
0, /* reserved */
0, /* sizeof(modesense - SG_OFF) */
- 0}, /* control */
+ 0}; /* control */
+ memcpy(d->cmdbuf, memblob,
6);

d->cmdbuf[1] = d->lun << 5;
@@ -247,7 +249,7 @@
if (d->is_atapi) {
unsigned char *mode = d->databuf + 8;

- memcpy(d->cmdbuf, (char[]) {
+ static char memblob1[] = {
0x55, /* MODE_SELECT */
0x10, /* no save page */
0, /* reserved */
@@ -257,17 +259,19 @@
0, /* reserved */
0, /* reserved */
12, /* sizeof(mode) */
- 0}, /* reserved */
+ 0}; /* reserved */
+ memcpy(d->cmdbuf, memblob1,
10);

- memcpy(d->databuf, (char[]) {
+ static char memblob2[] = {
/* mode parameter header */
0, 0, 0, 0, 0, 0, 0, 8, /* Block Descriptor Length */
/* descriptor block */
0, /* Density Code */
0, 0, 0, /* # of Blocks */
0, /* reserved */
- 0, 0, 0}, /* Blocklen */
+ 0, 0, 0}; /* Blocklen */
+ memcpy(d->databuf, memblob2,
16);

d->cmdbuf[1] |= d->lun << 5;
@@ -282,22 +286,24 @@
} else {
unsigned char *mode = d->databuf + 4;

- memcpy(d->cmdbuf, (char[]) {
+ static char memblob1[] = {
0x15, /* MODE_SELECT */
0x10, /* no save page */
0, /* reserved */
0, /* reserved */
12, /* sizeof(mode) */
- 0}, /* reserved */
+ 0}; /* reserved */
+ memcpy(d->cmdbuf, memblob1,
6);

- memcpy(d->databuf, (char[]) {
+ static char memblob2[] = {
/* mode section */
0, 0, 0, 8, /* Block Descriptor Length */
0, /* Density Code */
0, 0, 0, /* # of Blocks */
0, /* reserved */
- 0, 0, 0}, /* Blocklen */
+ 0, 0, 0}; /* Blocklen */
+ memcpy(d->databuf, memblob2,
12);

/* prepare to read cds in the previous mode */
@@ -385,9 +391,10 @@
scsi_TOC2 *toc;

/* read the header first */
- memcpy(d->cmdbuf, (char[]) {
+ static char memblob[] = {
0x43, 2, 2, 0, 0, 0, 1, session_buf_size / 256,
- session_buf_size % 256, 0}, 10);
+ session_buf_size % 256, 0};
+ memcpy(d->cmdbuf, memblob, 10);
d->cmdbuf[1] = d->lun << 5;

if (handle_scsi_cmd(d, 10, 0, session_buf_size, '\377', 1)) {
@@ -481,8 +488,9 @@
return -4;

/* read the header first */
- memcpy(d->cmdbuf, (char[]) {
- 0x43, 0, 0, 0, 0, 0, 1, 0, 12, 0}, 10);
+ static char memblob1[] = {
+ 0x43, 0, 0, 0, 0, 0, 1, 0, 12, 0};
+ memcpy(d->cmdbuf, memblob1, 10);
d->cmdbuf[1] = d->lun << 5;

if (handle_scsi_cmd(d, 10, 0, 12, '\377', 1)) {
@@ -500,8 +508,9 @@
}

for (i = first; i <= last; i++) {
- memcpy(d->cmdbuf, (char[]) {
- 0x43, 0, 0, 0, 0, 0, 0, 0, 12, 0}, 10);
+ static char memblob[] = {
+ 0x43, 0, 0, 0, 0, 0, 0, 0, 12, 0};
+ memcpy(d->cmdbuf, memblob, 10);
d->cmdbuf[1] = d->lun << 5;
d->cmdbuf[6] = i;

@@ -531,8 +540,9 @@
}
}

- memcpy(d->cmdbuf, (char[]) {
- 0x43, 0, 0, 0, 0, 0, 0, 0, 12, 0}, 10);
+ static char memblob2[] = {
+ 0x43, 0, 0, 0, 0, 0, 0, 0, 12, 0};
+ memcpy(d->cmdbuf, memblob2, 10);
d->cmdbuf[1] = d->lun << 5;
d->cmdbuf[6] = 0xAA;

@@ -567,8 +577,9 @@
int i;
unsigned tracks;

- memcpy(d->cmdbuf, (char[]) {
- 0xe5, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 10);
+ static char memblob[] = {
+ 0xe5, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 10);
d->cmdbuf[5] = 1;
d->cmdbuf[8] = 255;

@@ -585,8 +596,9 @@
}

for (i = 0; i < tracks; i++) {
- memcpy(d->cmdbuf, (char[]) {
- 0xe5, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 10);
+ static char memblob[] = {
+ 0xe5, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 10);
d->cmdbuf[5] = i + 1;
d->cmdbuf[8] = 255;

@@ -631,8 +643,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0x28, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 10);
+ static char memblob[] = {
+ 0x28, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 10);

if (d->fua)
d->cmdbuf[1] = 0x08;
@@ -655,8 +668,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xA8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 12);
+ static char memblob[] = {
+ 0xA8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

if (d->fua)
d->cmdbuf[1] = 0x08;
@@ -679,8 +693,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xd4, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 10);
+ static char memblob[] = {
+ 0xd4, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 10);

if (d->fua)
d->cmdbuf[1] = 0x08;
@@ -702,9 +717,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xd4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 12);
-
+ static char memblob[] = {
+ 0xd4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);
if (d->fua)
d->cmdbuf[1] = 0x08;

@@ -725,8 +740,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xd5, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 10);
+ static char memblob[] = {
+ 0xd5, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 10);

if (d->fua)
d->cmdbuf[1] = 0x08;
@@ -748,8 +764,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xd8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 12);
+ static char memblob[] = {
+ 0xd8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

if (d->fua)
d->cmdbuf[1] = 0x08;
@@ -776,8 +793,9 @@
return(TR_ILLEGAL);
} */

- memcpy(d->cmdbuf, (char[]) {
- 0xbe, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0}, 12);
+ static char memblob[] = {
+ 0xbe, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

d->cmdbuf[3] = (begin >> 16) & 0xFF;
d->cmdbuf[4] = (begin >> 8) & 0xFF;
@@ -795,8 +813,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xbe, 0, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0}, 12);
+ static char memblob[] = {
+ 0xbe, 0, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

d->cmdbuf[3] = (begin >> 16) & 0xFF;
d->cmdbuf[4] = (begin >> 8) & 0xFF;
@@ -814,8 +833,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xbe, 4, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0}, 12);
+ static char memblob[] = {
+ 0xbe, 4, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

d->cmdbuf[3] = (begin >> 16) & 0xFF;
d->cmdbuf[4] = (begin >> 8) & 0xFF;
@@ -854,8 +874,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xb9, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0}, 12);
+ static char memblob[] = {
+ 0xb9, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

LBA_to_MSF(begin, d->cmdbuf + 3, d->cmdbuf + 4, d->cmdbuf + 5);
LBA_to_MSF(begin + sectors, d->cmdbuf + 6, d->cmdbuf + 7,
@@ -873,8 +894,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xb9, 0, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0}, 12);
+ static char memblob[] = {
+ 0xb9, 0, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

LBA_to_MSF(begin, d->cmdbuf + 3, d->cmdbuf + 4, d->cmdbuf + 5);
LBA_to_MSF(begin + sectors, d->cmdbuf + 6, d->cmdbuf + 7,
@@ -892,8 +914,9 @@
{
int ret;

- memcpy(d->cmdbuf, (char[]) {
- 0xb9, 4, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0}, 12);
+ static char memblob[] = {
+ 0xb9, 4, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0, 0};
+ memcpy(d->cmdbuf, memblob, 12);

LBA_to_MSF(begin, d->cmdbuf + 3, d->cmdbuf + 4, d->cmdbuf + 5);
LBA_to_MSF(begin + sectors, d->cmdbuf + 6, d->cmdbuf + 7,
@@ -1526,8 +1549,9 @@
/* request vendor brand and model */
unsigned char *scsi_inquiry(cdrom_drive *d)
{
- memcpy(d->cmdbuf, (char[]) {
- 0x12, 0, 0, 0, 56, 0}, 6);
+ static char memblob[] = {
+ 0x12, 0, 0, 0, 56, 0};
+ memcpy(d->cmdbuf, memblob, 6);

if (handle_scsi_cmd(d, 6, 0, 56, '\377', 1)) {
cderror(d, "008: Unable to identify CDROM model\n");

cdparanoia _unstable_ port .patch