47 phase = name: args: ''
56 stdenv.mkDerivation rec {
60 src = fetchFromGitLab {
63 rev = "release-${version}";
64 hash = "sha256-UU57ZgH1sxCXspwfKXScw08aJYiv+k526U8q8N1tA+4=";
69 url = "https://gitlab.com/mbunkus/mkvtoolnix/-/commit/fc83003f541ac690fe308c3f4ac36e62814a40db.diff";
70 hash = "sha256-HOS79g5xm70upV5Okv1COEg0SanXs7brRRB59Ofx5HA=";
82 ] ++ optionals withGUI [ wrapQtAppsHook ];
84 # qtbase and qtmultimedia are needed without the GUI
106 ++ optionals withGUI [ cmark ]
107 ++ optionals stdenv.hostPlatform.isLinux [ qtwayland ];
109 # autoupdate is not needed but it silences a ton of pointless warnings
111 patchShebangs . > /dev/null
112 autoupdate configure.ac ac/*.m4
117 "--disable-precompiled-headers"
118 "--disable-profiling"
119 "--disable-static-qt"
120 "--disable-update-check"
121 "--enable-optimization"
122 "--with-boost-libdir=${getLib boost}/lib"
123 "--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
125 "--with-extra-includes=${getDev utf8cpp}/include/utf8cpp"
126 "--with-extra-libs=${getLib utf8cpp}/lib"
127 (enableFeature withGUI "gui")
130 buildPhase = phase "Build" "";
132 installPhase = phase "Install" "install";
136 checkPhase = phase "Check" "tests:run_unit";
138 dontWrapQtApps = true;
140 postFixup = optionalString withGUI ''
141 wrapQtApp $out/bin/mkvtoolnix-gui
145 description = "Cross-platform tools for Matroska";
146 homepage = "https://mkvtoolnix.download/";
147 license = licenses.gpl2Only;
148 mainProgram = if withGUI then "mkvtoolnix-gui" else "mkvtoolnix";
149 maintainers = with maintainers; [
153 platforms = platforms.unix;