mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
build: link netsurf
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
1
Makefile
1
Makefile
@@ -75,7 +75,6 @@ endif
|
|||||||
install-netsurf:
|
install-netsurf:
|
||||||
@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;) && \
|
||||||
mkdir -p vendor/netfurf/build && \
|
|
||||||
export PREFIX=$(BC_NS) && \
|
export PREFIX=$(BC_NS) && \
|
||||||
export LDFLAGS="-L$(ICONV)/lib" && \
|
export LDFLAGS="-L$(ICONV)/lib" && \
|
||||||
export CFLAGS="-I/$(ICONV)/include -I$(BC_NS)/libparserutils/include -I$(BC_NS)/libhubbub/include -I$(BC_NS)/libwapcaplet/include" && \
|
export CFLAGS="-I/$(ICONV)/include -I$(BC_NS)/libparserutils/include -I$(BC_NS)/libhubbub/include -I$(BC_NS)/libwapcaplet/include" && \
|
||||||
|
|||||||
30
build.zig
30
build.zig
@@ -78,6 +78,7 @@ fn common(
|
|||||||
) !void {
|
) !void {
|
||||||
try jsruntime_pkgs.add(step, options);
|
try jsruntime_pkgs.add(step, options);
|
||||||
linkLexbor(step);
|
linkLexbor(step);
|
||||||
|
linkNetSurf(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn linkLexbor(step: *std.build.LibExeObjStep) void {
|
fn linkLexbor(step: *std.build.LibExeObjStep) void {
|
||||||
@@ -86,3 +87,32 @@ fn linkLexbor(step: *std.build.LibExeObjStep) void {
|
|||||||
step.addObjectFile(.{ .path = lib_path });
|
step.addObjectFile(.{ .path = lib_path });
|
||||||
step.addIncludePath(.{ .path = "vendor/lexbor-src/source" });
|
step.addIncludePath(.{ .path = "vendor/lexbor-src/source" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
||||||
|
|
||||||
|
// iconv
|
||||||
|
var iconv_lib: []const u8 = undefined;
|
||||||
|
var iconv_include: []const u8 = undefined;
|
||||||
|
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(iconv_lib);
|
||||||
|
step.addIncludePath(iconv_include);
|
||||||
|
|
||||||
|
// netsurf libs
|
||||||
|
const ns = "vendor/netsurf/";
|
||||||
|
const libs: [4][]const u8 = .{
|
||||||
|
"libdom",
|
||||||
|
"libhubbub",
|
||||||
|
"libparserutils",
|
||||||
|
"libwapcaplet",
|
||||||
|
};
|
||||||
|
inline for (libs) |lib| {
|
||||||
|
step.addObjectFile(ns ++ "/build/" ++ lib ++ "/" ++ lib ++ ".a");
|
||||||
|
step.addIncludePath(ns ++ lib ++ "/include");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user