From 78d83e1ff252b495bff4419589c0833ecdc8733e Mon Sep 17 00:00:00 2001 From: Justus Ranvier Date: Tue, 10 Sep 2024 13:45:10 -0500 Subject: [PATCH] build android artifacts --- .github/workflows/vcpkg.yml | 114 +++++++++++++------------ .gitignore | 4 + CMakeLists.txt | 3 + CMakePresets.json | 163 ++++++++++++++++++++++++++++++++++++ main.cpp | 1 + overlay | 2 +- vcpkg.json | 19 +++-- 7 files changed, 246 insertions(+), 60 deletions(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json create mode 100644 main.cpp diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index 07d63e1..357f634 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -9,62 +9,55 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-14-intel, macos-14-arm, windows-2022] + platform: [macos-arm64, macos-x64, windows-x64, android-arm64, android-x64] include: - - platform: macos-14-intel + - platform: macos-arm64 runner: 'macos-14-large' - triplet: 'x64-osx-14' - - platform: macos-14-arm + - platform: macos-x64 runner: 'macos-14-xlarge' - triplet: 'arm64-osx-14' - - platform: windows-2022 + - platform: windows-x64 runner: 'windows-2022-xl8' - triplet: 'x64-windows' - env: - VCPKG_INSTALLED_DIR: '${{ github.workspace }}/vcpkg_installed/${{ matrix.platform }}' - VCPKG_DEFAULT_TRIPLET: '${{ matrix.triplet }}' - VCPKG_DEFAULT_HOST_TRIPLET: '${{ matrix.triplet }}' - VCPKG_OVERLAY_TRIPLETS: '${{ github.workspace }}/overlay/triplets' + - platform: android-arm64 + runner: 'ubuntu-latest' + - platform: android-x64 + runner: 'ubuntu-latest' steps: - name: Get more disk space run: | - if [ "$RUNNER_OS" == "Linux" ]; then - sudo rm -rvf /usr/lib/mono - sudo rm -rvf /usr/local/lib/android - sudo rm -rvf /usr/local/share/vcpkg - sudo rm -rvf /usr/share/miniconda - elif [ "$RUNNER_OS" == "macOS" ]; then - sudo rm -rvf "/Applications/Xcode_14.3.1.app" - sudo rm -rvf "/Library/Frameworks/Mono.framework" - sudo rm -rvf "/Users/runner/Library/Android" - sudo rm -rvf "/usr/bin/link" - sudo rm -rvf "/usr/bin/link" - sudo rm -rvf "/usr/local/miniconda" - sudo rm -rvf "/usr/local/opt/geckodriver/bin" - sudo rm -rvf "/usr/local/share/chromedriver-mac-x64" - sudo rm -rvf "/usr/local/share/edge_driver" - sudo rm -rvf "/usr/local/share/vcpkg" - sudo rm -rvf '${GOROOT_1_20_X64}' - sudo rm -rvf '${GOROOT_1_21_X64}' - sudo rm -rvf '${GOROOT_1_22_X64}' - sudo rm -rvf '${JAVA_HOME_8_X64}' - sudo rm -rvf '${JAVA_HOME_11_X64}' - sudo rm -rvf '${JAVA_HOME_17_X64}' - sudo rm -rvf '${JAVA_HOME_21_X64}' - elif [ "$RUNNER_OS" == "Windows" ]; then - rm -rvf "C:\Android" - rm -rvf "C:\Miniconda" - rm -rvf "C:\Program Files\dotnet" - rm -rvf "C:\SeleniumWebDrivers\" - rm -rvf "C:\selenium\" - rm -rvf "C:\tools\Apache24" - rm -rvf "C:\tools\nginx-1.27.0" - rm -rvf "C:\vcpkg" - rm -rvf '${JAVA_HOME_8_X64}' - rm -rvf '${JAVA_HOME_11_X64}' - rm -rvf '${JAVA_HOME_17_X64}' - rm -rvf '${JAVA_HOME_21_X64}' - fi + if [ "$RUNNER_OS" == "Linux" ]; then + sudo rm -rvf /usr/lib/mono + sudo rm -rvf /usr/local/share/vcpkg + sudo rm -rvf /usr/share/miniconda + elif [ "$RUNNER_OS" == "macOS" ]; then + sudo rm -rvf "/Applications/Xcode_14.*.app" + sudo rm -rvf "/Library/Frameworks/Mono.framework" + sudo rm -rvf "/usr/bin/link" + sudo rm -rvf "/usr/bin/link" + sudo rm -rvf "/usr/local/miniconda" + sudo rm -rvf "/usr/local/opt/geckodriver" + sudo rm -rvf "/usr/local/share/chromedriver-mac-x64" + sudo rm -rvf "/usr/local/share/edge_driver" + sudo rm -rvf "/usr/local/share/vcpkg" + sudo rm -rvf '${GOROOT_1_20_X64}' + sudo rm -rvf '${GOROOT_1_21_X64}' + sudo rm -rvf '${GOROOT_1_22_X64}' + sudo rm -rvf '${JAVA_HOME_8_X64}' + sudo rm -rvf '${JAVA_HOME_11_X64}' + sudo rm -rvf '${JAVA_HOME_17_X64}' + sudo rm -rvf '${JAVA_HOME_21_X64}' + elif [ "$RUNNER_OS" == "Windows" ]; then + rm -rvf "C:\Miniconda" + rm -rvf "C:\Program Files\dotnet" + rm -rvf "C:\SeleniumWebDrivers\" + rm -rvf "C:\selenium\" + rm -rvf "C:\tools\Apache24" + rm -rvf "C:\tools\nginx-1.27.0" + rm -rvf "C:\vcpkg" + rm -rvf '${JAVA_HOME_8_X64}' + rm -rvf '${JAVA_HOME_11_X64}' + rm -rvf '${JAVA_HOME_17_X64}' + rm -rvf '${JAVA_HOME_21_X64}' + fi shell: bash continue-on-error: true - name: Setup XCode @@ -76,6 +69,20 @@ jobs: run: | if [ "$RUNNER_OS" == "macOS" ]; then brew install autoconf-archive automake libtool md4c + elif [ "$RUNNER_OS" == "Linux" ]; then + apt-get update && + DEBIAN_FRONTEND=noninteractive apt-get install -qq \ + autoconf \ + autoconf-archive \ + automake \ + libegl1-mesa-dev \ + libglu1-mesa-dev \ + libx11-xcb-dev \ + '^libxcb.*-dev' \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libxrender-dev fi shell: bash - name: Checkout source @@ -88,16 +95,15 @@ jobs: - name: Run vcpkg if: runner.os != 'Windows' uses: lukka/run-vcpkg@v11 - with: - vcpkgJsonGlob: 'vcpkg.json' - runVcpkgInstall: true - name: Run vcpkg if: runner.os == 'Windows' uses: lukka/run-vcpkg@v11 with: vcpkgDirectory: 'c:\vcpkg' - vcpkgJsonGlob: 'vcpkg.json' - runVcpkgInstall: true + - name: Build packages + uses: lukka/run-cmake@v10 + with: + workflowPreset: '${{ matrix.platform }}' - name: Compress packages run: | tar -czpf '${{ github.workspace }}/${{ matrix.platform }}.tar.gz' -C '${{ github.workspace }}/vcpkg_installed' '${{ matrix.platform }}' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c242c15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +vcpkg_installed/ +.clang-format + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6674dd6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.26.0) +project(libopentxs-dependency-builder) +add_executable(stub main.cpp) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..8081552 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,163 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 26, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "hidden": true, + "toolchainFile": + "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "environment": { + "VCPKG_KEEP_ENV_VARS": "ANDROID_SDK_ROOT", + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/overlay/triplets" + }, + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "VCPKG_INSTALL_OPTIONS": "--allow-unsupported", + "VCPKG_INSTALLED_DIR": + "${sourceDir}/vcpkg_installed/${presetName}" + } + }, + { + "name": "macos-arm64", + "inherits": [ + "default" + ], + "cacheVariables": { + "VCPKG_HOST_TRIPLET": "arm64-osx-14", + "VCPKG_TARGET_TRIPLET": "arm64-osx-14" + } + }, + { + "name": "macos-x64", + "inherits": [ + "default" + ], + "cacheVariables": { + "VCPKG_HOST_TRIPLET": "x64-osx-14", + "VCPKG_TARGET_TRIPLET": "x64-osx-14" + } + }, + { + "name": "windows-x64", + "inherits": [ + "default" + ], + "cacheVariables": { + "VCPKG_HOST_TRIPLET": "x64-windows", + "VCPKG_TARGET_TRIPLET": "x64-windows" + } + }, + { + "name": "android-x64", + "inherits": [ + "default" + ], + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-android" + } + }, + { + "name": "android-arm64", + "inherits": [ + "default" + ], + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "arm64-android" + } + } + ], + "buildPresets": [ + { + "name": "macos-arm64", + "configurePreset": "macos-arm64" + }, + { + "name": "macos-x64", + "configurePreset": "macos-x64" + }, + { + "name": "windows-x64", + "configurePreset": "windows-x64" + }, + { + "name": "android-arm64", + "configurePreset": "android-arm64" + }, + { + "name": "android-x64", + "configurePreset": "android-x64" + } + ], + "workflowPresets": [ + { + "name": "macos-arm64", + "steps": [ + { + "type": "configure", + "name": "macos-arm64" + }, + { + "type": "build", + "name": "macos-arm64" + } + ] + }, + { + "name": "macos-x64", + "steps": [ + { + "type": "configure", + "name": "macos-x64" + }, + { + "type": "build", + "name": "macos-x64" + } + ] + }, + { + "name": "windows-x64", + "steps": [ + { + "type": "configure", + "name": "windows-x64" + }, + { + "type": "build", + "name": "windows-x64" + } + ] + }, + { + "name": "android-arm64", + "steps": [ + { + "type": "configure", + "name": "android-arm64" + }, + { + "type": "build", + "name": "android-arm64" + } + ] + }, + { + "name": "android-x64", + "steps": [ + { + "type": "configure", + "name": "android-x64" + }, + { + "type": "build", + "name": "android-x64" + } + ] + } + ] +} diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..76e8197 --- /dev/null +++ b/main.cpp @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/overlay b/overlay index d84bea0..e429387 160000 --- a/overlay +++ b/overlay @@ -1 +1 @@ -Subproject commit d84bea05d209a7d740f4f33e634e04dc3b15b909 +Subproject commit e429387bd4747eaf47d4f216b3e70d3b8f12fca3 diff --git a/vcpkg.json b/vcpkg.json index cdc7da7..b9ff64e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,9 +1,8 @@ { - "$schema": - "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", - "name": "opentxs-dependency-builder", - "builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da", - "version": "1", + "$schema": + "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "name": "libopentxs-dependency-builder", + "version": "1", "dependencies": [ "boost-algorithm", { @@ -64,6 +63,16 @@ "widgets" ] }, + { + "name": "qtbase", + "platform": "android", + "default-features": false, + "features": [ + "egl", + "gles2", + "opengl" + ] + }, "qtdeclarative", "secp256k1", "simpleini",