2018-10-23 21:28:50 +00:00
|
|
|
# Maintainer: Robert Yang <decatf@gmail.com>
|
|
|
|
pkgname=mesa-grate
|
|
|
|
pkgver=18.1.0
|
2019-02-26 17:24:26 +00:00
|
|
|
pkgrel=2
|
2018-10-24 00:01:38 +00:00
|
|
|
pkgdesc="Mesa DRI OpenGL library"
|
|
|
|
url="https://www.mesa3d.org"
|
2019-02-26 17:24:26 +00:00
|
|
|
arch="armhf armv7"
|
2018-10-24 00:01:38 +00:00
|
|
|
license="MIT SGI-B-2.0 BSL-1.0"
|
|
|
|
subpackages="
|
|
|
|
$pkgname-dev
|
|
|
|
$pkgname-dri-swrast:_dri
|
|
|
|
$pkgname-glapi $pkgname-egl $pkgname-gl $pkgname-gles
|
2019-01-17 14:57:00 +00:00
|
|
|
$pkgname-osmesa $pkgname-gbm
|
2018-10-24 00:01:38 +00:00
|
|
|
"
|
|
|
|
_llvmver=5
|
2018-10-23 21:28:50 +00:00
|
|
|
depends="ldpath libdrm-grate"
|
2018-10-24 00:01:38 +00:00
|
|
|
depends_dev="
|
2018-10-23 21:28:50 +00:00
|
|
|
libdrm-grate-dev
|
2018-10-24 00:01:38 +00:00
|
|
|
libxext-dev
|
|
|
|
libxdamage-dev
|
|
|
|
libxcb-dev
|
|
|
|
libxshmfence-dev
|
|
|
|
"
|
|
|
|
makedepends="
|
|
|
|
$depends_dev
|
|
|
|
bison
|
|
|
|
eudev-dev
|
|
|
|
expat-dev
|
|
|
|
flex
|
|
|
|
libelf-dev
|
|
|
|
libtool
|
|
|
|
libxfixes-dev
|
|
|
|
libva-dev
|
|
|
|
libvdpau-dev
|
|
|
|
libx11-dev
|
|
|
|
libxxf86vm-dev
|
|
|
|
libxt-dev
|
|
|
|
libxvmc-dev
|
2019-01-17 14:57:00 +00:00
|
|
|
meson
|
2018-10-24 00:01:38 +00:00
|
|
|
py-mako
|
|
|
|
py3-libxml2
|
|
|
|
python3
|
|
|
|
talloc-dev
|
|
|
|
wayland-dev
|
|
|
|
wayland-protocols
|
|
|
|
xorgproto
|
|
|
|
zlib-dev
|
|
|
|
"
|
2018-10-23 21:28:50 +00:00
|
|
|
install="$pkgname.post-install $pkgname.pre-deinstall"
|
2018-10-24 00:01:38 +00:00
|
|
|
source="
|
|
|
|
https://mesa.freedesktop.org/archive/mesa-$pkgver.tar.xz
|
|
|
|
glx_ro_text_segm.patch
|
|
|
|
musl-fix-includes.patch
|
|
|
|
drmdeps.patch
|
2018-10-23 21:28:50 +00:00
|
|
|
0001-Revert-autotools-add-tegra-header-files.patch
|
|
|
|
0002-Revert-autotools-Add-tegra-to-AM_DISTCHECK_CONFIGURE.patch
|
|
|
|
0003-Revert-drm-uapi-bump-headers.patch
|
|
|
|
0004-Revert-tegra-Initial-support.patch
|
|
|
|
0005-grate-driver.patch
|
2019-01-17 14:57:00 +00:00
|
|
|
0001-meson-Add-glx-tls-option.patch
|
|
|
|
0001-meson-correct-gallium-grate-variable.patch
|
2019-02-26 17:24:26 +00:00
|
|
|
adjust-cache-deflate-buffer.patch
|
2018-10-24 00:01:38 +00:00
|
|
|
"
|
2018-10-23 21:28:50 +00:00
|
|
|
replaces="mesa mesa-dricore"
|
|
|
|
|
2019-01-17 14:57:00 +00:00
|
|
|
_prefix=/usr
|
|
|
|
_dri_driverdir=${_prefix}/lib/xorg/modules/dri/grate
|
|
|
|
_dri_drivers=""
|
2018-10-23 21:28:50 +00:00
|
|
|
_gallium_drivers="swrast"
|
|
|
|
_vulkan_drivers=""
|
2018-10-24 00:01:38 +00:00
|
|
|
|
|
|
|
_arch_opts=
|
|
|
|
|
|
|
|
case "$CARCH" in
|
|
|
|
x86*)
|
|
|
|
_dri_drivers="${_dri_drivers},i915,i965"
|
|
|
|
_gallium_drivers="${_gallium_drivers},svga"
|
|
|
|
_vulkan_drivers="$_vulkan_drivers,intel"
|
|
|
|
subpackages="$subpackages \
|
|
|
|
$pkgname-dri-intel:_dri \
|
|
|
|
$pkgname-dri-vmwgfx:_dri \
|
|
|
|
$pkgname-vulkan-intel:_vulkan"
|
2019-01-17 14:57:00 +00:00
|
|
|
_arch_opts="-Ddri3=true"
|
2018-10-24 00:01:38 +00:00
|
|
|
case "$CARCH" in
|
|
|
|
x86)
|
2019-01-17 14:57:00 +00:00
|
|
|
_arch_opts="$_arch_opts -Dglx-rts=true -Dasm=false";;
|
2018-10-24 00:01:38 +00:00
|
|
|
esac
|
|
|
|
;;
|
2019-02-26 17:24:26 +00:00
|
|
|
armhf|armv7|aarch64)
|
2018-10-23 21:28:50 +00:00
|
|
|
_gallium_drivers="${_gallium_drivers},grate"
|
|
|
|
subpackages="$subpackages $pkgname-dri-tegra:_dri"
|
2018-10-24 00:01:38 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
builddir="$srcdir/mesa-$pkgver"
|
|
|
|
|
2018-10-24 00:01:38 +00:00
|
|
|
prepare() {
|
|
|
|
cd "$builddir"
|
|
|
|
default_prepare
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$builddir"
|
|
|
|
|
2019-01-17 14:57:00 +00:00
|
|
|
export PKG_CONFIG_PATH="/usr/lib/pkgconfig/libdrm-grate:${PKG_CONFIG_PATH}"
|
2018-10-24 00:01:38 +00:00
|
|
|
export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700"
|
2019-01-17 14:57:00 +00:00
|
|
|
meson build \
|
|
|
|
-Dbuild=$CBUILD \
|
|
|
|
-Dhost=$CHOST \
|
|
|
|
-Dprefix=$_prefix \
|
|
|
|
-Dsysconfdir=/etc \
|
|
|
|
-Ddri-drivers-path=${_dri_driverdir} \
|
|
|
|
-Ddri-search-path=${_dri_driverdir} \
|
|
|
|
-Dgallium-drivers=${_gallium_drivers} \
|
|
|
|
-Ddri-drivers=${_dri_drivers} \
|
|
|
|
-Dvulkan-drivers=${_vulkan_drivers} \
|
|
|
|
-Dplatforms=x11,drm \
|
|
|
|
-Dllvm=false \
|
|
|
|
-Dshared-glapi=true \
|
|
|
|
-Dgbm=true \
|
|
|
|
-Ddri=true \
|
|
|
|
-Dglx=auto \
|
|
|
|
-Dosmesa=gallium \
|
|
|
|
-Dgles1=true \
|
|
|
|
-Dgles2=true \
|
|
|
|
-Degl=true \
|
|
|
|
-Dtexture-float=true \
|
|
|
|
-Dgallium-xa=false \
|
|
|
|
-Dgallium-vdpau=false \
|
|
|
|
-Dgallium-va=false \
|
|
|
|
-Dgallium-xvmc=false \
|
|
|
|
-Dgallium-nine=false \
|
|
|
|
-Dglx-tls=false \
|
2018-10-24 00:01:38 +00:00
|
|
|
$_arch_opts
|
2019-01-17 14:57:00 +00:00
|
|
|
ninja -C build/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd "$builddir"
|
2019-01-17 14:57:00 +00:00
|
|
|
DESTDIR="$pkgdir" ninja -C build/ install
|
2018-10-24 00:01:38 +00:00
|
|
|
|
|
|
|
# provided by wayland
|
2018-10-23 21:28:50 +00:00
|
|
|
# rm -v "$pkgdir"/usr/lib/libwayland-egl.so*
|
|
|
|
# rm -v "$pkgdir"/usr/lib/pkgconfig/wayland-egl.pc
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
egl() {
|
|
|
|
pkgdesc="Mesa libEGL runtime libraries"
|
|
|
|
replaces="mesa"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libEGL.so* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gl() {
|
|
|
|
pkgdesc="Mesa libGL runtime libraries"
|
|
|
|
replaces="mesa"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libGL.so* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
glapi() {
|
|
|
|
pkgdesc="Mesa shared glapi"
|
|
|
|
replaces="$pkgname-gles"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libglapi.so.* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gles() {
|
|
|
|
pkgdesc="Mesa libGLESv2 runtime libraries"
|
|
|
|
replaces="mesa"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libGLES*.so* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xatracker() {
|
|
|
|
pkgdesc="Mesa XA state tracker for vmware"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libxatracker*.so.* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
osmesa() {
|
|
|
|
pkgdesc="Mesa offscreen rendering libraries"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libOSMesa.so.* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gbm() {
|
|
|
|
pkgdesc="Mesa gbm library"
|
|
|
|
replaces="mesa"
|
|
|
|
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/lib/libgbm.so.* "$subpkgdir"/usr/lib/mesa-grate/
|
2018-10-24 00:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_mv_dri() {
|
2019-01-17 14:57:00 +00:00
|
|
|
install -d "$subpkgdir"${_dri_driverdir}
|
2018-10-24 00:01:38 +00:00
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
2019-01-17 14:57:00 +00:00
|
|
|
mv "$pkgdir"${_dri_driverdir}/${1}.so \
|
|
|
|
"$subpkgdir"${_dri_driverdir}/
|
2018-10-24 00:01:38 +00:00
|
|
|
shift
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_mv_vdpau() {
|
|
|
|
local i
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/vdpau
|
2018-10-24 00:01:38 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
mv "$pkgdir"/usr/lib/vdpau/libvdpau_$i.* \
|
2018-10-23 21:28:50 +00:00
|
|
|
"$subpkgdir"/usr/lib/mesa-grate/vdpau/
|
2018-10-24 00:01:38 +00:00
|
|
|
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
|
2018-10-23 21:28:50 +00:00
|
|
|
# install -d "$subpkgdir"/usr/lib/mesa-grate/gallium-pipe
|
2018-10-24 00:01:38 +00:00
|
|
|
# for i in "$@"; do
|
|
|
|
# mv "$pkgdir"/usr/lib/gallium-pipe/pipe_$i.* \
|
2018-10-23 21:28:50 +00:00
|
|
|
# "$subpkgdir"/usr/lib/mesa-grate/gallium-pipe/
|
2018-10-24 00:01:38 +00:00
|
|
|
# done
|
|
|
|
}
|
|
|
|
|
|
|
|
_mv_vulkan() {
|
|
|
|
local i
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
install -d "$subpkgdir"/usr/share/mesa-grate/vulkan/icd.d
|
2018-10-24 00:01:38 +00:00
|
|
|
for i in "$@"; do
|
2018-10-23 21:28:50 +00:00
|
|
|
mv "$pkgdir"/usr/lib/libvulkan_${i}.so "$subpkgdir"/usr/lib/mesa-grate/
|
|
|
|
mv "$pkgdir"/usr/share/mesa-grate/vulkan/icd.d/${i}* "$subpkgdir"/usr/share/mesa-grate/vulkan/icd.d/
|
2018-10-24 00:01:38 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_mv_va() {
|
|
|
|
local i
|
2018-10-23 21:28:50 +00:00
|
|
|
install -d "$subpkgdir"/usr/lib/mesa-grate/dri
|
2018-10-24 00:01:38 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
mv "$pkgdir"/usr/lib/dri/${i}_drv_video.so \
|
2018-10-23 21:28:50 +00:00
|
|
|
"$subpkgdir"/usr/lib/mesa-grate/dri/
|
2018-10-24 00:01:38 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_dri() {
|
|
|
|
local n=${subpkgname##*-dri-}
|
|
|
|
pkgdesc="Mesa DRI driver for $n"
|
|
|
|
|
|
|
|
case $n in
|
|
|
|
ati)
|
2018-10-23 21:28:50 +00:00
|
|
|
_mv_dri radeon_dri r200_dri r300_dri r600_dri \
|
|
|
|
&& _mv_vdpau r300 r600 \
|
2018-10-24 00:01:38 +00:00
|
|
|
&& _mv_gpipe r300 r600 \
|
2018-10-23 21:28:50 +00:00
|
|
|
&& _mv_va r600
|
2018-10-24 00:01:38 +00:00
|
|
|
;;
|
|
|
|
intel)
|
|
|
|
_mv_dri i915_dri i965_dri
|
|
|
|
;;
|
|
|
|
nouveau)
|
|
|
|
_mv_dri nouveau_dri nouveau_vieux_dri \
|
|
|
|
&& _mv_vdpau nouveau \
|
|
|
|
&& _mv_gpipe nouveau \
|
|
|
|
&& _mv_va nouveau
|
|
|
|
;;
|
|
|
|
freedreno)
|
|
|
|
_mv_dri msm_dri kgsl_dri
|
|
|
|
;;
|
|
|
|
swrast)
|
|
|
|
_mv_dri swrast_dri kms_swrast_dri && _mv_gpipe swrast
|
|
|
|
;;
|
2018-10-23 21:28:50 +00:00
|
|
|
tegra)
|
|
|
|
_mv_dri tegra_dri
|
2019-02-26 17:24:26 +00:00
|
|
|
ln -s "${_dri_driverdir}/tegra_dri.so" \
|
|
|
|
"${subpkgdir}${_prefix}/lib/xorg/modules/dri/tegra_dri.so"
|
2018-10-23 21:28:50 +00:00
|
|
|
;;
|
2018-10-24 00:01:38 +00:00
|
|
|
vc4)
|
|
|
|
_mv_dri vc4_dri
|
|
|
|
;;
|
|
|
|
vmwgfx)
|
|
|
|
_mv_dri vmwgfx_dri && _mv_gpipe vmwgfx
|
|
|
|
;;
|
|
|
|
virtio)
|
|
|
|
_mv_dri virtio_gpu_dri
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
_vulkan() {
|
|
|
|
local n=${subpkgname##*-vulkan-}
|
|
|
|
pkgdesc="Mesa Vulkan API driver for $n"
|
|
|
|
|
|
|
|
case $n in
|
|
|
|
ati)
|
|
|
|
_mv_vulkan radeon ;;
|
|
|
|
intel)
|
|
|
|
_mv_vulkan intel ;;
|
|
|
|
esac
|
|
|
|
}
|
2018-10-23 21:28:50 +00:00
|
|
|
|
|
|
|
dev() {
|
|
|
|
default_dev
|
|
|
|
|
|
|
|
cd "$subpkgdir"/usr/lib
|
|
|
|
install -d mesa-grate/
|
|
|
|
mv lib*.so mesa-grate/
|
|
|
|
|
|
|
|
install -d pkgconfig/mesa-grate/
|
|
|
|
mv pkgconfig/*.pc pkgconfig/mesa-grate
|
|
|
|
|
|
|
|
# Move headers (to /usr/include/mesa-grate)
|
|
|
|
cd "$subpkgdir"/usr
|
|
|
|
mv include include_
|
|
|
|
mkdir include
|
|
|
|
mv include_ include/mesa-grate
|
|
|
|
|
|
|
|
# Redirect pkgconfig to alternate lib/header directory
|
|
|
|
local pc
|
|
|
|
cd "$subpkgdir"/usr/lib/pkgconfig/mesa-grate
|
|
|
|
for pc in *; do
|
|
|
|
sed -i "s./include$./include/mesa-grate.g" $pc
|
|
|
|
sed -i "s./lib$./lib/mesa-grate.g" $pc
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
sha512sums="8b26af2df8b94373cbc339521974cd568c1d4ff4204986ee7b439e4cf3ebe14d822ea081a7769b68eca9263b7bc6dbca01836b8bb0d6495d2e2614c4e3d601ad mesa-18.1.0.tar.xz
|
2018-10-24 00:01:38 +00:00
|
|
|
8a434ffefdc6ce924d613727a8649b9a77ad9f0ed0674c9cfb8f6ff0fec483f9318e681254535b62c957db1d0432f96427f917e2f139f4c65ef761bffb528255 glx_ro_text_segm.patch
|
|
|
|
2c9cb0fa890d29e4140d956ee52a74b4522e29e44fadfc2dd144e581c2701a1d8842ab5c8ff0b68e14b2242e2812a9d4ac0aed1c3314a2143333bc37f2323b58 musl-fix-includes.patch
|
2018-10-23 21:28:50 +00:00
|
|
|
3409483217dbec732286e628e268e1e8cd392b7e8efb13c7651b38e6563aa5a4988279efb029096dcd092ebe7a92eece103014ed420d2b242eab8d0237f056fd drmdeps.patch
|
|
|
|
d046ef1fec03648349ec321e93dd6f1718d84de6c080216f7158e1c918058307abcc6866af31a2be0aea1afb0d6f5863cf247638cc2ec93c37d885b1b0c1d728 0001-Revert-autotools-add-tegra-header-files.patch
|
|
|
|
ba0d498779302e01c36abfcf9eacf187e87063ca4ab4a2ac0fed63c331f765c254cd92a43fd4fde9c5a86235d8a8c766b4bbfe0e240df884522dc99dc4d3625a 0002-Revert-autotools-Add-tegra-to-AM_DISTCHECK_CONFIGURE.patch
|
|
|
|
498b9286bffc55e5fae6fa5e1459977c3b3ac1b85202975ae8555c3c551bef634f631ece083dc55e16cd8aac536aa82563760cb53c744cfe63f7b431c538df77 0003-Revert-drm-uapi-bump-headers.patch
|
|
|
|
01feb831b3227ff06feebee2a5f5a408a7d3710031853644b72d0dc32dfa139396553972435d1b9f3448f7589de782586f227e2ae8b239a47ddfd1b56d9cd1e9 0004-Revert-tegra-Initial-support.patch
|
2019-01-17 14:57:00 +00:00
|
|
|
ecdd537af62ea8e9d4e6361eafbfc09d315b9084af5af48d761e1713500e08ff965fa62f4a52aea9bd6ab98a3179fa7e4c9a31a647cbe503e820f525e33fd4d2 0005-grate-driver.patch
|
|
|
|
05e7ce9f69b9fe2d1691b40a7ec93e05de9043a7953bdd7189c5f90b406f4b72e6aaa1aaba3fa7cb53de5c8943bffaaa49df0a354f7e8ba4be725bf6b8da143a 0001-meson-Add-glx-tls-option.patch
|
2019-02-26 17:24:26 +00:00
|
|
|
2e1d5fcf239b7f7a8fc5e8f64819079c4b7ad8d2f83c033faffa2226b53bd16fb8db39fa67f9f0e7b81650749306a796e6db75237ad597c56575df9feca12e06 0001-meson-correct-gallium-grate-variable.patch
|
|
|
|
cdf22d2da3328e116c379264886bd01fd3ad5cc45fe03dc6fd97bdc4794502598ee195c0b9d975fa264d6ac31c6fa108c0535c91800ecf4fcabfd308e53074cc adjust-cache-deflate-buffer.patch"
|