From 96adea0927a8351f9f16e46e9c8e51f0b021c0d6 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 28 Sep 2024 20:18:18 +0200 Subject: [PATCH] last --- .CI/SetupHomebrewDeps.sh | 88 ++++++++------------------ .github/workflows/build.yml | 6 +- .github/workflows/create-installer.yml | 2 +- CHANGELOG.c7.md | 1 + 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index 98786ab6007..0119eaa7c67 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -2,73 +2,49 @@ set -e -# c-v-pasted from .zsh_commands +# Prefix for where to find the ARM64 library +arm64_homebrew_dir="/opt/homebrew" +# Prefix for where to find the x86 library +x86_64_homebrew_dir="/opt/homebrew-x86_64" + # Directory where we place the finished universal library +universal_lib_dir="/opt/universal-lib" + +# args: path-to-library (in homebrew dir) c2-make-universal-dylib() { - # Prefix for where to find the ARM64 library - local _arm64_homebrew="/opt/homebrew" - - # Prefix for where to find the x86 library - local _x86_64_homebrew="/opt/homebrew-x86_64" - - # Prefix we use to override the library (should be the base systems directory) - local _override_homebrew="${_arm64_homebrew}" - - # Directory where we place the finished universal library - local _universal_lib="/opt/universal-lib" - local _input_lib="$1" if [ -z "${_input_lib}" ]; then echo "usage: $0 [lib-path-relative-to-homebrew] (e.g. $0 lib/libboost_random-mt.dylib)" - return - fi - - if [ ! -d "${_arm64_homebrew}" ]; then - echo "error: The ARM64 homebrew directory (${_arm64_homebrew}) does not exist" - return - fi - if [ ! -d "${_x86_64_homebrew}" ]; then - echo "error: The x86_64 homebrew directory (${_x86_64_homebrew}) does not exist" - return - fi - if [ ! -d "${_universal_lib}" ]; then - echo "error: The universal lib directory (${_universal_lib}) does not exist" - return + exit 1 fi - if [ ! -w "${_universal_lib}" ]; then - echo "error: The current user does not have write permission in the universal lib directory (${_universal_lib})" - return + if [ ! -w "${universal_lib_dir}" ]; then + echo "error: The current user does not have write permission in the universal lib directory (${universal_lib_dir})" + exit 1 fi local _input_lib_filename="$(basename "${_input_lib}")" - local _arm64_lib="${_arm64_homebrew}/${_input_lib}" - local _x86_64_lib="${_x86_64_homebrew}/${_input_lib}" - local _override_lib=$(realpath "${_override_homebrew}/${_input_lib}") - - local _universal_lib="${_universal_lib}/${_input_lib_filename}" + local _arm64_lib="${arm64_homebrew_dir}/${_input_lib}" + local _x86_64_lib="${x86_64_homebrew_dir}/${_input_lib}" + local _override_lib=$(realpath "${arm64_homebrew_dir}/${_input_lib}") - if [ -f "${_universal_lib}" ]; then - echo "warning: The final output path (${_universal_lib}) already exists, you might run into errors" - echo "Some of these errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost), or re-installing them (e.g. brew reinstall openssl@1.1)" - echo "" - fi + local _universal_lib="${universal_lib_dir}/${_input_lib_filename}" if [ ! -f "${_arm64_lib}" ]; then - echo "error: The ARM64 library cannot be found at '${_arm64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" - return + echo "error: The ARM64 library '${_input_lib}' cannot be found at '${_arm64_lib}'" + exit 1 fi if [ ! -f "${_x86_64_lib}" ]; then - echo "error: The x86_64 library cannot be found at '${_x86_64_lib}' (combined prefix '${_arm64_homebrew}' with '${_input_lib})" - return + echo "error: The x86_64 library '${_input_lib}' cannot be found at '${_x86_64_lib}'" + exit 1 fi # Create the combined library if ! lipo "${_arm64_lib}" "${_x86_64_lib}" -create -output "${_universal_lib}"; then echo "error: Something went wrong creating the combined library" echo "Some errors can be solved by re-linking the original libraries (e.g. brew link --overwrite boost)" - return + exit 1 fi echo "Created the combined library at '${_universal_lib}" @@ -78,14 +54,14 @@ c2-make-universal-dylib() { ln -v -s "${_universal_lib}" "${_override_lib}" } -sudo mkdir /opt/homebrew-x86_64 -sudo mkdir /opt/universal-lib +sudo mkdir "$x86_64_homebrew_dir" +sudo mkdir "$universal_lib_dir" -sudo chown -R $USER /opt/universal-lib +sudo chown -R $USER "$universal_lib_dir" echo "Installing x86_64 brew" -sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C /opt/homebrew-x86_64 -sudo chown -R $USER /opt/homebrew-x86_64 +sudo curl -L https://github.com/Homebrew/brew/tarball/master | sudo tar xz --strip 1 -C "$x86_64_homebrew_dir" +sudo chown -R $USER "$x86_64_homebrew_dir" echo "Installing ARM dependencies" brew install "$@" @@ -93,18 +69,10 @@ brew install "$@" echo "Installing x86_64 dependencies" for dep in "$@" do - arch -x86_64 /opt/homebrew-x86_64/bin/brew fetch --force --bottle-tag=x86_64_monterey "$dep" - arch -x86_64 /opt/homebrew-x86_64/bin/brew install $(arch -x86_64 /opt/homebrew-x86_64/bin/brew --cache --bottle-tag=x86_64_monterey "$dep") + arch -x86_64 "$x86_64_homebrew_dir/bin/brew" fetch --force --bottle-tag=x86_64_monterey "$dep" + arch -x86_64 "$x86_64_homebrew_dir/bin/brew" install $(arch -x86_64 "$x86_64_homebrew_dir/bin/brew" --cache --bottle-tag=x86_64_monterey "$dep") done -echo "Unlink & link libraries" -brew unlink "$@" || true -brew link --overwrite "$@" - -echo "Unlink & link x86_64" -arch -x86_64 /opt/homebrew-x86_64/bin/brew unlink "$@" || true -arch -x86_64 /opt/homebrew-x86_64/bin/brew link --overwrite "$@" - echo "Relinking boost libraries" c2-make-universal-dylib lib/libboost_random-mt.dylib diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d594b31ca4..ca6abf475d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -399,16 +399,16 @@ jobs: # macOS - uses: actions/download-artifact@v4 - name: macOS Qt6.7.3 dmg + name: macOS Qt6.7.1 dmg with: - name: chatterino-macos-Qt-6.7.3-universal.dmg + name: chatterino-macos-Qt-6.7.1-universal.dmg path: release-artifacts/ - name: Rename artifacts run: | ls -l # Rename the macos build to indicate that it's for macOS 12.0 users - mv chatterino-macos-Qt-6.7.3-x86_64.dmg Chatterino-macOS-12.0-universal.dmg + mv chatterino-macos-Qt-6.7.1-universal.dmg Chatterino-macOS-12.0-universal.dmg working-directory: release-artifacts shell: bash diff --git a/.github/workflows/create-installer.yml b/.github/workflows/create-installer.yml index a746d3c8e31..12df9f50259 100644 --- a/.github/workflows/create-installer.yml +++ b/.github/workflows/create-installer.yml @@ -150,7 +150,7 @@ jobs: mv chatterino-windows-x86-64-Qt-6.7.3-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z - mv chatterino-macos-Qt-6.7.3-universal.dmg Chatterino.dmg + mv chatterino-macos-Qt-6.7.1-universal.dmg Chatterino.dmg - name: Hash files working-directory: build diff --git a/CHANGELOG.c7.md b/CHANGELOG.c7.md index d64964a74f4..f9287c48714 100644 --- a/CHANGELOG.c7.md +++ b/CHANGELOG.c7.md @@ -6,3 +6,4 @@ - Dev(macOS): Changed CFBundleIdentifier from `com.chatterino` to `app.7tv.chatterino7` (fec0dbdf558b1e6e358971a256f5540d34bb6a8d) - Dev: Updated Conan version used in CI to 2.4 (330d05d50ffd296b34744dbcc97290534e8cf704) - Dev(Windows): Updated `libavif` to 1.0.4, `boost` to 1.85, and `openssl` to 3.2.2 (330d05d50ffd296b34744dbcc97290534e8cf704) +- Dev(macOS): A single universal app is now released for macOS (#274)