2024-09-18 16:29:20 +00:00
|
|
|
{ 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";
|
2024-09-18 16:29:20 +00:00
|
|
|
hash = "sha256-t/Ttlvc9LCRW624oSsFaP8EmswJ3OAn86QgF1dCUjAs=";
|
2020-11-01 15:34:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gimx";
|
2024-09-18 16:29:20 +00:00
|
|
|
version = "8.0";
|
2020-11-01 15:34:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matlo";
|
|
|
|
repo = "GIMX";
|
2024-09-18 16:29:20 +00:00
|
|
|
rev = "v${version}";
|
2020-11-01 15:34:33 +00:00
|
|
|
fetchSubmodules = true;
|
2024-09-18 16:29:20 +00:00
|
|
|
hash = "sha256-BcFLdQgEAi6Sxyb5/P9YAIkmeXNZXrKcOa/6g817xQg=";
|
2020-11-01 15:34:33 +00:00
|
|
|
};
|
|
|
|
|
2024-09-18 16:29:20 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error";
|
|
|
|
patches = [ ./conf.patch ./gcc14.patch ];
|
2024-02-08 08:29:56 +00:00
|
|
|
|
2020-11-01 15:34:33 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2024-09-18 16:29:20 +00:00
|
|
|
buildInputs = [ curl libusb1 bluez libxml2 ncurses5 libmhash xorg.libX11 xorg.libXi ];
|
2022-10-03 13:56:51 +00:00
|
|
|
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
|
2024-09-18 16:29:20 +00:00
|
|
|
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
|
2024-09-18 16:29:20 +00:00
|
|
|
cp -r ${gimx-config}/Linux $out/share
|
2020-11-01 15:34:33 +00:00
|
|
|
|
2024-09-18 16:29:20 +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
|
|
|
|
2024-09-18 16:29:20 +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;
|
|
|
|
};
|
|
|
|
}
|