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 Permalink Normal View History

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