Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@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: Tue, 28 Jun 2016 18:07:03
Message-Id: 1467135497.856366c5b4b00916caa4263b9970d29d0b9838e8.monsieurp@gentoo
1 commit: 856366c5b4b00916caa4263b9970d29d0b9838e8
2 Author: Ilya Tumaykin <itumaykin <AT> gmail <DOT> com>
3 AuthorDate: Sat Jun 4 17:51:57 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 28 17:38:17 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=856366c5
7
8 media-video/aegisub: verbump to 3.2.2_p20160518
9
10 Major revamp of the ebuild and the patchset:
11 - EAPI=6;
12 - add testing support;
13 - remove ffmpeg USE and depend on ffmpegsource unconditionally
14 (otherwise aegisub can only open blank 'videos' without any video);
15 - cleanup dependencies;
16 - update the patchset (all changes were submitted upstream);
17 - update LICENSE.
18
19 Package-Manager: portage-2.3.0_rc1
20
21 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
22
23 media-video/aegisub/Manifest | 1 +
24 media-video/aegisub/aegisub-3.2.2_p20160518.ebuild | 138 +++++++++++++++++++++
25 ...b-3.2.2_p20160518-fix-system-luajit-build.patch | 121 ++++++++++++++++++
26 ...ub-3.2.2_p20160518-respect-compiler-flags.patch | 53 ++++++++
27 ...isub-3.2.2_p20160518-support-system-gtest.patch | 75 +++++++++++
28 5 files changed, 388 insertions(+)
29
30 diff --git a/media-video/aegisub/Manifest b/media-video/aegisub/Manifest
31 index d977b38..2db679d 100644
32 --- a/media-video/aegisub/Manifest
33 +++ b/media-video/aegisub/Manifest
34 @@ -1,2 +1,3 @@
35 DIST aegisub-3.2.2.tar.xz 5252052 SHA256 c55e33945b82d8513c02ea6e782f0d72c726adcd3707e95b8c0022f6151e6885 SHA512 54f825e52f238fef8d5cc31c37436e21355aee27883347f905271e5d2a8ff2a77e1b67d5aef38b0f8468bd0bad851fe944e02de27ec96310b902fbe5b1086722 WHIRLPOOL fe948edbb01f11385e14d1912b73942605df18325fcd95f4284a3c2edb73778d90d73038ac4a062e211fd56879590040e3c558fe1e361ec9fe2eee6a5c016448
36 DIST aegisub-3.2.2_p20160306.tar.gz 7436713 SHA256 1b70f67c3b3d6ecce482bc1f4beb1ceffd4c523aa060556658e403ea98fcc58c SHA512 815775b64b1ad5cd09eda6106561a8a0d4dc129d4c2e08e057eab881289526a7b67bab2f4d2f48748ef2015ea21f2839ed8f84d168bf9127c62c9a35caa1abd5 WHIRLPOOL caaa6b1d69c7e4d1da4abfd0382d263585c5216d9ed5e63f515d8bce98b2e0dad2848552f3f097a8db9e39dad5d2c00d3b752f0407490d0d2c777aaa8fc6dc38
37 +DIST aegisub-3.2.2_p20160518.tar.gz 7438734 SHA256 744318ce8be1afb21fbd6b0ce6d407a6f42c442db0df10c7cf89692a5bc8ca31 SHA512 8d8775ba0a12735a9756b9abfd65c89519dae4e21afcaedbd18985d1c1021975b1ae909b3bef1121b707c626e1711d56f1823f3b4746eab49e8386536a5e84e6 WHIRLPOOL 0d46799009c72cac1d6df89f4ffe5110d904e671175380e20605683b6a2f3ccdd46855cf98ebac8f0088c7a928b82547557afc8214b2fce85aed759aa5e9e4ab
38
39 diff --git a/media-video/aegisub/aegisub-3.2.2_p20160518.ebuild b/media-video/aegisub/aegisub-3.2.2_p20160518.ebuild
40 new file mode 100644
41 index 0000000..8610144
42 --- /dev/null
43 +++ b/media-video/aegisub/aegisub-3.2.2_p20160518.ebuild
44 @@ -0,0 +1,138 @@
45 +# Copyright 1999-2016 Gentoo Foundation
46 +# Distributed under the terms of the GNU General Public License v2
47 +# $Id$
48 +
49 +EAPI=6
50 +
51 +WX_GTK_VER=3.0
52 +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"
53 +COMMIT_ID="b118fe7e7a5c37540e2f0aa75af105e272bad234"
54 +
55 +inherit autotools fdo-mime flag-o-matic gnome2-utils l10n wxwidgets vcs-snapshot
56 +
57 +DESCRIPTION="Advanced subtitle editor"
58 +HOMEPAGE="http://www.aegisub.org/ https://github.com/Aegisub/Aegisub"
59 +SRC_URI="https://github.com/Aegisub/Aegisub/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
60 +
61 +LICENSE="BSD MIT"
62 +SLOT="0"
63 +KEYWORDS="~amd64 ~x86"
64 +IUSE="alsa debug +fftw openal oss portaudio pulseaudio spell test +uchardet"
65 +
66 +# aegisub bundles luabins (https://github.com/agladysh/luabins).
67 +# Unfortunately, luabins upstream is practically dead since 2010.
68 +# Thus unbundling luabins isn't worth the effort.
69 +RDEPEND="
70 + x11-libs/wxGTK:${WX_GTK_VER}[X,opengl,debug?]
71 + dev-lang/luajit:2[lua52compat]
72 + dev-libs/boost:=[icu,nls,threads]
73 + dev-libs/icu:=
74 + media-libs/ffmpegsource:=
75 + media-libs/fontconfig
76 + media-libs/freetype
77 + media-libs/libass:=[fontconfig]
78 + sys-libs/zlib
79 + virtual/libiconv
80 + virtual/opengl
81 + alsa? ( media-libs/alsa-lib )
82 + fftw? ( >=sci-libs/fftw-3.3:= )
83 + openal? ( media-libs/openal )
84 + portaudio? ( =media-libs/portaudio-19* )
85 + pulseaudio? ( media-sound/pulseaudio )
86 + spell? ( app-text/hunspell )
87 + uchardet? ( dev-libs/uchardet )
88 +"
89 +DEPEND="${RDEPEND}
90 + dev-util/intltool
91 + sys-devel/gettext
92 + virtual/pkgconfig
93 + oss? ( virtual/os-headers )
94 + test? (
95 + ~dev-cpp/gtest-1.7.0
96 + dev-lua/busted
97 + dev-lua/luarocks
98 + )
99 +"
100 +
101 +REQUIRED_USE="|| ( alsa openal oss portaudio pulseaudio )"
102 +
103 +PATCHES=(
104 + "${FILESDIR}/${PV}/${P}-fix-system-luajit-build.patch"
105 + "${FILESDIR}/${PV}/${P}-respect-compiler-flags.patch"
106 + "${FILESDIR}/${PV}/${P}-support-system-gtest.patch"
107 +)
108 +
109 +pkg_pretend() {
110 + if [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11; then
111 + die "Your compiler lacks C++11 support. Use GCC>=4.7.0 or Clang>=3.3."
112 + fi
113 +}
114 +
115 +src_prepare() {
116 + default_src_prepare
117 +
118 + # Remove tests that require unavailable uuid Lua module.
119 + rm automation/tests/modules/lfs.moon || die
120 +
121 + remove_locale() {
122 + rm "po/${1}.po" || die
123 + }
124 +
125 + l10n_find_plocales_changes 'po' '' '.po'
126 + l10n_for_each_disabled_locale_do remove_locale
127 +
128 + # See http://devel.aegisub.org/ticket/1914
129 + config_rpath_update "${S}"/config.rpath
130 +
131 + eautoreconf
132 +
133 + cat <<- EOF > build/git_version.h || die
134 + #define BUILD_GIT_VERSION_NUMBER 8897
135 + #define BUILD_GIT_VERSION_STRING "${PV}"
136 + #define TAGGED_RELEASE 0
137 + EOF
138 +}
139 +
140 +src_configure() {
141 + # Prevent access violations from OpenAL detection. See Gentoo bug 508184.
142 + use openal && export agi_cv_with_openal="yes"
143 +
144 + local myeconfargs=(
145 + --disable-update-checker
146 + --with-ffms2
147 + --with-system-luajit
148 + $(use_enable debug)
149 + $(use_with alsa)
150 + $(use_with fftw fftw3)
151 + $(use_with openal)
152 + $(use_with oss)
153 + $(use_with portaudio)
154 + $(use_with pulseaudio libpulse)
155 + $(use_with spell hunspell)
156 + $(use_with uchardet)
157 + )
158 + econf "${myeconfargs[@]}"
159 +}
160 +
161 +src_compile() {
162 + emake WITH_SYSTEM_GTEST=$(usex test)
163 +}
164 +
165 +src_test() {
166 + emake test-automation
167 + emake test-libaegisub
168 +}
169 +
170 +pkg_preinst() {
171 + gnome2_icon_savelist
172 +}
173 +
174 +pkg_postinst() {
175 + fdo-mime_desktop_database_update
176 + gnome2_icon_cache_update
177 +}
178 +
179 +pkg_postrm() {
180 + fdo-mime_desktop_database_update
181 + gnome2_icon_cache_update
182 +}
183
184 diff --git a/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-fix-system-luajit-build.patch b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-fix-system-luajit-build.patch
185 new file mode 100644
186 index 0000000..42b57e5
187 --- /dev/null
188 +++ b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-fix-system-luajit-build.patch
189 @@ -0,0 +1,121 @@
190 +See http://devel.aegisub.org/ticket/1904
191 +and http://devel.aegisub.org/ticket/1913
192 +and http://devel.aegisub.org/ticket/1922
193 +
194 +diff --git a/Makefile.inc.in b/Makefile.inc.in
195 +index d8b3f4a..52e4cf6 100644
196 +--- a/Makefile.inc.in
197 ++++ b/Makefile.inc.in
198 +@@ -9,6 +9,7 @@ HAVE_OPENAL = @with_openal@
199 + HAVE_OSS = @with_oss@
200 + HAVE_PORTAUDIO = @with_portaudio@
201 + HAVE_UCHARDET = @with_uchardet@
202 ++SYSTEM_LUAJIT = @with_system_luajit@
203 +
204 + ##############
205 + # BUILD OUTPUT
206 +diff --git a/automation/Makefile b/automation/Makefile
207 +index 5483dbd..1231aab 100644
208 +--- a/automation/Makefile
209 ++++ b/automation/Makefile
210 +@@ -12,10 +12,16 @@ DATA_AUTOMATION_INSTALLED = $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(DATA_
211 + $(DESTDIR)$(P_DATA)/automation/%: $(d)%
212 + $(MKDIR_INSTALL)
213 +
214 +-aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a $(LIBS_LUA)
215 ++aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a
216 + aegisub-lua_CPPFLAGS := $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(TOP)libaegisub/include -I$(TOP)src $(CXXFLAGS_WX)
217 + aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_PTHREAD)
218 +
219 ++ifeq (no, $(SYSTEM_LUAJIT))
220 ++aegisub-lua_OBJ += $(LIBS_LUA)
221 ++else
222 ++aegisub-lua_LIBS += $(LIBS_LUA)
223 ++endif
224 ++
225 + PROGRAM += $(d)aegisub-lua
226 +
227 + test-automation: $(PROGRAM)
228 +diff --git a/configure.ac b/configure.ac
229 +index 1649efc..81b1413 100644
230 +--- a/configure.ac
231 ++++ b/configure.ac
232 +@@ -429,13 +429,15 @@ AS_IF([test $with_system_luajit = no],
233 + [AC_SUBST([LUAJIT_CFLAGS], ['-I$(TOP)vendor/luajit/include'])
234 + AC_SUBST([LUAJIT_LIBS], ['$(TOP)vendor/luajit/src/libluajit.a'])])
235 +
236 ++AC_SUBST(with_system_luajit)
237 ++
238 + # We also need a Lua binary to run part of the build system
239 + # Which version doesn't matter as the scripts are portable between them
240 +-AC_CHECK_PROGS([LUA], [lua luajit lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
241 ++AC_PATH_PROGS([LUA], [luajit lua lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
242 +
243 + # If the user doesn't have an installed copy of Lua, just use the one built
244 + # as part of building LuaJIT
245 +-AS_IF([test -z $LUA], [LUA="$srcdir/vendor/luajit/src/host/minilua"])
246 ++AS_IF([test -z $LUA], [LUA='$(TOP)vendor/luajit/src/host/minilua'])
247 +
248 + ######################################################
249 + # Debugging support
250 +diff --git a/header.mk b/header.mk
251 +index 613b38f..a9ce1d7 100644
252 +--- a/header.mk
253 ++++ b/header.mk
254 +@@ -13,7 +13,10 @@ subdirs := \
255 + tests \
256 + tools \
257 + vendor/luabins \
258 +- vendor/luajit
259 ++
260 ++ifeq (no, $(SYSTEM_LUAJIT))
261 ++subdirs += vendor/luajit
262 ++endif
263 +
264 + subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
265 +
266 +diff --git a/src/Makefile b/src/Makefile
267 +index 0ee6c84..1a6f015 100644
268 +--- a/src/Makefile
269 ++++ b/src/Makefile
270 +@@ -6,7 +6,7 @@ src_CPPFLAGS := -I$(d) -I.. -I$(d)include -I$(TOP)libaegisub/include -I$(TOP)bui
271 + $(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_ICU) $(CPPFLAGS_BOOST)
272 + src_CXXFLAGS := $(CXXFLAGS_WX)
273 + src_LIBS := $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE) \
274 +- $(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) $(LIBS_ICU)
275 ++ $(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) $(LIBS_ICU)
276 + src_PCH := $(d)agi_pre.h
277 + src_INSTALLNAME := $(AEGISUB_COMMAND)
278 +
279 +@@ -111,11 +111,16 @@ src_OBJ := \
280 + $(d)video_provider_yuv4mpeg.o \
281 + $(d)video_slider.o \
282 + $(d)visual_feature.o \
283 +- $(LIBS_LUA) \
284 + $(TOP)lib/libaegisub.a \
285 + $(TOP)lib/libluabins.a \
286 + $(TOP)lib/libresrc.a \
287 +
288 ++ifeq (no, $(SYSTEM_LUAJIT))
289 ++src_OBJ += $(LIBS_LUA)
290 ++else
291 ++src_LIBS += $(LIBS_LUA)
292 ++endif
293 ++
294 + ifeq (yes, $(BUILD_DARWIN))
295 + src_OBJ += $(d)font_file_lister_coretext.o
296 + src_OBJ += $(subst .mm,.o,$(wildcard $(d)osx/*.mm))
297 +diff --git a/tools/Makefile b/tools/Makefile
298 +index de6166a..e3d108a 100644
299 +--- a/tools/Makefile
300 ++++ b/tools/Makefile
301 +@@ -12,6 +12,8 @@ repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU)
302 +
303 + PROGRAM += $(d)repack-thes-dict
304 +
305 +-$(TOP)tools/respack.lua: $(shell command -v "$(BIN_LUA)")
306 ++ifeq (no, $(SYSTEM_LUAJIT))
307 ++$(TOP)tools/respack.lua: $(BIN_LUA)
308 ++endif
309 +
310 + include $(TOP)Makefile.target
311
312 diff --git a/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-respect-compiler-flags.patch b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-respect-compiler-flags.patch
313 new file mode 100644
314 index 0000000..90e57f1
315 --- /dev/null
316 +++ b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-respect-compiler-flags.patch
317 @@ -0,0 +1,53 @@
318 +See http://devel.aegisub.org/ticket/1899
319 +and http://devel.aegisub.org/ticket/1900
320 +
321 +diff --git a/configure.ac b/configure.ac
322 +index 1649efc..2f4470b 100644
323 +--- a/configure.ac
324 ++++ b/configure.ac
325 +@@ -133,20 +133,17 @@ AS_IF([test x$build_darwin != xyes], [
326 + AC_ARG_ENABLE(compiler-flags, AS_HELP_STRING([--disable-compiler-flags],[Disable *all* additional compiler flags. [no]]))
327 +
328 + AS_IF([test x$enable_compiler_flags != xno], [
329 +- CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -std=gnu99 -pipe -g"
330 +- CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -pipe -g"
331 ++ CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
332 ++ CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing"
333 ++ AC_C_FLAG([-std=gnu99])
334 + AC_CXX_FLAG([-std=c++11])
335 +- AC_CXX_FLAG([-Wno-c++11-narrowing])
336 + AC_C_FLAG([-Wno-unused-local-typedefs])
337 + AC_CXX_FLAG([-Wno-unused-local-typedefs])
338 +
339 + # -O* messes with debugging.
340 + AS_IF([test x$enable_debug = xyes], [
341 +- CFLAGS="$CFLAGS -O0"
342 +- CXXFLAGS="$CXXFLAGS -O0"
343 +- ], [
344 +- CFLAGS="$CFLAGS -O3"
345 +- CXXFLAGS="$CXXFLAGS -O3"
346 ++ CFLAGS="$CFLAGS -O0 -g"
347 ++ CXXFLAGS="$CXXFLAGS -O0 -g"
348 + ])
349 + ])
350 +
351 +diff --git a/src/Makefile b/src/Makefile
352 +index 0ee6c84..cad213b 100644
353 +--- a/src/Makefile
354 ++++ b/src/Makefile
355 +@@ -188,14 +188,13 @@ endif
356 + #####################
357 + # SOURCE-LEVEL CFLAGS
358 + #####################
359 +-$(d)MatroskaParser.o_FLAGS := -Wno-sometimes-uninitialized
360 + $(d)audio_player.o_FLAGS := $(CFLAGS_ALSA) $(CFLAGS_PORTAUDIO) $(CFLAGS_LIBPULSE) $(CFLAGS_OPENAL)
361 + $(d)audio_provider_factory.o_FLAGS := $(CFLAGS_FFMS2)
362 + $(d)auto4_base.o_FLAGS := $(CFLAGS_FREETYPE)
363 + $(d)charset_detect.o_FLAGS := -D_X86_
364 + $(d)font_file_lister_fontconfig.o_FLAGS := $(CFLAGS_FONTCONFIG)
365 + $(d)subtitles_provider.o_FLAGS := $(CFLAGS_LIBASS)
366 +-$(d)subtitles_provider_libass.o_FLAGS := $(CFLAGS_LIBASS) -Wno-c++11-narrowing
367 ++$(d)subtitles_provider_libass.o_FLAGS := $(CFLAGS_LIBASS)
368 + $(d)text_file_reader.o_FLAGS := -D_X86_
369 + $(d)video_provider_manager.o_FLAGS := $(CFLAGS_FFMS2)
370 + $(d)auto4_lua.o_FLAGS := $(CFLAGS_LUA)
371
372 diff --git a/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-support-system-gtest.patch b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-support-system-gtest.patch
373 new file mode 100644
374 index 0000000..8209ac5
375 --- /dev/null
376 +++ b/media-video/aegisub/files/3.2.2_p20160518/aegisub-3.2.2_p20160518-support-system-gtest.patch
377 @@ -0,0 +1,75 @@
378 +commit 83f868ea8decbbe97891631fe142e84c883ee33d
379 +Author: Ilya Tumaykin <itumaykin@×××××.com>
380 +Date: Wed Jun 1 20:00:37 2016 +0300
381 +
382 +Allow to build and run tests with a system copy of gtest (googletest)
383 +
384 +Also add LIBS_UCHARDET to the mix only when uchardet is requested.
385 +
386 +Closes #1923
387 +
388 +Bug: http://devel.aegisub.org/ticket/1923
389 +---
390 +
391 +diff --git a/tests/Makefile b/tests/Makefile
392 +index 8c30c1d..c5bf049 100644
393 +--- a/tests/Makefile
394 ++++ b/tests/Makefile
395 +@@ -1,24 +1,45 @@
396 + include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
397 +
398 ++WITH_SYSTEM_GTEST ?= no
399 ++
400 ++ifeq (no, $(WITH_SYSTEM_GTEST))
401 + GTEST_ROOT ?= $(TOP)vendor/googletest
402 + GTEST_FILE := ${GTEST_ROOT}/src/gtest-all
403 ++GTEST_CPPFLAGS := -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include
404 ++GTEST_CXXFLAGS := $(CFLAGS_PTHREAD)
405 ++GTEST_LIBS := $(LIBS_PTHREAD)
406 ++else
407 ++GTEST_CPPFLAGS := $(shell gtest-config --cppflags)
408 ++GTEST_CXXFLAGS := $(shell gtest-config --cxxflags)
409 ++GTEST_LIBS := $(shell gtest-config --libs)
410 ++endif
411 +
412 + run_PCH := $(d)support/tests_pre.h
413 + run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
414 +- -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
415 +-run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
416 +-run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_UCHARDET) $(LIBS_PTHREAD)
417 ++ $(CPPFLAGS_BOOST) $(CFLAGS_ICU) $(CFLAGS_LUA) $(GTEST_CPPFLAGS)
418 ++run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare $(GTEST_CXXFLAGS)
419 ++run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(GTEST_LIBS)
420 + run_OBJ := \
421 + $(subst .cpp,.o,$(wildcard $(d)tests/*.cpp)) \
422 + $(d)support/main.o \
423 + $(d)support/util.o \
424 +- $(TOP)lib/libaegisub.a \
425 +- $(GTEST_FILE).o
426 ++ $(TOP)lib/libaegisub.a
427 +
428 ++ifeq (yes, $(HAVE_UCHARDET))
429 ++run_LIBS += $(LIBS_UCHARDET)
430 ++endif
431 ++
432 ++ifeq (no, $(WITH_SYSTEM_GTEST))
433 ++run_OBJ += $(GTEST_FILE).o
434 + # This bit of goofiness is to make it only try to build the tests if google
435 + # test can be found and silently skip it if not, by using $(wildcard) to check
436 + # for file existence
437 + PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc))
438 ++test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
439 ++else
440 ++PROGRAM += $(d)run
441 ++test: test-libaegisub
442 ++endif
443 +
444 + ifeq (yes, $(BUILD_DARWIN))
445 + run_LIBS += -framework ApplicationServices -framework Foundation
446 +@@ -31,6 +52,4 @@ gtest_filter ?= *
447 + test-libaegisub: $(d)run $(d)data
448 + cd $(TOP)tests; ./run --gtest_filter="$(gtest_filter)"
449 +
450 +-test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
451 +-
452 + include $(TOP)Makefile.target