1{
2 lib,
3 fetchurl,
4 buildPythonApplication,
5 libjack2,
6 pyqt5,
7 qt5,
8 which,
9 bash,
10}:
11
12buildPythonApplication rec {
13 pname = "patchance";
14 version = "1.1.0";
15
16 src = fetchurl {
17 url = "https://github.com/Houston4444/Patchance/releases/download/v${version}/Patchance-${version}-source.tar.gz";
18 sha256 = "sha256-wlkEKkPH2C/y7TQicIVycWbtLUdX2hICcUWi7nFN51w=";
19 };
20
21 format = "other";
22
23 nativeBuildInputs = [
24 pyqt5 # pyuic5 and pyrcc5 to build resources.
25 qt5.qttools # lrelease to build translations.
26 which # which to find lrelease.
27 qt5.wrapQtAppsHook
28 ];
29 buildInputs = [
30 libjack2
31 bash
32 ];
33 propagatedBuildInputs = [ pyqt5 ];
34
35 dontWrapQtApps = true; # The program is a python script.
36
37 installFlags = [ "PREFIX=$(out)" ];
38
39 makeWrapperArgs = [
40 "--suffix"
41 "LD_LIBRARY_PATH"
42 ":"
43 (lib.makeLibraryPath [ libjack2 ])
44 ];
45
46 preFixup = ''
47 makeWrapperArgs+=("''${qtWrapperArgs[@]}")
48 '';
49
50 postFixup = ''
51 wrapPythonProgramsIn "$out/share/patchance/src" "$out $pythonPath"
52 for file in $out/bin/*; do
53 wrapQtApp "$file"
54 done
55 '';
56
57 meta = with lib; {
58 homepage = "https://github.com/Houston4444/Patchance";
59 description = "JACK Patchbay GUI";
60 mainProgram = "patchance";
61 license = licenses.gpl2;
62 maintainers = with maintainers; [ orivej ];
63 platforms = platforms.linux;
64 };
65}