blob: f8042ebaf816bcde0af760a815f2de77fc202814 [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
EAPI=6
CROS_WORKON_COMMIT="1cd57dc10179783f443e1c148bc144184250968e"
CROS_WORKON_TREE="5e2d3eccd85d551dcd7d7bfa5dac28a8d680dc88"
CROS_WORKON_PROJECT="chromiumos/third_party/mesa"
CROS_WORKON_LOCALNAME="mesa-freedreno"
CROS_WORKON_EGIT_BRANCH="chromeos-freedreno"
inherit base meson multilib-minimal flag-o-matic toolchain-funcs cros-workon arc-build
DESCRIPTION="OpenGL-like graphic library for Linux"
HOMEPAGE="http://mesa3d.sourceforge.net/"
KEYWORDS="*"
# Most files are MIT/X11.
# Some files in src/glx are SGI-B-2.0.
LICENSE="MIT SGI-B-2.0"
SLOT="0"
IUSE="
cheets
cheets_user
cheets_user_64
debug
-vulkan
"
REQUIRED_USE="
cheets
"
DEPEND="
>=x11-libs/arc-libdrm-2.4.82[${MULTILIB_USEDEP}]
dev-libs/arc-libelf[${MULTILIB_USEDEP}]
"
RDEPEND="${DEPEND}"
pkg_pretend() {
if use vulkan; then
die "${PN} does not yet support vulkan"
fi
}
src_configure() {
arc-build-select-clang
multilib-minimal_src_configure
}
multilib_src_configure() {
tc-getPROG PKG_CONFIG pkg-config
emesonargs+=(
--prefix="${ARC_PREFIX}/vendor"
--sysconfdir="/system/vendor/etc"
-Ddri-search-path="/system/$(get_libdir)/dri:/system/vendor/$(get_libdir)/dri"
-Dllvm=disabled
-Ddri3=disabled
-Dshader-cache=enabled
-Dglx=disabled
-Degl=enabled
-Dgbm=disabled
-Dgles1=enabled
-Dgles2=enabled
-Dshared-glapi=enabled
-Ddri-drivers=
-Dgallium-drivers=freedreno
-Dgallium-vdpau=disabled
-Dgallium-xa=disabled
-Dplatforms=android
-Dplatform-sdk-version="${ARC_PLATFORM_SDK_VERSION}"
-Degl-lib-suffix=_mesa
-Dgles-lib-suffix=_mesa
--buildtype $(usex debug debug release)
-Dvulkan-drivers=$(usex vulkan freedreno '')
)
meson_src_configure
}
# The meson eclass exports src_compile but not multilib_src_compile. src_compile
# gets overridden by multilib-minimal
multilib_src_compile() {
meson_src_compile
}
multilib_src_install() {
exeinto "${ARC_PREFIX}/vendor/$(get_libdir)"
newexe "${BUILD_DIR}/src/mapi/shared-glapi/libglapi.so.0" libglapi.so.0
exeinto "${ARC_PREFIX}/vendor/$(get_libdir)/egl"
newexe "${BUILD_DIR}/src/egl/libEGL_mesa.so" libEGL_mesa.so
newexe "${BUILD_DIR}/src/mapi/es1api/libGLESv1_CM_mesa.so" libGLESv1_CM_mesa.so
newexe "${BUILD_DIR}/src/mapi/es2api/libGLESv2_mesa.so" libGLESv2_mesa.so
exeinto "${ARC_PREFIX}/vendor/$(get_libdir)/dri"
newexe "${BUILD_DIR}/src/gallium/targets/dri/libgallium_dri.so" msm_dri.so
}
multilib_src_install_all() {
# For documentation on the feature set represented by each XML file
# installed into /vendor/etc/permissions, see
# <https://developer.android.com/reference/android/content/pm/PackageManager.html>.
# For example XML files for each feature, see
# <https://android.googlesource.com/platform/frameworks/native/+/master/data/etc>.
# Install init files to advertise supported API versions.
insinto "${ARC_PREFIX}/vendor/etc/init"
doins "${FILESDIR}/gles31.rc"
# Install the dri header for arc-cros-gralloc
insinto "${ARC_PREFIX}/vendor/include/GL"
doins -r "${S}/include/GL/internal"
}