aboutsummaryrefslogtreecommitdiff
blob: 6f8f1f580d12c7da4a60e52df2adf3c0108a053f (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
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.13.1

EAPI=8

LLVM_COMPAT=( {18..19} )

inherit cargo llvm-r1

DESCRIPTION="A C ABI library which exposes Signal protocol logic"
HOMEPAGE="https://github.com/signalapp/libsignal"
SRC_URI="
	https://github.com/signalapp/libsignal/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz
	https://herbizarre.swordarmor.fr/garbage/${P}-vendor.tar.xz
"
S="${WORKDIR}/libsignal-${PV}/rust/bridge/ffi"

LICENSE="AGPL-3"
# Dependent crate licenses
LICENSE+=" AGPL-3 Apache-2.0 BSD-2 BSD ISC MIT Unicode-DFS-2016"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="
	dev-libs/protobuf
	$(llvm_gen_dep 'sys-devel/clang:${LLVM_SLOT}')
"

src_unpack() {
	default
	cargo_gen_config
	ln -s "${WORKDIR}/vendor/" "${WORKDIR}/libsignal-${PV}/vendor" || die
	sed -i "${ECARGO_HOME}/config.toml" \
		-e '/source.crates-io/d' \
		-e '/replace-with = "gentoo"/d' \
		-e '/local-registry = "\/nonexistent"/d' \
		|| die
	cat vendor/vendor-config.toml >> "${ECARGO_HOME}/config.toml" || die
}

src_install() {
	dolib.a "${WORKDIR}/${P/-ffi/}/$(cargo_target_dir)/${PN/-/_}.a"
}