Clone of mesa.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

debian-install.sh 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. #!/bin/bash
  2. set -e
  3. set -o xtrace
  4. export DEBIAN_FRONTEND=noninteractive
  5. CROSS_ARCHITECTURES="i386"
  6. for arch in $CROSS_ARCHITECTURES; do
  7. dpkg --add-architecture $arch
  8. done
  9. apt-get install -y \
  10. ca-certificates \
  11. wget \
  12. unzip
  13. sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
  14. echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
  15. apt-get update
  16. # Use newer packages from backports by default
  17. cat >/etc/apt/preferences <<EOF
  18. Package: *
  19. Pin: release a=buster-backports
  20. Pin-Priority: 500
  21. EOF
  22. apt-get dist-upgrade -y
  23. apt-get install -y --no-remove \
  24. llvm-6.0-dev \
  25. libclang-6.0-dev \
  26. llvm-7-dev \
  27. libclang-7-dev \
  28. llvm-8-dev \
  29. libclang-8-dev \
  30. g++ \
  31. clang-8 \
  32. git \
  33. bzip2 \
  34. zlib1g-dev \
  35. pkg-config \
  36. libxrender-dev \
  37. libxdamage-dev \
  38. libxxf86vm-dev \
  39. gcc \
  40. git \
  41. libepoxy-dev \
  42. libegl1-mesa-dev \
  43. libgbm-dev \
  44. libclc-dev \
  45. libxvmc-dev \
  46. libomxil-bellagio-dev \
  47. xz-utils \
  48. libexpat1-dev \
  49. libx11-xcb-dev \
  50. libelf-dev \
  51. libunwind-dev \
  52. libglvnd-dev \
  53. libgtk-3-dev \
  54. libpng-dev \
  55. libgbm-dev \
  56. libgles2-mesa-dev \
  57. libvulkan-dev \
  58. python-mako \
  59. python3-mako \
  60. bison \
  61. flex \
  62. gettext \
  63. cmake \
  64. meson \
  65. scons
  66. # Cross-build Mesa deps
  67. for arch in $CROSS_ARCHITECTURES; do
  68. apt-get install -y --no-remove \
  69. libdrm-dev:${arch} \
  70. libexpat1-dev:${arch} \
  71. libelf-dev:${arch} \
  72. crossbuild-essential-${arch}
  73. done
  74. # for 64bit windows cross-builds
  75. apt-get install -y --no-remove \
  76. mingw-w64 \
  77. libz-mingw-w64-dev \
  78. wine \
  79. wine32 \
  80. wine64
  81. # Debian's pkg-config wrapers for mingw are broken, and there's no sign that
  82. # they're going to be fixed, so we'll just have to fix it ourselves
  83. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
  84. cat >/usr/local/bin/x86_64-w64-mingw32-pkg-config <<EOF
  85. #!/bin/sh
  86. PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig pkg-config \$@
  87. EOF
  88. chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config
  89. # for the vulkan overlay layer
  90. wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
  91. unzip glslang-master-linux-Release.zip bin/glslangValidator
  92. install -m755 bin/glslangValidator /usr/local/bin/
  93. rm bin/glslangValidator glslang-master-linux-Release.zip
  94. # dependencies where we want a specific version
  95. export XORG_RELEASES=https://xorg.freedesktop.org/releases/individual
  96. export XCB_RELEASES=https://xcb.freedesktop.org/dist
  97. export WAYLAND_RELEASES=https://wayland.freedesktop.org/releases
  98. export XORGMACROS_VERSION=util-macros-1.19.0
  99. export GLPROTO_VERSION=glproto-1.4.17
  100. export DRI2PROTO_VERSION=dri2proto-2.8
  101. export LIBPCIACCESS_VERSION=libpciaccess-0.13.4
  102. export LIBDRM_VERSION=libdrm-2.4.99
  103. export XCBPROTO_VERSION=xcb-proto-1.13
  104. export RANDRPROTO_VERSION=randrproto-1.5.0
  105. export LIBXRANDR_VERSION=libXrandr-1.5.0
  106. export LIBXCB_VERSION=libxcb-1.13
  107. export LIBXSHMFENCE_VERSION=libxshmfence-1.3
  108. export LIBVDPAU_VERSION=libvdpau-1.1
  109. export LIBVA_VERSION=libva-1.7.0
  110. export LIBWAYLAND_VERSION=wayland-1.15.0
  111. export WAYLAND_PROTOCOLS_VERSION=wayland-protocols-1.12
  112. wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
  113. tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
  114. cd $XORGMACROS_VERSION; ./configure; make install; cd ..
  115. rm -rf $XORGMACROS_VERSION
  116. wget $XORG_RELEASES/proto/$GLPROTO_VERSION.tar.bz2
  117. tar -xvf $GLPROTO_VERSION.tar.bz2 && rm $GLPROTO_VERSION.tar.bz2
  118. cd $GLPROTO_VERSION; ./configure; make install; cd ..
  119. rm -rf $GLPROTO_VERSION
  120. wget $XORG_RELEASES/proto/$DRI2PROTO_VERSION.tar.bz2
  121. tar -xvf $DRI2PROTO_VERSION.tar.bz2 && rm $DRI2PROTO_VERSION.tar.bz2
  122. cd $DRI2PROTO_VERSION; ./configure; make install; cd ..
  123. rm -rf $DRI2PROTO_VERSION
  124. wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2
  125. tar -xvf $XCBPROTO_VERSION.tar.bz2 && rm $XCBPROTO_VERSION.tar.bz2
  126. cd $XCBPROTO_VERSION; ./configure; make install; cd ..
  127. rm -rf $XCBPROTO_VERSION
  128. wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2
  129. tar -xvf $LIBXCB_VERSION.tar.bz2 && rm $LIBXCB_VERSION.tar.bz2
  130. cd $LIBXCB_VERSION; ./configure; make install; cd ..
  131. rm -rf $LIBXCB_VERSION
  132. wget $XORG_RELEASES/lib/$LIBPCIACCESS_VERSION.tar.bz2
  133. tar -xvf $LIBPCIACCESS_VERSION.tar.bz2 && rm $LIBPCIACCESS_VERSION.tar.bz2
  134. cd $LIBPCIACCESS_VERSION; ./configure; make install; cd ..
  135. rm -rf $LIBPCIACCESS_VERSION
  136. wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
  137. tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
  138. cd $LIBDRM_VERSION; ./configure --enable-vc4 --enable-freedreno --enable-etnaviv-experimental-api; make install; cd ..
  139. rm -rf $LIBDRM_VERSION
  140. wget $XORG_RELEASES/proto/$RANDRPROTO_VERSION.tar.bz2
  141. tar -xvf $RANDRPROTO_VERSION.tar.bz2 && rm $RANDRPROTO_VERSION.tar.bz2
  142. cd $RANDRPROTO_VERSION; ./configure; make install; cd ..
  143. rm -rf $RANDRPROTO_VERSION
  144. wget $XORG_RELEASES/lib/$LIBXRANDR_VERSION.tar.bz2
  145. tar -xvf $LIBXRANDR_VERSION.tar.bz2 && rm $LIBXRANDR_VERSION.tar.bz2
  146. cd $LIBXRANDR_VERSION; ./configure; make install; cd ..
  147. rm -rf $LIBXRANDR_VERSION
  148. wget $XORG_RELEASES/lib/$LIBXSHMFENCE_VERSION.tar.bz2
  149. tar -xvf $LIBXSHMFENCE_VERSION.tar.bz2 && rm $LIBXSHMFENCE_VERSION.tar.bz2
  150. cd $LIBXSHMFENCE_VERSION; ./configure; make install; cd ..
  151. rm -rf $LIBXSHMFENCE_VERSION
  152. wget https://people.freedesktop.org/~aplattner/vdpau/$LIBVDPAU_VERSION.tar.bz2
  153. tar -xvf $LIBVDPAU_VERSION.tar.bz2 && rm $LIBVDPAU_VERSION.tar.bz2
  154. cd $LIBVDPAU_VERSION; ./configure; make install; cd ..
  155. rm -rf $LIBVDPAU_VERSION
  156. wget https://www.freedesktop.org/software/vaapi/releases/libva/$LIBVA_VERSION.tar.bz2
  157. tar -xvf $LIBVA_VERSION.tar.bz2 && rm $LIBVA_VERSION.tar.bz2
  158. cd $LIBVA_VERSION; ./configure --disable-wayland --disable-dummy-driver; make install; cd ..
  159. rm -rf $LIBVA_VERSION
  160. wget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz
  161. tar -xvf $LIBWAYLAND_VERSION.tar.xz && rm $LIBWAYLAND_VERSION.tar.xz
  162. cd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make install; cd ..
  163. rm -rf $LIBWAYLAND_VERSION
  164. wget $WAYLAND_RELEASES/$WAYLAND_PROTOCOLS_VERSION.tar.xz
  165. tar -xvf $WAYLAND_PROTOCOLS_VERSION.tar.xz && rm $WAYLAND_PROTOCOLS_VERSION.tar.xz
  166. cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make install; cd ..
  167. rm -rf $WAYLAND_PROTOCOLS_VERSION
  168. pushd /usr/local
  169. git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
  170. rm -rf shader-db/.git
  171. cd shader-db
  172. make
  173. popd
  174. # Use ccache to speed up builds
  175. apt-get install -y --no-remove ccache
  176. # We need xmllint to validate the XML files in Mesa
  177. apt-get install -y --no-remove libxml2-utils
  178. # Generate cross build files for Meson
  179. for arch in $CROSS_ARCHITECTURES; do
  180. cross_file="/cross_file-$arch.txt"
  181. /usr/share/meson/debcrossgen --arch "$arch" -o "$cross_file"
  182. # Explicitly set ccache path for cross compilers
  183. sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
  184. if [ "$arch" = "i386" ]; then
  185. # Work around a bug in debcrossgen that should be fixed in the next release
  186. sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
  187. # Don't need wrapper for i386 executables
  188. sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
  189. fi
  190. done
  191. ############### Build dEQP
  192. git config --global user.email "mesa@example.com"
  193. git config --global user.name "Mesa CI"
  194. # XXX: Use --depth 1 once we can drop the cherry-picks.
  195. git clone \
  196. https://github.com/KhronosGroup/VK-GL-CTS.git \
  197. -b opengl-es-cts-3.2.5.1 \
  198. /VK-GL-CTS
  199. cd /VK-GL-CTS
  200. # Fix surfaceless build
  201. git cherry-pick -x 22f41e5e321c6dcd8569c4dad91bce89f06b3670
  202. git cherry-pick -x 1daa8dff73161ea60ead965bd6c9f2a0a2165648
  203. # surfaceless links against libkms and such despite not using it.
  204. sed -i '/gbm/d' targets/surfaceless/surfaceless.cmake
  205. sed -i '/libkms/d' targets/surfaceless/surfaceless.cmake
  206. sed -i '/libgbm/d' targets/surfaceless/surfaceless.cmake
  207. python3 external/fetch_sources.py
  208. mkdir -p /deqp
  209. cd /deqp
  210. cmake -G Ninja \
  211. -DDEQP_TARGET=surfaceless \
  212. -DCMAKE_BUILD_TYPE=Release \
  213. /VK-GL-CTS
  214. ninja
  215. # Copy out the mustpass lists we want from a bunch of other junk.
  216. mkdir /deqp/mustpass
  217. for gles in gles2 gles3 gles31; do
  218. cp \
  219. /deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.5.x/$gles-master.txt \
  220. /deqp/mustpass/$gles-master.txt
  221. done
  222. # Remove the rest of the build products that we don't need.
  223. rm -rf /deqp/external
  224. rm -rf /deqp/modules/internal
  225. rm -rf /deqp/executor
  226. rm -rf /deqp/execserver
  227. rm -rf /deqp/modules/egl
  228. rm -rf /deqp/framework
  229. du -sh *
  230. rm -rf /VK-GL-CTS
  231. ############### Uninstall the build software
  232. apt-get purge -y \
  233. wget \
  234. unzip \
  235. cmake \
  236. git \
  237. libgles2-mesa-dev \
  238. libgbm-dev
  239. apt-get autoremove -y --purge