dev-util/grok-build - 1.0.24 (guru)

Search

Install

Install this version:

emerge -a =dev-util/grok-build-1.0.24

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =dev-util/grok-build-1.0.24

Or alternatively:

emerge --autounmask-write -a =dev-util/grok-build-1.0.24

Package Information

Description:
SpaceXAI's coding agent harness and TUI
Homepage:
https://x.ai/cli https://x.ai/open-source https://github.com/xai-org/grok-build
License:
Apache-2.0 Apache-2.0 BSD-2 BSD Boost-1.0 CC0-1.0 CDLA-Permissive-2.0 EPL-2.0 ISC MIT MIT-0 MPL-2.0 MPL-2.0 Unicode-3.0 Unicode-DFS-2016 WTFPL-2 ZLIB

Ebuild Details

Version EAPI Keywords Slot
1.0.24 8 ~amd64 0
View Raw Ebuild
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.16.0

EAPI=8

RUST_MIN_VER="1.92.0"

CRATES="
"

declare -A GIT_CRATES=(
	[async-openai-macros]='https://github.com/our-forks/async-openai;95b52ebdedf42143083cf3d6f0e0be7c84e9c808;async-openai-%commit%/async-openai-macros'
	[async-openai]='https://github.com/our-forks/async-openai;95b52ebdedf42143083cf3d6f0e0be7c84e9c808;async-openai-%commit%/async-openai'
	[nucleo-matcher]='https://github.com/helix-editor/nucleo;5b74652e482f7c07d827f18c6d21e7540c242c69;nucleo-%commit%/matcher'
	[nucleo]='https://github.com/helix-editor/nucleo;5b74652e482f7c07d827f18c6d21e7540c242c69;nucleo-%commit%'
)

inherit cargo check-reqs shell-completion

# no tagged releases
MY_COMMIT="f21225f2d463e1629769c7b4939807923c0ef83e"
DESCRIPTION="SpaceXAI's coding agent harness and TUI"
HOMEPAGE="
	https://x.ai/cli
	https://x.ai/open-source
	https://github.com/xai-org/grok-build
"
SRC_URI="
	https://github.com/xai-org/${PN}/archive/${MY_COMMIT}.tar.gz -> ${P}.gh.tar.gz
	https://github.com/fasys-crate-dist/${PN}/releases/download/v${PV}/${P}-crates.tar.xz
	${CARGO_CRATE_URIS}
"
S="${WORKDIR}/${PN}-${MY_COMMIT}"

LICENSE="Apache-2.0"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 BSD-2 BSD Boost-1.0 CC0-1.0 CDLA-Permissive-2.0 EPL-2.0
	ISC MIT MIT-0 MPL-2.0 MPL-2.0 Unicode-3.0 Unicode-DFS-2016 WTFPL-2
	ZLIB
"
SLOT="0"
KEYWORDS="~amd64" # ~arm64: ugrep
# TODO add feature USE flags?

DEPEND="
	sys-apps/bfs
	sys-apps/ripgrep
	sys-apps/ugrep
	virtual/zlib:=
"
RDEPEND="${DEPEND}"
BDEPEND="
	>=dev-libs/protobuf-25.6[protoc]
"

QA_FLAGS_IGNORED="usr/bin/.*"

CHECKREQS_DISK_BUILD=10G # 9.7G

pkg_setup() {
	check-reqs_pkg_setup
	rust_pkg_setup
}

src_prepare() {
	default

	# Do not bundle ripgrep
	local f
	for f in crates/codegen/xai-grok-{shell,tools}/build.rs; do
		sed \
			-e '1i #![allow(unreachable_code)]' \
			-e '/fn main()/a \    return Ok(());' \
			-i "$f" || die
	done

	# Disable auto-updates
	sed \
		-e '1i #![allow(unreachable_code)]' \
		-e '/fn env_installer(/a \    return Some("portage");' \
		-i crates/codegen/xai-grok-update/src/auto_update.rs || die

	# Cargo offline fetch workaround
	local url commit path
	IFS=";" read -r url commit path <<<"${GIT_CRATES[async-openai]}"
	local ASYNC_OPENAI_GIT="async-openai = { git = \"${url}.git\", rev = \"${commit}\""
	local ASYNC_OPENAI_PATH="async-openai = \\{ path = \"${WORKDIR}/async-openai-${commit}/async-openai\""

	sed "s|${ASYNC_OPENAI_GIT}|${ASYNC_OPENAI_PATH}|" \
		-i "${S}/Cargo.toml" || die
}

src_test() {
	# TODO more tests
	cargo_src_test --package xai-grok-pager-bin
}

src_install() {
	newbin "$(cargo_target_dir)/xai-grok-pager" grok
	dosym grok /usr/bin/agent

	local grok_bin="${ED}/usr/bin/grok"
	"${grok_bin}" completions bash > grok || die
	"${grok_bin}" completions fish > grok.fish || die
	"${grok_bin}" completions zsh > _grok || die

	dobashcomp grok
	dofishcomp grok.fish
	dozshcomp _grok
}

Inherited Eclasses

Dependencies

DEPEND

	sys-apps/bfs
	sys-apps/ripgrep
	sys-apps/ugrep
	virtual/zlib:=

RDEPEND

	sys-apps/bfs
	sys-apps/ripgrep
	sys-apps/ugrep
	virtual/zlib:=

BDEPEND

	>=dev-libs/protobuf-25.6[protoc]

Manifest for 1.0.24

Type File Size Source URLs
DIST grok-build-1.0.24-crates.tar.xz 95670580 bytes https://github.com/fasys-crate-dist/grok-build/releases/download/v1.0.24/grok-build-1.0.24-crates.tar.xz
DIST grok-build-1.0.24.gh.tar.gz 15282296 bytes https://github.com/xai-org/grok-build/archive/f21225f2d463e1629769c7b4939807923c0ef83e.tar.gz