Unverified Commit ad9c4be1 authored by Jared Baur's avatar Jared Baur Committed by GitHub
Browse files

Introduce multiple versions of ZLS (#438854)

parents c158e377 e6ff273e
Loading
Loading
Loading
Loading

pkgs/by-name/zl/zls/package.nix

deleted100644 → 0
+0 −40
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  zig_0_14,
  fetchFromGitHub,
  callPackage,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "zls";
  version = "0.14.0";

  src = fetchFromGitHub {
    owner = "zigtools";
    repo = "zls";
    tag = finalAttrs.version;
    fetchSubmodules = true;
    hash = "sha256-A5Mn+mfIefOsX+eNBRHrDVkqFDVrD3iXDNsUL4TPhKo=";
  };

  nativeBuildInputs = [ zig_0_14.hook ];

  postPatch = ''
    ln -s ${callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
  '';

  meta = {
    description = "Zig LSP implementation + Zig Language Server";
    mainProgram = "zls";
    changelog = "https://github.com/zigtools/zls/releases/tag/${finalAttrs.version}";
    homepage = "https://github.com/zigtools/zls";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      figsoda
      moni
      _0x5a4
    ];
    platforms = lib.platforms.unix;
  };
})
+66 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  zig_0_14,
  zig_0_15,
  fetchFromGitHub,
  callPackage,
}:

let
  common = finalAttrs: _: {
    pname = "zls";

    meta = {
      description = "Zig LSP implementation + Zig Language Server";
      mainProgram = "zls";
      changelog = "https://github.com/zigtools/zls/releases/tag/${finalAttrs.version}";
      homepage = "https://github.com/zigtools/zls";
      license = lib.licenses.mit;
      maintainers = with lib.maintainers; [
        figsoda
        moni
        _0x5a4
        jmbaur
      ];
      platforms = lib.platforms.unix;
    };
  };
in
lib.mapAttrs (_: extension: stdenv.mkDerivation (lib.extends common extension)) {
  zls_0_14 = finalAttrs: {
    version = "0.14.0";

    src = fetchFromGitHub {
      owner = "zigtools";
      repo = "zls";
      tag = finalAttrs.version;
      fetchSubmodules = true;
      hash = "sha256-A5Mn+mfIefOsX+eNBRHrDVkqFDVrD3iXDNsUL4TPhKo=";
    };

    nativeBuildInputs = [ zig_0_14.hook ];

    postPatch = ''
      ln -s ${callPackage ./deps_0_14.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
    '';
  };

  zls_0_15 = finalAttrs: {
    version = "0.15.0";

    src = fetchFromGitHub {
      owner = "zigtools";
      repo = "zls";
      tag = finalAttrs.version;
      fetchSubmodules = true;
      hash = "sha256-GFzSHUljcxy7sM1PaabbkQUdUnLwpherekPWJFxXtnk=";
    };

    nativeBuildInputs = [ zig_0_15.hook ];

    postPatch = ''
      ln -s ${callPackage ./deps_0_15.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
    '';
  };
}
+34 −0
Original line number Diff line number Diff line
# generated by zon2nix (https://github.com/nix-community/zon2nix)

{ linkFarm, fetchzip }:

linkFarm "zig-packages" [
  {
    name = "diffz-0.0.1-G2tlIQrOAQCfH15jdyaLyrMgV8eGPouFhkCeYFTmJaLk";
    path = fetchzip {
      url = "https://github.com/ziglibs/diffz/archive/a20dd1f11b10819a6f570f98b42e1c91e3704357.tar.gz";
      hash = "sha256-y7Ck5XZNnHxmPPWlDAqZZ2g3n67txj5/Zq04AhuW5+M=";
    };
  }
  {
    name = "N-V-__8AAMeOlQEipHjcyu0TCftdAi9AQe7EXUDJOoVe0k-t";
    path = fetchzip {
      url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz";
      hash = "sha256-HofqYJT1srDJ6Y1f18h7xtAbI/Gvvz0t9f0wBNnOZK8=";
    };
  }
  {
    name = "known_folders-0.0.0-Fy-PJkfRAAAVdptXWXBspIIC7EkVgLgWozU5zIk5Zgcy";
    path = fetchzip {
      url = "https://github.com/ziglibs/known-folders/archive/92defaee76b07487769ca352fd0ba95bc8b42a2f.tar.gz";
      hash = "sha256-+FviMdQGeHn2ymfXjIQPxLPx3haPy5zhPJuS3Ow8m68=";
    };
  }
  {
    name = "lsp_kit-0.1.0-bi_PL04yCgAxLsF0hH2a5sZKT84MGQaKXouw2jvCE8Nl";
    path = fetchzip {
      url = "https://github.com/zigtools/lsp-kit/archive/576e9405b1ab22c17c0f9318feed3278aa66b0ea.tar.gz";
      hash = "sha256-V6MSzc4Y9n6DK2cuZ62SKsvj2qeDVUxWVtbsWiRgtF4=";
    };
  }
]
+8 −0
Original line number Diff line number Diff line
@@ -9239,6 +9239,14 @@ with pkgs;

  zigStdenv = if stdenv.cc.isZig then stdenv else lowPrio zig.passthru.stdenv;

  inherit (callPackages ../development/tools/zls { })
    zls_0_14
    zls_0_15
    ;

  # This should be kept updated to ensure the default zls version matches the default zig version.
  zls = zls_0_14;

  libzint = zint-qt.override { withGUI = false; };

  aroccPackages = recurseIntoAttrs (callPackage ../development/compilers/arocc { });