recipe 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Build recipe for mesa.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. # Copyright (c) 2017-2021 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. # Exit immediately on any error
  18. set -e
  19. program=mesa
  20. version=20.3.2
  21. release=2
  22. # Define a category for the output of the package name
  23. pkgcategory=xorg_mesa
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch=https://archive.mesa3d.org/$tarname
  27. description="
  28. Mesa is an OpenGL compatible 3-D graphics library.
  29. The Mesa project began as an open-source implementation of the OpenGL
  30. specification - a system for rendering interactive 3D graphics.
  31. "
  32. homepage=https://www.mesa3d.org/
  33. license=MIT
  34. # Source documentation
  35. docs="VERSION"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # To increment compatibility with Musl (Thanks to "Alpine Linux")
  42. patch -p1 < "${worktree}/patches/mesa/adjust-cache-deflate-buffer.patch"
  43. patch -p1 < "${worktree}/patches/mesa/musl-fix-includes.patch"
  44. # To provide a few xdemos (Thanks to BLFS!)
  45. patch -p1 < "${worktree}/patches/mesa/mesa-20.3.2-add_xdemos-1.patch"
  46. MESA_GIT_SHA1_OVERRIDE='53b2b224dc2de982c37915a0ad218e33365ff75e'
  47. export MESA_GIT_SHA1_OVERRIDE
  48. python3 bin/git_sha1_gen.py --output include/git_sha1.h
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. mkdir BUILD
  52. cd BUILD
  53. CPPFLAGS="$QICPPFLAGS -D_XOPEN_SOURCE=700" \
  54. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  55. meson setup $configure_args \
  56. --libdir /usr/lib${libSuffix} \
  57. --buildtype=release \
  58. --strip \
  59. -Dplatforms=x11 \
  60. -Ddri-drivers="i915,i965,r100,r200,nouveau" \
  61. -Dgallium-drivers="nouveau,r300,r600,svga,radeonsi,swrast,virgl,iris,virgl" \
  62. -Dglx=dri \
  63. -Dosmesa=gallium \
  64. -Dllvm=true \
  65. -Dshared-llvm=enabled \
  66. -Dgallium-xvmc=enabled \
  67. -Dgallium-va=enabled \
  68. -Dgallium-xa=enabled \
  69. -Dgallium-vdpau=enabled \
  70. -Dgles1=enabled \
  71. -Dgles2=enabled \
  72. -Dopengl=true \
  73. -Dlmsensors=true \
  74. -Dgallium-nine=false \
  75. -Dvalgrind=false \
  76. -Dlibunwind=false \
  77. -Dzstd=false \
  78. ..
  79. ninja -j${jobs}
  80. DESTDIR="$destdir" ninja -j${jobs} install
  81. unset -v MESA_GIT_SHA1_OVERRIDE
  82. cd ../
  83. # Handle .new files via graft(1), if any
  84. if test -d "${destdir}/etc"
  85. then
  86. touch "${destdir}/etc/.graft-config"
  87. fi
  88. # Compress info documents deleting index file for the package
  89. if test -d "${destdir}/$infodir"
  90. then
  91. rm -f "${destdir}/${infodir}/dir"
  92. lzip -9 "${destdir}/${infodir}"/*
  93. fi
  94. # Compress and link man pages (if needed)
  95. if test -d "${destdir}/$mandir"
  96. then
  97. (
  98. cd "${destdir}/$mandir"
  99. find . -type f -exec lzip -9 {} +
  100. find . -type l | while read -r file
  101. do
  102. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  103. rm -- "$file"
  104. done
  105. )
  106. fi
  107. ## # Copy documentation
  108. ## mkdir -p "${destdir}${docsdir}"
  109. ## cp -p $docs "${destdir}${docsdir}"/
  110. }