mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
build libiconv from sources
This commit is contained in:
committed by
Francis Bouvier
parent
b5b4659c87
commit
d7fec31b8a
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@ zig-out
|
|||||||
/vendor/lexbor/
|
/vendor/lexbor/
|
||||||
/vendor/netsurf/build/
|
/vendor/netsurf/build/
|
||||||
/vendor/netsurf/lib/
|
/vendor/netsurf/lib/
|
||||||
/vendor/netsurf/include/
|
/vendor/netsurf/include/
|
||||||
|
/vendor/libiconv/
|
||||||
|
|||||||
25
Makefile
25
Makefile
@@ -55,30 +55,28 @@ test:
|
|||||||
# Install and build required dependencies commands
|
# Install and build required dependencies commands
|
||||||
# ------------
|
# ------------
|
||||||
.PHONY: install-submodule
|
.PHONY: install-submodule
|
||||||
.PHONY: install-lexbor install-jsruntime install-jsruntime-dev
|
.PHONY: install-lexbor install-jsruntime install-jsruntime-dev install-libiconv
|
||||||
.PHONY: install-netsurf clean-netsurf test-netsurf
|
.PHONY: install-netsurf clean-netsurf test-netsurf
|
||||||
.PHONY: install-dev install
|
.PHONY: install-dev install
|
||||||
|
|
||||||
## Install and build dependencies for release
|
## Install and build dependencies for release
|
||||||
install: install-submodule install-lexbor install-jsruntime
|
install: install-submodule install-lexbor install-jsruntime install-netsurf
|
||||||
|
|
||||||
## Install and build dependencies for dev
|
## Install and build dependencies for dev
|
||||||
install-dev: install-submodule install-lexbor install-jsruntime-dev
|
install-dev: install-submodule install-lexbor install-jsruntime-dev install-netsurf
|
||||||
|
|
||||||
BC_NS := $(BC)vendor/netsurf
|
BC_NS := $(BC)vendor/netsurf
|
||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S), Darwin)
|
ICONV := $(BC)vendor/libiconv
|
||||||
ICONV := /opt/homebrew/opt/libiconv
|
|
||||||
endif
|
|
||||||
# TODO: add Linux iconv path (I guess it depends on the distro)
|
# TODO: add Linux iconv path (I guess it depends on the distro)
|
||||||
# TODO: this way of linking libiconv is not ideal. We should have a more generic way
|
# TODO: this way of linking libiconv is not ideal. We should have a more generic way
|
||||||
# and stick to a specif version. Maybe build from source. Anyway not now.
|
# and stick to a specif version. Maybe build from source. Anyway not now.
|
||||||
install-netsurf:
|
install-netsurf: install-libiconv
|
||||||
@printf "\e[36mInstalling NetSurf...\e[0m\n" && \
|
@printf "\e[36mInstalling NetSurf...\e[0m\n" && \
|
||||||
ls $(ICONV) 1> /dev/null || (printf "\e[33mERROR: you need to install libiconv in your system (on MacOS on with Homebrew)\e[0m\n"; exit 1;) && \
|
ls $(ICONV) 1> /dev/null || (printf "\e[33mERROR: you need to install libiconv in your system (on MacOS on with Homebrew)\e[0m\n"; exit 1;) && \
|
||||||
export PREFIX=$(BC_NS) && \
|
export PREFIX=$(BC_NS) && \
|
||||||
export LDFLAGS="-L$(ICONV)/lib" && \
|
export OPTLDFLAGS="-L$(ICONV)/lib" && \
|
||||||
export CFLAGS="-I$(ICONV)/include" && \
|
export OPTCFLAGS="-I$(ICONV)/include" && \
|
||||||
printf "\e[33mInstalling libwapcaplet...\e[0m\n" && \
|
printf "\e[33mInstalling libwapcaplet...\e[0m\n" && \
|
||||||
cd vendor/netsurf/libwapcaplet && \
|
cd vendor/netsurf/libwapcaplet && \
|
||||||
BUILDDIR=$(BC_NS)/build/libwapcaplet make install && \
|
BUILDDIR=$(BC_NS)/build/libwapcaplet make install && \
|
||||||
@@ -124,6 +122,15 @@ test-netsurf:
|
|||||||
cd vendor/netsurf/libdom && \
|
cd vendor/netsurf/libdom && \
|
||||||
BUILDDIR=$(BC_NS)/build/libdom make test
|
BUILDDIR=$(BC_NS)/build/libdom make test
|
||||||
|
|
||||||
|
install-libiconv:
|
||||||
|
ifeq ("$(wildcard vendor/libiconv/lib/libiconv.a)","")
|
||||||
|
@mkdir -p vendor/libiconv
|
||||||
|
@cd vendor/libiconv && \
|
||||||
|
curl https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz | tar -xvzf -
|
||||||
|
@cd vendor/libiconv/libiconv-1.17 && \
|
||||||
|
./configure --prefix=$(BC)vendor/libiconv --enable-static && \
|
||||||
|
make && make install
|
||||||
|
endif
|
||||||
|
|
||||||
install-lexbor:
|
install-lexbor:
|
||||||
@mkdir -p vendor/lexbor
|
@mkdir -p vendor/lexbor
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -18,7 +18,8 @@ For Debian/Ubuntu based Linux:
|
|||||||
sudo apt install xz-utils \
|
sudo apt install xz-utils \
|
||||||
python3 ca-certificates git \
|
python3 ca-certificates git \
|
||||||
pkg-config libglib2.0-dev \
|
pkg-config libglib2.0-dev \
|
||||||
cmake
|
libexpat1-dev \
|
||||||
|
cmake clang
|
||||||
```
|
```
|
||||||
|
|
||||||
For MacOS, you only need Python 3 and cmake.
|
For MacOS, you only need Python 3 and cmake.
|
||||||
@@ -35,6 +36,13 @@ directory.
|
|||||||
make install-submodule
|
make install-submodule
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Build netsurf
|
||||||
|
|
||||||
|
The command `make install-netsurf` will build netsurf libs used by browsercore.
|
||||||
|
```
|
||||||
|
make install-netsurf
|
||||||
|
```
|
||||||
|
|
||||||
### Build lexbor
|
### Build lexbor
|
||||||
|
|
||||||
The command `make install-lexbor` will build lexbor lib used by browsercore.
|
The command `make install-lexbor` will build lexbor lib used by browsercore.
|
||||||
|
|||||||
13
build.zig
13
build.zig
@@ -91,17 +91,8 @@ fn linkLexbor(step: *std.build.LibExeObjStep) void {
|
|||||||
fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
||||||
|
|
||||||
// iconv
|
// iconv
|
||||||
var iconv_lib: []const u8 = undefined;
|
step.addObjectFile(.{ .path = "vendor/libiconv/lib/libiconv.a" });
|
||||||
var iconv_include: []const u8 = undefined;
|
step.addIncludePath(.{ .path = "vendor/libiconv/include" });
|
||||||
const os = step.target.getOsTag();
|
|
||||||
if (os == .macos) {
|
|
||||||
iconv_lib = "/opt/homebrew/opt/libiconv/lib/libiconv.a";
|
|
||||||
iconv_include = "/opt/homebrew/opt/libiconv/include";
|
|
||||||
} else if (os == .linux) {
|
|
||||||
@panic("you need to modify build.zig to specify libiconv paths");
|
|
||||||
}
|
|
||||||
step.addObjectFile(.{ .path = iconv_lib });
|
|
||||||
step.addIncludePath(.{ .path = iconv_include });
|
|
||||||
|
|
||||||
// netsurf libs
|
// netsurf libs
|
||||||
const ns = "vendor/netsurf/";
|
const ns = "vendor/netsurf/";
|
||||||
|
|||||||
Reference in New Issue
Block a user