diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5569ccbdcf..0f58c63536 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -55,6 +55,7 @@ jobs: run: | sudo apt install -y \ shellcheck + . <(curl https://aka.ms/vcpkg-init.sh -L) - name: Run pre-commit hooks uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b4c64ae700..f650a98b11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,6 @@ # See https://pre-commit.com/hooks.html for more hooks exclude: | (?x)^( - vcpkg/ | 3rdparty/ | .clang-format$ ) @@ -13,7 +12,11 @@ repos: rev: v3.2.0 hooks: - id: trailing-whitespace - exclude: ^i18n + exclude: | + (?x)^( + i18n/| + vcpkg/ + ) - id: check-yaml - id: check-added-large-files args: ['--maxkb=8000'] @@ -35,6 +38,13 @@ repos: types: [file, shell] exclude: .docker/android_dev/tools/android-accept-licenses.sh + - id: vcpkg-format + name: vcpkg-format + description: Formatting vcpkg manifests + entry: ./scripts/vcpkg-format.py + language: script + files: '.*vcpkg\.json' + # Shellcheck - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 2.1.5 diff --git a/scripts/vcpkg-format.py b/scripts/vcpkg-format.py new file mode 100755 index 0000000000..4faa140f69 --- /dev/null +++ b/scripts/vcpkg-format.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import subprocess +import sys +import os + + +def main(): + if sys.platform == "win32": + cmd = ("vcpkg", "format-manifest", "--x-wait-for-lock", *sys.argv[1:]) + else: + vcpkg_exe = os.path.join(os.path.expanduser("~"), ".vcpkg", "vcpkg") + if not os.path.isfile(vcpkg_exe): + print( + f"{vcpkg_exe} not found: bootstrap it by running \n\n . <(curl https://aka.ms/vcpkg-init.sh -L)\n\nSee https://github.com/microsoft/vcpkg-tool/blob/main/README.md#installuseremove" + ) + return 1 + cmd = (vcpkg_exe, "format-manifest", "--x-wait-for-lock", *sys.argv[1:]) + return subprocess.call(cmd) + + +if __name__ == "__main__": + exit(main()) diff --git a/vcpkg.json b/vcpkg.json index edce801572..70ea3a6299 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -21,22 +21,21 @@ "nu-book-zxing-cpp", { "name": "qca", - "default-features": false, - "features": - [ - "ossl" - ] + "host": true, + "default-features": false }, { "name": "qca", "default-features": false, - "host": true + "features": [ + "ossl" + ] }, "qgis", { "name": "qgis", - "default-features": false, - "host": true + "host": true, + "default-features": false }, { "name": "qtbase", diff --git a/vcpkg/ports/qca/vcpkg.json b/vcpkg/ports/qca/vcpkg.json index 7e6d164414..95bf6379c2 100644 --- a/vcpkg/ports/qca/vcpkg.json +++ b/vcpkg/ports/qca/vcpkg.json @@ -32,7 +32,7 @@ ] }, "gnupg": { - "description": "Build with gnupg" + "description": "Build with gnupg" }, "ossl": { "description": "Build with openssl", diff --git a/vcpkg/ports/qgis/vcpkg.json b/vcpkg/ports/qgis/vcpkg.json index 94386b63c3..c9867d3cb2 100644 --- a/vcpkg/ports/qgis/vcpkg.json +++ b/vcpkg/ports/qgis/vcpkg.json @@ -1,147 +1,132 @@ { - "name": "qgis", - "version-string": "current", - "homepage": "https://qgis.org", - "description": "QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)", - "dependencies": [ - "expat", - { - "name": "qgis", - "host": true, - "default-features": false - }, - "draco", - "libxml2", - "libzip", - "zlib", - "libspatialindex", - "libspatialite", - { - "name": "gdal", - "features":["poppler"] - }, - { - "name": "exiv2", - "features": - [ - "xmp" - ] - }, - "gsl", - "libpq", - "protobuf", - "proj", - "geos", - "jhasse-poly2tri", - { - "name": "libtasn1", - "platform": "ios | osx" - }, - { - "name": "qtbase", - "features": - [ - "brotli", - "concurrent", - "default-features", - "doubleconversion", - "freetype", - "gui", - "harfbuzz", - "jpeg", - "network", - { - "name":"openssl", - "platform": "!ios" - }, - { - "name":"securetransport", - "platform": "ios" - }, - "pcre2", - "png", - "sql", - "sql-sqlite", - "testlib", - "thread", - "widgets", - "zstd" - ], - "default-features": false - }, - "qtsvg", - "qtlocation", - { - "name": "qttools", - "host": true - }, - { - "name": "qca", - "default-features": false, - "features": - [ - "ossl" - ] - }, - "qtkeychain-qt6" - ], - "features": + "name": "qgis", + "version-string": "current", + "description": "QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)", + "homepage": "https://qgis.org", + "dependencies": [ + "draco", { - "opencl" : { - "description": "Should OpenCL support be added", - "dependencies": - [ - "opencl" - ] - }, - "server": - { - "description": "Determines whether QGIS server should be built", - "dependencies": - [ - "fastcgi" - ] - }, - "process": - { - "description": "Determines whether the command line QGIS process tool should be built" - }, - "3d": - { - "description": "Determines whether QGIS 3D library should be built", - "dependencies": - [ - "qt3d" - ] - }, - "bindings": - { - "description": "Determines whether Python bindings should be built" - }, - "gui": - { - "description": "Determines whether the QGIS gui should be built", - "dependencies": - [ - "qwt", - "qscintilla" - ] - }, - "desktop": + "name": "exiv2", + "features": [ + "xmp" + ] + }, + "expat", + { + "name": "gdal", + "features": [ + "poppler" + ] + }, + "geos", + "gsl", + "jhasse-poly2tri", + "libpq", + "libspatialindex", + "libspatialite", + { + "name": "libtasn1", + "platform": "ios | osx" + }, + "libxml2", + "libzip", + "proj", + "protobuf", + { + "name": "qca", + "default-features": false, + "features": [ + "ossl" + ] + }, + { + "name": "qgis", + "host": true, + "default-features": false + }, + { + "name": "qtbase", + "default-features": false, + "features": [ + "brotli", + "concurrent", + "default-features", + "doubleconversion", + "freetype", + "gui", + "harfbuzz", + "jpeg", + "network", { - "description": "Determines whether the QGIS desktop (main app) should be built" + "name": "openssl", + "platform": "!ios" }, - "customwidgets": + "pcre2", + "png", { - "description": "Determines whether the QGIS custom widgets for QtCreator should be built" + "name": "securetransport", + "platform": "ios" }, - "quick": - { - "description": "Build the QGIS quick components for mobile interfaces", - "dependencies": - [ - "qtdeclarative" - ] - } + "sql", + "sql-sqlite", + "testlib", + "thread", + "widgets", + "zstd" + ] + }, + "qtkeychain-qt6", + "qtlocation", + "qtsvg", + { + "name": "qttools", + "host": true + }, + "zlib" + ], + "features": { + "3d": { + "description": "Determines whether QGIS 3D library should be built", + "dependencies": [ + "qt3d" + ] + }, + "bindings": { + "description": "Determines whether Python bindings should be built" + }, + "customwidgets": { + "description": "Determines whether the QGIS custom widgets for QtCreator should be built" + }, + "desktop": { + "description": "Determines whether the QGIS desktop (main app) should be built" + }, + "gui": { + "description": "Determines whether the QGIS gui should be built", + "dependencies": [ + "qscintilla", + "qwt" + ] + }, + "opencl": { + "description": "Should OpenCL support be added", + "dependencies": [ + "opencl" + ] + }, + "process": { + "description": "Determines whether the command line QGIS process tool should be built" + }, + "quick": { + "description": "Build the QGIS quick components for mobile interfaces", + "dependencies": [ + "qtdeclarative" + ] + }, + "server": { + "description": "Determines whether QGIS server should be built", + "dependencies": [ + "fastcgi" + ] + } } } diff --git a/vcpkg/ports/sentry-cocoa/vcpkg.json b/vcpkg/ports/sentry-cocoa/vcpkg.json index 864149d750..5d28657547 100644 --- a/vcpkg/ports/sentry-cocoa/vcpkg.json +++ b/vcpkg/ports/sentry-cocoa/vcpkg.json @@ -1,8 +1,8 @@ { "name": "sentry-cocoa", "version-string": "current", - "homepage": "https://qgis.org", "description": "Sentry SDK for ios", + "homepage": "https://sentry.io/for/cocoa", "dependencies": [ { "name": "vcpkg-cmake",