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 # Set sane permissions
53 chmod -R u+w,go-w,a+rX-s .
55 ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
57 --libdir=/usr/lib${libSuffix} \
63 --disable-gallium-llvm \
64 --enable-texture-float \
68 --enable-shared-glapi \
71 --enable-gallium-extra-hud \
75 --enable-gallium-osmesa \
79 --with-gallium-drivers="i915,nouveau,r600,swrast" \
80 --with-platforms="drm,x11" \
81 --with-dri-driverdir=/usr/lib${libSuffix}/xorg/modules/dri \
82 --build="$(cc -dumpmachine)"
85 make -j${jobs} DESTDIR="$destdir" install-strip
87 # Handle .new files via graft(1), if any
88 if test -d "${destdir}/etc"
90 touch "${destdir}/etc/.graft-config"
93 # Compress info documents deleting index file for the package
94 if test -d "${destdir}/$infodir"
96 rm -f "${destdir}/${infodir}/dir"
97 lzip -9 "${destdir}/${infodir}"/*
100 # Compress and link man pages (if needed)
101 if test -d "${destdir}/$mandir"
104 cd "${destdir}/$mandir"
105 find . -type f -exec lzip -9 '{}' +
106 find . -type l | while read -r file
108 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
115 mkdir -p "${destdir}${docsdir}"
116 cp -p $docs "${destdir}${docsdir}"/