nixpkgs/pkgs/applications/misc/lutris/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

154 lines
2.5 KiB
Nix
Raw Normal View History

2021-07-03 12:46:45 +00:00
{ buildPythonApplication
, lib
, fetchFromGitHub
2023-10-20 11:59:19 +00:00
, fetchpatch
2021-07-03 12:46:45 +00:00
# build inputs
, atk
2022-04-02 20:22:45 +00:00
, file
, gdk-pixbuf
, glib-networking
, gnome-desktop
, gobject-introspection
, gst_all_1
, gtk3
, libnotify
, pango
, webkitgtk
, wrapGAppsHook
# check inputs
, xvfb-run
2022-04-02 20:22:45 +00:00
, nose2
, flake8
2021-07-03 12:46:45 +00:00
# python dependencies
2022-12-07 00:11:38 +00:00
, certifi
, dbus-python
, distro
, evdev
2021-04-03 07:24:37 +00:00
, lxml
, pillow
, pygobject3
2022-12-07 00:11:38 +00:00
, pypresence
, pyyaml
, requests
2023-02-12 19:32:00 +00:00
, protobuf
, moddb
2021-07-03 12:46:45 +00:00
# commands that lutris needs
, xrandr
, pciutils
, psmisc
, glxinfo
, vulkan-tools
, xboxdrv
, pulseaudio
, p7zip
, xgamma
, libstrangle
, fluidsynth
, xorgserver
2020-07-07 19:34:16 +00:00
, xorg
, util-linux
}:
let
# See lutris/util/linux.py
requiredTools = [
xrandr
pciutils
psmisc
glxinfo
vulkan-tools
xboxdrv
pulseaudio
p7zip
xgamma
libstrangle
fluidsynth
xorgserver
2020-07-07 19:34:16 +00:00
xorg.setxkbmap
xorg.xkbcomp
# bypass mount suid wrapper which does not work in fhsenv
util-linux
];
2021-07-03 12:46:45 +00:00
in
buildPythonApplication rec {
2022-12-17 03:39:52 +00:00
pname = "lutris-unwrapped";
version = "0.5.16";
src = fetchFromGitHub {
owner = "lutris";
repo = "lutris";
2023-02-12 19:32:00 +00:00
rev = "v${version}";
hash = "sha256-Ed1bhugBe97XmY050A5jCPcnLj0Fd7qPX2p/Ab+YbOE=";
};
nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];
buildInputs = [
atk
gdk-pixbuf
glib-networking
gnome-desktop
gtk3
libnotify
pango
webkitgtk
2022-12-17 03:39:52 +00:00
] ++ (with gst_all_1; [
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
gstreamer
]);
2022-12-07 00:11:38 +00:00
# See `install_requires` in https://github.com/lutris/lutris/blob/master/setup.py
propagatedBuildInputs = [
2022-12-07 00:11:38 +00:00
certifi
dbus-python
2021-04-03 07:24:37 +00:00
distro
2022-12-07 00:11:38 +00:00
evdev
2021-04-03 07:24:37 +00:00
lxml
2022-12-07 00:11:38 +00:00
pillow
2021-04-03 07:24:37 +00:00
pygobject3
2022-12-07 00:11:38 +00:00
pypresence
pyyaml
2021-04-03 07:24:37 +00:00
requests
2023-02-12 19:32:00 +00:00
protobuf
moddb
];
2022-04-02 20:22:45 +00:00
postPatch = ''
substituteInPlace lutris/util/magic.py \
--replace "'libmagic.so.1'" "'${lib.getLib file}/lib/libmagic.so.1'"
'';
nativeCheckInputs = [ xvfb-run nose2 flake8 ] ++ requiredTools;
checkPhase = ''
runHook preCheck
2022-12-17 03:39:52 +00:00
export HOME=$PWD
xvfb-run -s '-screen 0 800x600x24' make test
2022-12-17 03:39:52 +00:00
runHook postCheck
'';
# avoid double wrapping
dontWrapGApps = true;
makeWrapperArgs = [
2022-12-17 03:39:52 +00:00
"--prefix PATH : ${lib.makeBinPath requiredTools}"
"\${gappsWrapperArgs[@]}"
];
meta = with lib; {
homepage = "https://lutris.net";
description = "Open Source gaming platform for GNU/Linux";
2021-04-03 07:24:37 +00:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ Madouura ];
platforms = platforms.linux;
2023-08-04 19:10:05 +00:00
mainProgram = "lutris";
};
}