--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="Library for decoding ARIB STD-B24 subtitles"
+HOMEPAGE="https://github.com/nkoriyama/aribb24"
+SRC_URI="https://github.com/nkoriyama/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+
+RDEPEND="media-libs/libpng:0=[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-reset-control_time.patch
+ "${FILESDIR}"/${P}-fix-default-macros.patch
+ "${FILESDIR}"/${P}-add-missing-curly-braces.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf --disable-static
+}
+
+multilib_src_install_all() {
+ find "${D}" -name '*.la' -delete || die
+}
--- /dev/null
+From a5bcc6d17c20e18bdeec295089cc0cdfac9d35c8 Mon Sep 17 00:00:00 2001
+From: xtne6f <xt4ubq@gmail.com>
+Date: Thu, 7 Feb 2019 20:11:13 +0900
+Subject: [PATCH] Fix default macros
+
+---
+ src/decoder_macro.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/decoder_macro.h b/src/decoder_macro.h
+index 86edee4..513b81e 100644
+--- a/src/decoder_macro.h
++++ b/src/decoder_macro.h
+@@ -30,7 +30,7 @@ static const unsigned char decoder_default_macro_1[] = {
+ 0x1B,0x24,0x39,0x1B,0x29,0x31,0x1B,0x2A,0x30,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
+ };
+ static const unsigned char decoder_default_macro_2[] = {
+- 0x1B,0x24,0x39,0x1B,0x29,0x20,0x40,0x1B,0x2A,0x30,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
++ 0x1B,0x24,0x39,0x1B,0x29,0x20,0x41,0x1B,0x2A,0x30,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
+ };
+ static const unsigned char decoder_default_macro_3[] = {
+ 0x1B,0x28,0x32,0x1B,0x29,0x34,0x1B,0x2A,0x35,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
+@@ -39,7 +39,7 @@ static const unsigned char decoder_default_macro_4[] = {
+ 0x1B,0x28,0x32,0x1B,0x29,0x33,0x1B,0x2A,0x35,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
+ };
+ static const unsigned char decoder_default_macro_5[] = {
+- 0x1B,0x28,0x32,0x1B,0x29,0x20,0x40,0x1B,0x2A,0x35,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
++ 0x1B,0x28,0x32,0x1B,0x29,0x20,0x41,0x1B,0x2A,0x35,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D
+ };
+ static const unsigned char decoder_default_macro_6[] = {
+ 0x1B,0x28,0x20,0x41,0x1B,0x29,0x20,0x42,0x1B,0x2A,0x20,0x43,0x1B,0x2B,0x20,0x70,0x0F,0x1B,0x7D