1 # Description: Mesa 3D Graphics Library
2 # URL: https://www.mesa3d.org/
3 # Maintainer: CRUX Xorg Team, xorg-ports at crux dot nu
4 # Depends on: elfutils glslang libdrm libglvnd llvm python3-mako xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm
5 # Optional: libva libvdpau wayland-protocols
6
7 name=mesa
8 version=22.2.5
9 release=1
10 source=(https://archive.mesa3d.org/$name-$version.tar.xz)
11
12 build() {
13 prt-get isinst vulkan-loader && PKGMK_MESA_GALLIUM+='zink,'
14 prt-get isinst libvdpau && PKGMK_MESA+=' -D gallium-vdpau=enabled' || PKGMK_MESA+=' -D gallium-vdpau=disabled'
15 prt-get isinst wayland-protocols && PKGMK_MESA_PLATFORMS+='wayland'
16 ## for future references
17 #prt-get isinst xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm && PKGMK_MESA_PLATFORMS+=',x11'
18 PKGMK_MESA_PLATFORMS+=',x11'
19
20 CFLAGS+=' -mtls-dialect=gnu'
21 CXXFLAGS+=' -mtls-dialect=gnu'
22
23 meson setup build mesa-$version $PKGMK_MESA \
24 --prefix=/usr \
25 --sysconfdir=/etc \
26 --buildtype=plain \
27 --wrap-mode nodownload \
28 -D b_pie=true \
29 -D dri3=enabled \
30 -D egl=enabled \
31 -D llvm=enabled \
32 -D shared-llvm=enabled \
33 -D gbm=enabled \
34 -D gles1=disabled \
35 -D gles2=enabled \
36 -D glx=dri \
37 -D osmesa=true \
38 -D gallium-xa=enabled \
39 -D gallium-drivers=${PKGMK_MESA_GALLIUM}crocus,iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl \
40 -D platforms=${PKGMK_MESA_PLATFORMS#,} \
41 -D shared-glapi=enabled \
42 -D vulkan-drivers=amd,intel \
43 -D vulkan-layers=device-select,intel-nullhw,overlay \
44 -D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
45 -D glvnd=true
46
47 meson compile -C build -j ${JOBS:-1}
48 DESTDIR=$PKG meson install -C build
49
50 # indirect rendering symlink
51 ln -s libGLX_mesa.so.0 $PKG/usr/lib/libGLX_indirect.so.0
52 }
|