summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/aegisub')
-rw-r--r--media-video/aegisub/Manifest1
-rw-r--r--media-video/aegisub/aegisub-3.3.3.ebuild155
-rw-r--r--media-video/aegisub/aegisub-9999.ebuild51
-rw-r--r--media-video/aegisub/files/3.3.3/aegisub-3.3.3-support-system-gtest.patch89
-rw-r--r--media-video/aegisub/files/aegisub-9999-git.patch61
-rw-r--r--media-video/aegisub/metadata.xml4
6 files changed, 287 insertions, 74 deletions
diff --git a/media-video/aegisub/Manifest b/media-video/aegisub/Manifest
index a7462e939c7d..3ca44ea3a341 100644
--- a/media-video/aegisub/Manifest
+++ b/media-video/aegisub/Manifest
@@ -1 +1,2 @@
DIST aegisub-3.2.2_p20160518.tar.gz 7438734 BLAKE2B 3a57e5d6fafac2ca95d64d60e8d68b48177aaa0c5fd1438d0b0a133757ef95443c16324fb7effb41506f2b1eb70aab9d34845a91beef0ef81a3658444e24be07 SHA512 8d8775ba0a12735a9756b9abfd65c89519dae4e21afcaedbd18985d1c1021975b1ae909b3bef1121b707c626e1711d56f1823f3b4746eab49e8386536a5e84e6
+DIST aegisub-3.3.3.tar.gz 6580314 BLAKE2B b6a6b6d9a805fb1aec943f00452e5f074c050d7d8970e0fa57da54a7a3c12b86241eafafd957577625bcce395c9f909fe60a22c9d76fcf8f018a4ea03921dacf SHA512 19e44667ad8742560559387c15f6c00339194cd26e1140624c63f34c6b4da6bb0b80be0f636a2d1cd0b15f1598e0580218d648e0622635b12eeaad3a40df9abc
diff --git a/media-video/aegisub/aegisub-3.3.3.ebuild b/media-video/aegisub/aegisub-3.3.3.ebuild
new file mode 100644
index 000000000000..208e6b0e5adb
--- /dev/null
+++ b/media-video/aegisub/aegisub-3.3.3.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( luajit )
+LUA_REQ_USE="lua52compat"
+
+WX_GTK_VER=3.2-gtk3
+PLOCALES="ar be 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"
+
+inherit autotools flag-o-matic lua-single plocale wxwidgets xdg-utils vcs-snapshot toolchain-funcs
+
+DESCRIPTION="Advanced subtitle editor"
+HOMEPAGE="http://www.aegisub.org/ https://github.com/wangqr/Aegisub"
+
+if [[ ${PV} == *9999 ]]; then
+ EGIT_REPO_URI="https://github.com/wangqr/${PN^}.git"
+ # Submodules are used to pull bundled libraries.
+ EGIT_SUBMODULES=()
+ inherit git-r3
+else
+ SRC_URI="https://github.com/wangqr/Aegisub/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+LICENSE="BSD MIT"
+SLOT="0"
+IUSE="+alsa debug +fftw openal oss portaudio pulseaudio spell test +uchardet"
+RESTRICT="test"
+
+# aegisub bundles luabins (https://github.com/agladysh/luabins).
+# Unfortunately, luabins upstream is practically dead since 2010.
+# Thus unbundling luabins isn't worth the effort.
+RDEPEND="${LUA_DEPS}
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl,debug?]
+ dev-libs/boost:=[icu,nls]
+ dev-libs/icu:=
+ media-libs/ffmpegsource:=
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libass:=[fontconfig]
+ sys-libs/zlib
+ virtual/libiconv
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib )
+ fftw? ( >=sci-libs/fftw-3.3:= )
+ openal? ( media-libs/openal )
+ portaudio? ( =media-libs/portaudio-19* )
+ pulseaudio? ( media-libs/libpulse )
+ spell? ( app-text/hunspell:= )
+ uchardet? ( app-i18n/uchardet )
+"
+DEPEND="${RDEPEND}"
+# luarocks is only used as a command-line tool so there is no need to enforce
+# LUA_SINGLE_USEDEP on it. On the other hand, this means we must use version
+# bounds in order to make sure we use a version migrated to Lua eclasses.
+BDEPEND="dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig
+ test? (
+ ${RDEPEND}
+ >=dev-cpp/gtest-1.8.1
+ >=dev-lua/luarocks-3.4.0-r100
+ $(lua_gen_cond_dep '
+ dev-lua/busted[${LUA_USEDEP}]
+ ')
+ )
+"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}
+ || ( alsa openal oss portaudio pulseaudio )"
+
+PATCHES=(
+ "${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-fix-system-luajit-build.patch"
+ "${FILESDIR}/3.3.3/${PN}-3.3.3-support-system-gtest.patch"
+ "${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-tests_luarocks_lua_version.patch"
+ "${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-fix-boost-181-build.patch"
+)
+
+aegisub_check_compiler() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++14; then
+ die "Your compiler lacks C++14 support."
+ fi
+}
+
+pkg_pretend() {
+ aegisub_check_compiler
+}
+
+pkg_setup() {
+ aegisub_check_compiler
+ lua-single_pkg_setup
+}
+
+src_prepare() {
+ default_src_prepare
+
+ # Remove tests that require unavailable uuid Lua module.
+ rm automation/tests/modules/lfs.moon || die
+
+ remove_locale() {
+ rm "po/${1}.po" || die
+ }
+
+ plocale_find_changes 'po' '' '.po'
+ plocale_for_each_disabled_locale remove_locale
+
+ # See http://devel.aegisub.org/ticket/1914
+ config_rpath_update "${S}"/config.rpath
+
+ eautoreconf
+}
+
+src_configure() {
+ tc-export PKG_CONFIG
+ # Prevent access violations from OpenAL detection. See Gentoo bug 508184.
+ use openal && export agi_cv_with_openal="yes"
+
+ setup-wxwidgets
+ local myeconfargs=(
+ --disable-update-checker
+ --with-ffms2
+ --with-system-luajit
+ $(use_enable debug)
+ $(use_with alsa)
+ $(use_with fftw fftw3)
+ $(use_with openal)
+ $(use_with oss)
+ $(use_with portaudio)
+ $(use_with pulseaudio libpulse)
+ $(use_with spell hunspell)
+ $(use_with uchardet)
+ )
+ export FORCE_GIT_VERSION="v${PV}"
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake WITH_SYSTEM_GTEST=$(usex test)
+}
+
+src_test() {
+ emake test-automation
+ emake test-libaegisub
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+}
diff --git a/media-video/aegisub/aegisub-9999.ebuild b/media-video/aegisub/aegisub-9999.ebuild
index ef73d1cff4ee..208e6b0e5adb 100644
--- a/media-video/aegisub/aegisub-9999.ebuild
+++ b/media-video/aegisub/aegisub-9999.ebuild
@@ -6,21 +6,26 @@ EAPI=7
LUA_COMPAT=( luajit )
LUA_REQ_USE="lua52compat"
-WX_GTK_VER=3.0-gtk3
+WX_GTK_VER=3.2-gtk3
PLOCALES="ar be 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"
-inherit autotools lua-single plocale wxwidgets xdg-utils git-r3
+inherit autotools flag-o-matic lua-single plocale wxwidgets xdg-utils vcs-snapshot toolchain-funcs
DESCRIPTION="Advanced subtitle editor"
HOMEPAGE="http://www.aegisub.org/ https://github.com/wangqr/Aegisub"
-EGIT_REPO_URI="https://github.com/wangqr/${PN^}.git"
-# Submodules are used to pull bundled libraries.
-EGIT_SUBMODULES=()
+if [[ ${PV} == *9999 ]]; then
+ EGIT_REPO_URI="https://github.com/wangqr/${PN^}.git"
+ # Submodules are used to pull bundled libraries.
+ EGIT_SUBMODULES=()
+ inherit git-r3
+else
+ SRC_URI="https://github.com/wangqr/Aegisub/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
LICENSE="BSD MIT"
SLOT="0"
-KEYWORDS=""
-IUSE="+alsa debug +fftw openal oss portaudio pulseaudio spell +uchardet"
+IUSE="+alsa debug +fftw openal oss portaudio pulseaudio spell test +uchardet"
RESTRICT="test"
# aegisub bundles luabins (https://github.com/agladysh/luabins).
@@ -46,20 +51,44 @@ RDEPEND="${LUA_DEPS}
uchardet? ( app-i18n/uchardet )
"
DEPEND="${RDEPEND}"
+# luarocks is only used as a command-line tool so there is no need to enforce
+# LUA_SINGLE_USEDEP on it. On the other hand, this means we must use version
+# bounds in order to make sure we use a version migrated to Lua eclasses.
BDEPEND="dev-util/intltool
sys-devel/gettext
virtual/pkgconfig
+ test? (
+ ${RDEPEND}
+ >=dev-cpp/gtest-1.8.1
+ >=dev-lua/luarocks-3.4.0-r100
+ $(lua_gen_cond_dep '
+ dev-lua/busted[${LUA_USEDEP}]
+ ')
+ )
"
REQUIRED_USE="${LUA_REQUIRED_USE}
|| ( alsa openal oss portaudio pulseaudio )"
PATCHES=(
- "${FILESDIR}/${P}-git.patch"
+ "${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-fix-system-luajit-build.patch"
+ "${FILESDIR}/3.3.3/${PN}-3.3.3-support-system-gtest.patch"
+ "${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-tests_luarocks_lua_version.patch"
"${FILESDIR}/3.2.2_p20160518/${PN}-3.2.2_p20160518-fix-boost-181-build.patch"
)
+aegisub_check_compiler() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++14; then
+ die "Your compiler lacks C++14 support."
+ fi
+}
+
+pkg_pretend() {
+ aegisub_check_compiler
+}
+
pkg_setup() {
+ aegisub_check_compiler
lua-single_pkg_setup
}
@@ -83,6 +112,7 @@ src_prepare() {
}
src_configure() {
+ tc-export PKG_CONFIG
# Prevent access violations from OpenAL detection. See Gentoo bug 508184.
use openal && export agi_cv_with_openal="yes"
@@ -100,14 +130,13 @@ src_configure() {
$(use_with pulseaudio libpulse)
$(use_with spell hunspell)
$(use_with uchardet)
- --disable-compiler-flags
)
+ export FORCE_GIT_VERSION="v${PV}"
econf "${myeconfargs[@]}"
}
src_compile() {
- # Concurrent builds seem to break the build process.
- emake -j1
+ emake WITH_SYSTEM_GTEST=$(usex test)
}
src_test() {
diff --git a/media-video/aegisub/files/3.3.3/aegisub-3.3.3-support-system-gtest.patch b/media-video/aegisub/files/3.3.3/aegisub-3.3.3-support-system-gtest.patch
new file mode 100644
index 000000000000..ac7834e541d8
--- /dev/null
+++ b/media-video/aegisub/files/3.3.3/aegisub-3.3.3-support-system-gtest.patch
@@ -0,0 +1,89 @@
+commit 83f868ea8decbbe97891631fe142e84c883ee33d
+Author: Ilya Tumaykin <itumaykin@gmail.com>
+Date: Wed Jun 1 20:00:37 2016 +0300
+
+Allow to build and run tests with a system copy of gtest (googletest)
+
+Also add LIBS_UCHARDET to the mix only when uchardet is requested.
+
+Closes #1923
+
+Bug: http://devel.aegisub.org/ticket/1923
+---
+
+diff --git a/configure.ac b/configure.ac
+index 856e38993..197d0a788 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -144,7 +144,7 @@ AS_IF([test x$enable_compiler_flags != xno], [
+ CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing"
+
+ # For mac compiler which still stuck on c++98
+- AC_CXX_FLAG([-std=c++11])
++ AC_CXX_FLAG([-std=c++14])
+
+ # -O* messes with debugging.
+ AS_IF([test x$enable_debug = xyes], [
+diff --git a/tests/Makefile b/tests/Makefile
+index 137430854..bafb59a0f 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -1,24 +1,46 @@
+ include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
+
++WITH_SYSTEM_GTEST ?= no
++
++ifeq (no, $(WITH_SYSTEM_GTEST))
+ GTEST_ROOT ?= $(TOP)vendor/googletest
+ GTEST_FILE := ${GTEST_ROOT}/src/gtest-all
++GTEST_CPPFLAGS := -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include
++GTEST_LIBS := $(LIBS_PTHREAD)
++else
++GTEST_CPPFLAGS := $(shell ${PKG_CONFIG} --cflags-only-I gtest)
++GTEST_LIBS := $(shell ${PKG_CONFIG} --libs gtest)
++endif
++
++GTEST_CXXFLAGS := $(CFLAGS_PTHREAD)
+
+ run_PCH := $(d)support/tests_pre.h
+ run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
+- -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
+-run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
+-run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_UCHARDET) $(LIBS_PTHREAD)
++ $(CPPFLAGS_BOOST) $(CFLAGS_LUA) $(GTEST_CPPFLAGS)
++run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare $(GTEST_CXXFLAGS)
++run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_UCHARDET) $(LIBS_PTHREAD) $(GTEST_LIBS)
+ run_OBJ := \
+ $(patsubst %.cpp,%.o,$(wildcard $(d)tests/*.cpp)) \
+ $(d)support/main.o \
+ $(d)support/util.o \
+- $(TOP)lib/libaegisub.a \
+- $(GTEST_FILE).o
++ $(TOP)lib/libaegisub.a
++
++ifeq (yes, $(HAVE_UCHARDET))
++run_LIBS += $(LIBS_UCHARDET)
++endif
++
++ifeq (no, $(WITH_SYSTEM_GTEST))
++run_OBJ += $(GTEST_FILE).o
+
+ # This bit of goofiness is to make it only try to build the tests if google
+ # test can be found and silently skip it if not, by using $(wildcard) to check
+ # for file existence
+ PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc))
++test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
++else
++PROGRAM += $(d)run
++test: test-libaegisub
++endif
+
+ ifeq (yes, $(BUILD_DARWIN))
+ run_LIBS += -framework ApplicationServices -framework Foundation
+@@ -31,6 +53,4 @@ gtest_filter ?= *
+ test-libaegisub: $(d)run $(d)data
+ cd $(TOP)tests; ./run --gtest_filter="$(gtest_filter)"
+
+-test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
+-
+ include $(TOP)Makefile.target
diff --git a/media-video/aegisub/files/aegisub-9999-git.patch b/media-video/aegisub/files/aegisub-9999-git.patch
deleted file mode 100644
index a5883336757b..000000000000
--- a/media-video/aegisub/files/aegisub-9999-git.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff --git a/Makefile.target b/Makefile.target
-index 516ef3c24..65de0e767 100644
---- a/Makefile.target
-+++ b/Makefile.target
-@@ -79,13 +79,13 @@ endif
- all: $(LIB_TARGETS)
-
- clean:
-- $(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS)
-+ $(BIN_RM) -f -- $(OBJ) $(CLEANFILES) $(LIB_TARGETS)
-
- distclean: clean
-- $(BIN_RM) -rf $(DISTCLEANFILES) $(DEP)
-+ $(BIN_RM) -rf -- $(DISTCLEANFILES) $(DEP)
-
- depclean: clean
-- $(BIN_RM) -rf $(DEP)
-+ $(BIN_RM) -rf -- $(DEP)
-
- install:
-
-diff --git a/header.mk b/header.mk
-index 613b38ff1..2c238e125 100644
---- a/header.mk
-+++ b/header.mk
-@@ -5,15 +5,13 @@ TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/
- include $(TOP)Makefile.inc
-
- subdirs := \
-- automation \
- libaegisub \
- packages/desktop \
- po \
- src \
- tests \
-- tools \
- vendor/luabins \
-- vendor/luajit
-+ tools
-
- subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
-
-diff --git a/m4macros/ac_agi.m4 b/m4macros/ac_agi.m4
-index e45a54767..1bd0120ed 100644
---- a/m4macros/ac_agi.m4
-+++ b/m4macros/ac_agi.m4
-@@ -20,12 +20,14 @@ AC_DEFUN([AC_AGI_LINK],[
- aegisub_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $4"
- LIBS="$LIBS $5"
-+ AC_LANG_PUSH(C++)
- AC_CHECK_HEADER([$3], [agi_cv_header="yes"], [agi_cv_header="no"])
- AS_IF([test "x$agi_cv_header" = xyes],
- [AC_CACHE_CHECK(
- [whether $1 works], [agi_cv_with_$2],
- [AC_LINK_IFELSE([AC_LANG_SOURCE([$6])], [eval agi_cv_with_$2="yes"], [eval agi_cv_with_$2="no"])])]
- [eval agi_cv_with_$2="no"])
-+ AC_LANG_POP(C++)
- CPPFLAGS="$aegisub_save_CPPFLAGS"
- LIBS="$aegisub_save_LIBS"
- ])
diff --git a/media-video/aegisub/metadata.xml b/media-video/aegisub/metadata.xml
index be8099ce66c5..331bf705f1d7 100644
--- a/media-video/aegisub/metadata.xml
+++ b/media-video/aegisub/metadata.xml
@@ -9,7 +9,7 @@
<flag name="uchardet">Enable charset discovery via <pkg>app-i18n/uchardet</pkg></flag>
</use>
<upstream>
- <bugs-to>http://devel.aegisub.org/wiki/NewTicket</bugs-to>
- <remote-id type="github">Aegisub/Aegisub</remote-id>
+ <bugs-to>https://github.com/wangqr/Aegisub/issues</bugs-to>
+ <remote-id type="github">wangqr/Aegisub</remote-id>
</upstream>
</pkgmetadata>