Put the dylibbundler steps into cmake and out of travis
This commit is contained in:
parent
5723cc1ef7
commit
b71be82e27
6 changed files with 53 additions and 43 deletions
|
|
@ -56,7 +56,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
||||||
script: .travis/script_osx.sh
|
script: .travis/script_osx.sh
|
||||||
after_success: .travis/prepare_osx.sh
|
after_success: .travis/prepare_tarball.sh
|
||||||
|
|
||||||
- name: "MOD devices arm"
|
- name: "MOD devices arm"
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
test -z "$CONTAINER"
|
|
||||||
|
|
||||||
if ! [ -z "$CONTAINER" ]; then
|
|
||||||
. .travis/docker_container.sh
|
|
||||||
else
|
|
||||||
. .travis/no_container.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd build
|
|
||||||
buildenv make DESTDIR=${PWD}/${INSTALL_DIR} install
|
|
||||||
|
|
||||||
# Bundle LV2 dependencies
|
|
||||||
cd "${INSTALL_DIR}"/Library/Audio/Plug-Ins/LV2
|
|
||||||
dylibbundler -cd -of -b -x sfizz.lv2/Contents/Binary/sfizz.so -d sfizz.lv2/Contents/libs/ -p @loader_path/../libs/
|
|
||||||
dylibbundler -cd -of -b -x sfizz.lv2/Contents/Binary/sfizz_ui.so -d sfizz.lv2/Contents/libs/ -p @loader_path/../libs/
|
|
||||||
cd "${TRAVIS_BUILD_DIR}/build"
|
|
||||||
|
|
||||||
# Bundle VST3 dependencies
|
|
||||||
cd "${INSTALL_DIR}"/Library/Audio/Plug-Ins/VST3
|
|
||||||
dylibbundler -cd -of -b -x sfizz.vst3/Contents/MacOS/sfizz -d sfizz.vst3/Contents/libs/ -p @loader_path/../libs/
|
|
||||||
cd "${TRAVIS_BUILD_DIR}/build"
|
|
||||||
|
|
||||||
# Bundle AU dependencies
|
|
||||||
cd "${INSTALL_DIR}"/Library/Audio/Plug-Ins/Components
|
|
||||||
dylibbundler -cd -of -b -x sfizz.component/Contents/Resources/plugin.vst3/Contents/MacOS/sfizz -d sfizz.component/Contents/Resources/plugin.vst3/Contents/libs/ -p @loader_path/../libs/
|
|
||||||
cd "${TRAVIS_BUILD_DIR}/build"
|
|
||||||
|
|
||||||
#
|
|
||||||
tar -zcvf "${INSTALL_DIR}.tar.gz" ${INSTALL_DIR}
|
|
||||||
|
|
||||||
# Only release a tarball if there is a tag
|
|
||||||
if [[ ${TRAVIS_TAG} != "" ]]; then
|
|
||||||
mv "${INSTALL_DIR}.tar.gz" ${TRAVIS_BUILD_DIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "${TRAVIS_BUILD_DIR}"
|
|
||||||
|
|
@ -38,6 +38,9 @@ include (SfizzConfig)
|
||||||
# Don't use IPO in non Release builds
|
# Don't use IPO in non Release builds
|
||||||
include (CheckIPO)
|
include (CheckIPO)
|
||||||
|
|
||||||
|
# Dylib bunder for macOS
|
||||||
|
include (BundleDylibs)
|
||||||
|
|
||||||
# Add Abseil
|
# Add Abseil
|
||||||
add_subdirectory (external/abseil-cpp EXCLUDE_FROM_ALL)
|
add_subdirectory (external/abseil-cpp EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
|
||||||
32
cmake/BundleDylibs.cmake
Normal file
32
cmake/BundleDylibs.cmake
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Dylib bundler for macOS
|
||||||
|
# Requires the external program "dylibbundler"
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
find_program(DYLIBBUNDLER_PROGRAM "dylibbundler")
|
||||||
|
if(NOT DYLIBBUNDLER_PROGRAM)
|
||||||
|
message(WARNING "The installation helper \"dylibbundler\" is not available.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(bundle_dylibs NAME PATH)
|
||||||
|
if(NOT APPLE OR NOT DYLIBBUNDLER_PROGRAM)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_relative_libdir "../libs")
|
||||||
|
|
||||||
|
get_filename_component(_dir "${PATH}" DIRECTORY)
|
||||||
|
set(_dir "${_dir}/${_relative_libdir}")
|
||||||
|
|
||||||
|
set(_script "${CMAKE_CURRENT_BINARY_DIR}/_bundle-dylibs.${NAME}.cmake")
|
||||||
|
|
||||||
|
file(WRITE "${_script}"
|
||||||
|
"execute_process(COMMAND \"${DYLIBBUNDLER_PROGRAM}\"
|
||||||
|
\"-cd\" \"-of\" \"-b\"
|
||||||
|
\"-x\" \"\$ENV{DESTDIR}${PATH}\"
|
||||||
|
\"-d\" \"\$ENV{DESTDIR}${_dir}\"
|
||||||
|
\"-p\" \"@loader_path/${_relative_libdir}/\")
|
||||||
|
")
|
||||||
|
|
||||||
|
install(SCRIPT "${_script}" ${ARGN})
|
||||||
|
endfunction()
|
||||||
|
|
@ -105,6 +105,12 @@ endif()
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
install (DIRECTORY ${PROJECT_BINARY_DIR} DESTINATION ${LV2PLUGIN_INSTALL_DIR}
|
install(DIRECTORY ${PROJECT_BINARY_DIR} DESTINATION ${LV2PLUGIN_INSTALL_DIR}
|
||||||
|
COMPONENT "lv2")
|
||||||
|
bundle_dylibs(lv2
|
||||||
|
"${LV2PLUGIN_INSTALL_DIR}/${PROJECT_NAME}.lv2/Contents/Binary/sfizz.so"
|
||||||
|
COMPONENT "lv2")
|
||||||
|
bundle_dylibs(lv2-ui
|
||||||
|
"${LV2PLUGIN_INSTALL_DIR}/${PROJECT_NAME}.lv2/Contents/Binary/sfizz_ui.so"
|
||||||
COMPONENT "lv2")
|
COMPONENT "lv2")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -118,9 +118,12 @@ endif()
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
install (DIRECTORY "${PROJECT_BINARY_DIR}/${VSTPLUGIN_BUNDLE_NAME}"
|
install(DIRECTORY "${PROJECT_BINARY_DIR}/${VSTPLUGIN_BUNDLE_NAME}"
|
||||||
DESTINATION "${VSTPLUGIN_INSTALL_DIR}"
|
DESTINATION "${VSTPLUGIN_INSTALL_DIR}"
|
||||||
COMPONENT "vst")
|
COMPONENT "vst")
|
||||||
|
bundle_dylibs(vst
|
||||||
|
"${VSTPLUGIN_INSTALL_DIR}/${VSTPLUGIN_BUNDLE_NAME}/Contents/MacOS/sfizz"
|
||||||
|
COMPONENT "vst")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --- Audio Unit wrapper --- #
|
# --- Audio Unit wrapper --- #
|
||||||
|
|
@ -296,5 +299,11 @@ elseif(SFIZZ_AU)
|
||||||
install(DIRECTORY "${PROJECT_BINARY_DIR}/${VSTPLUGIN_BUNDLE_NAME}/"
|
install(DIRECTORY "${PROJECT_BINARY_DIR}/${VSTPLUGIN_BUNDLE_NAME}/"
|
||||||
DESTINATION "${AUPLUGIN_INSTALL_DIR}/${AUPLUGIN_BUNDLE_NAME}/Contents/Resources/plugin.vst3"
|
DESTINATION "${AUPLUGIN_INSTALL_DIR}/${AUPLUGIN_BUNDLE_NAME}/Contents/Resources/plugin.vst3"
|
||||||
COMPONENT "au")
|
COMPONENT "au")
|
||||||
|
bundle_dylibs(au
|
||||||
|
"${AUPLUGIN_INSTALL_DIR}/${AUPLUGIN_BUNDLE_NAME}/Contents/MacOS/sfizz"
|
||||||
|
COMPONENT "au")
|
||||||
|
bundle_dylibs(au-vst
|
||||||
|
"${AUPLUGIN_INSTALL_DIR}/${AUPLUGIN_BUNDLE_NAME}/Contents/Resources/plugin.vst3/Contents/MacOS/sfizz"
|
||||||
|
COMPONENT "au")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue