diff --git a/pkgs/by-name/zl/zls/package.nix b/pkgs/by-name/zl/zls/package.nix deleted file mode 100644 index e03a7600f8df..000000000000 --- a/pkgs/by-name/zl/zls/package.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - 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; - }; -}) diff --git a/pkgs/development/tools/zls/default.nix b/pkgs/development/tools/zls/default.nix new file mode 100644 index 000000000000..235375a22599 --- /dev/null +++ b/pkgs/development/tools/zls/default.nix @@ -0,0 +1,66 @@ +{ + 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 + ''; + }; +} diff --git a/pkgs/by-name/zl/zls/deps.nix b/pkgs/development/tools/zls/deps_0_14.nix similarity index 100% rename from pkgs/by-name/zl/zls/deps.nix rename to pkgs/development/tools/zls/deps_0_14.nix diff --git a/pkgs/development/tools/zls/deps_0_15.nix b/pkgs/development/tools/zls/deps_0_15.nix new file mode 100644 index 000000000000..2292e4212b6c --- /dev/null +++ b/pkgs/development/tools/zls/deps_0_15.nix @@ -0,0 +1,34 @@ +# 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="; + }; + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e5512af74d91..0d66cd0e13cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { });