nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ buildPythonApplication
2, lib
3, fetchFromGitHub
4
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
18
19 # check inputs
20, xvfb-run
21, nose2
22, flake8
23
24 # python dependencies
25, certifi
26, dbus-python
27, distro
28, evdev
29, lxml
30, pillow
31, pygobject3
32, pypresence
33, pyyaml
34, requests
35, protobuf
36, moddb
37
38 # commands that lutris needs
39, xrandr
40, pciutils
41, psmisc
42, glxinfo
43, vulkan-tools
44, xboxdrv
45, pulseaudio
46, p7zip
47, xgamma
48, libstrangle
49, fluidsynth
50, xorgserver
51, xorg
52, util-linux
53}:
54
55let
56 # See lutris/util/linux.py
57 requiredTools = [
58 xrandr
59 pciutils
60 psmisc
61 glxinfo
62 vulkan-tools
63 xboxdrv
64 pulseaudio
65 p7zip
66 xgamma
67 libstrangle
68 fluidsynth
69 xorgserver
70 xorg.setxkbmap
71 xorg.xkbcomp
72 # bypass mount suid wrapper which does not work in fhsenv
73 util-linux
74 ];
75in
76buildPythonApplication rec {
77 pname = "lutris-unwrapped";
78 version = "0.5.13";
79
80 src = fetchFromGitHub {
81 owner = "lutris";
82 repo = "lutris";
83 rev = "v${version}";
84 hash = "sha256-ectrfbIkPhIqfhkavDpBCNdLPnGQhCnfFYwTf2IxB50=";
85 };
86
87 nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];
88 buildInputs = [
89 atk
90 gdk-pixbuf
91 glib-networking
92 gnome-desktop
93 gtk3
94 libnotify
95 pango
96 webkitgtk
97 ] ++ (with gst_all_1; [
98 gst-libav
99 gst-plugins-bad
100 gst-plugins-base
101 gst-plugins-good
102 gst-plugins-ugly
103 gstreamer
104 ]);
105
106 # See `install_requires` in https://github.com/lutris/lutris/blob/master/setup.py
107 propagatedBuildInputs = [
108 certifi
109 dbus-python
110 distro
111 evdev
112 lxml
113 pillow
114 pygobject3
115 pypresence
116 pyyaml
117 requests
118 protobuf
119 moddb
120 ];
121
122 postPatch = ''
123 substituteInPlace lutris/util/magic.py \
124 --replace "'libmagic.so.1'" "'${lib.getLib file}/lib/libmagic.so.1'"
125 '';
126
127 nativeCheckInputs = [ xvfb-run nose2 flake8 ] ++ requiredTools;
128 checkPhase = ''
129 runHook preCheck
130
131 export HOME=$PWD
132 xvfb-run -s '-screen 0 800x600x24' make test
133
134 runHook postCheck
135 '';
136
137 # avoid double wrapping
138 dontWrapGApps = true;
139 makeWrapperArgs = [
140 "--prefix PATH : ${lib.makeBinPath requiredTools}"
141 "\${gappsWrapperArgs[@]}"
142 ];
143
144 meta = with lib; {
145 homepage = "https://lutris.net";
146 description = "Open Source gaming platform for GNU/Linux";
147 license = licenses.gpl3Plus;
148 maintainers = with maintainers; [ Madouura ];
149 platforms = platforms.linux;
150 };
151}