Freedreno patches + remove non-functioning workflow file #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Android | ||
on: | ||
[push, pull_request] | ||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
arch: [ "arm32", "aarch64", "x86_64" ] | ||
fail-fast: false | ||
name: "Build for ${{matrix.arch}}" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: | | ||
mkdir /tmp/vulkan | ||
sudo apt update | ||
sudo apt install -y meson libxrandr-dev libxxf86vm-dev libxcb-*-dev libx11-xcb-dev libxfixes-dev libdrm-dev libx11-dev | ||
pip3 install mako | ||
export ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk-bundle" | ||
envsubst <android-drm-${{matrix.arch}} >build-crossfile-drm | ||
git clone --depth 1 https://gitlab.freedesktop.org/mesa/drm.git | ||
cd drm | ||
meson setup "build-android" \ | ||
--prefix=/tmp/drm-static \ | ||
--cross-file "../build-crossfile-drm" \ | ||
-Ddefault_library=static \ | ||
-Dintel=disabled \ | ||
-Dradeon=disabled \ | ||
-Damdgpu=disabled \ | ||
-Dnouveau=disabled \ | ||
-Dvmwgfx=disabled \ | ||
-Dfreedreno=enabled \ | ||
-Dvc4=disabled \ | ||
-Detnaviv=disabled \ | ||
-Dfreedreno-kgsl=true | ||
ninja -C "build-android" install | ||
cd .. | ||
envsubst <android-${{matrix.arch}} >build-crossfile | ||
git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git | ||
cd mesa | ||
wget https://gitlab.freedesktop.org/mesa/mesa/-/commit/bed69133cda5bb6e29beacd61a665ef653d4d1f9.diff | ||
git apply -v --whitespace=fix --reverse bed69133cda5bb6e29beacd61a665ef653d4d1f9.diff || echo "git apply failed" | ||
git apply -v --whitespace=fix ../mesa-zink.diff || echo "git apply failed" | ||
meson setup "build-android" \ | ||
--prefix=/tmp/mesa \ | ||
--cross-file "../build-crossfile" \ | ||
-Dplatforms=android \ | ||
-Dplatform-sdk-version=25 \ | ||
-Dandroid-stub=true \ | ||
-Dllvm=disabled \ | ||
-Dxlib-lease=disabled \ | ||
-Degl=disabled \ | ||
-Dgbm=disabled \ | ||
-Dglx=disabled \ | ||
-Dopengl=true \ | ||
-Dosmesa=true \ | ||
-Dvulkan-drivers= \ | ||
-Dgallium-drivers=freedreno,zink \ | ||
-Dfreedreno-kmds=kgsl \ | ||
-Dshared-glapi=false \ | ||
-Dandroid-libbacktrace=disabled \ | ||
-Dbuildtype=release | ||
cd build-android | ||
if [ ${{matrix.arch}} == 'x86_64' ]; then meson configure -Dgallium-drivers=zink; fi | ||
ninja install | ||
if [ ${{matrix.arch}} == 'aarch64' ] | ||
then | ||
export ndk=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin | ||
cd ../.. | ||
envsubst <android-${{matrix.arch}-vulkan} >build-crossfile | ||
cd mesa | ||
meson setup "build-android-vulkan" \ | ||
--cross-file "../build-crossfile" \ | ||
-Dbuildtype=release \ | ||
-Dplatforms=android \ | ||
-Dplatform-sdk-version=33 \ | ||
-Dandroid-stub=true \ | ||
-Dgallium-drivers= \ | ||
-Dvulkan-drivers=freedreno \ | ||
-Dfreedreno-kmds=kgsl \ | ||
-Db_lto=true | ||
ninja -C "build-android-vulkan" | ||
cp build-android-vulkan/src/freedreno/vulkan/libvulkan_freedreno.so /tmp/vulkan | ||
fi | ||
- name: Upload OSMesa | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: libOSMesa_${{matrix.arch}} | ||
path: /tmp/mesa | ||
- name: Upload Vulkan | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: turnip_${{matrix.arch}} | ||
path: /tmp/vulkan |