recipes: xorg/mesa: upgraded to version 18.3.2
[dragora.git] / recipes / xorg / mesa / recipe
blob924c76a19d46b1f5504ae3112262195e494abdcb
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.
18 program=mesa
19 version=18.3.2
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/xorg/mesa"
25 tarname=${program}-${version}.tar.gz
27 # Remote source(s)
28 fetch=http://mesa.freedesktop.org/archive/$tarname
30 description="
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/
38 license=MIT
40 # Source documentation
41 docs="VERSION"
42 docsdir="${docdir}/${program}-${version}"
44 build()
46     set -e
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
52     # Set sane permissions
53     chmod -R u+w,go-w,a+rX-s .
55     ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
56      $configure_args \
57      --libdir=/usr/lib${libSuffix} \
58      --infodir=$infodir \
59      --mandir=$mandir \
60      --docdir=$docsdir \
61      --disable-debug \
62      --disable-llvm \
63      --disable-gallium-llvm \
64      --enable-texture-float \
65      --enable-gles1 \
66      --enable-gles2 \
67      --enable-gbm \
68      --enable-shared-glapi \
69      --enable-glx="dri" \
70      --enable-glx-tls \
71      --enable-gallium-extra-hud \
72      --enable-dri \
73      --enable-dri3 \
74      --enable-nine \
75      --enable-gallium-osmesa \
76      --enable-xa \
77      --enable-xlib-lease \
78      --enable-lmsensors \
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)"
84     make -j${jobs} V=1
85     make -j${jobs} DESTDIR="$destdir" install-strip
87     # Handle .new files via graft(1), if any
88     if test -d "${destdir}/etc"
89     then
90         touch "${destdir}/etc/.graft-config"
91     fi
93     # Compress info documents deleting index file for the package
94     if test -d "${destdir}/$infodir"
95     then
96         rm -f "${destdir}/${infodir}/dir"
97         lzip -9 "${destdir}/${infodir}"/*
98     fi
100     # Compress and link man pages (if needed)
101     if test -d "${destdir}/$mandir"
102     then
103         (
104             cd "${destdir}/$mandir"
105             find . -type f -exec lzip -9 '{}' +
106             find . -type l | while read -r file
107             do
108                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
109                 rm -- "$file"
110             done
111         )
112     fi
114     # Copy documentation
115     mkdir -p "${destdir}${docsdir}"
116     cp -p $docs "${destdir}${docsdir}"/