pkgsrc/audio/cdparanoia/patches/patch-ch
jperkin b14ce6342b Make package build on SunOS. The end result is mostly non-functional as it
is missing SCSI and CDDA support, however this does enable a number of other
packages to now build, many of which do not depend on working cdparanoia for
their own functionality.
2013-12-12 16:41:32 +00:00

76 lines
1.7 KiB
Text

$NetBSD: patch-ch,v 1.8 2013/12/12 16:41:32 jperkin Exp $
--- interface/cdda_interface.h.orig 2008-09-11 10:43:52.000000000 +0000
+++ interface/cdda_interface.h
@@ -18,9 +18,24 @@
#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>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#define CAM_NO_SCSI_INQUIRY
+#include <stdio.h>
+#include <camlib.h>
+#endif
+
+#if defined(__NetBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__sun)
+#define ENOMEDIUM 12345
+#endif
+
#define MAXTRK 100
typedef struct TOC { /* structure of table of contents */
@@ -35,6 +50,7 @@ typedef struct TOC { /* structure of tab
#define TEST_INTERFACE 2
#define SGIO_SCSI 3
#define SGIO_SCSI_BUGGY1 4
+#define OSX_IOKIT 5
#define CDDA_MESSAGE_FORGETIT 0
#define CDDA_MESSAGE_PRINTIT 1
@@ -49,13 +65,27 @@ typedef struct cdrom_drive{
int opened; /* This struct may just represent a candidate for opening */
char *cdda_device_name;
+#if !defined(__FreeBSD__)
char *ioctl_device_name;
int cdda_fd;
- int ioctl_fd;
- char *drive_model;
int drive_type;
+#else
+ struct cam_device *dev;
+ 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;
@@ -84,7 +114,7 @@ typedef struct cdrom_drive{
int is_atapi;
int is_mmc;
- cdda_private_data_t *private;
+ cdda_private_data_t *private_data;
void *reserved;
unsigned char inqbytes[4];