2023-08-12 19:56:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, fetchpatch, libGL, libX11 }:
|
2019-07-15 18:11:55 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libstrangle";
|
2022-04-17 10:25:04 +00:00
|
|
|
version = "unstable-202202022";
|
2019-07-15 18:11:55 +00:00
|
|
|
|
2021-01-09 16:02:57 +00:00
|
|
|
buildInputs = [ libGL libX11 ];
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "torkel104";
|
2019-07-15 18:11:55 +00:00
|
|
|
repo = pname;
|
2022-04-17 10:25:04 +00:00
|
|
|
rev = "0273e318e3b0cc759155db8729ad74266b74cb9b";
|
2024-07-13 13:27:47 +00:00
|
|
|
hash = "sha256-h10QA7m7hIQHq1g/vCYuZsFR2NVbtWBB46V6OWP5wgM=";
|
2019-07-15 18:11:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [ "prefix=" "DESTDIR=$(out)" ];
|
|
|
|
|
2022-04-17 10:25:04 +00:00
|
|
|
patches = [
|
2023-08-12 19:56:19 +00:00
|
|
|
./nixos.patch
|
|
|
|
# Pull the fix pending upstream inclusion for gcc-13:
|
|
|
|
# https://gitlab.com/torkel104/libstrangle/-/merge_requests/29
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://gitlab.com/torkel104/libstrangle/-/commit/4e17025071de1d99630febe7270b4f63056d0dfa.patch";
|
|
|
|
hash = "sha256-AKMHAZhCPcn62pi4fBGhw2r8SNSkCDMUCpR3IlmJ7wQ=";
|
|
|
|
})
|
2022-04-17 10:25:04 +00:00
|
|
|
];
|
2019-07-15 18:11:55 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteAllInPlace src/strangle.sh
|
2021-01-09 16:02:57 +00:00
|
|
|
substituteAllInPlace src/stranglevk.sh
|
2019-07-15 18:11:55 +00:00
|
|
|
'';
|
2022-06-29 22:40:01 +00:00
|
|
|
postInstall = ''
|
2022-07-07 16:33:27 +00:00
|
|
|
substitute $out/share/vulkan/implicit_layer.d/libstrangle_vk.json $out/share/vulkan/implicit_layer.d/libstrangle_vk.x86.json \
|
|
|
|
--replace "libstrangle_vk.so" "$out/lib/libstrangle/lib32/libstrangle_vk.so"
|
2022-06-29 22:40:01 +00:00
|
|
|
substituteInPlace $out/share/vulkan/implicit_layer.d/libstrangle_vk.json \
|
|
|
|
--replace "libstrangle_vk.so" "$out/lib/libstrangle/lib64/libstrangle_vk.so"
|
|
|
|
'';
|
2019-07-15 18:11:55 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 16:02:57 +00:00
|
|
|
homepage = "https://gitlab.com/torkel104/libstrangle";
|
2019-07-15 18:11:55 +00:00
|
|
|
description = "Frame rate limiter for Linux/OpenGL";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ aske ];
|
2021-04-27 17:45:51 +00:00
|
|
|
mainProgram = "strangle";
|
2019-07-15 18:11:55 +00:00
|
|
|
};
|
|
|
|
}
|