{"id":28712390,"url":"https://github.com/thin-edge/zig-mosquitto","last_synced_at":"2025-06-14T23:05:44.511Z","repository":{"id":245183888,"uuid":"817334451","full_name":"thin-edge/zig-mosquitto","owner":"thin-edge","description":" zig build for mosquitto","archived":false,"fork":false,"pushed_at":"2025-06-13T12:27:58.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T13:38:51.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/thin-edge.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,"zenodo":null}},"created_at":"2024-06-19T13:42:26.000Z","updated_at":"2025-06-13T12:28:04.000Z","dependencies_parsed_at":"2024-06-20T10:46:19.999Z","dependency_job_id":"4146f70e-6c5b-45ed-916c-6fccd7595994","html_url":"https://github.com/thin-edge/zig-mosquitto","commit_stats":null,"previous_names":["didier-wenzek/zig-mosquitto","thin-edge/zig-mosquitto"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thin-edge/zig-mosquitto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Fzig-mosquitto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Fzig-mosquitto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Fzig-mosquitto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Fzig-mosquitto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thin-edge","download_url":"https://codeload.github.com/thin-edge/zig-mosquitto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Fzig-mosquitto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259896239,"owners_count":22928331,"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":[],"created_at":"2025-06-14T23:05:43.619Z","updated_at":"2025-06-14T23:05:44.476Z","avatar_url":"https://github.com/thin-edge.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zig build for mosquitto\n\nCross compile mosquitto using zig build (tested with ziglang 0.14.0).\n\n- produce static executables\n- support for TLS (with an option to disable it if it is not needed)\n- bridge enabled\n- no websocket support\n- no systemd support (e.g. SDNotify isn't enabled)\n\n## Build Pre-requisites\n\n* ziglang 0.14.0\n* [nfpm](https://nfpm.goreleaser.com/) (to build the linux packages)\n* wget (used to download the mosquitto source code)\n\n## Building\n\n1. Clone the project\n\n    ```sh\n    git clone https://github.com/thin-edge/zig-mosquitto\n    cd zig-mosquitto\n    ```\n\n2. Checkout/download the mosquitto source code\n\n    ```sh\n    just checkout-mosquitto\n    ```\n\n    Or you can specify the mosquitto version by setting the `VERSION` environment variable.\n\n    ```sh\n    VERSION=2.0.21 just checkout-mosquitto\n    ```\n\n3. Build all targets\n\n    ```sh\n    just build-all\n    ```\n\n    Or specify the `VERSION` environment variable.\n\n    ```sh\n    VERSION=2.0.21 just build-all\n    ```\n\n    If you don't want to include TLS, then you can run:\n\n    ```sh\n    just build-notls-all\n    ```\n\n4. Use the build linux packages under the `dist/` folder\n\n    ```sh\n    ls -l dist/\n\n    # Using DNF (Fedora, RHEL, AmazonLinux)\n    dnf install tedge-mosquitto*.rpm\n\n    # Using Debian/Ubuntu\n    apt-get install tedge-mosquitto*.deb\n    ```\n\n### Building a single target\n\nIf you don't want to build for all of the targets, then you can build using\n\nThe compiled `mosquitto` binary will be created under `./zig-out/mosquitto`, however it will only be the binary from the last build.\n\n**With TLS**\n\n```sh\njust build x86_64-linux-musl amd64\n\njust build aarch64-linux-musl arm64\n\njust build arm-linux-musleabihf arm7\n\njust build arm-linux-musleabi arm5\n\njust build riscv64-linux-musl riscv64\n```\n\n**Without TLS**\n\n```sh\njust build-notls x86_64-linux-musl amd64\n\njust build-notls aarch64-linux-musl arm64\n\njust build-notls arm-linux-musleabihf arm7\n\njust build-notls arm-linux-musleabi arm5\n\njust build-notls riscv64-linux-musl riscv64\n```\n\n```shell\n# Clone: mainly a build.zig file\n$ git clone https://github.com/thin-edge/zig-mosquitto\n$ cd zig-mosquitto\n\n# The build expect a mosquitto sub-directory with mosquitto sources \n$ wget https://mosquitto.org/files/source/mosquitto-2.0.18.tar.gz\n$ tar -xzf mosquitto-2.0.18.tar.gz\n$ ln -s mosquitto-2.0.18 mosquitto\n\n# Compile with appropriate target\n$ zig build -Doptimize=ReleaseSmall -Dtarget=aarch64-linux-musl\n$ ls -l zig-out/bin/mosquitto\n-rwxrwxr-x 1 didier didier 209200 juin  19 22:00 zig-out/bin/mosquitto\n$ file zig-out/bin/mosquitto\nzig-out/bin/mosquitto: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped\n```\n\n## TODO\n\nThe following items are still yet to be addressed/fixed:\n\n* [ ] Support for other init systems like OpenRC, SysVInit, s6-overlay\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Fzig-mosquitto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthin-edge%2Fzig-mosquitto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Fzig-mosquitto/lists"}