{"id":28222197,"url":"https://github.com/luncliff/swift-vcpkg-plugin","last_synced_at":"2025-06-27T00:37:31.630Z","repository":{"id":291282598,"uuid":"977166962","full_name":"luncliff/swift-vcpkg-plugin","owner":"luncliff","description":"Experimental Swift plugin to integrate with the vcpkg package manager","archived":false,"fork":false,"pushed_at":"2025-05-16T06:49:18.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T20:06:10.392Z","etag":null,"topics":["experiment","swift","swift-package-manager","swift-plugin"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luncliff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-03T15:20:08.000Z","updated_at":"2025-05-16T06:59:13.000Z","dependencies_parsed_at":"2025-06-11T16:32:19.420Z","dependency_job_id":"251b47d2-8d7f-4979-9765-bb936fd1fbc2","html_url":"https://github.com/luncliff/swift-vcpkg-plugin","commit_stats":null,"previous_names":["luncliff/swift-vcpkg-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luncliff/swift-vcpkg-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luncliff%2Fswift-vcpkg-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luncliff%2Fswift-vcpkg-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luncliff%2Fswift-vcpkg-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luncliff%2Fswift-vcpkg-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luncliff","download_url":"https://codeload.github.com/luncliff/swift-vcpkg-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luncliff%2Fswift-vcpkg-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262166400,"owners_count":23269039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["experiment","swift","swift-package-manager","swift-plugin"],"created_at":"2025-05-18T06:10:17.138Z","updated_at":"2025-06-27T00:37:31.599Z","avatar_url":"https://github.com/luncliff.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-vcpkg-plugin\n\nExperimental Swift Package Manager [Build Tool plugin](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Plugins.md) for [Microsoft/vcpkg](https://github.com/microsoft/vcpkg)\n\n* https://github.com/swiftlang/swift-package-manager\n* https://github.com/microsoft/vcpkg\n* https://github.com/microsoft/vcpkg-tool\n\n## How To\n\n### Use\n\nBecause vcpkg may not configure native libraries properly, you will need a propert [vcpkg triplet](https://learn.microsoft.com/en-us/vcpkg/concepts/triplets).\nPlease check [the overlay triplets example](https://learn.microsoft.com/en-us/vcpkg/users/examples/overlay-triplets-linux-dynamic).\n\nFor example, if you're building for ARM64, macOS environment...\n\n```cmake\n# arm64-osx.cmake\nset(VCPKG_TARGET_ARCHITECTURE x64)\nset(VCPKG_CRT_LINKAGE dynamic)\nset(VCPKG_LIBRARY_LINKAGE static)\n\nset(VCPKG_CMAKE_SYSTEM_NAME Darwin)\nset(VCPKG_CMAKE_SYSTEM_VERSION 10.15) # For minimum SDK\nlist(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS\n    \"-DCMAKE_CXX_STANDARD=20\"\n)\n\nset(VCPKG_OSX_ARCHITECTURES arm64) # or x86_64, some ports won't support universal build\n```\n\nAfter the custom triplet, set [the environment variables](https://learn.microsoft.com/en-us/vcpkg/users/config-environment)\n* `VCPKG_OVERLAY_TRIPLETS`\n* ...\n\n```bash\n# Suppose this folder contains your CMake scripts\nexport VCPKG_OVERLAY_TRIPLETS=\"$(pwd)/vcpkg-triplets\"\n```\n\nIn your Package.swift,\n\n```swift\n// swift-tools-version: 6.0\nimport PackageDescription\n\nlet dependencies: [Package.Dependency] = [\n    .package(url: \"https://github.com/luncliff/swift-vcpkg-plugin\", branch: \"main\"),\n    // ...\n]\n\nlet triplet = \"arm64-osx\" // we will use libraries with the triplet, arm64-osx.cmake\n\nlet targets: [Target] = [\n    .target(\n        name: \"...\",\n        cxxSettings: [\n            // path to the installed header files\n            .unsafeFlags([\"-I.build/artifacts/\\(triplet)/include\"])\n        ],\n        linkerSettings: [\n            // path to the installed libraries\n            .unsafeFlags([\"-L.build/artifacts/\\(triplet)/lib\"])\n        ],\n        plugins: [\n            .plugin(name: \"swift-vcpkg-plugin\", package: \"swift-vcpkg-plugin\")\n        ]\n    )\n]\n\nlet package = Package(\n    name: \"...\",\n    // ...\n    dependencies: dependencies,\n    targets: targets\n)\n```\n\n\u003e\n\u003e [!WARNING]\n\u003e * When you build your project with this plugin, the sandbox created by the Swift package manager causes error while `curl`'s DNS usage.\n\u003e ```log\n\u003e curl: (6) Could not resolve host: github.com\n\u003e ```\n\u003e\n\nDisable sandbox to allow plugin to download \u0026 extract .zip file and executables...\n\n```bash\nswift build --disable-sandbox\n```\n\n### Build/Test\n\n\u003e\n\u003e [!WARNING]\n\u003e * Source organization may change later\n\u003e\n\n```bash\n# swift package resolve\n# swift package show-dependencies\nswift build\n```\n\n```bash\nswift test\n```\n\n### Format/Lint\n\nInstall some tools with [Homebrew](https://brew.sh)\n\n* https://formulae.brew.sh/formula/swiftformat\n* https://formulae.brew.sh/formula/swiftlint\n\n```bash\nbrew install swiftformat swiftlint\n```\n\nThen run the commands in following order.\n\n```bash\nswiftformat **/*.swift --swiftversion 6.0\nswiftlint --autocorrect **/*.swift\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluncliff%2Fswift-vcpkg-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluncliff%2Fswift-vcpkg-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluncliff%2Fswift-vcpkg-plugin/lists"}