Skip to content

Commit e22cbe0

Browse files
committed
scripts: add build-mesa
1 parent 7a48bbe commit e22cbe0

5 files changed

Lines changed: 61 additions & 0 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ CMAKE_POLICY_VERSION_MINIMUM="4.1"
99
MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET:-26.0}"
1010
CFLAGS="-mcpu=native"
1111
CXXFLAGS="${CFLAGS}"
12+
PYTHONPATH="$(realpath .python)"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/src/**
22
!/src/.gitkeep
33

4+
.python/**
5+
!.python/requirements.txt
6+
47
mpv.tar.gz

.python/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mako
2+
packaging
3+
pyyaml

build-mesa

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash -e
2+
#
3+
# mesa
4+
# https://gitlab.freedesktop.org/mesa/mesa.git
5+
#
6+
# Dependencies:
7+
# - brew install libclc spirv-llvm-translator
8+
# - pip3 install -t .python -r .python/requirements.txt
9+
# - ./build-spirv-tools
10+
#
11+
cd "$(dirname "$0")"
12+
set -a; . .env; set +a
13+
14+
pkgname="mesa"
15+
pkgdir="${STOWDIR}/${pkgname}"
16+
srcdir="src/mesa"
17+
builddir="${TMPDIR:-/tmp}/build.${pkgname}"
18+
19+
echo
20+
echo "*** $0: started"
21+
22+
rm -rf "${builddir}"
23+
24+
meson setup "${builddir}" "${srcdir}" \
25+
--prefix="${pkgdir}" \
26+
--native-file=meson/native/llvm.ini \
27+
-Dwrap_mode=nodownload \
28+
-Dbuildtype=release \
29+
-Db_lto=true \
30+
-Db_lto_mode=thin \
31+
-Dplatforms=macos \
32+
-Dvulkan-drivers=kosmickrisp \
33+
-Dgallium-drivers=[] \
34+
-Dvideo-codecs=all \
35+
-Dopengl=disabled \
36+
-Dgles1=disabled \
37+
-Dgles2=disabled \
38+
-Dglx=disabled \
39+
-Dxmlconfig=disabled \
40+
-Dzstd=disabled \
41+
"$@"
42+
43+
meson compile -C "${builddir}"
44+
45+
rm -rf "${pkgdir}"
46+
47+
meson install -C "${builddir}"
48+
stow -Rd "${STOWDIR}" "${pkgname}"
49+
50+
rm -rf "${builddir}"
51+
52+
echo "*** $0: finished"

meson/native/llvm.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[binaries]
2+
llvm-config = '/opt/local/opt/llvm/bin/llvm-config'

0 commit comments

Comments
 (0)