{"id":13741993,"url":"https://github.com/mattnite/zig-libcurl","last_synced_at":"2025-04-12T02:02:56.419Z","repository":{"id":44560368,"uuid":"439401256","full_name":"mattnite/zig-libcurl","owner":"mattnite","description":"compile libcurl in your build.zig","archived":false,"fork":false,"pushed_at":"2023-09-07T16:05:50.000Z","size":52,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T13:43:33.997Z","etag":null,"topics":["build","https","libcurl","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattnite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-17T16:53:22.000Z","updated_at":"2024-12-16T22:28:30.000Z","dependencies_parsed_at":"2024-08-03T04:18:38.802Z","dependency_job_id":null,"html_url":"https://github.com/mattnite/zig-libcurl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-libcurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-libcurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-libcurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-libcurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattnite","download_url":"https://codeload.github.com/mattnite/zig-libcurl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239858323,"owners_count":19708845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","https","libcurl","zig","zig-package"],"created_at":"2024-08-03T04:01:05.002Z","updated_at":"2025-02-20T15:30:49.117Z","avatar_url":"https://github.com/mattnite.png","language":"Zig","funding_links":["https://github.com/sponsors/mattnite"],"categories":["Libraries"],"sub_categories":[],"readme":"# libcurl build package\n\n[![ci](https://github.com/mattnite/zig-libcurl/actions/workflows/ci.yml/badge.svg)](https://github.com/mattnite/zig-libcurl/actions/workflows/ci.yml)\n\n## Like this project?\n\nIf you like this project or other works of mine, please consider [donating to or sponsoring me](https://github.com/sponsors/mattnite) on Github [:heart:](https://github.com/sponsors/mattnite)\n\n## How to use\n\nThis repo contains code for your `build.zig` that can statically compile libcurl, as well as some idiomatic Zig bindings for libcurl that you can use in your application. In either case below you will be able to include libcurls header with:\n\n```zig\nconst c = @cImport({\n    @cInclude(\"curl/curl.h\");\n});\n```\n\n### Link and add bindings to your application\n\nIn order to statically link libcurl into your application and access the bindings with a configurable import string:\n\n```zig\nconst libcurl = @import(\"path/to/libcurl.zig\");\n\npub fn build(b: *std.build.Builder) void {\n    // ...\n\n    const lib = libcurl.create(b, target, optimize);\n\n    const exe = b.addExecutable(.{\n        .name = \"my-program\",\n        .root_source_file = .{ .path = \"src/main.zig\" },\n        .target = target,\n        .optimize = optimize,\n    });\n    const exe = b.addExecutable(\"my-program\", \"src/main.zig\");\n    lib.link(exe, .{ .import_name = \"curl\" });\n}\n```\n\nNow code that is part of the `my-program` executable can import the libcurl bindings with `@import(\"curl\")`.\n\n### Only link to your application\n\nIn order to just link to the application, all you need to do is omit the `.import_name = \"curl\"` argument to libcurl's link options:\n\n```zig\n    lib.link(exe, .{});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattnite%2Fzig-libcurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattnite%2Fzig-libcurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattnite%2Fzig-libcurl/lists"}