recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Build recipe for mesa.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. # Copyright (c) 2017-2019 Matias Fonzo <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. program=mesa
  18. version=19.0.8
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/xorg/mesa"
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch=http://mesa.freedesktop.org/archive/$tarname
  25. description="
  26. Mesa is an OpenGL compatible 3-D graphics library.
  27. The Mesa project began as an open-source implementation of the OpenGL
  28. specification - a system for rendering interactive 3D graphics.
  29. "
  30. homepage=http://www.mesa3d.org/
  31. license=MIT
  32. # Source documentation
  33. docs="VERSION"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # To increment compatibility with Musl (Thanks to "Alpine Linux")
  41. patch -p1 < "${worktree}/patches/mesa/adjust-cache-deflate-buffer.patch"
  42. patch -p1 < "${worktree}/patches/mesa/musl-fix-includes.patch"
  43. patch -p1 < "${worktree}/patches/mesa/add-glx-use-tls.patch"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. case $arch in
  47. i?86 | x86_64*)
  48. extra_options="--enable-glx-read-only-text --disable-asm"
  49. ;;
  50. esac
  51. ./configure CPPFLAGS="-D_XOPEN_SOURCE=700" \
  52. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  53. $configure_args --enable-autotools \
  54. --libdir=/usr/lib${libSuffix} \
  55. --infodir=$infodir \
  56. --mandir=$mandir \
  57. --docdir=$docsdir \
  58. --disable-debug \
  59. --disable-llvm \
  60. --disable-gallium-llvm \
  61. --disable-gles1 \
  62. --enable-gles2 \
  63. --disable-glx-tls \
  64. --enable-glx="dri" \
  65. --enable-gbm \
  66. --enable-shared-glapi \
  67. --enable-gallium-extra-hud \
  68. --enable-dri \
  69. --enable-dri3 \
  70. --enable-gallium-osmesa \
  71. --enable-xa \
  72. --enable-nine \
  73. --enable-lmsensors \
  74. --with-gallium-drivers="i915,nouveau,r600,svga,swrast" \
  75. --with-platforms="drm,x11" \
  76. --with-dri-driverdir=/usr/lib${libSuffix}/xorg/modules/dri \
  77. --build="$(cc -dumpmachine)" \
  78. $extra_options
  79. unset extra_options
  80. make -j${jobs} V=1
  81. make -j${jobs} DESTDIR="$destdir" install-strip
  82. # Handle .new files via graft(1), if any
  83. if test -d "${destdir}/etc"
  84. then
  85. touch "${destdir}/etc/.graft-config"
  86. fi
  87. # Compress info documents deleting index file for the package
  88. if test -d "${destdir}/$infodir"
  89. then
  90. rm -f "${destdir}/${infodir}/dir"
  91. lzip -9 "${destdir}/${infodir}"/*
  92. fi
  93. # Compress and link man pages (if needed)
  94. if test -d "${destdir}/$mandir"
  95. then
  96. (
  97. cd "${destdir}/$mandir"
  98. find . -type f -exec lzip -9 '{}' +
  99. find . -type l | while read -r file
  100. do
  101. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  102. rm -- "$file"
  103. done
  104. )
  105. fi
  106. # Copy documentation
  107. mkdir -p "${destdir}${docsdir}"
  108. cp -p $docs "${destdir}${docsdir}"/
  109. }