summaryrefslogtreecommitdiff
path: root/media-video/handbrake
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-video/handbrake
reinit the tree, so we can have metadata
Diffstat (limited to 'media-video/handbrake')
-rw-r--r--media-video/handbrake/Manifest14
-rw-r--r--media-video/handbrake/files/handbrake-0.10.3-nolibav.patch76
-rw-r--r--media-video/handbrake/files/handbrake-9999-fix-missing-x265-link-flag.patch13
-rw-r--r--media-video/handbrake/files/handbrake-9999-remove-dvdnav-dup.patch20
-rw-r--r--media-video/handbrake/files/handbrake-9999-remove-faac-dependency.patch84
-rw-r--r--media-video/handbrake/handbrake-0.10.5-r2.ebuild155
-rw-r--r--media-video/handbrake/handbrake-1.0.3.ebuild156
-rw-r--r--media-video/handbrake/handbrake-1.0.7.ebuild156
-rw-r--r--media-video/handbrake/handbrake-9999.ebuild156
-rw-r--r--media-video/handbrake/metadata.xml18
10 files changed, 848 insertions, 0 deletions
diff --git a/media-video/handbrake/Manifest b/media-video/handbrake/Manifest
new file mode 100644
index 000000000000..a7d564a3d063
--- /dev/null
+++ b/media-video/handbrake/Manifest
@@ -0,0 +1,14 @@
+AUX handbrake-0.10.3-nolibav.patch 2821 SHA256 5824aca86ed4350d650019575b00c50bfe27a0d08ed1faffa3f1b71a8508dd61 SHA512 88a0b5df6cc198a8383a2d1dcf6d4c71f24445ea71e29dac570a2b3987cdaa0a563b56c7cccd291b58099dbdb15130bdcc0cd4527bdaeb442aefe4fa06455ec7 WHIRLPOOL f67b9138c83df07c044710720ec2457d11df29c2ee185ea50f9c4d6624d652093860e974d79fc9ee52a762f4372b160ef5330a9856a1a7c99c12a171ab929164
+AUX handbrake-9999-fix-missing-x265-link-flag.patch 281 SHA256 05e212e76b6e0b94a04de02cbeb7bf9db607059e19297b5bd3d0d143135285c4 SHA512 30d457258dd287cae3df66e7899b66480be2212a3969fe3a4e4f99ed383740e8f597fa7cf869922f29f501f100313b7efd78ebe09e2949ed4c235e2df22d22e5 WHIRLPOOL f7f599bf25d1522cc6a829d80e0a7ffcde038a7156cecf7358a83b97ff5fb6da8466de5f3a73a986451fded12a2dceed356272579f9d30cbacad0f39ea9f933c
+AUX handbrake-9999-remove-dvdnav-dup.patch 809 SHA256 f4eb9b127eb1adb6ced32eee4aecbfaeb8c13b749429f2f9f039800a6d2f1172 SHA512 e2005155adf29e8253f4313d209b2ccc642fb1d7f63256d3bdf675ddd0e6b0e15bc6bffd98e19aa7dab3907e161e29c5268dc5656590ce9254b12a91ac3ff6b0 WHIRLPOOL 598a972be822d16ed80879eb588482b54d2e0fb95a23be94dab3630e65e1d4b336e3abca07fff7e39bd463e42753c253c664ff71b596b5e1ba880bbf277eaf20
+AUX handbrake-9999-remove-faac-dependency.patch 3697 SHA256 05af966252b8b6e50d3c79c5dc258d8db95574335ca10d31b9f87af9a23b049b SHA512 9d070e50a9b7d4b8ac25b7d56bd341aca6dc979ba506c84f4b95109909f70020723915cd120bed24e84a8fc242ee3c3a5775f43a78b7995e53cd499444c9f6dc WHIRLPOOL 64fe289dbe9128b108e5d00b50f15ca9770c52e7f0fd5a384bdce1d66903ec264222360ffa25038c622c2dfbcbb4676648445da9dc5c39e5c1bf600945da8446
+DIST handbrake-0.10.5.tar.bz2 10452839 SHA256 fb9230dd121b456f6829d1d25ac8bbf76e503b51c4efc70f0a7fd2bb8607e2f0 SHA512 30aa09f5bf2ceb45500f316aa2bc070f630dbe399c9be739f60fd73bbb97d52157498ba7a1e7d024f7fa5b75aa0154976df3c346abda43168c881b1ad0a858ea WHIRLPOOL 190923ade8b28685d9b2ae275ec0806b74235d3644715f90f3993b7d113e3b65c28caa5c839da507913f8a4cf63d0f89f1d2e77fca65e65308b6091003a9f1f9
+DIST handbrake-1.0.3.tar.bz2 12600683 SHA256 591fb489edd6146136f0a92f895c2098365f612ad308d5ff9dc83223ad73ed27 SHA512 2d3dac2e29520f1d51cbca35385f775b5deed823c7cffd6beba0589f124ff99a120bf0db261efae1524c1c2d373789fc0b3e5784664e4aa6eebff372e928b6a2 WHIRLPOOL a16a124a9f2ab8761e2d4494580950f0559e44070829e1115c61b55ecf403fd32ca39be1d3ac2948735361520ee3f6d91919c3cfcff88c37e10f07c454b740c0
+DIST handbrake-1.0.7.tar.bz2 12650549 SHA256 ffdee112f0288f0146b965107956cd718408406b75db71c44d2188f5296e677f SHA512 bacc5ff105893a0fdea95174839663e00027c87a13f00fb67d39c347b55e35869c0b998ec52181389b98cc2cc358d221e41d729e76952e4cb21fe8d12ee5a44a WHIRLPOOL 4243959f8d95885681aa61b5905855586ac773d2a7b4aceff280576f9a900bf601b3ade630bd87b228cc5f682d8b31987c26b453394796c74cc3c387bbe4fb5f
+EBUILD handbrake-0.10.5-r2.ebuild 3479 SHA256 2da39fa41527e6b48fea22b1c3440491429169a4cf391e9cbdd0b0928ee4eebc SHA512 1f5bf9e88bbed89473edcf81013eee4b6ef223ea4fe9fc43ca46aa0b1ce657a122f2f6a020b46d354d36fb4c6044911c36c3c37793f5d2c6feffe89275d3ce52 WHIRLPOOL a12cbe58e3df2eb51493608adfa9953a6a489da0126669250a7300541da87308486757c43296d99790b5a2285f587970a8f5d83940826e3a8dda37c1adb5af76
+EBUILD handbrake-1.0.3.ebuild 3524 SHA256 6f149781c51b59d02bca39f70c8921d5a9a36f4d26e29452062e288c0e93ada4 SHA512 b519a8842dbd5a1420e1b3bd4256b2edbf5b1163c0a2eac90a6386798d86af63cdf18aa519f4244b51042a38a14a10cfae6fbf3211dbd9e1c981f730011dfb99 WHIRLPOOL e2f276612841e66db409934199d188181274b79494088ddac14398b7f71ad94c931439c2d409e612be37a690e74f37dd1520f920fe6d0fca8f61a70e564ddfd6
+EBUILD handbrake-1.0.7.ebuild 3524 SHA256 6f149781c51b59d02bca39f70c8921d5a9a36f4d26e29452062e288c0e93ada4 SHA512 b519a8842dbd5a1420e1b3bd4256b2edbf5b1163c0a2eac90a6386798d86af63cdf18aa519f4244b51042a38a14a10cfae6fbf3211dbd9e1c981f730011dfb99 WHIRLPOOL e2f276612841e66db409934199d188181274b79494088ddac14398b7f71ad94c931439c2d409e612be37a690e74f37dd1520f920fe6d0fca8f61a70e564ddfd6
+EBUILD handbrake-9999.ebuild 3524 SHA256 6f149781c51b59d02bca39f70c8921d5a9a36f4d26e29452062e288c0e93ada4 SHA512 b519a8842dbd5a1420e1b3bd4256b2edbf5b1163c0a2eac90a6386798d86af63cdf18aa519f4244b51042a38a14a10cfae6fbf3211dbd9e1c981f730011dfb99 WHIRLPOOL e2f276612841e66db409934199d188181274b79494088ddac14398b7f71ad94c931439c2d409e612be37a690e74f37dd1520f920fe6d0fca8f61a70e564ddfd6
+MISC ChangeLog 6273 SHA256 719292c02a6fddeb3c9e2dee683264a1ae024f388a84c4c2c04e9ef02b168374 SHA512 827ba2fbc2750bca2c209d6dd58b051902b832fac116385b85bf370369aaf5459d83134c1d713cb414aa011d672e0ce7e036351aa4a62381228ee589eedab5f0 WHIRLPOOL c56e38d05785b4e407b3bfc97d10cc18ec7811c6678ab485113bba790482d9e50afd184f9e061da25e0f4163c8f608e848a18e1df9d5845aeadf40e1eb126a58
+MISC ChangeLog-2015 7744 SHA256 5a5e95fb548a31d8bdbf9991e784efc02c40f053aadcb575d3183e81312a361c SHA512 eb24e6b7844e9aade708790834fb9a0fd6c0495af26f29e7a76f69da99c0b930328df9007fa706bff86891560afd01477df61c586eaea3f3c63afb0189741264 WHIRLPOOL 80b3676f64129795c8e5dc9e886db9062de33e568cc041a957125442f4cb59f977d4eee35834e37b9bb9a7aa2f4a6b70d1611e1f7eaec5df6ad11f8ecab0fb35
+MISC metadata.xml 842 SHA256 eb1bc76107b3a756dc0cb164032c4565b6d6d72360e6bf687942a8fb0474e377 SHA512 d503d78aefd9a994d3197093f97dd3f958fb8347e6eff7598d9d5ef11a5eb17e0088bac4bb676dfa617dd0377ee185e2d0e80fe91feecd53e5257cbf9adc5f0e WHIRLPOOL 148eeeb2b6d5c05747101b3325fd5a00c27550595eae66465ce11ccb2a8f0ec934a2292d19ccd96335b84144c47e022f4a6a1205607f10623b4ebd26c015cad7
diff --git a/media-video/handbrake/files/handbrake-0.10.3-nolibav.patch b/media-video/handbrake/files/handbrake-0.10.3-nolibav.patch
new file mode 100644
index 000000000000..8539186aaa56
--- /dev/null
+++ b/media-video/handbrake/files/handbrake-0.10.3-nolibav.patch
@@ -0,0 +1,76 @@
+From 75549414927212d4d1666730133805b33447de79 Mon Sep 17 00:00:00 2001
+From: John Stebbins <jstebbins.hb@gmail.com>
+Date: Tue, 3 Nov 2015 10:16:01 -0800
+Subject: [PATCH] muxavformat: add support for mp4 fallback audio signalling
+
+---
+diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
+index 0d70597..373c2ab 100644
+--- a/libhb/muxavformat.c
++++ b/libhb/muxavformat.c
+@@ -121,7 +121,7 @@ static int avformatInit( hb_mux_object_t * m )
+ hb_mux_data_t * track;
+ int meta_mux;
+ int max_tracks;
+- int ii, ret;
++ int ii, jj, ret;
+
+ int clock_min, clock_max, clock;
+ hb_video_framerate_get_limits(&clock_min, &clock_max, &clock);
+@@ -589,6 +589,56 @@ static int avformatInit( hb_mux_object_t * m )
+ }
+ }
+
++ // Check for audio track associations
++ for (ii = 0; ii < hb_list_count(job->list_audio); ii++)
++ {
++ audio = hb_list_item(job->list_audio, ii);
++ switch (audio->config.out.codec & HB_ACODEC_MASK)
++ {
++ case HB_ACODEC_FFAAC:
++ case HB_ACODEC_CA_AAC:
++ case HB_ACODEC_CA_HAAC:
++ case HB_ACODEC_FDK_AAC:
++ case HB_ACODEC_FDK_HAAC:
++ break;
++
++ default:
++ {
++ // Mark associated fallback audio tracks for any non-aac track
++ for(jj = 0; jj < hb_list_count( job->list_audio ); jj++ )
++ {
++ hb_audio_t * fallback;
++ int codec;
++
++ if (ii == jj) continue;
++
++ fallback = hb_list_item( job->list_audio, jj );
++ codec = fallback->config.out.codec & HB_ACODEC_MASK;
++ if (fallback->config.in.track == audio->config.in.track &&
++ (codec == HB_ACODEC_FFAAC ||
++ codec == HB_ACODEC_CA_AAC ||
++ codec == HB_ACODEC_CA_HAAC ||
++ codec == HB_ACODEC_FDK_AAC ||
++ codec == HB_ACODEC_FDK_HAAC))
++ {
++ hb_mux_data_t * fallback_track;
++ int * sd;
++
++ track = audio->priv.mux_data;
++ fallback_track = fallback->priv.mux_data;
++ sd = (int*)av_stream_new_side_data(track->st,
++ AV_PKT_DATA_FALLBACK_TRACK,
++ sizeof(int));
++ if (sd != NULL)
++ {
++ *sd = fallback_track->st->index;
++ }
++ }
++ }
++ } break;
++ }
++ }
++
+ char * subidx_fmt =
+ "size: %dx%d\n"
+ "org: %d, %d\n"
diff --git a/media-video/handbrake/files/handbrake-9999-fix-missing-x265-link-flag.patch b/media-video/handbrake/files/handbrake-9999-fix-missing-x265-link-flag.patch
new file mode 100644
index 000000000000..a963fe0af216
--- /dev/null
+++ b/media-video/handbrake/files/handbrake-9999-fix-missing-x265-link-flag.patch
@@ -0,0 +1,13 @@
+Written by: Peter Foley <pefoley2@pefoley.com>
+Gentoo Bug: #552792
+
+--- a/test/module.defs
++++ b/test/module.defs
+@@ -25,6 +25,7 @@
+
+ ifeq (1,$(FEATURE.x265))
+ TEST.GCC.D += USE_X265
++ TEST.GCC.l += x265
+ endif
+
+ TEST.GCC.l += $(foreach m,$(MODULES.NAMES),$($m.OSL.libs))
diff --git a/media-video/handbrake/files/handbrake-9999-remove-dvdnav-dup.patch b/media-video/handbrake/files/handbrake-9999-remove-dvdnav-dup.patch
new file mode 100644
index 000000000000..7dc1f69328ea
--- /dev/null
+++ b/media-video/handbrake/files/handbrake-9999-remove-dvdnav-dup.patch
@@ -0,0 +1,20 @@
+--- a/libhb/dvdnav.c
++++ b/libhb/dvdnav.c
+@@ -1225,16 +1225,7 @@
+ {
+ for (kk = 0; kk < buttons; kk++)
+ {
+- dvdnav_t *dvdnav_copy;
+-
+- result = dvdnav_dup( &dvdnav_copy, d->dvdnav );
+- if (result != DVDNAV_STATUS_OK)
+- {
+- hb_log("dvdnav dup failed: %s", dvdnav_err_to_string(d->dvdnav));
+- goto done;
+- }
+- title = try_button( dvdnav_copy, kk, list_title );
+- dvdnav_free_dup( dvdnav_copy );
++ title = try_button( d->dvdnav, kk, list_title );
+
+ if ( title >= 0 )
+ {
diff --git a/media-video/handbrake/files/handbrake-9999-remove-faac-dependency.patch b/media-video/handbrake/files/handbrake-9999-remove-faac-dependency.patch
new file mode 100644
index 000000000000..7e8ab99730a8
--- /dev/null
+++ b/media-video/handbrake/files/handbrake-9999-remove-faac-dependency.patch
@@ -0,0 +1,84 @@
+--- a/libhb/common.c
++++ b/libhb/common.c
+@@ -243,7 +243,6 @@
+ {
+ // legacy encoders, back to HB 0.9.4 whenever possible (disabled)
+ { { "", "dts", NULL, HB_ACODEC_DCA_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_DTS_PASS, },
+- { { "AAC (faac)", "faac", NULL, 0, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AAC, },
+ { { "AAC (ffmpeg)", "ffaac", NULL, HB_ACODEC_FFAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AAC, },
+ { { "AC3 (ffmpeg)", "ffac3", NULL, HB_ACODEC_AC3, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AC3, },
+ { { "MP3 (lame)", "lame", NULL, HB_ACODEC_LAME, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_MP3, },
+--- a/scripts/manicure.rb
++++ b/scripts/manicure.rb
+@@ -349,7 +349,7 @@
+ audioEncoders << "copy:dtshd"
+ when /AAC Pass/
+ audioEncoders << "copy:aac"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoders << "av_aac"
+ when "AAC (FDK)"
+ audioEncoders << "fdk_aac"
+@@ -466,7 +466,7 @@
+ case hash["AudioEncoderFallback"]
+ when /AC3/
+ audioEncoderFallback << "ac3"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoderFallback << "av_aac"
+ when "AAC (FDK)"
+ audioEncoderFallback << "fdk_aac"
+@@ -753,7 +753,7 @@
+ audioEncoders << "copy:dtshd"
+ when /AAC Pass/
+ audioEncoders << "copy:aac"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoders << "av_aac"
+ when "AAC (FDK)"
+ audioEncoders << "fdk_aac"
+@@ -870,7 +870,7 @@
+ case hash["AudioEncoderFallback"]
+ when /AC3/
+ audioEncoderFallback << "ac3"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoderFallback << "av_aac"
+ when "AAC (FDK)"
+ audioEncoderFallback << "fdk_aac"
+@@ -1163,7 +1163,7 @@
+ audioEncoders << "copy:dtshd"
+ when /AAC Pass/
+ audioEncoders << "copy:aac"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoders << "av_aac"
+ when "AAC (FDK)"
+ audioEncoders << "fdk_aac"
+@@ -1298,7 +1298,7 @@
+ case hash["AudioEncoderFallback"]
+ when /AC3/
+ audioEncoderFallback << "ac3"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoderFallback << "av_aac"
+ when "AAC (FDK)"
+ audioEncoderFallback << "fdk_aac"
+@@ -1615,7 +1615,7 @@
+ audioEncoders << "copy:dtshd"
+ when /AAC Pass/
+ audioEncoders << "copy:aac"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoders << "av_aac"
+ when "AAC (FDK)"
+ audioEncoders << "fdk_aac"
+@@ -1732,7 +1732,7 @@
+ case hash["AudioEncoderFallback"]
+ when /AC3/
+ audioEncoderFallback << "ac3"
+- when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)"
++ when "AAC (ffmpeg)", "AAC (avcodec)"
+ audioEncoderFallback << "av_aac"
+ when "AAC (FDK)"
+ audioEncoderFallback << "fdk_aac"
diff --git a/media-video/handbrake/handbrake-0.10.5-r2.ebuild b/media-video/handbrake/handbrake-0.10.5-r2.ebuild
new file mode 100644
index 000000000000..558ee7f48fc6
--- /dev/null
+++ b/media-video/handbrake/handbrake-0.10.5-r2.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils gnome2-utils python-any-r1
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
+ inherit git-r3
+ KEYWORDS=""
+else
+ MY_P="HandBrake-${PV}"
+ SRC_URI="http://handbrake.fr/rotation.php?file=${MY_P}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}/${MY_P}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
+HOMEPAGE="http://handbrake.fr/"
+LICENSE="GPL-2"
+
+SLOT="0"
+IUSE="+fdk gstreamer gtk libav libav-aac x265"
+
+REQUIRED_USE="^^ ( fdk libav-aac )"
+
+RDEPEND="
+ dev-libs/jansson
+ media-libs/a52dec
+ media-libs/libass:=
+ media-libs/libbluray:=
+ media-libs/libdvdnav
+ media-libs/libdvdread
+ media-libs/libsamplerate
+ media-libs/libtheora
+ media-libs/libvorbis
+ media-libs/libvpx
+ media-libs/x264:=
+ media-sound/lame
+ sys-libs/zlib
+ libav? ( >=media-video/libav-12:0=[fdk?] )
+ !libav? ( >=media-video/ffmpeg-2.3:0=[fdk?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ media-libs/gst-plugins-good:1.0
+ media-libs/gst-plugins-bad:1.0
+ media-libs/gst-plugins-ugly:1.0
+ media-plugins/gst-plugins-a52dec:1.0
+ media-plugins/gst-plugins-libav:1.0
+ media-plugins/gst-plugins-x264:1.0
+ )
+ gtk? (
+ >=x11-libs/gtk+-3.10
+ dev-libs/dbus-glib
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libnotify
+ x11-libs/pango
+ virtual/libgudev:=
+ )
+ fdk? ( media-libs/fdk-aac )
+ x265? ( >=media-libs/x265-1.7:0= )
+ "
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/yasm
+ dev-util/intltool
+ sys-devel/automake"
+
+PATCHES=(
+ # Remove libdvdnav duplication and call it on the original instead.
+ # It may work this way; if not, we should try to mimic the duplication.
+ "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
+
+ # Remove faac dependency; TODO: figure out if we need to do this at all.
+ "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
+
+ # Fix missing x265 link flag
+ "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
+)
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # Get rid of leftover bundled library build definitions,
+ sed -i 's:.*\(/contrib\|contrib/\).*::g' \
+ "${S}"/make/include/main.defs \
+ || die "Contrib removal failed."
+
+ default
+
+ # Get rid of libav specific code when using ffmpeg
+ use libav || eapply -R "${FILESDIR}/${PN}-0.10.3-nolibav.patch"
+
+ cd "${S}/gtk"
+ # Don't run autogen.sh.
+ sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
+ eautoreconf
+}
+
+src_configure() {
+ ./configure \
+ --force \
+ --verbose \
+ --prefix="${EPREFIX}/usr" \
+ --disable-gtk-update-checks \
+ $(use_enable libav-aac) \
+ $(use_enable fdk fdk-aac) \
+ $(use_enable gtk) \
+ $(usex !gstreamer --disable-gst) \
+ $(use_enable x265) || die "Configure failed."
+}
+
+src_compile() {
+ emake -C build
+
+ # TODO: Documentation building is currently broken, try to fix it.
+ #
+ # if use doc ; then
+ # emake -C build doc
+ # fi
+}
+
+src_install() {
+ emake -C build DESTDIR="${D}" install
+
+ dodoc AUTHORS CREDITS NEWS THANKS TRANSLATIONS
+}
+
+pkg_postinst() {
+ einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
+
+ if use gtk ; then
+ einfo ""
+ einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/media-video/handbrake/handbrake-1.0.3.ebuild b/media-video/handbrake/handbrake-1.0.3.ebuild
new file mode 100644
index 000000000000..0ce63641f6e7
--- /dev/null
+++ b/media-video/handbrake/handbrake-1.0.3.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils gnome2-utils python-any-r1
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
+ inherit git-r3
+ KEYWORDS=""
+else
+ MY_P="HandBrake-${PV}"
+ SRC_URI="http://handbrake.fr/rotation.php?file=${MY_P}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}/${MY_P}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
+HOMEPAGE="http://handbrake.fr/"
+LICENSE="GPL-2"
+
+SLOT="0"
+IUSE="+fdk gstreamer gtk libav libav-aac x265"
+
+REQUIRED_USE="^^ ( fdk libav-aac )"
+
+RDEPEND="
+ dev-libs/jansson
+ media-libs/a52dec
+ media-libs/libass:=
+ >=media-libs/libbluray-1.0
+ media-libs/libdvdnav
+ media-libs/libdvdread
+ media-libs/libsamplerate
+ media-libs/libtheora
+ media-libs/libvorbis
+ media-libs/libvpx
+ media-libs/opus
+ media-libs/x264:=
+ media-sound/lame
+ sys-libs/zlib
+ libav? ( >=media-video/libav-10.1:0=[fdk?] )
+ !libav? ( >=media-video/ffmpeg-2.3:0=[fdk?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ media-libs/gst-plugins-good:1.0
+ media-libs/gst-plugins-bad:1.0
+ media-libs/gst-plugins-ugly:1.0
+ media-plugins/gst-plugins-a52dec:1.0
+ media-plugins/gst-plugins-libav:1.0
+ media-plugins/gst-plugins-x264:1.0
+ )
+ gtk? (
+ >=x11-libs/gtk+-3.10
+ dev-libs/dbus-glib
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libnotify
+ x11-libs/pango
+ virtual/libgudev:=
+ )
+ fdk? ( media-libs/fdk-aac )
+ x265? ( >=media-libs/x265-1.7:0= )
+ "
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/yasm
+ dev-util/intltool
+ sys-devel/automake"
+
+PATCHES=(
+ # Remove libdvdnav duplication and call it on the original instead.
+ # It may work this way; if not, we should try to mimic the duplication.
+ "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
+
+ # Remove faac dependency; TODO: figure out if we need to do this at all.
+ "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
+
+ # Fix missing x265 link flag
+ "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
+)
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # Get rid of leftover bundled library build definitions,
+ sed -i 's:.*\(/contrib\|contrib/\).*::g' \
+ "${S}"/make/include/main.defs \
+ || die "Contrib removal failed."
+
+ default
+
+ # Get rid of libav specific code when using ffmpeg
+ use libav || eapply -R "${FILESDIR}/${PN}-0.10.3-nolibav.patch"
+
+ cd "${S}/gtk"
+ # Don't run autogen.sh.
+ sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
+ eautoreconf
+}
+
+src_configure() {
+ ./configure \
+ --force \
+ --verbose \
+ --prefix="${EPREFIX}/usr" \
+ --disable-gtk-update-checks \
+ $(use_enable libav-aac) \
+ $(use_enable fdk fdk-aac) \
+ $(use_enable gtk) \
+ $(usex !gstreamer --disable-gst) \
+ $(use_enable x265) || die "Configure failed."
+}
+
+src_compile() {
+ emake -C build
+
+ # TODO: Documentation building is currently broken, try to fix it.
+ #
+ # if use doc ; then
+ # emake -C build doc
+ # fi
+}
+
+src_install() {
+ emake -C build DESTDIR="${D}" install
+
+ dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
+}
+
+pkg_postinst() {
+ einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
+
+ if use gtk ; then
+ einfo ""
+ einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/media-video/handbrake/handbrake-1.0.7.ebuild b/media-video/handbrake/handbrake-1.0.7.ebuild
new file mode 100644
index 000000000000..0ce63641f6e7
--- /dev/null
+++ b/media-video/handbrake/handbrake-1.0.7.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils gnome2-utils python-any-r1
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
+ inherit git-r3
+ KEYWORDS=""
+else
+ MY_P="HandBrake-${PV}"
+ SRC_URI="http://handbrake.fr/rotation.php?file=${MY_P}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}/${MY_P}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
+HOMEPAGE="http://handbrake.fr/"
+LICENSE="GPL-2"
+
+SLOT="0"
+IUSE="+fdk gstreamer gtk libav libav-aac x265"
+
+REQUIRED_USE="^^ ( fdk libav-aac )"
+
+RDEPEND="
+ dev-libs/jansson
+ media-libs/a52dec
+ media-libs/libass:=
+ >=media-libs/libbluray-1.0
+ media-libs/libdvdnav
+ media-libs/libdvdread
+ media-libs/libsamplerate
+ media-libs/libtheora
+ media-libs/libvorbis
+ media-libs/libvpx
+ media-libs/opus
+ media-libs/x264:=
+ media-sound/lame
+ sys-libs/zlib
+ libav? ( >=media-video/libav-10.1:0=[fdk?] )
+ !libav? ( >=media-video/ffmpeg-2.3:0=[fdk?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ media-libs/gst-plugins-good:1.0
+ media-libs/gst-plugins-bad:1.0
+ media-libs/gst-plugins-ugly:1.0
+ media-plugins/gst-plugins-a52dec:1.0
+ media-plugins/gst-plugins-libav:1.0
+ media-plugins/gst-plugins-x264:1.0
+ )
+ gtk? (
+ >=x11-libs/gtk+-3.10
+ dev-libs/dbus-glib
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libnotify
+ x11-libs/pango
+ virtual/libgudev:=
+ )
+ fdk? ( media-libs/fdk-aac )
+ x265? ( >=media-libs/x265-1.7:0= )
+ "
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/yasm
+ dev-util/intltool
+ sys-devel/automake"
+
+PATCHES=(
+ # Remove libdvdnav duplication and call it on the original instead.
+ # It may work this way; if not, we should try to mimic the duplication.
+ "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
+
+ # Remove faac dependency; TODO: figure out if we need to do this at all.
+ "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
+
+ # Fix missing x265 link flag
+ "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
+)
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # Get rid of leftover bundled library build definitions,
+ sed -i 's:.*\(/contrib\|contrib/\).*::g' \
+ "${S}"/make/include/main.defs \
+ || die "Contrib removal failed."
+
+ default
+
+ # Get rid of libav specific code when using ffmpeg
+ use libav || eapply -R "${FILESDIR}/${PN}-0.10.3-nolibav.patch"
+
+ cd "${S}/gtk"
+ # Don't run autogen.sh.
+ sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
+ eautoreconf
+}
+
+src_configure() {
+ ./configure \
+ --force \
+ --verbose \
+ --prefix="${EPREFIX}/usr" \
+ --disable-gtk-update-checks \
+ $(use_enable libav-aac) \
+ $(use_enable fdk fdk-aac) \
+ $(use_enable gtk) \
+ $(usex !gstreamer --disable-gst) \
+ $(use_enable x265) || die "Configure failed."
+}
+
+src_compile() {
+ emake -C build
+
+ # TODO: Documentation building is currently broken, try to fix it.
+ #
+ # if use doc ; then
+ # emake -C build doc
+ # fi
+}
+
+src_install() {
+ emake -C build DESTDIR="${D}" install
+
+ dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
+}
+
+pkg_postinst() {
+ einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
+
+ if use gtk ; then
+ einfo ""
+ einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/media-video/handbrake/handbrake-9999.ebuild b/media-video/handbrake/handbrake-9999.ebuild
new file mode 100644
index 000000000000..0ce63641f6e7
--- /dev/null
+++ b/media-video/handbrake/handbrake-9999.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils gnome2-utils python-any-r1
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
+ inherit git-r3
+ KEYWORDS=""
+else
+ MY_P="HandBrake-${PV}"
+ SRC_URI="http://handbrake.fr/rotation.php?file=${MY_P}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}/${MY_P}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
+HOMEPAGE="http://handbrake.fr/"
+LICENSE="GPL-2"
+
+SLOT="0"
+IUSE="+fdk gstreamer gtk libav libav-aac x265"
+
+REQUIRED_USE="^^ ( fdk libav-aac )"
+
+RDEPEND="
+ dev-libs/jansson
+ media-libs/a52dec
+ media-libs/libass:=
+ >=media-libs/libbluray-1.0
+ media-libs/libdvdnav
+ media-libs/libdvdread
+ media-libs/libsamplerate
+ media-libs/libtheora
+ media-libs/libvorbis
+ media-libs/libvpx
+ media-libs/opus
+ media-libs/x264:=
+ media-sound/lame
+ sys-libs/zlib
+ libav? ( >=media-video/libav-10.1:0=[fdk?] )
+ !libav? ( >=media-video/ffmpeg-2.3:0=[fdk?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ media-libs/gst-plugins-good:1.0
+ media-libs/gst-plugins-bad:1.0
+ media-libs/gst-plugins-ugly:1.0
+ media-plugins/gst-plugins-a52dec:1.0
+ media-plugins/gst-plugins-libav:1.0
+ media-plugins/gst-plugins-x264:1.0
+ )
+ gtk? (
+ >=x11-libs/gtk+-3.10
+ dev-libs/dbus-glib
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libnotify
+ x11-libs/pango
+ virtual/libgudev:=
+ )
+ fdk? ( media-libs/fdk-aac )
+ x265? ( >=media-libs/x265-1.7:0= )
+ "
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/yasm
+ dev-util/intltool
+ sys-devel/automake"
+
+PATCHES=(
+ # Remove libdvdnav duplication and call it on the original instead.
+ # It may work this way; if not, we should try to mimic the duplication.
+ "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
+
+ # Remove faac dependency; TODO: figure out if we need to do this at all.
+ "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
+
+ # Fix missing x265 link flag
+ "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
+)
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # Get rid of leftover bundled library build definitions,
+ sed -i 's:.*\(/contrib\|contrib/\).*::g' \
+ "${S}"/make/include/main.defs \
+ || die "Contrib removal failed."
+
+ default
+
+ # Get rid of libav specific code when using ffmpeg
+ use libav || eapply -R "${FILESDIR}/${PN}-0.10.3-nolibav.patch"
+
+ cd "${S}/gtk"
+ # Don't run autogen.sh.
+ sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
+ eautoreconf
+}
+
+src_configure() {
+ ./configure \
+ --force \
+ --verbose \
+ --prefix="${EPREFIX}/usr" \
+ --disable-gtk-update-checks \
+ $(use_enable libav-aac) \
+ $(use_enable fdk fdk-aac) \
+ $(use_enable gtk) \
+ $(usex !gstreamer --disable-gst) \
+ $(use_enable x265) || die "Configure failed."
+}
+
+src_compile() {
+ emake -C build
+
+ # TODO: Documentation building is currently broken, try to fix it.
+ #
+ # if use doc ; then
+ # emake -C build doc
+ # fi
+}
+
+src_install() {
+ emake -C build DESTDIR="${D}" install
+
+ dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
+}
+
+pkg_postinst() {
+ einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
+
+ if use gtk ; then
+ einfo ""
+ einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/media-video/handbrake/metadata.xml b/media-video/handbrake/metadata.xml
new file mode 100644
index 000000000000..1c5819c4e49a
--- /dev/null
+++ b/media-video/handbrake/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>thev00d00@gentoo.org</email>
+ <name>Ian Whyman</name>
+ </maintainer>
+ <longdescription>
+ Open-source, GPL-licensed, multiplatform, multithreaded video transcoder.
+ </longdescription>
+ <use>
+ <flag name="gstreamer">Support for the streaming media framework from <pkg>media-libs/gstreamer</pkg>.</flag>
+ <flag name="gtk">Install the GTK UI, ghb.</flag>
+ <flag name="fdk">Support for encoding AAC using <pkg>media-libs/fdk-aac</pkg>.</flag>
+ <flag name="libav-aac">Support for encoding AAC using <pkg>media-video/libav</pkg>'s internal encoder.</flag>
+ <flag name="x265">Support for encoding h265 using <pkg>media-libs/x265</pkg>.</flag>
+ </use>
+</pkgmetadata>