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