depot/third_party/nixpkgs/pkgs/development/tools/misc/slint-lsp/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

62 lines
1.4 KiB
Nix

{ lib
, stdenv
, rustPlatform
, fetchCrate
, pkg-config
, cmake
, fontconfig
, libGL
, xorg
, libxkbcommon
, wayland
# Darwin Frameworks
, AppKit
, CoreGraphics
, CoreServices
, CoreText
, Foundation
, libiconv
, OpenGL
}:
let
rpathLibs = [ fontconfig libGL xorg.libxcb xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi ]
++ lib.optionals stdenv.isLinux [ libxkbcommon wayland ];
in
rustPlatform.buildRustPackage rec {
pname = "slint-lsp";
version = "1.3.2";
src = fetchCrate {
inherit pname version;
sha256 = "sha256-zNTel91c1ECg4z7xIu37GcSWHTxTKtxpGjH3TpiFQ1k=";
};
cargoHash = "sha256-pT3z6t1W/DitH/GJJIJhQawslodKzIkCyO0yd9OlvAg=";
nativeBuildInputs = [ cmake pkg-config fontconfig ];
buildInputs = rpathLibs ++ [ xorg.libxcb.dev ]
++ lib.optionals stdenv.isDarwin [
AppKit
CoreGraphics
CoreServices
CoreText
Foundation
libiconv
OpenGL
];
postInstall = lib.optionalString stdenv.isLinux ''
patchelf --set-rpath ${lib.makeLibraryPath rpathLibs} $out/bin/slint-lsp
'';
dontPatchELF = true;
meta = with lib; {
description = "Language Server Protocol (LSP) for Slint UI language";
homepage = "https://slint-ui.com/";
changelog = "https://github.com/slint-ui/slint/blob/v${version}/CHANGELOG.md";
license = with licenses; [ gpl3Plus ];
maintainers = with maintainers; [ xgroleau ];
};
}