app-shells/atuin: add 18.16.1

Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Florian Schmaus
2026-06-03 19:00:34 +02:00
parent cea67b6789
commit 24a31c2cfa
2 changed files with 155 additions and 0 deletions

View File

@@ -8,3 +8,5 @@ DIST atuin-18.14.1-crates.tar.xz 47072888 BLAKE2B a1904e9474a9daf8c355f9b5eb1b56
DIST atuin-18.14.1.tar.gz 2778055 BLAKE2B e2a0b40566db8757cc1e3f679ca644f6846a4134a62f8b29763435cdce79f94747f5d7a4fe40262167b9f95c77d0a6a6453f9b7ca443de6f285761923beabb8b SHA512 01d0f4c8293dcdf95a19879453464bbdc35b72bfcdddd02ca8452821ceccd9e98bc0206d9ad0da5a7f9ccfa6b885cd3f2033a18b94a45d10e410dd842aa6ec51
DIST atuin-18.16.0-crates.tar.xz 47668520 BLAKE2B 2bf6b34de97739bcd9b4ca73094c49a8973954e7e80f4a7e95a964350b1720fbc127a1db31f02145ab5f76497b83e4e2ed07c0d08117a4f713e32c2d348ad03c SHA512 92b5493021bda6313b8f0501d5b1820d7e4f4665907f6403dd5c12c1b3ea271759c81273d3acc4b7eb17ed924b3c0d3b2695b7d361b5175be97737bc3749dd1e
DIST atuin-18.16.0.tar.gz 2983921 BLAKE2B 8055e006a87552a3de4fb0839c6ffcac2bd79f9cc0bd06589158e6590ccd9d71452262ccb6c4c853dc18681b3380780cc0f4def17825e321c2f97d57aae333b7 SHA512 452674761028f66dc4e3208bb0ab53d20611383445aa40a70635f335ffd1bde03b925d0b6b0cf760e209054ce77df97f75ce720380a86263d7627723e80d3f09
DIST atuin-18.16.1-crates.tar.xz 47668520 BLAKE2B 2bf6b34de97739bcd9b4ca73094c49a8973954e7e80f4a7e95a964350b1720fbc127a1db31f02145ab5f76497b83e4e2ed07c0d08117a4f713e32c2d348ad03c SHA512 92b5493021bda6313b8f0501d5b1820d7e4f4665907f6403dd5c12c1b3ea271759c81273d3acc4b7eb17ed924b3c0d3b2695b7d361b5175be97737bc3749dd1e
DIST atuin-18.16.1.tar.gz 2990587 BLAKE2B c984d5c58b05dfd3c6d24f6a5c81fd6989c03117c4f2c39653b1c23b1065a595b455037a6190a40b5f3d93632a20b11875fa6228e843d33e1d94089e91e95078 SHA512 6aa296b8ac82df1dc4b8aa667252950a4b4dc22e9c7e64c37f91be991a57d6a9ba4b013b7b17e34989bfc2cc644616efc241ac7835274bef3453c1894e6e4e06

View File

@@ -0,0 +1,153 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
RUST_MIN_VER="1.95.0"
inherit cargo greadme shell-completion systemd
DESCRIPTION="Shell history manager supporting encrypted synchronisation"
HOMEPAGE="https://atuin.sh https://github.com/atuinsh/atuin"
SRC_URI="https://github.com/atuinsh/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/gentoo-crate-dist/atuin/releases/download/v${PV}/${P}-crates.tar.xz"
SRC_URI+=" ${CARGO_CRATE_URIS}"
LICENSE="MIT"
# Dependent crate licenses
# - openssl for ring crate
LICENSE+="
Apache-2.0 BSD Boost-1.0 CC0-1.0 CDLA-Permissive-2.0 ISC MIT MPL-2.0 openssl
Unicode-3.0 WTFPL-2 ZLIB
"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~riscv"
IUSE="+client +daemon server system-sqlite test +sync"
RESTRICT="!test? ( test )"
REQUIRED_USE="
|| ( client server )
sync? ( client )
test? ( client server sync )
"
DEPEND="system-sqlite? ( dev-db/sqlite:3 )"
RDEPEND="${DEPEND}
server? ( acct-user/atuin )
"
BDEPEND="test? ( dev-db/postgresql )"
QA_FLAGS_IGNORED="usr/bin/${PN}"
GREADME_DISABLE_AUTOFORMAT=1
DOCS=( CONTRIBUTING.md CONTRIBUTORS README.md )
src_configure() {
# Using system-sqlite has a negative performance impact
# see https://bugs.gentoo.org/959120
use system-sqlite && export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
local myfeatures=(
$(usev client)
$(usev daemon)
$(usev sync)
)
cargo_src_configure --no-default-features
}
src_compile() {
cargo_src_compile --bin ${PN}
if use server; then
cargo_src_compile --bin atuin-server
fi
ATUIN_BIN="$(cargo_target_dir)/${PN}"
# Prepare shell completion generation
mkdir completions || die
local shell
for shell in bash fish zsh; do
"${ATUIN_BIN}" gen-completions \
-s ${shell} \
-o completions \
|| die
done
if ! use client; then
return 0
fi
mkdir shell-init || die
for shell in bash fish zsh; do
"${ATUIN_BIN}" init ${shell} > shell-init/${shell} || die
done
}
src_test() {
local postgres_dir="${T}"/postgres
initdb "${postgres_dir}" || die
local port=11123
# -h '' --> only socket connections allowed.
postgres -D "${postgres_dir}" \
-k "${postgres_dir}" \
-p "${port}" &
local postgres_pid=${!}
local timeout_secs=30
timeout "${timeout_secs}" bash -c \
'until printf "" >/dev/tcp/${0}/${1} 2>> "${T}/portlog"; do sleep 1; done' \
localhost "${port}" || die "Timeout waiting for postgres port ${port} to become available"
psql -h localhost -p "${port}" -d postgres <<-EOF || die "Failed to configure postgres"
create database atuin;
create user atuin with encrypted password 'pass';
grant all privileges on database atuin to atuin;
\connect atuin
grant all on schema public to atuin;
EOF
# Subshell so that postgres_pid is in scope when the trap is executed.
(
cleanup() {
kill "${postgres_pid}" || die "failed to send SIGTERM to postgres"
}
trap cleanup EXIT
ATUIN_DB_URI="postgres://atuin:pass@localhost:${port}/atuin" cargo_src_test
)
}
src_install() {
dobin "${ATUIN_BIN}"
if use server; then
dobin "${ATUIN_BIN}-server"
systemd_dounit "${FILESDIR}/atuin.service"
fi
dodoc -r "${DOCS[@]}"
newbashcomp "completions/${PN}.bash" "${PN}"
dozshcomp "completions/_${PN}"
dofishcomp "completions/${PN}.fish"
if use daemon; then
systemd_douserunit "${FILESDIR}"/atuin-daemon.{service,socket}
fi
if ! use client; then
return 0
fi
insinto "/usr/share/${PN}"
doins -r shell-init
# The following readme text is only relevant if USE=client.
greadme_stdin <<-EOF
Gentoo installs atuin's shell-init code under
/usr/share/atuin/shell-init/
Therefore, instead of using, e.g., 'eval \"\$(atuin init zsh)\"' in
your .zshrc you can simply put \"source /usr/share/atuin/shell-init/zsh\"
there, which avoids the cost of forking a process.
EOF
}