From fd1c0d9c7a3cf47d3085c524a8f60f38c06fb043 Mon Sep 17 00:00:00 2001 From: hasso Date: Sat, 29 Aug 2009 04:54:52 +0000 Subject: Make it just build on DragonFly. Doesn't work yet though. --- audio/cdparanoia/distinfo | 12 ++++++------ audio/cdparanoia/patches/patch-cb | 12 +++++++----- audio/cdparanoia/patches/patch-cf | 16 ++++++++-------- audio/cdparanoia/patches/patch-cg | 40 +++++++++++++++++++++++++-------------- audio/cdparanoia/patches/patch-ch | 17 +++++++++-------- audio/cdparanoia/patches/patch-ci | 12 ++++++------ 6 files changed, 62 insertions(+), 47 deletions(-) (limited to 'audio/cdparanoia') diff --git a/audio/cdparanoia/distinfo b/audio/cdparanoia/distinfo index ec61f1e55e5..e376609583f 100644 --- a/audio/cdparanoia/distinfo +++ b/audio/cdparanoia/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.24 2009/08/14 15:51:05 drochner Exp $ +$NetBSD: distinfo,v 1.25 2009/08/29 04:54:52 hasso Exp $ SHA1 (cdparanoia-III-10.2.src.tgz) = 1901e20d3a370ca6afa4c76a9ef30d3f03044320 RMD160 (cdparanoia-III-10.2.src.tgz) = d6c4ea9cc4aa4d5bcca4985e668ea6142d53cc55 @@ -10,14 +10,14 @@ SHA1 (patch-ad) = 9a1ea1b98b5f3810e1ccae57beb8c68b5e189716 SHA1 (patch-ae) = dda320ca0817b06cb25be86b2a891776550603ae SHA1 (patch-ba) = 0f4f8ddecd9f5f273f7a1687bbb1477fd64500c1 SHA1 (patch-ca) = 9860c2227f9d359e808c0ee0989020a9a3163a48 -SHA1 (patch-cb) = b38b9119273aef002e1fde8f84888b303d7833d9 +SHA1 (patch-cb) = 97cd00476b84f2567eab247e0a6eef544030d692 SHA1 (patch-cc) = a2f78daf62ecae73ab3cc264f39b367dfa249129 SHA1 (patch-cd) = 7141563e10b0d23dbd4ff824224a10908741be5b SHA1 (patch-ce) = b343191fa2e337e2c3c091c585451c726c1f745b -SHA1 (patch-cf) = 73cdff1ab6b9857cd3299f3eb152c399a7e38227 -SHA1 (patch-cg) = 9a979bcac06da564e6d86d0ffc04848e529367cf -SHA1 (patch-ch) = e7ec16fe9c7ff805104d68678a2576370cc4c0e7 -SHA1 (patch-ci) = 614b428a3bf330ccb5850149549fb98e8e1b90c0 +SHA1 (patch-cf) = 2fe8cacff2d508948678d6455ea3bb679dece1e8 +SHA1 (patch-cg) = 4c1bcad8c1c3d3e3e84ba7754ada9de711581da2 +SHA1 (patch-ch) = 91d5057e3916849e2bfc027be3bb021e2b73c87e +SHA1 (patch-ci) = 6d0524484219b2d5e5b4149183d3644a6e9da77a SHA1 (patch-cj) = e2420e2ccadd2d6ea30d6bf48af9c141dc395afc SHA1 (patch-ck) = 0232f8f42d98b49043f55cd6aaf1f50ab38fadfb SHA1 (patch-cn) = b79db0b24a042a5801b47e6db5e20cbf07a53475 diff --git a/audio/cdparanoia/patches/patch-cb b/audio/cdparanoia/patches/patch-cb index 620ce2b9fdd..e8e8edbaac9 100644 --- a/audio/cdparanoia/patches/patch-cb +++ b/audio/cdparanoia/patches/patch-cb @@ -1,7 +1,7 @@ -$NetBSD: patch-cb,v 1.6 2009/08/09 16:00:53 drochner Exp $ +$NetBSD: patch-cb,v 1.7 2009/08/29 04:54:52 hasso Exp $ ---- interface/low_interface.h.orig 2008-09-11 12:43:52.000000000 +0200 -+++ interface/low_interface.h +--- interface/low_interface.h.orig 2008-09-11 13:43:52 +0300 ++++ interface/low_interface.h 2009-08-26 10:00:01 +0300 @@ -26,6 +26,7 @@ #include #include @@ -10,7 +10,7 @@ $NetBSD: patch-cb,v 1.6 2009/08/09 16:00:53 drochner Exp $ #include #include -@@ -54,6 +55,20 @@ +@@ -54,6 +55,22 @@ #include #include @@ -19,7 +19,9 @@ $NetBSD: patch-cb,v 1.6 2009/08/09 16:00:53 drochner Exp $ +#include +#include + ++#define CAM_NO_SCSI_INQUIRY +#include ++#include +#include + +#elif defined(__NetBSD__) @@ -31,7 +33,7 @@ $NetBSD: patch-cb,v 1.6 2009/08/09 16:00:53 drochner Exp $ #include "cdda_interface.h" #ifndef SG_EMULATED_HOST -@@ -107,10 +122,18 @@ struct cdda_private_data { +@@ -107,10 +124,18 @@ struct cdda_private_data { #define MAX_RETRIES 8 #define MAX_BIG_BUFF_SIZE 65536 #define MIN_BIG_BUFF_SIZE 4096 diff --git a/audio/cdparanoia/patches/patch-cf b/audio/cdparanoia/patches/patch-cf index 5d605c5ce07..314917061b7 100644 --- a/audio/cdparanoia/patches/patch-cf +++ b/audio/cdparanoia/patches/patch-cf @@ -1,7 +1,7 @@ -$NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ +$NetBSD: patch-cf,v 1.12 2009/08/29 04:54:52 hasso Exp $ ---- interface/scan_devices.c.orig 2008-08-26 11:55:22.000000000 +0200 -+++ interface/scan_devices.c +--- interface/scan_devices.c.orig 2008-08-26 12:55:22 +0300 ++++ interface/scan_devices.c 2009-08-26 09:50:54 +0300 @@ -1,6 +1,8 @@ /****************************************************************** * CopyPolicy: GNU Lesser General Public License 2.1 applies @@ -84,10 +84,10 @@ $NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ /* an IDE device may have scsi-ide support, SG_IO support and cooked support. Prefer the SCSI variants, they give the most control */ -+#if defined(__linux__) || defined(__NetBSD__) ++#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__) d=cdda_identify_scsi(NULL,device,messagedest,messages); if(!d)d=cdda_identify_cooked(device,messagedest,messages); -+#elif defined(__FreeBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) + d = cdda_identify_scsi(device, NULL, messagedest, messages); + if (d == NULL) + d = cdda_identify_cooked(device, messagedest, messages); @@ -219,7 +219,7 @@ $NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ } +#endif -+#if defined(__linux__) || defined(__NetBSD__) ++#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__) /* scanning is always done by specifying a device name in specialized_device; generic_device is only filled when the generic device force option is used, and in that case, use of SG (not SGIO) should indeed be @@ -350,7 +350,7 @@ $NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ } return(NULL); } -+#elif defined(__FreeBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) +cdrom_drive *cdda_identify_scsi(const char *device, + const char *dummy, + int messagedest, @@ -404,7 +404,7 @@ $NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ + d->lun = d->dev->target_lun; + d->interface = GENERIC_SCSI; + -+ if ((d->sg_buffer = malloc(MAX_BIG_BUFF_SIZE)) == NULL) { ++ if ((d->private->sg_buffer = malloc(MAX_BIG_BUFF_SIZE)) == NULL) { + idperror(messagedest, messages, "Could not allocate buffer memory", NULL); + goto cdda_identify_scsi_fail; + } diff --git a/audio/cdparanoia/patches/patch-cg b/audio/cdparanoia/patches/patch-cg index 5d05e619c73..3fcca5d311e 100644 --- a/audio/cdparanoia/patches/patch-cg +++ b/audio/cdparanoia/patches/patch-cg @@ -1,7 +1,7 @@ -$NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ +$NetBSD: patch-cg,v 1.11 2009/08/29 04:54:52 hasso Exp $ ---- interface/scsi_interface.c.orig 2008-09-11 22:33:30.000000000 +0200 -+++ interface/scsi_interface.c +--- interface/scsi_interface.c.orig 2008-09-11 23:33:30 +0300 ++++ interface/scsi_interface.c 2009-08-28 12:14:21 +0300 @@ -12,6 +12,11 @@ #include "common_interface.h" #include "utils.h" @@ -37,7 +37,7 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ cdmessage(d,buffer); } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static void clear_garbage(cdrom_drive *d){ fd_set fdset; struct timeval tv; @@ -53,11 +53,23 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ return 0; } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) /* process a complete scsi command. */ static int sg2_handle_scsi_cmd(cdrom_drive *d, unsigned char *cmd, -@@ -417,6 +430,71 @@ static int sgio_handle_scsi_cmd(cdrom_dr +@@ -356,7 +369,11 @@ static int sgio_handle_scsi_cmd(cdrom_dr + hdr.timeout = 50000; + hdr.interface_id = 'S'; + hdr.dxferp = d->private->sg_buffer; ++#if defined(__DragonFly__) ++ hdr.flags = 0; ++#else + hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ ++#endif + + /* scary buffer fill hack */ + if(bytecheck && out_size>in_size) +@@ -417,6 +434,71 @@ static int sgio_handle_scsi_cmd(cdrom_dr errno = 0; return 0; } @@ -129,11 +141,11 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ static int handle_scsi_cmd(cdrom_drive *d, unsigned char *cmd, -@@ -427,9 +505,14 @@ static int handle_scsi_cmd(cdrom_drive * +@@ -427,9 +509,14 @@ static int handle_scsi_cmd(cdrom_drive * int bytecheck, unsigned char *sense){ -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) if(d->interface == SGIO_SCSI || d->interface == SGIO_SCSI_BUGGY1) return sgio_handle_scsi_cmd(d,cmd,cmd_len,in_size,out_size,bytefill,bytecheck,sense); return sg2_handle_scsi_cmd(d,cmd,cmd_len,in_size,out_size,bytefill,bytecheck,sense); @@ -144,15 +156,15 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ } -@@ -453,6 +536,7 @@ static int test_unit_ready(cdrom_drive * +@@ -453,6 +540,7 @@ static int test_unit_ready(cdrom_drive * return 1; } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static void reset_scsi(cdrom_drive *d){ int arg,tries=0; d->enable_cdda(d,0); -@@ -471,6 +555,22 @@ static void reset_scsi(cdrom_drive *d){ +@@ -471,6 +559,22 @@ static void reset_scsi(cdrom_drive *d){ d->enable_cdda(d,1); } @@ -175,15 +187,15 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ static int mode_sense_atapi(cdrom_drive *d,int size,int page){ unsigned char sense[SG_MAX_SENSE]; -@@ -1587,6 +1687,7 @@ static void check_cache(cdrom_drive *d){ +@@ -1587,6 +1691,7 @@ static void check_cache(cdrom_drive *d){ } } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static int check_atapi(cdrom_drive *d){ int atapiret=-1; int fd = d->cdda_fd; /* check the device we'll actually be using to read */ -@@ -1616,7 +1717,32 @@ static int check_atapi(cdrom_drive *d){ +@@ -1616,7 +1721,32 @@ static int check_atapi(cdrom_drive *d){ return(d->is_atapi); } diff --git a/audio/cdparanoia/patches/patch-ch b/audio/cdparanoia/patches/patch-ch index 8285daa0c7c..1f4ceb0c7c8 100644 --- a/audio/cdparanoia/patches/patch-ch +++ b/audio/cdparanoia/patches/patch-ch @@ -1,8 +1,8 @@ -$NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $ +$NetBSD: patch-ch,v 1.6 2009/08/29 04:54:52 hasso Exp $ ---- interface/cdda_interface.h.orig 2008-09-11 12:43:52.000000000 +0200 -+++ interface/cdda_interface.h -@@ -18,9 +18,23 @@ +--- interface/cdda_interface.h.orig 2008-09-11 13:43:52 +0300 ++++ interface/cdda_interface.h 2009-08-28 11:50:44 +0300 +@@ -18,9 +18,24 @@ #endif #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4) @@ -15,6 +15,7 @@ $NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $ #include +#if defined(__FreeBSD__) || defined(__DragonFly__) ++#define CAM_NO_SCSI_INQUIRY +#include +#include +#endif @@ -26,7 +27,7 @@ $NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $ #define MAXTRK 100 typedef struct TOC { /* structure of table of contents */ -@@ -35,6 +49,7 @@ typedef struct TOC { /* structure of tab +@@ -35,6 +50,7 @@ typedef struct TOC { /* structure of tab #define TEST_INTERFACE 2 #define SGIO_SCSI 3 #define SGIO_SCSI_BUGGY1 4 @@ -34,11 +35,11 @@ $NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $ #define CDDA_MESSAGE_FORGETIT 0 #define CDDA_MESSAGE_PRINTIT 1 -@@ -49,13 +64,27 @@ typedef struct cdrom_drive{ +@@ -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__) && !defined(__DragonFly__) ++#if !defined(__FreeBSD__) char *ioctl_device_name; int cdda_fd; @@ -64,7 +65,7 @@ $NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $ int interface; int bigendianp; int nsectors; -@@ -84,7 +113,7 @@ typedef struct cdrom_drive{ +@@ -84,7 +114,7 @@ typedef struct cdrom_drive{ int is_atapi; int is_mmc; diff --git a/audio/cdparanoia/patches/patch-ci b/audio/cdparanoia/patches/patch-ci index d24853a6361..213b0e48b78 100644 --- a/audio/cdparanoia/patches/patch-ci +++ b/audio/cdparanoia/patches/patch-ci @@ -1,12 +1,12 @@ -$NetBSD: patch-ci,v 1.6 2009/08/14 15:51:06 drochner Exp $ +$NetBSD: patch-ci,v 1.7 2009/08/29 04:54:52 hasso Exp $ ---- interface/interface.c.orig 2008-09-11 12:43:52.000000000 +0200 -+++ interface/interface.c +--- interface/interface.c.orig 2008-09-11 13:43:52 +0300 ++++ interface/interface.c 2009-08-26 09:57:44 +0300 @@ -35,6 +35,10 @@ 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(__FreeBSD__) +#if defined(__APPLE__) && defined(__MACH__) + if(d->fd != -1) close(d->fd); +#else @@ -25,8 +25,8 @@ $NetBSD: patch-ci,v 1.6 2009/08/14 15:51:06 drochner Exp $ + cam_freeccb(d->ccb); + if(d->dev) + cam_close_device(d->dev); -+ if(d->sg_buffer) -+ free(d->sg_buffer); ++ if(d->private->sg_buffer) ++ free(d->private->sg_buffer); + if(d->ioctl_fd != -1) + close(d->ioctl_fd); +#endif -- cgit v1.2.3