Skip to content

Commit

Permalink
returned jack dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Dec 4, 2020
1 parent 71a33f6 commit 1220175
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 3 deletions.
46 changes: 46 additions & 0 deletions CMakeLists.txt
Expand Up @@ -162,6 +162,10 @@ option(USE_SYSTEM_QTSINGLEAPPLICATION "Use system QtSingleApplication" OFF)
option(USE_SYSTEM_FREETYPE "Use system FreeType" OFF) # requires freetype >= 2.5.2, does not work on win
option(DOWNLOAD_SOUNDFONT "Download the latest soundfont version as part of the build process" ON)

SET(JACK_LONGNAME "JACK (Jack Audio Connection Kit)")
SET(JACK_MIN_VERSION "0.98.0")
option(BUILD_JACK "Build with support for ${JACK_LONGNAME} audio backend. JACK >= ${JACK_MIN_VERSION} will be needed." OFF)

option(BUILD_PCH "Build using precompiled headers." ON)
option(BUILD_FOR_WINSTORE "Build for the Windows Store." OFF)
option(COVERAGE "Build with instrumentation to record code coverage." OFF)
Expand Down Expand Up @@ -416,6 +420,48 @@ if (USE_SYSTEM_FREETYPE)
endif (APPLE)
endif (USE_SYSTEM_FREETYPE)

##
## Find JACK >= JACK_MIN_VERSION
##


IF(BUILD_JACK)
IF(MINGW OR MSVC)
set (USE_JACK 1)
IF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# "pure" 32-bit environment
set (progenv "PROGRAMFILES")
ELSE("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# "pure" 64-bit environment
set (progenv "PROGRAMFILES(x86)")
ENDIF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
ELSE("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# 32-bit program running with an underlying 64-bit environment
set (progenv "PROGRAMFILES(x86)")
ELSE("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# Theoretically impossible case...
MESSAGE(SEND_ERROR "Error: Impossible program/environment bitness combination deduced: 64-bit program running in 32-bit environment. This is a programming error. PROCESSOR_ARCHITEW6432=$ENV{PROCESSOR_ARCHITEW6432}. PROCESSOR_ARCHITECTURE=$ENV{PROCESSOR_ARCHITECTURE}")
ENDIF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
ENDIF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
set (JACK_INCDIR "$ENV{${progenv}}/Jack/includes")
set (JACK_LIB "$ENV{${progenv}}/Jack/lib/libjack.a")
MESSAGE("JACK support enabled.")
ELSE(MINGW OR MSVC)
PKGCONFIG1 (jack ${JACK_MIN_VERSION} JACK_INCDIR JACK_LIBDIR JACK_LIB JACK_CPP)
IF(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} found. jack support enabled.")
SET(USE_JACK 1)
ELSE(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} not found")
MESSAGE(SEND_ERROR "Error: JACK support requested (BUILD_JACK=${BUILD_JACK}), but JACK was not found")
ENDIF(JACK_INCDIR)
ENDIF(MINGW OR MSVC)
ELSE(BUILD_JACK)
MESSAGE(STATUS "${JACK_LONGNAME} support disabled")
ENDIF(BUILD_JACK)

if (APPLE)
if(SOUNDFONT3)
##
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -32,6 +32,7 @@ CRASH_REPORT_URL=""
SUFFIX=""# E.g.: SUFFIX="dev" --> "mscore" becomes "mscoredev"
LABEL=""# E.g.: LABEL="Development Build" --> "MuseScore 2" becomes "MuseScore 2 Development Build"

BUILD_JACK="ON" # Override with "OFF" to disable.
BUILD_WEBENGINE="ON" # Override with "OFF" to disable.
USE_SYSTEM_FREETYPE="OFF" # Override with "ON" to enable. Requires freetype >= 2.5.2.
COVERAGE="OFF" # Override with "ON" to enable.
Expand Down Expand Up @@ -65,6 +66,7 @@ release:
-DCMAKE_BUILD_NUMBER="${BUILD_NUMBER}" \
-DTELEMETRY_TRACK_ID="${TELEMETRY_TRACK_ID}" \
-DCRASH_REPORT_URL="${CRASH_REPORT_URL}" \
-DBUILD_JACK="${BUILD_JACK}" \
-DBUILD_WEBENGINE="${BUILD_WEBENGINE}" \
-DUSE_SYSTEM_FREETYPE="${USE_SYSTEM_FREETYPE}" \
-DDOWNLOAD_SOUNDFONT="${DOWNLOAD_SOUNDFONT}" \
Expand Down Expand Up @@ -94,6 +96,7 @@ debug:
-DMSCORE_INSTALL_SUFFIX="${SUFFIX}" \
-DMUSESCORE_LABEL="${LABEL}" \
-DCMAKE_BUILD_NUMBER="${BUILD_NUMBER}" \
-DBUILD_JACK="${BUILD_JACK}" \
-DBUILD_WEBENGINE="${BUILD_WEBENGINE}" \
-DUSE_SYSTEM_FREETYPE="${USE_SYSTEM_FREETYPE}" \
-DCOVERAGE="${COVERAGE}" \
Expand Down
1 change: 1 addition & 0 deletions build/ci/linux/setup.sh
Expand Up @@ -43,6 +43,7 @@ apt_packages_standard=(
libfreetype6-dev
libfreetype6
libgl1-mesa-dev
libjack-dev
libnss3-dev
libportmidi-dev
libpulse-dev
Expand Down
2 changes: 1 addition & 1 deletion build/ci/linux/tools/make_appimage.sh
Expand Up @@ -154,7 +154,7 @@ additional_libraries=(
# the full functionality of the system version, but it does avoid the crash.
# Report new additions at https://github.com/linuxdeploy/linuxdeploy/issues
fallback_libraries=(

libjack.so.0 # https://github.com/LMMS/lmms/pull/3958
)

for file in "${unwanted_files[@]}"; do
Expand Down
3 changes: 3 additions & 0 deletions build/ci/macos/setup.sh
Expand Up @@ -16,6 +16,9 @@ rm bottles/freetype* | $SKIP_ERR_FLAG

brew update >/dev/null | $SKIP_ERR_FLAG

# additional dependencies
brew install jack

BREW_CELLAR=$(brew --cellar)
BREW_PREFIX=$(brew --prefix)

Expand Down
7 changes: 5 additions & 2 deletions build/ci/windows/build.bat
Expand Up @@ -47,14 +47,17 @@ ECHO "Finished copy dependencies"

SET GENERATOR_NAME=Visual Studio 16 2019
SET MSCORE_STABLE_BUILD="TRUE"

:: TODO We need define paths during image creation
SET "JACK_DIR=C:\Program Files (x86)\Jack"
SET "QT_DIR=C:\Qt\5.15.1"

@REM IF %TARGET_PROCESSOR_BITS% == 32 (
@REM ::SET "PATH=%QT_DIR%\msvc2015\bin;%PATH%"
@REM ::SET "PATH=%QT_DIR%\msvc2015\bin;%JACK_DIR%;%PATH%"
@REM ECHO "error: Not installed Qt 32"
@REM EXIT /b 1
@REM ) ELSE (
SET "PATH=%QT_DIR%\msvc2019_64\bin;%PATH%"
SET "PATH=%QT_DIR%\msvc2019_64\bin;%JACK_DIR%;%PATH%"
@REM )

:: At the moment not compiling yet.
Expand Down
3 changes: 3 additions & 0 deletions build/ci/windows/setup.bat
Expand Up @@ -53,6 +53,9 @@ CALL "7z" x -y "%TEMP_DIR%\%Qt_ARCHIVE%" "-o%QT_DIR%"
ECHO "=== Install dependencies ==="
CALL "wget.exe" -q --show-progress --no-check-certificate "https://s3.amazonaws.com/utils.musescore.org/musescore_dependencies_win32.7z" -O %TEMP_DIR%\musescore_dependencies_win32.7z
CALL "7z" x -y %TEMP_DIR%\musescore_dependencies_win32.7z "-o%TEMP_DIR%\musescore_dependencies_win32"
SET JACK_DIR="C:\Program Files (x86)\Jack"
XCOPY %TEMP_DIR%\musescore_dependencies_win32\dependencies\Jack %JACK_DIR% /E /I /Y
SET PATH=%JACK_DIR%;%PATH%

CALL "wget.exe" -q --show-progress --no-check-certificate "https://s3.amazonaws.com/utils.musescore.org/dependencies.7z" -O %TEMP_DIR%\dependencies.7z
CALL "7z" x -y %TEMP_DIR%\dependencies.7z "-oC:\musescore_dependencies"
Expand Down
4 changes: 4 additions & 0 deletions src/audiofile/CMakeLists.txt
Expand Up @@ -39,6 +39,10 @@ else(PLATFORM_IS_WINDOWS)

endif(PLATFORM_IS_WINDOWS)

set(MODULE_INCLUDE
${SNDFILE_INCDIR}
)

set(MODULE_LINK
${SNDFILE_LIB}
)
Expand Down

3 comments on commit 1220175

@Jojo-Schmitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All that just to get sndfile.h back??

@igorkorsukov
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All that just to get sndfile.h back??

This is for get sndfile.h back

set(MODULE_INCLUDE
    ${SNDFILE_INCDIR}
    )

Rest to return dependency on JACK

@Jojo-Schmitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I understood. I thought you wanted to disable JACK, and only fix the accidental break of libsndfile

Please sign in to comment.