nixpkgs/pkgs/tools/wayland/wl-mirror/default.nix

63 lines
1.4 KiB
Nix
Raw Normal View History

2021-11-26 20:03:06 +03:00
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, wayland
, wayland-protocols
, wayland-scanner
, wlr-protocols
, libGL
2022-01-01 14:59:49 +03:00
, installExampleScripts ? true
, makeWrapper
, pipectl
, slurp
, rofi
2021-11-26 20:03:06 +03:00
}:
2022-01-01 14:59:49 +03:00
let
wl-present-binpath = lib.makeBinPath [
pipectl
rofi
slurp
(placeholder "out")
];
in
2021-11-26 20:03:06 +03:00
stdenv.mkDerivation rec {
pname = "wl-mirror";
2022-01-01 14:59:49 +03:00
version = "0.8.1";
2021-11-26 20:03:06 +03:00
src = fetchFromGitHub {
owner = "Ferdi265";
repo = "wl-mirror";
rev = "v${version}";
2022-01-01 14:59:49 +03:00
hash = "sha256-P5rvZPpIStlOSGj3PaiXAMPWqgWpkC+4IrixEMwoGJU=";
2021-11-26 20:03:06 +03:00
};
patchPhase = ''
substituteInPlace CMakeLists.txt \
--replace 'WL_PROTOCOL_DIR "/usr' 'WL_PROTOCOL_DIR "${wayland-protocols}' \
--replace 'WLR_PROTOCOL_DIR "/usr' 'WLR_PROTOCOL_DIR "${wlr-protocols}'
'';
2022-01-01 14:59:49 +03:00
cmakeFlags = [
"-DINSTALL_EXAMPLE_SCRIPTS=${if installExampleScripts then "ON" else "OFF"}"
2021-11-26 20:03:06 +03:00
];
2022-01-01 14:59:49 +03:00
postInstall = lib.optionalString installExampleScripts ''
wrapProgram $out/bin/wl-present --prefix PATH ":" ${wl-present-binpath}
'';
nativeBuildInputs = [ cmake pkg-config wayland-scanner makeWrapper ];
buildInputs = [ libGL wayland wayland-protocols wlr-protocols ];
2021-11-26 20:03:06 +03:00
meta = with lib; {
homepage = "https://github.com/Ferdi265/wl-mirror";
description = "Mirrors an output onto a Wayland surface.";
license = licenses.gpl3;
maintainers = with maintainers; [ synthetica twitchyliquid64 ];
2021-11-26 20:03:06 +03:00
platforms = platforms.linux;
};
}