Skip to content

Commit 2855170

Browse files
committed
switch upstream gumbo to codeberg.org/gumbo-parser/gumbo-parser
* use version 0.13.2 * use meson build system
1 parent d4570c3 commit 2855170

3 files changed

Lines changed: 35 additions & 22 deletions

File tree

Makefile.gumbo

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22

33
BASE=${PWD}
44

5-
all: build/v0.10.1.tar.gz build/gumbo-parser-0.10.1 \
6-
build/gumbo-parser-0.10.1/configure \
7-
build/gumbo-parser-0.10.1/Makefile \
5+
GUMBO_VERSION=0.13.2
6+
GUMBO_URL=https://codeberg.org/gumbo-parser/gumbo-parser/archive/${GUMBO_VERSION}.tar.gz
7+
GUMBO_SHA256=dbdc159dc8e5c6f3f254e50bce689dd9e439064ff06c165d5653410a5714ab66
8+
9+
all: build/${GUMBO_VERSION}.tar.gz build/gumbo-parser \
810
build-dep/gumbo/lib/libgumbo.a
911

10-
build/v0.10.1.tar.gz:
11-
cd build && wget https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz
12+
build/${GUMBO_VERSION}.tar.gz:
13+
cd build && wget "${GUMBO_URL}"
1214

13-
build/gumbo-parser-0.10.1:
15+
build/gumbo-parser:
1416
cd build && \
15-
echo '28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad v0.10.1.tar.gz' | sha256sum -c && \
16-
tar xf v0.10.1.tar.gz
17-
18-
build/gumbo-parser-0.10.1/configure:
19-
cd build/gumbo-parser-0.10.1 && ./autogen.sh
20-
21-
build/gumbo-parser-0.10.1/Makefile:
22-
cd build/gumbo-parser-0.10.1 && \
23-
emconfigure ./configure \
24-
--prefix=${BASE}/build-dep/gumbo \
25-
--enable-static --disable-shared
17+
echo "${GUMBO_SHA256} ${GUMBO_VERSION}.tar.gz" | sha256sum -c && \
18+
tar xf ${GUMBO_VERSION}.tar.gz
2619

2720
build-dep/gumbo/lib/libgumbo.a:
28-
cd build/gumbo-parser-0.10.1 && \
29-
emmake make install
21+
mkdir -p build/gumbo-parser-build
22+
cd build/gumbo-parser && \
23+
meson setup "${BASE}/build/gumbo-parser-build" \
24+
--cross-file="${BASE}/gumbo-parser-meson-wasm.cross" \
25+
--prefix="${BASE}/build-dep/gumbo" \
26+
-Ddefault_library=static \
27+
-Dtests=false && \
28+
meson compile -C "${BASE}/build/gumbo-parser-build" && \
29+
meson install -C "${BASE}/build/gumbo-parser-build"
3030

3131
clean:
3232
rm -rf build-dep/gumbo
33-
rm -rf build/v0.10.1.tar.gz
34-
rm -rf build/gumbo-parser-0.10.1
33+
rm -rf "build/${GUMBO_VERSION}.tar.gz"
34+
rm -rf build/gumbo-parser
35+
rm -rf build/gumbo-parser-build
3536

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Hext.js also works in Node ([example](./htmlext.wasm.js)). If performance is imp
6464
[Hext](https://github.com/html-extract/hext) is written in C++. This repo contains a full build process for compiling Hext and all its dependencies to JavaScript/WebAssembly.
6565

6666
In order to build this, you need [Emscripten](https://emscripten.org/docs/getting_started/downloads.html) and the following packages:
67-
`wget git python3 build-essential libxml2 libtool autoconf rapidjson-dev cmake`.
67+
`wget git python3 build-essential libxml2 libtool autoconf rapidjson-dev cmake meson`.
6868

6969
Then compilation is done with a single command:
7070

gumbo-parser-meson-wasm.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[binaries]
2+
c = 'emcc'
3+
cpp = 'em++'
4+
ar = 'emar'
5+
ld = 'emcc'
6+
strip = 'emstrip'
7+
8+
[host_machine]
9+
system = 'emscripten'
10+
cpu_family = 'wasm32'
11+
cpu = 'wasm'
12+
endian = 'little'

0 commit comments

Comments
 (0)