# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-inherit eutils toolchain-funcs
+EAPI=6
+
+inherit toolchain-funcs
DESCRIPTION="converts RAW format (.bin/.cue) files to ISO/WAV format"
HOMEPAGE="http://users.andara.com/~doiron/bin2iso/"
KEYWORDS="alpha amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE=""
-DEPEND=""
-
S=${WORKDIR}/${PN}
-src_unpack() {
- unpack ${A}
- cd "${S}"
- edos2unix *.c
- epatch "${FILESDIR}"/${P}-sanity-checks.patch
-}
+PATCHES=( "${FILESDIR}"/${P}-sanity-checks.patch )
src_compile() {
- $(tc-getCC) bin2iso19b_linux.c -o ${PN} ${CFLAGS} ${LDFLAGS} || die "compile failed"
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} bin2iso19b_linux.c -o ${PN} || die "compile failed"
}
src_install() {
- dobin ${PN} || die "dobin failed"
+ dobin ${PN}
dodoc readme.txt
}
http://bugs.gentoo.org/show_bug.cgi?id=90540
---- bin2iso19b_linux.c
-+++ bin2iso19b_linux.c
+--- a/bin2iso19b_linux.c
++++ b/bin2iso19b_linux.c
@@ -237,6 +237,10 @@
- // Get the 'mode'
- if (strncmp(&Line[2], "TRACK ", 6)==0)
- {
-+ if (Line[8] < '0' || Line[8] > '9' || Line[9] < '0' || Line[9] > '9') {
-+ printf("Error: Track # is not a 2 digit number\n");
-+ exit(1);
-+ }
- strncpy(track->num, &Line[8], 2); track->num[2] = '\0';
-
- track->mode = UNKNOWN;
+ // Get the 'mode'\r
+ if (strncmp(&Line[2], "TRACK ", 6)==0) \r
+ {\r
++ if (Line[8] < '0' || Line[8] > '9' || Line[9] < '0' || Line[9] > '9') {\r
++ printf("Error: Track # is not a 2 digit number\n");\r
++ exit(1);\r
++ }\r
+ strncpy(track->num, &Line[8], 2); track->num[2] = '\0';\r
+ \r
+ track->mode = UNKNOWN;\r
@@ -246,7 +250,11 @@
- if(strncmp(&Line[11], "MODE2/2352", 10)==0) track->mode = MODE2_2352;
- if(strncmp(&Line[11], "MODE2/2336", 10)==0) track->mode = MODE2_2336;
- }
-- else return(1);
-+ else
-+ {
-+ printf("Error: 2nd line does not begin with ' TRACK '\n");
-+ exit(1);
-+ }
-
- // Set the name
- strcpy(track->name, sBinFilename);
+ if(strncmp(&Line[11], "MODE2/2352", 10)==0) track->mode = MODE2_2352;\r
+ if(strncmp(&Line[11], "MODE2/2336", 10)==0) track->mode = MODE2_2336;\r
+ }\r
+- else return(1);\r
++ else\r
++ {\r
++ printf("Error: 2nd line does not begin with ' TRACK '\n");\r
++ exit(1);\r
++ }\r
+ \r
+ // Set the name\r
+ strcpy(track->name, sBinFilename);\r