Update dependancy jsruntime-lib -> zig-js-runtime

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-05-14 11:27:35 +02:00
parent deed0546cc
commit 986e69f45d
5 changed files with 18 additions and 18 deletions

6
.gitmodules vendored
View File

@@ -1,6 +1,6 @@
[submodule "vendor/jsruntime-lib"] [submodule "vendor/zig-js-runtime"]
path = vendor/jsruntime-lib path = vendor/zig-js-runtime
url = git@github.com:lightpanda-io/jsruntime-lib.git url = git@github.com:lightpanda-io/zig-js-runtime.git
[submodule "vendor/netsurf/libwapcaplet"] [submodule "vendor/netsurf/libwapcaplet"]
path = vendor/netsurf/libwapcaplet path = vendor/netsurf/libwapcaplet
url = git@github.com:lightpanda-io/libwapcaplet.git url = git@github.com:lightpanda-io/libwapcaplet.git

View File

@@ -25,7 +25,7 @@ help:
# ------------ # ------------
.PHONY: build build-release run run-release shell test bench download-zig wpt .PHONY: build build-release run run-release shell test bench download-zig wpt
zig_version = $(shell grep 'recommended_zig_version = "' "vendor/jsruntime-lib/build.zig" | cut -d'"' -f2) zig_version = $(shell grep 'recommended_zig_version = "' "vendor/zig-js-runtime/build.zig" | cut -d'"' -f2)
kernel = $(shell uname -ms) kernel = $(shell uname -ms)
## Download the zig recommended version ## Download the zig recommended version
@@ -93,16 +93,16 @@ test:
# Install and build required dependencies commands # Install and build required dependencies commands
# ------------ # ------------
.PHONY: install-submodule .PHONY: install-submodule
.PHONY: install-jsruntime install-jsruntime-dev install-libiconv .PHONY: install-zig-js-runtime install-zig-js-runtime-dev install-libiconv
.PHONY: _install-netsurf install-netsurf clean-netsurf test-netsurf install-netsurf-dev .PHONY: _install-netsurf install-netsurf clean-netsurf test-netsurf install-netsurf-dev
.PHONY: install-mimalloc install-mimalloc-dev clean-mimalloc .PHONY: install-mimalloc install-mimalloc-dev clean-mimalloc
.PHONY: install-dev install .PHONY: install-dev install
## Install and build dependencies for release ## Install and build dependencies for release
install: install-submodule install-jsruntime install-netsurf install-mimalloc install: install-submodule install-zig-js-runtime install-netsurf install-mimalloc
## Install and build dependencies for dev ## Install and build dependencies for dev
install-dev: install-submodule install-jsruntime-dev install-netsurf-dev install-mimalloc-dev install-dev: install-submodule install-zig-js-runtime-dev install-netsurf-dev install-mimalloc-dev
install-netsurf-dev: _install-netsurf install-netsurf-dev: _install-netsurf
install-netsurf-dev: OPTCFLAGS := -O0 -g -DNDEBUG install-netsurf-dev: OPTCFLAGS := -O0 -g -DNDEBUG
@@ -178,12 +178,12 @@ ifeq ("$(wildcard vendor/libiconv/lib/libiconv.a)","")
make && make install make && make install
endif endif
install-jsruntime-dev: install-zig-js-runtime-dev:
@cd vendor/jsruntime-lib && \ @cd vendor/zig-js-runtime && \
make install-dev make install-dev
install-jsruntime: install-zig-js-runtime:
@cd vendor/jsruntime-lib && \ @cd vendor/zig-js-runtime && \
make install make install
.PHONY: _build_mimalloc .PHONY: _build_mimalloc

View File

@@ -8,7 +8,7 @@ Browsercore is written with [Zig](https://ziglang.org/) `0.12`. You have to
install it with the right version in order to build the project. install it with the right version in order to build the project.
Browsercore also depends on Browsercore also depends on
[js-runtimelib](https://github.com/francisbouvier/jsruntime-lib/), [js-runtimelib](https://github.com/francisbouvier/zig-js-runtime/),
[Netsurf libs](https://www.netsurf-browser.org/) and [Netsurf libs](https://www.netsurf-browser.org/) and
[Mimalloc](https://microsoft.github.io/mimalloc) libs. [Mimalloc](https://microsoft.github.io/mimalloc) libs.
@@ -57,13 +57,13 @@ Note, when Mimalloc is built in dev mode, you can dump memory stats with the
env var `MIMALLOC_SHOW_STATS=1`. See env var `MIMALLOC_SHOW_STATS=1`. See
https://microsoft.github.io/mimalloc/environment.html https://microsoft.github.io/mimalloc/environment.html
### Build jsruntime-lib ### Build zig-js-runtime
The command `make install-jsruntime-dev` uses jsruntime-lib's `zig-v8` dependency to build v8 engine lib. The command `make install-jsruntime-dev` uses zig-js-runtime's `zig-v8` dependency to build v8 engine lib.
Be aware the build task is very long and cpu consuming. Be aware the build task is very long and cpu consuming.
Build v8 engine for debug/dev version, it creates Build v8 engine for debug/dev version, it creates
`vendor/jsruntime-lib/vendor/v8/$ARCH/debug/libc_v8.a` file. `vendor/zig-js-runtime/vendor/v8/$ARCH/debug/libc_v8.a` file.
``` ```
make install-jsruntime-dev make install-jsruntime-dev

View File

@@ -20,8 +20,8 @@ const std = @import("std");
const builtin = @import("builtin"); const builtin = @import("builtin");
const jsruntime_path = "vendor/jsruntime-lib/"; const jsruntime_path = "vendor/zig-js-runtime/";
const jsruntime = @import("vendor/jsruntime-lib/build.zig"); const jsruntime = @import("vendor/zig-js-runtime/build.zig");
const jsruntime_pkgs = jsruntime.packages(jsruntime_path); const jsruntime_pkgs = jsruntime.packages(jsruntime_path);
/// Do not rename this constant. It is scanned by some scripts to determine /// Do not rename this constant. It is scanned by some scripts to determine
@@ -106,7 +106,7 @@ pub fn build(b: *std.build.Builder) !void {
// add jsruntime pretty deps // add jsruntime pretty deps
const pretty = tests.step.owner.createModule(.{ const pretty = tests.step.owner.createModule(.{
.source_file = .{ .path = "vendor/jsruntime-lib/src/pretty.zig" }, .source_file = .{ .path = "vendor/zig-js-runtime/src/pretty.zig" },
}); });
tests.addModule("pretty", pretty); tests.addModule("pretty", pretty);