Ticket #48005: cd-discid.diff
File cd-discid.diff, 8.4 KB (added by florian@…, 9 years ago) |
---|
-
audio/cd-discid/Portfile
3 3 PortSystem 1.0 4 4 5 5 name cd-discid 6 version 1. 16 version 1.4 7 7 categories audio 8 8 license {GPL-2+ Artistic-1} 9 9 platforms darwin … … 24 24 homepage http://linukz.org/cd-discid.shtml 25 25 master_sites http://linukz.org/download/ 26 26 27 checksums md5 04cb368e3f1ce17e656ac6691ca0b687 \ 28 sha1 74cedeb2c5bf4f3248af249c0ff344ea9d713d1a \ 29 rmd160 4fe4e53103565a01d1dc2dffcc9d43b4b1ea6565 27 checksums rmd160 a63dabd35ca0b1f8114eeca78f79ea2f6b52cd6e \ 28 sha256 ffd68cd406309e764be6af4d5cbcc309e132c13f3597c6a4570a1f218edd2c63 30 29 31 patchfiles patch-Makefile 32 post-patch { 33 reinplace "s/@VERSION@/${version}/g" ${worksrcpath}/Makefile 34 } 30 patchfiles patch-Makefile.diff \ 31 patch-cd-discid.c.diff \ 32 patch-cd-discid.1.diff 35 33 36 34 use_configure no 37 35 38 36 build.env CC=${configure.cc} 39 37 40 destroot.destdir prefix=${destroot}${prefix}38 destroot.destdir PREFIX=${destroot}${prefix} 41 39 42 40 universal_variant no 43 41 44 platform macosx {45 patchfiles-append patch-cd-discid.c.diff46 }47 48 42 livecheck.type regex 49 43 livecheck.regex ${name}-(\[0-9.\]+)\\.tar -
audio/cd-discid/files/patch-Makefile
1 --- Makefile.orig 2009-09-02 03:03:08.000000000 -05002 +++ Makefile 2010-03-20 07:48:10.000000000 -05003 @@ -1,17 +1,11 @@4 -VERSION = 0.85 -CC = gcc6 -CFLAGS = -g -O27 -LDFLAGS =8 -LIBS =9 -DEFS =10 +VERSION = @VERSION@11 INSTALL = /usr/bin/install -c12 13 # Installation directories14 -prefix = ${DESTDIR}/usr15 exec_prefix = ${prefix}16 mandir = ${prefix}/share/man/man117 bindir = ${exec_prefix}/bin18 -etcdir = ${DESTDIR}/etc19 +etcdir = ${prefix}/etc20 21 INCL =22 SRCS = cd-discid.c -
audio/cd-discid/files/patch-Makefile.diff
1 --- Makefile.orig 2015-06-09 23:14:28.000000000 +0200 2 +++ Makefile 2015-06-09 23:15:13.000000000 +0200 3 @@ -28,9 +28,8 @@ 4 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(OBJS) 5 6 install: cd-discid 7 - $(INSTALL) -D cd-discid $(DESTDIR)$(BINDIR)/cd-discid 8 - $(STRIP) $(DESTDIR)$(BINDIR)/cd-discid 9 - $(INSTALL) -D -m 644 cd-discid.1 $(DESTDIR)$(MANDIR)/cd-discid.1 10 + $(INSTALL) cd-discid $(DESTDIR)$(BINDIR)/cd-discid 11 + $(INSTALL) -m 644 cd-discid.1 $(DESTDIR)$(MANDIR)/cd-discid.1 12 13 clean: 14 $(RM) $(OBJS) cd-discid -
audio/cd-discid/files/patch-cd-discid.1.diff
1 --- cd-discid.1.orig 2013-05-14 11:02:00.000000000 +0200 2 +++ cd-discid.1 2015-06-10 09:33:52.000000000 +0200 3 @@ -33,14 +33,20 @@ 4 is omitted, the following device name is assumed: 5 .RS 6 .IP \fI/dev/cdrom\fP 7 -Linux and FreeBSD 8 +Linux, FreeBSD and DragonFly 9 .IP \fI/dev/cd0a\fP 10 OpenBSD and NetBSD 11 .IP \fI/dev/vol/aliases/cdrom0\fP 12 Solaris 13 -.IP \fI/dev/disk1\fP 14 +.IP \fI/dev/rdisk1\fP 15 MacOS X 16 .IP \fI/dev/cd0\fP 17 Hurd 18 .SH AUTHOR 19 -Robert Woodcock <rcw@debian.org>. Updates by Timur Bish <taem@linukz.org>. 20 +Robert Woodcock <rcw@debian.org> 21 +.SH "REPORTING BUGS" 22 +Timur Birsh <taem@linukz.org> 23 +.SH "SEE ALSO" 24 +http://linukz.org/cd-discid.shtml 25 +.br 26 +https://github.com/taem/cd-discid -
audio/cd-discid/files/patch-cd-discid.c.diff
1 --- cd-discid.c.orig 2003-12-15 16:55:00.000000000 -0700 2 +++ cd-discid.c 2008-10-23 14:46:35.000000000 -0600 3 @@ -86,6 +86,13 @@ 4 #define cdrom_tocentry CDTrackInfo 5 #define cdte_track_address trackStartAddress 1 --- cd-discid.c.orig 2013-05-14 11:02:00.000000000 +0200 2 +++ cd-discid.c 2015-06-10 09:18:49.000000000 +0200 3 @@ -1,6 +1,6 @@ 4 /* 5 * Copyright (c) 1999-2003 Robert Woodcock <rcw@debian.org> 6 - * Copyright (c) 2009-2012 Timur Birsh <taem@linukz.org> 7 + * Copyright (c) 2009-2013 Timur Birsh <taem@linukz.org> 8 * This code is hereby licensed for public consumption under either the 9 * GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. 6 10 7 +#if defined (__i386__) || defined(__x86_64__) 8 +#define SWAP ntohl 9 +#define RESWAP htonl 10 +#else 11 +#define SWAP 12 +#define RESWAP 13 +#endif 11 @@ -14,6 +14,8 @@ 12 * OpenBSD: Marcus Daniel <danielm@uni-muenster.de> 13 * NetBSD: Chris Gilbert <chris@NetBSD.org> 14 * MacOSX: Evan Jones <ejones@uwaterloo.ca> http://www.eng.uwaterloo.ca/~ejones/ 15 + * Thomas Klausner <tk@giga.or.at> 16 + * DragonFly: Thomas Klausner <tk@giga.or.at>, http://pkgsrc.se/audio/cd-discid 17 */ 18 19 #include <stdio.h> 20 @@ -46,7 +48,7 @@ 21 22 /* __FreeBSD_kernel__ is needed for properly compiling on Debian GNU/kFreeBSD 23 Look at http://glibc-bsd.alioth.debian.org/porting/PORTING for more info */ 24 -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 25 +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) 26 #include <sys/cdio.h> 27 #define CDROM_LBA CD_LBA_FORMAT /* first frame is 0 */ 28 #define CD_MSF_OFFSET 150 /* MSF offset of first frame */ 29 @@ -93,7 +95,7 @@ 30 #define cdth_trk1 lastTrackNumberInLastSessionLSB 31 #define cdrom_tocentry CDTrackInfo 32 #define cdte_track_address trackStartAddress 33 -#define DEVICE_NAME "/dev/disk1" 34 +#define DEVICE_NAME "/dev/rdisk1" 35 14 36 #else 15 # error "Your OS isn't supported yet." 16 #endif /* os selection */ 17 @@ -194,7 +201,7 @@ 37 #error "Your OS isn't supported yet." 38 @@ -130,7 +132,7 @@ 39 int drive, i, totaltime; 40 long int cksum = 0; 41 int musicbrainz = 0; 42 - unsigned char first = 1, last = 1; 43 + unsigned char last = 1; 44 char *devicename = DEVICE_NAME; 45 struct cdrom_tochdr hdr; 46 struct cdrom_tocentry *TocEntry; 47 @@ -187,7 +189,6 @@ 48 } 49 #endif 50 51 - first = hdr.cdth_trk0; 52 last = hdr.cdth_trk1; 53 54 len = (last + 1) * sizeof(struct cdrom_tocentry); 55 @@ -236,8 +237,7 @@ 18 56 * TocEntry[last-1].lastRecordedAddress + 1, so we compute the start 19 57 * of leadout from the start+length of the last track instead 20 58 */ 21 - TocEntry[last].cdte_track_address = TocEntry[last-1].trackSize + TocEntry[last-1].trackStartAddress; 22 + TocEntry[last].cdte_track_address = RESWAP(SWAP(TocEntry[last-1].trackSize) + SWAP(TocEntry[last-1].trackStartAddress)); 23 #else /* FreeBSD, Linux, Solaris */ 24 for (i=0; i < last; i++) { 59 - TocEntry[last].cdte_track_address = TocEntry[last - 1].trackSize + 60 - TocEntry[last - 1].trackStartAddress; 61 + TocEntry[last].cdte_track_address = htonl(ntohl(TocEntry[last-1].trackSize) + ntohl(TocEntry[last-1].trackStartAddress)); 62 #else /* FreeBSD, Linux, Solaris */ 63 for (i = 0; i < last; i++) { 25 64 /* tracks start with 1, but I must start with 0 on OpenBSD */ 26 @@ -2 14,12 +221,12 @@27 }28 #endif65 @@ -260,12 +260,12 @@ 66 /* release file handle */ 67 close(drive); 29 68 30 69 -#if defined(__FreeBSD__) 31 +#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))70 +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__) 32 71 TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address); 33 #endif 72 #endif 34 73 35 for (i =0; i < last; i++) {74 for (i = 0; i < last; i++) { 36 75 -#if defined(__FreeBSD__) 37 +#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))76 +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__) 38 77 TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address); 39 78 #endif 40 79 cksum += cddb_sum((TocEntry[i].cdte_track_address + CD_MSF_OFFSET) / CD_FRAMES);