{"id":20662650,"url":"https://github.com/gentoo/cargo-ebuild","last_synced_at":"2025-04-19T15:54:40.464Z","repository":{"id":38106084,"uuid":"371270977","full_name":"gentoo/cargo-ebuild","owner":"gentoo","description":"[MIRROR] cargo extension that can generate ebuilds using the in-tree eclasses","archived":false,"fork":false,"pushed_at":"2023-08-10T09:01:10.000Z","size":273,"stargazers_count":36,"open_issues_count":15,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T09:41:45.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitweb.gentoo.org/proj/cargo-ebuild.git","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gentoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-05-27T06:34:15.000Z","updated_at":"2025-03-25T10:37:34.000Z","dependencies_parsed_at":"2024-06-20T23:26:53.948Z","dependency_job_id":"5d2b701c-6842-43ee-94aa-0a19155bf7a8","html_url":"https://github.com/gentoo/cargo-ebuild","commit_stats":{"total_commits":126,"total_committers":14,"mean_commits":9.0,"dds":"0.46825396825396826","last_synced_commit":"cd2b45c311be01f7a1785894773c69702a337716"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gentoo%2Fcargo-ebuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gentoo%2Fcargo-ebuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gentoo%2Fcargo-ebuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gentoo%2Fcargo-ebuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gentoo","download_url":"https://codeload.github.com/gentoo/cargo-ebuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249730904,"owners_count":21317334,"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":"2024-11-16T19:14:54.163Z","updated_at":"2025-04-19T15:54:40.447Z","avatar_url":"https://github.com/gentoo.png","language":"Rust","readme":"# cargo-ebuild\n\n[![Build Status](https://github.com/gentoo/cargo-ebuild/actions/workflows/rust.yml/badge.svg)](https://github.com/gentoo/cargo-ebuild/actions)\n[![Latest Version](https://img.shields.io/crates/v/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)\n[![All downloads](https://img.shields.io/crates/d/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)\n[![Downloads of latest version](https://img.shields.io/crates/dv/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)\n\n`cargo ebuild` is a Cargo subcommand that generates an\n[ebuild](https://wiki.gentoo.org/wiki/Ebuild) recipe that uses\n[cargo.eclass](https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/cargo.eclass)\nto build a Cargo based project for [Gentoo](https://gentoo.org/)\n\n## Installation\n\nInstall it with Cargo:\n\n```\n$ cargo install cargo-ebuild\n```\n\n## Usage\n\nYou will first need to get the sources to the crate you want to install.\nYour best bet is to search for the crate at [crates.io](https://crates.io)\nand follow the *Repository* link. This should give you the ability to clone\nthe repo. Once you have cloned the repo, change into the directory and\nensure that you checkout the tag corresponding to the version you would like\nto package. Lastly you will execute the `cargo ebuild` command to generate the\nebuild for that crate.\n\n### Example\n\n```shell-session\n$ git clone https://github.com/gentoo/cargo-ebuild.git\n$ cd cargo-ebuild\n$ git checkout 0.5.3\n$ cargo ebuild\n$ cat cargo-ebuild-0.5.3.ebuild\n```\n\n```bash\n# Copyright 2023 Gentoo Authors\n# Distributed under the terms of the GNU General Public License v2\n\n# Auto-Generated by cargo-ebuild 0.5.3\n\nEAPI=8\n\nCRATES=\"\n\taho-corasick-0.7.20\n\tansi_term-0.12.1\n\tanyhow-1.0.68\n\tatty-0.2.14\n\tautocfg-1.1.0\n\tbitflags-1.3.2\n\tblock-buffer-0.10.3\n\tbstr-0.2.17\n\tcamino-1.1.1\n\tcargo-lock-8.0.3\n\tcargo-platform-0.1.2\n\tcargo_metadata-0.15.2\n\tcc-1.0.78\n\tcfg-if-1.0.0\n\tclap-2.34.0\n\tcpufeatures-0.2.5\n\tcrates-index-0.18.11\n\tcrossbeam-channel-0.5.6\n\tcrossbeam-deque-0.8.2\n\tcrossbeam-epoch-0.9.13\n\tcrossbeam-utils-0.8.14\n\tcrypto-common-0.1.6\n\tcvss-2.0.0\n\tdigest-0.10.6\n\teither-1.8.0\n\tfnv-1.0.7\n\tform_urlencoded-1.1.0\n\tfs-err-2.9.0\n\tgeneric-array-0.14.6\n\tgit2-0.15.0\n\tglobset-0.4.9\n\tglobwalk-0.8.1\n\theck-0.3.3\n\thermit-abi-0.1.19\n\thermit-abi-0.2.6\n\thex-0.4.3\n\thome-0.5.4\n\thumantime-2.1.0\n\thumantime-serde-1.1.1\n\tidna-0.3.0\n\tignore-0.4.18\n\titertools-0.10.5\n\titoa-1.0.5\n\tjobserver-0.1.25\n\tlazy_static-1.4.0\n\tlibc-0.2.139\n\tlibgit2-sys-0.14.0+1.5.0\n\tlibssh2-sys-0.2.23\n\tlibz-sys-1.1.8\n\tlog-0.4.17\n\tmemchr-2.5.0\n\tmemoffset-0.7.1\n\tnum_cpus-1.15.0\n\tonce_cell-1.17.0\n\topenssl-probe-0.1.5\n\topenssl-sys-0.9.80\n\tpercent-encoding-2.2.0\n\tpest-2.5.2\n\tpest_derive-2.5.2\n\tpest_generator-2.5.2\n\tpest_meta-2.5.2\n\tphf-0.11.1\n\tphf_generator-0.11.1\n\tphf_macros-0.11.1\n\tphf_shared-0.11.1\n\tpkg-config-0.3.26\n\tplatforms-3.0.2\n\tproc-macro-error-1.0.4\n\tproc-macro-error-attr-1.0.4\n\tproc-macro2-1.0.49\n\tquote-1.0.23\n\trand-0.8.5\n\trand_core-0.6.4\n\trayon-1.6.1\n\trayon-core-1.10.1\n\tregex-1.7.0\n\tregex-syntax-0.6.28\n\trustc-hash-1.1.0\n\trustsec-0.26.4\n\tryu-1.0.12\n\tsame-file-1.0.6\n\tscopeguard-1.1.0\n\tsemver-1.0.16\n\tserde-1.0.152\n\tserde_derive-1.0.152\n\tserde_json-1.0.91\n\tsha1-0.10.5\n\tsiphasher-0.3.10\n\tsmartstring-1.0.1\n\tstatic_assertions-1.1.0\n\tstrsim-0.8.0\n\tstructopt-0.3.26\n\tstructopt-derive-0.4.18\n\tsyn-1.0.107\n\ttera-1.17.1\n\ttextwrap-0.11.0\n\tthiserror-1.0.38\n\tthiserror-impl-1.0.38\n\tthread_local-1.1.4\n\ttime-0.3.17\n\ttime-core-0.1.0\n\ttinyvec-1.6.0\n\ttinyvec_macros-0.1.0\n\ttoml-0.5.10\n\ttypenum-1.16.0\n\tucd-trie-0.1.5\n\tunic-char-property-0.9.0\n\tunic-char-range-0.9.0\n\tunic-common-0.9.0\n\tunic-segment-0.9.0\n\tunic-ucd-segment-0.9.0\n\tunic-ucd-version-0.9.0\n\tunicode-bidi-0.3.8\n\tunicode-ident-1.0.6\n\tunicode-normalization-0.1.22\n\tunicode-segmentation-1.10.0\n\tunicode-width-0.1.10\n\turl-2.3.1\n\tvcpkg-0.2.15\n\tvec_map-0.8.2\n\tversion_check-0.9.4\n\twalkdir-2.3.2\n\twinapi-0.3.9\n\twinapi-i686-pc-windows-gnu-0.4.0\n\twinapi-util-0.1.5\n\twinapi-x86_64-pc-windows-gnu-0.4.0\n\"\n\ninherit cargo\n\nDESCRIPTION=\"Generates an ebuild for a package using the in-tree eclasses.\"\n# Double check the homepage as the cargo_metadata crate\n# does not provide this value so instead repository is used\nHOMEPAGE=\"https://github.com/gentoo/cargo-ebuild\"\nSRC_URI=\"$(cargo_crate_uris)\"\n\n# License set may be more restrictive as OR is not respected\n# use cargo-license for a more accurate license picture\nLICENSE=\"Apache-2.0 Boost-1.0 MIT MPL-2.0+ Unicode-DFS-2016 Unlicense ZLIB\"\nSLOT=\"0\"\nKEYWORDS=\"~amd64\"\n\nDEPEND=\"\"\nRDEPEND=\"${DEPEND}\"\nBDEPEND=\"\"\n\n# rust does not use *FLAGS from make.conf, silence portage warning\n# update with proper path to binaries this crate installs, omit leading /\nQA_FLAGS_IGNORED=\"usr/bin/${PN}\"\n```\n\n## API\n\nAPI documentation is available at [docs.rs](https://docs.rs/cargo-ebuild/).\n\n## Templates\n\n`cargo-ebuild` allows you to use a custom [tera](https://crates.io/crates/tera) template.\n\nThe built-in `base.tera` provided is the following:\n\n``` tera\n{%- block header -%}\n# Copyright 2017-{{ this_year }} Gentoo Authors\n# Distributed under the terms of the GNU General Public License v2\n\n# Auto-Generated by cargo-ebuild {{ cargo_ebuild_ver }}\n{% endblock %}\nEAPI={%- block eapi -%}7{%- endblock %}\n\n{% block crates -%}\nCRATES=\"\n{% for crate in crates -%}\n{{ crate }}\n{%- endfor -%}\"\n{%- endblock %}\n\ninherit {% block inherit -%}cargo{%- endblock %}\n\nDESCRIPTION={%- block description -%}\"{{ description | trim }}\"{%- endblock %}\n# Double check the homepage as the cargo_metadata crate\n# does not provide this value so instead repository is used\nHOMEPAGE={%- block homepage -%}\"{{ homepage }}\"{%- endblock %}\nSRC_URI={%- block src_uri -%}{% raw -%}\"$(cargo_crate_uris ${CRATES})\"{%- endraw %}{%- endblock %}\n# License set may be more restrictive as OR is not respected\n# use cargo-license for a more accurate license picture\nLICENSE={%- block license -%}\"{{ license }}\"{%- endblock %}\nSLOT={%- block slot -%}\"0\"{%- endblock %}\nKEYWORDS={%- block keyword -%}\"~amd64\"{%- endblock %}\n{% block variables -%}\nRESTRICT=\"mirror\"\n{%- endblock %}\n\n{%- block phases -%}\n{%- endblock -%}\n```\n\n``` tera\n{%- extends \"base.tera\" -%}\n\n{% block variables -%}\nUSE=\"+capi\"\n\nASM_DEP=\"\u003e=dev-lang/nasm-2.14\"\nBDEPEND=\"\n\tamd64? ( ${ASM_DEP} )\n\tcapi? ( dev-util/cargo-c )\n\"\n{%- endblock %}\n\n{% block phases -%}\nsrc_compile() {\n\texport CARGO_HOME=\"${ECARGO_HOME}\"\n\tlocal args=$(usex debug \"\" --release)\n\n\tcargo build ${args} \\\n\t\t|| die \"cargo build failed\"\n\n\tif use capi; then\n\t\tcargo cbuild ${args} \\\n\t\t\t--prefix=\"/usr\" --libdir=\"/usr/$(get_libdir)\" \\\n\t\t\t|| die \"cargo cbuild failed\"\n\tfi\n}\n\nsrc_install() {\n\texport CARGO_HOME=\"${ECARGO_HOME}\"\n\tlocal args=$(usex debug \"\" --release)\n\n\tif use capi; then\n\t\tcargo cinstall $args \\\n\t\t\t--prefix=\"/usr\" --libdir=\"/usr/$(get_libdir)\" --destdir=\"${ED}\" \\\n\t\t\t|| die \"cargo cinstall failed\"\n\tfi\n\n\tcargo_src_install\n}\n{%- endblock -%}\n```\n","funding_links":[],"categories":["Development tools"],"sub_categories":["Build system"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgentoo%2Fcargo-ebuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgentoo%2Fcargo-ebuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgentoo%2Fcargo-ebuild/lists"}