summary refs log tree commit diff
path: root/pkgs/applications/video/handbrake/default.nix
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-03-18 16:44:45 +0800
committerPeter Hoeg <peter@hoeg.com>2017-03-19 09:48:22 +0800
commitf4f29bcd8b12308f6348dcb8cd452228d55a78b4 (patch)
tree6114f4af482b3220266f3fd5e166d4fc59c5e10f /pkgs/applications/video/handbrake/default.nix
parentb9173e4e8cc9f15bec3a3588c7f16fc145cf0f4e (diff)
downloadnixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar.gz
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar.bz2
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar.lz
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar.xz
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.tar.zst
nixpkgs-f4f29bcd8b12308f6348dcb8cd452228d55a78b4.zip
handbrake: 0.10.5 -> 1.0.3
Diffstat (limited to 'pkgs/applications/video/handbrake/default.nix')
-rw-r--r--pkgs/applications/video/handbrake/default.nix88
1 files changed, 45 insertions, 43 deletions
diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix
index b8a16164988..31d69536e52 100644
--- a/pkgs/applications/video/handbrake/default.nix
+++ b/pkgs/applications/video/handbrake/default.nix
@@ -8,64 +8,71 @@
 # making licenses more clear and reducing compile time/install size.
 #
 # Only tested on Linux
-#
-# TODO: package and use libappindicator
 
-{ stdenv, config, fetchurl,
-  python2, pkgconfig, yasm,
-  autoconf, automake, libtool, m4,
-  libass, libsamplerate, fribidi, libxml2, bzip2,
-  libogg, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
+{ stdenv, lib, fetchFromGitHub,
+  python2, pkgconfig, yasm, harfbuzz, zlib,
+  autoconf, automake, cmake, libtool, m4, jansson,
+  libass, libiconv, libsamplerate, fribidi, libxml2, bzip2,
+  libogg, libopus, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
   lame, ffmpeg, libdvdread, libdvdnav, libbluray,
   mp4v2, mpeg2dec, x264, x265, libmkv,
   fontconfig, freetype, hicolor_icon_theme,
   glib, gtk3, intltool, libnotify,
   gst_all_1, dbus_glib, udev, libgudev, libvpx,
-  wrapGAppsHook,
-  useGtk ? true
+  useGtk ? true, wrapGAppsHook ? null, libappindicator-gtk3 ? null
 }:
 
 stdenv.mkDerivation rec {
-  version = "0.10.5";
+  version = "1.0.3";
   name = "handbrake-${version}";
 
-  buildInputsX = stdenv.lib.optionals useGtk [
-    glib gtk3 intltool libnotify
-    gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
-    libgudev
-    wrapGAppsHook
-  ];
+  src = fetchFromGitHub {
+    owner  = "HandBrake";
+    repo   = "HandBrake";
+    rev    = "${version}";
+    sha256 = "1r8yzs0xih03p5ybx5096zkvlwxhcmg34047awmda1wq3z3rdjh5";
+  };
+
+  nativeBuildInputs = [
+    cmake python2 pkgconfig yasm autoconf automake libtool m4
+  ] ++ (lib.optionals useGtk [
+    intltool wrapGAppsHook
+  ]);
 
-  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
+    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
-  ] ++ buildInputsX;
+  ] ++ (lib.optionals useGtk [
+    glib gtk3 libappindicator-gtk3 libnotify
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
+    libgudev
+  ]);
 
-  src = fetchurl {
-    url = "http://download.handbrake.fr/releases/${version}/HandBrake-${version}.tar.bz2";
-    sha256 = "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv";
-  };
+  dontUseCmakeConfigure = true;
 
   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
+    patchShebangs scripts
+
+    echo 'TAG=${version}' > version.txt
+
+    # `configure` errors out when trying to read the current year which is too low
+    substituteInPlace make/configure.py \
+      --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
     sed -i '/MODULES += contrib/d' make/include/main.defs
     sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules
-
-    patch -p1 -R < ${./handbrake-0.10.3-nolibav.patch}
   '';
 
   configureFlags = [
+    "--disable-df-fetch"
+    "--disable-df-verify"
     "--enable-fdk-aac"
     (if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
   ];
@@ -74,21 +81,16 @@ stdenv.mkDerivation rec {
     cd build
   '';
 
-  LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ x265 ];
-  preFixup = ''
-    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}")
-  '';
-
-  meta = {
+  meta = with stdenv.lib; {
     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 ];
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ wmertens ];
     # Not tested on anything else
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
   };
 }