diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0e511e70..3a01e03b 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -2,14 +2,13 @@ name: Build android (on MacOS) on: push: - paths: - - 'vcpkg-test/**' - - 'vcpkg-overlay/**' - - '.github/workflows/android.yml' - - release: - types: - - published + paths-ignore: + - '.github/workflows/ios.yml' + - '.github/workflows/linux.yml' + - '.github/workflows/mac.yml' + - '.github/workflows/win.yml' + - 'LICENSE' + - 'README.md' concurrency: group: ci-${{github.ref}}-android @@ -21,33 +20,43 @@ jobs: fail-fast: false matrix: include: - - arch: 'arm' - qt_arch: 'android_armv7' - - arch: 'amd64' - qt_arch: 'android_arm64_v8a' + - TRIPLET: 'arm-android' + QT_ARCH: 'android_armv7' + - TRIPLET: 'amd64-android' + QT_ARCH: 'android_arm64_v8a' runs-on: macos-12 env: QT_VERSION: '6.5.2' + CMAKE_GENERATOR: "Ninja" ANDROIDAPI: 24 NDK_VERSION: r25b NDK_VERSION_FULL: r25b JDK_VERSION: 11 SDK_PLATFORM: android-33 SDK_BUILD_TOOLS: 33.0.1 - CACHE_VERSION: 0 - QT_CACHE_VERSION: 0 XC_VERSION: ${{ '14.2' }} - VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change - VCPKG_ROOT: "/Users/runner/vcpkg-root" - + QT_ARCH: "android" + VCPKG_ROOT: "/Users/runner/vcpkg" + VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change + CACHE_VERSION: 0 + steps: - uses: actions/checkout@v3 + with: + path: input-sdk - - name: Select latest Xcode - run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app" + - name: Prepare vars + id: vars + run: | + brew install automake bison flex gnu-sed autoconf-archive libtool + echo $(brew --prefix bison)/bin >> $GITHUB_PATH + echo $(brew --prefix flex)/bin >> $GITHUB_PATH - - uses: lukka/get-cmake@latest # cmake & ninja + - name: Setup compiler + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ env.XC_VERSION }} - uses: nttld/setup-ndk@v1 id: setup-ndk @@ -75,7 +84,7 @@ jobs: setup-python: 'false' modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' dir: ${{ github.workspace }} - target: android + target: ${{ matrix.QT_ARCH }} arch: ${{ matrix.qt_arch }} cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-android @@ -91,33 +100,31 @@ jobs: cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-desktop - - name: Restore cached vcpkg build folder + - name: Restore vcpkg folder id: cache-vcpkg-restore + if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master uses: actions/cache/restore@v3 with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ matrix.arch }} + key: VCPKG-${{ runner.os }}-${{ matrix.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} - - name: Clone vcpkg + - uses: actions/checkout@v3 if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' + with: + repository: microsoft/vcpkg + path: ${{ env.VCPKG_ROOT }} + ref: ${ env.VCPKG_BASELINE } + + - name: Build Deps run: | - mkdir -p "${{ env.VCPKG_ROOT }}" - cd "${{ env.VCPKG_ROOT }}" - git init - git remote add origin https://github.com/microsoft/vcpkg.git - git pull origin master - git checkout $VCPKG_BASELINE - - - name: Build SDK ${{ matrix.arch }}-android - run: | - mkdir -p ${{ github.workspace }}/build/${{ matrix.arch }} - cd ${{ github.workspace }}/build/${{ matrix.arch }} + mkdir -p ${{ github.workspace }}/build + cd ${{ github.workspace }}/build cmake -B ${{ github.workspace }}/build/${{ matrix.arch }} \ - -S ${{ github.workspace }}/vcpkg-test \ + -S ${{ github.workspace }}/input-sdk \ -DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \ -DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ -G Ninja \ - -DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-android \ + -DVCPKG_TARGET_TRIPLET=${{ matrix.TRIPLET }} \ -DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \ -DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports" @@ -125,17 +132,17 @@ jobs: uses: actions/upload-artifact@v3 if: failure() with: - name: build-logs-${{ matrix.arch }}-android + name: build-logs-${{ matrix.TRIPLET }} path: | ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log - - name: Save cached vcpkg build folder + - name: Save vcpkg folder uses: actions/cache/save@v3 - if: always() + if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too id: cache-vcpkg-save with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ matrix.arch }} + key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} - name: Build Test App run: | @@ -149,15 +156,25 @@ jobs: timeZone: 8 format: 'YYYYMMDD' - - name: Create package + - name: Create SDK data folder run: | - SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-${{ matrix.arch }}-android-${{ runner.os }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz - echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV - cd ${{ github.workspace }}/${{ matrix.arch }}/vcpkg_installed/${{ matrix.arch }}-android/ - tar -c -z --exclude=*.pyc -f ${{ github.workspace }}/${SDK_TAR} ./ + mkdir -p ${{ github.workspace }}/sdk + cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ matrix.TRIPLET }}/* ${{ github.workspace }}/sdk/* + rm -rf ${{ github.workspace }}/sdk/debug + rm -rf ${{ github.workspace }}/sdk/etc + rm -rf ${{ github.workspace }}/sdk/mkspecs + rm -rf ${{ github.workspace }}/sdk/share + rm -rf ${{ github.workspace }}/sdk/tools + + SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ matrix.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz + echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV + + cd ${{ github.workspace }}/sdk/ + find libs/ + tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ - name: Upload Sdk in Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ${{ github.workspace }}/${{ env.SDK_TAR }} @@ -165,7 +182,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} uses: ncipollo/release-action@v1 with: - tag: ${{ matrix.arch }}-android-${{ runner.os }}-${{ steps.time.outputs.time }}-${{ github.run_number }} + tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} allowUpdates: true artifacts: ${{ env.SDK_TAR }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 037ec2da..82eeb7a2 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -2,14 +2,13 @@ name: Build ios on: push: - paths: - - 'vcpkg-test/**' - - 'vcpkg-overlay/**' - - '.github/workflows/ios.yml' - - release: - types: - - published + paths-ignore: + - '.github/workflows/android.yml' + - '.github/workflows/linux.yml' + - '.github/workflows/mac.yml' + - '.github/workflows/win.yml' + - 'LICENSE' + - 'README.md' concurrency: group: ci-${{github.ref}}-ios @@ -19,30 +18,42 @@ jobs: ios_build: runs-on: macos-12 env: - IOS_MIN_SDK_VERSION: '14.0' # iOS Deployment target QT_VERSION: '6.5.2' - ARCH: 'arm64' - CACHE_VERSION: 0 + TRIPLET: "arm64-ios" + CMAKE_GENERATOR: "Ninja" + IOS_MIN_SDK_VERSION: '14.0' # iOS Deployment target XC_VERSION: ${{ '14.2' }} - VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change - VCPKG_ROOT: "/Users/runner/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB) + QT_ARCH: "ios" + VCPKG_ROOT: "/Users/runner/vcpkg" + VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change + CACHE_VERSION: 0 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + path: input-sdk - name: Select latest Xcode run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app" - - uses: lukka/get-cmake@latest # cmake & ninja + - name: Prepare vars + id: vars + run: | + brew install automake bison flex gnu-sed autoconf-archive libtool + echo $(brew --prefix bison)/bin >> $GITHUB_PATH + echo $(brew --prefix flex)/bin >> $GITHUB_PATH + pip3 install -U pip + pip3 install aqtinstall - - name: Install Qt (android) + - name: Install Qt (ios) uses: jurplel/install-qt-action@v3 with: version: ${{ env.QT_VERSION }} setup-python: 'false' modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' dir: ${{ github.workspace }} - target: ios + target: ${{ env.QT_ARCH }} + arch: ${{ matrix.qt_arch }} cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-ios @@ -57,33 +68,30 @@ jobs: cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-desktop - - name: Restore cached vcpkg build folder + - name: Restore vcpkg folder id: cache-vcpkg-restore + if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master uses: actions/cache/restore@v3 with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }} + key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} - - name: Clone vcpkg + - uses: actions/checkout@v3 if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' + with: + repository: microsoft/vcpkg + path: ${{ env.VCPKG_ROOT }} + ref: ${ env.VCPKG_BASELINE } + + - name: Build Deps run: | - mkdir -p "${{ env.VCPKG_ROOT }}" - cd "${{ env.VCPKG_ROOT }}" - git init - git remote add origin https://github.com/microsoft/vcpkg.git - git pull origin master - git checkout $VCPKG_BASELINE - - - name: Build SDK ${{ env.ARCH }}-ios - run: | - mkdir -p ${{ github.workspace }}/build/${{ env.ARCH }} - cd ${{ github.workspace }}/build/${{ env.ARCH }} - cmake -B ${{ github.workspace }}/build/${{ env.ARCH }} \ - -S ${{ github.workspace }}/vcpkg-test \ - -DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \ + mkdir -p ${{ github.workspace }}/build + cd ${{ github.workspace }}/build + cmake -B ${{ github.workspace }}/build \ + -S ${{ github.workspace }}/input-sdk \ -DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ -G Ninja \ - -DVCPKG_TARGET_TRIPLET=${{ env.ARCH }}-ios \ + -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ -DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \ -DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports" @@ -91,21 +99,21 @@ jobs: uses: actions/upload-artifact@v3 if: failure() with: - name: build-logs-${{ env.ARCH }}-ios + name: build-logs-${{ env.TRIPLET }} path: | ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log - - name: Save cached vcpkg build folder + - name: Save vcpkg folder uses: actions/cache/save@v3 - if: always() + if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too id: cache-vcpkg-save with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }} + key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} - name: Build Test App run: | - cd ${{ github.workspace }}/build/${{ env.ARCH }} + cd ${{ github.workspace }}/build ninja - name: Get TimeStamp @@ -115,15 +123,25 @@ jobs: timeZone: 8 format: 'YYYYMMDD' - - name: Create package + - name: Create SDK data folder run: | - SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-ios-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz - echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV - cd "${{ github.workspace }}/build/stage" - tar -c -z --exclude=*.pyc -f ${{ github.workspace }}/${SDK_TAR} ./ + mkdir -p ${{ github.workspace }}/sdk + cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* + rm -rf ${{ github.workspace }}/sdk/debug + rm -rf ${{ github.workspace }}/sdk/etc + rm -rf ${{ github.workspace }}/sdk/mkspecs + rm -rf ${{ github.workspace }}/sdk/share + rm -rf ${{ github.workspace }}/sdk/tools + + SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz + echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV + + cd ${{ github.workspace }}/sdk/ + find libs/ + tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ - name: Upload Sdk in Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ${{ github.workspace }}/${{ env.SDK_TAR }} @@ -131,7 +149,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} uses: ncipollo/release-action@v1 with: - tag: ios-${{ steps.time.outputs.time }}-${{ github.run_number }} + tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} allowUpdates: true artifacts: ${{ env.SDK_TAR }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1f653564..521e835e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -2,14 +2,13 @@ name: Build Linux on: push: - paths: - - 'vcpkg-test/**' - - 'vcpkg-overlay/**' - - '.github/workflows/linux.yml' - - release: - types: - - published + paths-ignore: + - '.github/workflows/android.yml' + - '.github/workflows/ios.yml' + - '.github/workflows/mac.yml' + - '.github/workflows/win.yml' + - 'LICENSE' + - 'README.md' concurrency: group: ci-${{github.ref}}-linux @@ -19,56 +18,65 @@ jobs: linux_build: runs-on: ubuntu-22.04 if: github.repository == 'merginmaps/input-sdk' + env: - ARCH: 'x64' - UBUNTU_VERSION: 2204 QT_VERSION: '6.5.2' + TRIPLET: "x64-linux" + CMAKE_GENERATOR: "Ninja" + QT_ARCH: "desktop" + VCPKG_ROOT: "/home/runner/vcpkg" + VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change CACHE_VERSION: 0 - VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change - VCPKG_ROOT: "/home/runner/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB) steps: - uses: actions/checkout@v3 + with: + path: input-sdk - - uses: lukka/get-cmake@latest # cmake & ninja + - name: Prepare vars + id: vars + run: | + sudo apt-get install -y \ + bison flex \ + cmake ninja-build - - name: Install Qt - uses: jurplel/install-qt-action@v3 + - uses: jurplel/install-qt-action@v3 with: version: ${{ env.QT_VERSION }} + target: ${{ env.QT_ARCH }} setup-python: 'false' modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' dir: ${{ github.workspace }} cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-lnx - - name: Restore cached vcpkg build folder + - name: Restore vcpkg folder id: cache-vcpkg-restore + if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master uses: actions/cache/restore@v3 with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }} + key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} - - name: Clone vcpkg + - uses: actions/checkout@v3 if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' - run: | - mkdir -p "${{ env.VCPKG_ROOT }}" - cd "${{ env.VCPKG_ROOT }}" - git init - git remote add origin https://github.com/microsoft/vcpkg.git - git pull origin master - git checkout $VCPKG_BASELINE + with: + repository: microsoft/vcpkg + path: ${{ env.VCPKG_ROOT }} + ref: ${ env.VCPKG_BASELINE } - - name: Build SDK ${{ env.ARCH }}-linux + - name: Build Deps run: | - mkdir -p ${{ github.workspace }}/build/${{ env.ARCH }} - cd ${{ github.workspace }}/build/${{ env.ARCH }} - cmake -B ${{ github.workspace }}/build/${{ env.ARCH }} \ - -S ${{ github.workspace }}/vcpkg-test \ - -DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \ + echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV + which vcpkg + + mkdir -p ${{ github.workspace }}/build + cd ${{ github.workspace }}/build + cmake -B ${{ github.workspace }}/build \ + -S ${{ github.workspace }}/input-sdk \ -DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ -G Ninja \ - -DVCPKG_TARGET_TRIPLET=${{ env.ARCH }}-linux \ + -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ -DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \ -DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports" @@ -76,27 +84,27 @@ jobs: uses: actions/upload-artifact@v3 if: failure() with: - name: build-logs-${{ env.ARCH }}-linux + name: build-logs-${{ env.TRIPLET }} path: | ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log - - name: Save cached vcpkg build folder + - name: Save vcpkg folder uses: actions/cache/save@v3 - if: always() + if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too id: cache-vcpkg-save with: path: ${{ env.VCPKG_ROOT }} - key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }} + key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} - name: Build Test App run: | - cd ${{ github.workspace }}/build/${{ env.ARCH }} + cd ${{ github.workspace }}/build ninja - name: Run Tests run: | - cd ${{ github.workspace }}/build/${{ env.ARCH }} - ls -la + cd ${{ github.workspace }}/build + ./merginmapsinputsdk - name: Get TimeStamp id: time @@ -105,15 +113,25 @@ jobs: timeZone: 8 format: 'YYYYMMDD' - - name: Create package + - name: Create SDK data folder run: | - SDK_TAR=input-sdk-ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz - echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV - cd "${{ github.workspace }}/build/stage/${{ env.ARCH }}" - tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ + mkdir -p ${{ github.workspace }}/sdk + cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* + rm -rf ${{ github.workspace }}/sdk/debug + rm -rf ${{ github.workspace }}/sdk/etc + rm -rf ${{ github.workspace }}/sdk/mkspecs + rm -rf ${{ github.workspace }}/sdk/share + rm -rf ${{ github.workspace }}/sdk/tools + + SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz + echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV + + cd ${{ github.workspace }}/sdk/ + find libs/ + tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ - name: Upload Sdk in Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ${{ github.workspace }}/${{ env.SDK_TAR }} @@ -121,7 +139,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} uses: ncipollo/release-action@v1 with: - tag: ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }} + tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} allowUpdates: true artifacts: ${{ env.SDK_TAR }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 415351c8..34a2501f 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,6 +1,14 @@ name: Build macOS -on: [push] +on: + push: + paths-ignore: + - '.github/workflows/android.yml' + - '.github/workflows/ios.yml' + - '.github/workflows/linux.yml' + - '.github/workflows/win.yml' + - 'LICENSE' + - 'README.md' concurrency: group: ci-${{github.ref}}-mac @@ -13,7 +21,6 @@ jobs: env: QT_VERSION: '6.5.2' - ARCH: 'x64' TRIPLET: "x64-osx" CMAKE_GENERATOR: "Ninja" MACOSX_DEPLOYMENT_TARGET: 10.15.0 @@ -22,92 +29,90 @@ jobs: VCPKG_ROOT: "/Users/runner/vcpkg" VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change CACHE_VERSION: 0 - + steps: - uses: actions/checkout@v3 - - - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: ${{ env.XC_VERSION }} - - - uses: actions/checkout@v3 + path: input-sdk + - name: Prepare vars + id: vars + run: | + brew install automake bison flex gnu-sed autoconf-archive libtool + echo $(brew --prefix bison)/bin >> $GITHUB_PATH + echo $(brew --prefix flex)/bin >> $GITHUB_PATH + - uses: jurplel/install-qt-action@v3 with: version: ${{ env.QT_VERSION }} - target: desktop + setup-python: 'false' + target: ${{ env.QT_ARCH }} dir: ${{ github.workspace }} modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-mac - - name: Prepare build env - run: | - brew install automake bison flex gnu-sed autoconf-archive libtool - echo $(brew --prefix bison)/bin >> $GITHUB_PATH - echo $(brew --prefix flex)/bin >> $GITHUB_PATH + - name: Setup compiler + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ env.XC_VERSION }} - - name: Restore build folder - id: cache-build-restore + - name: Restore vcpkg folder + id: cache-vcpkg-restore if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master uses: actions/cache/restore@v3 with: - path: ${{ github.workspace }}/build - key: ${{ runner.os }}-build-VCPKG-${{ env.VCPKG_BASELINE }}-CACHE-v${{ env.CACHE_VERSION }}-QT-${{ env.QT_VERSION }}-${{ env.ARCH }}-gitref-${{ github.ref }} + path: ${{ env.VCPKG_ROOT }} + key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} - - name: Build SDK ${{ env.ARCH }}-osx + - uses: actions/checkout@v3 + if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' + with: + repository: microsoft/vcpkg + path: ${{ env.VCPKG_ROOT }} + ref: ${ env.VCPKG_BASELINE } + + - name: Build Deps run: | - mkdir -p ${{ github.workspace }}/build/vcpkg - cd ${{ github.workspace }}/build/vcpkg - if [ "$(ls -A .)" ]; then - echo "vcpkg installed - skip download" - else - git init . - git remote add origin https://github.com/microsoft/vcpkg.git - git pull origin master - git checkout $VCPKG_BASELINE - ./bootstrap-vcpkg.sh - fi - - echo "PATH=${{ github.workspace }}/build/vcpkg:$PATH" >> $GITHUB_ENV + echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV which vcpkg - mkdir -p ${{ github.workspace }}/build/${{ env.ARCH }} - cd ${{ github.workspace }}/build/${{ env.ARCH }} - cmake -B ${{ github.workspace }}/build/${{ env.ARCH }} \ - -S ${{ github.workspace }}/input-sdk/vcpkg-test \ - -DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \ - -DCMAKE_TOOLCHAIN_FILE:PATH="${{ github.workspace }}/build/vcpkg/scripts/buildsystems/vcpkg.cmake" \ - -G Ninja \ - -DVCPKG_TARGET_TRIPLET=${{ env.ARCH }}-osx \ + mkdir -p ${{ github.workspace }}/build + cd ${{ github.workspace }}/build + cmake -B ${{ github.workspace }}/build \ + -S ${{ github.workspace }}/input-sdk \ + -DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ + -GNinja \ + -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ -DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \ -DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports" \ - -DCMAKE_BUILD_TYPE=Release + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MAKE_PROGRAM=ninja - name: Upload build logs on deps failure uses: actions/upload-artifact@v3 if: failure() with: - name: build-logs-${{ env.ARCH }}-osx + name: build-logs-${{ env.TRIPLET }} path: | - ${{ github.workspace }}/build/vcpkg/buildtrees/**/*.log + ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log - - name: Save build folder + - name: Save vcpkg folder uses: actions/cache/save@v3 if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too - id: cache-build-save + id: cache-vcpkg-save with: - path: ${{ github.workspace }}/build - key: ${{ steps.cache-build-restore.outputs.cache-primary-key }} + path: ${{ env.VCPKG_ROOT }} + key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} - name: Build Test App run: | - cd ${{ github.workspace }}/build/${{ env.ARCH }} + cd ${{ github.workspace }}/build ninja - name: Run Tests run: | - cd ${{ github.workspace }}/build/${{ env.ARCH }} + cd ${{ github.workspace }}/build ./merginmapsinputsdk - name: Get TimeStamp @@ -119,10 +124,10 @@ jobs: - name: Create GDAL supported formats run: | - ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/tools/gdal/gdalinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log - ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/tools/gdal/ogrinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log + ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/tools/gdal/gdalinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log + ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/tools/gdal/ogrinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log - SUPPORTED_FORMATS="input-sdk-gdal-supported-formats-${{ steps.time.outputs.time }}-${{ github.run_number }}.log" + SUPPORTED_FORMATS="mergin-maps-input-sdk-gdal-supported-formats-${{ steps.time.outputs.time }}-${{ github.run_number }}.log" echo "SUPPORTED_FORMATS=${SUPPORTED_FORMATS}" >> $GITHUB_ENV cat ${{ github.workspace }}/supported_formats.log @@ -132,13 +137,13 @@ jobs: mkdir -p ${{ github.workspace }}/proj-data echo ".. 1/2 qgis database" mkdir -p ${{ github.workspace }}/proj-data/resources - ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/qgis/proj/qgis.db ${{ github.workspace }}/proj-data/resources/ - ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/qgis/proj/srs.db ${{ github.workspace }}/proj-data/resources/ + ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/share/qgis/proj/qgis.db ${{ github.workspace }}/proj-data/resources/ + ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/share/qgis/proj/srs.db ${{ github.workspace }}/proj-data/resources/ echo ".. 2/2 proj resources" mkdir -p ${{ github.workspace }}/proj-data/proj - ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/proj/* ${{ github.workspace }}/proj-data/proj/ + ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/share/proj/* ${{ github.workspace }}/proj-data/proj/ - PROJ_TAR=input-sdk-proj-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz + PROJ_TAR=mergin-maps-input-sdk-proj-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz echo "PROJ_TAR=${PROJ_TAR}" >> $GITHUB_ENV cd "${{ github.workspace }}/proj-data" @@ -149,14 +154,14 @@ jobs: - name: Create SDK data folder run: | mkdir -p ${{ github.workspace }}/sdk - cp -R ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/* ${{ github.workspace }}/sdk/* + cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* rm -rf ${{ github.workspace }}/sdk/debug rm -rf ${{ github.workspace }}/sdk/etc rm -rf ${{ github.workspace }}/sdk/mkspecs rm -rf ${{ github.workspace }}/sdk/share rm -rf ${{ github.workspace }}/sdk/tools - SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz + SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV cd ${{ github.workspace }}/sdk/ @@ -185,7 +190,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} uses: ncipollo/release-action@v1 with: - tag: mac-${{ steps.time.outputs.time }}-${{ github.run_number }} + tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} allowUpdates: true artifacts: "${{ env.SDK_TAR }},${{ env.SUPPORTED_FORMATS }},${{ env.PROJ_TAR }}" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index c2c1d0f9..77427624 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -1,6 +1,14 @@ name: Build win64 -on: [push] +on: + push: + paths-ignore: + - '.github/workflows/android.yml' + - '.github/workflows/ios.yml' + - '.github/workflows/linux.yml' + - '.github/workflows/mac.yml' + - 'LICENSE' + - 'README.md' concurrency: group: ci-${{github.ref}}-windows @@ -13,7 +21,6 @@ jobs: env: QT_VERSION: '6.5.2' - ARCH: "win64" TRIPLET: "x64-windows" VS_VERSION: "2019" CMAKE_GENERATOR: "Visual Studio 16 2019" # see https://github.com/actions/runner-images/blob/main/images/win/Windows2019-Readme.md @@ -24,9 +31,9 @@ jobs: CACHE_VERSION: 0 steps: - - run: Get-PSDrive - - uses: actions/checkout@v3 + with: + path: input-sdk - name: Prepare vars id: vars @@ -36,24 +43,10 @@ jobs: echo "::set-output name=WORKSPACE_DIR::$WORKSPACE_DIR" echo "WORKSPACE_DIR: $WORKSPACE_DIR" - - name: Restore vcpkg folder - id: cache-build-restore - if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master - uses: actions/cache/restore@v3 - with: - path: ${{ github.workspace }}/build - key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} - - - uses: actions/checkout@v3 - if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' - with: - repository: microsoft/vcpkg - path: ${ env.VCPKG_ROOT } - - - name: Install Qt - uses: jurplel/install-qt-action@v3 + - uses: jurplel/install-qt-action@v3 with: version: ${{ env.QT_VERSION }} + setup-python: 'false' target: desktop arch: ${{ env.QT_ARCH }} dir: ${{ github.workspace }} @@ -61,11 +54,26 @@ jobs: cache: true cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-win - - name: set compiler environment + - name: Setup compiler shell: cmd run: | CALL "C:\Program Files (x86)\Microsoft Visual Studio\${{ env.VS_VERSION }}\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ env.CMAKE_ARCH }} + - name: Restore vcpkg folder + id: cache-vcpkg-restore + if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master + uses: actions/cache/restore@v3 + with: + path: ${ env.VCPKG_ROOT } + key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} + + - uses: actions/checkout@v3 + if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' + with: + repository: microsoft/vcpkg + path: ${ env.VCPKG_ROOT } + ref: ${ env.VCPKG_BASELINE } + - name: Build Deps shell: pwsh run: | @@ -78,11 +86,10 @@ jobs: } $env:PATH="$env:VCPKG_ROOT;$env:PATH" cd $env:GITHUB_WORKSPACE - mkdir ${{ github.workspace }}\build\${{ env.ARCH }} -ea 0 + mkdir ${{ github.workspace }}\build -ea 0 exec { - cmake -B ${{ github.workspace }}\build\${{ env.ARCH }} ` - -S ${{ github.workspace }}\vcpkg-test ` - -DCMAKE_MODULE_PATH:PATH="${{ steps.vars.outputs.WORKSPACE_DIR }}/vcpkg-test/cmake" ` + cmake -B ${{ github.workspace }}\build ` + -S ${{ github.workspace }}\input-sdk ` -DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" ` -G "${{ env.CMAKE_GENERATOR }}" ` -A ${{ env.CMAKE_ARCH }} ` @@ -95,11 +102,11 @@ jobs: uses: actions/upload-artifact@v3 if: failure() with: - name: build-logs-x64-windows + name: build-logs-${{ env.TRIPLET }} path: | ${{ env.VCPKG_ROOT }}/buildtrees/**/*.log - - name: Save VCPKG folder + - name: Save vcpkg folder uses: actions/cache/save@v3 if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too id: cache-build-save @@ -119,7 +126,7 @@ jobs: } $env:PATH="$env:VCPKG_ROOT;$env:PATH" cd $env:GITHUB_WORKSPACE - exec { cmake --build ${{ github.workspace }}\build\${{ env.ARCH }}. --config Release --verbose } + exec { cmake --build ${{ github.workspace }}\build. --config Release --verbose } - name: Run SDK Tests shell: pwsh @@ -131,7 +138,7 @@ jobs: & $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" } if ($LastExitCode -ne 0) { exit $LastExitCode } } - exec { ${{ github.workspace }}\build\${{ env.ARCH }}\Release\merginmapsinputsdk.exe } + exec { ${{ github.workspace }}\build\Release\merginmapsinputsdk.exe } - name: Get TimeStamp id: time @@ -144,13 +151,13 @@ jobs: shell: bash run: | mkdir -p ${{ github.workspace }}/sdk - cp -R ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* + cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* rm -rf ${{ github.workspace }}/sdk/etc rm -rf ${{ github.workspace }}/sdk/mkspecs rm -rf ${{ github.workspace }}/sdk/share rm -rf ${{ github.workspace }}/sdk/tools - SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-win64-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip + SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV find ${{ github.workspace }}/sdk/bin/ | grep dll @@ -163,7 +170,7 @@ jobs: filename: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }} - name: Upload Sdk in Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }} if-no-files-found: error @@ -172,7 +179,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} uses: ncipollo/release-action@v1 with: - tag: win64-${{ steps.time.outputs.time }}-${{ github.run_number }} + tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} allowUpdates: true - artifacts: input-sdk-qt-${{ env.QT_VERSION }}-win64-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip + artifacts: ${{ env.SDK_TAR }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a5ae28..a96a960d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,6 @@ find_package(GEOS CONFIG REQUIRED) find_package(GDAL CONFIG REQUIRED) find_package(ZXing CONFIG REQUIRED) find_package(libzip REQUIRED) -find_package(unofficial-minizip CONFIG) find_package(unofficial-sqlite3 CONFIG REQUIRED) find_package(Protobuf REQUIRED) find_package(Qca CONFIG REQUIRED) @@ -52,7 +51,6 @@ find_package(expat CONFIG REQUIRED) find_package(CURL CONFIG REQUIRED) find_package(Iconv) find_package(WebP CONFIG REQUIRED) -find_package(PNG REQUIRED) unset_pc_spatialite() find_library(SPATIALINDEX_LIBRARY spatialindex_i spatialindex spatialindex-64 PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib NO_DEFAULT_PATH REQUIRED) @@ -60,12 +58,7 @@ find_library(SPATIALITE_LIBRARY spatialite PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_ find_library(ZLIB_LIBRARY z PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib NO_DEFAULT_PATH REQUIRED) find_library(FREEXL_LIBRARY freexl PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib NO_DEFAULT_PATH REQUIRED) if(APPLE) - find_library(LIBTASN1_LIBRARY - NAMES tasn1 - PATHS - /usr/local/lib - /usr/lib - ) + find_library(LIBTASN1_LIBRARY tasn1 PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib NO_DEFAULT_PATH REQUIRED) endif() add_executable(merginmapsinputsdk main.cpp) @@ -100,8 +93,6 @@ target_link_libraries(merginmapsinputsdk PRIVATE ZXing::Core ZXing::ZXing) target_link_libraries(merginmapsinputsdk PRIVATE PROJ::proj) target_link_libraries(merginmapsinputsdk PRIVATE GEOS::geos_c) target_link_libraries(merginmapsinputsdk PRIVATE Geodiff::Geodiff) -target_link_libraries(merginmapsinputsdk PRIVATE unofficial::minizip::minizip) -target_link_libraries(merginmapsinputsdk PRIVATE libzip::zip) target_link_libraries(merginmapsinputsdk PRIVATE libzip::zip) target_link_libraries(merginmapsinputsdk PRIVATE protobuf::libprotobuf-lite) target_link_libraries(merginmapsinputsdk PRIVATE qca) @@ -112,7 +103,6 @@ target_link_libraries(merginmapsinputsdk PRIVATE CURL::libcurl) target_link_libraries(merginmapsinputsdk PRIVATE expat::expat) target_link_libraries(merginmapsinputsdk PRIVATE Iconv::Iconv) target_link_libraries(merginmapsinputsdk PRIVATE WebP::webp WebP::webpdemux WebP::libwebpmux WebP::webpdecoder) -target_link_libraries(merginmapsinputsdk PRIVATE PNG::PNG) target_link_libraries(merginmapsinputsdk PRIVATE ${FREEXL_LIBRARY}) target_link_libraries(merginmapsinputsdk PRIVATE ${ZLIB_LIBRARY}) target_link_libraries(merginmapsinputsdk PRIVATE ${SPATIALINDEX_LIBRARY}) diff --git a/README.md b/README.md index ca901ec3..678fe13d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The release is automatically created from each build on master. - how to do diff `diff -rupN file.orig file` - how to do diff from GIT `git diff master` - find SHA512 hash for vcpkg: `shasum -a 512 myfile.tar.gz` -- vcpkg clean build - remove `vcpkg/buildtrees/` +- vcpkg clean build - remove `rm -rf ./vcpkg/buildtrees/ ./vcpkg/packages/` ## Android @@ -68,8 +68,6 @@ TODO - Install Cmake, bison, flex, ... ``` brew install cmake automake bison flex gnu-sed autoconf-archive libtool - export PATH=$(brew --prefix bison)/bin:$PATH - export PATH=$(brew --prefix flex)/bin:$PATH ``` - Qt (version from `.github/workflows/mac.yml`) - Install Vcpkg (git commit from `.github/workflows/mac.yml`) @@ -89,14 +87,16 @@ TODO ``` mkdir -p build/x64 cd build/x64 - export Qt6_DIR=/opt/Qt//macos + export Qt6_DIR=/opt/Qt/6.5.2/macos;export PATH=$(brew --prefix flex):$(brew --prefix bison)/bin:$PATH + cmake -B . -S ../../input-sdk/ \ -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake \ -G Ninja \ -DVCPKG_TARGET_TRIPLET=x64-osx \ -DVCPK_OVERLAY_TRIPLETS=../../input-sdk/vcpkg-overlay/triplets \ -DVCPKG_OVERLAY_PORTS=../../input-sdk/vcpkg-overlay/ports \ - -DCMAKE_BUILD_TYPE=Release + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MAKE_PROGRAM=ninja ``` - Build and run test app to verify your build diff --git a/vcpkg-overlay/ports/gdal/portfile.cmake b/vcpkg-overlay/ports/gdal/portfile.cmake index b077edc6..4ec7b5a6 100644 --- a/vcpkg-overlay/ports/gdal/portfile.cmake +++ b/vcpkg-overlay/ports/gdal/portfile.cmake @@ -13,24 +13,16 @@ vcpkg_from_github( # `vcpkg clean` stumbles over one subdir file(REMOVE_RECURSE "${SOURCE_PATH}/autotest") -# cannot use internal because we need it to WebP too -list(APPEND FEATURE_OPTIONS -DGDAL_USE_JPEG=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_JPEG_INTERNAL=ON) - -list(APPEND FEATURE_OPTIONS -DGDAL_USE_PNG=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_PNG_INTERNAL=ON) - -list(APPEND FEATURE_OPTIONS -DGDAL_USE_JSONC=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_JSONC_INTERNAL=ON) -list(APPEND FEATURE_OPTIONS -DGDAL_USE_GEOTIFF=ON) -list(APPEND FEATURE_OPTIONS -DGDAL_USE_GEOTIFF_INTERNAL=ON) - list(APPEND FEATURE_OPTIONS -DGDAL_USE_ICONV=ON) if(GDAL_USE_ICONV AND VCPKG_TARGET_IS_WINDOWS) list(APPEND FEATURE_OPTIONS -D_ICONV_SECOND_ARGUMENT_IS_NOT_CONST=ON) endif() +list(APPEND FEATURE_OPTIONS -DGDAL_USE_LIBXML2=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_TIFF=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_CURL=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_WEBP=ON) @@ -40,11 +32,10 @@ list(APPEND FEATURE_OPTIONS -DGDAL_USE_GEOTIFF=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_SPATIALITE=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_EXPAT=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_ZLIB=ON) +list(APPEND FEATURE_OPTIONS -DGDAL_USE_FREEXL=ON) list(APPEND FEATURE_OPTIONS -DGDAL_USE_POSTGRESQL=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_PCRE2=OFF) -list(APPEND FEATURE_OPTIONS -DGDAL_USE_ZSTD=OFF) -list(APPEND FEATURE_OPTIONS -DGDAL_USE_LIBXML2=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_GIF=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_OPENJPEG=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_ODBC=OFF) @@ -54,7 +45,7 @@ list(APPEND FEATURE_OPTIONS -DGDAL_USE_MYSQL=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_POPPLER=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_ODBC=OFF) list(APPEND FEATURE_OPTIONS -DGDAL_USE_MSSQL_ODBC=OFF) -list(APPEND FEATURE_OPTIONS -DGDAL_USE_FREEXL=OFF) +list(APPEND FEATURE_OPTIONS -DGDAL_USE_ZSTD=OFF) # Compatibility with older Android versions https://github.com/OSGeo/gdal/pull/5941 if(VCPKG_TARGET_IS_ANDROID AND ANRDOID_PLATFORM VERSION_LESS 24 AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")) @@ -62,10 +53,12 @@ if(VCPKG_TARGET_IS_ANDROID AND ANRDOID_PLATFORM VERSION_LESS 24 AND (VCPKG_TARGE endif() -if() - BUILD_APPS=OFF +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(BUILD_APPS ON) + list(APPEND FEATURE_OPTIONS -DBUILD_APPS=ON) else() - BUILD_APPS=OFF + set(BUILD_APPS OFF) + list(APPEND FEATURE_OPTIONS -DBUILD_APPS=OFF) endif() string(REPLACE "dynamic" "" qhull_target "Qhull::qhull${VCPKG_LIBRARY_LINKAGE}_r") diff --git a/vcpkg-overlay/ports/gdal/vcpkg.json b/vcpkg-overlay/ports/gdal/vcpkg.json index b10f214f..3670ffbd 100644 --- a/vcpkg-overlay/ports/gdal/vcpkg.json +++ b/vcpkg-overlay/ports/gdal/vcpkg.json @@ -19,6 +19,8 @@ "protobuf", "exiv2", "libiconv", + "libxml2", + "libgeotiff", "expat", { "name": "vcpkg-cmake", diff --git a/vcpkg-overlay/ports/libjpeg-turbo/CMakeLists.txt b/vcpkg-overlay/ports/libjpeg-turbo/CMakeLists.txt deleted file mode 100644 index a46ba2cf..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -# see https://github.com/OSGeo/gdal/blob/master/frmts/jpeg/libjpeg/CMakeLists.txt -cmake_minimum_required(VERSION 3.6) -project(JPEG) - -add_library( - jpeg STATIC - jcapimin.c - jchuff.h - jconfig.h - jdapimin.c - jdct.h - jdmarker.c - jdtrans.c - jidctflt.c - jmemmgr.c - jquant2.c - jcapistd.c - jcinit.c - jcparam.c - jdapistd.c - jddctmgr.c - jdmaster.c - jerror.c - jidctfst.c - jmemsys.h - jutils.c - jccoefct.c - jcmainct.c - jcphuff.c - jdatadst.c - jdhuff.c - jdmerge.c - jerror.h - jidctint.c - jmorecfg.h - jversion.h - jccolor.c - jcmarker.c - jcprepct.c - jdatasrc.c - jdhuff.h - jdphuff.c - jfdctflt.c - jidctred.c - jpegint.h - jcdctmgr.c - jcmaster.c - jcsample.c - jdcoefct.c - jdinput.c - jdpostct.c - jfdctfst.c - jinclude.h - jpeglib.h - jchuff.c - jcomapi.c - jctrans.c - jdcolor.c - jdmainct.c - jdsample.c - jfdctint.c - jmemnobs.c - jquant1.c) - -target_include_directories(jpeg PRIVATE $ $/..) -# target_compile_options(libjpeg PRIVATE ${GDAL_C_WARNING_FLAGS} ${GDAL_SOFTWARNFLAGS}) - -target_compile_definitions(jpeg PRIVATE -DDEFAULT_MAX_MEM=500000000L) -if (RENAME_INTERNAL_JPEG_SYMBOLS) - target_compile_definitions(jpeg PUBLIC -DRENAME_INTERNAL_LIBJPEG_SYMBOLS) -endif () - -# produce position independent code, default is on when building a shared library -# option(GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE "Set ON to produce -fPIC code" ${BUILD_SHARED_LIBS}) -# set_property(TARGET jpeg PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) -# target_sources(${GDAL_LIB_TARGET_NAME} PRIVATE $) \ No newline at end of file diff --git a/vcpkg-overlay/ports/libjpeg-turbo/cpl_port.h b/vcpkg-overlay/ports/libjpeg-turbo/cpl_port.h deleted file mode 100644 index 30fe1669..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/cpl_port.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CPL_BASE_H_INCLUDED_TWEAKED -#define CPL_BASE_H_INCLUDED_TWEAKED - -#if defined(__GNUC__) && __GNUC__ >= 4 -/** Qualifier for an argument that is unused */ -# define CPL_UNUSED __attribute((__unused__)) -#else -/* TODO: add cases for other compilers */ -/** Qualifier for an argument that is unused */ -# define CPL_UNUSED -#endif - -#endif /* ndef CPL_BASE_H_INCLUDED_TWEAKED */ \ No newline at end of file diff --git a/vcpkg-overlay/ports/libjpeg-turbo/jerror.patch b/vcpkg-overlay/ports/libjpeg-turbo/jerror.patch deleted file mode 100644 index ab239dce..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/jerror.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gdal/frmts/jpeg/libjpeg/jerror.c -+++ b/gdal/frmts/jpeg/libjpeg/jerror.c -@@ -47,6 +47,8 @@ - - #ifdef NEED_12_BIT_NAMES - #define jpeg_std_message_table jpeg_std_message_table_12 -+#elif defined(RENAME_INTERNAL_LIBJPEG_SYMBOLS) -+#define jpeg_std_message_table gdal_jpeg_std_message_table - #endif - - #define JMESSAGE(code,string) string , \ No newline at end of file diff --git a/vcpkg-overlay/ports/libjpeg-turbo/portfile.cmake b/vcpkg-overlay/ports/libjpeg-turbo/portfile.cmake deleted file mode 100644 index 7dba647e..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/portfile.cmake +++ /dev/null @@ -1,60 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO OSGeo/gdal - REF "v3.7.0" - SHA512 dfc7ccf5c1a3184fa93be762a880b7631faa4cd178cd72df8f5fd8a6296edafc56de2594617bebcb75ddf19ed4471dafcb574b22d7e9217dedfd7ea72c9247f2 - HEAD_REF master - PATCHES - jerror.patch -) - -# TODO copy files - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}/gdal/frmts/jpeg/libjpeg" - OPTIONS - -DBUILD_SHARED_LIBS=OFF \ - -DRENAME_INTERNAL_JPEG_SYMBOLS=ON \ -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() - -vcpkg_fixup_pkgconfig() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libjpeg-turbo) - -# Rename libraries for static builds -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib") - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib") - endif() - - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - - if (EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake" - "jpeg-static${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "jpeg${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake" - "turbojpeg-static${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "turbojpeg${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}") - endif() - if (EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake" - "jpeg-static${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "jpeg${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake" - "turbojpeg-static${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "turbojpeg${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}") - endif() -endif() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/share/man") - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/jpeg") - -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/vcpkg-overlay/ports/libjpeg-turbo/vcpkg-cmake-wrapper.cmake b/vcpkg-overlay/ports/libjpeg-turbo/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index da30dab9..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,39 +0,0 @@ -cmake_policy(PUSH) - -cmake_policy(SET CMP0012 NEW) -cmake_policy(SET CMP0054 NEW) -find_path(JPEG_INCLUDE_DIR NAMES jpeglib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) -find_library(JPEG_LIBRARY_RELEASE NAMES jpeg PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) -find_library(JPEG_LIBRARY_DEBUG NAMES jpeg PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) -if(CMAKE_VERSION VERSION_LESS 3.12 AND CMAKE_BUILD_TYPE STREQUAL "Debug") - set(JPEG_LIBRARY "${JPEG_LIBRARY_DEBUG}" CACHE FILEPATH "") -endif() -_find_package(${ARGS}) -if(JPEG_FOUND AND NOT TARGET JPEG::JPEG) - # Backfill JPEG::JPEG to versions of cmake before 3.12 - add_library(JPEG::JPEG UNKNOWN IMPORTED) - if(DEFINED JPEG_INCLUDE_DIRS) - set_target_properties(JPEG::JPEG PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${JPEG_INCLUDE_DIRS}") - endif() - if(EXISTS "${JPEG_LIBRARY}") - set_target_properties(JPEG::JPEG PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${JPEG_LIBRARY}") - endif() - if(EXISTS "${JPEG_LIBRARY_RELEASE}") - set_property(TARGET JPEG::JPEG APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(JPEG::JPEG PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${JPEG_LIBRARY_RELEASE}") - endif() - if(EXISTS "${JPEG_LIBRARY_DEBUG}") - set_property(TARGET JPEG::JPEG APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(JPEG::JPEG PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${JPEG_LIBRARY_DEBUG}") - endif() -endif() -cmake_policy(POP) diff --git a/vcpkg-overlay/ports/libjpeg-turbo/vcpkg.json b/vcpkg-overlay/ports/libjpeg-turbo/vcpkg.json deleted file mode 100644 index 4baef406..00000000 --- a/vcpkg-overlay/ports/libjpeg-turbo/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "libjpeg-turbo", - "version": "6b", - "port-version": 0, - "description": "internal JPEG copy from GDAL; this is not turbo, but normal", - "homepage": "https://gdal.org", - "license": "BSD-3-Clause", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/vcpkg-overlay/ports/libpq/Makefile b/vcpkg-overlay/ports/libpq/Makefile deleted file mode 100644 index 67994f4b..00000000 --- a/vcpkg-overlay/ports/libpq/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -subdir = . -top_builddir = . -include src/Makefile.global - -ifeq ($(LIBPQ_LIBRARY_TYPE), static) -LIBPQ_INSTALL_LIBS = install-stlib -endif - -ifeq ($(LIBPQ_LIBRARY_TYPE), shared) -ifeq ($(LIBPQ_USING_MINGW), yes) -# The import library name is the same as the static library name -EXTRA_TARGET = install-lib-static -endif -endif - -.PHONY: all -all: - $(MAKE) -C src/include - $(MAKE) -C src/common - $(MAKE) -C src/port - $(MAKE) -C src/interfaces/libpq all-$(LIBPQ_LIBRARY_TYPE)-lib - $(MAKE) -C src/interfaces/ecpg/include - $(MAKE) -C src/interfaces/ecpg/pgtypeslib - $(MAKE) -C src/interfaces/ecpg/ecpglib - $(MAKE) -C src/interfaces/ecpg/compatlib -ifeq ($(LIBPQ_ENABLE_TOOLS), yes) - $(MAKE) -C src/interfaces/ecpg/preproc - $(MAKE) -C src/fe_utils - $(MAKE) -C src/bin -else - $(MAKE) -C src/bin/pg_config -endif - -.PHONY: install-stlib -install-stlib: - $(MAKE) -C src/common install -o all - rm -f '$(DESTDIR)$(libdir)/libpgcommon_shlib.a' - $(MAKE) -C src/port install -o all - rm -f '$(DESTDIR)$(libdir)/libpgport_shlib.a' - -.PHONY: install -install: $(LIBPQ_INSTALL_LIBS) - $(MAKE) -C src/include install - $(MAKE) -C src/interfaces/libpq $(EXTRA_TARGET) install-lib-$(LIBPQ_LIBRARY_TYPE) install-lib-pc install -o all -o install-lib - $(MAKE) -C src/interfaces/ecpg/include install - $(MAKE) -C src/interfaces/ecpg/pgtypeslib install - $(MAKE) -C src/interfaces/ecpg/ecpglib install - $(MAKE) -C src/interfaces/ecpg/compatlib install -ifeq ($(LIBPQ_ENABLE_TOOLS), yes) - $(MAKE) -C src/interfaces/ecpg/preproc install - $(MAKE) -C src/bin install -else - $(MAKE) -C src/bin/pg_config install -endif diff --git a/vcpkg-overlay/ports/libpq/libpq.props.in b/vcpkg-overlay/ports/libpq/libpq.props.in deleted file mode 100644 index 223e528f..00000000 --- a/vcpkg-overlay/ports/libpq/libpq.props.in +++ /dev/null @@ -1,25 +0,0 @@ - - - - - %(AdditionalOptions) @VCPKG_COMBINED_C_FLAGS_DEBUG@ - - - %(AdditionalOptions) @VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG@ - - - %(AdditionalOptions) @VCPKG_COMBINED_STATIC_LINKER_FLAGS_DEBUG@ - - - - - %(AdditionalOptions) @VCPKG_COMBINED_C_FLAGS_RELEASE@ - - - %(AdditionalOptions) @VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE@ - - - %(AdditionalOptions) @VCPKG_COMBINED_STATIC_LINKER_FLAGS_RELEASE@ - - - diff --git a/vcpkg-overlay/ports/libpq/portfile.cmake b/vcpkg-overlay/ports/libpq/portfile.cmake deleted file mode 100644 index b03f3a99..00000000 --- a/vcpkg-overlay/ports/libpq/portfile.cmake +++ /dev/null @@ -1,154 +0,0 @@ -vcpkg_download_distfile(ARCHIVE - URLS "https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.bz2" - FILENAME "postgresql-${VERSION}.tar.bz2" - SHA512 cac97edeb40df1e8f2162f401b465751132929d7249495ef001e950645a2db46343bd732e7bd6504a7f795e25aea66724f2f4ab0065e3d9331b36db4b3a3bec6 -) - -vcpkg_extract_source_archive( - SOURCE_PATH - ARCHIVE "${ARCHIVE}" - PATCHES - unix/fix-configure.patch - unix/single-linkage.patch - unix/no-server-tools.patch - unix/mingw-install.patch - unix/python.patch - windows/macro-def.patch - windows/python_lib.patch - windows/win_bison_flex.patch - windows/msbuild.patch - windows/spin_delay.patch -) - -if("client" IN_LIST FEATURES) - set(HAS_TOOLS TRUE) -else() - set(HAS_TOOLS FALSE) -endif() - -set(required_programs PERL) -if(VCPKG_TARGET_IS_WINDOWS) - list(APPEND required_programs BISON FLEX) -endif() -foreach(program_name IN LISTS required_programs) - # Need to rename win_bison and win_flex to just bison and flex - vcpkg_find_acquire_program(${program_name}) - get_filename_component(program_dir ${${program_name}} DIRECTORY) - vcpkg_add_to_path(PREPEND "${program_dir}") -endforeach() - -vcpkg_cmake_get_vars(cmake_vars_file) -include("${cmake_vars_file}") - -if(VCPKG_DETECTED_MSVC) - if("nls" IN_LIST FEATURES) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES gettext) - vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") - endif() - if("xml" IN_LIST FEATURES) - x_vcpkg_pkgconfig_get_modules( - PREFIX PC_LIBXML2 - MODULES --msvc-syntax libxml-2.0 - LIBS - ) - separate_arguments(LIBXML2_LIBS_DEBUG NATIVE_COMMAND "${PC_LIBXML2_LIBS_DEBUG}") - separate_arguments(LIBXML2_LIBS_RELEASE NATIVE_COMMAND "${PC_LIBXML2_LIBS_RELEASE}") - endif() - if("xslt" IN_LIST FEATURES) - x_vcpkg_pkgconfig_get_modules( - PREFIX PC_LIBXSLT - MODULES --msvc-syntax libxslt - LIBS - ) - separate_arguments(LIBXSLT_LIBS_DEBUG NATIVE_COMMAND "${PC_LIBXSLT_LIBS_DEBUG}") - separate_arguments(LIBXSLT_LIBS_RELEASE NATIVE_COMMAND "${PC_LIBXSLT_LIBS_RELEASE}") - endif() - - include("${CMAKE_CURRENT_LIST_DIR}/build-msvc.cmake") - if(NOT VCPKG_BUILD_TYPE) - build_msvc(DEBUG "${SOURCE_PATH}") - endif() - build_msvc(RELEASE "${SOURCE_PATH}") - - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - endif() - - if(HAS_TOOLS) - vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") - else() - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools") - endif() -else() - file(COPY "${CMAKE_CURRENT_LIST_DIR}/Makefile" DESTINATION "${SOURCE_PATH}") - - vcpkg_list(SET BUILD_OPTS) - foreach(option IN ITEMS icu lz4 nls openssl python readline xml xslt zlib zstd) - if(option IN_LIST FEATURES) - list(APPEND BUILD_OPTS --with-${option}) - else() - list(APPEND BUILD_OPTS --without-${option}) - endif() - endforeach() - if("nls" IN_LIST FEATURES) - set(ENV{MSGFMT} "${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin/msgfmt${VCPKG_HOST_EXECUTABLE_SUFFIX}") - if(VCPKG_TARGET_IS_ANDROID) - list(APPEND BUILD_OPTS [[LIBS=$LIBS -liconv]]) - endif() - endif() - if("python" IN_LIST FEATURES) - vcpkg_find_acquire_program(PYTHON3) - list(APPEND BUILD_OPTS "PYTHON=${PYTHON3}") - endif() - if(VCPKG_TARGET_IS_ANDROID) # AND CMAKE_SYSTEM_VERSION LESS 26) - list(APPEND BUILD_OPTS ac_cv_header_langinfo_h=no) - endif() - if(VCPKG_DETECTED_CMAKE_OSX_SYSROOT) - list(APPEND BUILD_OPTS "PG_SYSROOT=${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}") - endif() - vcpkg_configure_make( - SOURCE_PATH "${SOURCE_PATH}" - COPY_SOURCE - AUTOCONFIG - ADDITIONAL_MSYS_PACKAGES autoconf-archive - DIRECT_PACKAGES - "https://mirror.msys2.org/msys/x86_64/tzcode-2023c-1-x86_64.pkg.tar.zst" - 7550b843964744607f736a7138f10c6cd92489406a1b84ac71d9a9d8aa16bc69048aa1b24e1f49291b010347047008194c334ca9c632e17fa8245e85549e3c7a - OPTIONS - ${BUILD_OPTS} - OPTIONS_DEBUG - --enable-debug - ) - - if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(ENV{LIBPQ_LIBRARY_TYPE} shared) - else() - set(ENV{LIBPQ_LIBRARY_TYPE} static) - endif() - if(VCPKG_TARGET_IS_MINGW) - set(ENV{LIBPQ_USING_MINGW} yes) - endif() - if(HAS_TOOLS) - set(ENV{LIBPQ_ENABLE_TOOLS} yes) - endif() - vcpkg_install_make() - - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/postgresql/server/pg_config.h" "#define CONFIGURE_ARGS" "// #define CONFIGURE_ARGS") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/pg_config.h" "#define CONFIGURE_ARGS" "// #define CONFIGURE_ARGS") -endif() - -vcpkg_fixup_pkgconfig() -configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/postgresql/vcpkg-cmake-wrapper.cmake" @ONLY) - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/doc" - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/debug/symbols" - "${CURRENT_PACKAGES_DIR}/debug/tools" - "${CURRENT_PACKAGES_DIR}/symbols" - "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug" -) - -file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYRIGHT") diff --git a/vcpkg-overlay/ports/libpq/unix/fix-configure.patch b/vcpkg-overlay/ports/libpq/unix/fix-configure.patch deleted file mode 100644 index c0a7f789..00000000 --- a/vcpkg-overlay/ports/libpq/unix/fix-configure.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 9a73f50..a35395e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -19,7 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - - AC_INIT([PostgreSQL], [15.3], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/]) - --m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required. -+cross_compiling=yes # Avoid conftest loading shared objects -+m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_warn([unsupported],[Autoconf version 2.69 is required. - Untested combinations of 'autoconf' and PostgreSQL versions are not - recommended. You can remove the check from 'configure.ac' but it is then - your responsibility whether the result works or not.])]) -@@ -1274,7 +1275,8 @@ if test "$enable_thread_safety" = yes; then - fi - - if test "$with_readline" = yes; then -- PGAC_CHECK_READLINE -+ PKG_CHECK_MODULES([READLINE], [readline], [HAVE_LIBREADLINE=1], [pgac_cv_check_readline=no]) -+ LIBS="$READLINE_LIBS $LIBS" - if test x"$pgac_cv_check_readline" = x"no"; then - AC_MSG_ERROR([readline library not found - If you have readline already installed, see config.log for details on the -@@ -1284,7 +1286,7 @@ Use --without-readline to disable readline support.]) - fi - - if test "$with_zlib" = yes; then -- AC_CHECK_LIB(z, inflate, [], -+ PKG_CHECK_MODULES([ZLIB], [zlib], [LIBS="$ZLIB_LIBS $LIBS"], - [AC_MSG_ERROR([zlib library not found - If you have zlib already installed, see config.log for details on the - failure. It is possible the compiler isn't looking in the proper directory. -@@ -1333,6 +1335,9 @@ if test "$with_ssl" = openssl ; then - # Minimum required OpenSSL version is 1.0.1 - AC_DEFINE(OPENSSL_API_COMPAT, [0x10001000L], - [Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.]) -+ PKG_CHECK_MODULES([CRYPTO_new_ex_data], [libcrypto], [LIBS="$CRYPTO_new_ex_data_LIBS $LIBS"], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) -+ PKG_CHECK_MODULES([SSL_new], [libssl], [LIBS="$SSL_new_LIBS $LIBS"], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]) -+ if false ; then - if test "$PORTNAME" != "win32"; then - AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) - AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]) -@@ -1340,6 +1345,7 @@ if test "$with_ssl" = openssl ; then - AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])]) - AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])]) - fi -+ fi - # Function introduced in OpenSSL 1.0.2. - AC_CHECK_FUNCS([X509_get_signature_nid]) - # Functions introduced in OpenSSL 1.1.0. We used to check for -@@ -1363,19 +1369,23 @@ if test "$with_pam" = yes ; then - fi - - if test "$with_libxml" = yes ; then -- AC_CHECK_LIB(xml2, xmlSaveToBuffer, [], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])]) -+ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.23], [AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if with xml2])], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])]) -+ LIBS="$LIBXML2_LIBS $LIBS" - fi - - if test "$with_libxslt" = yes ; then -- AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])]) -+ PKG_CHECK_MODULES([LIBXSLT], [libxslt], [AC_DEFINE(HAVE_LIBXSLT,1,[Define to 1 if with xslt])], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])]) -+ LIBS="$LIBXSLT_LIBS $LIBS" - fi - - if test "$with_lz4" = yes ; then -- AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])]) -+ PKG_CHECK_MODULES([LZ4], [liblz4], [AC_DEFINE(HAVE_LIBLZ4,1,[Define to 1 if with lz4])], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])]) -+ LIBS="$LZ4_LIBS $LIBS" - fi - - if test "$with_zstd" = yes ; then -- AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])]) -+ PKG_CHECK_MODULES([ZSTD], [libzstd], [AC_DEFINE(HAVE_LIBZSTD,1,[Define to 1 if with zstd])], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])]) -+ LIBS="$ZSTD_LIBS $LIBS" - fi - - # Note: We can test for libldap_r only after we know PTHREAD_LIBS; diff --git a/vcpkg-overlay/ports/libpq/unix/mingw-install.patch b/vcpkg-overlay/ports/libpq/unix/mingw-install.patch deleted file mode 100644 index ffeea023..00000000 --- a/vcpkg-overlay/ports/libpq/unix/mingw-install.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/src/Makefile.shlib b/src/Makefile.shlib -index 16255d7..51e9ed2 100644 ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -85,7 +85,11 @@ else - # Naming convention for dynamically loadable modules - shlib = $(NAME)$(DLSUFFIX) - endif -+ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared) -+stlib = lib$(NAME).dll.a -+else - stlib = lib$(NAME).a -+endif - - ifndef soname - # additional flags for backend modules -@@ -468,6 +472,9 @@ endif - else # no soname - $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' - endif -+ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared) -+ mv '$(DESTDIR)$(libdir)/$(shlib)' '$(DESTDIR)$(libdir)/../bin/$(shlib)' -+endif - - - installdirs-lib: -@@ -476,6 +483,9 @@ ifdef soname - else - $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' - endif -+ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared) -+ $(MKDIR_P) '$(DESTDIR)$(libdir)/../bin' -+endif - - - ## diff --git a/vcpkg-overlay/ports/libpq/unix/no-server-tools.patch b/vcpkg-overlay/ports/libpq/unix/no-server-tools.patch deleted file mode 100644 index f83682af..00000000 --- a/vcpkg-overlay/ports/libpq/unix/no-server-tools.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/src/bin/Makefile b/src/bin/Makefile -index 7f9dde9..bc6d835 100644 ---- a/src/bin/Makefile -+++ b/src/bin/Makefile -@@ -13,29 +13,20 @@ subdir = src/bin - top_builddir = ../.. - include $(top_builddir)/src/Makefile.global - -+.NOTPARALLEL: -+# incl. https://www.postgresql.org/docs/current/reference-client.html -+# excl. https://www.postgresql.org/docs/current/reference-server.html - SUBDIRS = \ -- initdb \ - pg_amcheck \ -- pg_archivecleanup \ - pg_basebackup \ -- pg_checksums \ - pg_config \ -- pg_controldata \ -- pg_ctl \ - pg_dump \ -- pg_resetwal \ -- pg_rewind \ -- pg_test_fsync \ -- pg_test_timing \ -- pg_upgrade \ - pg_verifybackup \ -- pg_waldump \ - pgbench \ - psql \ - scripts - - ifeq ($(PORTNAME), win32) --SUBDIRS += pgevent - else - ALWAYS_SUBDIRS += pgevent - endif diff --git a/vcpkg-overlay/ports/libpq/unix/python.patch b/vcpkg-overlay/ports/libpq/unix/python.patch deleted file mode 100644 index 6466746e..00000000 --- a/vcpkg-overlay/ports/libpq/unix/python.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index a35395e..3c1b3e2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1176,7 +1176,19 @@ fi - - if test "$with_python" = yes; then - PGAC_PATH_PYTHON -- PGAC_CHECK_PYTHON_EMBED_SETUP -+ python_majorversion=3 -+ python_version=3.10 -+ PKG_CHECK_MODULES(PYTHON_EMBED, python-${python_version}-embed) -+ python_includespec="${PYTHON_EMBED_CFLAGS}" -+ python_libdir=[$(echo " ${PYTHON_EMBED_LIBS}" | sed -e 's/\( -L[^ ]*\).*/\1/' -e 's/^.* -L//')] -+ python_libspec="${PYTHON_EMBED_LIBS}" -+ python_additional_libs="" -+ AC_SUBST(python_majorversion) -+ AC_SUBST(python_version) -+ AC_SUBST(python_includespec) -+ AC_SUBST(python_libdir) -+ AC_SUBST(python_libspec) -+ AC_SUBST(python_additional_libs) - fi - - if test x"$cross_compiling" = x"yes" && test -z "$with_system_tzdata"; then diff --git a/vcpkg-overlay/ports/libpq/unix/single-linkage.patch b/vcpkg-overlay/ports/libpq/unix/single-linkage.patch deleted file mode 100644 index dd149c7d..00000000 --- a/vcpkg-overlay/ports/libpq/unix/single-linkage.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/src/Makefile.shlib b/src/Makefile.shlib -index 551023c..16255d7 100644 ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -260,10 +260,14 @@ endif - - .PHONY: all-lib all-static-lib all-shared-lib - -+ifndef LIBPQ_LIBRARY_TYPE - all-lib: all-shared-lib - ifdef soname - # no static library when building a dynamically loadable module - all-lib: all-static-lib -+endif -+else -+all-lib: all-$(LIBPQ_LIBRARY_TYPE)-lib - all-lib: lib$(NAME).pc - endif - -@@ -417,9 +421,13 @@ endif # PORTNAME == cygwin || PORTNAME == win32 - ## - - .PHONY: install-lib install-lib-static install-lib-shared installdirs-lib -+ifndef LIBPQ_LIBRARY_TYPE - install-lib: install-lib-shared - ifdef soname - install-lib: install-lib-static -+endif -+else -+install-lib: install-lib-$(LIBPQ_LIBRARY_TYPE) - install-lib: install-lib-pc - endif - -diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile -index 8abdb09..185461e 100644 ---- a/src/interfaces/libpq/Makefile -+++ b/src/interfaces/libpq/Makefile -@@ -115,6 +115,7 @@ backend_src = $(top_srcdir)/src/backend - # Also skip the test on platforms where libpq infrastructure may be provided - # by statically-linked libraries, as we can't expect them to honor this - # coding rule. -+ifeq ($(LIBPQ_LIBRARY_TYPE), shared) - libpq-refs-stamp: $(shlib) - ifneq ($(enable_coverage), yes) - ifeq (,$(filter aix solaris,$(PORTNAME))) -@@ -124,6 +125,10 @@ ifeq (,$(filter aix solaris,$(PORTNAME))) - endif - endif - touch $@ -+else -+.PHONY: libpq-refs-stamp -+libpq-refs-stamp: -+endif - - # Make dependencies on pg_config_paths.h visible in all builds. - fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h diff --git a/vcpkg-overlay/ports/libpq/usage b/vcpkg-overlay/ports/libpq/usage deleted file mode 100644 index 8dfcd275..00000000 --- a/vcpkg-overlay/ports/libpq/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package libpq provides CMake integration: - - find_package(PostgreSQL REQUIRED) - target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL) diff --git a/vcpkg-overlay/ports/libpq/vcpkg-cmake-wrapper.cmake b/vcpkg-overlay/ports/libpq/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 6f143257..00000000 --- a/vcpkg-overlay/ports/libpq/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# Give the CMake module a little bit of help to find the debug libraries -find_library(PostgreSQL_LIBRARY_DEBUG -NAMES pq -PATHS - "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" -NO_DEFAULT_PATH -) -_find_package(${ARGS}) -if(PostgreSQL_FOUND AND NOT "@VCPKG_TARGET_IS_WINDOWS@") - find_library(PostgreSQL_DL_LIBRARY NAMES dl) - if(PostgreSQL_DL_LIBRARY) - list(APPEND PostgreSQL_LIBRARIES "dl") - if(TARGET PostgreSQL::PostgreSQL) - set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl") - endif() - endif() -endif() -if(PostgreSQL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - include(SelectLibraryConfigurations) - foreach(LIB_ITEM libpgport libpgcommon pgport pgcommon) - find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE - NAMES ${LIB_ITEM} - PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH - ) - if(TARGET PostgreSQL::PostgreSQL AND PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE) - set_property( - TARGET PostgreSQL::PostgreSQL - APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$>:${PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE}>" - ) - endif() - - find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG - NAMES ${LIB_ITEM} - PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH - ) - if(TARGET PostgreSQL::PostgreSQL AND PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG) - set_property( - TARGET PostgreSQL::PostgreSQL - APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$:${PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG}>" - ) - endif() - - if (PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE OR PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG) - select_library_configurations(PostgreSQL_${LIB_ITEM}) - list(APPEND PostgreSQL_LIBRARIES ${PostgreSQL_${LIB_ITEM}_LIBRARY}) - endif() - endforeach() - if(WIN32) - if(TARGET PostgreSQL::PostgreSQL) - set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Secur32.lib") - endif() - list(APPEND PostgreSQL_LIBRARIES Secur32.lib) - endif() - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) - set(Z_VCPKG_PORT_FEATURES "@FEATURES@") - if("openssl" IN_LIST Z_VCPKG_PORT_FEATURES) - find_package(OpenSSL REQUIRED) - if(TARGET PostgreSQL::PostgreSQL) - set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "OpenSSL::SSL") - endif() - list(APPEND PostgreSQL_LIBRARIES OpenSSL::SSL) - endif() - if(WIN32) - if(TARGET PostgreSQL::PostgreSQL) - set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Wldap32.lib") - endif() - list(APPEND PostgreSQL_LIBRARIES Wldap32.lib) - endif() - unset(Z_VCPKG_PORT_FEATURES) - cmake_policy(POP) -endif() diff --git a/vcpkg-overlay/ports/libpq/vcpkg-libs.props.in b/vcpkg-overlay/ports/libpq/vcpkg-libs.props.in deleted file mode 100644 index 4c777561..00000000 --- a/vcpkg-overlay/ports/libpq/vcpkg-libs.props.in +++ /dev/null @@ -1,31 +0,0 @@ - - - - @CURRENT_INSTALLED_DIR@/debug/lib/icuind.lib;@CURRENT_INSTALLED_DIR@/debug/lib/icuucd.lib;@CURRENT_INSTALLED_DIR@/debug/lib/icudtd.lib; - @CURRENT_INSTALLED_DIR@/debug/lib/lz4d.lib - @CURRENT_INSTALLED_DIR@/debug/lib/intl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/debug/lib/charset.lib - @CURRENT_INSTALLED_DIR@/debug/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib - @CURRENT_INSTALLED_DIR@/debug/lib/python310_d.lib - @CURRENT_INSTALLED_DIR@/debug/lib/tcl90g.lib - @CURRENT_INSTALLED_DIR@/debug/lib/tcl90sg.lib - @CURRENT_INSTALLED_DIR@/debug/lib/tcl90sgx.lib - @LIBXML2_LIBS_DEBUG@ - @LIBXSLT_LIBS_DEBUG@ - @CURRENT_INSTALLED_DIR@/debug/lib/zlibd.lib - @CURRENT_INSTALLED_DIR@/debug/lib/zstd.lib - - - @CURRENT_INSTALLED_DIR@/lib/icuin.lib;@CURRENT_INSTALLED_DIR@/lib/icuuc.lib;@CURRENT_INSTALLED_DIR@/lib/icudt.lib; - @CURRENT_INSTALLED_DIR@/lib/lz4.lib - @CURRENT_INSTALLED_DIR@/lib/intl.lib;@CURRENT_INSTALLED_DIR@/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/lib/charset.lib - @CURRENT_INSTALLED_DIR@/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib - @CURRENT_INSTALLED_DIR@/lib/python310.lib - @CURRENT_INSTALLED_DIR@/lib/tcl90.lib - @CURRENT_INSTALLED_DIR@/lib/tcl90s.lib - @CURRENT_INSTALLED_DIR@/lib/tcl90sx.lib - @LIBXML2_LIBS_RELEASE@ - @LIBXSLT_LIBS_RELEASE@ - @CURRENT_INSTALLED_DIR@/lib/zlib.lib - @CURRENT_INSTALLED_DIR@/lib/zstd.lib - - diff --git a/vcpkg-overlay/ports/libpq/vcpkg.json b/vcpkg-overlay/ports/libpq/vcpkg.json deleted file mode 100644 index 106e4694..00000000 --- a/vcpkg-overlay/ports/libpq/vcpkg.json +++ /dev/null @@ -1,194 +0,0 @@ -{ - "name": "libpq", - "version": "15.3", - "description": "The official database access API of postgresql", - "homepage": "https://www.postgresql.org/", - "license": "PostgreSQL", - "supports": "!uwp", - "dependencies": [ - { - "name": "libpq", - "default-features": false, - "features": [ - "bonjour" - ], - "platform": "osx" - }, - { - "name": "vcpkg-cmake-get-vars", - "host": true - }, - { - "name": "vcpkg-pkgconfig-get-modules", - "host": true, - "platform": "windows & !mingw" - } - ], - "default-features": [ - "lz4", - "openssl", - "zlib" - ], - "features": { - "all": { - "description": "Build all supported features", - "dependencies": [ - { - "name": "libpq", - "features": [ - "client", - "icu", - "xml", - "xslt", - "zstd" - ] - }, - { - "name": "libpq", - "features": [ - "bonjour" - ], - "platform": "osx" - }, - { - "name": "libpq", - "features": [ - "nls" - ], - "platform": "!osx" - }, - { - "name": "libpq", - "features": [ - "readline" - ], - "platform": "!windows" - }, - { - "name": "libpq", - "features": [ - "python" - ], - "platform": "!android & !mingw" - }, - { - "name": "libpq", - "features": [ - "tcl" - ], - "platform": "windows & !mingw & !arm" - } - ] - }, - "bonjour": { - "description": "Build with Bonjour support", - "supports": "osx" - }, - "client": { - "description": "Build all client tools and libraries" - }, - "icu": { - "description": "Build with support for the ICU library", - "dependencies": [ - "icu" - ] - }, - "lz4": { - "description": "Use lz4", - "dependencies": [ - "lz4" - ] - }, - "nls": { - "description": "Native Language Support", - "supports": "!osx", - "dependencies": [ - "gettext", - { - "name": "gettext", - "host": true, - "features": [ - "tools" - ], - "platform": "!windows, mingw" - } - ] - }, - "openssl": { - "description": "support for encrypted client connections and random number generation on platforms that do not have \"/dev/urandom\" (except windows)", - "dependencies": [ - "openssl" - ] - }, - "python": { - "$supports": "!(windows & (static | mingw))", - "description": "build the PL/Python server programming language", - "dependencies": [ - { - "name": "libpq", - "default-features": false, - "features": [ - "client" - ] - }, - "python3" - ] - }, - "readline": { - "description": "Use readline", - "supports": "!windows, mingw", - "dependencies": [ - "readline" - ] - }, - "tcl": { - "$supports": "!(windows & (static | mingw))", - "description": "build the PL/Tcl procedural language", - "supports": "windows & !mingw", - "dependencies": [ - { - "name": "libpq", - "default-features": false, - "features": [ - "client" - ] - }, - "tcl" - ] - }, - "xml": { - "description": "Build with libxml", - "dependencies": [ - { - "name": "libxml2", - "default-features": false - } - ] - }, - "xslt": { - "description": "Build with libxslt", - "dependencies": [ - { - "name": "libpq", - "default-features": false, - "features": [ - "xml" - ] - }, - "libxslt" - ] - }, - "zlib": { - "description": "Use zlib", - "dependencies": [ - "zlib" - ] - }, - "zstd": { - "description": "Use zstd", - "dependencies": [ - "zstd" - ] - } - } -} diff --git a/vcpkg-overlay/ports/libpq/windows/macro-def.patch b/vcpkg-overlay/ports/libpq/windows/macro-def.patch deleted file mode 100644 index 1d16c127..00000000 --- a/vcpkg-overlay/ports/libpq/windows/macro-def.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/include/common/checksum_helper.h b/src/include/common/checksum_helper.h -index cac7570ea..d0ca1243c 100644 ---- a/src/include/common/checksum_helper.h -+++ b/src/include/common/checksum_helper.h -@@ -33,7 +28,13 @@ - */ - typedef enum pg_checksum_type - { -+#pragma push_macro("CHECKSUM_TYPE_NONE") -+#ifdef CHECKSUM_TYPE_NONE -+// winioctl.h defines CHECKSUM_TYPE_NONE to 0 as a macro. -+#undef CHECKSUM_TYPE_NONE -+#endif - CHECKSUM_TYPE_NONE, -+#pragma pop_macro("CHECKSUM_TYPE_NONE") - CHECKSUM_TYPE_CRC32C, - CHECKSUM_TYPE_SHA224, - CHECKSUM_TYPE_SHA256, diff --git a/vcpkg-overlay/ports/libpq/windows/msbuild.patch b/vcpkg-overlay/ports/libpq/windows/msbuild.patch deleted file mode 100644 index ce243a32..00000000 --- a/vcpkg-overlay/ports/libpq/windows/msbuild.patch +++ /dev/null @@ -1,428 +0,0 @@ -diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm -index 8de79c6..3bc677d 100644 ---- a/src/tools/msvc/Install.pm -+++ b/src/tools/msvc/Install.pm -@@ -53,6 +53,11 @@ sub Install - my $target = shift; - $insttype = shift; - $insttype = "all" unless ($insttype); -+ if ($insttype eq 'core') -+ { -+ $insttype = 'client'; -+ @client_program_files = ( 'libecpg','libecpg_compat', 'libpgtypes', 'libpq' ); -+ } - - # if called from vcregress, the config will be passed to us - # so no need to re-include these -@@ -89,7 +94,7 @@ sub Install - my $majorver = DetermineMajorVersion(); - print "Installing version $majorver for $conf in $target\n"; - -- my @client_dirs = ('bin', 'lib', 'share', 'symbols'); -+ my @client_dirs = ('bin', 'lib', 'share', 'tools', 'share/libpq', 'tools/libpq'); - my @all_dirs = ( - @client_dirs, 'doc', 'doc/contrib', 'doc/extension', 'share/contrib', - 'share/extension', 'share/timezonesets', 'share/tsearch_data'); -@@ -117,11 +122,11 @@ sub Install - } - }, - @top_dir); -- CopySetOfFiles('config files', $sample_files, $target . '/share/'); -+ CopySetOfFiles('config files', $sample_files, $target . '/share/libpq/'); - CopyFiles( - 'Import libraries', - $target . '/lib/', -- "$conf\\", "postgres\\postgres.lib", "libpgcommon\\libpgcommon.lib", -+ "$conf\\", "libpgcommon\\libpgcommon.lib", - "libpgport\\libpgport.lib"); - CopyContribFiles($config, $target); - CopyIncludeFiles($target); -@@ -293,7 +298,16 @@ sub CopySolutionOutput - { - if ($1 == 1) - { -- push(@{ $install_list{'bin'} }, "exe"); -+ push(@{ $install_list{'tools\\libpq'} }, "exe"); -+ } -+ elsif ($1 == 2) -+ { -+ push(@{ $install_list{'bin'} }, "dll"); -+ push(@{ $install_list{'lib'} }, "lib") if $is_sharedlib; # not for plugins -+ } -+ elsif ($is_sharedlib) # forced to static lib by vcpkg triplet -+ { -+ push(@{ $install_list{'lib'} }, "lib"); - } - elsif ($1 == 2) - { -@@ -317,7 +331,16 @@ sub CopySolutionOutput - { - if ($1 eq 'Application') - { -- push(@{ $install_list{'bin'} }, "exe"); -+ push(@{ $install_list{'tools\\libpq'} }, "exe"); -+ } -+ elsif ($1 eq 'DynamicLibrary') -+ { -+ push(@{ $install_list{'bin'} }, "dll"); -+ push(@{ $install_list{'lib'} }, "lib") if $is_sharedlib; # not for plugins -+ } -+ elsif ($is_sharedlib) # forced to static lib by vcpkg triplet -+ { -+ push(@{ $install_list{'lib'} }, "lib"); - } - elsif ($1 eq 'DynamicLibrary') - { -@@ -350,7 +373,8 @@ sub CopySolutionOutput - || croak "Could not copy $pf.$ext\n"; - } - } -- lcopy("$conf\\$pf\\$pf.pdb", "$target\\symbols\\$pf.pdb") -+ $1 ne 'DynamicLibrary' || -+ lcopy("$conf\\$pf\\$pf.pdb", "$target\\bin\\$pf.pdb") - || croak "Could not copy $pf.pdb\n"; - print "."; - } -@@ -482,7 +506,7 @@ sub CopySubdirFiles - foreach my $f (split /\s+/, $flist) - { - lcopy("$subdir/$module/$f.control", -- "$target/share/extension/$f.control") -+ "$target/share/libpq/extension/$f.control") - || croak("Could not copy file $f.control in contrib $module"); - print '.'; - } -@@ -500,7 +524,7 @@ sub CopySubdirFiles - foreach my $f (split /\s+/, $flist) - { - lcopy("$subdir/$module/$f", -- "$target/share/$moduledir/" . basename($f)) -+ "$target/share/libpq/$moduledir/" . basename($f)) - || croak("Could not copy file $f in contrib $module"); - print '.'; - } -@@ -515,7 +539,7 @@ sub CopySubdirFiles - foreach my $f (split /\s+/, $flist) - { - lcopy("$subdir/$module/$f", -- "$target/share/tsearch_data/" . basename($f)) -+ "$target/share/libpq/tsearch_data/" . basename($f)) - || croak("Could not copy file $f in $subdir $module"); - print '.'; - } -@@ -578,7 +602,7 @@ sub CopySubdirFiles - if ($module eq 'spi'); - foreach my $f (split /\s+/, $flist) - { -- lcopy("$subdir/$module/$f", "$target/doc/$moduledir/$f") -+ lcopy("$subdir/$module/$f", "$target/share/libpq/doc/$moduledir/$f") - || croak("Could not copy file $f in contrib $module"); - print '.'; - } -@@ -708,7 +732,7 @@ sub GenerateNLSFiles - my $majorver = shift; - - print "Installing NLS files..."; -- EnsureDirectories($target, "share/locale"); -+ EnsureDirectories($target, "share/libpq/locale"); - my @flist; - File::Find::find( - { -@@ -730,12 +754,12 @@ sub GenerateNLSFiles - next unless /([^\/]+)\.po/; - $lang = $1; - -- EnsureDirectories($target, "share/locale/$lang", -- "share/locale/$lang/LC_MESSAGES"); -+ EnsureDirectories($target, "share/libpq/locale/$lang", -+ "share/libpq/locale/$lang/LC_MESSAGES"); - my @args = ( -- "$nlspath\\bin\\msgfmt", -+ "msgfmt", - '-o', -- "$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo", -+ "$target\\share\\libpq\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo", - $_); - system(@args) && croak("Could not run msgfmt on $dir\\$_"); - print "."; -diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm -index f24d9e5..356cc31 100644 ---- a/src/tools/msvc/MSBuildProject.pm -+++ b/src/tools/msvc/MSBuildProject.pm -@@ -81,13 +81,14 @@ EOF - - EOF - -+ my $maybe_dll = $self->{solution}->{options}->{VCPKG_CRT_LINKAGE} eq 'dynamic' ? "DLL" : ''; - $self->WriteItemDefinitionGroup( - $f, 'Debug', - { - defs => "_DEBUG;DEBUG=1", - opt => 'Disabled', - strpool => 'false', -- runtime => 'MultiThreadedDebugDLL' -+ runtime => 'MultiThreadedDebug' . $maybe_dll - }); - $self->WriteItemDefinitionGroup( - $f, -@@ -96,7 +97,7 @@ EOF - defs => "", - opt => 'Full', - strpool => 'true', -- runtime => 'MultiThreadedDLL' -+ runtime => 'MultiThreaded' . $maybe_dll - }); - return; - } -@@ -266,6 +267,8 @@ sub WriteConfigurationPropertyGroup - ($self->{type} eq "exe") - ? 'Application' - : ($self->{type} eq "dll" ? 'DynamicLibrary' : 'StaticLibrary'); -+ if ($self->{solution}->{options}->{VCPKG_LIBRARY_LINKAGE} eq 'static') -+ { $cfgtype =~ s/DynamicLibrary/StaticLibrary/; } - - print $f < -@@ -311,7 +314,9 @@ sub WriteItemDefinitionGroup - my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';'); - - my $targetmachine = -- $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64'; -+ 'Machine' . uc($self->{platform}); -+ $targetmachine =~ s/WIN32/X86/; -+ my $randomizebase = ($self->{platform} =~ /^ARM/) ? 'true' : 'false'; - - my $includes = join ';', @{ $self->{includes} }, ""; - -@@ -347,7 +352,7 @@ sub WriteItemDefinitionGroup - .\\$cfgname\\$self->{name}\\$self->{name}.pdb - false - .\\$cfgname\\$self->{name}\\$self->{name}.map -- false -+ $randomizebase - - - Console -diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm -index ef0a33c..dd68424 100644 ---- a/src/tools/msvc/Mkvcbuild.pm -+++ b/src/tools/msvc/Mkvcbuild.pm -@@ -114,8 +114,10 @@ sub mkvcbuild - - if ($vsVersion >= '9.00') - { -+ if ($solution->{platform} !~ /^ARM/) { - push(@pgportfiles, 'pg_crc32c_sse42_choose.c'); - push(@pgportfiles, 'pg_crc32c_sse42.c'); -+ } - push(@pgportfiles, 'pg_crc32c_sb8.c'); - } - else -@@ -196,6 +198,7 @@ sub mkvcbuild - 'syncrep_gram.y'); - $postgres->AddFiles('src/backend/utils/adt', 'jsonpath_scan.l', - 'jsonpath_gram.y'); -+ ($config->{VCPKG_LIBRARY_LINKAGE} eq 'dynamic') && - $postgres->AddDefine('BUILDING_DLL'); - $postgres->AddLibrary('secur32.lib'); - $postgres->AddLibrary('ws2_32.lib'); -@@ -240,12 +243,13 @@ sub mkvcbuild - $pltcl->AddIncludeDir($solution->{options}->{tcl} . '/include'); - $pltcl->AddReference($postgres); - -- for my $tclver (qw(86t 86 85 84)) -+ my $v = $solution->{options}->{tcl_version}; -+ for my $tclver ( ("${v}","${v}s","${v}sx") ) - { - my $tcllib = $solution->{options}->{tcl} . "/lib/tcl$tclver.lib"; - if (-e $tcllib) - { -- $pltcl->AddLibrary($tcllib); -+ $pltcl->AddLibrary("\$(VcpkgTcl${tclver}Libs)"); - $found = 1; - last; - } -@@ -500,8 +504,7 @@ sub mkvcbuild - . "print(str(sys.version_info[0])+str(sys.version_info[1]))"; - my $prefixcmd = - qq("$solution->{options}->{python}\\python" -c "$pythonprog"); -- my $pyout = `$prefixcmd`; -- die "Could not query for python version!\n" if $?; -+ my $pyout = "$solution->{options}->{python}\n$solution->{options}->{python_version}"; - my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); - - # Sometimes (always?) if python is not present, the execution -@@ -517,8 +520,8 @@ sub mkvcbuild - - my $plpython = $solution->AddProject('plpython' . $pymajorver, - 'dll', 'PLs', 'src/pl/plpython'); -- $plpython->AddIncludeDir($pyprefix . '/include'); -- $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib"); -+ $plpython->AddIncludeDir($pyprefix . "/include/python$pyver"); -+ $plpython->AddLibrary('$(VcpkgPythonLibs)'); - $plpython->AddReference($postgres); - - # Add transform modules dependent on plpython -diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm -index 570bab5..2d51abe 100644 ---- a/src/tools/msvc/Project.pm -+++ b/src/tools/msvc/Project.pm -@@ -167,6 +167,11 @@ sub AddReference - } - $self->AddLibrary( - "__CFGNAME__/" . $ref->{name} . "/" . $ref->{name} . ".lib"); -+ -+ if ($self->{solution}->{options}->{VCPKG_LIBRARY_LINKAGE} eq 'static') -+ { -+ map { $self->AddLibrary($_) } @{ $ref->{libraries} }; -+ } - } - return; - } -diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm -index d30e8fc..231275b 100644 ---- a/src/tools/msvc/Solution.pm -+++ b/src/tools/msvc/Solution.pm -@@ -63,6 +63,11 @@ sub DeterminePlatform - my $self = shift; - - if ($^O eq "MSWin32") -+ { -+ $self->{platform} = uc($self->{options}->{VCPKG_TARGET_ARCHITECTURE}); -+ $self->{platform} =~ s/^X86$/Win32/; -+ } -+ elsif (0) - { - # Examine CL help output to determine if we are in 32 or 64-bit mode. - my $output = `cl /help 2>&1`; -@@ -124,6 +129,9 @@ sub copyFile - sub GetOpenSSLVersion - { - my $self = shift; -+ if ($self->{options}->{openssl_version} =~ /(\d+)\.(\d+)\.(\d+)/m) { -+ return ($1, $2, $3); -+ } - - # Attempt to get OpenSSL version and location. This assumes that - # openssl.exe is in the specified directory. -@@ -148,7 +156,7 @@ sub GetOpenSSLVersion - sub GenerateFiles - { - my $self = shift; -- my $bits = $self->{platform} eq 'Win32' ? 32 : 64; -+ my $bits = $self->{platform} =~ /64/ ? 64 : 32; - my $ac_init_found = 0; - my $package_name; - my $package_version; -@@ -502,7 +510,7 @@ sub GenerateFiles - USE_PAM => undef, - USE_SLICING_BY_8_CRC32C => undef, - USE_SSE42_CRC32C => undef, -- USE_SSE42_CRC32C_WITH_RUNTIME_CHECK => 1, -+ USE_SSE42_CRC32C_WITH_RUNTIME_CHECK => $self->{platform} =~ /^ARM/ ? undef : 1, - USE_SYSTEMD => undef, - USE_SYSV_SEMAPHORES => undef, - USE_SYSV_SHARED_MEMORY => undef, -@@ -760,14 +768,14 @@ sub GenerateFiles - || confess "Could not open pg_config_paths.h"; - print $o <{options}->{zlib}) - { - $proj->AddIncludeDir($self->{options}->{zlib} . '\include'); -- $proj->AddLibrary($self->{options}->{zlib} . '\lib\zdll.lib'); -+ $proj->AddLibrary('$(VcpkgZlibLibs)'); - } - if ($self->{options}->{openssl}) - { - $proj->AddIncludeDir($self->{options}->{openssl} . '\include'); -+ $proj->AddLibrary('$(VcpkgOpensslLibs)'); -+ } -+ elsif (0) -+ { - my ($digit1, $digit2, $digit3) = $self->GetOpenSSLVersion(); - - # Starting at version 1.1.0 the OpenSSL installers have -@@ -1027,7 +1039,7 @@ sub AddProject - if ($self->{options}->{nls}) - { - $proj->AddIncludeDir($self->{options}->{nls} . '\include'); -- $proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib'); -+ $proj->AddLibrary('$(VcpkgNlsLibs)'); - } - if ($self->{options}->{gss}) - { -@@ -1060,6 +1072,10 @@ sub AddProject - if ($self->{options}->{icu}) - { - $proj->AddIncludeDir($self->{options}->{icu} . '\include'); -+ $proj->AddLibrary('$(VcpkgIcuLibs)'); -+ } -+ elsif (0) -+ { - if ($self->{platform} eq 'Win32') - { - $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); -@@ -1077,22 +1093,22 @@ sub AddProject - { - $proj->AddIncludeDir($self->{options}->{xml} . '\include'); - $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); -- $proj->AddLibrary($self->{options}->{xml} . '\lib\libxml2.lib'); -+ $proj->AddLibrary('$(VcpkgXmlLibs)'); - } - if ($self->{options}->{xslt}) - { - $proj->AddIncludeDir($self->{options}->{xslt} . '\include'); -- $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); -+ $proj->AddLibrary('$(VcpkgXsltLibs)'); - } - if ($self->{options}->{lz4}) - { - $proj->AddIncludeDir($self->{options}->{lz4} . '\include'); -- $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib'); -+ $proj->AddLibrary('$(VcpkgLz4Libs)'); - } - if ($self->{options}->{zstd}) - { - $proj->AddIncludeDir($self->{options}->{zstd} . '\include'); -- $proj->AddLibrary($self->{options}->{zstd} . '\lib\libzstd.lib'); -+ $proj->AddLibrary('$(VcpkgZstdLibs)'); - } - if ($self->{options}->{uuid}) - { -diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl -index b8c514a..1fb7619 100644 ---- a/src/tools/msvc/gendef.pl -+++ b/src/tools/msvc/gendef.pl -@@ -122,7 +122,7 @@ sub writedef - - # Strip the leading underscore for win32, but not x64 - $f =~ s/^_// -- unless ($platform eq "x64"); -+ if ($platform eq "Win32"); - - # Emit just the name if it's a function symbol, or emit the name - # decorated with the DATA option for variables. -@@ -150,7 +150,7 @@ sub usage - usage() - unless scalar(@ARGV) == 2 - && ( ($ARGV[0] =~ /\\([^\\]+$)/) -- && ($ARGV[1] eq 'Win32' || $ARGV[1] eq 'x64')); -+ && ($ARGV[1] ne '')); - my $defname = uc $1; - my $deffile = "$ARGV[0]/$defname.def"; - my $platform = $ARGV[1]; diff --git a/vcpkg-overlay/ports/libpq/windows/python_lib.patch b/vcpkg-overlay/ports/libpq/windows/python_lib.patch deleted file mode 100644 index cd012329..00000000 --- a/vcpkg-overlay/ports/libpq/windows/python_lib.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/pl/plpython/plpython.h b/src/pl/plpython/plpython.h -index 3a1f0d56d..6a8a09a20 100644 ---- a/src/pl/plpython/plpython.h -+++ b/src/pl/plpython/plpython.h -@@ -45,12 +45,10 @@ - #if defined(_MSC_VER) && defined(_DEBUG) - /* Python uses #pragma to bring in a non-default libpython on VC++ if - * _DEBUG is defined */ --#undef _DEBUG - /* Also hide away errcode, since we load Python.h before postgres.h */ - #define errcode __msvc_errcode - #include - #undef errcode --#define _DEBUG - #elif defined (_MSC_VER) - #define errcode __msvc_errcode - #include diff --git a/vcpkg-overlay/ports/libpq/windows/spin_delay.patch b/vcpkg-overlay/ports/libpq/windows/spin_delay.patch deleted file mode 100644 index 163e8e6e..00000000 --- a/vcpkg-overlay/ports/libpq/windows/spin_delay.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h -index 4d3ffc7..658b1a1 100644 ---- a/src/include/storage/s_lock.h -+++ b/src/include/storage/s_lock.h -@@ -953,12 +953,18 @@ typedef LONG slock_t; - /* If using Visual C++ on Win64, inline assembly is unavailable. - * Use a _mm_pause intrinsic instead of rep nop. - */ --#if defined(_WIN64) -+#if defined(_M_X64) && !defined(_M_ARM64EC) - static __forceinline void - spin_delay(void) - { - _mm_pause(); - } -+#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) -+static __forceinline void -+spin_delay(void) -+{ -+ __yield(); -+} - #else - static __forceinline void - spin_delay(void) diff --git a/vcpkg-overlay/ports/libpq/windows/win_bison_flex.patch b/vcpkg-overlay/ports/libpq/windows/win_bison_flex.patch deleted file mode 100644 index 645d53af..00000000 --- a/vcpkg-overlay/ports/libpq/windows/win_bison_flex.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/tools/msvc/pgflex.pl b/src/tools/msvc/pgflex.pl -index aceed5ffd..f6ed215e8 100644 ---- a/src/tools/msvc/pgflex.pl -+++ b/src/tools/msvc/pgflex.pl -@@ -16,7 +16,7 @@ $ENV{CYGWIN} = 'nodosfilewarning'; - - do './src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; - --my ($flexver) = `flex -V`; # grab first line -+my ($flexver) = `win_flex -V`; # grab first line - $flexver = (split(/\s+/, $flexver))[1]; - $flexver =~ s/[^0-9.]//g; - my @verparts = split(/\./, $flexver); -@@ -52,7 +52,7 @@ close($mf); - my $basetarg = basename($output); - my $flexflags = ($make =~ /^$basetarg:\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : ''); - --system("flex $flexflags -o$output $input"); -+system("win_flex $flexflags -o$output $input"); - if ($? == 0) - { - -diff --git a/src/tools/msvc/pgbison.pl b/src/tools/msvc/pgbison.pl -index 895e398c0..f5b524a5d 100644 ---- a/src/tools/msvc/pgbison.pl -+++ b/src/tools/msvc/pgbison.pl -@@ -13,7 +13,7 @@ use File::Basename; - - do './src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; - --my ($bisonver) = `bison -V`; # grab first line -+my ($bisonver) = `win_bison -V`; # grab first line - $bisonver = (split(/\s+/, $bisonver))[3]; # grab version number - - unless ($bisonver eq '1.875' || $bisonver ge '2.2') -@@ -51,5 +51,5 @@ close($mf); - - my $nodep = $bisonver ge '3.0' ? "-Wno-deprecated" : ""; - --system("bison $nodep $headerflag $input -o $output"); -+system("win_bison $nodep $headerflag $input -o $output"); - exit $? >> 8; - diff --git a/vcpkg-overlay/ports/libtasn1/portfile.cmake b/vcpkg-overlay/ports/libtasn1/portfile.cmake new file mode 100644 index 00000000..ce464c76 --- /dev/null +++ b/vcpkg-overlay/ports/libtasn1/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_download_distfile(ARCHIVE + https://ftp.gnu.org/pub/gnu/libtasn1/libtasn1-${VERSION_libtasn1}.tar.gz + + URLS "https://ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz" + "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz" + FILENAME "libtasn1-${VERSION}.tar.gz" + SHA512 287f5eddfb5e21762d9f14d11997e56b953b980b2b03a97ed4cd6d37909bda1ed7d2cdff9da5d270a21d863ab7e54be6b85c05f1075ac5d8f0198997cf335ef4 +) +vcpkg_extract_source_archive(SOURCE_PATH + ARCHIVE "${ARCHIVE}" + SOURCE_BASE "v${VERSION}" +) + +string(APPEND VCPKG_C_FLAGS " -Wno-implicit-function-declaration") +string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration") + +vcpkg_list(SET OPTIONS) +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + DETERMINE_BUILD_TRIPLET + USE_WRAPPERS + OPTIONS + --enable-extra-encodings + --disable-doc + --disable-valgrind-tests + --disable-gcc-warnings + --disable-silent-rules + ${OPTIONS} +) +vcpkg_install_make() + diff --git a/vcpkg-overlay/ports/libtasn1/vcpkg.json b/vcpkg-overlay/ports/libtasn1/vcpkg.json new file mode 100644 index 00000000..7950a5cc --- /dev/null +++ b/vcpkg-overlay/ports/libtasn1/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "libtasn1", + "version": "4.19.0", + "port-version": 0, + "description": "GNU Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER) manipulation", + "homepage": "https://www.gnu.org/software/libtasn1/", + "license": null +} diff --git a/vcpkg-overlay/ports/openssl/disable-apps.patch b/vcpkg-overlay/ports/openssl/disable-apps.patch deleted file mode 100644 index 8dac3d68..00000000 --- a/vcpkg-overlay/ports/openssl/disable-apps.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Configure b/Configure -index 5ac4b52..ad638e8 100755 ---- a/Configure -+++ b/Configure -@@ -401,6 +401,7 @@ my @dtls = qw(dtls1 dtls1_2); - my @disablables = ( - "acvp-tests", - "afalgeng", -+ "apps", - "aria", - "asan", - "asm", diff --git a/vcpkg-overlay/ports/openssl/disable-install-docs.patch b/vcpkg-overlay/ports/openssl/disable-install-docs.patch deleted file mode 100644 index 6e39790c..00000000 --- a/vcpkg-overlay/ports/openssl/disable-install-docs.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 110ba06..5b6b1c7 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -611,7 +611,7 @@ install_sw: install_dev install_engines install_modules install_runtime - - uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev - --install_docs: install_man_docs install_html_docs -+install_docs: - - uninstall_docs: uninstall_man_docs uninstall_html_docs - $(RM) -r $(DESTDIR)$(DOCDIR) -diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl -index d054431..b5c1c88 100644 ---- a/Configurations/windows-makefile.tmpl -+++ b/Configurations/windows-makefile.tmpl -@@ -487,7 +487,7 @@ install_sw: install_dev install_engines install_modules install_runtime - - uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev - --install_docs: install_html_docs -+install_docs: - - uninstall_docs: uninstall_html_docs - diff --git a/vcpkg-overlay/ports/openssl/install-pc-files.cmake b/vcpkg-overlay/ports/openssl/install-pc-files.cmake deleted file mode 100644 index 04897fae..00000000 --- a/vcpkg-overlay/ports/openssl/install-pc-files.cmake +++ /dev/null @@ -1,32 +0,0 @@ -function(install_pc_file name pc_data) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY) - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY) - endif() -endfunction() - -install_pc_file(openssl [[ -Name: OpenSSL -Description: Secure Sockets Layer and cryptography libraries and tools -Requires: libssl libcrypto -]]) - -install_pc_file(libssl [[ -Name: OpenSSL-libssl -Description: Secure Sockets Layer and cryptography libraries -Libs: -L"${libdir}" -llibssl -Requires: libcrypto -Cflags: -I"${includedir}" -]]) - -install_pc_file(libcrypto [[ -Name: OpenSSL-libcrypto -Description: OpenSSL cryptography library -Libs: -L"${libdir}" -llibcrypto -Libs.private: -lcrypt32 -lws2_32 -ladvapi32 -luser32 -Cflags: -I"${includedir}" -]]) - -vcpkg_fixup_pkgconfig() diff --git a/vcpkg-overlay/ports/openssl/openssl.pc.in b/vcpkg-overlay/ports/openssl/openssl.pc.in deleted file mode 100644 index f7fa9d18..00000000 --- a/vcpkg-overlay/ports/openssl/openssl.pc.in +++ /dev/null @@ -1,6 +0,0 @@ -prefix=${pcfiledir}/../.. -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include -Version: @VERSION@ -@pc_data@ diff --git a/vcpkg-overlay/ports/openssl/portfile.cmake b/vcpkg-overlay/ports/openssl/portfile.cmake deleted file mode 100644 index 17e94cbe..00000000 --- a/vcpkg-overlay/ports/openssl/portfile.cmake +++ /dev/null @@ -1,75 +0,0 @@ -if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright" - OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright") - message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.") -endif() - -if(VCPKG_TARGET_IS_EMSCRIPTEN) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -endif() - -if (NOT "${VERSION}" MATCHES [[^([0-9]+)\.([0-9]+)\.([0-9]+)$]]) - message(FATAL_ERROR "Version regex did not match.") -endif() -set(OPENSSL_VERSION_MAJOR "${CMAKE_MATCH_1}") -set(OPENSSL_VERSION_MINOR "${CMAKE_MATCH_2}") -set(OPENSSL_VERSION_FIX "${CMAKE_MATCH_3}") -configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO openssl/openssl - REF "openssl-${VERSION}" - SHA512 7073fd82ce17a63d77babb6a184c14c7341e4b1f8f5a6caeaa1a6d9c78d6a12bb6d9cbad5d39d16412be6d1c12eac60364644664a8e26e3940476973ba07fd19 - PATCHES - disable-apps.patch - disable-install-docs.patch - script-prefix.patch - windows/install-layout.patch - windows/install-pdbs.patch - unix/android-cc.patch - unix/move-openssldir.patch - unix/no-empty-dirs.patch - unix/no-static-libs-for-shared.patch -) - -vcpkg_list(SET CONFIGURE_OPTIONS - enable-static-engine - enable-capieng - no-ssl3 - no-weak-ssl-ciphers - no-tests -) - -set(INSTALL_FIPS "") -if("fips" IN_LIST FEATURES) - vcpkg_list(APPEND INSTALL_FIPS install_fips) - vcpkg_list(APPEND CONFIGURE_OPTIONS enable-fips) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_list(APPEND CONFIGURE_OPTIONS shared) -else() - vcpkg_list(APPEND CONFIGURE_OPTIONS no-shared no-module) -endif() - -if(NOT "tools" IN_LIST FEATURES) - vcpkg_list(APPEND CONFIGURE_OPTIONS no-apps) -endif() - -if(DEFINED OPENSSL_USE_NOPINSHARED) - vcpkg_list(APPEND CONFIGURE_OPTIONS no-pinshared) -endif() - -if(OPENSSL_NO_AUTOLOAD_CONFIG) - vcpkg_list(APPEND CONFIGURE_OPTIONS no-autoload-config) -endif() - -if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") -else() - include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake") -endif() - -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg-overlay/ports/openssl/script-prefix.patch b/vcpkg-overlay/ports/openssl/script-prefix.patch deleted file mode 100644 index 70f0859c..00000000 --- a/vcpkg-overlay/ports/openssl/script-prefix.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/c_rehash.in b/tools/c_rehash.in -index 343cdc1..e48038e 100644 ---- a/tools/c_rehash.in -+++ b/tools/c_rehash.in -@@ -12,7 +12,7 @@ - # and add symbolic links to their hash values. - - my $dir = {- quotify1($config{openssldir}) -}; --my $prefix = {- quotify1($config{prefix}) -}; -+use FindBin; - - my $errorcount = 0; - my $openssl = $ENV{OPENSSL} || "openssl"; -@@ -61,7 +61,7 @@ if (defined(&Cwd::getcwd)) { - - # DOS/Win32 or Unix delimiter? Prefix our installdir, then search. - my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; --$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); -+$ENV{PATH} = "$FindBin::Bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); - - if (! -x $openssl) { - my $found = 0; diff --git a/vcpkg-overlay/ports/openssl/unix/android-cc.patch b/vcpkg-overlay/ports/openssl/unix/android-cc.patch deleted file mode 100644 index f4c3d683..00000000 --- a/vcpkg-overlay/ports/openssl/unix/android-cc.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf -index 41ad922..d15e34c 100644 ---- a/Configurations/15-android.conf -+++ b/Configurations/15-android.conf -@@ -102,6 +102,7 @@ - my $cflags; - my $cppflags; - -+if (0) { - # see if there is NDK clang on $PATH, "universal" or "standalone" - if (which("clang") =~ m|^$ndk/.*/prebuilt/([^/]+)/|) { - my $host=$1; -@@ -158,6 +159,7 @@ - $sysroot =~ s|^$ndk/||; - $sysroot = " --sysroot=\$($ndk_var)/$sysroot"; - } -+} - $android_ndk = { - cflags => $cflags . $sysroot, - cppflags => $cppflags, diff --git a/vcpkg-overlay/ports/openssl/unix/configure b/vcpkg-overlay/ports/openssl/unix/configure deleted file mode 100755 index 2d49b3d1..00000000 --- a/vcpkg-overlay/ports/openssl/unix/configure +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -e - -declare -a OUT_OPTIONS - -INTERPRETER=perl - -LAST_SEEN= -COPY_OPTIONS=no -for OPTION; do - case "${OPTION},${COPY_OPTIONS}" in - */Configure,no) - OUT_OPTIONS+=("${OPTION}") - INTERPRETER="${LAST_SEEN}" - COPY_OPTIONS=yes - ;; - --prefix=*|--openssldir=*|--libdir=*|--cross-compile-prefix=*|--debug,*) - OUT_OPTIONS+=("${OPTION}") - ;; - -*|*=*) - ;; - *,yes) - OUT_OPTIONS+=("${OPTION}") - ;; - esac - LAST_SEEN="${OPTION}" -done - -set -x -"${INTERPRETER}" ${OUT_OPTIONS[@]} diff --git a/vcpkg-overlay/ports/openssl/unix/move-openssldir.patch b/vcpkg-overlay/ports/openssl/unix/move-openssldir.patch deleted file mode 100644 index 44e0183e..00000000 --- a/vcpkg-overlay/ports/openssl/unix/move-openssldir.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index dd96254..c4458ca 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -689,6 +689,10 @@ install_ssldirs: - cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \ - chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \ - fi -+ $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)$(OPENSSLDIR) -+ for I in $(DESTDIR)$(OPENSSLDIR)/*; do \ -+ mv $$I $(DESTDIR)$(INSTALLTOP)$(OPENSSLDIR)/; \ -+ done - - install_dev: install_runtime_libs - @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) diff --git a/vcpkg-overlay/ports/openssl/unix/no-empty-dirs.patch b/vcpkg-overlay/ports/openssl/unix/no-empty-dirs.patch deleted file mode 100644 index 4c59d9ea..00000000 --- a/vcpkg-overlay/ports/openssl/unix/no-empty-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 5b6b1c7..4c8c916 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -818,7 +818,7 @@ _install_modules_deps: install_runtime_libs build_modules - - install_engines: _install_modules_deps - @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) -- @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/ -+ @[ -z "$(INSTALL_ENGINES)" ] || $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/ - @$(ECHO) "*** Installing engines" - @set -e; for e in dummy $(INSTALL_ENGINES); do \ - if [ "$$e" = "dummy" ]; then continue; fi; \ -@@ -842,7 +842,7 @@ uninstall_engines: - - install_modules: _install_modules_deps - @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) -- @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/ -+ @[ -z "$(INSTALL_MODULES)" ] || $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/ - @$(ECHO) "*** Installing modules" - @set -e; for e in dummy $(INSTALL_MODULES); do \ - if [ "$$e" = "dummy" ]; then continue; fi; \ diff --git a/vcpkg-overlay/ports/openssl/unix/no-static-libs-for-shared.patch b/vcpkg-overlay/ports/openssl/unix/no-static-libs-for-shared.patch deleted file mode 100644 index 868e682a..00000000 --- a/vcpkg-overlay/ports/openssl/unix/no-static-libs-for-shared.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 4c8c916..dd96254 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -708,6 +708,7 @@ install_dev: install_runtime_libs - done - @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir) - @set -e; for l in $(INSTALL_LIBS); do \ -+ if [ -n "$(INSTALL_SHLIBS)" ] ; then continue ; fi ; \ - fn=`basename $$l`; \ - $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \ - cp $$l $(DESTDIR)$(libdir)/$$fn.new; \ diff --git a/vcpkg-overlay/ports/openssl/unix/portfile.cmake b/vcpkg-overlay/ports/openssl/unix/portfile.cmake deleted file mode 100644 index 9eff266e..00000000 --- a/vcpkg-overlay/ports/openssl/unix/portfile.cmake +++ /dev/null @@ -1,153 +0,0 @@ -if (VCPKG_TARGET_IS_LINUX) - message(NOTICE [[ -openssl requires Linux kernel headers from the system package manager. - They can be installed on Alpine systems via `apk add linux-headers`. - They can be installed on Ubuntu systems via `apt install linux-libc-dev`. -]]) -endif() - -if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES make perl) - set(MAKE "${MSYS_ROOT}/usr/bin/make.exe") - set(PERL "${MSYS_ROOT}/usr/bin/perl.exe") -else() - find_program(MAKE make) - if(NOT MAKE) - message(FATAL_ERROR "Could not find make. Please install it through your package manager.") - endif() - vcpkg_find_acquire_program(PERL) -endif() -set(INTERPRETER "${PERL}") - -execute_process( - COMMAND "${PERL}" -e "use IPC::Cmd;" - RESULT_VARIABLE perl_ipc_cmd_result -) -if(NOT perl_ipc_cmd_result STREQUAL "0") - message(FATAL_ERROR "\nPerl cannot find IPC::Cmd. Please install it through your system package manager.\n") -endif() - -# Ideally, OpenSSL should use `CC` from vcpkg as is (absolute path). -# But in reality, OpenSSL expects to locate the compiler via `PATH`, -# and it makes its own choices e.g. for Android. -vcpkg_cmake_get_vars(cmake_vars_file) -include("${cmake_vars_file}") -cmake_path(GET VCPKG_DETECTED_CMAKE_C_COMPILER PARENT_PATH compiler_path) -cmake_path(GET VCPKG_DETECTED_CMAKE_C_COMPILER FILENAME compiler_name) -find_program(compiler_in_path NAMES "${compiler_name}" PATHS ENV PATH NO_DEFAULT_PATH) -if(NOT compiler_in_path) - vcpkg_host_path_list(APPEND ENV{PATH} "${compiler_path}") -elseif(NOT compiler_in_path STREQUAL VCPKG_DETECTED_CMAKE_C_COMPILER) - vcpkg_host_path_list(PREPEND ENV{PATH} "${compiler_path}") -endif() - -vcpkg_list(SET MAKEFILE_OPTIONS) -if(VCPKG_TARGET_IS_ANDROID) - set(ENV{ANDROID_NDK_ROOT} "${VCPKG_DETECTED_CMAKE_ANDROID_NDK}") - set(OPENSSL_ARCH "android-${VCPKG_DETECTED_CMAKE_ANDROID_ARCH}") - if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON) - vcpkg_list(APPEND CONFIGURE_OPTIONS no-asm) - endif() -elseif(VCPKG_TARGET_IS_LINUX) - if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") - set(OPENSSL_ARCH linux-aarch64) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") - set(OPENSSL_ARCH linux-armv4) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64") - set(OPENSSL_ARCH linux-x86_64) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86") - set(OPENSSL_ARCH linux-x86) - else() - set(OPENSSL_ARCH linux-generic32) - endif() -elseif(VCPKG_TARGET_IS_IOS) - if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") - set(OPENSSL_ARCH ios64-xcrun) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") - set(OPENSSL_ARCH ios-xcrun) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" OR VCPKG_TARGET_ARCHITECTURE MATCHES "x64") - set(OPENSSL_ARCH iossimulator-xcrun) - else() - message(FATAL_ERROR "Unknown iOS target architecture: ${VCPKG_TARGET_ARCHITECTURE}") - endif() - # disable that makes linkage error (e.g. require stderr usage) - list(APPEND CONFIGURE_OPTIONS no-ui no-asm) -elseif(VCPKG_TARGET_IS_OSX) - if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") - set(OPENSSL_ARCH darwin64-arm64) - else() - set(OPENSSL_ARCH darwin64-x86_64) - endif() -elseif(VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD) - set(OPENSSL_ARCH BSD-generic64) -elseif(VCPKG_TARGET_IS_MINGW) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(OPENSSL_ARCH mingw64) - else() - set(OPENSSL_ARCH mingw) - endif() -elseif(VCPKG_TARGET_IS_EMSCRIPTEN) - vcpkg_list(APPEND CONFIGURE_OPTIONS - threads - no-engine - no-asm - no-sse2 - no-srtp - --cross-compile-prefix= - ) -else() - message(FATAL_ERROR "Unknown platform") -endif() - -file(MAKE_DIRECTORY "${SOURCE_PATH}/vcpkg") -file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}/vcpkg") -vcpkg_configure_make( - SOURCE_PATH "${SOURCE_PATH}" - PROJECT_SUBPATH "vcpkg" - NO_ADDITIONAL_PATHS - OPTIONS - "${INTERPRETER}" - "${SOURCE_PATH}/Configure" - ${OPENSSL_ARCH} - ${CONFIGURE_OPTIONS} - "--openssldir=/etc/ssl" - "--libdir=lib" - OPTIONS_DEBUG - --debug -) -vcpkg_install_make( - ${MAKEFILE_OPTIONS} - BUILD_TARGET build_sw -) -vcpkg_fixup_pkgconfig() - -if("tools" IN_LIST FEATURES) - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") - file(RENAME "${CURRENT_PACKAGES_DIR}/bin/c_rehash" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/c_rehash") - file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/c_rehash") - vcpkg_copy_tools(TOOL_NAMES openssl AUTO_CLEAN) -elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/etc/ssl/misc") -endif() - -file(TOUCH "${CURRENT_PACKAGES_DIR}/etc/ssl/certs/.keep") -file(TOUCH "${CURRENT_PACKAGES_DIR}/etc/ssl/private/.keep") - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/etc" - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" -) - -# For consistency of mingw build with nmake build -file(GLOB engines "${CURRENT_PACKAGES_DIR}/lib/ossl-modules/*.dll") -if(NOT engines STREQUAL "") - file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/ossl-modules") -endif() -file(GLOB engines "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules/*.dll") -if(NOT engines STREQUAL "") - file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules") -endif() diff --git a/vcpkg-overlay/ports/openssl/unix/remove-deps.cmake b/vcpkg-overlay/ports/openssl/unix/remove-deps.cmake deleted file mode 100644 index a57c70fe..00000000 --- a/vcpkg-overlay/ports/openssl/unix/remove-deps.cmake +++ /dev/null @@ -1,7 +0,0 @@ -file(GLOB_RECURSE MAKEFILES ${DIR}/*/Makefile) -foreach(MAKEFILE ${MAKEFILES}) - message("removing deps from ${MAKEFILE}") - file(READ "${MAKEFILE}" _contents) - string(REGEX REPLACE "\n# DO NOT DELETE THIS LINE.*" "" _contents "${_contents}") - file(WRITE "${MAKEFILE}" "${_contents}") -endforeach() diff --git a/vcpkg-overlay/ports/openssl/usage b/vcpkg-overlay/ports/openssl/usage deleted file mode 100644 index f535cb6a..00000000 --- a/vcpkg-overlay/ports/openssl/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package openssl is compatible with built-in CMake targets: - - find_package(OpenSSL REQUIRED) - target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto) diff --git a/vcpkg-overlay/ports/openssl/vcpkg-cmake-wrapper.cmake.in b/vcpkg-overlay/ports/openssl/vcpkg-cmake-wrapper.cmake.in deleted file mode 100644 index 5008112c..00000000 --- a/vcpkg-overlay/ports/openssl/vcpkg-cmake-wrapper.cmake.in +++ /dev/null @@ -1,82 +0,0 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0012 NEW) -cmake_policy(SET CMP0054 NEW) -cmake_policy(SET CMP0057 NEW) - -set(OPENSSL_VERSION_MAJOR @OPENSSL_VERSION_MAJOR@) -set(OPENSSL_VERSION_MINOR @OPENSSL_VERSION_MINOR@) -set(OPENSSL_VERSION_FIX @OPENSSL_VERSION_FIX@) - -if(OPENSSL_USE_STATIC_LIBS) - if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "dynamic") - message(WARNING "OPENSSL_USE_STATIC_LIBS is set, but vcpkg port openssl was built with dynamic linkage") - endif() - set(OPENSSL_USE_STATIC_LIBS_BAK "${OPENSSL_USE_STATIC_LIBS}") - set(OPENSSL_USE_STATIC_LIBS FALSE) -endif() - -if(DEFINED OPENSSL_ROOT_DIR) - set(OPENSSL_ROOT_DIR_BAK "${OPENSSL_ROOT_DIR}") -endif() -get_filename_component(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) -get_filename_component(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR}" DIRECTORY) -find_path(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATH "${OPENSSL_ROOT_DIR}/include" NO_DEFAULT_PATH) -if(MSVC) - find_library(LIB_EAY_DEBUG NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(LIB_EAY_RELEASE NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) - find_library(SSL_EAY_DEBUG NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(SSL_EAY_RELEASE NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) -elseif(WIN32) - find_library(LIB_EAY NAMES libcrypto crypto NAMES_PER_DIR) - find_library(SSL_EAY NAMES libssl ssl NAMES_PER_DIR) -else() - find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto) - find_library(OPENSSL_SSL_LIBRARY NAMES ssl) -endif() - -_find_package(${ARGS}) - -unset(OPENSSL_ROOT_DIR) -if(DEFINED OPENSSL_ROOT_DIR_BAK) - set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR_BAK}") - unset(OPENSSL_ROOT_DIR_BAK) -endif() - -if(DEFINED OPENSSL_USE_STATIC_LIBS_BAK) - set(OPENSSL_USE_STATIC_LIBS "${OPENSSL_USE_STATIC_LIBS_BAK}") - unset(OPENSSL_USE_STATIC_LIBS_BAK) -endif() - -if(OPENSSL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - if(WIN32) - list(APPEND OPENSSL_LIBRARIES crypt32 ws2_32) - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") - endif() - if(TARGET OpenSSL::SSL) - set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") - endif() - else() - find_library(OPENSSL_DL_LIBRARY NAMES dl) - if(OPENSSL_DL_LIBRARY) - list(APPEND OPENSSL_LIBRARIES "dl") - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl") - endif() - endif() - - if("REQUIRED" IN_LIST ARGS) - find_package(Threads REQUIRED) - else() - find_package(Threads) - endif() - list(APPEND OPENSSL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") - endif() - if(TARGET OpenSSL::SSL) - set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") - endif() - endif() -endif() -cmake_policy(POP) diff --git a/vcpkg-overlay/ports/openssl/vcpkg.json b/vcpkg-overlay/ports/openssl/vcpkg.json deleted file mode 100644 index 7a9bdee5..00000000 --- a/vcpkg-overlay/ports/openssl/vcpkg.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "openssl", - "version": "3.1.1", - "port-version": 0, - "description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.", - "homepage": "https://www.openssl.org", - "license": "Apache-2.0", - "supports": "android", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - }, - { - "name": "vcpkg-cmake-get-vars", - "host": true - } - ] -} diff --git a/vcpkg-overlay/ports/openssl/windows/install-layout.patch b/vcpkg-overlay/ports/openssl/windows/install-layout.patch deleted file mode 100644 index be9df768..00000000 --- a/vcpkg-overlay/ports/openssl/windows/install-layout.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl -index f71f3bf..116954f 100644 ---- a/Configurations/windows-makefile.tmpl -+++ b/Configurations/windows-makefile.tmpl -@@ -223,7 +223,7 @@ MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath); - splitpath($modulesprefix, 1); - our $modulesdir_dev = $modulesprefix_dev; - our $modulesdir_dir = -- catdir($modulesprefix_dir, "ossl-modules"); -+ catdir($modulesprefix_dir, "../bin"); - our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir); - our $enginesdir_dev = $modulesprefix_dev; - our $enginesdir_dir = diff --git a/vcpkg-overlay/ports/openssl/windows/install-pdbs.patch b/vcpkg-overlay/ports/openssl/windows/install-pdbs.patch deleted file mode 100644 index 379c525a..00000000 --- a/vcpkg-overlay/ports/openssl/windows/install-pdbs.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl -index 5946c89..f71f3bf 100644 ---- a/Configurations/windows-makefile.tmpl -+++ b/Configurations/windows-makefile.tmpl -@@ -556,6 +556,7 @@ install_dev: install_runtime_libs - @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)" - @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)" - @if "$(SHLIBS)"=="" \ -+ @if "$(INSTALL_PDBS)"=="ON" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)" - - uninstall_dev: -@@ -569,6 +570,7 @@ install_engines: _install_modules_deps - @if not "$(INSTALL_ENGINES)"=="" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)" - @if not "$(INSTALL_ENGINES)"=="" \ -+ @if "$(INSTALL_PDBS)"=="ON" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)" - - uninstall_engines: -@@ -580,6 +582,7 @@ install_modules: _install_modules_deps - @if not "$(INSTALL_MODULES)"=="" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULES) "$(MODULESDIR)" - @if not "$(INSTALL_MODULES)"=="" \ -+ @if "$(INSTALL_PDBS)"=="ON" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULEPDBS) "$(MODULESDIR)" - - uninstall_modules: -@@ -593,6 +596,7 @@ install_runtime_libs: build_libs - @if not "$(SHLIBS)"=="" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin" - @if not "$(SHLIBS)"=="" \ -+ @if "$(INSTALL_PDBS)"=="ON" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \ - "$(INSTALLTOP)\bin" - -@@ -605,6 +609,7 @@ install_programs: install_runtime_libs build_programs - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \ - "$(INSTALLTOP)\bin" - @if not "$(INSTALL_PROGRAMS)"=="" \ -+ @if "$(INSTALL_PDBS)"=="ON" \ - "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \ - "$(INSTALLTOP)\bin" - @if not "$(INSTALL_PROGRAMS)"=="" \ diff --git a/vcpkg-overlay/ports/openssl/windows/portfile.cmake b/vcpkg-overlay/ports/openssl/windows/portfile.cmake deleted file mode 100644 index c1ce2774..00000000 --- a/vcpkg-overlay/ports/openssl/windows/portfile.cmake +++ /dev/null @@ -1,133 +0,0 @@ -vcpkg_find_acquire_program(NASM) -get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) -vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") - -vcpkg_find_acquire_program(PERL) -get_filename_component(PERL_EXE_PATH "${PERL}" DIRECTORY) -vcpkg_add_to_path("${PERL_EXE_PATH}") - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(OPENSSL_ARCH VC-WIN32) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(OPENSSL_ARCH VC-WIN64A) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(OPENSSL_ARCH VC-WIN32-ARM) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(OPENSSL_ARCH VC-WIN64-ARM) -else() - message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}") -endif() - -if(VCPKG_TARGET_IS_UWP) - vcpkg_list(APPEND CONFIGURE_OPTIONS - no-unit-test - no-asm - no-uplink - ) - string(APPEND OPENSSL_ARCH "-UWP") -endif() - -if(VCPKG_CONCURRENCY GREATER "1") - vcpkg_list(APPEND CONFIGURE_OPTIONS no-makedepend) -endif() - -cmake_path(NATIVE_PATH CURRENT_PACKAGES_DIR NORMALIZE install_dir_native) - -vcpkg_cmake_get_vars(cmake_vars_file) -include("${cmake_vars_file}") - -# Clang always uses /Z7; Patching /Zi /Fd out of openssl requires more work. -set(OPENSSL_BUILD_MAKES_PDBS ON) -if (VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES "Clang" OR VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(OPENSSL_BUILD_MAKES_PDBS OFF) -endif() - -cmake_path(NATIVE_PATH NASM NORMALIZE as) -cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_C_COMPILER NORMALIZE cc) -cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_AR NORMALIZE ar) -cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_LINKER NORMALIZE ld) - -vcpkg_build_nmake( - SOURCE_PATH "${SOURCE_PATH}" - PREFER_JOM - CL_LANGUAGE NONE - PRERUN_SHELL_RELEASE "${PERL}" Configure - ${CONFIGURE_OPTIONS} - ${OPENSSL_ARCH} - "--prefix=${install_dir_native}" - "--openssldir=${install_dir_native}" - "AS=${as}" - "CC=${cc}" - "CFLAGS=${VCPKG_COMBINED_C_FLAGS_RELEASE}" - "AR=${ar}" - "ARFLAGS=${VCPKG_COMBINED_STATIC_LINKER_FLAGS_RELEASE}" - "LD=${ld}" - "LDFLAGS=${VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE}" - PRERUN_SHELL_DEBUG "${PERL}" Configure - ${CONFIGURE_OPTIONS} - ${OPENSSL_ARCH} - --debug - "--prefix=${install_dir_native}\\debug" - "--openssldir=${install_dir_native}\\debug" - "AS=${as}" - "CC=${cc}" - "CFLAGS=${VCPKG_COMBINED_C_FLAGS_DEBUG}" - "AR=${ar}" - "ARFLAGS=${VCPKG_COMBINED_STATIC_LINKER_FLAGS_DEBUG}" - "LD=${ld}" - "LDFLAGS=${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}" - PROJECT_NAME "makefile" - TARGET install_dev install_modules ${INSTALL_FIPS} - LOGFILE_ROOT install - OPTIONS - "INSTALL_PDBS=${OPENSSL_BUILD_MAKES_PDBS}" # install-pdbs.patch - OPTIONS_RELEASE - install_runtime install_ssldirs # extra targets -) - -set(scripts "bin/c_rehash.pl" "misc/CA.pl" "misc/tsget.pl") -if("tools" IN_LIST FEATURES) - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") - file(RENAME "${CURRENT_PACKAGES_DIR}/openssl.cnf" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/openssl.cnf") - if("fips" IN_LIST FEATURES) - file(RENAME "${CURRENT_PACKAGES_DIR}/fipsmodule.cnf" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/fipsmodule.cnf") - endif() - foreach(script IN LISTS scripts) - file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") - file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}") - endforeach() - vcpkg_copy_tools(TOOL_NAMES openssl AUTO_CLEAN) -else() - file(REMOVE "${CURRENT_PACKAGES_DIR}/openssl.cnf") - file(REMOVE "${CURRENT_PACKAGES_DIR}/fipsmodule.cnf") - foreach(script IN LISTS scripts) - file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}") - endforeach() - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - endif() -endif() - -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/certs" - "${CURRENT_PACKAGES_DIR}/misc" - "${CURRENT_PACKAGES_DIR}/private" - "${CURRENT_PACKAGES_DIR}/lib/engines-3" - "${CURRENT_PACKAGES_DIR}/debug/certs" - "${CURRENT_PACKAGES_DIR}/debug/misc" - "${CURRENT_PACKAGES_DIR}/debug/lib/engines-3" - "${CURRENT_PACKAGES_DIR}/debug/private" - "${CURRENT_PACKAGES_DIR}/debug/include" -) -file(REMOVE - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/openssl.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/fipsmodule.cnf" -) diff --git a/vcpkg-overlay/ports/qgis-qt6/vcpkg.json b/vcpkg-overlay/ports/qgis-qt6/vcpkg.json index 9fe89138..ae86c1e4 100644 --- a/vcpkg-overlay/ports/qgis-qt6/vcpkg.json +++ b/vcpkg-overlay/ports/qgis-qt6/vcpkg.json @@ -19,6 +19,10 @@ "geos", "qt6", "qca-qt6", - "qtkeychain-qt6" + "qtkeychain-qt6", + { + "name": "libtasn1", + "platform": "osx | ios" + } ] } diff --git a/vcpkg-overlay/ports/tiff/FindCMath.patch b/vcpkg-overlay/ports/tiff/FindCMath.patch new file mode 100644 index 00000000..70654cf8 --- /dev/null +++ b/vcpkg-overlay/ports/tiff/FindCMath.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/FindCMath.cmake b/cmake/FindCMath.cmake +index ad92218..dd42aba 100644 +--- a/cmake/FindCMath.cmake ++++ b/cmake/FindCMath.cmake +@@ -31,7 +31,7 @@ include(CheckSymbolExists) + include(CheckLibraryExists) + + check_symbol_exists(pow "math.h" CMath_HAVE_LIBC_POW) +-find_library(CMath_LIBRARY NAMES m) ++find_library(CMath_LIBRARY NAMES m PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) + + if(NOT CMath_HAVE_LIBC_POW) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) diff --git a/vcpkg-overlay/ports/tiff/portfile.cmake b/vcpkg-overlay/ports/tiff/portfile.cmake new file mode 100644 index 00000000..01af6b41 --- /dev/null +++ b/vcpkg-overlay/ports/tiff/portfile.cmake @@ -0,0 +1,95 @@ +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.com + OUT_SOURCE_PATH SOURCE_PATH + REPO libtiff/libtiff + REF "v${VERSION}" + SHA512 859331284cd28df56c44644a355ecdd8eece19f0d5cd3e693e37c0fe37115091e46943ffbad784e84af1b39a6fd81cd196af2d4fefe86369258f89050dafaa84 + HEAD_REF master + PATCHES + FindCMath.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + cxx cxx + jpeg jpeg + jpeg CMAKE_REQUIRE_FIND_PACKAGE_JPEG + lzma lzma + lzma CMAKE_REQUIRE_FIND_PACKAGE_liblzma + tools tiff-tools + webp webp + webp CMAKE_REQUIRE_FIND_PACKAGE_WebP + zip zlib + zip CMAKE_REQUIRE_FIND_PACKAGE_ZLIB + zstd zstd + zstd CMAKE_REQUIRE_FIND_PACKAGE_ZSTD +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON + -Dtiff-docs=OFF + -Dtiff-contrib=OFF + -Dtiff-tests=OFF + -Dlibdeflate=OFF + -Djbig=OFF # This is disabled by default due to GPL/Proprietary licensing. + -Djpeg12=OFF + -Dlerc=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_OpenGL=ON + -DCMAKE_DISABLE_FIND_PACKAGE_GLUT=ON + -DZSTD_HAVE_DECOMPRESS_STREAM=ON + -DHAVE_JPEGTURBO_DUAL_MODE_8_12=OFF + OPTIONS_DEBUG + -DCMAKE_DEBUG_POSTFIX=d # tiff sets "d" for MSVC only. + MAYBE_UNUSED_VARIABLES + ZSTD_HAVE_DECOMPRESS_STREAM +) + +vcpkg_cmake_install() + +# CMake config wasn't packaged in the past and is not yet usable now, +# cf. https://gitlab.com/libtiff/libtiff/-/merge_requests/496 +# vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/tiff") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake") + +set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libtiff-4.pc") +if(EXISTS "${_file}") + vcpkg_replace_string("${_file}" "-ltiff" "-ltiffd") +endif() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) + +if ("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES + fax2ps + fax2tiff + pal2rgb + ppm2tiff + raw2tiff + tiff2bw + tiff2pdf + tiff2ps + tiff2rgba + tiffcmp + tiffcp + tiffcrop + tiffdither + tiffdump + tiffinfo + tiffmedian + tiffset + tiffsplit + AUTO_CLEAN + ) +endif() + +vcpkg_copy_pdbs() +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/vcpkg-overlay/ports/tiff/vcpkg-cmake-wrapper.cmake.in b/vcpkg-overlay/ports/tiff/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 00000000..ff0ddc0b --- /dev/null +++ b/vcpkg-overlay/ports/tiff/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,81 @@ +cmake_policy(PUSH) +cmake_policy(SET CMP0012 NEW) +cmake_policy(SET CMP0057 NEW) +set(z_vcpkg_tiff_find_options "") +if("REQUIRED" IN_LIST ARGS) + list(APPEND z_vcpkg_tiff_find_options "REQUIRED") +endif() +if("QUIET" IN_LIST ARGS) + list(APPEND z_vcpkg_tiff_find_options "QUIET") +endif() + +_find_package(${ARGS}) + +include(SelectLibraryConfigurations) + +if(TIFF_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + set(z_vcpkg_tiff_link_libraries "") + set(z_vcpkg_tiff_libraries "") + if("@webp@") + find_package(WebP CONFIG ${z_vcpkg_tiff_find_options}) + list(APPEND z_vcpkg_tiff_link_libraries "\$") + list(APPEND z_vcpkg_tiff_libraries ${WebP_LIBRARIES}) + endif() + if("@lzma@") + find_package(LibLZMA ${z_vcpkg_tiff_find_options}) + list(APPEND z_vcpkg_tiff_link_libraries "\$") + list(APPEND z_vcpkg_tiff_libraries ${LIBLZMA_LIBRARIES}) + endif() + if("@jpeg@") + find_package(JPEG ${z_vcpkg_tiff_find_options}) + list(APPEND z_vcpkg_tiff_link_libraries "\$") + list(APPEND z_vcpkg_tiff_libraries ${JPEG_LIBRARIES}) + endif() + if("@zstd@") + find_package(zstd CONFIG ${z_vcpkg_tiff_find_options}) + set(z_vcpkg_tiff_zstd_target_property "IMPORTED_LOCATION_") + if(TARGET zstd::libzstd_shared) + set(z_vcpkg_tiff_zstd "\$") + set(z_vcpkg_tiff_zstd_target zstd::libzstd_shared) + if(WIN32) + set(z_vcpkg_tiff_zstd_target_property "IMPORTED_IMPLIB_") + endif() + else() + set(z_vcpkg_tiff_zstd "\$") + set(z_vcpkg_tiff_zstd_target zstd::libzstd_static) + endif() + get_target_property(z_vcpkg_tiff_zstd_configs "${z_vcpkg_tiff_zstd_target}" IMPORTED_CONFIGURATIONS) + foreach(z_vcpkg_config IN LISTS z_vcpkg_tiff_zstd_configs) + get_target_property(ZSTD_LIBRARY_${z_vcpkg_config} "${z_vcpkg_tiff_zstd_target}" "${z_vcpkg_tiff_zstd_target_property}${z_vcpkg_config}") + endforeach() + select_library_configurations(ZSTD) + if(NOT TARGET ZSTD::ZSTD) + add_library(ZSTD::ZSTD INTERFACE IMPORTED) + set_property(TARGET ZSTD::ZSTD APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_tiff_zstd}) + endif() + list(APPEND z_vcpkg_tiff_libraries ${ZSTD_LIBRARIES}) + list(APPEND z_vcpkg_tiff_link_libraries ${z_vcpkg_tiff_zstd}) + unset(z_vcpkg_tiff_zstd) + unset(z_vcpkg_tiff_zstd_configs) + unset(z_vcpkg_config) + unset(z_vcpkg_tiff_zstd_target) + endif() + if("@zlib@") + find_package(ZLIB ${z_vcpkg_tiff_find_options}) + list(APPEND z_vcpkg_tiff_link_libraries "\$") + list(APPEND z_vcpkg_tiff_libraries ${ZLIB_LIBRARIES}) + endif() + if(UNIX) + list(APPEND z_vcpkg_tiff_link_libraries m) + list(APPEND z_vcpkg_tiff_libraries m) + endif() + + if(TARGET TIFF::TIFF) + set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_tiff_link_libraries}) + endif() + list(APPEND TIFF_LIBRARIES ${z_vcpkg_tiff_libraries}) + unset(z_vcpkg_tiff_link_libraries) + unset(z_vcpkg_tiff_libraries) +endif() +unset(z_vcpkg_tiff_find_options) +cmake_policy(POP) diff --git a/vcpkg-overlay/ports/tiff/vcpkg.json b/vcpkg-overlay/ports/tiff/vcpkg.json new file mode 100644 index 00000000..5efdd811 --- /dev/null +++ b/vcpkg-overlay/ports/tiff/vcpkg.json @@ -0,0 +1,61 @@ +{ + "name": "tiff", + "version": "4.5.1", + "port-version": 2, + "description": "A library that supports the manipulation of TIFF image files", + "homepage": "https://libtiff.gitlab.io/libtiff/", + "license": "libtiff", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "jpeg", + "lzma", + "zip" + ], + "features": { + "cxx": { + "description": "Build C++ libtiffxx library" + }, + "jpeg": { + "description": "Support JPEG compression in TIFF image files", + "dependencies": [ + "libjpeg-turbo" + ] + }, + "lzma": { + "description": "Support LZMA compression in TIFF image files", + "dependencies": [ + "liblzma" + ] + }, + "tools": { + "description": "Build tools" + }, + "webp": { + "description": "Support WEBP compression in TIFF image files", + "dependencies": [ + "libwebp" + ] + }, + "zip": { + "description": "Support ZIP/deflate compression in TIFF image files", + "dependencies": [ + "zlib" + ] + }, + "zstd": { + "description": "Support ZSTD compression in TIFF image files", + "dependencies": [ + "zstd" + ] + } + } +} diff --git a/vcpkg-overlay/triplets/x64-windows.cmake b/vcpkg-overlay/triplets/x64-windows.cmake index 6933f0e9..1ebee625 100644 --- a/vcpkg-overlay/triplets/x64-windows.cmake +++ b/vcpkg-overlay/triplets/x64-windows.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE dynamic) set(VCPKG_BUILD_TYPE release) set(VCPKG_ENV_PASSTHROUGH Qt6_DIR) \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index 3511892d..3639f5a3 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -24,7 +24,7 @@ { "name": "tiff", "default-features": false, - "features": ["webp", "zip", "jpeg"] + "features": ["webp", "zip", "lzma", "jpeg"] }, "geodiff", "nu-book-zxing-cpp",