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 { lib
, ruby, docbook_xsl, file, xdg-utils, gettext, expat, boost, libebml, zlib , stdenv
, fmt, libmatroska, libogg, libvorbis, flac, libxslt, cmark, pcre2 , 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 , withGUI ? true
, qtbase ? null , wrapQtAppsHook
, qtmultimedia ? null
, wrapQtAppsHook ? null
}: }:
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"; pname = "mkvtoolnix";
version = "56.0.0"; version = "59.0.0";
src = fetchFromGitLab { src = fetchFromGitLab {
owner = "mbunkus"; owner = "mbunkus";
repo = "mkvtoolnix"; repo = "mkvtoolnix";
rev = "release-${version}"; rev = "release-${version}";
sha256 = "0nhpp1zkggxqjj7lhj6as5mcjcz5yk3l1d1xcgs7i9153blam1yj"; sha256 = "sha256-bPypOsveXrkz1V961b9GTJKFdgru/kcW15z/yik/4yQ=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config autoconf automake gettext autoreconfHook
drake ruby docbook_xsl libxslt 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 = [ buildInputs = [
expat file xdg-utils boost libebml zlib fmt boost
libmatroska libogg libvorbis flac cmark pcre2 expat
] ++ optional stdenv.isDarwin libiconv file
++ optionals withGUI [ qtbase qtmultimedia wrapQtAppsHook ]; 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 ."; # autoupdate is not needed but it silences a ton of pointless warnings
buildPhase = "drake -j $NIX_BUILD_CORES"; postPatch = ''
installPhase = "drake install -j $NIX_BUILD_CORES"; patchShebangs . > /dev/null
autoupdate configure.ac ac/*.m4
'';
configureFlags = [ configureFlags = [
"--enable-magic" "--disable-debug"
"--disable-precompiled-headers"
"--disable-profiling"
"--disable-static-qt"
"--enable-optimization" "--enable-optimization"
"--with-boost-libdir=${boost.out}/lib" "--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" "--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"; CXXFLAGS = optional stdenv.cc.isClang "-std=c++17";
LDFLAGS = optional stdenv.cc.isClang "-lc++fs"; LDFLAGS = optional stdenv.cc.isClang "-lc++fs";
dontWrapQtApps = true; dontWrapQtApps = true;
postFixup = optionalString withGUI '' postFixup = optionalString withGUI ''
wrapQtApp $out/bin/mkvtoolnix-gui wrapQtApp $out/bin/mkvtoolnix-gui
''; '';
meta = with lib; { meta = with lib; {
description = "Cross-platform tools for Matroska"; description = "Cross-platform tools for Matroska";
homepage = "http://www.bunkus.org/videotools/mkvtoolnix/"; homepage = "https://mkvtoolnix.download/";
license = licenses.gpl2Only; license = licenses.gpl2Only;
maintainers = with maintainers; [ codyopel rnhmjoj ]; maintainers = with maintainers; [ codyopel rnhmjoj ];
platforms = platforms.linux platforms = platforms.linux
++ optionals (!withGUI) platforms.darwin; ++ optionals (!withGUI) platforms.darwin;
}; };
} }

View file

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