Files
Arch-R/packages/graphics/mesa/package.mk
2018-07-27 18:34:21 +01:00

110 lines
4.6 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="mesa"
PKG_VERSION="18.1.5"
PKG_SHA256="69dbe6f1a6660386f5beb85d4fcf003ee23023ed7b9a603de84e9a37e8d98dea"
PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_SITE="http://www.mesa3d.org/"
PKG_URL="ftp://freedesktop.org/pub/mesa/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain expat libdrm Mako:host"
PKG_SECTION="graphics"
PKG_SHORTDESC="mesa: 3-D graphics library with OpenGL API"
PKG_LONGDESC="Mesa is a 3-D graphics library with an API which is very similar to that of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax or state machine, it is being used with authorization from Silicon Graphics, Inc. However, the author makes no claim that Mesa is in any way a compatible replacement for OpenGL or associated with Silicon Graphics, Inc. Those who want a licensed implementation of OpenGL should contact a licensed vendor. While Mesa is not a licensed OpenGL implementation, it is currently being tested with the OpenGL conformance tests. For the current conformance status see the CONFORM file included in the Mesa distribution."
PKG_TOOLCHAIN="meson"
PKG_BUILD_FLAGS="+lto"
get_graphicdrivers
PKG_MESON_OPTS_TARGET="-Ddri-drivers=$DRI_DRIVERS \
-Dgallium-drivers=$GALLIUM_DRIVERS \
-Dgallium-extra-hud=false \
-Dgallium-xvmc=false \
-Dgallium-omx=disabled \
-Dgallium-nine=false \
-Dgallium-opencl=disabled \
-Dvulkan-drivers= \
-Dshader-cache=true \
-Dshared-glapi=true \
-Dopengl=true \
-Dgbm=true \
-Degl=true \
-Dglvnd=false \
-Dasm=true \
-Dvalgrind=false \
-Dlibunwind=false \
-Dlmsensors=false \
-Dbuild-tests=false \
-Dtexture-float=true \
-Dselinux=false \
-Dosmesa=none"
if [ "$DISPLAYSERVER" = "x11" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET xorgproto libXext libXdamage libXfixes libXxf86vm libxcb libX11 libxshmfence"
export X11_INCLUDES=
PKG_MESON_OPTS_TARGET+=" -Dplatforms=x11,drm -Ddri3=true -Dglx=dri"
elif [ "$DISPLAYSERVER" = "weston" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET wayland wayland-protocols"
PKG_MESON_OPTS_TARGET+=" -Dplatforms=wayland,drm -Ddri3=false -Dglx=disabled"
else
PKG_MESON_OPTS_TARGET+=" -Dplatforms=drm -Ddri3=false -Dglx=disabled"
fi
if [ "$LLVM_SUPPORT" = "yes" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET elfutils llvm"
export LLVM_CONFIG="$SYSROOT_PREFIX/usr/bin/llvm-config-host"
PKG_MESON_OPTS_TARGET+=" -Dllvm=true"
else
PKG_MESON_OPTS_TARGET+=" -Dllvm=false"
fi
if [ "$VDPAU_SUPPORT" = "yes" -a "$DISPLAYSERVER" = "x11" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libvdpau"
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=true"
else
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=false"
fi
if [ "$VAAPI_SUPPORT" = "yes" ] && listcontains "$GRAPHIC_DRIVERS" "(r600|radeonsi)"; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libva"
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=true"
else
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=false"
fi
if listcontains "$GRAPHIC_DRIVERS" "vmware"; then
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=true"
else
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=false"
fi
if [ "$OPENGLES_SUPPORT" = "yes" ]; then
PKG_MESON_OPTS_TARGET+=" -Dgles1=false -Dgles2=true"
else
PKG_MESON_OPTS_TARGET+=" -Dgles1=false -Dgles2=false"
fi
# Temporary workaround:
# Listed libraries are static, while mesa expects shared ones. This breaks the
# dependency tracking. The following has some ideas on how to address that.
# https://github.com/LibreELEC/LibreELEC.tv/pull/2163
pre_configure_target() {
if [ "$DISPLAYSERVER" = "x11" ]; then
export LIBS="-lxcb-dri3 -lxcb-dri2 -lxcb-xfixes -lxcb-present -lxcb-sync -lxshmfence -lz"
fi
}
post_makeinstall_target() {
# Similar hack is needed on EGL, GLES* front. Might as well drop it and test the GLVND?
if [ "$DISPLAYSERVER" = "x11" ]; then
# rename and relink for cooperate with nvidia drivers
rm -rf $INSTALL/usr/lib/libGL.so
rm -rf $INSTALL/usr/lib/libGL.so.1
ln -sf libGL.so.1 $INSTALL/usr/lib/libGL.so
ln -sf /var/lib/libGL.so $INSTALL/usr/lib/libGL.so.1
mv $INSTALL/usr/lib/libGL.so.1.2.0 $INSTALL/usr/lib/libGL_mesa.so.1
fi
}