2015-05-11 11:20:12 +01:00
|
|
|
{ stdenv, fetchurl, gettext, pkgconfig, ruby
|
|
|
|
, boost, expat, file, flac, libebml, libmatroska, libogg, libvorbis, xdg_utils, zlib
|
|
|
|
# pugixml (not packaged)
|
|
|
|
, buildConfig ? "all"
|
|
|
|
, withGUI ? false, qt5 ? null # Disabled for now until upstream issues are resolved
|
|
|
|
, legacyGUI ? true, wxGTK ? null
|
|
|
|
# For now both qt5 and wxwidgets gui's are enabled, if wxwidgets is disabled the
|
|
|
|
# build system doesn't install desktop entries, icons, etc...
|
2015-10-31 21:00:40 +00:00
|
|
|
, libiconv
|
2011-02-12 20:18:53 +00:00
|
|
|
}:
|
|
|
|
|
2015-05-11 11:20:12 +01:00
|
|
|
let
|
|
|
|
inherit (stdenv.lib) enableFeature optional;
|
|
|
|
in
|
|
|
|
|
|
|
|
assert withGUI -> qt5 != null;
|
|
|
|
assert legacyGUI -> wxGTK != null;
|
2015-01-10 13:46:05 +00:00
|
|
|
|
2011-02-12 20:18:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-08-29 14:06:23 +01:00
|
|
|
name = "mkvtoolnix-${version}";
|
2016-01-03 20:31:29 +00:00
|
|
|
version = "8.4.0";
|
2011-02-12 20:18:53 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-01-21 20:05:31 +00:00
|
|
|
url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.xz";
|
2016-01-03 20:31:29 +00:00
|
|
|
sha256 = "0y7qm8q9vpvjiw7b69k9140pw9nhvs6ggmk56yxnmcd02inm19gn";
|
2011-02-12 20:18:53 +00:00
|
|
|
};
|
|
|
|
|
2015-05-11 11:20:12 +01:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs ./rake.d/
|
|
|
|
patchShebangs ./Rakefile
|
|
|
|
# Force ruby encoding to use UTF-8 or else when enabling qt5 the Rakefile may
|
|
|
|
# fail with `invalid byte sequence in US-ASCII' due to UTF-8 characters
|
|
|
|
# This workaround replaces an arbitrary comment in the drake file
|
|
|
|
sed -e 's,#--,Encoding.default_external = Encoding::UTF_8,' -i ./drake
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-boost-libdir=${boost.lib}/lib"
|
|
|
|
"--without-curl"
|
|
|
|
] ++ (
|
|
|
|
if (withGUI || legacyGUI) then [
|
|
|
|
"--with-mkvtoolnix-gui"
|
|
|
|
"--enable-gui"
|
|
|
|
(enableFeature withGUI "qt")
|
|
|
|
(enableFeature legacyGUI "wxwidgets")
|
|
|
|
] else [
|
|
|
|
"--disable-gui"
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gettext pkgconfig ruby ];
|
|
|
|
|
2014-08-29 14:06:23 +01:00
|
|
|
buildInputs = [
|
2015-05-11 11:20:12 +01:00
|
|
|
boost expat file flac libebml libmatroska libogg libvorbis xdg_utils zlib
|
2015-10-31 21:00:40 +00:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ]
|
|
|
|
++ optional withGUI qt5
|
2015-05-11 11:20:12 +01:00
|
|
|
++ optional legacyGUI wxGTK;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2011-02-12 20:18:53 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2015-05-11 11:20:12 +01:00
|
|
|
./drake
|
2011-02-12 20:18:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2015-05-11 11:20:12 +01:00
|
|
|
./drake install
|
2011-02-12 20:18:53 +00:00
|
|
|
'';
|
|
|
|
|
2015-05-11 11:20:12 +01:00
|
|
|
meta = with stdenv.lib; {
|
2011-02-12 20:22:55 +00:00
|
|
|
description = "Cross-platform tools for Matroska";
|
|
|
|
homepage = http://www.bunkus.org/videotools/mkvtoolnix/;
|
2015-05-11 11:20:12 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ codyopel fuuzetsu ];
|
2015-10-31 21:00:40 +00:00
|
|
|
platforms = platforms.all;
|
2011-02-12 20:18:53 +00:00
|
|
|
};
|
|
|
|
}
|