1 |
commit: dc51888cc64e6ce07980564274c180ddd0ffd9f6 |
2 |
Author: Ben Kohler <bkohler <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 19 18:33:06 2020 +0000 |
4 |
Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 19 18:33:40 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc51888c |
7 |
|
8 |
media-video/handbrake: add new x265 link patch & tweak DEPEND |
9 |
|
10 |
Closes: https://bugs.gentoo.org/730034 |
11 |
Closes: https://bugs.gentoo.org/730544 |
12 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
13 |
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org> |
14 |
|
15 |
.../files/handbrake-1.3.3-x265-link.patch | 13 ++ |
16 |
media-video/handbrake/handbrake-1.3.3-r1.ebuild | 168 +++++++++++++++++++++ |
17 |
2 files changed, 181 insertions(+) |
18 |
|
19 |
diff --git a/media-video/handbrake/files/handbrake-1.3.3-x265-link.patch b/media-video/handbrake/files/handbrake-1.3.3-x265-link.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..6a1464571ec |
22 |
--- /dev/null |
23 |
+++ b/media-video/handbrake/files/handbrake-1.3.3-x265-link.patch |
24 |
@@ -0,0 +1,13 @@ |
25 |
+--- a/test/module.defs 2020-06-13 15:05:35.000000000 +0100 |
26 |
++++ a/test/module.defs 2020-07-03 11:15:53.951205608 +0100 |
27 |
+@@ -30,6 +30,10 @@ |
28 |
+ endif |
29 |
+ endif |
30 |
+ |
31 |
++ifeq (1,$(FEATURE.x265)) |
32 |
++ TEST.GCC.l += x265 |
33 |
++endif |
34 |
++ |
35 |
+ ifeq (1,$(FEATURE.flatpak)) |
36 |
+ TEST.GCC.l += glib-2.0 |
37 |
+ endif |
38 |
|
39 |
diff --git a/media-video/handbrake/handbrake-1.3.3-r1.ebuild b/media-video/handbrake/handbrake-1.3.3-r1.ebuild |
40 |
new file mode 100644 |
41 |
index 00000000000..2dccc821812 |
42 |
--- /dev/null |
43 |
+++ b/media-video/handbrake/handbrake-1.3.3-r1.ebuild |
44 |
@@ -0,0 +1,168 @@ |
45 |
+# Copyright 1999-2020 Gentoo Authors |
46 |
+# Distributed under the terms of the GNU General Public License v2 |
47 |
+ |
48 |
+EAPI=7 |
49 |
+ |
50 |
+PYTHON_COMPAT=( python3_{6,7,8} ) |
51 |
+ |
52 |
+inherit autotools eutils gnome2-utils python-any-r1 xdg-utils |
53 |
+ |
54 |
+if [[ ${PV} = *9999* ]]; then |
55 |
+ EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git" |
56 |
+ inherit git-r3 |
57 |
+ KEYWORDS="" |
58 |
+else |
59 |
+ MY_P="HandBrake-${PV}" |
60 |
+ SRC_URI="https://github.com/HandBrake/HandBrake/releases/download/${PV}/${MY_P}-source.tar.bz2 -> ${P}.tar.bz2" |
61 |
+ S="${WORKDIR}/${MY_P}" |
62 |
+ KEYWORDS="~amd64 ~x86" |
63 |
+fi |
64 |
+ |
65 |
+DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder" |
66 |
+HOMEPAGE="http://handbrake.fr/" |
67 |
+LICENSE="GPL-2" |
68 |
+ |
69 |
+SLOT="0" |
70 |
+IUSE="+fdk gstreamer gtk libav-aac numa nvenc x265" |
71 |
+ |
72 |
+REQUIRED_USE="^^ ( fdk libav-aac )" |
73 |
+ |
74 |
+RDEPEND=" |
75 |
+ app-arch/xz-utils |
76 |
+ media-libs/speex |
77 |
+ dev-libs/jansson |
78 |
+ dev-libs/libxml2 |
79 |
+ media-libs/a52dec |
80 |
+ media-libs/libass:= |
81 |
+ >=media-libs/libbluray-1.0 |
82 |
+ >=media-libs/dav1d-0.5.1 |
83 |
+ media-libs/libdvdnav |
84 |
+ media-libs/libdvdread:= |
85 |
+ media-libs/libsamplerate |
86 |
+ media-libs/libtheora |
87 |
+ media-libs/libvorbis |
88 |
+ >=media-libs/libvpx-1.8 |
89 |
+ nvenc? ( media-libs/nv-codec-headers ) |
90 |
+ media-libs/opus |
91 |
+ media-libs/x264:= |
92 |
+ media-sound/lame |
93 |
+ sys-libs/zlib |
94 |
+ >=media-video/ffmpeg-4.2.1:0=[postproc,fdk?] |
95 |
+ gstreamer? ( |
96 |
+ media-libs/gstreamer:1.0 |
97 |
+ media-libs/gst-plugins-base:1.0 |
98 |
+ media-libs/gst-plugins-good:1.0 |
99 |
+ media-libs/gst-plugins-bad:1.0 |
100 |
+ media-libs/gst-plugins-ugly:1.0 |
101 |
+ media-plugins/gst-plugins-a52dec:1.0 |
102 |
+ media-plugins/gst-plugins-libav:1.0 |
103 |
+ media-plugins/gst-plugins-x264:1.0 |
104 |
+ media-plugins/gst-plugins-gdkpixbuf:1.0 |
105 |
+ ) |
106 |
+ gtk? ( |
107 |
+ >=x11-libs/gtk+-3.10 |
108 |
+ dev-libs/dbus-glib |
109 |
+ dev-libs/glib:2 |
110 |
+ dev-libs/libgudev:= |
111 |
+ x11-libs/cairo |
112 |
+ x11-libs/gdk-pixbuf:2 |
113 |
+ x11-libs/libnotify |
114 |
+ x11-libs/pango |
115 |
+ ) |
116 |
+ fdk? ( media-libs/fdk-aac ) |
117 |
+ x265? ( >=media-libs/x265-3.2:0=[10bit,12bit,numa?] ) |
118 |
+ " |
119 |
+ |
120 |
+DEPEND="${RDEPEND} |
121 |
+ ${PYTHON_DEPS} |
122 |
+ dev-lang/nasm |
123 |
+ dev-util/cmake |
124 |
+ dev-util/intltool |
125 |
+ dev-util/meson |
126 |
+ sys-devel/automake" |
127 |
+ |
128 |
+PATCHES=( |
129 |
+ # Remove libdvdnav duplication and call it on the original instead. |
130 |
+ # It may work this way; if not, we should try to mimic the duplication. |
131 |
+ "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch" |
132 |
+ |
133 |
+ # Remove faac dependency; TODO: figure out if we need to do this at all. |
134 |
+ "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch" |
135 |
+ |
136 |
+ # Use whichever python is set by portage |
137 |
+ "${FILESDIR}/${PN}-1.3.0-dont-search-for-python.patch" |
138 |
+ |
139 |
+ # Fix x265 linkage... again again #730034 |
140 |
+ "${FILESDIR}/${PN}-1.3.3-x265-link.patch" |
141 |
+) |
142 |
+ |
143 |
+src_prepare() { |
144 |
+ # Get rid of leftover bundled library build definitions, |
145 |
+ sed -i 's:.*\(/contrib\|contrib/\).*::g' \ |
146 |
+ "${S}"/make/include/main.defs \ |
147 |
+ || die "Contrib removal failed." |
148 |
+ |
149 |
+ default |
150 |
+ |
151 |
+ cd "${S}/gtk" |
152 |
+ # Don't run autogen.sh. |
153 |
+ sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed" |
154 |
+ eautoreconf |
155 |
+} |
156 |
+ |
157 |
+src_configure() { |
158 |
+ # Libav was replaced in 1.2 with ffmpeg by default |
159 |
+ # but I've elected to not make people change their use flags for AAC |
160 |
+ # as its the same code anyway |
161 |
+ ./configure \ |
162 |
+ --force \ |
163 |
+ --verbose \ |
164 |
+ --prefix="${EPREFIX}/usr" \ |
165 |
+ --disable-gtk-update-checks \ |
166 |
+ --disable-flatpak \ |
167 |
+ --disable-gtk4 \ |
168 |
+ $(use_enable libav-aac ffmpeg-aac) \ |
169 |
+ $(use_enable fdk fdk-aac) \ |
170 |
+ $(usex !gtk --disable-gtk) \ |
171 |
+ $(usex !gstreamer --disable-gst) \ |
172 |
+ $(use_enable numa) \ |
173 |
+ $(use_enable nvenc) \ |
174 |
+ $(use_enable x265) || die "Configure failed." |
175 |
+} |
176 |
+ |
177 |
+src_compile() { |
178 |
+ emake -C build |
179 |
+ |
180 |
+ # TODO: Documentation building is currently broken, try to fix it. |
181 |
+ # |
182 |
+ # if use doc ; then |
183 |
+ # emake -C build doc |
184 |
+ # fi |
185 |
+} |
186 |
+ |
187 |
+src_install() { |
188 |
+ emake -C build DESTDIR="${D}" install |
189 |
+ |
190 |
+ dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown |
191 |
+} |
192 |
+ |
193 |
+pkg_postinst() { |
194 |
+ einfo "Gentoo builds of HandBrake are NOT SUPPORTED by upstream as they" |
195 |
+ einfo "do not use the bundled (and often patched) upstream libraries." |
196 |
+ einfo "" |
197 |
+ einfo "Please do not raise bugs with upstream because of these ebuilds," |
198 |
+ einfo "report bugs to Gentoo's bugzilla or Multimedia forum instead." |
199 |
+ |
200 |
+ einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`." |
201 |
+ if use gtk ; then |
202 |
+ einfo "For the GTK+ version of HandBrake, you can run \`ghb\`." |
203 |
+ fi |
204 |
+ |
205 |
+ xdg_icon_cache_update |
206 |
+ xdg_desktop_database_update |
207 |
+} |
208 |
+ |
209 |
+pkg_postrm() { |
210 |
+ xdg_icon_cache_update |
211 |
+ xdg_desktop_database_update |
212 |
+} |