Files
nixpkgs/pkgs/by-name/sw/switchres/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

64 lines
1.3 KiB
Nix

{
stdenv,
lib,
pkg-config,
fetchFromGitHub,
xorg,
libdrm,
SDL2,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "switchres";
version = "2.2.1";
src = fetchFromGitHub {
owner = "antonioginer";
repo = "switchres";
tag = "v${finalAttrs.version}";
hash = "sha256-/21RcpumWYNBPck7gpH6krwC3Thz/rKDPgeJblN2BDA=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
xorg.libXrandr
xorg.xorgproto
libdrm
SDL2
];
patchPhase = ''
runHook prePatch
substituteInPlace ./custom_video_xrandr.cpp \
--replace-fail libX11.so ${xorg.libX11}/lib/libX11.so \
--replace-fail libXrandr.so ${xorg.libXrandr}/lib/libXrandr.so
substituteInPlace ./custom_video_drmkms.cpp \
--replace-fail libdrm.so ${libdrm}/lib/libdrm.so \
runHook postPatch
'';
env = {
PREFIX = "$(out)";
};
preInstall = ''
install -Dm755 switchres $out/bin/switchres
'';
meta = {
description = "Modeline generation engine for emulation";
homepage = "https://github.com/antonioginer/switchres";
changelog = "https://github.com/antonioginer/switchres/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Only;
mainProgram = "switchres";
maintainers = with lib.maintainers; [ bot-wxt1221 ];
platforms = lib.platforms.linux;
};
})