nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, rustPlatform
4, fetchCrate
5, pkg-config
6, cmake
7, fontconfig
8, libGL
9, xorg
10, libxkbcommon
11, wayland
12 # Darwin Frameworks
13, AppKit
14, CoreGraphics
15, CoreServices
16, CoreText
17, Foundation
18, libiconv
19, OpenGL
20}:
21
22let
23 rpathLibs = [ fontconfig libGL xorg.libxcb xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi ]
24 ++ lib.optionals stdenv.isLinux [ libxkbcommon wayland ];
25in
26rustPlatform.buildRustPackage rec {
27 pname = "slint-lsp";
28 version = "1.0.0";
29
30 src = fetchCrate {
31 inherit pname version;
32 sha256 = "sha256-Ua8ENLxmfYv6zF/uihT49ZpphFaC3zS882cttJ/rvc4=";
33 };
34
35 cargoHash = "sha256-IzjOAy9zTtsD4jHjI1oVXBg7Si1AeDNH8ATK4yO8WVw=";
36
37 nativeBuildInputs = [ cmake pkg-config fontconfig ];
38 buildInputs = rpathLibs ++ [ xorg.libxcb.dev ]
39 ++ lib.optionals stdenv.isDarwin [
40 AppKit
41 CoreGraphics
42 CoreServices
43 CoreText
44 Foundation
45 libiconv
46 OpenGL
47 ];
48
49 postInstall = lib.optionalString stdenv.isLinux ''
50 patchelf --set-rpath ${lib.makeLibraryPath rpathLibs} $out/bin/slint-lsp
51 '';
52
53 dontPatchELF = true;
54
55 meta = with lib; {
56 description = "Language Server Protocol (LSP) for Slint UI language";
57 homepage = "https://slint-ui.com/";
58 changelog = "https://github.com/slint-ui/slint/blob/v${version}/CHANGELOG.md";
59 license = with licenses; [ gpl3Plus ];
60 maintainers = with maintainers; [ xgroleau ];
61 };
62}