Introduce multiple versions of ZLS (#438854)

authored by

Jared Baur and committed by
GitHub
ad9c4be1 c158e377

+108 -40
pkgs/by-name/zl/zls/deps.nix pkgs/development/tools/zls/deps_0_14.nix
-40
pkgs/by-name/zl/zls/package.nix
··· 1 - { 2 - lib, 3 - stdenv, 4 - zig_0_14, 5 - fetchFromGitHub, 6 - callPackage, 7 - }: 8 - 9 - stdenv.mkDerivation (finalAttrs: { 10 - pname = "zls"; 11 - version = "0.14.0"; 12 - 13 - src = fetchFromGitHub { 14 - owner = "zigtools"; 15 - repo = "zls"; 16 - tag = finalAttrs.version; 17 - fetchSubmodules = true; 18 - hash = "sha256-A5Mn+mfIefOsX+eNBRHrDVkqFDVrD3iXDNsUL4TPhKo="; 19 - }; 20 - 21 - nativeBuildInputs = [ zig_0_14.hook ]; 22 - 23 - postPatch = '' 24 - ln -s ${callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p 25 - ''; 26 - 27 - meta = { 28 - description = "Zig LSP implementation + Zig Language Server"; 29 - mainProgram = "zls"; 30 - changelog = "https://github.com/zigtools/zls/releases/tag/${finalAttrs.version}"; 31 - homepage = "https://github.com/zigtools/zls"; 32 - license = lib.licenses.mit; 33 - maintainers = with lib.maintainers; [ 34 - figsoda 35 - moni 36 - _0x5a4 37 - ]; 38 - platforms = lib.platforms.unix; 39 - }; 40 - })
+66
pkgs/development/tools/zls/default.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + zig_0_14, 5 + zig_0_15, 6 + fetchFromGitHub, 7 + callPackage, 8 + }: 9 + 10 + let 11 + common = finalAttrs: _: { 12 + pname = "zls"; 13 + 14 + meta = { 15 + description = "Zig LSP implementation + Zig Language Server"; 16 + mainProgram = "zls"; 17 + changelog = "https://github.com/zigtools/zls/releases/tag/${finalAttrs.version}"; 18 + homepage = "https://github.com/zigtools/zls"; 19 + license = lib.licenses.mit; 20 + maintainers = with lib.maintainers; [ 21 + figsoda 22 + moni 23 + _0x5a4 24 + jmbaur 25 + ]; 26 + platforms = lib.platforms.unix; 27 + }; 28 + }; 29 + in 30 + lib.mapAttrs (_: extension: stdenv.mkDerivation (lib.extends common extension)) { 31 + zls_0_14 = finalAttrs: { 32 + version = "0.14.0"; 33 + 34 + src = fetchFromGitHub { 35 + owner = "zigtools"; 36 + repo = "zls"; 37 + tag = finalAttrs.version; 38 + fetchSubmodules = true; 39 + hash = "sha256-A5Mn+mfIefOsX+eNBRHrDVkqFDVrD3iXDNsUL4TPhKo="; 40 + }; 41 + 42 + nativeBuildInputs = [ zig_0_14.hook ]; 43 + 44 + postPatch = '' 45 + ln -s ${callPackage ./deps_0_14.nix { }} $ZIG_GLOBAL_CACHE_DIR/p 46 + ''; 47 + }; 48 + 49 + zls_0_15 = finalAttrs: { 50 + version = "0.15.0"; 51 + 52 + src = fetchFromGitHub { 53 + owner = "zigtools"; 54 + repo = "zls"; 55 + tag = finalAttrs.version; 56 + fetchSubmodules = true; 57 + hash = "sha256-GFzSHUljcxy7sM1PaabbkQUdUnLwpherekPWJFxXtnk="; 58 + }; 59 + 60 + nativeBuildInputs = [ zig_0_15.hook ]; 61 + 62 + postPatch = '' 63 + ln -s ${callPackage ./deps_0_15.nix { }} $ZIG_GLOBAL_CACHE_DIR/p 64 + ''; 65 + }; 66 + }
+34
pkgs/development/tools/zls/deps_0_15.nix
··· 1 + # generated by zon2nix (https://github.com/nix-community/zon2nix) 2 + 3 + { linkFarm, fetchzip }: 4 + 5 + linkFarm "zig-packages" [ 6 + { 7 + name = "diffz-0.0.1-G2tlIQrOAQCfH15jdyaLyrMgV8eGPouFhkCeYFTmJaLk"; 8 + path = fetchzip { 9 + url = "https://github.com/ziglibs/diffz/archive/a20dd1f11b10819a6f570f98b42e1c91e3704357.tar.gz"; 10 + hash = "sha256-y7Ck5XZNnHxmPPWlDAqZZ2g3n67txj5/Zq04AhuW5+M="; 11 + }; 12 + } 13 + { 14 + name = "N-V-__8AAMeOlQEipHjcyu0TCftdAi9AQe7EXUDJOoVe0k-t"; 15 + path = fetchzip { 16 + url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz"; 17 + hash = "sha256-HofqYJT1srDJ6Y1f18h7xtAbI/Gvvz0t9f0wBNnOZK8="; 18 + }; 19 + } 20 + { 21 + name = "known_folders-0.0.0-Fy-PJkfRAAAVdptXWXBspIIC7EkVgLgWozU5zIk5Zgcy"; 22 + path = fetchzip { 23 + url = "https://github.com/ziglibs/known-folders/archive/92defaee76b07487769ca352fd0ba95bc8b42a2f.tar.gz"; 24 + hash = "sha256-+FviMdQGeHn2ymfXjIQPxLPx3haPy5zhPJuS3Ow8m68="; 25 + }; 26 + } 27 + { 28 + name = "lsp_kit-0.1.0-bi_PL04yCgAxLsF0hH2a5sZKT84MGQaKXouw2jvCE8Nl"; 29 + path = fetchzip { 30 + url = "https://github.com/zigtools/lsp-kit/archive/576e9405b1ab22c17c0f9318feed3278aa66b0ea.tar.gz"; 31 + hash = "sha256-V6MSzc4Y9n6DK2cuZ62SKsvj2qeDVUxWVtbsWiRgtF4="; 32 + }; 33 + } 34 + ]
+8
pkgs/top-level/all-packages.nix
··· 9239 9239 9240 9240 zigStdenv = if stdenv.cc.isZig then stdenv else lowPrio zig.passthru.stdenv; 9241 9241 9242 + inherit (callPackages ../development/tools/zls { }) 9243 + zls_0_14 9244 + zls_0_15 9245 + ; 9246 + 9247 + # This should be kept updated to ensure the default zls version matches the default zig version. 9248 + zls = zls_0_14; 9249 + 9242 9250 libzint = zint-qt.override { withGUI = false; }; 9243 9251 9244 9252 aroccPackages = recurseIntoAttrs (callPackage ../development/compilers/arocc { });