add zlib as a dependency
This commit is contained in:
parent
a9b1873109
commit
ace805f532
10
README.md
10
README.md
@ -1,13 +1,3 @@
|
|||||||
|
|
||||||
# commands to run
|
|
||||||
```bash
|
|
||||||
wget https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz
|
|
||||||
tar xvf zlib-1.2.13.tar.gz
|
|
||||||
rm zlib-1.2.13.tar.gz
|
|
||||||
mv zlib-1.2.13 lib/zlib
|
|
||||||
```
|
|
||||||
or simply run ./install-zlib.sh
|
|
||||||
|
|
||||||
# features
|
# features
|
||||||
* supports sharding for large bots
|
* supports sharding for large bots
|
||||||
* 100% API coverage, fully typed
|
* 100% API coverage, fully typed
|
||||||
|
35
build.zig
35
build.zig
@ -25,13 +25,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const zlib_zig = b.createModule(.{
|
const zlib = b.dependency("zlib", .{});
|
||||||
//.name = "zlib",
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
.root_source_file = b.path("zlib.zig"),
|
|
||||||
.link_libc = true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const zmpl = b.dependency("zmpl", .{
|
const zmpl = b.dependency("zmpl", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
@ -51,41 +45,18 @@ pub fn build(b: *std.Build) void {
|
|||||||
.link_libc = true,
|
.link_libc = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const srcs = &.{
|
|
||||||
"lib/zlib/adler32.c",
|
|
||||||
"lib/zlib/compress.c",
|
|
||||||
"lib/zlib/crc32.c",
|
|
||||||
"lib/zlib/deflate.c",
|
|
||||||
"lib/zlib/gzclose.c",
|
|
||||||
"lib/zlib/gzlib.c",
|
|
||||||
"lib/zlib/gzread.c",
|
|
||||||
"lib/zlib/gzwrite.c",
|
|
||||||
"lib/zlib/inflate.c",
|
|
||||||
"lib/zlib/infback.c",
|
|
||||||
"lib/zlib/inftrees.c",
|
|
||||||
"lib/zlib/inffast.c",
|
|
||||||
"lib/zlib/trees.c",
|
|
||||||
"lib/zlib/uncompr.c",
|
|
||||||
"lib/zlib/zutil.c",
|
|
||||||
};
|
|
||||||
|
|
||||||
//const mode = b.standardReleaseOptions();
|
|
||||||
|
|
||||||
zlib_zig.addCSourceFiles(.{ .files = srcs, .flags = &.{"-std=c89"} });
|
|
||||||
zlib_zig.addIncludePath(b.path("lib/zlib/"));
|
|
||||||
|
|
||||||
// now install your own executable after it's built correctly
|
// now install your own executable after it's built correctly
|
||||||
|
|
||||||
dzig.addImport("ws", websocket.module("websocket"));
|
dzig.addImport("ws", websocket.module("websocket"));
|
||||||
dzig.addImport("tls12", zig_tls.module("zig-tls12"));
|
dzig.addImport("tls12", zig_tls.module("zig-tls12"));
|
||||||
dzig.addImport("zlib", zlib_zig);
|
dzig.addImport("zlib", zlib.module("zlib"));
|
||||||
dzig.addImport("zmpl", zmpl.module("zmpl"));
|
dzig.addImport("zmpl", zmpl.module("zmpl"));
|
||||||
dzig.addImport("deque", deque.module("zig-deque"));
|
dzig.addImport("deque", deque.module("zig-deque"));
|
||||||
|
|
||||||
marin.root_module.addImport("discord.zig", dzig);
|
marin.root_module.addImport("discord.zig", dzig);
|
||||||
marin.root_module.addImport("ws", websocket.module("websocket"));
|
marin.root_module.addImport("ws", websocket.module("websocket"));
|
||||||
marin.root_module.addImport("tls12", zig_tls.module("zig-tls12"));
|
marin.root_module.addImport("tls12", zig_tls.module("zig-tls12"));
|
||||||
marin.root_module.addImport("zlib", zlib_zig);
|
marin.root_module.addImport("zlib", zlib.module("zlib"));
|
||||||
marin.root_module.addImport("zmpl", zmpl.module("zmpl"));
|
marin.root_module.addImport("zmpl", zmpl.module("zmpl"));
|
||||||
marin.root_module.addImport("deque", deque.module("zig-deque"));
|
marin.root_module.addImport("deque", deque.module("zig-deque"));
|
||||||
|
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
.url = "https://github.com/yuzudev/websocket.zig/archive/refs/heads/master.zip",
|
.url = "https://github.com/yuzudev/websocket.zig/archive/refs/heads/master.zip",
|
||||||
.hash = "122062d9dda015ba25780d00697e0e2c1cbc3ffa5b5eae55c9ea28b39b6d99ef1d85",
|
.hash = "122062d9dda015ba25780d00697e0e2c1cbc3ffa5b5eae55c9ea28b39b6d99ef1d85",
|
||||||
},
|
},
|
||||||
|
.zlib = .{
|
||||||
|
.url = "https://github.com/yuzudev/zig-zlib/archive/refs/heads/main.zip",
|
||||||
|
.hash = "1220cd041e8d04f1da9d6f46d0438f4e6809b113ba3454fffdaae96b59d2b35a6b2b",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"build.zig",
|
"build.zig",
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
wget https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz
|
|
||||||
tar xvf zlib-1.2.13.tar.gz
|
|
||||||
rm zlib-1.2.13.tar.gz
|
|
||||||
mv zlib-1.2.13 zlib
|
|
||||||
mv zlib lib/zlib
|
|
Loading…
x
Reference in New Issue
Block a user