diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1ca6b67c7a14d..33a967dd0517cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,12 @@ jobs: vcpkg_triplet: arm64-osx-min1100-release vcpkg_host_triplet: x64-osx-min1015-release check_disk_space: df -h + - os: ubuntu-latest + vcpkg_path: /home/runner/mixxx-vcpkg + vcpkg_bootstrap: ./bootstrap-vcpkg.sh + vcpkg_triplet: wasm32-emscripten-pthread-release + vcpkg_host_triplet: x64-linux-release + check_disk_space: df -h env: VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }} VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.vcpkg_host_triplet }} @@ -82,6 +88,16 @@ jobs: brew update && brew install nasm autoconf-archive /bin/bash -c "sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer" xcrun --show-sdk-version + + - name: "[Linux] Set up build environment" + if: runner.os == 'Linux' + run: sudo apt-get install -y autoconf-archive nasm '^libxcb.*-dev' libx11-xcb-dev libgl1-mesa-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev mesa-common-dev + + - name: "[Emscripten] Install SDK" + if: startsWith(matrix.vcpkg_triplet, 'wasm32-') || startsWith(matrix.vcpkg_triplet, 'wasm64-') + uses: mymindstorm/setup-emsdk@v14 + with: + version: '3.1.55' - name: Check available disk space run: ${{ matrix.check_disk_space }} diff --git a/overlay/triplets/wasm32-emscripten-pthread-release.cmake b/overlay/triplets/wasm32-emscripten-pthread-release.cmake new file mode 100644 index 00000000000000..f8adb816529717 --- /dev/null +++ b/overlay/triplets/wasm32-emscripten-pthread-release.cmake @@ -0,0 +1,28 @@ +set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH) + +if(NOT DEFINED ENV{EMSCRIPTEN_ROOT}) + find_path(EMSCRIPTEN_ROOT "emcc") +else() + set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}") +endif() + +if(NOT EMSCRIPTEN_ROOT) + if(NOT DEFINED ENV{EMSDK}) + message(FATAL_ERROR "The emcc compiler not found in PATH") + endif() + set(EMSCRIPTEN_ROOT "$ENV{EMSDK}/upstream/emscripten") +endif() + +if(NOT EXISTS "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake") + message(FATAL_ERROR "Emscripten.cmake toolchain file not found") +endif() + +set(VCPKG_TARGET_ARCHITECTURE wasm32) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME Emscripten) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake") + +set(ENV{EMCC_CFLAGS} "$ENV{EMCC_CFLAGS} -pthread") + +set(VCPKG_BUILD_TYPE release) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index c622dfd708d266..36cddcc09ec5dd 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -19,11 +19,22 @@ vcpkg_extract_source_archive(SOURCE_PATH mingw-dll-install.patch disable-static-prefix.patch # https://gitlab.kitware.com/cmake/cmake/-/issues/16617; also mingw. fix-win-build.patch + vcpkg-cross-data.patch ) vcpkg_find_acquire_program(PYTHON3) set(ENV{PYTHON} "${PYTHON3}") +vcpkg_list(SET CONFIGURE_OPTIONS) +vcpkg_list(SET CONFIGURE_OPTIONS_RELEASE) +vcpkg_list(SET CONFIGURE_OPTIONS_DEBUG) +vcpkg_list(SET BUILD_OPTIONS) + +if(VCPKG_TARGET_IS_EMSCRIPTEN) + vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-extras) + vcpkg_list(APPEND BUILD_OPTIONS "PKGDATA_OPTS=--without-assembly -O ../data/icupkg.inc") +endif() + if(VCPKG_TARGET_IS_WINDOWS) list(APPEND CONFIGURE_OPTIONS --enable-icu-build-win) endif() @@ -33,8 +44,11 @@ list(APPEND CONFIGURE_OPTIONS --disable-samples --disable-tests --disable-layout list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release) list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release) -set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel) -set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) +set(CONFIG_TRIPLETS) +list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-rel) +if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-dbg) +endif() if("tools" IN_LIST FEATURES) list(APPEND CONFIGURE_OPTIONS --enable-tools) @@ -89,7 +103,7 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() #31680: Fix @rpath in both debug and release build - foreach(CONFIG_TRIPLE IN ITEMS ${DEBUG_TRIPLET} ${RELEASE_TRIPLET}) + foreach(CONFIG_TRIPLE IN LISTS CONFIG_TRIPLETS) # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc) vcpkg_execute_build_process( @@ -141,7 +155,7 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() -vcpkg_install_make() +vcpkg_install_make(OPTIONS ${BUILD_OPTIONS}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share" @@ -178,7 +192,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/icu/debug") # To cross compile, we need some files at specific positions. So lets copy them -file(GLOB CROSS_COMPILE_DEFS "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/config/icucross.*") +file(GLOB CROSS_COMPILE_DEFS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config/icucross.*") file(INSTALL ${CROSS_COMPILE_DEFS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/config") file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*icu*${ICU_VERSION_MAJOR}.dll") diff --git a/ports/icu/vcpkg-cross-data.patch b/ports/icu/vcpkg-cross-data.patch new file mode 100644 index 00000000000000..7ca87fb93b2e6d --- /dev/null +++ b/ports/icu/vcpkg-cross-data.patch @@ -0,0 +1,13 @@ +diff --git a/source/configure.ac b/source/configure.ac +index 1bd5871..c508f48 100644 +--- a/source/configure.ac ++++ b/source/configure.ac +@@ -1151,7 +1151,7 @@ AC_ARG_ENABLE(fuzzer, + fuzzer=false) + ICU_CONDITIONAL(FUZZER, test "$fuzzer" = true) + +-ICU_CONDITIONAL(DATA, test "$tools" = true || test "$cross_compiling" = "yes") ++ICU_CONDITIONAL(DATA, test "$tools" = true || test "$cross_compiling" = "yes" || test -n "$cross_buildroot") + + AC_ARG_WITH(data-packaging, + [ --with-data-packaging specify how to package ICU data. Possible values: diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index 88a574b25a5f92..d80834ecb61e81 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,6 +1,7 @@ { "name": "icu", "version": "73.1", + "port-version": 2, "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "license": "ICU", diff --git a/vcpkg.json b/vcpkg.json index a0271cde11fb49..f19c58e47a88f9 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -22,24 +22,80 @@ "description": "Build with Qt 6", "dependencies": [ "qt5compat", - "qtbase", + { + "name": "qtbase", + "default-features": false, + "features": [ + "brotli", + "concurrent", + { + "name": "dbus", + "platform": "!emscripten" + }, + "default-features", + "doubleconversion", + "freetype", + { + "name": "gles2", + "$comment": "TODO: Use gles3 once we update the Qt port", + "platform": "emscripten" + }, + "gui", + "harfbuzz", + "icu", + "jpeg", + "network", + "opengl", + { + "name": "openssl", + "platform": "!emscripten" + }, + "pcre2", + "png", + "sql", + { + "name": "sql-psql", + "platform": "!emscripten" + }, + "sql-sqlite", + "testlib", + "thread", + "widgets", + "zstd" + ] + }, "qtdeclarative", "qtsvg", - "qttranslations", - "qtkeychain-qt6" + { + "name": "qttranslations", + "platform": "!emscripten" + }, + { + "name": "qtkeychain-qt6", + "platform": "!emscripten" + } ] } }, "dependencies": [ "ableton-link", "benchmark", - "chromaprint", + { + "name": "chromaprint", + "platform": "!emscripten" + }, "fdk-aac", - "ffmpeg", + { + "name": "ffmpeg", + "platform": "!emscripten" + }, "fftw3", "grantlee", "gtest", - "hidapi", + { + "name": "hidapi", + "platform": "!emscripten" + }, { "name": "hss1394", "platform": "windows | osx" @@ -63,7 +119,10 @@ "name": "libsndfile", "default-features": false }, - "libusb", + { + "name": "libusb", + "platform": "!emscripten" + }, "libvorbis", "lilv", "mp3lame", @@ -72,9 +131,23 @@ "opusfile", { "name": "portaudio", - "features": ["asio"] + "default-features": false, + "features": [ + { + "name": "asio", + "platform": "!emscripten" + }, + { + "name": "jack", + "platform": "!emscripten" + } + ] + }, + { + "name": "portmidi", + "$comment": "TODO: Depends on https://github.com/PortMidi/portmidi/issues/68 (alternatively libremidi might be an option)", + "platform": "!emscripten" }, - "portmidi", "protobuf", "pthreads", "rubberband", diff --git a/versions/baseline.json b/versions/baseline.json index 5ba9727460309c..e07a94cead1e55 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3322,7 +3322,7 @@ }, "icu": { "baseline": "73.1", - "port-version": 0 + "port-version": 2 }, "ideviceinstaller": { "baseline": "2023-07-21", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index 7cd3b924823572..d76f3d6c058d36 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,15 @@ { "versions": [ + { + "git-tree": "b6ac20c2420a4f7118d5db326c8c599e50b2c5a4", + "version": "73.1", + "port-version": 2 + }, + { + "git-tree": "deb5694d7965a264d6eb579df49aff4fe6362c24", + "version": "73.1", + "port-version": 1 + }, { "git-tree": "acc3cf9137af5fc8fdd3e8607377026cf88f144d", "version": "73.1",