Skip to content

Commit

Permalink
mesa: build with less features on i686
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Nov 20, 2024
1 parent 22d6032 commit 3f1bdd6
Showing 1 changed file with 49 additions and 27 deletions.
76 changes: 49 additions & 27 deletions mingw-w64-mesa/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,47 @@ _realname=mesa
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=24.2.7
pkgrel=1
pkgrel=2
pkgdesc="Open-source implementation of the OpenGL, Vulkan and OpenCL specifications (mingw-w64)"
url="https://www.mesa3d.org/"
msys2_repository_url="https://gitlab.freedesktop.org/mesa/mesa"
msys2_references=(
"cpe: cpe:/a:mesa3d:mesa"
)
license=('spdx:MIT')
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-directx-headers"
"${MINGW_PACKAGE_PREFIX}-meson"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-clang"
"${MINGW_PACKAGE_PREFIX}-polly"
"${MINGW_PACKAGE_PREFIX}-directx-headers"
"${MINGW_PACKAGE_PREFIX}-python-mako"
"${MINGW_PACKAGE_PREFIX}-python-packaging"
"${MINGW_PACKAGE_PREFIX}-python-yaml"
"${MINGW_PACKAGE_PREFIX}-libclc"
"${MINGW_PACKAGE_PREFIX}-libelf"
"${MINGW_PACKAGE_PREFIX}-glslang")
depends=("${MINGW_PACKAGE_PREFIX}-clang-libs"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-vulkan-loader"
"${MINGW_PACKAGE_PREFIX}-libsystre"
"${MINGW_PACKAGE_PREFIX}-libva"
$([[ ${CARCH} == i686 ]] || echo \
"${MINGW_PACKAGE_PREFIX}-glslang" \
"${MINGW_PACKAGE_PREFIX}-libclc" \
"${MINGW_PACKAGE_PREFIX}-libelf" \
"${MINGW_PACKAGE_PREFIX}-polly")
)
depends=("${MINGW_PACKAGE_PREFIX}-libsystre"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-spirv-llvm-translator"
"${MINGW_PACKAGE_PREFIX}-spirv-tools"
"${MINGW_PACKAGE_PREFIX}-opencl-icd")
optdepends=("${MINGW_PACKAGE_PREFIX}-opengl-man-pages: for the OpenGL API man pages"
"${MINGW_PACKAGE_PREFIX}-vulkan-validation-layers: to debug applications using Vulkan graphics")
$([[ ${CARCH} == i686 ]] || echo \
"${MINGW_PACKAGE_PREFIX}-clang-libs" \
"${MINGW_PACKAGE_PREFIX}-libva" \
"${MINGW_PACKAGE_PREFIX}-opencl-icd" \
"${MINGW_PACKAGE_PREFIX}-spirv-llvm-translator" \
"${MINGW_PACKAGE_PREFIX}-spirv-tools" \
"${MINGW_PACKAGE_PREFIX}-vulkan-loader")
)
if [[ ${CARCH} != i686 ]]; then
optdepends=("${MINGW_PACKAGE_PREFIX}-opengl-man-pages: for the OpenGL API man pages"
"${MINGW_PACKAGE_PREFIX}-vulkan-validation-layers: to debug applications using Vulkan graphics")
fi
source=(https://mesa.freedesktop.org/archive/${_realname}-${pkgver}.tar.xz{,.sig}
0000-addrlib-workaround-old-cpu-target.patch)
sha256sums=('a0ce37228679647268a83b3652d859dcf23d6f6430d751489d4464f6de6459fd'
Expand Down Expand Up @@ -79,7 +86,7 @@ prepare() {
apply_patch_with_msg \
0000-addrlib-workaround-old-cpu-target.patch

# Tie clang clc linking mode to static-libclc instead of shared-llvm
# Tie clang clc linking mode to static-libclc instead of shared-llvm
sed -e "s|_shared_llvm|false|g" \
-i src/compiler/clc/meson.build
}
Expand All @@ -93,22 +100,37 @@ build() {
-Degl=disabled
-Dgles1=disabled
-Dgles2=disabled
-Dllvm=enabled
-Dshared-llvm=enabled
-Dosmesa=true
-Dbuild-tests=false
-Dgallium-drivers=softpipe,llvmpipe,zink,d3d12
-Dgallium-va=enabled
-Dvideo-codecs=all
-Dmicrosoft-clc=enabled
-Dstatic-libclc=all
-Dcpp_rtti=true
-Dmin-windows-version=8
-Dgallium-opencl=icd
-Dopencl-spirv=true
-Dvulkan-drivers=swrast,amd,microsoft-experimental
)

if [[ ${CARCH} != i686 ]]; then
_meson_options+=(
-Dllvm=enabled
-Dshared-llvm=enabled
-Dgallium-drivers=softpipe,llvmpipe,zink,d3d12
-Dgallium-opencl=icd
-Dgallium-va=enabled
-Dmicrosoft-clc=enabled
-Dstatic-libclc=all
-Dopencl-spirv=true
-Dvulkan-drivers=swrast,amd,microsoft-experimental
)
else
_meson_options+=(
-Dllvm=disabled
-Dgallium-drivers=softpipe,zink,d3d12
-Dgallium-opencl=disabled
-Dgallium-va=disabled
-Dmicrosoft-clc=disabled
-Dopencl-spirv=false
-Dvulkan-drivers=microsoft-experimental
)
fi

MSYS2_ARG_CONV_EXCL="--prefix=" \
PROCESSOR_ARCHITECTURE="${CARCH}" \
${MINGW_PREFIX}/bin/meson setup \
Expand Down

0 comments on commit 3f1bdd6

Please sign in to comment.