Skip to content

Commit

Permalink
Merge branch 'master' into experiments/postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
christofmuc committed Jan 4, 2025
2 parents 2c3dbf7 + c691a99 commit 5a8318b
Show file tree
Hide file tree
Showing 71 changed files with 3,011 additions and 807 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/builds-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: push

jobs:
build-macos:
runs-on: macos-latest
runs-on: macos-13
steps:
- name: Checkout repository with tags
uses: actions/checkout@v2
Expand All @@ -17,25 +17,65 @@ jobs:
run: |
git submodule update --recursive --init --depth 1
- name: Bootstrap MacPorts
uses: melusina-org/setup-macports@v1

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install ICU via MacPorts, because they can do universal binaries!
run: |
port install icu +universal
- name: Prepare build machine with homebrew
run: |
brew install boost icu4c
brew install boost
brew remove --ignore-dependencies icu4c
- uses: actions/setup-python@v3
with:
python-version: '3.12'

- name: CMake configure
- name: Import Developer Certificate
run: |
echo "$MACOS_CERTIFICATE_BASE64" | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_TEMPORARY_KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -lut 3600 build.keychain
security unlock-keychain -p "$MACOS_TEMPORARY_KEYCHAIN_PASSWORD" build.keychain
security list-keychains -d user -s build.keychain $(security list-keychains -d user | sed s/\"//g)
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "$MACOS_TEMPORARY_KEYCHAIN_PASSWORD" build.keychain
security find-identity -v
env:
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
MACOS_CERTIFICATE_BASE64: ${{ secrets.MACOS_CERTIFICATE_BASE64 }}
MACOS_TEMPORARY_KEYCHAIN_PASSWORD: $ {{ secrets.MACOS_TEMPORARY_KEYCHAIN_PASSWORD }}

- name: Build the MacOS DMG
shell: bash
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=`brew --prefix icu4c`
export BUILD_TYPE=RelWithDebInfo
export BUILD_DIR=./build
security unlock-keychain -p "$MACOS_TEMPORARY_KEYCHAIN_PASSWORD" build.keychain
security find-identity -p codesigning -v
security find-certificate -c "$APPLE_DEVELOPER_IDENTITY"
make
make apple
env:
APPLE_DEVELOPER_IDENTITY: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID}}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
TEAM_ID: ${{ secrets.TEAM_ID }}
MACOS_TEMPORARY_KEYCHAIN_PASSWORD: $ {{ secrets.MACOS_TEMPORARY_KEYCHAIN_PASSWORD }}

- name: CMake build
run: cmake --build build --target package --parallel
- name: Archive DMG artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: DMG image
path: |
build/KnobKraft_Orm-*.dmg
- name: Publish release
uses: xresloader/upload-to-github-release@v1
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/builds-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Ubuntu KnobKraft Orm
name: Ubuntu 22 KnobKraft Orm

on: [push]

jobs:
build-linux:
build-ubuntu-22:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository with tags
Expand Down Expand Up @@ -36,6 +36,13 @@ jobs:
- name: CMake build
run: cmake --build builds --target package -- -j4

- name: Upload artifact for testing outside of a release
uses: actions/upload-artifact@v4
with:
name: ubuntu22-release
path: |
builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Linux.tar.gz
- name: Publish release
uses: xresloader/upload-to-github-release@v1
env:
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/builds-ubuntu24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Ubuntu 24 KnobKraft Orm

on: [push]

jobs:
build-ubuntu-24:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository with tags
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Additionally checkout submodules - don't use checkout action as it will overwrite refs
run: |
git submodule update --recursive --init --depth 1
- name: Install dependencies from apt-get
run: sudo apt-get -y update && sudo apt-get install -y libcurl4-openssl-dev pkg-config libtbb-dev libasound2-dev libboost-dev libgtk-3-dev libwebkit2gtk-4.1-dev libglew-dev libjack-dev libicu-dev

- name: Select proper Python version
uses: actions/setup-python@v2
with:
python-version: '3.12'
architecture: 'x64'

- name: CMake configure
env: # We get the SENTRY DSN from the repository's secret store
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
shell: bash
run: |
cmake -S . -B builds -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=off -DPYTHON_VERSION_TO_EMBED=3.12 -DSENTRY_CRASH_REPORTING=ON -DSENTRY_DSN=$SENTRY_DSN
- name: CMake build
run: |
cmake --build builds --target package -- -j4
mv builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Linux.tar.gz builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Ubuntu24.tar.gz
- name: Upload artifact for testing outside of a release
uses: actions/upload-artifact@v4
with:
name: ubuntu24-release
path: |
builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Ubuntu24.tar.gz
- name: Publish release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: builds/KnobKraft_Orm-${{env.ORM_VERSION}}-Ubuntu24.tar.gz
tags: true
draft: false

- name: Setup Sentry CLI
uses: mathieu-bour/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
organization: knobkraft
project: knobkraft

- name: Upload PDB files to Sentry for stack unwinding when this is a tagged build
if: startsWith(github.ref, 'refs/tags/')
working-directory: builds
run: |
sentry-cli upload-dif . --log-level=debug
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
builds/
*__pycache__*
.idea/
.vscode/
adaptations/CompiledAdaptions.h
third_party/Tools.InnoSetup.6.0.5/
builds6/
The-Orm/sentry-config.h
adaptations/CompiledAdaptations.h
codesigning/dsa_priv.pem
builds.old/
cmake-build-debug/
build_python310/
adaptations/testData/TORAIZ Artist Sound Pack Agreement.pdf
adaptations/testData/Toraiz AS-1 Synth Sunset Bank.tas1_bank
build2.0
build
build20231003
build_python38/
build_new_python/
.builds
56 changes: 39 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@

cmake_minimum_required(VERSION 3.14)

# Target a specific MacOS version (I have no idea which version I need, so let's try with Mavericks)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X version to target for deployment")
# Target a specific MacOS version.
# JUCE 8 refuses to build for anything older than 10.11, so let's try that.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X version to target for deployment")

option(UNIVERSAL_BINARY "Compile Intel and Apple Silicon universal binaries for macOS" ON)
if(UNIVERSAL_BINARY)
message("Universal binaries for Apple are selected, building for Apple M1 and Intel")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
endif()

# For old Apple < macOS 10.15 and Linux, do not allow C++ 17 because it won't work. With the newer nlohmann::json, we can specify the C++ version to use
add_compile_definitions(JSON_HAS_CPP_14)
Expand All @@ -18,7 +25,8 @@ project(KnobKraft_Orm)
option(ASAN "Use Address Sanitization for Debug version (Windows only for now)" OFF)

# Since we also build MacOS, we need C++ 17. Which is not a bad thing.
set(CMAKE_CXX_STANDARD 17)
# Gin requests C++ 20.
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)

Expand Down Expand Up @@ -108,10 +116,17 @@ IF (WIN32)
add_compile_options(/fsanitize=address)
endif()
ELSEIF(APPLE)
# For Intel Macs:
# set(ICU_ROOT "/usr/local/opt/icu4c")
# For Apple silicon:
# set(ICU_ROOT "/opt/homebrew/opt/icu4c")
IF(UNIVERSAL_BINARY)
# Use the macPort version of the icu4c library, as the homebrew version is not available as universal binary
#set(ICU_DEBUG 1)
set(ICU_ROOT "/opt/local")
ELSE()
# For Intel Macs:
message("Using ICU from homebrew for Intel. If you compile for Apple silicon please update the CMakeLists.txt here")
set(ICU_ROOT "/usr/local/opt/icu4c")
# For Apple silicon:
# set(ICU_ROOT "/opt/homebrew/opt/icu4c")
ENDIF()
find_package(ICU REQUIRED data uc)

# Supress a warning from juce_TargetPlatform by letting it know the build type
Expand All @@ -124,15 +139,19 @@ ELSEIF(APPLE)
# The JUCE font rendering is really fat on macOS, let us try to disable this flag
add_definitions(-DJUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING)
ELSEIF(UNIX)
# Include useful scripts for CMake
find_package(PkgConfig REQUIRED)
find_package(OpenGL)

# These calls create special `PkgConfig::<MODULE>` variables
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(GLEW REQUIRED IMPORTED_TARGET glew)
pkg_check_modules(WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.0)
find_package(ICU REQUIRED data uc)
# Include useful scripts for CMake
find_package(PkgConfig REQUIRED)
find_package(OpenGL)

# These calls create special `PkgConfig::<MODULE>` variables
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(GLEW REQUIRED IMPORTED_TARGET glew)
pkg_check_modules(WEBKIT IMPORTED_TARGET webkit2gtk-4.1)
if (NOT WEBKIT_FOUND EQUAL 1)
# If 4.1 is not available, we need 4.0
pkg_check_modules(WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.0)
endif()
find_package(ICU REQUIRED data uc)
ENDIF()

# We need to put our own CMake helpers on the module path
Expand Down Expand Up @@ -169,6 +188,9 @@ if(UNIX AND NOT APPLE)

# Also, as we will be building a shared module for Python, make sure GCC generates relocatable code suited for inclusion in a shared library
add_definitions(-fPIC)
# Pybind11 and gcc cause tons of visibility warnings together. This is the recommended way to get rid of them...
# https://github.com/pybind/pybind11/discussions/4862
add_compile_options(-fvisibility=hidden)
ENDIF()

# Include the SQLite wrapper for MidiKraft-database. The EXCLUDE_FROM_ALL is to prevent it from adding to the
Expand Down Expand Up @@ -203,7 +225,6 @@ target_compile_definitions(juce-static
JUCE_PLUGINHOST_VST=0
JUCE_PLUGINHOST_AU=0
DONT_SET_USING_JUCE_NAMESPACE=1
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_REPORT_APP_USAGE=0
JUCE_CHECK_MEMORY_LEAKS=0
JUCE_QUICKTIME=0
Expand Down Expand Up @@ -232,6 +253,7 @@ set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(third_party/json)
option(JSON_VALIDATOR_INSTALL "" OFF)
add_subdirectory(third_party/json-schema-validator)
option(FMT_INSTALL "" OFF)
add_subdirectory(third_party/fmt)
option(SPDLOG_FMT_EXTERNAL "" ON)
add_subdirectory(third_party/spdlog)
Expand Down
Loading

0 comments on commit 5a8318b

Please sign in to comment.