handbrake: 0.10.5 -> 1.0.3

This commit is contained in:
Peter Hoeg 2017-03-18 16:44:45 +08:00
parent b9173e4e8c
commit f4f29bcd8b
2 changed files with 50 additions and 47 deletions

View File

@ -8,64 +8,71 @@
# making licenses more clear and reducing compile time/install size. # making licenses more clear and reducing compile time/install size.
# #
# Only tested on Linux # Only tested on Linux
#
# TODO: package and use libappindicator
{ stdenv, config, fetchurl, { stdenv, lib, fetchFromGitHub,
python2, pkgconfig, yasm, python2, pkgconfig, yasm, harfbuzz, zlib,
autoconf, automake, libtool, m4, autoconf, automake, cmake, libtool, m4, jansson,
libass, libsamplerate, fribidi, libxml2, bzip2, libass, libiconv, libsamplerate, fribidi, libxml2, bzip2,
libogg, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac, libogg, libopus, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
lame, ffmpeg, libdvdread, libdvdnav, libbluray, lame, ffmpeg, libdvdread, libdvdnav, libbluray,
mp4v2, mpeg2dec, x264, x265, libmkv, mp4v2, mpeg2dec, x264, x265, libmkv,
fontconfig, freetype, hicolor_icon_theme, fontconfig, freetype, hicolor_icon_theme,
glib, gtk3, intltool, libnotify, glib, gtk3, intltool, libnotify,
gst_all_1, dbus_glib, udev, libgudev, libvpx, gst_all_1, dbus_glib, udev, libgudev, libvpx,
wrapGAppsHook, useGtk ? true, wrapGAppsHook ? null, libappindicator-gtk3 ? null
useGtk ? true
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.10.5"; version = "1.0.3";
name = "handbrake-${version}"; name = "handbrake-${version}";
buildInputsX = stdenv.lib.optionals useGtk [ src = fetchFromGitHub {
glib gtk3 intltool libnotify owner = "HandBrake";
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev repo = "HandBrake";
libgudev rev = "${version}";
wrapGAppsHook sha256 = "1r8yzs0xih03p5ybx5096zkvlwxhcmg34047awmda1wq3z3rdjh5";
];
nativeBuildInputs = [ python2 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 x265 libvpx
] ++ buildInputsX;
src = fetchurl {
url = "http://download.handbrake.fr/releases/${version}/HandBrake-${version}.tar.bz2";
sha256 = "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv";
}; };
nativeBuildInputs = [
cmake python2 pkgconfig yasm autoconf automake libtool m4
] ++ (lib.optionals useGtk [
intltool wrapGAppsHook
]);
buildInputs = [
fribidi fontconfig freetype jansson zlib
libass libiconv libsamplerate libxml2 bzip2
libogg libopus libtheora libvorbis libdvdcss a52dec libmkv fdk_aac
lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264 x265 libvpx
] ++ (lib.optionals useGtk [
glib gtk3 libappindicator-gtk3 libnotify
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
libgudev
]);
dontUseCmakeConfigure = true;
preConfigure = '' preConfigure = ''
# Fake wget to prevent downloads patchShebangs scripts
mkdir wget
echo "#!/bin/sh" > wget/wget echo 'TAG=${version}' > version.txt
echo "echo ===== Not fetching \$*" >> wget/wget
echo "exit 1" >> wget/wget # `configure` errors out when trying to read the current year which is too low
chmod +x wget/wget substituteInPlace make/configure.py \
export PATH=$PATH:$PWD/wget --replace developer release \
--replace 'repo.date.strftime("%Y-%m-%d %H:%M:%S")' '""'
substituteInPlace libhb/module.defs \
--replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
# Force using nixpkgs dependencies # Force using nixpkgs dependencies
sed -i '/MODULES += contrib/d' make/include/main.defs sed -i '/MODULES += contrib/d' make/include/main.defs
sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules
patch -p1 -R < ${./handbrake-0.10.3-nolibav.patch}
''; '';
configureFlags = [ configureFlags = [
"--disable-df-fetch"
"--disable-df-verify"
"--enable-fdk-aac" "--enable-fdk-aac"
(if useGtk then "--disable-gtk-update-checks" else "--disable-gtk") (if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
]; ];
@ -74,21 +81,16 @@ stdenv.mkDerivation rec {
cd build cd build
''; '';
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ x265 ]; meta = with stdenv.lib; {
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}")
'';
meta = {
homepage = http://handbrake.fr/; homepage = http://handbrake.fr/;
description = "A tool for ripping DVDs into video files"; description = "A tool for ripping DVDs into video files";
longDescription = '' longDescription = ''
Handbrake is a versatile transcoding DVD ripper. This package Handbrake is a versatile transcoding DVD ripper. This package
provides the cli HandbrakeCLI and the GTK+ version ghb. provides the cli HandbrakeCLI and the GTK+ version ghb.
''; '';
license = stdenv.lib.licenses.gpl2; license = licenses.gpl2;
maintainers = [ stdenv.lib.maintainers.wmertens ]; maintainers = with maintainers; [ wmertens ];
# Not tested on anything else # Not tested on anything else
platforms = stdenv.lib.platforms.linux; platforms = platforms.linux;
}; };
} }

View File

@ -14397,7 +14397,8 @@ with pkgs;
lxdvdrip = callPackage ../applications/video/lxdvdrip { }; lxdvdrip = callPackage ../applications/video/lxdvdrip { };
handbrake = callPackage ../applications/video/handbrake { handbrake = callPackage ../applications/video/handbrake {
ffmpeg = ffmpeg_2; # TODO: remove when 3.2 becomes default
ffmpeg = ffmpeg_3_2;
}; };
lilyterm = callPackage ../applications/misc/lilyterm { lilyterm = callPackage ../applications/misc/lilyterm {