|
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + fetchgit, |
| 5 | + pkg-config, |
| 6 | + meson, |
| 7 | + ninja, |
| 8 | + makeWrapper, |
| 9 | + gpu-screen-recorder, |
| 10 | + gpu-screen-recorder-notification, |
| 11 | + libX11, |
| 12 | + libXrender, |
| 13 | + libXrandr, |
| 14 | + libXcomposite, |
| 15 | + libXi, |
| 16 | + libXcursor, |
| 17 | + libglvnd, |
| 18 | + wrapperDir ? "/run/wrappers/bin", |
| 19 | + gitUpdater, |
| 20 | +}: |
| 21 | + |
| 22 | +stdenv.mkDerivation rec { |
| 23 | + pname = "gpu-screen-recorder-ui"; |
| 24 | + version = "1.1.7"; |
| 25 | + |
| 26 | + src = fetchgit { |
| 27 | + url = "https://repo.dec05eba.com/${pname}"; |
| 28 | + tag = version; |
| 29 | + hash = "sha256-8KBBuZhb5e/Xh2MwxHSVXLETQz9Koi+0IEdp2adp0aM="; |
| 30 | + }; |
| 31 | + |
| 32 | + postPatch = '' |
| 33 | + substituteInPlace depends/mglpp/depends/mgl/src/gl.c \ |
| 34 | + --replace-fail "libGL.so.1" "${lib.getLib libglvnd}/lib/libGL.so.1" \ |
| 35 | + --replace-fail "libGLX.so.0" "${lib.getLib libglvnd}/lib/libGLX.so.0" \ |
| 36 | + --replace-fail "libEGL.so.1" "${lib.getLib libglvnd}/lib/libEGL.so.1" |
| 37 | +
|
| 38 | + substituteInPlace extra/gpu-screen-recorder-ui.service \ |
| 39 | + --replace-fail "ExecStart=${meta.mainProgram}" "ExecStart=$out/bin/${meta.mainProgram}" |
| 40 | + ''; |
| 41 | + |
| 42 | + nativeBuildInputs = [ |
| 43 | + pkg-config |
| 44 | + meson |
| 45 | + ninja |
| 46 | + makeWrapper |
| 47 | + ]; |
| 48 | + |
| 49 | + buildInputs = [ |
| 50 | + libX11 |
| 51 | + libXrender |
| 52 | + libXrandr |
| 53 | + libXcomposite |
| 54 | + libXi |
| 55 | + libXcursor |
| 56 | + libglvnd |
| 57 | + ]; |
| 58 | + |
| 59 | + mesonFlags = [ |
| 60 | + # Handled by the module |
| 61 | + (lib.mesonBool "capabilities" false) |
| 62 | + ]; |
| 63 | + |
| 64 | + postInstall = |
| 65 | + let |
| 66 | + gpu-screen-recorder-wrapped = gpu-screen-recorder.override { |
| 67 | + inherit wrapperDir; |
| 68 | + }; |
| 69 | + in |
| 70 | + '' |
| 71 | + wrapProgram "$out/bin/${meta.mainProgram}" \ |
| 72 | + --prefix PATH : "${wrapperDir}" \ |
| 73 | + --suffix PATH : "${ |
| 74 | + lib.makeBinPath [ |
| 75 | + gpu-screen-recorder-wrapped |
| 76 | + gpu-screen-recorder-notification |
| 77 | + ] |
| 78 | + }" |
| 79 | + ''; |
| 80 | + |
| 81 | + passthru.updateScript = gitUpdater { }; |
| 82 | + |
| 83 | + meta = { |
| 84 | + description = "A fullscreen overlay UI for GPU Screen Recorder in the style of ShadowPlay"; |
| 85 | + homepage = "https://git.dec05eba.com/${pname}/about/"; |
| 86 | + license = lib.licenses.gpl3Only; |
| 87 | + mainProgram = "gsr-ui"; |
| 88 | + maintainers = with lib.maintainers; [ js6pak ]; |
| 89 | + platforms = lib.platforms.linux; |
| 90 | + }; |
| 91 | +} |
0 commit comments