summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/cdparanoia/Makefile6
-rw-r--r--audio/cdparanoia/distinfo31
-rw-r--r--audio/cdparanoia/patches/patch-aa32
-rw-r--r--audio/cdparanoia/patches/patch-ab14
-rw-r--r--audio/cdparanoia/patches/patch-ac49
-rw-r--r--audio/cdparanoia/patches/patch-ad25
-rw-r--r--audio/cdparanoia/patches/patch-ae77
-rw-r--r--audio/cdparanoia/patches/patch-ca15
-rw-r--r--audio/cdparanoia/patches/patch-cb4
-rw-r--r--audio/cdparanoia/patches/patch-cc55
-rw-r--r--audio/cdparanoia/patches/patch-cd29
-rw-r--r--audio/cdparanoia/patches/patch-cf73
-rw-r--r--audio/cdparanoia/patches/patch-ch34
-rw-r--r--audio/cdparanoia/patches/patch-ci31
-rw-r--r--audio/cdparanoia/patches/patch-cj15
-rw-r--r--audio/cdparanoia/patches/patch-ck36
-rw-r--r--audio/cdparanoia/patches/patch-cl13
-rw-r--r--audio/cdparanoia/patches/patch-cm14
-rw-r--r--audio/cdparanoia/patches/patch-cn272
19 files changed, 710 insertions, 115 deletions
diff --git a/audio/cdparanoia/Makefile b/audio/cdparanoia/Makefile
index 2dedf458078..c3a5612f130 100644
--- a/audio/cdparanoia/Makefile
+++ b/audio/cdparanoia/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.22 2006/03/07 06:29:03 joerg Exp $
+# $NetBSD: Makefile,v 1.23 2006/09/03 17:13:30 ben Exp $
#
DISTNAME= cdparanoia-III-alpha9.8
PKGNAME= cdparanoia-3.0.9.8
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= audio
MASTER_SITES= http://www.xiph.org/paranoia/download/
EXTRACT_SUFX= .src.tgz
@@ -12,7 +12,7 @@ MAINTAINER= kim@tac.nyc.ny.us
HOMEPAGE= http://www.xiph.org/paranoia/
COMMENT= CDDA reading utility with extra data verification features
-ONLY_FOR_PLATFORM= FreeBSD-*-* NetBSD-*-* Linux-*-* DragonFly-*-*
+ONLY_FOR_PLATFORM= FreeBSD-*-* NetBSD-*-* Linux-*-* DragonFly-*-* Darwin-*-*
PKG_INSTALLATION_TYPES= overwrite pkgviews
diff --git a/audio/cdparanoia/distinfo b/audio/cdparanoia/distinfo
index 88d7ba5648e..2ef80c9bcc8 100644
--- a/audio/cdparanoia/distinfo
+++ b/audio/cdparanoia/distinfo
@@ -1,20 +1,25 @@
-$NetBSD: distinfo,v 1.14 2006/05/14 21:31:01 minskim Exp $
+$NetBSD: distinfo,v 1.15 2006/09/03 17:13:30 ben Exp $
SHA1 (cdparanoia-III-alpha9.8.src.tgz) = 04cc33a7d22d6255f6239e3e74195506b3bdde06
RMD160 (cdparanoia-III-alpha9.8.src.tgz) = d9225165f83b5386c58db263d6918a7006df1481
Size (cdparanoia-III-alpha9.8.src.tgz) = 116591 bytes
-SHA1 (patch-aa) = 31b37e9fb7be1cb16249bcd6a8561ab64c2fbf39
-SHA1 (patch-ab) = 69d2996b7089cb87ce4e3de969da795ae041e720
-SHA1 (patch-ac) = 7de8b30c5b5ed2e82090115897d7c98e61776214
-SHA1 (patch-ad) = 45cb1d2d402f5769447507c8da24e289396021e7
-SHA1 (patch-ae) = ea4cbc4a13f36ba4da39bd9a944d4123f132b86e
+SHA1 (patch-aa) = 29fd5767b37360fe804013bb171fc7e5f4d8311f
+SHA1 (patch-ab) = d4dad2ef444cd82bbe6201f7cbdcc42d1f28cc6e
+SHA1 (patch-ac) = 3d2221af8d9280c77ad0f08836cbc6f2b311d61f
+SHA1 (patch-ad) = 9a1ea1b98b5f3810e1ccae57beb8c68b5e189716
+SHA1 (patch-ae) = 6ba166c2ac73b9c03a1944989c6ffbe655d80c71
SHA1 (patch-ba) = 51151796493c946e5bdafbd22005136ea7f27a09
-SHA1 (patch-ca) = cf29a467bd37bc642edd81f8a6aa76cfb0c15344
-SHA1 (patch-cb) = 2123635be4d7765419d62958365a6df621471439
-SHA1 (patch-cc) = 311f8e45a9c3bc86cdb106730295f28a856ae2ab
-SHA1 (patch-cd) = 81a35822f89b4f674f03cbcbd5831cac96c3aa92
+SHA1 (patch-ca) = 9c35254c09a96b622cac44198443f66f7bc0e428
+SHA1 (patch-cb) = c19ee04017b836842bb0f2d2c77e8f35aad0f9bb
+SHA1 (patch-cc) = 9398e31db2e0c4cca19a95aa7b22cdb928869429
+SHA1 (patch-cd) = 81d31fb55db0f982959395cdecc3da826bf23bfb
SHA1 (patch-ce) = 282e3169cc26ab11924c66a312d77d7c1f59f242
-SHA1 (patch-cf) = 3ccf5e52737cb449dbead92c582646d0ebe24500
+SHA1 (patch-cf) = 650de2a80235e42acd5670a06bd1e5bcf346100d
SHA1 (patch-cg) = b9786ee81dcb7bd2f6572a20f424dd5291a8720d
-SHA1 (patch-ch) = d28ec06a56499ff96491edc49d462f43c41d15fe
-SHA1 (patch-ci) = 7d041cabce0a8935fd1807766a93eb72e7c9c717
+SHA1 (patch-ch) = 8d16dd8c80e8f1ee35ccc299ba927d685adde01c
+SHA1 (patch-ci) = 60db1d1d2e8ec9c6d446543762218b22c597d986
+SHA1 (patch-cj) = e2420e2ccadd2d6ea30d6bf48af9c141dc395afc
+SHA1 (patch-ck) = 0232f8f42d98b49043f55cd6aaf1f50ab38fadfb
+SHA1 (patch-cl) = f511570233524feac434db160e51099316618058
+SHA1 (patch-cm) = 18001a6cf96dd6bfde8e1208be56a40fac9aa0d5
+SHA1 (patch-cn) = b79db0b24a042a5801b47e6db5e20cbf07a53475
diff --git a/audio/cdparanoia/patches/patch-aa b/audio/cdparanoia/patches/patch-aa
index 6a47f2edbf5..0779e82a0f4 100644
--- a/audio/cdparanoia/patches/patch-aa
+++ b/audio/cdparanoia/patches/patch-aa
@@ -1,8 +1,26 @@
-$NetBSD: patch-aa,v 1.3 2001/06/25 12:17:55 simonb Exp $
+$NetBSD: patch-aa,v 1.4 2006/09/03 17:13:30 ben Exp $
---- configure.in.orig Mon Aug 16 08:29:43 1999
-+++ configure.in Mon Jun 25 21:15:58 2001
-@@ -20,6 +20,12 @@
+--- configure.in.orig 2000-03-25 23:33:22.000000000 -0800
++++ configure.in
+@@ -12,6 +12,17 @@ AC_PROG_RANLIB
+ AC_CHECK_PROG(AR,ar,ar)
+ AC_CHECK_PROG(INSTALL,install,install)
+
++case $host in
++*-*-darwin*)
++ EXTRA_OBJS=osx_interface.o
++ EXTRA_LIBS=-framework CoreFoundation -framework IOKit
++ ;;
++*)
++ EXTRA_OBJS=cooked_interface.o scsi_interface.o
++ EXTRA_LIBS=
++ ;;
++esac
++
+ if test -z "$GCC"; then
+ DEBUG="-g"
+ OPT="-O"
+@@ -20,6 +31,12 @@ else
i?86-*-linux*)
DEBUG="-g -Wall -fsigned-char"
OPT="-O20 -ffast-math -fsigned-char -finline-functions";;
@@ -15,7 +33,7 @@ $NetBSD: patch-aa,v 1.3 2001/06/25 12:17:55 simonb Exp $
*)
DEBUG="-g -Wall -fsigned-char"
OPT="-O20 -fsigned-char";;
-@@ -28,7 +34,10 @@
+@@ -28,7 +45,10 @@ fi
AC_HEADER_STDC
@@ -27,7 +45,7 @@ $NetBSD: patch-aa,v 1.3 2001/06/25 12:17:55 simonb Exp $
TYPESIZES=""
-@@ -62,15 +71,25 @@
+@@ -62,15 +82,27 @@ fi
AC_CHECK_HEADERS(linux/sbpcd.h, SBPCD_H="-DSBPCD_H='1' ")
AC_CHECK_HEADERS(linux/ucdrom.h, UCDROM_H="-DUCDROM_H='1' ")
@@ -51,5 +69,7 @@ $NetBSD: patch-aa,v 1.3 2001/06/25 12:17:55 simonb Exp $
AC_SUBST(DEBUG)
AC_SUBST(CC)
+AC_SUBST(LIBUTIL)
++AC_SUBST(EXTRA_OBJS)
++AC_SUBST(EXTRA_LIBS)
AC_OUTPUT(Makefile interface/Makefile paranoia/Makefile)
diff --git a/audio/cdparanoia/patches/patch-ab b/audio/cdparanoia/patches/patch-ab
index 7c737a12b5e..66f3a1e590f 100644
--- a/audio/cdparanoia/patches/patch-ab
+++ b/audio/cdparanoia/patches/patch-ab
@@ -1,9 +1,9 @@
-$NetBSD: patch-ab,v 1.5 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-ab,v 1.6 2006/09/03 17:13:30 ben Exp $
-Note tht VERSION is *not* used for the libtool versioning.
+Note that VERSION is *not* used for the libtool versioning.
---- Makefile.in.orig Wed Mar 28 07:46:58 2001
-+++ Makefile.in Sun Mar 3 23:08:01 2002
+--- Makefile.in.orig 2001-03-27 14:46:58.000000000 -0800
++++ Makefile.in
@@ -3,12 +3,12 @@
# DO NOT EDIT BELOW! ##########################################################
# (unless, of course, you know what you are doing :) ##########################
@@ -19,7 +19,7 @@ Note tht VERSION is *not* used for the libtool versioning.
OPT=@OPT@ $(FLAGS)
DEBUG=@DEBUG@ $(FLAGS)
CC=@CC@
-@@ -27,29 +27,29 @@
+@@ -27,29 +27,29 @@ PWD = $(shell pwd)
OFILES = main.o report.o header.o buffering_write.o
@@ -38,7 +38,7 @@ Note tht VERSION is *not* used for the libtool versioning.
+STLIBDEP = interface/libcdda_interface.a paranoia/libcdda_paranoia.a
+SHLIBDEP = interface/libcdda_interface.la paranoia/libcdda_paranoia.la
-+SHLIBS = $(SHLIBDEP) @LIBUTIL@ -lm
++SHLIBS = $(SHLIBDEP) @LIBUTIL@ @EXTRA_LIBS@ -lm
-all:
+
@@ -63,7 +63,7 @@ Note tht VERSION is *not* used for the libtool versioning.
test:
cd interface && $(MAKE) all
-@@ -65,31 +65,20 @@
+@@ -65,31 +65,20 @@ slib:
install:
$(INSTALL) -d -m 0755 $(BINDIR)
diff --git a/audio/cdparanoia/patches/patch-ac b/audio/cdparanoia/patches/patch-ac
index 982c1d04c4f..3ab390884e8 100644
--- a/audio/cdparanoia/patches/patch-ac
+++ b/audio/cdparanoia/patches/patch-ac
@@ -1,8 +1,25 @@
-$NetBSD: patch-ac,v 1.5 2004/03/20 11:23:51 wiz Exp $
+$NetBSD: patch-ac,v 1.6 2006/09/03 17:13:30 ben Exp $
---- configure.orig Sat Apr 15 17:13:01 2000
+--- configure.orig 2000-04-15 08:13:01.000000000 -0700
+++ configure
-@@ -893,6 +893,12 @@ else
+@@ -884,6 +884,16 @@ else
+ echo "$ac_t""no" 1>&6
+ fi
+
++case $host in
++*-*-darwin*)
++ EXTRA_OBJS=osx_interface.o
++ EXTRA_LIBS="-framework CoreFoundation -framework IOKit"
++ ;;
++*)
++ EXTRA_OBJS="cooked_interface.o scsi_interface.o"
++ EXTRA_LIBS=
++ ;;
++esac
+
+ if test -z "$GCC"; then
+ DEBUG="-g"
+@@ -893,6 +903,12 @@ else
i?86-*-linux*)
DEBUG="-g -Wall -fsigned-char"
OPT="-O20 -ffast-math -fsigned-char -finline-functions";;
@@ -15,7 +32,7 @@ $NetBSD: patch-ac,v 1.5 2004/03/20 11:23:51 wiz Exp $
*)
DEBUG="-g -Wall -fsigned-char"
OPT="-O20 -fsigned-char";;
-@@ -1084,7 +1090,6 @@ EOF
+@@ -1084,7 +1100,6 @@ EOF
fi
@@ -23,7 +40,7 @@ $NetBSD: patch-ac,v 1.5 2004/03/20 11:23:51 wiz Exp $
TYPESIZES=""
-@@ -1476,6 +1481,143 @@ else
+@@ -1476,6 +1491,143 @@ else
fi
done
@@ -167,7 +184,27 @@ $NetBSD: patch-ac,v 1.5 2004/03/20 11:23:51 wiz Exp $
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1482: checking whether ${MAKE-make} sets \${MAKE}" >&5
-@@ -1744,9 +1886,12 @@ s%@CPP@%$CPP%g
+@@ -1686,6 +1838,10 @@ for ac_option
+ do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ : Avoid regenerating within pkgsrc
++ exit 0
++ : Avoid regenerating within pkgsrc
++ exit 0
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+@@ -1736,6 +1892,8 @@ s%@host_alias@%$host_alias%g
+ s%@host_cpu@%$host_cpu%g
+ s%@host_vendor@%$host_vendor%g
+ s%@host_os@%$host_os%g
++s%@EXTRA_OBJS@%$EXTRA_OBJS%g
++s%@EXTRA_LIBS@%$EXTRA_LIBS%g
+ s%@CC@%$CC%g
+ s%@RANLIB@%$RANLIB%g
+ s%@AR@%$AR%g
+@@ -1744,9 +1902,12 @@ s%@CPP@%$CPP%g
s%@SET_MAKE@%$SET_MAKE%g
s%@SBPCD_H@%$SBPCD_H%g
s%@UCDROM_H@%$UCDROM_H%g
diff --git a/audio/cdparanoia/patches/patch-ad b/audio/cdparanoia/patches/patch-ad
index dd2498e55d5..12ee25d654b 100644
--- a/audio/cdparanoia/patches/patch-ad
+++ b/audio/cdparanoia/patches/patch-ad
@@ -1,8 +1,8 @@
-$NetBSD: patch-ad,v 1.3 2002/03/04 14:45:13 itohy Exp $
+$NetBSD: patch-ad,v 1.4 2006/09/03 17:13:30 ben Exp $
---- utils.h.orig Thu Apr 20 07:41:04 2000
-+++ utils.h Sun Mar 3 23:24:19 2002
-@@ -1,5 +1,16 @@
+--- utils.h.orig 2000-04-19 15:41:04.000000000 -0700
++++ utils.h
+@@ -1,5 +1,20 @@
#include <stdlib.h>
+#ifdef __linux__
#include <endian.h>
@@ -16,27 +16,42 @@ $NetBSD: patch-ad,v 1.3 2002/03/04 14:45:13 itohy Exp $
+#include <machine/bswap.h>
+#endif
+#endif
++#if defined(__APPLE__) && defined(__MACH__)
++#include <stdint.h>
++#include <machine/endian.h>
++#endif
#include <stdio.h>
#include <errno.h>
#include <string.h>
-@@ -19,15 +30,23 @@
+@@ -19,15 +34,34 @@ static inline int bigendianp(void){
}
static inline int32_t swap32(int32_t x){
+#ifdef __NetBSD__
+ return bswap32(x);
+#else
++#if defined(__APPLE__) && defined(__MACH__)
++ return((((uint32_t)x & 0x000000ffU) << 24) |
++ (((uint32_t)x & 0x0000ff00U) << 8) |
++ (((uint32_t)x & 0x00ff0000U) >> 8) |
++ (((uint32_t)x & 0xff000000U) >> 24));
++#else
return((((u_int32_t)x & 0x000000ffU) << 24) |
(((u_int32_t)x & 0x0000ff00U) << 8) |
(((u_int32_t)x & 0x00ff0000U) >> 8) |
(((u_int32_t)x & 0xff000000U) >> 24));
+#endif
++#endif
}
static inline int16_t swap16(int16_t x){
+#ifdef __NetBSD__
+ return bswap16(x);
+#else
++#if defined(__APPLE__) && defined(__MACH__)
++ return((((uint16_t)x & 0x00ffU) << 8) |
++ (((uint16_t)x & 0xff00U) >> 8));
++#endif
return((((u_int16_t)x & 0x00ffU) << 8) |
(((u_int16_t)x & 0xff00U) >> 8));
+#endif
diff --git a/audio/cdparanoia/patches/patch-ae b/audio/cdparanoia/patches/patch-ae
index 8e23995f263..cdb0681cd3e 100644
--- a/audio/cdparanoia/patches/patch-ae
+++ b/audio/cdparanoia/patches/patch-ae
@@ -1,7 +1,7 @@
-$NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
+$NetBSD: patch-ae,v 1.5 2006/09/03 17:13:30 ben Exp $
---- main.c.orig Mon Mar 26 12:44:50 2001
-+++ main.c Mon Mar 4 23:05:48 2002
+--- main.c.orig 2001-03-25 19:44:50.000000000 -0800
++++ main.c
@@ -49,12 +49,18 @@
#include <unistd.h>
#include <string.h>
@@ -21,7 +21,7 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
#include "interface/cdda_interface.h"
#include "paranoia/cdda_paranoia.h"
#include "utils.h"
-@@ -231,6 +237,7 @@
+@@ -231,6 +237,7 @@ VERSION"\n"
" cdparanoia [options] <span> [outfile]\n\n"
"OPTIONS:\n"
@@ -29,7 +29,19 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
" -v --verbose : extra verbose operation\n"
" -q --quiet : quiet operation\n"
" -e --stderr-progress : force output of progress information to\n"
-@@ -276,6 +283,50 @@
+@@ -256,9 +263,11 @@ VERSION"\n"
+ " to n sectors\n"
+ " -o --force-search-overlap <n> : force minimum overlap search during\n"
+ " verification to n sectors\n"
++#if !(defined(__APPLE__) && defined(__MACH__))
+ " -d --force-cdrom-device <dev> : use specified device; disallow \n"
+ " autosense\n"
+ " -g --force-generic-device <dev> : use specified generic scsi device\n"
++#endif
+ " -S --force-read-speed <n> : read from device at specified speed\n"
+ " -t --toc-offset <n> : Add <n> sectors to the values reported\n"
+ " when addressing tracks. May be negative\n"
+@@ -276,6 +285,52 @@ VERSION"\n"
" -Z --disable-paranoia : disable all paranoia checking\n"
" -Y --disable-extra-paranoia : only do cdda2wav-style overlap checking\n"
" -X --abort-on-skip : abort on imperfect reads/skips\n\n"
@@ -57,8 +69,10 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
+" -n <n> : force default number of sectors in read to n sectors\n"
+" -o <n> : force minimum overlap search during\n"
+" verification to n sectors\n"
++#if !(defined(__APPLE__) && defined(__MACH__))
+" -d <dev> : use specified device; disallow autosense\n"
+" -g <dev> : use specified generic scsi device\n"
++#endif
+" -S <n> : read from device at specified speed\n"
+" -t <n> : Add <n> sectors to the values reported\n"
+" when addressing tracks. May be negative\n"
@@ -80,7 +94,7 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
"OUTPUT SMILIES:\n"
" :-) Normal operation, low/no jitter\n"
-@@ -376,7 +427,7 @@
+@@ -376,7 +431,7 @@ static void callback(long inpos, int fun
int graph=30;
char buffer[256];
static long c_sector=0,v_sector=0;
@@ -89,7 +103,7 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
static int last=0;
static long lasttime=0;
long sector,osector=0;
-@@ -587,6 +638,7 @@
+@@ -587,6 +642,7 @@ static void callback(long inpos, int fun
const char *optstring = "escCn:o:O:d:g:S:prRwafvqVQhZz::YXWBi:Tt:";
@@ -97,7 +111,7 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
struct option options [] = {
{"stderr-progress",no_argument,NULL,'e'},
{"search-for-drive",no_argument,NULL,'s'},
-@@ -621,6 +673,7 @@
+@@ -621,6 +677,7 @@ struct option options [] = {
{NULL,0,NULL,0}
};
@@ -105,7 +119,7 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
long blocking_write(int outf, char *buffer, long num){
long words=0,temp;
-@@ -673,7 +726,12 @@
+@@ -673,7 +730,12 @@ int main(int argc,char *argv[]){
atexit(cleanup);
@@ -119,11 +133,29 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
switch(c){
case 'B':
batch=1;
-@@ -810,6 +868,27 @@
- report(VERSION);
+@@ -690,6 +752,7 @@ int main(int argc,char *argv[]){
+ case 'o':
+ force_cdrom_overlap=atoi(optarg);
+ break;
++#if !(defined(__APPLE__) && defined(__MACH__))
+ case 'd':
+ if(force_cdrom_device)free(force_cdrom_device);
+ force_cdrom_device=copystring(optarg);
+@@ -698,6 +761,7 @@ int main(int argc,char *argv[]){
+ if(force_generic_device)free(force_generic_device);
+ force_generic_device=copystring(optarg);
+ break;
++#endif
+ case 'S':
+ force_cdrom_speed=atoi(optarg);
+ break;
+@@ -811,6 +875,30 @@ int main(int argc,char *argv[]){
/* Query the cdrom/disc; we may need to override some settings */
-+
+
++#if defined(__APPLE__) && defined(__MACH__)
++ d=cdda_find_a_cdrom(verbose,NULL);
++#else
+#ifndef __linux__ /* XXX */
+#ifdef __NetBSD__
+ if (!force_generic_device) {
@@ -144,6 +176,25 @@ $NetBSD: patch-ae,v 1.4 2002/03/04 14:45:13 itohy Exp $
+ if (!force_cdrom_device)
+ force_cdrom_device=copystring(force_generic_device);
+#endif
-
++
if(force_generic_device)
d=cdda_identify_scsi(force_generic_device,force_cdrom_device,verbose,NULL);
+ else
+@@ -841,6 +929,7 @@ int main(int argc,char *argv[]){
+ report("");
+ }
+ }
++#endif /* __APPLE__ && __DARWIN__ */
+
+ if(!d){
+ if(!verbose)
+@@ -878,7 +967,9 @@ int main(int argc,char *argv[]){
+ "ignoring preset and autosense",force_cdrom_sectors);
+ report(buffer);
+ d->nsectors=force_cdrom_sectors;
++#if !(defined(__APPLE__) && defined(__MACH__))
+ d->bigbuff=force_cdrom_sectors*CD_FRAMESIZE_RAW;
++#endif
+ }
+ }
+ if(force_cdrom_overlap!=-1){
diff --git a/audio/cdparanoia/patches/patch-ca b/audio/cdparanoia/patches/patch-ca
index a43c478341a..98e508d3cc6 100644
--- a/audio/cdparanoia/patches/patch-ca
+++ b/audio/cdparanoia/patches/patch-ca
@@ -1,10 +1,15 @@
-$NetBSD: patch-ca,v 1.4 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-ca,v 1.5 2006/09/03 17:13:30 ben Exp $
---- interface/Makefile.in.orig 1999-12-14 04:27:59.000000000 +0000
+--- interface/Makefile.in.orig 1999-12-13 20:27:59.000000000 -0800
+++ interface/Makefile.in
-@@ -21,9 +21,7 @@ CPPFLAGS+=-D_REENTRANT
- OFILES = scan_devices.o common_interface.o cooked_interface.o interface.o\
- scsi_interface.o smallft.o toc.o test_interface.o
+@@ -18,12 +18,10 @@ RANLIB=@RANLIB@
+ LIBS = -lm
+ CPPFLAGS+=-D_REENTRANT
+
+-OFILES = scan_devices.o common_interface.o cooked_interface.o interface.o\
+- scsi_interface.o smallft.o toc.o test_interface.o
++OFILES = scan_devices.o common_interface.o interface.o\
++ smallft.o toc.o test_interface.o @EXTRA_OBJS@
-export VERSION
-
diff --git a/audio/cdparanoia/patches/patch-cb b/audio/cdparanoia/patches/patch-cb
index 90d5c02d17d..cd2612c35a0 100644
--- a/audio/cdparanoia/patches/patch-cb
+++ b/audio/cdparanoia/patches/patch-cb
@@ -1,6 +1,6 @@
-$NetBSD: patch-cb,v 1.4 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-cb,v 1.5 2006/09/03 17:13:30 ben Exp $
---- interface/low_interface.h.orig 2001-03-26 16:12:11.000000000 +1000
+--- interface/low_interface.h.orig 2001-03-25 22:12:11.000000000 -0800
+++ interface/low_interface.h
@@ -25,6 +25,7 @@
#include <sys/time.h>
diff --git a/audio/cdparanoia/patches/patch-cc b/audio/cdparanoia/patches/patch-cc
index f1288c88112..318cdf0048b 100644
--- a/audio/cdparanoia/patches/patch-cc
+++ b/audio/cdparanoia/patches/patch-cc
@@ -1,8 +1,8 @@
-$NetBSD: patch-cc,v 1.5 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-cc,v 1.6 2006/09/03 17:13:30 ben Exp $
---- interface/utils.h.orig 2000-04-19 16:41:04.000000000 -0600
+--- interface/utils.h.orig 2000-04-19 15:41:04.000000000 -0700
+++ interface/utils.h
-@@ -1,4 +1,18 @@
+@@ -1,4 +1,23 @@
+#ifdef __linux__
#include <endian.h>
+#endif
@@ -18,38 +18,71 @@ $NetBSD: patch-cc,v 1.5 2006/03/07 06:29:03 joerg Exp $
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#include <machine/endian.h>
+#endif
++#if defined(__APPLE__) && defined(__MACH__)
++#include <stdint.h>
++#include <machine/endian.h>
++#define STDERR_FILENO 2
++#endif
#include <stdio.h>
#include <errno.h>
#include <string.h>
-@@ -112,6 +126,7 @@ static void cderror(cdrom_drive *d,const
+@@ -14,15 +33,27 @@ static inline int bigendianp(void){
+ }
+
+ static inline int32_t swap32(int32_t x){
++#if defined(__APPLE__) && defined(__MACH__)
++ return((((uint32_t)x & 0x000000ffU) << 24) |
++ (((uint32_t)x & 0x0000ff00U) << 8) |
++ (((uint32_t)x & 0x00ff0000U) >> 8) |
++ (((uint32_t)x & 0xff000000U) >> 24));
++#else
+ return((((u_int32_t)x & 0x000000ffU) << 24) |
+ (((u_int32_t)x & 0x0000ff00U) << 8) |
+ (((u_int32_t)x & 0x00ff0000U) >> 8) |
+ (((u_int32_t)x & 0xff000000U) >> 24));
++#endif
+ }
+
+ static inline int16_t swap16(int16_t x){
++#if defined(__APPLE__) && defined(__MACH__)
++ return((((uint16_t)x & 0x00ffU) << 8) |
++ (((uint16_t)x & 0xff00U) >> 8));
++#else
+ return((((u_int16_t)x & 0x00ffU) << 8) |
+ (((u_int16_t)x & 0xff00U) >> 8));
++#endif
+ }
+
+ #if BYTE_ORDER == LITTLE_ENDIAN
+@@ -112,6 +143,7 @@ static void cderror(cdrom_drive *d,const
break;
case CDDA_MESSAGE_FORGETIT:
default:
-+ ;
++ break;
}
}
}
-@@ -127,6 +142,7 @@ static void cdmessage(cdrom_drive *d,con
+@@ -127,6 +159,7 @@ static void cdmessage(cdrom_drive *d,con
break;
case CDDA_MESSAGE_FORGETIT:
default:
-+ ;
++ break;
}
}
}
-@@ -169,6 +185,7 @@ static void idperror(int messagedest,cha
+@@ -169,6 +202,7 @@ static void idperror(int messagedest,cha
break;
case CDDA_MESSAGE_FORGETIT:
default:
-+ ;
++ break;
}
}
if(malloced)free(buffer);
-@@ -205,6 +222,7 @@ static void idmessage(int messagedest,ch
+@@ -205,6 +239,7 @@ static void idmessage(int messagedest,ch
break;
case CDDA_MESSAGE_FORGETIT:
default:
-+ ;
++ break;
}
}
if(malloced)free(buffer);
diff --git a/audio/cdparanoia/patches/patch-cd b/audio/cdparanoia/patches/patch-cd
index 696f6d66f95..2299a1283a9 100644
--- a/audio/cdparanoia/patches/patch-cd
+++ b/audio/cdparanoia/patches/patch-cd
@@ -1,8 +1,19 @@
-$NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-cd,v 1.4 2006/09/03 17:13:30 ben Exp $
---- interface/common_interface.c.orig 2000-04-20 08:41:04.000000000 +1000
+--- interface/common_interface.c.orig 2000-04-19 15:41:04.000000000 -0700
+++ interface/common_interface.c
-@@ -13,19 +13,28 @@
+@@ -9,23 +9,39 @@
+ ******************************************************************/
+
+ #include <math.h>
++#if defined(__APPLE__) && defined(__MACH__)
++#include <sys/syslimits.h>
++#include <assert.h>
++#include <stdlib.h>
++#include <paths.h>
++#include <fcntl.h>
++#endif
+ #include "low_interface.h"
#include "utils.h"
#include "smallft.h"
@@ -31,7 +42,7 @@ $NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
/* Use the ioctl thingy above ping the cdrom; this will get model info */
char *atapi_drive_info(int fd){
/* Work around the fact that the struct grew without warning in
-@@ -46,6 +55,7 @@ char *atapi_drive_info(int fd){
+@@ -46,6 +62,7 @@ char *atapi_drive_info(int fd){
free(id);
return(ret);
}
@@ -39,7 +50,7 @@ $NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
int data_bigendianp(cdrom_drive *d){
float lsb_votes=0;
-@@ -171,7 +181,9 @@ int data_bigendianp(cdrom_drive *d){
+@@ -171,9 +188,12 @@ int data_bigendianp(cdrom_drive *d){
knows the leasoud/leadin size. */
int FixupTOC(cdrom_drive *d,int tracks){
@@ -48,8 +59,11 @@ $NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
+#endif
int j;
++#if !(defined(__APPLE__) && defined(__MACH__))
/* First off, make sure the 'starting sector' is >=0 */
-@@ -208,14 +220,26 @@ int FixupTOC(cdrom_drive *d,int tracks){
+
+ for(j=0;j<tracks;j++){
+@@ -208,14 +228,26 @@ int FixupTOC(cdrom_drive *d,int tracks){
/* For a scsi device, the ioctl must go to the specialized SCSI
CDROM device, not the generic device. */
@@ -77,7 +91,7 @@ $NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
/* This is an odd little piece of code --Monty */
-@@ -223,14 +247,15 @@ int FixupTOC(cdrom_drive *d,int tracks){
+@@ -223,14 +255,16 @@ int FixupTOC(cdrom_drive *d,int tracks){
/* adjust end of last audio track to be in the first session */
for (j = tracks-1; j >= 0; j--) {
if (j > 0 && !IS_AUDIO(d,j) && IS_AUDIO(d,j-1)) {
@@ -92,6 +106,7 @@ $NetBSD: patch-cd,v 1.3 2006/03/07 06:29:03 joerg Exp $
}
}
+#endif
++#endif
return 0;
}
diff --git a/audio/cdparanoia/patches/patch-cf b/audio/cdparanoia/patches/patch-cf
index 7bdde5052d1..5aba4a64f1f 100644
--- a/audio/cdparanoia/patches/patch-cf
+++ b/audio/cdparanoia/patches/patch-cf
@@ -1,6 +1,6 @@
-$NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
+$NetBSD: patch-cf,v 1.7 2006/09/03 17:13:30 ben Exp $
---- interface/scan_devices.c.orig 2001-03-26 15:44:01.000000000 +1000
+--- interface/scan_devices.c.orig 2001-03-25 21:44:01.000000000 -0800
+++ interface/scan_devices.c
@@ -19,6 +19,8 @@
#include "common_interface.h"
@@ -11,7 +11,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
#define MAX_DEV_LEN 20 /* Safe because strings only come from below */
/* must be absolute paths! */
static char *scsi_cdrom_prefixes[]={
-@@ -49,10 +51,18 @@ static char *cdrom_devices[]={
+@@ -49,11 +51,24 @@ static char *cdrom_devices[]={
"/dev/cm206cd",
"/dev/gscd",
"/dev/optcd",NULL};
@@ -26,11 +26,17 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
/* Functions here look for a cdrom drive; full init of a drive type
happens in interface.c */
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || (defined(__APPLE__) && defined(__MACH__))
cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages){
++#if defined(__APPLE__) && defined(__MACH__)
++ cdrom_drive *d = calloc(1, sizeof(cdrom_drive));
++ d->interface = OSX_IOKIT;
++ return d;
++#else
/* Brute force... */
-@@ -75,10 +85,12 @@ cdrom_drive *cdda_find_a_cdrom(int messa
+ int i=0;
+@@ -75,10 +90,12 @@ cdrom_drive *cdda_find_a_cdrom(int messa
if((d=cdda_identify(buffer,messagedest,messages)))
return(d);
idmessage(messagedest,messages,"",NULL);
@@ -43,12 +49,14 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
}
}else{
/* Name. Go for it. */
-@@ -98,6 +110,16 @@ cdrom_drive *cdda_find_a_cdrom(int messa
+@@ -97,8 +114,20 @@ cdrom_drive *cdda_find_a_cdrom(int messa
+ temp->pw_name);
}
return(NULL);
++#endif
}
+#endif /* __linux__ */
-+
+
+#ifdef __NetBSD__
+
+cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages)
@@ -57,10 +65,12 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
+ /* NOTREACHED */
+}
+#endif /* __NetBSD__ */
-
++
++#if !(defined(__APPLE__) && defined(__MACH__))
cdrom_drive *cdda_identify(const char *device, int messagedest,char **messages){
struct stat st;
-@@ -117,8 +139,14 @@ cdrom_drive *cdda_identify(const char *d
+ cdrom_drive *d=NULL;
+@@ -117,8 +146,14 @@ cdrom_drive *cdda_identify(const char *d
}
#endif
@@ -75,7 +85,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
#ifdef CDDA_TEST
if(!d)d=cdda_identify_test(device,messagedest,messages);
-@@ -146,6 +174,7 @@ char *test_resolve_symlink(const char *f
+@@ -146,6 +181,7 @@ char *test_resolve_symlink(const char *f
cdrom_drive *cdda_identify_cooked(const char *dev, int messagedest,
char **messages){
@@ -83,7 +93,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
cdrom_drive *d=NULL;
struct stat st;
int fd=-1;
-@@ -273,8 +302,60 @@ cdrom_drive *cdda_identify_cooked(const
+@@ -273,8 +309,60 @@ cdrom_drive *cdda_identify_cooked(const
idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description);
return(d);
@@ -144,7 +154,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
struct sg_id {
long l1; /* target | lun << 8 | channel << 16 | low_ino << 24 */
long l2; /* Unique id */
-@@ -289,12 +370,18 @@ typedef struct scsiid{
+@@ -289,12 +377,18 @@ typedef struct scsiid{
/* Even *this* isn't as simple as it bloody well should be :-P */
/* SG has an easy interface, but SCSI overall does not */
static int get_scsi_id(int fd, scsiid *id){
@@ -163,7 +173,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if(ioctl(fd,SCSI_IOCTL_GET_IDLUN,&argid))return(-1);
id->bus=argid.l2; /* for now */
id->id=argid.l1&0xff;
-@@ -302,6 +389,13 @@ static int get_scsi_id(int fd, scsiid *i
+@@ -302,6 +396,13 @@ static int get_scsi_id(int fd, scsiid *i
if(ioctl(fd,SCSI_IOCTL_GET_BUS_NUMBER,&busarg)==0)
id->bus=busarg;
@@ -177,7 +187,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
return(0);
}
-@@ -390,6 +484,7 @@ matchfail:
+@@ -390,6 +491,7 @@ matchfail:
if(dev!=-1)close(dev);
return(NULL);
}
@@ -185,7 +195,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
void strscat(char *a,char *b,int n){
int i;
-@@ -401,6 +496,7 @@ void strscat(char *a,char *b,int n){
+@@ -401,6 +503,7 @@ void strscat(char *a,char *b,int n){
strcat(a," ");
}
@@ -193,7 +203,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
/* At this point, we're going to punt compatability before SG2, and
allow only SG2 and SG3 */
static int verify_SG_version(cdrom_drive *d,int messagedest,
-@@ -430,7 +526,9 @@ static int verify_SG_version(cdrom_drive
+@@ -430,7 +533,9 @@ static int verify_SG_version(cdrom_drive
idmessage(messagedest,messages,buffer,"");
return(major);
}
@@ -203,7 +213,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
cdrom_drive *cdda_identify_scsi(const char *generic_device,
const char *ioctl_device, int messagedest,
char **messages){
-@@ -460,6 +558,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -460,6 +565,7 @@ cdrom_drive *cdda_identify_scsi(const ch
generic_device);
return(NULL);
}
@@ -211,7 +221,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if((int)(g_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){
if((int)(g_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){
idmessage(messagedest,messages,"\t\t%s is not a SCSI device",
-@@ -471,6 +570,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -471,6 +577,7 @@ cdrom_drive *cdda_identify_scsi(const ch
ioctl_device=temp;
}
}
@@ -219,7 +229,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
}
if(ioctl_device){
if(stat(ioctl_device,&i_st)){
-@@ -478,6 +578,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -478,6 +585,7 @@ cdrom_drive *cdda_identify_scsi(const ch
ioctl_device);
return(NULL);
}
@@ -227,7 +237,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if((int)(i_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){
if((int)(i_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){
idmessage(messagedest,messages,"\t\t%s is not a SCSI device",
-@@ -489,6 +590,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -489,6 +597,7 @@ cdrom_drive *cdda_identify_scsi(const ch
ioctl_device=temp;
}
}
@@ -235,7 +245,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
}
/* we need to resolve any symlinks for the lookup code to work */
-@@ -505,6 +607,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -505,6 +614,7 @@ cdrom_drive *cdda_identify_scsi(const ch
}
if(!generic_device || !ioctl_device){
@@ -243,7 +253,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if(generic_device){
ioctl_device=
scsi_match(generic_device,scsi_cdrom_prefixes,
-@@ -520,6 +623,12 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -520,6 +630,12 @@ cdrom_drive *cdda_identify_scsi(const ch
if(!generic_device)
goto cdda_identify_scsi_fail;
}
@@ -256,7 +266,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
}
idmessage(messagedest,messages,"\t\tgeneric device: %s",generic_device);
-@@ -556,6 +665,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -556,6 +672,7 @@ cdrom_drive *cdda_identify_scsi(const ch
type=(int)(i_st.st_rdev>>8);
@@ -264,7 +274,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if(type==SCSI_CDROM_MAJOR){
if (!S_ISBLK(i_st.st_mode)) {
idmessage(messagedest,messages,"\t\tSCSI CDROM device %s not a "
-@@ -567,8 +677,10 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -567,8 +684,10 @@ cdrom_drive *cdda_identify_scsi(const ch
"major number",ioctl_device);
goto cdda_identify_scsi_fail;
}
@@ -275,7 +285,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
if((int)(g_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){
if (!S_ISCHR(g_st.st_mode)) {
idmessage(messagedest,messages,"\t\tGeneric SCSI device %s not a "
-@@ -580,6 +692,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -580,6 +699,7 @@ cdrom_drive *cdda_identify_scsi(const ch
"major number",generic_device);
goto cdda_identify_scsi_fail;
}
@@ -283,7 +293,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
d=calloc(1,sizeof(cdrom_drive));
-@@ -590,6 +703,7 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -590,6 +710,7 @@ cdrom_drive *cdda_identify_scsi(const ch
d->bigendianp=-1; /* We don't know yet... */
d->nsectors=-1;
@@ -291,7 +301,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
version=verify_SG_version(d,messagedest,messages);
switch(version){
case -1:case 0:case 1:
-@@ -599,6 +713,9 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -599,6 +720,9 @@ cdrom_drive *cdda_identify_scsi(const ch
d->interface=GENERIC_SCSI;
break;
}
@@ -301,7 +311,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
/* malloc our big buffer for scsi commands */
d->sg=malloc(MAX_BIG_BUFF_SIZE);
-@@ -617,7 +734,16 @@ cdrom_drive *cdda_identify_scsi(const ch
+@@ -617,7 +741,16 @@ cdrom_drive *cdda_identify_scsi(const ch
/* It would seem some TOSHIBA CDROMs gets things wrong */
@@ -319,7 +329,7 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
!strncmp (p + 16, "CD-ROM", 6) &&
p[0] == TYPE_DISK) {
p[0] = TYPE_ROM;
-@@ -653,6 +779,88 @@ cdda_identify_scsi_fail:
+@@ -653,6 +786,88 @@ cdda_identify_scsi_fail:
if(g_fd!=-1)close(g_fd);
return(NULL);
}
@@ -408,3 +418,8 @@ $NetBSD: patch-cf,v 1.6 2006/03/07 06:29:03 joerg Exp $
#ifdef CDDA_TEST
+@@ -702,3 +917,4 @@ cdrom_drive *cdda_identify_test(const ch
+ }
+
+ #endif
++#endif /* __APPLE__ && __MACH__ */
diff --git a/audio/cdparanoia/patches/patch-ch b/audio/cdparanoia/patches/patch-ch
index f7216564559..99bb152ae68 100644
--- a/audio/cdparanoia/patches/patch-ch
+++ b/audio/cdparanoia/patches/patch-ch
@@ -1,8 +1,16 @@
-$NetBSD: patch-ch,v 1.2 2006/03/07 06:29:04 joerg Exp $
+$NetBSD: patch-ch,v 1.3 2006/09/03 17:13:30 ben Exp $
---- interface/cdda_interface.h.orig 2001-03-24 12:15:46.000000000 +1100
+--- interface/cdda_interface.h.orig 2001-03-23 17:15:46.000000000 -0800
+++ interface/cdda_interface.h
-@@ -21,6 +21,11 @@
+@@ -18,9 +18,19 @@
+ #endif
+ #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4)
+
++#if defined(__APPLE__) && defined(__MACH__)
++#include <IOKit/IOKitLib.h>
++#include <IOKit/storage/IOCDTypes.h>
++#endif
++
#include <sys/types.h>
#include <signal.h>
@@ -14,7 +22,15 @@ $NetBSD: patch-ch,v 1.2 2006/03/07 06:29:04 joerg Exp $
#define MAXTRK 100
typedef struct TOC { /* structure of table of contents */
-@@ -47,13 +50,19 @@ typedef struct cdrom_drive{
+@@ -33,6 +43,7 @@ typedef struct TOC { /* structure of tab
+ #define GENERIC_SCSI 0
+ #define COOKED_IOCTL 1
+ #define TEST_INTERFACE 2
++#define OSX_IOKIT 3
+
+ #define CDDA_MESSAGE_FORGETIT 0
+ #define CDDA_MESSAGE_PRINTIT 1
+@@ -47,13 +58,27 @@ typedef struct cdrom_drive{
int opened; /* This struct may just represent a candidate for opening */
char *cdda_device_name;
@@ -31,12 +47,20 @@ $NetBSD: patch-ch,v 1.2 2006/03/07 06:29:04 joerg Exp $
+ union ccb *ccb;
+#endif
+
++#if defined(__APPLE__) && defined(__MACH__)
++ io_object_t io;
++ int fd;
++ char *dev;
++ CDTOC *raw_toc;
++ int descriptor_count;
++#endif
++
+ int ioctl_fd;
+ char *drive_model;
int interface;
int bigendianp;
int nsectors;
-@@ -83,9 +94,13 @@ typedef struct cdrom_drive{
+@@ -83,9 +108,13 @@ typedef struct cdrom_drive{
int is_mmc;
/* SCSI command buffer and offset pointers */
diff --git a/audio/cdparanoia/patches/patch-ci b/audio/cdparanoia/patches/patch-ci
index bc36f8635d0..2aeef343992 100644
--- a/audio/cdparanoia/patches/patch-ci
+++ b/audio/cdparanoia/patches/patch-ci
@@ -1,18 +1,22 @@
-$NetBSD: patch-ci,v 1.3 2006/05/14 21:31:01 minskim Exp $
+$NetBSD: patch-ci,v 1.4 2006/09/03 17:13:30 ben Exp $
---- interface/interface.c.orig 2000-04-19 22:41:04.000000000 +0000
+--- interface/interface.c.orig 2000-04-19 15:41:04.000000000 -0700
+++ interface/interface.c
-@@ -30,12 +30,25 @@ int cdda_close(cdrom_drive *d){
+@@ -30,12 +30,29 @@ int cdda_close(cdrom_drive *d){
_clean_messages(d);
if(d->cdda_device_name)free(d->cdda_device_name);
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
++#if defined(__APPLE__) && defined(__MACH__)
++ if(d->fd != -1) close(d->fd);
++#else
if(d->ioctl_device_name)free(d->ioctl_device_name);
if(d->drive_model)free(d->drive_model);
if(d->cdda_fd!=-1)close(d->cdda_fd);
if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd);
if(d->sg)free(d->sg);
-
++#endif
+#else
+ if(d->drive_model)
+ free(d->drive_model);
@@ -29,3 +33,24 @@ $NetBSD: patch-ci,v 1.3 2006/05/14 21:31:01 minskim Exp $
free(d);
}
return(0);
+@@ -47,6 +64,12 @@ int cdda_open(cdrom_drive *d){
+ if(d->opened)return(0);
+
+ switch(d->interface){
++#if defined(__APPLE__) && defined(__MACH__)
++ case OSX_IOKIT:
++ if((ret=osx_open_device(d)))
++ return ret;
++ break;
++#else
+ case GENERIC_SCSI:
+ if((ret=scsi_init_drive(d)))
+ return(ret);
+@@ -61,6 +84,7 @@ int cdda_open(cdrom_drive *d){
+ return(ret);
+ break;
+ #endif
++#endif
+ default:
+ cderror(d,"100: Interface not supported\n");
+ return(-100);
diff --git a/audio/cdparanoia/patches/patch-cj b/audio/cdparanoia/patches/patch-cj
new file mode 100644
index 00000000000..b4b649b22bc
--- /dev/null
+++ b/audio/cdparanoia/patches/patch-cj
@@ -0,0 +1,15 @@
+$NetBSD: patch-cj,v 1.1 2006/09/03 17:13:30 ben Exp $
+
+--- interface/common_interface.h.orig 1999-08-15 14:52:42.000000000 -0700
++++ interface/common_interface.h
+@@ -9,8 +9,10 @@
+
+ #include "low_interface.h"
+
++#if !(defined(__APPLE__) && defined(__MACH__))
+ extern int ioctl_ping_cdrom(int fd);
+ extern char *atapi_drive_info(int fd);
++#endif
+ extern int data_bigendianp(cdrom_drive *d);
+ extern int FixupTOC(cdrom_drive *d,int tracks);
+
diff --git a/audio/cdparanoia/patches/patch-ck b/audio/cdparanoia/patches/patch-ck
new file mode 100644
index 00000000000..759fe9c3e8d
--- /dev/null
+++ b/audio/cdparanoia/patches/patch-ck
@@ -0,0 +1,36 @@
+$NetBSD: patch-ck,v 1.1 2006/09/03 17:13:30 ben Exp $
+
+--- /dev/null 2006-09-03 08:46:15.000000000 -0700
++++ interface/osx_interface.h 2006-09-03 08:49:13.000000000 -0700
+@@ -0,0 +1,31 @@
++/******************************************************************
++ * CopyPolicy: GNU Public License 2 applies
++ * Copyright (C) 1998 Monty xiphmont@mit.edu
++ *
++ ******************************************************************/
++
++#ifndef _cdda_osx_interface_h_
++#define _cdda_osx_interface_h_
++
++#include <CoreFoundation/CFBase.h>
++#include <CoreFoundation/CFString.h>
++#include <CoreFoundation/CFNumber.h>
++#include <IOKit/IOBSD.h>
++#include <IOKit/storage/IOMedia.h>
++#include <IOKit/storage/IOCDMedia.h>
++#include <IOKit/storage/IOCDMediaBSDClient.h>
++#include "cdda_interface.h"
++
++char *osx_bsd_device_for_media(io_object_t media);
++int osx_enumerate_devices(cdrom_drive *d,
++ int (*device_found)(cdrom_drive *, io_object_t, void *),
++ void *data);
++io_object_t osx_default_device(cdrom_drive *d);
++int osx_read_toc(cdrom_drive *d);
++int osx_open_device(cdrom_drive *d);
++int osx_open_device_orig(cdrom_drive *d, io_object_t io);
++int osx_set_speed(cdrom_drive *d, int speed);
++int osx_enable_cdda(cdrom_drive *d, int enable);
++long osx_read_audio(cdrom_drive *d, void *buf, long begin, long sectors);
++
++#endif
diff --git a/audio/cdparanoia/patches/patch-cl b/audio/cdparanoia/patches/patch-cl
new file mode 100644
index 00000000000..8aaf32787ee
--- /dev/null
+++ b/audio/cdparanoia/patches/patch-cl
@@ -0,0 +1,13 @@
+$NetBSD: patch-cl,v 1.1 2006/09/03 17:13:30 ben Exp $
+
+--- configure.sub.orig 2006-09-03 08:31:08.000000000 -0700
++++ configure.sub
+@@ -641,7 +641,7 @@ case $os in
+ | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* )
++ | -udi* | -eabi* | -lites* | -darwin* )
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -sunos5*)
diff --git a/audio/cdparanoia/patches/patch-cm b/audio/cdparanoia/patches/patch-cm
new file mode 100644
index 00000000000..1cc39fb91ed
--- /dev/null
+++ b/audio/cdparanoia/patches/patch-cm
@@ -0,0 +1,14 @@
+$NetBSD: patch-cm,v 1.1 2006/09/03 17:13:30 ben Exp $
+
+--- configure.guess.orig 1999-08-15 14:52:30.000000000 -0700
++++ configure.guess
+@@ -459,6 +459,9 @@ EOF
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
++ *:Darwin:*:*)
++ echo `uname -p`-apple-darwin${UNAME_RELEASE}
++ exit 0 ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/audio/cdparanoia/patches/patch-cn b/audio/cdparanoia/patches/patch-cn
new file mode 100644
index 00000000000..3b0d482aad3
--- /dev/null
+++ b/audio/cdparanoia/patches/patch-cn
@@ -0,0 +1,272 @@
+$NetBSD: patch-cn,v 1.1 2006/09/03 17:13:30 ben Exp $
+
+--- /dev/null 2006-09-03 09:28:05.000000000 -0700
++++ interface/osx_interface.c 2006-09-03 09:35:39.000000000 -0700
+@@ -0,0 +1,267 @@
++/******************************************************************
++ * CopyPolicy: GNU Public License 2 applies
++ * Copyright (C) 1998 Monty xiphmont@mit.edu
++ ******************************************************************/
++
++#include <math.h>
++#include <assert.h>
++#include <stdlib.h>
++#include <paths.h>
++#include <fcntl.h>
++#include <sys/syslimits.h>
++
++#include "osx_interface.h"
++#include "utils.h"
++
++char *osx_bsd_device_for_media(io_object_t media)
++{
++ char buf[PATH_MAX];
++ size_t dev_path_length;
++ CFTypeRef str_bsd_path;
++ char *result;
++
++ str_bsd_path = IORegistryEntryCreateCFProperty(media,
++ CFSTR(kIOBSDNameKey), kCFAllocatorDefault, 0);
++
++ if(str_bsd_path == NULL) {
++ return NULL;
++ }
++
++ snprintf(buf, sizeof(buf), "%s%c", _PATH_DEV, 'r' );
++ dev_path_length = strlen(buf);
++
++ if (CFStringGetCString(str_bsd_path,
++ buf + dev_path_length,
++ sizeof(buf) - dev_path_length,
++ kCFStringEncodingASCII)) {
++ result = strdup(buf);
++ } else {
++ result = NULL;
++ }
++ CFRelease(str_bsd_path);
++ return result;
++}
++
++int osx_enumerate_devices(cdrom_drive *d,
++ int (*device_found)(cdrom_drive *, io_object_t, void *),
++ void *data)
++{
++ kern_return_t ret;
++ mach_port_t port;
++ int drives = 0;
++ CFMutableDictionaryRef classes_to_match;
++ kern_return_t kern_result;
++ io_iterator_t media_iterator;
++ io_object_t next_media;
++
++ /* get port for IOKit communication */
++ if ((ret = IOMasterPort(MACH_PORT_NULL, &port)) != KERN_SUCCESS) {
++ cderror(d,"099: IOMasterPort fail\n");
++ return -1;
++ }
++
++ classes_to_match = IOServiceMatching(kIOCDMediaClass);
++ if(classes_to_match == NULL) {
++ cderror(d,"099: IOServiceMatching: NULL\n");
++ return -1;
++ }
++
++ CFDictionarySetValue(classes_to_match, CFSTR(kIOMediaEjectableKey),
++ kCFBooleanTrue);
++
++ kern_result = IOServiceGetMatchingServices(port, classes_to_match,
++ &media_iterator);
++ if (kern_result != KERN_SUCCESS) {
++ cderror(d,"099: IOServiceGetMatchingServices fail\n");
++ return -1;
++ }
++
++ while (1) {
++ drives++;
++ next_media = IOIteratorNext(media_iterator);
++ if (next_media == 0) {
++ break;
++ }
++
++ if (!device_found(d, next_media, data))
++ break;
++ IOObjectRelease(next_media);
++ }
++ if (next_media) IOObjectRelease(next_media);
++ IOObjectRelease(media_iterator);
++
++ return drives;
++}
++
++static int find_first_device(cdrom_drive *d, io_object_t io, void *data)
++{
++ io_object_t *dev = (io_object_t *)data;
++ *dev = io;
++ IOObjectRetain(io);
++ return 0;
++}
++
++io_object_t osx_default_device(cdrom_drive *d)
++{
++ io_object_t io;
++ osx_enumerate_devices(d, find_first_device, (void *)&io);
++ return io;
++}
++
++int osx_read_toc(cdrom_drive *d)
++{
++ kern_return_t ret;
++ char *devname;
++ CFRange range;
++ CFIndex buf_len;
++ int leadout;
++ CFMutableDictionaryRef properties;
++ CFDataRef data;
++ int i;
++
++ devname = strrchr(d->dev, '/');
++
++ if (devname != NULL) {
++ devname++;
++ } else {
++ devname = d->dev;
++ }
++
++ if (*devname == 'r') devname++;
++
++ /* create a CF dictionary containing the TOC */
++ ret = IORegistryEntryCreateCFProperties(d->io, &properties,
++ kCFAllocatorDefault, kNilOptions);
++
++ if( ret != KERN_SUCCESS) {
++ cderror(d, "099: IORegistryEntryCreateCFProperties fail\n");
++ return -1;
++ }
++
++ /* get the TOC from the dictionary */
++ data = (CFDataRef)CFDictionaryGetValue(properties,
++ CFSTR(kIOCDMediaTOCKey));
++ if(data == NULL) {
++ cderror(d, "099: CFDictionaryGetValue fail\n");
++ return -1;
++ }
++
++ buf_len = CFDataGetLength(data) + 1;
++ range = CFRangeMake(0, buf_len);
++
++ d->raw_toc = (CDTOC *)malloc(buf_len);
++ if (d->raw_toc == NULL) {
++ cderror(d, "099: toc malloc fail\n");
++ CFRelease(properties);
++ return -1;
++ }
++ CFDataGetBytes(data, range, (u_char *)d->raw_toc);
++
++ CFRelease(properties);
++
++ d->descriptor_count = CDTOCGetDescriptorCount(d->raw_toc);
++ d->tracks = 0;
++
++ for (i = 0; i < d->descriptor_count; i++) {
++ int track_num = d->raw_toc->descriptors[i].point;
++ CDMSF msf = d->raw_toc->descriptors[i].p;
++ int start_sector = CDConvertMSFToLBA(msf);
++ if (track_num == 0xa2) {
++ leadout = i;
++ }
++ fprintf(stderr,
++ "track_num = %d start sector %d msf: %d,%d,%d\n",
++ track_num, start_sector,
++ msf.minute, msf.second, msf.frame);
++ if (track_num > 99 || track_num < 1) {
++ // e.g.:
++ // track_num = 160 start sector 4350 msf: 1,0,0
++ // track_num = 161 start sector 67350 msf: 15,0,0
++ // track_num = 162 start sector 330645 msf: 73,30,45
++
++ continue;
++ // XXX don't know what happens here. tracks 0xa0, 0xa1, 0xa2 (leadout)
++ }
++ d->disc_toc[d->tracks].bTrack = track_num;
++ d->disc_toc[d->tracks].bFlags = (d->raw_toc->descriptors[i].adr << 4) |
++ d->raw_toc->descriptors[i].control;
++ d->disc_toc[d->tracks].dwStartSector = start_sector;
++ d->tracks++;
++ }
++ d->disc_toc[d->tracks].bTrack = 0xaa;
++ d->disc_toc[d->tracks].bFlags = (d->raw_toc->descriptors[i].adr << 4) |
++ d->raw_toc->descriptors[leadout].control;
++ d->disc_toc[d->tracks].dwStartSector = CDConvertMSFToLBA(
++ d->raw_toc->descriptors[leadout].p);
++
++ return 0;
++}
++
++int osx_open_device_orig(cdrom_drive *d, io_object_t io)
++{
++ if (io == NULL) {
++ d->io = osx_default_device(d);
++ } else {
++ IOObjectRetain(io);
++ d->io = io;
++ }
++ d->dev = osx_bsd_device_for_media(d->io);
++ if (!d->dev) {
++ IOObjectRelease(d->io);
++ return -1;
++ }
++
++ d->fd = open(d->dev, O_RDONLY | O_NONBLOCK, 0);
++ d->enable_cdda = osx_enable_cdda;
++ d->read_toc = osx_read_toc;
++ d->read_audio = osx_read_audio;
++ d->set_speed = osx_set_speed;
++
++ if (d->fd == -1) {
++ free(d->dev);
++ IOObjectRelease(d->io);
++ return -1;
++ }
++
++ osx_read_toc(d);
++
++ d->nsectors = 32;
++ d->opened = 1;
++ return 0;
++}
++
++int osx_open_device(cdrom_drive *d)
++{
++ osx_open_device_orig(d, NULL);
++}
++
++int osx_set_speed(cdrom_drive *d, int speed)
++{
++ return 0;
++}
++
++int osx_enable_cdda(cdrom_drive *d, int enable)
++{
++ return 0;
++}
++
++long osx_read_audio(cdrom_drive *d, void *buf, long begin, long sectors)
++{
++ dk_cd_read_t cd_read;
++
++ // fprintf(stderr, "read_audio %p, %d, %d\n", buf, begin, sectors);
++
++ memset(&cd_read, 0, sizeof(cd_read));
++
++ cd_read.offset = begin * kCDSectorSizeCDDA;
++ cd_read.sectorArea = kCDSectorAreaUser;
++ cd_read.sectorType = kCDSectorTypeCDDA;
++
++ cd_read.buffer = buf;
++ cd_read.bufferLength = kCDSectorSizeCDDA * sectors;
++
++ if( ioctl(d->fd, DKIOCCDREAD, &cd_read) == -1) {
++ return 0;
++ }
++ return cd_read.bufferLength / kCDSectorSizeCDDA;
++}