blob: 5bfa4fa851fb1fdda0c62b527db933bbb4b45dee [file] [log] [blame]
{ inputs, system, lib, pkg-config, rustPlatform, libclang, xcb-util-cursor, xorg, musl, makeWrapper }: let
src = inputs.xwayland-satellite;
libraries = [
xcb-util-cursor
xorg.libxcb
musl
];
includeArgs = map (library: ''-I"${library.dev}/include"'') libraries;
libraryArgs = map (library: ''-L"${library}/lib"'') libraries;
extraClangArgs = builtins.concatStringsSep " " (includeArgs ++ libraryArgs);
xwayland = inputs.nixpkgs-xwayland-23.legacyPackages.${system}.xwayland; # needed to avoid steam big picture mode failing, see https://github.com/Supreeeme/xwayland-satellite/issues/18
in rustPlatform.buildRustPackage {
pname = "xwayland-satellite";
version = "unstable-${src.lastModifiedDate}";
inherit src;
cargoLock.lockFile = "${src}/Cargo.lock";
preBuild = ''
export LIBCLANG_PATH="${libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS='${extraClangArgs}'
export LIBRARY_PATH="${lib.makeLibraryPath libraries}"
'';
doCheck = false; # xwayland-satellite fails checks due to not being wrapped at this point...
nativeBuildInputs = libraries ++ [
libclang.lib
pkg-config
makeWrapper
];
postInstall = ''
wrapProgram $out/bin/xwayland-satellite --suffix PATH : ${lib.makeBinPath [ xwayland ]}
'';
buildInputs = [
xwayland
];
meta = {
description = "Allow rootless xwayland integration for wayland compositors";
homepage = "https://github.com/Supreeeme/xwayland-satellite";
license = lib.licenses.mpl20;
maintainers = [ lib.maintainers.minion3665 ];
};
}