Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/bin/update-android-headers.sh
4545 views
1
#!/bin/sh
2
3
set -eu
4
5
if [ ! -e .git ]; then
6
echo must run from top-level directory;
7
exit 1
8
fi
9
10
if [ ! -d platform-hardware-libhardware ]; then
11
git clone --depth 1 https://android.googlesource.com/platform/hardware/libhardware platform-hardware-libhardware
12
git clone --depth 1 https://android.googlesource.com/platform/system/core platform-system-core
13
git clone --depth 1 https://android.googlesource.com/platform/frameworks/native platform-frameworks-native
14
fi
15
16
dest=include/android_stub
17
18
# Persist the frozen Android N system/window.h for backward compatibility
19
20
cp -av ${dest}/system/window.h platform-system-core/libsystem/include/system
21
22
rm -rf ${dest}
23
mkdir ${dest}
24
25
26
# These directories contains mostly only the files we need, so copy wholesale
27
28
cp -av platform-frameworks-native/libs/nativewindow/include/vndk \
29
platform-system-core/libsync/include/sync \
30
platform-system-core/libsync/include/ndk \
31
platform-system-core/libbacktrace/include/backtrace \
32
platform-system-core/libsystem/include/system \
33
platform-system-core/liblog/include/log \
34
platform-frameworks-native/libs/nativewindow/include/apex \
35
platform-frameworks-native/libs/nativebase/include/nativebase \
36
${dest}
37
38
39
# We only need a few files from these big directories so just copy those
40
41
mkdir ${dest}/hardware
42
cp -av platform-hardware-libhardware/include/hardware/{hardware,gralloc,gralloc1,fb}.h ${dest}/hardware
43
cp -av platform-frameworks-native/vulkan/include/hardware/hwvulkan.h ${dest}/hardware
44
45
mkdir ${dest}/cutils
46
cp -av platform-system-core/libcutils/include/cutils/{log,native_handle,properties}.h ${dest}/cutils
47
48
49
# include/android has files from a few different projects
50
51
mkdir ${dest}/android
52
cp -av platform-frameworks-native/libs/nativewindow/include/android/* \
53
platform-frameworks-native/libs/arect/include/android/* \
54
platform-system-core/liblog/include/android/* \
55
platform-system-core/libsync/include/android/* \
56
${dest}/android
57
58
59