summaryrefslogtreecommitdiff
path: root/dev-db/turso/turso-0.6.0.ebuild
blob: 14b1ee0d80806907306fb2a6fd47c8205ac0c1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 2024-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

RUST_MIN_VER="1.88.0"

declare -A GIT_CRATES=(
	[syntect]="https://github.com/trishume/syntect;64644ffe064457265cbcee12a0c1baf9485ba6ee;syntect-%commit%"
)

inherit cargo linux-info

DESCRIPTION="Turso Database is an in-process OLTP database engine library with a CLI"
HOMEPAGE="https://github.com/tursodatabase/turso"
SRC_URI="
	https://github.com/tursodatabase/${PN}/releases/download/v${PV}/source.tar.gz -> ${P}.tar.gz
	https://github.com/gentoo-crate-dist/${PN}/releases/download/v${PV}/${P}-crates.tar.xz
	${CARGO_CRATE_URIS}
"

S="${WORKDIR}/${PN}_cli-${PV}"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions Boost-1.0 CC0-1.0 CDDL
	GPL-2.0-with-bison-exception MIT MPL-2.0 Unicode-DFS-2016
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+uring"

DEPEND="
	>=dev-libs/libgit2-0.99:=
	dev-libs/oniguruma:=
"
RDEPEND="${DEPEND}"

pkg_setup() {
	CONFIG_CHECK="~IO_URING"
	WARNING_IO_URING="The USE flag 'uring' needs the option IO_URING to be enabled."

	use uring && linux-info_pkg_setup
	rust_pkg_setup
}

src_configure() {
	# high magic to allow system-libs
	export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
	export RUSTONIG_SYSTEM_LIBONIG=1
	export LIBGIT2_NO_VENDOR=1

	local myfeatures=(
		"mimalloc"
		$(usev uring io_uring)
	)
	cargo_src_configure --no-default-features
}

src_compile() {
	cargo_src_compile --package "${PN}_cli" --bin "tursodb"
}

src_install() {
	cargo_src_install --path cli

	local DOCS=(
		CHANGELOG.md
		CONTRIBUTING.md
		README.md
	)

	einstalldocs
}