pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / chiaki-ng / default.nix
blob6ef2bb380fff264ebe1edacb0ed3841731027dea
1 { lib
2 , fetchFromGitHub
3 , stdenv
4 , cmake
5 , pkg-config
6 , protobuf
7 , python3
8 , ffmpeg
9 , libopus
10 , wrapQtAppsHook
11 , qtbase
12 , qtmultimedia
13 , qtsvg
14 , qtwayland
15 , qtdeclarative
16 , qtwebengine
17 , SDL2
18 , libevdev
19 , udev
20 , curlFull
21 , hidapi
22 , json_c
23 , fftw
24 , miniupnpc
25 , speexdsp
26 , libplacebo
27 , vulkan-loader
28 , vulkan-headers
29 , libunwind
30 , shaderc
31 , lcms2
32 , libdovi
33 , xxHash
36 stdenv.mkDerivation rec {
37   pname = "chiaki-ng";
38   version = "1.9.0";
40   src = fetchFromGitHub {
41     owner = "streetpea";
42     repo = "chiaki-ng";
43     rev = "v${version}";
44     hash = "sha256-7+AixZu74y1V+rUauVswPzuWX2x6n3MJoM2A2w4zyuI=";
45     fetchSubmodules = true;
46   };
48   nativeBuildInputs = [
49     cmake
50     pkg-config
51     wrapQtAppsHook
52     protobuf
53     python3
54     python3.pkgs.wrapPython
55     python3.pkgs.protobuf
56     python3.pkgs.setuptools
57   ];
59   buildInputs = [
60     ffmpeg
61     libopus
62     qtbase
63     qtmultimedia
64     qtsvg
65     qtdeclarative
66     qtwayland
67     qtwebengine
68     protobuf
69     SDL2
70     curlFull
71     hidapi
72     json_c
73     fftw
74     miniupnpc
75     libevdev
76     udev
77     speexdsp
78     libplacebo
79     vulkan-headers
80     libunwind
81     shaderc
82     lcms2
83     libdovi
84     xxHash
85   ];
87   # handle library name discrepancy when curl not built with cmake
88   postPatch = ''
89     substituteInPlace lib/CMakeLists.txt \
90       --replace-fail 'libcurl_shared' 'libcurl'
91   '';
93   cmakeFlags = [
94     "-Wno-dev"
95     (lib.cmakeFeature "CHIAKI_USE_SYSTEM_CURL" "true")
96   ];
98   qtWrapperArgs = [
99     "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
100   ];
102   pythonPath = [
103     python3.pkgs.requests
104   ];
106   postInstall = ''
107     install -Dm755 $src/scripts/psn-account-id.py $out/bin/psn-account-id
108   '';
110   postFixup = ''
111     wrapPythonPrograms
112   '';
114   meta = with lib; {
115     homepage = "https://streetpea.github.io/chiaki-ng/";
116     description = "Next-Generation of Chiaki (the open-source remote play client for PlayStation)";
117     # Includes OpenSSL linking exception that we currently have no way
118     # to represent.
119     #
120     # See also: <https://github.com/spdx/license-list-XML/issues/939>
121     license = licenses.agpl3Only;
122     maintainers = with maintainers; [ devusb ];
123     platforms = platforms.linux;
124     mainProgram = "chiaki";
125   };