python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / misc / lutris / default.nix
blobf60c478c6824e0c29c10a0a631645fe292fe6e11
1 { buildPythonApplication
2 , lib
3 , fetchFromGitHub
5   # build inputs
6 , atk
7 , file
8 , gdk-pixbuf
9 , glib-networking
10 , gnome-desktop
11 , gobject-introspection
12 , gst_all_1
13 , gtk3
14 , libnotify
15 , pango
16 , webkitgtk
17 , wrapGAppsHook
19   # check inputs
20 , xvfb-run
21 , nose2
22 , flake8
24   # python dependencies
25 , dbus-python
26 , distro
27 , evdev
28 , lxml
29 , pillow
30 , pygobject3
31 , pyyaml
32 , requests
33 , keyring
34 , python-magic
36   # commands that lutris needs
37 , xrandr
38 , pciutils
39 , psmisc
40 , glxinfo
41 , vulkan-tools
42 , xboxdrv
43 , pulseaudio
44 , p7zip
45 , xgamma
46 , libstrangle
47 , wine
48 , fluidsynth
49 , xorgserver
50 , xorg
53 let
54   # See lutris/util/linux.py
55   requiredTools = [
56     xrandr
57     pciutils
58     psmisc
59     glxinfo
60     vulkan-tools
61     xboxdrv
62     pulseaudio
63     p7zip
64     xgamma
65     libstrangle
66     wine
67     fluidsynth
68     xorgserver
69     xorg.setxkbmap
70     xorg.xkbcomp
71   ];
73   binPath = lib.makeBinPath requiredTools;
75   gstDeps = with gst_all_1; [
76     gst-libav
77     gst-plugins-bad
78     gst-plugins-base
79     gst-plugins-good
80     gst-plugins-ugly
81     gstreamer
82   ];
85 buildPythonApplication rec {
86   pname = "lutris-original";
87   version = "0.5.11";
89   src = fetchFromGitHub {
90     owner = "lutris";
91     repo = "lutris";
92     rev = "refs/tags/v${version}";
93     sha256 = "sha256-D2qMKYmi5TC8jEAECcz2V0rUrmp5kjXJ5qyW6C4re3w=";
94   };
96   nativeBuildInputs = [ wrapGAppsHook ];
97   buildInputs = [
98     atk
99     gdk-pixbuf
100     glib-networking
101     gnome-desktop
102     gobject-introspection
103     gtk3
104     libnotify
105     pango
106     webkitgtk
107     python-magic
108   ] ++ gstDeps;
110   propagatedBuildInputs = [
111     evdev
112     distro
113     lxml
114     pyyaml
115     pygobject3
116     requests
117     pillow
118     dbus-python
119     keyring
120     python-magic
121   ];
123   postPatch = ''
124     substituteInPlace lutris/util/magic.py \
125       --replace "'libmagic.so.1'" "'${lib.getLib file}/lib/libmagic.so.1'"
126   '';
129   checkInputs = [ xvfb-run nose2 flake8 ] ++ requiredTools;
130   preCheck = "export HOME=$PWD";
131   checkPhase = ''
132     runHook preCheck
133     xvfb-run -s '-screen 0 800x600x24' make test
134     runHook postCheck
135   '';
137   # avoid double wrapping
138   dontWrapGApps = true;
139   makeWrapperArgs = [
140     "--prefix PATH : ${binPath}"
141     "\${gappsWrapperArgs[@]}"
142   ];
143   # needed for glib-schemas to work correctly (will crash on dialogues otherwise)
144   # see https://github.com/NixOS/nixpkgs/issues/56943
145   strictDeps = false;
147   meta = with lib; {
148     homepage = "https://lutris.net";
149     description = "Open Source gaming platform for GNU/Linux";
150     license = licenses.gpl3Plus;
151     maintainers = with maintainers; [ Madouura ];
152     platforms = platforms.linux;
153   };