diff options
Diffstat (limited to 'pcr/mesa-vanilla/PKGBUILD')
-rw-r--r-- | pcr/mesa-vanilla/PKGBUILD | 262 |
1 files changed, 109 insertions, 153 deletions
diff --git a/pcr/mesa-vanilla/PKGBUILD b/pcr/mesa-vanilla/PKGBUILD index 28714d962..c928211a7 100644 --- a/pcr/mesa-vanilla/PKGBUILD +++ b/pcr/mesa-vanilla/PKGBUILD @@ -1,57 +1,17 @@ -# Maintainer (Arch): Jan de Groot <jgc@archlinux.org> -# Maintainer (Arch): Andreas Radke <andyrtr@archlinux.org> # Maintainer: Márcio Silva <coadde@parabola.nu> -# Contributor: Luke Shumaker <lukeshu@parabola.nu> - -# Some short notes on package names -# -# The general notion of graphics APIs is that there is one loader -# package that programs depend on; the loader package depends on a -# psuedo-package that is provided by any number of driver packages. -# -# One software $VENDOR may support multiple hardware $FAMILYs. The -# driver package name is just convention. -# -# Loader-package : Pseudo-package : Driver-package : Provided files -# ------------------:----------------:----------------------:-------------------------------------------------- -# ocl-icd : opencl-driver : opencl-$VENDOR : /etc/OpenCL/vendors/$VENDOR.icd -# vulkan-icd-loader : vulkan-driver : vulkan-$FAMILY : /usr/share/vulkan/icd.d/${FAMILY}_icd.$CARCH.json -# libglvnd : opengl-driver : (mesa) : /usr/lib/libGLX_${VENDOR}.so libEGL_${VENDOR}.so -# libva : : libva-$VENDOR-driver : /usr/lib/dri/${FAMILY}_drv_video.so -# libvdpau : : (mesa-vdpau) : /usr/lib/vdpau/libvdpau_${FAMILY}.so -# xorg-server : : (mesa) : /usr/lib/xorg/modules/dri/${FAMILY}_dri.so -# -# libca, libvdpau, and Xorg DRI don't have a pseudo-package name -# because the loader package ships with a default implementation; -# whereas ocl-icd, vulkan-icd-loader, and libglvnd are useless without -# an external backend. -# -# Historically, it was the convention that the Xorg DRI provider was -# named "$FAMILY-dri", or "$VENDOR-dri", but this has fallen out of -# style. However, for historical compatibility, providing packages -# might provide "$VENDOR-dri" packages for packages that used to -# exist. -# -# Because this package is refusing to apply libglvnd support patches -# to mesa, "libglvnd" is replaced by "mesa-libgl", which is very -# similar, but is unable to load any opengl-driver other than mesa. - -# XXX: We --enable-lmsensors, while Arch/ALARM mesa does not. Is -# there a reason for this? - -pkgbase=mesa-vanilla -pkgname=("opencl-${pkgbase}" "vulkan-radeon${pkgbase#mesa}" "libva-${pkgbase}-driver" "${pkgbase}-vdpau" "${pkgbase}") -pkgname+=("${pkgbase}-libgl") -case "$CARCH" in - x86_64|i686) pkgname+=("vulkan-intel${pkgbase#mesa}");; -esac + +# Based on mesa package from Arch and Arch ARM + +pkgbase=mesa +pkgname=('opencl-mesa-vanilla' 'libva-mesa-driver-vanilla' 'mesa-vdpau-vanilla' 'mesa-vanilla' + 'mesa-libgl-vanilla' 'vulkan-radeon-vanilla') +[[ "${CARCH}" = 'x86_64' || "${CARCH}" = 'i686' ]] && pkgname+=('vulkan-intel-vanilla') pkgver=17.0.2 -pkgrel=3.parabola2 +pkgrel=2 arch=('i686' 'x86_64' 'armv7h') makedepends=('python2-mako' 'libxml2' 'libx11' 'glproto' 'libdrm' 'dri2proto' 'dri3proto' 'presentproto' 'libxshmfence' 'libxxf86vm' 'libxdamage' 'libvdpau' 'libva' 'wayland' 'elfutils' 'llvm' - 'libomxil-bellagio' 'libclc' 'clang') -makedepends+=('lm_sensors') + 'libomxil-bellagio' 'libclc' 'clang' 'lm_sensors') # Implement 'lm_sensors' extra functionality, for i2c on video drivers url="http://mesa3d.sourceforge.net" license=('custom') source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig} @@ -75,7 +35,7 @@ prepare() { # Now mesa checks for libpthread-stubs - so remove the check patch -Np1 -i ../remove-libpthread-stubs.patch - # I'm not sure if these are nescessary for non-libglvnd builds + # non-upstreamed ones patch -Np1 -i ../0001-Fix-linkage-against-shared-glapi.patch patch -Np1 -i ../0001-glapi-Link-with-glapi-when-built-shared.patch @@ -83,33 +43,37 @@ prepare() { } build() { + # copy source to build mesa-libcl-icd package + cp -a ${srcdir}/{mesa,opencl}-${pkgver} + cd ${srcdir}/mesa-${pkgver} - case "$CARCH" in - x86_64|i686) - # XXX: We enable the 'swr' Gallium driver, while Arch does not. - # Why? - GALLIUM=r300,r600,radeonsi,nouveau,svga,swrast,virgl,swr - DRI=i915,i965,r200,radeon,nouveau,swrast - VULKAN=intel,radeon - ;; - armv7h) - # XXX: We enable the 'svga', 'r300', 'r600', and 'radionsi' - # Gallium drivers, while ALARM does not. Why? - GALLIUM=freedreno,nouveau,swrast,virgl,vc4,etnaviv,imx,svga,r300,r600,radeonsi - # XXX: We enable the 'r200' and 'radeon' DRI drivers, while - # ALARM does not. Why? - DRI=r200,radeon,nouveau,swrast - # XXX: We enable the 'radeon' Vulkan driver, while ALARM does - # not. Why? - VULKAN=radeon - ;; - esac - - # XXX: We ---enable-gallium-extra-hud, while Arch/ALARM mesa does - # not. Why? - # - # NB: ALARM builds mesa without xa, vdpau, or opencl. + # softpipe,llvmpipe + if [[ "${CARCH}" = 'x86_64' || "${CARCH}" = 'i686' ]]; then + DRI=i915,i965,r200,radeon,nouveau,swrast + # Implement 'swr' (OpenSWR) software driver (only support x86 hardware with AVX extension, see: http://openswr.org/) + GALLIUM=r300,r600,radeonsi,nouveau,svga,swrast,virgl,swr + VULKAN=intel,radeon + elif [[ "${CARCH}" = 'armv7h' ]]; then + DRI=r200,radeon,nouveau,swrast + # Implement PCI and PCI-e drivers, due some ARM hardware does suport PCI and PCIe drivers, see: + https://lwn.net/Articles/586802/ + https://www.linaro.org/blog/core-dump/kvm-pciemsi-passthrough-armarm64/ + # nVidia, are avaliable on Tegra hardware and AMD will support K12 hardware, see: + https://en.wikipedia.org/wiki/Tegra + https://en.wikipedia.org/wiki/AMD_K12 + GALLIUM=freedreno,etnaviv,vc4,imx,r300,r600,radeonsi,nouveau,svga,swrast,virgl + VULKAN=radeon + fi + + # Implement 'gallium-extra-hud' extra functionality + # Implement opencl/vaapi/vdpau/xa on ARM archictecture, does support it and easy to maintain the PKGBUILD + ARM archictecture support PCI and PCIe drivers, see: + https://lwn.net/Articles/586802/ + https://www.linaro.org/blog/core-dump/kvm-pciemsi-passthrough-armarm64/ + Some ARM video drivers like freedreno/nouveau does support OpenCL, see: + Mali (Lima) : https://en.wikipedia.org/wiki/Mali_(GPU)#Variants + Adreno (Freedreno, is not avaliable on mesa) : https://en.wikipedia.org/wiki/Adreno#Variants ./configure --prefix=/usr \ --sysconfdir=/etc \ --with-dri-driverdir=/usr/lib/xorg/modules/dri \ @@ -140,7 +104,6 @@ build() { --enable-gallium-extra-hud \ --enable-lmsensors \ --with-clang-libdir=/usr/lib - #--with-sha1=libgcrypt \ make @@ -151,114 +114,111 @@ build() { package_opencl-mesa-vanilla() { pkgdesc="OpenCL support for AMD/ATI Radeon mesa drivers" - depends=('expat' 'libdrm' 'libelf' 'libclc' 'clang') - depends+=('lm_sensors') + depends=('mesa-vanilla' 'opencl-icd-loader' 'expat' 'libdrm' 'libelf' 'libclc' 'clang' 'lm_sensors') optdepends=('opencl-headers: headers necessary for OpenCL development') provides=('opencl-driver') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + conflicts=('opencl-mesa' 'opencl-nvidia' 'opencl-nvidia-340xx' 'opencl-nvidia-304xx' 'opencl-catalyst') + replaces=('opencl-nvidia' 'opencl-nvidia-340xx' 'opencl-nvidia-304xx' 'opencl-catalyst') install -m755 -d ${pkgdir}/etc cp -rv ${srcdir}/fakeinstall/etc/OpenCL ${pkgdir}/etc/ - + install -m755 -d ${pkgdir}/usr/lib/gallium-pipe - cp -rv ${srcdir}/fakeinstall/usr/lib/lib*OpenCL* ${pkgdir}/usr/lib/ + cp -rv ${srcdir}/fakeinstall/usr/lib/libMesaOpenCL* ${pkgdir}/usr/lib/ cp -rv ${srcdir}/fakeinstall/usr/lib/gallium-pipe/pipe_{r600,radeonsi}.so ${pkgdir}/usr/lib/gallium-pipe/ - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + install -m755 -d "${pkgdir}/usr/share/licenses/opencl-mesa" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/opencl-mesa/" } package_vulkan-intel-vanilla() { pkgdesc="Intel's Vulkan mesa driver" - depends=('wayland' 'libx11' 'libxshmfence') + depends=('mesa-vanilla' 'wayland' 'libx11' 'libxshmfence') provides=('vulkan-driver') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + conflicts=('vulkan-intel') install -m755 -d ${pkgdir}/usr/share/vulkan/icd.d - mv -v ${srcdir}/fakeinstall/usr/share/vulkan/icd.d/intel_icd*.json ${pkgdir}/usr/share/vulkan/icd.d/ + cp -rv ${srcdir}/fakeinstall/usr/share/vulkan/icd.d/intel_icd*.json ${pkgdir}/usr/share/vulkan/icd.d/ install -m755 -d ${pkgdir}/usr/{include/vulkan,lib} - mv -v ${srcdir}/fakeinstall/usr/lib/libvulkan_intel.so ${pkgdir}/usr/lib/ - mv -v ${srcdir}/fakeinstall/usr/include/vulkan/vulkan_intel.h ${pkgdir}/usr/include/vulkan + cp -rv ${srcdir}/fakeinstall/usr/lib/libvulkan_intel.so ${pkgdir}/usr/lib/ + cp -rv ${srcdir}/fakeinstall/usr/include/vulkan/vulkan_intel.h ${pkgdir}/usr/include/vulkan - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + install -m755 -d "${pkgdir}/usr/share/licenses/vulkan-intel" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/vulkan-intel/" } package_vulkan-radeon-vanilla() { pkgdesc="Radeon's Vulkan mesa driver" - depends=('wayland' 'libx11' 'libxshmfence' 'libelf' 'libdrm' 'llvm-libs') + depends=('mesa-vanilla' 'wayland' 'libx11' 'libxshmfence' 'libelf' 'libdrm' 'llvm-libs') provides=('vulkan-driver') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + conflicts=('vulkan-radeon') install -m755 -d ${pkgdir}/usr/share/vulkan/icd.d - mv -v ${srcdir}/fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json ${pkgdir}/usr/share/vulkan/icd.d/ + cp -rv ${srcdir}/fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json ${pkgdir}/usr/share/vulkan/icd.d/ install -m755 -d ${pkgdir}/usr/lib - mv -v ${srcdir}/fakeinstall/usr/lib/libvulkan_radeon.so ${pkgdir}/usr/lib/ + cp -rv ${srcdir}/fakeinstall/usr/lib/libvulkan_radeon.so ${pkgdir}/usr/lib/ - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + install -m755 -d "${pkgdir}/usr/share/licenses/vulkan-radeon" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/vulkan-radeon/" } -package_libva-mesa-vanilla-driver() { +package_libva-mesa-driver-vanilla() { pkgdesc="VA-API implementation for gallium" - depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence') - depends+=('lm_sensors') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + depends=('mesa-vanilla' 'libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence' 'lm_sensors') + conflicts=('libva-mesa-driver') install -m755 -d ${pkgdir}/usr/lib cp -rv ${srcdir}/fakeinstall/usr/lib/dri ${pkgdir}/usr/lib - - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + + install -m755 -d "${pkgdir}/usr/share/licenses/libva-mesa-driver" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/libva-mesa-driver/" } -package_mesa-vanilla-vdpau() { +package_mesa-vdpau-vanilla() { pkgdesc="Mesa VDPAU drivers" - depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence') - depends+=('lm_sensors') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + depends=('mesa-vanilla' 'libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence' 'lm_sensors') + conflicts=('mesa-vdpau') install -m755 -d ${pkgdir}/usr/lib cp -rv ${srcdir}/fakeinstall/usr/lib/vdpau ${pkgdir}/usr/lib - - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + + install -m755 -d "${pkgdir}/usr/share/licenses/mesa-vdpau" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa-vdpau/" } package_mesa-vanilla() { pkgdesc="A free implementation of the OpenGL specification" depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf' - 'libomxil-bellagio' 'libtxc_dxtn' 'llvm-libs' "$pkgbase-libgl") - depends+=('lm_sensors') + 'libomxil-bellagio' 'libtxc_dxtn' 'llvm-libs' 'mesa-libgl-vanilla' 'lm_sensors') optdepends=('opengl-man-pages: for the OpenGL API man pages' - "$pkgbase-vdpau: for accelerated video playback" - "libva-$pkgbase-driver: for accelerated video playback") - # The "$FAMILY-dri" bits are for historical compatibility, the list - # of DRI families provided does not need to be updated. - provides=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri') - conflicts=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri') - replaces=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") + 'mesa-vdpau: for accelerated video playback' + 'libva-mesa-driver: for accelerated video playback') + provides_x86_64=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' 'opengl-driver') + conflicts_x86_64=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' 'mesa' + 'nvidia-utils' 'nvidia-340xx-utils' 'nvidia-304xx-utils' 'catalyst-utils') + replaces_x86_64=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' + 'nvidia-utils' 'nvidia-340xx-utils' 'nvidia-304xx-utils' 'catalyst-utils') + provides_i686=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' 'opengl-driver') + conflicts_i686=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' 'mesa' + 'nvidia-utils' 'nvidia-340xx-utils' 'nvidia-304xx-utils' 'catalyst-utils') + replaces_i686=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'virgl-dri' 'swr-dri' 'mesa-dri' + 'nvidia-utils' 'nvidia-340xx-utils' 'nvidia-304xx-utils' 'catalyst-utils') + provides_armv7h=('ati-dri' 'freedreno-dri' 'etnaviv-dri' 'imx-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'vc4-dri' 'virgl-dri' 'mesa-dri' 'opengl-driver') + conflicts_armv7h=('ati-dri' 'freedreno-dri' 'etnaviv-dri' 'imx-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'vc4-dri' 'virgl-dri' 'mesa-dri' 'mesa' + 'nvidia-utils' 'catalyst-utils') + replaces_armv7h=('ati-dri' 'freedreno-dri' 'etnaviv-dri' 'imx-dri' 'nouveau-dri' 'svga-dri' + 'swrast-dri' 'vc4-dri' 'virgl-dri' 'mesa-dri' + 'nvidia-utils' 'catalyst-utils') install -m755 -d ${pkgdir}/etc cp -rv ${srcdir}/drirc ${pkgdir}/etc @@ -266,7 +226,7 @@ package_mesa-vanilla() { install -m755 -d ${pkgdir}/usr/lib/xorg/modules/dri # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast cp -av ${srcdir}/fakeinstall/usr/lib/xorg/modules/dri/* ${pkgdir}/usr/lib/xorg/modules/dri - + cp -rv ${srcdir}/fakeinstall/usr/lib/bellagio ${pkgdir}/usr/lib cp -rv ${srcdir}/fakeinstall/usr/lib/d3d ${pkgdir}/usr/lib cp -rv ${srcdir}/fakeinstall/usr/lib/lib{gbm,glapi}.so* ${pkgdir}/usr/lib/ @@ -276,30 +236,26 @@ package_mesa-vanilla() { cp -rv ${srcdir}/fakeinstall/usr/include ${pkgdir}/usr cp -rv ${srcdir}/fakeinstall/usr/lib/pkgconfig ${pkgdir}/usr/lib/ - + # remove vulkan headers rm -rf ${pkgdir}/usr/include/vulkan - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + install -m755 -d "${pkgdir}/usr/share/licenses/mesa" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa/" } -package_mesa-vanilla-libgl() { +package_mesa-libgl-vanilla() { pkgdesc="Mesa 3-D graphics library" - depends=("$pkgbase") - provides=('libgl' 'libegl' 'libgles') - conflicts=('libgl' 'libegl' 'libgles') - - pkgdesc+=" (without libglvnd patches)" - provides+=("${pkgname%$suffix}=$pkgver") - conflicts+=("${pkgname%$suffix}") - replaces=('mesa-libgl') # A hack to make -Syu from the vanilla libre/mesa work + depends=('libdrm' 'libxdamage' 'libxshmfence' 'libxxf86vm' 'wayland') + provides=('libgl' 'libegl' 'libgles' 'mesa-libgl' 'libglvnd') + conflicts=('mesa-libgl' 'libglvnd' 'nvidia-libgl' 'nvidia-340xx-libgl' 'nvidia-304xx-libgl' 'nvidia-cg-toolkit' 'catalyst-libgl') + replaces=('nvidia-libgl' 'nvidia-340xx-libgl' 'nvidia-304xx-libgl' 'nvidia-cg-toolkit' 'catalyst-libgl') install -m755 -d "${pkgdir}/usr/lib/" cp -rv ${srcdir}/fakeinstall/usr/lib/libGL.so* ${pkgdir}/usr/lib/ cp -rv ${srcdir}/fakeinstall/usr/lib/libEGL.so* ${pkgdir}/usr/lib/ cp -rv ${srcdir}/fakeinstall/usr/lib/libGLES*.so* ${pkgdir}/usr/lib/ - install -m755 -d "${pkgdir}/usr/share/licenses/$pkgname" - install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/" + install -m755 -d "${pkgdir}/usr/share/licenses/mesa-libgl" + install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa-libgl/" } |