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

137 lines
2.4 KiB
Nix
Raw Normal View History

{ 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
2016-03-07 18:24:24 +00:00
, withGUI ? true
, wrapQtAppsHook
}:
let
inherit (lib) enableFeature optional 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";
2021-11-28 09:04:45 +00:00
version = "63.0.0";
2017-12-22 02:58:10 +00:00
src = fetchFromGitLab {
owner = "mbunkus";
repo = "mkvtoolnix";
rev = "release-${version}";
2021-11-28 09:04:45 +00:00
sha256 = "0jniy2kkg4fkrgyw2k8jcpq872qzkrxkbpbc7ksadm2rdygsa3xh";
};
2018-02-28 22:27:43 +00:00
nativeBuildInputs = [
autoreconfHook
docbook_xsl
gettext
gtest
libxslt
pkg-config
rake
]
++ optional withGUI wrapQtAppsHook;
2015-05-11 11:20:12 +01:00
# 1. qtbase and qtmultimedia are needed without the GUI
# 2. we have utf8cpp in nixpkgs but it doesn't find it
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
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
'';
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"
"--enable-optimization"
"--with-boost-libdir=${boost.out}/lib"
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
"--with-gettext"
(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";
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;
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;
maintainers = with maintainers; [ codyopel rnhmjoj ];
platforms = platforms.unix;
};
}