Skip to content

Commit

Permalink
dev-libs/beignet: run "eselect opencl" in pkg_postinst()
Browse files Browse the repository at this point in the history
Select ocl-icd if the relevant USE flag was set, self otherwise. In both
cases use --use-old to honour possible earlier user-made choice.

Package-Manager: Portage-2.3.49, Repoman-2.3.10
  • Loading branch information
Marek Szuba committed Sep 27, 2018
1 parent e582331 commit 663eb4a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions dev-libs/beignet/beignet-1.3.2-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ else
S=${WORKDIR}/Beignet-${PV}-Source
fi

COMMON="media-libs/mesa[${MULTILIB_USEDEP}]
COMMON="app-eselect/eselect-opencl
media-libs/mesa[${MULTILIB_USEDEP}]
<sys-devel/clang-6.0.9999:=[${MULTILIB_USEDEP}]
>=x11-libs/libdrm-2.4.70[video_cards_intel,${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXfixes[${MULTILIB_USEDEP}]"
RDEPEND="${COMMON}
app-eselect/eselect-opencl"
x11-libs/libXfixes[${MULTILIB_USEDEP}]
ocl-icd? ( dev-libs/ocl-icd )"
RDEPEND="${COMMON}"
DEPEND="${COMMON}
${PYTHON_DEPS}
ocl-icd? ( dev-libs/ocl-icd )
virtual/pkgconfig"

LLVM_MAX_SLOT=6
Expand Down Expand Up @@ -105,3 +105,11 @@ multilib_src_install() {
dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so.1
dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so
}

pkg_postinst() {
if use ocl-icd; then
"${ROOT}"/usr/bin/eselect opencl set --use-old ocl-icd
else
"${ROOT}"/usr/bin/eselect opencl set --use-old beignet
fi
}

0 comments on commit 663eb4a

Please sign in to comment.