2014-05-04 01:55:36 +02:00
|
|
|
# Handbrake normally uses its own copies of the libraries it uses, for better
|
|
|
|
# control over library patches.
|
|
|
|
#
|
|
|
|
# This derivation patches HB so it doesn't do that. The relevant patches
|
|
|
|
# are added to the Nix packages and proposed upstream instead. In several cases
|
|
|
|
# upstream already incorporated these patches.
|
|
|
|
# This has the benefits of providing improvements to other packages,
|
|
|
|
# making licenses more clear and reducing compile time/install size.
|
|
|
|
#
|
|
|
|
# Only tested on Linux
|
|
|
|
#
|
|
|
|
# TODO: package and use libappindicator
|
|
|
|
|
|
|
|
{ stdenv, config, fetchurl,
|
2016-10-18 17:22:15 +02:00
|
|
|
python2, pkgconfig, yasm,
|
2014-05-04 01:55:36 +02:00
|
|
|
autoconf, automake, libtool, m4,
|
|
|
|
libass, libsamplerate, fribidi, libxml2, bzip2,
|
|
|
|
libogg, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
|
2016-08-29 08:03:41 +02:00
|
|
|
lame, ffmpeg, libdvdread, libdvdnav, libbluray,
|
|
|
|
mp4v2, mpeg2dec, x264, x265, libmkv,
|
2016-07-09 13:06:14 +02:00
|
|
|
fontconfig, freetype, hicolor_icon_theme,
|
2016-08-29 08:03:41 +02:00
|
|
|
glib, gtk3, intltool, libnotify,
|
|
|
|
gst_all_1, dbus_glib, udev, libgudev, libvpx,
|
|
|
|
wrapGAppsHook,
|
|
|
|
useGtk ? true
|
2014-05-04 01:55:36 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-08-29 08:03:41 +02:00
|
|
|
version = "0.10.5";
|
2014-05-04 01:55:36 +02:00
|
|
|
name = "handbrake-${version}";
|
|
|
|
|
|
|
|
buildInputsX = stdenv.lib.optionals useGtk [
|
2016-08-29 08:03:41 +02:00
|
|
|
glib gtk3 intltool libnotify
|
2014-05-04 01:55:36 +02:00
|
|
|
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
|
2015-12-08 16:48:30 +01:00
|
|
|
libgudev
|
2016-08-29 08:03:41 +02:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2014-05-04 01:55:36 +02:00
|
|
|
|
2016-10-18 17:22:15 +02:00
|
|
|
nativeBuildInputs = [ python2 pkgconfig yasm autoconf automake libtool m4 ];
|
2014-05-04 01:55:36 +02:00
|
|
|
buildInputs = [
|
2016-07-09 13:06:14 +02:00
|
|
|
fribidi fontconfig freetype hicolor_icon_theme
|
2014-05-04 01:55:36 +02:00
|
|
|
libass libsamplerate libxml2 bzip2
|
|
|
|
libogg libtheora libvorbis libdvdcss a52dec libmkv fdk_aac
|
2016-08-29 08:03:41 +02:00
|
|
|
lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264 x265 libvpx
|
|
|
|
] ++ buildInputsX;
|
2014-05-04 01:55:36 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-01-01 10:07:35 +01:00
|
|
|
url = "http://download.handbrake.fr/releases/${version}/HandBrake-${version}.tar.bz2";
|
2016-08-29 08:03:41 +02:00
|
|
|
sha256 = "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv";
|
2014-05-04 01:55:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# Fake wget to prevent downloads
|
|
|
|
mkdir wget
|
|
|
|
echo "#!/bin/sh" > wget/wget
|
|
|
|
echo "echo ===== Not fetching \$*" >> wget/wget
|
|
|
|
echo "exit 1" >> wget/wget
|
|
|
|
chmod +x wget/wget
|
|
|
|
export PATH=$PATH:$PWD/wget
|
|
|
|
|
|
|
|
# Force using nixpkgs dependencies
|
|
|
|
sed -i '/MODULES += contrib/d' make/include/main.defs
|
|
|
|
sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules
|
|
|
|
|
2016-08-29 08:03:41 +02:00
|
|
|
patch -p1 -R < ${./handbrake-0.10.3-nolibav.patch}
|
2014-05-04 01:55:36 +02:00
|
|
|
'';
|
|
|
|
|
2016-08-29 08:03:41 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-fdk-aac"
|
|
|
|
(if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
|
|
|
|
];
|
2014-05-04 01:55:36 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
2016-10-09 18:17:09 +02:00
|
|
|
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ x265 ];
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}")
|
|
|
|
'';
|
|
|
|
|
2014-05-04 01:55:36 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://handbrake.fr/;
|
|
|
|
description = "A tool for ripping DVDs into video files";
|
|
|
|
longDescription = ''
|
|
|
|
Handbrake is a versatile transcoding DVD ripper. This package
|
|
|
|
provides the cli HandbrakeCLI and the GTK+ version ghb.
|
|
|
|
'';
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.wmertens ];
|
|
|
|
# Not tested on anything else
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|