Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable linux and mac build in workflow #19

Open
wants to merge 71 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
378d054
Enable linux build and cleanups
stekyne Jul 8, 2023
20e1f5a
Install build essentials
stekyne Jul 8, 2023
96ceaf3
Updated VCPKG version
stekyne Oct 26, 2023
8ef9e0a
Moved OpcodeBase to shared folder
stekyne Oct 26, 2023
e36ef58
More changes for linux build
stekyne Oct 31, 2023
ead0da6
Update VCPKG version to match csound repo
stekyne Oct 31, 2023
6bc0245
Updated vcpkg again
stekyne Oct 31, 2023
71271c3
Update version
stekyne Nov 1, 2023
ba53e8e
Reorder linux platform setup
stekyne Nov 1, 2023
70d47c0
Update VCPKG
stekyne Nov 2, 2023
6417e9a
Split out vcpkg bootstrap
stekyne Nov 2, 2023
5aa9d61
Reorg platform order
stekyne Nov 2, 2023
0b880d4
Update VCPKG
stekyne Dec 30, 2023
ded4a80
Fixed workflow file
stekyne Dec 30, 2023
cf0b9bd
Disable csound install
stekyne Dec 31, 2023
3ace7c3
Added csound headers to repo
stekyne Dec 31, 2023
03a7d51
Update csound header includes
stekyne Dec 31, 2023
bf251ab
Cleaned up csound inclusion in cmake
stekyne Dec 31, 2023
ad4cb44
Remove csound installation for linux
stekyne Dec 31, 2023
948b287
Remove caching
stekyne Dec 31, 2023
4af3d0a
Remove unneeded hint
stekyne Dec 31, 2023
334d4a2
Fix workflow
stekyne Dec 31, 2023
093ad78
Remove FLTK package
stekyne Dec 31, 2023
7d315eb
Enable binary caching
stekyne Dec 31, 2023
0f49c7d
Minor cleanups
stekyne Jan 2, 2024
b042f6c
Cleaned up ableton link cmake
stekyne Jan 2, 2024
b3a50dd
Cleaned up websockets cmake
stekyne Jan 2, 2024
4faf234
Remove uneeded include
stekyne Jan 2, 2024
c3b4402
Cleaned up faust cmake file
stekyne Jan 7, 2024
6d9e98e
Set minimum cmake version
stekyne Jan 7, 2024
6b7e1fb
Misc cleanups
stekyne Jan 7, 2024
5f4b5bc
Cleaned up cmake files
stekyne Jan 7, 2024
7d7ce86
Cleaned up ableton link cmake
stekyne Jan 7, 2024
a31aec9
Updated cmake files for opcodes
stekyne Jan 10, 2024
0e753b1
Remove unused triplet file
stekyne Jan 10, 2024
34056fc
Updated vcpkg
stekyne Jan 10, 2024
41aabef
Update vcpkg version
stekyne Jan 12, 2024
8bc9b8a
Disable fltk build for linux
stekyne Jan 12, 2024
d89fd0a
Disable fluidsynth build on Windows
stekyne Jan 12, 2024
b5b788c
Clean up cmake for opcodes
stekyne Jan 18, 2024
5e14b6a
Enable fluidsynth again on Windows
stekyne Jan 18, 2024
012713e
Switch to official VCPKG cache instead of 3rd party action
stekyne Feb 2, 2024
93a287e
Fixed some warnings
stekyne Sep 19, 2024
3dad9ef
Updated VCPKG
stekyne Sep 19, 2024
24fbc58
Updated upload artifact action
stekyne Sep 19, 2024
c3243f5
Move common cmake/dependency files out to root
stekyne Sep 20, 2024
f1fe68f
Cleaned up websockets cmake
stekyne Sep 20, 2024
41caa3d
Cleaned up cmakes root
stekyne Sep 20, 2024
6af7d91
Debug CI issue
stekyne Sep 21, 2024
866c190
Added back VCPKG to root dir
stekyne Sep 23, 2024
8af12c9
Remove debugging code in workflow
stekyne Sep 23, 2024
ce22630
Update vcpkg baseline
stekyne Sep 23, 2024
7da31d4
Switch windows target triplet for vcpkg
stekyne Sep 25, 2024
5e3fd20
Remove fluidsynth from vcpkg list as it's broken
stekyne Sep 25, 2024
7907ea7
Renamed python cs7 plugin for the time being
stekyne Sep 25, 2024
017a4ff
Disable fluidsynth build
stekyne Sep 25, 2024
29bb2a4
Disable required keyword for fluidsynth
stekyne Sep 25, 2024
d7c976e
Fixed target name
stekyne Sep 26, 2024
acc48cf
Added csound 7 headers and moved them to new folders
stekyne Sep 26, 2024
6258231
Vscode config additiosn
stekyne Sep 26, 2024
2c1cc49
Updated Cmake to build and install version 6 and 7 of plugins
stekyne Oct 4, 2024
e64eb11
Added back macos CI
stekyne Oct 4, 2024
755961e
Fixed make_plugin call for websockets
stekyne Oct 4, 2024
b32d05a
Add back bootstrap for mac
stekyne Oct 4, 2024
7c9def5
Fixed str in cmake findfaust
stekyne Oct 4, 2024
1f25761
Remove installation of csound for CI, including headers in repo
stekyne Oct 4, 2024
266ca5f
Set CRT for msvc in cmake
stekyne Oct 4, 2024
e863504
Added missing varaible
stekyne Oct 7, 2024
809e7b2
Fixed MSVC runtime CRT library issue
stekyne Oct 9, 2024
2a08fa3
Fix CI installer workflow
stekyne Oct 9, 2024
2e1654a
Lock MacOS CI to v13 not latest
stekyne Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 29 additions & 43 deletions .github/workflows/plugins_build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Csound plugins build

env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

on:
push:
Expand All @@ -21,15 +21,11 @@ jobs:

strategy:
matrix:
os: [windows-latest]
version: ["6.17.0"]
os: [windows-latest, ubuntu-latest, "macos-13"]
include:
- os: "windows-latest"
mono: ""
# - os: "ubuntu-latest"
# mono: "mono"
# - os: "macos-latest"
# mono: "mono"
- os: "ubuntu-latest"
- os: "macos-13"

steps:
- name: Checkout Source Code
Expand All @@ -45,55 +41,45 @@ jobs:
run: |
Invoke-WebRequest $env:FAUST_URL -OutFile faustInstaller.exe
./faustInstaller.exe /S
echo "C:/Program Files/Faust;C:/Program Files/Faust/lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:/Program Files/csound/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "OPCODE6DIR64=C:/Program Files/csound/plugins64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PYTHONPATH=C:/Program Files/csound/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RAWWAVE_PATH=C:/Program Files/csound/samples" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
.\6.x\vcpkg\bootstrap-vcpkg.bat
choco install csound --version=6.17.0
echo $GITHUB_ENV
ls 'C:\Program Files\Faust\'
echo "C:\Program Files\Faust\;C:\Program Files\Faust\lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
.\vcpkg\bootstrap-vcpkg.bat

# - name: Setup platform (linux)
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# ./vcpkg/bootstrap-vcpkg.sh
# sudo apt-get update
# sudo apt-get install libcsound64-dev
- name: Setup platform (linux)
if: startsWith(matrix.os, 'ubuntu')
run: ./vcpkg/bootstrap-vcpkg.sh

# - name: Setup platform (macos)
# if: startsWith(matrix.os, 'macos')
# run: |
# ./vcpkg/bootstrap-vcpkg.sh
# brew install csound

- name: Setup VCPKG cache
shell: bash
- name: Setup platform (macos)
if: startsWith(matrix.os, 'macos')
run: |
${{ matrix.mono }} `./6.x/vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/csound/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "csound" \
-password "${{ secrets.GITHUB_TOKEN }}"
${{ matrix.mono }} `./6.x/vcpkg/vcpkg fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/csound/index.json"
./vcpkg/bootstrap-vcpkg.sh

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Generate CMake build
run: cmake 6.x/. -B build -DUSE_VCPKG=1
run: cmake -B build -DUSE_VCPKG=1

- name: Build plugins
run: cmake --build build --config Release

- name: Build installer
run: iscc /o. .\installer\win64\Installer.iss
- name: Build installer (windows)
if: startsWith(matrix.os, 'windows') && github.ref == 'refs/heads/develop'
run: |
iscc /o. .\6.x\installer\win64\Installer.iss
# iscc /o. .\7.x\installer\win64\Installer.iss

- name: Upload installer
uses: actions/upload-artifact@v2
- name: Upload installer (windows)
if: startsWith(matrix.os, 'windows') && github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_win_x64-${{env.CSOUND_VERSION}}.${{github.run_number}}-plugins-installer
path: ./csound6-plugins-win_x86_64-*.exe
path: ./6.x/csound6-plugins-win_x86_64-*.exe
if-no-files-found: error
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vcpkg"]
path = 6.x/vcpkg
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"files.associations": {
"lame.h": "c"
"lame.h": "c",
"pythonopcodes.h": "c",
"csdl.h": "c"
}
}
110 changes: 6 additions & 104 deletions 6.x/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,9 @@
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0077 NEW)

option(USE_VCPKG "Use VCPKG to download and manage dependencies" OFF)

if (USE_VCPKG)
# Detect correct triplet based on CMake env
if (WIN32)
set(VCPKG_HOST_TRIPLET "x64-windows-csound" CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-windows-csound")
set(CSOUND_INCLUDE_DIR_HINT "C:/Program Files/Csound6_x64")
elseif(APPLE)
set(VCPKG_HOST_TRIPLET "x64-osx" CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-osx")
elseif (UNIX)
set(VCPKG_HOST_TRIPLET "x64-linux" CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-linux")
endif()

set(VCPKG_FEATURE_FLAGS versions)
set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_CURRENT_SOURCE_DIR}/)
set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")
endif()

project(Csound-plugins)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANG 1)
endif()

set(APIVERSION "6.0")

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

find_package(CSOUND)

if(NOT CSOUND_INCLUDE_DIRS)
message(FATAL_ERROR "Csound header files are required")
endif()
set(APIVERSION "6.0")

include(TestBigEndian)
include(CheckFunctionExists)
Expand All @@ -52,7 +13,7 @@ include(CheckCXXCompilerFlag)
### COMPILER OPTIMIZATION FLAGS
option(USE_COMPILER_OPTIMIZATIONS "Use the default Csound compiler optimization flags" ON)
if(USE_COMPILER_OPTIMIZATIONS)
include(${CMAKE_SOURCE_DIR}/cmake/CompilerOptimizations.cmake)
include("${CMAKE_SOURCE_DIR}/cmake/CompilerOptimizations.cmake")
endif()

##/Library/Frameworks/CsoundLib64.framework/Versions/Current/Resources/Opcodes64
Expand Down Expand Up @@ -182,70 +143,11 @@ if(APPLE)
endif()
message("-- Plugins to be installed at: ${PLUGIN_INSTALL_DIR}")

# Checks if dependencies for an enabled target are fulfilled.
# If FAIL_MISSING is true and the dependencies are not fulfilled,
# it will abort the cmake run.
# If FAIL_MISSING is false, it will set the option to OFF.
# If the target is not enabled, it will do nothing.
# example: check_deps(BUILD_NEW_PARSER FLEX_EXECUTABLE BISON_EXECUTABLE)
function(check_deps option)
if(${option})
set(i 1)
while( ${i} LESS ${ARGC} )
set(dep ${ARGV${i}})
if(NOT ${dep})
if(FAIL_MISSING)
message(FATAL_ERROR
"${option} is enabled, but ${dep}=\"${${dep}}\"")
else()
message(STATUS "${dep}=\"${${dep}}\", so disabling ${option}")
set(${option} OFF PARENT_SCOPE)
# Set it in the local scope too
set(${option} OFF)
endif()
endif()
math(EXPR i "${i}+1")
endwhile()
endif()
if(${option})
message(STATUS "${option} is enabled.")
else()
message(STATUS "${option} is disabled.")
endif()
endfunction(check_deps)

# Utility function to make plugins. All plugin targets should use this as it
# sets up output directory set in top-level CmakeLists.txt
# and adds the appropriate install target
#
# libname - name of library to produce
# srcs - list of src files (must be quoted if a list)
# extralibs (OPTIONAL) - extra libraries to link the plugin to
#
# NB - this was moved here as it needs some VARS defined above
# for setting up the framework
function(make_plugin libname srcs)
if(APPLE)
add_library(${libname} SHARED ${srcs})
else()
add_library(${libname} MODULE ${srcs})
endif()

set(i 2)
while( ${i} LESS ${ARGC} )
target_link_libraries(${libname} PRIVATE ${ARGV${i}})
math(EXPR i "${i}+1")
endwhile()
# Include utility functions for making plugins
include("${CMAKE_SOURCE_DIR}/cmake/utilities.cmake")

install(TARGETS ${libname}
LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}"
ARCHIVE DESTINATION "${PLUGIN_INSTALL_DIR}" )
endfunction(make_plugin)

#checking pthread functions
# Checking pthread functions
if(REQUIRE_PTHREADS AND (PTHREAD_LIBRARY OR HAIKU))

#list(APPEND libcsound_CFLAGS -DHAVE_PTHREAD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_PTHREAD")

check_function_exists(pthread_spin_lock PTHREAD_SPIN_LOCK_EXISTS)
Expand Down Expand Up @@ -311,4 +213,4 @@ add_subdirectory(./src/mp3)
add_subdirectory(./src/wiimote)
add_subdirectory(./src/p5glove)
add_subdirectory(./src/jackops)
add_subdirectory(./src/fluidOpcodes)
add_subdirectory(./src/fluidOpcodes)
92 changes: 92 additions & 0 deletions 6.x/csound/CppSound.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* C S O U N D
*
* L I C E N S E
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CSND_CPPSOUND_H
#define CSND_CPPSOUND_H

#include "float-version.h"
#ifndef __MYFLT_DEF
#define __MYFLT_DEF
#ifdef USE_DOUBLE
#define MYFLT double
#else
#define MYFLT float
#endif
#endif

#ifdef SWIG
%module csnd6
%include "std_string.i"
%include "std_vector.i"
%{
#include "csound.hpp"
#include "CsoundFile.hpp"
#include <string>
#include <vector>
%}
%template(MyfltVector) std::vector<MYFLT>;
#else
#include "csound.hpp"
#include "CsoundFile.hpp"
#include <string>
#include <vector>
#endif

class PUBLIC CppSound : public Csound, public CsoundFile
{
bool go;
bool isCompiled;
bool isPerforming;
size_t spoutSize;
std::string renderedSoundfile;
public:
CppSound() : Csound(),
go(false),
isCompiled(false),
isPerforming(false),
spoutSize(0)
{

//SetHostData((CSOUND *)0);

}

virtual ~CppSound();
virtual CSOUND *getCsound();
virtual intptr_t getThis();
virtual CsoundFile *getCsoundFile();
virtual int compile(int argc, const char **argv);
virtual int compile();
virtual size_t getSpoutSize() const;
virtual std::string getOutputSoundfileName() const;
virtual int perform(int argc, const char **argv);
virtual int perform();
virtual int performKsmps();
virtual void cleanup();
virtual void inputMessage(const char *istatement);
virtual void write(const char *text);
virtual bool getIsCompiled() const;
virtual void setIsPerforming(bool isPerforming);
virtual bool getIsPerforming() const;
virtual bool getIsGo();
virtual void stop();
};

#endif

Loading
Loading