You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
cd-discid: Update to version 1.4. (https://trac.macports.org/ticket/48005)
git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@137367 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
PortSystem 1.0
|
||||
|
||||
name cd-discid
|
||||
version 1.1
|
||||
version 1.4
|
||||
categories audio
|
||||
license {GPL-2+ Artistic-1}
|
||||
platforms darwin
|
||||
@@ -24,26 +24,20 @@ long_description In order to do CDDB queries over the Internet, you \
|
||||
homepage http://linukz.org/cd-discid.shtml
|
||||
master_sites http://linukz.org/download/
|
||||
|
||||
checksums md5 04cb368e3f1ce17e656ac6691ca0b687 \
|
||||
sha1 74cedeb2c5bf4f3248af249c0ff344ea9d713d1a \
|
||||
rmd160 4fe4e53103565a01d1dc2dffcc9d43b4b1ea6565
|
||||
checksums rmd160 a63dabd35ca0b1f8114eeca78f79ea2f6b52cd6e \
|
||||
sha256 ffd68cd406309e764be6af4d5cbcc309e132c13f3597c6a4570a1f218edd2c63
|
||||
|
||||
patchfiles patch-Makefile
|
||||
post-patch {
|
||||
reinplace "s/@VERSION@/${version}/g" ${worksrcpath}/Makefile
|
||||
}
|
||||
patchfiles patch-Makefile.diff \
|
||||
patch-cd-discid.c.diff \
|
||||
patch-cd-discid.1.diff
|
||||
|
||||
use_configure no
|
||||
|
||||
build.env CC=${configure.cc}
|
||||
|
||||
destroot.destdir prefix=${destroot}${prefix}
|
||||
destroot.destdir PREFIX=${destroot}${prefix}
|
||||
|
||||
universal_variant no
|
||||
|
||||
platform macosx {
|
||||
patchfiles-append patch-cd-discid.c.diff
|
||||
}
|
||||
|
||||
livecheck.type regex
|
||||
livecheck.regex ${name}-(\[0-9.\]+)\\.tar
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--- Makefile.orig 2009-09-02 03:03:08.000000000 -0500
|
||||
+++ Makefile 2010-03-20 07:48:10.000000000 -0500
|
||||
@@ -1,17 +1,11 @@
|
||||
-VERSION = 0.8
|
||||
-CC = gcc
|
||||
-CFLAGS = -g -O2
|
||||
-LDFLAGS =
|
||||
-LIBS =
|
||||
-DEFS =
|
||||
+VERSION = @VERSION@
|
||||
INSTALL = /usr/bin/install -c
|
||||
|
||||
# Installation directories
|
||||
-prefix = ${DESTDIR}/usr
|
||||
exec_prefix = ${prefix}
|
||||
mandir = ${prefix}/share/man/man1
|
||||
bindir = ${exec_prefix}/bin
|
||||
-etcdir = ${DESTDIR}/etc
|
||||
+etcdir = ${prefix}/etc
|
||||
|
||||
INCL =
|
||||
SRCS = cd-discid.c
|
||||
@@ -0,0 +1,14 @@
|
||||
--- Makefile.orig 2015-06-09 23:14:28.000000000 +0200
|
||||
+++ Makefile 2015-06-09 23:15:13.000000000 +0200
|
||||
@@ -28,9 +28,8 @@
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(OBJS)
|
||||
|
||||
install: cd-discid
|
||||
- $(INSTALL) -D cd-discid $(DESTDIR)$(BINDIR)/cd-discid
|
||||
- $(STRIP) $(DESTDIR)$(BINDIR)/cd-discid
|
||||
- $(INSTALL) -D -m 644 cd-discid.1 $(DESTDIR)$(MANDIR)/cd-discid.1
|
||||
+ $(INSTALL) cd-discid $(DESTDIR)$(BINDIR)/cd-discid
|
||||
+ $(INSTALL) -m 644 cd-discid.1 $(DESTDIR)$(MANDIR)/cd-discid.1
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) cd-discid
|
||||
@@ -0,0 +1,26 @@
|
||||
--- cd-discid.1.orig 2013-05-14 11:02:00.000000000 +0200
|
||||
+++ cd-discid.1 2015-06-10 09:33:52.000000000 +0200
|
||||
@@ -33,14 +33,20 @@
|
||||
is omitted, the following device name is assumed:
|
||||
.RS
|
||||
.IP \fI/dev/cdrom\fP
|
||||
-Linux and FreeBSD
|
||||
+Linux, FreeBSD and DragonFly
|
||||
.IP \fI/dev/cd0a\fP
|
||||
OpenBSD and NetBSD
|
||||
.IP \fI/dev/vol/aliases/cdrom0\fP
|
||||
Solaris
|
||||
-.IP \fI/dev/disk1\fP
|
||||
+.IP \fI/dev/rdisk1\fP
|
||||
MacOS X
|
||||
.IP \fI/dev/cd0\fP
|
||||
Hurd
|
||||
.SH AUTHOR
|
||||
-Robert Woodcock <rcw@debian.org>. Updates by Timur Bish <taem@linukz.org>.
|
||||
+Robert Woodcock <rcw@debian.org>
|
||||
+.SH "REPORTING BUGS"
|
||||
+Timur Birsh <taem@linukz.org>
|
||||
+.SH "SEE ALSO"
|
||||
+http://linukz.org/cd-discid.shtml
|
||||
+.br
|
||||
+https://github.com/taem/cd-discid
|
||||
@@ -1,40 +1,79 @@
|
||||
--- cd-discid.c.orig 2003-12-15 16:55:00.000000000 -0700
|
||||
+++ cd-discid.c 2008-10-23 14:46:35.000000000 -0600
|
||||
@@ -86,6 +86,13 @@
|
||||
#define cdrom_tocentry CDTrackInfo
|
||||
#define cdte_track_address trackStartAddress
|
||||
--- cd-discid.c.orig 2013-05-14 11:02:00.000000000 +0200
|
||||
+++ cd-discid.c 2015-06-10 09:18:49.000000000 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2003 Robert Woodcock <rcw@debian.org>
|
||||
- * Copyright (c) 2009-2012 Timur Birsh <taem@linukz.org>
|
||||
+ * Copyright (c) 2009-2013 Timur Birsh <taem@linukz.org>
|
||||
* This code is hereby licensed for public consumption under either the
|
||||
* GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice.
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* OpenBSD: Marcus Daniel <danielm@uni-muenster.de>
|
||||
* NetBSD: Chris Gilbert <chris@NetBSD.org>
|
||||
* MacOSX: Evan Jones <ejones@uwaterloo.ca> http://www.eng.uwaterloo.ca/~ejones/
|
||||
+ * Thomas Klausner <tk@giga.or.at>
|
||||
+ * DragonFly: Thomas Klausner <tk@giga.or.at>, http://pkgsrc.se/audio/cd-discid
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -46,7 +48,7 @@
|
||||
|
||||
/* __FreeBSD_kernel__ is needed for properly compiling on Debian GNU/kFreeBSD
|
||||
Look at http://glibc-bsd.alioth.debian.org/porting/PORTING for more info */
|
||||
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
#include <sys/cdio.h>
|
||||
#define CDROM_LBA CD_LBA_FORMAT /* first frame is 0 */
|
||||
#define CD_MSF_OFFSET 150 /* MSF offset of first frame */
|
||||
@@ -93,7 +95,7 @@
|
||||
#define cdth_trk1 lastTrackNumberInLastSessionLSB
|
||||
#define cdrom_tocentry CDTrackInfo
|
||||
#define cdte_track_address trackStartAddress
|
||||
-#define DEVICE_NAME "/dev/disk1"
|
||||
+#define DEVICE_NAME "/dev/rdisk1"
|
||||
|
||||
+#if defined (__i386__) || defined(__x86_64__)
|
||||
+#define SWAP ntohl
|
||||
+#define RESWAP htonl
|
||||
+#else
|
||||
+#define SWAP
|
||||
+#define RESWAP
|
||||
+#endif
|
||||
#else
|
||||
# error "Your OS isn't supported yet."
|
||||
#endif /* os selection */
|
||||
@@ -194,7 +201,7 @@
|
||||
* TocEntry[last-1].lastRecordedAddress + 1, so we compute the start
|
||||
* of leadout from the start+length of the last track instead
|
||||
*/
|
||||
- TocEntry[last].cdte_track_address = TocEntry[last-1].trackSize + TocEntry[last-1].trackStartAddress;
|
||||
+ TocEntry[last].cdte_track_address = RESWAP(SWAP(TocEntry[last-1].trackSize) + SWAP(TocEntry[last-1].trackStartAddress));
|
||||
#else /* FreeBSD, Linux, Solaris */
|
||||
for (i=0; i < last; i++) {
|
||||
/* tracks start with 1, but I must start with 0 on OpenBSD */
|
||||
@@ -214,12 +221,12 @@
|
||||
#error "Your OS isn't supported yet."
|
||||
@@ -130,7 +132,7 @@
|
||||
int drive, i, totaltime;
|
||||
long int cksum = 0;
|
||||
int musicbrainz = 0;
|
||||
- unsigned char first = 1, last = 1;
|
||||
+ unsigned char last = 1;
|
||||
char *devicename = DEVICE_NAME;
|
||||
struct cdrom_tochdr hdr;
|
||||
struct cdrom_tocentry *TocEntry;
|
||||
@@ -187,7 +189,6 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(__FreeBSD__)
|
||||
+#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
|
||||
TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
|
||||
#endif
|
||||
- first = hdr.cdth_trk0;
|
||||
last = hdr.cdth_trk1;
|
||||
|
||||
len = (last + 1) * sizeof(struct cdrom_tocentry);
|
||||
@@ -236,8 +237,7 @@
|
||||
* TocEntry[last-1].lastRecordedAddress + 1, so we compute the start
|
||||
* of leadout from the start+length of the last track instead
|
||||
*/
|
||||
- TocEntry[last].cdte_track_address = TocEntry[last - 1].trackSize +
|
||||
- TocEntry[last - 1].trackStartAddress;
|
||||
+ TocEntry[last].cdte_track_address = htonl(ntohl(TocEntry[last-1].trackSize) + ntohl(TocEntry[last-1].trackStartAddress));
|
||||
#else /* FreeBSD, Linux, Solaris */
|
||||
for (i = 0; i < last; i++) {
|
||||
/* tracks start with 1, but I must start with 0 on OpenBSD */
|
||||
@@ -260,12 +260,12 @@
|
||||
/* release file handle */
|
||||
close(drive);
|
||||
|
||||
for (i=0; i < last; i++) {
|
||||
-#if defined(__FreeBSD__)
|
||||
+#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
|
||||
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
||||
TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < last; i++) {
|
||||
-#if defined(__FreeBSD__)
|
||||
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
||||
TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
|
||||
#endif
|
||||
cksum += cddb_sum((TocEntry[i].cdte_track_address + CD_MSF_OFFSET) / CD_FRAMES);
|
||||
|
||||
Reference in New Issue
Block a user