Ticket #48005: cd-discid.diff

File cd-discid.diff, 8.4 KB (added by florian@…, 9 years ago)

Patch against dports/audio/cd-discid

  • audio/cd-discid/Portfile

     
    33PortSystem              1.0
    44
    55name                    cd-discid
    6 version                 1.1
     6version                 1.4
    77categories              audio
    88license                 {GPL-2+ Artistic-1}
    99platforms               darwin
     
    2424homepage                http://linukz.org/cd-discid.shtml
    2525master_sites            http://linukz.org/download/
    2626
    27 checksums               md5     04cb368e3f1ce17e656ac6691ca0b687 \
    28                         sha1    74cedeb2c5bf4f3248af249c0ff344ea9d713d1a \
    29                         rmd160  4fe4e53103565a01d1dc2dffcc9d43b4b1ea6565
     27checksums               rmd160  a63dabd35ca0b1f8114eeca78f79ea2f6b52cd6e \
     28                        sha256  ffd68cd406309e764be6af4d5cbcc309e132c13f3597c6a4570a1f218edd2c63
    3029
    31 patchfiles              patch-Makefile
    32 post-patch {
    33     reinplace "s/@VERSION@/${version}/g" ${worksrcpath}/Makefile
    34 }
     30patchfiles              patch-Makefile.diff \
     31                        patch-cd-discid.c.diff \
     32                        patch-cd-discid.1.diff
    3533
    3634use_configure           no
    3735
    3836build.env               CC=${configure.cc}
    3937
    40 destroot.destdir        prefix=${destroot}${prefix}
     38destroot.destdir        PREFIX=${destroot}${prefix}
    4139
    4240universal_variant       no
    4341
    44 platform macosx {
    45     patchfiles-append   patch-cd-discid.c.diff
    46 }
    47 
    4842livecheck.type          regex
    4943livecheck.regex         ${name}-(\[0-9.\]+)\\.tar
  • audio/cd-discid/files/patch-Makefile

     
    1 --- Makefile.orig       2009-09-02 03:03:08.000000000 -0500
    2 +++ Makefile    2010-03-20 07:48:10.000000000 -0500
    3 @@ -1,17 +1,11 @@
    4 -VERSION = 0.8
    5 -CC = gcc
    6 -CFLAGS = -g -O2
    7 -LDFLAGS =
    8 -LIBS =
    9 -DEFS = 
    10 +VERSION = @VERSION@
    11  INSTALL = /usr/bin/install -c
    12  
    13  # Installation directories
    14 -prefix = ${DESTDIR}/usr
    15  exec_prefix = ${prefix}
    16  mandir = ${prefix}/share/man/man1
    17  bindir = ${exec_prefix}/bin
    18 -etcdir = ${DESTDIR}/etc
    19 +etcdir = ${prefix}/etc
    20  
    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.
    610 
    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 
    1436 #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 @@
    1856         * TocEntry[last-1].lastRecordedAddress + 1, so we compute the start
    1957         * of leadout from the start+length of the last track instead
    2058         */
    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++) {
    2564                /* tracks start with 1, but I must start with 0 on OpenBSD */
    26 @@ -214,12 +221,12 @@
    27         }
    28  #endif
     65@@ -260,12 +260,12 @@
     66        /* release file handle */
     67        close(drive);
    2968 
    3069-#if defined(__FreeBSD__)
    31 +#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
     70+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
    3271        TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
    33  #endif       
     72 #endif
    3473 
    35         for (i=0; i < last; i++) {
     74        for (i = 0; i < last; i++) {
    3675-#if defined(__FreeBSD__)
    37 +#if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
     76+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
    3877                TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
    3978 #endif
    4079                cksum += cddb_sum((TocEntry[i].cdte_track_address + CD_MSF_OFFSET) / CD_FRAMES);