summaryrefslogtreecommitdiff
path: root/net-libs/libuplink/libuplink-1.14.1-r1.ebuild
blob: e1b399f0161a475101b85da78dfd2cf2c05dc36f (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
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="C library for the Storj V3 network (libuplink)"
HOMEPAGE="https://www.storj.io/ https://github.com/storj/uplink-c"
MY_PN="uplink-c"

SRC_URI="
https://github.com/storj/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
https://codeberg.org/davidreed/uplink-c/releases/download/v${PV}/${MY_PN}-${PV}-vendor.tar.xz
"

S="${WORKDIR}/${MY_PN}-${PV}"

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

IUSE="static-libs"

RESTRICT="test"

BDEPEND="
	>=dev-lang/go-1.25.0:=
	app-arch/unzip
	virtual/pkgconfig
"

src_prepare() {
	default

	# remove upstream's pre-stripped flags and add SONAME
	sed -i \
		-e 's/LDFLAGS="-s -w"/LDFLAGS="-extldflags=-Wl,-soname,libuplink.so"/' \
		scripts/build-lib || die
}

src_compile() {
	emake build
}

src_install() {
	# Shared libs
	dolib.so .build/libuplink.so

	# Optional static libs
	if use static-libs ; then
	dolib.a  .build/libuplink.a
	fi

	# Headers (upstream copies them into .build/uplink)
	insinto /usr/include/uplink
	doins .build/uplink/*.h

	# pkg-config file
	insinto /usr/$(get_libdir)/pkgconfig
	doins .build/libuplink.pc
}