* [gentoo-commits] repo/gentoo:master commit in: app-shells/atuin/, app-shells/atuin/files/
@ 2024-01-01 18:58 Florian Schmaus
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Schmaus @ 2024-01-01 18:58 UTC (permalink / raw
  To: gentoo-commits
commit:     3eff40a18e315d09bcae43de2d9edb93c6c76aa4
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  1 18:57:09 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Mon Jan  1 18:58:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3eff40a1
app-shells/atuin: install systemd service and shell inits
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
 ...{atuin-17.1.0.ebuild => atuin-17.1.0-r1.ebuild} | 26 ++++++++++++++++++++--
 app-shells/atuin/files/atuin.service               | 10 +++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/app-shells/atuin/atuin-17.1.0.ebuild b/app-shells/atuin/atuin-17.1.0-r1.ebuild
similarity index 92%
rename from app-shells/atuin/atuin-17.1.0.ebuild
rename to app-shells/atuin/atuin-17.1.0-r1.ebuild
index b4c1180a83f9..73e7165fe160 100644
--- a/app-shells/atuin/atuin-17.1.0.ebuild
+++ b/app-shells/atuin/atuin-17.1.0-r1.ebuild
@@ -423,7 +423,7 @@ CRATES="
 	zeroize_derive@1.4.2
 "
 
-inherit cargo shell-completion
+inherit cargo shell-completion systemd readme.gentoo-r1
 
 DESCRIPTION="Shell history manager supporting encrypted synchronisation"
 HOMEPAGE="https://atuin.sh https://github.com/atuinsh/atuin"
@@ -444,6 +444,7 @@ REQUIRED_USE="
 	sync? ( client )
 	test? ( client server sync )
 "
+RDEPEND="server? ( acct-user/atuin )"
 BDEPEND=">=virtual/rust-1.71.0"
 
 QA_FLAGS_IGNORED="usr/bin/${PN}"
@@ -484,13 +485,20 @@ src_compile() {
 					 -o completions \
 			|| die
 	done
+
+	mkdir shell-init || die
+	for shell in bash fish zsh; do
+		"${ATUIN_BIN}" init ${shell} > shell-init/${shell} || die
+	done
 }
 
 src_install() {
 	exeinto "/usr/bin"
 	doexe "${ATUIN_BIN}"
 
-	if ! use server; then
+	if use server; then
+		systemd_dounit "${FILESDIR}/atuin.service"
+	else
 		rm -r "docs/docs/self-hosting" || die
 	fi
 
@@ -499,4 +507,18 @@ src_install() {
 	newbashcomp "completions/${PN}.bash" "${PN}"
 	dozshcomp "completions/_${PN}"
 	dofishcomp "completions/${PN}.fish"
+
+	insinto "/usr/share/${PN}"
+	doins -r shell-init
+
+	local DOC_CONTENTS="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."
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
 }
diff --git a/app-shells/atuin/files/atuin.service b/app-shells/atuin/files/atuin.service
new file mode 100644
index 000000000000..6408e142b1a5
--- /dev/null
+++ b/app-shells/atuin/files/atuin.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Atuin (shell history manager) server
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/atuin server start
+User=atuin
+
+[Install]
+WantedBy=default.target
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/atuin/, app-shells/atuin/files/
@ 2025-05-16 10:11 Arthur Zamarin
  0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2025-05-16 10:11 UTC (permalink / raw
  To: gentoo-commits
commit:     5cc79e4bfc2b153f4d0c62e8d78ea6b9eec68cec
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May 16 10:11:06 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May 16 10:11:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cc79e4b
app-shells/atuin: add 18.6.1
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
 app-shells/atuin/Manifest            |   2 +
 app-shells/atuin/atuin-18.6.1.ebuild | 141 +++++++++++++++++++++++++++++++++++
 app-shells/atuin/files/README.gentoo |   5 ++
 3 files changed, 148 insertions(+)
diff --git a/app-shells/atuin/Manifest b/app-shells/atuin/Manifest
index 1b71be01ba70..f8b92513b584 100644
--- a/app-shells/atuin/Manifest
+++ b/app-shells/atuin/Manifest
@@ -2,3 +2,5 @@ DIST atuin-18.4.0-crates.tar.xz 51123080 BLAKE2B c7266f1e8379a506fe3c5d66130b6f9
 DIST atuin-18.4.0.tar.gz 641540 BLAKE2B 234066aee376311a2336b35baf9114d3f52a8d71a5613a9d1f5d449bfce1087be20d7ebf92c8198c79d55359f53ad377334e1ea8f622b6580c8f10d1fa53b4df SHA512 26728549a52cc37dfc4d2e42cae73d5a3bb0475233b2dc88dcb7446aba355b78970601e8693fcfa5eb19658b544b7c92f20bd9e19a1a75a1cef30bec27426e03
 DIST atuin-18.5.0-crates.tar.xz 43441568 BLAKE2B a6b3315429c441d1d4449ba962bad07320b8058a88269989e851d0925ff16ea1156ddee4b787a2bdbbeaf9d20445c3bd7157233b5ab032b1586c8e579f66d2b2 SHA512 57aeb6a361d11bb42d918ff9d55f2b7e73b487dfec3edf4f63726ed2b349e53d6450029a00a5c34a64f454d2f82b6084e554882125b62ee10b6c1d40b07fe7bf
 DIST atuin-18.5.0.tar.gz 664804 BLAKE2B 72044a3fbf06e57c08cd10d8d4a70b08807f0e078367dac84e5c5411946346041308ddef1d88b6ceb82e281ea08c1a48aae5e8446881e62c3666d2e8af3ceb6d SHA512 7f493ccd9c23b898e46238001752e20317be010bc2871cccf24f64770d5fbd3c45d6fba8e2143651f126f0119ef348fb543cb0017be6fd5738c6217bd6921eaf
+DIST atuin-18.6.1-crates.tar.xz 43525080 BLAKE2B 2b8eac104e61d506191d1027e1b73e09bdd177fb8d88fd50affdd57c146a7e57e1dcebc8ed524d4f052b4c9eb3df384324eb753ccf2535d0272c44166ad44b8b SHA512 2c4d54b83db7101ae81ea3c0965249dab0143e4175ca7632d36fd9d3f9e1f8d29284c18742b8d16f8b1c8b430e2f76cdc905778da2fda11c13bb9ceface60144
+DIST atuin-18.6.1.tar.gz 666475 BLAKE2B 64a072ce2cd683184f12886ffac94a580cddd09c5beb5f936cdecb3fe7afe7db2380529b9dc74cf7c967fa50a8d23491d571b3af8befad326ffef338a00096b1 SHA512 c1a75935ea4a5335315841e767c89cb2da5374449943497bbad8744e12fe2e64c49bb442f3987fd5cf4707dccfa2a066df3d7abcbf7a7ddadde29a6c9fcf5c56
diff --git a/app-shells/atuin/atuin-18.6.1.ebuild b/app-shells/atuin/atuin-18.6.1.ebuild
new file mode 100644
index 000000000000..1e2585996737
--- /dev/null
+++ b/app-shells/atuin/atuin-18.6.1.ebuild
@@ -0,0 +1,141 @@
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES=" "
+RUST_MIN_VER="1.86"
+
+inherit cargo readme.gentoo-r1 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"
+
+LICENSE="MIT"
+# Dependent crate licenses
+# - openssl for ring crate
+LICENSE+=" Apache-2.0 BSD Boost-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016 openssl"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv"
+IUSE="+client +daemon server test +sync"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+	|| ( client server )
+	sync? ( client )
+	test? ( client server sync )
+"
+DEPEND="dev-db/sqlite:3"
+RDEPEND="${DEPEND}
+	server? ( acct-user/atuin )
+"
+BDEPEND="test? ( dev-db/postgresql )"
+
+QA_FLAGS_IGNORED="usr/bin/${PN}"
+
+DISABLE_AUTOFORMATTING=1
+
+DOCS=( CONTRIBUTING.md CONTRIBUTORS README.md )
+
+src_configure() {
+	export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
+	local myfeatures=(
+		$(usev client)
+		$(usev daemon)
+		$(usev server)
+		$(usev sync)
+	)
+	cargo_src_configure --no-default-features
+}
+
+src_compile() {
+	cargo_src_compile
+
+	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
+		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
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}
diff --git a/app-shells/atuin/files/README.gentoo b/app-shells/atuin/files/README.gentoo
new file mode 100644
index 000000000000..1c6eee971743
--- /dev/null
+++ b/app-shells/atuin/files/README.gentoo
@@ -0,0 +1,5 @@
+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.
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/atuin/, app-shells/atuin/files/
@ 2025-07-22  7:23 Florian Schmaus
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Schmaus @ 2025-07-22  7:23 UTC (permalink / raw
  To: gentoo-commits
commit:     20b4f3efbed3ce3ef64a6e0b4de49a0f19268332
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 22 07:04:34 2025 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Jul 22 07:23:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20b4f3ef
app-shells/atuin: switch back to greadme.eclass
The package used greadme.eclass before, but was, for some unknown reason,
switched back to readme.gentoo-r1.eclass with
5cc79e4bfc2b ("app-shells/atuin: add 18.6.1"). However, this broke
multiple things:
- readme.gentoo-r1.eclass is not as flexible with optional README files
  as greadme.eclass, causing https://bugs.gentoo.org/956351 which was fixed with
  d1911f241fa8 ("app-shells/atuin: fix call to readme.gentoo_create_doc
  IUSE="client"")
- the README text was copied verbatim from the bash here-doc into a
  file, resulting in wrong quotes being shown
- the readme text is only sensible if USE=client and hence was only
  conditionally shown if this the 'client' USE flag was enabled
Ultimately, greadme.eclass is more sophisticated as
readme.gentoo-r1.eclass and can be used in every situation where
readme.gentoo-r1.eclass is used.
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
 .../{atuin-18.6.1.ebuild => atuin-18.6.1-r1.ebuild}      | 16 ++++++++++------
 .../{atuin-18.7.1.ebuild => atuin-18.7.1-r1.ebuild}      | 16 ++++++++++------
 app-shells/atuin/files/README.gentoo                     |  5 -----
 3 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/app-shells/atuin/atuin-18.6.1.ebuild b/app-shells/atuin/atuin-18.6.1-r1.ebuild
similarity index 87%
rename from app-shells/atuin/atuin-18.6.1.ebuild
rename to app-shells/atuin/atuin-18.6.1-r1.ebuild
index a004c99ef1d5..c2c0b9fd42ba 100644
--- a/app-shells/atuin/atuin-18.6.1.ebuild
+++ b/app-shells/atuin/atuin-18.6.1-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 CRATES=" "
 RUST_MIN_VER="1.86"
 
-inherit cargo readme.gentoo-r1 shell-completion systemd
+inherit cargo greadme shell-completion systemd
 
 DESCRIPTION="Shell history manager supporting encrypted synchronisation"
 HOMEPAGE="https://atuin.sh https://github.com/atuinsh/atuin"
@@ -34,7 +34,7 @@ BDEPEND="test? ( dev-db/postgresql )"
 
 QA_FLAGS_IGNORED="usr/bin/${PN}"
 
-DISABLE_AUTOFORMATTING=1
+GREADME_DISABLE_AUTOFORMAT=1
 
 DOCS=( CONTRIBUTING.md CONTRIBUTORS README.md )
 
@@ -110,7 +110,6 @@ src_test() {
 }
 
 src_install() {
-	readme.gentoo_create_doc
 	dobin "${ATUIN_BIN}"
 
 	if use server; then
@@ -133,8 +132,13 @@ src_install() {
 
 	insinto "/usr/share/${PN}"
 	doins -r shell-init
-}
 
-pkg_postinst() {
-	readme.gentoo_print_elog
+	# 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
 }
diff --git a/app-shells/atuin/atuin-18.7.1.ebuild b/app-shells/atuin/atuin-18.7.1-r1.ebuild
similarity index 87%
rename from app-shells/atuin/atuin-18.7.1.ebuild
rename to app-shells/atuin/atuin-18.7.1-r1.ebuild
index 5ee9a1e6c3c5..ea768df96754 100644
--- a/app-shells/atuin/atuin-18.7.1.ebuild
+++ b/app-shells/atuin/atuin-18.7.1-r1.ebuild
@@ -7,7 +7,7 @@ CRATES=" "
 
 RUST_MIN_VER="1.86"
 
-inherit cargo readme.gentoo-r1 shell-completion systemd
+inherit cargo greadme shell-completion systemd
 
 DESCRIPTION="Shell history manager supporting encrypted synchronisation"
 HOMEPAGE="https://atuin.sh https://github.com/atuinsh/atuin"
@@ -35,7 +35,7 @@ BDEPEND="test? ( dev-db/postgresql )"
 
 QA_FLAGS_IGNORED="usr/bin/${PN}"
 
-DISABLE_AUTOFORMATTING=1
+GREADME_DISABLE_AUTOFORMAT=1
 
 DOCS=( CONTRIBUTING.md CONTRIBUTORS README.md )
 
@@ -111,7 +111,6 @@ src_test() {
 }
 
 src_install() {
-	readme.gentoo_create_doc
 	dobin "${ATUIN_BIN}"
 
 	if use server; then
@@ -134,8 +133,13 @@ src_install() {
 
 	insinto "/usr/share/${PN}"
 	doins -r shell-init
-}
 
-pkg_postinst() {
-	readme.gentoo_print_elog
+	# 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
 }
diff --git a/app-shells/atuin/files/README.gentoo b/app-shells/atuin/files/README.gentoo
deleted file mode 100644
index 1c6eee971743..000000000000
--- a/app-shells/atuin/files/README.gentoo
+++ /dev/null
@@ -1,5 +0,0 @@
-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.
^ permalink raw reply related	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-22  7:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 10:11 [gentoo-commits] repo/gentoo:master commit in: app-shells/atuin/, app-shells/atuin/files/ Arthur Zamarin
  -- strict thread matches above, loose matches on Subject: below --
2025-07-22  7:23 Florian Schmaus
2024-01-01 18:58 Florian Schmaus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox