forked from notaz/mesa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMangoHud
executable file
·131 lines (121 loc) · 3.79 KB
/
MangoHud
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
MANGO_DIR=$HOME/.local/share/MangoHud
LIB64=$HOME/.local/share/MangoHud/libMangoHud64.so
LIB32=$HOME/.local/share/MangoHud/libMangoHud32.so
ubuntu-dep () {
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-setuptools \
python3-wheel ninja-build pkg-config \
libdrm-dev llvm libx11-xcb-dev zlib1g-dev \
libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev\
libxshmfence-dev gettext wget unzip git bison flex
sudo pip3 install meson mako
wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
unzip glslang-master-linux-Release.zip bin/glslangValidator
sudo install -m755 bin/glslangValidator /usr/local/bin/
rm bin/glslangValidator glslang-master-linux-Release.zip
}
configure () {
rm -r MangoHud-build64
meson MangoHud-build64 --libdir lib64 --prefix $PWD/build -D b_lto=false \
-D b_ndebug=true \
-D platforms=x11 \
-D dri-drivers=[] \
-D gallium-drivers=[] \
-D vulkan-drivers=intel \
-D swr-arches=avx,avx2 \
-D dri3=true \
-D egl=false \
-D gallium-extra-hud=false \
-D gallium-nine=false \
-D gallium-omx=disabled \
-D gallium-opencl=disabled \
-D gallium-va=false \
-D gallium-vdpau=false \
-D gallium-xa=false \
-D gallium-xvmc=false \
-D gbm=false \
-D gles1=false \
-D gles2=false \
-D glvnd=false \
-D glx=disabled \
-D libunwind=false \
-D llvm=true \
-D lmsensors=false \
-D osmesa=none \
-D opengl=false \
-D shader-cache=true \
-D shared-glapi=true \
-D valgrind=false \
-D vulkan-overlay-layer=true
export CC="gcc -m32"
export CXX="g++ -m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
export LLVM_CONFIG="/usr/bin/llvm-config32"
rm -r MangoHud-build32
meson MangoHud-build32 --libdir lib32 --prefix $PWD/build -D b_lto=false \
-D b_ndebug=true \
-D platforms=x11 \
-D dri-drivers=[] \
-D gallium-drivers=[] \
-D vulkan-drivers=intel \
-D swr-arches=avx,avx2 \
-D dri3=true \
-D egl=false \
-D gallium-extra-hud=false \
-D gallium-nine=false \
-D gallium-omx=disabled \
-D gallium-opencl=disabled \
-D gallium-va=false \
-D gallium-vdpau=false \
-D gallium-xa=false \
-D gallium-xvmc=false \
-D gbm=false \
-D gles1=false \
-D gles2=false \
-D glvnd=false \
-D glx=disabled \
-D libunwind=false \
-D llvm=true \
-D lmsensors=false \
-D osmesa=none \
-D opengl=false \
-D shader-cache=true \
-D shared-glapi=true \
-D valgrind=false \
-D vulkan-overlay-layer=true
}
install-mango () {
mkdir -p $MANGO_DIR
mkdir -p $HOME/.local/share/vulkan/implicit_layer.d
cp build/lib64/libMangoHud.so build/libMangoHud64.so
cp build/lib32/libMangoHud.so build/libMangoHud32.so
sed "s|libMangoHud.so|$LIB32|g" build/share/vulkan/implicit_layer.d/mangohud.json > build/mangohud32.json
sed "s|libMangoHud.so|$LIB64|g" build/share/vulkan/implicit_layer.d/mangohud.json > build/mangohud64.json
sed -i "s|MANGOHUD|MANGOHUD32|g" build/mangohud32.json
install build/libMangoHud32.so $HOME/.local/share/MangoHud/
install build/libMangoHud64.so $HOME/.local/share/MangoHud/
install build/mangohud32.json $HOME/.local/share/vulkan/implicit_layer.d/
install build/mangohud64.json $HOME/.local/share/vulkan/implicit_layer.d/
}
build () {
ninja -C MangoHud-build64 install
ninja -C MangoHud-build32 install
}
case $1 in
"ubuntu-dep")
ubuntu-dep
;;
"build")
build
;;
"configure")
configure
;;
"install-mango")
install-mango
;;
*)
echo "Uncregonized command"
;;
esac