diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ec4305c5..1d67c484 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -141,10 +141,10 @@ jobs: displayName: 'Run tests' # -# MacOS qt6(intel) +# MacOS Qt6(universal) # -- job: MacOS_qt6_Intel +- job: MacOS_qt6_Universal timeoutInMinutes: 90 dependsOn: CodeFormatValidation variables: @@ -175,7 +175,7 @@ jobs: VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" echo "Trying to know if we are in a forked repo: $IS_FORK" SKIP_CODESIGN="$(tr [A-Z] [a-z] <<< "$IS_FORK")" - ./compileOSX.sh $VERSION $(Build.BuildNumber) $SKIP_CODESIGN Qt6 x86_64 + ./compileOSX.sh $VERSION $(Build.BuildNumber) $SKIP_CODESIGN Qt6 universal displayName: 'Build' - script: | cd $(Build.SourcesDirectory)/tests @@ -196,66 +196,7 @@ jobs: - task: PublishPipelineArtifact@1 inputs: path: $(Build.ArtifactStagingDirectory) - artifactName: Macos qt6 Intel $(Build.BuildNumber) dmg - -# -# MacOS qt6(apple) -# - -#TODO create a template -- job: MacOS_qt6_Apple - timeoutInMinutes: 90 - dependsOn: CodeFormatValidation - variables: - - ${{ if and(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))) }}: - - group: macos-codesign - pool: - vmImage: 'macOS-latest' - steps: - - script: | - pip3 install aqtinstall - python3 -m aqt install 6.3.1 mac desktop -m qt5compat qtmultimedia qtimageformats - echo '##vso[task.prependpath]$(Build.SourcesDirectory)/6.3.1/macos/bin' - brew install create-dmg - brew install node - brew link --overwrite node - npm install -g appdmg - mkdir $(Build.SourcesDirectory)\compressed_archive - wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O $(Build.SourcesDirectory)/compressed_archive/7z2301-src.7z - 7z x $(Build.SourcesDirectory)/compressed_archive/7z2301-src.7z -o$(Build.SourcesDirectory)/compressed_archive/lib7zip - displayName: 'Install dependencies' - - ${{ if and(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))) }}: - - task: InstallAppleCertificate@2 - inputs: - certSecureFile: 'developerID_application.p12' - certPwd: $(P12Password) - - script: | - cd $(Build.SourcesDirectory) - VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" - echo "Trying to know if we are in a forked repo: $IS_FORK" - SKIP_CODESIGN="$(tr [A-Z] [a-z] <<< "$IS_FORK")" - ./compileOSX.sh $VERSION $(Build.BuildNumber) $SKIP_CODESIGN Qt6 arm64 - displayName: 'Build' - - script: | - cd $(Build.SourcesDirectory)/tests - qmake - make check TESTARGS="-maxwarnings 100000" - displayName: 'Build and run tests' - - script: | - SKIP_CODESIGN="$(tr [A-Z] [a-z] <<< "$IS_FORK")" - if [ "$SKIP_CODESIGN" = false ]; then - xcrun notarytool submit *.dmg --apple-id $(AppleId) --team-id $(TeamId) --password $(AppPassword) --wait - xcrun stapler staple *.dmg - fi - displayName: 'Notarize' - - task: CopyFiles@2 - inputs: - contents: '*.dmg' - targetFolder: $(Build.ArtifactStagingDirectory) - - task: PublishPipelineArtifact@1 - inputs: - path: $(Build.ArtifactStagingDirectory) - artifactName: Macos qt6 Apple $(Build.BuildNumber) dmg + artifactName: Macos qt6 universal $(Build.BuildNumber) dmg # # MacOS @@ -370,8 +311,7 @@ jobs: - Linux_qt6 - Linux_qt6_7zip - MacOS - - MacOS_qt6_Apple - - MacOS_qt6_Intel + - MacOS_qt6_Universal - Windows_x86 - Windows_x64 - Windows_x64_qt6 @@ -413,8 +353,7 @@ jobs: - Linux_qt6 - Linux_qt6_7zip - MacOS - - MacOS_qt6_Apple - - MacOS_qt6_Intel + - MacOS_qt6_Universal - Windows_x86 - Windows_x64 - Windows_x64_qt6 diff --git a/compileOSX.sh b/compileOSX.sh index 51601ffa..bd92627f 100755 --- a/compileOSX.sh +++ b/compileOSX.sh @@ -17,13 +17,12 @@ if [ "$6" == "clean" ]; then ./cleanOSX.sh fi -if [ "$ARCH" == "arm64" ]; then - ARCH_NAME="Apple" -elif [ "$ARCH" == "x86_64" ]; then +if [ "$ARCH" == "x86_64" ]; then + ARCHS="x86_64" ARCH_NAME="Intel" else - echo "Unknown arch: $ARCH" - exit 1 + ARCHS="x86_64 arm64" + ARCH_NAME="U" fi echo "Building for $ARCH_NAME" @@ -32,19 +31,19 @@ hash qmake 2>/dev/null || { echo >&2 "Qmake command not available. Please add th echo "Compiling YACReader" cd YACReader -qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}" +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="$ARCHS" make cd .. echo "Compiling YACReaderLibrary" cd YACReaderLibrary -qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}" +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="$ARCHS" make cd .. echo "Compiling YACReaderLibraryServer" cd YACReaderLibraryServer -qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}" +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="$ARCHS" make cd .. diff --git a/dependencies/7zip/macx/Version.txt b/dependencies/7zip/macx/Version.txt index 3d5e31b5..845fb0a7 100644 --- a/dependencies/7zip/macx/Version.txt +++ b/dependencies/7zip/macx/Version.txt @@ -1,3 +1,5 @@ 7zip 23.01 built from the original sources using the Format7zF bundle -TODO: try to get the optimized version of 7z.so by using the custom makefiles. \ No newline at end of file +Universal binary created using lipo: + +lipo -create -arch arm64 arm64/7z.so -arch x86_64 x86_64/7z.so -o universal/7z.so \ No newline at end of file diff --git a/dependencies/7zip/macx/universal/7z.so b/dependencies/7zip/macx/universal/7z.so new file mode 100755 index 00000000..cf94e537 Binary files /dev/null and b/dependencies/7zip/macx/universal/7z.so differ