Skip to content

Commit

Permalink
Merge pull request #193187 from xgroleau/slint-lsp/init-0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Oct 7, 2022
2 parents bd75150 + 43d8a46 commit 299ec2c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
66 changes: 66 additions & 0 deletions pkgs/development/tools/misc/slint-lsp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ lib
, stdenv
, rustPlatform
, fetchCrate
, pkg-config
, cmake
, fontconfig
, libGL
, libxcb
, libX11
, libXcursor
, libXi
, libXrandr
, libxkbcommon
, wayland
# Darwin Frameworks
, AppKit
, CoreGraphics
, CoreServices
, CoreText
, Foundation
, libiconv
, OpenGL
}:

let
rpathLibs = [ fontconfig libGL libxcb libX11 libXcursor libXrandr libXi ]
++ lib.optionals stdenv.isLinux [ libxkbcommon wayland ];
in
rustPlatform.buildRustPackage rec {
pname = "slint-lsp";
version = "0.3.0";

src = fetchCrate {
inherit pname version;
sha256 = "sha256-dZYkiYrotW8td5dxnPSvDzkWf+xV4ceISVLRZx2goXo=";
};

cargoSha256 = "sha256-9zbA9JXfLdosCU6gVsrsAyiyX8Qh6x5wMw1W4QKqbp4=";

nativeBuildInputs = [ cmake pkg-config fontconfig ];
buildInputs = rpathLibs ++ [ 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 ];
};
}
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17373,6 +17373,11 @@ with pkgs;

slimerjs = callPackage ../development/tools/slimerjs {};

slint-lsp = callPackage ../development/tools/misc/slint-lsp {
inherit (xorg) libXcursor libXi;
inherit (darwin.apple_sdk.frameworks) AppKit CoreGraphics CoreServices CoreText Foundation OpenGL;
};

sloccount = callPackage ../development/tools/misc/sloccount { };

sloc = nodePackages.sloc;
Expand Down

0 comments on commit 299ec2c

Please sign in to comment.