mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
handbrake: 0.9.9 -> 0.10.5
This commit is contained in:
parent
7a073c1c6d
commit
6a11b11a7d
@ -7,8 +7,6 @@
|
||||
# This has the benefits of providing improvements to other packages,
|
||||
# making licenses more clear and reducing compile time/install size.
|
||||
#
|
||||
# For compliance, the unfree codec faac is optionally spliced out.
|
||||
#
|
||||
# Only tested on Linux
|
||||
#
|
||||
# TODO: package and use libappindicator
|
||||
@ -18,47 +16,40 @@
|
||||
autoconf, automake, libtool, m4,
|
||||
libass, libsamplerate, fribidi, libxml2, bzip2,
|
||||
libogg, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
|
||||
lame, faac, ffmpeg, libdvdread, libdvdnav, libbluray,
|
||||
mp4v2, mpeg2dec, x264, libmkv,
|
||||
lame, ffmpeg, libdvdread, libdvdnav, libbluray,
|
||||
mp4v2, mpeg2dec, x264, x265, libmkv,
|
||||
fontconfig, freetype, hicolor_icon_theme,
|
||||
glib, gtk, webkitgtk, intltool, libnotify,
|
||||
gst_all_1, dbus_glib, udev, libgudev,
|
||||
useGtk ? true,
|
||||
useWebKitGtk ? false # This prevents ghb from starting in my tests
|
||||
glib, gtk3, intltool, libnotify,
|
||||
gst_all_1, dbus_glib, udev, libgudev, libvpx,
|
||||
wrapGAppsHook,
|
||||
useGtk ? true
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.9.9";
|
||||
version = "0.10.5";
|
||||
name = "handbrake-${version}";
|
||||
|
||||
# ToDo: doesn't work (yet)
|
||||
allowUnfree = false; # config.allowUnfree or false;
|
||||
|
||||
buildInputsX = stdenv.lib.optionals useGtk [
|
||||
glib gtk intltool libnotify
|
||||
glib gtk3 intltool libnotify
|
||||
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
|
||||
libgudev
|
||||
] ++ stdenv.lib.optionals useWebKitGtk [ webkitgtk ];
|
||||
|
||||
# Did not test compiling with it
|
||||
unfreeInputs = stdenv.lib.optional allowUnfree faac;
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ python pkgconfig yasm autoconf automake libtool m4 ];
|
||||
buildInputs = [
|
||||
fribidi fontconfig freetype hicolor_icon_theme
|
||||
libass libsamplerate libxml2 bzip2
|
||||
libogg libtheora libvorbis libdvdcss a52dec libmkv fdk_aac
|
||||
lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264
|
||||
] ++ buildInputsX ++ unfreeInputs;
|
||||
lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264 x265 libvpx
|
||||
] ++ buildInputsX;
|
||||
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.handbrake.fr/releases/${version}/HandBrake-${version}.tar.bz2";
|
||||
sha256 = "1crmm1c32vx60jfl2bqzg59q4qqx6m83b08snp7h1njc21sdf7d7";
|
||||
sha256 = "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv";
|
||||
};
|
||||
|
||||
patches = stdenv.lib.optional (! allowUnfree) ./disable-unfree.patch;
|
||||
|
||||
preConfigure = ''
|
||||
# Fake wget to prevent downloads
|
||||
mkdir wget
|
||||
@ -72,13 +63,13 @@ stdenv.mkDerivation rec {
|
||||
sed -i '/MODULES += contrib/d' make/include/main.defs
|
||||
sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules
|
||||
|
||||
# disable faac if non-free
|
||||
if [ -z "$allowUnfree" ]; then
|
||||
rm libhb/encfaac.c
|
||||
fi
|
||||
patch -p1 -R < ${./handbrake-0.10.3-nolibav.patch}
|
||||
'';
|
||||
|
||||
configureFlags = "--enable-fdk-aac ${if useGtk then "--disable-gtk-update-checks" else "--disable-gtk"}";
|
||||
configureFlags = [
|
||||
"--enable-fdk-aac"
|
||||
(if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
cd build
|
||||
@ -90,7 +81,6 @@ stdenv.mkDerivation rec {
|
||||
longDescription = ''
|
||||
Handbrake is a versatile transcoding DVD ripper. This package
|
||||
provides the cli HandbrakeCLI and the GTK+ version ghb.
|
||||
The faac library is disabled if you're compiling free-only.
|
||||
'';
|
||||
license = stdenv.lib.licenses.gpl2;
|
||||
maintainers = [ stdenv.lib.maintainers.wmertens ];
|
||||
|
@ -1,101 +0,0 @@
|
||||
diff -ru HandBrake-0.9.9-orig/gtk/configure.ac HandBrake-0.9.9/gtk/configure.ac
|
||||
--- HandBrake-0.9.9-orig/gtk/configure.ac 2014-05-02 22:50:00.047305795 +0200
|
||||
+++ HandBrake-0.9.9/gtk/configure.ac 2014-05-02 22:48:57.119304020 +0200
|
||||
@@ -203,7 +203,7 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
-HB_LIBS="-lhb -la52 -lmkv -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lfaac -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lmp4v2 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2"
|
||||
+HB_LIBS="-lhb -la52 -lmkv -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lmp4v2 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2"
|
||||
|
||||
if test "x$use_fdk_aac" = "xyes" ; then
|
||||
HB_LIBS+=" -lfdk-aac"
|
||||
diff -ru HandBrake-0.9.9-orig/gtk/src/preset_xlat.c HandBrake-0.9.9/gtk/src/preset_xlat.c
|
||||
--- HandBrake-0.9.9-orig/gtk/src/preset_xlat.c 2014-05-02 22:50:00.043305794 +0200
|
||||
+++ HandBrake-0.9.9/gtk/src/preset_xlat.c 2014-05-02 22:42:20.987292846 +0200
|
||||
@@ -260,7 +260,6 @@
|
||||
|
||||
static value_map_t acodec_xlat[] =
|
||||
{
|
||||
- {"AAC (faac)", "faac"},
|
||||
{"AC3 Passthru", "ac3"},
|
||||
{"MP3 (lame)", "lame"},
|
||||
{"Vorbis (vorbis)", "vorbis"},
|
||||
diff -ru HandBrake-0.9.9-orig/gtk/src/presets.c HandBrake-0.9.9/gtk/src/presets.c
|
||||
--- HandBrake-0.9.9-orig/gtk/src/presets.c 2014-05-02 22:50:00.043305794 +0200
|
||||
+++ HandBrake-0.9.9/gtk/src/presets.c 2014-05-02 22:42:41.283293419 +0200
|
||||
@@ -2029,8 +2029,6 @@
|
||||
|
||||
static value_map_t acodec_xlat_compat[] =
|
||||
{
|
||||
- {"AAC (CoreAudio)", "faac"},
|
||||
- {"HE-AAC (CoreAudio)", "faac"},
|
||||
{"AC3 (ffmpeg)", "ac3"},
|
||||
{"AC3", "ac3"},
|
||||
{"MP3 Passthru", "mp3pass"},
|
||||
diff -ru HandBrake-0.9.9-orig/libhb/common.c HandBrake-0.9.9/libhb/common.c
|
||||
--- HandBrake-0.9.9-orig/libhb/common.c 2014-05-02 22:50:00.047305795 +0200
|
||||
+++ HandBrake-0.9.9/libhb/common.c 2014-05-02 22:37:24.679284489 +0200
|
||||
@@ -126,7 +126,6 @@
|
||||
{ "AAC (CoreAudio)", "ca_aac", HB_ACODEC_CA_AAC, HB_MUX_MP4|HB_MUX_MKV },
|
||||
{ "HE-AAC (CoreAudio)", "ca_haac", HB_ACODEC_CA_HAAC, HB_MUX_MP4|HB_MUX_MKV },
|
||||
#endif
|
||||
- { "AAC (faac)", "faac", HB_ACODEC_FAAC, HB_MUX_MP4|HB_MUX_MKV },
|
||||
#ifdef USE_FDK_AAC
|
||||
{ "AAC (FDK)", "fdk_aac", HB_ACODEC_FDK_AAC, HB_MUX_MP4|HB_MUX_MKV },
|
||||
{ "HE-AAC (FDK)", "fdk_haac", HB_ACODEC_FDK_HAAC, HB_MUX_MP4|HB_MUX_MKV },
|
||||
diff -ru HandBrake-0.9.9-orig/libhb/common.h HandBrake-0.9.9/libhb/common.h
|
||||
--- HandBrake-0.9.9-orig/libhb/common.h 2014-05-02 22:50:00.047305795 +0200
|
||||
+++ HandBrake-0.9.9/libhb/common.h 2014-05-02 22:39:37.839288245 +0200
|
||||
@@ -945,7 +945,6 @@
|
||||
extern hb_work_object_t hb_decavcodeca;
|
||||
extern hb_work_object_t hb_decavcodecv;
|
||||
extern hb_work_object_t hb_declpcm;
|
||||
-extern hb_work_object_t hb_encfaac;
|
||||
extern hb_work_object_t hb_enclame;
|
||||
extern hb_work_object_t hb_encvorbis;
|
||||
extern hb_work_object_t hb_muxer;
|
||||
diff -ru HandBrake-0.9.9-orig/libhb/hb.c HandBrake-0.9.9/libhb/hb.c
|
||||
--- HandBrake-0.9.9-orig/libhb/hb.c 2014-05-02 22:50:00.047305795 +0200
|
||||
+++ HandBrake-0.9.9/libhb/hb.c 2014-05-02 22:39:02.287287242 +0200
|
||||
@@ -487,7 +487,6 @@
|
||||
hb_register( &hb_decavcodeca );
|
||||
hb_register( &hb_decavcodecv );
|
||||
hb_register( &hb_declpcm );
|
||||
- hb_register( &hb_encfaac );
|
||||
hb_register( &hb_enclame );
|
||||
hb_register( &hb_encvorbis );
|
||||
hb_register( &hb_muxer );
|
||||
@@ -588,7 +587,6 @@
|
||||
hb_register( &hb_decavcodeca );
|
||||
hb_register( &hb_decavcodecv );
|
||||
hb_register( &hb_declpcm );
|
||||
- hb_register( &hb_encfaac );
|
||||
hb_register( &hb_enclame );
|
||||
hb_register( &hb_encvorbis );
|
||||
hb_register( &hb_muxer );
|
||||
diff -ru HandBrake-0.9.9-orig/libhb/module.defs HandBrake-0.9.9/libhb/module.defs
|
||||
--- HandBrake-0.9.9-orig/libhb/module.defs 2014-05-02 22:50:00.047305795 +0200
|
||||
+++ HandBrake-0.9.9/libhb/module.defs 2014-05-02 22:39:25.727287903 +0200
|
||||
@@ -95,7 +95,7 @@
|
||||
LIBHB.lib = $(LIBHB.build/)hb.lib
|
||||
|
||||
LIBHB.dll.libs = $(foreach n, \
|
||||
- a52 ass avcodec avformat avutil avresample dvdnav dvdread faac \
|
||||
+ a52 ass avcodec avformat avutil avresample dvdnav dvdread \
|
||||
fontconfig freetype mkv mpeg2 mp3lame mp4v2 \
|
||||
ogg samplerate swscale theora vorbis vorbisenc x264 xml2 bluray, \
|
||||
$(CONTRIB.build/)lib/lib$(n).a )
|
||||
Only in HandBrake-0.9.9: libhb-orig
|
||||
diff -ru HandBrake-0.9.9orig/test/module.defs HandBrake-0.9.9/test/module.defs
|
||||
--- HandBrake-0.9.9-orig/test/module.defs 2014-05-02 23:15:10.575348401 +0200
|
||||
+++ HandBrake-0.9.9/test/module.defs 2014-05-02 23:17:00.523351502 +0200
|
||||
@@ -14,7 +14,7 @@
|
||||
TEST.libs = $(LIBHB.a)
|
||||
|
||||
TEST.GCC.l = \
|
||||
- a52 ass avcodec avformat avutil avresample dvdnav dvdread faac \
|
||||
+ a52 ass avcodec avformat avutil avresample dvdnav dvdread \
|
||||
fontconfig freetype fribidi mkv mpeg2 mp3lame mp4v2 ogg \
|
||||
samplerate swscale theoraenc theoradec vorbis vorbisenc x264 \
|
||||
bluray xml2 bz2 z
|
@ -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"
|
@ -13855,7 +13855,6 @@ in
|
||||
lxdvdrip = callPackage ../applications/video/lxdvdrip { };
|
||||
|
||||
handbrake = callPackage ../applications/video/handbrake {
|
||||
webkitgtk = webkitgtk24x;
|
||||
ffmpeg = ffmpeg_2;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user