Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/amdgpu-pro-opencl/
Date: Sun, 06 Aug 2017 16:38:18
Message-Id: 1502037488.8ded910c42a3382278b213c2af0911bd0941e91a.marecki@gentoo
1 commit: 8ded910c42a3382278b213c2af0911bd0941e91a
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 6 16:36:21 2017 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 6 16:38:08 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ded910c
7
8 dev-libs/amdgpu-pro-opencl: add missing file to 17.30.458935
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.1
11
12 .../amdgpu-pro-opencl-17.30.458935-r1.ebuild | 81 ++++++++++++++++++++++
13 1 file changed, 81 insertions(+)
14
15 diff --git a/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-17.30.458935-r1.ebuild b/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-17.30.458935-r1.ebuild
16 new file mode 100644
17 index 00000000000..971d4999df4
18 --- /dev/null
19 +++ b/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-17.30.458935-r1.ebuild
20 @@ -0,0 +1,81 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
25 +
26 +inherit unpacker versionator
27 +
28 +SUPER_PN='amdgpu-pro'
29 +MY_PV=$(replace_version_separator 2 '-')
30 +
31 +DESCRIPTION="Proprietary OpenCL implementation for AMD GPUs"
32 +HOMEPAGE="https://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx"
33 +SRC_URI="${SUPER_PN}-${MY_PV}.tar.xz"
34 +
35 +LICENSE="AMD-GPU-PRO-EULA"
36 +SLOT="0"
37 +KEYWORDS="~amd64"
38 +
39 +RESTRICT="mirror fetch strip"
40 +
41 +DEPEND="dev-util/patchelf"
42 +RDEPEND="dev-libs/ocl-icd"
43 +
44 +QA_PREBUILT="/opt/${SUPER_PN}/lib*/*"
45 +
46 +S="${WORKDIR}/${SUPER_PN}-${MY_PV}"
47 +
48 +pkg_nofetch() {
49 + local pkgver=$(get_version_component_range 1-2)
50 + einfo "Please download the AMDGPU-Pro Driver ${pkgver} for Ubuntu from"
51 + einfo " ${HOMEPAGE}"
52 + einfo "The archive should then be placed into ${DISTDIR}."
53 +}
54 +
55 +src_unpack() {
56 + default
57 +
58 + local ids_ver="1.0.0"
59 + local libdrm_ver="2.4.70"
60 + local patchlevel=$(get_version_component_range 3)
61 + cd "${S}" || die
62 + unpack_deb opencl-${SUPER_PN}-icd_${MY_PV}_amd64.deb
63 + unpack_deb libdrm-${SUPER_PN}-amdgpu1_${libdrm_ver}-${patchlevel}_amd64.deb
64 + unpack_deb ids-${SUPER_PN}_${ids_ver}-${patchlevel}_all.deb
65 +}
66 +
67 +src_prepare() {
68 + default
69 +
70 + cd "${S}/opt/${SUPER_PN}/lib/x86_64-linux-gnu" || die
71 + patchelf --set-rpath '$ORIGIN' libamdocl64.so || die "Failed to fix library rpath"
72 +}
73 +
74 +src_install() {
75 +
76 + into "/opt/${SUPER_PN}"
77 + dolib opt/${SUPER_PN}/lib/x86_64-linux-gnu/*
78 + insinto "/opt/${SUPER_PN}"
79 + doins -r opt/${SUPER_PN}/share
80 +
81 + insinto /etc/OpenCL/vendors/
82 + echo "/opt/${SUPER_PN}/$(get_libdir)/libamdocl64.so" > "${SUPER_PN}.icd" || die "Failed to generate ICD file"
83 + doins "${SUPER_PN}.icd"
84 +}
85 +
86 +pkg_postinst() {
87 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
88 + ewarn "Please note that using proprietary OpenCL libraries together with the"
89 + ewarn "Open Source amdgpu stack is not officially supported by AMD. Do not ask them"
90 + ewarn "for support in case of problems with this package."
91 + ewarn ""
92 + ewarn "Furthermore, if you have the whole AMDGPU-Pro stack installed this package"
93 + ewarn "will almost certainly conflict with it. This might change once AMDGPU-Pro"
94 + ewarn "has become officially supported by Gentoo."
95 + fi
96 +
97 + elog "AMD OpenCL driver relies on dev-libs/ocl-icd to work. To enable it, please run"
98 + elog ""
99 + elog " eselect opencl set ocl-icd"
100 + elog ""
101 +}