1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=6
|
|
4 |
# Skeleton command:
|
|
5 |
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/teras/Jubler/archive/v7.0.3.tar.gz --slot 0 --keywords "~amd64" --ebuild jubler-7.0.3.ebuild
|
5 |
6 |
|
6 |
|
inherit desktop java-pkg-2 java-ant-2 xdg
|
|
7 |
EAPI=8
|
7 |
8 |
|
8 |
|
MY_PN="${PN^}"
|
|
9 |
JAVA_PKG_IUSE="doc source"
|
|
10 |
MAVEN_ID="com.panayotis.jubler:project:7.0.3"
|
9 |
11 |
|
10 |
|
DESCRIPTION="Java subtitle editor"
|
|
12 |
inherit desktop java-pkg-2 java-pkg-simple toolchain-funcs xdg-utils
|
|
13 |
|
|
14 |
DESCRIPTION="Jubler Subtitle Εditor"
|
11 |
15 |
HOMEPAGE="https://www.jubler.org/"
|
12 |
|
SRC_URI="mirror://sourceforge/${PN}/${MY_PN}-source-${PV}.tar.bz2 -> ${P}.tar.bz2"
|
|
16 |
SRC_URI="https://github.com/teras/Jubler/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
13 |
17 |
|
14 |
18 |
LICENSE="GPL-2"
|
15 |
19 |
SLOT="0"
|
16 |
|
KEYWORDS="amd64 x86"
|
17 |
|
IUSE="mplayer spell nls"
|
|
20 |
KEYWORDS="~amd64 ~x86"
|
|
21 |
|
|
22 |
CP_DEPEND="dev-java/appenh:0"
|
|
23 |
|
|
24 |
DEPEND="${CP_DEPEND}
|
|
25 |
media-video/ffmpeg:0=
|
|
26 |
>=virtual/jdk-1.8:*"
|
|
27 |
|
|
28 |
RDEPEND="${CP_DEPEND}
|
|
29 |
>=virtual/jre-1.8:*"
|
18 |
30 |
|
19 |
|
RDEPEND="
|
20 |
|
mplayer? ( media-video/mplayer[libass] )
|
21 |
|
spell? ( app-text/aspell )
|
22 |
|
>=virtual/jre-1.6"
|
|
31 |
JUBLER_MODULES=(
|
|
32 |
"jubler"
|
|
33 |
"appenhancer"
|
|
34 |
"aspell"
|
|
35 |
"basetextsubs"
|
|
36 |
"coretools"
|
|
37 |
"mplayer"
|
|
38 |
"zemberek"
|
|
39 |
)
|
23 |
40 |
|
24 |
|
DEPEND="
|
25 |
|
>=virtual/jdk-1.6"
|
|
41 |
HTML_DOCS=( ChangeLog.html )
|
26 |
42 |
|
27 |
|
S="${WORKDIR}/${MY_PN}-${PV}"
|
|
43 |
PATCHES=( "${FILESDIR}/7.0.3-helpme.patch" )
|
|
44 |
|
|
45 |
S="${WORKDIR}/Jubler-${PV}"
|
28 |
46 |
|
29 |
47 |
src_prepare() {
|
|
48 |
java-pkg-2_src_prepare
|
30 |
49 |
default
|
31 |
|
|
32 |
|
local REMOVE_PLUGINS=() _plugin
|
33 |
|
use mplayer || REMOVE_PLUGINS+=( mplayer )
|
34 |
|
use spell || REMOVE_PLUGINS+=( aspell zemberek )
|
35 |
|
for _plugin in "${REMOVE_PLUGINS[@]}"; do
|
36 |
|
rm -rv "plugins/${_plugin}" || die
|
37 |
|
done
|
|
50 |
# decodeaudio.c:82:24: error: 'AVCODEC_MAX_AUDIO_FRAME_SIZE' undeclared (first use in this function); did you mean 'AV_CODEC_CAP_VARIABLE_FRAME_SIZE'?
|
|
51 |
# decodeaudio.c:176:49: error: 'CODEC_ID_NONE' undeclared (first use in this function); did you mean 'AV_CODEC_ID_NONE'?
|
|
52 |
# decodeaudio.c:180:38: error: 'AVCodecContext' has no member named 'request_channels'; did you mean 'request_channel_layout'?
|
|
53 |
# decodeframe.c:230:31: error: 'PIX_FMT_RGB24' undeclared (first use in this function); did you mean 'AV_PIX_FMT_RGB24'?
|
|
54 |
# decodeaudio.c:197:79: error: 'AVIO_WRONLY' undeclared (first use in this function # https://github.com/FFmpeg/FFmpeg/commit/59d96941f0
|
|
55 |
# decodeaudio.c:239:26: error: 'AVCodecContext' has no member named 'request_channels'; did you mean 'request_channel_layout'?
|
|
56 |
# makecache.c:94:28: error: 'AVCODEC_MAX_AUDIO_FRAME_SIZE' undeclared (first use in this function); did you mean 'AV_CODEC_CAP_VARIABLE_FRAME_SIZE'?
|
|
57 |
# decodeaudio.c:339:25: error: 'CODEC_FLAG_GLOBAL_HEADER' undeclared (first use in this function); did you mean 'AV_CODEC_FLAG_GLOBAL_HEADER'
|
|
58 |
sed \
|
|
59 |
-e 's:AVCODEC_MAX_AUDIO_FRAME_SIZE:AV_CODEC_CAP_VARIABLE_FRAME_SIZE:' \
|
|
60 |
-e 's:CODEC_ID_NONE:AV_CODEC_ID_NONE:' \
|
|
61 |
-e 's:request_channels:request_channel_layout:' \
|
|
62 |
-e 's:PIX_FMT_RGB24:AV_PIX_FMT_RGB24:' \
|
|
63 |
-e 's:AVIO_WRONLY:AVIO_FLAG_WRITE:' \
|
|
64 |
-e 's:CODEC_FLAG_GLOBAL_HEADER:AV_CODEC_FLAG_GLOBAL_HEADER:' \
|
|
65 |
-e 's:CodecID:AVCodecID:' \
|
|
66 |
-i resources/ffmpeg/ffdecode/*.c || die
|
38 |
67 |
}
|
39 |
68 |
|
40 |
69 |
src_compile() {
|
41 |
|
local JUBLER_TARGETS=()
|
42 |
|
use nls || JUBLER_TARGETS+=( core help )
|
43 |
|
eant -f "${S}/build.xml" "${JUBLER_TARGETS[@]}"
|
|
70 |
einfo "Compiling the ffdecode library"
|
|
71 |
pushd resources/ffmpeg/ffdecode || die
|
|
72 |
local args=(
|
|
73 |
JAVA_HOME="$(java-config -g JAVA_HOME)"
|
|
74 |
STATIC="no"
|
|
75 |
CC="$(tc-getCC)"
|
|
76 |
STRIP="$(tc-getSTRIP)"
|
|
77 |
LIBNAME="libffdecode.so"
|
|
78 |
)
|
|
79 |
emake "${args[@]}"
|
|
80 |
popd
|
|
81 |
|
|
82 |
jar -cf coretheme.jar -C modules/coretheme/src/main/resources/ . || die
|
|
83 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":coretheme.jar"
|
|
84 |
|
|
85 |
mv modules/{core,jubler} || die
|
|
86 |
|
|
87 |
local module
|
|
88 |
for module in "${JUBLER_MODULES[@]}"; do
|
|
89 |
einfo "Compiling module \"${module}\""
|
|
90 |
JAVA_SRC_DIR="modules/${module}/src/main/java"
|
|
91 |
JAVA_RESOURCE_DIRS="modules/${module}/src/main/resources"
|
|
92 |
JAVA_JAR_FILENAME="${module}.jar"
|
|
93 |
if [[ ${module} == jubler ]]; then
|
|
94 |
JAVA_MAIN_CLASS="Jubler"
|
|
95 |
fi
|
|
96 |
|
|
97 |
java-pkg-simple_src_compile
|
|
98 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":${module}.jar"
|
|
99 |
JAVA_MAIN_CLASS=""
|
|
100 |
rm -r target || die
|
|
101 |
done
|
|
102 |
|
|
103 |
if use doc; then
|
|
104 |
einfo "Compiling javadocs"
|
|
105 |
JAVA_SRC_DIR=()
|
|
106 |
for module in "${JUBLER_MODULES}"; do
|
|
107 |
JAVA_SRC_DIR+=( "modules/${module}/src/main/java" )
|
|
108 |
done
|
|
109 |
JAVA_JAR_FILENAME="ignoreme.jar"
|
|
110 |
java-pkg-simple_src_compile
|
|
111 |
fi
|
44 |
112 |
}
|
45 |
113 |
|
46 |
114 |
src_install() {
|
47 |
|
DESTDIR="${D}" eant linuxdesktopintegration
|
48 |
|
rm -rv "${D}/usr/share/menu" || die
|
49 |
|
|
50 |
|
doicon "resources/installers/linux/${PN}.png"
|
51 |
|
domenu "resources/installers/linux/${PN}.desktop"
|
52 |
|
|
53 |
|
java-pkg_dojar dist/Jubler.jar
|
54 |
|
java-pkg_dolauncher "${PN}" --main Jubler
|
|
115 |
java-pkg_doso dist/lib/libffdecode.so
|
|
116 |
java-pkg_dojar "coretheme.jar"
|
|
117 |
local module
|
|
118 |
for module in "${JUBLER_MODULES[@]}"; do
|
|
119 |
java-pkg_dojar ${module}.jar
|
|
120 |
if use source; then
|
|
121 |
java-pkg_dosrc "modules/${module}/src/main/java/*"
|
|
122 |
fi
|
|
123 |
done
|
55 |
124 |
|
56 |
|
if use nls; then
|
57 |
|
insinto "/usr/share/${PN}/lib/i18n/"
|
58 |
|
doins dist/i18n/*.jar
|
|
125 |
if use doc; then
|
|
126 |
java-pkg_dojavadoc target/api
|
59 |
127 |
fi
|
60 |
128 |
|
61 |
|
insinto "/usr/share/${PN}/lib/themes"
|
62 |
|
doins dist/themes/coretheme.jar
|
63 |
|
insinto "/usr/share/${PN}/lib/lib"
|
64 |
|
doins dist/lib/*.jar
|
|
129 |
java-pkg_dolauncher "jubler" --main Jubler
|
|
130 |
|
|
131 |
domenu resources/installers/linux/jubler.desktop
|
|
132 |
doicon -s 32 resources/installers/linux/jubler32.png
|
|
133 |
doicon -s 64 resources/installers/linux/jubler64.png
|
|
134 |
doicon -s 128 resources/installers/linux/jubler128.png
|
|
135 |
doicon modules/jubler/src/main/resources/icons/splash.jpg
|
|
136 |
doicon -s 16 modules/jubler/src/main/resources/icons/crossmobile.png
|
|
137 |
|
|
138 |
# modules/installer/pom.xml#L90-L94
|
|
139 |
insinto /usr/share/${PN}/lib/i18n
|
|
140 |
doins -r resources/i18n/cache
|
|
141 |
insinto /usr/share/${PN}/lib/help
|
|
142 |
doins resources/help/{cache/jubler-faq.html,jubler-faq.xml,question.png}
|
|
143 |
}
|
65 |
144 |
|
66 |
|
insinto "/usr/share/${PN}/help"
|
67 |
|
doins resources/help/*
|
|
145 |
pkg_postinst() {
|
|
146 |
xdg_icon_cache_update
|
|
147 |
}
|
68 |
148 |
|
69 |
|
doman "resources/installers/linux/${PN}.1"
|
70 |
|
einstalldocs
|
|
149 |
pkg_postrm() {
|
|
150 |
xdg_icon_cache_update
|
71 |
151 |
}
|