Gentoo Archives: gentoo-commits

From: Nick Sarnie <sarnex@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/aegisub/files/3.2.2_p20160518/, media-video/aegisub/
Date: Sat, 05 Mar 2022 14:32:13
Message-Id: 1646490687.f943cce85e79f7cf011979d40a17444aa68e0450.sarnex@gentoo
1 commit: f943cce85e79f7cf011979d40a17444aa68e0450
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 5 14:31:27 2022 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 5 14:31:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f943cce8
7
8 media-video/aegisub: Fix build
9
10 Closes: https://bugs.gentoo.org/834086
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>
13
14 .../aegisub/aegisub-3.2.2_p20160518-r103.ebuild | 159 +++++++++++++++++++++
15 ...sub-3.2.2_p20160518-luaL_Reg-not-luaL_reg.patch | 35 +++++
16 2 files changed, 194 insertions(+)
17
18 diff --git a/media-video/aegisub/aegisub-3.2.2_p20160518-r103.ebuild b/media-video/aegisub/aegisub-3.2.2_p20160518-r103.ebuild
19 new file mode 100644
20 index 000000000000..0ac1ff04d08e
21 --- /dev/null
22 +++ b/media-video/aegisub/aegisub-3.2.2_p20160518-r103.ebuild
23 @@ -0,0 +1,159 @@
24 +# Copyright 1999-2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +LUA_COMPAT=( luajit )
30 +LUA_REQ_USE="lua52compat"
31 +
32 +WX_GTK_VER=3.0
33 +PLOCALES="ar bg ca cs da de el es eu fa fi fr_FR gl hu id it ja ko nl pl pt_BR pt_PT ru sr_RS sr_RS@latin uk_UA vi zh_CN zh_TW"
34 +COMMIT_ID="b118fe7e7a5c37540e2f0aa75af105e272bad234"
35 +
36 +inherit autotools flag-o-matic lua-single plocale wxwidgets xdg-utils vcs-snapshot
37 +
38 +DESCRIPTION="Advanced subtitle editor"
39 +HOMEPAGE="http://www.aegisub.org/ https://github.com/Aegisub/Aegisub"
40 +SRC_URI="https://github.com/Aegisub/Aegisub/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
41 +
42 +LICENSE="BSD MIT"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~x86"
45 +IUSE="+alsa debug +fftw openal oss portaudio pulseaudio spell test +uchardet"
46 +RESTRICT="!test? ( test )"
47 +
48 +# aegisub bundles luabins (https://github.com/agladysh/luabins).
49 +# Unfortunately, luabins upstream is practically dead since 2010.
50 +# Thus unbundling luabins isn't worth the effort.
51 +RDEPEND="${LUA_DEPS}
52 + x11-libs/wxGTK:${WX_GTK_VER}[X,opengl,debug?]
53 + dev-libs/boost:=[icu,nls,threads(+)]
54 + dev-libs/icu:=
55 + media-libs/ffmpegsource:=
56 + media-libs/fontconfig
57 + media-libs/freetype
58 + media-libs/libass:=[fontconfig]
59 + sys-libs/zlib
60 + virtual/libiconv
61 + virtual/opengl
62 + alsa? ( media-libs/alsa-lib )
63 + fftw? ( >=sci-libs/fftw-3.3:= )
64 + openal? ( media-libs/openal )
65 + portaudio? ( =media-libs/portaudio-19* )
66 + pulseaudio? ( media-sound/pulseaudio )
67 + spell? ( app-text/hunspell:= )
68 + uchardet? ( app-i18n/uchardet )
69 +"
70 +DEPEND="${RDEPEND}"
71 +# luarocks is only used as a command-line tool so there is no need to enforce
72 +# LUA_SINGLE_USEDEP on it. On the other hand, this means we must use version
73 +# bounds in order to make sure we use a version migrated to Lua eclasses.
74 +BDEPEND="dev-util/intltool
75 + sys-devel/gettext
76 + virtual/pkgconfig
77 + test? (
78 + ${RDEPEND}
79 + >=dev-cpp/gtest-1.8.1
80 + >=dev-lua/luarocks-3.4.0-r100
81 + $(lua_gen_cond_dep '
82 + dev-lua/busted[${LUA_USEDEP}]
83 + ')
84 + )
85 +"
86 +
87 +REQUIRED_USE="${LUA_REQUIRED_USE}
88 + || ( alsa openal oss portaudio pulseaudio )"
89 +
90 +PATCHES=(
91 + "${FILESDIR}/${PV}/${P}-fix-system-luajit-build.patch"
92 + "${FILESDIR}/${PV}/${P}-respect-compiler-flags.patch"
93 + "${FILESDIR}/${PV}/${P}-support-system-gtest.patch"
94 + "${FILESDIR}/${PV}/${P}-fix-icu59-build.patch"
95 + "${FILESDIR}/${PV}/${P}-fix-icu62-build.patch"
96 + "${FILESDIR}/${PV}/${P}-fix-boost170-build.patch"
97 + "${FILESDIR}/${PV}/${P}-fix-makefile-for-make4.3.patch"
98 + "${FILESDIR}/${PV}/${P}-tests_luarocks_lua_version.patch"
99 + "${FILESDIR}/${PV}/${P}-avoid-conveying-positional-parameters-to-source-builtin.patch"
100 + "${FILESDIR}/${PV}/${P}-luaL_Reg-not-luaL_reg.patch"
101 +)
102 +
103 +aegisub_check_compiler() {
104 + if [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11; then
105 + die "Your compiler lacks C++11 support. Use GCC>=4.7.0 or Clang>=3.3."
106 + fi
107 +}
108 +
109 +pkg_pretend() {
110 + aegisub_check_compiler
111 +}
112 +
113 +pkg_setup() {
114 + aegisub_check_compiler
115 + lua-single_pkg_setup
116 +}
117 +
118 +src_prepare() {
119 + default_src_prepare
120 +
121 + # Remove tests that require unavailable uuid Lua module.
122 + rm automation/tests/modules/lfs.moon || die
123 +
124 + remove_locale() {
125 + rm "po/${1}.po" || die
126 + }
127 +
128 + plocale_find_changes 'po' '' '.po'
129 + plocale_for_each_disabled_locale remove_locale
130 +
131 + # See http://devel.aegisub.org/ticket/1914
132 + config_rpath_update "${S}"/config.rpath
133 +
134 + eautoreconf
135 +
136 + cat <<- EOF > build/git_version.h || die
137 + #define BUILD_GIT_VERSION_NUMBER 8897
138 + #define BUILD_GIT_VERSION_STRING "${PV}"
139 + #define TAGGED_RELEASE 0
140 + EOF
141 +}
142 +
143 +src_configure() {
144 + # Prevent access violations from OpenAL detection. See Gentoo bug 508184.
145 + use openal && export agi_cv_with_openal="yes"
146 +
147 + setup-wxwidgets
148 + local myeconfargs=(
149 + --disable-update-checker
150 + --with-ffms2
151 + --with-system-luajit
152 + $(use_enable debug)
153 + $(use_with alsa)
154 + $(use_with fftw fftw3)
155 + $(use_with openal)
156 + $(use_with oss)
157 + $(use_with portaudio)
158 + $(use_with pulseaudio libpulse)
159 + $(use_with spell hunspell)
160 + $(use_with uchardet)
161 + )
162 + econf "${myeconfargs[@]}"
163 +}
164 +
165 +src_compile() {
166 + emake WITH_SYSTEM_GTEST=$(usex test)
167 +}
168 +
169 +src_test() {
170 + emake test-automation
171 + emake test-libaegisub
172 +}
173 +
174 +pkg_postinst() {
175 + xdg_icon_cache_update
176 + xdg_desktop_database_update
177 +}
178 +
179 +pkg_postrm() {
180 + xdg_icon_cache_update
181 + xdg_desktop_database_update
182 +}
183
184 diff --git a/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-luaL_Reg-not-luaL_reg.patch b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-luaL_Reg-not-luaL_reg.patch
185 new file mode 100644
186 index 000000000000..1704630ea53f
187 --- /dev/null
188 +++ b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-luaL_Reg-not-luaL_reg.patch
189 @@ -0,0 +1,35 @@
190 +diff --git a/libaegisub/lua/modules/lpeg.c b/libaegisub/lua/modules/lpeg.c
191 +index 8d67335ab..5261c2061 100644
192 +--- a/libaegisub/lua/modules/lpeg.c
193 ++++ b/libaegisub/lua/modules/lpeg.c
194 +@@ -2334,7 +2334,7 @@ static int matchl (lua_State *L) {
195 + }
196 +
197 +
198 +-static struct luaL_reg pattreg[] = {
199 ++static struct luaL_Reg pattreg[] = {
200 + {"match", matchl},
201 + {"print", printpat_l},
202 + {"locale", locale_l},
203 +@@ -2360,7 +2360,7 @@ static struct luaL_reg pattreg[] = {
204 + };
205 +
206 +
207 +-static struct luaL_reg metapattreg[] = {
208 ++static struct luaL_Reg metapattreg[] = {
209 + {"__add", union_l},
210 + {"__pow", star_l},
211 + {"__sub", diff_l},
212 +diff --git a/vendor/luabins/src/luabins.c b/vendor/luabins/src/luabins.c
213 +index 60668213f..35b177629 100644
214 +--- a/vendor/luabins/src/luabins.c
215 ++++ b/vendor/luabins/src/luabins.c
216 +@@ -54,7 +54,7 @@ static int l_load(lua_State * L)
217 + }
218 +
219 + /* luabins Lua module API */
220 +-static const struct luaL_reg R[] =
221 ++static const struct luaL_Reg R[] =
222 + {
223 + { "save", l_save },
224 + { "load", l_load },