From 57260e5de8e4fcca7154016ffacd74b157c3d40b Mon Sep 17 00:00:00 2001 From: SolDev69 <40839581+SolDev69@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:34:42 +0000 Subject: [PATCH] Add ios build files I have no idea what I'm doing --- .github/workflows/pojav-gallium-ios.yml | 65 +++++++++++++++++++++++++ ios-aarch64 | 19 ++++++++ ios-drm-aarch64 | 19 ++++++++ 3 files changed, 103 insertions(+) create mode 100644 .github/workflows/pojav-gallium-ios.yml create mode 100644 ios-aarch64 create mode 100644 ios-drm-aarch64 diff --git a/.github/workflows/pojav-gallium-ios.yml b/.github/workflows/pojav-gallium-ios.yml new file mode 100644 index 00000000000..e0255758040 --- /dev/null +++ b/.github/workflows/pojav-gallium-ios.yml @@ -0,0 +1,65 @@ + +name: Build iOS + +on: + [push, pull_request] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build iOS + run: | + git clone --depth 1 https://github.com/KhronosGroup/MoltenVK + brew install meson pkg-config + # sudo apt install -y meson libxrandr-dev libxxf86vm-dev libxshmfence-dev libxcb-*-dev libx11-xcb-dev libxfixes-dev libdrm-dev libx11-dev + # cp -R /usr/include/X11 include/ + # cp -R /usr/include/xcb include/ + # cp -R /usr/include/GL/* include/GL/ + pip3 install mako + # -Dglx=gallium-xlib \ + # -Dglx=dri + envsubst build-crossfile-drm + git clone --depth 1 https://gitlab.freedesktop.org/mesa/drm.git + cd drm + meson setup "build-ios-libdrm" \ + --prefix=/Users/runner/work/unified-mesa-project/unified-mesa-project/libdrm \ + --cross-file "../build-crossfile-drm" \ + -Ddefault_library=static \ + -Dintel=disabled \ + -Dradeon=disabled \ + -Damdgpu=disabled \ + -Dnouveau=disabled \ + -Dvmwgfx=disabled \ + -Dfreedreno=disabled \ + -Dvc4=disabled \ + -Detnaviv=disabled + ninja -C build-ios-libdrm install + cd .. + envsubst build-crossfile + meson build-ios-aarch64 \ + --prefix="/tmp/mesa" \ + --cross-file "build-crossfile" \ + -Dmoltenvk-dir=../../../../MoltenVK/MoltenVK \ + -Db_lundef=false \ + -Dllvm=disabled \ + -Dxlib-lease=disabled \ + -Degl=disabled \ + -Dgbm=disabled \ + -Dglx=dri \ + -Dglx-direct=true \ + -Dopengl=true \ + -Dosmesa=true \ + -Dvulkan-drivers= \ + -Dgallium-drivers=zink + ninja -C build-ios-aarch64 install + # cp build-ios-aarch64/src/gallium/drivers/zink/libzink.a /tmp/zink/lib/ + install_name_tool -change /tmp/zink/lib/libglapi.0.dylib @executable_path/Frameworks/libglapi.0.dylib.framework/libglapi.0.dylib -add_rpath @executable_path/Frameworks/libMoltenVK.dylib.framework /tmp/zink/lib/libOSMesa.8.dylib + - name: Upload libraries + uses: actions/upload-artifact@v2 + with: + name: libOSMesa + path: /tmp/mesa \ No newline at end of file diff --git a/ios-aarch64 b/ios-aarch64 new file mode 100644 index 00000000000..79b6b543376 --- /dev/null +++ b/ios-aarch64 @@ -0,0 +1,19 @@ +[binaries] + +ar = 'ar' +c = ['ccache', 'clang', '-O3', '-DVK_USE_PLATFORM_IOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT', '-DVK_ENABLE_BETA_EXTENSIONS', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=12.0', '-fPIC'] +cpp = ['ccache', 'clang++', '-O3', '-DVK_USE_PLATFORM_IOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT', '-DVK_ENABLE_BETA_EXTENSIONS', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=12.0', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++'] +c_ld = 'ld' +cpp_ld = 'ld' +strip = 'strip' +# Android doesn't come with a pkg-config, but we need one for meson to be happy not +# finding all the optional deps it looks for. Use system pkg-config pointing at a +# directory we get to populate with any .pc files we want to add for Android +pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=/Users/runner/work/unified-mesa-project/unified-mesa-project/libdrm', 'pkg-config'] + +[host_machine] +# or linux? +system = 'darwin' +cpu_family = 'arm' +cpu = 'armv8' +endian = 'little' \ No newline at end of file diff --git a/ios-drm-aarch64 b/ios-drm-aarch64 new file mode 100644 index 00000000000..934d3776a7b --- /dev/null +++ b/ios-drm-aarch64 @@ -0,0 +1,19 @@ +[binaries] + +ar = 'ar' +c = ['ccache', 'clang', '-O3', '-DVK_USE_PLATFORM_IOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT', '-DVK_ENABLE_BETA_EXTENSIONS', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=12.0', '-fPIC'] +cpp = ['ccache', 'clang++', '-O3', '-DVK_USE_PLATFORM_IOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT', '-DVK_ENABLE_BETA_EXTENSIONS', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=12.0', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++'] +c_ld = 'ld' +cpp_ld = 'ld' +strip = 'strip' +# Android doesn't come with a pkg-config, but we need one for meson to be happy not +# finding all the optional deps it looks for. Use system pkg-config pointing at a +# directory we get to populate with any .pc files we want to add for Android +pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', 'pkg-config'] + +[host_machine] +# or linux? +system = 'darwin' +cpu_family = 'arm' +cpu = 'armv8' +endian = 'little' \ No newline at end of file