Skip to content

Instantly share code, notes, and snippets.

@kir68k
Created August 4, 2023 04:00
Show Gist options
  • Select an option

  • Save kir68k/53deb044e18e3780c89e3435eba09192 to your computer and use it in GitHub Desktop.

Select an option

Save kir68k/53deb044e18e3780c89e3435eba09192 to your computer and use it in GitHub Desktop.
Ebuild for colorgen-nvim, not uploaded to repo as it doesn't compile.
# Copyright 2023 Kirixetamine <revelation@krxt.dev>
# Distributed under the terms of the ISC License
EAPI=8
inherit cargo
DESCRIPTION="Blazingly fast colorscheme generator for Neovim, written in Rust"
HOMEPAGE="https://github.com/LunarVim/colorgen-nvim/"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/LunarVim/colorgen-nvim"
S="${WORKDIR}/${P}"
else
SRC_URI="https://github.com/LunarVim/${PN}/archive/${PV}.tar.gz
$(cargo_crate_uris)"
KEYWORDS="~amd64"
fi
LICENSE="GPL-3"
SLOT="0"
BDEPEND="
virtual/rust
"
src_unpack() {
if [[ ${PV} ]]; then
git-r3_src_unpack
cargo_live_src_unpack
else
cargo_src_unpack
fi
}
src_configure() {
cargo_src_configure --no-default-features --frozen
}
src_compile() {
cargo_src_compile
}
src_install() {
cargo_src_install
}
@kir68k
Copy link
Author

kir68k commented Aug 4, 2023

If you are reading this from my GH issue, but don't know ebuilds and don't want to search for what does what, the important parts are:

inherit cargo which gives access to cargo/rust related functions
cargo_src_configure which configures cargo package features and arguments, like configure scripts
cargo_src_compile which compiles the rust project
cargo_src_install which installs the built binaries onto a filesystem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment