Skip to content

Commit

Permalink
Merge branch 'master' into synths/roland_juno_ds
Browse files Browse the repository at this point in the history
# Conflicts:
#	adaptations/roland/GenericRoland.py
  • Loading branch information
christofmuc committed Jan 19, 2025
2 parents 9e29ab8 + aa455c9 commit 5c5240c
Show file tree
Hide file tree
Showing 153 changed files with 5,206 additions and 2,157 deletions.
58 changes: 50 additions & 8 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,23 +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
brew reinstall icu4c
ls /usr/local/Cellar/icu4c/
brew remove --ignore-dependencies icu4c
- uses: actions/setup-python@v3
with:
python-version: '3.10'
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=/usr/local/Cellar/icu4c/73.2
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
23 changes: 18 additions & 5 deletions .github/workflows/builds-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 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:
runs-on: ubuntu-20.04
build-ubuntu-22:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository with tags
uses: actions/checkout@v2
Expand All @@ -18,18 +18,31 @@ jobs:
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.0-dev libglew-dev libjack-dev libicu-dev libpython3-dev
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.0-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_EXECUTABLE=/usr/bin/python3.8 -DPYTHON_VERSION_TO_EMBED=3.8 -DSENTRY_CRASH_REPORTING=ON -DSENTRY_DSN=$SENTRY_DSN
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

- 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
71 changes: 71 additions & 0 deletions .github/workflows/builds-ubuntu24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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: |
cmake --version
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 cmake
- 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
2 changes: 1 addition & 1 deletion .github/workflows/builds-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Select proper Python version
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.12'
architecture: 'x64'

- name: Install NuGet
Expand Down
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +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
.builds
68 changes: 46 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,29 @@

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")

IF(APPLE)
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)
# 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)
ENDIF()

project(KnobKraft_Orm)

#set(USE_ASIO true)
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 All @@ -45,12 +55,12 @@ endfunction()
# For other platforms, we are using Python 3.10
if(WIN32)
# For Windows, specify the exact version to download, as the FetchContent will calculate the download URLs from it
set(PYTHON_VERSION_TO_DOWNLOAD "3.8.10" CACHE STRING "Specify which version of Python should be used for embedding, including patch level to download")
set(PYTHON_VERSION_TO_DOWNLOAD "3.12.2" CACHE STRING "Specify which version of Python should be used for embedding, including patch level to download")
parse_semver(${PYTHON_VERSION_TO_DOWNLOAD} PYTHON_EMBEDDED_MAJOR PYTHON_EMBEDDED_MINOR PYTHON_EMBEDDED_PATCH)
set(PYTHON_VERSION_TO_EMBED "${PYTHON_EMBEDDED_MAJOR}.${PYTHON_EMBEDDED_MINOR}")
set(PYTHON_VERSION_TO_COPY "${PYTHON_EMBEDDED_MAJOR}${PYTHON_EMBEDDED_MINOR}") # Note the missing dot
else()
set(PYTHON_VERSION_TO_EMBED "3.10" CACHE STRING "Specify which version of Python should be used for embedding.")
set(PYTHON_VERSION_TO_EMBED "3.12" CACHE STRING "Specify which version of Python should be used for embedding.")
endif()

# On Windows, we need to download external dependencies
Expand All @@ -59,8 +69,7 @@ IF (WIN32)
include(FetchContent REQUIRED)

FetchContent_Declare(
icu
URL https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-Win64-MSVC2017.zip
icu URL https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-Win64-MSVC2019.zip
)
FetchContent_MakeAvailable(icu)

Expand Down Expand Up @@ -101,7 +110,17 @@ IF (WIN32)
add_compile_options(/fsanitize=address)
endif()
ELSEIF(APPLE)
set(ICU_ROOT "/opt/homebrew/Cellar/icu4c/72.1")
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 @@ -114,15 +133,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 @@ -159,6 +182,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 @@ -193,7 +219,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 @@ -222,6 +247,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 All @@ -237,13 +263,11 @@ add_subdirectory(MidiKraft)
add_subdirectory(synths/access-virus)
add_subdirectory(synths/bcr2000)
add_subdirectory(synths/kawai-k3)
add_subdirectory(synths/korg-dw8000)
add_subdirectory(synths/oberheim-matrix1000)
add_subdirectory(synths/roland-mks50)
add_subdirectory(synths/roland-mks80)
add_subdirectory(synths/sequential-rev2)
add_subdirectory(synths/sequential-ob6)
add_subdirectory(synths/yamaha-refacedx)

# Add the generic adaptations module, that allows to define synths via Python
add_subdirectory(adaptations)
Expand Down
Loading

0 comments on commit 5c5240c

Please sign in to comment.