Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 61 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitLab, 5 fetchpatch, 6 libGL, 7 libX11, 8}: 9 10stdenv.mkDerivation rec { 11 pname = "libstrangle"; 12 version = "unstable-202202022"; 13 14 buildInputs = [ 15 libGL 16 libX11 17 ]; 18 19 src = fetchFromGitLab { 20 owner = "torkel104"; 21 repo = pname; 22 rev = "0273e318e3b0cc759155db8729ad74266b74cb9b"; 23 hash = "sha256-h10QA7m7hIQHq1g/vCYuZsFR2NVbtWBB46V6OWP5wgM="; 24 }; 25 26 makeFlags = [ 27 "prefix=" 28 "DESTDIR=$(out)" 29 ]; 30 31 patches = [ 32 ./nixos.patch 33 # Pull the fix pending upstream inclusion for gcc-13: 34 # https://gitlab.com/torkel104/libstrangle/-/merge_requests/29 35 (fetchpatch { 36 name = "gcc-13.patch"; 37 url = "https://gitlab.com/torkel104/libstrangle/-/commit/4e17025071de1d99630febe7270b4f63056d0dfa.patch"; 38 hash = "sha256-AKMHAZhCPcn62pi4fBGhw2r8SNSkCDMUCpR3IlmJ7wQ="; 39 }) 40 ]; 41 42 postPatch = '' 43 substituteAllInPlace src/strangle.sh 44 substituteAllInPlace src/stranglevk.sh 45 ''; 46 postInstall = '' 47 substitute $out/share/vulkan/implicit_layer.d/libstrangle_vk.json $out/share/vulkan/implicit_layer.d/libstrangle_vk.x86.json \ 48 --replace "libstrangle_vk.so" "$out/lib/libstrangle/lib32/libstrangle_vk.so" 49 substituteInPlace $out/share/vulkan/implicit_layer.d/libstrangle_vk.json \ 50 --replace "libstrangle_vk.so" "$out/lib/libstrangle/lib64/libstrangle_vk.so" 51 ''; 52 53 meta = with lib; { 54 homepage = "https://gitlab.com/torkel104/libstrangle"; 55 description = "Frame rate limiter for Linux/OpenGL"; 56 license = licenses.gpl3; 57 platforms = [ "x86_64-linux" ]; 58 maintainers = with maintainers; [ aske ]; 59 mainProgram = "strangle"; 60 }; 61}