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