Files
nixpkgs/pkgs/by-name/mo/moltengamepad/package.nix
Marcin Serwin 217c457722 moltengamepad: unstable-2016-05-04 -> 1.2.1
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2026-06-08 17:45:57 +02:00

63 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
udev,
go-md2man,
linuxHeaders,
installShellFiles,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "moltengamepad";
version = "1.2.1";
src = fetchFromGitHub {
owner = "jgeumlek";
repo = "MoltenGamepad";
tag = "v${finalAttrs.version}";
hash = "sha256-pfUx5wUkXcshHvBoD47ZRHfJPGHPSzz72H3WBIauFw0=";
};
postPatch = ''
# https://github.com/jgeumlek/MoltenGamepad/pull/99
sed -e '16i#include <memory>' -i source/core/uinput.h
sed -e '8i#include <string>' -i source/core/udev.h
'';
strictDeps = true;
__structuredAttrs = true;
enableParallelBuilding = true;
nativeBuildInputs = [
go-md2man
installShellFiles
];
buildInputs = [ udev ];
preBuild = ''
make eventlists INPUT_HEADER=${linuxHeaders}/include/linux/input-event-codes.h
'';
installPhase = ''
runHook preInstall
installBin moltengamepad
installManPage documentation/moltengamepad.1
runHook postInstall
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
homepage = "https://github.com/jgeumlek/MoltenGamepad";
description = "Flexible Linux input device translator, geared for gamepads";
mainProgram = "moltengamepad";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
};
})