Skip to content

Commit

Permalink
Add CPack
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Sep 15, 2024
1 parent 03a6e6a commit 10cd08e
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 18 deletions.
64 changes: 48 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@ jobs:
- name: Install dependencies
run: sudo apt-get --yes install fluidsynth libfluidsynth-dev sordi gtk+2.0 libgtk2.0-dev libcairo2 lv2-dev
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: |
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake -DCMAKE_INSTALL_PREFIX=../install-dir -DCMAKE_BUILD_TYPE=Release ..
- name: Build
run: cmake --build build
- name: Package
run: |
cd build
cpack -G TGZ --config CPackSourceConfig.cmake
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux
path: build/calf-*gz
linux-clang-with-lld:
name: linux-clang-with-lld # clang with LLVM's linker LLD
runs-on: ubuntu-latest
Expand All @@ -32,14 +41,14 @@ jobs:
- name: Install dependencies
run: sudo apt-get --yes install fluidsynth libfluidsynth-dev sordi gtk+2.0 libgtk2.0-dev libcairo2 lv2-dev
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: >
mkdir build && cd build &&
cmake ..
-DCMAKE_INSTALL_PREFIX=../install
-DCMAKE_INSTALL_PREFIX=../install-dir
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_FLAGS="-fuse-ld=lld"
Expand All @@ -50,44 +59,67 @@ jobs:
name: macos
runs-on: macos-13
steps:
- name: Install python3
run: brew install --overwrite [email protected]
- name: Install dependencies
run: brew install automake fluid-synth gtk+ cairo lv2 gtk-mac-integration expat
run: brew install automake fluid-synth gtk+ lv2 gtk-mac-integration expat
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: |
export LDFLAGS="-L$(brew --prefix)/lib"
export CPPFLAGS="-I$(brew --prefix expat)/include"
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_SHARED_LINKER_FLAGS="-L$(brew --prefix)/lib -Wl,-rpath,$(brew --prefix)/lib" -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/include"
cmake -DCMAKE_INSTALL_PREFIX=../install-dir -DCMAKE_SHARED_LINKER_FLAGS="-L$(brew --prefix)/lib -Wl,-rpath,$(brew --prefix)/lib" -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/include" -DCMAKE_BUILD_TYPE=Release ..
- name: Build
run: cmake --build build
# install does not work yet, but seems less critical for now
- name: Package
run: |
cd build
cpack -G productbuild
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos
path: build/calf-*.pkg
msvc:
name: msvc
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache vcpkg dependencies
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: vcpkg-x64-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-x64-
path: build\vcpkg_installed
- name: Configure
run: >
cmake
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .
run: |
mkdir build -Force
cmake `
-B build `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_BUILD_TYPE=Debug `
.
- name: Build
run: cmake --build .
# install does not work yet, but seems less critical for now
run: cmake --build build --config Release
- name: Package
run: |
cd build
cpack -G NSIS -C Release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: build\calf-*.exe

# mingw-cross:
# strategy:
# matrix:
Expand All @@ -98,7 +130,7 @@ jobs:
# runs-on: ubuntu-latest
# steps:
# - name: Check out
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Install MinGW
Expand Down
36 changes: 34 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ project(calf)
string(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE)

set(PROJECT_YEAR 2023)
set(PROJECT_AUTHOR "CALF Developers")
set(PROJECT_AUTHOR "${PROJECT_NAME_UCASE} Developers")
set(PROJECT_URL "https://calf-studio-gear.org/")
set(PROJECT_DESCRIPTION "${CMAKE_PROJECT_NAME} Studio Gear")
set(PROJECT_DESCRIPTION "${PROJECT_NAME_UCASE} Studio Gear")
set(PROJECT_COPYRIGHT "2007-${PROJECT_YEAR} ${PROJECT_AUTHOR}")
set(VERSION_MAJOR "0")
set(VERSION_MINOR "90")
Expand All @@ -15,6 +15,38 @@ set(VERSION_STAGE "alpha")
set(VERSION_BUILD "")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}")

configure_file("${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY)

#
# CPack
#

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
SET(CPACK_PACKAGE_VENDOR "${PROJECT_AUTHOR}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_RELEASE}")
IF(VERSION_STAGE)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_STAGE}")
ENDIF()
IF(VERSION_BUILD)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_BUILD}")
ENDIF()
SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build;/\.github;/\.git/;/\.gitignore;/\.svnignore;/autogen\.sh;/configure\.ac;/Makefile\.am;${CPACK_SOURCE_IGNORE_FILES}")
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}jackhost" "${PROJECT_NAME_UCASE} binary")
# Disable strip for Debug|RelWithDebInfo
if(CMAKE_BUILD_TYPE MATCHES "Deb")
unset(CPACK_STRIP_FILES)
else()
set(CPACK_STRIP_FILES TRUE)
endif()

INCLUDE(CPack)

#
# Options
#
Expand Down

0 comments on commit 10cd08e

Please sign in to comment.