dev-libs/ocl-icd-2.2.12: Install headers and drop ocl-icd.icd

Add useflag to install khronos CL headers.
Don't install ocl-icd.icd to /etc/.

v2: Don't try to move docs. It's not necessary.
v3: Fixup ruby depend

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10122
Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
Jan Vesely
2018-10-10 02:33:25 -04:00
committed by Matt Turner
parent 4ef67b507a
commit 9599894aef
2 changed files with 24 additions and 12 deletions

View File

@@ -5,4 +5,9 @@
<email>patrick@gentoo.org</email>
<name>Patrick Lauer</name>
</maintainer>
<use>
<flag name="khronos-headers" restrict="&gt;dev-libs/ocl-icd-2.2.11-r1">
Install Khronos OpenCL headers.
</flag>
</use>
</pkgmetadata>

View File

@@ -3,7 +3,8 @@
EAPI=7
inherit autotools flag-o-matic multilib-minimal
USE_RUBY="ruby23 ruby24 ruby25"
inherit autotools flag-o-matic multilib-minimal ruby-single
DESCRIPTION="Alternative to vendor specific OpenCL ICD loaders"
HOMEPAGE="https://github.com/OCL-dev/ocl-icd"
@@ -12,10 +13,9 @@ LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
IUSE="+khronos-headers"
DEPEND="dev-lang/ruby
dev-ruby/rubygems"
DEPEND="${RUBY_DEPS}"
RDEPEND="app-eselect/eselect-opencl"
src_prepare() {
@@ -30,16 +30,23 @@ multilib_src_configure() {
}
multilib_src_install() {
default
# Drop .la files
find "${D}" -name '*.la' -delete || die
echo "/usr/$(get_libdir)/OpenCL/vendors/ocl-icd/libOpenCL.so" > "${PN}-${ABI}.icd"
insinto /etc/OpenCL/vendors/
doins "${PN}-${ABI}.icd"
OCL_DIR="/usr/$(get_libdir)/OpenCL/vendors/ocl-icd"
dodir ${OCL_DIR}/{,include}
emake DESTDIR="${D}" install
# Install vendor library
mv -f "${D}/usr/$(get_libdir)"/libOpenCL* "${ED}${OCL_DIR}" || die "Can't install vendor library"
OCL_DIR="${D}"/usr/"$(get_libdir)"/OpenCL/vendors/ocl-icd/
mkdir -p ${OCL_DIR} || die "mkdir failed"
mv "${D}/usr/$(get_libdir)"/libOpenCL* "${OCL_DIR}"
# Install vendor headers
if use khronos-headers; then
cp -r "${S}/khronos-headers/CL" "${ED}${OCL_DIR}/include" || die "Can't install vendor headers"
fi
}
pkg_postinst() {
eselect opencl set --use-old ${PN}
}