diff --git a/.github/workflows/miyoo_mini_release.yml b/.github/workflows/miyoo_mini_release.yml index b43276fd0..7142b0356 100644 --- a/.github/workflows/miyoo_mini_release.yml +++ b/.github/workflows/miyoo_mini_release.yml @@ -24,9 +24,7 @@ jobs: - name: Build working-directory: ${{github.workspace}} - run: > - source Packaging/miyoo_mini/toolchain_env.sh && - Packaging/miyoo_mini/build.sh + run: Packaging/miyoo_mini/build.sh - name: Upload-OnionOS-Package if: ${{ !env.ACT }} diff --git a/Packaging/miyoo_mini/build.sh b/Packaging/miyoo_mini/build.sh index 0451d70a5..e4458aaa0 100755 --- a/Packaging/miyoo_mini/build.sh +++ b/Packaging/miyoo_mini/build.sh @@ -21,16 +21,15 @@ main() { cmake_configure() { cmake -S. -B"$BUILD_DIR" \ - "-DTARGET_PLATFORM=miyoo_mini" \ - -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \ - -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \ + -DTARGET_PLATFORM=miyoo_mini \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="${PACKAGING_DIR}/toolchainfile.cmake" \ -DBUILD_TESTING=OFF \ - -DCMAKE_FIND_ROOT_PATH="/opt/miyoomini-toolchain/arm-linux-gnueabihf/sysroot" \ "$@" } cmake_build() { - cmake --build "$BUILD_DIR" + cmake --build "$BUILD_DIR" -j $(getconf _NPROCESSORS_ONLN) } build_custom_sdl() { @@ -41,6 +40,11 @@ build_custom_sdl() { # clone the repo and build the lib cd $BUILD_DIR/CustomSDL git clone $MIYOO_CUSTOM_SDL_REPO --branch $MIYOO_CUSTOM_SDL_BRANCH --single-branch . + + PATH="/opt/miyoomini-toolchain/usr/bin:${PATH}:/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/bin" \ + CROSS_COMPILE=/opt/miyoomini-toolchain/usr/bin/arm-linux-gnueabihf- \ + PREFIX=/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/usr \ + UNION_PLATFORM=miyoomini \ ./make.sh # change back to devilutionx root diff --git a/Packaging/miyoo_mini/setup_toolchain.sh b/Packaging/miyoo_mini/setup_toolchain.sh index 40905d404..d7f3fe0b7 100755 --- a/Packaging/miyoo_mini/setup_toolchain.sh +++ b/Packaging/miyoo_mini/setup_toolchain.sh @@ -6,7 +6,7 @@ main() { } install_toolchain() { - TOOLCHAIN_VERSION=v0.0.2 + TOOLCHAIN_VERSION=v0.0.3 TOOLCHAIN_TAR="miyoomini-toolchain.tar.xz" TOOLCHAIN_ARCH=`uname -m` @@ -35,6 +35,7 @@ install_dependencies() { cmake \ cmake-curses-gui \ cpio \ + gettext \ git \ libncurses5-dev \ make \ diff --git a/Packaging/miyoo_mini/toolchain_env.sh b/Packaging/miyoo_mini/toolchain_env.sh deleted file mode 100755 index 4f9a9a82a..000000000 --- a/Packaging/miyoo_mini/toolchain_env.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -export PATH="/opt/miyoomini-toolchain/usr/bin:${PATH}:/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/bin" -export CROSS_COMPILE=/opt/miyoomini-toolchain/usr/bin/arm-linux-gnueabihf- -export PREFIX=/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/usr -export UNION_PLATFORM=miyoomini diff --git a/Packaging/miyoo_mini/toolchainfile.cmake b/Packaging/miyoo_mini/toolchainfile.cmake new file mode 100644 index 000000000..1208664ee --- /dev/null +++ b/Packaging/miyoo_mini/toolchainfile.cmake @@ -0,0 +1,12 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR arm) +set(CMAKE_PROGRAM_PATH "/opt/miyoomini-toolchain/bin") +set(CMAKE_SYSROOT "/opt/miyoomini-toolchain/arm-linux-gnueabihf/sysroot") +set(CMAKE_FIND_ROOT_PATH "/opt/miyoomini-toolchain/arm-linux-gnueabihf/sysroot") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(ENV{PKG_CONFIG_SYSROOT_DIR} "/opt/miyoomini-toolchain/arm-linux-gnueabihf/sysroot") +set(CMAKE_C_COMPILER "/opt/miyoomini-toolchain/bin/arm-linux-gnueabihf-gcc")