Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions devel/zls/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.4 2024/08/13 19:41:04 wiz Exp $

DISTNAME= zls-0.12.0
DISTNAME= zls-0.13.0
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=zigtools/}
GITHUB_PROJECT= zls
Expand All @@ -16,8 +16,6 @@ ZIGSTRIP= no
# Temporary required, a zig build system parser is being written.
ALLOW_NETWORK_ACCESS=yes

BROKEN= "Does not support zig 0.13.0"

.include "zig-depends.mk"

.include "../../lang/zig/application.mk"
Expand Down
14 changes: 11 additions & 3 deletions devel/zls/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
$NetBSD: distinfo,v 1.1 2024/04/29 13:27:52 nikita Exp $

BLAKE2s (zls-0.12.0.tar.gz) = e7ed5f0c856248d88a07cccd5f71d5135e6f215bb0c47cc24ce07dac6d60e406
SHA512 (zls-0.12.0.tar.gz) = d27653ae57c89f5fea03ecaaefa4c273a6a3694db24a1ebdf735c7ef0ca145e2d61c8f19d18bd5434659ac8ed0f5f715e6d15e4252db87ad89ac9402f580a860
Size (zls-0.12.0.tar.gz) = 341927 bytes
BLAKE2s (zls-0.13.0.tar.gz) = 3ae5318e6a133d21745733eec1a369eaa9c220d70b1088b4271bf74eb9f16d13
SHA512 (zls-0.13.0.tar.gz) = 92b20418d1410f013ac3d4cbe432ab1b748454d013a2d1be5abd47b91ea7d2340d55b775a66eb116f4641e9f2fc3baf84a44ba8f58b1a774254e7428449bb088
Size (zls-0.13.0.tar.gz) = 352025 bytes
SHA1 (patch-build.zig) = 5bbfc5ff0aea336803169774b131276eedff546d
SHA1 (patch-flake.lock) = 7082474f1872246b84ac65f89987a38ab85ca9ba
SHA1 (patch-flake.nix) = 0d9f8c5eef4777e04c51a03b2bb77085fafc518f
SHA1 (patch-schema.json) = db1b2476f5115d499d6fddf28f3d730b7cab6009
SHA1 (patch-src_Config.zig) = 89c168e6f079673c0848a43db8bdba0d230692b6
SHA1 (patch-src_config__gen_config.json) = 423f0ac5909b0941c94062811c91a6ff6d74af0d
SHA1 (patch-src_config__gen_config__gen.zig) = d94bff19c26342b952c61528b26cbae46cf0d370
SHA1 (patch-src_tools_langref__0.13.0.html.in) = bfdfad8878769d788afcdd350ca5a53e95ea7100
78 changes: 78 additions & 0 deletions devel/zls/patches/patch-build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
$NetBSD$

--- build.zig.orig 2025-03-17 06:46:13.317251024 +0000
+++ build.zig
@@ -41,9 +41,6 @@ pub fn build(b: *Build) !void {
const enable_tracy_allocation = b.option(bool, "enable_tracy_allocation", "Enable using TracyAllocator to monitor allocations.") orelse enable_tracy;
const enable_tracy_callstack = b.option(bool, "enable_tracy_callstack", "Enable callstack graphs.") orelse enable_tracy;
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match filter") orelse &[0][]const u8{};
- const data_version = b.option([]const u8, "data_version", "The Zig version your compiler is.");
- const data_version_path = b.option([]const u8, "version_data_path", "Manually specify zig language reference file");
- const override_version_data_file_path = b.option([]const u8, "version_data_file_path", "Relative path to version data file (if none, will be named with timestamp)");
const use_llvm = b.option(bool, "use_llvm", "Use Zig's llvm code backend");

const resolved_zls_version = getVersion(b);
@@ -88,17 +85,31 @@ pub fn build(b: *Build) !void {
const gen_exe = b.addExecutable(.{
.name = "zls_gen",
.root_source_file = b.path("src/config_gen/config_gen.zig"),
- .target = b.host,
+ .target = b.graph.host,
.single_threaded = true,
});

+ const version_data_module = blk: {
+ const gen_version_data_cmd = b.addRunArtifact(gen_exe);
+ const version = if (zls_version.pre == null and zls_version.build == null) b.fmt("{}", .{zls_version}) else "master";
+ gen_version_data_cmd.addArgs(&.{ "--langref-version", version });
+
+ gen_version_data_cmd.addArg("--langref-path");
+ gen_version_data_cmd.addFileArg(b.path(b.fmt("src/tools/langref_{s}.html.in", .{version})));
+
+ gen_version_data_cmd.addArg("--generate-version-data");
+ const version_data_path = gen_version_data_cmd.addOutputFileArg("version_data.zig");
+
+ break :blk b.addModule("version_data", .{ .root_source_file = version_data_path });
+ };
+
const gen_cmd = b.addRunArtifact(gen_exe);
gen_cmd.addArgs(&.{
"--readme-path",
b.pathFromRoot("README.md"),
- "--generate-config-path",
+ "--generate-config",
b.pathFromRoot("src/Config.zig"),
- "--generate-schema-path",
+ "--generate-schema",
b.pathFromRoot("schema.json"),
});
if (b.args) |args| gen_cmd.addArgs(args);
@@ -106,28 +117,6 @@ pub fn build(b: *Build) !void {
const gen_step = b.step("gen", "Regenerate config files");
gen_step.dependOn(&gen_cmd.step);

- const gen_version_data_cmd = b.addRunArtifact(gen_exe);
- const resolved_data_version = data_version orelse if (zls_version.pre == null and zls_version.build == null) b.fmt("{}", .{zls_version}) else "master";
- gen_version_data_cmd.addArgs(&.{ "--generate-version-data", resolved_data_version });
- if (data_version_path) |path| {
- gen_version_data_cmd.addArg("--langref_path");
- gen_version_data_cmd.addFileArg(.{ .cwd_relative = path });
- }
- const version_data_file_name = if (data_version_path != null)
- b.fmt("version_data_{s}.zig", .{resolved_data_version})
- else blk: {
- // invalidate version data periodically from cache because the website content may change
- // setting `has_side_effects` would also be possible but that would always force a re-run
- const timestamp = @divFloor(std.time.timestamp(), std.time.s_per_day);
- break :blk b.fmt("version_data_{s}_{d}.zig", .{ resolved_data_version, timestamp });
- };
- gen_version_data_cmd.addArg("--generate-version-data-path");
- const version_data_path: std.Build.LazyPath = if (override_version_data_file_path) |path|
- .{ .cwd_relative = path }
- else
- gen_version_data_cmd.addOutputFileArg(version_data_file_name);
- const version_data_module = b.addModule("version_data", .{ .root_source_file = version_data_path });
-
const zls_module = b.addModule("zls", .{
.root_source_file = b.path("src/zls.zig"),
.imports = &.{
31 changes: 31 additions & 0 deletions devel/zls/patches/patch-flake.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$NetBSD$

--- flake.lock.orig 2025-03-17 06:46:13.322381314 +0000
+++ flake.lock
@@ -72,18 +72,6 @@
"type": "github"
}
},
- "langref": {
- "flake": false,
- "locked": {
- "narHash": "sha256-O6p2tiKD8ZMhSX+DeA/o5hhAvcPkU2J9lFys/r11peY=",
- "type": "file",
- "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in"
- },
- "original": {
- "type": "file",
- "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in"
- }
- },
"nixpkgs": {
"locked": {
"lastModified": 1717696253,
@@ -104,7 +92,6 @@
"inputs": {
"flake-utils": "flake-utils",
"gitignore": "gitignore",
- "langref": "langref",
"nixpkgs": "nixpkgs",
"zig-overlay": "zig-overlay"
}
36 changes: 36 additions & 0 deletions devel/zls/patches/patch-flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$NetBSD$

--- flake.nix.orig 2025-03-17 06:46:13.327127011 +0000
+++ flake.nix
@@ -10,13 +10,9 @@
gitignore.inputs.nixpkgs.follows = "nixpkgs";

flake-utils.url = "github:numtide/flake-utils";
-
- # llvm: fix @wasmMemory{Size,Grow} for wasm64
- langref.url = "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in";
- langref.flake = false;
};

- outputs = { self, nixpkgs, zig-overlay, gitignore, flake-utils, langref }:
+ outputs = { self, nixpkgs, zig-overlay, gitignore, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
@@ -34,14 +30,13 @@
dontConfigure = true;
dontInstall = true;
doCheck = true;
- langref = langref;
buildPhase = ''
mkdir -p .cache
ln -s ${pkgs.callPackage ./deps.nix { zig = zig; }} .cache/p
- zig build install --cache-dir $(pwd)/.zig-cache --global-cache-dir $(pwd)/.cache -Dversion_data_path=$langref -Dcpu=baseline -Doptimize=ReleaseSafe --prefix $out
+ zig build install --cache-dir $(pwd)/.zig-cache --global-cache-dir $(pwd)/.cache -Dcpu=baseline -Doptimize=ReleaseSafe --prefix $out
'';
checkPhase = ''
- zig build test --cache-dir $(pwd)/.zig-cache --global-cache-dir $(pwd)/.cache -Dversion_data_path=$langref -Dcpu=baseline
+ zig build test --cache-dir $(pwd)/.zig-cache --global-cache-dir $(pwd)/.cache -Dcpu=baseline
'';
};
}
13 changes: 13 additions & 0 deletions devel/zls/patches/patch-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$NetBSD$

--- schema.json.orig 2025-03-17 06:46:13.332129443 +0000
+++ schema.json
@@ -30,7 +30,7 @@
"default": false
},
"semantic_tokens": {
- "description": "Set level of semantic tokens. Partial only includes information that requires semantic analysis.",
+ "description": "Set level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"type": "string",
"enum": [
"none",
13 changes: 13 additions & 0 deletions devel/zls/patches/patch-src_Config.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$NetBSD$

--- src/Config.zig.orig 2024-06-09 00:05:07.000000000 +0000
+++ src/Config.zig
@@ -19,7 +19,7 @@ build_on_save_step: []const u8 = "instal
/// Whether to automatically fix errors on save. Currently supports adding and removing discards.
enable_autofix: bool = false,

-/// Set level of semantic tokens. Partial only includes information that requires semantic analysis.
+/// Set level of semantic tokens. `partial` only includes information that requires semantic analysis.
semantic_tokens: enum {
none,
partial,
13 changes: 13 additions & 0 deletions devel/zls/patches/patch-src_config__gen_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$NetBSD$

--- src/config_gen/config.json.orig 2024-06-09 00:05:07.000000000 +0000
+++ src/config_gen/config.json
@@ -32,7 +32,7 @@
},
{
"name": "semantic_tokens",
- "description": "Set level of semantic tokens. Partial only includes information that requires semantic analysis.",
+ "description": "Set level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"type": "enum",
"enum": [
"none",
Loading