diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 14aba88..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: 2 -jobs: - build: - macos: - xcode: "9.0.1" - working_directory: /Users/distiller/project - steps: - - checkout - - run: - name: Update brew - command: brew update && brew upgrade python - - run: - name: Install brew dependencies - command: brew install cmake p7zip libzip libuv protobuf - - run: - name: Install python dependencies - command: pip3 install jinja2 ds_store - - run: - name: Download Qt - command: ./download_qt.sh - - run: - name: Build - command: python3 __main__.py --qt-path qt/*/*/ --update-url https://mcpelauncher.mrarm.io/ver/osx --build-id $CIRCLE_BUILD_NUM - - run: - name: Build .dmg - command: python3 build_dmg.py - - store_artifacts: - path: output/Minecraft Bedrock Launcher.dmg - destination: /Minecraft Bedrock Launcher.dmg - - run: - name: Upload the .dmg to website - command: 'curl -X POST -u "ci:$WEBSITE_CI_UPLOAD_PASS" --data-binary "@output/Minecraft Bedrock Launcher.dmg" -H "X-Type: osx-dmg" https://mcpelauncher.mrarm.io/api/v1/upload' - - run: - name: Update version number - command: 'curl -X POST -u "ci:$WEBSITE_CI_UPLOAD_PASS" -F "channel=osx" -F "build_id=$CIRCLE_BUILD_NUM" https://mcpelauncher.mrarm.io/api/v1/version' diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..b95bcc3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Checkout the wiki + url: https://mcpelauncher.readthedocs.io + about: You find useful information about this launcher + - name: Ask on Discord + url: https://discord.gg/TaUNBXr + about: You can ask for help here! diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..715a5aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + inputs: + type: + type: choice + default: draft + options: + - build + - draft + - release +jobs: + read-repo-files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Outputs + id: out + run: | + echo "mcpelauncher-ref=$(cat mcpelauncher.commit)" >> $GITHUB_OUTPUT + outputs: + mcpelauncher-ref: ${{ steps.out.outputs.mcpelauncher-ref }} + ci: + needs: read-repo-files + if: (!cancelled()) + uses: ./.github/workflows/main.yml + with: + publish: ${{ github.event_name == 'push' && github.server_url == 'https://github.com' || github.event_name == 'workflow_dispatch' && inputs.type == 'release' }} + use-repo-files: true + offset: 400 + build-m1: true + draft: ${{ github.event_name == 'workflow_dispatch' && inputs.type == 'draft' }} + mcpelauncher-ref: ${{ needs.read-repo-files.outputs.mcpelauncher-ref || 'ng' }} + secrets: inherit diff --git a/.github/workflows/m1.yml b/.github/workflows/m1.yml new file mode 100644 index 0000000..8dea206 --- /dev/null +++ b/.github/workflows/m1.yml @@ -0,0 +1,280 @@ +name: Manual Build +on: + workflow_call: + inputs: + mcpelauncher-manifest-repo: + description: 'mcpelauncher repo' + default: 'https://github.com/minecraft-linux/mcpelauncher-manifest.git' + type: string + mcpelauncher-manifest-ref: + description: 'mcpelauncher ref' + default: 'ng' + type: string + submodule-refs: + type: string + default: "[]" + workflow_dispatch: + inputs: + mcpelauncher-manifest-repo: + description: 'mcpelauncher repo' + default: 'https://github.com/minecraft-linux/mcpelauncher-manifest.git' + type: string + mcpelauncher-manifest-ref: + description: 'mcpelauncher ref' + default: 'ng' + type: string + submodule-refs: + type: string + default: "[]" + +jobs: + openssl: + runs-on: ${{ matrix.OS }} + strategy: + fail-fast: false + matrix: + include: + - OS: macos-latest + deps: '' + sdkroot: '' + version: '11.0' + arch: 'arm64' + opensslflags: darwin64-arm64 + env: + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }} + cache-name: cache-openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + steps: + - name: Cache openssl + id: cache + uses: actions/cache@v4 + with: + path: output + key: ${{ env.cache-name }} + - uses: actions/checkout@v1 + if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }} + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + - name: Install Deps + if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.deps != '' }} + run: ${{ matrix.deps }} + - name: Build OpenSSL + if: steps.cache.outputs.cache-hit != 'true' + shell: pwsh + run: | + if ('${{ matrix.sdkroot }}' -ne '') { + if ('${{ matrix.sdkroot }}'.StartsWith('/')) { + $Env:SDKROOT = '${{ matrix.sdkroot }}' + } else { + $Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}' + } + } + git clone https://github.com/openssl/openssl.git -b openssl-3.2 + $INSDIR = (Get-Location).ToString() + "/output" + pushd openssl + perl ./Configure ${{ matrix.opensslflags }} ('--prefix=' + $INSDIR) + make install_sw + - name: Create tar archive + run: | + install_name_tool -id @rpath/libssl.dylib -add_rpath @loader_path/../Frameworks lib/libssl.dylib || : + install_name_tool -id @rpath/libcrypto.dylib -add_rpath @loader_path/../Frameworks lib/libcrypto.dylib || : + tar cJf ../openssl.tar.xz . + working-directory: output + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + path: output/ + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar + path: openssl.tar.xz + angle: + runs-on: ${{ matrix.OS }} + strategy: + fail-fast: false + matrix: + include: + - OS: macos-latest + deps: '' + version: '11.0' + arch: 'arm64' + env: + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }} + cache-name: cache-angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + steps: + - name: Cache angle + id: cache + uses: actions/cache@v4 + with: + path: output + key: ${{ env.cache-name }} + - uses: actions/checkout@v1 + if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }} + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + - name: Install Deps + if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.deps != '' }} + run: ${{ matrix.deps }} + - name: Build angle + if: steps.cache.outputs.cache-hit != 'true' + shell: pwsh + run: | + if ('${{ matrix.sdkroot }}' -ne '') { + if ('${{ matrix.sdkroot }}'.StartsWith('/')) { + $Env:SDKROOT = '${{ matrix.sdkroot }}' + } else { + $Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}' + } + } + $INSDIR = (Get-Location).ToString() + "/output" + mkdir $INSDIR + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + $Env:PATH = $Env:PATH + ':' + $PWD.ToString() + '/depot_tools' + git clone https://github.com/minecraft-linux/angle.git -b metal-freeze + pushd angle + python scripts/bootstrap.py + gclient sync + @" + target_cpu="${{ matrix.arch }}" + is_debug=false + mac_sdk_min="${{ matrix.version }}" + mac_min_system_version="${{ matrix.version }}" + mac_deployment_target="${{ matrix.version }}" + angle_enable_metal=true + angle_enable_swiftshader=false + angle_enable_vulkan=false + "@ > ($INSDIR + "/args.gn") + if ('${{ matrix.sdkroot }}' -ne '') { + echo 'mac_sdk_path="' + $Env:SDKROOT + '"' >> ($INSDIR + "/args.gn") + } + echo "args.gn:" + cat ($INSDIR + "/args.gn") + echo "Confguring" + gn gen ($INSDIR) + autoninja -C ($INSDIR) libEGL libGLESv2 + - name: Create tar archive + run: | + tar cJf ../angle.tar.xz . + working-directory: output + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + path: output/ + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar + path: angle.tar.xz + build: + runs-on: ${{ matrix.OS }} + needs: [ "openssl" ] + strategy: + fail-fast: false + matrix: + include: + - AppImage: false + OS: macos-latest + arch: arm64 + version: "11.0" + container: '{}' + deps: | + brew install autoconf automake + echo 'set(CMAKE_SYSTEM_NAME Darwin)' > toolchain.txt + echo 'set(CMAKE_SYSTEM_PROCESSOR aarch64)' >> toolchain.txt + triple: arm64-apple-darwin + cmakeextraflags: ('-DCMAKE_TOOLCHAIN_FILE='+ $INSDIR + '/../toolchain.txt') + openssl: true + env: + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }} + CC: clang + CXX: clang++ + DEBIAN_FRONTEND: noninteractive + # container: ${{ fromJson(matrix.container) }} + steps: + - uses: actions/checkout@v1 + if: ${{ startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }} + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + - name: Install Deps + shell: pwsh + run: ${{ matrix.deps }} + - name: Sync Submodule Sources + uses: actions/github-script@v7 + with: + github-token: none + script: | + var downloadRepo = async function(path, repo, ref) { + await io.mkdirP(path); + await exec.exec("git", ["init"], { cwd: path }); + await exec.exec("git", ["remote", "add", "origin", repo], { cwd: path }); + await exec.exec("git", ["fetch", "origin", ref], { cwd: path }); + await exec.exec("git", ["reset", "--hard", "FETCH_HEAD"], { cwd: path }); + await exec.exec("git", ["submodule", "update", "--init", "--recursive"], { cwd: path }); + }; + await downloadRepo("mcpelauncher", process.env.MCPELAUNCHER_REPO, process.env.MCPELAUNCHER_REF); + var submoduleRefs = JSON.parse(process.env.SUBMODULEREFS); + for(var submoduleRef of submoduleRefs) { + if(submoduleRef.project === "mcpelauncher") { + await exec.exec("git", ["fetch", submoduleRef.origin || "origin", submoduleRef.ref], { cwd: `${submoduleRef.project}/${submoduleRef.path}` }); + await exec.exec("git", ["checkout", "FETCH_HEAD"], { cwd: `${submoduleRef.project}/${submoduleRef.path}` }); + } + } + env: + SUBMODULEREFS: ${{ inputs.submodule-refs || '[]' }} + MCPELAUNCHER_REPO: ${{ inputs.mcpelauncher-manifest-repo }} + MCPELAUNCHER_REF: ${{ inputs.mcpelauncher-manifest-ref }} + - uses: actions/download-artifact@v4 + id: openssl + if: ${{ matrix.openssl }} + with: + name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + - name: Building mcpelauncher ${{ inputs.mcpelauncher-manifest-repo }}/${{ inputs.mcpelauncher-manifest-ref }} + shell: pwsh + env: + CC: clang + CXX: clang++ + run: | + if ('${{ matrix.sdkroot }}' -ne '') { + if ('${{ matrix.sdkroot }}'.StartsWith('/')) { + $Env:SDKROOT = '${{ matrix.sdkroot }}' + } else { + $Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}' + } + } + mkdir output + mkdir build + $INSDIR = (Get-Location).ToString() + "/output" + ${{ matrix.envflags }} + pushd build + $EXTRA_FLAGS = '' + if ('${{steps.openssl.outputs.download-path}}' -ne '') { + brew uninstall --ignore-dependencies openssl@3 + if ($EXTRA_FLAGS -ne '') { + $EXTRA_FLAGS += ' ' + } + $EXTRA_FLAGS += '-DOPENSSL_ROOT_DIR=${{steps.openssl.outputs.download-path}}' + } + cmake ../mcpelauncher '-DCMAKE_POLICY_VERSION_MINIMUM=4.0' '-DCMAKE_BUILD_TYPE=Release' '-DBUILD_UI=OFF' ('-DCMAKE_INSTALL_PREFIX=' + $INSDIR) -DCMAKE_ASM_FLAGS="--target=${{ matrix.triple }}" -DCMAKE_C_FLAGS="--target=${{ matrix.triple }} ${{ matrix.cflags }}" -DCMAKE_CXX_FLAGS="--target=${{ matrix.triple }} ${{ matrix.cxxflags }}" -DCMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} $EXTRA_FLAGS ${{ matrix.cmakeextraflags }} '-DMSA_DAEMON_PATH=.' '-DENABLE_DEV_PATHS=OFF' '-DXAL_WEBVIEW_QT_PATH=.' + make install -j4 + popd + popd + + - name: Create tar archive + run: | + tar cJf ../mcpelauncher.tar.xz . + working-directory: output + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: mcpelauncher-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }} + path: output/ + - name: Upload tar + uses: actions/upload-artifact@v4 + with: + name: mcpelauncher-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar + path: mcpelauncher.tar.xz diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ea7444c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,909 @@ +on: + workflow_call: + inputs: + submodule-refs: + type: string + default: "[]" + mcpelauncher-repo: + type: string + default: https://github.com/minecraft-linux/mcpelauncher-manifest + mcpelauncher-ref: + type: string + default: ${{ github.repository == 'minecraft-linux/mcpelauncher-manifest' && (github.sha || github.ref) || 'ng' }} + mcpelauncher-ui-repo: + type: string + default: https://github.com/minecraft-linux/mcpelauncher-ui-manifest + mcpelauncher-ui-ref: + type: string + default: ${{ github.repository == 'minecraft-linux/mcpelauncher-ui-manifest' && (github.sha || github.ref) || 'ng' }} + msa-repo: + type: string + default: https://github.com/minecraft-linux/msa-manifest + msa-ref: + type: string + default: ${{ github.repository == 'minecraft-linux/msa-manifest' && (github.sha || github.ref) || 'master' }} + MacOSX1014sdkRepo: + type: string + default: ChristopherHX/MacOSX10.14.sdk + MacOSX1014sdkRef: + type: string + default: 18f574aa8d71402560dd3cbf349a9f8b2cec3833 + use-repo-files: + type: boolean + default: false + publish: + type: boolean + default: false + draft: + type: boolean + default: false + offset: + type: number + default: 0 + build-m1: + type: boolean + default: true + secrets: + MacOSX1014sdk: + description: 'A ssh key to download macOS sdk 10.14' + required: false + SPARKLE_ECDSA: + description: 'sparkle ecdsa public key' + required: false + SPARKLE_ECDSA_PUB: + description: 'sparkle ecdsa public key' + required: false +jobs: + build-libcxx32: + runs-on: macos-15-intel + steps: + #- name: Select Xcode + # run: sudo xcode-select -switch /Applications/Xcode_14.2.app + - name: Check Cache libcxx32 + id: libcxx32-llvm + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-libcxx32--macos-10-10-4 + with: + path: libcxx32-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx32 + if: steps.libcxx32-llvm.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-libcxx32--macos-10-10-4 + with: + path: libcxx32-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - uses: actions/checkout@v1 + if: steps.libcxx32-llvm.outputs.cache-hit != 'true' + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + id: setup-py + - name: Build libcxx, libcxxabi + if: steps.libcxx32-llvm.outputs.cache-hit != 'true' + run: | + export MACOSX_DEPLOYMENT_TARGET=10.10.0 + export SDKROOT=${{ github.workspace }}/../MacOSX-SDKs/MacOSX10.10.sdk + git clone https://github.com/llvm/llvm-project.git llvm -b release/10.x + mkdir -p libcxx32-build + cd libcxx32-build + cmake ../llvm/llvm -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DHAVE_CXX_ATOMICS_WITHOUT_LIB=ON -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=ON -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" -DCMAKE_BUILD_TYPE=Release -DLIBCXX_BUILD_32_BITS=ON -DLIBCXXABI_BUILD_32_BITS=ON -DLLVM_BUILD_32_BITS=ON -DPYTHON_EXECUTABLE=${{ steps.setup-py.outputs.python-path }} + make -j8 cxx cxxabi + build-libcxx64: + runs-on: macos-15-intel + steps: + - name: Check Cache libcxx64 + id: libcxx64-llvm + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-libcxx64--macos-10-10-4 + with: + path: libcxx64-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx64 + if: steps.libcxx64-llvm.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-libcxx64--macos-10-10-4 + with: + path: libcxx64-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - uses: actions/checkout@v1 + if: steps.libcxx64-llvm.outputs.cache-hit != 'true' + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + id: setup-py + - name: Build libcxx, libcxxabi + if: steps.libcxx64-llvm.outputs.cache-hit != 'true' + run: | + export MACOSX_DEPLOYMENT_TARGET=10.10.0 + export SDKROOT=${{ github.workspace }}/../MacOSX-SDKs/MacOSX10.10.sdk + git clone https://github.com/llvm/llvm-project.git llvm -b release/10.x + mkdir -p libcxx64-build + cd libcxx64-build + cmake ../llvm/llvm -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DHAVE_CXX_ATOMICS_WITHOUT_LIB=ON -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=ON -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=${{ steps.setup-py.outputs.python-path }} + make -j8 cxx cxxabi + build-libcxx: + runs-on: macos-15-intel + needs: [build-libcxx32,build-libcxx64] + steps: + - name: Check libcxx + id: libcxx-llvm + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-libcxx--macos-10-10-4 + with: + path: libcxx-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx32 + if: steps.libcxx-llvm.outputs.cache-hit != 'true' + id: libcxx32-llvm + uses: actions/cache@v4 + env: + cache-name: cache-libcxx32--macos-10-10-4 + with: + path: libcxx32-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx64 + if: steps.libcxx-llvm.outputs.cache-hit != 'true' + id: libcxx64-llvm + uses: actions/cache@v4 + env: + cache-name: cache-libcxx64--macos-10-10-4 + with: + path: libcxx64-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx + if: steps.libcxx-llvm.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-libcxx--macos-10-10-4 + with: + path: libcxx-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Build universal lib + if: steps.libcxx-llvm.outputs.cache-hit != 'true' + run: | + mkdir -p libcxx-build/ + lipo -create libcxx32-build/lib/libc++.dylib libcxx64-build/lib/libc++.dylib -output libcxx-build/libc++.1.dylib + lipo -create libcxx32-build/lib/libc++abi.dylib libcxx64-build/lib/libc++abi.dylib -output libcxx-build/libc++abi.1.dylib + cd libcxx-build + ln -s libc++.1.dylib libc++.dylib + ln -s libc++abi.1.dylib libc++abi.dylib + install_name_tool -rpath @loader_path/../lib @loader_path/../Frameworks libc++.dylib + install_name_tool -rpath @loader_path/../lib @loader_path/../Frameworks libc++abi.dylib + buildopenssl32: + runs-on: macos-15-intel + steps: + - name: Check for openssl + id: cache-openssl32 + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-openssl32-macos-10-10 + with: + path: ssl32 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl + if: steps.cache-openssl32.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-openssl32-macos-10-10 + with: + path: ssl32 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - uses: actions/checkout@v3 + if: env.HAVE_SECRET && steps.cache-openssl32.outputs.cache-hit != 'true' + with: + repository: ${{ inputs.MacOSX1014sdkRepo}} + ref: ${{ inputs.MacOSX1014sdkRef }} + ssh-key: ${{ secrets.MacOSX1014sdk }} + path: MacOSX10.14.sdk + env: + HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }} + - uses: actions/checkout@v1 + if: env.MISSING_SECRET && steps.cache-openssl32.outputs.cache-hit != 'true' + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + env: + MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }} + - name: Update env + if: steps.cache-openssl32.outputs.cache-hit != 'true' + run: | + echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV + echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV + - name: Prepare Legacy sdk + if: steps.cache-openssl32.outputs.cache-hit != 'true' + run: | + cd "$SDKROOT/usr/include" + ln -s "$(xcrun --sdk macosx --show-sdk-path)/usr/include/c++" c++ + - name: Build OpenSSL + if: steps.cache-openssl32.outputs.cache-hit != 'true' + run: | + # Keep sing openssl 1.1.1 on 32bit, 3.2 refuses to configure + git clone https://github.com/openssl/openssl.git -b OpenSSL_1_1_1-stable + cd openssl + KERNEL_BITS=32 ./config --prefix="$PWD/../ssl32" + make -j8 + sudo make install_sw -j8 + buildopenssl64: + runs-on: macos-15-intel + steps: + - name: Check for openssl + id: cache-openssl64 + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-openssl64-macos-10-10 + with: + path: ssl64 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl + if: steps.cache-openssl64.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-openssl64-macos-10-10 + with: + path: ssl64 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - uses: actions/checkout@v3 + if: env.HAVE_SECRET && steps.cache-openssl64.outputs.cache-hit != 'true' + with: + repository: ${{ inputs.MacOSX1014sdkRepo}} + ref: ${{ inputs.MacOSX1014sdkRef }} + ssh-key: ${{ secrets.MacOSX1014sdk }} + path: MacOSX10.14.sdk + env: + HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }} + - uses: actions/checkout@v1 + if: env.MISSING_SECRET && steps.cache-openssl64.outputs.cache-hit != 'true' + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + env: + MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }} + - name: Update env + if: steps.cache-openssl64.outputs.cache-hit != 'true' + run: | + echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV + echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV + - name: Prepare Legacy sdk + if: steps.cache-openssl64.outputs.cache-hit != 'true' + run: | + cd "$SDKROOT/usr/include" + ln -s "$(xcrun --sdk macosx --show-sdk-path)/usr/include/c++" c++ + - name: Build OpenSSL + if: steps.cache-openssl64.outputs.cache-hit != 'true' + run: | + git clone https://github.com/openssl/openssl.git -b openssl-3.2 + cd openssl + KERNEL_BITS=64 ./config --prefix="$PWD/../ssl64" + make -j8 + sudo make install_sw -j8 + buildopenssl: + runs-on: macos-15-intel + needs: [buildopenssl32, buildopenssl64] + steps: + - name: Check openssl + id: openssl + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-openssl-2 + with: + path: ssl + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl + if: steps.openssl.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-openssl-2 + with: + path: ssl + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl32 + if: steps.openssl.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-openssl32-macos-10-10 + with: + path: ssl32 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl64 + if: steps.openssl.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-openssl64-macos-10-10 + with: + path: ssl64 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Build universal lib + if: steps.openssl.outputs.cache-hit != 'true' + run: | + mkdir -p ssl/lib + lipo -create ssl32/lib/libssl.dylib ssl64/lib/libssl.dylib -output ssl/lib/libssl.dylib + lipo -create ssl32/lib/libcrypto.dylib ssl64/lib/libcrypto.dylib -output ssl/lib/libcrypto.dylib + cd ssl/lib + install_name_tool -id @rpath/libssl.dylib -add_rpath @loader_path/../Frameworks libssl.dylib + install_name_tool -id @rpath/libcrypto.dylib -add_rpath @loader_path/../Frameworks libcrypto.dylib + buildangle: + runs-on: macos-15-intel + # needs: [buildangle32, buildangle64] + steps: + - name: Check angle + id: angle + uses: ChristopherHX/check-cache@main + env: + cache-name: cache-angle-3 + with: + path: source/osx-angle-ci/artifacts + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache angle + if: steps.angle.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-angle-3 + with: + path: source/osx-angle-ci/artifacts + key: ${{ runner.os }}-build-${{ env.cache-name }} + # See https://github.com/minecraft-linux/macos-builder/commit/2588136caaad8c993f3912d981dab13b9846360e for building it + # python2 now runs via python3 in macOS hosted runners + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + architecture: 'x64' + if: steps.angle.outputs.cache-hit != 'true' + - run: | + mkdir -p source/osx-angle-ci/artifacts + if: steps.angle.outputs.cache-hit != 'true' + - run: | + from subprocess import check_call as call + import shutil + from os import path + DMG_MOUNT_PATH = '/Volumes/Minecraft Bedrock Launcher/' + DMG_FILE = 'Minecraft Bedrock Launcher.dmg' + call(['curl', '-sL', '-o', DMG_FILE, 'https://github.com/minecraft-linux/macos-builder/releases/download/v0.12.2-448/Minecraft_Bedrock_Launcher_v0.12.2-macOS-x86_64-0.2.448_macOS_10.13.0.dmg']) + call(['hdiutil', 'attach', '-noautoopen', '-mountpoint', DMG_MOUNT_PATH, '-quiet', DMG_FILE]) + shutil.copy2(path.join(DMG_MOUNT_PATH, 'Minecraft Bedrock Launcher.app', 'Contents', 'Frameworks', 'libEGL.dylib'), './source/osx-angle-ci/artifacts/libEGL.dylib', follow_symlinks = True) + shutil.copy2(path.join(DMG_MOUNT_PATH, 'Minecraft Bedrock Launcher.app', 'Contents', 'Frameworks', 'libGLESv2.dylib'), './source/osx-angle-ci/artifacts/libGLESv2.dylib', follow_symlinks = True) + shell: python + if: steps.angle.outputs.cache-hit != 'true' + - run: | + lipo -remove arm64 ./source/osx-angle-ci/artifacts/libEGL.dylib -output ./source/osx-angle-ci/artifacts/libEGL.dylib + lipo -remove arm64 ./source/osx-angle-ci/artifacts/libGLESv2.dylib -output ./source/osx-angle-ci/artifacts/libGLESv2.dylib + if: steps.angle.outputs.cache-hit != 'true' + build-protobuf: + runs-on: macos-15-intel + steps: + #- name: Select Xcode + # run: sudo xcode-select -switch /Applications/Xcode_14.2.app + - uses: actions/cache/restore@v4 + id: cache + with: + path: protobuf-build + key: protobuf-macos-x64 + lookup-only: true + - uses: actions/checkout@v3 + if: env.HAVE_SECRET && steps.cache.outputs.cache-hit != 'true' + with: + repository: ${{ inputs.MacOSX1014sdkRepo}} + ref: ${{ inputs.MacOSX1014sdkRef }} + ssh-key: ${{ secrets.MacOSX1014sdk }} + path: MacOSX10.14.sdk + env: + HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }} + - uses: actions/checkout@v1 + if: env.MISSING_SECRET && steps.cache.outputs.cache-hit != 'true' + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + env: + MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }} + - name: Update env + if: steps.cache.outputs.cache-hit != 'true' + run: | + echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV + echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV + - name: Prepare Legacy sdk + if: steps.cache.outputs.cache-hit != 'true' + run: | + cd "$SDKROOT/usr/include" + ln -s "$(xcrun --sdk macosx --show-sdk-path)/usr/include/c++" c++ + - name: Install brew dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: | + brew install autoconf || : + brew install automake || : + brew install libtool || : + - name: Get Source Protobuf + if: steps.cache.outputs.cache-hit != 'true' + run: | + git clone https://github.com/protocolbuffers/protobuf.git -b 21.x protobuf + git -C protobuf submodule update --init --recursive + - name: Build Protobuf + if: steps.cache.outputs.cache-hit != 'true' + run: | + mkdir -p "$GITHUB_WORKSPACE/protobuf-build" + ./autogen.sh + ./configure --prefix="$GITHUB_WORKSPACE/protobuf-build" + make -j8 + make install -j8 + working-directory: protobuf + - uses: actions/cache/save@v4 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: protobuf-build + key: protobuf-macos-x64 + build-m1: + if: inputs.build-m1 + uses: ./.github/workflows/m1.yml + with: + mcpelauncher-manifest-repo: ${{ inputs.mcpelauncher-repo }} + mcpelauncher-manifest-ref: ${{ inputs.mcpelauncher-ref }} + submodule-refs: ${{ inputs.submodule-refs }} + build: + continue-on-error: true + runs-on: macos-15-intel + if: "!(cancelled() || failure())" + needs: [build-libcxx, buildopenssl, buildangle, build-protobuf, build-m1] + permissions: + id-token: write # required to get an oidc token + contents: read + strategy: + fail-fast: false + matrix: + include: + - target: "10.10.0" + micro: 0 + QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_592/ + QT_VERSION_SHORT: 5.9.2 + QT_VERSION: 5.9.2-0-201710050729 + QT_PACKAGE_PREFIX: qt.592. + QT_PACKAGE_SUFFIX: clang_64 + QT_PREBUILT_SUFFIX: -MacOS-OSX_10_10-Clang-MacOS-OSX_10_10-X86_64 + extraflags: "--qtworkaround" + - target: "10.12.0" + micro: 1 + QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5113/ + QT_VERSION_SHORT: 5.11.3 + QT_VERSION: 5.11.3-0-201811291904 + QT_PACKAGE_PREFIX: qt.qt5.5113. + QT_PACKAGE_SUFFIX: clang_64 + QT_PREBUILT_SUFFIX: -MacOS-MacOS_10_12-Clang-MacOS-MacOS_10_12-X86_64 + - target: "10.13.0" + micro: 2 + QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5150/ + QT_VERSION_SHORT: 5.15.0 + QT_VERSION: 5.15.0-0-202005140805 + QT_PACKAGE_PREFIX: qt.qt5.5150. + QT_PACKAGE_SUFFIX: clang_64 + QT_PREBUILT_SUFFIX: -MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64 + env: + CMAKE_OSX_ARCHITECTURES: x86_64 # Is this needed? archive member: libglfw3.a(cocoa_init.m.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) + steps: + #- name: Select Xcode + # run: sudo xcode-select -switch /Applications/Xcode_14.2.app + - name: Setup Vars + id: setup-vars + uses: actions/github-script@v7 + with: + script: | + core.setOutput("owner", context.repo.owner); + core.setOutput("repo", context.repo.repo); + core.setOutput("build-number", "" + (${{ github.run_number }} + ${{ inputs.offset }})); + - uses: ChristopherHX/oidc@f8f35d97bc37ffbe779bb3ab8453920fedf6fb37 + id: oidc + continue-on-error: true + - uses: actions/checkout@v3 + with: + repository: ${{ steps.oidc.outputs.job_workflow_repo_name_and_owner || inputs.submodule-refs && 'minecraft-linux/macos-builder' || github.repository }} + ref: ${{ steps.oidc.outputs.job_workflow_repo_ref || inputs.submodule-refs && 'main' || github.sha || github.ref }} + - name: Sync Submodule Sources + if: ${{ !inputs.use-repo-files && inputs.submodule-refs }} + uses: actions/github-script@v7 + with: + github-token: none + script: | + var downloadRepo = async function(path, repo, ref) { + await io.mkdirP(path); + await exec.exec("git", ["init"], { cwd: path }); + await exec.exec("git", ["remote", "add", "origin", repo], { cwd: path }); + await exec.exec("git", ["fetch", "origin", ref], { cwd: path }); + await exec.exec("git", ["reset", "--hard", "FETCH_HEAD"], { cwd: path }); + await exec.exec("git", ["submodule", "update", "--init", "--recursive"], { cwd: path }); + }; + await downloadRepo("source/mcpelauncher", process.env.MCPELAUNCHER_REPO, process.env.MCPELAUNCHER_REF); + await downloadRepo("source/mcpelauncher-ui", process.env.MCPELAUNCHER_UI_REPO, process.env.MCPELAUNCHER_UI_REF); + await downloadRepo("source/msa", process.env.MSA_REPO, process.env.MSA_REF); + var submoduleRefs = JSON.parse(process.env.SUBMODULEREFS); + for(var submoduleRef of submoduleRefs) { + await exec.exec("git", ["fetch", submoduleRef.origin || "origin", submoduleRef.ref], { cwd: `source/${submoduleRef.project}/${submoduleRef.path}` }); + await exec.exec("git", ["checkout", "FETCH_HEAD"], { cwd: `source/${submoduleRef.project}/${submoduleRef.path}` }); + } + env: + SUBMODULEREFS: ${{ inputs.submodule-refs }} + MCPELAUNCHER_REPO: ${{ inputs.mcpelauncher-repo }} + MCPELAUNCHER_REF: ${{ inputs.mcpelauncher-ref }} + MCPELAUNCHER_UI_REPO: ${{ inputs.mcpelauncher-ui-repo }} + MCPELAUNCHER_UI_REF: ${{ inputs.mcpelauncher-ui-ref }} + MSA_REPO: ${{ inputs.msa-repo }} + MSA_REF: ${{ inputs.msa-ref }} + + - name: download m1 angle + if: inputs.build-m1 + uses: actions/download-artifact@v4 + with: + name: angle-macos-latest-11.0-arm64 + path: "m1-artifacts" + - name: download m1 openssl + if: inputs.build-m1 + uses: actions/download-artifact@v4 + with: + name: openssl-macos-latest-11.0-arm64 + path: "m1-artifacts" + - name: download m1 mcpelauncher + if: inputs.build-m1 + uses: actions/download-artifact@v4 + with: + name: mcpelauncher-macos-latest-11.0-arm64 + path: "m1-artifacts" + - name: Cache libcxx32 + id: libcxx32-llvm + uses: actions/cache@v4 + env: + cache-name: cache-libcxx32--macos-10-10-4 + with: + path: libcxx32-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx64 + id: libcxx64-llvm + uses: actions/cache@v4 + env: + cache-name: cache-libcxx64--macos-10-10-4 + with: + path: libcxx64-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache libcxx + id: libcxx-llvm + uses: actions/cache@v4 + env: + cache-name: cache-libcxx--macos-10-10-4 + with: + path: libcxx-build + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl + uses: actions/cache@v4 + env: + cache-name: cache-openssl-2 + with: + path: ssl + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl32 + uses: actions/cache@v4 + env: + cache-name: cache-openssl32-macos-10-10 + with: + path: ssl32 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Cache openssl64 + uses: actions/cache@v4 + env: + cache-name: cache-openssl64-macos-10-10 + with: + path: ssl64 + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: patch ssl + run: | + cd ssl32 + rm -rf lib + ln -s ../ssl/lib + cd ../ssl64 + rm -rf lib + ln -s ../ssl/lib + - name: Cache angle + if: steps.angle.outputs.cache-hit != 'true' + uses: actions/cache@v4 + env: + cache-name: cache-angle-3 + with: + path: source/osx-angle-ci/artifacts + key: ${{ runner.os }}-build-${{ env.cache-name }} + - uses: actions/cache/restore@v4 + with: + fail-on-cache-miss: true + path: protobuf-build + key: protobuf-macos-x64 + - name: brew install / link + run: | + brew install p7zip automake + brew uninstall openssl@3 || : + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + - name: Cache qt + if: 'false' + id: cache-qt + uses: actions/cache@v4 + env: + cache-name: cache-qt-macos-${{ matrix.target }} + with: + path: qt + key: ${{ runner.os }}-build-${{ env.cache-name }} + - name: Download Qt + # if: steps.cache-qt.outputs.cache-hit != 'true' + run: | + ./download_qt.sh + env: + QT_BASE_URL: ${{ matrix.QT_BASE_URL }} + QT_VERSION_SHORT: ${{ matrix.QT_VERSION_SHORT }} + QT_VERSION: ${{ matrix.QT_VERSION }} + QT_PACKAGE_PREFIX: ${{ matrix.QT_PACKAGE_PREFIX }} + QT_PACKAGE_SUFFIX: ${{ matrix.QT_PACKAGE_SUFFIX }} + QT_PREBUILT_SUFFIX: ${{ matrix.QT_PREBUILT_SUFFIX }} + - uses: actions/checkout@v3 + if: env.HAVE_SECRET + with: + repository: ${{ inputs.MacOSX1014sdkRepo}} + ref: ${{ inputs.MacOSX1014sdkRef }} + ssh-key: ${{ secrets.MacOSX1014sdk }} + path: MacOSX10.14.sdk + env: + HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }} + - uses: actions/checkout@v1 + if: env.MISSING_SECRET + with: + repository: phracker/MacOSX-SDKs + ref: refs/heads/master + env: + MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }} + - name: Update env + run: | + echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.target }} > $GITHUB_ENV + echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV + - name: Prepare Legacy sdk + run: | + DEST="$PWD/libcxx64-build/include/c++" + cd "$SDKROOT/usr/include" + #ln -s "$(xcrun --sdk macosx --show-sdk-path)/usr/include/c++" c++ + ln -s "$DEST" c++ + - name: Get Source libzip + run: | + git clone https://github.com/nih-at/libzip libzip + git -C libzip checkout v1.9.2 + - name: Build libzip + run: | + cmake libzip -B libzip-build -DCMAKE_POLICY_VERSION_MINIMUM=4.0 -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=OFF -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DENABLE_FDOPEN=OFF + cmake --build libzip-build --parallel + sudo cmake --build libzip-build --target install --parallel + - name: Install python dependencies # This is a throw away VM + run: pip3 install --break-system-packages jinja2 ds_store + + - name: add deps to base app + run: | + sudo cp -R protobuf-build/* /usr/local/ + mkdir -p base-app/Contents/Frameworks/ + cp libcxx-build/* base-app/Contents/Frameworks/ + cp ssl/lib/* base-app/Contents/Frameworks/ + cp ./source/osx-angle-ci/artifacts/* base-app/Contents/Frameworks/ + - name: add m1 build + if: inputs.build-m1 + run: | + mkdir -p base-app/Contents/Frameworks/ + lipo -create m1-artifacts/lib/libssl.dylib base-app/Contents/Frameworks/libssl.dylib -output base-app/Contents/Frameworks/libssl.dylib + lipo -create m1-artifacts/lib/libcrypto.dylib base-app/Contents/Frameworks/libcrypto.dylib -output base-app/Contents/Frameworks/libcrypto.dylib + lipo -create m1-artifacts/libEGL.dylib base-app/Contents/Frameworks/libEGL.dylib -output base-app/Contents/Frameworks/libEGL.dylib + lipo -create m1-artifacts/libGLESv2.dylib base-app/Contents/Frameworks/libGLESv2.dylib -output base-app/Contents/Frameworks/libGLESv2.dylib + mkdir -p base-app/Contents/Resources/ + cp -R m1-artifacts/share/* base-app/Contents/Resources/ + mkdir -p base-app/Contents/MacOS/ + cp m1-artifacts/bin/mcpelauncher-client base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a + chmod +x base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a + install_name_tool -add_rpath @loader_path/../Frameworks base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a || : + - name: Build + run: | + python3 __main__.py --qt-path qt/*/*${{ secrets.SPARKLE_ECDSA_PUB && format('{0} {1}', ' --update-sparkle-appcast https://github.com/${GITHUB_REPOSITORY}/releases/download/ng.dmg/appcast.xml --update-sparkle-ed-public-key ', secrets.SPARKLE_ECDSA_PUB) }} --app-root base-app --build-id ${{ steps.setup-vars.outputs.build-number }} --prettyversion "$(cat version.txt)-macOS-x86_64-0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}" --version "0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}" ${{ matrix.extraflags }}${{ !inputs.use-repo-files && inputs.submodule-refs && ' --skip-sync-sources' || '' }}${{ secrets.MacOSX1014sdk && ' --use-own-curl' || '' }} + - name: Build .dmg + run: python3 build_dmg.py + - name: Generate Dist + run: | + DMG_FILENAME="Minecraft_Bedrock_Launcher_$(cat version.txt)-macOS-x86_64-0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}_macOS_${{ matrix.target }}.dmg" + mkdir -p dist + mv "${{ github.workspace }}/output/Minecraft Bedrock Launcher.dmg" "dist/${DMG_FILENAME}" + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: dmg-${{ matrix.target }} + path: dist + publish: + runs-on: macos-15-intel + needs: build + # Eventually extend this job to be able to run on other repositories, otherwise replace the owner and repository name in this job + if: ${{ !cancelled() && inputs.publish }} + steps: + - uses: actions/checkout@v3 + - name: Setup Env + run: | + echo "DMG_VERSION=$(cat version.txt)" >> $GITHUB_ENV + - name: Setup Vars + id: setup-vars + uses: actions/github-script@v7 + with: + script: | + core.setOutput("owner", context.repo.owner); + core.setOutput("repo", context.repo.repo); + core.setOutput("build-number", "" + (${{ github.run_number }} + ${{ inputs.offset }})); + - name: Download everything + uses: actions/download-artifact@v4 + with: + path: sparkle + pattern: dmg-* + - name: Download sparkle + run: | + curl -L -C - -o sparkle.tar.xz https://github.com/sparkle-project/Sparkle/releases/download/1.26.0/Sparkle-1.26.0.tar.xz + tar -xf ./sparkle.tar.xz + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Download some old dmg's and generate deltas + shell: python + run: | + from os import makedirs, fsencode, fsdecode, listdir, path, rename, getenv + import xml.etree.ElementTree as ET + from subprocess import check_call + makedirs('dist') + makedirs('dist2') + check_call(['curl', '-L', '-o', path.abspath(path.join('sparkle', 'appcast.xml')), 'https://github.com/${{ github.repository }}/releases/download/ng.dmg/appcast.xml']) + tree = ET.parse(path.join('sparkle', 'appcast.xml')) + root = tree.getroot() + i = 0 + for rank in root.iter('item'): + enc = rank.find('enclosure') + url = enc.get('url') + check_call(['curl', '-L', '-o', path.abspath(path.join('sparkle', url[url.rfind('/')+1:])), url]) + + directory = fsencode('sparkle') + for file in listdir(directory): + filename = fsdecode(file) + if filename.endswith(".dmg"): + print(filename) + macindex = filename.rindex('macOS_') + 6 + if macindex == 5: + continue + destdirname = path.join('sparkle', filename[macindex:len(filename)-4]) + print(destdirname) + if not path.isdir(destdirname): + makedirs(destdirname) + rename(path.join('sparkle', filename), path.join(destdirname, filename)) + + tagname = 'invalid' + with open('version.txt', 'r') as file: + tagname = file.read().replace('\n', '') + '-' + getenv('BUILD_NUMBER') + + print(tagname) + def dumpfile(f): + print('dumpfile: ' + f) + with open(f, 'r') as file: + print(file.read()) + + for file in listdir(directory): + ver = path.join('sparkle', fsdecode(file)) + if not path.isdir(ver): + continue + founddmg = False + for file in listdir(ver): + filename = fsdecode(file) + if filename.endswith(".dmg"): + founddmg = True + break + if not founddmg: + continue + print(ver) + dumpfile(path.join('sparkle', 'appcast.xml')) + rename(path.join('sparkle', 'appcast.xml'), path.join(ver, 'appcast.xml')) + dumpfile(path.join(ver, 'appcast.xml')) + check_call(['./bin/generate_appcast', '-s', '${{ secrets.SPARKLE_ECDSA }}', '--download-url-prefix', 'https://github.com/${{ github.repository }}/releases/download/' + tagname + '/', ver ]) + dumpfile(path.join(ver, 'appcast.xml')) + rename(path.join(ver, 'appcast.xml'), path.join('sparkle', 'appcast.xml')) + dumpfile(path.join('sparkle', 'appcast.xml')) + for file in listdir(ver): + filename = fsdecode(file) + if filename.endswith(".delta") or (filename.endswith(".dmg") and filename.find(getenv('BUILD_NUMBER') + '_macOS_') != -1): + print(filename) + rename(path.join(ver, filename), path.join('dist2', filename)) + + def register_all_namespaces(filename): + namespaces = dict([node for _, node in ET.iterparse(filename, events=['start-ns'])]) + for ns in namespaces: + ET.register_namespace(ns, namespaces[ns]) + + dumpfile(path.join('sparkle', 'appcast.xml')) + register_all_namespaces(path.join('sparkle', 'appcast.xml')) + # Revert url changes + tree2 = ET.parse(path.join('sparkle', 'appcast.xml')) + root2 = tree2.getroot() + for rank in root2.iter('item'): + enc = rank.find('enclosure') + title = rank.find('title').text + for rank2 in root.iter('item'): + if title == rank2.find('title').text: + enc.set('url', rank2.find('enclosure').get('url')) + print(enc.get('url')) + break + tree2.write(path.join('dist', 'appcast.xml'), encoding='utf-8', xml_declaration=True) + dumpfile(path.join('dist', 'appcast.xml')) + tree2.write(path.join('dist2', 'appcast.xml'), encoding='utf-8', xml_declaration=True) + if: env.HAVE_SECRET + id: files-updated + env: + HAVE_SECRET: ${{ secrets.SPARKLE_ECDSA && '1' || '' }} + BUILD_NUMBER: ${{ steps.setup-vars.outputs.build-number }} + - name: download ghr + run: | + curl -L https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_darwin_amd64.zip --output ghr.zip + unzip ghr.zip + - name: Upload ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]' && !inputs.draft) && 'Latest' || 'Draft' }} + if: steps.files-updated.result != 'skipped' + run: | + ./ghr*/ghr -c ${{ github.sha }} -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} ${{ !(github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft) && '-draft ' || '' }}-b "$LAUNCHER_RELEASE_DESCRIPTION$(cat changelog.txt)" "$(cat version.txt)-${{ steps.setup-vars.outputs.build-number }}" dist2/ + env: + LAUNCHER_RELEASE_DESCRIPTION: | + Links for linux flatpak or AppImage can be found on our wiki https://minecraft-linux.github.io. + + > [!WARNING] + > The current macOS port is about to stop receiving Minecraft updates in March 2025 + > mojang is going to make OpenGL ES 3.1 required + + > [!CAUTION] + > - You need to own Minecraft on the google play store and login with your google account to use this launcher + > - Only mac models first sold in 2012 or later can run versions after Minecraft 1.20.15 + + > [!IMPORTANT] + > - There is no arm64 dmg file + > - use the intel dmg for macOS 10.13 or newer + > - the game itself will run on arm64 + > - Hi CPU Load + > - VSync is broken when not opt in to Metal in Profile Editor + > - Metal Mode may cause a black Screen on game versions after 1.18.15 + > - The performance is better for linux, because we don't have to translate the Graphic Api + + [Download link for intel or amd based 64bit systems ( known as amd64, intel64 and x86_64 e.g. most PC's or Laptops )](https://github.com/${{ github.repository }}/releases/download/${{env.DMG_VERSION}}-${{ steps.setup-vars.outputs.build-number }}/Minecraft_Bedrock_Launcher_${{env.DMG_VERSION}}-macOS-x86_64-0.2.${{ steps.setup-vars.outputs.build-number }}_macOS_10.13.0.dmg) + + We don't support macOS 10.10 - 10.12, but are still providing releases for them under assets. + + macOS x86_64 has no native OpenGL ES 2 or 3 framework + - translating the api via google/angle to OpenGL (Metal opt in, due to bug reports) + - possible more frame drops compared to linux + + No sound on unsupported ancient mac's from pre 2012 in i386 compatibility mode + + macOS/m1 mode is experimental and is very unstable, **since macOS 14 you are no longer able to use the intel game client and have to use the m1/arm64-v8 game client** + Please leave a comment https://github.com/minecraft-linux/mcpelauncher-manifest/discussions/819 if the arm64 game launcher doesn't work at all on your m1/m2 mac, together with the whole log file of the crash or the log after a force quit + + # Not available Features you may miss + - Xbox live friend joining + - usually times out or crashs the game in both directions + - consider using the offical server software + - connect all by ip as external server + - Xbox live login + - a lot of devices seem to get error code "drowned" without beeing asked for login + - error code "drowned" has more meanings like you closed the webview window without sign in + - there is no resolution for those getting this error + - programs that rewrite http requests sent by this launcher could also cause this problem + - all xbox http requests are signed by an ecdsa key + - the second request using the token for sisu auth are always rejected by Xbox Live Servers with http code 403 Forbidden + - this problem is not reproducable for developers + + ### Changelog + - name: Publish release + if: steps.files-updated.result != 'skipped' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft + run: | + ./ghr*/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} -replace ng.dmg dist/ diff --git a/.gitignore b/.gitignore index 3750e57..9c691ae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ qt_tmp/ .idea/ __pycache__/ .DS_Store + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e502ff5 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +> [!WARNING] +> Deprecated CI scripts, I don't like piracy + +### Can I play with an APK? + +No, this allowed piracy that is forbidden in this project. + +Any attempt to document workarounds or make it easy to import an paid apk without a valid google play game license is undesirable. + +Game licenses can be revoked at any point of time by you, microsoft/mojang or google, as it happened for all residents of Russia. + +Ignoring this policy may cause suspension including termination of this project like happended between 2022-2023. + +_Exception to the rule are Minecraft Trial and Edu where the latter doesn't work at this time._ + +For the most current version of this rule see https://minecraft-linux.github.io/faq/index.html#can-i-play-with-an-apk + + +## macOS Troubleshooting & Performance Optimization + +### ANGLE & Metal Backend Setup +- On macOS Apple Silicon (M1/M2/M3/M4) and Intel Macs, ANGLE translates GLES graphics calls via Metal or OpenGL. +- To enable the native Metal backend override, set: + ```bash + ANGLE_DEFAULT_PLATFORM=metal + ``` +- For GPU rendering compatibility on Bedrock, you can pass: + ```bash + force_gl_renderer="Adreno (TM) 740" + ``` + +### Xbox Live / MSA Authentication +- Ensure `libcurl` version is 8.21.0 or newer to prevent ECDSA token verification errors on `sisu.xboxlive.com`. +- If login code "Drowned" occurs, clear stale auth cache tokens in `~/Library/Application Support/mcpelauncher/pass.token`. diff --git a/__main__.py b/__main__.py index 586efad..1a303fc 100644 --- a/__main__.py +++ b/__main__.py @@ -1,10 +1,9 @@ -from os import makedirs, path, cpu_count, listdir -from subprocess import check_call as call, check_output +from os import makedirs, path, cpu_count, listdir, getenv +from subprocess import check_call as call import subprocess from shutil import rmtree, copyfile, copytree import shutil import argparse -import json from jinja2 import Template # Change for each release @@ -30,9 +29,20 @@ def display_stage(name): parser.add_argument('--qt-path', help='Specify the Qt installation path', required=True) parser.add_argument('--update-url', help='Enable checking updates in the metalauncher from the specified URL') parser.add_argument('--build-id', help='Specify the build ID for update checking purposes') +parser.add_argument('--update-sparkle-appcast', help='Sparkle appcast URL') +parser.add_argument('--update-sparkle-ed-public-key', help='Enable checking updates in the metalauncher from the specified URL') +parser.add_argument('--version', help='App version') +parser.add_argument('--prettyversion', help='App pretty version in settings') parser.add_argument('--force', help='Always remove the output directory', action='store_true') +parser.add_argument('--qtworkaround', help='apply a qt workaround', action='store_true') +parser.add_argument('--skip-sync-sources', help='skip sync-sources', action='store_true') +parser.add_argument('--use-own-curl', help='skip sync-sources', action='store_true') +parser.add_argument('--app-root', help='base folder of the Application before running macdeployqt') args = parser.parse_args() +if(args.version): + VERSION = args.version + if path.exists(path.join(OUTPUT_DIR)): if not args.force: print('Removing `{}/`! Click enter to continue, or ^C to exit'.format(OUTPUT_DIR)) @@ -50,41 +60,51 @@ def display_stage(name): ICON_FILE = path.join(SOURCE_DIR, 'minecraft.icns') if not path.exists(ICON_FILE): display_stage("Downloading icons file") - call(['curl', '-sL', '-o', ICON_FILE, 'https://github.com/minecraft-linux/mcpelauncher-proprietary/raw/master/minecraft.icns']) + call(['curl', '-sL', '-o', ICON_FILE, 'https://github.com/minecraft-linux/mcpelauncher-ui-qt/raw/0b956a0fc816d900d5b3f2883c6a401330c50fab/Resources/mcpelauncher-icon.icns']) copyfile(ICON_FILE, path.join(APP_OUTPUT_DIR, 'Contents', 'Resources', 'minecraft.icns')) # Download the sources -def clone_repo(name, url): +def clone_repo(name, url, branch): display_stage("Cloning repository: " + url) directory = path.join(SOURCE_DIR, name) if not path.isdir(directory): - call(['git', 'clone', '--recursive', url, directory]) + makedirs(directory) + call(['git', 'init'], cwd=directory) + call(['git', 'remote', 'add', 'origin', url], cwd=directory) + call(['git', 'fetch', 'origin', branch], cwd=directory) + call(['git', 'reset', '--hard', 'FETCH_HEAD'], cwd=directory) + call(['git', 'submodule', 'update', '--init', '--recursive'], cwd=directory) else: call(['git', 'pull'], cwd=directory) - call(['git', 'submodule', 'update'], cwd=directory) + call(['git', 'submodule', 'update', '--init', '--recursive'], cwd=directory) + +if not args.skip_sync_sources: + display_stage("Downloading sources") -display_stage("Downloading sources") -clone_repo('msa', 'https://github.com/minecraft-linux/msa-manifest.git') -clone_repo('mcpelauncher', 'https://github.com/minecraft-linux/mcpelauncher-manifest.git') -clone_repo('mcpelauncher-ui', 'https://github.com/minecraft-linux/mcpelauncher-ui-manifest.git') + with open('msa.commit', 'r') as file: + clone_repo('msa', 'https://github.com/minecraft-linux/msa-manifest.git', file.read().replace('\n', '')) + with open('mcpelauncher.commit', 'r') as file: + clone_repo('mcpelauncher', 'https://github.com/minecraft-linux/mcpelauncher-manifest.git', file.read().replace('\n', '')) + with open('mcpelauncher-ui.commit', 'r') as file: + clone_repo('mcpelauncher-ui', 'https://github.com/minecraft-linux/mcpelauncher-ui-manifest.git', file.read().replace('\n', '')) # Build # QT_INSTALL_PATH = subprocess.check_output(['brew', '--prefix', 'qt']).decode('utf-8').strip() QT_INSTALL_PATH = path.abspath(args.qt_path) CMAKE_INSTALL_PREFIX = path.abspath(path.join(SOURCE_DIR, "install")) -CMAKE_INSTALL_FRAMEWORK_DIR = path.join(CMAKE_INSTALL_PREFIX, 'Frameworks') CMAKE_QT_EXTRA_OPTIONS = ["-DCMAKE_PREFIX_PATH=" + QT_INSTALL_PATH, '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON'] +MCPELAUNCHER_EXTRA_OPTIONS = [] +if args.use_own_curl: + MCPELAUNCHER_EXTRA_OPTIONS += [ "-DUSE_OWN_CURL=ON" ] +else: + MCPELAUNCHER_EXTRA_OPTIONS += [ "-DUSE_OWN_CURL=OFF" ] + if not path.isdir(CMAKE_INSTALL_PREFIX): makedirs(CMAKE_INSTALL_PREFIX) -if not path.isdir(CMAKE_INSTALL_FRAMEWORK_DIR): - makedirs(CMAKE_INSTALL_FRAMEWORK_DIR) - latest = json.loads(check_output(['curl', '-L', 'https://api.github.com/repos/minecraft-linux/osx-angle-ci/releases/latest'])) - for asset in latest['assets']: - if asset['name'] == 'libEGL.dylib' or asset['name'] == 'libGLESv2.dylib': - print('Downloading ' + asset['name']) - call(['curl', '-L', asset['browser_download_url'], '--output', path.join(CMAKE_INSTALL_FRAMEWORK_DIR, asset['name'])]) +def cmake_cmd(source_dir): + return ['cmake', source_dir, '-DCMAKE_INSTALL_PREFIX=' + CMAKE_INSTALL_PREFIX, '-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] def build_component(name, cmake_opts): display_stage("Building: " + name) @@ -92,30 +112,72 @@ def build_component(name, cmake_opts): build_dir = path.join(SOURCE_DIR, "build", name) if not path.isdir(build_dir): makedirs(build_dir) - call(['cmake', source_dir, '-DCMAKE_INSTALL_PREFIX=' + CMAKE_INSTALL_PREFIX] + cmake_opts, cwd=build_dir) + call(cmake_cmd(source_dir) + cmake_opts, cwd=build_dir) call(['make', '-j' + str(cpu_count()), 'install'], cwd=build_dir) +def build_component32(name, cmake_opts): + display_stage("Building: " + name) + source_dir = path.abspath(path.join(SOURCE_DIR, name)) + build_dir = path.join(SOURCE_DIR, "build", name) + if not path.isdir(build_dir): + makedirs(build_dir) + call(cmake_cmd(source_dir) + cmake_opts, cwd=build_dir) + call(['make', '-j' + str(cpu_count())], cwd=build_dir) + shutil.copy2(path.join(build_dir, 'mcpelauncher-client', 'mcpelauncher-client'), path.join(CMAKE_INSTALL_PREFIX, 'bin', 'mcpelauncher-client32')) + VERSION_OPTS = [] if args.update_url and args.build_id: VERSION_OPTS = ["-DENABLE_UPDATE_CHECK=ON", "-DUPDATE_CHECK_URL=" + args.update_url, "-DUPDATE_CHECK_BUILD_ID=" + args.build_id] +SPARKLE_OPTS = [] +if args.update_sparkle_appcast: + SPARKLE_OPTS = [ "-DENABLE_SPARKLE_UPDATE_CHECK=1", "-DSPARKLE_UPDATE_CHECK_URL=" + args.update_sparkle_appcast] + display_stage("Building") -build_component("msa", ['-DENABLE_MSA_QT_UI=ON', '-DMSA_UI_PATH_DEV=OFF'] + CMAKE_QT_EXTRA_OPTIONS) -build_component("mcpelauncher", ['-DMSA_DAEMON_PATH=.', '-DENABLE_DEV_PATHS=OFF']) -build_component("mcpelauncher-ui", ['-DGAME_LAUNCHER_PATH=.'] + VERSION_OPTS + CMAKE_QT_EXTRA_OPTIONS) +OPENSSL64_OPTS = [ '-DOPENSSL_ROOT_DIR=' + path.abspath('ssl64'), '-DOPENSSL_CRYPTO_LIBRARY=' + path.abspath('ssl64/lib/libcrypto.dylib')] +OPENSSL64_INCLUDES = '-I' + path.abspath('ssl64/include') + ' -L' + path.abspath('ssl64/lib') +build_component("mcpelauncher", ['-DMSA_DAEMON_PATH=.', '-DENABLE_DEV_PATHS=OFF', '-DBUILD_FAKE_JNI_TESTS=OFF', '-DXAL_WEBVIEW_QT_PATH=.', '-DJNI_USE_JNIVM=ON', '-DBUILD_FAKE_JNI_EXAMPLES=OFF', '-DCMAKE_CXX_FLAGS=-DNDEBUG -Wl,-L' + path.abspath('libcxx-build') +',-rpath,@loader_path/../Frameworks -D_LIBCPP_DISABLE_AVAILABILITY=1' + ' ' + OPENSSL64_INCLUDES] + CMAKE_QT_EXTRA_OPTIONS + MCPELAUNCHER_EXTRA_OPTIONS + OPENSSL64_OPTS) +build_component32("mcpelauncher", ['-DMSA_DAEMON_PATH=.', '-DENABLE_DEV_PATHS=OFF', '-DENABLE_QT_ERROR_UI=OFF', '-DBUILD_FAKE_JNI_TESTS=OFF', '-DOPENSSL_ROOT_DIR=' + path.abspath('ssl32'), '-DOPENSSL_CRYPTO_LIBRARY=' + path.abspath('ssl32/lib/libcrypto.dylib'), '-DBUILD_FAKE_JNI_EXAMPLES=OFF', '-DCMAKE_ASM_FLAGS=-m32', '-DCMAKE_C_FLAGS=-m32', '-DCMAKE_CXX_FLAGS=-m32 -DNDEBUG -Wl,-L' + path.abspath('libcxx-build') +',-rpath,@loader_path/../Frameworks -D_LIBCPP_DISABLE_AVAILABILITY=1 -I' + path.abspath('ssl32/include') + ' -L' + path.abspath('ssl32/lib'), '-DCMAKE_CXX_COMPILER_TARGET=i386-apple-darwin', '-DCMAKE_LIBRARY_ARCHITECTURE=i386-apple-darwin', '-DBUILD_WEBVIEW=OFF', '-DXAL_WEBVIEW_QT_PATH=.', '-DJNI_USE_JNIVM=ON'] + MCPELAUNCHER_EXTRA_OPTIONS) +build_component("msa", ['-DENABLE_MSA_QT_UI=ON', '-DMSA_UI_PATH_DEV=OFF', '-DCMAKE_CXX_FLAGS=-DNDEBUG -Wl,-L' + path.abspath('libcxx-build') + ',-rpath,@loader_path/../Frameworks' +' -D_LIBCPP_DISABLE_AVAILABILITY=1'] + CMAKE_QT_EXTRA_OPTIONS) +ADDITIONAL_UI_OPTS = [] +if args.prettyversion: + ADDITIONAL_UI_OPTS += [ "-DLAUNCHER_VERSION_NAME=" + args.prettyversion ] +if args.build_id: + ADDITIONAL_UI_OPTS += [ "-DLAUNCHER_VERSION_CODE=" + args.build_id ] +changelog = "" +with open('changelog.txt', 'r') as file: + changelog = file.read().replace('\n', '
') + ADDITIONAL_UI_OPTS += [ "-DLAUNCHER_CHANGE_LOG=" + changelog ] + +with open('versionsdb.txt', 'r') as file: + ref = file.read().replace('\n', '') + clone_repo('versionsdb', 'https://github.com/minecraft-linux/mcpelauncher-versiondb.git', ref) + ADDITIONAL_UI_OPTS += [ "-DLAUNCHER_VERSIONDB_PATH=" + path.abspath(path.join(SOURCE_DIR, 'versionsdb'))] + +with open('versionsdbremote.txt', 'r') as file: + ref = file.read().replace('\n', '') + ADDITIONAL_UI_OPTS += [ "-DLAUNCHER_VERSIONDB_URL=https://raw.githubusercontent.com/minecraft-linux/mcpelauncher-versiondb/" + ref] + +build_component("mcpelauncher-ui", ['-DGAME_LAUNCHER_PATH=.', '-DCMAKE_CXX_FLAGS=-DNDEBUG -Wl,-F'+ QT_INSTALL_PATH + '/lib/,-L' + path.abspath('libcxx-build') +',-rpath,@loader_path/../Frameworks -D_LIBCPP_DISABLE_AVAILABILITY=1' + ' ' + OPENSSL64_INCLUDES, "-DQt5QuickCompiler_FOUND=OFF", "-DLAUNCHER_ENABLE_GOOGLE_PLAY_LICENCE_CHECK=ON", "-DLAUNCHER_DISABLE_DEV_MODE=ON"] + VERSION_OPTS + SPARKLE_OPTS + CMAKE_QT_EXTRA_OPTIONS + ADDITIONAL_UI_OPTS + OPENSSL64_OPTS) display_stage("Copying files") def copy_installed_files(from_path, to_path): for f in listdir(from_path): print("Copying file: " + f) if path.isdir(path.join(from_path, f)): - copytree(path.join(from_path, f), path.join(to_path, f)) + copytree(path.join(from_path, f), path.join(to_path, f), True, dirs_exist_ok = True) else: - shutil.copy2(path.join(from_path, f), path.join(to_path, f)) + shutil.copy2(path.join(from_path, f), path.join(to_path, f), follow_symlinks = False) + +if path.exists(args.app_root): + copy_installed_files(args.app_root, APP_OUTPUT_DIR) copy_installed_files(path.join(CMAKE_INSTALL_PREFIX, 'bin'), path.join(APP_OUTPUT_DIR, 'Contents', 'MacOS')) copy_installed_files(path.join(CMAKE_INSTALL_PREFIX, 'share'), path.join(APP_OUTPUT_DIR, 'Contents', 'Resources')) -copy_installed_files(path.join(CMAKE_INSTALL_PREFIX, 'Frameworks'), path.join(APP_OUTPUT_DIR, 'Contents', 'Frameworks')) +# Workaround Qt 5.9.2 +if args.qtworkaround: + copy_installed_files(path.join(QT_INSTALL_PATH, 'qml', 'QtQuick'), path.join(APP_OUTPUT_DIR, 'Contents', 'Resources', 'qml', 'QtQuick')) + copy_installed_files(path.join(QT_INSTALL_PATH, 'qml', 'QtQuick.2'), path.join(APP_OUTPUT_DIR, 'Contents', 'Resources', 'qml', 'QtQuick.2')) display_stage("Building Info.plist file") with open(path.join(TEMPLATES_DIR, 'Info.plist.tmpl'), 'r') as raw: @@ -126,7 +188,10 @@ def copy_installed_files(from_path, to_path): cf_bundle_get_info_string = 'Minecraft Bedrock Launcher', cf_bundle_icon_file = 'minecraft', cf_bundle_name = 'Minecraft Bedrock Launcher', - cf_bundle_version = VERSION + cf_bundle_version = VERSION, + cf_sparkle_feed = args.update_sparkle_appcast, + cf_sparkle_public_ed_key = args.update_sparkle_ed_public_key, + cf_bundle_macos_min = getenv("MACOSX_DEPLOYMENT_TARGET", "10.7") ) f = open(path.join(APP_OUTPUT_DIR, 'Contents', 'Info.plist'), 'w') @@ -136,8 +201,10 @@ def copy_installed_files(from_path, to_path): display_stage("Copying Qt libraries") QT_DEPLOY_OPTIONS = [path.join(QT_INSTALL_PATH, 'bin', 'macdeployqt'), APP_OUTPUT_DIR] QT_DEPLOY_OPTIONS.append('-qmldir=' + path.join(SOURCE_DIR, 'mcpelauncher-ui', 'mcpelauncher-ui-qt')) +QT_DEPLOY_OPTIONS.append('-qmldir=' + path.join(SOURCE_DIR, 'mcpelauncher', 'mcpelauncher-webview')) +QT_DEPLOY_OPTIONS.append('-qmldir=' + path.join(SOURCE_DIR, 'mcpelauncher', 'mcpelauncher-errorwindow', 'src', 'qml')) QT_DEPLOY_OPTIONS.append('-executable=' + path.abspath(path.join(APP_OUTPUT_DIR, 'Contents', 'MacOS', 'mcpelauncher-ui-qt'))) QT_DEPLOY_OPTIONS.append('-executable=' + path.abspath(path.join(APP_OUTPUT_DIR, 'Contents', 'MacOS', 'msa-ui-qt'))) +QT_DEPLOY_OPTIONS.append('-executable=' + path.abspath(path.join(APP_OUTPUT_DIR, 'Contents', 'MacOS', 'mcpelauncher-webview'))) +QT_DEPLOY_OPTIONS.append('-executable=' + path.abspath(path.join(APP_OUTPUT_DIR, 'Contents', 'MacOS', 'mcpelauncher-error'))) call(QT_DEPLOY_OPTIONS) - -display_stage('App bundle has been built at {}!'.format(path.join(OUTPUT_DIR, APP_OUTPUT_NAME))) diff --git a/build_dmg.py b/build_dmg.py index 953a1ec..57fd0fc 100644 --- a/build_dmg.py +++ b/build_dmg.py @@ -19,9 +19,7 @@ if path.exists(DMG_OUTPUT_PATH): remove(DMG_OUTPUT_PATH) -BG_FILE = path.join(SOURCE_DIR, 'dmg-background.tif') -if not path.exists(BG_FILE): - call(['curl', '-sL', '-o', BG_FILE, 'https://mrarm.io/u/dmg-background.tif']) +BG_FILE = 'dmg-background.tif' # we assume here that sectors are 512B IMAGE_SECTOR_SIZE = 512 diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..2215e82 --- /dev/null +++ b/changelog.txt @@ -0,0 +1 @@ +

Fixed new multiplayer problems on macOS / crash when someone else opens Minecraft in the local network of 1.21.40 - 1.21.60.21.

The game runs now on limited fps when V-Sync is broken (when it is enabled), now capped between 80-110fps before it where greater than 2000

Disabled Fullscreen support of Menubar and f11 shortcut due to causing more bugs than being useful, use the green button and hide the menubar

diff --git a/dmg-background.tif b/dmg-background.tif new file mode 100644 index 0000000..d36fd0b Binary files /dev/null and b/dmg-background.tif differ diff --git a/download_qt.sh b/download_qt.sh index 1bb8c21..7a31f4f 100755 --- a/download_qt.sh +++ b/download_qt.sh @@ -1,18 +1,18 @@ #!/bin/bash -QT_BASE_URL=http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5112/ -QT_VERSION_SHORT=5.11.2 -QT_VERSION=5.11.2-0-201809141947 -QT_PACKAGE_PREFIX=qt.qt5.5112. -QT_PACKAGE_SUFFIX=clang_64 -QT_PREBUILT_SUFFIX=-MacOS-MacOS_10_12-Clang-MacOS-MacOS_10_12-X86_64 +QT_BASE_URL=${QT_BASE_URL-"http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_592/"} +QT_VERSION_SHORT=${QT_VERSION_SHORT-"5.9.2"} +QT_VERSION=${QT_VERSION-"5.9.2-0-201710050729"} +QT_PACKAGE_PREFIX=${QT_PACKAGE_PREFIX-"qt.592."} +QT_PACKAGE_SUFFIX=${QT_PACKAGE_SUFFIX-"clang_64"} +QT_PREBUILT_SUFFIX=${QT_PREBUILT_SUFFIX-"-MacOS-OSX_10_10-Clang-MacOS-OSX_10_10-X86_64"} COLOR_STATUS=$'\033[1m\033[32m' COLOR_RESET=$'\033[0m' function install_module() { echo "${COLOR_STATUS}Downloading $2${COLOR_RESET}" - remote_sha1=$(curl "$2.sha1") + remote_sha1=$(curl -L "$2.sha1") curl -L -C - -o $1 $2 local_sha1=$(shasum $1 | cut -d " " -f 1) if [[ "$remote_sha1" != "$local_sha1" ]]; then @@ -47,3 +47,7 @@ install_module_extra qtwebengine qtwebengine echo "${COLOR_STATUS}Patching$2${COLOR_RESET}" cd qt/$QT_VERSION_SHORT/clang_64/ ../../../patch_qt.sh + +curl -L -C - -o sparkle.tar.xz https://github.com/sparkle-project/Sparkle/releases/download/1.26.0/Sparkle-1.26.0.tar.xz +tar -xf ./sparkle.tar.xz +mv Sparkle.framework lib/ diff --git a/mcpelauncher-ui.commit b/mcpelauncher-ui.commit new file mode 100644 index 0000000..06adf94 --- /dev/null +++ b/mcpelauncher-ui.commit @@ -0,0 +1 @@ +6227f2987468a8ef20b757131482415a5a374afd diff --git a/mcpelauncher.commit b/mcpelauncher.commit new file mode 100644 index 0000000..16a626c --- /dev/null +++ b/mcpelauncher.commit @@ -0,0 +1 @@ +a187f10d19415e4d7dbac3b30ca0143920ba1330 \ No newline at end of file diff --git a/msa.commit b/msa.commit new file mode 100644 index 0000000..e5b0310 --- /dev/null +++ b/msa.commit @@ -0,0 +1 @@ +cfcebaa0845df8e0eebaae5b211e38f8d812beab \ No newline at end of file diff --git a/templates/Info.plist.tmpl b/templates/Info.plist.tmpl index ce023e1..2a72165 100644 --- a/templates/Info.plist.tmpl +++ b/templates/Info.plist.tmpl @@ -18,5 +18,35 @@ APPL CFBundleVersion {{ cf_bundle_version }} + SUFeedURL + {{ cf_sparkle_feed }} + SUEnableAutomaticChecks + + SUPublicEDKey + {{ cf_sparkle_public_ed_key }} + SUScheduledCheckInterval + 0 + SUAllowsAutomaticUpdates + + SUAutomaticallyUpdate + + LSSupportsGameMode + + LSMinimumSystemVersion + {{ cf_bundle_macos_min }} + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + mcpack + mcworld + mcaddon + mctemplate + + CFBundleTypeRole + Viewer + + diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..7a586f4 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +v1.x-nightly \ No newline at end of file diff --git a/versionsdb.txt b/versionsdb.txt new file mode 100644 index 0000000..e5517e4 --- /dev/null +++ b/versionsdb.txt @@ -0,0 +1 @@ +HEAD \ No newline at end of file diff --git a/versionsdbremote.txt b/versionsdbremote.txt new file mode 100644 index 0000000..e5517e4 --- /dev/null +++ b/versionsdbremote.txt @@ -0,0 +1 @@ +HEAD \ No newline at end of file