Skip to content

Commit

Permalink
Merge pull request #5073 from opengisch/vcpkg-manifest-format
Browse files Browse the repository at this point in the history
Format vcpkg manifest files
  • Loading branch information
nirvn authored Mar 4, 2024
2 parents d12bdd5 + 37a22e1 commit f9cdfb2
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 151 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
14 changes: 12 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
vcpkg/ |
3rdparty/ |
.clang-format$
)
Expand All @@ -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']
Expand All @@ -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
Expand Down
23 changes: 23 additions & 0 deletions scripts/vcpkg-format.py
Original file line number Diff line number Diff line change
@@ -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())
15 changes: 7 additions & 8 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion vcpkg/ports/qca/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
]
},
"gnupg": {
"description": "Build with gnupg"
"description": "Build with gnupg"
},
"ossl": {
"description": "Build with openssl",
Expand Down
263 changes: 124 additions & 139 deletions vcpkg/ports/qgis/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
2 changes: 1 addition & 1 deletion vcpkg/ports/sentry-cocoa/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

1 comment on commit f9cdfb2

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.