@@ -1,34 +1,45 @@
1−{ stdenv, fetchurl
2−, openssl, qt5, libGLU_combined, zlib, pkgconfig, libav
1+{ stdenv, mkDerivation, fetchurl, autoPatchelfHook
2+, ffmpeg, openssl, qtbase, zlib, pkgconfig
33}:
44
5−stdenv.mkDerivation rec {
6− name = "makemkv-${ver}";
7− ver = "1.14.4";
8− builder = ./builder.sh;
9−
5+let
6+ version = "1.14.4";
107 # Using two URLs as the first one will break as soon as a new version is released
118 src_bin = fetchurl {
129 urls = [
13− "http://www.makemkv.com/download/makemkv-bin-${ver}.tar.gz"
14− "http://www.makemkv.com/download/old/makemkv-bin-${ver}.tar.gz"
10+ "http://www.makemkv.com/download/makemkv-bin-${version}.tar.gz"
11+ "http://www.makemkv.com/download/old/makemkv-bin-${version}.tar.gz"
1512 ];
1613 sha256 = "0vmmvldmwmq9g202abblj6l15kb8z3b0c6mcc03f30s2yci6ij33";
1714 };
18−
1915 src_oss = fetchurl {
2016 urls = [
21− "http://www.makemkv.com/download/makemkv-oss-${ver}.tar.gz"
22− "http://www.makemkv.com/download/old/makemkv-oss-${ver}.tar.gz"
17+ "http://www.makemkv.com/download/makemkv-oss-${version}.tar.gz"
18+ "http://www.makemkv.com/download/old/makemkv-oss-${version}.tar.gz"
2319 ];
2420 sha256 = "0n1nlq17dxcbgk9xqf7nv6zykvh91yhsjqdhq55947wc11fxjqa0";
2521 };
22+in mkDerivation {
23+ pname = "makemkv";
24+ inherit version;
25+
26+ srcs = [ src_bin src_oss ];
27+
28+ sourceRoot = "makemkv-oss-${version}";
29+
30+ nativeBuildInputs = [ autoPatchelfHook pkgconfig ];
31+
32+ buildInputs = [ ffmpeg openssl qtbase zlib ];
33+
34+ installPhase = ''
35+ runHook preInstall
2636
27− nativeBuildInputs = [ pkgconfig ];
28− buildInputs = [openssl qt5.qtbase libGLU_combined zlib libav];
37+ install -Dm555 -t $out/bin out/makemkv ../makemkv-bin-${version}/bin/amd64/makemkvcon
38+ install -D -t $out/lib out/lib{driveio,makemkv,mmbd}.so.*
39+ install -D -t $out/share/MakeMKV ../makemkv-bin-${version}/src/share/*
2940
30− libPath = stdenv.lib.makeLibraryPath [stdenv.cc.cc openssl libGLU_combined qt5.qtbase zlib ]
31− + ":" + stdenv.cc.cc + "/lib64";
41+ runHook postInstall
42+ '';
3243
3344 meta = with stdenv.lib; {
3445 description = "Convert blu-ray and dvd to mkv";