Both packages come from one PKGBUILD, so the MLX wheel and the Vulkan driver it was qualified on publish together. omarchy-mlx-vulkan builds only the Honeykrisp Vulkan driver from joshuaswarren/mesa-1 9b97b82ab1. It installs the driver, an ICD manifest with an absolute library_path, and the driver's git SHA in /usr/lib/omarchy-mlx/vulkan/. The manifest is outside the loader's search path, so only omarchy-mlx uses the driver. It provides nothing generic and conflicts with mesa-honeykrisp-omarchy. omarchy-mlx builds the private venv offline from the release's hash-locked vendor wheels and depends on the exact omarchy-mlx-vulkan build. The mlx-omarchy sources are placeholders until v0.7.7 is published.
120 lines
4.8 KiB
Bash
120 lines
4.8 KiB
Bash
# Maintainer: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
|
|
|
pkgbase=omarchy-mlx
|
|
pkgname=(omarchy-mlx omarchy-mlx-vulkan)
|
|
pkgver=0.7.7
|
|
pkgrel=1
|
|
arch=('aarch64')
|
|
url='https://github.com/joshuaswarren/mlx-omarchy'
|
|
# The two packages publish together, so the tested wheel and the Vulkan driver
|
|
# it was qualified on can never skew.
|
|
#
|
|
# PLACEHOLDER until v0.7.7 is published. The three mlx-omarchy sources and their
|
|
# checksums are the test stand-ins: the source archive of commit 42c0f25f6, the
|
|
# v0.7.6 release wheel, and a vendor tarball built with packaging/vendor-wheels.sh
|
|
# from that commit. Replace _wheel and the three checksums with the v0.7.7
|
|
# release values.
|
|
_wheel=mlx_omarchy-0.32.3.dev202609291615+06711ad-cp314-cp314-linux_aarch64.whl
|
|
_vendor=omarchy-mlx-vendor-wheels-v$pkgver-cp314-aarch64.tar
|
|
# The Honeykrisp Vulkan driver: joshuaswarren/mesa-1 honeykrisp-omarchy-v3.
|
|
_mesa_commit=9b97b82ab1d22ef13837359cf5113e703ed097b7
|
|
# The driver reports this in driverInfo as "git-<sha>"; the runtime compares it.
|
|
_mesa_sha=${_mesa_commit:0:10}
|
|
makedepends=('clang' 'elfutils' 'expat' 'glslang' 'libclc' 'libdrm' 'llvm' 'meson'
|
|
'python' 'python-mako' 'python-packaging' 'python-yaml'
|
|
'spirv-llvm-translator' 'spirv-tools' 'zstd')
|
|
options=('!debug' '!lto')
|
|
source=("mlx-omarchy-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz"
|
|
"$_wheel::$url/releases/download/v$pkgver/${_wheel//+/%2B}"
|
|
"$_vendor::$url/releases/download/v$pkgver/$_vendor"
|
|
"mesa-$_mesa_commit.tar.gz::https://github.com/joshuaswarren/mesa-1/archive/$_mesa_commit.tar.gz")
|
|
noextract=("$_wheel" "$_vendor")
|
|
sha256sums=('PLACEHOLDER_SOURCE'
|
|
'PLACEHOLDER_WHEEL'
|
|
'PLACEHOLDER_VENDOR'
|
|
'b3e62600af7060b11e01f7290ce6772a47dd0c10a7b0f85adb9698146ef4516d')
|
|
|
|
prepare() {
|
|
rm -rf vendor
|
|
mkdir vendor
|
|
tar -xf "$_vendor" -C vendor --strip-components=1
|
|
[[ -f vendor/$_wheel ]] || cp "$_wheel" vendor/
|
|
}
|
|
|
|
build() {
|
|
# Vulkan driver only: no GL, no gallium drivers, no window systems, no layers.
|
|
# The tarball has no .git; git_sha1.h is generated at compile time from this.
|
|
export MESA_GIT_SHA1_OVERRIDE=$_mesa_commit
|
|
meson setup "mesa-1-$_mesa_commit" build-mesa \
|
|
--prefix=/usr \
|
|
--libdir=lib \
|
|
--buildtype=release \
|
|
-Db_ndebug=true \
|
|
-Dvulkan-drivers=asahi \
|
|
-Dgallium-drivers= \
|
|
-Dplatforms= \
|
|
-Dvulkan-layers= \
|
|
-Dopengl=false \
|
|
-Dgles1=disabled \
|
|
-Dgles2=disabled \
|
|
-Degl=disabled \
|
|
-Dgbm=disabled \
|
|
-Dglx=disabled \
|
|
-Dllvm=enabled \
|
|
-Dshared-llvm=enabled \
|
|
-Dvalgrind=disabled \
|
|
-Dbuild-tests=false
|
|
meson compile -C build-mesa
|
|
DESTDIR="$srcdir/mesa-stage" meson install -C build-mesa
|
|
|
|
# The system venv and launchers, built offline from the hash-locked wheels.
|
|
cd "mlx-omarchy-$pkgver"
|
|
MLX_OMARCHY_CONV_RING=0 bash install.sh --system \
|
|
--dest-root "$srcdir/stage" \
|
|
--vendor "$srcdir/vendor" \
|
|
--lock "$srcdir/vendor/requirements-lock.txt"
|
|
}
|
|
|
|
check() {
|
|
grep -aq "(git-$_mesa_sha)" "$srcdir/mesa-stage/usr/lib/libvulkan_asahi.so"
|
|
"$srcdir/stage/usr/lib/omarchy-mlx/venv/bin/python" \
|
|
-c 'import mlx.core, mlx_omarchy_paths, mlx_omarchy_serve'
|
|
}
|
|
|
|
package_omarchy-mlx() {
|
|
pkgdesc='MLX for Apple Silicon Macs: GPU inference through Vulkan, with ANE support'
|
|
license=('MIT')
|
|
groups=('omarchy-platform-apple-silicon')
|
|
depends=("omarchy-mlx-vulkan=$pkgver-$pkgrel" 'python>=3.14' 'python<3.15'
|
|
'blas' 'gcc-libs' 'glibc' 'lapack' 'openblas' 'vulkan-icd-loader')
|
|
optdepends=('omarchy-ane-abi: Apple Neural Engine execution on qualified chips (omarchy-ane-dkms)')
|
|
cp -a "$srcdir/stage/usr" "$pkgdir/usr"
|
|
}
|
|
|
|
package_omarchy-mlx-vulkan() {
|
|
pkgdesc='Honeykrisp Vulkan driver for omarchy-mlx only (private ICD, not used by other programs)'
|
|
license=('MIT AND BSD-3-Clause AND SGI-B-2.0')
|
|
groups=('omarchy-platform-apple-silicon')
|
|
depends=('expat' 'gcc-libs' 'glibc' 'libdrm' 'libelf' 'llvm-libs' 'spirv-tools' 'zstd')
|
|
conflicts=('mesa-honeykrisp-omarchy')
|
|
|
|
local dir=/usr/lib/omarchy-mlx/vulkan
|
|
install -Dm755 "$srcdir/mesa-stage/usr/lib/libvulkan_asahi.so" "$pkgdir$dir/libvulkan_asahi.so"
|
|
# The ICD manifest stays out of the loader's search path; only omarchy-mlx
|
|
# names it. library_path is absolute.
|
|
python - "$srcdir/mesa-stage/usr/share/vulkan/icd.d/asahi_icd.aarch64.json" \
|
|
"$pkgdir$dir/honeykrisp_icd.aarch64.json" "$dir/libvulkan_asahi.so" <<'PY'
|
|
import json, sys
|
|
src, dst, lib = sys.argv[1:]
|
|
manifest = json.load(open(src))
|
|
manifest["ICD"]["library_path"] = lib
|
|
with open(dst, "w") as f:
|
|
json.dump(manifest, f, indent=4)
|
|
f.write("\n")
|
|
PY
|
|
chmod 644 "$pkgdir$dir/honeykrisp_icd.aarch64.json"
|
|
printf '%s\n' "$_mesa_sha" | install -Dm644 /dev/stdin "$pkgdir$dir/mesa-git-sha"
|
|
install -Dm644 "$srcdir/mesa-1-$_mesa_commit/docs/license.rst" \
|
|
"$pkgdir/usr/share/licenses/$pkgname/license.rst"
|
|
}
|