xdg-desktop-portal-hyprland/nix/default.nix
Mihai Fufezan 21d216ed7f
CMake: get rid of Makefile and Ninja (#154)
* CMake: get rid of Makefile

* Nix: build using CMake
2024-01-04 16:20:11 +01:00

75 lines
1.4 KiB
Nix

{
lib,
stdenv,
cmake,
makeWrapper,
pkg-config,
wayland-scanner,
wrapQtAppsHook,
hyprland,
hyprland-protocols,
hyprlang,
libdrm,
mesa,
pipewire,
qtbase,
qttools,
qtwayland,
sdbus-cpp,
slurp,
systemd,
wayland,
wayland-protocols,
debug ? false,
version ? "git",
}:
stdenv.mkDerivation {
pname = "xdg-desktop-portal-hyprland" + lib.optionalString debug "-debug";
inherit version;
src = ../.;
cmakeFlags = lib.optional debug (lib.strings.cmakeFeature "CMAKE_BUILD_TYPE" "DEBUG");
nativeBuildInputs = [
cmake
makeWrapper
pkg-config
wayland-scanner
wrapQtAppsHook
];
buildInputs = [
hyprland-protocols
hyprlang
libdrm
mesa
pipewire
qtbase
qttools
qtwayland
sdbus-cpp
systemd
wayland
wayland-protocols
];
dontWrapQtApps = true;
postInstall = ''
wrapProgramShell $out/bin/hyprland-share-picker \
"''${qtWrapperArgs[@]}" \
--prefix PATH ":" ${lib.makeBinPath [slurp hyprland]}
wrapProgramShell $out/libexec/xdg-desktop-portal-hyprland \
--prefix PATH ":" ${lib.makeBinPath [(placeholder "out")]}
'';
meta = with lib; {
homepage = "https://github.com/hyprwm/xdg-desktop-portal-hyprland";
description = "xdg-desktop-portal backend for Hyprland";
license = licenses.bsd3;
maintainers = with maintainers; [fufexan];
platforms = platforms.linux;
};
}