mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 05:04:00 +00:00
142 lines
2.6 KiB
Nix
142 lines
2.6 KiB
Nix
{ lib
|
|
, stdenv
|
|
, 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
|
|
, wrapQtAppsHook
|
|
}:
|
|
|
|
let
|
|
inherit (lib) enableFeature optional optionals optionalString;
|
|
|
|
phase = name: args:
|
|
''
|
|
runHook pre${name}
|
|
|
|
rake ${args}
|
|
|
|
runHook post${name}
|
|
'';
|
|
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "mkvtoolnix";
|
|
version = "61.0.0";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "mbunkus";
|
|
repo = "mkvtoolnix";
|
|
rev = "release-${version}";
|
|
sha256 = "04f18jr0a5m1sah8163m28b82w1ikjzmahqy67pbbpzg0mc6rqr4";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
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 = [
|
|
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;
|
|
|
|
# autoupdate is not needed but it silences a ton of pointless warnings
|
|
postPatch = ''
|
|
patchShebangs . > /dev/null
|
|
autoupdate configure.ac ac/*.m4
|
|
'';
|
|
|
|
configureFlags = [
|
|
"--disable-debug"
|
|
"--disable-precompiled-headers"
|
|
"--disable-profiling"
|
|
"--disable-static-qt"
|
|
"--enable-optimization"
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
|
|
"--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;
|
|
|
|
# Avoid Qt 5.12 problem on Big Sur: https://bugreports.qt.io/browse/QTBUG-87014
|
|
qtWrapperArgs = lib.optionals stdenv.isDarwin [
|
|
"--set QT_MAC_WANTS_LAYER 1"
|
|
];
|
|
|
|
postFixup = optionalString withGUI ''
|
|
wrapQtApp $out/bin/mkvtoolnix-gui
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Cross-platform tools for Matroska";
|
|
homepage = "https://mkvtoolnix.download/";
|
|
license = licenses.gpl2Only;
|
|
maintainers = with maintainers; [ codyopel rnhmjoj ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|