38 enableFeature getDev getLib optionals optionalString;
50 stdenv.mkDerivation rec {
54 src = fetchFromGitLab {
57 rev = "release-${version}";
58 hash = "sha256-UU57ZgH1sxCXspwfKXScw08aJYiv+k526U8q8N1tA+4=";
70 ++ optionals withGUI [ wrapQtAppsHook ];
72 # qtbase and qtmultimedia are needed without the GUI
93 ++ optionals withGUI [ cmark ]
94 ++ optionals stdenv.hostPlatform.isLinux [ qtwayland ]
95 ++ optionals stdenv.hostPlatform.isDarwin [ libiconv ];
97 # autoupdate is not needed but it silences a ton of pointless warnings
99 patchShebangs . > /dev/null
100 autoupdate configure.ac ac/*.m4
105 "--disable-precompiled-headers"
106 "--disable-profiling"
107 "--disable-static-qt"
108 "--disable-update-check"
109 "--enable-optimization"
110 "--with-boost-libdir=${getLib boost}/lib"
111 "--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
113 "--with-extra-includes=${getDev utf8cpp}/include/utf8cpp"
114 "--with-extra-libs=${getLib utf8cpp}/lib"
115 (enableFeature withGUI "gui")
118 buildPhase = phase "Build" "";
120 installPhase = phase "Install" "install";
124 checkPhase = phase "Check" "tests:run_unit";
126 dontWrapQtApps = true;
128 postFixup = optionalString withGUI ''
129 wrapQtApp $out/bin/mkvtoolnix-gui
133 description = "Cross-platform tools for Matroska";
134 homepage = "https://mkvtoolnix.download/";
135 license = licenses.gpl2Only;
136 mainProgram = if withGUI then "mkvtoolnix-gui" else "mkvtoolnix";
137 maintainers = with maintainers; [ codyopel rnhmjoj ];
138 platforms = platforms.unix;