2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
|
|
|
, rake
|
|
|
|
, boost
|
|
|
|
, cmark
|
|
|
|
, docbook_xsl
|
|
|
|
, expat
|
2024-10-11 05:15:48 +00:00
|
|
|
, fetchpatch2
|
2021-08-05 21:33:18 +00:00
|
|
|
, file
|
|
|
|
, flac
|
|
|
|
, fmt
|
|
|
|
, gettext
|
|
|
|
, gmp
|
|
|
|
, gtest
|
|
|
|
, libdvdread
|
|
|
|
, libebml
|
|
|
|
, libiconv
|
|
|
|
, libmatroska
|
|
|
|
, libogg
|
|
|
|
, libvorbis
|
|
|
|
, libxslt
|
|
|
|
, nlohmann_json
|
|
|
|
, pugixml
|
|
|
|
, qtbase
|
|
|
|
, qtmultimedia
|
2024-01-13 08:15:51 +00:00
|
|
|
, qtwayland
|
2024-01-02 11:29:13 +00:00
|
|
|
, utf8cpp
|
2021-08-05 21:33:18 +00:00
|
|
|
, xdg-utils
|
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, withGUI ? true
|
2021-08-05 21:33:18 +00:00
|
|
|
, wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit (lib)
|
|
|
|
enableFeature getDev getLib optionals optionalString;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
phase = name: args:
|
|
|
|
''
|
|
|
|
runHook pre${name}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
rake ${args}
|
|
|
|
|
|
|
|
runHook post${name}
|
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
2021-08-18 13:19:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mkvtoolnix";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "87.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
2021-08-05 21:33:18 +00:00
|
|
|
owner = "mbunkus";
|
|
|
|
repo = "mkvtoolnix";
|
|
|
|
rev = "release-${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-UU57ZgH1sxCXspwfKXScw08aJYiv+k526U8q8N1tA+4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://gitlab.com/mbunkus/mkvtoolnix/-/commit/fc83003f541ac690fe308c3f4ac36e62814a40db.diff";
|
|
|
|
hash = "sha256-HOS79g5xm70upV5Okv1COEg0SanXs7brRRB59Ofx5HA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-05 21:33:18 +00:00
|
|
|
autoreconfHook
|
|
|
|
docbook_xsl
|
|
|
|
gettext
|
|
|
|
gtest
|
|
|
|
libxslt
|
|
|
|
pkg-config
|
|
|
|
rake
|
|
|
|
]
|
2024-01-02 11:29:13 +00:00
|
|
|
++ optionals withGUI [ wrapQtAppsHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# qtbase and qtmultimedia are needed without the GUI
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-08-05 21:33:18 +00:00
|
|
|
boost
|
|
|
|
expat
|
|
|
|
file
|
|
|
|
flac
|
|
|
|
fmt
|
|
|
|
gmp
|
|
|
|
libdvdread
|
|
|
|
libebml
|
|
|
|
libmatroska
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
nlohmann_json
|
|
|
|
pugixml
|
|
|
|
qtbase
|
|
|
|
qtmultimedia
|
2024-01-02 11:29:13 +00:00
|
|
|
utf8cpp
|
2021-08-05 21:33:18 +00:00
|
|
|
xdg-utils
|
|
|
|
zlib
|
|
|
|
]
|
2024-01-02 11:29:13 +00:00
|
|
|
++ optionals withGUI [ cmark ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ optionals stdenv.hostPlatform.isLinux [ qtwayland ]
|
|
|
|
++ optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
# autoupdate is not needed but it silences a ton of pointless warnings
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs . > /dev/null
|
|
|
|
autoupdate configure.ac ac/*.m4
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-debug"
|
|
|
|
"--disable-precompiled-headers"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--disable-profiling"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--disable-static-qt"
|
2023-10-09 19:29:22 +00:00
|
|
|
"--disable-update-check"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--enable-optimization"
|
2024-01-02 11:29:13 +00:00
|
|
|
"--with-boost-libdir=${getLib boost}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--with-gettext"
|
2024-01-02 11:29:13 +00:00
|
|
|
"--with-extra-includes=${getDev utf8cpp}/include/utf8cpp"
|
|
|
|
"--with-extra-libs=${getLib utf8cpp}/lib"
|
2021-08-05 21:33:18 +00:00
|
|
|
(enableFeature withGUI "gui")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildPhase = phase "Build" "";
|
|
|
|
|
|
|
|
installPhase = phase "Install" "install";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = phase "Check" "tests:run_unit";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontWrapQtApps = true;
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postFixup = optionalString withGUI ''
|
|
|
|
wrapQtApp $out/bin/mkvtoolnix-gui
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cross-platform tools for Matroska";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://mkvtoolnix.download/";
|
|
|
|
license = licenses.gpl2Only;
|
2022-10-21 18:38:19 +00:00
|
|
|
mainProgram = if withGUI then "mkvtoolnix-gui" else "mkvtoolnix";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ codyopel rnhmjoj ];
|
2021-08-18 13:19:15 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|