--- /dev/null
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="A set of tools for DVD+RW/-RW drives"
+HOMEPAGE="http://fy.chalmers.se/~appro/linux/DVD+RW/"
+SRC_URI="http://fy.chalmers.se/~appro/linux/DVD+RW/tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="virtual/cdrtools"
+DEPEND="${RDEPEND}
+ sys-devel/m4"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0-sysmacros.patch
+ "${FILESDIR}"/${PN}-7.0-wctomb-r1.patch
+ "${FILESDIR}"/${PN}-7.0-glibc2.6.90.patch
+ "${FILESDIR}"/${PN}-7.0-dvddl-r1.patch
+ "${FILESDIR}"/${PN}-7.0-wexit.patch
+)
+
+src_prepare() {
+ # Linux compiler flags only include -O2 and are incremental.
+ sed -i '/FLAGS/s:-O2::' Makefile.m4 || die "failed to sed out FLAGS"
+ default
+}
+
+src_compile() {
+ emake SHELL="${EPREFIX}"/bin/bash CC="$(tc-getCC)" CXX="$(tc-getCXX)"
+}
+
+src_install() {
+ emake SHELL="${EPREFIX}"/bin/bash prefix="${ED}/usr" install
+ dodoc index.html
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ elog 'If you receive an error, "unable to anonymously mmap...'
+ elog 'Resource temporarily unavailable" when running growisofs,'
+ elog 'then you may need to run "ulimit -l unlimited".'
+ fi
+}
--- /dev/null
+--- a/growisofs_mmc.cpp 2006-04-27 20:45:00.788446635 +0200
++++ b/growisofs_mmc.cpp 2006-04-27 20:46:01.666824300 +0200
+@@ -1412,9 +1412,7 @@
+ blocks += 15, blocks &= ~15;
+
+ if (blocks <= split)
+- fprintf (stderr,":-( more than 50%% of space will be *wasted*!\n"
+- " use single layer media for this recording\n"),
+- exit (FATAL_START(EMEDIUMTYPE));
++ fprintf (stderr,":-? more than 50%% of space will be *wasted*!\n");
+
+ blocks /= 16;
+ blocks += 1;
--- /dev/null
+--- a/transport.hxx 2008-03-25 21:24:47.000000000 -0400
++++ b/transport.hxx 2008-03-25 21:25:36.000000000 -0400
+@@ -116,7 +116,7 @@
+ extern "C" char *plusminus_locale()
+ { static class __plusminus {
+ private:
+- char str[4];
++ char str[MB_LEN_MAX];
+ public:
+ __plusminus() { setlocale(LC_CTYPE,ENV_LOCALE);
+ int l = wctomb(str,(wchar_t)(unsigned char)'±');