diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2004-10-05 12:59:46 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2004-10-05 12:59:46 +0800 |
commit | d92e10bc4eba8b5fb690df40235db4e9c0cb516c (patch) | |
tree | 6c8133e26c0771e0c2f821fef825d240465d3d8d | |
parent | d46d30c9ac73f330f269ee6762bec031dd2df315 (diff) | |
download | marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar.gz marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar.bz2 marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar.lz marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar.xz marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.tar.zst marcuscom-ports-d92e10bc4eba8b5fb690df40235db4e9c0cb516c.zip |
* Enable DVD support by default when doing package building
* Fix a crash that can occur when processing CD-ROM drives and recordable
drives without any discs [1]
Reported by: Tom McLaughlin <tmclaugh@sdf.lonestar.org> [1]
Tested by: Tom McLaughlin <tmclaugh@sdf.lonestar.org> [1]
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@2930 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | sysutils/nautilus-cd-burner/Makefile | 6 | ||||
-rw-r--r-- | sysutils/nautilus-cd-burner/files/patch-cd-drive.c | 136 |
2 files changed, 132 insertions, 10 deletions
diff --git a/sysutils/nautilus-cd-burner/Makefile b/sysutils/nautilus-cd-burner/Makefile index e687ebb8f..50ff7e6f2 100644 --- a/sysutils/nautilus-cd-burner/Makefile +++ b/sysutils/nautilus-cd-burner/Makefile @@ -7,6 +7,7 @@ PORTNAME= nautilus-cd-burner PORTVERSION= 2.8.3 +PORTREVISION= 1 CATEGORIES= sysutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME}/2.8 @@ -32,6 +33,11 @@ GCONF_SCHEMAS= ncb.schemas .include <bsd.port.pre.mk> +.if defined(PACKAGE_BUILDING) || defined(PARALLEL_PACKAGE_BUILD) +.undef WITHOUT_DVD +WITH_DVD= yes +.endif + .if exists(${LOCALBASE}/bin/growisofs) WITH_DVD= yes .endif diff --git a/sysutils/nautilus-cd-burner/files/patch-cd-drive.c b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c index 0ac6cbb26..d2b9765a9 100644 --- a/sysutils/nautilus-cd-burner/files/patch-cd-drive.c +++ b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c @@ -1,6 +1,90 @@ ---- cd-drive.c.orig Sun Aug 1 19:58:03 2004 -+++ cd-drive.c Sun Aug 1 19:59:15 2004 -@@ -484,9 +484,49 @@ +--- cd-drive.c.orig Wed Sep 22 09:20:04 2004 ++++ cd-drive.c Mon Oct 4 02:20:47 2004 +@@ -270,9 +270,21 @@ + { + int fd; + int mmc_profile; ++#ifdef __FreeBSD__ ++ struct cam_device *cam; ++#endif + + g_return_val_if_fail (device != NULL, CD_MEDIA_TYPE_ERROR); + ++#ifdef __FreeBSD__ ++ cam = cam_open_device (device, O_RDWR); ++ if (cam == NULL) { ++ return CD_MEDIA_TYPE_ERROR; ++ } ++ ++ fd = cam->fd; ++#else ++ + fd = open (device, O_RDONLY|O_EXCL|O_NONBLOCK); + if (fd < 0) { + if (errno == EBUSY) { +@@ -280,6 +292,7 @@ + } + return CD_MEDIA_TYPE_ERROR; + } ++#endif + + mmc_profile = get_mmc_profile (fd); + +@@ -307,7 +320,11 @@ + } + } + ++#ifdef __FreeBSD__ ++ cam_close_device (cam); ++#else + close (fd); ++#endif + + switch (mmc_profile) { + case -1: +@@ -442,10 +459,21 @@ + int secs; + int mmc_profile; + gint64 size; ++#ifdef __FreeBSD__ ++ struct cam_device *cam; ++#endif + + g_return_val_if_fail (device != NULL, CD_MEDIA_SIZE_UNKNOWN); + + secs = 0; ++#ifdef __FreeBSD__ ++ cam = cam_open_device (device, O_RDWR); ++ if (cam == NULL) { ++ return CD_MEDIA_SIZE_UNKNOWN; ++ } ++ ++ fd = cam->fd; ++#else + + fd = open (device, O_RDONLY|O_EXCL|O_NONBLOCK); + if (fd < 0) { +@@ -454,6 +482,7 @@ + } + return CD_MEDIA_SIZE_UNKNOWN; + } ++#endif + + mmc_profile = get_mmc_profile (fd); + +@@ -476,7 +505,11 @@ + size = CD_MEDIA_SIZE_NA; + } + ++#ifdef __FreeBSD__ ++ cam_close_device (cam); ++#else + close (fd); ++#endif + + return size; + } +@@ -595,9 +628,81 @@ #endif /* USE_HAL */ #if defined(__linux__) || defined(__FreeBSD__) @@ -10,21 +94,37 @@ + int fd; + int max_speed; + int read_speed, write_speed; - ++#ifdef __FreeBSD__ ++ struct cam_device *cam; ++#endif ++ + max_speed = -1; - ++#ifdef __FreeBSD__ ++ cam = cam_open_device (device, O_RDWR); ++ if (cam == NULL) { ++ return -1; ++ } ++ ++ fd = cam->fd; ++#else ++ + fd = open (device, O_RDONLY|O_EXCL|O_NONBLOCK); + if (fd < 0) { + return -1; + } ++#endif + get_read_write_speed (fd, &read_speed, &write_speed); ++#ifdef __FreeBSD__ ++ cam_close_device (cam); ++#else + close (fd); ++#endif + max_speed = (int)floor (write_speed) / CD_ROM_SPEED; -+ + + return max_speed; +} -+ + +#if !defined(__linux) +static int +get_device_max_read_speed (char *device) @@ -32,16 +132,32 @@ + int fd; + int max_speed; + int read_speed, write_speed; ++#ifdef __FreeBSD__ ++ struct cam_device *cam; ++#endif + + max_speed = -1; ++#ifdef __FreeBSD__ ++ cam = cam_open_device (device, O_RDWR); ++ if (cam == NULL) { ++ return -1; ++ } ++ ++ fd = cam->fd; ++#else + + fd = open (device, O_RDONLY|O_EXCL|O_NONBLOCK); + if (fd < 0) { + return -1; + } ++#endif + + get_read_write_speed (fd, &read_speed, &write_speed); ++#ifdef __FreeBSD__ ++ cam_close_device (cam); ++#else + close (fd); ++#endif + max_speed = (int)floor (read_speed) / CD_ROM_SPEED; + + return max_speed; @@ -50,7 +166,7 @@ #endif /* __linux__ || __FreeBSD__ */ #if defined (__linux__) -@@ -689,49 +729,7 @@ +@@ -800,49 +905,7 @@ return NULL; } @@ -61,7 +177,7 @@ - int fd; - int max_speed; - int read_speed, write_speed; -- + - max_speed = -1; - - fd = open (device, O_RDONLY|O_EXCL|O_NONBLOCK); @@ -94,7 +210,7 @@ - get_read_write_speed (fd, &read_speed, &write_speed); - close (fd); - max_speed = (int)floor (write_speed) / CD_ROM_SPEED; - +- - return max_speed; -} |