summaryrefslogtreecommitdiff
blob: ab5eb71a3052abc1d0009f6e951cba5162b316ea (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
76
77
78
79
80
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MY_PV=$(ver_cut 1-2)

DESCRIPTION="NVIDIA Ray Tracing Engine"
HOMEPAGE="https://developer.nvidia.com/optix"
SRC_URI="!headers-only? ( NVIDIA-OptiX-SDK-${PV}-linux64-x86_64.sh )"
S="${WORKDIR}"

HEADER_INTERNAL_FILES="
optix_7_device_impl.h
optix_7_device_impl_exception.h
optix_7_device_impl_transformations.h
"

HEADER_FILES="
optix.h
optix_7_device.h
optix_7_host.h
optix_7_types.h
optix_denoiser_tiling.h
optix_device.h
optix_function_table.h
optix_function_table_definition.h
optix_host.h
optix_stack_size.h
optix_stubs.h
optix_types.h
"

for i in ${HEADER_INTERNAL_FILES}; do
	SRC_URI+=" headers-only? ( https://developer.download.nvidia.com/redist/optix/v${MY_PV}/internal/${i} -> ${P}-internal-${i} )"
done
for i in ${HEADER_FILES}; do
	SRC_URI+=" headers-only? ( https://developer.download.nvidia.com/redist/optix/v${MY_PV}/${i} -> ${P}-${i} )"
done
unset i

LICENSE="NVIDIA-SDK"
SLOT="0"
KEYWORDS="amd64 ~arm64"
RESTRICT="bindist mirror !headers-only? ( fetch )"
IUSE="+headers-only"

RDEPEND=">=x11-drivers/nvidia-drivers-510"

pkg_nofetch() {
	einfo "Please download ${A} from:"
	einfo "  ${HOMEPAGE}"
	einfo "and move it to your distfiles directory."
}

src_unpack() {
	local i
	if use headers-only; then
		mkdir -p "${S}/include/internal" || die
		for i in ${HEADER_INTERNAL_FILES}; do
			cp "${DISTDIR}/${P}-internal-${i}" "${S}/include/internal/${i}" || die
		done
		for i in ${HEADER_FILES}; do
			cp "${DISTDIR}/${P}-${i}" "${S}/include/${i}" || die
		done
	else
		tail -n +223 "${DISTDIR}"/${A} | tar -zx
		assert "unpacking ${A} failed"
	fi
}

src_install() {
	insinto /opt/${PN}
	doins -r include

	if use !headers-only; then
		DOCS=( doc/OptiX_{API_Reference,Programming_Guide}_${PV}.pdf )
		einstalldocs
	fi
}