2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, pkg-config, autoconf, automake, libiconv, drake
|
|
|
|
, ruby, docbook_xsl, file, xdg-utils, gettext, expat, boost, libebml, zlib
|
2020-09-25 04:45:31 +00:00
|
|
|
, fmt, libmatroska, libogg, libvorbis, flac, libxslt, cmark, pcre2
|
2020-04-24 23:36:52 +00:00
|
|
|
, withGUI ? true
|
|
|
|
, qtbase ? null
|
|
|
|
, qtmultimedia ? null
|
|
|
|
, wrapQtAppsHook ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert withGUI -> qtbase != null && qtmultimedia != null && wrapQtAppsHook != null;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mkvtoolnix";
|
2021-04-25 03:57:28 +00:00
|
|
|
version = "56.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "mbunkus";
|
|
|
|
repo = "mkvtoolnix";
|
|
|
|
rev = "release-${version}";
|
2021-04-25 03:57:28 +00:00
|
|
|
sha256 = "0nhpp1zkggxqjj7lhj6as5mcjcz5yk3l1d1xcgs7i9153blam1yj";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config autoconf automake gettext
|
2020-04-24 23:36:52 +00:00
|
|
|
drake ruby docbook_xsl libxslt
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
expat file xdg-utils boost libebml zlib fmt
|
2020-09-25 04:45:31 +00:00
|
|
|
libmatroska libogg libvorbis flac cmark pcre2
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ optional stdenv.isDarwin libiconv
|
|
|
|
++ optionals withGUI [ qtbase qtmultimedia wrapQtAppsHook ];
|
|
|
|
|
|
|
|
preConfigure = "./autogen.sh; patchShebangs .";
|
|
|
|
buildPhase = "drake -j $NIX_BUILD_CORES";
|
|
|
|
installPhase = "drake install -j $NIX_BUILD_CORES";
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-magic"
|
|
|
|
"--enable-optimization"
|
|
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
|
|
"--disable-debug"
|
|
|
|
"--disable-profiling"
|
|
|
|
"--disable-precompiled-headers"
|
|
|
|
"--disable-static-qt"
|
|
|
|
"--with-gettext"
|
|
|
|
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
|
|
|
|
(enableFeature withGUI "qt")
|
|
|
|
];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
CXXFLAGS = optional stdenv.cc.isClang "-std=c++17";
|
2021-03-15 08:37:03 +00:00
|
|
|
LDFLAGS = optional stdenv.cc.isClang "-lc++fs";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
postFixup = optionalString withGUI ''
|
|
|
|
wrapQtApp $out/bin/mkvtoolnix-gui
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cross-platform tools for Matroska";
|
|
|
|
homepage = "http://www.bunkus.org/videotools/mkvtoolnix/";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ codyopel rnhmjoj ];
|
|
|
|
platforms = platforms.linux
|
|
|
|
++ optionals (!withGUI) platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|