nixpkgs/pkgs/games/gimx/default.nix

55 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, libusb1, bluez, libxml2, ncurses5, libmhash, xorg }:
2020-11-01 15:34:33 +00:00
let
gimx-config = fetchFromGitHub {
owner = "matlo";
repo = "GIMX-configurations";
2021-03-22 11:37:31 +00:00
rev = "c20300f24d32651d369e2b27614b62f4b856e4a0";
hash = "sha256-t/Ttlvc9LCRW624oSsFaP8EmswJ3OAn86QgF1dCUjAs=";
2020-11-01 15:34:33 +00:00
};
in stdenv.mkDerivation rec {
pname = "gimx";
version = "8.0";
2020-11-01 15:34:33 +00:00
src = fetchFromGitHub {
owner = "matlo";
repo = "GIMX";
rev = "v${version}";
2020-11-01 15:34:33 +00:00
fetchSubmodules = true;
hash = "sha256-BcFLdQgEAi6Sxyb5/P9YAIkmeXNZXrKcOa/6g817xQg=";
2020-11-01 15:34:33 +00:00
};
env.NIX_CFLAGS_COMPILE = "-Wno-error";
patches = [ ./conf.patch ./gcc14.patch ];
2020-11-01 15:34:33 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ curl libusb1 bluez libxml2 ncurses5 libmhash xorg.libX11 xorg.libXi ];
makeFlags = [ "build-core" ];
2022-12-23 16:57:29 +00:00
2020-11-01 15:34:33 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out
substituteInPlace ./core/Makefile --replace-fail "chmod ug+s" "echo"
2020-11-01 15:34:33 +00:00
export DESTDIR="$out"
make install-shared install-core
mv $out/usr/lib $out/lib
mv $out/usr/bin $out/bin
cp -r ${gimx-config}/Linux $out/share
2020-11-01 15:34:33 +00:00
makeWrapper $out/bin/gimx $out/bin/gimx-ds4 \
--add-flags "--nograb" --add-flags "-p /dev/ttyUSB0" \
--add-flags "-c $out/share/Dualshock4.xml"
2020-11-01 15:34:33 +00:00
runHook postInstall
2020-11-01 15:34:33 +00:00
'';
meta = with lib; {
homepage = "https://github.com/matlo/GIMX";
description = "Game Input Multiplexer";
license = licenses.gpl3Only;
platforms = platforms.linux;
};
}