Skip to content

Commit

Permalink
use zon to download c source code
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed May 4, 2024
1 parent 93e92d9 commit d0f88a8
Show file tree
Hide file tree
Showing 649 changed files with 355 additions and 386,003 deletions.
18 changes: 17 additions & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,21 @@
"build.zig.zon",
"LICENSE",
},
.dependencies = .{},
.dependencies = .{
.curl = .{
// https://github.com/curl/curl/releases/tag/curl-8_5_0
.url = "https://github.com/curl/curl/releases/download/curl-8_5_0/curl-8.5.0.tar.gz",
.hash = "12206e97053bf43e6bd83f2d51eefbac497a05f2eee98868431e9d228a12971e716e",
},
// https://github.com/madler/zlib/releases/tag/v1.3
.zlib = .{
.url = "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz",
.hash = "1220c32f4f9dbcb4445c153b6a5bf1e1f697a76f6b690dda9c600357c6b7080af614",
},
// https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.6.0
.mbedtls = .{
.url = "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz",
.hash = "1220358fd78ebfb68dde5b77787d5325f1f89e901d448ae0da0187811be53dd3ec7c",
},
},
}
349 changes: 181 additions & 168 deletions libs/curl.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@ pub fn create(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui
.name = "curl",
.target = target,
.optimize = optimize,
.link_libc = true,
});
lib.addCSourceFiles(.{ .files = srcs });
lib.addIncludePath(.{ .path = "libs/curl/lib" });
lib.addIncludePath(.{ .path = "libs/curl/include" });
lib.installHeadersDirectory(.{ .path = "libs/curl/include/curl" }, "curl", .{});
lib.linkLibC();
const curl_dep = b.dependency("curl", .{
.target = target,
.optimize = optimize,
});

inline for (srcs) |s| {
lib.addCSourceFile(.{
.file = curl_dep.path(s),
.flags = &.{
"-std=c99",
"-Wpedantic",
},
});
}
lib.addIncludePath(curl_dep.path("lib"));
lib.addIncludePath(curl_dep.path("include"));
lib.installHeadersDirectory(curl_dep.path("include/curl"), "curl", .{});
lib.defineCMacro("BUILDING_LIBCURL", null);
lib.defineCMacro("CURL_STATICLIB", "1");
lib.defineCMacro("CURL_DISABLE_LDAP", "1");
Expand Down Expand Up @@ -186,167 +199,167 @@ pub fn create(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui
}

const srcs = &.{
"libs/curl/lib/cookie.c",
"libs/curl/lib/http_chunks.c",
"libs/curl/lib/escape.c",
"libs/curl/lib/version_win32.c",
"libs/curl/lib/url.c",
"libs/curl/lib/base64.c",
"libs/curl/lib/mqtt.c",
"libs/curl/lib/setopt.c",
"libs/curl/lib/telnet.c",
"libs/curl/lib/hostip.c",
"libs/curl/lib/curl_gethostname.c",
"libs/curl/lib/connect.c",
"libs/curl/lib/socks_sspi.c",
"libs/curl/lib/cf-socket.c",
"libs/curl/lib/curl_fnmatch.c",
"libs/curl/lib/curl_gssapi.c",
"libs/curl/lib/http1.c",
"libs/curl/lib/multi.c",
"libs/curl/lib/gopher.c",
"libs/curl/lib/noproxy.c",
"libs/curl/lib/curl_sasl.c",
"libs/curl/lib/dict.c",
"libs/curl/lib/bufref.c",
"libs/curl/lib/slist.c",
"libs/curl/lib/curl_trc.c",
"libs/curl/lib/vtls/rustls.c",
"libs/curl/lib/vtls/mbedtls.c",
"libs/curl/lib/vtls/wolfssl.c",
"libs/curl/lib/vtls/schannel.c",
"libs/curl/lib/vtls/gtls.c",
"libs/curl/lib/vtls/sectransp.c",
"libs/curl/lib/vtls/vtls.c",
"libs/curl/lib/vtls/mbedtls_threadlock.c",
"libs/curl/lib/vtls/schannel_verify.c",
"libs/curl/lib/vtls/hostcheck.c",
"libs/curl/lib/vtls/bearssl.c",
"libs/curl/lib/vtls/openssl.c",
"libs/curl/lib/vtls/x509asn1.c",
"libs/curl/lib/vtls/keylog.c",
"libs/curl/lib/file.c",
"libs/curl/lib/socks_gssapi.c",
"libs/curl/lib/select.c",
"libs/curl/lib/socketpair.c",
"libs/curl/lib/curl_memrchr.c",
"libs/curl/lib/cfilters.c",
"libs/curl/lib/strtok.c",
"libs/curl/lib/version.c",
"libs/curl/lib/fopen.c",
"libs/curl/lib/http_aws_sigv4.c",
"libs/curl/lib/mprintf.c",
"libs/curl/lib/curl_path.c",
"libs/curl/lib/parsedate.c",
"libs/curl/lib/rename.c",
"libs/curl/lib/ftplistparser.c",
"libs/curl/lib/content_encoding.c",
"libs/curl/lib/mime.c",
"libs/curl/lib/rand.c",
"libs/curl/lib/curl_des.c",
"libs/curl/lib/curl_ntlm_core.c",
"libs/curl/lib/pop3.c",
"libs/curl/lib/curl_sspi.c",
"libs/curl/lib/smb.c",
"libs/curl/lib/conncache.c",
"libs/curl/lib/inet_pton.c",
"libs/curl/lib/if2ip.c",
"libs/curl/lib/openldap.c",
"libs/curl/lib/http_digest.c",
"libs/curl/lib/cf-h1-proxy.c",
"libs/curl/lib/asyn-thread.c",
"libs/curl/lib/strerror.c",
"libs/curl/lib/ftp.c",
"libs/curl/lib/strdup.c",
"libs/curl/lib/memdebug.c",
"libs/curl/lib/speedcheck.c",
"libs/curl/lib/vquic/curl_ngtcp2.c",
"libs/curl/lib/vquic/curl_msh3.c",
"libs/curl/lib/vquic/vquic.c",
"libs/curl/lib/vquic/curl_quiche.c",
"libs/curl/lib/getinfo.c",
"libs/curl/lib/http2.c",
"libs/curl/lib/vauth/oauth2.c",
"libs/curl/lib/vauth/vauth.c",
"libs/curl/lib/vauth/digest_sspi.c",
"libs/curl/lib/vauth/digest.c",
"libs/curl/lib/vauth/cram.c",
"libs/curl/lib/vauth/cleartext.c",
"libs/curl/lib/vauth/krb5_sspi.c",
"libs/curl/lib/vauth/spnego_sspi.c",
"libs/curl/lib/vauth/ntlm_sspi.c",
"libs/curl/lib/vauth/spnego_gssapi.c",
"libs/curl/lib/vauth/ntlm.c",
"libs/curl/lib/vauth/krb5_gssapi.c",
"libs/curl/lib/vauth/gsasl.c",
"libs/curl/lib/md4.c",
"libs/curl/lib/bufq.c",
"libs/curl/lib/curl_get_line.c",
"libs/curl/lib/hostip4.c",
"libs/curl/lib/curl_rtmp.c",
"libs/curl/lib/amigaos.c",
"libs/curl/lib/share.c",
"libs/curl/lib/warnless.c",
"libs/curl/lib/hostsyn.c",
"libs/curl/lib/md5.c",
"libs/curl/lib/strtoofft.c",
"libs/curl/lib/altsvc.c",
"libs/curl/lib/formdata.c",
"libs/curl/lib/dynbuf.c",
"libs/curl/lib/curl_addrinfo.c",
"libs/curl/lib/hostasyn.c",
"libs/curl/lib/doh.c",
"libs/curl/lib/curl_ntlm_wb.c",
"libs/curl/lib/easygetopt.c",
"libs/curl/lib/ldap.c",
"libs/curl/lib/nonblock.c",
"libs/curl/lib/idn.c",
"libs/curl/lib/pingpong.c",
"libs/curl/lib/imap.c",
"libs/curl/lib/vssh/libssh.c",
"libs/curl/lib/vssh/wolfssh.c",
"libs/curl/lib/vssh/libssh2.c",
"libs/curl/lib/splay.c",
"libs/curl/lib/krb5.c",
"libs/curl/lib/progress.c",
"libs/curl/lib/cf-haproxy.c",
"libs/curl/lib/easyoptions.c",
"libs/curl/lib/curl_range.c",
"libs/curl/lib/curl_endian.c",
"libs/curl/lib/http_proxy.c",
"libs/curl/lib/inet_ntop.c",
"libs/curl/lib/timeval.c",
"libs/curl/lib/asyn-ares.c",
"libs/curl/lib/rtsp.c",
"libs/curl/lib/sha256.c",
"libs/curl/lib/curl_threads.c",
"libs/curl/lib/easy.c",
"libs/curl/lib/dynhds.c",
"libs/curl/lib/tftp.c",
"libs/curl/lib/hsts.c",
"libs/curl/lib/smtp.c",
"libs/curl/lib/hash.c",
"libs/curl/lib/cf-https-connect.c",
"libs/curl/lib/getenv.c",
"libs/curl/lib/headers.c",
"libs/curl/lib/system_win32.c",
"libs/curl/lib/http_ntlm.c",
"libs/curl/lib/psl.c",
"libs/curl/lib/ws.c",
"libs/curl/lib/hostip6.c",
"libs/curl/lib/curl_multibyte.c",
"libs/curl/lib/netrc.c",
"libs/curl/lib/llist.c",
"libs/curl/lib/urlapi.c",
"libs/curl/lib/strcase.c",
"libs/curl/lib/sendf.c",
"libs/curl/lib/timediff.c",
"libs/curl/lib/http.c",
"libs/curl/lib/cf-h2-proxy.c",
"libs/curl/lib/socks.c",
"libs/curl/lib/http_negotiate.c",
"libs/curl/lib/transfer.c",
"libs/curl/lib/c-hyper.c",
"libs/curl/lib/hmac.c",
"libs/curl/lib/fileinfo.c",
"lib/cookie.c",
"lib/http_chunks.c",
"lib/escape.c",
"lib/version_win32.c",
"lib/url.c",
"lib/base64.c",
"lib/mqtt.c",
"lib/setopt.c",
"lib/telnet.c",
"lib/hostip.c",
"lib/curl_gethostname.c",
"lib/connect.c",
"lib/socks_sspi.c",
"lib/cf-socket.c",
"lib/curl_fnmatch.c",
"lib/curl_gssapi.c",
"lib/http1.c",
"lib/multi.c",
"lib/gopher.c",
"lib/noproxy.c",
"lib/curl_sasl.c",
"lib/dict.c",
"lib/bufref.c",
"lib/slist.c",
"lib/curl_trc.c",
"lib/vtls/rustls.c",
"lib/vtls/mbedtls.c",
"lib/vtls/wolfssl.c",
"lib/vtls/schannel.c",
"lib/vtls/gtls.c",
"lib/vtls/sectransp.c",
"lib/vtls/vtls.c",
"lib/vtls/mbedtls_threadlock.c",
"lib/vtls/schannel_verify.c",
"lib/vtls/hostcheck.c",
"lib/vtls/bearssl.c",
"lib/vtls/openssl.c",
"lib/vtls/x509asn1.c",
"lib/vtls/keylog.c",
"lib/file.c",
"lib/socks_gssapi.c",
"lib/select.c",
"lib/socketpair.c",
"lib/curl_memrchr.c",
"lib/cfilters.c",
"lib/strtok.c",
"lib/version.c",
"lib/fopen.c",
"lib/http_aws_sigv4.c",
"lib/mprintf.c",
"lib/curl_path.c",
"lib/parsedate.c",
"lib/rename.c",
"lib/ftplistparser.c",
"lib/content_encoding.c",
"lib/mime.c",
"lib/rand.c",
"lib/curl_des.c",
"lib/curl_ntlm_core.c",
"lib/pop3.c",
"lib/curl_sspi.c",
"lib/smb.c",
"lib/conncache.c",
"lib/inet_pton.c",
"lib/if2ip.c",
"lib/openldap.c",
"lib/http_digest.c",
"lib/cf-h1-proxy.c",
"lib/asyn-thread.c",
"lib/strerror.c",
"lib/ftp.c",
"lib/strdup.c",
"lib/memdebug.c",
"lib/speedcheck.c",
"lib/vquic/curl_ngtcp2.c",
"lib/vquic/curl_msh3.c",
"lib/vquic/vquic.c",
"lib/vquic/curl_quiche.c",
"lib/getinfo.c",
"lib/http2.c",
"lib/vauth/oauth2.c",
"lib/vauth/vauth.c",
"lib/vauth/digest_sspi.c",
"lib/vauth/digest.c",
"lib/vauth/cram.c",
"lib/vauth/cleartext.c",
"lib/vauth/krb5_sspi.c",
"lib/vauth/spnego_sspi.c",
"lib/vauth/ntlm_sspi.c",
"lib/vauth/spnego_gssapi.c",
"lib/vauth/ntlm.c",
"lib/vauth/krb5_gssapi.c",
"lib/vauth/gsasl.c",
"lib/md4.c",
"lib/bufq.c",
"lib/curl_get_line.c",
"lib/hostip4.c",
"lib/curl_rtmp.c",
"lib/amigaos.c",
"lib/share.c",
"lib/warnless.c",
"lib/hostsyn.c",
"lib/md5.c",
"lib/strtoofft.c",
"lib/altsvc.c",
"lib/formdata.c",
"lib/dynbuf.c",
"lib/curl_addrinfo.c",
"lib/hostasyn.c",
"lib/doh.c",
"lib/curl_ntlm_wb.c",
"lib/easygetopt.c",
"lib/ldap.c",
"lib/nonblock.c",
"lib/idn.c",
"lib/pingpong.c",
"lib/imap.c",
"lib/vssh/libssh.c",
"lib/vssh/wolfssh.c",
"lib/vssh/libssh2.c",
"lib/splay.c",
"lib/krb5.c",
"lib/progress.c",
"lib/cf-haproxy.c",
"lib/easyoptions.c",
"lib/curl_range.c",
"lib/curl_endian.c",
"lib/http_proxy.c",
"lib/inet_ntop.c",
"lib/timeval.c",
"lib/asyn-ares.c",
"lib/rtsp.c",
"lib/sha256.c",
"lib/curl_threads.c",
"lib/easy.c",
"lib/dynhds.c",
"lib/tftp.c",
"lib/hsts.c",
"lib/smtp.c",
"lib/hash.c",
"lib/cf-https-connect.c",
"lib/getenv.c",
"lib/headers.c",
"lib/system_win32.c",
"lib/http_ntlm.c",
"lib/psl.c",
"lib/ws.c",
"lib/hostip6.c",
"lib/curl_multibyte.c",
"lib/netrc.c",
"lib/llist.c",
"lib/urlapi.c",
"lib/strcase.c",
"lib/sendf.c",
"lib/timediff.c",
"lib/http.c",
"lib/cf-h2-proxy.c",
"lib/socks.c",
"lib/http_negotiate.c",
"lib/transfer.c",
"lib/c-hyper.c",
"lib/hmac.c",
"lib/fileinfo.c",
};
Loading

0 comments on commit d0f88a8

Please sign in to comment.