]> git.armaanb.net Git - asd-repo.git/blob - extra/mesa/build
Adapt for asd linux
[asd-repo.git] / extra / mesa / build
1 #!/bin/sh -e
2
3 # Install python-mako which is solely needed for mesa
4 # and thus contained in this build.
5 {
6     cd mako
7
8     python3 setup.py build
9     python3 setup.py install \
10         --prefix=/usr \
11         --root="$PWD/dist"
12
13     # Use a glob to avoid having to figure out the Python
14     # version for the path below.
15     cd dist/usr/lib/python*/site-packages
16
17     # Set the PYTHONPATH so python knows where to find mako.
18     # The one liner simply appends the existing path and
19     # handles the case where an unset PYTHONPATH breaks
20     # python as it will only contain our new addition.
21     PYTHONPATH=$PWD:$(python -c "import sys; print(':'.join(sys.path))")
22
23     cd -; cd ..
24 }
25
26 export PYTHONPATH
27 export DESTDIR="$1"
28 export CFLAGS="$CFLAGS -DGLX_X86_READONLY_TEXT"
29
30 # Fix issues with musl and firefox.
31 # https://bugs.freedesktop.org/show_bug.cgi?id=35268
32 # https://github.com/mesa3d/mesa/commit/9f37c9903b87f86a533bfaffa72f0ecb285b02b2
33 sed -i "/pre_args += '-DUSE_ELF_TLS'/d" meson.build
34
35 python3 bin/git_sha1_gen.py --output include/git_sha1.h
36
37 meson \
38     --prefix=/usr \
39     --sysconfdir=/etc \
40     --mandir=/usr/share/man \
41     --localstatedir=/var \
42     --buildtype=release \
43     -Dplatforms=x11 \
44     -Dzstd=enabled \
45     . output
46
47 ninja -C output
48 ninja -C output install
49