nixpkgs/pkgs/applications/video/mkvtoolnix/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

141 lines
2.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitLab
, pkg-config
, autoreconfHook
, rake
, boost
, cmark
, docbook_xsl
, expat
, file
, flac
, fmt
, gettext
, gmp
, gtest
, libdvdread
, libebml
, libiconv
, libmatroska
, libogg
, libvorbis
, libxslt
, nlohmann_json
, pugixml
, qtbase
, qtmultimedia
, qtwayland
2023-12-15 02:13:59 +00:00
, utf8cpp
, xdg-utils
, zlib
2016-03-07 18:24:24 +00:00
, withGUI ? true
, wrapQtAppsHook
}:
let
2023-12-15 02:13:59 +00:00
inherit (lib)
enableFeature getDev getLib optionals optionalString;
2016-03-07 18:24:24 +00:00
phase = name: args:
''
runHook pre${name}
rake ${args}
runHook post${name}
'';
in
stdenv.mkDerivation rec {
pname = "mkvtoolnix";
2024-01-03 06:53:38 +00:00
version = "82.0";
2017-12-22 02:58:10 +00:00
src = fetchFromGitLab {
owner = "mbunkus";
repo = "mkvtoolnix";
rev = "release-${version}";
2024-01-03 06:53:38 +00:00
hash = "sha256-3WULzEkjMH4PUETJeKmDKn9PdanWf581O2mI/IqN8YM=";
};
2018-02-28 22:27:43 +00:00
nativeBuildInputs = [
autoreconfHook
docbook_xsl
gettext
gtest
libxslt
pkg-config
rake
]
2023-12-15 02:13:59 +00:00
++ optionals withGUI [ wrapQtAppsHook ];
2015-05-11 11:20:12 +01:00
2023-12-15 02:13:59 +00:00
# qtbase and qtmultimedia are needed without the GUI
2014-08-29 14:06:23 +01:00
buildInputs = [
boost
expat
file
flac
fmt
gmp
libdvdread
libebml
libmatroska
libogg
libvorbis
nlohmann_json
pugixml
qtbase
qtmultimedia
2023-12-15 02:13:59 +00:00
utf8cpp
xdg-utils
zlib
]
2023-12-15 02:13:59 +00:00
++ optionals withGUI [ cmark ]
++ optionals stdenv.isLinux [ qtwayland ]
2023-12-15 02:13:59 +00:00
++ optionals stdenv.isDarwin [ libiconv ];
# autoupdate is not needed but it silences a ton of pointless warnings
postPatch = ''
patchShebangs . > /dev/null
autoupdate configure.ac ac/*.m4
'';
2016-03-07 18:24:24 +00:00
configureFlags = [
"--disable-debug"
"--disable-precompiled-headers"
"--disable-profiling"
2016-03-07 18:24:24 +00:00
"--disable-static-qt"
"--disable-update-check"
"--enable-optimization"
2023-12-15 02:13:59 +00:00
"--with-boost-libdir=${getLib boost}/lib"
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
"--with-gettext"
2023-12-15 02:13:59 +00:00
"--with-extra-includes=${getDev utf8cpp}/include/utf8cpp"
"--with-extra-libs=${getLib utf8cpp}/lib"
(enableFeature withGUI "gui")
2016-03-07 18:24:24 +00:00
];
buildPhase = phase "Build" "";
installPhase = phase "Install" "install";
doCheck = true;
checkPhase = phase "Check" "tests:run_unit";
2019-08-15 16:28:53 +01:00
dontWrapQtApps = true;
2019-08-15 16:28:53 +01:00
postFixup = optionalString withGUI ''
wrapQtApp $out/bin/mkvtoolnix-gui
'';
meta = with lib; {
description = "Cross-platform tools for Matroska";
homepage = "https://mkvtoolnix.download/";
license = licenses.gpl2Only;
2022-10-08 12:02:27 +01:00
mainProgram = if withGUI then "mkvtoolnix-gui" else "mkvtoolnix";
maintainers = with maintainers; [ codyopel rnhmjoj ];
platforms = platforms.unix;
};
}