EAPI=8 inherit cmake flag-o-matic DESCRIPTION="Agent Smith: terminal assistant with tools on this host, sessions on alpha (C++)" HOMEPAGE="https://trunkmasters.com/smith" SRC_URI="https://www.hedronfire.com/distfiles/${P}.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64" IUSE="server" DEPEND=" =dev-libs/boost-1.91.0* =dev-libs/openssl-3.6.5* >=dev-db/sqlite-3.53:3 =dev-cpp/nlohmann_json-3.12.0* =dev-cpp/tomlplusplus-3.4.0* " # The client runs sandboxed commands in bubblewrap and logs in over OpenSSH. The # server runs as an existing `smith` account (on Alpha it predates any acct package). RDEPEND=" ${DEPEND} dev-vcs/git net-misc/openssh sys-apps/bubblewrap " BDEPEND=" dev-vcs/git =dev-cpp/catch-3.15.3* >=dev-lang/python-3.11 " src_configure() { # The project refuses in-source builds and requires an absolute build root. export SMITH_CPP_BUILD_ROOT="${WORKDIR}/build" local mycmakeargs=( -DSMITH_SANITIZER=none ) cmake_src_configure } src_test() { # The end-to-end tests (sockets, TLS, a pty) run in CI, outside the Portage sandbox. cmake_src_test -R '^unit$' } src_install() { cmake_src_install if use server; then newinitd "${ED}"/usr/share/smith/openrc/smithd.initd smithd newconfd "${ED}"/usr/share/smith/openrc/smithd.confd smithd else rm "${ED}"/usr/sbin/smithd "${ED}"/usr/libexec/smith/smith-mcp || die fi } pkg_postinst() { use server || return elog "Server: needs the system account smith (and AIRouter's account in group of the" elog "relay socket). Start from /usr/share/smith/server.toml.example as /etc/smith/server.toml" elog "(root:smith 0640). AIRouter needs a smith principal, the smith role and a profile" elog "pinned to it whose resource server is /usr/libexec/smith/smith-mcp with" elog "SMITH_MCP_SOCKET=/run/smith/relay/relay.sock. Then: rc-service smithd start." }