Thu Dec 16 04:55:46 2010 UTC ()
make 10.2 work on macosx (port wouldn't compile since it was upgraded
from 9.8 to 10.2).   the main issue is that macosx doesn't have the
clockid_t and clock_gettime() API.


(chuck)
diff -r1.29 -r1.30 pkgsrc/audio/cdparanoia/distinfo
diff -r1.7 -r1.8 pkgsrc/audio/cdparanoia/patches/patch-cb
diff -r1.6 -r1.7 pkgsrc/audio/cdparanoia/patches/patch-ch
diff -r1.8 -r1.9 pkgsrc/audio/cdparanoia/patches/patch-ci

cvs diff -r1.29 -r1.30 pkgsrc/audio/cdparanoia/distinfo (expand / switch to unified diff)

--- pkgsrc/audio/cdparanoia/distinfo 2010/12/15 21:08:30 1.29
+++ pkgsrc/audio/cdparanoia/distinfo 2010/12/16 04:55:46 1.30
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1$NetBSD: distinfo,v 1.29 2010/12/15 21:08:30 chuck Exp $ 1$NetBSD: distinfo,v 1.30 2010/12/16 04:55:46 chuck Exp $
2 2
3SHA1 (cdparanoia-III-10.2.src.tgz) = 1901e20d3a370ca6afa4c76a9ef30d3f03044320 3SHA1 (cdparanoia-III-10.2.src.tgz) = 1901e20d3a370ca6afa4c76a9ef30d3f03044320
4RMD160 (cdparanoia-III-10.2.src.tgz) = d6c4ea9cc4aa4d5bcca4985e668ea6142d53cc55 4RMD160 (cdparanoia-III-10.2.src.tgz) = d6c4ea9cc4aa4d5bcca4985e668ea6142d53cc55
5Size (cdparanoia-III-10.2.src.tgz) = 183236 bytes 5Size (cdparanoia-III-10.2.src.tgz) = 183236 bytes
6SHA1 (patch-aa) = e00476e557772f97e1588650bbfab19a985a7921 6SHA1 (patch-aa) = e00476e557772f97e1588650bbfab19a985a7921
7SHA1 (patch-ab) = af07649ac4e0d4a5c2798e4cfc903e6959adea44 7SHA1 (patch-ab) = af07649ac4e0d4a5c2798e4cfc903e6959adea44
8SHA1 (patch-ac) = bd79af2f7544aa7e1c55150c761870887b49a160 8SHA1 (patch-ac) = bd79af2f7544aa7e1c55150c761870887b49a160
9SHA1 (patch-ad) = f0c79049cbc26e9483c410f00cb6df85c280c145 9SHA1 (patch-ad) = f0c79049cbc26e9483c410f00cb6df85c280c145
10SHA1 (patch-ae) = dda320ca0817b06cb25be86b2a891776550603ae 10SHA1 (patch-ae) = dda320ca0817b06cb25be86b2a891776550603ae
11SHA1 (patch-ba) = 0f4f8ddecd9f5f273f7a1687bbb1477fd64500c1 11SHA1 (patch-ba) = 0f4f8ddecd9f5f273f7a1687bbb1477fd64500c1
12SHA1 (patch-ca) = 9860c2227f9d359e808c0ee0989020a9a3163a48 12SHA1 (patch-ca) = 9860c2227f9d359e808c0ee0989020a9a3163a48
13SHA1 (patch-cb) = 31891b99826876e8c16ecc7688972087c49f53ac 13SHA1 (patch-cb) = 48c05accf3b235a2a1bb168b88cad6e8936169b1
14SHA1 (patch-cc) = e692c8f4a9811123baa6cb25c09dea0004cc9b68 14SHA1 (patch-cc) = e692c8f4a9811123baa6cb25c09dea0004cc9b68
15SHA1 (patch-cd) = 7141563e10b0d23dbd4ff824224a10908741be5b 15SHA1 (patch-cd) = 7141563e10b0d23dbd4ff824224a10908741be5b
16SHA1 (patch-ce) = b343191fa2e337e2c3c091c585451c726c1f745b 16SHA1 (patch-ce) = b343191fa2e337e2c3c091c585451c726c1f745b
17SHA1 (patch-cf) = 8d204272dace7bb1d3238e44f6ff152ab38f0930 17SHA1 (patch-cf) = 8d204272dace7bb1d3238e44f6ff152ab38f0930
18SHA1 (patch-cg) = fd92ca2b999c4d25ddbe5abe5f384c5c83019624 18SHA1 (patch-cg) = fd92ca2b999c4d25ddbe5abe5f384c5c83019624
19SHA1 (patch-ch) = 37c8e5e675ed8db8ae7768918bea28d509a0563c 19SHA1 (patch-ch) = 4b0a232bc21fc57777897269139894428d11016b
20SHA1 (patch-ci) = 0b334f818b35871856f386f77e0bce935ab1b3d0 20SHA1 (patch-ci) = dabc5121436aee0efde4cda8a01903d918cb8e4a
21SHA1 (patch-cj) = e2420e2ccadd2d6ea30d6bf48af9c141dc395afc 21SHA1 (patch-cj) = e2420e2ccadd2d6ea30d6bf48af9c141dc395afc
22SHA1 (patch-ck) = 0232f8f42d98b49043f55cd6aaf1f50ab38fadfb 22SHA1 (patch-ck) = 0232f8f42d98b49043f55cd6aaf1f50ab38fadfb
23SHA1 (patch-cn) = b79db0b24a042a5801b47e6db5e20cbf07a53475 23SHA1 (patch-cn) = b79db0b24a042a5801b47e6db5e20cbf07a53475

cvs diff -r1.7 -r1.8 pkgsrc/audio/cdparanoia/patches/patch-cb (expand / switch to unified diff)

--- pkgsrc/audio/cdparanoia/patches/patch-cb 2009/08/29 04:54:52 1.7
+++ pkgsrc/audio/cdparanoia/patches/patch-cb 2010/12/16 04:55:46 1.8
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1$NetBSD: patch-cb,v 1.7 2009/08/29 04:54:52 hasso Exp $ 1$NetBSD: patch-cb,v 1.8 2010/12/16 04:55:46 chuck Exp $
2 2
3--- interface/low_interface.h.orig 2008-09-11 13:43:52 +0300 3--- interface/low_interface.h.orig 2008-09-11 06:43:52.000000000 -0400
4+++ interface/low_interface.h 2009-08-26 10:00:01 +0300 4+++ interface/low_interface.h 2010-12-15 23:40:19.000000000 -0500
5@@ -26,6 +26,7 @@ 5@@ -26,6 +26,7 @@
6 #include <sys/time.h> 6 #include <sys/time.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8  8
9+#ifdef __linux__ 9+#ifdef __linux__
10 #include <linux/major.h> 10 #include <linux/major.h>
11 #include <linux/version.h> 11 #include <linux/version.h>
12  12
13@@ -54,6 +55,22 @@ 13@@ -54,6 +55,22 @@
14 #include <linux/cdrom.h> 14 #include <linux/cdrom.h>
15 #include <linux/major.h> 15 #include <linux/major.h>
16  16
17+#elif defined(__FreeBSD__) || defined(__DragonFly__) 17+#elif defined(__FreeBSD__) || defined(__DragonFly__)
@@ -23,27 +23,38 @@ $NetBSD: patch-cb,v 1.7 2009/08/29 04:54 @@ -23,27 +23,38 @@ $NetBSD: patch-cb,v 1.7 2009/08/29 04:54
23+#include <cam/scsi/scsi_message.h> 23+#include <cam/scsi/scsi_message.h>
24+#include <cam/scsi/scsi_sg.h> 24+#include <cam/scsi/scsi_sg.h>
25+#include <camlib.h> 25+#include <camlib.h>
26+ 26+
27+#elif defined(__NetBSD__) 27+#elif defined(__NetBSD__)
28+ 28+
29+#include <sys/scsiio.h> 29+#include <sys/scsiio.h>
30+#include <sys/cdio.h> 30+#include <sys/cdio.h>
31+#endif 31+#endif
32+ 32+
33 #include "cdda_interface.h" 33 #include "cdda_interface.h"
34  34
35 #ifndef SG_EMULATED_HOST 35 #ifndef SG_EMULATED_HOST
36@@ -107,10 +124,18 @@ struct cdda_private_data { 36@@ -100,17 +117,29 @@
 37 struct cdda_private_data {
 38 struct sg_header *sg_hd;
 39 unsigned char *sg_buffer; /* points into sg_hd */
 40+#if defined(__APPLE__) && defined(__MACH__)
 41+ /* don't need clock */
 42+#else
 43 clockid_t clock;
 44+#endif
 45 int last_milliseconds;
 46 };
 47
37 #define MAX_RETRIES 8 48 #define MAX_RETRIES 8
38 #define MAX_BIG_BUFF_SIZE 65536 49 #define MAX_BIG_BUFF_SIZE 65536
39 #define MIN_BIG_BUFF_SIZE 4096 50 #define MIN_BIG_BUFF_SIZE 4096
40+#ifdef __linux__ 51+#ifdef __linux__
41 #define SG_OFF sizeof(struct sg_header) 52 #define SG_OFF sizeof(struct sg_header)
42+#elif defined(__FreeBSD__) || defined(__DragonFly__) 53+#elif defined(__FreeBSD__) || defined(__DragonFly__)
43+#define SG_OFF (0) 54+#define SG_OFF (0)
44+#elif defined(__NetBSD__) 55+#elif defined(__NetBSD__)
45+#define SG_OFF sizeof(scsireq_t) 56+#define SG_OFF sizeof(scsireq_t)
46+#endif 57+#endif
47  58
48 extern int cooked_init_drive (cdrom_drive *d); 59 extern int cooked_init_drive (cdrom_drive *d);
49+#if !defined(__FreeBSD__) && !defined(__DragonFly__) 60+#if !defined(__FreeBSD__) && !defined(__DragonFly__)

cvs diff -r1.6 -r1.7 pkgsrc/audio/cdparanoia/patches/patch-ch (expand / switch to unified diff)

--- pkgsrc/audio/cdparanoia/patches/patch-ch 2009/08/29 04:54:52 1.6
+++ pkgsrc/audio/cdparanoia/patches/patch-ch 2010/12/16 04:55:46 1.7
@@ -1,51 +1,51 @@ @@ -1,51 +1,51 @@
1$NetBSD: patch-ch,v 1.6 2009/08/29 04:54:52 hasso Exp $ 1$NetBSD: patch-ch,v 1.7 2010/12/16 04:55:46 chuck Exp $
2 2
3--- interface/cdda_interface.h.orig 2008-09-11 13:43:52 +0300 3--- interface/cdda_interface.h.orig 2008-09-11 06:43:52.000000000 -0400
4+++ interface/cdda_interface.h 2009-08-28 11:50:44 +0300 4+++ interface/cdda_interface.h 2010-12-15 23:39:17.000000000 -0500
5@@ -18,9 +18,24 @@ 5@@ -18,9 +18,24 @@
6 #endif 6 #endif
7 #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4) 7 #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4)
8  8
9+#if defined(__APPLE__) && defined(__MACH__) 9+#if defined(__APPLE__) && defined(__MACH__)
10+#include <IOKit/IOKitLib.h> 10+#include <IOKit/IOKitLib.h>
11+#include <IOKit/storage/IOCDTypes.h> 11+#include <IOKit/storage/IOCDTypes.h>
12+#endif 12+#endif
13+ 13+
14 #include <sys/types.h> 14 #include <sys/types.h>
15 #include <signal.h> 15 #include <signal.h>
16  16
17+#if defined(__FreeBSD__) || defined(__DragonFly__) 17+#if defined(__FreeBSD__) || defined(__DragonFly__)
18+#define CAM_NO_SCSI_INQUIRY 18+#define CAM_NO_SCSI_INQUIRY
19+#include <stdio.h> 19+#include <stdio.h>
20+#include <camlib.h> 20+#include <camlib.h>
21+#endif 21+#endif
22+ 22+
23+#ifdef __NetBSD__ 23+#if defined(__NetBSD__) || (defined(__APPLE__) && defined(__MACH__))
24+#define ENOMEDIUM 12345 24+#define ENOMEDIUM 12345
25+#endif 25+#endif
26+ 26+
27 #define MAXTRK 100 27 #define MAXTRK 100
28  28
29 typedef struct TOC { /* structure of table of contents */ 29 typedef struct TOC { /* structure of table of contents */
30@@ -35,6 +50,7 @@ typedef struct TOC { /* structure of tab 30@@ -35,6 +50,7 @@
31 #define TEST_INTERFACE 2 31 #define TEST_INTERFACE 2
32 #define SGIO_SCSI 3 32 #define SGIO_SCSI 3
33 #define SGIO_SCSI_BUGGY1 4 33 #define SGIO_SCSI_BUGGY1 4
34+#define OSX_IOKIT 5 34+#define OSX_IOKIT 5
35  35
36 #define CDDA_MESSAGE_FORGETIT 0 36 #define CDDA_MESSAGE_FORGETIT 0
37 #define CDDA_MESSAGE_PRINTIT 1 37 #define CDDA_MESSAGE_PRINTIT 1
38@@ -49,13 +65,27 @@ typedef struct cdrom_drive{ 38@@ -49,13 +65,27 @@
39 int opened; /* This struct may just represent a candidate for opening */ 39 int opened; /* This struct may just represent a candidate for opening */
40  40
41 char *cdda_device_name; 41 char *cdda_device_name;
42+#if !defined(__FreeBSD__) 42+#if !defined(__FreeBSD__)
43 char *ioctl_device_name; 43 char *ioctl_device_name;
44  44
45 int cdda_fd; 45 int cdda_fd;
46- int ioctl_fd; 46- int ioctl_fd;
47  47
48- char *drive_model; 48- char *drive_model;
49 int drive_type; 49 int drive_type;
50+#else 50+#else
51+ struct cam_device *dev; 51+ struct cam_device *dev;
@@ -55,22 +55,22 @@ $NetBSD: patch-ch,v 1.6 2009/08/29 04:54 @@ -55,22 +55,22 @@ $NetBSD: patch-ch,v 1.6 2009/08/29 04:54
55+#if defined(__APPLE__) && defined(__MACH__) 55+#if defined(__APPLE__) && defined(__MACH__)
56+ io_object_t io; 56+ io_object_t io;
57+ int fd; 57+ int fd;
58+ char *dev; 58+ char *dev;
59+ CDTOC *raw_toc; 59+ CDTOC *raw_toc;
60+ int descriptor_count; 60+ int descriptor_count;
61+#endif 61+#endif
62+ 62+
63+ int ioctl_fd; 63+ int ioctl_fd;
64+ char *drive_model; 64+ char *drive_model;
65 int interface; 65 int interface;
66 int bigendianp; 66 int bigendianp;
67 int nsectors; 67 int nsectors;
68@@ -84,7 +114,7 @@ typedef struct cdrom_drive{ 68@@ -84,7 +114,7 @@
69 int is_atapi; 69 int is_atapi;
70 int is_mmc; 70 int is_mmc;
71  71
72- cdda_private_data_t *private; 72- cdda_private_data_t *private;
73+ cdda_private_data_t *private_data; 73+ cdda_private_data_t *private_data;
74 void *reserved; 74 void *reserved;
75 unsigned char inqbytes[4]; 75 unsigned char inqbytes[4];
76  76

cvs diff -r1.8 -r1.9 pkgsrc/audio/cdparanoia/patches/patch-ci (expand / switch to unified diff)

--- pkgsrc/audio/cdparanoia/patches/patch-ci 2010/03/26 16:38:32 1.8
+++ pkgsrc/audio/cdparanoia/patches/patch-ci 2010/12/16 04:55:46 1.9
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1$NetBSD: patch-ci,v 1.8 2010/03/26 16:38:32 jdc Exp $ 1$NetBSD: patch-ci,v 1.9 2010/12/16 04:55:46 chuck Exp $
2 2
3--- interface/interface.c.orig 2008-09-11 10:43:52.000000000 +0000 3--- interface/interface.c.orig 2008-09-11 06:43:52.000000000 -0400
4+++ interface/interface.c 2010-03-24 13:57:38.000000000 +0000 4+++ interface/interface.c 2010-12-15 23:41:29.000000000 -0500
5@@ -35,6 +35,10 @@ 5@@ -35,6 +35,10 @@
6  6
7 _clean_messages(d); 7 _clean_messages(d);
8 if(d->cdda_device_name)free(d->cdda_device_name); 8 if(d->cdda_device_name)free(d->cdda_device_name);
9+#if !defined(__FreeBSD__) 9+#if !defined(__FreeBSD__)
10+#if defined(__APPLE__) && defined(__MACH__) 10+#if defined(__APPLE__) && defined(__MACH__)
11+ if(d->fd != -1) close(d->fd); 11+ if(d->fd != -1) close(d->fd);
12+#else 12+#else
13 if(d->ioctl_device_name)free(d->ioctl_device_name); 13 if(d->ioctl_device_name)free(d->ioctl_device_name);
14 if(d->drive_model)free(d->drive_model); 14 if(d->drive_model)free(d->drive_model);
15 if(d->cdda_fd!=-1)close(d->cdda_fd); 15 if(d->cdda_fd!=-1)close(d->cdda_fd);
16@@ -43,6 +47,19 @@ 16@@ -43,6 +47,19 @@
17 if(d->private->sg_hd)free(d->private->sg_hd); 17 if(d->private->sg_hd)free(d->private->sg_hd);
@@ -64,13 +64,24 @@ $NetBSD: patch-ci,v 1.8 2010/03/26 16:38 @@ -64,13 +64,24 @@ $NetBSD: patch-ci,v 1.8 2010/03/26 16:38
64+#endif 64+#endif
65 default: 65 default:
66 cderror(d,"100: Interface not supported\n"); 66 cderror(d,"100: Interface not supported\n");
67 return(-100); 67 return(-100);
68@@ -113,7 +139,7 @@ 68@@ -113,7 +139,7 @@
69 if(sectors>0){ 69 if(sectors>0){
70 sectors=d->read_audio(d,buffer,beginsector,sectors); 70 sectors=d->read_audio(d,buffer,beginsector,sectors);
71  71
72- if(sectors>0){ 72- if(sectors>0){
73+ if(sectors>0 && buffer != NULL){ 73+ if(sectors>0 && buffer != NULL){
74 /* byteswap? */ 74 /* byteswap? */
75 if(d->bigendianp==-1) /* not determined yet */ 75 if(d->bigendianp==-1) /* not determined yet */
76 d->bigendianp=data_bigendianp(d); 76 d->bigendianp=data_bigendianp(d);
 77@@ -127,7 +153,9 @@
 78 }
 79 }
 80 }
 81- if(ms)*ms=d->private->last_milliseconds;
 82+ if(ms) {
 83+ *ms = (d->private == NULL) ? 0 : d->private->last_milliseconds;
 84+ }
 85 return(sectors);
 86 }
 87