mkvtoolnix: 56.0.0 -> 59.0.0

Additional changes:

1. Qt is now needed for both the cli and gui variants.
2. Run the test suite
3. Drop a number of dependencies that are no longer needed
4. We have nlohmann_json and pugixml, so use those instead of the
   vendored versions
5. Add support for reading chapters from DVDs
6. Build with rake as recommended by upstream
This commit is contained in:
Peter Hoeg 2021-07-15 09:24:59 +08:00
parent 7d189ad382
commit 98dcfcfeb8
2 changed files with 104 additions and 35 deletions

View File

@ -1,69 +1,138 @@
{ lib, stdenv, fetchFromGitLab, pkg-config, autoconf, automake, libiconv, drake
, ruby, docbook_xsl, file, xdg-utils, gettext, expat, boost, libebml, zlib
, fmt, libmatroska, libogg, libvorbis, flac, libxslt, cmark, pcre2
{ lib
, stdenv
, mkDerivation
, fetchFromGitLab
, pkg-config
, autoreconfHook
, qmake
, rake
, boost
, cmark
, docbook_xsl
, expat
, file
, flac
, fmt
, gettext
, gmp
, gtest
, libdvdread
, libebml
, libiconv
, libmatroska
, libogg
, libvorbis
, libxslt
, nlohmann_json
, pugixml
, qtbase
, qtmultimedia
, xdg-utils
, zlib
, withGUI ? true
, qtbase ? null
, qtmultimedia ? null
, wrapQtAppsHook ? null
, wrapQtAppsHook
}:
assert withGUI -> qtbase != null && qtmultimedia != null && wrapQtAppsHook != null;
let
inherit (lib) enableFeature optional optionals optionalString;
with lib;
phase = name: args:
''
runHook pre${name}
stdenv.mkDerivation rec {
rake ${args}
runHook post${name}
'';
in
mkDerivation rec {
pname = "mkvtoolnix";
version = "56.0.0";
version = "59.0.0";
src = fetchFromGitLab {
owner = "mbunkus";
repo = "mkvtoolnix";
rev = "release-${version}";
sha256 = "0nhpp1zkggxqjj7lhj6as5mcjcz5yk3l1d1xcgs7i9153blam1yj";
owner = "mbunkus";
repo = "mkvtoolnix";
rev = "release-${version}";
sha256 = "sha256-bPypOsveXrkz1V961b9GTJKFdgru/kcW15z/yik/4yQ=";
};
nativeBuildInputs = [
pkg-config autoconf automake gettext
drake ruby docbook_xsl libxslt
];
autoreconfHook
docbook_xsl
gettext
gtest
libxslt
pkg-config
rake
]
++ optional withGUI wrapQtAppsHook;
# 1. qtbase and qtmultimedia are needed without the GUI
# 2. we have utf8cpp in nixpkgs but it doesn't find it
buildInputs = [
expat file xdg-utils boost libebml zlib fmt
libmatroska libogg libvorbis flac cmark pcre2
] ++ optional stdenv.isDarwin libiconv
++ optionals withGUI [ qtbase qtmultimedia wrapQtAppsHook ];
boost
expat
file
flac
fmt
gmp
libdvdread
libebml
libmatroska
libogg
libvorbis
nlohmann_json
pugixml
qtbase
qtmultimedia
xdg-utils
zlib
]
++ optional withGUI cmark
++ optional stdenv.isDarwin libiconv;
preConfigure = "./autogen.sh; patchShebangs .";
buildPhase = "drake -j $NIX_BUILD_CORES";
installPhase = "drake install -j $NIX_BUILD_CORES";
# autoupdate is not needed but it silences a ton of pointless warnings
postPatch = ''
patchShebangs . > /dev/null
autoupdate configure.ac ac/*.m4
'';
configureFlags = [
"--enable-magic"
"--disable-debug"
"--disable-precompiled-headers"
"--disable-profiling"
"--disable-static-qt"
"--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")
"--with-gettext"
(enableFeature withGUI "gui")
];
buildPhase = phase "Build" "";
installPhase = phase "Install" "install";
doCheck = true;
checkPhase = phase "Check" "tests:run_unit";
CXXFLAGS = optional stdenv.cc.isClang "-std=c++17";
LDFLAGS = optional stdenv.cc.isClang "-lc++fs";
dontWrapQtApps = true;
postFixup = optionalString withGUI ''
wrapQtApp $out/bin/mkvtoolnix-gui
'';
meta = with lib; {
description = "Cross-platform tools for Matroska";
homepage = "http://www.bunkus.org/videotools/mkvtoolnix/";
license = licenses.gpl2Only;
homepage = "https://mkvtoolnix.download/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ codyopel rnhmjoj ];
platforms = platforms.linux
platforms = platforms.linux
++ optionals (!withGUI) platforms.darwin;
};
}

View File

@ -17554,7 +17554,7 @@ in
mkvtoolnix = libsForQt5.callPackage ../applications/video/mkvtoolnix { };
mkvtoolnix-cli = callPackage ../applications/video/mkvtoolnix {
mkvtoolnix-cli = mkvtoolnix.override {
withGUI = false;
};