pmaports/main/mesa-grate/APKBUILD

342 lines
8.8 KiB
Text
Raw Normal View History

# Maintainer: Robert Yang <decatf@gmail.com>
pkgname=mesa-grate
pkgver=18.1.0
pkgrel=2
pkgdesc="Mesa DRI OpenGL library"
url="https://www.mesa3d.org"
arch="armhf armv7"
license="MIT SGI-B-2.0 BSL-1.0"
subpackages="
$pkgname-dev
$pkgname-dri-swrast:_dri
$pkgname-glapi $pkgname-egl $pkgname-gl $pkgname-gles
$pkgname-osmesa $pkgname-gbm
"
_llvmver=5
depends="ldpath libdrm-grate"
depends_dev="
libdrm-grate-dev
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
meson
py2-mako
python2
talloc-dev
wayland-dev
wayland-protocols
xorgproto
zlib-dev
"
install="$pkgname.post-install $pkgname.pre-deinstall"
source="
https://mesa.freedesktop.org/archive/mesa-$pkgver.tar.xz
glx_ro_text_segm.patch
musl-fix-includes.patch
drmdeps.patch
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
0001-meson-Add-glx-tls-option.patch
0001-meson-correct-gallium-grate-variable.patch
adjust-cache-deflate-buffer.patch
"
replaces="mesa mesa-dricore"
_prefix=/usr
_dri_driverdir=${_prefix}/lib/xorg/modules/dri/grate
_dri_drivers=""
_gallium_drivers="swrast"
_vulkan_drivers=""
_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"
_arch_opts="-Ddri3=true"
case "$CARCH" in
x86)
_arch_opts="$_arch_opts -Dglx-rts=true -Dasm=false";;
esac
;;
armhf|armv7|aarch64)
_gallium_drivers="${_gallium_drivers},grate"
subpackages="$subpackages $pkgname-dri-tegra:_dri"
;;
esac
builddir="$srcdir/mesa-$pkgver"
prepare() {
cd "$builddir"
default_prepare
}
build() {
cd "$builddir"
export PKG_CONFIG_PATH="/usr/lib/pkgconfig/libdrm-grate:${PKG_CONFIG_PATH}"
export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700"
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 \
$_arch_opts
ninja -C build/
}
package() {
cd "$builddir"
DESTDIR="$pkgdir" ninja -C build/ install
# provided by wayland
# rm -v "$pkgdir"/usr/lib/libwayland-egl.so*
# rm -v "$pkgdir"/usr/lib/pkgconfig/wayland-egl.pc
}
egl() {
pkgdesc="Mesa libEGL runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libEGL.so* "$subpkgdir"/usr/lib/mesa-grate/
}
gl() {
pkgdesc="Mesa libGL runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libGL.so* "$subpkgdir"/usr/lib/mesa-grate/
}
glapi() {
pkgdesc="Mesa shared glapi"
replaces="$pkgname-gles"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libglapi.so.* "$subpkgdir"/usr/lib/mesa-grate/
}
gles() {
pkgdesc="Mesa libGLESv2 runtime libraries"
replaces="mesa"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libGLES*.so* "$subpkgdir"/usr/lib/mesa-grate/
}
xatracker() {
pkgdesc="Mesa XA state tracker for vmware"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libxatracker*.so.* "$subpkgdir"/usr/lib/mesa-grate/
}
osmesa() {
pkgdesc="Mesa offscreen rendering libraries"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libOSMesa.so.* "$subpkgdir"/usr/lib/mesa-grate/
}
gbm() {
pkgdesc="Mesa gbm library"
replaces="mesa"
install -d "$subpkgdir"/usr/lib/mesa-grate/
mv "$pkgdir"/usr/lib/libgbm.so.* "$subpkgdir"/usr/lib/mesa-grate/
}
_mv_dri() {
install -d "$subpkgdir"${_dri_driverdir}
while [ $# -gt 0 ]; do
mv "$pkgdir"${_dri_driverdir}/${1}.so \
"$subpkgdir"${_dri_driverdir}/
shift
done
}
_mv_vdpau() {
local i
install -d "$subpkgdir"/usr/lib/mesa-grate/vdpau
for i in "$@"; do
mv "$pkgdir"/usr/lib/vdpau/libvdpau_$i.* \
"$subpkgdir"/usr/lib/mesa-grate/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/mesa-grate/gallium-pipe
# for i in "$@"; do
# mv "$pkgdir"/usr/lib/gallium-pipe/pipe_$i.* \
# "$subpkgdir"/usr/lib/mesa-grate/gallium-pipe/
# done
}
_mv_vulkan() {
local i
install -d "$subpkgdir"/usr/lib/mesa-grate/
install -d "$subpkgdir"/usr/share/mesa-grate/vulkan/icd.d
for i in "$@"; do
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/
done
}
_mv_va() {
local i
install -d "$subpkgdir"/usr/lib/mesa-grate/dri
for i in "$@"; do
mv "$pkgdir"/usr/lib/dri/${i}_drv_video.so \
"$subpkgdir"/usr/lib/mesa-grate/dri/
done
}
_dri() {
local n=${subpkgname##*-dri-}
pkgdesc="Mesa DRI driver for $n"
case $n in
ati)
_mv_dri radeon_dri r200_dri r300_dri r600_dri \
&& _mv_vdpau r300 r600 \
&& _mv_gpipe r300 r600 \
&& _mv_va r600
;;
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
;;
tegra)
_mv_dri tegra_dri
ln -s "${_dri_driverdir}/tegra_dri.so" \
"${subpkgdir}${_prefix}/lib/xorg/modules/dri/tegra_dri.so"
;;
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
}
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
8a434ffefdc6ce924d613727a8649b9a77ad9f0ed0674c9cfb8f6ff0fec483f9318e681254535b62c957db1d0432f96427f917e2f139f4c65ef761bffb528255 glx_ro_text_segm.patch
2c9cb0fa890d29e4140d956ee52a74b4522e29e44fadfc2dd144e581c2701a1d8842ab5c8ff0b68e14b2242e2812a9d4ac0aed1c3314a2143333bc37f2323b58 musl-fix-includes.patch
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
ecdd537af62ea8e9d4e6361eafbfc09d315b9084af5af48d761e1713500e08ff965fa62f4a52aea9bd6ab98a3179fa7e4c9a31a647cbe503e820f525e33fd4d2 0005-grate-driver.patch
05e7ce9f69b9fe2d1691b40a7ec93e05de9043a7953bdd7189c5f90b406f4b72e6aaa1aaba3fa7cb53de5c8943bffaaa49df0a354f7e8ba4be725bf6b8da143a 0001-meson-Add-glx-tls-option.patch
2e1d5fcf239b7f7a8fc5e8f64819079c4b7ad8d2f83c033faffa2226b53bd16fb8db39fa67f9f0e7b81650749306a796e6db75237ad597c56575df9feca12e06 0001-meson-correct-gallium-grate-variable.patch
cdf22d2da3328e116c379264886bd01fd3ad5cc45fe03dc6fd97bdc4794502598ee195c0b9d975fa264d6ac31c6fa108c0535c91800ecf4fcabfd308e53074cc adjust-cache-deflate-buffer.patch"