From c12a65133ba5a506a4746b0405fd043fbb4d755f Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Thu, 4 Apr 2024 23:27:03 +0300 Subject: [PATCH] Create CI build. --- .gitea/workflows/build.yaml | 25 +++++++++++++++++++++++++ Quik.Common | 2 +- Quik.FreeType.sln | 25 +++++++++++++++++++++++++ build_native.sh | 24 ++++++++++++++++++++---- 4 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 .gitea/workflows/build.yaml create mode 100644 Quik.FreeType.sln diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..cabb028 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,25 @@ +name: Build +run-name: Build Quik.FreeType on Docker. +on: + workflow_dispatch: + push: + branches: [master, stable] + +jobs: + build: + runs-on: ubuntu-latest + container: + image: git.mixedup.dev/quik/docker-cross-compiler + env: + QUIK_API_KEY: "${{secrets.QUIK_API_KEY}}" + volumes: + - ${{ gitea.workspace }}:/home/quik/src + steps: + - name: Check repository out. + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Run Build Script + run: "./build_native.sh" + - name: Publish Package + run: "Quik.Common/sh/publish.sh ." diff --git a/Quik.Common b/Quik.Common index d9c98b5..146f1e0 160000 --- a/Quik.Common +++ b/Quik.Common @@ -1 +1 @@ -Subproject commit d9c98b5cdc37b2ba1855c8fa9ce0fac8266b0f89 +Subproject commit 146f1e0855808d2c08489189a1923e2a7b8516fa diff --git a/Quik.FreeType.sln b/Quik.FreeType.sln new file mode 100644 index 0000000..3e76399 --- /dev/null +++ b/Quik.FreeType.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Quik.FreeType", "Quik.FreeType.csproj", "{A19CFEF1-19F1-41DD-A784-29AEE6072315}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A19CFEF1-19F1-41DD-A784-29AEE6072315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A19CFEF1-19F1-41DD-A784-29AEE6072315}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A19CFEF1-19F1-41DD-A784-29AEE6072315}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A19CFEF1-19F1-41DD-A784-29AEE6072315}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F64EFC25-A7C1-4A63-8068-D5626B24871F} + EndGlobalSection +EndGlobal diff --git a/build_native.sh b/build_native.sh index ca44911..42e0b04 100644 --- a/build_native.sh +++ b/build_native.sh @@ -1,8 +1,24 @@ #!/bin/bash cd $(dirname "$0") -# Apply the patch file that makes it easier to build freetype. -# Note that this doesn't work all that well on windows. -cat ../lib/freetype_patch.diff | git -C ../lib/freetype apply +CMAKE_DIR="$PWD/Quik.Common/cmake" +NOINSTALL=1 +QUIK_ADDITIONAL_CMAKE="-D BUILD_SHARED_LIBS=true -D NO_SONAME=true" -QUIK_ADDITIONAL_CMAKE=-DBUILD_SHARED_LIBS\=true DST=$PWD ../sh/quik_build_native.sh ../lib/freetype +./Quik.Common/sh/quik_build_native.sh "$PWD/freetype" + +# Copy out natives from their respective directories into runtimes +mkdir -p \ + ./runtimes/linux-arm/native \ + ./runtimes/linux-arm64/native \ + ./runtimes/linux-x64/native \ + ./runtimes/win-x64/native \ + ./runtimes/win-x86/native + +cp ./out/linux-arm/libfreetype.so runtimes/linux-arm/native/libfreetype.so +cp ./out/linux-arm64/libfreetype.so runtimes/linux-arm64/native/libfreetype.so +cp ./out/linux-x64/libfreetype.so runtimes/linux-x64/native/libfreetype.so +cp ./out/win-x64/libfreetype.dll runtimes/win-x64/native/libfreetype.dll +cp ./out/win-x86/libfreetype.dll runtimes/win-x86/native/libfreetype.dll + +dotnet build