pmaports/temp/mesa/APKBUILD
Oliver Smith 67eb31effd
temp/mesa: bump pkgrel
Fix up for !359: the pkgrel was not bumped, and because the real mesa
version was stored in _pkgver instead of pkgver (which is set to 9999),
this means that the APKBUILD has exactly the same version as before. So
pmbootstrap will not try to build it, resulting in a missing
mesa-dri-lima package and general confusion.

See also:
https://gitlab.com/postmarketOS/pmaports/merge_requests/359#note_170054969
2019-05-14 16:14:38 +02:00

276 lines
6.2 KiB
Text

# Forked from Alpine, so we can upgrade the version and build etnaviv and tegra
# ---
# Remember to increase pkgrel after changing _pkgver!
# ---
pkgname=mesa
pkgver=9999
_pkgver=19.1.0-rc1
pkgrel=3
pkgdesc="[${_pkgver}] Mesa DRI OpenGL library"
url="https://www.mesa3d.org"
arch="armhf armv7 aarch64"
license="MIT SGI-B-2.0 BSL-1.0"
subpackages="
$pkgname-dev
$pkgname-dri-swrast:_dri
$pkgname-dri-nouveau:_dri
$pkgname-dri-freedreno:_dri
$pkgname-dri-virtio:_dri
$pkgname-glapi $pkgname-egl $pkgname-gl $pkgname-gles
$pkgname-osmesa $pkgname-gbm $pkgname-xatracker
"
depends_dev="
libdrm-dev
libxext-dev
libxdamage-dev
libxcb-dev
libxshmfence-dev
"
makedepends="
$depends_dev
bison
eudev-dev
expat-dev
flex
gettext
elfutils-libelf
libtool
libxfixes-dev
libva-dev
libvdpau-dev
libx11-dev
libxrandr-dev
libxxf86vm-dev
libxt-dev
libxvmc-dev
makedepend
py-mako
py3-libxml2
python3
talloc-dev
wayland-dev
wayland-protocols
xorgproto
zlib-dev
meson
ninja
"
source="
https://gitlab.freedesktop.org/mesa/mesa/-/archive/$pkgname-$_pkgver/mesa-$pkgname-$_pkgver.tar.gz
10-adjust-cache-deflate-buffer.patch
20-musl.patch
meson-add-toggle-for-TLS-support-in-GLX.patch
fix-lima-on-wayland.patch"
replaces="mesa-dricore"
_dri_driverdir=/usr/lib/dri
_dri_driverdir_x11=/usr/lib/xorg/modules/dri
_dri_drivers="nouveau"
_gallium_drivers="swrast,freedreno,virgl,nouveau"
_vulkan_drivers=""
case "$CARCH" in
x86*)
_dri_drivers="${_dri_drivers},i915,i965"
_gallium_drivers="${_gallium_drivers},svga"
_vulkan_drivers="${_vulkan_drivers},amd,intel"
subpackages="$subpackages \
$pkgname-dri-intel:_dri \
$pkgname-dri-vmwgfx:_dri"
;;
armhf|aarch64)
_gallium_drivers="${_gallium_drivers},vc4,kmsro,etnaviv,tegra,panfrost,lima"
_vulkan_drivers="${_vulkan_drivers}"
subpackages="$subpackages $pkgname-dri-vc4:_dri
$pkgname-dri-etnaviv:_dri
$pkgname-dri-imx:_dri
$pkgname-dri-tegra:_dri
$pkgname-dri-lima:_dri
$pkgname-dri-panfrost:_dri"
;;
esac
builddir="$srcdir/mesa-$pkgname-$_pkgver"
build() {
cd "$builddir"
export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700"
mkdir "$builddir"/build
meson -Ddri-search-path="$_dri_driverdir" \
-Dgallium-drivers="$_gallium_drivers" \
-Ddri-drivers="$_dri_drivers" \
-Dvulkan-drivers="$_vulkan_drivers" \
-Dplatforms=x11,wayland,drm \
-Ddri3=true \
-Degl=true \
-Dglx=dri \
-Dgles1=true \
-Dgles2=true \
-Dshared-glapi=true \
-Dosmesa=gallium \
-Dgbm=true \
-Dglx-tls=false \
-Dprefix="$pkgdir"/usr "$builddir"/build
ninja -C "$builddir"/build
}
package() {
cd "$builddir"
ninja -C "$builddir"/build install
}
egl() {
pkgdesc="[${_pkgver}] Mesa libEGL runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libEGL.so* "$subpkgdir"/usr/lib/
}
gl() {
pkgdesc="[${_pkgver}] Mesa libGL runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libGL.so* "$subpkgdir"/usr/lib/
}
glapi() {
pkgdesc="[${_pkgver}] Mesa shared glapi"
replaces="$pkgname-gles"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libglapi.so.* "$subpkgdir"/usr/lib/
}
gles() {
pkgdesc="[${_pkgver}] Mesa libGLESv2 runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libGLES*.so* "$subpkgdir"/usr/lib/
}
osmesa() {
pkgdesc="[${_pkgver}] Mesa offscreen rendering libraries"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libOSMesa.so.* "$subpkgdir"/usr/lib/
}
xatracker() {
pkgdesc="Mesa XA state tracker for vmware"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libxatracker*.so.* "$subpkgdir"/usr/lib/
}
gbm() {
pkgdesc="[${_pkgver}] Mesa gbm library"
replaces="mesa"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgbm.so.* "$subpkgdir"/usr/lib/
}
_mv_dri() {
install -d "$subpkgdir"/$_dri_driverdir
install -d "$subpkgdir"/$_dri_driverdir_x11
while [ $# -gt 0 ]; do
mv "$pkgdir"/$_dri_driverdir/${1}.so \
"$subpkgdir"/$_dri_driverdir/
shift
ln -s $_dri_driverdir/${1}.so \
"$subpkgdir"/$_dri_driverdir_x11/${1}.so
done
}
_mv_vdpau() {
local i
install -d "$subpkgdir"/usr/lib/vdpau
for i in "$@"; do
mv "$pkgdir"/usr/lib/vdpau/libvdpau_$i.* \
"$subpkgdir"/usr/lib/vdpau/
done
}
_mv_gpipe() {
return 0
# http://cgit.freedesktop.org/mesa/mesa/commit/?id=44ec468e8033553c26a112cebba41c343db00eb1
# https://code.google.com/p/chromium/issues/detail?id=412089
# local i
# install -d "$subpkgdir"/usr/lib/gallium-pipe
# for i in "$@"; do
# mv "$pkgdir"/usr/lib/gallium-pipe/pipe_$i.* \
# "$subpkgdir"/usr/lib/gallium-pipe/
# done
}
_mv_va() {
local i
install -d "$subpkgdir"/usr/lib/dri
for i in "$@"; do
mv "$pkgdir"/usr/lib/dri/${i}_drv_video.so \
"$subpkgdir"/usr/lib/dri/
done
}
_dri() {
local n=${subpkgname##*-dri-}
pkgdesc="[${_pkgver}] Mesa DRI driver for $n"
case $n in
intel)
_mv_dri i915_dri i965_dri
;;
freedreno)
_mv_dri msm_dri kgsl_dri
;;
swrast)
_mv_dri swrast_dri kms_swrast_dri && _mv_gpipe swrast
;;
vc4)
_mv_dri vc4_dri
;;
vmwgfx)
_mv_dri vmwgfx_dri && _mv_gpipe vmwgfx
;;
virtio)
_mv_dri virtio_gpu_dri
;;
etnaviv)
_mv_dri etnaviv_dri
;;
imx)
_mv_dri imx-drm_dri
;;
tegra)
_mv_dri tegra_dri
;;
nouveau)
_mv_dri nouveau_dri nouveau_vieux_dri \
&& _mv_vdpau nouveau \
&& _mv_gpipe nouveau \
&& _mv_va nouveau
;;
lima)
_mv_dri lima_dri sun4i-drm_dri
;;
panfrost)
_mv_dri panfrost_dri
;;
esac
}
sha512sums="24502a417d5a3c9c3687123882a64abcaea482ada5efaf69f610a623d2d4b05b0701bd4c1d2993ae40a2a2fd7b954ba0be7a2e54b9e751ec70ebb3e75c153f21 mesa-mesa-19.1.0-rc1.tar.gz
cdf22d2da3328e116c379264886bd01fd3ad5cc45fe03dc6fd97bdc4794502598ee195c0b9d975fa264d6ac31c6fa108c0535c91800ecf4fcabfd308e53074cc 10-adjust-cache-deflate-buffer.patch
02db65893d55b5667d9c3bc193fc089e5408596431e06363fe2adea00c9e3c4e80612f3d03dc61f931d1a6ae04340bccf55e1376cf00bbf2433990713649d286 20-musl.patch
a7bbc0d8836fe5eb7220c7b41d8af439878a3876302de32739243232f979ea9c63d2069fcd78bef370eafef0a21f491ef99219ae686e965326475764244bbe5d meson-add-toggle-for-TLS-support-in-GLX.patch
095bbcef3bc73d4e51125819a1f8b18b3ec02dab4219dce50ce6cef60a755eac3526ea99f0f72c6a3f02567a27654ef5a41a4075b210a7182d0d17317855725b fix-lima-on-wayland.patch"