Skip to content

Commit

Permalink
sys-libs/libnvidia-container: add 1.16.1
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Strizhkin <[email protected]>
  • Loading branch information
denisstrizhkin committed Sep 7, 2024
1 parent 5c7752e commit dff0bcd
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
1 change: 1 addition & 0 deletions sys-libs/libnvidia-container/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST libnvidia-container-1.14.6.tar.gz 1549174 BLAKE2B d3c526d7b04ac9cbc6b6bb63f25d4c5b17571169a6cb1a6ab9f7c1cc322a27e3a853373551682b535146914fd2eca809d02391acb458a874a7e9e5c0fc8bf459 SHA512 598f4b2752615bfe44782a60cd2afee769fde496c6bdff613f58c4a3f0b02f8b398b293659cb78a84ff5fbff50892f3cb4b9cd3c6a60d17897fa5e063905a0c5
DIST libnvidia-container-1.16.1.tar.gz 1610619 BLAKE2B dc490c1bcd891119841bb5c1aa0c1977f0f326118f7bc86adbab6a0053f52950e4ced5a4b025d6b557c1526e3125aa69ac47c10c621993becc5c40b13d6990c5 SHA512 b304c284c5ab0c3544362307dc16ffcca8d34497e4356a520dc6da81a86a62b2a262b528cba559bb0d7a3addf018c3b50b6cb78669c82c1b4acae159e5922548
DIST libnvidia-container-nvidia-modprobe-550.54.14.tar.gz 47147 BLAKE2B 7b334877d98d0c75d5750192dea868436938852443ced14e74e59076ed4d8be9e361cdefbe48295d87bb91ac4565152ec3f3233479b3da19bb8baf8e7ef53cd6 SHA512 279228aa315ff5fd1a23df23527aff58b2319f11f9fc7d939fa285ea933b4cc6d223451e20ecf7f50baba9f6c9c100e57cb77675d0d17fa77f19d3fea2ccc193
105 changes: 105 additions & 0 deletions sys-libs/libnvidia-container/libnvidia-container-1.16.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# check the VERSION in libnvidia-container/mk/nvidia-modprobe.mk
NVMODV="550.54.14"

DESCRIPTION="NVIDIA container runtime library"
HOMEPAGE="https://github.com/NVIDIA/libnvidia-container"

if [[ "${PV}" == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/NVIDIA/${PN}.git"
else
SRC_URI="
https://github.com/NVIDIA/${PN}/archive/v${PV/_rc/-rc.}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${PN}-${PV/_rc/-rc.}"
KEYWORDS="~amd64"
fi
NVMODS="${WORKDIR}/nvidia-modprobe-${NVMODV}"
SRC_URI+="
https://github.com/NVIDIA/nvidia-modprobe/archive/${NVMODV}.tar.gz -> ${PN}-nvidia-modprobe-${NVMODV}.tar.gz
"

LICENSE="Apache-2.0"
SLOT="0/${PV}"
IUSE="doc static-libs"

RDEPEND="
net-libs/libtirpc:=
sys-libs/libcap
sys-libs/libseccomp
virtual/libelf:=
x11-drivers/nvidia-drivers
"

DEPEND="${RDEPEND}"

BDEPEND="
dev-build/bmake
dev-lang/go
net-libs/rpcsvc-proto
sys-apps/lsb-release
virtual/pkgconfig
"

PATCHES=(
"${FILESDIR}"/${PN}-1.14.6-fix-makefile.patch
)

DOCS=( COPYING COPYING.LESSER LICENSE NOTICE README.md)

src_unpack() {
default_src_unpack
if [[ "${PV}" == "9999" ]] ; then
git-r3_src_unpack
fi
}

src_prepare() {
# nvidia-modprobe patching based on libnvidia-container/mk/nvidia-modprobe.mk
mkdir -p "${S}"/deps/src/nvidia-modprobe-"${NVMODV}" || die
cp -r "${NVMODS}"/modprobe-utils/ "${S}"/deps/src/nvidia-modprobe-"${NVMODV}"/ || die
touch "${S}/deps/src/nvidia-modprobe-${NVMODV}/.download_stamp" || die
pushd "${S}/deps/src/nvidia-modprobe-${NVMODV}" || die
eapply -p1 "${S}"/mk/nvidia-modprobe.patch
popd || die

default
}

src_compile() {
export GOPATH="${S}"
export GOFLAGS="-mod=vendor"
IFS='_' read -r MY_LIB_VERSION MY_LIB_TAG <<< "${PV}"
emake \
CGO_CFLAGS="${CFLAGS}" \
CGO_LDFLAGS="${LDFLAGS}" \
GO_LDFLAGS="-compressdwarf=false -linkmode=external" \
REVISION="${PV}" \
LIB_VERSION="${MY_LIB_VERSION}" \
LIB_TAG="${MY_LIB_TAG}"
}

src_install() {
emake \
CGO_CFLAGS="${CFLAGS}" \
CGO_LDFLAGS="${LDFLAGS}" \
GO_LDFLAGS="-compressdwarf=false -linkmode=external" \
REVISION="${PV}" \
LIB_VERSION="${MY_LIB_VERSION}" \
LIB_TAG="${MY_LIB_TAG}" \
DESTDIR="${D}" \
install
# Install docs
if use doc ; then
einstalldocs # Bug 831705
fi
# Cleanup static libraries
if ! use static-libs ; then
find "${ED}" -name '*.a' -delete || die # Bug 783984
fi
}

0 comments on commit dff0bcd

Please sign in to comment.