mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 20:13:01 -04:00
Pass a SONAME to the external linker when building the shared library to satisfy ELF shared library QA requirements. Closes: https://bugs.gentoo.org/975462 Signed-off-by: David Reed <david-gentoo@reedfam.email>
68 lines
1.3 KiB
Bash
68 lines
1.3 KiB
Bash
# 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://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://github.com/david-gentoo/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.20:=
|
|
app-arch/unzip
|
|
virtual/pkgconfig
|
|
"
|
|
|
|
src_prepare() {
|
|
default
|
|
|
|
# remove upstream's pre-stripped flags
|
|
sed -i \
|
|
-e 's/[[:space:]]*-ldflags="-s -w"//' \
|
|
scripts/build-lib || die
|
|
|
|
# Add SONAME to the shared object.
|
|
sed -i \
|
|
-e 's/go build /go build -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
|
|
}
|