# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="Lightweight distributed issue tracker for AI coding agents"
HOMEPAGE="https://github.com/steveyegge/beads"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
	dev-vcs/git
	dev-db/sqlite
"

EGO_SUM=(
	"github.com/AlekSi/pointer v1.0.0"
	"github.com/AlekSi/pointer v1.0.0/go.mod"
	"github.com/BurntSushi/toml v1.6.0"
	"github.com/BurntSushi/toml v1.6.0/go.mod"
	"github.com/MakeNowJust/heredoc v1.0.0"
	"github.com/MakeNowJust/heredoc v1.0.0/go.mod"
	"github.com/alecthomas/chroma/v2 v2.14.0"
	"github.com/alecthomas/chroma/v2 v2.14.0/go.mod"
	"github.com/anthropics/anthropic-sdk-go v1.19.0"
	"github.com/anthropics/anthropic-sdk-go v1.19.0/go.mod"
	"github.com/atotto/clipboard v0.1.4"
	"github.com/atotto/clipboard v0.1.4/go.mod"
	"github.com/aymanbagabas/go-osc52/v2 v2.0.1"
	"github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod"
	"github.com/aymanbagabas/go-udiff v0.3.1"
	"github.com/aymanbagabas/go-udiff v0.3.1/go.mod"
	"github.com/aymerick/douceur v0.2.0"
	"github.com/aymerick/douceur v0.2.0/go.mod"
	"github.com/catppuccin/go v0.3.0"
	"github.com/catppuccin/go v0.3.0/go.mod"
	"github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7"
	"github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7/go.mod"
	"github.com/charmbracelet/bubbletea v1.3.6"
	"github.com/charmbracelet/bubbletea v1.3.6/go.mod"
	"github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc"
	"github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod"
	"github.com/charmbracelet/glamour v0.10.0"
	"github.com/charmbracelet/glamour v0.10.0/go.mod"
	"github.com/charmbracelet/huh v0.8.0"
	"github.com/charmbracelet/huh v0.8.0/go.mod"
	"github.com/charmbracelet/lipgloss v1.1.0"
	"github.com/charmbracelet/lipgloss v1.1.0/go.mod"
	"github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834"
	"github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834/go.mod"
	"github.com/charmbracelet/x/ansi v0.9.3"
	"github.com/charmbracelet/x/ansi v0.9.3/go.mod"
	"github.com/charmbracelet/x/cellbuf v0.0.13"
	"github.com/charmbracelet/x/cellbuf v0.0.13/go.mod"
	"github.com/charmbracelet/x/conpty v0.1.0"
	"github.com/charmbracelet/x/conpty v0.1.0/go.mod"
	"github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86"
	"github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod"
	"github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91"
	"github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod"
	"github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf"
	"github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf/go.mod"
	"github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0"
	"github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod"
	"github.com/charmbracelet/x/term v0.2.1"
	"github.com/charmbracelet/x/term v0.2.1/go.mod"
	"github.com/charmbracelet/x/termios v0.1.1"
	"github.com/charmbracelet/x/termios v0.1.1/go.mod"
	"github.com/charmbracelet/x/xpty v0.1.2"
	"github.com/charmbracelet/x/xpty v0.1.2/go.mod"
	"github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod"
	"github.com/creack/pty v1.1.24"
	"github.com/creack/pty v1.1.24/go.mod"
	"github.com/davecgh/go-spew v1.1.1"
	"github.com/davecgh/go-spew v1.1.1/go.mod"
	"github.com/dlclark/regexp2 v1.11.0"
	"github.com/dlclark/regexp2 v1.11.0/go.mod"
	"github.com/dustin/go-humanize v1.0.1"
	"github.com/dustin/go-humanize v1.0.1/go.mod"
	"github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f"
	"github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod"
	"github.com/frankban/quicktest v1.14.6"
	"github.com/frankban/quicktest v1.14.6/go.mod"
	"github.com/fsnotify/fsnotify v1.9.0"
	"github.com/fsnotify/fsnotify v1.9.0/go.mod"
	"github.com/go-viper/mapstructure/v2 v2.4.0"
	"github.com/go-viper/mapstructure/v2 v2.4.0/go.mod"
	"github.com/gofrs/flock v0.13.0"
	"github.com/gofrs/flock v0.13.0/go.mod"
	"github.com/google/go-cmp v0.7.0"
	"github.com/google/go-cmp v0.7.0/go.mod"
	"github.com/gorilla/css v1.0.1"
	"github.com/gorilla/css v1.0.1/go.mod"
	"github.com/inconshreveable/mousetrap v1.1.0"
	"github.com/inconshreveable/mousetrap v1.1.0/go.mod"
	"github.com/kr/pretty v0.3.1"
	"github.com/kr/pretty v0.3.1/go.mod"
	"github.com/kr/text v0.2.0"
	"github.com/kr/text v0.2.0/go.mod"
	"github.com/lucasb-eyer/go-colorful v1.2.0"
	"github.com/lucasb-eyer/go-colorful v1.2.0/go.mod"
	"github.com/mattn/go-isatty v0.0.20"
	"github.com/mattn/go-isatty v0.0.20/go.mod"
	"github.com/mattn/go-localereader v0.0.1"
	"github.com/mattn/go-localereader v0.0.1/go.mod"
	"github.com/mattn/go-runewidth v0.0.12/go.mod"
	"github.com/mattn/go-runewidth v0.0.16"
	"github.com/mattn/go-runewidth v0.0.16/go.mod"
	"github.com/microcosm-cc/bluemonday v1.0.27"
	"github.com/microcosm-cc/bluemonday v1.0.27/go.mod"
	"github.com/mitchellh/hashstructure/v2 v2.0.2"
	"github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod"
	"github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6"
	"github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod"
	"github.com/muesli/cancelreader v0.2.2"
	"github.com/muesli/cancelreader v0.2.2/go.mod"
	"github.com/muesli/reflow v0.3.0"
	"github.com/muesli/reflow v0.3.0/go.mod"
	"github.com/muesli/termenv v0.16.0"
	"github.com/muesli/termenv v0.16.0/go.mod"
	"github.com/ncruces/go-sqlite3 v0.30.4"
	"github.com/ncruces/go-sqlite3 v0.30.4/go.mod"
	"github.com/ncruces/julianday v1.0.0"
	"github.com/ncruces/julianday v1.0.0/go.mod"
	"github.com/olebedev/when v1.1.0"
	"github.com/olebedev/when v1.1.0/go.mod"
	"github.com/pelletier/go-toml/v2 v2.2.4"
	"github.com/pelletier/go-toml/v2 v2.2.4/go.mod"
	"github.com/pkg/errors v0.8.1"
	"github.com/pkg/errors v0.8.1/go.mod"
	"github.com/pmezard/go-difflib v1.0.0"
	"github.com/pmezard/go-difflib v1.0.0/go.mod"
	"github.com/rivo/uniseg v0.1.0/go.mod"
	"github.com/rivo/uniseg v0.2.0/go.mod"
	"github.com/rivo/uniseg v0.4.7"
	"github.com/rivo/uniseg v0.4.7/go.mod"
	"github.com/rogpeppe/go-internal v1.9.0"
	"github.com/rogpeppe/go-internal v1.9.0/go.mod"
	"github.com/russross/blackfriday/v2 v2.1.0/go.mod"
	"github.com/sagikazarmark/locafero v0.11.0"
	"github.com/sagikazarmark/locafero v0.11.0/go.mod"
	"github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8"
	"github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod"
	"github.com/spf13/afero v1.15.0"
	"github.com/spf13/afero v1.15.0/go.mod"
	"github.com/spf13/cast v1.10.0"
	"github.com/spf13/cast v1.10.0/go.mod"
	"github.com/spf13/cobra v1.10.2"
	"github.com/spf13/cobra v1.10.2/go.mod"
	"github.com/spf13/pflag v1.0.9/go.mod"
	"github.com/spf13/pflag v1.0.10"
	"github.com/spf13/pflag v1.0.10/go.mod"
	"github.com/spf13/viper v1.21.0"
	"github.com/spf13/viper v1.21.0/go.mod"
	"github.com/stretchr/testify v1.11.1"
	"github.com/stretchr/testify v1.11.1/go.mod"
	"github.com/subosito/gotenv v1.6.0"
	"github.com/subosito/gotenv v1.6.0/go.mod"
	"github.com/tetratelabs/wazero v1.11.0"
	"github.com/tetratelabs/wazero v1.11.0/go.mod"
	"github.com/tidwall/gjson v1.14.2/go.mod"
	"github.com/tidwall/gjson v1.18.0"
	"github.com/tidwall/gjson v1.18.0/go.mod"
	"github.com/tidwall/match v1.1.1"
	"github.com/tidwall/match v1.1.1/go.mod"
	"github.com/tidwall/pretty v1.2.0/go.mod"
	"github.com/tidwall/pretty v1.2.1"
	"github.com/tidwall/pretty v1.2.1/go.mod"
	"github.com/tidwall/sjson v1.2.5"
	"github.com/tidwall/sjson v1.2.5/go.mod"
	"github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e"
	"github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod"
	"github.com/yuin/goldmark v1.7.1/go.mod"
	"github.com/yuin/goldmark v1.7.8"
	"github.com/yuin/goldmark v1.7.8/go.mod"
	"github.com/yuin/goldmark-emoji v1.0.5"
	"github.com/yuin/goldmark-emoji v1.0.5/go.mod"
	"go.yaml.in/yaml/v3 v3.0.4"
	"go.yaml.in/yaml/v3 v3.0.4/go.mod"
	"golang.org/x/exp v0.0.0-20231006140011-7918f672742d"
	"golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod"
	"golang.org/x/mod v0.31.0"
	"golang.org/x/mod v0.31.0/go.mod"
	"golang.org/x/net v0.47.0"
	"golang.org/x/net v0.47.0/go.mod"
	"golang.org/x/sync v0.19.0"
	"golang.org/x/sync v0.19.0/go.mod"
	"golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod"
	"golang.org/x/sys v0.6.0/go.mod"
	"golang.org/x/sys v0.39.0"
	"golang.org/x/sys v0.39.0/go.mod"
	"golang.org/x/term v0.38.0"
	"golang.org/x/term v0.38.0/go.mod"
	"golang.org/x/text v0.32.0"
	"golang.org/x/text v0.32.0/go.mod"
	"golang.org/x/tools v0.39.0"
	"golang.org/x/tools v0.39.0/go.mod"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod"
	"gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15"
	"gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod"
	"gopkg.in/natefinch/lumberjack.v2 v2.2.1"
	"gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod"
	"gopkg.in/yaml.v3 v3.0.1"
	"gopkg.in/yaml.v3 v3.0.1/go.mod"
	"rsc.io/script v0.0.2"
	"rsc.io/script v0.0.2/go.mod"
)

go-module_set_globals

SRC_URI="https://github.com/steveyegge/beads/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${EGO_SUM_SRC_URI}"

src_compile() {
	ego build -o bd ./cmd/bd
}

src_install() {
	dobin bd

	dodoc README.md
}