Merge pull request #52453 from Anton-Latukha/handbrake-1.2

handbrake: 1.1.2 -> 1.2.0
This commit is contained in:
Peter Hoeg 2019-01-11 14:10:56 +08:00 committed by GitHub
commit a9632dd470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 53 deletions

View File

@ -1,72 +1,64 @@
# Upstream distributes HandBrake with bundle of according versions of libraries and patches to them. # Upstream distributes HandBrake with bundle of according versions of libraries and patches to them.
# #
# Derivation patches HandBrake to use our closure. # Derivation patches HandBrake to use Nix closure dependencies.
# #
{ stdenv, lib, fetchurl, { stdenv, lib, fetchurl, callPackage,
python2, pkgconfig, yasm, zlib, # Main build tools
autoconf, automake, libtool, m4, jansson, python2, pkgconfig, autoconf, automake, cmake, nasm, libtool, m4,
libass, libiconv, libsamplerate, fribidi, libxml2, bzip2, # Processing, video codecs, containers
libogg, libopus, libtheora, libvorbis, libdvdcss, a52dec, ffmpeg-full, nv-codec-headers, libogg, x264, x265, libvpx, libtheora,
lame, libdvdread, libdvdnav, libbluray, # Codecs, audio
mp4v2, mpeg2dec, x264, x265, libmkv, libopus, lame, libvorbis, a52dec, speex, libsamplerate,
fontconfig, freetype, hicolor-icon-theme, # Text processing
glib, gtk3, intltool, libnotify, libiconv, fribidi, fontconfig, freetype, libass, jansson, libxml2,
gst_all_1, dbus-glib, udev, libgudev, libvpx, # Optical media
useGtk ? true, wrapGAppsHook ? null, libappindicator-gtk3 ? null, libdvdread, libdvdnav, libdvdcss, libbluray,
useFfmpeg ? false, libav_12 ? null, ffmpeg ? null, useGtk ? true, wrapGAppsHook ? null,
intltool ? null,
glib ? null,
gtk3 ? null,
libappindicator-gtk3 ? null,
libnotify ? null,
gst_all_1 ? null,
dbus-glib ? null,
udev ? null,
libgudev ? null,
hicolor-icon-theme ? null,
useFdk ? false, fdk_aac ? null useFdk ? false, fdk_aac ? null
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
# TODO: Release 1.2.0 would switch LibAV to FFmpeg. version = "1.2.0";
version = "1.1.2";
name = "handbrake-${version}"; name = "handbrake-${version}";
src = fetchurl { src = fetchurl {
url = ''https://download2.handbrake.fr/${version}/HandBrake-${version}-source.tar.bz2''; url = ''https://download2.handbrake.fr/${version}/HandBrake-${version}-source.tar.bz2'';
sha256 = "0bny0hwlr55g2c69rsamv0xvwmfh1s4a582b9vq20xv5ly84m6ms"; sha256 = "03clkknaq3mz84p85cvr21gsy9b8vv2g4vvyfz44hz8la253jfqi";
}; };
patched_libav_12 = libav_12.overrideAttrs (super: {
patches = (super.patches or []) ++ [(
# NOTE: 2018-04-26: HandBrake compilation (1.1.0) requires
# a patch of LibAV (12.3) from HandBrake team. This patch
# not went LibAV upstream.
fetchurl {
url = ''https://raw.githubusercontent.com/HandBrake/HandBrake/9e1f245708a157231c427c0ef9b91729d59a30e1/contrib/ffmpeg/A21-mp4-sdtp.patch'';
sha256 = "14grzyvb1qbb90k31ibabnwmwnrc48ml6h2z0rjamdv83q45jq4g";
})
# NOTE: 2018-11-11: Transcoding to MP4 can fail with:
#
# Tag avc1/0x31637661 incompatible with output codec id '28'
# muxavformat: avformat_write_header failed!
#
# Fix using Handbrake patch that is not upstream in libav.
(
fetchurl {
url = ''https://raw.githubusercontent.com/HandBrake/HandBrake/df6c26fa261423237ee2bec0bf784c32cbfda3fa/contrib/ffmpeg/A20-avc3-hvc1-override.patch'';
sha256 = "1vijd7bmkzp3sb6zhpcpdni8fz4h13wgglnml6cz9f44j41w2c3v";
})
];
});
nativeBuildInputs = [ nativeBuildInputs = [
python2 pkgconfig yasm autoconf automake libtool m4 python2 pkgconfig autoconf automake cmake nasm libtool m4
] ++ lib.optionals useGtk [ intltool wrapGAppsHook ]; ] ++ lib.optionals useGtk [ intltool wrapGAppsHook ];
buildInputs = [ buildInputs = [
fribidi fontconfig freetype jansson zlib ffmpeg-full libogg libtheora x264 x265 libvpx
libass libiconv libsamplerate libxml2 bzip2 libopus lame libvorbis a52dec speex libsamplerate
libogg libopus libtheora libvorbis libdvdcss a52dec libmkv libiconv fribidi fontconfig freetype libass jansson libxml2
lame libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264 x265 libvpx libdvdread libdvdnav libdvdcss libbluray
] ++ lib.optionals useGtk [ ] ++ lib.optionals useGtk [
glib gtk3 libappindicator-gtk3 libnotify glib gtk3 libappindicator-gtk3 libnotify
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
libgudev hicolor-icon-theme libgudev hicolor-icon-theme
] ++ (if useFfmpeg then [ ffmpeg ] else [ patched_libav_12 ]) ] ++ lib.optional useFdk fdk_aac
++ lib.optional useFdk fdk_aac; # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only,
# look at ./make/configure.py search "enable_nvenc"
++ lib.optional stdenv.isLinux nv-codec-headers;
# NOTE: 2018-12-25: v1.2.0 now requires cmake dep
# (default distribution bundles&builds 3rd party libs),
# don't trigger cmake build
dontUseCmakeConfigure = true;
enableParallelBuilding = true; enableParallelBuilding = true;
preConfigure = '' preConfigure = ''
@ -87,6 +79,7 @@ stdenv.mkDerivation rec {
(if useFdk then "--enable-fdk-aac" else "") (if useFdk then "--enable-fdk-aac" else "")
]; ];
# NOTE: 2018-12-27: Check NixOS HandBrake test if changing
NIX_LDFLAGS = [ NIX_LDFLAGS = [
"-lx265" "-lx265"
]; ];

View File

@ -96,7 +96,7 @@
, libxcbshapeExtlib ? true # X11 grabbing shape rendering , libxcbshapeExtlib ? true # X11 grabbing shape rendering
, libXv ? null # Xlib support , libXv ? null # Xlib support
, lzma ? null # xz-utils , lzma ? null # xz-utils
, nvenc ? false, nvidia-video-sdk ? null # NVIDIA NVENC support , nvenc ? false, nvidia-video-sdk ? null, nv-codec-headers ? null # NVIDIA NVENC support
, callPackage # needed for NVENC to access external ffmpeg nvidia headers , callPackage # needed for NVENC to access external ffmpeg nvidia headers
, openal ? null # OpenAL 1.1 capture support , openal ? null # OpenAL 1.1 capture support
#, opencl ? null # OpenCL code #, opencl ? null # OpenCL code
@ -176,8 +176,6 @@
let let
inherit (stdenv) isCygwin isFreeBSD isLinux; inherit (stdenv) isCygwin isFreeBSD isLinux;
inherit (stdenv.lib) optional optionals optionalString enableFeature; inherit (stdenv.lib) optional optionals optionalString enableFeature;
nv-codec-headers = callPackage ./nv-codec-headers.nix { };
in in
/* /*

View File

@ -2,18 +2,18 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "nv-codec-headers-${version}"; name = "nv-codec-headers-${version}";
version = "n8.1.24.2"; version = "8.2.15.6";
src = fetchgit { src = fetchgit {
url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git"; url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git";
rev = "${version}"; rev = "n${version}";
sha256 = "122i3f6whiz5yp44dhk73ifr1973z8vvfbg4216vb782bl8b5bam"; sha256 = "0216ww8byjxz639kagyw0mr9vxxwj89xdnj448d579vjr54jychv";
}; };
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
meta = { meta = {
description = "ffmpeg nvidia headers for NVENC"; description = "FFmpeg version of headers for NVENC";
homepage = http://ffmpeg.org/; homepage = http://ffmpeg.org/;
license = stdenv.lib.licenses.gpl3Plus; license = stdenv.lib.licenses.gpl3Plus;
maintainers = [ stdenv.lib.maintainers.MP2E ]; maintainers = [ stdenv.lib.maintainers.MP2E ];

View File

@ -11817,6 +11817,8 @@ in
ntrack = callPackage ../development/libraries/ntrack { }; ntrack = callPackage ../development/libraries/ntrack { };
nv-codec-headers = callPackage ../development/libraries/nv-codec-headers { };
nvidia-texture-tools = callPackage ../development/libraries/nvidia-texture-tools { }; nvidia-texture-tools = callPackage ../development/libraries/nvidia-texture-tools { };
nvidia-video-sdk = callPackage ../development/libraries/nvidia-video-sdk { }; nvidia-video-sdk = callPackage ../development/libraries/nvidia-video-sdk { };