media-video/mkvtoolnix: make test build optional

Bug: https://bugs.gentoo.org/978866
Thanks-To: Bernd Feige <Bernd.Feige@gmx.net>
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1722
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alfred Wingate
2026-09-10 00:13:49 +01:00
committed by Sam James
parent 02c7e50452
commit d075e03c1c
3 changed files with 45 additions and 4 deletions
@@ -0,0 +1,31 @@
https://bugs.gentoo.org/978866#c8
Thanks to Bernd Feige.
--- a/ac/gtest.m4
+++ b/ac/gtest.m4
@@ -35,5 +35,23 @@ AC_DEFUN([AX_GTEST],[
AC_SUBST(GTEST_TYPE)
])
-AX_GTEST
+AC_ARG_ENABLE(
+ [tests],
+ AS_HELP_STRING([--disable-tests],[Disable building of unit tests (default: auto)]),
+ [],
+ [enable_tests=auto]
+)
+
+if test x"$enable_tests" != xno; then
+ AX_GTEST
+else
+ GTEST_CFLAGS=
+ GTEST_LIBS=
+ GTEST_TYPE=no
+ AC_SUBST([GTEST_CFLAGS])
+ AC_SUBST([GTEST_LIBS])
+ AC_SUBST([GTEST_TYPE])
+ AC_MSG_NOTICE([Tests disabled; not looking for gtest])
+fi
+
AC_PATH_PROG(VALGRIND, valgrind,, $PATH)
@@ -73,6 +73,10 @@ if [[ ${PV} != *9999 ]] ; then
VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/moritzbunkus.asc"
fi
PATCHES=(
"${FILESDIR}"/mktoolnix-101.0-optional-tests-build.patch
)
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]]; then
# bug #927497
@@ -124,10 +128,11 @@ src_configure() {
local myeconfargs=(
$(use_enable dbus)
$(use_enable debug)
$(usex pch "" --disable-precompiled-headers)
$(use_enable gui)
$(use_with dvd dvdread)
$(use_enable gui)
$(use_with nls gettext)
$(usex pch "" --disable-precompiled-headers)
$(use_enable test tests)
#$(use_with nls po4a)
--disable-update-check
--disable-optimization
@@ -73,6 +73,10 @@ if [[ ${PV} != *9999 ]] ; then
VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/moritzbunkus.asc"
fi
PATCHES=(
"${FILESDIR}"/mktoolnix-101.0-optional-tests-build.patch
)
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]]; then
# bug #927497
@@ -124,10 +128,11 @@ src_configure() {
local myeconfargs=(
$(use_enable dbus)
$(use_enable debug)
$(usex pch "" --disable-precompiled-headers)
$(use_enable gui)
$(use_with dvd dvdread)
$(use_enable gui)
$(use_with nls gettext)
$(usex pch "" --disable-precompiled-headers)
$(use_enable test tests)
#$(use_with nls po4a)
--disable-update-check
--disable-optimization