1 { lib, stdenv, fetchurl, pkg-config, cryptopp
2 , libusb1, qtbase, qttools, makeWrapper
3 , qmake, withEspeak ? false, espeak ? null
6 let inherit (lib) getDev; in
8 stdenv.mkDerivation rec {
9 pname = "rockbox-utility";
13 url = "https://download.rockbox.org/rbutil/source/RockboxUtility-v${version}-src.tar.bz2";
14 sha256 = "0zm9f01a810y7aq0nravbsl0vs9vargwvxnfl4iz9qsqygwlj69y";
17 buildInputs = [ cryptopp libusb1 qtbase qttools ]
18 ++ lib.optional withEspeak espeak;
19 nativeBuildInputs = [ makeWrapper pkg-config qmake qt5.wrapQtAppsHook ];
22 sed -i rbutil/rbutilqt/rbutilqt.pro \
23 -e '/^lrelease.commands =/ s|$$\[QT_INSTALL_BINS\]/lrelease -silent|${getDev qttools}/bin/lrelease|'
34 install -Dm755 RockboxUtility $out/bin/rockboxutility
35 ln -s $out/bin/rockboxutility $out/bin/RockboxUtility
36 wrapProgram $out/bin/rockboxutility \
37 ${lib.optionalString withEspeak ''
38 --prefix PATH : ${espeak}/bin
44 # `make build/rcc/qrc_rbutilqt-lang.cpp` fails with
45 # RCC: Error in 'rbutilqt-lang.qrc': Cannot find file 'lang/rbutil_cs.qm'
46 # Do not add `lrelease rbutilqt.pro` into preConfigure, otherwise `make lrelease`
47 # may clobber the files read by the parallel `make build/rcc/qrc_rbutilqt-lang.cpp`.
48 enableParallelBuilding = false;
51 description = "Open source firmware for mp3 players";
52 homepage = "https://www.rockbox.org";
53 license = licenses.gpl2;
54 platforms = platforms.linux;
55 maintainers = with maintainers; [ goibhniu ];