reicpes: Upgrade of libdrm, libva, and mesa
[dragora.git] / recipes / xorg / mesa-gallium-xa / recipe
blobd099d0e506f4ab0a47b5c94e8d08680af41eb874
1 # Build recipe for mesa-gallium-xa (mesa with XA support).
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2021 Matias Fonzo <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=mesa
22 version=21.2.5
23 release=1
25 # Re-define package name
26 pkgname=mesa-gallium-xa
28 # Define a category for the output of the package name
29 pkgcategory=xorg_mesa
31 tarname=${program}-${version}.tar.xz
33 # Remote source(s)
34 fetch=https://archive.mesa3d.org/$tarname
36 description="
37 A Mesa build with XA support.
39 This is mainly required for VMware supported architectures,
40 for example, for the \"xf86-video-vmware\" package, but it
41 also comes with the XA support.
44 homepage=https://www.mesa3d.org/
45 license=MIT
47 build()
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # To increment compatibility with Musl (Thanks to "Alpine Linux")
54     patch -p1 < "${worktree}/patches/mesa/musl-fix-includes.patch"
55     patch -p1 < "${worktree}/patches/mesa/add-use-elf-tls.patch"
57     # To provide a few xdemos (Thanks to BLFS!)
58     patch -p1 < "${worktree}/patches/mesa/mesa-21.2.4-add_xdemos-1.patch"
60     MESA_GIT_SHA1_OVERRIDE='53b2b224dc2de982c37915a0ad218e33365ff75e'
61     export MESA_GIT_SHA1_OVERRIDE
62     python3 bin/git_sha1_gen.py --output include/git_sha1.h
64     # Set sane permissions
65     chmod -R u+w,go-w,a+rX-s .
67     case $arch in
68     amd64 | x32 | i?86 )
69         _extra_options="-Dglx-read-only-text=true"
70         ;;
71     esac
73     rm -rf BUILD
74     mkdir BUILD
75     cd BUILD
77     CPPFLAGS="$QICPPFLAGS -D_XOPEN_SOURCE=700" \
78     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
79     meson setup $configure_args \
80      --libdir /usr/lib${libSuffix} \
81      --buildtype=release \
82      --strip \
83      -Dplatforms="" \
84      -Ddri-drivers="" \
85      -Dgallium-drivers="svga" \
86      -Dvulkan-drivers="" \
87      -Dglx=disabled \
88      -Degl=disabled \
89      -Dosmesa=false \
90      -Dgallium-xvmc=disabled \
91      -Dgallium-va=disabled \
92      -Dgallium-vdpau=disabled \
93      -Dgles1=disabled \
94      -Dgles2=disabled \
95      -Dopengl=false \
96      -Dgallium-nine=false \
97      -Dvalgrind=disabled \
98      -Dgallium-xa=enabled \
99      $_extra_options \
100      ..
102     ninja -j${jobs}
103     DESTDIR="$destdir" ninja -j${jobs} install
105     unset -v MESA_GIT_SHA1_OVERRIDE _extra_options
107     cd ../
109     # Do not include config directory (provided by 'mesa')
110     rm -rf "${destdir}/usr/share/drirc.d"
112     # Compress and link man pages (if needed)
113     if test -d "${destdir}/$mandir"
114     then
115         (
116             cd "${destdir}/$mandir"
117             find . -type f -exec lzip -9 {} +
118             find . -type l | while read -r file
119             do
120                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
121                 rm -- "$file"
122             done
123         )
124     fi