Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "muse_framework"]
path = muse
url = https://github.com/musescore/muse_framework.git
[submodule "muse_deps"]
path = muse_deps
url = https://github.com/musescore/muse_deps.git
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ set(CMAKE_MODULE_PATH

###########################################
# Check compiler version
###########################################
###########################################
message(STATUS "C: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
message(STATUS "CXX: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "CXX: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")

include(CheckCompilerVersion)
check_compile_version("Clang" 20 "https://github.com/musescore/MuseScore/wiki/Set-up-developer-environment")
Expand Down Expand Up @@ -123,13 +123,13 @@ option(MUE_BUILD_IMPORTEXPORT_TESTS "Build importexport tests" ON)
option(MUE_BUILD_PROPERTIESPANEL_MODULE "Build propertiespanel module" ON)
option(MUE_BUILD_PROPERTIESPANEL_QML "Build propertiespanel QML" ${MUE_BUILD_PROPERTIESPANEL_MODULE})

option(MUE_BUILD_INSTRUMENTSSCENE_MODULE "Build instruments scene module" ON)
option(MUE_BUILD_INSTRUMENTSSCENE_MODULE "Build instruments scene module" ON)
option(MUE_BUILD_INSTRUMENTSSCENE_QML "Build instruments scene QML" ${MUE_BUILD_INSTRUMENTSSCENE_MODULE})

option(MUE_BUILD_MUSESOUNDS_MODULE "Build MuseSounds module" ON)
option(MUE_BUILD_MUSESOUNDS_QML "Build musesounds QML" ${MUE_BUILD_MUSESOUNDS_MODULE})

option(MUE_BUILD_NOTATION_MODULE "Build notation module" ON)
option(MUE_BUILD_NOTATION_MODULE "Build notation module" ON)
option(MUE_BUILD_NOTATION_TESTS "Build notation tests" ${MUE_BUILD_NOTATION_MODULE})

option(MUE_BUILD_NOTATIONSCENE_MODULE "Build notation scene module" ON)
Expand Down Expand Up @@ -221,10 +221,6 @@ set(FETCHCONTENT_BASE_DIR ${PROJECT_BINARY_DIR}/_deps)

if (MUE_COMPILE_MACOS_PRECOMPILED_DEPS_PATH)
list(PREPEND CMAKE_PREFIX_PATH ${MUE_COMPILE_MACOS_PRECOMPILED_DEPS_PATH})

# These are included in the precompiled dependencies, so let's use them from there
set(MUSE_USE_SYSTEM_FLAC ON)
set(MUSE_USE_SYSTEM_OPUS ON)
endif()

include(SetupQt6)
Expand Down
1 change: 1 addition & 0 deletions buildscripts/ci/linux/tools/make_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export EXTRA_PLATFORM_PLUGINS="libqoffscreen.so;libqwayland.so"
# Qml files can be in different directories, the qmlimportscanner will go through everything recursively.
export QML_SOURCES_PATHS=./

export LD_LIBRARY_PATH="${appdir}/lib:${appdir}/usr/lib:${LD_LIBRARY_PATH:-}"
linuxdeploy --appdir "${appdir}" # adds all shared library dependencies
linuxdeploy-plugin-qt --appdir "${appdir}" # adds all Qt dependencies

Expand Down
7 changes: 7 additions & 0 deletions buildscripts/cmake/DependencyManifest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require_dep(ogg)
require_dep(vorbis)
require_dep(flac)
require_dep(opus)
require_dep(libsndfile)

require_source_dep(liblouis)
171 changes: 171 additions & 0 deletions buildscripts/cmake/PrepareDepsSources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# PrepareDepsSources.cmake - pre-fetch dep sources into the cache.
#
# cmake [-DEXTDEPS_CACHE=<dir>] -P buildscripts/cmake/PrepareDepsSources.cmake
#
# This lets source/REBUILD and offline/distro builds configure without network.
# SYSTEM deps and deps without a recipe are skipped.

cmake_minimum_required(VERSION 3.24)
set(_self_dir "${CMAKE_CURRENT_LIST_DIR}")
get_filename_component(_root "${_self_dir}/../.." ABSOLUTE)
set(EXTDEPS_DIR "${_root}/muse_deps")

include("${EXTDEPS_DIR}/buildtools/build_dependency.cmake")

if (EXTDEPS_CACHE)
set(ENV{EXTDEPS_CACHE} "${EXTDEPS_CACHE}")
endif()
_bd_resolve_cache(EXTDEPS_CACHE)

# Fetch one tarball into <cache>/downloads/<name>/<basename>.
function(_pds_tarball name label url sha256)
get_filename_component(_basename "${url}" NAME)
if (_basename MATCHES "^git_revision:")
set(_basename "${label}.zip")
endif()
set(_download_dir "${EXTDEPS_CACHE}/downloads/${name}")
set(_archive "${_download_dir}/${_basename}")
if (EXISTS "${_archive}")
file(SHA256 "${_archive}" _got_sha256)
if (_got_sha256 STREQUAL "${sha256}")
message(STATUS "[prepare] cached ${name}/${_basename}")
return()
endif()
endif()
file(MAKE_DIRECTORY "${_download_dir}")
message(STATUS "[prepare] fetch ${name}/${_basename}")

# Try the release mirror first. Fetch from upstream when the pin is new.
_bd_mirror("${EXTDEPS_DIR}" _mirror)
set(_urls "")
if (_mirror)
_bd_src_ext("${_basename}" _ext)
list(APPEND _urls "${_mirror}/${label}-src.${_ext}")
endif()
list(APPEND _urls "${url}")
_bd_fetch("${_archive}" "${sha256}" ${_urls})
endfunction()

# Resolve a dep's version (metadata DEP_VERSION) and include its spec. Sets
# <out_spec> to the spec path, "" if there is no recipe.
function(_pds_spec name out_spec out_version)
include("${EXTDEPS_DIR}/${name}/${name}.cmake")
set(_version "${DEP_VERSION}")
set(_spec "${EXTDEPS_DIR}/${name}/${_version}/recipe/spec.cmake")
if (NOT EXISTS "${_spec}")
set(_spec "")
endif()
set(${out_spec} "${_spec}" PARENT_SCOPE)
set(${out_version} "${_version}" PARENT_SCOPE)
endfunction()

function(_pds_single name)
_pds_spec("${name}" spec version)
if (NOT spec)
message(STATUS "[prepare] skip ${name} (no recipe)")
return()
endif()
include("${spec}")
if (NOT DEFINED DEP_SOURCE_URL OR NOT DEFINED DEP_SOURCE_SHA256)
message(STATUS "[prepare] skip ${name} (no tarball source)")
return()
endif()
_pds_tarball("${name}" "${name}-${version}" "${DEP_SOURCE_URL}" "${DEP_SOURCE_SHA256}")
endfunction()

function(require_dep name)
if ("${ARGV1}" STREQUAL "SYSTEM")
message(STATUS "[prepare] skip ${name} (system)")
elseif ("${ARGV1}" STREQUAL "REBUILD" OR "${ARGV1}" STREQUAL "")
_pds_single("${name}")
else()
message(FATAL_ERROR "[prepare] ${name}: require_dep accepts only REBUILD or SYSTEM (got '${ARGV1}')")
endif()
endfunction()

function(require_tool name)
_pds_single("${name}")
_pds_sources("${name}")
endfunction()

# Source-delivery deps and recipes with extra source pins: each DEP_SOURCES
# entry, "sub|tarball|url|sha256" fetched + verified or "sub|git|repo|commit"
# cloned + checked out, into the same cache layout the engine reads.
function(_pds_sources name)
_pds_spec("${name}" spec version)
if (NOT spec)
return()
endif()
include("${spec}")
set(_download_dir "${EXTDEPS_CACHE}/downloads/${name}")
file(MAKE_DIRECTORY "${_download_dir}")
find_program(GIT NAMES git)
foreach(_source ${DEP_SOURCES})
string(REPLACE "|" ";" _source_fields "${_source}")
list(GET _source_fields 0 _source_sub)
list(GET _source_fields 1 _source_kind)
list(GET _source_fields 2 _source_location)
list(GET _source_fields 3 _source_pin)
if (_source_kind STREQUAL "tarball")
if (_source_sub STREQUAL name)
set(label "${name}-${version}")
else()
set(label "${name}-${_source_sub}")
endif()
_pds_tarball("${name}" "${label}" "${_source_location}" "${_source_pin}")
else() # git commit
set(_git_dir "${_download_dir}/${_source_sub}.git")
if (NOT GIT)
message(FATAL_ERROR "[prepare] git required to prefetch ${name}/${_source_sub}")
endif()
if (NOT EXISTS "${_git_dir}/.git")
execute_process(COMMAND ${GIT} clone --quiet "${_source_location}" "${_git_dir}" RESULT_VARIABLE _result)
if (NOT _result EQUAL 0)
file(REMOVE_RECURSE "${_git_dir}")
message(FATAL_ERROR "[prepare] ${name}/${_source_sub} clone failed (${_source_location})")
endif()
endif()
_bd_run_dir("${_git_dir}" ${GIT} checkout --quiet "${_source_pin}")
execute_process(COMMAND ${GIT} -C "${_git_dir}" rev-parse HEAD
OUTPUT_VARIABLE _head OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT _head STREQUAL "${_source_pin}")
message(FATAL_ERROR "[prepare] ${name}/${_source_sub}: HEAD ${_head} != pinned ${_source_pin}")
endif()
message(STATUS "[prepare] git ${name}/${_source_sub} @ ${_source_pin}")
endif()
endforeach()
endfunction()

function(require_source_dep name)
if ("${ARGV1}" STREQUAL "SYSTEM")
message(STATUS "[prepare] skip ${name} (system)")
return()
elseif (NOT "${ARGV1}" STREQUAL "")
message(FATAL_ERROR "[prepare] ${name}: require_source_dep accepts only SYSTEM (got '${ARGV1}')")
endif()
_pds_sources("${name}")
endfunction()

# Run the manifest once per OS_IS_WIN (asio) to gather all dependencies
# TODO: consider running on all combinations (os, arch ,etc) if needed
macro(_pds_manifest win)
set(OS_IS_LIN FALSE)
set(OS_IS_FBSD FALSE)
set(OS_IS_MAC FALSE)
set(OS_IS_WIN ${win})
set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x86_64")
set(MUSE_MODULE_VST ON)
set(MUSE_MODULE_DRAW ON)
set(MUSE_MODULE_AUDIO ON)
set(MUSE_MODULE_AUDIO_EXPORT ON)
set(MUSE_MODULE_DOCKWINDOW ON)
set(MUSE_MODULE_DOCKWINDOW_KDDOCKWIDGETS_V2 ON)
set(MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT ON)
set(MUSE_ENABLE_UNIT_TESTS ON)
set(MUE_BUILD_IMPEXP_MNX_MODULE ON)
include("${_self_dir}/DependencyManifest.cmake")
include("${_root}/muse/buildscripts/cmake/ExtDepsManifest.cmake")
endmacro()
_pds_manifest(FALSE)
_pds_manifest(TRUE)
message(STATUS "[prepare] sources ready in ${EXTDEPS_CACHE}/downloads")
22 changes: 18 additions & 4 deletions buildscripts/cmake/SetupDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

include(MuseDeps)
include(GetPlatformInfo)

# setup framework dependences
include(${MUSE_FRAMEWORK_PATH}/buildscripts/cmake/SetupDependencies.cmake)
set(EXTDEPS_DIR "${CMAKE_SOURCE_DIR}/muse_deps")
if (NOT EXISTS "${EXTDEPS_DIR}/buildtools/manifest.cmake")
message(FATAL_ERROR "muse_deps submodule missing, run: git submodule update --init muse_deps")
endif()

# add a list of local dependencies here
set(LOCAL_ROOT_PATH ${FETCHCONTENT_BASE_DIR})
include(${EXTDEPS_DIR}/buildtools/manifest.cmake)

include(${CMAKE_CURRENT_LIST_DIR}/DependencyManifest.cmake)
include(${MUSE_FRAMEWORK_PATH}/buildscripts/cmake/ExtDepsManifest.cmake)

extdeps_install_consumed(MACOS_BUNDLE mscore.app)

add_custom_target(prepare_deps_sources
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/PrepareDepsSources.cmake"
COMMENT "Pre-fetching dependency sources into the cache"
VERBATIM
)
2 changes: 1 addition & 1 deletion muse
Submodule muse updated 2760 files
1 change: 1 addition & 0 deletions muse_deps
Submodule muse_deps added at bcf01b
4 changes: 3 additions & 1 deletion src/braille/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
muse_create_module(braille)

add_subdirectory(tables)
add_subdirectory(thirdparty/liblouis)

target_sources(braille PRIVATE
braillemodule.cpp
Expand Down Expand Up @@ -34,6 +33,9 @@ target_link_libraries(braille PRIVATE
liblouis
)

get_property(_liblouis_tables GLOBAL PROPERTY liblouis_TABLES)
install(FILES ${_liblouis_tables} DESTINATION ${MUSE_APP_INSTALL_RESOURCES_LOCATION}/tables)

if (MUE_BUILD_BRAILLE_TESTS)
add_subdirectory(tests)
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/braille/internal/louis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include <QString>

#include "braille/thirdparty/liblouis/liblouis/internal.h"
#include "braille/thirdparty/liblouis/liblouis/liblouis.h"
#include "internal.h"
#include "liblouis.h"

#define WIDECHARS_ARE_UCS4

Expand Down
89 changes: 0 additions & 89 deletions src/braille/thirdparty/liblouis/.clang-format

This file was deleted.

4 changes: 0 additions & 4 deletions src/braille/thirdparty/liblouis/.dir-locals.el

This file was deleted.

Loading
Loading