diff --git a/.clang-format b/.clang-format index 38b431e1..c18a9773 100644 --- a/.clang-format +++ b/.clang-format @@ -44,7 +44,7 @@ BreakBeforeBraces: Custom BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakStringLiterals: false # apparently unpredictable -ColumnLimit: 80 +ColumnLimit: 120 CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 8 diff --git a/.cmake-format.json b/.cmake-format.json deleted file mode 100644 index 31bd6074..00000000 --- a/.cmake-format.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "format": { - "line_width": 120, - "tab_size": 2, - "enable_sort": true, - "autosort": true - }, - "additional_commands": { - "set_target_properties_obs": { - "pargs": 1, - "flags": [], - "kwargs": { - "PROPERTIES": { - "kwargs": { - "PREFIX": 1, - "OUTPUT_NAME": 1, - "FOLDER": 1, - "VERSION": 1, - "SOVERSION": 1, - "AUTOMOC": 1, - "AUTOUIC": 1, - "AUTORCC": 1, - "AUTOUIC_SEARCH_PATHS": 1, - "BUILD_RPATH": 1, - "INSTALL_RPATH": 1 - } - } - } - } - } -} diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 00000000..f01baabf --- /dev/null +++ b/.gersemirc @@ -0,0 +1,11 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json + +color: false +definitions: [] +line_length: 120 +indent: 2 +list_expansion: favour-inlining +quiet: false +unsafe: false +workers: 10 +warn_about_unknown_commands: false diff --git a/.github/actions/build-plugin/action.yaml b/.github/actions/build-plugin/action.yaml index aeede626..9bf40106 100644 --- a/.github/actions/build-plugin/action.yaml +++ b/.github/actions/build-plugin/action.yaml @@ -1,23 +1,23 @@ -name: 'Set up and build plugin' -description: 'Builds the plugin for specified architecture and build config' +name: Set up and build plugin +description: Builds the plugin for specified architecture and build config inputs: target: - description: 'Target architecture for dependencies' + description: Target architecture for dependencies required: true config: - description: 'Build configuration' + description: Build configuration required: false - default: 'RelWithDebInfo' + default: RelWithDebInfo codesign: - description: 'Enable codesigning (macOS only)' + description: Enable codesigning (macOS only) required: false default: 'false' codesignIdent: - description: 'Developer ID for application codesigning (macOS only)' + description: Developer ID for application codesigning (macOS only) required: false default: '-' workingDirectory: - description: 'Working directory for packaging' + description: Working directory for packaging required: false default: ${{ github.workspace }} runs: @@ -28,6 +28,7 @@ runs: shell: zsh --no-rcs --errexit --pipefail {0} working-directory: ${{ inputs.workingDirectory }} env: + CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache CODESIGN_IDENT: ${{ inputs.codesignIdent }} CODESIGN_TEAM: ${{ inputs.codesignTeam }} run: | @@ -55,16 +56,18 @@ runs: if: runner.os == 'Linux' shell: zsh --no-rcs --errexit --pipefail {0} working-directory: ${{ inputs.workingDirectory }} + env: + CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache run: | : Run Ubuntu Build local -a build_args=( - --target linux-${{ inputs.target }} + --target ubuntu-${{ inputs.target }} --config ${{ inputs.config }} ) if (( ${+RUNNER_DEBUG} )) build_args+=(--debug) - .github/scripts/build-linux ${build_args} + .github/scripts/build-ubuntu ${build_args} - name: Run Windows Build if: runner.os == 'Windows' @@ -86,7 +89,7 @@ runs: if: contains(fromJSON('["Linux", "macOS"]'),runner.os) shell: zsh --no-rcs --errexit --pipefail {0} env: - CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf + CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache run: | : Create Summary 📊 diff --git a/.github/actions/check-changes/action.yaml b/.github/actions/check-changes/action.yaml new file mode 100644 index 00000000..50d16790 --- /dev/null +++ b/.github/actions/check-changes/action.yaml @@ -0,0 +1,77 @@ +name: Check For Changed Files +description: Checks for changed files compared to specific git reference and glob expression +inputs: + baseRef: + description: Git reference to check against + required: false + ref: + description: Git reference to check with + required: false + default: HEAD + checkGlob: + description: Glob expression to limit check to specific files + required: false + useFallback: + description: Use fallback compare against prior commit + required: false + default: 'true' + diffFilter: + description: git diff-filter string to use + required: false + default: '' +outputs: + hasChangedFiles: + value: ${{ steps.checks.outputs.hasChangedFiles }} + description: True if specified files were changed in comparison to specified git reference + changedFiles: + value: ${{ steps.checks.outputs.changedFiles }} + description: List of changed files +runs: + using: composite + steps: + - name: Check For Changed Files ✅ + shell: bash + id: checks + env: + GIT_BASE_REF: ${{ inputs.baseRef }} + GIT_REF: ${{ inputs.ref }} + GITHUB_EVENT_FORCED: ${{ github.event.forced }} + GITHUB_REF_BEFORE: ${{ github.event.before }} + USE_FALLBACK: ${{ inputs.useFallback }} + DIFF_FILTER: ${{ inputs.diffFilter }} + run: | + : Check for Changed Files ✅ + if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi + shopt -s extglob + shopt -s dotglob + + if [[ "${GIT_BASE_REF}" ]]; then + if ! git cat-file -e "${GIT_BASE_REF}" &> /dev/null; then + echo "::warning::Provided base reference ${GIT_BASE_REF} is invalid" + if [[ "${USE_FALLBACK}" == 'true' ]]; then + GIT_BASE_REF='HEAD~1' + fi + fi + else + if ! git cat-file -e ${GITHUB_REF_BEFORE} &> /dev/null; then + GITHUB_REF_BEFORE='4b825dc642cb6eb9a060e54bf8d69288fbee4904' + fi + + GIT_BASE_REF='HEAD~1' + case "${GITHUB_EVENT_NAME}" in + pull_request) GIT_BASE_REF="origin/${GITHUB_BASE_REF}" ;; + push) if [[ "${GITHUB_EVENT_FORCED}" != 'true' ]]; then GIT_BASE_REF="${GITHUB_REF_BEFORE}"; fi ;; + *) ;; + esac + fi + + changes=($(git diff --name-only --diff-filter="${DIFF_FILTER}" ${GIT_BASE_REF} ${GIT_REF} -- ${{ inputs.checkGlob }})) + + if (( ${#changes[@]} )); then + file_string="${changes[*]}" + echo "hasChangedFiles=true" >> $GITHUB_OUTPUT + echo "changedFiles=[\"${file_string// /\",\"}\"]" >> $GITHUB_OUTPUT + else + echo "hasChangedFiles=false" >> $GITHUB_OUTPUT + echo "changedFiles=[]" >> GITHUB_OUTPUT + fi diff --git a/.github/actions/package-plugin/action.yaml b/.github/actions/package-plugin/action.yaml index 5d31e669..11fdccf8 100644 --- a/.github/actions/package-plugin/action.yaml +++ b/.github/actions/package-plugin/action.yaml @@ -1,47 +1,47 @@ -name: 'Package plugin' -description: 'Packages the plugin for specified architecture and build config.' +name: Package plugin +description: Packages the plugin for specified architecture and build config. inputs: target: - description: 'Build target for dependencies' + description: Build target for dependencies required: true config: - description: 'Build configuration' + description: Build configuration required: false - default: 'RelWithDebInfo' + default: RelWithDebInfo codesign: - description: 'Enable codesigning (macOS only)' + description: Enable codesigning (macOS only) required: false default: 'false' notarize: - description: 'Enable notarization (macOS only)' + description: Enable notarization (macOS only) required: false default: 'false' codesignIdent: - description: 'Developer ID for application codesigning (macOS only)' + description: Developer ID for application codesigning (macOS only) required: false default: '-' installerIdent: - description: 'Developer ID for installer package codesigning (macOS only)' + description: Developer ID for installer package codesigning (macOS only) required: false default: '' codesignTeam: - description: 'Developer team for codesigning (macOS only)' + description: Developer team for codesigning (macOS only) required: false default: '' codesignUser: - description: 'Apple ID username for notarization (macOS only)' + description: Apple ID username for notarization (macOS only) required: false default: '' codesignPass: - description: 'Apple ID password for notarization (macOS only)' + description: Apple ID password for notarization (macOS only) required: false default: '' package: - description: 'Create Windows or macOS installation package' + description: Create Windows or macOS installation package required: false default: 'false' workingDirectory: - description: 'Working directory for packaging' + description: Working directory for packaging required: false default: ${{ github.workspace }} runs: @@ -87,14 +87,14 @@ runs: run: | : Run Ubuntu Packaging package_args=( - --target linux-${{ inputs.target }} + --target ubuntu-${{ inputs.target }} --config ${{ inputs.config }} ) if (( ${+RUNNER_DEBUG} )) build_args+=(--debug) if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package) - .github/scripts/package-linux ${package_args} + .github/scripts/package-ubuntu ${package_args} - name: Run Windows Packaging if: runner.os == 'Windows' @@ -110,8 +110,4 @@ runs: Configuration = '${{ inputs.config }}' } - if ( '${{ inputs.package }}' -eq 'true' ) { - $PackageArgs += @{BuildInstaller = $true} - } - .github/scripts/Package-Windows.ps1 @PackageArgs diff --git a/.github/actions/run-clang-format/action.yaml b/.github/actions/run-clang-format/action.yaml index 70ed1429..8e6801df 100644 --- a/.github/actions/run-clang-format/action.yaml +++ b/.github/actions/run-clang-format/action.yaml @@ -4,7 +4,7 @@ inputs: failCondition: description: Controls whether failed checks also fail the workflow run required: false - default: 'never' + default: never workingDirectory: description: Working directory for checks required: false @@ -20,8 +20,15 @@ runs: echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner." exit 2 + - name: Check for Changed Files ✅ + uses: ./.github/actions/check-changes + id: checks + with: + checkGlob: "'*.c' '*.h' '*.cpp' '*.hpp' '*.m' '*.mm'" + diffFilter: 'ACM' + - name: Install Dependencies 🛍️ - if: runner.os == 'Linux' + if: runner.os == 'Linux' && fromJSON(steps.checks.outputs.hasChangedFiles) shell: bash run: | : Install Dependencies 🛍️ @@ -33,29 +40,21 @@ runs: echo ::endgroup:: - name: Run clang-format 🐉 + if: fromJSON(steps.checks.outputs.hasChangedFiles) id: result shell: zsh --no-rcs --errexit --pipefail {0} working-directory: ${{ inputs.workingDirectory }} env: - GITHUB_EVENT_FORCED: ${{ github.event.forced }} - GITHUB_REF_BEFORE: ${{ github.event.before }} + CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }} run: | : Run clang-format 🐉 if (( ${+RUNNER_DEBUG} )) setopt XTRACE - local -a changes=($(git diff --name-only HEAD~1 HEAD)) - case ${GITHUB_EVENT_NAME} { - pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;; - push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;; - *) ;; - } - - if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) { - echo ::group::Install clang-format-17 - brew install --quiet obsproject/tools/clang-format@17 - echo ::endgroup:: + print ::group::Install clang-format-17 + brew install --quiet obsproject/tools/clang-format@17 + print ::endgroup:: - echo ::group::Run clang-format-17 - ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check - echo ::endgroup:: - } + print ::group::Run clang-format-17 + local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/}) + ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} + print ::endgroup:: diff --git a/.github/actions/run-cmake-format/action.yaml b/.github/actions/run-cmake-format/action.yaml deleted file mode 100644 index 40360263..00000000 --- a/.github/actions/run-cmake-format/action.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: Run cmake-format -description: Runs cmake-format and checks for any changes introduced by it -inputs: - failCondition: - description: Controls whether failed checks also fail the workflow run - required: false - default: 'never' - workingDirectory: - description: Working directory for checks - required: false - default: ${{ github.workspace }} -runs: - using: composite - steps: - - name: Check Runner Operating System 🏃‍♂️ - if: runner.os == 'Windows' - shell: bash - run: | - : Check Runner Operating System 🏃‍♂️ - echo "::notice::run-cmake-format action requires a macOS-based or Linux-based runner." - exit 2 - - - name: Install Dependencies 🛍️ - if: runner.os == 'Linux' - shell: bash - run: | - : Install Dependencies 🛍️ - echo ::group::Install Dependencies - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH - brew install --quiet zsh - echo ::endgroup:: - - - name: Run cmake-format 🎛️ - id: result - shell: zsh --no-rcs --errexit --pipefail {0} - working-directory: ${{ github.workspace }} - env: - GITHUB_EVENT_FORCED: ${{ github.event.forced }} - GITHUB_REF_BEFORE: ${{ github.event.before }} - run: | - : Run cmake-format 🎛️ - if (( ${+RUNNER_DEBUG} )) setopt XTRACE - - local -a changes=($(git diff --name-only HEAD~1 HEAD)) - case ${GITHUB_EVENT_NAME} { - pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;; - push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;; - *) ;; - } - - if (( ${changes[(I)*.cmake|*CMakeLists.txt]} )) { - echo ::group::Install cmakelang - pip3 install cmakelang - echo ::endgroup:: - echo ::group::Run cmake-format - ./build-aux/run-cmake-format --fail-${{ inputs.failCondition }} --check - echo ::endgroup:: - } diff --git a/.github/actions/run-gersemi/action.yaml b/.github/actions/run-gersemi/action.yaml new file mode 100644 index 00000000..5a6818f9 --- /dev/null +++ b/.github/actions/run-gersemi/action.yaml @@ -0,0 +1,59 @@ +name: Run gersemi +description: Runs gersemi and checks for any changes introduced by it +inputs: + failCondition: + description: Controls whether failed checks also fail the workflow run + required: false + default: never + workingDirectory: + description: Working directory for checks + required: false + default: ${{ github.workspace }} +runs: + using: composite + steps: + - name: Check Runner Operating System 🏃‍♂️ + if: runner.os == 'Windows' + shell: bash + run: | + : Check Runner Operating System 🏃‍♂️ + echo "::notice::run-gersemi action requires a macOS-based or Linux-based runner." + exit 2 + + - name: Check for Changed Files ✅ + uses: ./.github/actions/check-changes + id: checks + with: + checkGlob: "'*.cmake' '*CMakeLists.txt'" + diffFilter: 'ACM' + + - name: Install Dependencies 🛍️ + if: runner.os == 'Linux' && fromJSON(steps.checks.outputs.hasChangedFiles) + shell: bash + run: | + : Install Dependencies 🛍️ + echo ::group::Install Dependencies + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + brew install --quiet zsh + echo ::endgroup:: + + - name: Run gersemi 🎛️ + if: fromJSON(steps.checks.outputs.hasChangedFiles) + id: result + shell: zsh --no-rcs --errexit --pipefail {0} + working-directory: ${{ github.workspace }} + env: + CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }} + run: | + : Run gersemi 🎛️ + if (( ${+RUNNER_DEBUG} )) setopt XTRACE + + print ::group::Install gersemi + brew install --quiet obsproject/tools/gersemi + print ::endgroup:: + + print ::group::Run gersemi + local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/}) + ./build-aux/run-gersemi --fail-${{ inputs.failCondition }} --check ${changes} + print ::endgroup:: diff --git a/.github/actions/setup-macos-codesigning/action.yaml b/.github/actions/setup-macos-codesigning/action.yaml index 5f24114b..621fdb5b 100644 --- a/.github/actions/setup-macos-codesigning/action.yaml +++ b/.github/actions/setup-macos-codesigning/action.yaml @@ -30,10 +30,13 @@ outputs: value: ${{ steps.codesign.outputs.haveCodesignIdent }} haveProvisioningProfile: description: True if necessary provisioning profile credentials were found - value: ${{ steps.provisioning.outputs.haveProvisioningProfile }} + value: ${{ steps.provisioning.outputs.haveProvisioningProfile || steps.codesign.outputs.haveProvisioningProfile }} + provisioningProfileUUID: + description: UUID of imported provisioning profile + value: ${{ steps.provisioning.outputs.provisioningProfileUUID }} haveNotarizationUser: description: True if necessary notarization credentials were found - value: ${{ steps.notarization.outputs.haveNotarizationUser }} + value: ${{ steps.notarization.outputs.haveNotarizationUser || steps.codesign.outputs.haveNotarizationUser }} codesignIdent: description: Codesigning identity value: ${{ steps.codesign.outputs.codesignIdent }} @@ -64,7 +67,7 @@ runs: MAOCS_SIGNING_CERT_PASSWORD: ${{ inputs.certificatePassword }} MACOS_KEYCHAIN_PASSWORD: ${{ inputs.keychainPassword }} run: | - : macOS Codesigning ✍️ + : macOS Code Signing ✍️ if (( ${+RUNNER_DEBUG} )) setopt XTRACE if [[ ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_IDENTITY_INSTALLER} && ${MACOS_SIGNING_CERT} ]] { @@ -73,7 +76,7 @@ runs: local -r certificate_path="${RUNNER_TEMP}/build_certificate.p12" local -r keychain_path="${RUNNER_TEMP}/app-signing.keychain-db" - print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}" + print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output=${certificate_path} : "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | shasum | head -c 32)"}" @@ -100,6 +103,8 @@ runs: print "codesignTeam=${team_id}" >> $GITHUB_OUTPUT } else { print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT + print 'haveProvisioningProfile=false' >> $GITHUB_OUTPUT + print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT } - name: Provisioning Profile 👤 @@ -112,12 +117,12 @@ runs: : Provisioning Profile 👤 if (( ${+RUNNER_DEBUG} )) setopt XTRACE - if [[ ${MACOS_SIGNING_PROVISIONING_PROFILE} ]] { + if [[ "${MACOS_SIGNING_PROVISIONING_PROFILE}" ]] { print 'haveProvisioningProfile=true' >> $GITHUB_OUTPUT local -r profile_path="${RUNNER_TEMP}/build_profile.provisionprofile" print -n "${MACOS_SIGNING_PROVISIONING_PROFILE}" \ - | base64 --decode --output ${profile_path} + | base64 --decode --output="${profile_path}" print '::group::Provisioning Profile Setup' mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles @@ -125,7 +130,7 @@ runs: local -r uuid="$(plutil -extract UUID raw ${RUNNER_TEMP}/build_profile.plist)" local -r team_id="$(plutil -extract TeamIdentifier.0 raw -expect string ${RUNNER_TEMP}/build_profile.plist)" - if [[ ${team_id} != '${{ steps.codesign.codesignTeam }}' ]] { + if [[ ${team_id} != '${{ steps.codesign.outputs.codesignTeam }}' ]] { print '::notice::Code Signing team in provisioning profile does not match certificate.' } @@ -137,9 +142,9 @@ runs: } - name: Notarization 🧑‍💼 - shell: zsh --no-rcs --errexit --pipefail {0} id: notarization - if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }} + if: fromJSON(steps.codesign.outputs.haveCodesignIdent) + shell: zsh --no-rcs --errexit --pipefail {0} env: MACOS_NOTARIZATION_USERNAME: ${{ inputs.notarizationUser }} MACOS_NOTARIZATION_PASSWORD: ${{ inputs.notarizationPassword }} diff --git a/.github/scripts/.Brewfile b/.github/scripts/.Brewfile index 8368e3d2..4464254c 100644 --- a/.github/scripts/.Brewfile +++ b/.github/scripts/.Brewfile @@ -1,6 +1,5 @@ brew "ccache" brew "coreutils" brew "cmake" -brew "git" brew "jq" brew "xcbeautify" diff --git a/.github/scripts/.Wingetfile b/.github/scripts/.Wingetfile deleted file mode 100644 index 6d6b9aef..00000000 --- a/.github/scripts/.Wingetfile +++ /dev/null @@ -1,2 +0,0 @@ -package 'cmake', path: 'Cmake\bin', bin: 'cmake' -package 'innosetup', path: 'Inno Setup 6', bin: 'iscc' diff --git a/.github/scripts/Build-Windows.ps1 b/.github/scripts/Build-Windows.ps1 index 5f322960..d56e61db 100644 --- a/.github/scripts/Build-Windows.ps1 +++ b/.github/scripts/Build-Windows.ps1 @@ -3,10 +3,7 @@ param( [ValidateSet('x64')] [string] $Target = 'x64', [ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')] - [string] $Configuration = 'RelWithDebInfo', - [switch] $SkipAll, - [switch] $SkipBuild, - [switch] $SkipDeps + [string] $Configuration = 'RelWithDebInfo' ) $ErrorActionPreference = 'Stop' @@ -16,12 +13,16 @@ if ( $DebugPreference -eq 'Continue' ) { $InformationPreference = 'Continue' } +if ( $env:CI -eq $null ) { + throw "Build-Windows.ps1 requires CI environment" +} + if ( ! ( [System.Environment]::Is64BitOperatingSystem ) ) { throw "A 64-bit system is required to build the project." } -if ( $PSVersionTable.PSVersion -lt '7.0.0' ) { - Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6' +if ( $PSVersionTable.PSVersion -lt '7.2.0' ) { + Write-Warning 'The obs-studio PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6' exit 2 } @@ -35,7 +36,6 @@ function Build { $ScriptHome = $PSScriptRoot $ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.." - $BuildSpecFile = "${ProjectRoot}/buildspec.json" $UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse @@ -44,58 +44,39 @@ function Build { . $Utility.FullName } - $BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json - $ProductName = $BuildSpec.name - $ProductVersion = $BuildSpec.version + Push-Location -Stack BuildTemp + Ensure-Location $ProjectRoot - if ( ! $SkipDeps ) { - Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile" - } + $CmakeArgs = @('--preset', "windows-ci-${Target}") + $CmakeBuildArgs = @('--build') + $CmakeInstallArgs = @() - Push-Location -Stack BuildTemp - if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) { - Ensure-Location $ProjectRoot - - $CmakeArgs = @() - $CmakeBuildArgs = @() - $CmakeInstallArgs = @() - - if ( $VerbosePreference -eq 'Continue' ) { - $CmakeBuildArgs += ('--verbose') - $CmakeInstallArgs += ('--verbose') - } - - if ( $DebugPreference -eq 'Continue' ) { - $CmakeArgs += ('--debug-output') - } - - $Preset = "windows-$(if ( $Env:CI -ne $null ) { 'ci-' })${Target}" - - $CmakeArgs += @( - '--preset', $Preset - ) - - $CmakeBuildArgs += @( - '--build' - '--preset', $Preset - '--config', $Configuration - '--parallel' - '--', '/consoleLoggerParameters:Summary', '/noLogo' - ) - - $CmakeInstallArgs += @( - '--install', "build_${Target}" - '--prefix', "${ProjectRoot}/release/${Configuration}" - '--config', $Configuration - ) - - Log-Group "Configuring ${ProductName}..." - Invoke-External cmake @CmakeArgs - - Log-Group "Building ${ProductName}..." - Invoke-External cmake @CmakeBuildArgs + if ( $DebugPreference -eq 'Continue' ) { + $CmakeArgs += ('--debug-output') + $CmakeBuildArgs += ('--verbose') + $CmakeInstallArgs += ('--verbose') } - Log-Group "Install ${ProductName}..." + + $CmakeBuildArgs += @( + '--preset', "windows-${Target}" + '--config', $Configuration + '--parallel' + '--', '/consoleLoggerParameters:Summary', '/noLogo' + ) + + $CmakeInstallArgs += @( + '--install', "build_${Target}" + '--prefix', "${ProjectRoot}/release/${Configuration}" + '--config', $Configuration + ) + + Log-Group "Configuring ${ProductName}..." + Invoke-External cmake @CmakeArgs + + Log-Group "Building ${ProductName}..." + Invoke-External cmake @CmakeBuildArgs + + Log-Group "Installing ${ProductName}..." Invoke-External cmake @CmakeInstallArgs Pop-Location -Stack BuildTemp diff --git a/.github/scripts/Package-Windows.ps1 b/.github/scripts/Package-Windows.ps1 index 67b02093..0425807b 100644 --- a/.github/scripts/Package-Windows.ps1 +++ b/.github/scripts/Package-Windows.ps1 @@ -3,9 +3,7 @@ param( [ValidateSet('x64')] [string] $Target = 'x64', [ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')] - [string] $Configuration = 'RelWithDebInfo', - [switch] $BuildInstaller, - [switch] $SkipDeps + [string] $Configuration = 'RelWithDebInfo' ) $ErrorActionPreference = 'Stop' @@ -15,21 +13,22 @@ if ( $DebugPreference -eq 'Continue' ) { $InformationPreference = 'Continue' } +if ( $env:CI -eq $null ) { + throw "Package-Windows.ps1 requires CI environment" +} + if ( ! ( [System.Environment]::Is64BitOperatingSystem ) ) { throw "Packaging script requires a 64-bit system to build and run." } - -if ( $PSVersionTable.PSVersion -lt '7.0.0' ) { +if ( $PSVersionTable.PSVersion -lt '7.2.0' ) { Write-Warning 'The packaging script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6' exit 2 } function Package { trap { - Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue' Write-Error $_ - Log-Group exit 2 } @@ -50,15 +49,10 @@ function Package { $OutputName = "${ProductName}-${ProductVersion}-windows-${Target}" - if ( ! $SkipDeps ) { - Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile" - } - $RemoveArgs = @{ ErrorAction = 'SilentlyContinue' Path = @( "${ProjectRoot}/release/${ProductName}-*-windows-*.zip" - "${ProjectRoot}/release/${ProductName}-*-windows-*.exe" ) } @@ -73,25 +67,6 @@ function Package { } Compress-Archive -Force @CompressArgs Log-Group - - if ( ( $BuildInstaller ) ) { - Log-Group "Packaging ${ProductName}..." - - $IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss" - if ( ! ( Test-Path -Path $IsccFile ) ) { - throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.' - } - - Log-Information 'Creating InnoSetup installer...' - Push-Location -Stack BuildTemp - Ensure-Location -Path "${ProjectRoot}/release" - Copy-Item -Path ${Configuration} -Destination Package -Recurse - Invoke-External iscc ${IsccFile} /O"${ProjectRoot}/release" /F"${OutputName}-Installer" - Remove-Item -Path Package -Recurse - Pop-Location -Stack BuildTemp - - Log-Group - } } Package diff --git a/.github/scripts/build-linux b/.github/scripts/build-linux deleted file mode 120000 index 11e4d760..00000000 --- a/.github/scripts/build-linux +++ /dev/null @@ -1 +0,0 @@ -.build.zsh \ No newline at end of file diff --git a/.github/scripts/build-macos b/.github/scripts/build-macos deleted file mode 120000 index 11e4d760..00000000 --- a/.github/scripts/build-macos +++ /dev/null @@ -1 +0,0 @@ -.build.zsh \ No newline at end of file diff --git a/.github/scripts/build-macos b/.github/scripts/build-macos new file mode 100755 index 00000000..fece23b4 --- /dev/null +++ b/.github/scripts/build-macos @@ -0,0 +1,153 @@ +#!/usr/bin/env zsh + +builtin emulate -L zsh +setopt EXTENDED_GLOB +setopt PUSHD_SILENT +setopt ERR_EXIT +setopt ERR_RETURN +setopt NO_UNSET +setopt PIPE_FAIL +setopt NO_AUTO_PUSHD +setopt NO_PUSHD_IGNORE_DUPS +setopt FUNCTION_ARGZERO + +## Enable for script debugging +# setopt WARN_CREATE_GLOBAL +# setopt WARN_NESTED_VAR +# setopt XTRACE + +if (( ! ${+CI} )) { + print -u2 -PR "%F{1} ✖︎ ${ZSH_ARGZERO:t:r} requires CI environment.%f" + exit 1 +} + +autoload -Uz is-at-least && if ! is-at-least 5.9; then + print -u2 -PR "${CI:+::error::}%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue." + exit 1 +fi + +TRAPZERR() { + print -u2 -PR "::error::%F{1} ✖︎ script execution error%f" + print -PR -e " + Callstack: + ${(j:\n :)funcfiletrace} + " + + exit 2 +} + +build() { + if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} + local host_os='macos' + local project_root=${SCRIPT_HOME:A:h:h} + local buildspec_file=${project_root}/buildspec.json + + fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath}) + autoload -Uz log_group log_info log_error log_output check_macos setup_ccache + + if [[ ! -r ${buildspec_file} ]] { + log_error \ + 'No buildspec.json found. Please create a build specification for your project.' + return 2 + } + + local -i debug=0 + + local config='RelWithDebInfo' + local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) + local -i codesign=0 + + local -a args + while (( # )) { + case ${1} { + -c|--config) + if (( # == 1 )) || [[ ${2:0:1} == '-' ]] { + log_error "Missing value for option %B${1}%b" + log_output ${_usage} + exit 2 + } + ;; + } + case ${1} { + --) shift; args+=($@); break ;; + -c|--config) + if (( ! ${_valid_configs[(Ie)${2}]} )) { + log_error "Invalid value %B${2}%b for option %B${1}%b" + exit 2 + } + config=${2} + shift 2 + ;; + -s|--codesign) codesign=1; shift ;; + --debug) debug=1; shift ;; + *) log_error "Unknown option: %B${1}%b"; exit 2 ;; + } + } + + set -- ${(@)args} + + check_macos + + local product_name + local product_version + read -r product_name product_version <<< \ + "$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})" + + pushd ${project_root} + + local -a cmake_args=() + local -a cmake_build_args=(--build) + local -a cmake_install_args=(--install) + + if (( debug )) cmake_args+=(--debug-output) + + cmake_args+=(--preset 'macos-ci') + + typeset -gx NSUnbufferedIO=YES + + typeset -gx CODESIGN_IDENT="${CODESIGN_IDENT:--}" + if (( codesign )) && [[ -z ${CODESIGN_TEAM} ]] { + typeset -gx CODESIGN_TEAM="$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')" + } + + log_group "Configuring ${product_name}..." + cmake -S ${project_root} ${cmake_args} + + log_group "Building ${product_name}..." + run_xcodebuild() { + if (( debug )) { + xcodebuild ${@} + } else { + if [[ ${GITHUB_EVENT_NAME} == push ]] { + xcodebuild ${@} 2>&1 | xcbeautify --renderer terminal + } else { + xcodebuild ${@} 2>&1 | xcbeautify --renderer github-actions + } + } + } + + local -a build_args=( + ONLY_ACTIVE_ARCH=NO + -arch arm64 + -arch x86_64 + -project ${product_name}.xcodeproj + -target ${product_name} + -destination "generic/platform=macOS,name=Any Mac" + -configuration ${config} + -parallelizeTargets + -hideShellScriptEnvironment + build + ) + + pushd build_macos + run_xcodebuild ${build_args} + popd + + log_group "Installing ${product_name}..." + cmake --install build_macos --config ${config} --prefix "${project_root}/release/${config}" + + popd + log_group +} + +build ${@} diff --git a/.github/scripts/.build.zsh b/.github/scripts/build-ubuntu similarity index 72% rename from .github/scripts/.build.zsh rename to .github/scripts/build-ubuntu index 708fdcf2..895148d6 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/build-ubuntu @@ -21,14 +21,6 @@ autoload -Uz is-at-least && if ! is-at-least 5.2; then exit 1 fi -TRAPEXIT() { - local return_value=$? - - if (( ${+CI} )) unset NSUnbufferedIO - - return ${return_value} -} - TRAPZERR() { if (( ${_loglevel:-3} > 2 )) { print -u2 -PR "${CI:+::error::}%F{1} ✖︎ script execution error%f" @@ -43,12 +35,12 @@ TRAPZERR() { build() { if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} - local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]} + local host_os='ubuntu' local project_root=${SCRIPT_HOME:A:h:h} local buildspec_file=${project_root}/buildspec.json fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath}) - autoload -Uz log_group log_info log_error log_output set_loglevel check_${host_os} setup_ccache + autoload -Uz log_group log_info log_error log_output set_loglevel check_ubuntu setup_ccache if [[ ! -r ${buildspec_file} ]] { log_error \ @@ -56,35 +48,27 @@ build() { return 2 } + local -i debug=0 typeset -g -a skips=() local -i verbosity=1 local -r _version='2.0.0' local -r -a _valid_targets=( - macos-universal - linux-x86_64 - linux-aarch64 + ubuntu-x86_64 ) local target local config='RelWithDebInfo' local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) local -i codesign=0 - if [[ ${host_os} == linux ]] { - local -r -a _valid_generators=(Ninja 'Unix Makefiles') - local generator='Ninja' - local -r _usage_host=" + local -r -a _valid_generators=(Ninja 'Unix Makefiles') + local generator='Ninja' + local -r _usage_host=" %F{yellow} Additional options for Linux builds%f ----------------------------------------------------------------------------- %B--generator%b Specify build system to generate Available generators: - Ninja - Unix Makefiles" - } elif [[ ${host_os} == macos ]] { - local -r _usage_host=" -%F{yellow} Additional options for macOS builds%f - ----------------------------------------------------------------------------- - %B-s | --codesign%b Enable codesigning (macOS only)" - } local -i print_config=0 local -r _usage=" @@ -152,14 +136,12 @@ ${_usage_host:-}" -V|--version) print -Pr "${_version}"; exit 0 ;; --debug) verbosity=3; shift ;; --generator) - if [[ ${host_os} == linux ]] { - if (( ! ${_valid_generators[(Ie)${2}]} )) { - log_error "Invalid value %B${2}%b for option %B${1}%b" - log_output ${_usage} - exit 2 - } - generator=${2} + if (( ! ${_valid_generators[(Ie)${2}]} )) { + log_error "Invalid value %B${2}%b for option %B${1}%b" + log_output ${_usage} + exit 2 } + generator=${2} shift 2 ;; --print-config) print_config=1; skips+=(deps); shift ;; @@ -181,11 +163,10 @@ ${_usage_host:-}" if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) { check_${host_os} - setup_ccache } - if [[ ${host_os} == linux ]] { - autoload -Uz setup_linux && setup_linux + if [[ ${host_os} == ubuntu ]] { + autoload -Uz setup_ubuntu && setup_ubuntu } local product_name @@ -210,33 +191,7 @@ ${_usage_host:-}" local -r _preset="${target%%-*}${CI:+-ci}" case ${target} { - macos-*) - if (( ${+CI} )) typeset -gx NSUnbufferedIO=YES - - cmake_args+=( - --preset ${_preset} - ) - - if (( codesign )) { - autoload -Uz read_codesign_team && read_codesign_team - - if [[ -z ${CODESIGN_TEAM} ]] { - autoload -Uz read_codesign && read_codesign - } - } - - cmake_args+=( - -DCODESIGN_TEAM=${CODESIGN_TEAM:-} - -DCODESIGN_IDENTITY=${CODESIGN_IDENT:--} - ) - - cmake_build_args+=(--preset ${_preset} --parallel --config ${config} -- ONLY_ACTIVE_ARCH=NO -arch arm64 -arch x86_64) - cmake_install_args+=(build_macos --config ${config} --prefix "${project_root}/release/${config}") - - local -a xcbeautify_opts=() - if (( _loglevel == 0 )) xcbeautify_opts+=(--quiet) - ;; - linux-*) + ubuntu-*) cmake_args+=( --preset ${_preset}-${target##*-} -G "${generator}" @@ -248,14 +203,6 @@ ${_usage_host:-}" local cmake_version read -r _ _ cmake_version <<< "$(cmake --version)" - if [[ ${CPUTYPE} != ${target##*-} ]] { - if is-at-least 3.21.0 ${cmake_version}; then - cmake_args+=(--toolchain "${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake") - else - cmake_args+=(-D"CMAKE_TOOLCHAIN_FILE=${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake") - fi - } - cmake_build_args+=(--preset ${_preset}-${target##*-} --config ${config}) if [[ ${generator} == 'Unix Makefiles' ]] { cmake_build_args+=(--parallel $(( $(nproc) + 1 ))) @@ -272,15 +219,7 @@ ${_usage_host:-}" cmake ${cmake_args} log_group "Building ${product_name}..." - if [[ ${host_os} == macos ]] { - if (( _loglevel > 1 )) { - cmake ${cmake_build_args} - } else { - cmake ${cmake_build_args} 2>&1 | xcbeautify ${xcbeautify_opts} - } - } else { - cmake ${cmake_build_args} - } + cmake ${cmake_build_args} } log_group "Installing ${product_name}..." diff --git a/.github/scripts/package-linux b/.github/scripts/package-linux deleted file mode 120000 index b3590ee8..00000000 --- a/.github/scripts/package-linux +++ /dev/null @@ -1 +0,0 @@ -.package.zsh \ No newline at end of file diff --git a/.github/scripts/package-macos b/.github/scripts/package-macos deleted file mode 120000 index b3590ee8..00000000 --- a/.github/scripts/package-macos +++ /dev/null @@ -1 +0,0 @@ -.package.zsh \ No newline at end of file diff --git a/.github/scripts/package-macos b/.github/scripts/package-macos new file mode 100755 index 00000000..8d1b29dc --- /dev/null +++ b/.github/scripts/package-macos @@ -0,0 +1,173 @@ +#!/usr/bin/env zsh + +builtin emulate -L zsh +setopt EXTENDED_GLOB +setopt PUSHD_SILENT +setopt ERR_EXIT +setopt ERR_RETURN +setopt NO_UNSET +setopt PIPE_FAIL +setopt NO_AUTO_PUSHD +setopt NO_PUSHD_IGNORE_DUPS +setopt FUNCTION_ARGZERO + +## Enable for script debugging +# setopt WARN_CREATE_GLOBAL +# setopt WARN_NESTED_VAR +# setopt XTRACE + +if (( ! ${+CI} )) { + print -u2 -PR "%F{1} ✖︎ ${ZSH_ARGZERO:t:r} requires CI environment%f" + exit 1 +} + +autoload -Uz is-at-least && if ! is-at-least 5.9; then + print -u2 -PR "${CI:+::error::}%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue." + exit 1 +fi + +TRAPZERR() { + print -u2 -PR "::error::%F{1} ✖︎ script execution error%f" + print -PR -e " + Callstack: + ${(j:\n :)funcfiletrace} + " + + exit 2 +} + +package() { + if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} + local host_os='macos' + local project_root=${SCRIPT_HOME:A:h:h} + local buildspec_file=${project_root}/buildspec.json + + fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath}) + autoload -Uz log_group log_error log_output check_macos + + if [[ ! -r ${buildspec_file} ]] { + log_error \ + 'No buildspec.json found. Please create a build specification for your project.' + return 2 + } + + local -i debug=0 + + local config='RelWithDebInfo' + local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) + + local -i codesign=0 + local -i notarize=0 + local -i package=0 + + local -a args + while (( # )) { + case ${1} { + -c|--config) + if (( # == 1 )) || [[ ${2:0:1} == '-' ]] { + log_error "Missing value for option %B${1}%b" + exit 2 + } + ;; + } + case ${1} { + --) shift; args+=($@); break ;; + -c|--config) + if (( !${_valid_configs[(Ie)${2}]} )) { + log_error "Invalid value %B${2}%b for option %B${1}%b" + exit 2 + } + config=${2} + shift 2 + ;; + -s|--codesign) typeset -g codesign=1; shift ;; + -n|--notarize) typeset -g notarize=1; typeset -g codesign=1; shift ;; + -p|--package) typeset -g package=1; shift ;; + --debug) debug=1; shift ;; + *) log_error "Unknown option: %B${1}%b"; exit 2 ;; + } + } + + set -- ${(@)args} + + check_macos + + local product_name + local product_version + read -r product_name product_version <<< \ + "$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})" + + local output_name="${product_name}-${product_version}-${host_os}-universal" + + if [[ ! -d ${project_root}/release/${config}/${product_name}.plugin ]] { + log_error 'No release artifact found. Run the build script or the CMake install procedure first.' + return 2 + } + + if (( package )) { + if [[ ! -f ${project_root}/release/${config}/${product_name}.pkg ]] { + log_error 'Installer Package not found. Run the build script or the CMake build and install procedures first.' + return 2 + } + + log_group "Packaging ${product_name}..." + pushd ${project_root} + + typeset -gx CODESIGN_IDENT="${CODESIGN_IDENT:--}" + typeset -gx CODESIGN_IDENT_INSTALLER="${CODESIGN_IDENT_INSTALLER:--}" + typeset -gx CODESIGN_TEAM="$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')" + + if (( codesign )) { + productsign \ + --sign "${CODESIGN_IDENT_INSTALLER}" \ + ${project_root}/release/${config}/${product_name}.pkg \ + ${project_root}/release/${output_name}.pkg + + rm ${project_root}/release/${config}/${product_name}.pkg + } else { + mv ${project_root}/release/${config}/${product_name}.pkg \ + ${project_root}/release/${output_name}.pkg + } + + if (( codesign && notarize )) { + if ! [[ ${CODESIGN_IDENT} != '-' && ${CODESIGN_TEAM} && {CODESIGN_IDENT_USER} && ${CODESIGN_IDENT_PASS} ]] { + log_error "Notarization requires Apple ID and application password." + return 2 + } + + if [[ ! -f ${project_root}/release/${output_name}.pkg ]] { + log_error "No package for notarization found." + return 2 + } + + xcrun notarytool store-credentials "${product_name}-Codesign-Password" --apple-id "${CODESIGN_IDENT_USER}" --team-id "${CODESIGN_TEAM}" --password "${CODESIGN_IDENT_PASS}" + xcrun notarytool submit ${project_root}/release/${output_name}.pkg --keychain-profile "${product_name}-Codesign-Password" --wait + + local -i _status=0 + + xcrun stapler staple ${project_root}/release/${output_name}.pkg || _status=1 + + if (( _status )) { + log_error "Notarization failed. Use 'xcrun notarytool log ' to check for errors." + return 2 + } + } + popd + } else { + log_group "Archiving ${product_name}..." + pushd ${project_root}/release/${config} + XZ_OPT=-T0 tar -cvJf ${project_root}/release/${output_name}.tar.xz ${product_name}.plugin + popd + } + + if [[ ${config} == Release ]] { + log_group "Archiving ${product_name} Debug Symbols..." + pushd ${project_root}/release/${config} + XZ_OPT=-T0 tar -cvJf ${project_root}/release/${output_name}-dSYMs.tar.xz ${product_name}.plugin.dSYM + popd + } + + log_group +} + +package ${@} diff --git a/.github/scripts/.package.zsh b/.github/scripts/package-ubuntu similarity index 53% rename from .github/scripts/.package.zsh rename to .github/scripts/package-ubuntu index 076d897d..65df29be 100755 --- a/.github/scripts/.package.zsh +++ b/.github/scripts/package-ubuntu @@ -21,16 +21,6 @@ autoload -Uz is-at-least && if ! is-at-least 5.2; then exit 1 fi -TRAPEXIT() { - local return_value=$? - - if (( ${+CI} )) { - unset NSUnbufferedIO - } - - return ${return_value} -} - TRAPZERR() { if (( ${_loglevel:-3} > 2 )) { print -u2 -PR "${CI:+::error::}%F{1} ✖︎ script execution error%f" @@ -45,7 +35,7 @@ TRAPZERR() { package() { if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} - local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]} + local host_os='ubuntu' local project_root=${SCRIPT_HOME:A:h:h} local buildspec_file=${project_root}/buildspec.json @@ -58,11 +48,11 @@ package() { return 2 } + local -i debug=0 local -i verbosity=1 local -r _version='2.0.0' local -r -a _valid_targets=( - macos-universal - linux-x86_64 + ubuntu-x86_64 ) local target local config='RelWithDebInfo' @@ -72,15 +62,6 @@ package() { local -i package=0 local -i skip_deps=0 - if [[ ${host_os} == macos ]] { - local -r _usage_host=" -%F{yellow} Additional options for macOS builds%f - ----------------------------------------------------------------------------- - %B-s | --codesign%b Enable codesigning (macOS only) - %B-n | --notarize%b Enable notarization (macOS only) - %B-p | --package%b Create package installer (macOS only)" - } - local -r _usage=" Usage: %B${functrace[1]%:*}%b