Advertisement
ukbeast

Untitled

Jun 3rd, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.58 KB | None | 0 0
  1. --- home:sndirsch:branches:X11:XOrg.spec
  2. +++ home:X0F:HSF.spec
  3. @@ -17,6 +17,7 @@
  4.  
  5.  
  6. #!BuildIgnore: Mesa-dri
  7. +%define __builder ninja
  8.  
  9. %global flavor @BUILD_FLAVOR@%{nil}
  10. %if "%{flavor}" == "drivers"
  11. @@ -45,15 +46,32 @@
  12. %define _version 23.1.1
  13. %define with_opencl 0
  14. %define with_rusticl 0
  15. +# those maniacs have added rust version of their semi-abandoned OpenCL library, gallium-rusticl
  16. +# so you could have a dependency on crappy llvm fork while also having a dependency on regular llvm
  17. %define with_vulkan 0
  18. %define with_llvm 0
  19.  
  20. +%define use_clang 1
  21. +%define use_lld 1
  22. +%ifarch %ix86 %arm
  23. +%define use_lto 1
  24. +%else
  25. +%define use_lto 1
  26. +%endif
  27. +
  28. +# advanced visualization support, requires perfetto dependency
  29. +%define with_perfetto 0
  30. +
  31. +# required for drivers
  32. +%define have_gallium 1
  33. +
  34. %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64 ppc64le riscv64
  35. %define gallium_loader 1
  36. %else
  37. %define gallium_loader 0
  38. %endif
  39.  
  40. +%define omx_support 0
  41. %define vdpau_nouveau 0
  42. %define vdpau_radeon 0
  43. %define vdpau_virtio_gpu 0
  44. @@ -72,11 +90,11 @@
  45. %define with_opencl 1
  46. %ifarch %{ix86} x86_64
  47. %define with_vulkan 1
  48. - %define vulkan_drivers swrast,amd,intel,intel_hasvk
  49. + %define vulkan_drivers swrast,virtio-experimental,amd,intel,intel_hasvk,imagination-experimental,microsoft-experimental
  50. %endif
  51. %ifarch %{arm} aarch64
  52. %define with_vulkan 1
  53. - %define vulkan_drivers swrast,amd,broadcom,freedreno
  54. + %define vulkan_drivers swrast,virtio-experimental,amd,broadcom,freedreno,panfrost
  55. %endif
  56. %ifarch riscv64
  57. %define with_vulkan 1
  58. @@ -88,16 +106,10 @@
  59. %define with_llvm 1
  60. %endif
  61.  
  62. -%if 0%{with_opencl}
  63. -%define have_gallium 1
  64. -%else
  65. -%define have_gallium 0
  66. -%endif
  67. -
  68. %if "%{flavor}" == "drivers"
  69. %define glamor 0
  70. %if 0%{?suse_version} > 1550 && 0%{with_opencl}
  71. - %define with_rusticl 1
  72. + %define with_rusticl 0
  73. %endif
  74. %else
  75. # No llvm dependencies
  76. @@ -131,7 +143,7 @@
  77. URL: https://www.mesa3d.org
  78. #Git-Clone: git://anongit.freedesktop.org/mesa/mesa
  79. Source: https://mesa.freedesktop.org/archive/%{_name_archive}-%{_version}.tar.xz
  80. -Source1: https://mesa.freedesktop.org/archive/%{_name_archive}-%{_version}.tar.xz.sig
  81. +#Source1: https://mesa.freedesktop.org/archive/%{_name_archive}-%{_version}.tar.xz.sig
  82. Source2: baselibs.conf
  83. Source3: README.updates
  84. Source4: manual-pages.tar.bz2
  85. @@ -141,35 +153,51 @@
  86. # never to be upstreamed
  87. Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch
  88. Patch58: u_dep_xcb.patch
  89. -Patch100: U_fix-mpeg1_2-decode-mesa-20.2.patch
  90. Patch200: u_fix-build-on-ppc64le.patch
  91. -Patch300: n_no-sse2-on-ix86-except-for-intel-drivers.patch
  92. -Patch400: n_stop-iris-flicker.patch
  93. Patch600: U_glx-Remove-pointless-GLX_INTEL_swap_event-paranoia.patch
  94. +
  95. +# this naively parrots Nvidia's numbers; crash is triggered by mpv
  96. +#Patch900: Mesa-crankup_RADV_ComputeWorkGroup.patch
  97. +# no change is observed
  98. +#Patch901: Mesa-crankup_RADV_3Dcompute.patch
  99. +# needs rebasing
  100. +#Patch902: Mesa-crankup_core_limits.patch
  101. +
  102. %ifarch %{ix86} x86_64
  103. -BuildRequires: DirectX-Headers
  104. +BuildRequires: pkgconfig(DirectX-Headers)
  105. +# for libvulkan_microsoft/dzn
  106. +BuildRequires: dxc-libdxcompiler-devel
  107. %endif
  108. BuildRequires: bison
  109. BuildRequires: cmake
  110. BuildRequires: fdupes
  111. BuildRequires: flex
  112. -%if 0%{?sle_version} >= 150400
  113. -BuildRequires: gcc12-c++
  114. -%else
  115. +BuildRequires: glibc-devel
  116. +BuildRequires: ninja
  117. +%if 0%{?use_clang}
  118. +BuildRequires: clang-devel
  119. +#BuildRequires: npth-devel
  120. +%if 0%{?use_lld}
  121. +BuildRequires: lld
  122. +%else
  123. +BuildRequires: binutils-gold
  124. +BuildRequires: llvm-gold
  125. +%endif
  126. +%else
  127. +BuildRequires: binutils-gold
  128. BuildRequires: gcc-c++
  129. %endif
  130. BuildRequires: glslang-devel
  131. BuildRequires: imake
  132. +BuildRequires: libpciaccess-devel
  133. +BuildRequires: libsensors4-devel
  134. BuildRequires: libtool
  135. BuildRequires: memory-constraints
  136. BuildRequires: meson
  137. BuildRequires: pkgconfig
  138. BuildRequires: python3-base
  139. -%if 0%{?suse_version} > 1320
  140. BuildRequires: python3-mako
  141. -%else
  142. -BuildRequires: python3-Mako
  143. -%endif
  144. +BuildRequires: python3-ply
  145. BuildRequires: python3-xml
  146. BuildRequires: pkgconfig(dri2proto)
  147. BuildRequires: pkgconfig(dri3proto)
  148. @@ -180,8 +208,17 @@
  149. BuildRequires: pkgconfig(libdrm_nouveau) >= 2.4.66
  150. BuildRequires: pkgconfig(libdrm_radeon) >= 2.4.71
  151. BuildRequires: pkgconfig(libglvnd) >= 0.1.0
  152. +BuildRequires: pkgconfig(libunwind)
  153. %ifarch aarch64 %{ix86} x86_64 ppc64le s390x
  154. BuildRequires: pkgconfig(valgrind)
  155. +%endif
  156. +%if 0%{omx_support}
  157. +# needs bellagio replaced with tizonia
  158. +#BuildRequires: pkgconfig(libomxil-bellagio)
  159. +BuildRequires: pkgconfig(libtizcore)
  160. +%endif
  161. +%if 0%{with_perfetto}
  162. +BuildRequires: pkgconfig(perfetto)
  163. %endif
  164. BuildRequires: pkgconfig(libva)
  165. BuildRequires: pkgconfig(presentproto)
  166. @@ -191,6 +228,7 @@
  167. BuildRequires: pkgconfig(vulkan)
  168. %endif
  169. %endif
  170. +BuildRequires: pkgconfig(libzstd)
  171. BuildRequires: pkgconfig(x11)
  172. BuildRequires: pkgconfig(x11-xcb)
  173. BuildRequires: pkgconfig(xcb-dri2)
  174. @@ -228,18 +266,16 @@
  175. BuildRequires: pkgconfig(libelf)
  176. %endif
  177. %ifarch x86_64 %{ix86}
  178. -BuildRequires: libelf-devel
  179. BuildRequires: pkgconfig(libdrm_intel) >= 2.4.75
  180. -%else
  181. -%if 0%{with_opencl}
  182. -BuildRequires: libelf-devel
  183. -%endif
  184. +BuildRequires: pkgconfig(libelf)
  185. %endif
  186. # Requirements for wayland bumped up from 17.0
  187. BuildRequires: pkgconfig(wayland-client) >= 1.11
  188. BuildRequires: pkgconfig(wayland-protocols) >= 1.8
  189. BuildRequires: pkgconfig(wayland-server) >= 1.11
  190. -%if 0%{with_llvm}
  191. +
  192. +%if 0%{with_llvm} || 0%{?use_clang}
  193. +BuildRequires: clang-devel
  194. %if 0%{?suse_version} >= 1550
  195. BuildRequires: llvm-devel
  196. %else
  197. @@ -257,6 +293,12 @@
  198. %endif
  199. %endif
  200. %endif
  201. +%endif
  202. +
  203. +%if 0%{?with_vulkan}
  204. +BuildRequires: pkgconfig(LLVMSPIRVLib)
  205. +BuildRequires: pkgconfig(SPIRV-Tools)
  206. +BuildRequires: pkgconfig(vulkan)
  207. %endif
  208.  
  209. %if 0%{with_opencl}
  210. @@ -290,10 +332,9 @@
  211. Requires: Mesa-libGL1 = %{version}
  212. Requires: libglvnd >= 0.1.0
  213.  
  214. -# This dependency on Mesa-dri and Mesa-gallium is here to make sure users that
  215. +# This dependency on Mesa-gallium is here to make sure users that
  216. # do not install recommends on their system still get working Mesa. It is
  217. # ignored in obs when Mesa is installed as build dependency.
  218. -Requires: Mesa-dri = %{version}
  219. %if 0%{have_gallium}
  220. Requires: Mesa-gallium = %{version}
  221. %endif
  222. @@ -336,6 +377,9 @@
  223. Obsoletes: s2tc-devel < %{version}
  224. Provides: libtxc_dxtn-devel = %{version}
  225. Obsoletes: libtxc_dxtn-devel < %{version}
  226. +%if 0%{with_opencl}
  227. +Requires: opencl-headers >= 1.2
  228. +%endif
  229.  
  230. %description devel
  231. Mesa is a 3-D graphics library with an API which is very similar to
  232. @@ -362,12 +406,11 @@
  233. This package contains the EGL native platform graphics interface
  234. library. EGL provides a platform-agnostic mechanism for creating
  235. rendering surfaces for use with other graphics libraries, such as
  236. -OpenGL|ES and OpenVG.
  237. +OpenGL|ES.
  238.  
  239. This package contains modules to interface with the existing system
  240. GLX or DRI2 drivers to provide OpenGL via EGL. The Mesa main package
  241. -provides drivers to provide hardware-accelerated OpenGL|ES and OpenVG
  242. -support.
  243. +provides drivers to provide hardware-accelerated OpenGL|ES support.
  244.  
  245. %package libEGL-devel
  246. Summary: Development files for the EGL API
  247. @@ -383,7 +426,7 @@
  248. compiling programs against EGL native platform graphics interface
  249. library. EGL provides a platform-agnostic mechanism for creating
  250. rendering surfaces for use with other graphics libraries, such as
  251. -OpenGL|ES and OpenVG.
  252. +OpenGL|ES.
  253.  
  254. This package provides the development environment for compiling
  255. programs against the EGL library.
  256. @@ -521,15 +564,6 @@
  257. dispatching all the gl* functions. It is intended to be mainly used by
  258. the Mesa-libGLES* packages.
  259.  
  260. -%package -n Mesa-dri
  261. -Summary: DRI plug-ins for 3D acceleration
  262. -Group: System/Libraries
  263. -Requires: Mesa = %{version}
  264. -Supplements: Mesa
  265. -
  266. -%description -n Mesa-dri
  267. -This package contains Mesa DRI drivers for 3D acceleration.
  268. -
  269. %package dri-devel
  270. Summary: Development files for the DRI API
  271. Group: Development/Libraries/C and C++
  272. @@ -539,30 +573,12 @@
  273. This package contains the development environment required for
  274. compiling programs and libraries using the DRI API.
  275.  
  276. -%package -n Mesa-dri-nouveau
  277. -Summary: Mesa DRI plug-in for 3D acceleration via Nouveau
  278. -Group: System/Libraries
  279. -Requires: Mesa = %{version}
  280. -
  281. -%description -n Mesa-dri-nouveau
  282. -This package contains nouveau_dri.so, which is necessary for
  283. -Nouveau's 3D acceleration to work. It is packaged separately
  284. -since it is still experimental.
  285. -
  286. -%package -n Mesa-dri-vc4
  287. -Summary: Mesa DRI plug-in for 3D acceleration on Raspberry Pi
  288. -Group: System/Libraries
  289. -Requires: Mesa = %{version}
  290. -
  291. -%description -n Mesa-dri-vc4
  292. -This package contains vc4_dri.so, which is necessary for 3D
  293. -acceleration on the Raspberry Pi to work. It is packaged separately
  294. -since it is still experimental.
  295. -
  296. %package -n Mesa-gallium
  297. Summary: Mesa Gallium GPU drivers
  298. Group: System/Libraries
  299. Requires: Mesa = %{version}
  300. +Provides: Mesa-dri = %{version}
  301. +Obsoletes: Mesa-dri < %{version}
  302. Supplements: Mesa
  303.  
  304. %description -n Mesa-gallium
  305. @@ -626,14 +642,6 @@
  306. %description -n libvdpau_nouveau
  307. This package contains the VDPAU state tracker for Nouveau.
  308.  
  309. -%package -n libvdpau_r300
  310. -Summary: VDPAU state tracker for R300
  311. -Group: System/Libraries
  312. -Supplements: modalias(pci:v00001002d*sv*sd*bc03sc*i*)
  313. -
  314. -%description -n libvdpau_r300
  315. -This package contains the VDPAU state tracker for R300.
  316. -
  317. %package -n libvdpau_r600
  318. Summary: VDPAU state tracker for R600
  319. Group: System/Libraries
  320. @@ -650,6 +658,16 @@
  321. %description -n libvdpau_radeonsi
  322. This package contains the VDPAU state tracker for radeonsi.
  323.  
  324. +%package -n libvdpau_d3d12
  325. +Summary: VDPAU state tracker for d3d12
  326. +Group: System/Libraries
  327. +Supplements: qemu-x86
  328. +Supplements: wine
  329. +Supplements: wine:staging
  330. +
  331. +%description -n libvdpau_d3d12
  332. +This package contains the VDPAU state tracker for radeonsi.
  333. +
  334. %package -n libvdpau_virtio_gpu
  335. Summary: VDPAU state tracker for VirtIO GPU
  336. Group: System/Libraries
  337. @@ -657,6 +675,20 @@
  338. %description -n libvdpau_virtio_gpu
  339. This package contains the VDPAU state tracker for VirtIO GPU.
  340.  
  341. +%if 0%{omx_support}
  342. +%package -n libomx_mesa
  343. +Summary: Omx state tracker
  344. +Group: System/Libraries
  345. +Provides: libomx_nouveau
  346. +Provides: libomx_r600
  347. +Provides: libomx_radeonsi
  348. +Supplements: xf86-video-ati
  349. +#Requires: libomxil-bellagio
  350. +
  351. +%description -n libomx_mesa
  352. +This package contains the oxm state tracker
  353. +%endif
  354. +
  355. %package -n Mesa-libOpenCL
  356. Summary: Mesa OpenCL implementation (Clover)
  357. Group: System/Libraries
  358. @@ -665,6 +697,9 @@
  359. %else
  360. Requires: libclc
  361. %endif
  362. +# for CLover kernel compilation that can be tuned at runtime with CLOVER_EXTRA_COMPILE_OPTIONS CLOVER_EXTRA_LINK_OPTIONS
  363. +#Requires: clang
  364. +#Requires: lld
  365.  
  366. %description -n Mesa-libOpenCL
  367. This package contains the Mesa OpenCL implementation or GalliumCompute.
  368. @@ -694,34 +729,73 @@
  369. Group: System/Libraries
  370. Supplements: modalias(pci:v00008086d*sv*sd*bc03sc*i*)
  371. Requires: Mesa-vulkan-device-select
  372. +Recommends: Mesa-vulkan-intel-nullhw
  373. +Recommends: Mesa-vulkan-overlay
  374. +
  375. +%description -n libvulkan_intel
  376. +This package contains the Vulkan parts for Mesa.
  377. +
  378. +%package -n libvulkan_imagination
  379. +Summary: Mesa vulkan driver for MTT GPU
  380. +Group: System/Libraries
  381. +Supplements: modalias(pci:v00001ed5d*sv*sd*bc03sc*i*)
  382. +Requires: Mesa-vulkan-device-select
  383. +Recommends: Mesa-vulkan-overlay
  384. +
  385. +%description -n libvulkan_imagination
  386. +This package contains the Vulkan parts for Mesa.
  387. +
  388. +%package -n libvulkan_microsoft
  389. +Summary: Mesa vulkan driver for Microsoft VirtGPU
  390. +Group: System/Libraries
  391. +Supplements: modalias(pci:v00001414d*sv*sd*bc03sc*i*)
  392. +Requires: Mesa-vulkan-device-select
  393. +Recommends: Mesa-vulkan-overlay
  394. +
  395. +%description -n libvulkan_microsoft
  396. +This package contains the Vulkan parts for Mesa.
  397. +
  398. +%package -n libvulkan_radeon
  399. +Summary: Mesa vulkan driver for AMD GPU
  400. +Group: System/Libraries
  401. +Supplements: modalias(pci:v00001002d*sv*sd*bc03sc*i*)
  402. +Requires: Mesa-vulkan-device-select
  403. +Recommends: Mesa-vulkan-intel-nullhw
  404. +Recommends: Mesa-vulkan-overlay
  405. +
  406. +%description -n libvulkan_radeon
  407. +This package contains the Vulkan parts for Mesa.
  408. +
  409. +%package -n libvulkan_lvp
  410. +Summary: Mesa vulkan driver for LVP
  411. +Group: System/Libraries
  412. # get rid of this package, which is no longer neeeded at all
  413. Provides: Mesa-libVulkan-devel = 22.0.0
  414. Obsoletes: Mesa-libVulkan-devel < 22.0.0
  415. -
  416. -%description -n libvulkan_intel
  417. +Requires: Mesa-vulkan-device-select
  418. +Recommends: Mesa-vulkan-intel-nullhw
  419. +Recommends: Mesa-vulkan-overlay
  420. +
  421. +%description -n libvulkan_lvp
  422. This package contains the Vulkan parts for Mesa.
  423.  
  424. -%package -n libvulkan_radeon
  425. -Summary: Mesa vulkan driver for AMD GPU
  426. -Group: System/Libraries
  427. -Supplements: modalias(pci:v00001002d*sv*sd*bc03sc*i*)
  428. +%package -n libvulkan_virtio
  429. +Summary: Mesa vulkan driver for VirtIO
  430. +Group: System/Libraries
  431. Requires: Mesa-vulkan-device-select
  432. -
  433. -%description -n libvulkan_radeon
  434. -This package contains the Vulkan parts for Mesa.
  435. -
  436. -%package -n libvulkan_lvp
  437. -Summary: Mesa vulkan driver for LVP
  438. -Group: System/Libraries
  439. -Requires: Mesa-vulkan-device-select
  440. -
  441. -%description -n libvulkan_lvp
  442. +Recommends: Mesa-vulkan-intel-nullhw
  443. +Recommends: Mesa-vulkan-overlay
  444. +
  445. +%description -n libvulkan_virtio
  446. This package contains the Vulkan parts for Mesa.
  447.  
  448. %ifarch %{arm} aarch64
  449. %package -n libvulkan_broadcom
  450. Summary: Mesa vulkan driver for Broadcom
  451. Group: System/Libraries
  452. +Requires: Mesa-vulkan-device-select
  453. +Recommends: Mesa-vulkan-intel-nullhw
  454. +Recommends: Mesa-vulkan-overlay
  455.  
  456. %description -n libvulkan_broadcom
  457. This package contains the Vulkan parts for Mesa.
  458. @@ -729,11 +803,22 @@
  459. %package -n libvulkan_freedreno
  460. Summary: Mesa vulkan driver for Freedreno
  461. Group: System/Libraries
  462. +Requires: Mesa-vulkan-device-select
  463. +Recommends: Mesa-vulkan-intel-nullhw
  464. +Recommends: Mesa-vulkan-overlay
  465.  
  466. %description -n libvulkan_freedreno
  467. This package contains the Vulkan parts for Mesa.
  468. %endif
  469.  
  470. +%package -n Mesa-vulkan-intel-nullhw
  471. +Summary: Mesa Vulkan null layer
  472. +Group: System/Libraries
  473. +
  474. +%description -n Mesa-vulkan-intel-nullhw
  475. +This package contains the VK_LAYER_INTEL_nullhw Vulkan layer
  476. +used to disable all rendering/compute commands
  477. +
  478. %package -n Mesa-vulkan-device-select
  479. Summary: Vulkan layer to select Vulkan devices provided by Mesa
  480. Group: System/Libraries
  481. @@ -749,7 +834,6 @@
  482. This package contains the VK_MESA_Overlay Vulkan layer
  483.  
  484. %package -n libxatracker2
  485. -Version: 1.0.0
  486. Summary: XA state tracker
  487. Group: System/Libraries
  488.  
  489. @@ -760,7 +844,6 @@
  490. video driver.
  491.  
  492. %package -n libxatracker-devel
  493. -Version: 1.0.0
  494. Summary: Development files for the XA API
  495. Group: Development/Libraries/C and C++
  496. Requires: libxatracker2 = %{version}
  497. @@ -784,15 +867,14 @@
  498. %if 0%{?suse_version} < 1550
  499. %patch54 -p1
  500. %endif
  501. -%patch58 -p1
  502. -%patch100 -p1
  503. +%patch58 -p1 -F2
  504. %patch200 -p1
  505. -%ifarch %{ix86}
  506. -%patch300 -p1
  507. -%endif
  508. -%patch400 -p1
  509. # reverse apply to fix a regression (boo#1209005)
  510. -%patch600 -p1 -R
  511. +#patch600 -p1 -R
  512. +
  513. +#patch900 -p1 -F3
  514. +#patch901 -p1 -F3
  515. +#patch902 -p1 -F3
  516.  
  517. # Remove requires to vulkan libs from baselibs.conf on platforms
  518. # where vulkan build is disabled; ugly ...
  519. @@ -801,25 +883,106 @@
  520. mv "%{_sourcedir}/temp" "%{_sourcedir}/baselibs.conf"
  521. %endif
  522.  
  523. +# it's not Intel without shipping ugly broken hacks
  524. +sed -i -e "s:opencl-c.h:$(find %{_libdir}/clang/ -name opencl-c.h | tail -1):" src/intel/vulkan/grl/meson.build
  525. +
  526. %build
  527. +# this macro needs 'BuildRequires: memory-constraints'
  528. +#limit_build -m 3072
  529. # try to avoid OOM on ppc64 (boo#1194739)
  530. %ifarch ppc64 ppc64le
  531. %limit_build -m 1024
  532. %endif
  533. -%if 0%{?sle_version} >= 150400
  534. -export CC=gcc-12
  535. -export CXX=g++-12
  536. -%endif
  537. +ulimit -Sn 4000
  538. +export SUSE_ASNEEDED=0
  539. +export SUSE_ZNOW=0
  540. +
  541. +export UCFLAGS="-w -fPIC -O3"
  542. +#UCFLAGS="${UCFLAGS} -I%{_includedir} -I%{_includedir}/wayland"
  543. +%ifarch x86_64
  544. +export UCFLAGS="${UCFLAGS} -march=x86-64 -mtune=generic -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul"
  545. +%else
  546. +%ifarch %ix86
  547. +export UCFLAGS="${UCFLAGS} -march=x86-64 -mtune=i586 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul"
  548. +%endif
  549. +%endif
  550. +export ULDFLAGS="${ULDFLAGS} -fPIC -Wl,-O1"
  551. +export ULDFLAGS="${ULDFLAGS} -Wl,--gc-sections -Wl,--icf=safe"
  552. +%if 0%{?use_lld}
  553. +export ULDFLAGS="${ULDFLAGS} -fuse-ld=lld"
  554. +%ifarch %ix86 %arm
  555. +#export ULDFLAGS="${ULDFLAGS} -Wl,-z,notext"
  556. +%endif
  557. +export LD="lld"
  558. +alias ld=ld.lld
  559. +%else
  560. +export ULDFLAGS="${ULDFLAGS} -fuse-ld=gold -Wl,--sort-common"
  561. +export LD=ld.gold
  562. +alias ld=gold
  563. +%endif
  564. +%if 0%{?use_clang}
  565. +export CC=clang
  566. +export CXX=clang++
  567. +export CPP='clang -E' AR=llvm-ar AS=llvm-as NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size STRIP=llvm-strip RANLIB=llvm-ranlib
  568. +export UCFLAGS="${UCFLAGS} -v"
  569. +#export UCFLAGS="${UCFLAGS} -std=gnu17 -D_GNU_SOURCE -fexceptions -relocatable-pch -faligned-allocation"
  570. +export UCXXFLAGS="${UCFLAGS}"
  571. +#export UCXXFLAGS="${UCFLAGS} -std=gnu++17 -fpermissive -fcxx-exceptions"
  572. +export HOST="$(${CC} -print-target-triple)"
  573. +%if 0%{?use_lto}
  574. +%ifarch x86_64
  575. +export UCFLAGS="${UCFLAGS} -fglobal-isel"
  576. +%endif
  577. +%if 0%{?use_lld}
  578. +%global _lto_cflags -flto=thin -Wl,--plugin-opt=O3 %{?jobs:-Wl,--threads=%{jobs}}
  579. +%global _lto_ldlags -flto=thin -Wl,--plugin-opt=O3 %{?jobs:-Wl,--threads=%{jobs}}
  580. +%else
  581. +%global _lto_cflags -flto=thin
  582. +%global _lto_ldlags -flto=thin
  583. +%endif
  584. +%else
  585. +%global _lto_cflags %nil
  586. +%global _lto_ldlags %nil
  587. +%endif
  588. +%else
  589. +export CC=gcc
  590. +export CXX=g++
  591. +export UCFLAGS="${UCFLAGS} -ftree-parallelize-loops=16 -ftree-vectorize -fvect-cost-model=cheap -fsimd-cost-model=cheap -fpredictive-commoning"
  592. +%ifarch %ix86
  593. +export UCFLAGS="${UCFLAGS} -pthread -fopenmp -lgomp"
  594. +export ULDFLAGS="${ULDFLAGS} -pthread -fopenmp -lgomp"
  595. +%endif
  596. +export UCXXFLAGS="${UCFLAGS} -fpermissive"
  597. +export HOST="%{_target_platform}"
  598. +%if 0%{?use_lto}
  599. +%global _lto_cflags -fuse-linker-plugin %_lto_cflags -ffat-lto-objects -flto-odr-type-merging
  600. +%global _lto_ldlags -fuse-linker-plugin -flto=%{?jobs:%{jobs}}
  601. +%else
  602. +%global _lto_cflags %nil
  603. +%global _lto_ldlags %nil
  604. +%endif
  605. +%endif
  606. +export TARGET="${HOST}"
  607. +export UCFLAGS="${UCFLAGS} %_lto_cflags"
  608. +export UCXXFLAGS="${UCXXFLAGS} %_lto_cflags"
  609. +export ULDFLAGS="${ULDFLAGS} %_lto_cflags %_lto_ldlags"
  610. +# override OBS defaults ?
  611. +export CFLAGS="${UCFLAGS}"
  612. +export CXXFLAGS="${UCXXFLAGS}"
  613. +export LDFLAGS="${ULDFLAGS}"
  614.  
  615. egl_platforms=x11,wayland
  616. +# dri drivers are not built without egl=enabled and
  617. +# consequences of building them with anything but glx=dri are unknown
  618.  
  619. %meson \
  620. --auto-features=disabled \
  621. + -Dzstd=enabled \
  622. %if "%{flavor}" == "drivers"
  623. -Dgles1=disabled \
  624. -Dgles2=disabled \
  625. -Degl=enabled \
  626. - -Dglx=disabled \
  627. + -Dglx=dri \
  628. -Dosmesa=false \
  629. -Dxmlconfig=enabled \
  630. %else
  631. @@ -827,14 +990,16 @@
  632. -Dgles1=enabled \
  633. -Dgles2=enabled \
  634. -Degl=enabled \
  635. + -Dglx=dri \
  636. -Dosmesa=true \
  637. - -Dglx=auto \
  638. -Dllvm=disabled \
  639. -Dvulkan-drivers= \
  640. %endif
  641. -Dplatforms=$egl_platforms \
  642. -Ddri3=enabled \
  643. -Dshared-glapi=enabled \
  644. + -Dlmsensors=enabled \
  645. + -Dlibunwind=enabled \
  646. %if 0%{?with_nine}
  647. -Dgallium-nine=true \
  648. %endif
  649. @@ -842,6 +1007,7 @@
  650. -Dgbm=enabled \
  651. %endif
  652. %if 0%{with_opencl}
  653. + -Dopencl-spirv=true \
  654. -Dgallium-opencl=icd \
  655. %if 0%{?suse_version} >= 1550
  656. --sysconfdir=%{_datadir} \
  657. @@ -861,23 +1027,46 @@
  658. -Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec \
  659. %endif
  660. %if %{gallium_loader}
  661. +%if 0%{omx_support}
  662. + -Dgallium-omx=tizonia \
  663. +%endif
  664. + -Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec \
  665. + -Dgallium-d3d12-video=enabled \
  666. -Dgallium-vdpau=enabled \
  667. -Dgallium-va=enabled \
  668. -Dgallium-xa=enabled \
  669. + -Dgallium-extra-hud=true \
  670. +%if 0%{with_perfetto}
  671. + -Dperfetto=true \
  672. +%endif
  673. %endif
  674. %if 0%{with_vulkan}
  675. - -Dvulkan-drivers=%{?vulkan_drivers} \
  676. - -Dvulkan-layers=device-select,overlay \
  677. + -Dspirv-to-dxil=true \
  678. + -Dvulkan-beta=true \
  679. + -Dvulkan-drivers=%{vulkan_drivers} \
  680. + -Dvulkan-layers=device-select,intel-nullhw,overlay \
  681. + %ifarch %{ix86} x86_64
  682. + -Dintel-clc=enabled \
  683. + -Dimagination-srv=true \
  684. + -Dmicrosoft-clc=disabled \
  685. + %else
  686. + %endif
  687. %else
  688. -Dvulkan-drivers= \
  689. %endif
  690. + -Dmin-windows-version=7 \
  691. + -Dshader-cache=enabled \
  692. %ifarch %{ix86} x86_64
  693. + -Dvmware-mks-stats=true \
  694. + -Dintel-xe-kmd=enabled \
  695. -Dgallium-drivers=r300,r600,radeonsi,nouveau,swrast,svga,virgl,iris,crocus,i915,d3d12,zink \
  696. %else
  697. %ifarch %{arm} aarch64
  698. - -Dgallium-drivers=r300,r600,radeonsi,nouveau,swrast,virgl,freedreno,vc4,etnaviv,lima,panfrost,v3d,svga,tegra \
  699. + -Dfreedreno-kmds=msm,kgsl,virtio \
  700. + -Dgallium-drivers=r300,r600,radeonsi,nouveau,swrast,virgl,freedreno,vc4,etnaviv,lima,panfrost,v3d,svga,tegra,asahi,kmsro \
  701. %else
  702. %ifarch ppc64 ppc64le riscv64
  703. + -Dpower8=enabled \
  704. -Dgallium-drivers=r300,r600,radeonsi,nouveau,swrast,virgl \
  705. %else
  706. -Dgallium-drivers=swrast \
  707. @@ -891,73 +1080,76 @@
  708. -Dvalgrind=enabled \
  709. %endif
  710. -Db_ndebug=true \
  711. - -Dc_args="%{optflags}" \
  712. -%ifarch %ix86
  713. - -Dcpp_args="$(echo %{optflags}|sed 's/-flto=auto//')"
  714. -%else
  715. - -Dcpp_args="%{optflags}"
  716. -%endif
  717. -
  718. -%meson_build
  719. + -Dc_args="${CFLAGS} ${LDFLAGS}" \
  720. + -Dcpp_args="${CXXFLAGS} ${LDFLAGS}" \
  721. + -Db_pch=false \
  722. + -Db_pie=true \
  723. + -Dstrip=false \
  724. + || (cat */meson-logs/meson-log.txt; exit 1)
  725. +
  726. +%meson_build || (cat */meson-logs/meson-log.txt; exit 1)
  727.  
  728. %install
  729. +ulimit -Sn 4000
  730. %meson_install
  731. -find %{buildroot} -type f -name "*.la" -delete -print
  732. +find %{buildroot} -type f -name "*.la" -delete -print || echo ignored
  733. +find %{buildroot} -type f -name "*.a" -delete -print || echo ignored
  734. +
  735. +if [ -f "%{buildroot}/%{_bindir}/mesa-overlay-control.py" ]; then
  736. + sed -i -e 's:env ::' "%{buildroot}/%{_bindir}/mesa-overlay-control.py"
  737. +fi
  738.  
  739. # libwayland-egl is provided by wayland itself
  740. -rm -f %{buildroot}/%{_libdir}/libwayland-egl.so*
  741. -rm -f %{buildroot}/%{_libdir}/pkgconfig/wayland-egl.pc
  742. +rm -fv %{buildroot}/%{_libdir}/libwayland-egl.so* || echo ignored
  743. +rm -fv %{buildroot}/%{_libdir}/pkgconfig/wayland-egl.pc || echo ignored
  744.  
  745. %if "%{flavor}" == "drivers"
  746. # Delete things that we do not package in the Mesa-drivers variant, but can
  747. # not disable from buildling and installing.
  748.  
  749. -rm -f %{buildroot}/%{_libdir}/libEGL.so*
  750. -# in Mesa-libEGL-devel
  751. -rm %{buildroot}/%{_includedir}/EGL/egl.h
  752. -rm %{buildroot}/%{_includedir}/EGL/eglext.h
  753. -rm %{buildroot}/%{_includedir}/EGL/eglext_angle.h
  754. -rm %{buildroot}/%{_includedir}/EGL/eglmesaext.h
  755. -rm %{buildroot}/%{_includedir}/EGL/eglplatform.h
  756. -rm %{buildroot}/%{_libdir}/pkgconfig/egl.pc
  757. +rm -fv %{buildroot}/%{_libdir}/libGL.so* || echo ignored
  758. +rm -fv %{buildroot}/%{_libdir}/libEGL.so* || echo ignored
  759. +# in Mesa-lib[E]GL-devel
  760. +find %{buildroot}/%{_includedir}/EGL -delete -print || echo ignored
  761. +find %{buildroot}/%{_libdir} -name "gl.pc" -delete -print || echo ignored
  762. +find %{buildroot}/%{_libdir} -name "egl.pc" -delete -print || echo ignored
  763.  
  764. # in Mesa-libGL-devel
  765. -rm -rf %{buildroot}/%{_includedir}/GL
  766. +#rm -rf %{buildroot}/%{_includedir}/GL
  767. +find %{buildroot}/%{_includedir}/GL/* -not -name "osmesa.h" -delete -print || echo ignored
  768.  
  769. # in Mesa-libglapi0
  770. -rm %{buildroot}/%{_libdir}/libglapi.so*
  771. +rm -v %{buildroot}/%{_libdir}/libglapi.so* || echo ignored
  772.  
  773. # in libwayland-egl1
  774. -rm -f %{buildroot}/%{_libdir}/libwayland-egl.so*
  775. -rm -f %{buildroot}/%{_libdir}/pkgconfig/wayland-egl.pc
  776. +find %{buildroot}/%{_libdir} -name "*wayland-egl.*" -delete -print || echo ignored
  777.  
  778. # in Mesa-dri-devel
  779. -rm %{buildroot}/%{_libdir}/pkgconfig/dri.pc
  780. +find %{buildroot}/%{_libdir} -name "dri.pc" -delete -print || echo ignored
  781.  
  782. # in libgbm-devel
  783. -rm %{buildroot}/%{_includedir}/gbm.h
  784. -rm %{buildroot}/%{_libdir}/libgbm.so*
  785. -rm %{buildroot}/%{_libdir}/pkgconfig/gbm.pc
  786. +find %{buildroot}/%{_includedir} -name "gbm*" -delete -print || echo ignored
  787. +find %{buildroot}/%{_libdir} -name "*gbm.*" -delete -print || echo ignored
  788.  
  789. # in KHR-devel
  790. -rm -rf %{buildroot}/%{_includedir}/KHR
  791. +rm -rfv %{buildroot}/%{_includedir}/KHR || echo ignored
  792.  
  793. # workaround needed since Mesa 19.0.2
  794. -rm -f %{buildroot}/%{_libdir}/vdpau/libvdpau_gallium.so
  795. -
  796. -%else
  797. -# package in Mesa-dri
  798. -rm -rf %{buildroot}/%{_datadir}/drirc.d
  799. -
  800. -rm -f %{buildroot}/%{_libdir}/dri/*_dri.so
  801. -
  802. -rm -f %{buildroot}%{_libdir}/libGLES*
  803. +rm -fv %{buildroot}/%{_libdir}/vdpau/libvdpau_gallium.so || echo ignored
  804. +# all dri drivers are hard links of libgallium_dri.so which is not installed
  805. +%fdupes -s %{buildroot}/%{_libdir}/dri
  806. +
  807. +%else
  808. +# package in Mesa-gallium
  809. +find %{buildroot}/%{_libdir}/dri/ -name "*_dri.so" -delete -print || echo ignored
  810. +find %{buildroot}%{_libdir} -name "libGLES*" -delete -print || echo ignored
  811. +
  812. # glvnd needs a default provider for indirect rendering where it cannot
  813. # determine the vendor
  814. ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_indirect.so.0
  815.  
  816. # pickup pkgconfig files from libglvnd build
  817. -rm -f %{buildroot}/%{_libdir}/pkgconfig/{gl,egl,glesv1_cm,glesv2}.pc
  818. +rm -fv %{buildroot}/%{_libdir}/pkgconfig/{gl,egl,glesv1_cm,glesv2}.pc || echo ignored
  819. install -m 0644 /usr/share/doc/packages/libglvnd/pkgconfig/{gl,egl,glesv1_cm,glesv2}.pc \
  820. %{buildroot}/%{_libdir}/pkgconfig/
  821.  
  822. @@ -970,11 +1162,13 @@
  823. done
  824. %endif
  825.  
  826. -%fdupes -s %{buildroot}/%{_mandir}
  827. +if [ -d "%{buildroot}/%{_mandir}" ];then
  828. + %fdupes -s %{buildroot}/%{_mandir}
  829. +fi
  830.  
  831. %if "%{flavor}" != "drivers"
  832. # Use dummy README file that can be included in both Mesa and Mesa-32bit. This way Mesa-32bit will be build (otherwise it would be skipped as empty) and it can be used by the other *-32bit packages.
  833. -echo "The \"Mesa\" package does not have the ability to render, but is supplemented by \"Mesa-dri\" and \"Mesa-gallium\" which contain the drivers for rendering" > docs/README.package.%{_arch}
  834. +echo "The \"Mesa\" package does not have the ability to render, but is supplemented by \"Mesa-gallium\" which contain the drivers for rendering" > docs/README.package.%{_arch}
  835. %endif
  836.  
  837. %post -p /sbin/ldconfig
  838. @@ -1049,15 +1243,6 @@
  839. %files libGLESv3-devel
  840. %{_includedir}/GLES3
  841.  
  842. -%files -n libOSMesa8
  843. -%{_libdir}/libOSMesa.so.8.0.0
  844. -%{_libdir}/libOSMesa.so.8
  845. -
  846. -%files -n libOSMesa-devel
  847. -%{_includedir}/GL/osmesa.h
  848. -%{_libdir}/libOSMesa.so
  849. -%{_libdir}/pkgconfig/osmesa.pc
  850. -
  851. %files -n libgbm1
  852. %{_libdir}/libgbm.so.1*
  853.  
  854. @@ -1078,43 +1263,39 @@
  855. %{_libdir}/pkgconfig/xatracker.pc
  856. %endif
  857.  
  858. +%if %{omx_support}
  859. +%files -n libomx_mesa
  860. +%defattr(-,root,root)
  861. +%_libdir/bellagio/libomx_mesa*
  862. +%endif
  863. +
  864. %if %{vdpau_nouveau}
  865. %files -n libvdpau_nouveau
  866. -%{_libdir}/vdpau/libvdpau_nouveau.so
  867. -%{_libdir}/vdpau/libvdpau_nouveau.so.1
  868. -%{_libdir}/vdpau/libvdpau_nouveau.so.1.0
  869. -%{_libdir}/vdpau/libvdpau_nouveau.so.1.0.0
  870. +%defattr(-,root,root)
  871. +%{_libdir}/vdpau/libvdpau_nouveau.so*
  872. %endif
  873.  
  874. %if %{vdpau_radeon}
  875. -%files -n libvdpau_r300
  876. -%{_libdir}/vdpau/libvdpau_r300.so
  877. -%{_libdir}/vdpau/libvdpau_r300.so.1
  878. -%{_libdir}/vdpau/libvdpau_r300.so.1.0
  879. -%{_libdir}/vdpau/libvdpau_r300.so.1.0.0
  880. -
  881. %files -n libvdpau_r600
  882. -%{_libdir}/vdpau/libvdpau_r600.so
  883. -%{_libdir}/vdpau/libvdpau_r600.so.1
  884. -%{_libdir}/vdpau/libvdpau_r600.so.1.0
  885. -%{_libdir}/vdpau/libvdpau_r600.so.1.0.0
  886. +%defattr(-,root,root)
  887. +%{_libdir}/vdpau/libvdpau_r600.so*
  888. %endif
  889.  
  890. %ifarch %{ix86} x86_64 ppc64 ppc64le %{arm} aarch64 riscv64
  891. %files -n libvdpau_radeonsi
  892. -%{_libdir}/vdpau/libvdpau_radeonsi.so
  893. -%{_libdir}/vdpau/libvdpau_radeonsi.so.1
  894. -%{_libdir}/vdpau/libvdpau_radeonsi.so.1.0
  895. -%{_libdir}/vdpau/libvdpau_radeonsi.so.1.0.0
  896. -%endif
  897. -%endif
  898. +%defattr(-,root,root)
  899. +%{_libdir}/vdpau/libvdpau_radeonsi.so*
  900. +%endif
  901. +
  902. +%files -n libvdpau_d3d12
  903. +%defattr(-,root,root)
  904. +%{_libdir}/vdpau/libvdpau_d3d12.so*
  905.  
  906. %if %{vdpau_virtio_gpu}
  907. %files -n libvdpau_virtio_gpu
  908. -%{_libdir}/vdpau/libvdpau_virtio_gpu.so
  909. -%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1
  910. -%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1.0
  911. -%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1.0.0
  912. +%defattr(-,root,root)
  913. +%{_libdir}/vdpau/libvdpau_virtio*.so*
  914. +%endif
  915. %endif
  916.  
  917. %if "%{flavor}" != "drivers"
  918. @@ -1123,37 +1304,27 @@
  919.  
  920. %files libglapi-devel
  921. %{_libdir}/libglapi.so
  922. +
  923. +%files -n libOSMesa8
  924. +%defattr(-,root,root)
  925. +%{_libdir}/libOSMesa.so.*
  926. +
  927. +%files -n libOSMesa-devel
  928. +%defattr(-,root,root)
  929. +%{_includedir}/GL/osmesa.h
  930. +%{_libdir}/libOSMesa.so
  931. +%{_libdir}/pkgconfig/osmesa.pc
  932. %endif
  933.  
  934. %if "%{flavor}" == "drivers"
  935. -%files -n Mesa-dri
  936. +
  937. +%files -n Mesa-gallium
  938. %dir %{_datadir}/drirc.d
  939. %config %{_datadir}/drirc.d/*
  940. -%dir %{_libdir}/dri
  941. +%dir %{_libdir}/dri/
  942. %{_libdir}/dri/*_dri.so
  943. -%ifarch %{ix86} x86_64 aarch64 %{arm} ppc64 ppc64le riscv64
  944. -%exclude %{_libdir}/dri/nouveau_dri.so
  945. -%endif
  946. -%ifarch %{arm} aarch64
  947. -%exclude %{_libdir}/dri/vc4_dri.so
  948. -%endif
  949. -
  950. -%if 0%{with_opencl}
  951. -# only built with opencl
  952. -%files -n Mesa-gallium
  953. %dir %{_libdir}/gallium-pipe/
  954. %{_libdir}/gallium-pipe/pipe_*.so
  955. -%endif
  956. -
  957. -%ifarch %{ix86} x86_64 aarch64 %{arm} ppc64 ppc64le riscv64
  958. -%files -n Mesa-dri-nouveau
  959. -%{_libdir}/dri/nouveau_dri.so
  960. -%endif
  961. -
  962. -%ifarch aarch64 %{arm}
  963. -%files -n Mesa-dri-vc4
  964. -%{_libdir}/dri/vc4_dri.so
  965. -%endif
  966.  
  967. # drivers
  968. %endif
  969. @@ -1211,6 +1382,7 @@
  970. %if "%{flavor}" == "drivers"
  971. %ifarch %{ix86} x86_64 aarch64 %{arm} ppc64 ppc64le riscv64
  972. %files -n Mesa-libva
  973. +%dir %{_libdir}/dri
  974. %{_libdir}/dri/*_drv_video.so
  975. %endif
  976. %endif
  977. @@ -1224,6 +1396,19 @@
  978. %{_libdir}/libvulkan_intel.so
  979. %{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json
  980. %{_libdir}/libvulkan_intel_hasvk.so
  981. +
  982. +%files -n libvulkan_imagination
  983. +%dir %{_datadir}/vulkan
  984. +%dir %{_datadir}/vulkan/icd.d
  985. +%{_datadir}/vulkan/icd.d/powervr_*icd.*.json
  986. +%{_libdir}/libvulkan_powervr*.so
  987. +%{_libdir}/libpowervr*.so
  988. +
  989. +%files -n libvulkan_microsoft
  990. +%dir %{_datadir}/vulkan
  991. +%dir %{_datadir}/vulkan/icd.d
  992. +%{_datadir}/vulkan/icd.d/dzn_*icd.*.json
  993. +%{_libdir}/libvulkan_dzn.so
  994. %endif
  995.  
  996. %files -n libvulkan_radeon
  997. @@ -1237,6 +1422,12 @@
  998. %dir %{_datadir}/vulkan
  999. %dir %{_datadir}/vulkan/icd.d
  1000. %{_datadir}/vulkan/icd.d/lvp_icd.*.json
  1001. +
  1002. +%files -n libvulkan_virtio
  1003. +%{_libdir}/libvulkan_virtio.so
  1004. +%dir %{_datadir}/vulkan
  1005. +%dir %{_datadir}/vulkan/icd.d
  1006. +%{_datadir}/vulkan/icd.d/virtio_icd.*.json
  1007.  
  1008. %ifarch %{arm} aarch64
  1009. %files -n libvulkan_broadcom
  1010. @@ -1252,15 +1443,21 @@
  1011. %{_datadir}/vulkan/icd.d/freedreno_icd.*.json
  1012. %endif
  1013.  
  1014. +%files -n Mesa-vulkan-intel-nullhw
  1015. +%{_libdir}/libVkLayer_INTEL_nullhw.so
  1016. +%dir %{_datadir}/vulkan/implicit_layer.d
  1017. +%{_datadir}/vulkan/explicit_layer.d/VkLayer_INTEL_nullhw.json
  1018. +
  1019. %files -n Mesa-vulkan-device-select
  1020. %{_libdir}/libVkLayer_MESA_device_select.so
  1021. -%dir %{_datadir}/vulkan
  1022. %dir %{_datadir}/vulkan/implicit_layer.d
  1023. %{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
  1024.  
  1025. %files -n Mesa-vulkan-overlay
  1026. +%{_bindir}/spirv2dxil
  1027. %{_bindir}/mesa-overlay-control.py
  1028. %{_libdir}/libVkLayer_MESA_overlay.so
  1029. +%{_libdir}/libspirv_to_dxil.*
  1030. %dir %{_datadir}/vulkan
  1031. %dir %{_datadir}/vulkan/explicit_layer.d
  1032. %{_datadir}/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json
  1033.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement