2022-10-07 17:53:42 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, fontconfig
|
|
|
|
, libGL
|
2022-10-14 00:16:16 +02:00
|
|
|
, xorg
|
2022-10-07 17:53:42 +02:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
|
|
|
# Darwin Frameworks
|
|
|
|
, AppKit
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreServices
|
|
|
|
, CoreText
|
|
|
|
, Foundation
|
|
|
|
, libiconv
|
|
|
|
, OpenGL
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-10-14 00:16:16 +02:00
|
|
|
rpathLibs = [ fontconfig libGL xorg.libxcb xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi ]
|
2022-10-07 17:53:42 +02:00
|
|
|
++ lib.optionals stdenv.isLinux [ libxkbcommon wayland ];
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "slint-lsp";
|
2023-04-19 00:10:43 +02:00
|
|
|
version = "1.0.0";
|
2022-10-07 17:53:42 +02:00
|
|
|
|
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2023-04-19 00:10:43 +02:00
|
|
|
sha256 = "sha256-Ua8ENLxmfYv6zF/uihT49ZpphFaC3zS882cttJ/rvc4=";
|
2022-10-07 17:53:42 +02:00
|
|
|
};
|
|
|
|
|
2023-04-19 00:10:43 +02:00
|
|
|
cargoHash = "sha256-IzjOAy9zTtsD4jHjI1oVXBg7Si1AeDNH8ATK4yO8WVw=";
|
2022-10-07 17:53:42 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config fontconfig ];
|
2022-10-14 00:16:16 +02:00
|
|
|
buildInputs = rpathLibs ++ [ xorg.libxcb.dev ]
|
2022-10-07 17:53:42 +02:00
|
|
|
++ 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 ];
|
|
|
|
};
|
|
|
|
}
|