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

EAPI=8

DESCRIPTION="A terminal based Matrix client written in Go"
HOMEPAGE="https://github.com/tulir/gomuks"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"

inherit go-module
EGO_SUM=(
	"github.com/alecthomas/chroma v0.10.0"
	"github.com/alecthomas/chroma v0.10.0/go.mod"
	"github.com/davecgh/go-spew v1.1.0/go.mod"
	"github.com/davecgh/go-spew v1.1.1"
	"github.com/davecgh/go-spew v1.1.1/go.mod"
	"github.com/disintegration/imaging v1.6.2"
	"github.com/disintegration/imaging v1.6.2/go.mod"
	"github.com/dlclark/regexp2 v1.4.0"
	"github.com/dlclark/regexp2 v1.4.0/go.mod"
	"github.com/gabriel-vasile/mimetype v1.4.1"
	"github.com/gabriel-vasile/mimetype v1.4.1/go.mod"
	"github.com/gdamore/encoding v1.0.0"
	"github.com/gdamore/encoding v1.0.0/go.mod"
	"github.com/gorilla/mux v1.8.0"
	"github.com/gorilla/mux v1.8.0/go.mod"
	"github.com/gorilla/websocket v1.5.0"
	"github.com/gorilla/websocket v1.5.0/go.mod"
	"github.com/kr/pretty v0.1.0"
	"github.com/kr/pretty v0.1.0/go.mod"
	"github.com/kr/pty v1.1.1/go.mod"
	"github.com/kr/text v0.1.0"
	"github.com/kr/text v0.1.0/go.mod"
	"github.com/kyokomi/emoji/v2 v2.2.10"
	"github.com/kyokomi/emoji/v2 v2.2.10/go.mod"
	"github.com/lithammer/fuzzysearch v1.1.5"
	"github.com/lithammer/fuzzysearch v1.1.5/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-sqlite3 v1.14.16"
	"github.com/mattn/go-sqlite3 v1.14.16/go.mod"
	"github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d"
	"github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod"
	"github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5"
	"github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod"
	"github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/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.2.0/go.mod"
	"github.com/rivo/uniseg v0.4.2"
	"github.com/rivo/uniseg v0.4.2/go.mod"
	"github.com/rogpeppe/go-internal v1.8.1/go.mod"
	"github.com/sasha-s/go-deadlock v0.3.1"
	"github.com/sasha-s/go-deadlock v0.3.1/go.mod"
	"github.com/stretchr/objx v0.1.0/go.mod"
	"github.com/stretchr/testify v1.7.0/go.mod"
	"github.com/stretchr/testify v1.7.1"
	"github.com/tidwall/gjson v1.12.1/go.mod"
	"github.com/tidwall/gjson v1.14.1"
	"github.com/tidwall/gjson v1.14.1/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"
	"github.com/tidwall/pretty v1.2.0/go.mod"
	"github.com/tidwall/sjson v1.2.4"
	"github.com/tidwall/sjson v1.2.4/go.mod"
	"github.com/tulir/go-runewidth v0.0.14-0.20221113132156-dc2fc6d28246"
	"github.com/tulir/go-runewidth v0.0.14-0.20221113132156-dc2fc6d28246/go.mod"
	"github.com/yuin/goldmark v1.4.13/go.mod"
	"github.com/yuin/goldmark v1.5.3"
	"github.com/yuin/goldmark v1.5.3/go.mod"
	"github.com/zyedidia/clipboard v1.0.4"
	"github.com/zyedidia/clipboard v1.0.4/go.mod"
	"go.etcd.io/bbolt v1.3.6"
	"go.etcd.io/bbolt v1.3.6/go.mod"
	"go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e"
	"go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e/go.mod"
	"go.mau.fi/mauview v0.2.1"
	"go.mau.fi/mauview v0.2.1/go.mod"
	"go.mau.fi/tcell v0.4.0"
	"go.mau.fi/tcell v0.4.0/go.mod"
	"golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod"
	"golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod"
	"golang.org/x/crypto v0.0.0-20220513210258-46612604a0f9"
	"golang.org/x/crypto v0.0.0-20220513210258-46612604a0f9/go.mod"
	"golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod"
	"golang.org/x/image v0.1.0"
	"golang.org/x/image v0.1.0/go.mod"
	"golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod"
	"golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod"
	"golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod"
	"golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod"
	"golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod"
	"golang.org/x/net v0.2.0"
	"golang.org/x/net v0.2.0/go.mod"
	"golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod"
	"golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod"
	"golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod"
	"golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod"
	"golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod"
	"golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod"
	"golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod"
	"golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod"
	"golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod"
	"golang.org/x/sys v0.2.0"
	"golang.org/x/sys v0.2.0/go.mod"
	"golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod"
	"golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod"
	"golang.org/x/term v0.2.0"
	"golang.org/x/term v0.2.0/go.mod"
	"golang.org/x/text v0.3.0/go.mod"
	"golang.org/x/text v0.3.3/go.mod"
	"golang.org/x/text v0.3.7/go.mod"
	"golang.org/x/text v0.4.0"
	"golang.org/x/text v0.4.0/go.mod"
	"golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod"
	"golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod"
	"golang.org/x/tools v0.1.12/go.mod"
	"golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod"
	"gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127"
	"gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod"
	"gopkg.in/errgo.v2 v2.1.0/go.mod"
	"gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2"
	"gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2/go.mod"
	"gopkg.in/vansante/go-ffprobe.v2 v2.1.1"
	"gopkg.in/vansante/go-ffprobe.v2 v2.1.1/go.mod"
	"gopkg.in/yaml.v2 v2.4.0"
	"gopkg.in/yaml.v2 v2.4.0/go.mod"
	"gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod"
	"gopkg.in/yaml.v3 v3.0.1"
	"gopkg.in/yaml.v3 v3.0.1/go.mod"
	"maunium.net/go/mauflag v1.0.0"
	"maunium.net/go/mauflag v1.0.0/go.mod"
	"maunium.net/go/maulogger/v2 v2.3.2"
	"maunium.net/go/maulogger/v2 v2.3.2/go.mod"
	"maunium.net/go/mautrix v0.11.1"
	"maunium.net/go/mautrix v0.11.1/go.mod"
	"mvdan.cc/xurls/v2 v2.4.0"
	"mvdan.cc/xurls/v2 v2.4.0/go.mod"
)
go-module_set_globals

EGIT_COMMIT="09a927955810f6f0c6d3f4809d9b01eda365fd39"
SRC_URI="https://github.com/tulir/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${PN}-${PV}.tar.gz ${EGO_SUM_SRC_URI}"
S=${WORKDIR}/${PN}-${EGIT_COMMIT}

IUSE="+encryption"
DEPEND="encryption? ( >=dev-libs/olm-3 )"
RDEPEND="${DEPEND}"

src_compile() {
	use encryption || CGO_ENABLED=0
	go build
}

src_install() {
	dobin ${PN}
}
