2021-07-15 02:24:59 +01:00
|
|
|
{ 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
|
2021-07-15 02:24:59 +01:00
|
|
|
, wrapQtAppsHook
|
2011-02-12 20:18:53 +00:00
|
|
|
}:
|
|
|
|
|
2021-07-15 02:24:59 +01:00
|
|
|
let
|
|
|
|
inherit (lib) enableFeature optional optionals optionalString;
|
2016-03-07 18:24:24 +00:00
|
|
|
|
2021-07-15 02:24:59 +01:00
|
|
|
phase = name: args:
|
|
|
|
''
|
|
|
|
runHook pre${name}
|
2015-01-10 13:46:05 +00:00
|
|
|
|
2021-07-15 02:24:59 +01:00
|
|
|
rake ${args}
|
|
|
|
|
|
|
|
runHook post${name}
|
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
2021-08-13 19:41:59 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-03-26 14:47:49 +00:00
|
|
|
pname = "mkvtoolnix";
|
2021-11-28 09:04:45 +00:00
|
|
|
version = "63.0.0";
|
2011-02-12 20:18:53 +00:00
|
|
|
|
2017-12-22 02:58:10 +00:00
|
|
|
src = fetchFromGitLab {
|
2021-07-15 02:24:59 +01:00
|
|
|
owner = "mbunkus";
|
|
|
|
repo = "mkvtoolnix";
|
|
|
|
rev = "release-${version}";
|
2021-11-28 09:04:45 +00:00
|
|
|
sha256 = "0jniy2kkg4fkrgyw2k8jcpq872qzkrxkbpbc7ksadm2rdygsa3xh";
|
2011-02-12 20:18:53 +00:00
|
|
|
};
|
|
|
|
|
2018-02-28 22:27:43 +00:00
|
|
|
nativeBuildInputs = [
|
2021-07-15 02:24:59 +01:00
|
|
|
autoreconfHook
|
|
|
|
docbook_xsl
|
|
|
|
gettext
|
|
|
|
gtest
|
|
|
|
libxslt
|
|
|
|
pkg-config
|
|
|
|
rake
|
|
|
|
]
|
|
|
|
++ optional withGUI wrapQtAppsHook;
|
2015-05-11 11:20:12 +01:00
|
|
|
|
2021-07-15 02:24:59 +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 = [
|
2021-07-15 02:24:59 +01:00
|
|
|
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;
|
2011-02-12 20:18:53 +00:00
|
|
|
|
2021-07-15 02:24:59 +01:00
|
|
|
# autoupdate is not needed but it silences a ton of pointless warnings
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs . > /dev/null
|
|
|
|
autoupdate configure.ac ac/*.m4
|
|
|
|
'';
|
2011-02-12 20:18:53 +00:00
|
|
|
|
2016-03-07 18:24:24 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-debug"
|
|
|
|
"--disable-precompiled-headers"
|
2021-07-15 02:24:59 +01:00
|
|
|
"--disable-profiling"
|
2016-03-07 18:24:24 +00:00
|
|
|
"--disable-static-qt"
|
2021-07-15 02:24:59 +01:00
|
|
|
"--enable-optimization"
|
|
|
|
"--with-boost-libdir=${boost.out}/lib"
|
2017-03-13 21:16:38 +00:00
|
|
|
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
|
2021-07-15 02:24:59 +01:00
|
|
|
"--with-gettext"
|
|
|
|
(enableFeature withGUI "gui")
|
2016-03-07 18:24:24 +00:00
|
|
|
];
|
2011-02-12 20:18:53 +00:00
|
|
|
|
2021-07-15 02:24:59 +01:00
|
|
|
buildPhase = phase "Build" "";
|
|
|
|
|
|
|
|
installPhase = phase "Install" "install";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = phase "Check" "tests:run_unit";
|
|
|
|
|
2020-06-06 03:40:33 +01:00
|
|
|
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;
|
2021-07-15 02:24:59 +01:00
|
|
|
|
2019-08-15 16:28:53 +01:00
|
|
|
postFixup = optionalString withGUI ''
|
|
|
|
wrapQtApp $out/bin/mkvtoolnix-gui
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2011-02-12 20:22:55 +00:00
|
|
|
description = "Cross-platform tools for Matroska";
|
2021-07-15 02:24:59 +01:00
|
|
|
homepage = "https://mkvtoolnix.download/";
|
|
|
|
license = licenses.gpl2Only;
|
2019-12-05 07:29:48 +00:00
|
|
|
maintainers = with maintainers; [ codyopel rnhmjoj ];
|
2021-08-16 03:40:11 +01:00
|
|
|
platforms = platforms.unix;
|
2011-02-12 20:18:53 +00:00
|
|
|
};
|
|
|
|
}
|