{"id":13742009,"url":"https://github.com/mattnite/zig-zlib","last_synced_at":"2025-04-15T23:52:37.053Z","repository":{"id":45193162,"uuid":"439394960","full_name":"mattnite/zig-zlib","owner":"mattnite","description":"compile zlib in your build.zig","archived":false,"fork":false,"pushed_at":"2024-04-09T23:34:23.000Z","size":31,"stargazers_count":22,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T03:02:08.071Z","etag":null,"topics":["build","zig","zig-package","zlib"],"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:30:10.000Z","updated_at":"2024-12-31T03:20:46.000Z","dependencies_parsed_at":"2024-08-03T04:18:38.801Z","dependency_job_id":null,"html_url":"https://github.com/mattnite/zig-zlib","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-zlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-zlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-zlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattnite%2Fzig-zlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattnite","download_url":"https://codeload.github.com/mattnite/zig-zlib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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","zig","zig-package","zlib"],"created_at":"2024-08-03T04:01:05.172Z","updated_at":"2025-04-15T23:52:37.035Z","avatar_url":"https://github.com/mattnite.png","language":"Zig","funding_links":["https://github.com/sponsors/mattnite"],"categories":["Libraries"],"sub_categories":[],"readme":"# zlib build package\n\n[![build](https://github.com/mattnite/zig-zlib/actions/workflows/build.yml/badge.svg)](https://github.com/mattnite/zig-zlib/actions/workflows/build.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 zlib, as well as some idiomatic Zig bindings for zlib that you can use in your application. In either case below you will be able to include zlibs header with:\n\n```zig\nconst c = @cImport({\n    @cInclude(\"zlib.h\");\n});\n```\n\n### Link and add bindings to your application\n\nIn order to statically link zlib into your application and access the bindings with a configurable import string:\n\n```zig\nconst zlib = @import(\"path/to/zlib.zig\");\n\npub fn build(b: *std.build.Builder) void {\n    // ...\n\n    const lib = zlib.create(b, target, mode);\n\n    const exe = b.addExecutable(\"my-program\", \"src/main.zig\");\n    lib.link(exe, .{ .import_name = \"zlib\" });\n}\n```\n\nNow code that is part of the `my-program` executable can import the zlib bindings with `@import(\"zlib\")`.\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 = \"zlib\"` argument to zlib'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-zlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattnite%2Fzig-zlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattnite%2Fzig-zlib/lists"}