Skip to content

Commit b047cb6

Browse files
committed
remove libdom
1 parent c52dce1 commit b047cb6

File tree

415 files changed

+26294
-33558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

415 files changed

+26294
-33558
lines changed

.github/actions/install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
zig:
66
description: 'Zig version to install'
77
required: false
8-
default: '0.15.1'
8+
default: '0.15.2'
99
arch:
1010
description: 'CPU arch used to select the v8 lib'
1111
required: false

.github/workflows/zig-fmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: zig-fmt
22

33
env:
4-
ZIG_VERSION: 0.15.1
4+
ZIG_VERSION: 0.15.2
55

66
on:
77
pull_request:

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
zig-cache
21
/.zig-cache/
3-
zig-out
4-
/vendor/netsurf/out
5-
/vendor/libiconv/
2+
/zig-out/
63
lightpanda.id
74
/v8/
5+
/build/
6+
src/html5ever/target/

.gitmodules

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
[submodule "vendor/netsurf/libwapcaplet"]
2-
path = vendor/netsurf/libwapcaplet
3-
url = https://github.com/lightpanda-io/libwapcaplet.git/
4-
[submodule "vendor/netsurf/libparserutils"]
5-
path = vendor/netsurf/libparserutils
6-
url = https://github.com/lightpanda-io/libparserutils.git/
7-
[submodule "vendor/netsurf/libdom"]
8-
path = vendor/netsurf/libdom
9-
url = https://github.com/lightpanda-io/libdom.git/
10-
[submodule "vendor/netsurf/share/netsurf-buildsystem"]
11-
path = vendor/netsurf/share/netsurf-buildsystem
12-
url = https://github.com/lightpanda-io/netsurf-buildsystem.git
13-
[submodule "vendor/netsurf/libhubbub"]
14-
path = vendor/netsurf/libhubbub
15-
url = https://github.com/lightpanda-io/libhubbub.git/
161
[submodule "tests/wpt"]
172
path = tests/wpt
183
url = https://github.com/lightpanda-io/wpt
19-
[submodule "vendor/mimalloc"]
20-
path = vendor/mimalloc
21-
url = https://github.com/microsoft/mimalloc.git/
224
[submodule "vendor/nghttp2"]
235
path = vendor/nghttp2
246
url = https://github.com/nghttp2/nghttp2.git

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM debian:stable
22

33
ARG MINISIG=0.12
4-
ARG ZIG=0.15.1
4+
ARG ZIG=0.15.2
55
ARG ZIG_MINISIG=RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
66
ARG V8=14.0.365.4
77
ARG ZIG_V8=v0.1.33

Makefile

Lines changed: 17 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,16 @@ wpt-summary:
9696
@printf "\e[36mBuilding wpt...\e[0m\n"
9797
@$(ZIG) build wpt -- --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
9898

99-
## Test
99+
## Test - `grep` is used to filter out the huge compile command on build
100+
ifeq ($(OS), macos)
100101
test:
101-
@TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all
102+
@script -q /dev/null sh -c 'TEST_FILTER="${F}" $(ZIG) build test -freference-trace --summary all' 2>&1 \
103+
| grep --line-buffered -v "^/.*zig test -freference-trace"
104+
else
105+
test:
106+
@script -qec 'TEST_FILTER="${F}" $(ZIG) build test -freference-trace --summary all' /dev/null 2>&1 \
107+
| grep --line-buffered -v "^/.*zig test -freference-trace"
108+
endif
102109

103110
## Run demo/runner end to end tests
104111
end2end:
@@ -120,128 +127,24 @@ build-v8:
120127

121128
# Install and build required dependencies commands
122129
# ------------
123-
.PHONY: install-submodule
124-
.PHONY: install-libiconv
125-
.PHONY: _install-netsurf install-netsurf clean-netsurf test-netsurf install-netsurf-dev
126-
.PHONY: install-mimalloc install-mimalloc-dev clean-mimalloc
127-
.PHONY: install-dev install
130+
.PHONY: install-html5ever install-html5ever-dev
131+
.PHONY: install install-dev
128132

129133
## Install and build dependencies for release
130-
install: install-submodule install-libiconv install-netsurf install-mimalloc
134+
install: install-submodule install-html5ever
131135

132136
## Install and build dependencies for dev
133-
install-dev: install-submodule install-libiconv install-netsurf-dev install-mimalloc-dev
134-
135-
install-netsurf-dev: _install-netsurf
136-
install-netsurf-dev: OPTCFLAGS := -O0 -g -DNDEBUG
137-
138-
install-netsurf: _install-netsurf
139-
install-netsurf: OPTCFLAGS := -DNDEBUG
140-
141-
BC_NS := $(BC)vendor/netsurf/out/$(OS)-$(ARCH)
142-
ICONV := $(BC)vendor/libiconv/out/$(OS)-$(ARCH)
143-
# TODO: add Linux iconv path (I guess it depends on the distro)
144-
# TODO: this way of linking libiconv is not ideal. We should have a more generic way
145-
# and stick to a specif version. Maybe build from source. Anyway not now.
146-
_install-netsurf: clean-netsurf
147-
@printf "\e[36mInstalling NetSurf...\e[0m\n" && \
148-
ls $(ICONV)/lib/libiconv.a 1> /dev/null || (printf "\e[33mERROR: you need to execute 'make install-libiconv'\e[0m\n"; exit 1;) && \
149-
mkdir -p $(BC_NS) && \
150-
cp -R vendor/netsurf/share $(BC_NS) && \
151-
export PREFIX=$(BC_NS) && \
152-
export OPTLDFLAGS="-L$(ICONV)/lib" && \
153-
export OPTCFLAGS="$(OPTCFLAGS) -I$(ICONV)/include" && \
154-
printf "\e[33mInstalling libwapcaplet...\e[0m\n" && \
155-
cd vendor/netsurf/libwapcaplet && \
156-
BUILDDIR=$(BC_NS)/build/libwapcaplet make install && \
157-
cd ../libparserutils && \
158-
printf "\e[33mInstalling libparserutils...\e[0m\n" && \
159-
BUILDDIR=$(BC_NS)/build/libparserutils make install && \
160-
cd ../libhubbub && \
161-
printf "\e[33mInstalling libhubbub...\e[0m\n" && \
162-
BUILDDIR=$(BC_NS)/build/libhubbub make install && \
163-
rm src/treebuilder/autogenerated-element-type.c && \
164-
cd ../libdom && \
165-
printf "\e[33mInstalling libdom...\e[0m\n" && \
166-
BUILDDIR=$(BC_NS)/build/libdom make install && \
167-
printf "\e[33mRunning libdom example...\e[0m\n" && \
168-
cd examples && \
169-
$(ZIG) cc \
170-
-I$(ICONV)/include \
171-
-I$(BC_NS)/include \
172-
-L$(ICONV)/lib \
173-
-L$(BC_NS)/lib \
174-
-liconv \
175-
-ldom \
176-
-lhubbub \
177-
-lparserutils \
178-
-lwapcaplet \
179-
-o a.out \
180-
dom-structure-dump.c \
181-
$(ICONV)/lib/libiconv.a && \
182-
./a.out > /dev/null && \
183-
rm a.out && \
184-
printf "\e[36mDone NetSurf $(OS)\e[0m\n"
185-
186-
clean-netsurf:
187-
@printf "\e[36mCleaning NetSurf build...\e[0m\n" && \
188-
rm -Rf $(BC_NS)
189-
190-
test-netsurf:
191-
@printf "\e[36mTesting NetSurf...\e[0m\n" && \
192-
export PREFIX=$(BC_NS) && \
193-
export LDFLAGS="-L$(ICONV)/lib -L$(BC_NS)/lib" && \
194-
export CFLAGS="-I$(ICONV)/include -I$(BC_NS)/include" && \
195-
cd vendor/netsurf/libdom && \
196-
BUILDDIR=$(BC_NS)/build/libdom make test
197-
198-
download-libiconv:
199-
ifeq ("$(wildcard vendor/libiconv/libiconv-1.17)","")
200-
@mkdir -p vendor/libiconv
201-
@cd vendor/libiconv && \
202-
curl -L https://github.com/lightpanda-io/libiconv/releases/download/1.17/libiconv-1.17.tar.gz | tar -xvzf -
203-
endif
137+
install-dev: install-submodule install-html5ever-dev
204138

205-
build-libiconv: clean-libiconv
206-
@cd vendor/libiconv/libiconv-1.17 && \
207-
./configure --prefix=$(ICONV) --enable-static && \
208-
make && make install
139+
install-html5ever:
140+
cd src/html5ever && cargo build --release --target-dir ../../build/html5ever/
209141

210-
install-libiconv: download-libiconv build-libiconv
211-
212-
clean-libiconv:
213-
ifneq ("$(wildcard vendor/libiconv/libiconv-1.17/Makefile)","")
214-
@cd vendor/libiconv/libiconv-1.17 && \
215-
make clean
216-
endif
142+
install-html5ever-dev:
143+
cd src/html5ever && cargo build --target-dir ../../build/html5ever/
217144

218145
data:
219146
cd src/data && go run public_suffix_list_gen.go > public_suffix_list.zig
220147

221-
.PHONY: _build_mimalloc
222-
223-
MIMALLOC := $(BC)vendor/mimalloc/out/$(OS)-$(ARCH)
224-
_build_mimalloc: clean-mimalloc
225-
@mkdir -p $(MIMALLOC)/build && \
226-
cd $(MIMALLOC)/build && \
227-
cmake -DMI_BUILD_SHARED=OFF -DMI_BUILD_OBJECT=OFF -DMI_BUILD_TESTS=OFF -DMI_OVERRIDE=OFF $(OPTS) ../../.. && \
228-
make && \
229-
mkdir -p $(MIMALLOC)/lib
230-
231-
install-mimalloc-dev: _build_mimalloc
232-
install-mimalloc-dev: OPTS=-DCMAKE_BUILD_TYPE=Debug
233-
install-mimalloc-dev:
234-
@cd $(MIMALLOC) && \
235-
mv build/libmimalloc-debug.a lib/libmimalloc.a
236-
237-
install-mimalloc: _build_mimalloc
238-
install-mimalloc:
239-
@cd $(MIMALLOC) && \
240-
mv build/libmimalloc.a lib/libmimalloc.a
241-
242-
clean-mimalloc:
243-
@rm -Rf $(MIMALLOC)/build
244-
245148
## Init and update git submodule
246149
install-submodule:
247150
@git submodule init && \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ You can also follow the progress of our Javascript support in our dedicated [zig
164164

165165
### Prerequisites
166166

167-
Lightpanda is written with [Zig](https://ziglang.org/) `0.15.1`. You have to
167+
Lightpanda is written with [Zig](https://ziglang.org/) `0.15.2`. You have to
168168
install it with the right version in order to build the project.
169169

170170
Lightpanda also depends on

0 commit comments

Comments
 (0)