recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Build recipe for mesa-gallium-xa (mesa with XA support).
  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=21.2.5
  21. release=1
  22. # Re-define package name
  23. pkgname=mesa-gallium-xa
  24. # Define a category for the output of the package name
  25. pkgcategory=xorg_mesa
  26. tarname=${program}-${version}.tar.xz
  27. # Remote source(s)
  28. fetch=https://archive.mesa3d.org/$tarname
  29. description="
  30. A Mesa build with XA support.
  31. This is mainly required for VMware supported architectures,
  32. for example, for the \"xf86-video-vmware\" package, but it
  33. also comes with the XA support.
  34. "
  35. homepage=https://www.mesa3d.org/
  36. license=MIT
  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/musl-fix-includes.patch"
  43. patch -p1 < "${worktree}/patches/mesa/add-use-elf-tls.patch"
  44. # To provide a few xdemos (Thanks to BLFS!)
  45. patch -p1 < "${worktree}/patches/mesa/mesa-21.2.4-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. case $arch in
  52. amd64 | x32 | i?86 )
  53. _extra_options="-Dglx-read-only-text=true"
  54. ;;
  55. esac
  56. rm -rf BUILD
  57. mkdir BUILD
  58. cd BUILD
  59. CPPFLAGS="$QICPPFLAGS -D_XOPEN_SOURCE=700" \
  60. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  61. meson setup $configure_args \
  62. --libdir /usr/lib${libSuffix} \
  63. --buildtype=release \
  64. --strip \
  65. -Dplatforms="" \
  66. -Ddri-drivers="" \
  67. -Dgallium-drivers="svga" \
  68. -Dvulkan-drivers="" \
  69. -Dglx=disabled \
  70. -Degl=disabled \
  71. -Dosmesa=false \
  72. -Dgallium-xvmc=disabled \
  73. -Dgallium-va=disabled \
  74. -Dgallium-vdpau=disabled \
  75. -Dgles1=disabled \
  76. -Dgles2=disabled \
  77. -Dopengl=false \
  78. -Dgallium-nine=false \
  79. -Dvalgrind=disabled \
  80. -Dgallium-xa=enabled \
  81. $_extra_options \
  82. ..
  83. ninja -j${jobs}
  84. DESTDIR="$destdir" ninja -j${jobs} install
  85. unset -v MESA_GIT_SHA1_OVERRIDE _extra_options
  86. cd ../
  87. # Do not include config directory (provided by 'mesa')
  88. rm -rf "${destdir}/usr/share/drirc.d"
  89. # Compress and link man pages (if needed)
  90. if test -d "${destdir}/$mandir"
  91. then
  92. (
  93. cd "${destdir}/$mandir"
  94. find . -type f -exec lzip -9 {} +
  95. find . -type l | while read -r file
  96. do
  97. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  98. rm -- "$file"
  99. done
  100. )
  101. fi
  102. }