mirror of
https://github.com/Ed94/VEFontCache-Odin.git
synced 2025-08-06 15:02:44 -07:00
Merge branch 'test_macos_action'
This commit is contained in:
62
.github/workflows/macos_build.yaml
vendored
Normal file
62
.github/workflows/macos_build.yaml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: MacOS Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
- '**'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up environment
|
||||||
|
run: |
|
||||||
|
if ! command -v git &> /dev/null; then
|
||||||
|
echo "Git not found. Installing Git..."
|
||||||
|
brew install git
|
||||||
|
else
|
||||||
|
echo "Git is already installed."
|
||||||
|
fi
|
||||||
|
git --version
|
||||||
|
|
||||||
|
brew install bash
|
||||||
|
echo "Bash version: $(bash --version)"
|
||||||
|
|
||||||
|
brew install freetype
|
||||||
|
brew install harfbuzz
|
||||||
|
brew install odin
|
||||||
|
|
||||||
|
make -C "/opt/homebrew/Cellar/odin/2024-10/libexec/vendor/stb/src"
|
||||||
|
|
||||||
|
- name: Run build script
|
||||||
|
run: |
|
||||||
|
echo "Setting execute permissions on specific .sh files"
|
||||||
|
chmod +x ./scripts/build_sokol_demo.sh
|
||||||
|
chmod +x ./scripts/build_sokol_library.sh
|
||||||
|
chmod +x ./scripts/compile_sokol_shaders.sh
|
||||||
|
chmod +x ./scripts/clean.sh
|
||||||
|
chmod +x ./scripts/helpers/misc.sh
|
||||||
|
chmod +x ./scripts/helpers/odin_compiler_defs.sh
|
||||||
|
|
||||||
|
echo "Running build_sokol_demo.sh"
|
||||||
|
./scripts/build_sokol_demo.sh
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: List build artifacts
|
||||||
|
run: ls -R ./build || echo "build directory not found"
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: macos-build
|
||||||
|
path: ./build/
|
||||||
|
if-no-files-found: warn
|
@@ -19,8 +19,22 @@ if [ -f "$path_system_details" ]; then
|
|||||||
CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2)
|
CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2)
|
||||||
CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2)
|
CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2)
|
||||||
else
|
else
|
||||||
CoreCount_Physical=$(nproc --all)
|
OS=$(uname -s)
|
||||||
CoreCount_Logical=$(nproc)
|
case "$OS" in
|
||||||
|
Darwin*)
|
||||||
|
CoreCount_Physical=$(sysctl -n hw.physicalcpu)
|
||||||
|
CoreCount_Logical=$(sysctl -n hw.logicalcpu)
|
||||||
|
;;
|
||||||
|
Linux*)
|
||||||
|
CoreCount_Physical=$(nproc --all)
|
||||||
|
CoreCount_Logical=$(nproc)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported operating system: $OS"
|
||||||
|
CoreCount_Physical=1
|
||||||
|
CoreCount_Logical=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "[CPU]" > "$path_system_details"
|
echo "[CPU]" > "$path_system_details"
|
||||||
echo "PhysicalCores=$CoreCount_Physical" >> "$path_system_details"
|
echo "PhysicalCores=$CoreCount_Physical" >> "$path_system_details"
|
||||||
@@ -47,7 +61,19 @@ update_git_repo "$path_sokol" "$url_sokol" "$sokol_build_clibs_command"
|
|||||||
update_git_repo "$path_harfbuzz" "$url_harfbuzz" "./scripts/build.sh"
|
update_git_repo "$path_harfbuzz" "$url_harfbuzz" "./scripts/build.sh"
|
||||||
|
|
||||||
pushd "$path_thirdparty" > /dev/null
|
pushd "$path_thirdparty" > /dev/null
|
||||||
path_harfbuzz_dlls="$path_harfbuzz/lib/linux64"
|
case "$OS" in
|
||||||
|
Darwin*)
|
||||||
|
path_harfbuzz_dlls="$path_harfbuzz/lib/osx"
|
||||||
|
;;
|
||||||
|
Linux*)
|
||||||
|
path_harfbuzz_dlls="$path_harfbuzz/lib/linux64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported operating system: $OS"
|
||||||
|
CoreCount_Physical=1
|
||||||
|
CoreCount_Logical=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
if ls "$path_harfbuzz_dlls"/*.so 1> /dev/null 2>&1; then
|
if ls "$path_harfbuzz_dlls"/*.so 1> /dev/null 2>&1; then
|
||||||
cp "$path_harfbuzz_dlls"/*.so "$path_build/"
|
cp "$path_harfbuzz_dlls"/*.so "$path_build/"
|
||||||
else
|
else
|
||||||
|
@@ -36,27 +36,45 @@ fi
|
|||||||
|
|
||||||
pushd "$path_sokol"
|
pushd "$path_sokol"
|
||||||
|
|
||||||
check_and_install() {
|
OS=$(uname -s)
|
||||||
if ! dpkg -s $1 &> /dev/null; then
|
case "$OS" in
|
||||||
echo "$1 not found. Attempting to install..."
|
Linux*)
|
||||||
sudo apt update && sudo apt install -y $1
|
echo "Detected Linux operating system"
|
||||||
if [ $? -ne 0 ]; then
|
# Check for OpenGL and X11 development libraries
|
||||||
echo "Failed to install $1. Please install manually and try again."
|
check_and_install() {
|
||||||
exit 1
|
if ! dpkg -s $1 &> /dev/null; then
|
||||||
fi
|
echo "$1 not found. Attempting to install..."
|
||||||
fi
|
sudo apt update && sudo apt install -y $1
|
||||||
}
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to install $1. Please install manually and try again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# Uncomment these lines if you need to install these dependencies
|
||||||
|
# check_and_install libgl1-mesa-dev
|
||||||
|
# check_and_install libx11-dev
|
||||||
|
# check_and_install libxcursor-dev
|
||||||
|
# check_and_install libxrandr-dev
|
||||||
|
# check_and_install libxinerama-dev
|
||||||
|
# check_and_install libxi-dev
|
||||||
|
# check_and_install libasound2-dev # ALSA development library
|
||||||
|
|
||||||
# Check for OpenGL and X11 development libraries
|
echo "Running Linux build script..."
|
||||||
# check_and_install libgl1-mesa-dev
|
./build_clibs_linux.sh
|
||||||
# check_and_install libx11-dev
|
;;
|
||||||
# check_and_install libxcursor-dev
|
Darwin*)
|
||||||
# check_and_install libxrandr-dev
|
echo "Detected macOS operating system"
|
||||||
# check_and_install libxinerama-dev
|
echo "Running macOS build script..."
|
||||||
# check_and_install libxi-dev
|
ls -al
|
||||||
# check_and_install libasound2-dev # ALSA development library
|
./build_clibs_macos.sh
|
||||||
|
;;
|
||||||
# Run the build script
|
*)
|
||||||
./build_clibs_linux.sh
|
echo "Unsupported operating system: $OS"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
echo "Build process completed."
|
||||||
|
@@ -1,12 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
OS=$(uname -s)
|
||||||
|
|
||||||
path_root="$(git rev-parse --show-toplevel)"
|
path_root="$(git rev-parse --show-toplevel)"
|
||||||
path_backend="$path_root/backend"
|
path_backend="$path_root/backend"
|
||||||
path_scripts="$path_root/scripts"
|
path_scripts="$path_root/scripts"
|
||||||
path_thirdparty="$path_root/thirdparty"
|
path_thirdparty="$path_root/thirdparty"
|
||||||
|
|
||||||
path_sokol_tools="$path_thirdparty/sokol-tools"
|
path_sokol_tools="$path_thirdparty/sokol-tools"
|
||||||
sokol_shdc="$path_sokol_tools/bin/linux/sokol-shdc"
|
case "$OS" in
|
||||||
|
Darwin*)
|
||||||
|
sokol_shdc="$path_sokol_tools/bin/osx/sokol-shdc"
|
||||||
|
;;
|
||||||
|
Linux*)
|
||||||
|
sokol_shdc="$path_sokol_tools/bin/linux/sokol-shdc"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported operating system: $OS"
|
||||||
|
CoreCount_Physical=1
|
||||||
|
CoreCount_Logical=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "Using sokol-shdc: $sokol_shdc"
|
||||||
|
chmod +x "$sokol_shdc"
|
||||||
|
|
||||||
path_backend_sokol="$path_backend/sokol"
|
path_backend_sokol="$path_backend/sokol"
|
||||||
|
|
||||||
@@ -42,4 +58,6 @@ pushd "$path_backend_sokol" > /dev/null
|
|||||||
"$flag_target_lang" "glsl410:glsl300es:hlsl4:metal_macos:wgsl" \
|
"$flag_target_lang" "glsl410:glsl300es:hlsl4:metal_macos:wgsl" \
|
||||||
"$flag_format_odin" "$flag_module=draw_text"
|
"$flag_format_odin" "$flag_module=draw_text"
|
||||||
|
|
||||||
|
echo "Built sokol shaders"
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
@@ -67,6 +67,7 @@ update_git_repo() {
|
|||||||
|
|
||||||
echo "Building $url"
|
echo "Building $url"
|
||||||
pushd "$path" > /dev/null
|
pushd "$path" > /dev/null
|
||||||
|
chmod +x "$build_command"
|
||||||
eval "$build_command"
|
eval "$build_command"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ update_git_repo() {
|
|||||||
|
|
||||||
echo "Building $url"
|
echo "Building $url"
|
||||||
pushd "$path" > /dev/null
|
pushd "$path" > /dev/null
|
||||||
|
chmod +x "$build_command"
|
||||||
eval "$build_command"
|
eval "$build_command"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user