Files
nixpkgs/pkgs/by-name/wl/wl-mirror/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

96 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
wayland,
wayland-protocols,
wayland-scanner,
wlr-protocols,
libGL,
libgbm,
bash,
installExampleScripts ? true,
makeWrapper,
installShellFiles,
pipectl,
slurp,
rofi,
scdoc,
}:
let
wl-present-binpath = lib.makeBinPath [
pipectl
rofi
slurp
(placeholder "out")
];
in
stdenv.mkDerivation rec {
pname = "wl-mirror";
version = "0.18.3";
src = fetchFromGitHub {
owner = "Ferdi265";
repo = "wl-mirror";
rev = "v${version}";
hash = "sha256-xj+CZPHeMAisOMB8mYSIc2jAa5iQD5pM+Stccq4gnak=";
};
strictDeps = true;
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
cmake
pkg-config
wayland-scanner
scdoc
makeWrapper
installShellFiles
];
buildInputs = [
libGL
libgbm
wayland
wayland-protocols
wlr-protocols
bash
];
postPatch = ''
echo 'v${version}' > version.txt
substituteInPlace CMakeLists.txt \
--replace 'WL_PROTOCOL_DIR "/usr' 'WL_PROTOCOL_DIR "${wayland-protocols}' \
--replace 'WLR_PROTOCOL_DIR "/usr' 'WLR_PROTOCOL_DIR "${wlr-protocols}'
'';
cmakeFlags = [
"-DINSTALL_EXAMPLE_SCRIPTS=${if installExampleScripts then "ON" else "OFF"}"
"-DINSTALL_DOCUMENTATION=ON"
"-DWITH_GBM=ON"
];
postInstall = ''
installShellCompletion --cmd wl-mirror \
--bash ../scripts/completions/bash-completions/_wl-mirror \
--zsh ../scripts/completions/zsh-completions/_wl-mirror
installShellCompletion --cmd wl-present \
--bash ../scripts/completions/bash-completions/_wl-present \
--zsh ../scripts/completions/zsh-completions/_wl-present
''
+ lib.optionalString installExampleScripts ''
wrapProgram $out/bin/wl-present --prefix PATH ":" ${wl-present-binpath}
'';
meta = with lib; {
homepage = "https://github.com/Ferdi265/wl-mirror";
description = "Simple Wayland output mirror client";
license = licenses.gpl3;
maintainers = with maintainers; [ synthetica ];
platforms = platforms.linux;
};
}