1 # Build recipe for mesa.
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2019 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.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/xorg/mesa"
25 tarname=${program}-${version}.tar.gz
28 fetch=http://mesa.freedesktop.org/archive/$tarname
31 Mesa is an OpenGL compatible 3-D graphics library.
33 The Mesa project began as an open-source implementation of the OpenGL
34 specification - a system for rendering interactive 3D graphics.
37 homepage=http://www.mesa3d.org/
40 # Source documentation
42 docsdir="${docdir}/${program}-${version}"
48 unpack "${tardir}/$tarname"
52 # To increment compatibility with Musl (Thanks to "Alpine Linux")
53 patch -p1 < "${worktree}/patches/mesa/adjust-cache-deflate-buffer.patch"
54 patch -p1 < "${worktree}/patches/mesa/musl-fix-includes.patch"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 ./configure CPPFLAGS="-D_XOPEN_SOURCE=700" \
60 CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
61 $configure_args --enable-autotools \
62 --libdir=/usr/lib${libSuffix} \
68 --disable-gallium-llvm \
72 --enable-texture-float \
76 --enable-shared-glapi \
77 --enable-gallium-extra-hud \
80 --enable-gallium-osmesa \
85 --with-gallium-drivers="i915,nouveau,r600,swrast" \
86 --with-platforms="drm,x11" \
87 --with-dri-driverdir=/usr/lib${libSuffix}/xorg/modules/dri \
88 --build="$(cc -dumpmachine)"
91 make -j${jobs} DESTDIR="$destdir" install-strip
93 # Handle .new files via graft(1), if any
94 if test -d "${destdir}/etc"
96 touch "${destdir}/etc/.graft-config"
99 # Compress info documents deleting index file for the package
100 if test -d "${destdir}/$infodir"
102 rm -f "${destdir}/${infodir}/dir"
103 lzip -9 "${destdir}/${infodir}"/*
106 # Compress and link man pages (if needed)
107 if test -d "${destdir}/$mandir"
110 cd "${destdir}/$mandir"
111 find . -type f -exec lzip -9 '{}' +
112 find . -type l | while read -r file
114 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
121 mkdir -p "${destdir}${docsdir}"
122 cp -p $docs "${destdir}${docsdir}"/