2021-11-26 17:03:06 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, wayland-scanner
|
|
|
|
, wlr-protocols
|
|
|
|
, libGL
|
2022-05-09 14:18:15 +00:00
|
|
|
, bash
|
2022-01-01 11:59:49 +00:00
|
|
|
, installExampleScripts ? true
|
|
|
|
, makeWrapper
|
|
|
|
, pipectl
|
|
|
|
, slurp
|
|
|
|
, rofi
|
2022-08-08 22:30:13 +00:00
|
|
|
, scdoc
|
2021-11-26 17:03:06 +00:00
|
|
|
}:
|
|
|
|
|
2022-01-01 11:59:49 +00:00
|
|
|
let
|
|
|
|
wl-present-binpath = lib.makeBinPath [
|
|
|
|
pipectl
|
|
|
|
rofi
|
|
|
|
slurp
|
|
|
|
(placeholder "out")
|
|
|
|
];
|
|
|
|
in
|
|
|
|
|
2021-11-26 17:03:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wl-mirror";
|
2024-03-03 05:20:43 +00:00
|
|
|
version = "0.16.2";
|
2021-11-26 17:03:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ferdi265";
|
|
|
|
repo = "wl-mirror";
|
|
|
|
rev = "v${version}";
|
2024-03-03 05:20:43 +00:00
|
|
|
hash = "sha256-srGqMqkkdJzcxN2sNToqDw/6B4OirlmKW1MXt1Nmvsk=";
|
2021-11-26 17:03:06 +00:00
|
|
|
};
|
|
|
|
|
2022-05-09 14:18:15 +00:00
|
|
|
strictDeps = true;
|
2023-08-11 13:23:24 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2022-08-08 22:30:13 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config wayland-scanner scdoc makeWrapper ];
|
2022-05-09 14:18:15 +00:00
|
|
|
buildInputs = [ libGL wayland wayland-protocols wlr-protocols bash ];
|
|
|
|
|
2022-04-12 17:33:56 +00:00
|
|
|
postPatch = ''
|
|
|
|
echo 'v${version}' > version.txt
|
2021-11-26 17:03:06 +00:00
|
|
|
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 11:59:49 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DINSTALL_EXAMPLE_SCRIPTS=${if installExampleScripts then "ON" else "OFF"}"
|
2022-08-08 22:30:13 +00:00
|
|
|
"-DINSTALL_DOCUMENTATION=ON"
|
2021-11-26 17:03:06 +00:00
|
|
|
];
|
|
|
|
|
2022-01-01 11:59:49 +00:00
|
|
|
postInstall = lib.optionalString installExampleScripts ''
|
|
|
|
wrapProgram $out/bin/wl-present --prefix PATH ":" ${wl-present-binpath}
|
|
|
|
'';
|
|
|
|
|
2021-11-26 17:03:06 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/Ferdi265/wl-mirror";
|
2024-06-07 07:46:46 +00:00
|
|
|
description = "Simple Wayland output mirror client";
|
2021-11-26 17:03:06 +00:00
|
|
|
license = licenses.gpl3;
|
2024-04-27 05:48:31 +00:00
|
|
|
maintainers = with maintainers; [ synthetica ];
|
2021-11-26 17:03:06 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|