Github messages for voidlinux
 help / color / mirror / Atom feed
From: Calandracas606 <Calandracas606@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Mesa llvm19
Date: Thu, 21 Nov 2024 05:08:38 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-53166@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

There is a new pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages mesa-llvm19
https://github.com/void-linux/void-packages/pull/53166

Mesa llvm19
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - i686
  - aarch64 (cross)
  - aarch64-musl (cross)
  - armv7l (cross)
  - armv7l-musl (cross)
  - armv6l (cross)
  - armv6l-musl (cross)



A patch file from https://github.com/void-linux/void-packages/pull/53166.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mesa-llvm19-53166.patch --]
[-- Type: text/x-diff, Size: 4760 bytes --]

From c3eb04f48df613f41220739ab642e183f2ee8c23 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Mon, 18 Nov 2024 19:04:45 -0500
Subject: [PATCH 1/2] mesa: build with llvm19

---
 srcpkgs/mesa/template | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 0ff83ace1550a2..4a14daebc2fbe7 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,9 +1,9 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=24.2.6
-revision=1
+revision=2
 build_style=meson
-_llvmver=18
+_llvmver=19
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
@@ -26,6 +26,7 @@ changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
 checksum=2b68c4a6f204c1999815a457299f81c41ba7bf48c4674b0b2d1d8864f41f3709
 
+build_helper="qemu"
 build_options="wayland"
 build_options_default="wayland"
 
@@ -142,7 +143,8 @@ fi
 # enabled currently by amd drivers
 if [ "$_have_opencl" ]; then
 	hostmakedepends+=" clang${_llvmver} rust rust-bindgen"
-	makedepends+=" clang${_llvmver} libclc rust SPIRV-LLVM-Translator-devel SPIRV-Tools-devel"
+	makedepends+=" clang${_llvmver} libclc${_llvmver} rust
+	 SPIRV-LLVM-Translator${_llvmver}-devel SPIRV-Tools-devel"
 	subpackages+=" mesa-opencl"
 	configure_args+=" -Dgallium-opencl=icd -Dgallium-rusticl=true -Drust_std=2021"
 fi
@@ -184,6 +186,18 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -Dpower8=false" ;;
 esac
 
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		# Bug with our current llvm19 package causes a broken symlink:
+		# /usr/aarch64-linux-gnu/usr/lib/libLLVM-19.so -> /usr/lib/llvm/19/lib/libLLVM-19.so
+		# The symlink should be relative, not absolute.
+		# This causes breakage because the symlink is to the
+		# so of the wrong (host) architecture
+		# rm the broken symlink for now, will be fixed in the next version
+		rm -f "${XBPS_CROSS_BASE}/usr/lib/libLLVM-${_llvmver}.so"
+	fi
+}
+
 post_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		find -iname "*.ninja" -exec sed -i "{}" \
@@ -304,7 +318,7 @@ libxatracker_package() {
 
 mesa-opencl_package() {
 	short_desc="Mesa implementation of OpenCL (r600+ only)"
-	depends="libclc"
+	depends="libclc${_llvmver}"
 	pkg_install() {
 		vmove etc/OpenCL
 		vmove usr/lib/gallium-pipe

From 9123307bc118845b23f685fc79536b0474e284d8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 20 Nov 2024 23:01:48 -0500
Subject: [PATCH 2/2] xbps-src: llvm-config wrapper

---
 common/build-helper/meson.sh                    |  6 +++---
 common/hooks/pre-configure/02-script-wrapper.sh | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
index e414afbfba4bb3..02fb515f2bea6f 100644
--- a/common/build-helper/meson.sh
+++ b/common/build-helper/meson.sh
@@ -69,13 +69,13 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
 	g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
 	g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
 	g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
-	llvm-config = '/usr/bin/llvm-config'
+	llvm-config = 'llvm-config-qemu'
 	cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
-	
+
 	[properties]
 	needs_exe_wrapper = true
 	bindgen_clang_arguments = ['-target', '${XBPS_CROSS_TRIPLET}']
-	
+
 	[host_machine]
 	system = 'linux'
 	cpu_family = '${_MESON_CPU_FAMILY}'
diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 004c68442c061c..c6383cd4f72963 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -50,6 +50,20 @@ generic_wrapper3() {
 	chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
 }
 
+qemu_wrapper() {
+	local wrapper="$1"
+	[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
+	[ ! -x qemu-${XBPS_TARGET_QEMU_MACHINE}-static ] && return 0
+	[ -x ${XBPS_WRAPPERDIR}/${wrapper}-qemu ] && return 0
+
+cat >>${XBPS_WRAPPERDIR}/${wrapper}-qemu<<_EOF
+#!/bin/sh
+export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
+exec qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@"
+_EOF
+	chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}-qemu
+}
+
 apr_apu_wrapper() {
 	local wrapper="$1"
 
@@ -240,4 +254,5 @@ hook() {
 	python_wrapper python-config 2.7
 	python_wrapper python3-config 3.12
 	apr_apu_wrapper apu-1-config
+	qemu_wrapper llvm-config
 }

             reply	other threads:[~2024-11-21  4:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21  4:08 Calandracas606 [this message]
2024-11-21  4:26 ` [PR PATCH] [Updated] " Calandracas606

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-53166@inbox.vuxu.org \
    --to=calandracas606@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).