diff --git a/.gitattributes b/.gitattributes index fa1385d99a319b..d0c3b3e9ccf66d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,5 @@ * -text +ports/** -linguist-detectable + +# Declare files that will always have LF line endings on checkout. +scripts/ci.baseline.txt text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index d3be89f6075413..b971df79de29c6 100644 --- a/.gitignore +++ b/.gitignore @@ -289,47 +289,25 @@ __pycache__/ /packages/ /scripts/buildsystems/tmp/ /toolsrc/build.rel/ -/toolsrc/msbuild.x86.debug/ -/toolsrc/msbuild.x86.release/ -/toolsrc/msbuild.x64.debug/ -/toolsrc/msbuild.x64.release/ +/toolsrc/windows-bootstrap/msbuild.x86.debug/ +/toolsrc/windows-bootstrap/msbuild.x86.release/ +/toolsrc/windows-bootstrap/msbuild.x64.debug/ +/toolsrc/windows-bootstrap/msbuild.x64.release/ +#ignore custom triplets /triplets/* #add vcpkg-designed triplets back in -!triplets/community/arm64-mingw-dynamic.cmake -!triplets/community/arm64-mingw-static.cmake -!triplets/community/arm64-uwp.cmake -!triplets/community/arm64-windows-static.cmake -!triplets/community/arm-mingw-dynamic.cmake -!triplets/community/arm-mingw-static.cmake -!triplets/community/arm-windows.cmake -!triplets/community/x64-mingw-dynamic.cmake -!triplets/community/x64-mingw-static.cmake -!triplets/community/x64-windows-static-md.cmake -!triplets/community/x86-mingw-dynamic.cmake -!triplets/community/x86-mingw-static.cmake -!triplets/community/x86-uwp.cmake -!triplets/community/x86-windows-static.cmake -!triplets/community/x86-windows-static-md.cmake -!triplets/community/x64-osx-dynamic.cmake -!triplets/community/x64-android.cmake -!triplets/community/x86-android.cmake -!triplets/community/arm-android.cmake -!triplets/community/arm64-android.cmake -!triplets/community/arm64-ios.cmake -!triplets/community/arm-ios.cmake -!triplets/community/x64-ios.cmake -!triplets/community/x86-ios.cmake -!triplets/community/wasm32-emscripten.cmake -!triplets/community/arm64-osx.cmake -!triplets/arm-uwp.cmake -!triplets/x64-uwp.cmake -!triplets/x64-windows.cmake -!triplets/x64-windows-static.cmake -!triplets/x86-windows.cmake -!triplets/arm64-windows.cmake -!triplets/x64-linux.cmake -!triplets/x64-osx.cmake -#ignore custom triplets +!/triplets/arm-uwp.cmake +!/triplets/arm64-windows.cmake +!/triplets/x64-linux.cmake +!/triplets/x64-osx.cmake +!/triplets/x64-uwp.cmake +!/triplets/x64-windows-static.cmake +!/triplets/x64-windows.cmake +!/triplets/x86-windows.cmake + +!/triplets/community +!/triplets/community/** + *.exe *.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d1b29f9969ef..dea1e5a4ab93c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,1625 @@ +vcpkg (2020.06.16 - 2020.7.31) +--- +#### Total port count: 1429 +#### Total port count per triplet (tested): +|triplet|ports available| +|---|---| +|**x64-windows**|1304| +|x86-windows|1284| +|x64-windows-static|1213| +|**x64-osx**|1139| +|**x64-linux**|1210| +|arm64-windows|928| +|x64-uwp|700| +|arm-uwp|669| + +#### The following commands and options have been updated: +- `x-package-info` ***[NEW COMMAND]***: Allows viewing of port information in a requested format (currently json) + - [(#12845)](https://github.com/microsoft/vcpkg/pull/12845) [vcpkg] Lift `--x-json` to a global option, implement experimental `x-package-info` command (by @ras0219) +- `--editable` ***[NEW OPTION]***: Suppress binary caching and source re-extraction for packages listed on the command line + - [(#12200)](https://github.com/microsoft/vcpkg/pull/12200) [vcpkg] Implement --editable (by @ras0219) + - [(#12366)](https://github.com/microsoft/vcpkg/pull/12366) [vcpkg] Improve informational message for `--editable` while cleaning sources (by @ras0219) +- `--x-binarysource=` ***[NEW OPTION]***: Experimental: Support NuGet servers for retrieving and uploading of binary packages during builds + - [(#12058)](https://github.com/microsoft/vcpkg/pull/12058) [vcpkg] Implementation of --x-binarysource=nuget (and friends) (by @ras0219) +- `install` + - `--x-write-nuget-packages-config` ***[NEW OPTION]***: Experimental: Write out a NuGet packages config-formatted file for use with external binary caching + - [(#12138)](https://github.com/microsoft/vcpkg/pull/12138) [vcpkg] Implement --x-write-nuget-packages-config= setting for `install` and `x-set-installed` (by @ras0219) +- `x-set-installed` + - `--dry-run` ***[NEW OPTION]***: Perform a dry run by not actually building or installing + - [(#12132)](https://github.com/microsoft/vcpkg/pull/12132) [vcpkg-x-set-installed] Implement --dry-run (by @ras0219) +- `--x-json`: Lift this option to the global scope to request json output from compatible commands (see `x-package-info`) + - [(#12845)](https://github.com/microsoft/vcpkg/pull/12845) [vcpkg] Lift `--x-json` to a global option, implement experimental `x-package-info` command (by @ras0219) + +#### The following documentation has been updated: +- [vcpkg_from_sourceforge](docs/maintainers/vcpkg_from_sourceforge.md) ***[NEW]*** + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) (by @JackBoosY) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) (by @JackBoosY) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [vcpkg_fixup_pkgconfig](docs/maintainers/vcpkg_fixup_pkgconfig.md) ***[NEW]*** + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [Binary Caching Specification](docs/specifications/binarycaching.md) ***[NEW]*** + - [(#11204)](https://github.com/microsoft/vcpkg/pull/11204) [vcpkg] RFC: Binarycaching (by @ras0219-msft) +- [README](README.md) + - [(#12093)](https://github.com/microsoft/vcpkg/pull/12093) [vcpkg docs] new README/Quick Start guide (by @strega-nil) +- [Patching Example](docs/examples/patching.md) + - [(#11952)](https://github.com/microsoft/vcpkg/pull/11952) [Document]Mention --ignore-space-at-eol in patching.md (by @Pospelove) + - [(#12200)](https://github.com/microsoft/vcpkg/pull/12200) [vcpkg] Implement --editable (by @ras0219) +- [vcpkg_fixup_cmake_targets](docs/maintainers/vcpkg_fixup_cmake_targets.md) + - [(#11275)](https://github.com/microsoft/vcpkg/pull/11275) [ignition-plugin1] Add new port 🤖 (by @traversaro) +- [Privacy](docs/about/privacy.md) + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation (by @strega-nil) +- [Manifests](docs/specifications/manifests.md) + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation (by @strega-nil) +- [Environment and Configuration](docs/users/config-environment.md) + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation (by @strega-nil) + - [(#12640)](https://github.com/microsoft/vcpkg/pull/12640) [vcpkg] add environment variable VCPKG_OVERLAY_PORTS (by @Neumann-A) +- [Buildsystem Integration](docs/users/integration.md) + - [(#12145)](https://github.com/microsoft/vcpkg/pull/12145) [vcpkg] Update message in bootstrap.ps1 (by @PhoebeHui) + - [(#12873)](https://github.com/microsoft/vcpkg/pull/12873) [vcpkg] Fix bullet lists for integration.md on readthedocs.io (by @ftheile) +- [Installing and Using Packages](docs/examples/installing-and-using-packages.md) + - [(#12200)](https://github.com/microsoft/vcpkg/pull/12200) [vcpkg] Implement --editable (by @ras0219) + - [(#12516)](https://github.com/microsoft/vcpkg/pull/12516) [sqlite3] Namespaced targets with unofficial:: (by @PhoebeHui) +- [Packaging Zipfiles](docs/examples/packaging-zipfiles.md) + - [(#12200)](https://github.com/microsoft/vcpkg/pull/12200) [vcpkg] Implement --editable (by @ras0219) +- [CONTROL Files](docs/maintainers/control-files.md) + - [(#12227)](https://github.com/microsoft/vcpkg/pull/12227) [vcpkg manifests] fix some issues (by @strega-nil) +- [Portfile Functions](docs/maintainers/portfile-functions.md) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [vcpkg_build_make](docs/maintainers/vcpkg_build_make.md) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [vcpkg_common_definitions](docs/maintainers/vcpkg_common_definitions.md) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [vcpkg_configure_make](docs/maintainers/vcpkg_configure_make.md) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [vcpkg_find_acquire_program](docs/maintainers/vcpkg_find_acquire_program.md) + - [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [Triplets](docs/users/triplets.md) + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 (by @Squareys) +- [Maintainer Guidelines and Policies](docs/maintainers/maintainer-guide.md) + - [(#12460)](https://github.com/microsoft/vcpkg/pull/12460) [vcpkg] Improve format check failure message (by @JackBoosY) +- [vcpkg_check_linkage.md](docs/maintainers/vcpkg_check_linkage.md) + - [(#12624)](https://github.com/microsoft/vcpkg/pull/12624) Fix .gitignore excluding triplets/community, sort, and driveby vcpkg_check_linkage.md doc bug. (by @BillyONeal) +- [Overlay Triplets Example: Dynamic Linux Library](docs/examples/overlay-triplets-linux-dynamic.md) + - [(#12516)](https://github.com/microsoft/vcpkg/pull/12516) [sqlite3] Namespaced targets with unofficial:: (by @PhoebeHui) + +#### The following *remarkable* changes have been made to vcpkg's infrastructure: +- Port Manifest: New feature to allow projects to state their dependencies in a declarative format + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation (by @strega-nil) + - [(#12227)](https://github.com/microsoft/vcpkg/pull/12227) [vcpkg manifests] fix some issues (by @strega-nil) + - [(#12549)](https://github.com/microsoft/vcpkg/pull/12549) [vcpkg manifest] add feature support (by @strega-nil) +- `vcpkg_from_sourceforge`: New maintainer helper function to retrieve sources from SourceForge + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) (by @JackBoosY) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) (by @JackBoosY) +- `VCPKG_OVERLAY_PORTS`: New environment variable to allow users to override ports with alternate versions + - [(#12640)](https://github.com/microsoft/vcpkg/pull/12640) [vcpkg] add environment variable VCPKG_OVERLAY_PORTS (by @Neumann-A) + +#### The following *additional* changes have been made to vcpkg's infrastructure: +- [(#12174)](https://github.com/microsoft/vcpkg/pull/12174) [vcpkg] Fix `vcpkg export --nuget` regressions (by @ras0219) +- [(#11842)](https://github.com/microsoft/vcpkg/pull/11842) [vcpkg] Extract common paths settings to make_cmake_cmd... (by @BillyONeal) +- [(#11977)](https://github.com/microsoft/vcpkg/pull/11977) [CHANGELOG] Update to 2020.06.15 (by @vicroms) +- [(#11978)](https://github.com/microsoft/vcpkg/pull/11978) Attempt to mitigate Windows Defender detections by making provision-image.ps1 not a powershell script (by @BillyONeal) +- [(#11015)](https://github.com/microsoft/vcpkg/pull/11015) [vcpkg] Fix issue #9781 by exporting from the installed directory (by @ras0219) +- [(#11984)](https://github.com/microsoft/vcpkg/pull/11984) [breakpad] Fix build failure on OSX (by @JackBoosY) +- [(#11981)](https://github.com/microsoft/vcpkg/pull/11981) [thrift] Update to 0.13.0 and fix OSX build (by @JackBoosY) +- [(#11963)](https://github.com/microsoft/vcpkg/pull/11963) [libvpx] Support arm64-windows (by @JackBoosY) +- [(#12000)](https://github.com/microsoft/vcpkg/pull/12000) [vcpkg] Clean tombstones in every build except PR validations (by @BillyONeal) +- [(#11965)](https://github.com/microsoft/vcpkg/pull/11965) [vcpkg baseline] Retrigger failed ports in baseline (by @PhoebeHui) +- [(#11938)](https://github.com/microsoft/vcpkg/pull/11938) [vcpkg] Add mirror to download Strawberry Perl (by @AenBleidd) +- [(#11931)](https://github.com/microsoft/vcpkg/pull/11931) [vcpkg] Put user-defined configuration triplets path on top of the search queue (by @AenBleidd) +- [(#11999)](https://github.com/microsoft/vcpkg/pull/11999) [vcpkg] Use SSH keys instead of password authentication when minting Linux scale sets (by @BillyONeal) +- [(#12049)](https://github.com/microsoft/vcpkg/pull/12049) [vcpkg] Delete unused --purge-tombstones and introduce BufferedPrint class (by @BillyONeal) +- [(#11654)](https://github.com/microsoft/vcpkg/pull/11654) [vcpkg] Track compiler information in ABI (by @ras0219) +- [(#11983)](https://github.com/microsoft/vcpkg/pull/11983) [libmicrohttpd] Support build on UNIX and use msbuild on Windows (by @JackBoosY) +- [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) (by @endrift) +- [(#12074)](https://github.com/microsoft/vcpkg/pull/12074) [vcpkg] Do not fail just because cleaning tombstones failed in CI. (by @BillyONeal) +- [(#11275)](https://github.com/microsoft/vcpkg/pull/11275) [ignition-plugin1] Add new port 🤖 (by @traversaro) +- [(#12067)](https://github.com/microsoft/vcpkg/pull/12067) [vcpkg baseline] Fix baseline errors (by @JackBoosY) +- [(#12082)](https://github.com/microsoft/vcpkg/pull/12082) [vcpkg] Commonize pipelines build powershell and don't use binary caching in CI (rather than PR) builds (by @BillyONeal) +- [(#12113)](https://github.com/microsoft/vcpkg/pull/12113) [vcpkg] Add disk space report to Windows PR/CI (by @BillyONeal) +- [(#12072)](https://github.com/microsoft/vcpkg/pull/12072) [vcpkg build] fix build command (by @strega-nil) +- [(#12120)](https://github.com/microsoft/vcpkg/pull/12120) [vcpkg] Delete unnecessary tombstone deletion step now that CI rebuilds everything (by @BillyONeal) +- [(#12091)](https://github.com/microsoft/vcpkg/pull/12091) [vcpkg] Use XDG/LOCALAPPDATA for default binary caching path (by @ras0219) +- [(#12128)](https://github.com/microsoft/vcpkg/pull/12128) [vcpkg] Fix "[commands-build] build smoke test" (by @ras0219) +- [(#12130)](https://github.com/microsoft/vcpkg/pull/12130) [vcpkg] Add write-only binary caching for CI. (by @BillyONeal) +- [(#12101)](https://github.com/microsoft/vcpkg/pull/12101) [vcpkg] Add mingw dynamic libs triplet (by @longnguyen2004) +- [(#12069)](https://github.com/microsoft/vcpkg/pull/12069) Fix typo in comment (by @freddy77) +- [(#12144)](https://github.com/microsoft/vcpkg/pull/12144) [vcpkg baseline][paraview] Fix linux build (by @JackBoosY) +- [(#12172)](https://github.com/microsoft/vcpkg/pull/12172) [vcpkg ci] add macos scripts to vcpkg repo (by @strega-nil) +- [(#12176)](https://github.com/microsoft/vcpkg/pull/12176) [vcpkg] VM Update (by @BillyONeal) +- [(#12192)](https://github.com/microsoft/vcpkg/pull/12192) Fix sourceparagraph:BooleanField (by @strega-nil) +- [(#12191)](https://github.com/microsoft/vcpkg/pull/12191) Don't change manifest root when manifest isn't enabled. (by @dada2048) +- [(#12170)](https://github.com/microsoft/vcpkg/pull/12170) [vcpkg] Enable NuGet-based binary caching via mono (by @ras0219) +- [(#12145)](https://github.com/microsoft/vcpkg/pull/12145) [vcpkg] Update message in bootstrap.ps1 (by @PhoebeHui) +- [(#12201)](https://github.com/microsoft/vcpkg/pull/12201) [vcpkg] Remove all uses of Foo::Foo() noexcept = default; to fix #9955 (by @ras0219) +- [(#12203)](https://github.com/microsoft/vcpkg/pull/12203) [vcpkg] Improve performance of compiler tracking (by @ras0219) +- [(#12212)](https://github.com/microsoft/vcpkg/pull/12212) [msbuild] Revert the importance to Normal (by @PhoebeHui) +- [(#12197)](https://github.com/microsoft/vcpkg/pull/12197) [vcpkg] Remove the tombstones and 'ignore' baseline concepts. (by @BillyONeal) +- [(#4608)](https://github.com/microsoft/vcpkg/pull/4608) [vcpkg] Use IncludePath and LibraryPath properties (by @FrankHeimes) +- [(#12242)](https://github.com/microsoft/vcpkg/pull/12242) [vcpkg] Remove use of std::variant and std::visit to fix VS2015. (by @ras0219) +- [(#12272)](https://github.com/microsoft/vcpkg/pull/12272) [vcpkg] Revert change which causes sources to be purged by default in `vcpkg build` (by @ras0219) +- [(#12263)](https://github.com/microsoft/vcpkg/pull/12263) [vcpkg] Update toolsrc VERSION to 2020.06.15 (by @c72578) +- [(#12232)](https://github.com/microsoft/vcpkg/pull/12232) [opengl wincrypt winsock2] Use $ENV{WindowsSdkDir} instead of hard coding Windows SDK paths. (by @BillyONeal) +- [(#12177)](https://github.com/microsoft/vcpkg/pull/12177) [vcpkg] Added python script to generate all packages file list, added to azur… (by @yaoleo34) +- [(#11655)](https://github.com/microsoft/vcpkg/pull/11655) [vcpkg] Format the C++ in CI (by @strega-nil) +- [(#12300)](https://github.com/microsoft/vcpkg/pull/12300) [libbson, vcpkg baseline] Remove passing and fix spurious failure. (by @BillyONeal) +- [(#12140)](https://github.com/microsoft/vcpkg/pull/12140) [simdjson] Update to 0.4.6 (by @myd7349) +- [(#11967)](https://github.com/microsoft/vcpkg/pull/11967) [evpp] Fix build error on OSX (by @JackBoosY) +- [(#12314)](https://github.com/microsoft/vcpkg/pull/12314) [vcpkg ci] Update formatting CI (by @strega-nil) +- [(#12259)](https://github.com/microsoft/vcpkg/pull/12259) [triplets][osx] add support for arm64 'apple silicon' (by @eklipse2k8) +- [(#11754)](https://github.com/microsoft/vcpkg/pull/11754) [pcre2] Update to 10.35 (by @c72578) +- [(#11753)](https://github.com/microsoft/vcpkg/pull/11753) Fix support for toolchains that set CMAKE_FIND_ROOT_PATH_MODE_* variables to ONLY (by @traversaro) +- [(#12317)](https://github.com/microsoft/vcpkg/pull/12317) [vcpkg README] Fix links (by @strega-nil) +- [(#12319)](https://github.com/microsoft/vcpkg/pull/12319) [vcpkg.targets] Fix #12292 regression with MSBuild targets (by @ras0219-msft) +- [(#12323)](https://github.com/microsoft/vcpkg/pull/12323) [vcpkg] Ignore dependencies not found errors when downloading mode (by @JackBoosY) +- [(#12257)](https://github.com/microsoft/vcpkg/pull/12257) [vcpkg] Fix MSBuild regressions #12062 and #12086. (by @ras0219) +- [(#12037)](https://github.com/microsoft/vcpkg/pull/12037) [freerdp] Fix x64-osx triplet (by @AlexAltea) +- [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. (by @Neumann-A) +- [(#8322)](https://github.com/microsoft/vcpkg/pull/8322) [kfr] Add new port (by @myd7349) +- [(#12244)](https://github.com/microsoft/vcpkg/pull/12244) [cuda] correct env variables for newer cuda versions (by @Neumann-A) +- [(#12256)](https://github.com/microsoft/vcpkg/pull/12256) [vcpkg] Move default binary cache from `$root/archives` to user-wide directory (by @ras0219) +- [(#12350)](https://github.com/microsoft/vcpkg/pull/12350) [vcpkg] Remove unnecessary work queue (by @strega-nil) +- [(#12367)](https://github.com/microsoft/vcpkg/pull/12367) [vcpkg build] fix #12355 (by @strega-nil) +- [(#12369)](https://github.com/microsoft/vcpkg/pull/12369) [vcpkg formatting] Fix format regex (by @strega-nil) +- [(#12178)](https://github.com/microsoft/vcpkg/pull/12178) [vcpkg] Add a schema file for vcpkg.json (by @Edhebi) +- [(#12370)](https://github.com/microsoft/vcpkg/pull/12370) [vcpkg] Enable binary caching by default (by @ras0219) +- [(#12386)](https://github.com/microsoft/vcpkg/pull/12386) [vcpkg] Add CMake heuristics for header-only libraries (by @ras0219) +- [(#12378)](https://github.com/microsoft/vcpkg/pull/12378) [vcpkg] proper errorcheck during files installation (by @Maximus5) +- [(#12384)](https://github.com/microsoft/vcpkg/pull/12384) [vcpkg-ci] Always publish file lists (by @ras0219) +- [(#12254)](https://github.com/microsoft/vcpkg/pull/12254) [vcpkg] Track hashes of cmake script helpers in consuming portfiles (by @ras0219) +- [(#12361)](https://github.com/microsoft/vcpkg/pull/12361) [vcpkg] Fix iOS toolchain detection when using the iOS community triplets (by @alcroito) +- [(#12398)](https://github.com/microsoft/vcpkg/pull/12398) [libb2] Add supports and install pkg-conifg on macOS VM (by @PhoebeHui) +- [(#12368)](https://github.com/microsoft/vcpkg/pull/12368) [vcpkg formatting] Turn off DeriveLineEnding (by @strega-nil) +- [(#12429)](https://github.com/microsoft/vcpkg/pull/12429) [vcpkg] Fix ParagraphParser::required_field() (by @maksqwe) +- [(#12400)](https://github.com/microsoft/vcpkg/pull/12400) [vcpkg] implement copy_symlink working for non-elevated processes (by @Maximus5) +- [(#12432)](https://github.com/microsoft/vcpkg/pull/12432) vcpkg_configure_make: typo fix '_vcpkg_append_to_configure_environment' (by @kevinlul) +- [(#12351)](https://github.com/microsoft/vcpkg/pull/12351) [vcpkg] Clean up command switch code (by @strega-nil) +- [(#12179)](https://github.com/microsoft/vcpkg/pull/12179) [vcpkg] print list in json (by @dan-shaw) +- [(#12084)](https://github.com/microsoft/vcpkg/pull/12084) Build fix with MinGW GCC 9.2.0 (by @cristianadam) +- [(#12455)](https://github.com/microsoft/vcpkg/pull/12455) [libmicrohttpd] Add `platform.h` to restricted header list. (by @ras0219) +- [(#12468)](https://github.com/microsoft/vcpkg/pull/12468) [vcpkg] Add NVTOOLSEXT_PATH to the env passthrough list (by @Neumann-A) +- [(#12534)](https://github.com/microsoft/vcpkg/pull/12534) Add initial s390x support (by @lebdron) +- [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries (by @Neumann-A) +- [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 (by @cenit) +- [(#12467)](https://github.com/microsoft/vcpkg/pull/12467) [vcpkg-acquire-msys] Install new keyring (by @emptyVoid) +- [(#12460)](https://github.com/microsoft/vcpkg/pull/12460) [vcpkg] Improve format check failure message (by @JackBoosY) +- [(#9248)](https://github.com/microsoft/vcpkg/pull/9248) fix issue #9228 : Add support to subgroups in gitlab (by @RamadanAhmed) +- [(#12513)](https://github.com/microsoft/vcpkg/pull/12513) [vcpkg] EOL LF for ci.baseline.txt (by @Neumann-A) +- [(#8628)](https://github.com/microsoft/vcpkg/pull/8628) [marble] Add new port (by @ig-or) +- [(#12118)](https://github.com/microsoft/vcpkg/pull/12118) [mozjpeg] fix build (by @saucecontrol) +- [(#12530)](https://github.com/microsoft/vcpkg/pull/12530) [libmodbus] Fix static linkage error (by @NancyLi1013) +- [(#12514)](https://github.com/microsoft/vcpkg/pull/12514) [mpir] Fix build error if VCPKG_BUILD_TYPE is set as release or debug (by @NancyLi1013) +- [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build (by @JackBoosY) +- [(#12569)](https://github.com/microsoft/vcpkg/pull/12569) [vcpkg_fixup_pkgconfig] Remove required in first find_program call for pkg-config (by @Neumann-A) +- [(#12097)](https://github.com/microsoft/vcpkg/pull/12097) Fix vcpkg android toolchain so it adds flags that aren't just ignored (by @jamiebk) +- [(#11021)](https://github.com/microsoft/vcpkg/pull/11021) [rsocket] Add new port (by @curoky) +- [(#12104)](https://github.com/microsoft/vcpkg/pull/12104) Fix vcpkg_fixup_cmake_targets to work correctly on MinGW (by @koprok) +- [(#12661)](https://github.com/microsoft/vcpkg/pull/12661) [vcpkg] Fix typo in link for installing and using packages (by @varunagrawal) +- [(#12639)](https://github.com/microsoft/vcpkg/pull/12639) [vcpkg-ci] fix macos setup scripts (by @strega-nil) +- [(#12586)](https://github.com/microsoft/vcpkg/pull/12586) [vcpkg] Fix build on Windows 8.1 SDK (by @strega-nil) +- [(#12585)](https://github.com/microsoft/vcpkg/pull/12585) [vcpkg] Refactor Commands: Part 1 (by @strega-nil) +- [(#10770)](https://github.com/microsoft/vcpkg/pull/10770) [cmake] Add cmake port to test qt (by @Neumann-A) +- [(#10786)](https://github.com/microsoft/vcpkg/pull/10786) [tomlplusplus] Add new port (by @traversaro) +- [(#12641)](https://github.com/microsoft/vcpkg/pull/12641) Refactor commands 2: Electric Boogaloo (by @strega-nil) +- [(#12548)](https://github.com/microsoft/vcpkg/pull/12548) [vcpkg manifest] look at `platform` directives (by @strega-nil) +- [(#12494)](https://github.com/microsoft/vcpkg/pull/12494) [qt-webengine] Fix building with vs2017 (by @Neumann-A) +- [(#11376)](https://github.com/microsoft/vcpkg/pull/11376) [avro-cpp] new port (by @alexander-smyslov) +- [(#11535)](https://github.com/microsoft/vcpkg/pull/11535) [mpg123] Allow cross-compiling, fix previous builds tainting rebuilds (by @kevinlul) +- [(#12624)](https://github.com/microsoft/vcpkg/pull/12624) Fix .gitignore excluding triplets/community, sort, and driveby vcpkg_check_linkage.md doc bug. (by @BillyONeal) +- [(#12423)](https://github.com/microsoft/vcpkg/pull/12423) [vcpkg] Add environment variable VCPKG_DEFAULT_BINARY_CACHE (by @Neumann-A) +- [(#10670)](https://github.com/microsoft/vcpkg/pull/10670) [vcpkg] Fix [boost] find_package for MSVC2013 / v120 (by @ManuelKugelmann) +- [(#12471)](https://github.com/microsoft/vcpkg/pull/12471) [vcpkg format-manifest] Add convert-control flag (by @strega-nil) +- [(#11208)](https://github.com/microsoft/vcpkg/pull/11208) [ITK] Update to 5.1 (by @Neumann-A) +- [(#12742)](https://github.com/microsoft/vcpkg/pull/12742) [wavpack] Fix failure on linux and osx (by @PhoebeHui) +- [(#12727)](https://github.com/microsoft/vcpkg/pull/12727) [msbuild] Revert the importance to Normal (by @PhoebeHui) +- [(#12717)](https://github.com/microsoft/vcpkg/pull/12717) [vcpkg] Fix prettify output not working in some cases (by @Deadpikle) +- [(#12715)](https://github.com/microsoft/vcpkg/pull/12715) [vcpkg] Add VCPKG_TARGET_IS_IOS (by @Deadpikle) +- [(#12716)](https://github.com/microsoft/vcpkg/pull/12716) [vcpkg] Fix arm64-osx triplet not building for arm64 (by @Deadpikle) +- [(#12701)](https://github.com/microsoft/vcpkg/pull/12701) [vcpkg-ci-paraview] move into scripts/test_ports (by @Neumann-A) +- [(#12699)](https://github.com/microsoft/vcpkg/pull/12699) [vcpkg baseline] remove qt translations from skip list (by @Neumann-A) +- [(#12695)](https://github.com/microsoft/vcpkg/pull/12695) [ngspice] Initial port (by @marekr) +- [(#12678)](https://github.com/microsoft/vcpkg/pull/12678) [vcpkg] Add missing check for x86 (by @arves100) +- [(#12752)](https://github.com/microsoft/vcpkg/pull/12752) [vcpkg_build_qmake] Disable multi-threaded build when file fails to open (by @JackBoosY) +- [(#12789)](https://github.com/microsoft/vcpkg/pull/12789) [vcpkg] Fix vs2015 build (by @strega-nil) +- [(#12312)](https://github.com/microsoft/vcpkg/pull/12312) [fmt] Update to 7.0.2 + [spdlog] Update to 1.7.0 (by @kevinlul) +- [(#12515)](https://github.com/microsoft/vcpkg/pull/12515) [pangolin] Fix build failure on UNIX (by @JackBoosY) +- [(#12792)](https://github.com/microsoft/vcpkg/pull/12792) [log4cpp] Fix header file install path (by @LilyWangL) +- [(#12784)](https://github.com/microsoft/vcpkg/pull/12784) [gSoap] Update to 2.8.105 and add a required shared directory (by @xgcssch) +- [(#12768)](https://github.com/microsoft/vcpkg/pull/12768) [libtorrent] Update to 1.2.8 (by @FranciscoPombal) +- [(#12762)](https://github.com/microsoft/vcpkg/pull/12762) [boost] Add Supports fields and more accurately handle arm64-windows/x64-uwp (by @ras0219) +- [(#12630)](https://github.com/microsoft/vcpkg/pull/12630) [secp256k1] Fix build failures and export cmake targets (by @PhoebeHui) +- [(#12524)](https://github.com/microsoft/vcpkg/pull/12524) [asmjit] Update to the latest commit (by @ZehMatt) +- [(#12528)](https://github.com/microsoft/vcpkg/pull/12528) [libass] Fix build error on x64-windows-static (by @LilyWangL) +- [(#12634)](https://github.com/microsoft/vcpkg/pull/12634) [vcpkg] Improving android support (by @christophe-calmejane) +- [(#9162)](https://github.com/microsoft/vcpkg/pull/9162) [crashrpt] Add new port (by @tbdrake) +- [(#12810)](https://github.com/microsoft/vcpkg/pull/12810) [vcpkg] Make C++ the primary github language (by @strega-nil) +- [(#12198)](https://github.com/microsoft/vcpkg/pull/12198) [vcpkg] Add `vcpkg export` to E2E tests. Enable E2E tests on all platforms. (by @ras0219) +- [(#12698)](https://github.com/microsoft/vcpkg/pull/12698) [vcpkg] Rewrite CMake build system to be more target-based (by @strega-nil) +- [(#12776)](https://github.com/microsoft/vcpkg/pull/12776) [vcpkg_copy_tool_dependencies] Use vcpkg internal powershell (by @JackBoosY) +- [(#12805)](https://github.com/microsoft/vcpkg/pull/12805) [lapack-reference|fortran] Add new port (by @Neumann-A) +- [(#12829)](https://github.com/microsoft/vcpkg/pull/12829) [vcpkg] Fix resolution of default features when using Manifest mode (by @ras0219) +- [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues (by @Neumann-A) +- [(#12818)](https://github.com/microsoft/vcpkg/pull/12818) [constexpr-contracts] Adds new port (by @cjdb) +- [(#12876)](https://github.com/microsoft/vcpkg/pull/12876) [vcpkg] Reduce dependencies and contents of vcpkgpaths.h (by @ras0219) +- [(#12866)](https://github.com/microsoft/vcpkg/pull/12866) [msys] Improve vcpkg_acquire_msys (by @PhoebeHui) +- [(#12897)](https://github.com/microsoft/vcpkg/pull/12897) [vcpkg] Restore layering and purge unused ParagraphParseResult (by @ras0219) +- [(#12895)](https://github.com/microsoft/vcpkg/pull/12895) [vcpkg_find_acquire_program] add version check for ninja (by @Neumann-A) +- [(#12927)](https://github.com/microsoft/vcpkg/pull/12927) [meson] Update meson to 0.55.1 (by @Neumann-A) +- [(#12837)](https://github.com/microsoft/vcpkg/pull/12837) Fix/clang10 linux (by @ignacionr) +- [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) (by @NancyLi1013) +- [(#12774)](https://github.com/microsoft/vcpkg/pull/12774) [vcpkg] Use std::filesystem when Visual Studio is greater than 2015 (by @JackBoosY) +- [(#12626)](https://github.com/microsoft/vcpkg/pull/12626) [vcpkg_find_acquire_program] Enable find_acquire(PKGCONFIG) (by @ras0219) +- [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. (by @Sibras) +- [(#12864)](https://github.com/microsoft/vcpkg/pull/12864) [vcpkg_execute_build_process] Re-fix qt5 components build (by @JackBoosY) +- [(#13000)](https://github.com/microsoft/vcpkg/pull/13000) [vcpkg] Fix baseline (by @NancyLi1013) +- [(#12985)](https://github.com/microsoft/vcpkg/pull/12985) [vcpkg] Add Forward Declarations (originally by @cngzhnp) (by @strega-nil) +- [(#12976)](https://github.com/microsoft/vcpkg/pull/12976) [vcpkg] Update hint message (by @PhoebeHui) +- [(#12974)](https://github.com/microsoft/vcpkg/pull/12974) [fluidsynth/redis-plus-plus] Update to the latest released version (by @NancyLi1013) +- [(#13017)](https://github.com/microsoft/vcpkg/pull/13017) remove registries.h and fwd/registries.h... (by @strega-nil) +- [(#12975)](https://github.com/microsoft/vcpkg/pull/12975) [openmpi/vcpkg_build_make] Disable parallel build (by @JackBoosY) +- [(#13043)](https://github.com/microsoft/vcpkg/pull/13043) [vcpkg] Fix hint message (by @PhoebeHui) +- [(#12046)](https://github.com/microsoft/vcpkg/pull/12046) [portmidi] Updated portmidi package to use alternative code source (by @stekyne) +- [(#13066)](https://github.com/microsoft/vcpkg/pull/13066) [typo] Fix incorrect Path in readme (by @ninjaoflight) +- [(#12910)](https://github.com/microsoft/vcpkg/pull/12910) [vcpkg] Fix editable bug (by @ras0219) +- [(#12523)](https://github.com/microsoft/vcpkg/pull/12523) [vcpkg.cmake] check for vcpkg.json only in `${CMAKE_SOURCE_DIR}` (by @strega-nil) +- [(#12964)](https://github.com/microsoft/vcpkg/pull/12964) [vcpkg] Do not use raw paths inside regexes (by @hanst99) +- [(#13092)](https://github.com/microsoft/vcpkg/pull/13092) [vcpkg] Hotfix regression in #12523 (by @ras0219) +- [(#13067)](https://github.com/microsoft/vcpkg/pull/13067) Sort file lists and failure logs together. (by @BillyONeal) +- [(#12738)](https://github.com/microsoft/vcpkg/pull/12738) [vcpkg] Use https sources for common tools (by @janisozaur) +- [(#13058)](https://github.com/microsoft/vcpkg/pull/13058) [Box2d] Update to 2.4.0 (by @JonLiu1993) +- [(#12977)](https://github.com/microsoft/vcpkg/pull/12977) fix vcpkg_configure_cmake for case when having semicolons in OPTIONS (by @jgehw) +- [(#12950)](https://github.com/microsoft/vcpkg/pull/12950) [vcpkg] Fix build on older compilers. (by @huahang) +- [(#13104)](https://github.com/microsoft/vcpkg/pull/13104) [vcpkg] Fix vcpkg_acquire_msys failing on path with spaces (by @SupSuper) +- [(#13125)](https://github.com/microsoft/vcpkg/pull/13125) Disable fluidlite in CI. (by @BillyONeal) +- [(#13117)](https://github.com/microsoft/vcpkg/pull/13117) [vcpkg] Fix #13094 by avoiding the comma operator. (by @BillyONeal) +- [(#13107)](https://github.com/microsoft/vcpkg/pull/13107) [VMSS] Fix the printed error message (by @JackBoosY) +- [(#13069)](https://github.com/microsoft/vcpkg/pull/13069) [vcpkg] Fix upgrade for port-version (by @strega-nil) +- [(#12982)](https://github.com/microsoft/vcpkg/pull/12982) [vcpkg_find_acquire_program] Cleanup and add CI testing (by @ras0219) +- [(#13142)](https://github.com/microsoft/vcpkg/pull/13142) Allow use of VS LLVM clang-format. (by @BillyONeal) +- [(#13148)](https://github.com/microsoft/vcpkg/pull/13148) [baseline] Skip check of clapack:x64-osx in the baseline (by @JackBoosY) + +
+The following 59 ports have been added: + +|port|version| +|---|---| +|[nanobench](https://github.com/microsoft/vcpkg/pull/11955)| 4.0.0 +|[cgns](https://github.com/microsoft/vcpkg/pull/9960)| 3.4.0-1 +|[paraview](https://github.com/microsoft/vcpkg/pull/9960)[#12067](https://github.com/microsoft/vcpkg/pull/12067) [#12144](https://github.com/microsoft/vcpkg/pull/12144) [#12149](https://github.com/microsoft/vcpkg/pull/12149) [#11596](https://github.com/microsoft/vcpkg/pull/11596) [#12342](https://github.com/microsoft/vcpkg/pull/12342) | 5.8.0-2 +|[drogon](https://github.com/microsoft/vcpkg/pull/12024)[#12931](https://github.com/microsoft/vcpkg/pull/12931) [#13007](https://github.com/microsoft/vcpkg/pull/13007) | v1.0.0-beta21 +|[libxdiff](https://github.com/microsoft/vcpkg/pull/12017)| 0.23 +|[efsw](https://github.com/microsoft/vcpkg/pull/11901)| 2020-06-08 +|[bitmagic](https://github.com/microsoft/vcpkg/pull/11890)| 6.4.0 +|[tgbot-cpp](https://github.com/microsoft/vcpkg/pull/11876)| 1.2.1 +|[ignition-plugin1](https://github.com/microsoft/vcpkg/pull/11275)| 1.1.0 +|[ppmagic](https://github.com/microsoft/vcpkg/pull/12253)| 2020-07-03 +|[getdns](https://github.com/microsoft/vcpkg/pull/12090)| 1.6.0 +|[font-chef](https://github.com/microsoft/vcpkg/pull/12293)| 1.0.1 +|[implot](https://github.com/microsoft/vcpkg/pull/11920)[#12835](https://github.com/microsoft/vcpkg/pull/12835) | 0.4 +|[threadpool](https://github.com/microsoft/vcpkg/pull/11650)| 0.2.5 +|[mygui](https://github.com/microsoft/vcpkg/pull/11991)| 2020-06-17 +|[kfr](https://github.com/microsoft/vcpkg/pull/8322)| 2020-06-15 +|[meshoptimizer](https://github.com/microsoft/vcpkg/pull/12211)| 0.14 +|[edlib](https://github.com/microsoft/vcpkg/pull/12490)| 1.2.6 +|[neargye-semver](https://github.com/microsoft/vcpkg/pull/12406)| 0.2.2 +|[marble](https://github.com/microsoft/vcpkg/pull/8628)| 19.08.2 +|[simple-fft](https://github.com/microsoft/vcpkg/pull/11929)| 2020-06-14 +|[stx](https://github.com/microsoft/vcpkg/pull/12011)| 1.0.1 +|[rsocket](https://github.com/microsoft/vcpkg/pull/11021)| 2020.05.04.00-1 +|[brpc](https://github.com/microsoft/vcpkg/pull/11524)| 0.9.7 +|[gamedev-framework](https://github.com/microsoft/vcpkg/pull/12426)[#12680](https://github.com/microsoft/vcpkg/pull/12680) | 0.17 +|[tomlplusplus](https://github.com/microsoft/vcpkg/pull/10786)[#12859](https://github.com/microsoft/vcpkg/pull/12859) | 2.1.0 +|[vcpkg-ci-paraview](https://github.com/microsoft/vcpkg/pull/12342)| 1 +|[avro-cpp](https://github.com/microsoft/vcpkg/pull/11376)| 1.9.2 +|[xframe](https://github.com/microsoft/vcpkg/pull/12427)| 0.3.0 +|[minc](https://github.com/microsoft/vcpkg/pull/11208)| 2.4.03 +|[nifticlib](https://github.com/microsoft/vcpkg/pull/11208)| 2020-04-30 +|[ngspice](https://github.com/microsoft/vcpkg/pull/12695)| 32 +|[josuttis-jthread](https://github.com/microsoft/vcpkg/pull/12497)[#13040](https://github.com/microsoft/vcpkg/pull/13040) | 2020-07-21 +|[lapack](https://github.com/microsoft/vcpkg/pull/12464)[#12805](https://github.com/microsoft/vcpkg/pull/12805) | 1 +|[qwtw](https://github.com/microsoft/vcpkg/pull/12748)[#12961](https://github.com/microsoft/vcpkg/pull/12961) | 3.1.0 +|[cppad](https://github.com/microsoft/vcpkg/pull/12560)| 20200000.3 +|[kf5completion](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5config](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5coreaddons](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5crash](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5guiaddons](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5i18n](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5itemmodels](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5itemviews](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5widgetsaddons](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[kf5windowsystem](https://github.com/microsoft/vcpkg/pull/11861)| 5.64.0 +|[libde265](https://github.com/microsoft/vcpkg/pull/11861)| 1.0.5 +|[libheif](https://github.com/microsoft/vcpkg/pull/11861)[#12856](https://github.com/microsoft/vcpkg/pull/12856) | 1.7.0 +|[quazip](https://github.com/microsoft/vcpkg/pull/11861)| 0.9.1 +|[vc](https://github.com/microsoft/vcpkg/pull/11861)| 1.4.1 +|[tlx](https://github.com/microsoft/vcpkg/pull/11943)| 0.5.20191212 +|[crashrpt](https://github.com/microsoft/vcpkg/pull/9162)| 1.4.3 +|[dbghelp](https://github.com/microsoft/vcpkg/pull/9162)| 0.0 +|[opencolorio-tools](https://github.com/microsoft/vcpkg/pull/12420)| 1.1.1 +|[lapack-reference](https://github.com/microsoft/vcpkg/pull/12805)[#12977](https://github.com/microsoft/vcpkg/pull/12977) [#12929](https://github.com/microsoft/vcpkg/pull/12929) | 3.8.0 +|[vcpkg-gfortran](https://github.com/microsoft/vcpkg/pull/12805)| 1 +|[constexpr-contracts](https://github.com/microsoft/vcpkg/pull/12818)| 2020-08-09 +|[fluidlite](https://github.com/microsoft/vcpkg/pull/13006)[#13125](https://github.com/microsoft/vcpkg/pull/13125) | 2020-08-20 +|[boost-uninstall](https://github.com/microsoft/vcpkg/pull/12851)| 1.73.0 +
+ +
+The following 345 ports have been updated: + +- slikenet `2019-10-22_1` -> `2019-10-22-2` + - [(#11987)](https://github.com/microsoft/vcpkg/pull/11987) [slikenet] Add cmake config and targets file + +- breakpad `2019-07-11-1` -> `2019-07-11-2` + - [(#11984)](https://github.com/microsoft/vcpkg/pull/11984) [breakpad] Fix build failure on OSX + +- plf-colony `2019-08-10` -> `5.33` + - [(#11993)](https://github.com/microsoft/vcpkg/pull/11993) [plf-colony] Update to 5.33 + +- thrift `2020-02-08` -> `0.13.0` + - [(#11981)](https://github.com/microsoft/vcpkg/pull/11981) [thrift] Update to 0.13.0 and fix OSX build + +- libvpx `1.8.1-5` -> `1.8.1-7` + - [(#11963)](https://github.com/microsoft/vcpkg/pull/11963) [libvpx] Support arm64-windows + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + - [(#12401)](https://github.com/microsoft/vcpkg/pull/12401) [liblzma, libvpx] Add mingw support + - [(#12706)](https://github.com/microsoft/vcpkg/pull/12706) [libvpx] fix pdb paths + +- libzip `rel-1-6-1` -> `1.7.1` + - [(#11982)](https://github.com/microsoft/vcpkg/pull/11982) [libzip] Update to 1.7.1 + - [(#12610)](https://github.com/microsoft/vcpkg/pull/12610) [libzip] Fix find_package error + +- directxtex `jun2020` -> `jun2020b` + - [(#11971)](https://github.com/microsoft/vcpkg/pull/11971) [directxtk12][directxtex] Update to latest version + - [(#12332)](https://github.com/microsoft/vcpkg/pull/12332) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + - [(#13060)](https://github.com/microsoft/vcpkg/pull/13060) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- directxtk12 `jun2020` -> `jun2020b` + - [(#11971)](https://github.com/microsoft/vcpkg/pull/11971) [directxtk12][directxtex] Update to latest version + - [(#12332)](https://github.com/microsoft/vcpkg/pull/12332) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + - [(#13060)](https://github.com/microsoft/vcpkg/pull/13060) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- geographiclib `1.47-patch1-12` -> `1.47-patch1-16` + - [(#11965)](https://github.com/microsoft/vcpkg/pull/11965) [vcpkg baseline] Retrigger failed ports in baseline + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12379)](https://github.com/microsoft/vcpkg/pull/12379) [geographiclib] Update to 1.50.1 + - [(#12471)](https://github.com/microsoft/vcpkg/pull/12471) [vcpkg format-manifest] Add convert-control flag + +- polyclipping `6.4.2` -> `6.4.2-4` + - [(#11965)](https://github.com/microsoft/vcpkg/pull/11965) [vcpkg baseline] Retrigger failed ports in baseline + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- qhull `7.3.2-2` -> `8.0.0` + - [(#12015)](https://github.com/microsoft/vcpkg/pull/12015) [qhull] update version 8.0.0 + +- jsoncons `0.153.0` -> `0.155.1` + - [(#12014)](https://github.com/microsoft/vcpkg/pull/12014) [jsoncons] Update to v0.153.3 + - [(#12372)](https://github.com/microsoft/vcpkg/pull/12372) [jsoncons] Update to v0.154.1 + - [(#12827)](https://github.com/microsoft/vcpkg/pull/12827) [jsoncons] Update to version 0.155.1 + +- azure-c-shared-utility `2020-02-04.1` -> `2020-07-19` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + - [(#12493)](https://github.com/microsoft/vcpkg/pull/12493) [Azure-IoT-Sdk*] Update to 2020-07-19 + +- azure-iot-sdk-c `2020-02-04.1-1` -> `2020-07-19` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + - [(#12209)](https://github.com/microsoft/vcpkg/pull/12209) [azure-iot-sdk-c] Fix feature name and enable to build + - [(#12493)](https://github.com/microsoft/vcpkg/pull/12493) [Azure-IoT-Sdk*] Update to 2020-07-19 + - [(#12605)](https://github.com/microsoft/vcpkg/pull/12605) [azure-iot-sdk-c] Fix passing hsm_type_symm_key + +- azure-macro-utils-c `2020-02-04.1` -> `2020-06-17-1` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + +- azure-uamqp-c `2020-02-04.1` -> `2020-07-19` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + - [(#12493)](https://github.com/microsoft/vcpkg/pull/12493) [Azure-IoT-Sdk*] Update to 2020-07-19 + +- azure-uhttp-c `2020-02-04.1` -> `2020-07-19` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + - [(#12493)](https://github.com/microsoft/vcpkg/pull/12493) [Azure-IoT-Sdk*] Update to 2020-07-19 + +- azure-umqtt-c `2020-02-04.1` -> `2020-07-19` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + - [(#12493)](https://github.com/microsoft/vcpkg/pull/12493) [Azure-IoT-Sdk*] Update to 2020-07-19 + +- umock-c `2020-02-04.1` -> `2020-06-17-1` + - [(#12013)](https://github.com/microsoft/vcpkg/pull/12013) [Azure-IoT-Sdk] Update to release 2020-06-17 + +- tinyxml2 `8.0.0` -> `8.0.0-1` + - [(#11966)](https://github.com/microsoft/vcpkg/pull/11966) [tinyxml2] Fix generation of pkg-config file + +- nlohmann-json `3.7.3` -> `3.9.1` + - [(#11941)](https://github.com/microsoft/vcpkg/pull/11941) [nlohmann-json] Upgrade to 3.8.0 + - [(#12117)](https://github.com/microsoft/vcpkg/pull/12117) [nlohmann-json] Always install multiple headers to allow forward declarations + - [(#12601)](https://github.com/microsoft/vcpkg/pull/12601) [nlohmann-json] Update to 3.9.0 + - [(#12787)](https://github.com/microsoft/vcpkg/pull/12787) [nlohmann-json] Update to 3.9.1 + +- trantor `v1.0.0-rc13` -> `v1.0.0-rc16` + - [(#11937)](https://github.com/microsoft/vcpkg/pull/11937) [trantor] Bump version to v1.0.0-rc14 + - [(#12930)](https://github.com/microsoft/vcpkg/pull/12930) [trantor] Update to 1.0.0-rc16 + +- graphicsmagick `1.3.35` -> `1.3.35-2` + - [(#11926)](https://github.com/microsoft/vcpkg/pull/11926) [graphicsmagick] fix Magick++.h header location. + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + +- bitsery `5.0.3` -> `5.1.0` + - [(#11912)](https://github.com/microsoft/vcpkg/pull/11912) [bitsery] Update to 5.1.0 version + +- skyr-url `1.10.0` -> `1.12.0` + - [(#11911)](https://github.com/microsoft/vcpkg/pull/11911) [skyr-url] Updated version number of skyr-url + - [(#12214)](https://github.com/microsoft/vcpkg/pull/12214) [skyr-url] Changed version number to 1.12.0 + +- vtk `9.0-2` -> `9.0.1` + - [(#9960)](https://github.com/microsoft/vcpkg/pull/9960) [CGNS/ParaView] Add new ports + - [(#12067)](https://github.com/microsoft/vcpkg/pull/12067) [vcpkg baseline] Fix baseline errors + - [(#11399)](https://github.com/microsoft/vcpkg/pull/11399) [vtk] Added opengl feature. + - [(#12149)](https://github.com/microsoft/vcpkg/pull/12149) [vtk] update to 9.0.1 + - [(#12472)](https://github.com/microsoft/vcpkg/pull/12472) [vtk|cuda] add nvcc to the path + - [(#12342)](https://github.com/microsoft/vcpkg/pull/12342) [qt5-base] Add zstd as a dependency + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- so5extra `1.4.0` -> `1.4.1` + - [(#12052)](https://github.com/microsoft/vcpkg/pull/12052) [so5extra] update to v.1.4.1. + +- sobjectizer `5.7.0.1` -> `5.7.1` + - [(#12051)](https://github.com/microsoft/vcpkg/pull/12051) [SObjectizer] update to v.5.7.1. + +- field3d `1.7.2` -> `1.7.3` + - [(#11747)](https://github.com/microsoft/vcpkg/pull/11747) [hdf5] Update HDF5 to 1.12 + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + - [(#12342)](https://github.com/microsoft/vcpkg/pull/12342) [qt5-base] Add zstd as a dependency + +- hdf5 `1.10.5-12` -> `1.12.0` + - [(#11747)](https://github.com/microsoft/vcpkg/pull/11747) [hdf5] Update HDF5 to 1.12 + +- freerdp `2.0.0-1` -> `2.1.1-1` + - [(#12050)](https://github.com/microsoft/vcpkg/pull/12050) [freerdp] Update to version 2.1.1 + - [(#12037)](https://github.com/microsoft/vcpkg/pull/12037) [freerdp] Fix x64-osx triplet + +- openal-soft `1.20.1-1` -> `1.20.1-2` + - [(#12047)](https://github.com/microsoft/vcpkg/pull/12047) [openal-soft] Fix build failure by updating the library + - [(#12318)](https://github.com/microsoft/vcpkg/pull/12318) [openal-soft] Revert #12047 + - [(#12103)](https://github.com/microsoft/vcpkg/pull/12103) Mingw port fixes + +- absent `0.3.0` -> `0.3.1` + - [(#12036)](https://github.com/microsoft/vcpkg/pull/12036) [absent] Bump version 0.3.1 + +- cjson `2019-11-30` -> `2019-11-30-1` + - [(#12026)](https://github.com/microsoft/vcpkg/pull/12026) [cjson] fix windows-static for don't export symbols + +- open62541 `1.0.1` -> `1.1` + - [(#12023)](https://github.com/microsoft/vcpkg/pull/12023) [open62541] update to v1.1, add encryption support + +- abseil `2020-03-03-6` -> `2020-03-03-7` + - [(#12022)](https://github.com/microsoft/vcpkg/pull/12022) [abseil] Fix usage issue + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12471)](https://github.com/microsoft/vcpkg/pull/12471) [vcpkg format-manifest] Add convert-control flag + - [(#12781)](https://github.com/microsoft/vcpkg/pull/12781) [abseil] Fix CMake warning + +- nowide `10.0.1` -> `11.0.0` + - [(#12020)](https://github.com/microsoft/vcpkg/pull/12020) [nowide] Update to 11.0.0 + +- cpp-httplib `0.5.1` -> `0.7.0` + - [(#12010)](https://github.com/microsoft/vcpkg/pull/12010) [cpp-httplib] Update library to 0.7.0 + +- openmesh `8.0` -> `8.1` + - [(#12007)](https://github.com/microsoft/vcpkg/pull/12007) [openmesh] Fix install *.dll and add vcpkg-cmake-wrapper.cmake + - [(#11739)](https://github.com/microsoft/vcpkg/pull/11739) [openmesh] Upgrade to 8.1 + +- cpprestsdk `2.10.16-2` -> `2.10.16-3` + - [(#12006)](https://github.com/microsoft/vcpkg/pull/12006) [cpprestsdk] Fix usage issue when building static + +- activemq-cpp `3.9.5-2` -> `3.9.5-3` + - [(#12005)](https://github.com/microsoft/vcpkg/pull/12005) [activemq-cpp] Fix static build + +- date `2019-11-08` -> `3.0.0` + - [(#11968)](https://github.com/microsoft/vcpkg/pull/11968) [date] Update to 3.0.0 + - [(#12739)](https://github.com/microsoft/vcpkg/pull/12739) [date] Fix config.cmake and usage + +- libmicrohttpd `0.9.63-2` -> `0.9.63-3` + - [(#11983)](https://github.com/microsoft/vcpkg/pull/11983) [libmicrohttpd] Support build on UNIX and use msbuild on Windows + - [(#12455)](https://github.com/microsoft/vcpkg/pull/12455) [libmicrohttpd] Add `platform.h` to restricted header list. + +- llvm `10.0.0-3` -> `10.0.0-4` + - [(#11956)](https://github.com/microsoft/vcpkg/pull/11956) [llvm] fix issue #11916 + +- ffmpeg `4.2-10` -> `4.2-13` + - [(#11946)](https://github.com/microsoft/vcpkg/pull/11946) [ffmpeg] Add avisynthplus support + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + - [(#12083)](https://github.com/microsoft/vcpkg/pull/12083) [ffmpeg] Allow gpl builds without avisynthplus + - [(#12063)](https://github.com/microsoft/vcpkg/pull/12063) [ffmpeg] Fix tools dependency dll file + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + - [(#12635)](https://github.com/microsoft/vcpkg/pull/12635) [ffmpeg] fix FindFFMPEG.cmake to work properly even without avresample + - [(#12843)](https://github.com/microsoft/vcpkg/pull/12843) [ffmpeg] Some libraries in ffmpeg can be optional + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + - [(#13004)](https://github.com/microsoft/vcpkg/pull/13004) [ffmpeg] fix cmake module + +- imgui `1.76-1` -> `1.78` + - [(#11919)](https://github.com/microsoft/vcpkg/pull/11919) [imgui] Add Freetype feature + - [(#12155)](https://github.com/microsoft/vcpkg/pull/12155) [imgui] Update to 1.77 + - [(#12329)](https://github.com/microsoft/vcpkg/pull/12329) [imgui] Split bindings to multiple features + - [(#12210)](https://github.com/microsoft/vcpkg/pull/12210) [ogre] Update to version 1.12.7 and fix link error + - [(#12890)](https://github.com/microsoft/vcpkg/pull/12890) [imgui] Add messages for unsupported features + - [(#13064)](https://github.com/microsoft/vcpkg/pull/13064) [imgui] Update to 1.78 + - [(#12691)](https://github.com/microsoft/vcpkg/pull/12691) [libigl] fix imgui feature + +- x265 `3.2-3` -> `3.4` + - [(#11903)](https://github.com/microsoft/vcpkg/pull/11903) [x265] Delete the bin directory if the platform is Linux + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + - [(#13048)](https://github.com/microsoft/vcpkg/pull/13048) [x265] Update source and version + +- wtl `10.0-5` -> `10.0.10077` + - [(#11893)](https://github.com/microsoft/vcpkg/pull/11893) [wtl] Update to 10.0.10077 + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12688)](https://github.com/microsoft/vcpkg/pull/12688) [wtl ] Upgrade wtl to 10.0.10077. + +- icu `67.1` -> `67.1-2` + - [(#11897)](https://github.com/microsoft/vcpkg/pull/11897) [icu] Add tools + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + +- cairo `1.16.0-4` -> `1.16.0-6` + - [(#11829)](https://github.com/microsoft/vcpkg/pull/11829) [cairo] Fix error in static build + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- pango `1.40.11-6` -> `1.40.11-7` + - [(#11829)](https://github.com/microsoft/vcpkg/pull/11829) [cairo] Fix error in static build + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- grpc `1.28.1-1` -> `1.31.1` + - [(#11791)](https://github.com/microsoft/vcpkg/pull/11791) [grpc] Update to 1.29.1 + - [(#12611)](https://github.com/microsoft/vcpkg/pull/12611) [grpc] Fix generate plugin grpc_csharp_ext + - [(#12920)](https://github.com/microsoft/vcpkg/pull/12920) [grpc] grpc v1.30.2 + - [(#13084)](https://github.com/microsoft/vcpkg/pull/13084) [grpc][upb][re2] grpc v1.31.1 + +- offscale-libetcd-cpp `2019-07-10` -> `2019-07-10-1` + - [(#11791)](https://github.com/microsoft/vcpkg/pull/11791) [grpc] Update to 1.29.1 + +- stlab `1.5.2` -> `1.5.2-1` + - [(#11787)](https://github.com/microsoft/vcpkg/pull/11787) [stlab] Fix cmake config file + +- ffnvcodec `9.1.23.1` -> `9.1.23.1-1` + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- libpq `12.2-2` -> `12.2-3` + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + - [(#12415)](https://github.com/microsoft/vcpkg/pull/12415) [libpq] Remove broken features + - [(#12674)](https://github.com/microsoft/vcpkg/pull/12674) [libpq] only require bison and flex on Windows + +- tensorflow-cc `1.14-2` -> `1.14-3` + - [(#12080)](https://github.com/microsoft/vcpkg/pull/12080) Fix bootstrapping MSYS2 pacman (#11499) + - [(#12546)](https://github.com/microsoft/vcpkg/pull/12546) [tensorflow-cc] fix build issues on Windows + +- ignition-modularscripts `2020-05-09` -> `2020-05-16` + - [(#11275)](https://github.com/microsoft/vcpkg/pull/11275) [ignition-plugin1] Add new port 🤖 + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + +- apr `1.7.0` -> `1.7.0-1` + - [(#12067)](https://github.com/microsoft/vcpkg/pull/12067) [vcpkg baseline] Fix baseline errors + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + +- argtable2 `2.13-4` -> `2.13-7` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- cunit `2.1.3-3` -> `2.1.3-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- epsilon `0.9.2-1` -> `0.9.2-4` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- freeglut `3.2.1-1` -> `3.2.1-4` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- freeimage `3.18.0-9` -> `3.18.0-12` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + +- giflib `5.1.4-3` -> `5.1.4-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- gsoap `2.8.102` -> `2.8.105` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12784)](https://github.com/microsoft/vcpkg/pull/12784) [gSoap] Update to 2.8.105 and add a required shared directory + +- healpix `1.12.10-1` -> `1.12.10-5` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- irrlicht `1.8.4-5` -> `1.8.4-8` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#13137)](https://github.com/microsoft/vcpkg/pull/13137) [irrlicht] Patch moved sysctl.h header file + +- itpp `4.3.1-2` -> `4.3.1-5` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libaiff `5.0-3` -> `5.0-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libdisasm `0.23-3` -> `0.23-7` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libmad `0.15.1-5` -> `0.15.1-8` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libmikmod `3.3.11.1-5` -> `3.3.11.1-8` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libsquish `1.15-3` -> `1.15-7` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libssh `0.9.3-1` -> `0.9.3-2` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + +- libusb-win32 `1.2.6.0-3` -> `1.2.6.0-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libuuid `1.0.3-4` -> `1.0.3-7` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- libxmp-lite `4.4.1-3` -> `4.4.1-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- mathgl `2.4.3-3` -> `2.4.3-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- mp3lame `3.100` -> `3.100-3` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- mpg123 `1.25.8-10` -> `1.25.8-12` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12287)](https://github.com/microsoft/vcpkg/pull/12287) [mpg123] Update portfile.cmake to accomodate OpenSUSE 15.x /lib /lib64 + - [(#11535)](https://github.com/microsoft/vcpkg/pull/11535) [mpg123] Allow cross-compiling, fix previous builds tainting rebuilds + +- pcre `8.44-1` -> `8.44-4` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12252)](https://github.com/microsoft/vcpkg/pull/12252) [pcre] Use vcpkg_from_sourceforge as a fallback + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12629)](https://github.com/microsoft/vcpkg/pull/12629) [pcre] Fix installation when only building release + +- pcre2 `10.30-7` -> `10.35` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12233)](https://github.com/microsoft/vcpkg/pull/12233) [pcre2] Restore the https://ftp.pcre.org/ mirror in addition to the SourceForge mirrors. + - [(#11754)](https://github.com/microsoft/vcpkg/pull/11754) [pcre2] Update to 10.35 + - [(#12347)](https://github.com/microsoft/vcpkg/pull/12347) [pcre2] Fix -mshstk needed with -fcf-protection + +- plplot `5.13.0-5` -> `5.13.0-8` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- podofo `0.9.6-8` -> `0.9.6-9` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- portmidi `0.217.1-1` -> `0.234` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12046)](https://github.com/microsoft/vcpkg/pull/12046) [portmidi] Updated portmidi package to use alternative code source + +- pthreads `3.0.0-5` -> `3.0.0-6` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + +- qt5-base `5.12.8-4` -> `5.15.0` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12153)](https://github.com/microsoft/vcpkg/pull/12153) [qt5-base] fix static init fiasco and fix debug dll's not being copied + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + - [(#12342)](https://github.com/microsoft/vcpkg/pull/12342) [qt5-base] Add zstd as a dependency + - [(#12752)](https://github.com/microsoft/vcpkg/pull/12752) [vcpkg_build_qmake] Disable multi-threaded build when file fails to open + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- qwt `6.1.3-11` -> `6.1.4` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + +- rapidxml `1.13-1` -> `1.13-4` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- sigslot `1.0.0` -> `1.0.0-3` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- soxr `0.1.3.` -> `0.1.3-2` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + +- tclap `1.2.2-2` -> `1.2.2-3` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + +- tinyfiledialogs `3.4.3-2` -> `3.6.3` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12137)](https://github.com/microsoft/vcpkg/pull/12137) [tinyfiledialogs] Update version and download path to v3.6.3 + +- tinyxml `2.6.2-4` -> `2.6.2-7` + - [(#11899)](https://github.com/microsoft/vcpkg/pull/11899) [vcpkg] Add vcpkg_from_sourceforge (1/2) + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- openssl-unix `1.1.1d-4` -> `1.1.1g` + - [(#11882)](https://github.com/microsoft/vcpkg/pull/11882) [openssl] Update openssl 1.1.1g - continued from PR #11003 + - [(#12544)](https://github.com/microsoft/vcpkg/pull/12544) [openssl-unix] Add mingw with dynamic libs support - take 2 + - [(#12867)](https://github.com/microsoft/vcpkg/pull/12867) [openssl] Interrupt the build process when files conflict + - [(#12986)](https://github.com/microsoft/vcpkg/pull/12986) [openssl-unix] Fix #12919 + - [(#12527)](https://github.com/microsoft/vcpkg/pull/12527) [openssl-unix] use xcrun for iOS triplet build + +- openssl-uwp `1.1.1d-1` -> `1.1.1g` + - [(#11882)](https://github.com/microsoft/vcpkg/pull/11882) [openssl] Update openssl 1.1.1g - continued from PR #11003 + - [(#12867)](https://github.com/microsoft/vcpkg/pull/12867) [openssl] Interrupt the build process when files conflict + +- openssl-windows `1.1.1d-2` -> `1.1.1g` + - [(#11882)](https://github.com/microsoft/vcpkg/pull/11882) [openssl] Update openssl 1.1.1g - continued from PR #11003 + - [(#12056)](https://github.com/microsoft/vcpkg/pull/12056) [openssl-windows] Added feature option to build openssl with no-pinshared flag + - [(#12867)](https://github.com/microsoft/vcpkg/pull/12867) [openssl] Interrupt the build process when files conflict + +- openssl `1.1.1d` -> `1.1.1g` + - [(#11882)](https://github.com/microsoft/vcpkg/pull/11882) [openssl] Update openssl 1.1.1g - continued from PR #11003 + - [(#12867)](https://github.com/microsoft/vcpkg/pull/12867) [openssl] Interrupt the build process when files conflict + +- cmocka `1.1.5-1` -> `1.1.5` + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + - [(#12828)](https://github.com/microsoft/vcpkg/pull/12828) [cmocka] Update to 2020-08-01 + +- libarchive `3.4.1-3` -> `3.4.1` + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + +- libiconv `1.16-3` -> `1.16` + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + +- libxml2 `2.9.9-6` -> `2.9.9` + - [(#11757)](https://github.com/microsoft/vcpkg/pull/11757) [vcpkg manifest] Manifest Implementation + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + +- suitesparse `5.4.0-5` -> `5.4.0-6` + - [(#11945)](https://github.com/microsoft/vcpkg/pull/11945) [suitesparse] Fixing `SuiteSparse_INCLUDE_DIRS` is not usable from the port. + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + +- boost-locale `1.73.0` -> `1.73.0-1` + - [(#10943)](https://github.com/microsoft/vcpkg/pull/10943) [boost-locale] Fix boost-locale failing to build with ICU + - [(#12762)](https://github.com/microsoft/vcpkg/pull/12762) [boost] Add Supports fields and more accurately handle arm64-windows/x64-uwp + +- monkeys-audio `5.38` -> `5.48` + - [(#12158)](https://github.com/microsoft/vcpkg/pull/12158) [monkeys-audio] Update to 5.46 + - [(#12690)](https://github.com/microsoft/vcpkg/pull/12690) [monkeys-audio] Update to 5.48 + +- google-cloud-cpp `1.14.0` -> `1.16.0` + - [(#12195)](https://github.com/microsoft/vcpkg/pull/12195) [google-cloud-cpp] Update to v1.15.0 + - [(#12747)](https://github.com/microsoft/vcpkg/pull/12747) [google-cloud-cpp] Update to v1.16.0 + +- infoware `0.5.3` -> `0.5.5` + - [(#12167)](https://github.com/microsoft/vcpkg/pull/12167) [infoware] Bump version to 0.5.4 + - [(#13010)](https://github.com/microsoft/vcpkg/pull/13010) [infoware] Bump version to 0.5.5 + +- sqlite3 `3.32.1` -> `3.32.3` + - [(#12185)](https://github.com/microsoft/vcpkg/pull/12185) update to sqlite3 3.32.3 + - [(#12516)](https://github.com/microsoft/vcpkg/pull/12516) [sqlite3] Namespaced targets with unofficial:: + - [(#11532)](https://github.com/microsoft/vcpkg/pull/11532) [sqlite3] Sqlite3 geopoly and json1 features + +- plibsys `0.0.4-3` -> `0.0.4` + - [(#12196)](https://github.com/microsoft/vcpkg/pull/12196) [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers + +- span-lite `0.5.0` -> `0.7.0` + - [(#12206)](https://github.com/microsoft/vcpkg/pull/12206) [span-lite] Update to 0.7.0 + +- safeint `3.23` -> `3.24` + - [(#12217)](https://github.com/microsoft/vcpkg/pull/12217) [safeint] Update to 3.24 + +- xerces-c `3.2.3` -> `3.2.3-1` + - [(#12205)](https://github.com/microsoft/vcpkg/pull/12205) [xerces-c] rename feature from xmlch_wchar to xmlch-wchar + +- libnice `0.1.15-3` -> `0.1.15-4` + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + +- opencc `2020-04-26-4` -> `2020-04-26-6` + - [(#12018)](https://github.com/microsoft/vcpkg/pull/12018) [vcpkg_from_sourceforge] Add retry mirror function (2/2) + - [(#12246)](https://github.com/microsoft/vcpkg/pull/12246) [opencc] Fix regression on pipeline + +- exiv2 `0.27.2-1` -> `0.27.3` + - [(#12278)](https://github.com/microsoft/vcpkg/pull/12278) [Exiv2] update to 0.27.3 + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- nanodbc `2.12.4-8` -> `2.12.4` + - [(#12274)](https://github.com/microsoft/vcpkg/pull/12274) [nanodbc] Set unixodbc as a dependency under non-Windows + +- doctest `2.3.7` -> `2.4.0` + - [(#12239)](https://github.com/microsoft/vcpkg/pull/12239) [doctest] update to 2.4.0 + +- opengl `0.0-6` -> `0.0-7` + - [(#12232)](https://github.com/microsoft/vcpkg/pull/12232) [opengl wincrypt winsock2] Use $ENV{WindowsSdkDir} instead of hard coding Windows SDK paths. + +- wincrypt `0.0-1` -> `0.0-2` + - [(#12232)](https://github.com/microsoft/vcpkg/pull/12232) [opengl wincrypt winsock2] Use $ENV{WindowsSdkDir} instead of hard coding Windows SDK paths. + +- winsock2 `0.0-1` -> `0.0-2` + - [(#12232)](https://github.com/microsoft/vcpkg/pull/12232) [opengl wincrypt winsock2] Use $ENV{WindowsSdkDir} instead of hard coding Windows SDK paths. + +- openvr `1.10.30` -> `1.12.5` + - [(#12219)](https://github.com/microsoft/vcpkg/pull/12219) [openvr] Update to 1.12.5 + +- utf8h `841cb2deb8eb806e73fff0e1f43a11fca4f5da45` -> `2020-06-14` + - [(#12218)](https://github.com/microsoft/vcpkg/pull/12218) [utf8h] Update to latest version + +- libyuv `fec9121-1` -> `fec9121-2` + - [(#12213)](https://github.com/microsoft/vcpkg/pull/12213) [libyuv] Find dependency port libjpeg-turbo + - [(#12338)](https://github.com/microsoft/vcpkg/pull/12338) [libyuv] Fix static build issue + +- polyhook2 `2020-06-02` -> `2020-08-04` + - [(#12189)](https://github.com/microsoft/vcpkg/pull/12189) [polyhook2] Update to latest + - [(#12524)](https://github.com/microsoft/vcpkg/pull/12524) [asmjit] Update to the latest commit + +- ace `6.5.9-5` -> `6.5.11` + - [(#12183)](https://github.com/microsoft/vcpkg/pull/12183) [ace] 6.5.10 + - [(#12954)](https://github.com/microsoft/vcpkg/pull/12954) [ace] Update to 6.5.11 + +- curl `7.68.0-3` -> `7.71.1` + - [(#12141)](https://github.com/microsoft/vcpkg/pull/12141) [curl] Update to 7.71.0 + - [(#12758)](https://github.com/microsoft/vcpkg/pull/12758) [curl] Fix tools + - [(#12800)](https://github.com/microsoft/vcpkg/pull/12800) [curl] Fix static build + +- robin-hood-hashing `3.4.0` -> `3.8.0` + - [(#12147)](https://github.com/microsoft/vcpkg/pull/12147) [robin-hood-hashing] Update to 3.7.0 + - [(#12480)](https://github.com/microsoft/vcpkg/pull/12480) [robin-hood-hashing] Update to latest version + +- libexif `0.6.21-2` -> `0.6.22` + - [(#12161)](https://github.com/microsoft/vcpkg/pull/12161) [libexif] Update to 0.6.22 + +- cli `1.1.1` -> `1.2.0` + - [(#12139)](https://github.com/microsoft/vcpkg/pull/12139) [cli] update the version to 1.2.0 + +- libffi `3.3-2` -> `3.3-3` + - [(#12126)](https://github.com/microsoft/vcpkg/pull/12126) [libffi] Add pkgconfig file + - [(#12498)](https://github.com/microsoft/vcpkg/pull/12498) [libffi] fix crash in debug + +- angle `2020-05-15` -> `2020-05-15-1` + - [(#12111)](https://github.com/microsoft/vcpkg/pull/12111) [angle] Add egl renderer to list of files compiled for linux + +- caf `0.17.2` -> `0.17.3` + - [(#12068)](https://github.com/microsoft/vcpkg/pull/12068) [caf] Update to 0.17.3 + +- aws-sdk-cpp `1.7.333` -> `1.8.4` + - [(#12316)](https://github.com/microsoft/vcpkg/pull/12316) aws-sdk-cpp version update + +- libcopp `1.2.1` -> `1.3.1` + - [(#12264)](https://github.com/microsoft/vcpkg/pull/12264) [libcoppp] Update version to 1.3.0 + +- openimageio `2.1.9.0` -> `2.1.16.0-1` + - [(#11767)](https://github.com/microsoft/vcpkg/pull/11767) [openimageio] Update to version 2.1.16.0 + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + - [(#12592)](https://github.com/microsoft/vcpkg/pull/12592) [openimageio] Fix installed cmake file path + - [(#12856)](https://github.com/microsoft/vcpkg/pull/12856) [vcpkg baseline] Fix openimageio and pangolin build failures on Linux + +- evpp `0.7.0-2` -> `0.7.0-3` + - [(#11967)](https://github.com/microsoft/vcpkg/pull/11967) [evpp] Fix build error on OSX + - [(#12277)](https://github.com/microsoft/vcpkg/pull/12277) [libevent] update to 2.1.12 + +- protobuf `3.12.0-2` -> `3.13.0` + - [(#11851)](https://github.com/microsoft/vcpkg/pull/11851) [protobuf] Update to 3.12.3 + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12103)](https://github.com/microsoft/vcpkg/pull/12103) Mingw port fixes + - [(#12776)](https://github.com/microsoft/vcpkg/pull/12776) [vcpkg_copy_tool_dependencies] Use vcpkg internal powershell + - [(#12918)](https://github.com/microsoft/vcpkg/pull/12918) [protobuf] protobuf v3.13.0 + +- fontconfig `2.12.4-10` -> `2.12.4` + - [(#12322)](https://github.com/microsoft/vcpkg/pull/12322) [fontconfig] Fix fonts.conf install path + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- faad2 `2.9.1-1` -> `2.9.1` + - [(#12306)](https://github.com/microsoft/vcpkg/pull/12306) [Many ports] Fix invalid character in feature name + +- freetype `2.10.1-6` -> `2.10.2` + - [(#11846)](https://github.com/microsoft/vcpkg/pull/11846) [freetype] Update to 2.10.2 + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + - [(#12886)](https://github.com/microsoft/vcpkg/pull/12886) [many ports] Fix various problems with mingw + +- cgal `5.0.2-1` -> `5.0.3` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12711)](https://github.com/microsoft/vcpkg/pull/12711) [cgal] Update cgal to 5.0.3 + +- cutelyst2 `2.9.0` -> `2.9.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- kd-soap `1.8.0-1` -> `1.8.0-2` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- kf5archive `5.64.0` -> `5.64.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#11861)](https://github.com/microsoft/vcpkg/pull/11861) Adding libraries needed to build Krita + +- kf5holidays `5.64.0` -> `5.64.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- kf5plotting `5.64.0` -> `5.64.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- kf5syntaxhighlighting `5.64.0` -> `5.64.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- libqglviewer `2.7.2-2` -> `2.7.2-3` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- opencv2 `2.4.13.7-1` -> `2.4.13.7-2` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + +- opencv3 `3.4.7-3` -> `3.4.7-4` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + +- opencv4 `4.1.1-6` -> `4.3.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + +- osg-qt `Qt4-1` -> `Qt4-2` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qca `2.2.1` -> `2.2.1-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qcustomplot `2.0.1-3` -> `2.0.1-4` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qscintilla `2.11.4-1` -> `2.11.4-2` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt-advanced-docking-system `3.2.5-1` -> `3.2.5-2` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-3d `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-activeqt `5.12.8-1` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-androidextras `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-canvas3d `5.12.8` -> `0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-charts `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-connectivity `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + +- qt5-datavis3d `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-declarative `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-doc `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-gamepad `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-graphicaleffects `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-imageformats `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + +- qt5-location `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + +- qt5-macextras `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-mqtt `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-multimedia `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-networkauth `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-purchasing `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-quickcontrols `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-quickcontrols2 `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-remoteobjects `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-script `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-scxml `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-sensors `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-serialbus `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-serialport `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-speech `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-svg `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-tools `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-translations `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-virtualkeyboard `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-wayland `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-webchannel `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-webengine `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12494)](https://github.com/microsoft/vcpkg/pull/12494) [qt-webengine] Fix building with vs2017 + +- qt5-webglplugin `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-websockets `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-webview `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-winextras `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-x11extras `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5-xmlpatterns `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- qt5 `5.12.8` -> `5.15.0` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + - [(#12471)](https://github.com/microsoft/vcpkg/pull/12471) [vcpkg format-manifest] Add convert-control flag + - [(#12864)](https://github.com/microsoft/vcpkg/pull/12864) [vcpkg_execute_build_process] Re-fix qt5 components build + +- qtkeychain `v0.9.1` -> `v0.9.1-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- soqt `1.6.0` -> `1.6.0-1` + - [(#11596)](https://github.com/microsoft/vcpkg/pull/11596) [qt5] update qt to 5.15 and make ports depend on qt5-base[core]. + +- range-v3 `0.10.0-20200425` -> `0.10.0-20200708` + - [(#12346)](https://github.com/microsoft/vcpkg/pull/12346) [range-v3] updates range-v3 + +- azure-storage-cpp `7.4.0` -> `7.5.0` + - [(#12333)](https://github.com/microsoft/vcpkg/pull/12333) [azure-storage-cpp] Upgrade to 7.5.0 + +- directxmesh `jun2020` -> `jul2020` + - [(#12332)](https://github.com/microsoft/vcpkg/pull/12332) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + - [(#13060)](https://github.com/microsoft/vcpkg/pull/13060) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- directxtk `jun2020` -> `jul2020` + - [(#12332)](https://github.com/microsoft/vcpkg/pull/12332) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + - [(#13060)](https://github.com/microsoft/vcpkg/pull/13060) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- cuda `10.1-1` -> `10.1` + - [(#12244)](https://github.com/microsoft/vcpkg/pull/12244) [cuda] correct env variables for newer cuda versions + +- pybind11 `2.4.3` -> `2.5.0` + - [(#12394)](https://github.com/microsoft/vcpkg/pull/12394) [pybind11] Update to v2.5.0 + +- corrade `2019.10-1` -> `2020.06` + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 + +- magnum-extras `2019.10` -> `2020.06` + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 + +- magnum-integration `2019.10` -> `2020.06` + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 + +- magnum-plugins `2019.10-2` -> `2020.06` + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 + - [(#12458)](https://github.com/microsoft/vcpkg/pull/12458) [magnum-plugins] Fix file conflict with stb + +- magnum `2019.10-2` -> `2020.06` + - [(#12211)](https://github.com/microsoft/vcpkg/pull/12211) [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 + +- zstd `1.4.4-1` -> `1.4.4` + - [(#12407)](https://github.com/microsoft/vcpkg/pull/12407) [zstd] fix pkg-config files + +- string-theory `3.2` -> `3.3` + - [(#12440)](https://github.com/microsoft/vcpkg/pull/12440) [string-theory] Update to 3.3 + +- nrf-ble-driver `4.1.1-2` -> `4.1.2` + - [(#12436)](https://github.com/microsoft/vcpkg/pull/12436) [nrf-ble-driver] Update to v4.1.2 + +- folly `2019.10.21.00-2` -> `2019.10.21.00` + - [(#12419)](https://github.com/microsoft/vcpkg/pull/12419) [folly] Fix build error C3861 + +- boost-modular-build-helper `1.73.0-1` -> `1.73.0` + - [(#12417)](https://github.com/microsoft/vcpkg/pull/12417) [boost-modular-build-helper] Remove has_icu.lib + - [(#12535)](https://github.com/microsoft/vcpkg/pull/12535) [boost] s390x support + - [(#12634)](https://github.com/microsoft/vcpkg/pull/12634) [vcpkg] Improving android support + - [(#9224)](https://github.com/microsoft/vcpkg/pull/9224) [boost-modular-build-helper] Fix issue that link incorrect dependent libraries + - [(#12851)](https://github.com/microsoft/vcpkg/pull/12851) [boost-uninstall] Add port to easily uninstall all boost components + +- liblzma `5.2.4-5` -> `5.2.5` + - [(#12401)](https://github.com/microsoft/vcpkg/pull/12401) [liblzma, libvpx] Add mingw support + - [(#7226)](https://github.com/microsoft/vcpkg/pull/7226) [liblzma] Patch headers to fix https://github.com/OpenTTD/OpenTTD/pull/7614 + +- pugixml `1.10-1` -> `1.10` + - [(#12441)](https://github.com/microsoft/vcpkg/pull/12441) [pugixml] Fix pkgconfig file + +- hiredis `2019-11-2-1` -> `2019-11-2` + - [(#12354)](https://github.com/microsoft/vcpkg/pull/12354) [hiredis] Fix feature ssl build error on windows + +- eigen3 `3.3.7-5` -> `3.3.7` + - [(#12279)](https://github.com/microsoft/vcpkg/pull/12279) [eigen3] Fix eigen3 and cuda compatibility issue + +- zlib `1.2.11-6` -> `1.2.11` + - [(#12133)](https://github.com/microsoft/vcpkg/pull/12133) [zlib] Add pkgconfig file + - [(#12753)](https://github.com/microsoft/vcpkg/pull/12753) [zlib, libpng] Fix pkg-config for mingw + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- libmupdf `1.16.1-1` -> `1.17.0` + - [(#12483)](https://github.com/microsoft/vcpkg/pull/12483) [libmupdf] Update libmupdf to 1.17.0 + +- bzip2 `1.0.6-5` -> `1.0.6-6` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12880)](https://github.com/microsoft/vcpkg/pull/12880) [bzip2] fixes for building release-only + +- gmp `6.2.0-1` -> `6.2.0-2` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12664)](https://github.com/microsoft/vcpkg/pull/12664) [mpir, gmp] Add message to handle the conflicts between these two ports + +- libpng `1.6.37-9` -> `1.6.37-10` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12753)](https://github.com/microsoft/vcpkg/pull/12753) [zlib, libpng] Fix pkg-config for mingw + +- nettle `3.5.1-1` -> `3.5.1-2` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + +- ompl `1.4.2-4` -> `1.5.0` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + - [(#12529)](https://github.com/microsoft/vcpkg/pull/12529) [qt5 components] Disable parallel build + - [(#11737)](https://github.com/microsoft/vcpkg/pull/11737) [ompl]: upgrade to 1.5.0 + +- sdl1 `1.2.15-11` -> `1.2.15` + - [(#11550)](https://github.com/microsoft/vcpkg/pull/11550) [vcpkg/scripts/pkgconfig] rewrite pkg-config check for libraries + +- alembic `1.7.12-1` -> `1.7.13` + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + - [(#12735)](https://github.com/microsoft/vcpkg/pull/12735) [alembic] Update to 1.7.13 + +- opencv `4.1.1-1` -> `4.3.0` + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + +- openexr `2.3.0-5` -> `2.5.0` + - [(#11130)](https://github.com/microsoft/vcpkg/pull/11130) [opencv4] update to v4.3 + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- libftdi1 `1.4` -> `1.4-1` + - [(#9561)](https://github.com/microsoft/vcpkg/pull/9561) [libusb] Fix issue to support linux + +- libusb `1.0.23` -> `1.0.23-1` + - [(#9561)](https://github.com/microsoft/vcpkg/pull/9561) [libusb] Fix issue to support linux + - [(#12656)](https://github.com/microsoft/vcpkg/pull/12656) [libusb] build fails on windows due to symlink in extracted archive + - [(#13057)](https://github.com/microsoft/vcpkg/pull/13057) [libusb] Add vcpkg-cmake-wrapper + +- treehopper `1.11.3-3` -> `1.11.3-4` + - [(#9561)](https://github.com/microsoft/vcpkg/pull/9561) [libusb] Fix issue to support linux + +- outcome `2.1` -> `2.1.3` + - [(#12078)](https://github.com/microsoft/vcpkg/pull/12078) [outcome] Update library and fix portfile + +- librdkafka `1.2.0-2` -> `1.5.0` + - [(#12095)](https://github.com/microsoft/vcpkg/pull/12095) [librdkafka] Upgrade to 1.4.4 + - [(#12731)](https://github.com/microsoft/vcpkg/pull/12731) [librdkafka] Update to 1.5.0 + +- glew `2.1.0-7` -> `2.1.0-8` + - [(#12103)](https://github.com/microsoft/vcpkg/pull/12103) Mingw port fixes + +- mozjpeg `2020-06-02` -> `2020-06-02-1` + - [(#12118)](https://github.com/microsoft/vcpkg/pull/12118) [mozjpeg] fix build + +- fltk `1.3.5-2` -> `1.3.5` + - [(#12273)](https://github.com/microsoft/vcpkg/pull/12273) [fltk] Force static library due to global variables. Fix CMake Targets. + +- nana `1.7.2-3` -> `1.7.2` + - [(#12543)](https://github.com/microsoft/vcpkg/pull/12543) [nana] Fix the version and language standard + +- winpcap `4.1.3-3` -> `4.1.3` + - [(#12542)](https://github.com/microsoft/vcpkg/pull/12542) [winpcap] Remove the keyword 'inline' macro + +- boost-build `1.73.0-1` -> `1.73.0` + - [(#12535)](https://github.com/microsoft/vcpkg/pull/12535) [boost] s390x support + - [(#12851)](https://github.com/microsoft/vcpkg/pull/12851) [boost-uninstall] Add port to easily uninstall all boost components + +- restinio `0.6.8` -> `0.6.9` + - [(#12087)](https://github.com/microsoft/vcpkg/pull/12087) [RESTinio] Update to v.0.6.8.1 + - [(#12889)](https://github.com/microsoft/vcpkg/pull/12889) [restinio] update to 0.6.9 + - [(#13018)](https://github.com/microsoft/vcpkg/pull/13018) [restinio] update to v.0.6.10 + +- fizz `2020.02.03.00` -> `2020.02.03.00` + - [(#12277)](https://github.com/microsoft/vcpkg/pull/12277) [libevent] update to 2.1.12 + +- libevent `2.1.11-5` -> `2.1.12` + - [(#12277)](https://github.com/microsoft/vcpkg/pull/12277) [libevent] update to 2.1.12 + +- libflac `1.3.3-1` -> `1.3.3` + - [(#12374)](https://github.com/microsoft/vcpkg/pull/12374) [sdl2-mixer] Fix FLAC symbol export when static linking, add nativemidi default feature + - [(#12761)](https://github.com/microsoft/vcpkg/pull/12761) [flac] Disable stack smash protection and FORTIFY_SOURCE for mingw + +- libsndfile `1.0.29-9` -> `1.0.29` + - [(#12374)](https://github.com/microsoft/vcpkg/pull/12374) [sdl2-mixer] Fix FLAC symbol export when static linking, add nativemidi default feature + - [(#12921)](https://github.com/microsoft/vcpkg/pull/12921) [libsndfile] Update to 1.0.29 + +- sdl2-mixer `2.0.4-9` -> `2.0.4` + - [(#12374)](https://github.com/microsoft/vcpkg/pull/12374) [sdl2-mixer] Fix FLAC symbol export when static linking, add nativemidi default feature + +- physx `4.1.1-3` -> `4.1.1` + - [(#12413)](https://github.com/microsoft/vcpkg/pull/12413) [physx] Add patch for NVIDIAGameWorks/PhysX#322. + - [(#12710)](https://github.com/microsoft/vcpkg/pull/12710) [physx] Add support for checked and profile builds. + +- wxwidgets `3.1.3-1` -> `3.1.4` + - [(#12485)](https://github.com/microsoft/vcpkg/pull/12485) [wxwidgets] Adding wxWidgets resource compiler (wxrc) to /tools/wxwidgets directory + - [(#12733)](https://github.com/microsoft/vcpkg/pull/12733) [wxwidgets] Update to 3.1.4 + - [(#12885)](https://github.com/microsoft/vcpkg/pull/12885) [wxwidgets] copy pdbs + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- osgearth `2.10.2-1` -> `3.0` + - [(#12531)](https://github.com/microsoft/vcpkg/pull/12531) [osgearth] update to 3.0 + +- netcdf-c `4.7.3-1` -> `4.7.3` + - [(#12342)](https://github.com/microsoft/vcpkg/pull/12342) [qt5-base] Add zstd as a dependency + - [(#12755)](https://github.com/microsoft/vcpkg/pull/12755) [netcdf-c] also depend on embree on osx + - [(#12434)](https://github.com/microsoft/vcpkg/pull/12434) [netcdf-c] Fix dependency libmath + +- arrow `0.17.1` -> `1.0.0` + - [(#12537)](https://github.com/microsoft/vcpkg/pull/12537) [Arrow] Update to 1.0.0 + +- libigl `2.1.0-2` -> `2.2.0` + - [(#10252)](https://github.com/microsoft/vcpkg/pull/10252) [libigl] Fix configure error and dependencies + - [(#12691)](https://github.com/microsoft/vcpkg/pull/12691) [libigl] fix imgui feature + +- asiosdk `2.3.3` -> `2.3.3-1` + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- jxrlib `2019.10.9` -> `2019.10.9-1` + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- libmodman `2.0.1-1` -> `2.0.1-2` + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- libproxy `0.4.15-1` -> `0.4.15-2` + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- stb `2020-02-08` -> `2020-02-08-1` + - [(#12157)](https://github.com/microsoft/vcpkg/pull/12157) [many ports] Remove _find_package guards that break *_FOUND + +- itk `5.0.1-2` -> `5.1.0` + - [(#11208)](https://github.com/microsoft/vcpkg/pull/11208) [ITK] Update to 5.1 + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- opencl `2.2-2-1` -> `2.2` + - [(#11208)](https://github.com/microsoft/vcpkg/pull/11208) [ITK] Update to 5.1 + +- openjpeg `2.3.1-1` -> `2.3.1` + - [(#11208)](https://github.com/microsoft/vcpkg/pull/11208) [ITK] Update to 5.1 + +- pbc `0.5.14-2` -> `0.5.14` + - [(#12732)](https://github.com/microsoft/vcpkg/pull/12732) [vcpkg baseline] Fix pbc build failure with x64-osx + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- libodb-sqlite `2.4.0-6` -> `2.4.0` + - [(#12516)](https://github.com/microsoft/vcpkg/pull/12516) [sqlite3] Namespaced targets with unofficial:: + +- gtkmm `3.22.2-2` -> `3.22.2` + - [(#12637)](https://github.com/microsoft/vcpkg/pull/12637) [gtkmm] fix missing symbol exports with gtkmm release build + +- wavpack `5.2.0` -> `5.2.0` + - [(#12742)](https://github.com/microsoft/vcpkg/pull/12742) [wavpack] Fix failure on linux and osx + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- shapelib `1.4.1-2` -> `1.5.0` + - [(#12737)](https://github.com/microsoft/vcpkg/pull/12737) [shapelib] Update to 1.5.0 + +- teemo `1.3` -> `2.1` + - [(#12728)](https://github.com/microsoft/vcpkg/pull/12728) [teemo] Update to v2.1 + +- quill `1.3.1` -> `1.4.0` + - [(#12683)](https://github.com/microsoft/vcpkg/pull/12683) [quill] Update to version 1.3.3 + - [(#12924)](https://github.com/microsoft/vcpkg/pull/12924) [quill] Update to 1.4.0 + +- libmariadb `3.1.7-1` -> `3.1.7` + - [(#12669)](https://github.com/microsoft/vcpkg/pull/12669) [libmariadb] Include bundled zlib and openssl + +- brotli `1.0.7-1` -> `1.0.7` + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- cairomm `1.15.3-4` -> `1.15.3` + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- freetype-gl `2019-03-29-3` -> `2019-03-29` + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- libraqm `0.7.0-1` -> `0.7.0` + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + +- sfml `2.5.1-7` -> `2.5.1` + - [(#12405)](https://github.com/microsoft/vcpkg/pull/12405) [brotli] add pkgconfig / [freetype] depend on brotli + - [(#11800)](https://github.com/microsoft/vcpkg/pull/11800) [sfml][imgui-sfml] Push SFML_STATIC_LIBRARIES setting into `sfml` + +- fmt `6.2.1` -> `7.0.3` + - [(#12312)](https://github.com/microsoft/vcpkg/pull/12312) [fmt] Update to 7.0.2 + [spdlog] Update to 1.7.0 + - [(#12806)](https://github.com/microsoft/vcpkg/pull/12806) [fmt] Update to 7.0.3 + +- spdlog `1.6.1` -> `1.7.0` + - [(#12312)](https://github.com/microsoft/vcpkg/pull/12312) [fmt] Update to 7.0.2 + [spdlog] Update to 1.7.0 + +- armadillo `2019-04-16-8` -> `2019-04-16` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + +- blaze `3.7` -> `3.8` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + - [(#12916)](https://github.com/microsoft/vcpkg/pull/12916) [blaze] Update to Blaze 3.8 + +- ceres `1.14.0-7` -> `1.14.0` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + +- clapack `3.2.1-13` -> `3.2.1` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + - [(#12805)](https://github.com/microsoft/vcpkg/pull/12805) [lapack-reference|fortran] Add new port + +- dlib `19.19-1` -> `19.21` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + - [(#13061)](https://github.com/microsoft/vcpkg/pull/13061) [dlib] Update to v19.21 + +- geogram `1.6.9-7` -> `1.7.5` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + - [(#12562)](https://github.com/microsoft/vcpkg/pull/12562) [geogram] update to 1.7.5 + - [(#12626)](https://github.com/microsoft/vcpkg/pull/12626) [vcpkg_find_acquire_program] Enable find_acquire(PKGCONFIG) + +- mlpack `3.2.2-3` -> `3.2.2` + - [(#12464)](https://github.com/microsoft/vcpkg/pull/12464) [lapack] add metaport lapack to switch lapack impl with an overlay + - [(#12805)](https://github.com/microsoft/vcpkg/pull/12805) [lapack-reference|fortran] Add new port + +- pangolin `0.5-7` -> `0.5` + - [(#12515)](https://github.com/microsoft/vcpkg/pull/12515) [pangolin] Fix build failure on UNIX + - [(#12856)](https://github.com/microsoft/vcpkg/pull/12856) [vcpkg baseline] Fix openimageio and pangolin build failures on Linux + +- orocos-kdl `1.4-2` -> `1.4` + - [(#12794)](https://github.com/microsoft/vcpkg/pull/12794) [ocoros-kdl] Fix the CMake config file + +- log4cpp `2.9.1-2` -> `2.9.1` + - [(#12792)](https://github.com/microsoft/vcpkg/pull/12792) [log4cpp] Fix header file install path + +- bond `9.0.0` -> `9.0.2` + - [(#12782)](https://github.com/microsoft/vcpkg/pull/12782) [bond] Update to v9.0.2 + +- libtorrent `1.2.7` -> `1.2.9` + - [(#12768)](https://github.com/microsoft/vcpkg/pull/12768) [libtorrent] Update to 1.2.8 + - [(#12762)](https://github.com/microsoft/vcpkg/pull/12762) [boost] Add Supports fields and more accurately handle arm64-windows/x64-uwp + - [(#12946)](https://github.com/microsoft/vcpkg/pull/12946) [libtorrent] minor version bump and python patch adjustment + +- boost-context `1.73.0-1` -> `1.73.0` + - [(#12762)](https://github.com/microsoft/vcpkg/pull/12762) [boost] Add Supports fields and more accurately handle arm64-windows/x64-uwp + +- secp256k1 `2017-19-10-0b7024185045a49a1a6a4c5615bf31c94f63d9c4-2` -> `2017-19-10` + - [(#12630)](https://github.com/microsoft/vcpkg/pull/12630) [secp256k1] Fix build failures and export cmake targets + +- xbyak `5.911` -> `5.93` + - [(#12577)](https://github.com/microsoft/vcpkg/pull/12577) [Xbyak] Update to 5.93 + +- tiff `4.0.10-9` -> `4.1.0` + - [(#12559)](https://github.com/microsoft/vcpkg/pull/12559) [tiff] Update 4.0.10 to 4.1.0 + +- asmjit `2020-05-08` -> `2020-07-22` + - [(#12524)](https://github.com/microsoft/vcpkg/pull/12524) [asmjit] Update to the latest commit + +- libressl `2.9.1-2` -> `2.9.1` + - [(#11949)](https://github.com/microsoft/vcpkg/pull/11949) [libressl] add download mirror + +- darknet `2020-03-02` -> `2020-06-29` + - [(#11037)](https://github.com/microsoft/vcpkg/pull/11037) [darknet] ready for yolo_v4 + +- embree3 `3.8.0` -> `3.11.0` + - [(#12555)](https://github.com/microsoft/vcpkg/pull/12555) [embree3] Update to 3.11.0 + +- fribidi `1.0.9-1` -> `1.0.10` + - [(#12517)](https://github.com/microsoft/vcpkg/pull/12517) [fribidi] Update to 1.0.10 + +- opencolorio `1.1.1-2` -> `1.1.1` + - [(#12420)](https://github.com/microsoft/vcpkg/pull/12420) [opencolorio-tools] Separate feature application to avoid circular dependency + - [(#12869)](https://github.com/microsoft/vcpkg/pull/12869) [opencolorio] Update repository + +- osg `3.6.4-3` -> `3.6.5` + - [(#12672)](https://github.com/microsoft/vcpkg/pull/12672) [osg] Update to 3.6.5 + +- openblas `0.3.9-1` -> `0.3.9` + - [(#12805)](https://github.com/microsoft/vcpkg/pull/12805) [lapack-reference|fortran] Add new port + - [(#12956)](https://github.com/microsoft/vcpkg/pull/12956) [openblas] Fix generating pkg-config file + +- farmhash `1.1-1` -> `1.1` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- freexl `1.0.4-9` -> `1.0.4` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- libcrafter `0.3-1` -> `0.3` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- libmagic `5.37-1` -> `5.37` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- libwandio `4.2.1-2` -> `4.2.1` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- ocilib `4.6.4-1` -> `4.6.4` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- x264 `157-303c484ec828ed0-8` -> `157-303c484ec828ed0` + - [(#11836)](https://github.com/microsoft/vcpkg/pull/11836) [vcpkg/scripts/make] trying to iron out some issues + +- wpilib `2020.1.1` -> `2020.3.2` + - [(#12373)](https://github.com/microsoft/vcpkg/pull/12373) [wpilib] Update to 2020.3.2 + +- proj4 `6.3.1-1` -> `6.3.1` + - [(#12875)](https://github.com/microsoft/vcpkg/pull/12875) [proj4] use sqlite3 config cmake, make sqlite3 private + +- tool-meson `0.54.2` -> `0.55.1` + - [(#12927)](https://github.com/microsoft/vcpkg/pull/12927) [meson] Update meson to 0.55.1 + +- apr-util `1.6.1-1` -> `1.6.1` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- expat `2.2.7` -> `2.2.9` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- gdal `2.4.1-9` -> `2.4.1` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + - [(#12541)](https://github.com/microsoft/vcpkg/pull/12541) [gdal] Fix static build issue + +- io2d `2019-07-11-2` -> `2019-07-11` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- libkml `1.3.0-4` -> `1.3.0` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- poco `1.9.2-2` -> `1.9.2` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- readosm `1.1.0-2` -> `1.1.0` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- skia `2020-05-18-1` -> `2020-05-18` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- spatialite-tools `4.3.0-2` -> `4.3.0` + - [(#9146)](https://github.com/microsoft/vcpkg/pull/9146) [expat] Update the version to 2.2.9 (add support for uwp) + +- xlnt `1.4.0-1` -> `1.5.0` + - [(#12972)](https://github.com/microsoft/vcpkg/pull/12972) [xlnt] Upgrade xlnt to 1.5.0 + +- fdk-aac `2018-07-08-1` -> `2018-07-08-2` + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- opus `1.3.1-3` -> `1.3.1` + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + - [(#12886)](https://github.com/microsoft/vcpkg/pull/12886) [many ports] Fix various problems with mingw + +- sdl2 `2.0.12-1` -> `2.0.12` + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- speex `1.2.0-4` -> `1.2.0` + - [(#11277)](https://github.com/microsoft/vcpkg/pull/11277) [ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. + +- pcl `1.9.1-13` -> `1.11.0` + - [(#10042)](https://github.com/microsoft/vcpkg/pull/10042) [pcl] Update to 1.10.0 + - [(#13020)](https://github.com/microsoft/vcpkg/pull/13020) [pcl] check SSE flags + +- tinygltf `2.2.0` -> `2020-07-28` + - [(#12608)](https://github.com/microsoft/vcpkg/pull/12608) [tinygltf] update to v2.4.0 + +- pmdk `1.8` -> `1.9` + - [(#12863)](https://github.com/microsoft/vcpkg/pull/12863) [pmdk] Update to 1.9 + +- kangaru `4.2.2` -> `4.2.4` + - [(#12932)](https://github.com/microsoft/vcpkg/pull/12932) [kangaru] Update to v4.2.4 + +- intel-mkl `2018.0.1` -> `2020.0.0` + - [(#12978)](https://github.com/microsoft/vcpkg/pull/12978) [intel-mkl] Update to 2020.0.0 + +- fluidsynth `2.1.0` -> `2.1.4` + - [(#12974)](https://github.com/microsoft/vcpkg/pull/12974) [fluidsynth/redis-plus-plus] Update to the latest released version + +- redis-plus-plus `1.1.1` -> `1.1.2` + - [(#12974)](https://github.com/microsoft/vcpkg/pull/12974) [fluidsynth/redis-plus-plus] Update to the latest released version + +- openxr-loader `1.0.3.0` -> `1.0.11` + - [(#12060)](https://github.com/microsoft/vcpkg/pull/12060) [openxr-loader] Update to latest version, official repo + +- libmediainfo `20.03` -> `20.08` + - [(#12944)](https://github.com/microsoft/vcpkg/pull/12944) [libmediainfo] Update to 20.08 + +- wt `4.2.2` -> `4.4.0` + - [(#13005)](https://github.com/microsoft/vcpkg/pull/13005) [wt] Update to 4.4.0 + +- libjpeg-turbo `2.0.4` -> `2.0.5` + - [(#12973)](https://github.com/microsoft/vcpkg/pull/12973) [libjpeg-turbo] Update to 2.0.5 + +- berkeleydb `4.8.30-4` -> `4.8.30` + - [(#12870)](https://github.com/microsoft/vcpkg/pull/12870) [berkeleydb] Fix build error with Visual Studio 16.7.0 + +- libmodplug `0.8.9.0-5` -> `0.8.9.0` + - [(#12886)](https://github.com/microsoft/vcpkg/pull/12886) [many ports] Fix various problems with mingw + +- imgui-sfml `2.1-1` -> `2.1-2` + - [(#11800)](https://github.com/microsoft/vcpkg/pull/11800) [sfml][imgui-sfml] Push SFML_STATIC_LIBRARIES setting into `sfml` + +- re2 `2020-01-01` -> `2020-06-01` + - [(#13084)](https://github.com/microsoft/vcpkg/pull/13084) [grpc][upb][re2] grpc v1.31.1 + +- upb `2019-10-21-2` -> `2020-08-19` + - [(#13084)](https://github.com/microsoft/vcpkg/pull/13084) [grpc][upb][re2] grpc v1.31.1 + +- box2d `2019-12-31` -> `2.4.0` + - [(#13058)](https://github.com/microsoft/vcpkg/pull/13058) [Box2d] Update to 2.4.0 + +- cpp-taskflow `2.2.0-1` -> `2.5.0` + - [(#12923)](https://github.com/microsoft/vcpkg/pull/12923) [cpp-taskflow] Update to 2.5.0 + +- aubio `0.4.9-1` -> `0.4.9` + - [(#12921)](https://github.com/microsoft/vcpkg/pull/12921) [libsndfile] Update to 1.0.29 + +- libfreenect2 `0.2.0-4` -> `0.2.0` + - [(#13057)](https://github.com/microsoft/vcpkg/pull/13057) [libusb] Add vcpkg-cmake-wrapper + +
+ +-- vcpkg team vcpkg@microsoft.com THU, 27 Aug 02:20:00 -0800 + vcpkg (2020.04.20 - 2020.06.15) --- #### Total port count: 1402 diff --git a/README.md b/README.md index 1764b5a1137a9b..1189325290ddd2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Vcpkg: Overview + [中文总览](README_zh_CN.md) Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. @@ -17,7 +18,6 @@ you can run `vcpkg help`, or `vcpkg help [command]` for command-specific help. [![Build Status](https://dev.azure.com/vcpkg/public/_apis/build/status/microsoft.vcpkg.ci?branchName=master)](https://dev.azure.com/vcpkg/public/_build/latest?definitionId=29&branchName=master) - # Table of Contents - [Vcpkg: Overview](#vcpkg-overview) @@ -254,7 +254,7 @@ and go to the CMake settings (Build, Execution, Deployment > CMake). Finally, in `CMake options`, add the following line: ``` --DCMAKE_TOOLCHAIN_FILE=C:/Users/nimazzuc/src/vcpkg/scripts/buildsystems/vcpkg.cmake +-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake ``` Unfortunately, you'll have to add this to each profile. @@ -324,7 +324,7 @@ you may use a simple `vcpkg install --feature-flags=manifests` For more information, check out the [manifest][getting-started:manifest-spec] specification. -[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md +[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md [getting-started:integration]: docs/users/integration.md [getting-started:git]: https://git-scm.com/downloads [getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools @@ -353,7 +353,6 @@ $ ./vcpkg integrate bash depending on the shell you use, then restart your console. - # Examples See the [documentation](docs/index.md) for specific walkthroughs, diff --git a/README_zh_CN.md b/README_zh_CN.md index 286976dc832dbe..33aae2ecf3a45e 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -1,6 +1,7 @@ -# Vcpkg 总览 +# Vcpkg: 总览 + +[English Overview](README.md) -## 概要 Vcpkg 可帮助您在 Windows、 Linux 和 MacOS 上管理 C 和 C++ 库。 这个工具和生态链正在不断发展,我们一直期待您的贡献! @@ -17,8 +18,7 @@ Vcpkg 可帮助您在 Windows、 Linux 和 MacOS 上管理 C 和 C++ 库。 # 目录 -- [Vcpkg 总览](#vcpkg-总览) - - [概要](#概要) +- [Vcpkg: 总览](#vcpkg-总览) - [目录](#目录) - [入门](#入门) - [快速开始: Windows](#快速开始-windows) @@ -91,14 +91,14 @@ vcpkg团队和贡献者可以看到它的地方, > .\vcpkg\vcpkg integrate install ``` -在此之后, 您可以创建一个非cmake项目 (或打开已有的项目)。 +在此之后,您可以创建一个非cmake项目 (或打开已有的项目)。 在您的项目中,所有已安装的库均可立即使用 `#include` 包含您需使用的库的头文件并无需添加额外配置。 若您在 Visual Studio 中使用cmake工程,请查阅[这里](#visual-studio-cmake-工程中使用-vcpkg)。 -为了在IDE以外在cmake中使用vcpkg, 您需要使用以下工具链文件: +为了在IDE以外在cmake中使用vcpkg,您需要使用以下工具链文件: -``` +```cmd > cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake > cmake --build [build directory] ``` @@ -140,11 +140,11 @@ $ ./vcpkg/vcpkg install [packages to install] $ ./vcpkg/vcpkg search [search term] ``` -为了在cmake中使用vcpkg, 您需要使用以下工具链文件: +为了在cmake中使用vcpkg,您需要使用以下工具链文件: -``` -> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake -> cmake --build [build directory] +```sh +$ cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake +$ cmake --build [build directory] ``` 在cmake中,您仍需通过 `find_package` 来使用第三方库。 @@ -158,7 +158,7 @@ $ ./vcpkg/vcpkg search [search term] 在Linux的不同发行版中,您需要安装不同的工具包: -- Debian, Ubuntu, popOS, 或其他基于 Debian 的发行版: +- Debian,Ubuntu,popOS或其他基于 Debian 的发行版: ```sh $ sudo apt-get update @@ -174,7 +174,7 @@ $ scl enable devtoolset-7 bash ``` 对于其他的发行版,请确保已安装 g++ 6 或更新的版本。 -若您希望添加特定发行版的说明, [请提交一个 PR][contributing:submit-pr]! +若您希望添加特定发行版的说明,[请提交一个 PR][contributing:submit-pr]! ## 安装 macOS Developer Tools @@ -192,7 +192,7 @@ $ xcode-select --install ### 在 macOS 10.15 之前版本中安装 GCC 此条只在您的macOS版本低于 10.15 时是必须的。 -安装homebrew应当很轻松, 请查阅 以获取更多信息。 +安装homebrew应当很轻松,请查阅 以获取更多信息。 为了更简便,请使用以下命令: ```sh @@ -209,7 +209,7 @@ $ brew install gcc ## 在 CMake 中使用 vcpkg -若您希望在CMake中使用vcpkg, 以下内容可能帮助您: +若您希望在CMake中使用vcpkg,以下内容可能帮助您: ### Visual Studio Code 中的 CMake Tools @@ -234,15 +234,15 @@ $ brew install gcc ### CLion 中使用 vcpkg 打开 Toolchains 设置 -(File > Settings on Windows and Linux, CLion > Preferences on macOS), -并打开 CMake 设置 (Build, Execution, Deployment > CMake)。 +(File > Settings on Windows and Linux, CLion > Preferences on macOS), +并打开 CMake 设置 (Build, Execution, Deployment > CMake)。 最后在 `CMake options` 中添加以下行: ``` --DCMAKE_TOOLCHAIN_FILE=C:/Users/nimazzuc/src/vcpkg/scripts/buildsystems/vcpkg.cmake +-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake ``` -遗憾的是, 您必须手动将此选项加入每个项目配置文件中。 +遗憾的是,您必须手动将此选项加入每个项目配置文件中。 ### 将 vcpkg 作为一个子模块 @@ -293,7 +293,7 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/ 请查阅 [清单][getting-started:manifest-spec] 获取更多信息。 -[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md +[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md [getting-started:integration]: docs/users/integration.md [getting-started:git]: https://git-scm.com/downloads [getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools @@ -315,7 +315,7 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/ 或 -``` +```sh $ ./vcpkg integrate bash ``` diff --git a/docs/examples/installing-and-using-packages.md b/docs/examples/installing-and-using-packages.md index f98de78ab14917..011df93a4cc9f9 100644 --- a/docs/examples/installing-and-using-packages.md +++ b/docs/examples/installing-and-using-packages.md @@ -47,8 +47,8 @@ Total elapsed time: 12.04 s The package sqlite3:x86-windows provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)) ``` @@ -118,11 +118,11 @@ Now let's make a simple CMake project with a main file. cmake_minimum_required(VERSION 3.0) project(test) -find_package(sqlite3 CONFIG REQUIRED) +find_package(unofficial-sqlite3 CONFIG REQUIRED) add_executable(main main.cpp) -target_link_libraries(main PRIVATE sqlite3) +target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` ```cpp // main.cpp diff --git a/docs/examples/overlay-triplets-linux-dynamic.md b/docs/examples/overlay-triplets-linux-dynamic.md index 7d0540927d4c49..5d79013377afb1 100644 --- a/docs/examples/overlay-triplets-linux-dynamic.md +++ b/docs/examples/overlay-triplets-linux-dynamic.md @@ -55,8 +55,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux-dynamic provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` Overlay triplets enables your custom triplet files when using `vcpkg install`, `vcpkg update`, `vcpkg upgrade`, and `vcpkg remove`. @@ -115,8 +115,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` Note that the default triplet is masked by your custom triplet: diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 0b653225802bfd..e0fde7e6885c63 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -208,6 +208,34 @@ Note that if a library generates CMake integration files (`foo-config.cmake`), r Finally, DLL files on Windows should never be renamed post-build because it breaks the generated LIBs. +## Code format + +### Vcpkg internal code + +We require the c/c++ code inside vcpkg to follow the clang-format, if you change them. Please perform the following steps after modification: + +- Use Visual Studio: +1. Configure your [clang-format tools](https://devblogs.microsoft.com/cppblog/clangformat-support-in-visual-studio-2017-15-7-preview-1/). +2. Open the modified file. +3. Use shortcut keys Ctrl+K, Ctrl+D to format the current file. + +- Use tools: +1. Install [llvm clang-format](https://releases.llvm.org/download.html#10.0.0) +2. Run command: +```cmd +> LLVM_PATH/bin/clang-format.exe -style=file -i changed_file.cpp +``` + +### Manifest + +We require that the manifest file needs to be formatted, perform the following steps to solve this issue: + +1. Format all changed manifest files. +```cmd +> vcpkg x-format-manifest --all +``` +2. Commit changes to your branch. + ## Useful implementation notes ### Portfiles are run in Script Mode diff --git a/docs/maintainers/vcpkg_check_linkage.md b/docs/maintainers/vcpkg_check_linkage.md index 406325dba08f84..eb20e97c861919 100644 --- a/docs/maintainers/vcpkg_check_linkage.md +++ b/docs/maintainers/vcpkg_check_linkage.md @@ -28,7 +28,7 @@ This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail, ## Examples -* [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake) +* [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake) ## Source -[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) +[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) diff --git a/docs/maintainers/vcpkg_configure_cmake.md b/docs/maintainers/vcpkg_configure_cmake.md index d020dbb69a4da3..00324dc1cd2906 100644 --- a/docs/maintainers/vcpkg_configure_cmake.md +++ b/docs/maintainers/vcpkg_configure_cmake.md @@ -29,6 +29,8 @@ This should be specified unless the port is known to not work under Ninja. Disables running the CMake configure step in parallel. This is needed for libraries which write back into their source directory during configure. +This also disables CMAKE_DISABLE_SOURCE_CHANGES. + ### NO_CHARSET_FLAG Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. diff --git a/docs/maintainers/vcpkg_find_acquire_program.md b/docs/maintainers/vcpkg_find_acquire_program.md index a838bb974e6b84..ae83ccb92fe4af 100644 --- a/docs/maintainers/vcpkg_find_acquire_program.md +++ b/docs/maintainers/vcpkg_find_acquire_program.md @@ -16,6 +16,7 @@ The current list of programs includes: - 7Z - ARIA2 (Downloader) - BISON +- CLANG - DARK - DOXYGEN - FLEX diff --git a/docs/specifications/registries.md b/docs/specifications/registries.md new file mode 100644 index 00000000000000..48b392a5c1d684 --- /dev/null +++ b/docs/specifications/registries.md @@ -0,0 +1,285 @@ +# Package Federation: Custom Registries + +As it is now, vcpkg has over 1400 ports in the default registry (the `/ports` directory). +For the majority of users, this repository of packages is enough. However, many enterprises +need to more closely control their dependencies for one reason or another, and this document +lays out a method which we will build into vcpkg for exactly that reason. + +## Background + +A registry is simply a set of packages. In fact, there is already a registry in vcpkg: the default one. +Package federation, implemented via custom registries, allows one to add new packages, +edit existing packages, and have as much or as little control as one likes over the dependencies that one uses. +It gives the control over dependencies that an enterprise requires. + +### How Does the Current Default Registry Work? + +Of course, the existing vcpkg tool does have packages in the official, +default registry. The way we describe these packages is in the ports tree – +at the base of the vcpkg install directory, there is a directory named ports, +which contains on the order of 1300 directories, one for each package. Then, +in each package directory, there are at least two files: a CONTROL or +vcpkg.json file, which contains the name, version, description, and features +of the package; and a portfile.cmake file which contains the information on +how to download and build the package. There may be other files in this +registry, like patches or usage instructions, but only those two files are +needed. + +### Existing vcpkg Registry-like Features + +There are some existing features in vcpkg that act somewhat like a custom +registry. The most obvious feature that we have is overlay ports – this +feature allows you to specify any number of directories as "overlays", which +either contain a package definition directly, or which contain some number of +package directories; these overlays will be used instead of the ports tree +for packages that exist in both places, and are specified exclusively on the +command line. Additionally, unfortunately, if one installs a package from +overlay ports that does not exist in the ports tree, one must pass these +overlays to every vcpkg installation command. + +There is also the less obvious "feature" which works by virtue of the ports +tree being user-editable: one can always edit the ports tree on their own +machine, and can even fork vcpkg and publish their own ports tree. +Unfortunately, this then means that any updates to the source tree require +merges, as opposed to being able to fast-forward to the newest sources. + +### Why Registries? + +There are many reasons to want custom registries; however, the most important reasons are: + +* Legal requirements – a company like Microsoft or Google + needs the ability to strictly control the code that goes into their products, + making certain that they are following the licenses strictly. + * There have been examples in the past where a library which is licensed under certain terms contains code + which is not legally allowed to be licensed under those terms (see [this example][legal-example], + where a person tried to merge Microsoft-owned, Apache-licensed code into the GPL-licensed libstdc++). +* Technical requirements – a company may wish to run their own tests on the packages they ship, + such as [fuzzing]. +* Other requirements – an organization may wish to strictly control its dependencies for a myriad of other reasons. +* Newer versions – vcpkg may not necessarily always be up to date for all libraries in our registry, + and an organization may require a newer version than we ship; + they can very easily update this package and have the version that they want. +* Port modifications – vcpkg has somewhat strict policies on port modifications, + and an organization may wish to make different modifications than we do. + It may allow that organization to make certain that the package works on triplets + that our team does not test as extensively. +* Testing – just like port modifications, if a team wants to do specific testing on triplets they care about, + they can do so via their custom registry. + +Then, there is the question of why vcpkg needs a new solution for custom registries, +beyond the existing overlay ports feature. There are two big reasons – +the first is to allow a project to define the registries that they use for their dependencies, +and the second is the clear advantage in the user experience of the vcpkg tool. +If a project requires specific packages to come from specific registries, +they can do so without worrying that a user accidentally misses the overlay ports part of a command. +Additionally, beyond a feature which makes overlay ports easier to use, +custom registries allow for more complex and useful infrastructure around registries. +In the initial custom registry implementation, we will allow overlay ports style paths, +as well as git repositories, which means that people can run and use custom registries +without writing their own infrastructure around getting people that registry. + +It is the intention of vcpkg to be the most user-friendly package manager for C++, +and this allows us to fulfill on that intention even further. +As opposed to having to write `--overlay-ports=path/to/overlay` for every command one runs, +or adding an environment variable `VCPKG_OVERLAY_PORTS`, +one can simply write vcpkg install and the registries will be taken care of for you. +As opposed to having to use git submodules, or custom registry code for every project, +one can write and run the infrastructure in one place, +and every project that uses that registry requires only a few lines of JSON. + +[legal-example]: https://gcc.gnu.org/legacy-ml/libstdc++/2019-09/msg00054.html +[fuzzing]: https://en.wikipedia.org/wiki/Fuzzing + +## Specification + +We will be adding a new file that vcpkg understands - `vcpkg-configuration.json`. +The way that vcpkg will find this file is different depending on what mode vcpkg is in: +in classic mode, vcpkg finds this file alongside the vcpkg binary, in the root directory. +In manifest mode, vcpkg finds this file alongside the manifest. For the initial implementation, +this is all vcpkg will look for; however, in the future, vcpkg will walk the tree and include +configuration all along the way: this allows for overriding defaults. +The specific algorithm for applying this is not yet defined, since currently only one +`vcpkg-configuration.json` is allowed. + +The only thing allowed in a `vcpkg-configuration.json` is a `` object. + +A `` is an object: +* Optionally, `"default-registry"`: A `` or `null` +* Optionally, `"registries"`: An array of ``s + +Since this is the first RFC that adds anything to this field, +as of now the only properties that can live in that object will be +these. + +A `` is an object matching one of the following: +* ``: + * `"kind"`: The string `"builtin"` +* ``: + * `"kind"`: The string `"directory"` + * `"path"`: A path +* ``: + * `"kind"`: The string `"git"` + * `"repository"`: A URI + * Optionally, `"path"`: An absolute path into the git repository + * Optionally, `"ref"`: A git reference + +A `` is a `` object, plus the following properties: +* Optionally, `"scopes"`: An array of ``s +* Optionally, `"packages"`: An array of ``s + +The `"packages"` and `"scopes"` fields of distinct registries must be disjoint, +and each `` must have at least one of the `"scopes"` and `"packages"` property, +since otherwise there's no point. + +As an example, a package which uses a different default registry, and a different registry for boost, +might look like the following: + +```json +{ + "default-registry": { + "kind": "directory", + "path": "vcpkg-ports" + }, + "registries": [ + { + "kind": "git", + "repository": "https://github.com/boostorg/vcpkg-ports", + "ref": "v1.73.0", + "scopes": [ "boost" ] + }, + { + "kind": "builtin", + "packages": [ "cppitertools" ] + } + ] +} +``` + +This will install `fmt` from `/vcpkg-ports`, +`cppitertools` from the registry that ships with vcpkg, +and any `boost` dependencies from `https://github.com/boostorg/vcpkg-ports`. +Notably, this does not replace behavior up the tree -- only the `vcpkg-configuration.json`s +for the current invocation do anything. + +### Behavior + +When a vcpkg command requires the installation of dependencies, +it will generate the initial list of dependencies from the package, +and then run the following algorithm on each dependency: + +1. Figure out which registry the package should come from by doing the following: + 1. If there is a registry in the registry set which contains the dependency name in the `"packages"` array, + then use that registry. + 2. For every scope, in order from most specific to least, + if there is a registry in the registry set which contains that scope in the `"scopes"` array, + then use that registry. + (For example, for `"cat.meow.cute"`, check first for `"cat.meow.cute"`, then `"cat.meow"`, then `"cat"`). + 3. If the default registry is not `null`, use that registry. + 4. Else, error. +2. Then, add that package's dependencies to the list of packages to find, and repeat for the next dependency. + +vcpkg will also rerun this algorithm whenever an install is run with different configuration. + +### How Registries are Layed Out + +There are three kinds of registries, but they only differ in how the registry gets onto one's filesystem. +Once the registry is there, package lookup runs the same, with each kind having it's own way of defining its +own root. + +In order to find a port `meow` in a registry with root `R`, vcpkg first sees if `R/meow` exists; +if it does, then the port root is `R/meow`. Otherwise, see if `R/m-` exists; if it does, +then the port root is `R/m-/meow`. (note: this algorithm may be extended further in the future). + +For example, given the following port root: + +``` +R/ + abseil/... + b-/ + boost/... + boost-build/... + banana/... + banana/... +``` + +The port root for `abseil` is `R/abseil`; the port root for `boost` is `R/b-/boost`; +the port root for `banana` is `R/banana` (although this duplication is not recommended). + +The reason we are making this change to allow more levels in the ports tree is that ~1300 +ports are hard to look through in a tree view, and this allows us to see only the ports we're +interested in. Additionally, no port name may end in a `-`, so this means that these port subdirectories +will never intersect with actual ports. Additionally, since we use only ASCII for port names, +we don't have to worry about graphemes vs. code units vs. code points -- in ASCII, they are equivalent. + +Let's now look at how different registry kinds work: + +#### `` + +For a ``, there is no configuration required. +The registry root is simply `/ports`. + +#### `` + +For a ``, it is again fairly simple. +Given `$path` the value of the `"path"` property, the registry root is either: + +* If `$path` is absolute, then the registry root is `$path`. +* If `$path` is drive-relative (only important on Windows), the registry root is + `(drive of vcpkg.json)/$path` +* If `$path` is relative, the registry root is `(directory of vcpkg.json)/$path` + +Note that the path to vcpkg.json is _not_ canonicalized; it is used exactly as it is seen by vcpkg. + +#### `` + +This registry is the most complex. We would like to cache existing registries, +but we don't want to ignore new updates to the registry. +It is the opinion of the author that we want to find more updates than not, +so we will update the registry whenever the `vcpkg.json` or `vcpkg-configuration.json` +is modified. We will do so by keeping a sha512 of the `vcpkg.json` and `vcpkg-configuration.json` +inside the `vcpkg-installed` directory. + +We will download the specific ref of the repository to a central location (and update as needed), +and the root will be either: ``, if the `"path"` property is not defined, +or else `/` if it is defined. +The `"path"` property must be absolute, without a drive, and will be treated as relative to +the path to the repository. For example: + +```json +{ + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg", + "path": "/ports" +} +``` + +is the correct way to refer to the registry built in to vcpkg, at the latest version. + +The following are all incorrect: + +```json +{ + "$reason": "path can't be drive-absolute", + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg", + "path": "F:/ports" +} +``` + +```json +{ + "$reason": "path can't be relative", + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg", + "path": "ports" +} +``` + +```json +{ + "$reason": "path _really_ can't be relative like that", + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg", + "path": "../../meow/ports" +} +``` diff --git a/docs/users/config-environment.md b/docs/users/config-environment.md index ffa988cbc38346..22f7ff84a2d3e1 100644 --- a/docs/users/config-environment.md +++ b/docs/users/config-environment.md @@ -38,11 +38,19 @@ Example: `D:\2017` This environment variable can be set to a triplet name which will be used for unqualified triplet references in command lines. +#### VCPKG_OVERLAY_PORTS + +This environment variable allows users to override ports with alternate versions according to the +[ports overlay](../specifications/ports-overlay.md) specification. List paths to overlays using +the platform dependent PATH seperator (Windows `;` | others `:`) + +Example (Windows): `C:\custom-ports\boost;C:\custom-ports\sqlite3` + #### VCPKG_FORCE_SYSTEM_BINARIES This environment variable, if set, suppresses the downloading of CMake and Ninja and forces the use of the system binaries. -### VCPKG_KEEP_ENV_VARS +#### VCPKG_KEEP_ENV_VARS This environment variable can be set to a list of environment variables, separated by `;`, which will be propagated to the build environment. diff --git a/docs/users/integration.md b/docs/users/integration.md index e9a9c42cda0ac0..e9d8940aa500c3 100644 --- a/docs/users/integration.md +++ b/docs/users/integration.md @@ -22,6 +22,7 @@ This will implicitly add Include Directories, Link Directories, and Link Librari For the vast majority of libraries, this is all you need to do -- just File -> New Project and write code! However, some libraries perform conflicting behaviors such as redefining `main()`. Since you need to choose per-project which of these conflicting options you want, you will need to add those libraries to your linker inputs manually. Here are some examples, though this is not an exhaustive list: + - Gtest provides `gtest`, `gmock`, `gtest_main`, and `gmock_main` - SDL2 provides `SDL2main` - SFML provides `sfml-main` @@ -81,6 +82,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console #### Manual compiler settings Libraries are installed into the `installed\` subfolder, partitioned by architecture (e.g. x86-windows): + * The header files are installed to `installed\x86-windows\include` * Release `.lib` files are installed to `installed\x86-windows\lib` or `installed\x86-windows\lib\manual-link` * Release `.dll` files are installed to `installed\x86-windows\bin` @@ -112,6 +114,7 @@ Please also see our [blog post](https://blogs.msdn.microsoft.com/vcblog/2017/05/ ### Triplet selection Every integration mechanism besides manually adding the folders will deduce a [triplet][] for your project as one of: + - x86-windows - x64-windows - x86-uwp diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 10ac31fd5736e4..b587a91e5288d3 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -78,6 +78,15 @@ This option also has forms for configuration-specific and C flags: - `VCPKG_C_FLAGS_DEBUG` - `VCPKG_C_FLAGS_RELEASE` +### VCPKG_LINKER_FLAGS +Sets additional linker flags to be used while building dynamic libraries and +executables in the absence of `VCPKG_CHAINLOAD_TOOLCHAIN_FILE`. + +This option also has forms for configuration-specific flags: +- `VCPKG_LINKER_FLAGS` +- `VCPKG_LINKER_FLAGS_DEBUG` +- `VCPKG_LINKER_FLAGS_RELEASE` + ### VCPKG_DEP_INFO_OVERRIDE_VARS Replaces the default computed list of triplet "Supports" terms. diff --git a/ports/3fd/vcpkg.json b/ports/3fd/vcpkg.json index f183916e6613ff..92c53d327f5a79 100644 --- a/ports/3fd/vcpkg.json +++ b/ports/3fd/vcpkg.json @@ -16,7 +16,7 @@ "name": "poco", "platform": "windows" }, - "sqlite3", - "rapidxml" + "rapidxml", + "sqlite3" ] } diff --git a/ports/7zip/CMakeLists.txt b/ports/7zip/CMakeLists.txt index 7e93a3bf0d0092..4ed90058413b0c 100644 --- a/ports/7zip/CMakeLists.txt +++ b/ports/7zip/CMakeLists.txt @@ -108,6 +108,7 @@ set(SRC_C C/Lzma2Enc.c C/LzmaDec.c C/LzmaEnc.c + C/LzmaLib.c C/MtCoder.c C/MtDec.c C/Ppmd7.c @@ -311,6 +312,7 @@ add_library(7zip ${SRC_CRYPTO} ${SRC_C} CPP/7zip/Archive/Archive2.def + C/Util/LzmaLib/LzmaLib.def ) target_compile_definitions(7zip @@ -334,6 +336,14 @@ target_include_directories(7zip set(PUBLIC_HEADERS C/7zTypes.h + C/Alloc.h + C/LzFind.h + C/LzFindMt.h + C/LzHash.h + C/LzmaDec.h + C/LzmaEnc.h + C/LzmaLib.h + C/Threads.h CPP/7zip/Archive/IArchive.h CPP/7zip/ICoder.h CPP/7zip/IDecl.h diff --git a/ports/7zip/CONTROL b/ports/7zip/CONTROL index 42cb47b345bba6..73150ef444e68c 100644 --- a/ports/7zip/CONTROL +++ b/ports/7zip/CONTROL @@ -1,3 +1,4 @@ Source: 7zip Version: 19.00 +Port-Version: 1 Description: Library for archiving file with a high compression ratio. diff --git a/ports/abseil/fix-cmake-threads-dependency.patch b/ports/abseil/fix-cmake-threads-dependency.patch new file mode 100644 index 00000000000000..0dda75e36ab3d4 --- /dev/null +++ b/ports/abseil/fix-cmake-threads-dependency.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/abslConfig.cmake.in b/CMake/abslConfig.cmake.in +index 60847fa77..6d23f63d3 100644 +--- a/CMake/abslConfig.cmake.in ++++ b/CMake/abslConfig.cmake.in +@@ -1,6 +1,7 @@ + # absl CMake configuration file. + +-include(FindThreads) ++include(CMakeFindDependencyMacro) ++find_dependency(Threads) + + @PACKAGE_INIT@ + diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 8fcf0bb7630b42..0b62c6c2e25407 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -7,9 +7,12 @@ set(ABSEIL_PATCHES # This patch is an upstream commit, the related PR: https://github.com/abseil/abseil-cpp/pull/637 fix-MSVCbuildfail.patch - + # Remove this patch in next update, see https://github.com/google/cctz/pull/145 fix-arm-build.patch + + # This patch is an upstream commit: https://github.com/abseil/abseil-cpp/commit/68494aae959dfbbf781cdf03a988d2f5fc7e4802 + fix-cmake-threads-dependency.patch ) if("cxx17" IN_LIST FEATURES) diff --git a/ports/abseil/vcpkg.json b/ports/abseil/vcpkg.json index cfc1022ea4f9cc..79e6c308b5d097 100644 --- a/ports/abseil/vcpkg.json +++ b/ports/abseil/vcpkg.json @@ -1,14 +1,14 @@ { "name": "abseil", "version-string": "2020-03-03", - "port-version": 7, - "homepage": "https://github.com/abseil/abseil-cpp", + "port-version": 8, "description": [ "an open-source collection designed to augment the C++ standard library.", "Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.", "In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.", "Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole." ], + "homepage": "https://github.com/abseil/abseil-cpp", "features": [ { "name": "cxx17", diff --git a/ports/ace/CONTROL b/ports/ace/CONTROL index 6190d4a1f412bc..eca959e3ec6c9b 100644 --- a/ports/ace/CONTROL +++ b/ports/ace/CONTROL @@ -1,5 +1,5 @@ Source: ace -Version: 6.5.10 +Version: 6.5.11 Homepage: https://www.dre.vanderbilt.edu/~schmidt/ACE.html Description: The ADAPTIVE Communication Environment diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index f06b2c468ff610..61212814763ede 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,7 +1,7 @@ # Using zip archive under Linux would cause sh/perl to report "No such file or directory" or "bad interpreter" # when invoking `prj_install.pl`. # So far this issue haven't yet be triggered under WSL 1 distributions. Not sure the root cause of it. -set(ACE_VERSION 6.5.10) +set(ACE_VERSION 6.5.11) string(REPLACE "." "_" ACE_VERSION_DIRECTORY ${ACE_VERSION}) if("tao" IN_LIST FEATURES) @@ -10,14 +10,14 @@ if("tao" IN_LIST FEATURES) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-${ACE_VERSION_DIRECTORY}/ACE%2BTAO-src-${ACE_VERSION}.zip" FILENAME ACE-TAO-${ACE_VERSION}.zip - SHA512 1b6453bb692dde6a51090a1ea57677d9241a54ebb7edf32838dbf413f7515b83ae77f407998609f6dcd7cc37b2d4973f2b5cb1ad2f92f75caa686efd08c3a0b5 + SHA512 82c4aa9718814f72f6ecc45da064d8d30f104d9b4785f357525c4c4a8ceb709e5885ddb1c4729df0cab9f69282c8f58cce3a23573a74e1dbdc677a6a54c1c894 ) else() # VCPKG_TARGET_IS_LINUX vcpkg_download_distfile(ARCHIVE URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-${ACE_VERSION_DIRECTORY}/ACE%2BTAO-src-${ACE_VERSION}.tar.gz" FILENAME ACE-TAO-${ACE_VERSION}.tar.gz - SHA512 d0b8c6b398fba62dce75daa2f8759113c1235be3dc3d1c88ecce668d804a1acd6f40bc7e38eede3000c7f85e9da2123b84da1357375f5ee29b1a002cd9d6e0f8 + SHA512 82d69ed23b049948b104677afb93fcaad4468335268b101e5b7d73aa15b380d120253415b42cadf6ba45bbf2ed3771d51f7b56c56eb93ff9e33a044f118f9191 ) endif() else() @@ -26,14 +26,14 @@ else() vcpkg_download_distfile(ARCHIVE URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-${ACE_VERSION_DIRECTORY}/ACE-src-${ACE_VERSION}.zip" FILENAME ACE-src-${ACE_VERSION}.zip - SHA512 d17b4bf41ea6804594a8363d2b8776b5981d305df75b99cda5fe05dd021261a424e1038a522c8dc175f8ea2ee15e064676cbd615bd6c3c6339ef174a0e8a0914 + SHA512 36f286240ac81c9de0c4a21a54e9e61a4efd0ae9e8381732dadfba496768b697dec9fb448e0d252293bfd686e114c644c7602ddbdbe74c5d73eb6423d00d0ae5 ) else(VCPKG_TARGET_IS_WINDOWS) # VCPKG_TARGET_IS_LINUX vcpkg_download_distfile(ARCHIVE URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-${ACE_VERSION_DIRECTORY}/ACE-src-${ACE_VERSION}.tar.gz" FILENAME ACE-src-${ACE_VERSION}.tar.gz - SHA512 a92edae9e120f2220272f138907fc25e53753d3b21a446460e8682d0cae6f5c6e5fa08d398630f6d1e189bc47ce8e69a52143635f459292522753549fd7ad9ab + SHA512 e47e1ef2e8d517aed3c647a1e7dd9ac8b54ed187f9d6adf1e535bb7c4da6e8e808d72850ae18f2e42842ea9487ef774f7af90d1fbede17e0858e2b5846650580 ) endif() endif() diff --git a/ports/akali/CONTROL b/ports/akali/CONTROL index a7acd59194766c..35f86f28ce02e9 100644 --- a/ports/akali/CONTROL +++ b/ports/akali/CONTROL @@ -1,4 +1,5 @@ Source: akali Version: 1.41 +Port-Version: 1 Description: C++ Common Library. -Homepage: https://github.com/winsoft666/akali \ No newline at end of file +Homepage: https://github.com/winsoft666/akali diff --git a/ports/alembic/CONTROL b/ports/alembic/CONTROL index 54442f2e444166..e58acda672ab63 100644 --- a/ports/alembic/CONTROL +++ b/ports/alembic/CONTROL @@ -1,5 +1,7 @@ Source: alembic -Version: 1.7.12-1 +Version: 1.7.13 +Port-Version: 1 Build-Depends: ilmbase, hdf5 Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications. Homepage: https://alembic.io/ +Supports: windows & !arm & !uwp & !static diff --git a/ports/alembic/fix-C1083.patch b/ports/alembic/fix-C1083.patch deleted file mode 100644 index 15de9f514f9f26..00000000000000 --- a/ports/alembic/fix-C1083.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/lib/Alembic/Abc/Foundation.h b/lib/Alembic/Abc/Foundation.h -index 9760c49..fbab6a0 100644 ---- a/lib/Alembic/Abc/Foundation.h -+++ b/lib/Alembic/Abc/Foundation.h -@@ -40,11 +40,11 @@ - #include - #include - --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include - - #include - #include -diff --git a/lib/Alembic/AbcGeom/Foundation.h b/lib/Alembic/AbcGeom/Foundation.h -index 301efc3..2bb0f6b 100644 ---- a/lib/Alembic/AbcGeom/Foundation.h -+++ b/lib/Alembic/AbcGeom/Foundation.h -@@ -39,8 +39,8 @@ - - #include - --#include --#include -+#include -+#include - - - namespace Alembic { -diff --git a/lib/Alembic/Util/Foundation.h b/lib/Alembic/Util/Foundation.h -index d7f40dd..a41bb97 100644 ---- a/lib/Alembic/Util/Foundation.h -+++ b/lib/Alembic/Util/Foundation.h -@@ -63,7 +63,7 @@ - - #include - --#include -+#include - - #include - #include diff --git a/ports/alembic/fix-find-openexr-ilmbase.patch b/ports/alembic/fix-find-openexr-ilmbase.patch index 6a72711f425964..f35f17df35ec4f 100644 --- a/ports/alembic/fix-find-openexr-ilmbase.patch +++ b/ports/alembic/fix-find-openexr-ilmbase.patch @@ -2,7 +2,7 @@ diff --git a/cmake/AlembicIlmBase.cmake b/cmake/AlembicIlmBase.cmake index cd00d70..0e50512 100644 --- a/cmake/AlembicIlmBase.cmake +++ b/cmake/AlembicIlmBase.cmake -@@ -33,11 +33,25 @@ +@@ -33,11 +33,17 @@ ## ##-***************************************************************************** @@ -16,17 +16,9 @@ index cd00d70..0e50512 100644 + set(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${OpenEXR_INCLUDE_DIRS}/OpenEXR) + set(ALEMBIC_ILMBASE_HALF_LIB ${OPENEXR_HALF_LIBRARY}) + set(ALEMBIC_ILMBASE_IEX_LIB ${OPENEXR_IEX_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OpenEXR_IEXMATH_LIBRARY}) ++ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IMATH_LIBRARY}) + set(ALEMBIC_ILMBASE_ILMTHREAD_LIB ${OPENEXR_ILMTHREAD_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) -+ -+ MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) -+ MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) -+ MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) -+ MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) -+ MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) -+ MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) -+ ++ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) SET(ALEMBIC_ILMBASE_LIBS ${ALEMBIC_ILMBASE_IMATH_LIB} ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} @@ -46,348 +38,13 @@ diff --git a/cmake/AlembicOpenEXR.cmake b/cmake/AlembicOpenEXR.cmake index 0833b32..a9180cd 100644 --- a/cmake/AlembicOpenEXR.cmake +++ b/cmake/AlembicOpenEXR.cmake -@@ -38,8 +38,12 @@ +@@ -38,8 +38,8 @@ FIND_PACKAGE( OpenEXR ) IF( OPENEXR_FOUND ) - SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS} ) + SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS}/OpenEXR ) SET( ALEMBIC_OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ) -+ -+ MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) -+ MESSAGE( STATUS "OPENEXR LIB: ${ALEMBIC_OPENEXR_LIBRARIES}" ) -+ # SET( ALEMBIC_OPENEXR_DEFINITIONS ${OPENEXR_DEFINITIONS} ) SET( ALEMBIC_OPENEXR_FOUND 1 CACHE STRING "Set to 1 if OpenEXR is found, 0 otherwise" ) -diff --git a/cmake/Modules/FindIlmBase.cmake b/cmake/Modules/FindIlmBase.cmake -deleted file mode 100644 -index 679a02f..0000000 ---- a/cmake/Modules/FindIlmBase.cmake -+++ /dev/null -@@ -1,190 +0,0 @@ --##-***************************************************************************** --## --## Copyright (c) 2009-2016, --## Sony Pictures Imageworks Inc. and --## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. --## --## All rights reserved. --## --## Redistribution and use in source and binary forms, with or without --## modification, are permitted provided that the following conditions are --## met: --## * Redistributions of source code must retain the above copyright --## notice, this list of conditions and the following disclaimer. --## * Redistributions in binary form must reproduce the above --## copyright notice, this list of conditions and the following disclaimer --## in the documentation and/or other materials provided with the --## distribution. --## * Neither the name of Industrial Light & Magic nor the names of --## its contributors may be used to endorse or promote products derived --## from this software without specific prior written permission. --## --## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --## --##-***************************************************************************** -- --#-****************************************************************************** --#-****************************************************************************** --# FIRST, ILMBASE STUFF --#-****************************************************************************** --#-****************************************************************************** -- --# If ILMBASE_ROOT was defined in the environment, use it. --IF(NOT ILMBASE_ROOT AND NOT $ENV{ILMBASE_ROOT} STREQUAL "") -- SET(ILMBASE_ROOT $ENV{ILMBASE_ROOT}) --ENDIF() -- --IF(NOT DEFINED ILMBASE_ROOT) -- MESSAGE(STATUS "ILMBASE_ROOT is undefined" ) -- IF ( ${CMAKE_HOST_UNIX} ) -- IF( ${DARWIN} ) -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) -- ELSE() -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_ILMBASE_ROOT "/usr/local/ilmbase-1.0.1/" ) -- ENDIF() -- ELSE() -- IF ( ${WINDOWS} ) -- # TODO: set to 32-bit or 64-bit path -- SET( ALEMBIC_ILMBASE_ROOT "C:/Program Files (x86)/ilmbase-1.0.1/" ) -- ELSE() -- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) -- ENDIF() -- ENDIF() --ELSE() -- SET( ALEMBIC_ILMBASE_ROOT ${ILMBASE_ROOT} ) --ENDIF() -- --SET(_ilmbase_FIND_COMPONENTS -- Half -- Iex -- IexMath -- IlmThread -- Imath --) -- --SET(_ilmbase_SEARCH_DIRS -- ${ALEMBIC_ILMBASE_ROOT} -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local -- /usr -- /sw -- /opt/local -- /opt/csw -- /opt -- /usr/freeware --) -- --FIND_PATH(ILMBASE_INCLUDE_DIR -- NAMES -- IlmBaseConfig.h -- HINTS -- ${_ilmbase_SEARCH_DIRS} -- PATH_SUFFIXES -- include -- include/OpenEXR --) -- --# If the headers were found, get the version from config file, if not already set. --IF(ILMBASE_INCLUDE_DIR) -- SET(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${ILMBASE_INCLUDE_DIR}) -- IF(NOT ILMBASE_VERSION) -- -- FIND_FILE(_ilmbase_CONFIG -- NAMES -- IlmBaseConfig.h -- PATHS -- "${ILMBASE_INCLUDE_DIR}" -- "${ILMBASE_INCLUDE_DIR}/OpenEXR" -- ) -- -- IF(_ilmbase_CONFIG) -- FILE(STRINGS "${_ilmbase_CONFIG}" ILMBASE_BUILD_SPECIFICATION -- REGEX "^[ \t]*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"[.0-9]+\".*$") -- ELSE() -- MESSAGE(WARNING "Could not find \"OpenEXRConfig.h\" in \"${ILMBASE_INCLUDE_DIR}\"") -- ENDIF() -- -- IF(ILMBASE_BUILD_SPECIFICATION) -- STRING(REGEX REPLACE ".*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"([.0-9]+)\".*" -- "\\2" _ilmbase_libs_ver_init ${ILMBASE_BUILD_SPECIFICATION}) -- ELSE() -- MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_ilmbase_libs_ver_init}.") -- ENDIF() -- -- UNSET(_ilmbase_CONFIG CACHE) -- -- ENDIF() -- -- SET("ILMBASE_VERSION" ${_ilmbase_libs_ver_init} CACHE STRING "Version of OpenEXR lib") -- UNSET(_ilmbase_libs_ver_init) -- -- STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION}) --ENDIF() -- -- --SET(_ilmbase_LIBRARIES) --FOREACH(COMPONENT ${_ilmbase_FIND_COMPONENTS}) -- STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) -- -- FIND_LIBRARY(ALEMBIC_ILMBASE_${UPPERCOMPONENT}_LIB -- NAMES -- ${COMPONENT}-${_ilmbase_libs_ver} ${COMPONENT} -- HINTS -- ${_ilmbase_SEARCH_DIRS} -- PATH_SUFFIXES -- lib64 lib -- ) -- LIST(APPEND _ilmbase_LIBRARIES "${ILMBASE_${UPPERCOMPONENT}_LIBRARY}") --ENDFOREACH() -- --UNSET(_ilmbase_libs_ver) -- --IF ( ${ALEMBIC_ILMBASE_HALF_LIB} STREQUAL "ALEMBIC_ILMBASE_HALF_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_IEX_LIB} STREQUAL "ALEMBIC_ILMBASE_IEX_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( DEFINED USE_IEXMATH AND USE_IEXMATH ) -- IF ( ${ALEMBIC_ILMBASE_IEXMATH_LIB} STREQUAL -- "ALEMBIC_ILMBASE_IEXMATH_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IexMath, IlmThread, Imath) not found, required" ) -- ENDIF() --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} STREQUAL "ALEMBIC_ILMBASE_ILMTHREAD_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_IMATH_LIB} STREQUAL "ALEMBIC_ILMBASE_IMATH_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY} STREQUAL "ALEMBIC_ILMBASE_INCLUDE_DIRECTORY-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase header files not found, required: ALEMBIC_ILMBASE_ROOT: ${ALEMBIC_ILMBASE_ROOT}" ) --ENDIF() -- -- --MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) --MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) --MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) --MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) --MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) --MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) -- --SET( ILMBASE_FOUND TRUE ) -diff --git a/cmake/Modules/FindOpenEXR.cmake b/cmake/Modules/FindOpenEXR.cmake -deleted file mode 100644 -index 935fe6f..0000000 ---- a/cmake/Modules/FindOpenEXR.cmake -+++ /dev/null -@@ -1,129 +0,0 @@ --##-***************************************************************************** --## --## Copyright (c) 2009-2011, --## Sony Pictures Imageworks Inc. and --## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. --## --## All rights reserved. --## --## Redistribution and use in source and binary forms, with or without --## modification, are permitted provided that the following conditions are --## met: --## * Redistributions of source code must retain the above copyright --## notice, this list of conditions and the following disclaimer. --## * Redistributions in binary form must reproduce the above --## copyright notice, this list of conditions and the following disclaimer --## in the documentation and/or other materials provided with the --## distribution. --## * Neither the name of Industrial Light & Magic nor the names of --## its contributors may be used to endorse or promote products derived --## from this software without specific prior written permission. --## --## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --## --##-***************************************************************************** -- -- --# We shall worry about windowsification later. -- --#-****************************************************************************** --#-****************************************************************************** --# NOW, OPENEXR STUFF. EXR IS OPTIONAL, WHERASE ILMBASE IS NOT --#-****************************************************************************** --#-****************************************************************************** -- --IF(NOT DEFINED OPENEXR_ROOT) -- IF ( ${CMAKE_HOST_UNIX} ) -- IF( ${DARWIN} ) -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ELSE() -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_OPENEXR_ROOT "/usr/local/openexr-1.6.1/" ) -- ENDIF() -- ELSE() -- IF ( ${WINDOWS} ) -- # TODO: set to 32-bit or 64-bit path -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ELSE() -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ENDIF() -- ENDIF() --ELSE() -- SET( ALEMBIC_OPENEXR_ROOT ${OPENEXR_ROOT} ) --ENDIF() -- --IF(NOT $ENV{OPENEXR_ROOT}x STREQUAL "x") -- SET( ALEMBIC_OPENEXR_ROOT $ENV{OPENEXR_ROOT}) --ELSE() -- SET( ENV{OPENEXR_ROOT} ${OPENEXR_ROOT} ) --ENDIF() -- -- --SET(LIBRARY_PATHS -- ${ALEMBIC_OPENEXR_ROOT}/lib -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local/lib -- /usr/lib -- /sw/lib -- /opt/local/lib -- /opt/csw/lib -- /opt/lib -- /usr/freeware/lib64 --) -- --SET(INCLUDE_PATHS -- ${ALEMBIC_OPENEXR_ROOT}/include/OpenEXR/ -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local/include/OpenEXR/ -- /usr/local/include -- /usr/include -- /sw/include # Fink -- /opt/local/include # DarwinPorts -- /opt/csw/include # Blastwave -- /opt/include -- /usr/freeware/include --) -- --FIND_PATH( ALEMBIC_OPENEXR_INCLUDE_PATH ImfRgba.h -- PATHS -- ${INCLUDE_PATHS} -- DOC "The directory where ImfRgba.h resides" ) -- --FIND_LIBRARY( ALEMBIC_OPENEXR_ILMIMF_LIB IlmImf -- PATHS -- ${LIBRARY_PATHS} -- DOC "The IlmImf library" ) -- -- --SET( OPENEXR_FOUND TRUE ) -- --IF ( ${ALEMBIC_OPENEXR_INCLUDE_PATH} STREQUAL "ALEMBIC_OPENEXR_INCLUDE_PATH-NOTFOUND" ) -- MESSAGE( STATUS "OpenEXR include path not found, disabling" ) -- SET( OPENEXR_FOUND FALSE ) --ENDIF() -- --IF ( ${ALEMBIC_OPENEXR_ILMIMF_LIB} STREQUAL "ALEMBIC_OPENEXR_ILMIMF_LIB-NOTFOUND" ) -- MESSAGE( STATUS "OpenEXR libraries not found, disabling" ) -- SET( OPENEXR_FOUND FALSE ) -- SET( ALEMBIC_OPENEXR_LIBS NOTFOUND ) --ENDIF() -- --IF (OPENEXR_FOUND) -- MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) -- SET( ALEMBIC_OPENEXR_LIBS ${ALEMBIC_OPENEXR_ILMIMF_LIB} ) --ENDIF() -- -- diff --git a/ports/alembic/portfile.cmake b/ports/alembic/portfile.cmake index ecd1974940e0a3..6c9a2b57d32a5d 100644 --- a/ports/alembic/portfile.cmake +++ b/ports/alembic/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "OSX" "Linux") + vcpkg_buildpath_length_warning(37) vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) @@ -5,14 +7,16 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO alembic/alembic - REF 1.7.12 - SHA512 e05e0b24056c17f01784ced1f9606a269974de195f1aca8a6fce2123314e7ee609f70df77ac7fe18dc7f0c04fb883d38cc7de9b963caacf9586aaa24d4ac6210 + REF cfe114639ef7ad084d61e71ab86a17e708d838ae #v1.7.13 + SHA512 38b797c1179e759870f10afc4a2182bc3e874eacecc9627c879d3a5cf35e49c83cae80600678427e5c22d6576d0e6280ce3cf0a2ac505f1df74ec4a8bdb083b5 HEAD_REF master PATCHES - fix-C1083.patch fix-find-openexr-ilmbase.patch ) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindIlmBase.cmake) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindOpenEXR.cmake) + if(NOT VCPKG_TARGET_IS_WINDOWS) # In debug mode with g++, alembic defines -Werror # so we need to disable some warnings to avoid build errors @@ -49,20 +53,20 @@ if(VCPKG_TARGET_IS_WINDOWS) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/bin/Alembic.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/debug/bin/Alembic.dll) - file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake DEBUG_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake DEBUG_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/Alembic.dll" "\${_IMPORT_PREFIX}/debug/bin/Alembic.dll" DEBUG_CONFIG "${DEBUG_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") - file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake RELEASE_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake RELEASE_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/lib/Alembic.dll" "\${_IMPORT_PREFIX}/bin/Alembic.dll" RELEASE_CONFIG "${RELEASE_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake "${RELEASE_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake "${RELEASE_CONFIG}") else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/alembic) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/alembic RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/apr-util/CONTROL b/ports/apr-util/CONTROL index 766aeb919830e3..f3e54d01394585 100644 --- a/ports/apr-util/CONTROL +++ b/ports/apr-util/CONTROL @@ -1,5 +1,6 @@ Source: apr-util -Version: 1.6.1-1 +Version: 1.6.1 +Port-Version: 2 Homepage: https://apr.apache.org/ Description: Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation Build-Depends: expat, apr, openssl diff --git a/ports/apr-util/use-vcpkg-expat.patch b/ports/apr-util/use-vcpkg-expat.patch index 28bcb51dce4de7..f124fcdd51ecdc 100644 --- a/ports/apr-util/use-vcpkg-expat.patch +++ b/ports/apr-util/use-vcpkg-expat.patch @@ -1,116 +1,124 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9ae90b19..b0e86e2c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,8 +29,9 @@ OPTION(APR_HAS_LDAP "LDAP support" ON) - OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) - OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) - OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) --SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files") --SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with") -+ -+find_path(APR_INCLUDE_DIR apr.h) -+find_library(APR_LIBRARIES NAMES libapr-1 apr-1) - - IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") - MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") -@@ -65,8 +66,8 @@ IF(NOT EXPAT_FOUND) - MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!") - ENDIF() - --SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) --SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) -+find_path(XMLLIB_INCLUDE_DIR expat.h) -+find_library(XMLLIB_LIBRARIES NAMES expat) - - SET(LDAP_LIBRARIES) - IF(APR_HAS_LDAP) -@@ -229,17 +230,21 @@ SET(dbd_drivers) - # Note: The WINNT definition on some targets is used only by libaprutil.rc. - - # libaprutil-1 is shared, aprutil-1 is static -+if(BUILD_SHARED_LIBS) - ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) - SET(install_targets ${install_targets} libaprutil-1) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) - TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) --SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") -+SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_IMPORT;XML_STATIC;WINNT") - -+else(BUILD_SHARED_LIBS) - ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) - SET(install_targets ${install_targets} aprutil-1) - TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) - SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") -- -+endif(BUILD_SHARED_LIBS) -+ -+if(BUILD_SHARED_LIBS) - IF(APU_HAVE_CRYPTO) - IF(NOT OPENSSL_FOUND) - MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") -@@ -249,7 +254,7 @@ IF(APU_HAVE_CRYPTO) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) - SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") - SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") -- SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl") -+ SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_crypto_openssl") - TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF() - -@@ -260,8 +265,8 @@ IF(APU_HAVE_ODBC) - SET(dbd_drivers ${dbd_drivers} odbc) - TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32) - SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) -- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT") -- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc") -+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_IMPORT;APR_DECLARE_IMPORT;APU_DSO_MODULE_BUILD;WINNT") -+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_dbd_odbc") - ENDIF() - - IF(APR_HAS_LDAP) -@@ -271,11 +276,12 @@ IF(APR_HAS_LDAP) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) - TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES}) - SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") -- SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap") -+ SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_ldap") - SET(apr_ldap_libraries apr_ldap-1) - ELSE() - SET(apr_ldap_libraries) - ENDIF() -+endif(BUILD_SHARED_LIBS) - - IF(APR_BUILD_TESTAPR) - ENABLE_TESTING() -@@ -289,7 +295,7 @@ IF(APR_BUILD_TESTAPR) - ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml - ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) - -- IF(TEST_STATIC_LIBS) -+ IF(NOT BUILD_SHARED_LIBS) - SET(whichapr aprutil-1) - SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC") - ELSE() -@@ -325,13 +331,15 @@ INSTALL(TARGETS ${install_targets} - ARCHIVE DESTINATION lib - ) - --IF(INSTALL_PDB) -- INSTALL(FILES ${install_bin_pdb} -- DESTINATION bin -- CONFIGURATIONS RelWithDebInfo Debug) --ENDIF() -+#IF(INSTALL_PDB) -+# INSTALL(FILES ${install_bin_pdb} -+# DESTINATION bin -+# CONFIGURATIONS RelWithDebInfo Debug) -+#ENDIF() - --INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) -+if(NOT DISABLE_INSTALL_HEADERS) -+ INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) -+endif() - - STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) - MESSAGE(STATUS "") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9ae90b1..71a50b0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,16 +21,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + + FIND_PACKAGE(OpenSSL) + +-FIND_PACKAGE(expat) +- + OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) + OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) + OPTION(APR_HAS_LDAP "LDAP support" ON) + OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) + OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) + OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +-SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files") +-SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with") ++find_path(APR_INCLUDE_DIR apr.h) ++find_library(APR_LIBRARIES NAMES libapr-1 apr-1) + + IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") + MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") +@@ -61,13 +59,13 @@ IF(APR_HAS_LDAP) + SET(apr_has_ldap_10 1) + ENDIF() + +-IF(NOT EXPAT_FOUND) ++find_path(XMLLIB_INCLUDE_DIR expat.h) ++find_library(XMLLIB_LIBRARIES NAMES libexpat libexpatMD) ++ ++IF(NOT XMLLIB_LIBRARIES) + MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!") + ENDIF() + +-SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) +-SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) +- + SET(LDAP_LIBRARIES) + IF(APR_HAS_LDAP) + SET(LDAP_LIBRARIES wldap32) +@@ -229,17 +227,21 @@ SET(dbd_drivers) + # Note: The WINNT definition on some targets is used only by libaprutil.rc. + + # libaprutil-1 is shared, aprutil-1 is static ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) + SET(install_targets ${install_targets} libaprutil-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) + TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) +-SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") ++SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_IMPORT;XML_STATIC;WINNT") + ++else(BUILD_SHARED_LIBS) + ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) + SET(install_targets ${install_targets} aprutil-1) + TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) + SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") ++endif(BUILD_SHARED_LIBS) + ++if(BUILD_SHARED_LIBS) + IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") +@@ -249,7 +251,7 @@ IF(APU_HAVE_CRYPTO) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") +- SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl") ++ SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_crypto_openssl") + TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) + ENDIF() + +@@ -260,8 +262,8 @@ IF(APU_HAVE_ODBC) + SET(dbd_drivers ${dbd_drivers} odbc) + TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32) + SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) +- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT") +- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc") ++ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_IMPORT;APR_DECLARE_IMPORT;APU_DSO_MODULE_BUILD;WINNT") ++ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_dbd_odbc") + ENDIF() + + IF(APR_HAS_LDAP) +@@ -271,11 +273,12 @@ IF(APR_HAS_LDAP) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) + TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES}) + SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") +- SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap") ++ SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_ldap") + SET(apr_ldap_libraries apr_ldap-1) + ELSE() + SET(apr_ldap_libraries) + ENDIF() ++endif(BUILD_SHARED_LIBS) + + IF(APR_BUILD_TESTAPR) + ENABLE_TESTING() +@@ -289,7 +292,7 @@ IF(APR_BUILD_TESTAPR) + ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml + ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) + +- IF(TEST_STATIC_LIBS) ++ IF(NOT BUILD_SHARED_LIBS) + SET(whichapr aprutil-1) + SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC") + ELSE() +@@ -325,13 +328,9 @@ INSTALL(TARGETS ${install_targets} + ARCHIVE DESTINATION lib + ) + +-IF(INSTALL_PDB) +- INSTALL(FILES ${install_bin_pdb} +- DESTINATION bin +- CONFIGURATIONS RelWithDebInfo Debug) +-ENDIF() +- +-INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) ++if(NOT DISABLE_INSTALL_HEADERS) ++ INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) ++endif() + + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) + MESSAGE(STATUS "") diff --git a/ports/apr/CONTROL b/ports/apr/CONTROL index 607f6c4d4abbe2..2c9c0c691cae7c 100644 --- a/ports/apr/CONTROL +++ b/ports/apr/CONTROL @@ -1,5 +1,6 @@ Source: apr -Version: 1.7.0-1 +Version: 1.7.0 +Port-Version: 2 Homepage: https://apr.apache.org/ Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. Supports: !uwp diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index b3ede1a1da2243..39f2370018299a 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -82,7 +82,7 @@ else() vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/apr-1.pc "-lapr-\${APR_MAJOR_VERSION}" "-lapr-1" ) - vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl) + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl uuid crypt) endif() # Handle copyright diff --git a/ports/argparse/vcpkg.json b/ports/argparse/vcpkg.json index 9137c655f6866d..438522292049c3 100644 --- a/ports/argparse/vcpkg.json +++ b/ports/argparse/vcpkg.json @@ -2,6 +2,6 @@ "name": "argparse", "version-string": "2.1", "description": "Argument parser for modern C++", - "license": "MIT", - "homepage": "https://github.com/p-ranav/argparse" + "homepage": "https://github.com/p-ranav/argparse", + "license": "MIT" } diff --git a/ports/argtable3/CONTROL b/ports/argtable3/CONTROL deleted file mode 100644 index f894b4fc5ba7f9..00000000000000 --- a/ports/argtable3/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: argtable3 -Version: 2019-08-21 -Description: A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options -Homepage: www.argtable.org diff --git a/ports/argtable3/fix-cmake.patch b/ports/argtable3/fix-cmake.patch deleted file mode 100644 index 320e6385e939a3..00000000000000 --- a/ports/argtable3/fix-cmake.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 57bd7a1..e19e677 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -65,10 +65,6 @@ if(ARGTABLE3_ENABLE_CONAN AND EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${LINK_FLAGS}") - endif() - --if(ARGTABLE3_ENABLE_TESTS) -- enable_testing() --endif() -- - set(ARGTABLE3_AMALGAMATION_SRC_FILE ${PROJECT_SOURCE_DIR}/dist/argtable3.c) - set(ARGTABLE3_SRC_FILES - ${PROJECT_SOURCE_DIR}/src/arg_cmd.c -@@ -88,18 +84,11 @@ set(ARGTABLE3_SRC_FILES - ${PROJECT_SOURCE_DIR}/src/getopt_long.c - ) - --# Platform specific settings for installation --if(UNIX) -- include(GNUInstallDirs) -- set(ARGTABLE3_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) -- set(ARGTABLE3_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) -- set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) --elseif(WIN32) -- set(ARGTABLE3_INSTALL_LIBDIR "lib") -- set(ARGTABLE3_INSTALL_INCLUDEDIR "include") -- set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") --endif(UNIX) -- - add_subdirectory(src) --add_subdirectory(tests) -+ -+if(ARGTABLE3_ENABLE_TESTS) -+ enable_testing() -+ add_subdirectory(tests) -+endif() -+ - add_subdirectory(examples) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 429b143..f45c071 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -28,9 +28,19 @@ - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ################################################################################ - --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") -+include(GNUInstallDirs) -+ -+if(UNIX) -+ set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) -+elseif(WIN32) -+ set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") -+endif(UNIX) -+ -+if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") -+endif() - - add_definitions(-D_XOPEN_SOURCE=700) - -@@ -46,6 +56,7 @@ if(WIN32) - "${PROJECT_BINARY_DIR}/src/version.rc" - ) - add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES} "${PROJECT_BINARY_DIR}/src/version.rc") -+ target_compile_definitions(argtable3 INTERFACE argtable3_IMPORTS) - else() - add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES}) - endif() -@@ -57,8 +68,18 @@ target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) - set_target_properties(argtable3 argtable3_static PROPERTIES - VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) -- --install(TARGETS argtable3 EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) --install(TARGETS argtable3_static EXPORT ${ARGTABLE3_PACKAGE_NAME}Config ARCHIVE DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) --install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${ARGTABLE3_INSTALL_INCLUDEDIR}) -+if(BUILD_SHARED_LIBS) -+install(TARGETS argtable3 -+ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+else() -+install(TARGETS argtable3_static -+ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+endif() -+install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - install(EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_CMAKEDIR}) diff --git a/ports/argtable3/portfile.cmake b/ports/argtable3/portfile.cmake index 18d994cc540973..4e90c02e07b737 100644 --- a/ports/argtable3/portfile.cmake +++ b/ports/argtable3/portfile.cmake @@ -1,13 +1,9 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO argtable/argtable3 - REF bbc4ec20991e87ecf8dcf288aef777b55b78daa7 - SHA512 050f54ead2d029715d8f10e63ff555027ead61fbfa18bd955e3b99e080f9178ad5c41937c5d62477885143f27bb9e7e505a7120b95bfcd899a60719584191f1c + REF 1c1bb23b305c8cf349328fc0cacd7beb7a575ff4 # v3.1.5 + SHA512 13150c8adc1eda107b6df65a2e276510a66bd912f6067d7cc72951735a4c20307144b04cda959cdd24f160da3810ba8bb35e48992ff4281e44ed2331d030fb1d HEAD_REF master - PATCHES - fix-cmake.patch ) vcpkg_configure_cmake( @@ -29,14 +25,9 @@ elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) endif() -file(COPY - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_replace_string( @@ -46,8 +37,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME ${PORT}) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/argtable3/vcpkg.json b/ports/argtable3/vcpkg.json new file mode 100644 index 00000000000000..37c2ec78b4bf3b --- /dev/null +++ b/ports/argtable3/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "argtable3", + "version-string": "3.1.5", + "description": "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options", + "homepage": "www.argtable.org" +} diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL index 463b8e670cf805..850809579a8f54 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -1,4 +1,5 @@ Source: armadillo -Version: 2019-04-16-8 +Version: 2019-04-16 +Port-Version: 10 Description: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use -Build-Depends: openblas (!osx), clapack (!osx) +Build-Depends: openblas, lapack diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index 0b171b34f919bd..f8bb9cbd629a02 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -1,6 +1,6 @@ Source: arrow -Version: 0.17.1 -Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl +Version: 1.0.1 +Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl, utf8proc Homepage: https://github.com/apache/arrow Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations. Supports: x64 diff --git a/ports/arrow/all.patch b/ports/arrow/all.patch index 4116a1e5f5b1a8..65260b148a1aeb 100644 --- a/ports/arrow/all.patch +++ b/ports/arrow/all.patch @@ -26,7 +26,7 @@ index bf47915c4..053e605a0 100644 # Some systems (e.g. Fedora) don't fill Brotli_LIBRARY_DIRS, so add the other dirs here. diff --git a/cpp/cmake_modules/FindLz4.cmake b/cpp/cmake_modules/FindLz4.cmake -index 841091643..a196b251d 100644 +index 841091643..bb5a00a50 100644 --- a/cpp/cmake_modules/FindLz4.cmake +++ b/cpp/cmake_modules/FindLz4.cmake @@ -19,14 +19,16 @@ if(MSVC AND NOT DEFINED LZ4_MSVC_STATIC_LIB_SUFFIX) @@ -49,7 +49,14 @@ index 841091643..a196b251d 100644 "${CMAKE_SHARED_LIBRARY_PREFIX}lz4_static${CMAKE_SHARED_LIBRARY_SUFFIX}" PATHS ${LZ4_ROOT} PATH_SUFFIXES ${LIB_PATH_SUFFIXES} -@@ -43,14 +45,14 @@ else() +@@ -38,19 +40,19 @@ if(LZ4_ROOT) + PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) + + else() +- pkg_check_modules(LZ4_PC liblz4) +- if(LZ4_PC_FOUND) ++ #pkg_check_modules(LZ4_PC liblz4) ++ if(0) #if(LZ4_PC_FOUND) # Disabled as sometimes incompatible with vcpkg on Linux and OSX set(LZ4_INCLUDE_DIR "${LZ4_PC_INCLUDEDIR}") list(APPEND LZ4_PC_LIBRARY_DIRS "${LZ4_PC_LIBDIR}") @@ -102,65 +109,105 @@ index bb3eb5608..0b03d37d3 100644 find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include") find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin") diff --git a/cpp/cmake_modules/FindZSTD.cmake b/cpp/cmake_modules/FindZSTD.cmake -index 8e47086e8..d87906a25 100644 +index 84d21d2b5..971a9dec3 100644 --- a/cpp/cmake_modules/FindZSTD.cmake +++ b/cpp/cmake_modules/FindZSTD.cmake -@@ -19,14 +19,18 @@ if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) - set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") +@@ -24,11 +24,11 @@ if(ARROW_ZSTD_USE_SHARED) + list(APPEND ZSTD_LIB_NAMES + "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}") + else() +- if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) +- set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") ++ if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(ZSTD_MSVC_DEBUG_LIB_SUFFIX d) + endif() + set(ZSTD_STATIC_LIB_SUFFIX +- "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${ZSTD_MSVC_DEBUG_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) + set(ZSTD_LIB_NAMES "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}") endif() - --set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(ZSTD_LIB_NAME_DEBUG_SUFFIX d) -+endif() -+ -+set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${ZSTD_LIB_NAME_DEBUG_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) - - # First, find via if specified ZTD_ROOT - if(ZSTD_ROOT) - message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}") - find_library(ZSTD_LIB -- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" -+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" - "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" - PATHS ${ZSTD_ROOT} - PATH_SUFFIXES ${LIB_PATH_SUFFIXES} -@@ -39,19 +43,18 @@ if(ZSTD_ROOT) - +@@ -49,8 +49,8 @@ if(ZSTD_ROOT) + else() # Second, find via pkg_check_modules - pkg_check_modules(ZSTD_PC libzstd) - if(ZSTD_PC_FOUND) -+ if(0) # Disabled as incompatible with vcpkg ++ #pkg_check_modules(ZSTD_PC libzstd) ++ if(0) #(ZSTD_PC_FOUND) # Disabled as sometimes incompatible with vcpkg on Linux and OSX set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}") - + list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") -- find_library(ZSTD_LIB zstd -+ find_library(ZSTD_LIB zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} - PATHS ${ZSTD_PC_LIBRARY_DIRS} - NO_DEFAULT_PATH - PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - # Third, check all other CMake paths - else() - find_library(ZSTD_LIB -- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" -+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" - "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" - PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - find_path(ZSTD_INCLUDE_DIR NAMES zstd.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) -diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake -index 6110a5aa5..3270d74a9 100644 ---- a/cpp/cmake_modules/SetupCxxFlags.cmake -+++ b/cpp/cmake_modules/SetupCxxFlags.cmake -@@ -163,7 +163,9 @@ macro(arrow_add_werror_if_debug) - if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - # Treat all compiler warnings as errors - if(MSVC) -- set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") -+ if(MSVC_VERSION VERSION_LESS 1900) -+ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") -+ endif() - else() - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror") - endif() +diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake +index 3b229846c..da2c6d551 100644 +--- a/cpp/cmake_modules/DefineOptions.cmake ++++ b/cpp/cmake_modules/DefineOptions.cmake +@@ -297,6 +297,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + define_option(ARROW_PROTOBUF_USE_SHARED + "Rely on Protocol Buffers shared libraries where relevant" ON) + ++ define_option(ARROW_UTF8PROC_USE_SHARED ++ "Rely on utf8proc shared libraries where relevant" ON) ++ + define_option(ARROW_ZSTD_USE_SHARED "Rely on zstd shared libraries where relevant" ON) + + define_option(ARROW_WITH_BACKTRACE "Build with backtrace support" ON) +diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake +index ab9ae9f98..d3063827a 100644 +--- a/cpp/cmake_modules/Findutf8proc.cmake ++++ b/cpp/cmake_modules/Findutf8proc.cmake +@@ -15,11 +15,28 @@ + # specific language governing permissions and limitations + # under the License. + ++if(ARROW_UTF8PROC_USE_SHARED) ++ set(UTF8PROC_LIB_NAMES) ++ if(CMAKE_IMPORT_LIBRARY_SUFFIX) ++ list(APPEND UTF8PROC_LIB_NAMES ++ "${CMAKE_IMPORT_LIBRARY_PREFIX}utf8proc${CMAKE_IMPORT_LIBRARY_SUFFIX}") ++ endif() ++ list(APPEND UTF8PROC_LIB_NAMES ++ "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}") ++else() ++ if(MSVC AND NOT DEFINED UTF8PROC_MSVC_STATIC_LIB_SUFFIX) ++ set(UTF8PROC_MSVC_STATIC_LIB_SUFFIX "_static") ++ endif() ++ set(UTF8PROC_STATIC_LIB_SUFFIX ++ "${UTF8PROC_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ set(UTF8PROC_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}utf8proc${UTF8PROC_STATIC_LIB_SUFFIX}) ++ set(UTF8PROC_LIB_NAMES "${UTF8PROC_STATIC_LIB_NAME}" "lib${UTF8PROC_STATIC_LIB_NAME}") ++endif() ++ + if(utf8proc_ROOT) + find_library( + UTF8PROC_LIB +- NAMES utf8proc +- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" ++ NAMES ${UTF8PROC_LIB_NAMES} + PATHS ${utf8proc_ROOT} + PATH_SUFFIXES ${LIB_PATH_SUFFIXES} + NO_DEFAULT_PATH) +@@ -28,12 +45,10 @@ if(utf8proc_ROOT) + PATHS ${utf8proc_ROOT} + NO_DEFAULT_PATH + PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) +- + else() + find_library( + UTF8PROC_LIB +- NAMES utf8proc +- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" ++ NAMES ${UTF8PROC_LIB_NAMES} + PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) + find_path(UTF8PROC_INCLUDE_DIR NAMES utf8proc.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) + endif() +@@ -47,5 +62,8 @@ if(UTF8PROC_FOUND OR utf8proc_FOUND) + set_target_properties(utf8proc::utf8proc + PROPERTIES IMPORTED_LOCATION "${UTF8PROC_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${UTF8PROC_INCLUDE_DIR}") ++ if(NOT ARROW_UTF8PROC_USE_SHARED) ++ set_target_properties(utf8proc::utf8proc ++ PROPERTIES INTERFACE_COMPILER_DEFINITIONS "UTF8PROC_STATIC") ++ endif() + endif() +- diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index 42227dc9417c2c..5e2f87f0b72ed6 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/arrow - REF apache-arrow-0.17.1 - SHA512 2a1a637d6df08e19d0c8313c51e1baf8902db677b072f8787c4f9faf8bdec94357ac8af839718d449377b508fe4f6e31b011cbdc6ccf029b6a66f567172569aa + REF apache-arrow-1.0.1 + SHA512 46fedecaf7fa0ff0d8b4ac5f3d7bcbcb75ce4f65d272f775dedd61f091f975cf03fc55e91e46021df9872a82712ca9c9e4eb35414cf46c0f49a26f7a5a3dd50c HEAD_REF master PATCHES all.patch @@ -26,12 +26,15 @@ vcpkg_configure_cmake( OPTIONS -DARROW_DEPENDENCY_SOURCE=SYSTEM -Duriparser_SOURCE=SYSTEM - -DARROW_BUILD_TESTS=off + -DARROW_BUILD_TESTS=OFF ${FEATURE_OPTIONS} -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC} -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED} - -DARROW_GFLAGS_USE_SHARED=off - -DARROW_JEMALLOC=off + -DARROW_BROTLI_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_GFLAGS_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_UTF8PROC_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_ZSTD_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_JEMALLOC=OFF -DARROW_BUILD_UTILITIES=OFF -DARROW_WITH_BZ2=ON -DARROW_WITH_ZLIB=ON @@ -39,6 +42,7 @@ vcpkg_configure_cmake( -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON + -DARROW_WITH_UTF8PROC=ON -DPARQUET_REQUIRE_ENCRYPTION=ON ) diff --git a/ports/asiosdk/CONTROL b/ports/asiosdk/CONTROL index 1a8c75628314a3..b97ebb689d4337 100644 --- a/ports/asiosdk/CONTROL +++ b/ports/asiosdk/CONTROL @@ -1,4 +1,4 @@ Source: asiosdk -Version: 2.3.3 +Version: 2.3.3-1 Homepage: https://www.steinberg.net/en/company/developers.html Description: ASIO is a low latency audio API from Steinberg. diff --git a/ports/asiosdk/vcpkg-cmake-wrapper.cmake b/ports/asiosdk/vcpkg-cmake-wrapper.cmake index 2fbe9725f536ec..df14d7c827e016 100644 --- a/ports/asiosdk/vcpkg-cmake-wrapper.cmake +++ b/ports/asiosdk/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(ASIOSDK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT ASIOSDK_INCLUDE_DIR) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${ASIOSDK_PREV_MODULE_PATH}) diff --git a/ports/asmjit/CONTROL b/ports/asmjit/CONTROL index 5ec779ce70fb24..d4b46b6a5c4007 100644 --- a/ports/asmjit/CONTROL +++ b/ports/asmjit/CONTROL @@ -1,5 +1,5 @@ Source: asmjit -Version: 2020-05-08 +Version: 2020-07-22 Homepage: https://github.com/asmjit/asmjit Description: Complete x86/x64 JIT and Remote Assembler for C++ Supports: !arm diff --git a/ports/asmjit/portfile.cmake b/ports/asmjit/portfile.cmake index d95645d7e21642..812083b6d919ca 100644 --- a/ports/asmjit/portfile.cmake +++ b/ports/asmjit/portfile.cmake @@ -3,23 +3,23 @@ vcpkg_fail_port_install(ON_ARCH "arm") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO asmjit/asmjit - REF 80645e66a8ae85749937bda3b329388c8a76ea4c - SHA512 8e7b0aed14e8ce05e6e6b2eed77be23a81b9548a146aef187ac6beced3bc2a6cba92835718adb901a1ab983fab32f3e9f18061b157b2276bb1451a71ca1195b8 + REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 + SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 HEAD_REF master ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS -DASMJIT_STATIC=1 - ) + set(ASMJIT_STATIC 1) else() - vcpkg_configure_cmake( + set(ASMJIT_STATIC 0) +endif() + +vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - ) -endif() + OPTIONS -DASMJIT_STATIC=${ASMJIT_STATIC} + ) + vcpkg_install_cmake() vcpkg_copy_pdbs() diff --git a/ports/atkmm/CONTROL b/ports/atkmm/CONTROL index caf3abb43f09c0..8192383d888094 100644 --- a/ports/atkmm/CONTROL +++ b/ports/atkmm/CONTROL @@ -1,5 +1,7 @@ Source: atkmm -Version: 2.24.2-2 +Version: 2.24.2 +Port-Version: 3 Homepage: https://www.gtkmm.org Description: atkmm is the official C++ interface for the ATK accessibility toolkit library. It may be used, for instance, by user interfaces implemented with gtkmm. Build-Depends: glib, gettext, atk, glibmm +Supports: !(linux | osx) diff --git a/ports/atkmm/portfile.cmake b/ports/atkmm/portfile.cmake index f8e9df2943cd2f..9795881ece1a6e 100644 --- a/ports/atkmm/portfile.cmake +++ b/ports/atkmm/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) @@ -32,34 +32,19 @@ vcpkg_build_msbuild( # Handle headers file(COPY ${SOURCE_PATH}/MSVC_Net2013/atkmm/atkmmconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/atk/atkmm.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file( - COPY - ${SOURCE_PATH}/atk/atkmm +file(COPY ${SOURCE_PATH}/atk/atkmm DESTINATION ${CURRENT_PACKAGES_DIR}/include - FILES_MATCHING PATTERN *.h -) + FILES_MATCHING PATTERN *.h) # Handle libraries -file( - COPY - ${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/atkmm.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file( - COPY - ${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/atkmm.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) -file( - COPY - ${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/atkmm.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file( - COPY - ${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/atkmm.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) +file(COPY ${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/atkmm.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/atkmm.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/atkmm.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(COPY ${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/atkmm.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) vcpkg_copy_pdbs() diff --git a/ports/aubio/CMakeLists.txt b/ports/aubio/CMakeLists.txt index 9a6ad2377d9faa..ad8ce6a4669d32 100644 --- a/ports/aubio/CMakeLists.txt +++ b/ports/aubio/CMakeLists.txt @@ -24,33 +24,24 @@ set(CMAKE_DEBUG_POSTFIX d) option(BUILD_TOOLS "Build and install tools" ON) set(TOOLS_INSTALLDIR "bin" CACHE STRING "Target directory for installed tools") -find_path(LIBSNDFILE_H sndfile.h) -find_library(LIBSNDFILE_LIB NAMES libsndfile-1 libsndfile) find_library(AVCODEC_LIB avcodec) find_library(AVUTIL_LIB avutil) find_library(AVDEVICE_LIB avdevice) find_library(AVFILTER_LIB avfilter) find_library(AVFORMAT_LIB avformat) find_library(SWRESAMPLE_LIB swresample) -find_library(OGG_LIB ogg) -find_library(FLAC_LIB flac) -find_library(VORBIS_LIB vorbis) -find_library(VORBISENC_LIB vorbisenc) find_package(BZip2 REQUIRED) find_package(LibLZMA REQUIRED) +find_package(SndFile REQUIRED) -include_directories(src ${LIBSNDFILE_H} ${LIBLZMA_INCLUDE_DIRS}) +include_directories(src ${LIBLZMA_INCLUDE_DIRS}) file(GLOB_RECURSE SOURCES src/*.c) set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h) add_library(aubio ${SOURCES}) target_link_libraries(aubio PUBLIC - ${LIBSNDFILE_LIB} - ${OGG_LIB} - ${FLAC_LIB} - ${VORBIS_LIB} - ${VORBISENC_LIB} + SndFile::sndfile ${AVCODEC_LIB} ${AVUTIL_LIB} ${AVDEVICE_LIB} diff --git a/ports/aubio/CONTROL b/ports/aubio/CONTROL index 2c5a18e48ac8c9..f023b702e3ce97 100644 --- a/ports/aubio/CONTROL +++ b/ports/aubio/CONTROL @@ -1,5 +1,6 @@ Source: aubio -Version: 0.4.9-1 +Version: 0.4.9 +Port-Version: 2 Homepage: https://github.com/aubio/aubio Description: Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio. Build-Depends: ffmpeg, libsndfile, libogg, libflac, libvorbis, bzip2, liblzma diff --git a/ports/audiofile/portfile.cmake b/ports/audiofile/portfile.cmake new file mode 100644 index 00000000000000..49f9a67d279426 --- /dev/null +++ b/ports/audiofile/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO adamstark/AudioFile + REF ccb64bd86881099e65a329f104733679ae03f63e # 1.0.7 + SHA512 f172f9df95a028c9c3da29cd530dd4b55acad76ee7503000f96ba10c5d014abd219fcd145cea4b7ca7a902c38d968518b39de285d25f7e3ccc56d1ba3769d7b8 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/AudioFile.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/audiofile/vcpkg.json b/ports/audiofile/vcpkg.json new file mode 100644 index 00000000000000..d779642030d20b --- /dev/null +++ b/ports/audiofile/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "audiofile", + "version-string": "1.0.7", + "description": "A simple header-only C++ library for reading and writing audio files.", + "homepage": "https://github.com/adamstark/AudioFile", + "license": "GPL-3.0" +} diff --git a/ports/avisynthplus/portfile.cmake b/ports/avisynthplus/portfile.cmake index d18d548a060cec..467e8dd9174519 100644 --- a/ports/avisynthplus/portfile.cmake +++ b/ports/avisynthplus/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(ON_TARGET "UWP" "arm" "arm64") +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_LIBRARY_LINKAGE "static" ON_TARGET "UWP" "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) @@ -20,4 +20,4 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL ${SOURCE_PATH}/distrib/gpl.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/avisynthplus RENAME copyright) +file(INSTALL ${SOURCE_PATH}/distrib/gpl.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/avisynthplus/vcpkg.json b/ports/avisynthplus/vcpkg.json index 1af0142ea4d4bb..b6796ad53c1384 100644 --- a/ports/avisynthplus/vcpkg.json +++ b/ports/avisynthplus/vcpkg.json @@ -1,7 +1,8 @@ { "name": "avisynthplus", "version-string": "3.6.0", - "homepage": "http://avs-plus.net/", + "port-version": 1, "description": "An improved version of the AviSynth frameserver, with improved features and developer friendliness", - "supports": "!(uwp | arm | static)" + "homepage": "http://avs-plus.net/", + "supports": "windows & !arm & !uwp & !static" } diff --git a/ports/avro-cpp/CONTROL b/ports/avro-cpp/CONTROL new file mode 100644 index 00000000000000..0f75d7e24cdd2e --- /dev/null +++ b/ports/avro-cpp/CONTROL @@ -0,0 +1,9 @@ +Source: avro-cpp +Version: 1.9.2 +Homepage: https://github.com/apache/avro +Description: Apache Avro is a data serialization system +Build-Depends: boost-format, boost-thread, boost-filesystem, boost-iostreams, boost-program-options, boost-random, boost-crc, boost-test, libzip, bzip2, liblzma, zlib, zstd + +Feature: snappy +Build-Depends: snappy +Description: Support Snappy for compression diff --git a/ports/avro-cpp/install.patch b/ports/avro-cpp/install.patch new file mode 100644 index 00000000000000..12ead28612157d --- /dev/null +++ b/ports/avro-cpp/install.patch @@ -0,0 +1,100 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 30a5d66..f7f2b94 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -40,6 +40,8 @@ set (AVRO_VERSION_MINOR "0") + project (Avro-cpp) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}) + ++find_package(ZLIB REQUIRED) ++ + if (WIN32 AND NOT CYGWIN AND NOT MSYS) + add_definitions (/EHa) + add_definitions ( +@@ -118,11 +120,11 @@ set_target_properties (avrocpp PROPERTIES + set_target_properties (avrocpp_s PROPERTIES + VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}) + +-target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + + add_executable (precompile test/precompile.cc) + +-target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + + macro (gen file ns) + add_custom_command (OUTPUT ${file}.hh +@@ -151,34 +153,40 @@ gen (crossref cr) + gen (primitivetypes pt) + + add_executable (avrogencpp impl/avrogencpp.cc) +-target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) ++ + +-enable_testing() ++if(BUILD_TESTING) ++ enable_testing() ++endif() + + macro (unittest name) + add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++ target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + +-unittest (buffertest) +-unittest (unittest) +-unittest (SchemaTests) +-unittest (LargeSchemaTests) +-unittest (CodecTests) +-unittest (StreamTests) +-unittest (SpecificTests) +-unittest (DataFileTests) +-unittest (JsonTests) +-unittest (AvrogencppTests) +-unittest (CompilerTests) +- +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh +- tweet_hh +- union_array_union_hh union_map_union_hh union_conflict_hh +- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh +- primitivetypes_hh empty_record_hh) ++if(BUILD_TESTING) ++ unittest (buffertest) ++ unittest (unittest) ++ unittest (SchemaTests) ++ unittest (LargeSchemaTests) ++ unittest (CodecTests) ++ unittest (StreamTests) ++ unittest (SpecificTests) ++ unittest (DataFileTests) ++ unittest (JsonTests) ++ unittest (AvrogencppTests) ++ unittest (CompilerTests) ++ ++ add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh ++ tweet_hh ++ union_array_union_hh union_map_union_hh union_conflict_hh ++ recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh ++ primitivetypes_hh empty_record_hh) ++ ++endif() + + include (InstallRequiredSystemLibraries) + +@@ -189,9 +197,9 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + +-install (TARGETS avrogencpp RUNTIME DESTINATION bin) ++install (TARGETS avrogencpp RUNTIME DESTINATION tools/bin) + + install (DIRECTORY api/ DESTINATION include/avro + FILES_MATCHING PATTERN *.hh) diff --git a/ports/avro-cpp/portfile.cmake b/ports/avro-cpp/portfile.cmake new file mode 100644 index 00000000000000..49f0af20ce77b2 --- /dev/null +++ b/ports/avro-cpp/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/avro + REF release-1.9.2 + SHA512 6a6980901eea964c050eb3d61fadf28712e2f02c36985bf8e5176b668bba48985f6a666554a1964435448de29b18d790ab86b787d0288a22fd9cba00746a7846 + HEAD_REF master + PATCHES + install.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/lang/c++ + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DBUILD_TESTING=OFF + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DAVRO_ADD_PROTECTOR_FLAGS=1 +) + +vcpkg_install_cmake(ADD_BIN_TO_PATH) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/lang/c++/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/azure-c-shared-utility/CONTROL b/ports/azure-c-shared-utility/CONTROL index 253ed721c95d1b..6546575b1f0f68 100644 --- a/ports/azure-c-shared-utility/CONTROL +++ b/ports/azure-c-shared-utility/CONTROL @@ -1,5 +1,5 @@ Source: azure-c-shared-utility -Version: 2020-06-17-1 +Version: 2020-07-19 Description: Azure C SDKs common code Homepage: https://github.com/Azure/azure-c-shared-utility Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c, umock-c @@ -7,4 +7,4 @@ Supports: !uwp Feature: public-preview Description: Azure C SDKs common code (public preview) -Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] \ No newline at end of file +Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] diff --git a/ports/azure-c-shared-utility/portfile.cmake b/ports/azure-c-shared-utility/portfile.cmake index b38a835ce0b550..ccc9b681d10e87 100644 --- a/ports/azure-c-shared-utility/portfile.cmake +++ b/ports/azure-c-shared-utility/portfile.cmake @@ -16,8 +16,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-c-shared-utility - REF 30211c742f082082c127c0f284257119131a96ab - SHA512 c46493a82a6879d501a0261ca61fb91594ac554928794ef96fd96570fed2ba5e0533a4e00a02e3826d7dfacc22bff3ac8e0a2696a7b46c766d317f29207ec062 + REF 65c27eb4ab9a8bbe36b4d7c5a0e9ad305becb8b4 + SHA512 48c65111b12e895f9c2087964d7291e6d1629242194fed9b33ead8ca438f16c803786cd55761eabdd12d47c9920542cff0e510bf16f16cac1d60049ba205df0e HEAD_REF master PATCHES fix-utilityFunctions-conditions.patch diff --git a/ports/azure-iot-sdk-c/CONTROL b/ports/azure-iot-sdk-c/CONTROL index 0c6aef0a1ead6f..6344bdeabad213 100644 --- a/ports/azure-iot-sdk-c/CONTROL +++ b/ports/azure-iot-sdk-c/CONTROL @@ -1,5 +1,6 @@ Source: azure-iot-sdk-c -Version: 2020-06-17-2 +Version: 2020-07-19 +Port-Version: 1 Build-Depends: azure-uamqp-c, azure-umqtt-c, azure-c-shared-utility, parson, azure-uhttp-c, azure-macro-utils-c, umock-c Description: A C99 SDK for connecting devices to Microsoft Azure IoT services Homepage: https://github.com/Azure/azure-iot-sdk-c diff --git a/ports/azure-iot-sdk-c/portfile.cmake b/ports/azure-iot-sdk-c/portfile.cmake index 6d0bec58a192c7..db460aaecf7547 100644 --- a/ports/azure-iot-sdk-c/portfile.cmake +++ b/ports/azure-iot-sdk-c/portfile.cmake @@ -15,8 +15,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-iot-sdk-c - REF 989f1dc66c7de53cb14d29eb051003eec0de798e - SHA512 876e846cdef699ee3635e5191a697c56c7c40b2110d2468cfbbe204cff59d42a0d930861fda7229dbba163a329de9d8f06276228bab516ef92c88feebfcfbc13 + REF f464326f10cbba497b71c4aa263b6a22e1b375fe + SHA512 32dfb2ac697755af3646b07259298fc2f27007ab1a0a27da0be4f597c82dd2f8bbad6f07b4ed01dfbb62d86649d4be913c59e1e76b33efec112beaaba550d375 HEAD_REF master PATCHES improve-external-deps.patch @@ -25,6 +25,7 @@ else() endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + use-prov-client hsm_type_symm_key use-prov-client use_prov_client ) @@ -40,7 +41,6 @@ vcpkg_configure_cmake( -Duse_default_uuid=ON -Dbuild_as_dynamic=OFF -Duse_edge_modules=ON - -Dhsm_type_symm_key=${use_prov_client} ) vcpkg_install_cmake() diff --git a/ports/azure-uamqp-c/CONTROL b/ports/azure-uamqp-c/CONTROL index c2a59448dad988..ddd6fe2da1bb8e 100644 --- a/ports/azure-uamqp-c/CONTROL +++ b/ports/azure-uamqp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uamqp-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: AMQP library for C Homepage: https://github.com/Azure/azure-uamqp-c diff --git a/ports/azure-uamqp-c/portfile.cmake b/ports/azure-uamqp-c/portfile.cmake index 39b45e8cd18819..e154414fc2d6b6 100644 --- a/ports/azure-uamqp-c/portfile.cmake +++ b/ports/azure-uamqp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uamqp-c - REF cd11c2591ada765f23669bce62dbfaf503b3108e - SHA512 a2879afcc6417ebe81bae0ca12e0ebcae90749637446917168a3356bfdd8fa2f3d73fb1ce2def907b26f7d6c0fcc4f7bd72463ed9dba4d0f8a5a287f4307ae0c + REF 9e851bd6db08d6d2d08d1ef469d1e6fc4795382d + SHA512 efe0b9ed8a949af67e958b1516f499f57a0838a847e92d6c932058e931d2536038e7d49d63597e21de0a6f2af22bc179a6d99c8b8077451f906118b0b65e1417 HEAD_REF master ) endif() diff --git a/ports/azure-uhttp-c/CONTROL b/ports/azure-uhttp-c/CONTROL index 5f26022c4c7e60..b64573024fb0f7 100644 --- a/ports/azure-uhttp-c/CONTROL +++ b/ports/azure-uhttp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uhttp-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: Azure HTTP Library written in C Homepage: https://github.com/Azure/azure-uhttp-c diff --git a/ports/azure-uhttp-c/portfile.cmake b/ports/azure-uhttp-c/portfile.cmake index ff8c03e90f816d..1e05b1cfa93c54 100644 --- a/ports/azure-uhttp-c/portfile.cmake +++ b/ports/azure-uhttp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uhttp-c - REF 6bf59b9057f653aaa57e6539627085f41c2dfe33 - SHA512 96437df9f249e2a551e9890b4d476ae032384a067d845b86893013138380802592f70139e2b4f4c0d543c464ef98008d0b2f025ce6f0341181e431b53e311dc5 + REF ef8ba1591b0f825315b78380331ff9290197db02 + SHA512 3e0434272de684a43189d491c16ab7e20ffcfd08f8addb01f64caa446211faa67e45aa51c403520df6a105cc9ac50b85de1b9e0954510fd4232c0f19d01fea9c HEAD_REF master ) endif() diff --git a/ports/azure-umqtt-c/CONTROL b/ports/azure-umqtt-c/CONTROL index 9f8f637e23b9fd..755b0160e9bc3f 100644 --- a/ports/azure-umqtt-c/CONTROL +++ b/ports/azure-umqtt-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-umqtt-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: General purpose library for communication over the mqtt protocol Homepage: https://github.com/Azure/azure-umqtt-c diff --git a/ports/azure-umqtt-c/portfile.cmake b/ports/azure-umqtt-c/portfile.cmake index 80779f03e55195..84fba09b62871a 100644 --- a/ports/azure-umqtt-c/portfile.cmake +++ b/ports/azure-umqtt-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-umqtt-c - REF 349a2bffc1addfdc4b61d30f80adc1e15b336fbd - SHA512 887ece4d9cbb32059c84d776d88ce05fa8474289afb1cd5873a672fc926024a416ac50a829c671fd2aae6b4eaa984f05196a3fff6a56011585d875f116a0a764 + REF 165f6f52f8b2aec54a28ea5ede41736589726cd0 + SHA512 af56db89ddbae1a8067d3b1c7f85ecf085fb6bf529d01f74dd301e6994b20e6f1a821fd7d5116b53d1a8911ccc463149a53a5611e650c3aeb63893012206ffb8 HEAD_REF master ) endif() diff --git a/ports/behaviortree-cpp/001_port_fixes.patch b/ports/behaviortree-cpp/001_port_fixes.patch new file mode 100644 index 00000000000000..3cb4ac29ed32a8 --- /dev/null +++ b/ports/behaviortree-cpp/001_port_fixes.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 75dea11..4eea781 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -229,7 +229,7 @@ if( ZMQ_FOUND ) + endif() + + if(MSVC) +- target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W4 /WX) ++ target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W4 /wd4702) + else() + target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE + -Wall -Wextra -Werror=return-type) diff --git a/ports/behaviortree-cpp/002_fix_dependencies.patch b/ports/behaviortree-cpp/002_fix_dependencies.patch new file mode 100644 index 00000000000000..76d7857dbf6388 --- /dev/null +++ b/ports/behaviortree-cpp/002_fix_dependencies.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 75dea11..23053ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ if(MSVC) + endif() + + #---- Include boost to add coroutines ---- +-find_package(Boost COMPONENTS coroutine QUIET) ++find_package(Boost REQUIRED) # coroutine2 is header-only + if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) + string(REPLACE "." "0" Boost_VERSION_NODOT ${Boost_VERSION}) +@@ -45,18 +45,18 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) + + #---- Find other packages ---- + find_package(Threads) +-find_package(ZMQ) ++find_package(cppzmq) + + list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES + ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_DL_LIBS} + ${Boost_LIBRARIES} ) + +-if( ZMQ_FOUND ) ++if( ZMQ_FOUND OR ON ) + message(STATUS "ZeroMQ found.") + add_definitions( -DZMQ_FOUND ) + list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) +- list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${ZMQ_LIBRARIES}) ++ list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES cppzmq) + else() + message(WARNING "ZeroMQ NOT found. Skipping the build of [PublisherZMQ] and [bt_recorder].") + endif() diff --git a/ports/behaviortree-cpp/portfile.cmake b/ports/behaviortree-cpp/portfile.cmake new file mode 100644 index 00000000000000..f67153766f9d1c --- /dev/null +++ b/ports/behaviortree-cpp/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/3.5.1.tar.gz" + FILENAME "BehaviorTree.CPP.3.5.1.tar.gz" + SHA512 66db43225e692fa0f9073e63bdff765c037440372478792a9b442103a8bed945f5c3ae1d66266b86cb41d0006404a8297708a799ec0c7286c2beec6f964a4ac6 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + 001_port_fixes.patch + 002_fix_dependencies.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCMAKE_DISABLE_FIND_PACKAGE_ament_cmake=1 + -DCMAKE_DISABLE_FIND_PACKAGE_Curses=1 + -DBUILD_EXAMPLES=OFF + -DBUILD_UNIT_TESTS=OFF + -DBUILD_TOOLS=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/BehaviorTreeV3/cmake TARGET_PATH share/behaviortreev3) +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/lib/BehaviorTreeV3" + "${CURRENT_PACKAGES_DIR}/debug/lib/BehaviorTreeV3" +) + +vcpkg_test_cmake(PACKAGE_NAME BehaviorTreeV3) diff --git a/ports/behaviortree-cpp/vcpkg.json b/ports/behaviortree-cpp/vcpkg.json new file mode 100644 index 00000000000000..783187faa3e850 --- /dev/null +++ b/ports/behaviortree-cpp/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "behaviortree-cpp", + "version-string": "3.5.1", + "port-version": 2, + "description": "Behavior Trees Library in C++.", + "homepage": "https://www.behaviortree.dev", + "supports": "!uwp & !osx", + "dependencies": [ + "boost-coroutine2", + "cppzmq" + ] +} diff --git a/ports/berkeleydb/CONTROL b/ports/berkeleydb/CONTROL index 07ab3e306774da..91677a1f79150a 100644 --- a/ports/berkeleydb/CONTROL +++ b/ports/berkeleydb/CONTROL @@ -1,5 +1,6 @@ Source: berkeleydb -Version: 4.8.30-4 +Version: 4.8.30 +Port-Version: 5 Homepage: https://download.oracle.com/ Description: BDB - A high-performance embedded database for key/value data. Supports: !(uwp|linux|osx) diff --git a/ports/berkeleydb/fix-conflict-macro.patch b/ports/berkeleydb/fix-conflict-macro.patch new file mode 100644 index 00000000000000..c15d7edff9818f --- /dev/null +++ b/ports/berkeleydb/fix-conflict-macro.patch @@ -0,0 +1,123 @@ +diff --git a/dbinc/atomic.h b/dbinc/atomic.h +index 0034dcc..2dd5e03 100644 +--- a/dbinc/atomic.h ++++ b/dbinc/atomic.h +@@ -70,7 +70,7 @@ typedef struct { + * These have no memory barriers; the caller must include them when necessary. + */ + #define atomic_read(p) ((p)->value) +-#define atomic_init(p, val) ((p)->value = (val)) ++#define bdb_atomic_init(p, val) ((p)->value = (val)) + + #ifdef HAVE_ATOMIC_SUPPORT + +@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange( + #define atomic_dec(env, p) (--(p)->value) + #define atomic_compare_exchange(env, p, oldval, newval) \ + (DB_ASSERT(env, atomic_read(p) == (oldval)), \ +- atomic_init(p, (newval)), 1) ++ bdb_atomic_init(p, (newval)), 1) + #else + #define atomic_inc(env, p) __atomic_inc(env, p) + #define atomic_dec(env, p) __atomic_dec(env, p) +diff --git a/mp/mp_fget.c b/mp/mp_fget.c +index 5fdee5a..452ef17 100644 +--- a/mp/mp_fget.c ++++ b/mp/mp_fget.c +@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */ + + /* Initialize enough so we can call __memp_bhfree. */ + alloc_bhp->flags = 0; +- atomic_init(&alloc_bhp->ref, 1); ++ bdb_atomic_init(&alloc_bhp->ref, 1); + #ifdef DIAGNOSTIC + if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { + __db_errx(env, +@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */ + MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, + PROT_READ); + +- atomic_init(&alloc_bhp->ref, 1); ++ bdb_atomic_init(&alloc_bhp->ref, 1); + MUTEX_LOCK(env, alloc_bhp->mtx_buf); + alloc_bhp->priority = bhp->priority; + alloc_bhp->pgno = bhp->pgno; +diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c +index 34467d2..b604388 100644 +--- a/mp/mp_mvcc.c ++++ b/mp/mp_mvcc.c +@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp) + #else + memcpy(frozen_bhp, bhp, SSZA(BH, buf)); + #endif +- atomic_init(&frozen_bhp->ref, 0); ++ bdb_atomic_init(&frozen_bhp->ref, 0); + if (mutex != MUTEX_INVALID) + frozen_bhp->mtx_buf = mutex; + else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, +@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp) + #endif + alloc_bhp->mtx_buf = mutex; + MUTEX_LOCK(env, alloc_bhp->mtx_buf); +- atomic_init(&alloc_bhp->ref, 1); ++ bdb_atomic_init(&alloc_bhp->ref, 1); + F_CLR(alloc_bhp, BH_FROZEN); + } + +diff --git a/mp/mp_region.c b/mp/mp_region.c +index e6cece9..e3e3382 100644 +--- a/mp/mp_region.c ++++ b/mp/mp_region.c +@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) + MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) + return (ret); + SH_TAILQ_INIT(&htab[i].hash_bucket); +- atomic_init(&htab[i].hash_page_dirty, 0); ++ bdb_atomic_init(&htab[i].hash_page_dirty, 0); + } + + /* +@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) + hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID : + mtx_base + i; + SH_TAILQ_INIT(&hp->hash_bucket); +- atomic_init(&hp->hash_page_dirty, 0); ++ bdb_atomic_init(&hp->hash_page_dirty, 0); + #ifdef HAVE_STATISTICS + hp->hash_io_wait = 0; + hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; +diff --git a/mutex/mut_method.c b/mutex/mut_method.c +index 2588763..56b6723 100644 +--- a/mutex/mut_method.c ++++ b/mutex/mut_method.c +@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval) + MUTEX_LOCK(env, mtx); + ret = atomic_read(v) == oldval; + if (ret) +- atomic_init(v, newval); ++ bdb_atomic_init(v, newval); + MUTEX_UNLOCK(env, mtx); + + return (ret); +diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c +index f3922e0..934a654 100644 +--- a/mutex/mut_tas.c ++++ b/mutex/mut_tas.c +@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags) + + #ifdef HAVE_SHARED_LATCHES + if (F_ISSET(mutexp, DB_MUTEX_SHARED)) +- atomic_init(&mutexp->sharecount, 0); ++ bdb_atomic_init(&mutexp->sharecount, 0); + else + #endif + if (MUTEX_INIT(&mutexp->tas)) { +@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex) + F_CLR(mutexp, DB_MUTEX_LOCKED); + /* Flush flag update before zeroing count */ + MEMBAR_EXIT(); +- atomic_init(&mutexp->sharecount, 0); ++ bdb_atomic_init(&mutexp->sharecount, 0); + } else { + DB_ASSERT(env, sharecount > 0); + MEMBAR_EXIT(); diff --git a/ports/berkeleydb/portfile.cmake b/ports/berkeleydb/portfile.cmake index 5d47b7a6fab11e..93d89fb3ebd8c2 100644 --- a/ports/berkeleydb/portfile.cmake +++ b/ports/berkeleydb/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} + PATCHES fix-conflict-macro.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/bfgroup-lyra/CONTROL b/ports/bfgroup-lyra/CONTROL index 6a4d896f1fd483..ed2976f25aca3e 100644 --- a/ports/bfgroup-lyra/CONTROL +++ b/ports/bfgroup-lyra/CONTROL @@ -1,4 +1,4 @@ Source: bfgroup-lyra -Version: 1.3 +Version: 1.5 Homepage: https://bfgroup.github.io/Lyra/ Description: A simple to use, composable, command line parser for C++ 11 and beyond diff --git a/ports/bfgroup-lyra/portfile.cmake b/ports/bfgroup-lyra/portfile.cmake index edcbc939f1f922..cdb4662fe5770c 100644 --- a/ports/bfgroup-lyra/portfile.cmake +++ b/ports/bfgroup-lyra/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO bfgroup/Lyra - REF 9e31b213ffd8c66414623f0b26614326a5e12853 # 1.3 - SHA512 03ff1bfa19bd4dfb00cb864fac5275b075bc0b3c817d2598338b7b957d571799e531cd851cd451d2896ed920dc3037edd22dc14826b343ff6f76bfa2a7982589 + REF 1.5 + SHA512 1f8e505a487a9421a59afed0ee0c68894fb479117ac20c0bbb8d77ccf50ab938a68c93068f26871b9ddff0a21732d8bb1c6cc997b295a2a39c9363d32e320b3b HEAD_REF master ) diff --git a/ports/bigint/CMakeLists.txt b/ports/bigint/CMakeLists.txt index e4cccbe12a4736..fffc9419278220 100644 --- a/ports/bigint/CMakeLists.txt +++ b/ports/bigint/CMakeLists.txt @@ -1,14 +1,11 @@ -cmake_minimum_required(VERSION 3.8.0) -project(bigint) +cmake_minimum_required(VERSION 3.14.0) +project(bigint CXX) if(MSVC) - add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) + add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) endif() -include_directories(".") - -set( - bigint_srcs +set(BIGINT_SRCS BigUnsigned.cc BigInteger.cc BigIntegerAlgorithms.cc @@ -16,8 +13,7 @@ set( BigIntegerUtils.cc ) -set( - bigint_hh +set(BIGINT_HH NumberlikeArray.hh BigUnsigned.hh BigInteger.hh @@ -27,15 +23,20 @@ set( BigIntegerUtils.hh ) -add_library(bigint ${bigint_srcs}) +add_library(bigint ${BIGINT_SRCS}) +target_include_directories(bigint PUBLIC $ $) + +install( + TARGETS bigint + EXPORT bigint-config +) install( - TARGETS bigint - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + EXPORT bigint-config + NAMESPACE bigint:: + DESTINATION share/bigint ) if(NOT DISABLE_INSTALL_HEADERS) - install(FILES ${bigint_hh} DESTINATION include/bigint) + install(FILES ${BIGINT_HH} DESTINATION include/bigint) endif() diff --git a/ports/bigint/CONTROL b/ports/bigint/CONTROL index b47401c79c100a..1f0d8f63b46e97 100644 --- a/ports/bigint/CONTROL +++ b/ports/bigint/CONTROL @@ -1,4 +1,5 @@ Source: bigint -Version: 2010.04.30-4 +Version: 2010.04.30 +Port-Version: 6 Homepage: https://mattmccutchen.net/bigint Description: C++ Big Integer Library diff --git a/ports/bigint/fix-osx-usage.patch b/ports/bigint/fix-osx-usage.patch new file mode 100644 index 00000000000000..f387d7b297b838 --- /dev/null +++ b/ports/bigint/fix-osx-usage.patch @@ -0,0 +1,39 @@ +diff --git a/BigUnsigned.hh b/BigUnsigned.hh +index adf1c00..9228753 100644 +--- a/BigUnsigned.hh ++++ b/BigUnsigned.hh +@@ -20,7 +20,7 @@ public: + typedef unsigned long Blk; + + typedef NumberlikeArray::Index Index; +- NumberlikeArray::N; ++ using NumberlikeArray::N; + + protected: + // Creates a BigUnsigned with a capacity; for internal use. +@@ -84,8 +84,8 @@ public: + // BIT/BLOCK ACCESSORS + + // Expose these from NumberlikeArray directly. +- NumberlikeArray::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::getLength; + + /* Returns the requested block, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ +diff --git a/BigUnsignedInABase.hh b/BigUnsignedInABase.hh +index 8f9bdce..0ea89c6 100644 +--- a/BigUnsignedInABase.hh ++++ b/BigUnsignedInABase.hh +@@ -100,8 +100,8 @@ public: + Base getBase() const { return base; } + + // Expose these from NumberlikeArray directly. +- NumberlikeArray::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::getLength; + + /* Returns the requested digit, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ diff --git a/ports/bigint/portfile.cmake b/ports/bigint/portfile.cmake index 2a0a22adbe287e..7231697501a63d 100644 --- a/ports/bigint/portfile.cmake +++ b/ports/bigint/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_download_distfile(ARCHIVE @@ -11,6 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} + PATCHES fix-osx-usage.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -22,5 +21,6 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() -file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/bigint RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/blaze/CONTROL b/ports/blaze/CONTROL index d9198b970beb8b..94d148368f7bce 100644 --- a/ports/blaze/CONTROL +++ b/ports/blaze/CONTROL @@ -1,5 +1,6 @@ Source: blaze -Version: 3.7 -Build-Depends: clapack (!osx), boost-exception +Version: 3.8 +Port-Version: 1 +Build-Depends: lapack, boost-exception Homepage: https://bitbucket.org/blaze-lib/blaze Description: Blaze is an open-source, high-performance C++ math library for dense and sparse arithmetic. diff --git a/ports/blaze/fix-vm-build.patch b/ports/blaze/fix-vm-build.patch new file mode 100644 index 00000000000000..3936299e0a7a26 --- /dev/null +++ b/ports/blaze/fix-vm-build.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e5ab1f460..a23c6dbf5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,12 +145,13 @@ if (${BLAZE_CACHE_SIZE_AUTO}) + endif (flag EQUAL 0) + endif (APPLE) + +- if (flag) ++ string(REGEX MATCH "([0-9][0-9]+)" tmp ${tmp}) # Get a number containing at least 2 digits in the string tmp ++ ++ if (flag OR NOT tmp) + message("Cache size not found automatically. Using default value as cache size.") + set(tmp ${BLAZE_CACHE_SIZE_DEFAULT}) + endif (flag) + +- string(REGEX MATCH "([0-9][0-9]+)" tmp ${tmp}) # Get a number containing at least 2 digits in the string tmp + math(EXPR BLAZE_CACHE_SIZE ${tmp}*1024) # Convert to bytes (assuming that the value is given in kibibytes) + + endif (${BLAZE_CACHE_SIZE_AUTO}) diff --git a/ports/blaze/portfile.cmake b/ports/blaze/portfile.cmake index 96d1d165e21415..8ef5792fd1891b 100644 --- a/ports/blaze/portfile.cmake +++ b/ports/blaze/portfile.cmake @@ -1,9 +1,11 @@ vcpkg_from_bitbucket( OUT_SOURCE_PATH SOURCE_PATH REPO blaze-lib/blaze - REF e9724478a5fd29b9c2f8c45f0be95ad774ab4d4f - SHA512 d1699fffe3013d571e34cf5444714647428be257cad90c4bc6cca8051702ff6d086eb731dca408faaf83b9311df4138f55187673235128fcd3c03029af337a75 + REF 0380370f0626de2ad0ec7ea815803e22bbf6b42e + SHA512 47df2a291febf0565787ed9c4222ee1958d03c5b76c54923e4d8e44f75321c266e81d69ba4512a4ab07d7e431c065d025e01269cf9c1d5f0927f133885def4c7 HEAD_REF master + PATCHES + fix-vm-build.patch ) vcpkg_configure_cmake( diff --git a/ports/blend2d/portfile.cmake b/ports/blend2d/portfile.cmake index 8862ba28be0a7e..99edda698bbfdf 100644 --- a/ports/blend2d/portfile.cmake +++ b/ports/blend2d/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_ARCH "wasm32" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO blend2d/blend2d - REF 9e6686c0760135cc54dfd3e9e239ceac07cddb78 - SHA512 475a7fa4de4728e0c41d97e759d5c74fe5d66d28169614a9081a461fdc27e1f1c4db438d7e2a5cd9170489bbb7e352d73ec46d8bde45ff7c4a024c35fdb43e5f + REF 960fe2fa6c93b1026a10e3db15e06db77d6817a3 + SHA512 232546d17de7f7f2f6a67ba2d88d1fca30ac6d9199216f98294e1bd0ec4e9dd33cc78a262f89da3ba1f433e9efbecded5866ddbc20f150c6a804c02687650270 HEAD_REF master ) @@ -21,8 +21,8 @@ if(NOT BLEND2D_BUILD_NO_JIT) vcpkg_from_github( OUT_SOURCE_PATH ASMJIT_SOURCE_PATH REPO asmjit/asmjit - REF 2de7e742443e23b925b830c415268ce1470341ce - SHA512 40ec1ec5540a20530e795c0e425322ed027d2e6e400f8f1ee1426e256ea0f3cf2e241972cdbda2f2d8e9fad06ba0ba12f0dcff9a09aa5da65cb3d01e19079966 + REF 8f25116f2bea8f5e0604dae867be817e3f12bac1 + SHA512 708ddb7bcd73e76e6485330f8935d64bbe27d526807fb877234303032247dc900751963c935d2a391fddb133eea6ae4300ade061d9202ed7f767e388e379abc8 HEAD_REF master ) diff --git a/ports/blend2d/vcpkg.json b/ports/blend2d/vcpkg.json index e8940a0eeb5c1a..d61e3f4cec119b 100644 --- a/ports/blend2d/vcpkg.json +++ b/ports/blend2d/vcpkg.json @@ -1,10 +1,15 @@ { "name": "blend2d", - "version-string": "beta_2020-07-09", - "port-version": 0, + "version-string": "beta_2020-08-24", "description": "Beta 2D Vector Graphics Powered by a JIT Compiler", "homepage": "https://github.com/blend2d/blend2d", "documentation": "https://blend2d.com/doc/index.html", + "supports": "!(arm | uwp)", + "default-features": [ + "jit", + "logging", + "tls" + ], "features": [ { "name": "jit", @@ -18,11 +23,5 @@ "name": "tls", "description": "Default feature. Enables use of thread_local feature. Disable for platforms where thread local storage is expensive or not supported." } - ], - "default-features": [ - "jit", - "logging", - "tls" - ], - "supports": "!(arm|uwp)" + ] } diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index eaf174e23e5962..94d5cd3f7a1284 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,5 +1,5 @@ Source: bond -Version: 9.0.0 +Version: 9.0.2 Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. Homepage: https://github.com/Microsoft/bond Build-Depends: rapidjson, boost-config, boost-utility, boost-assign diff --git a/ports/bond/fix-install-path.patch b/ports/bond/fix-install-path.patch index e5fa270c192374..643e0cfbfbf0d3 100644 --- a/ports/bond/fix-install-path.patch +++ b/ports/bond/fix-install-path.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f8eaa..1b0c01c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -18,7 +18,7 @@ set (BOND_FIND_RAPIDJSON +@@ -23,7 +23,7 @@ set (BOND_FIND_RAPIDJSON # settings so that we don't apply our settings to third-party code. add_subdirectory (thirdparty) @@ -11,7 +11,7 @@ index f2f8eaa..1b0c01c 100644 set (BOND_IDL ${CMAKE_CURRENT_SOURCE_DIR}/idl) set (BOND_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/cpp/inc) -@@ -80,6 +80,6 @@ if (BOND_GBC_PATH) +@@ -85,6 +85,6 @@ if (BOND_GBC_PATH) install ( FILES ${BOND_GBC_PATH} @@ -35,7 +35,7 @@ index 1dff9d0..9a11575 100644 @@ -130,7 +130,7 @@ endif() install (FILES ${output} - PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION bin) + DESTINATION ${completion_dir}) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 903ca0f462372a..9a1485baca272b 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -set(BOND_VER 9.0.0) +set(BOND_VER 9.0.2) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/bond REF ${BOND_VER} - SHA512 b6bed9be8b5dd2a7d50c6bd275b94c62050b83717907522a07279cccc50e209306792c6f3c7f206afcb3226aed21b43b115b63dccc806eff5d9cd4e12b355461 + SHA512 ece636bc06e7bac4208d373610e689f19b394cae4eaa869f32b098924a6e7034e4d804d4831d7f6fd2540a619daf77f4ab43c49aa442a9cd26161b0a8a2db000 HEAD_REF master PATCHES fix-install-path.patch skip-grpc-compilation.patch ) @@ -15,7 +15,7 @@ if (VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile(GBC_ARCHIVE URLS "https://github.com/microsoft/bond/releases/download/${BOND_VER}/gbc-${BOND_VER}-amd64.zip" FILENAME "gbc-${BOND_VER}-amd64.zip" - SHA512 f4480a3eb7adedfd3da554ef3cdc64b6e7da5c699bde0ccd86b2dd6a159ccacbb1df2b84b6bc80bc8475f30b904cba98085609e42aad929b2b23258eaff52048 + SHA512 661d63a82284d3ecbc7b50d5f4972dadeb607f96612108a4a0887c6684a418e8b265516354504ca3440a182d1e31f2eb5861531133b455d8b6c01aec45ade5d3 ) # Clear the generator to prevent it from updating diff --git a/ports/boost-asio/CONTROL b/ports/boost-asio/CONTROL index 641ca4aa91d2c5..63823d2a448593 100644 --- a/ports/boost-asio/CONTROL +++ b/ports/boost-asio/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-asio Version: 1.73.0 -Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl +Port-Version: 1 +Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!arm&!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl Homepage: https://github.com/boostorg/asio Description: Boost asio module diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index 087970deab9dc7..036631336f6d9d 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,4 +1,6 @@ Source: boost-build -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 4 Homepage: https://github.com/boostorg/build Description: Boost.Build +Build-Depends: boost-uninstall \ No newline at end of file diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index 7633f51aaa1fbf..bad139ac22728e 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -2,9 +2,7 @@ include(vcpkg_common_functions) set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - return() -elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") +if(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") return() endif() diff --git a/ports/boost-context/CONTROL b/ports/boost-context/CONTROL index 2180441f3a062d..a6ba3fa04eb571 100644 --- a/ports/boost-context/CONTROL +++ b/ports/boost-context/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-context -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-modular-build-helper, boost-pool, boost-predef, boost-smart-ptr, boost-thread, boost-vcpkg-helpers Homepage: https://github.com/boostorg/context Description: Boost context module +Supports: !uwp diff --git a/ports/boost-coroutine/CONTROL b/ports/boost-coroutine/CONTROL index b8a67d5b823c18..95851da832e5f3 100644 --- a/ports/boost-coroutine/CONTROL +++ b/ports/boost-coroutine/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-coroutine Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-context (!uwp), boost-detail, boost-exception, boost-integer, boost-modular-build-helper, boost-move, boost-range, boost-system, boost-thread, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/coroutine Description: Boost coroutine module +Supports: !arm&!uwp diff --git a/ports/boost-fiber/CONTROL b/ports/boost-fiber/CONTROL index 22acacfbe5fb5e..4db73b41e91174 100644 --- a/ports/boost-fiber/CONTROL +++ b/ports/boost-fiber/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-fiber Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-build, boost-config, boost-context (!uwp), boost-core, boost-detail, boost-filesystem (!uwp), boost-format, boost-intrusive, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-vcpkg-helpers Homepage: https://github.com/boostorg/fiber Description: Boost fiber module +Supports: !osx&!uwp&!arm diff --git a/ports/boost-filesystem/CONTROL b/ports/boost-filesystem/CONTROL index 09e2a8e6ce7299..3a2b3239089846 100644 --- a/ports/boost-filesystem/CONTROL +++ b/ports/boost-filesystem/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-filesystem Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-system, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/filesystem Description: Boost filesystem module +Supports: !uwp diff --git a/ports/boost-graph-parallel/CONTROL b/ports/boost-graph-parallel/CONTROL index d08ab59fb44772..cd05cb7de8d9f8 100644 --- a/ports/boost-graph-parallel/CONTROL +++ b/ports/boost-graph-parallel/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph-parallel Version: 1.73.0 -Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/graph_parallel Description: Boost graph_parallel module diff --git a/ports/boost-iostreams/CONTROL b/ports/boost-iostreams/CONTROL index b62a07c060aa07..7f521ec3476d82 100644 --- a/ports/boost-iostreams/CONTROL +++ b/ports/boost-iostreams/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-iostreams Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-bind, boost-build, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, bzip2, liblzma, zlib, zstd Homepage: https://github.com/boostorg/iostreams Description: Boost iostreams module +Supports: !uwp diff --git a/ports/boost-locale/CONTROL b/ports/boost-locale/CONTROL index d7c8d7c0fa7097..5260cea4c5aacd 100644 --- a/ports/boost-locale/CONTROL +++ b/ports/boost-locale/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-locale -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-smart-ptr, boost-static-assert, boost-system, boost-thread, boost-type-traits, boost-unordered, boost-vcpkg-helpers, libiconv (!uwp&!windows) Homepage: https://github.com/boostorg/locale Description: Boost locale module +Supports: !uwp Feature: icu Build-Depends: icu diff --git a/ports/boost-log/CONTROL b/ports/boost-log/CONTROL index c4aa6be65d0b2f..33fc046e7b4c35 100644 --- a/ports/boost-log/CONTROL +++ b/ports/boost-log/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-log Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-align, boost-array, boost-asio, boost-assert, boost-atomic, boost-bind, boost-build, boost-compatibility, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-exception, boost-filesystem (!uwp), boost-function-types, boost-fusion, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iterator, boost-lexical-cast, boost-locale (!uwp), boost-math, boost-modular-build-helper, boost-move, boost-mpl, boost-optional, boost-parameter, boost-phoenix, boost-predef, boost-preprocessor, boost-property-tree, boost-proto, boost-random, boost-range, boost-regex, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-thread, boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi, boost-xpressive Homepage: https://github.com/boostorg/log Description: Boost log module +Supports: !uwp diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index 05a1762a037b99..852430dc9b476a 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -35,6 +35,14 @@ else() list(APPEND B2_OPTIONS address-model=32) endif() +if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + list(APPEND B2_OPTIONS architecture=s390x) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + list(APPEND B2_OPTIONS architecture=arm) +else() + list(APPEND B2_OPTIONS architecture=x86) +endif() + if(APPLE) list(APPEND B2_OPTIONS target-os=darwin toolset=clang) elseif(WIN32) @@ -91,7 +99,11 @@ if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET) endif() endif() if(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) - set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + else() + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + endif() endif() if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT) set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") @@ -158,7 +170,6 @@ add_custom_target(boost ALL --hash -q - architecture=x86 threading=multi debug-symbols=on diff --git a/ports/boost-modular-build-helper/CONTROL b/ports/boost-modular-build-helper/CONTROL index 29c1d24c81f078..b39ec5f4221afc 100644 --- a/ports/boost-modular-build-helper/CONTROL +++ b/ports/boost-modular-build-helper/CONTROL @@ -1,3 +1,4 @@ Source: boost-modular-build-helper Version: 1.73.0 -Port-Version: 2 +Port-Version: 5 +Build-Depends: boost-uninstall \ No newline at end of file diff --git a/ports/boost-modular-build-helper/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam index 884284b499510b..8d7d1e35019cf5 100644 --- a/ports/boost-modular-build-helper/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam @@ -36,8 +36,7 @@ if "@PORT@" != "boost-system" { use-project /boost/system : . ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_system ; use-project /boost : . ; @@ -48,8 +47,7 @@ if "@PORT@" != "boost-chrono" { use-project /boost/chrono : . ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_chrono ; } @@ -57,8 +55,7 @@ if "@PORT@" != "boost-regex" { use-project /boost/regex : . ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_regex ; } @@ -66,8 +63,7 @@ if "@PORT@" != "boost-date-time" { use-project /boost/date_time : . ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_RELEASE_SUFFIX@" release -/boost/date_time//boost_date_time ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_DEBUG_SUFFIX@" debug -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_SUFFIX@" @VARIANT@ -/boost/date_time//boost_date_time ; explicit boost_date_time ; } @@ -75,8 +71,7 @@ if "@PORT@" != "boost-thread" { use-project /boost/thread : . ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/date_time//boost_date_time ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/date_time//boost_date_time ; explicit boost_thread ; } @@ -84,8 +79,7 @@ if "@PORT@" != "boost-timer" { use-project /boost/timer : . ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_timer ; } @@ -93,8 +87,7 @@ if "@PORT@" != "boost-filesystem" { use-project /boost/filesystem : . ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/system//boost_system ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/system//boost_system ; explicit boost_filesystem ; } @@ -102,8 +95,7 @@ if "@PORT@" != "boost-atomic" { use-project /boost/atomic : . ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_atomic ; } @@ -114,8 +106,7 @@ if "@PORT@" != "boost-context" use-project /boost/context : . ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_context ; } @@ -123,8 +114,7 @@ if "@PORT@" != "boost-test" { use-project /boost/test : . ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_unit_test_framework ; } @@ -132,8 +122,7 @@ if "@PORT@" != "boost-serialization" { use-project /boost/serialization : . ; - lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_serialization ; } diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index 1ce6ad1cc72da3..26784ed26f5ee4 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -4,7 +4,7 @@ function(boost_modular_build) if(NOT DEFINED _bm_SOURCE_PATH) message(FATAL_ERROR "SOURCE_PATH is a required argument to boost_modular_build.") endif() - + # Next CMake variables may be overridden in the file specified in ${_bm_BOOST_CMAKE_FRAGMENT} set(B2_OPTIONS) set(B2_OPTIONS_DBG) @@ -18,10 +18,16 @@ function(boost_modular_build) # Todo: this serves too similar a purpose as vcpkg_find_acquire_program() if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build") + if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../arm64-linux/tools/boost-build") + else() + set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build") + endif() + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l") + set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../arm-linux/tools/boost-build") elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) - elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) else() set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/tools/boost-build") @@ -29,9 +35,17 @@ function(boost_modular_build) if(NOT EXISTS "${BOOST_BUILD_PATH}") if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") + if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64") + message(FATAL_ERROR "The arm64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:arm64-linux`.") + else() + message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") + endif() else() - message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.") + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l") + message(FATAL_ERROR "The arm boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:arm-linux`.") + else() + message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.") + endif() endif() endif() @@ -51,8 +65,13 @@ function(boost_modular_build) if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(BOOST_LIB_PREFIX) - set(BOOST_LIB_RELEASE_SUFFIX -vc140-mt.lib) - set(BOOST_LIB_DEBUG_SUFFIX -vc140-mt-gd.lib) + if(VCPKG_PLATFORM_TOOLSET MATCHES "v14.") + set(BOOST_LIB_RELEASE_SUFFIX -vc140-mt.lib) + set(BOOST_LIB_DEBUG_SUFFIX -vc140-mt-gd.lib) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(BOOST_LIB_RELEASE_SUFFIX -vc120-mt.lib) + set(BOOST_LIB_DEBUG_SUFFIX -vc120-mt-gd.lib) + endif() else() set(BOOST_LIB_PREFIX lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -81,15 +100,20 @@ function(boost_modular_build) file(WRITE ${_bm_SOURCE_PATH}/build/Jamfile.v2 "${_contents}") endif() - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-config/checks") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${_bm_SOURCE_PATH}/build/config") # endif() # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-predef/check") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${_bm_SOURCE_PATH}/build/predef") # endif() - - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + + function(unix_build BOOST_LIB_SUFFIX BUILD_TYPE BUILD_LIB_PATH) + message(STATUS "Building ${BUILD_TYPE}...") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_SUFFIX}) + set(VARIANT ${BUILD_TYPE}) + set(BUILD_LIB_PATH ${BUILD_LIB_PATH}) + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) + set(configure_option) if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) list(APPEND configure_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}") @@ -107,6 +131,16 @@ function(boost_modular_build) ${configure_option} ) vcpkg_install_cmake() + endfunction() + + if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + unix_build(${BOOST_LIB_RELEASE_SUFFIX} "release" "lib/") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + unix_build(${BOOST_LIB_DEBUG_SUFFIX} "debug" "debug/lib/") + endif() if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/lib) message(FATAL_ERROR "No libraries were produced. This indicates a failure while building the boost library.") @@ -184,7 +218,7 @@ function(boost_modular_build) -sZSTD_BINARY=zstdd "-sZSTD_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib" ) - + set(B2_OPTIONS_REL -sZLIB_BINARY=zlib "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/lib" @@ -252,6 +286,8 @@ function(boost_modular_build) list(APPEND B2_OPTIONS address-model=32 architecture=arm) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") list(APPEND B2_OPTIONS address-model=64 architecture=arm) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") + list(APPEND B2_OPTIONS address-model=64 architecture=s390x) else() list(APPEND B2_OPTIONS address-model=32 architecture=x86) endif() @@ -281,7 +317,9 @@ function(boost_modular_build) configure_file(${_bm_DIR}/user-config.jam ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/user-config.jam @ONLY) if(VCPKG_PLATFORM_TOOLSET MATCHES "v14.") - list(APPEND B2_OPTIONS toolset=msvc) + list(APPEND _bm_OPTIONS toolset=msvc) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + list(APPEND _bm_OPTIONS toolset=msvc) elseif(VCPKG_PLATFORM_TOOLSET MATCHES "external") list(APPEND B2_OPTIONS toolset=gcc) else() @@ -293,6 +331,10 @@ function(boost_modular_build) ###################### if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${TARGET_TRIPLET}-rel") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_RELEASE_SUFFIX}) + set(VARIANT "release") + set(BUILD_LIB_PATH "lib/") + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" @@ -311,6 +353,10 @@ function(boost_modular_build) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Building ${TARGET_TRIPLET}-dbg") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_DEBUG_SUFFIX}) + set(VARIANT debug) + set(BUILD_LIB_PATH "debug/lib/") + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index e50c43848c4f46..afd55f519a2293 100644 --- a/ports/boost-mpi/CONTROL +++ b/ports/boost-mpi/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpi Version: 1.73.0 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python, boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi +Port-Version: 1 +Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python (!uwp&!(arm&windows)), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi Homepage: https://github.com/boostorg/mpi Description: Boost mpi module diff --git a/ports/boost-parameter-python/CONTROL b/ports/boost-parameter-python/CONTROL index 2b33da28798f84..cba56b9e662722 100644 --- a/ports/boost-parameter-python/CONTROL +++ b/ports/boost-parameter-python/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-parameter-python Version: 1.73.0 -Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python (!uwp&!(arm&windows)), boost-vcpkg-helpers Homepage: https://github.com/boostorg/parameter_python Description: Boost parameter_python module diff --git a/ports/boost-poly-collection/CONTROL b/ports/boost-poly-collection/CONTROL index 9c98aae6cfa3ac..30d96babe6e14a 100644 --- a/ports/boost-poly-collection/CONTROL +++ b/ports/boost-poly-collection/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-poly-collection Version: 1.73.0 -Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure (!arm), boost-type-traits, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/poly_collection Description: Boost poly_collection module diff --git a/ports/boost-python/CONTROL b/ports/boost-python/CONTROL index 011f68fcde437c..a8698deaaf6bca 100644 --- a/ports/boost-python/CONTROL +++ b/ports/boost-python/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-python Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-bind, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-property-map, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, python3 Homepage: https://github.com/boostorg/python Description: Boost python module +Supports: !uwp&!(arm&windows) Feature: python2 Build-Depends: python2 (windows) diff --git a/ports/boost-safe-numerics/CONTROL b/ports/boost-safe-numerics/CONTROL index ec3fb47d42f988..1cbd56ef8dccc1 100644 --- a/ports/boost-safe-numerics/CONTROL +++ b/ports/boost-safe-numerics/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-safe-numerics Version: 1.73.0 -Build-Depends: boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-concept-check, boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers Homepage: https://github.com/boostorg/safe_numerics Description: Boost safe_numerics module diff --git a/ports/boost-stacktrace/CONTROL b/ports/boost-stacktrace/CONTROL index 6b726dbad7ff8c..17cd4eb40c8cdc 100644 --- a/ports/boost-stacktrace/CONTROL +++ b/ports/boost-stacktrace/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-stacktrace Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-array, boost-build, boost-config, boost-container-hash, boost-core, boost-modular-build-helper, boost-predef, boost-static-assert, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/stacktrace Description: Boost stacktrace module +Supports: !uwp diff --git a/ports/boost-test/CONTROL b/ports/boost-test/CONTROL index e20a2c343015f0..8ef2c2b11236b6 100644 --- a/ports/boost-test/CONTROL +++ b/ports/boost-test/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-test Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/test Description: Boost test module +Supports: !uwp diff --git a/ports/boost-uninstall/CONTROL b/ports/boost-uninstall/CONTROL new file mode 100644 index 00000000000000..8556583a3ee40b --- /dev/null +++ b/ports/boost-uninstall/CONTROL @@ -0,0 +1,4 @@ +Source: boost-uninstall +Version: 1.73.0 +Homepage: https://boost.org +Description: boost uninstall port \ No newline at end of file diff --git a/ports/boost-uninstall/portfile.cmake b/ports/boost-uninstall/portfile.cmake new file mode 100644 index 00000000000000..a06925e40896de --- /dev/null +++ b/ports/boost-uninstall/portfile.cmake @@ -0,0 +1,4 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +message(STATUS "\nPlease use the following command when you need to remove all boost ports/components:\n\ + \"./vcpkg remove boost-uninstall:${TARGET_TRIPLET} --recurse\"\n") diff --git a/ports/boost-vcpkg-helpers/CONTROL b/ports/boost-vcpkg-helpers/CONTROL index 9069917a2f86d5..1b1642e17406b5 100644 --- a/ports/boost-vcpkg-helpers/CONTROL +++ b/ports/boost-vcpkg-helpers/CONTROL @@ -1,3 +1,5 @@ Source: boost-vcpkg-helpers Version: 7 +Port-Version: 1 Description: a set of vcpkg-internal scripts used to modularize boost +Build-Depends: boost-uninstall \ No newline at end of file diff --git a/ports/boost-wave/CONTROL b/ports/boost-wave/CONTROL index 538e8772caee4f..7ed072e39b7179 100644 --- a/ports/boost-wave/CONTROL +++ b/ports/boost-wave/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-wave Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-concept-check, boost-config, boost-core, boost-detail, boost-filesystem (!uwp), boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-multi-index, boost-pool, boost-preprocessor, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/wave Description: Boost wave module +Supports: !uwp diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 5094237daa2e0c..8a77879f23ca3e 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost Version: 1.73.0 +Port-Version: 3 Homepage: https://boost.org Description: Peer-reviewed portable C++ source libraries -Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract (!arm), boost-conversion, boost-convert, boost-core, boost-coroutine (!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (windows), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python, boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap +Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract, boost-conversion, boost-convert, boost-core, boost-coroutine (!arm&!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (!osx&!uwp&!arm), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python (!uwp&!(arm&windows)), boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure, boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap + Feature: mpi Description: Build with MPI support diff --git a/ports/boringssl/0002-disable-waring-4065.patch b/ports/boringssl/0002-disable-waring-4065.patch new file mode 100644 index 00000000000000..88ffffaf0bdaea --- /dev/null +++ b/ports/boringssl/0002-disable-waring-4065.patch @@ -0,0 +1,15 @@ +diff --git a/decrepit/CMakeLists.txt b/decrepit/CMakeLists.txt +index ef95a6b..0b52c05 100644 +--- a/decrepit/CMakeLists.txt ++++ b/decrepit/CMakeLists.txt +@@ -40,6 +40,10 @@ add_executable( + + add_dependencies(decrepit_test global_target) + ++if(MSVC) ++ target_compile_options(decrepit PRIVATE /wd4065) ++endif() ++ + target_link_libraries(decrepit_test test_support_lib boringssl_gtest decrepit + crypto) + if(WIN32) diff --git a/ports/boringssl/CONTROL b/ports/boringssl/CONTROL index fb8d41ce7d532c..1c8c4dcbf6b9c2 100644 --- a/ports/boringssl/CONTROL +++ b/ports/boringssl/CONTROL @@ -1,5 +1,6 @@ Source: boringssl Version: 2020-04-07 +Port-Version: 2 Homepage: https://boringssl.googlesource.com/boringssl Description: BoringSSl is a fork of OpenSSL developed by Google Supports: !uwp diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake index a4b5acbc49ea81..80068da8d05b96 100644 --- a/ports/boringssl/portfile.cmake +++ b/ports/boringssl/portfile.cmake @@ -1,9 +1,7 @@ vcpkg_fail_port_install(ON_TARGET "UWP") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build BoringSSL if OpenSSL is installed. Please remove OpenSSL, and try to install BoringSSL again if you need it. Build will continue since BoringSSL is a drop-in replacement for OpenSSL") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + message(FATAL_ERROR "Can't build BoringSSL if OpenSSL is installed. Please remove OpenSSL, and try to install BoringSSL again if you need it. Build will continue since BoringSSL is a drop-in replacement for OpenSSL") endif() vcpkg_find_acquire_program(PERL) @@ -30,6 +28,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-vcpkg.patch + 0002-disable-waring-4065.patch ) vcpkg_configure_cmake( diff --git a/ports/box2d/CONTROL b/ports/box2d/CONTROL index a7e4b7f1cee015..909dc4c1ab1b8e 100644 --- a/ports/box2d/CONTROL +++ b/ports/box2d/CONTROL @@ -1,4 +1,5 @@ Source: box2d -Version: 2019-12-31 +Version: 2.4.0 Description: An open source C++ engine for simulating rigid bodies in 2D. Homepage: https://box2d.org +Supports: !uwp diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index c930f41b9b4d24..3b931cb3fa179f 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO erincatto/Box2D - REF 37e2dc25f8da158abda10324d75cb4d1db009adf - SHA512 c9021b6bbc8ee405e38418bdadc136814fb66d5f4928ffd06d2ed016751613ecc3e82e7f60851fdc7a2e13594f68c21e7b7adb06d35a5a02314235132556d174 + REF 4d7757feedc9dd36f64393ae08acfd3b9600ac17 #v2.4.0 + SHA512 197f701016c91fda944328e7d867f0a5baa152cce53fa35826986923456af593595bad884008944e041d9ac2e1d769a54eaad4142e19b42a3bb2a2010d814cc9 HEAD_REF master PATCHES export-targets.patch diff --git a/ports/brotli/CONTROL b/ports/brotli/CONTROL index ff152f83bd8274..7db9ffb6c56736 100644 --- a/ports/brotli/CONTROL +++ b/ports/brotli/CONTROL @@ -1,4 +1,5 @@ Source: brotli -Version: 1.0.7-1 +Version: 1.0.7 +Port-Version: 3 Homepage: https://github.com/google/brotli Description: a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. diff --git a/ports/brotli/pkgconfig.patch b/ports/brotli/pkgconfig.patch new file mode 100644 index 00000000000000..8ceafe1b10125a --- /dev/null +++ b/ports/brotli/pkgconfig.patch @@ -0,0 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c4b757f9..eed560c1d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -351,7 +351,7 @@ function(generate_pkg_config_path outvar path) + set("${outvar}" "${${outvar}}" PARENT_SCOPE) + endfunction(generate_pkg_config_path) + +-function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) ++function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION SHARED_TARGET STATIC_TARGET) + file(READ ${INPUT_FILE} TEXT) + + set(PREFIX "${CMAKE_INSTALL_PREFIX}") +@@ -366,14 +366,21 @@ function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) + + string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT}) + ++ if(BUILD_SHARED_LIBS) ++ set(LIB_NAME "${SHARED_TARGET}") ++ else() ++ set(LIB_NAME "${STATIC_TARGET}") ++ endif() ++ string(REGEX REPLACE "@lib_name@" "${LIB_NAME}" TEXT ${TEXT}) ++ + file(WRITE ${OUTPUT_FILE} ${TEXT}) + endfunction() + +-transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}" brotlicommon brotlicommon-static) + +-transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}" brotlidec brotlidec-static) + +-transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}" brotlienc brotlienc-static) + + if(NOT BROTLI_BUNDLED_MODE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" +diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in +index 2a8cf7a35..464a21292 100644 +--- a/scripts/libbrotlicommon.pc.in ++++ b/scripts/libbrotlicommon.pc.in +@@ -7,5 +7,5 @@ Name: libbrotlicommon + URL: https://github.com/google/brotli + Description: Brotli common dictionary library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlicommon ++Libs: -L${libdir} -l@lib_name@ + Cflags: -I${includedir} +diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in +index 6f8ef2e41..f87d3f65f 100644 +--- a/scripts/libbrotlidec.pc.in ++++ b/scripts/libbrotlidec.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlidec + URL: https://github.com/google/brotli + Description: Brotli decoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlidec ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} +diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in +index 2098afe2c..7b6371bcb 100644 +--- a/scripts/libbrotlienc.pc.in ++++ b/scripts/libbrotlienc.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlienc + URL: https://github.com/google/brotli + Description: Brotli encoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlienc ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} diff --git a/ports/brotli/portfile.cmake b/ports/brotli/portfile.cmake index 6fa75937c1fce4..81960a9ee83ce7 100644 --- a/ports/brotli/portfile.cmake +++ b/ports/brotli/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES install.patch fix-arm-uwp.patch + pkgconfig.patch ) vcpkg_configure_cmake( @@ -21,6 +22,8 @@ vcpkg_copy_pdbs() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/brotli) vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-brotli TARGET_PATH share/unofficial-brotli) +vcpkg_fixup_pkgconfig() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-brotli) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/brpc/CONTROL b/ports/brpc/CONTROL new file mode 100644 index 00000000000000..39860698135c2b --- /dev/null +++ b/ports/brpc/CONTROL @@ -0,0 +1,6 @@ +Source: brpc +Version: 0.9.7 +Homepage: https://github.com/apache/incubator-brpc +Description: Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called "baidu-rpc" inside Baidu. +Build-Depends: leveldb, gflags, glog, protobuf[zlib], openssl, thrift +Supports: !windows diff --git a/ports/brpc/fix_boost_ptr.patch b/ports/brpc/fix_boost_ptr.patch new file mode 100644 index 00000000000000..4ced79422bc7ce --- /dev/null +++ b/ports/brpc/fix_boost_ptr.patch @@ -0,0 +1,14 @@ +diff --git a/src/brpc/policy/thrift_protocol.cpp b/src/brpc/policy/thrift_protocol.cpp +index eae081a0..39c92338 100755 +--- a/src/brpc/policy/thrift_protocol.cpp ++++ b/src/brpc/policy/thrift_protocol.cpp +@@ -45,8 +45,7 @@ + #if defined(_THRIFT_STDCXX_H_) + # define THRIFT_STDCXX apache::thrift::stdcxx + #else +- # define THRIFT_STDCXX boost +- # include ++ # define THRIFT_STDCXX std + #endif + #endif + diff --git a/ports/brpc/fix_thrift.patch b/ports/brpc/fix_thrift.patch new file mode 100644 index 00000000000000..699f42fb0aa0b9 --- /dev/null +++ b/ports/brpc/fix_thrift.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3deb7342..737f6a70 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -62,8 +62,10 @@ if(WITH_DEBUG_SYMBOLS) + endif() + + if(WITH_THRIFT) ++ find_package(Thrift CONFIG REQUIRED) ++ # target_link_libraries(main PRIVATE thrift::thrift thriftz::thriftz thriftnb::thriftnb) + set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") +- set(THRIFT_LIB "thrift") ++ set(THRIFT_LIB "thrift::thrift") + endif() + + include(GNUInstallDirs) +@@ -196,9 +198,10 @@ set(DYNAMIC_LIB + ${LEVELDB_LIB} + ${PROTOC_LIB} + ${CMAKE_THREAD_LIBS_INIT} ++ ${OPENSSL_CRYPTO_LIBRARY} ++ ${OPENSSL_SSL_LIBRARY} + ${THRIFT_LIB} + ${THRIFTNB_LIB} +- ${OPENSSL_CRYPTO_LIBRARY} + dl + z) + diff --git a/ports/brpc/portfile.cmake b/ports/brpc/portfile.cmake new file mode 100644 index 00000000000000..3a1c1dce73eb00 --- /dev/null +++ b/ports/brpc/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_fail_port_install(ON_TARGET "windows") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/incubator-brpc + REF 1d6510aa50075cade5ed539ee09a11a1b8d7f990 # 0.9.7 + SHA512 9c9dbe2a202e58586010c56634bd371f6a9e3ff0d8c5341abbabd1f1dd204a3aec5e89061fa326b4fc8ae7202f9fc33f93a5acd845d18dab3915a3e2b81cbaf3 + HEAD_REF master + PATCHES + fix_boost_ptr.patch + fix_thrift.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DWITH_THRIFT=ON + -DWITH_MESALINK=OFF + -DWITH_GLOG=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/butil/third_party/superfasthash") + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL deleted file mode 100644 index 695925c073b7c5..00000000000000 --- a/ports/bzip2/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: bzip2 -Version: 1.0.6-5 -Homepage: http://www.bzip.org/ -Description: High-quality data compressor. diff --git a/ports/bzip2/bzip2.pc.in b/ports/bzip2/bzip2.pc.in new file mode 100644 index 00000000000000..91153c13b532be --- /dev/null +++ b/ports/bzip2/bzip2.pc.in @@ -0,0 +1,11 @@ +prefix=@BZIP2_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: bzip2 +Description: bzip2 +Version: 1.0.6 +Requires: +Libs: -L${libdir} -l@bzname@ +Cflags: -I${includedir} \ No newline at end of file diff --git a/ports/bzip2/fix-windows-include.patch b/ports/bzip2/fix-windows-include.patch deleted file mode 100644 index 11797ad2f8eed5..00000000000000 --- a/ports/bzip2/fix-windows-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN bzip2-1.0.6-orig/bzip2.c bzip2-1.0.6/bzip2.c ---- bzip2-1.0.6-orig/bzip2.c 2010-09-11 02:04:53.000000000 +0300 -+++ bzip2-1.0.6/bzip2.c 2019-11-04 11:40:52.230652175 +0200 -@@ -128,7 +128,7 @@ - #if BZ_LCCWIN32 - # include - # include --# include -+# include - - # define NORETURN /**/ - # define PATH_SEP '\\' diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 0462d53eb6f809..19314eb0ee6446 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,43 +1,46 @@ -include(vcpkg_common_functions) -set(BZIP2_VERSION 1.0.6) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" - FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" - SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${BZIP2_VERSION} - PATCHES - fix-import-export-macros.patch - fix-windows-include.patch -) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS_DEBUG - -DBZIP2_SKIP_HEADERS=ON - -DBZIP2_SKIP_TOOLS=ON -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() - -file(READ ${CURRENT_PACKAGES_DIR}/include/bzlib.h BZLIB_H) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") -else() - string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") -endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/bzlib.h "${BZLIB_H}") - -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/share/bzip2/copyright) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - -vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://sourceware.org/git/bzip2.git + REF 75a94bea3918e612b879d6a11ca64b8689526147 # REFERENCE BZIP2 VERSION 1.0.8 + SHA512 4611105f9090477b5f6f6dbd303a282099df71644e04d8a998ef81de487f6c8cac4c0ec1283ad737f6767c51f1e3b4e24e2ee021c6dd085925617d9ed145b2ba + PATCHES + fix-import-export-macros.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DBZIP2_SKIP_HEADERS=ON + -DBZIP2_SKIP_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(READ "${CURRENT_PACKAGES_DIR}/include/bzlib.h" BZLIB_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") +else() + string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") +endif() +file(WRITE "${CURRENT_PACKAGES_DIR}/include/bzlib.h" "${BZLIB_H}") + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}") + set(bzname bz2) + configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/bzip2.pc" @ONLY) +endif() + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}/debug") + set(bzname bz2d) + configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/bzip2.pc" @ONLY) +endif() + +vcpkg_fixup_pkgconfig() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/bzip2/vcpkg.json b/ports/bzip2/vcpkg.json new file mode 100644 index 00000000000000..8c7520de83e597 --- /dev/null +++ b/ports/bzip2/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "bzip2", + "version-string": "1.0.8", + "port-version": 1, + "description": "bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.", + "homepage": "https://sourceware.org/bzip2/", + "documentation": "https://sourceware.org/bzip2/docs.html" +} diff --git a/ports/caf/CONTROL b/ports/caf/CONTROL index 69e9c1ae450d6a..1e0ca3624ee1d4 100644 --- a/ports/caf/CONTROL +++ b/ports/caf/CONTROL @@ -1,5 +1,5 @@ Source: caf -Version: 0.17.3 +Version: 0.17.6 Homepage: https://github.com/actor-framework/actor-framework Build-Depends: openssl Description: an open source C++11 actor model implementation featuring lightweight & fast actor implementations, pattern matching for messages, network transparent messaging, and more. diff --git a/ports/caf/fix-arm.patch b/ports/caf/fix-arm.patch deleted file mode 100644 index 1c14287cc8b1e9..00000000000000 --- a/ports/caf/fix-arm.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index da58790..d79a1ae 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -99,11 +99,13 @@ endfunction(pretty_yes) - - add_executable(caf-generate-enum-strings cmake/caf-generate-enum-strings.cpp) - -+install(TARGETS caf-generate-enum-strings DESTINATION tools) -+ - function(enum_to_string relative_input_file relative_output_file) - set(input "${CMAKE_CURRENT_SOURCE_DIR}/${relative_input_file}") - set(output "${CMAKE_CURRENT_BINARY_DIR}/${relative_output_file}") - add_custom_command(OUTPUT "${output}" -- COMMAND caf-generate-enum-strings "${input}" "${output}" -+ COMMAND ${CAF_TOOL_PATH}caf-generate-enum-strings "${input}" "${output}" - DEPENDS caf-generate-enum-strings "${input}") - endfunction() - diff --git a/ports/caf/portfile.cmake b/ports/caf/portfile.cmake index c8ead37b41589f..2cd515007db978 100644 --- a/ports/caf/portfile.cmake +++ b/ports/caf/portfile.cmake @@ -18,12 +18,11 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO actor-framework/actor-framework - REF b05a4b7b2a6f59b0508db84ea68e5ada2224f904 # 0.17.3 - SHA512 02b1598f5090674bc2ce4fdbcd70a4669c8c0710e98d910dbd77338c088cc87db4e0eeb3dd89100772ff4f74bdf09a7f70b8975d79c816e422dc34a356f8ba4e + REF f7d4fc7ac679e18ba385f64434f8015c3cea9cb5 # 0.17.6 + SHA512 8b4719c26dfad68eed6f2528263702e42f9865bb7a9f2d40909dc6c3fc20bb7259fe44a5f89390ba714c7f9359db2d171ff44685641962c24a70f4e2aa3f3f65 HEAD_REF master PATCHES openssl-version-override.patch - fix-arm.patch ) vcpkg_configure_cmake( diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index 6470d8d09d5ab8..e333f304d23ce6 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -210,7 +210,7 @@ add_library(cairo ${SOURCES}) if (WITH_X11) target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1) endif() - +target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS}) target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig) if(WIN32) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 0eda86fac3f26b..6c26c77a250d5f 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,5 +1,6 @@ Source: cairo -Version: 1.16.0-6 +Version: 1.16.0 +Port-Version: 7 Homepage: https://cairographics.org Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. Build-Depends: zlib, libpng, pixman, freetype, fontconfig diff --git a/ports/cairomm/CMakeLists.txt b/ports/cairomm/CMakeLists.txt index 1274a643167533..1cc02978601678 100644 --- a/ports/cairomm/CMakeLists.txt +++ b/ports/cairomm/CMakeLists.txt @@ -15,6 +15,7 @@ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CAIROMM_MICRO_VERSION ${ message(STATUS "Ciaromm version: ${CAIROMM_MAJOR_VERSION}.${CAIROMM_MINOR_VERSION}.${CAIROMM_MICRO_VERSION}") find_package(Cairo REQUIRED) +find_package(Freetype REQUIRED) find_package(SigC++ REQUIRED) #configure @@ -87,7 +88,7 @@ set(cairomm_rc ${CMAKE_BINARY_DIR}/cairomm.rc) add_library(cairomm-1.0 ${cairomm_cc} ${cairomm_rc}) -target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} ) +target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} Freetype::Freetype) target_include_directories(cairomm-1.0 PRIVATE ${CAIRO_INCLUDE_DIR} ${SIGC++_INCLUDE_DIR} diff --git a/ports/cairomm/CONTROL b/ports/cairomm/CONTROL index e9d9d9b5fd1a7c..7a89c9ec1de468 100644 --- a/ports/cairomm/CONTROL +++ b/ports/cairomm/CONTROL @@ -1,5 +1,6 @@ Source: cairomm -Version: 1.15.3-4 +Version: 1.15.3 +Port-Version: 5 Homepage: https://www.cairographics.org Description: A C++ wrapper for the cairo graphics library Build-Depends: cairo, libsigcpp diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index f269f05eefd852..87a3785d5fe2b1 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -31,19 +31,10 @@ index 02c72b5..62d8c59 100644 endif (MINIGLOG) if (NOT SCHUR_SPECIALIZATIONS) -@@ -582,7 +562,7 @@ include_directories( - # Note that this is *not* propagated to clients, ie CERES_INCLUDE_DIRS - # used by clients after find_package(Ceres) does not identify Eigen as - # as system headers. --include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) -+include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}/Eigen) - - if (SUITESPARSE) - include_directories(${SUITESPARSE_INCLUDE_DIRS}) -@@ -917,8 +897,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" +@@ -917,8 +897,5 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" - "${Ceres_SOURCE_DIR}/cmake/FindEigen.cmake" +- "${Ceres_SOURCE_DIR}/cmake/FindEigen.cmake" - "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" - "${Ceres_SOURCE_DIR}/cmake/FindGflags.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index 071ad0ad1fb591..9b02e99633a7df 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -89,7 +89,7 @@ index d0380de..55760a8 100644 -endif (CERES_USES_MINIGLOG) +#SuiteSparse +if (@SUITESPARSE@) -+ find_dependency(suitesparse CONFIG REQUIRED) ++ find_dependency(suitesparse CONFIG) +endif() # Import exported Ceres targets, if they have not already been imported. diff --git a/ports/ceres/0004_blas_linux_fix.patch b/ports/ceres/0004_blas_linux_fix.patch deleted file mode 100644 index 5fffee5e231cf4..00000000000000 --- a/ports/ceres/0004_blas_linux_fix.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/internal/ceres/blas.cc b/internal/ceres/blas.cc -index 3ba63bb..071a26e 100644 ---- a/internal/ceres/blas.cc -+++ b/internal/ceres/blas.cc -@@ -33,7 +33,7 @@ - #include "glog/logging.h" - - #ifndef CERES_NO_LAPACK --extern "C" void dsyrk_(char* uplo, -+extern "C" void dsyrk(char* uplo, - char* trans, - int* n, - int* k, -@@ -64,7 +64,7 @@ void BLAS::SymmetricRankKUpdate(int num_rows, - int k = transpose ? num_rows : num_cols; - int lda = k; - int ldc = n; -- dsyrk_(&uplo, -+ dsyrk(&uplo, - &trans, - &n, - &k, diff --git a/ports/ceres/0004_fix_find_eigen.patch b/ports/ceres/0004_fix_find_eigen.patch new file mode 100644 index 00000000000000..ad92228c0bc896 --- /dev/null +++ b/ports/ceres/0004_fix_find_eigen.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7033de0..5235baa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -209,40 +209,40 @@ endif (IOS) + unset(CERES_COMPILE_OPTIONS) + + # Eigen. +-find_package(Eigen REQUIRED) +-if (EIGEN_FOUND) +- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") +- if (EIGEN_VERSION VERSION_LESS 3.1.0) ++find_package(Eigen3 REQUIRED) ++if (EIGEN3_FOUND) ++ message(STATUS "Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") ++ if (EIGEN3_VERSION_STRING VERSION_LESS 3.1.0) + message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.1.0 in order " + "that Eigen/SparseCore be available, detected version of Eigen is: " +- "${EIGEN_VERSION}") +- endif (EIGEN_VERSION VERSION_LESS 3.1.0) ++ "${EIGEN3_VERSION_STRING}") ++ endif (EIGEN3_VERSION_STRING VERSION_LESS 3.1.0) + + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND +- EIGEN_VERSION VERSION_LESS 3.3.4) ++ EIGEN3_VERSION_STRING VERSION_LESS 3.3.4) + # As per issue #289: https://github.com/ceres-solver/ceres-solver/issues/289 + # the bundle_adjustment_test will fail for Eigen < 3.3.4 on aarch64. + message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.3.4 on aarch64. " +- "Detected version of Eigen is: ${EIGEN_VERSION}.") ++ "Detected version of Eigen is: ${EIGEN3_VERSION_STRING}.") + endif() + + if (EIGENSPARSE) +- message("-- Enabling use of Eigen as a sparse linear algebra library.") ++ message(STATUS "Enabling use of Eigen as a sparse linear algebra library.") + list(APPEND CERES_COMPILE_OPTIONS CERES_USE_EIGEN_SPARSE) +- if (EIGEN_VERSION VERSION_LESS 3.2.2) ++ if (EIGEN3_VERSION_STRING VERSION_LESS 3.2.2) + message(" WARNING:") + message("") +- message(" Your version of Eigen (${EIGEN_VERSION}) is older than ") ++ message(" Your version of Eigen (${EIGEN3_VERSION_STRING}) is older than ") + message(" version 3.2.2. The performance of SPARSE_NORMAL_CHOLESKY ") + message(" and SPARSE_SCHUR linear solvers will suffer.") +- endif (EIGEN_VERSION VERSION_LESS 3.2.2) ++ endif (EIGEN3_VERSION_STRING VERSION_LESS 3.2.2) + else (EIGENSPARSE) + message("-- Disabling use of Eigen as a sparse linear algebra library.") + message(" This does not affect the covariance estimation algorithm ") + message(" which can still use the EIGEN_SPARSE_QR algorithm.") + add_definitions(-DEIGEN_MPL2_ONLY) + endif (EIGENSPARSE) +-endif (EIGEN_FOUND) ++endif (EIGEN3_FOUND) + + if (LAPACK) + find_package(LAPACK QUIET) +@@ -562,7 +562,7 @@ include_directories( + # Note that this is *not* propagated to clients, ie CERES_INCLUDE_DIRS + # used by clients after find_package(Ceres) does not identify Eigen as + # as system headers. +-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) ++include_directories(${EIGEN3_INCLUDE_DIRS}) + + if (SUITESPARSE) + include_directories(${SUITESPARSE_INCLUDE_DIRS}) +diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in +index c4ed71f..b3d6a17 100644 +--- a/cmake/CeresConfig.cmake.in ++++ b/cmake/CeresConfig.cmake.in +@@ -202,39 +202,39 @@ set(CERES_VERSION @CERES_VERSION@ ) + + # Eigen. + # Flag set during configuration and build of Ceres. +-set(CERES_EIGEN_VERSION @EIGEN_VERSION@) ++set(CERES_EIGEN_VERSION @EIGEN3_VERSION_STRING@) + set(EIGEN_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_EIGEN_CMAKE_CONFIGURATION@) + # Append the locations of Eigen when Ceres was built to the search path hints. + if (EIGEN_WAS_BUILT_WITH_CMAKE) + set(Eigen3_DIR @Eigen3_DIR@) + set(EIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION TRUE) + else() +- list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@) ++ list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN3_INCLUDE_DIR@) + endif() + # Search quietly to control the timing of the error message if not found. The + # search should be for an exact match, but for usability reasons do a soft + # match and reject with an explanation below. +-find_package(Eigen ${CERES_EIGEN_VERSION} QUIET) +-if (EIGEN_FOUND) +- if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION) ++find_package(Eigen3 ${CERES_EIGEN_VERSION} QUIET) ++if (EIGEN3_FOUND) ++ if (NOT EIGEN3_VERSION_STRING VERSION_EQUAL CERES_EIGEN_VERSION) + # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the + # specified version. However, only version = is supported. Improve + # usability by explaining why we don't accept non-exact version matching. + ceres_report_not_found("Found Eigen dependency, but the version of Eigen " +- "found (${EIGEN_VERSION}) does not exactly match the version of Eigen " ++ "found (${EIGEN3_VERSION_STRING}) does not exactly match the version of Eigen " + "Ceres was compiled with (${CERES_EIGEN_VERSION}). This can cause subtle " + "bugs by triggering violations of the One Definition Rule. See the " + "Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule " + "for more details") + endif () + message(STATUS "Found required Ceres dependency: " +- "Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}") +-else (EIGEN_FOUND) ++ "Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN3_INCLUDE_DIRS}") ++else (EIGEN3_FOUND) + ceres_report_not_found("Missing required Ceres " + "dependency: Eigen version ${CERES_EIGEN_VERSION}, please set " +- "EIGEN_INCLUDE_DIR.") +-endif (EIGEN_FOUND) +-list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) ++ "EIGEN3_INCLUDE_DIR.") ++endif (EIGEN3_FOUND) ++list(APPEND CERES_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS}) + + # Glog. + include (CMakeFindDependencyMacro) diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index a0a7a72e02faf8..5fb8186add93ee 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,11 +1,12 @@ Source: ceres -Version: 1.14.0-7 +Version: 1.14.0 +Port-Version: 10 Build-Depends: glog, eigen3 Homepage: https://github.com/ceres-solver/ceres-solver Description: non-linear optimization package Feature: lapack -Build-Depends: clapack (!osx) +Build-Depends: lapack Description: Use Lapack in Ceres Feature: suitesparse diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index d2d781b594341b..e7c455c562097f 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -6,10 +6,6 @@ if(VCPKG_CRT_LINKAGE STREQUAL "static") set(MSVC_USE_STATIC_CRT_VALUE ON) endif() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(ADDITIONAL_PATCH "0004_blas_linux_fix.patch") -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ceres-solver/ceres-solver @@ -20,15 +16,14 @@ vcpkg_from_github( 0001_cmakelists_fixes.patch 0002_use_glog_target.patch 0003_fix_exported_ceres_config.patch - ${ADDITIONAL_PATCH} + 0004_fix_find_eigen.patch ) +file(REMOVE ${SOURCE_PATH}/cmake/FindCXSparse.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake) -#file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake) +file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake) -#file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake) - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "suitesparse" SUITESPARSE @@ -52,7 +47,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) else() vcpkg_fixup_cmake_targets(CONFIG_PATH lib${LIB_SUFFIX}/cmake/Ceres) @@ -61,7 +56,7 @@ endif() vcpkg_copy_pdbs() # Changes target search path -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) file(READ ${CURRENT_PACKAGES_DIR}/share/ceres/CeresConfig.cmake CERES_TARGETS) string(REPLACE "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../" "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../../" CERES_TARGETS "${CERES_TARGETS}") @@ -77,6 +72,4 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -# Handle copyright of suitesparse and metis -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ceres) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/ceres/LICENSE ${CURRENT_PACKAGES_DIR}/share/ceres/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cgal/CONTROL b/ports/cgal/CONTROL index 60452db0f2dd46..1cb5e38bc9854d 100644 --- a/ports/cgal/CONTROL +++ b/ports/cgal/CONTROL @@ -1,5 +1,5 @@ Source: cgal -Version: 5.0.2-2 +Version: 5.0.3 Build-Depends: mpfr, mpir, zlib, boost-format, boost-container, boost-ptr-container, boost-iterator, boost-variant, boost-any, boost-unordered, boost-random, boost-foreach, boost-graph, boost-heap, boost-logic, boost-multiprecision, boost-interval Homepage: https://github.com/CGAL/cgal Description: The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry. diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 04e3271361d729..a7106503876ed5 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF releases/CGAL-5.0.2 - SHA512 108f1d6f68674e123fd90143049f30a7e7965827468828f75ba7ae0b7ba174690520bafdf0648853c1b28895d6a9a0c7349c03e678c13395a84ffe7397c97e99 + REF releases/CGAL-5.0.3 + SHA512 e163276264d8aeb3a546392f87d898bcbc59a4e2f10c23327f0c8e3d41f0d3d8200f872230da3f077d3a564acfa4b3fa4c6a101db0b3cd8d4a4028fffa8110df HEAD_REF master ) diff --git a/ports/chromium-base/CONTROL b/ports/chromium-base/CONTROL new file mode 100644 index 00000000000000..91b0590181f5af --- /dev/null +++ b/ports/chromium-base/CONTROL @@ -0,0 +1,5 @@ +Source: chromium-base +Version: 86.0.4199.1 +Homepage: https://chromium.googlesource.com/chromium/src +Description: Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web. +Supports: x64 & (osx|windows|linux) & !uwp \ No newline at end of file diff --git a/ports/chromium-base/chromium-baseConfig.cmake.in b/ports/chromium-base/chromium-baseConfig.cmake.in new file mode 100644 index 00000000000000..95ce316c655f04 --- /dev/null +++ b/ports/chromium-base/chromium-baseConfig.cmake.in @@ -0,0 +1,81 @@ +if(TARGET chromium-base) + return() +endif() + +set(DEFINITIONS_DBG @DEFINITIONS_DBG@) +set(DEFINITIONS_REL @DEFINITIONS_DBG@) + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +add_library(chromium-base INTERFACE IMPORTED GLOBAL) +add_library(chromium-base::chromium-base ALIAS chromium-base) + +set(LIBRARIES_ chromium_base chromium_base_static dynamic_annotations double_conversion) + +if(WIN32) + list(APPEND LIBRARIES_ + cfgmgr32 + powrprof + propsys + setupapi + userenv + wbemuuid + winmm + advapi32 + comdlg32 + dbghelp + dnsapi + gdi32 + msimg32 + odbc32 + odbccp32 + oleaut32 + shell32 + shlwapi + user32 + usp10 + uuid + version + wininet + winspool + ws2_32 + delayimp + kernel32 + ole32) +elseif(APPLE) + list(APPEND LIBRARIES_ + ApplicationServices + AppKit + CoreFoundation + IOKit + OpenDirectory + Security + bsm + pmenergy + pmsample) +endif() + +foreach(LIB_NAME ${LIBRARIES_}) + find_library(_LIB NAMES ${LIB_NAME} ${LIB_NAME}.dll) + target_link_libraries(chromium-base INTERFACE ${_LIB}) + unset(_LIB CACHE) +endforeach() + +if(UNIX AND NOT APPLE) + target_link_libraries(chromium-base INTERFACE -ldl -latomic -lpthread) +endif() + +target_include_directories(chromium-base + INTERFACE ${_IMPORT_PREFIX}/include/chromium-base) + +target_compile_definitions(chromium-base INTERFACE + $<$:${DEFINITIONS_DBG}> + $<$:${DEFINITIONS_REL}>) + +target_compile_features(chromium-base INTERFACE cxx_std_14) diff --git a/ports/chromium-base/portfile.cmake b/ports/chromium-base/portfile.cmake new file mode 100644 index 00000000000000..409c2d589eaa06 --- /dev/null +++ b/ports/chromium-base/portfile.cmake @@ -0,0 +1,155 @@ +vcpkg_fail_port_install( + ON_ARCH "x86" "arm" "arm64" + ON_TARGET "UWP") + +# Patches may be provided at the end +function(checkout_in_path PATH URL REF) + if(EXISTS "${PATH}") + file(GLOB FILES "${PATH}") + list(LENGTH FILES COUNT) + if(COUNT GREATER 0) + return() + endif() + file(REMOVE_RECURSE "${PATH}") + endif() + + vcpkg_from_git( + OUT_SOURCE_PATH DEP_SOURCE_PATH + URL "${URL}" + REF "${REF}" + PATCHES "${ARGN}" + ) + file(RENAME "${DEP_SOURCE_PATH}" "${PATH}") + file(REMOVE_RECURSE "${DEP_SOURCE_PATH}") +endfunction() + +# Commits are based on https://chromium.googlesource.com/chromium/src/+/refs/tags/86.0.4199.1 +set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/25ce732") +file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party") + +set(CHROMIUM_GIT "https://chromium.googlesource.com/chromium/src") +checkout_in_path( + "${SOURCE_PATH}/base" + "${CHROMIUM_GIT}/base" + "25ce73258703a5ac018da0e203fb3d4a98c2136e" + res/0001-base.patch) +checkout_in_path( + "${SOURCE_PATH}/build" + "${CHROMIUM_GIT}/build" + "312532ee66abdacbe58afb5df7ddf05e3a6399f9" + res/0002-build.patch) +checkout_in_path( + "${SOURCE_PATH}/third_party/apple_apsl" + "${CHROMIUM_GIT}/third_party/apple_apsl" + "4cc25bbf65194f6726f7f10da0a885818e35d53e") +checkout_in_path( + "${SOURCE_PATH}/third_party/ced" + "${CHROMIUM_GIT}/third_party/ced" + "4cd87a44674edd9fe1f01c4cb5f1b73907ce4236") +checkout_in_path( + "${SOURCE_PATH}/third_party/modp_b64" + "${CHROMIUM_GIT}/third_party/modp_b64" + "509f005fa65e652dc4a6f636da6fa1002b6dce16") + +set(RES "${CMAKE_CURRENT_LIST_DIR}/res") +file(COPY "${RES}/.gn" DESTINATION "${SOURCE_PATH}") +file(COPY "${RES}/BUILD.gn" DESTINATION "${SOURCE_PATH}") +file(COPY "${RES}/build_overrides" DESTINATION "${SOURCE_PATH}") +file(COPY "${RES}/testing" DESTINATION "${SOURCE_PATH}") +file(COPY "${RES}/tools" DESTINATION "${SOURCE_PATH}") +file(COPY "${RES}/gclient_args.gni" DESTINATION "${SOURCE_PATH}/build/config") +file(COPY "${RES}/LASTCHANGE.committime" DESTINATION "${SOURCE_PATH}/build/util") +file(COPY "${RES}/icu" DESTINATION "${SOURCE_PATH}/third_party") +file(COPY "${RES}/libxml" DESTINATION "${SOURCE_PATH}/third_party") +file(COPY "${RES}/protobuf" DESTINATION "${SOURCE_PATH}/third_party") +file(COPY "${RES}/fontconfig" DESTINATION "${SOURCE_PATH}/third_party") +file(COPY "${RES}/test_fonts" DESTINATION "${SOURCE_PATH}/third_party") + +set(OPTIONS "\ + use_custom_libcxx=false \ + clang_use_chrome_plugins=false \ + forbid_non_component_debug_builds=false") +set(DEFINITIONS "") + +if(WIN32) + # Windows 10 SDK >= (10.0.19041.0) is required + # https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk + SET(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled) + set(ENV{DEPOT_TOOLS_WIN_TOOLCHAIN} 0) + set(OPTIONS "${OPTIONS} treat_warnings_as_errors=false use_lld=false") +endif() + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Linux) + set(OPTIONS "${OPTIONS} use_allocator=\"none\" use_sysroot=false use_glib=false") +endif() + +# Find the directory that contains "bin/clang" +# Note: Only clang-cl is supported on Windows, see https://crbug.com/988071 +vcpkg_find_acquire_program(CLANG) +if(CLANG MATCHES "-NOTFOUND") + message(FATAL_ERROR "Clang is required.") +endif() +get_filename_component(CLANG "${CLANG}" DIRECTORY) +get_filename_component(CLANG "${CLANG}" DIRECTORY) +if((WIN32 AND NOT EXISTS "${CLANG}/bin/clang-cl.exe") OR + (APPLE AND NOT EXISTS "${CLANG}/bin/clang")) + message(FATAL_ERROR "Clang needs to be inside a bin directory.") +endif() +set(OPTIONS "${OPTIONS} clang_base_path=\"${CLANG}\"") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPTIONS "${OPTIONS} is_component_build=true") + list(APPEND DEFINITIONS COMPONENT_BUILD) +else() + set(OPTIONS "${OPTIONS} is_component_build=false") +endif() + +if(APPLE) + set(OPTIONS "${OPTIONS} enable_dsyms=true") +endif() + +set(OPTIONS_DBG "${OPTIONS} is_debug=true symbol_level=2") +set(OPTIONS_REL "${OPTIONS} is_debug=false symbol_level=0") +set(DEFINITIONS_DBG ${DEFINITIONS}) +set(DEFINITIONS_REL ${DEFINITIONS}) + +vcpkg_configure_gn( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG "${OPTIONS_DBG}" + OPTIONS_RELEASE "${OPTIONS_REL}" +) + +# Prevent a ninja re-config loop +set(NINJA_REBUILD "build build.ninja: gn\n generator = 1\n depfile = build.ninja.d") +vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/build.ninja" "${NINJA_REBUILD}" "") +vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja" "${NINJA_REBUILD}" "") + +set(TARGETS + base base:base_static + base/third_party/dynamic_annotations + base/third_party/double_conversion) + +if(WIN32) + list(APPEND TARGETS base/win:pe_image) +endif() + +vcpkg_install_gn( + SOURCE_PATH "${SOURCE_PATH}" + TARGETS ${TARGETS} +) + +# Install includes +set(PACKAGES_INCLUDE_DIR "${CURRENT_PACKAGES_DIR}/include/${PORT}") +file(GLOB_RECURSE INCLUDE_FILES LIST_DIRECTORIES false RELATIVE "${SOURCE_PATH}" "${SOURCE_PATH}/*.h") +foreach(file_ ${INCLUDE_FILES}) + configure_file("${SOURCE_PATH}/${file_}" "${PACKAGES_INCLUDE_DIR}/${file_}" COPYONLY) +endforeach() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/chromium-baseConfig.cmake.in" + "${CURRENT_PACKAGES_DIR}/share/${PORT}/chromium-baseConfig.cmake" @ONLY) + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/third_party/ced/LICENSE" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright) diff --git a/ports/chromium-base/res/.gn b/ports/chromium-base/res/.gn new file mode 100644 index 00000000000000..4fcb7c405ff334 --- /dev/null +++ b/ports/chromium-base/res/.gn @@ -0,0 +1 @@ +buildconfig = "//build/config/BUILDCONFIG.gn" \ No newline at end of file diff --git a/ports/chromium-base/res/0001-base.patch b/ports/chromium-base/res/0001-base.patch new file mode 100644 index 00000000000000..ca8c059756d80f --- /dev/null +++ b/ports/chromium-base/res/0001-base.patch @@ -0,0 +1,101 @@ +diff --git a/BUILD.gn b/BUILD.gn +index 7b7cd51..2961688 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -155,6 +155,7 @@ if (is_android) { + # test code (test support and anything in the test directory) which should use + # source_set as is recommended for GN targets). + jumbo_component("base") { ++ output_name = "chromium_base" + if (is_nacl || is_ios) { + # Link errors related to malloc functions if libbase for nacl is + # compiled with jumbo: https://crbug.com/775959. +@@ -162,6 +163,11 @@ jumbo_component("base") { + never_build_jumbo = true + } + ++ if (!is_component_build) { ++ complete_static_lib = true ++ configs -= [ "//build/config/compiler:thin_archive" ] ++ } ++ + sources = [ + "allocator/allocator_check.cc", + "allocator/allocator_check.h", +@@ -1638,7 +1644,7 @@ jumbo_component("base") { + "hash/md5_constexpr_internal.h", + "hash/sha1.h", + ] +- if (is_nacl) { ++ if (true) { + sources += [ + "hash/md5_nacl.cc", + "hash/md5_nacl.h", +@@ -2298,6 +2304,7 @@ buildflag_header("tracing_buildflags") { + # library. Note that this library cannot depend on base because base depends on + # base_static. + static_library("base_static") { ++ output_name = "chromium_base_static" + sources = [ + "base_switches.cc", + "base_switches.h", +@@ -2325,7 +2332,7 @@ static_library("base_static") { + } + + component("i18n") { +- output_name = "base_i18n" ++ output_name = "chromium_base_i18n" + sources = [ + "i18n/base_i18n_export.h", + "i18n/base_i18n_switches.cc", +diff --git a/gtest_prod_util.h b/gtest_prod_util.h +index 2ca267e..0a0b6df 100644 +--- a/gtest_prod_util.h ++++ b/gtest_prod_util.h +@@ -5,7 +5,8 @@ + #ifndef BASE_GTEST_PROD_UTIL_H_ + #define BASE_GTEST_PROD_UTIL_H_ + +-#include "testing/gtest/include/gtest/gtest_prod.h" // nogncheck ++#define FRIEND_TEST(test_case_name, test_name)\ ++friend class test_case_name##_##test_name##_Test + + // This is a wrapper for gtest's FRIEND_TEST macro that friends + // test with all possible prefixes. This is very helpful when changing the test +diff --git a/hash/md5.h b/hash/md5.h +index 8a49f08..24acdab 100644 +--- a/hash/md5.h ++++ b/hash/md5.h +@@ -11,7 +11,7 @@ + #include "base/strings/string_piece.h" + #include "build/build_config.h" + +-#if defined(OS_NACL) ++#if true + #include "base/hash/md5_nacl.h" + #else + #include "base/hash/md5_boringssl.h" +diff --git a/hash/md5_nacl.cc b/hash/md5_nacl.cc +index 827bbbd..4b22c59 100644 +--- a/hash/md5_nacl.cc ++++ b/hash/md5_nacl.cc +@@ -22,6 +22,7 @@ + */ + + #include ++#include + + #include "base/hash/md5.h" + +diff --git a/profiler/stack_copier_signal.cc b/profiler/stack_copier_signal.cc +index 5a7d8b9..f959f2f 100644 +--- a/profiler/stack_copier_signal.cc ++++ b/profiler/stack_copier_signal.cc +@@ -6,6 +6,7 @@ + + #include + #include ++#include + #include + #include + diff --git a/ports/chromium-base/res/0002-build.patch b/ports/chromium-base/res/0002-build.patch new file mode 100644 index 00000000000000..94568d1690e317 --- /dev/null +++ b/ports/chromium-base/res/0002-build.patch @@ -0,0 +1,144 @@ +diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn +index 4cc6bfc..9ea83a9 100644 +--- a/config/BUILDCONFIG.gn ++++ b/config/BUILDCONFIG.gn +@@ -657,6 +657,7 @@ template("component") { + # See http://crbug.com/594610 + forward_variables_from(invoker, [ "visibility" ]) + forward_variables_from(invoker, "*", [ "visibility" ]) ++ not_needed("*") + } + } + +diff --git a/config/clang/BUILD.gn b/config/clang/BUILD.gn +index 960726e..87886dc 100644 +--- a/config/clang/BUILD.gn ++++ b/config/clang/BUILD.gn +@@ -38,5 +38,7 @@ config("extra_warnings") { + "-Wstring-conversion", + + "-Wtautological-overlap-compare", ++ "-Wno-unknown-warning-option", ++ "-Wno-unknown-pragmas" + ] + } +diff --git a/config/mac/sdk_info.py b/config/mac/sdk_info.py +index 1ad11d3..99b21f9 100644 +--- a/config/mac/sdk_info.py ++++ b/config/mac/sdk_info.py +@@ -61,10 +61,15 @@ def FillXcodeVersion(settings, developer_dir): + settings['xcode_build'] = version_plist['ProductBuildVersion'] + return + +- lines = subprocess.check_output(['xcodebuild', '-version']).splitlines() +- settings['xcode_version'] = FormatVersion(lines[0].split()[-1]) +- settings['xcode_version_int'] = int(settings['xcode_version'], 10) +- settings['xcode_build'] = lines[-1].split()[-1] ++ try: ++ lines = subprocess.check_output(['xcodebuild', '-version']).splitlines() ++ settings['xcode_version'] = FormatVersion(lines[0].split()[-1]) ++ settings['xcode_version_int'] = int(settings['xcode_version'], 10) ++ settings['xcode_build'] = lines[-1].split()[-1] ++ except: ++ settings['xcode_version'] = "" ++ settings['xcode_version_int'] = 0 ++ settings['xcode_build'] = "" + + + def FillMachineOSBuild(settings): +diff --git a/mac/find_sdk.py b/mac/find_sdk.py +index 58362bf..a6069b6 100755 +--- a/mac/find_sdk.py ++++ b/mac/find_sdk.py +@@ -68,6 +68,8 @@ def main(): + dev_dir = out.rstrip() + sdk_dir = os.path.join( + dev_dir, 'Platforms/MacOSX.platform/Developer/SDKs') ++ if not os.path.isdir(sdk_dir): ++ sdk_dir = os.path.join(dev_dir, 'SDKs') + + if not os.path.isdir(sdk_dir): + raise SdkError('Install Xcode, launch it, accept the license ' + +@@ -87,7 +89,10 @@ def main(): + + if options.print_bin_path: + bin_path = 'Toolchains/XcodeDefault.xctoolchain/usr/bin/' +- print(os.path.join(dev_dir, bin_path)) ++ if os.path.isdir(os.path.join(dev_dir, bin_path)): ++ print(os.path.join(dev_dir, bin_path)) ++ else: ++ print(os.path.join(dev_dir, 'usr/bin/')) + + return best_sdk + +diff --git a/toolchain/mac/BUILD.gn b/toolchain/mac/BUILD.gn +index 8fdada0..8d5e6b7 100644 +--- a/toolchain/mac/BUILD.gn ++++ b/toolchain/mac/BUILD.gn +@@ -184,9 +184,9 @@ template("mac_toolchain") { + # If dSYMs are enabled, this flag will be added to the link tools. + if (_enable_dsyms) { + dsym_switch = " -Wcrl,dsym,{{root_out_dir}} " +- dsym_switch += "-Wcrl,dsymutilpath," + +- rebase_path("//tools/clang/dsymutil/bin/dsymutil", +- root_build_dir) + " " ++ # dsym_switch += "-Wcrl,dsymutilpath," + ++ # rebase_path("//tools/clang/dsymutil/bin/dsymutil", ++ # root_build_dir) + " " + + dsym_output_dir = + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM" +diff --git a/toolchain/win/BUILD.gn b/toolchain/win/BUILD.gn +index be08930..04fb374 100644 +--- a/toolchain/win/BUILD.gn ++++ b/toolchain/win/BUILD.gn +@@ -98,7 +98,7 @@ template("msvc_toolchain") { + } else { + lld_link = "lld-link" + } +- prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ prefix = "$clang_base_path/bin" + + # lld-link includes a replacement for lib.exe that can produce thin + # archives and understands bitcode (for lto builds). +@@ -190,7 +190,7 @@ template("msvc_toolchain") { + # amount of data to parse and store in .ninja_deps. We do this on non-Windows too, + # and already make sure rebuilds after win sdk / libc++ / clang header updates happen via + # changing commandline flags. +- show_includes = "/showIncludes:user" ++ show_includes = "" + } else { + show_includes = "/showIncludes" + } +@@ -235,7 +235,7 @@ template("msvc_toolchain") { + + if (toolchain_args.current_cpu == "arm64") { + if (is_clang) { +- prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ prefix = "$clang_base_path/bin" + ml = "${clang_prefix}${prefix}/${clang_cl} --target=arm64-windows" + if (host_os == "win") { + # Flip the slashes so that copy/paste of the command works. +@@ -444,11 +444,9 @@ template("win_toolchains") { + + msvc_toolchain("win_clang_" + target_name) { + environment = "environment." + toolchain_arch +- prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ prefix = "$clang_base_path/bin" + cl = "${clang_prefix}$prefix/${clang_cl}" +- _clang_lib_dir = +- rebase_path("$clang_base_path/lib/clang/$clang_version/lib/windows", +- root_build_dir) ++ _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib/windows" + if (host_os == "win") { + # Flip the slashes so that copy/paste of the command works. + cl = string_replace(cl, "/", "\\") +@@ -459,7 +457,7 @@ template("win_toolchains") { + + sys_include_flags = "${win_toolchain_data.include_flags_imsvc}" + sys_lib_flags = +- "-libpath:$_clang_lib_dir ${win_toolchain_data.libpath_flags}" ++ "-libpath:\"$_clang_lib_dir\" ${win_toolchain_data.libpath_flags}" + + toolchain_args = { + if (defined(invoker.toolchain_args)) { diff --git a/ports/chromium-base/res/BUILD.gn b/ports/chromium-base/res/BUILD.gn new file mode 100644 index 00000000000000..01d935ba02527f --- /dev/null +++ b/ports/chromium-base/res/BUILD.gn @@ -0,0 +1,5 @@ +static_library("chromium-base") { + deps = [ + "//base", + ] +} diff --git a/ports/chromium-base/res/LASTCHANGE.committime b/ports/chromium-base/res/LASTCHANGE.committime new file mode 100644 index 00000000000000..6acbbf6910963e --- /dev/null +++ b/ports/chromium-base/res/LASTCHANGE.committime @@ -0,0 +1 @@ +1594430814 \ No newline at end of file diff --git a/ports/chromium-base/res/build_overrides/build.gni b/ports/chromium-base/res/build_overrides/build.gni new file mode 100644 index 00000000000000..47ac036443fb64 --- /dev/null +++ b/ports/chromium-base/res/build_overrides/build.gni @@ -0,0 +1,16 @@ +import("//build/config/gclient_args.gni") + +# Some non-Chromium builds don't support building java targets. +enable_java_templates = true + +# Don't use Chromium's third_party/binutils. +linux_use_bundled_binutils_override = false + +# Tracing requires //third_party/perfetto. +enable_base_tracing = false + +# Skip assertions about 4GiB file size limit. See https://crbug.com/648948. +ignore_elf32_limitations = false + +# Use the system install of Xcode for tools like ibtool, libtool, etc. +use_system_xcode = true diff --git a/ports/chromium-base/res/fontconfig/BUILD.gn b/ports/chromium-base/res/fontconfig/BUILD.gn new file mode 100644 index 00000000000000..5c26eaf19c3ed9 --- /dev/null +++ b/ports/chromium-base/res/fontconfig/BUILD.gn @@ -0,0 +1 @@ +component("fontconfig") {} \ No newline at end of file diff --git a/ports/chromium-base/res/gclient_args.gni b/ports/chromium-base/res/gclient_args.gni new file mode 100644 index 00000000000000..bd1145a79d5413 --- /dev/null +++ b/ports/chromium-base/res/gclient_args.gni @@ -0,0 +1,7 @@ +build_with_chromium = true +checkout_android = false +checkout_android_native_support = false +checkout_ios_webkit = false +checkout_nacl = false +checkout_oculus_sdk = false +checkout_openxr = false \ No newline at end of file diff --git a/ports/chromium-base/res/icu/BUILD.gn b/ports/chromium-base/res/icu/BUILD.gn new file mode 100644 index 00000000000000..22356981f3b55b --- /dev/null +++ b/ports/chromium-base/res/icu/BUILD.gn @@ -0,0 +1,2 @@ +component("icuuc") {} +component("icu") {} \ No newline at end of file diff --git a/ports/chromium-base/res/icu/config.gni b/ports/chromium-base/res/icu/config.gni new file mode 100644 index 00000000000000..4e9ad6a5ee9f93 --- /dev/null +++ b/ports/chromium-base/res/icu/config.gni @@ -0,0 +1,3 @@ +declare_args() { + icu_use_data_file = false +} \ No newline at end of file diff --git a/ports/chromium-base/res/libxml/BUILD.gn b/ports/chromium-base/res/libxml/BUILD.gn new file mode 100644 index 00000000000000..b48056ab882c4f --- /dev/null +++ b/ports/chromium-base/res/libxml/BUILD.gn @@ -0,0 +1,2 @@ +component("libxml_utils") {} +component("xml_reader") {} \ No newline at end of file diff --git a/ports/chromium-base/res/protobuf/proto_library.gni b/ports/chromium-base/res/protobuf/proto_library.gni new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/ports/chromium-base/res/test_fonts/BUILD.gn b/ports/chromium-base/res/test_fonts/BUILD.gn new file mode 100644 index 00000000000000..b95c104e1f372a --- /dev/null +++ b/ports/chromium-base/res/test_fonts/BUILD.gn @@ -0,0 +1 @@ +component("test_fonts") {} \ No newline at end of file diff --git a/ports/chromium-base/res/testing/gmock/BUILD.gn b/ports/chromium-base/res/testing/gmock/BUILD.gn new file mode 100644 index 00000000000000..acd0ec30c0963d --- /dev/null +++ b/ports/chromium-base/res/testing/gmock/BUILD.gn @@ -0,0 +1 @@ +component("gmock") {} \ No newline at end of file diff --git a/ports/chromium-base/res/testing/gtest/BUILD.gn b/ports/chromium-base/res/testing/gtest/BUILD.gn new file mode 100644 index 00000000000000..2463cc7c0d82d3 --- /dev/null +++ b/ports/chromium-base/res/testing/gtest/BUILD.gn @@ -0,0 +1 @@ +component("gtest") {} \ No newline at end of file diff --git a/ports/chromium-base/res/testing/libfuzzer/fuzzer_test.gni b/ports/chromium-base/res/testing/libfuzzer/fuzzer_test.gni new file mode 100644 index 00000000000000..6e2a4c20fea4e1 --- /dev/null +++ b/ports/chromium-base/res/testing/libfuzzer/fuzzer_test.gni @@ -0,0 +1 @@ +import("//testing/test.gni") \ No newline at end of file diff --git a/ports/chromium-base/res/testing/test.gni b/ports/chromium-base/res/testing/test.gni new file mode 100644 index 00000000000000..2d6f8c10352558 --- /dev/null +++ b/ports/chromium-base/res/testing/test.gni @@ -0,0 +1,20 @@ +template("test") { + not_needed(invoker, "*") + not_needed("*") +} + +set_defaults("test") { + configs = [ + "//build/config/compiler:chromium_code" + ] +} + +template("fuzzer_test") { + not_needed(invoker, "*") + not_needed("*") +} + +template("protoc_convert") { + not_needed(invoker, "*") + not_needed("*") +} \ No newline at end of file diff --git a/ports/chromium-base/res/tools/win/DebugVisualizers/BUILD.gn b/ports/chromium-base/res/tools/win/DebugVisualizers/BUILD.gn new file mode 100644 index 00000000000000..5c2c1f68e14e66 --- /dev/null +++ b/ports/chromium-base/res/tools/win/DebugVisualizers/BUILD.gn @@ -0,0 +1 @@ +config("chrome") {} \ No newline at end of file diff --git a/ports/chromium-base/res/tools/win/DebugVisualizers/chrome.natvis b/ports/chromium-base/res/tools/win/DebugVisualizers/chrome.natvis new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index ce3610044aeff6..0dac115073e94a 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,5 +1,6 @@ Source: clapack -Version: 3.2.1-13 +Version: 3.2.1 +Port-Version: 15 Homepage: https://www.netlib.org/clapack Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) diff --git a/ports/clapack/FindLAPACK.cmake b/ports/clapack/FindLAPACK.cmake index 0b5924ff4a4280..eff9bae705479e 100644 --- a/ports/clapack/FindLAPACK.cmake +++ b/ports/clapack/FindLAPACK.cmake @@ -1,468 +1,233 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#[=======================================================================[.rst: -FindLAPACK ----------- - -Find LAPACK library - -This module finds an installed fortran library that implements the -LAPACK linear-algebra interface (see http://www.netlib.org/lapack/). - -The approach follows that taken for the autoconf macro file, -acx_lapack.m4 (distributed at -http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). - -Input Variables -^^^^^^^^^^^^^^^ - -The following variables may be set to influence this module's behavior: - -``BLA_STATIC`` - if ``ON`` use static linkage - -``BLA_VENDOR`` - If set, checks only the specified vendor, if not set checks all the - possibilities. List of vendors valid in this module: - - * ``Intel10_32`` (intel mkl v10 32 bit) - * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) - * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) - * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) - * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model) - * ``Intel`` (obsolete versions of mkl 32 and 64 bit) - * ``OpenBLAS`` - * ``FLAME`` - * ``ACML`` - * ``Apple`` - * ``NAS`` - * ``Generic`` - -``BLA_F95`` - if ``ON`` tries to find BLAS95/LAPACK95 - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -``LAPACK_FOUND`` - library implementing the LAPACK interface is found -``LAPACK_LINKER_FLAGS`` - uncached list of required linker flags (excluding -l and -L). -``LAPACK_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use LAPACK -``LAPACK95_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use LAPACK95 -``LAPACK95_FOUND`` - library implementing the LAPACK95 interface is found - -.. note:: - - C or CXX must be enabled to use Intel MKL - - For example, to use Intel MKL libraries and/or Intel compiler: - - .. code-block:: cmake - - set(BLA_VENDOR Intel10_64lp) - find_package(LAPACK) -#]=======================================================================] - -set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - -# Check the language being used -if( NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED) ) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.") - else() - message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)") - return() - endif() -endif() - -if (CMAKE_Fortran_COMPILER_LOADED) -include(${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -else () -include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -endif () -include(${CMAKE_ROOT}/Modules/CMakePushCheckState.cmake) -include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) - -cmake_push_check_state() -set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY}) - -set(LAPACK_FOUND FALSE) -set(LAPACK95_FOUND FALSE) - -# TODO: move this stuff to separate module - -macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads) -# This macro checks for the existence of the combination of fortran libraries -# given by _list. If the combination is found, this macro checks (using the -# Check_Fortran_Function_Exists macro) whether can link against that library -# combination using the name of a routine given by _name using the linker -# flags given by _flags. If the combination of libraries is found and passes -# the link test, LIBRARIES is set to the list of complete library paths that -# have been found. Otherwise, LIBRARIES is set to FALSE. - -# N.B. _prefix is the prefix applied to the names of all cached variables that -# are generated internally and marked advanced by this macro. - -set(_libraries_work TRUE) -set(${LIBRARIES}) -set(${LIBRARIES}_RELEASE) -set(_combined_name) -if (NOT _libdir) - if (WIN32) - set(_libdir ENV LIB) - elseif (APPLE) - set(_libdir ENV DYLD_LIBRARY_PATH) - else () - set(_libdir ENV LD_LIBRARY_PATH) - endif () -endif () - -list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") - -foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - - if(_libraries_work) - if (BLA_STATIC) - if (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif () - if (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else () - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif () - else () - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # for ubuntu's libblas3gf and liblapack3gf packages - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) - endif () - endif () - find_library(${_prefix}_${_library}_LIBRARY_RELEASE - NAMES ${_library} - PATHS ${_libdir} - ) - mark_as_advanced(${_prefix}_${_library}_LIBRARY_RELEASE) - find_library(${_prefix}_${_library}_LIBRARY_DEBUG - NAMES ${_library}d - PATHS ${_libdir} - ) - mark_as_advanced(${_prefix}_${_library}_LIBRARY_DEBUG) - select_library_configurations(${_prefix}_${_library}) - if(NOT ${_prefix}_${_library}_LIBRARY_RELEASE MATCHES "NOTFOUND") - set(${LIBRARIES}_RELEASE ${${LIBRARIES}_RELEASE} ${${_prefix}_${_library}_LIBRARY_RELEASE}) - endif() - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif() -endforeach() - -if(_libraries_work) - # Test this combination of libraries. - if(NOT "${_blas}" STREQUAL "") - string(GENEX_STRIP "${_blas}" _test_blas) - endif() - if(UNIX AND BLA_STATIC) - set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}_RELEASE} ${_test_blas} "-Wl,--end-group" ${_threads}) - else() - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}_RELEASE} ${_test_blas} ${_threads}) - endif() - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - #message("DEBUG: _test_blas = ${_test_blas} former ${_blas}") - if (NOT CMAKE_Fortran_COMPILER_LOADED) - check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - else () - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) - endif () - set(CMAKE_REQUIRED_LIBRARIES) - set(_test_blas) - set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) -# message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endif() - - if(_libraries_work) - set(${LIBRARIES} ${${LIBRARIES}} "${_blas}" ${_threads}) - else() - set(${LIBRARIES} FALSE) - endif() - -endmacro() - - -set(LAPACK_LINKER_FLAGS) -set(LAPACK_LIBRARIES) -set(LAPACK95_LIBRARIES) - - -if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS) -else() - find_package(BLAS REQUIRED) -endif() - - -if(BLAS_FOUND) - set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) - if (NOT $ENV{BLA_VENDOR} STREQUAL "") - set(BLA_VENDOR $ENV{BLA_VENDOR}) - else () - if(NOT BLA_VENDOR) - set(BLA_VENDOR "All") - endif() - endif () - -#intel lapack -if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") - if (NOT WIN32) - set(LAPACK_mkl_LM "-lm") - set(LAPACK_mkl_LDL "-ldl") - endif () - if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) - if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_PACKAGE(Threads) - else() - find_package(Threads REQUIRED) - endif() - - if (BLA_VENDOR MATCHES "_64ilp") - set(LAPACK_mkl_ILP_MODE "ilp64") - else () - set(LAPACK_mkl_ILP_MODE "lp64") - endif () - - set(LAPACK_SEARCH_LIBS "") - - if (BLA_F95) - set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") - set(_LIBRARIES LAPACK95_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) - - # old - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95") - # new >= 10.3 - list(APPEND LAPACK_SEARCH_LIBS - "mkl_intel_c") - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95_${LAPACK_mkl_ILP_MODE}") - else() - set(LAPACK_mkl_SEARCH_SYMBOL "cheev") - set(_LIBRARIES LAPACK_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) - - # old - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack") - endif() - - # First try empty lapack libs - if (NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - LAPACK - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "" - "${_BLAS_LIBRARIES}" - "" - ) - endif () - # Then try the search libs - foreach (IT ${LAPACK_SEARCH_LIBS}) - if (NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - LAPACK - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "${IT}" - "${_BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" - ) - endif () - endforeach () - - unset(LAPACK_mkl_ILP_MODE) - unset(LAPACK_mkl_SEARCH_SYMBOL) - unset(LAPACK_mkl_LM) - unset(LAPACK_mkl_LDL) - endif () -endif() - -if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "goto2" - "${BLAS_LIBRARIES}" - "" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "openblas" - "${BLAS_LIBRARIES}" - "" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "flame" - "${BLAS_LIBRARIES}" - "" - ) - endif() -endif () - -#acml lapack - if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") - if (BLAS_LIBRARIES MATCHES ".+acml.+") - set (LAPACK_LIBRARIES ${BLAS_LIBRARIES}) - endif () - endif () - -# Apple LAPACK library? -if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "Accelerate" - "${BLAS_LIBRARIES}" - "" - ) - endif() -endif () -if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "vecLib" - "${BLAS_LIBRARIES}" - "" - ) - endif () -endif () -# Generic LAPACK library? -if (BLA_VENDOR STREQUAL "Generic" OR - BLA_VENDOR STREQUAL "ATLAS" OR - BLA_VENDOR STREQUAL "All") - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack" - "${BLAS_LIBRARIES}" - "" - ) - endif () - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack;libf2c" - "${BLAS_LIBRARIES}" - "" - ) - endif () - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack;f2c" - "${BLAS_LIBRARIES}" - "" - ) - endif () -endif () - -else() - message(STATUS "LAPACK requires BLAS") -endif() - -if(BLA_F95) - if(LAPACK95_LIBRARIES) - set(LAPACK95_FOUND TRUE) - else() - set(LAPACK95_FOUND FALSE) - endif() - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK95_FOUND) - message(STATUS "A library with LAPACK95 API found.") - else() - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK95 API not found. Please specify library location." - ) - else() - message(STATUS - "A library with LAPACK95 API not found. Please specify library location." - ) - endif() - endif() - endif() - set(LAPACK_FOUND "${LAPACK95_FOUND}") - set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") -else() - if(LAPACK_LIBRARIES) - set(LAPACK_FOUND TRUE) - else() - set(LAPACK_FOUND FALSE) - endif() - - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK_FOUND) - message(STATUS "A library with LAPACK API found.") - else() - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK API not found. Please specify library location." - ) - else() - message(STATUS - "A library with LAPACK API not found. Please specify library location." - ) - endif() - endif() - endif() -endif() - -cmake_pop_check_state() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) +#.rst: +# clapack config for vcpkg +# ------------ +# +# Find the clapack includes and library. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This script defines the following variables: +# +# ``CLAPACK_FOUND`` +# True if clapack library found +# +# ``CLAPACK_VERSION`` +# Containing the clapack version tag (manually defined) +# +# ``CLAPACK_INCLUDE_DIR`` +# Location of clapack headers +# +# ``CLAPACK_LIBRARY`` +# List of libraries to link with when using clapack +# +# Result Targets +# ^^^^^^^^^^^^^^ +# +# This script defines the following targets: +# +# ``clapack::clapack`` +# Target to use clapack +# +# Compatibility Variables +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# This script defines the following variables for compatibility reasons: +# +# ``F2C_FOUND`` +# True if f2c (fortran-to-c wrap layer) library found +# +# ``F2C_INCLUDE_DIR`` +# Location of clapack headers +# +# ``F2C_LIBRARY`` +# Library containing the fortran-to-c wrap layer, necessary for clapack and automatically included when used +# +# ``LAPACK_FOUND`` +# True if clapack library found +# +# ``LAPACK_VERSION`` +# Containing the clapack version tag (manually defined) +# +# ``LAPACK_INCLUDE_DIR`` +# Location of clapack headers +# +# ``LAPACK_LIBRARY`` +# List of libraries to link with when using clapack +# +# Compatibility Targets +# ^^^^^^^^^^^^^^ +# +# This script defines the following targets for compatibility reasons: +# +# ``lapack`` +# Target to use lapack + +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) +include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) + +set(CLAPACK_VERSION "3.2.1") + +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +find_dependency(Threads) + +if(UNIX) + find_library(ADDITIONAL_LAPACK_LIBRARY m) + set(PTHREAD_LINK_NAME "-pthread") +endif() + +if(NOT F2C_LIBRARY) + find_library(F2C_LIBRARY_RELEASE NAMES f2c libf2c) + find_library(F2C_LIBRARY_DEBUG NAMES f2cd libf2cd) + select_library_configurations(F2C) + + #keep a list of "pure" f2c libs, without dependencies + set(oF2C_LIBRARY_RELEASE ${F2C_LIBRARY_RELEASE}) + set(oF2C_LIBRARY_DEBUG ${F2C_LIBRARY_DEBUG}) + set(oF2C_LIBRARY ${F2C_LIBRARY}) + + list(APPEND F2C_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY}) +endif() + +if(NOT LAPACK_LIBRARY) + find_library(LAPACK_LIBRARY_RELEASE NAMES lapack) + find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd) + + #keep a list of "pure" lapack libs, without dependencies + set(oLAPACK_LIBRARY_RELEASE ${LAPACK_LIBRARY_RELEASE}) + set(oLAPACK_LIBRARY_DEBUG ${LAPACK_LIBRARY_DEBUG}) + select_library_configurations(oLAPACK) + + list(APPEND LAPACK_LIBRARY_RELEASE ${F2C_LIBRARY_RELEASE}) + list(APPEND LAPACK_LIBRARY_DEBUG ${F2C_LIBRARY_DEBUG}) + + find_dependency(OpenBLAS) + get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_RELEASE) + if(NOT _loc) + get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_RELEASE) + endif() + set(LAPACK_BLAS_LIBRARY_RELEASE ${_loc}) + get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_DEBUG) + if(NOT _loc) + get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_DEBUG) + endif() + set(LAPACK_BLAS_LIBRARY_DEBUG ${_loc}) + select_library_configurations(LAPACK_BLAS) + list(APPEND LAPACK_LIBRARY_RELEASE ${LAPACK_BLAS_LIBRARY_RELEASE}) + list(APPEND LAPACK_LIBRARY_DEBUG ${LAPACK_BLAS_LIBRARY_DEBUG}) + + select_library_configurations(LAPACK) + if(UNIX) + list(APPEND LAPACK_LIBRARY ${PTHREAD_LINK_NAME}) + endif() +endif() + +if(NOT F2C_INCLUDE_DIR) + find_path(F2C_INCLUDE_DIR NAMES f2c.h) +endif() + +if(NOT LAPACK_INCLUDE_DIR) + find_path(LAPACK_INCLUDE_DIR NAMES clapack.h) +endif() + +list(APPEND LAPACK_INCLUDE_DIR ${F2C_INCLUDE_DIR}) +set(LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE) +set(LAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE) +set(CLAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE) +set(CLAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE) +set(F2C_INCLUDE_DIRS "${F2C_INCLUDE_DIR}" CACHE PATH "" FORCE) + +set(LAPACK_DLL_DIR ${LAPACK_INCLUDE_DIR}) +list(TRANSFORM LAPACK_DLL_DIR APPEND "/../bin") +message(STATUS "LAPACK_DLL_DIR: ${LAPACK_DLL_DIR}") + +if(WIN32) + find_file(LAPACK_LIBRARY_RELEASE_DLL NAMES lapack.dll PATHS ${LAPACK_DLL_DIR}) + find_file(LAPACK_LIBRARY_DEBUG_FOLDER NAMES lapackd.dll PATHS ${LAPACK_DLL_DIR}) + find_file(F2C_LIBRARY_RELEASE_DLL NAMES f2c.dll libf2c.dll PATHS ${LAPACK_DLL_DIR}) + find_file(F2C_LIBRARY_DEBUG_DLL NAMES f2cd.dll libf2cd.dll PATHS ${LAPACK_DLL_DIR}) +endif() + +set(LAPACK_BLAS_LIBRARY "${LAPACK_BLAS_LIBRARY}" CACHE STRING "" FORCE) +set(F2C_LIBRARIES "${F2C_LIBRARY}" CACHE STRING "" FORCE) +set(LAPACK_VERSION "${CLAPACK_VERSION}" CACHE STRING "" FORCE) +set(LAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE) +set(CLAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE) +set(CLAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE) + +set(LAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE) +set(F2C_LIBRARY "${F2C_LIBRARY}" CACHE STRING "" FORCE) +set(LAPACK_LIBRARY_RELEASE "${LAPACK_LIBRARY_RELEASE}" CACHE STRING "" FORCE) +set(LAPACK_LIBRARY_DEBUG "${LAPACK_LIBRARY_DEBUG}" CACHE STRING "" FORCE) +set(F2C_LIBRARY_RELEASE "${F2C_LIBRARY_RELEASE}" CACHE STRING "" FORCE) +set(F2C_LIBRARY_DEBUG "${F2C_LIBRARY_DEBUG}" CACHE STRING "" FORCE) + +find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY LAPACK_INCLUDE_DIR) +mark_as_advanced(LAPACK_INCLUDE_DIR LAPACK_LIBRARY) + +#TARGETS +if(CLAPACK_FOUND AND NOT TARGET clapack::clapack) + if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}") + add_library(clapack::clapack SHARED IMPORTED) + set_target_properties(clapack::clapack PROPERTIES + IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}" + IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}" + INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "$<$>:${oF2C_LIBRARY_RELEASE}>;$<$:${oF2C_LIBRARY_DEBUG}>;$<$>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$:${LAPACK_BLAS_LIBRARY_DEBUG}>;$;$" + IMPORTED_CONFIGURATIONS Release + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}") + set_property(TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug) + set_target_properties(clapack::clapack PROPERTIES + IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}" + IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}") + endif() + else() + add_library(clapack::clapack UNKNOWN IMPORTED) + set_target_properties(clapack::clapack PROPERTIES + IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}" + INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "$<$>:${oF2C_LIBRARY_RELEASE}>;$<$:${oF2C_LIBRARY_DEBUG}>;$<$>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$:${LAPACK_BLAS_LIBRARY_DEBUG}>;$;$" + IMPORTED_CONFIGURATIONS Release + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + if(EXISTS "${LAPACK_LIBRARY_DEBUG}") + set_property(TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug) + set_target_properties(clapack::clapack PROPERTIES + IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}") + endif() + endif() +endif() + +if(CLAPACK_FOUND AND NOT TARGET lapack) + if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}") + add_library(lapack SHARED IMPORTED) + set_target_properties(lapack PROPERTIES + IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}" + IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}" + INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "$<$>:${oF2C_LIBRARY_RELEASE}>;$<$:${oF2C_LIBRARY_DEBUG}>;$<$>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$:${LAPACK_BLAS_LIBRARY_DEBUG}>;$;$" + IMPORTED_CONFIGURATIONS Release + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}") + set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug) + set_target_properties(lapack PROPERTIES + IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}" + IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}") + endif() + else() + add_library(lapack UNKNOWN IMPORTED) + set_target_properties(lapack PROPERTIES + IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}" + INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}" + IMPORTED_CONFIGURATIONS Release + INTERFACE_LINK_LIBRARIES "$<$>:${oF2C_LIBRARY_RELEASE}>;$<$:${oF2C_LIBRARY_DEBUG}>;$<$>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$:${LAPACK_BLAS_LIBRARY_DEBUG}>;$;$" + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + if(EXISTS "${LAPACK_LIBRARY_DEBUG}") + set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug) + set_target_properties(lapack PROPERTIES + IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}") + endif() + endif() +endif() diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 1de30b1093869a..35638748877253 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -1,3 +1,7 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/share/lapack-reference/copyright") + message(FATAL_ERROR "Can't build ${PORT} if lapack-reference is installed. Please remove lapack-reference:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again.") +endif() + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_download_distfile(ARCHIVE @@ -11,7 +15,7 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES remove_internal_blas.patch - fix-ConfigFile.patch + fix-ConfigFile.patch fix-install.patch support-uwp.patch ) @@ -37,11 +41,10 @@ vcpkg_copy_pdbs() #TODO: fix the official exported targets, since they are broken (luckily it seems that no-one uses them for now) vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack) -#we install a cmake wrapper since the official FindLAPACK module in cmake does find clapack easily, unfortunately... -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Install clapack wrappers. +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake index 26a0a1624b854d..cb2e08fdfad6d6 100644 --- a/ports/clapack/vcpkg-cmake-wrapper.cmake +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -1,2 +1,11 @@ -include(${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake) +message(STATUS "Using VCPKG FindLAPACK from package 'clapack'") +set(LAPACK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +list(REMOVE_ITEM ARGS "NO_MODULE") +list(REMOVE_ITEM ARGS "CONFIG") +list(REMOVE_ITEM ARGS "MODULE") + +_find_package(${ARGS}) + +set(CMAKE_MODULE_PATH ${LAPACK_PREV_MODULE_PATH}) diff --git a/ports/cli/CONTROL b/ports/cli/CONTROL index b84813e2ff34c6..8cda2750e5957e 100644 --- a/ports/cli/CONTROL +++ b/ports/cli/CONTROL @@ -1,5 +1,5 @@ Source: cli -Version: 1.2.0 +Version: 1.2.1 Homepage: https://github.com/daniele77/cli Description: A library for interactive command line interfaces in modern C++ Build-Depends: boost-asio diff --git a/ports/cli/portfile.cmake b/ports/cli/portfile.cmake index 77813db666b97b..134c718293bff1 100644 --- a/ports/cli/portfile.cmake +++ b/ports/cli/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO daniele77/cli - REF v1.2.0 - SHA512 ff548cbc1a77ded32f67d0ff4740d2abb31226cb6f0d9d431e1a35dcdfcaf68a2b9e16e926fc88f19aa17f5c6f5f8e2aead83ff65d7557c192bdd7d4ce2a2d3e + REF v1.2.1 + SHA512 fc834608ac2ca6c3f330711c80897cc581eb1ed8da7a0d56a07efe6650d871f5317c777a6a029fdc0177684f08479bd129cc0ce748354bac3dbe6af79a390d14 HEAD_REF master ) @@ -17,4 +15,4 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/cli) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cli RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cli11/CONTROL b/ports/cli11/CONTROL index 1f0f0c551e9ce5..e9e64abc69ae0e 100644 --- a/ports/cli11/CONTROL +++ b/ports/cli11/CONTROL @@ -1,4 +1,4 @@ Source: cli11 -Version: 1.9.0 +Version: 1.9.1 Description: CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface. Homepage: https://github.com/CLIUtils/CLI11 diff --git a/ports/cli11/portfile.cmake b/ports/cli11/portfile.cmake index aef2cf0d5d0bc6..69f0a26fe6c2d7 100644 --- a/ports/cli11/portfile.cmake +++ b/ports/cli11/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CLIUtils/CLI11 - REF dd0d8e4fe729e5b1110232c7a5c9566dad884686 #version 1.9.0 - SHA512 dccee89de994d17537b31db717d0f42cae8827a192067718641a6e9e3188f468047a86ce329781142b9c7a1216d5eedcfe975fdbd001f40005a8ab50e08470d9 + REF 2b059cbdbe844450e1675a5dda3cb8acb1147631 #version 1.9.1 + SHA512 8b7999ae3692ccb7b324bef033ad4cedccbf720b904aa3aa8d07d1cbc8f09f4ecbd9701d2a50a6266f81fe877e30a63a3b6e07d746fa738291b07476405e866d HEAD_REF master ) diff --git a/ports/cmocka/CONTROL b/ports/cmocka/CONTROL deleted file mode 100644 index 090b8ca799a435..00000000000000 --- a/ports/cmocka/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: cmocka -Version: 1.1.5 -Port-Version: 3 -Description: An elegant unit testing framework for C with support for mock objects diff --git a/ports/cmocka/fix-uwp.patch b/ports/cmocka/fix-uwp.patch deleted file mode 100644 index cb3828b1c2cd47..00000000000000 --- a/ports/cmocka/fix-uwp.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmocka.c b/src/cmocka.c -index 6bfc831..4c1c04b 100644 ---- a/src/cmocka.c -+++ b/src/cmocka.c -@@ -3356,7 +3356,7 @@ int _run_tests(const UnitTest * const tests, const size_t number_of_tests) { - int _run_group_tests(const UnitTest * const tests, const size_t number_of_tests) - { - UnitTestFunction setup = NULL; -- const char *setup_name; -+ const char *setup_name = NULL; - size_t num_setups = 0; - UnitTestFunction teardown = NULL; - const char *teardown_name = NULL; diff --git a/ports/cmocka/portfile.cmake b/ports/cmocka/portfile.cmake index a448d3a70c58a8..220868ebb3ec26 100644 --- a/ports/cmocka/portfile.cmake +++ b/ports/cmocka/portfile.cmake @@ -1,28 +1,20 @@ -include(vcpkg_common_functions) - vcpkg_from_gitlab( GITLAB_URL https://gitlab.com OUT_SOURCE_PATH SOURCE_PATH REPO cmocka/cmocka - REF cmocka-1.1.5 - SHA512 4e305e500f448676be5503972c49089c51f38b47d8129add2205608ed73f9de8b911aee83c00da4ef52c0179a5b5ba0e3386f3bca839f18e7ab21787184d9990 + REF 672c5cee79eb412025c3dd8b034e611c1f119055 + SHA512 e02ffe780698ce3930aceb1b927f7d48c932c6bb251a32b1f4ab44ecb4ff6bfe5c2a6b9e2dfede49cd4cc1d68a8bb903ef1d26c28536abf3581a9d803287aa0a HEAD_REF master - PATCHES - shared-lib.patch - static-lib.patch - fix-uwp.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIB) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DWITH_CMOCKERY_SUPPORT=ON -DUNIT_TESTING=OFF -DWITH_EXAMPLES=OFF - -DBUILD_STATIC_LIB=${BUILD_STATIC_LIB} - -DWITH_STATIC_LIB=${BUILD_STATIC_LIB} + -DPICKY_DEVELOPER=OFF ) vcpkg_install_cmake() @@ -31,18 +23,6 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -file(COPY - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - -# Install usage -configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# CMake integration test -#vcpkg_test_cmake(PACKAGE_NAME ${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cmocka/shared-lib.patch b/ports/cmocka/shared-lib.patch deleted file mode 100644 index 8c2f76277bd66f..00000000000000 --- a/ports/cmocka/shared-lib.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5684685..8555169 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,7 +30,7 @@ if (WIN32) - cmocka.def - ) - endif (WIN32) -- -+if (BUILD_SHARED_LIBS) - add_library(${CMOCKA_SHARED_LIBRARY} SHARED ${cmocka_SRCS}) - - target_include_directories(${CMOCKA_SHARED_LIBRARY} -@@ -82,7 +82,7 @@ install(TARGETS - ${CMAKE_INSTALL_BINDIR} - COMPONENT - ${PROJECT_NAME}) -- -+endif (BUILD_SHARED_LIBS) - if (BUILD_STATIC_LIB) - add_library(${CMOCKA_STATIC_LIBRARY} STATIC ${cmocka_SRCS}) - diff --git a/ports/cmocka/static-lib.patch b/ports/cmocka/static-lib.patch deleted file mode 100644 index f879fe25bd1f75..00000000000000 --- a/ports/cmocka/static-lib.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 00e568e..6e3489a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -77,9 +77,17 @@ install( - - # cmake config files - if (WIN32) -+ if (BUILD_SHARED_LIBS) - set(CMOCKA_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}) -+ else() -+ set(CMOCKA_LIBRARY_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}${CMOCKA_STATIC_LIBRARY}${CMAKE_IMPORT_LIBRARY_SUFFIX}) -+ endif() - else() -+ if (BUILD_SHARED_LIBS) - set(CMOCKA_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ else() -+ set(CMOCKA_LIBRARY_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}${CMOCKA_STATIC_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}) -+ endif() - endif() - - set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE INTERNAL "") diff --git a/ports/cmocka/usage b/ports/cmocka/usage deleted file mode 100644 index 59f2a5da8b63b4..00000000000000 --- a/ports/cmocka/usage +++ /dev/null @@ -1,5 +0,0 @@ -The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: - - find_package(@PORT@ CONFIG REQUIRED) - target_include_directories(main PRIVATE ${CMOCKA_INCLUDE_DIR}) - target_link_libraries(main PRIVATE ${CMOCKA_LIBRARIES}) diff --git a/ports/cmocka/vcpkg-cmake-wrapper.cmake b/ports/cmocka/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 49b486ff83b493..00000000000000 --- a/ports/cmocka/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,10 +0,0 @@ -_find_package(${ARGS}) - -get_filename_component(_cmocka_lib_name ${CMOCKA_LIBRARY} NAME) - -set(CMOCKA_LIBRARY - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/${_cmocka_lib_name} - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/${_cmocka_lib_name} -) - -set(CMOCKA_LIBRARIES ${CMOCKA_LIBRARY}) diff --git a/ports/cmocka/vcpkg.json b/ports/cmocka/vcpkg.json new file mode 100644 index 00000000000000..d7bcbcf49635a2 --- /dev/null +++ b/ports/cmocka/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "cmocka", + "version-string": "2020-08-01", + "description": "An elegant unit testing framework for C with support for mock objects", + "homepage": "https://cmocka.org/", + "license": "Apache-2.0" +} diff --git a/ports/colmap/portfile.cmake b/ports/colmap/portfile.cmake new file mode 100644 index 00000000000000..6b9bf3284c4af2 --- /dev/null +++ b/ports/colmap/portfile.cmake @@ -0,0 +1,89 @@ +set(COLMAP_REF "3.6") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO colmap/colmap + REF ${COLMAP_REF} + SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632 + HEAD_REF dev +) + +if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES)) + message(FATAL_ERROR "Feature cuda and cuda-redist require x64 triplet.") +endif() + +# set GIT_COMMIT_ID and GIT_COMMIT_DATE +if(DEFINED VCPKG_HEAD_VERSION) + set(GIT_COMMIT_ID "${VCPKG_HEAD_VERSION}") +else() + set(GIT_COMMIT_ID "${COLMAP_REF}") +endif() + +string(TIMESTAMP COLMAP_GIT_COMMIT_DATE "%Y-%m-%d") + +set(CUDA_ENABLED OFF) +set(TESTS_ENABLED OFF) + +if("cuda" IN_LIST FEATURES) + set(CUDA_ENABLED ON) +endif() + +if("cuda-redist" IN_LIST FEATURES) + set(CUDA_ENABLED ON) + set(CUDA_ARCHS "Common") +endif() + +if("tests" IN_LIST FEATURES) + set(TESTS_ENABLED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCUDA_ENABLED=${CUDA_ENABLED} + -DCUDA_ARCHS=${CUDA_ARCHS} + -DTESTS_ENABLED=${TESTS_ENABLED} + -DGIT_COMMIT_ID=${GIT_COMMIT_ID} + -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*") +foreach(TOOL_FILENAME ${TOOL_FILENAMES}) + get_filename_component(TEST_TOOL_NAME ${TOOL_FILENAME} NAME_WLE) + list(APPEND COLMAP_TOOL_NAMES "${TEST_TOOL_NAME}") +endforeach() + +vcpkg_copy_tools(TOOL_NAMES ${COLMAP_TOOL_NAMES} AUTO_CLEAN) + +# remove empty folders and unused files +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/lib/Graclus/multilevelLib + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/tools + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/media + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/shaders + ${CURRENT_PACKAGES_DIR}/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib + ${CURRENT_PACKAGES_DIR}/include/colmap/tools + ${CURRENT_PACKAGES_DIR}/include/colmap/ui/media + ${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders + ${CURRENT_PACKAGES_DIR}/COLMAP.bat + ${CURRENT_PACKAGES_DIR}/RUN_TESTS.bat + ${CURRENT_PACKAGES_DIR}/debug/COLMAP.bat + ${CURRENT_PACKAGES_DIR}/debug/RUN_TESTS.bat + ${CURRENT_PACKAGES_DIR}/debug/bin +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) diff --git a/ports/colmap/usage b/ports/colmap/usage new file mode 100644 index 00000000000000..b71316b3cf81a3 --- /dev/null +++ b/ports/colmap/usage @@ -0,0 +1,10 @@ +For example, under Windows, execute COLMAP as: + + \packages\colmap_\tools\colmap\colmap.exe gui + \packages\colmap_\tools\colmap\colmap.exe mapper + \packages\colmap_\tools\colmap\colmap.exe ... + +The package colmap provides CMake integration: + + find_package(COLMAP REQUIRED) + target_link_libraries(main ${COLMAP_LIBRARIES}) diff --git a/ports/colmap/vcpkg.json b/ports/colmap/vcpkg.json new file mode 100644 index 00000000000000..565e945baba8e5 --- /dev/null +++ b/ports/colmap/vcpkg.json @@ -0,0 +1,55 @@ +{ + "name": "colmap", + "version-string": "3.6", + "description": "COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. It offers a wide range of features for reconstruction of ordered and unordered image collections. The software is licensed under the new BSD license.", + "homepage": "https://colmap.github.io/", + "license": "BSD-3-Clause", + "dependencies": [ + "boost-filesystem", + "boost-graph", + "boost-program-options", + "boost-regex", + "boost-system", + "boost-test", + { + "name": "ceres", + "features": [ + "lapack", + "suitesparse" + ] + }, + { + "name": "cgal", + "features": [ + "qt" + ] + }, + "eigen3", + "freeimage", + "gflags", + "glew", + "glog", + "qt5-base", + "suitesparse" + ], + "features": [ + { + "name": "cuda", + "description": "CUDA support for current compute architecture of this machine.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "cuda-redist", + "description": "Redistributable CUDA support for common supported compute architectures.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "tests", + "description": "Enable TESTS." + } + ] +} diff --git a/ports/constexpr-contracts/CONTROL b/ports/constexpr-contracts/CONTROL new file mode 100644 index 00000000000000..515b9b2b56907f --- /dev/null +++ b/ports/constexpr-contracts/CONTROL @@ -0,0 +1,4 @@ +Source: constexpr-contracts +Version: 2020-08-09 +Homepage: https://github.com/cjdb/constexpr-contracts +Description: A constexpr-friendly, optimisation-friendly contracts library. diff --git a/ports/constexpr-contracts/portfile.cmake b/ports/constexpr-contracts/portfile.cmake new file mode 100644 index 00000000000000..d189ba43d9e5a1 --- /dev/null +++ b/ports/constexpr-contracts/portfile.cmake @@ -0,0 +1,20 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cjdb/constexpr-contracts + REF 58154e9010cb80aad4e95ef6f1835ebd7db3780a # commit 2020-05-25 + SHA512 b634267a4044cd712c8e52f65cd305f437864cab591f2b22104581f70b305ba52889dd46724e6047386463a010ee78fdd951411ea3691b5725d52d13f7adda76 + HEAD_REF main +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/constexpr-contracts) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/coroutine/CONTROL b/ports/coroutine/CONTROL deleted file mode 100644 index 13fa58ab2a58f2..00000000000000 --- a/ports/coroutine/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: coroutine -Homepage: https://github.com/luncliff/coroutine -Version: 1.5.0 -Build-Depends: ms-gsl -Description: C++ 20 Coroutines helper/example library -Supports: !uwp diff --git a/ports/coroutine/fix-errorC7651.patch b/ports/coroutine/fix-errorC7651.patch new file mode 100644 index 00000000000000..42c4291a500006 --- /dev/null +++ b/ports/coroutine/fix-errorC7651.patch @@ -0,0 +1,68 @@ +diff --git a/modules/portable/frame.cpp b/modules/portable/frame.cpp +index 2cedf81..f413f28 100644 +--- a/modules/portable/frame.cpp ++++ b/modules/portable/frame.cpp +@@ -77,13 +77,31 @@ size_t _coro_done(void*); + // + // intrinsic: Clang/GCC + // +-extern "C" { +-bool __builtin_coro_done(void*); +-void __builtin_coro_resume(void*); +-void __builtin_coro_destroy(void*); +-// void* __builtin_coro_promise(void* ptr, int align, bool p); ++//extern "C" { ++template ++void resume_wrapper(void *p) ++{ ++ if constexpr (B) ++ __builtin_coro_resume(p); ++} ++ ++template ++void destroy_wrapper(void *p) ++{ ++ if constexpr(B) ++ __builtin_coro_destroy(p); + } + ++template ++bool done_wrapper(void *p) ++{ ++ if constexpr(B) ++ return __builtin_coro_done(p); ++ return false; ++} ++// void* __builtin_coro_promise(void* ptr, int align, bool p); ++//} ++ + bool _coro_finished(portable_coro_prefix* _Handle); + + #if defined(__clang__) +@@ -124,7 +142,7 @@ bool portable_coro_done(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + return _coro_finished(_Handle); + } else if constexpr (is_clang) { +- return __builtin_coro_done(_Handle); ++ return done_wrapper(_Handle); + } + return false; // follow `noop_coroutine` + } +@@ -133,7 +151,7 @@ void portable_coro_resume(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + _coro_resume(_Handle); + } else if constexpr (is_clang) { +- __builtin_coro_resume(_Handle); ++ resume_wrapper(_Handle); + } + } + +@@ -141,7 +159,7 @@ void portable_coro_destroy(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + _coro_destroy(_Handle); + } else if constexpr (is_clang) { +- __builtin_coro_destroy(_Handle); ++ destroy_wrapper(_Handle); + } + } + diff --git a/ports/coroutine/portfile.cmake b/ports/coroutine/portfile.cmake index 26abb7bf7a3ffe..3c5f27b72caaab 100644 --- a/ports/coroutine/portfile.cmake +++ b/ports/coroutine/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( REF 1.5.0 SHA512 61b91fdc641b6905b884e99c5bf193ec2cf6962144ab3baafdb9432115757d96f3797f116b30356f0d21417b23082bc908f75042721caeab3329c4910b654594 HEAD_REF master + PATCHES fix-errorC7651.patch ) vcpkg_configure_cmake( diff --git a/ports/coroutine/vcpkg.json b/ports/coroutine/vcpkg.json new file mode 100644 index 00000000000000..4e71341284ef76 --- /dev/null +++ b/ports/coroutine/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "coroutine", + "version-string": "1.5.0", + "port-version": 1, + "description": "C++ 20 Coroutines helper/example library", + "homepage": "https://github.com/luncliff/coroutine", + "supports": "!uwp", + "dependencies": [ + "ms-gsl" + ] +} diff --git a/ports/cpp-taskflow/CONTROL b/ports/cpp-taskflow/CONTROL index ee3e33ed041cb1..72ef86c8ec1f0f 100644 --- a/ports/cpp-taskflow/CONTROL +++ b/ports/cpp-taskflow/CONTROL @@ -1,4 +1,4 @@ Source: cpp-taskflow -Version: 2.2.0-1 +Version: 2.5.0 Description: Fast Parallel Tasking Programming Library using Modern C++. Homepage: https://github.com/taskflow/taskflow diff --git a/ports/cpp-taskflow/fix-compiler-error.patch b/ports/cpp-taskflow/fix-compiler-error.patch new file mode 100644 index 00000000000000..1bcdcd41f8eb0e --- /dev/null +++ b/ports/cpp-taskflow/fix-compiler-error.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9beec931..6782f1d5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -89,7 +89,7 @@ target_compile_options( + $<$:-Wall -Wextra -Wfatal-errors> + $<$,$>:-Wall -Wextra -Wfatal-errors> + $<$,$>:-Wall -Wextra -Wfatal-errors> +- $<$,$>:/W3 /permissive-> ++ $<$,$>:/bigobj /W3 /permissive-> + #$<$:-Xcompiler=-Wall,-Wextra,-Wfatal-errors> + #$<$:-Wall -Wextra -Wfatal-errors> + #$<$:-Wall -Wextra -Wfatal-errors> +@@ -219,6 +219,8 @@ target_include_directories(${PROJECT_NAME} INTERFACE + # Example program + # ----------------------------------------------------------------------------- + ++if(BUILD_TEST) ++ + message(STATUS "Building examples ...") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TF_EXAMPLE_DIR}) + +@@ -617,6 +619,8 @@ add_test(cuda_kmeans.1000.16C16G ${TF_UTEST_CUDA_KMEANS} -tc=kmeans.1000.16C16G) + + endif(CMAKE_CUDA_COMPILER) + ++endif() ++ + # ----------------------------------------------------------------------------- + # Benchmarking (enabled by TF_BUILD_BENCHMARKS) + # ----------------------------------------------------------------------------- diff --git a/ports/cpp-taskflow/portfile.cmake b/ports/cpp-taskflow/portfile.cmake index 8e2964337e79a9..735a08d47bfcf0 100644 --- a/ports/cpp-taskflow/portfile.cmake +++ b/ports/cpp-taskflow/portfile.cmake @@ -2,9 +2,10 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO taskflow/taskflow - REF v2.2.0 - SHA512 1aa4e9d7324f56eb33cd4986d721035f0abf12e022da956bafc0b16cf6cb82d152334ae58edc4581ab2f6d44989ca21cdd590ad560d6f1a4f905710fe08d0091 + REF v2.5.0 + SHA512 49f38a14a207db085a2e3581b3698cdb3be4fa65c11194db454bd2fb65da2d744347c6a10a7a903b04cc2dd5cac65ef389d400c66d2a23521c3bbe2283357890 HEAD_REF master + PATCHES fix-compiler-error.patch ) vcpkg_configure_cmake( @@ -12,8 +13,9 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DTF_BUILD_EXAMPLES=OFF - -DTF_BUILD_TESTS=OFF + -DBUILD_TESTING=OFF -DTF_BUILD_BENCHMARKS=OFF + -DCMAKE_CUDA_COMPILER=OFF ) vcpkg_install_cmake() @@ -23,4 +25,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) # Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cppad/CONTROL b/ports/cppad/CONTROL new file mode 100644 index 00000000000000..f38cfd121b4da8 --- /dev/null +++ b/ports/cppad/CONTROL @@ -0,0 +1,5 @@ +Source: cppad +Version: 20200000.3 +Homepage: https://github.com/coin-or/CppAD +Description: CppAD: A Package for Differentiation of C++ Algorithms +Supports: !(arm|uwp) diff --git a/ports/cppad/pkgconfig-fix.patch b/ports/cppad/pkgconfig-fix.patch new file mode 100644 index 00000000000000..6688fc9d7f90f1 --- /dev/null +++ b/ports/cppad/pkgconfig-fix.patch @@ -0,0 +1,63 @@ +diff --git a/pkgconfig/CMakeLists.txt b/pkgconfig/CMakeLists.txt +index db8b65902..b1224a01d 100644 +--- a/pkgconfig/CMakeLists.txt ++++ b/pkgconfig/CMakeLists.txt +@@ -42,8 +42,9 @@ ENDIF( cppad_has_ipopt ) + # cppad_pkgconfig_cflags + # cppad_pkgconfig_cflags_uninstalled + # +-SET(cppad_pkgconfig_cflags "-I${cppad_abs_includedir}" ) +-SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) ++SET(cppad_pkgconfig_includedir "${cmake_install_includedirs}" ) ++SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) ++SET(cppad_pkgconfig_libdir "${cmake_install_libdirs}" ) + # ---------------------------------------------------------------------------- + # cppad_pkgconfig_libs + # cppad_pkgconfig_libs_uninstalled +@@ -74,7 +75,7 @@ IF( "${libs}" STREQUAL "" ) + SET(cppad_pkgconfig_libs "") + SET(cppad_pkgconfig_libs_uninstalled "") + ELSE( "${libs}" STREQUAL "" ) +- SET(cppad_pkgconfig_libs "-L${cppad_abs_libdir} ${libs}") ++ SET(cppad_pkgconfig_libs "-L\${libdir} ${libs}") + SET(cppad_pkgconfig_libs_uninstalled "${uninstalled} ${libs}") + ENDIF( "${libs}" STREQUAL "" ) + # +@@ -84,10 +85,12 @@ ENDIF( "${libs}" STREQUAL "" ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/cppad.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc ++ @ONLY + ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/cppad-uninstalled.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/cppad-uninstalled.pc ++ @ONLY + ) + # During install copy cppad.pc to datadir and libdir + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc +diff --git a/pkgconfig/cppad.pc.in b/pkgconfig/cppad.pc.in +index a202e3fb3..1c34c1e08 100644 +--- a/pkgconfig/cppad.pc.in ++++ b/pkgconfig/cppad.pc.in +@@ -12,12 +12,19 @@ + # This file is used with pkg-config to include CppAD after it is installed + # + # Entries set by top source directory CMakeLists.txt file ++ ++prefix=${pcfiledir}/../.. ++exec_prefix=${prefix} ++libdir=${exec_prefix}/@cppad_pkgconfig_libdir@ ++includedir=${prefix}/@cppad_pkgconfig_includedir@ ++ + Name: cppad + Description: @cppad_description@ + Version: @cppad_version@ + URL: @cppad_url@ ++ + # + # Entries set by pkgconfig/CMakeLists.txt file +-Cflags: @cppad_pkgconfig_cflags@ ++Cflags: -I${includedir} + Libs: @cppad_pkgconfig_libs@ + Requires: @cppad_pkgconfig_requires@ diff --git a/ports/cppad/portfile.cmake b/ports/cppad/portfile.cmake new file mode 100644 index 00000000000000..1c9fc8ddf4e45e --- /dev/null +++ b/ports/cppad/portfile.cmake @@ -0,0 +1,42 @@ +# the compilation fails on arm and uwp. Please check the related issue: +# https://github.com/microsoft/vcpkg/pull/12560#issuecomment-668412073 +vcpkg_fail_port_install(ON_TARGET "uwp" and "arm") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO coin-or/CppAD + REF 20200000.3 + SHA512 4e980665a21c76cf355d1c5597c65fbfba7ac3e15c43a88ccfe3ba0267b85b4e9aa7c6e8a0ed7a728f8cf2c6e1424625d5cbcdd295a6c0a08b47b4b121572d13 + HEAD_REF master + PATCHES + windows-fix.patch + pkgconfig-fix.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -Dcppad_prefix=${CURRENT_PACKAGES_DIR} + OPTIONS_RELEASE + -Dcmake_install_libdirs=lib + -Dcppad_debug_which:STRING=debug_none + OPTIONS_DEBUG + -Dcmake_install_libdirs=debug/lib +) + +vcpkg_install_cmake() + +# Install the pkgconfig file +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +endif() + +vcpkg_fixup_pkgconfig() + +# Add the copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cppad/windows-fix.patch b/ports/cppad/windows-fix.patch new file mode 100644 index 00000000000000..50c38ca12307e6 --- /dev/null +++ b/ports/cppad/windows-fix.patch @@ -0,0 +1,105 @@ +diff --git a/cppad_lib/cppad_colpack.cpp b/cppad_lib/cppad_colpack.cpp +index dc3327053..739363292 100644 +--- a/cppad_lib/cppad_colpack.cpp ++++ b/cppad_lib/cppad_colpack.cpp +@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + + # if CPPAD_HAS_COLPACK == 0 + namespace CppAD { namespace local { +- CPPAD_LIB_EXPORT void this_routine_should_never_get_called(void) ++ void this_routine_should_never_get_called(void) + { CPPAD_ASSERT_UNKNOWN(false); } + } } + # else // CPPAD_HAS_COLPACK +@@ -52,7 +52,7 @@ the entry with index (i, adolc_pattern[i][k]) is a non-zero + in the sparsity pattern for the matrix. + */ + // ---------------------------------------------------------------------- +-CPPAD_LIB_EXPORT void cppad_colpack_general( ++void cppad_colpack_general( + CppAD::vector& color , + size_t m , + size_t n , +@@ -164,7 +164,7 @@ For i = 0 , ... , m-1, and for k = 1, ... ,adolc_pattern[i][0], + the entry with index (i, adolc_pattern[i][k]) is + in the sparsity pattern for the symmetric matrix. + */ +-CPPAD_LIB_EXPORT void cppad_colpack_symmetric( ++void cppad_colpack_symmetric( + CppAD::vector& color , + size_t m , + const CppAD::vector& adolc_pattern ) +diff --git a/cppad_lib/json_parser.cpp b/cppad_lib/json_parser.cpp +index fac417d9f..ac0910cee 100644 +--- a/cppad_lib/json_parser.cpp ++++ b/cppad_lib/json_parser.cpp +@@ -20,7 +20,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + // documentation for this routine is in the file below + # include + +-CPPAD_LIB_EXPORT void CppAD::local::graph::json_parser( ++void CppAD::local::graph::json_parser( + const std::string& json , + cpp_graph& graph_obj ) + { using std::string; +diff --git a/cppad_lib/json_writer.cpp b/cppad_lib/json_writer.cpp +index 250345c6e..add4b20a9 100644 +--- a/cppad_lib/json_writer.cpp ++++ b/cppad_lib/json_writer.cpp +@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + // documentation for this routine is in the file below + # include + +-CPPAD_LIB_EXPORT void CppAD::local::graph::json_writer( ++void CppAD::local::graph::json_writer( + std::string& json , + const cpp_graph& graph_obj ) + { using std::string; +diff --git a/include/cppad/local/cppad_colpack.hpp b/include/cppad/local/cppad_colpack.hpp +index ee96ab5fe..6dd022180 100644 +--- a/include/cppad/local/cppad_colpack.hpp ++++ b/include/cppad/local/cppad_colpack.hpp +@@ -59,7 +59,7 @@ it is not the case that both + This routine tries to minimize, with respect to the choice of colors, + the number of colors. + */ +-extern void cppad_colpack_general( ++CPPAD_LIB_EXPORT void cppad_colpack_general( + CppAD::vector& color , + size_t m , + size_t n , +@@ -91,7 +91,7 @@ The properties of this coloring have not yet been determined; see + Efficient Computation of Sparse Hessians Using Coloring + and Automatic Differentiation (pdf/ad/gebemedhin14.pdf) + */ +-extern void cppad_colpack_symmetric( ++CPPAD_LIB_EXPORT void cppad_colpack_symmetric( + CppAD::vector& color , + size_t n , + const CppAD::vector& adolc_pattern +diff --git a/include/cppad/local/graph/json_parser.hpp b/include/cppad/local/graph/json_parser.hpp +index 17bcc7c7e..a28d2c045 100644 +--- a/include/cppad/local/graph/json_parser.hpp ++++ b/include/cppad/local/graph/json_parser.hpp +@@ -42,7 +42,7 @@ Upon return it is a $cref cpp_ad_graph$$ representation of this function. + $head Prototype$$ + $srccode%hpp% */ + namespace CppAD { namespace local { namespace graph { +- void json_parser( ++ CPPAD_LIB_EXPORT void json_parser( + const std::string& json , + cpp_graph& graph_obj + ); +diff --git a/include/cppad/local/graph/json_writer.hpp b/include/cppad/local/graph/json_writer.hpp +index 36a4cb39f..299c56cc0 100644 +--- a/include/cppad/local/graph/json_writer.hpp ++++ b/include/cppad/local/graph/json_writer.hpp +@@ -41,7 +41,7 @@ This is a $code cpp_graph$$ object. + $head Prototype$$ + $srccode%hpp% */ + namespace CppAD { namespace local { namespace graph { +- void json_writer( ++ CPPAD_LIB_EXPORT void json_writer( + std::string& json , + const cpp_graph& graph_obj + ); diff --git a/ports/cpu-features/portfile.cmake b/ports/cpu-features/portfile.cmake new file mode 100644 index 00000000000000..e50d5ef1405046 --- /dev/null +++ b/ports/cpu-features/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/cpu_features + REF b9593c8b395318bb2bc42683a94f962564cc4664 # 0.4.1 + SHA512 8c12b50741e2979a32b69c788934bee0d00811b7662006c8b493e98d5efeada67ed59460be40c234b2d3bafd85671cb1a1d7c1a6ee535a7fc1cc6ac56a754576 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CpuFeatures TARGET_PATH share/CpuFeatures) + +if("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES list_cpu_features) +endif() +vcpkg_clean_executables_in_bin(FILE_NAMES list_cpu_features) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cpu-features/vcpkg.json b/ports/cpu-features/vcpkg.json new file mode 100644 index 00000000000000..f773cf60b4414e --- /dev/null +++ b/ports/cpu-features/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "cpu-features", + "version-string": "0.4.1", + "description": "A cross-platform C library to retrieve CPU features (such as available instructions) at runtime", + "homepage": "https://github.com/google/cpu_features", + "license": "Apache-2.0", + "supports": "!(arm | uwp)", + "features": [ + { + "name": "tools", + "description": "list_cpu_features command line tool" + } + ] +} diff --git a/ports/crashrpt/001-add-install-target-and-find-deps.patch b/ports/crashrpt/001-add-install-target-and-find-deps.patch new file mode 100644 index 00000000000000..2d983800d4a58a --- /dev/null +++ b/ports/crashrpt/001-add-install-target-and-find-deps.patch @@ -0,0 +1,809 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44d7df0..ed9e3d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,9 @@ set (CRASHRPT_VER 1403) + # Build options + option(CRASHRPT_BUILD_SHARED_LIBS "If set (default), CrashRpt modules are built as dynamic-link libraries, otherwise as static libs." ON) + option(CRASHRPT_LINK_CRT_AS_DLL "If set (default), CrashRpt modules link C run-time (CRT) as multi-threaded dynamic libraries, otherwise as multi-threaded static libs." ON) ++option(CRASHRPT_BUILD_PROBE "If set (default), CrashRpt builds the CrashRptProbe project." ON) ++option(CRASHRPT_BUILD_DEMOS "If set (default), CrashRpt builds the demo projects." ON) ++option(CRASHRPT_BUILD_TESTS "If set (default), CrashRpt builds the test projects." ON) + + # Set output directory for executable files + if(CMAKE_CL_64) +@@ -94,19 +97,65 @@ macro(fix_default_compiler_settings_) + + endmacro() + ++find_package(ZLIB REQUIRED) ++find_package(PNG REQUIRED) ++find_package(Ogg REQUIRED) ++find_package(JPEG REQUIRED) ++ ++find_library(THEORA_LIBRARY theora) ++if(NOT THEORA_LIBRARY) ++ message(FATAL_ERROR "theora library not found") ++endif() ++ ++find_path(THEORA_INCLUDE_DIR theora/theora.h) ++if(NOT THEORA_INCLUDE_DIR) ++ message(FATAL_ERROR "theora include dir not found") ++endif() ++ ++find_library(TINYXML_LIBRARY NAMES tinyxml) ++if(NOT TINYXML_LIBRARY) ++ message(FATAL_ERROR "tinyxml library not found") ++endif() ++ ++find_path(TINYXML_INCLUDE_DIR tinyxml.h) ++if(NOT TINYXML_INCLUDE_DIR) ++ message(FATAL_ERROR "tinyxml include dir not found") ++endif() ++ ++find_path(WTL_INCLUDE_DIR wtl/atlapp.h) ++if(NOT WTL_INCLUDE_DIR) ++ message(FATAL_ERROR "WTL include dir not found") ++endif() ++ ++find_library(DBGHELP_LIBRARY dbghelp) ++if(NOT DBGHELP_LIBRARY) ++ message(FATAL_ERROR "dbghelp library not found") ++endif() ++ ++find_path(DBGHELP_INCLUDE_DIR dbghelp.h) ++if(NOT DBGHELP_INCLUDE_DIR) ++ message(FATAL_ERROR "dbghelp include dir not found") ++endif() ++ + # Other CMakeLists are located in project subdirectories + ++if(CRASHRPT_BUILD_DEMOS) + add_subdirectory("demos/ConsoleDemo") + add_subdirectory("demos/WTLDemo") + add_subdirectory("demos/MFCDemo") ++endif() + + add_subdirectory("reporting/crashrpt") + add_subdirectory("reporting/crashsender") + ++if(CRASHRPT_BUILD_PROBE) + add_subdirectory("processing/crashrptprobe") + add_subdirectory("processing/crprober") ++endif() + ++if(CRASHRPT_BUILD_TESTS) + add_subdirectory("tests") ++endif() + + # Set output directory for LIB files + if(CMAKE_CL_64) +@@ -117,13 +166,13 @@ else(CMAKE_CL_64) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/thirdparty/lib) + endif(CMAKE_CL_64) + +-add_subdirectory("thirdparty/tinyxml") +-add_subdirectory("thirdparty/jpeg") +-add_subdirectory("thirdparty/libpng") ++#add_subdirectory("thirdparty/tinyxml") ++#add_subdirectory("thirdparty/jpeg") ++#add_subdirectory("thirdparty/libpng") + add_subdirectory("thirdparty/minizip") +-add_subdirectory("thirdparty/zlib") +-add_subdirectory("thirdparty/libogg") +-add_subdirectory("thirdparty/libtheora") ++#add_subdirectory("thirdparty/zlib") ++#add_subdirectory("thirdparty/libogg") ++#add_subdirectory("thirdparty/libtheora") + + + +diff --git a/demos/ConsoleDemo/CMakeLists.txt b/demos/ConsoleDemo/CMakeLists.txt +index e47ef4c..4df7b12 100644 +--- a/demos/ConsoleDemo/CMakeLists.txt ++++ b/demos/ConsoleDemo/CMakeLists.txt +@@ -12,12 +12,12 @@ fix_default_compiler_settings_() + # Add include dir + include_directories(${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg +- ${CMAKE_SOURCE_DIR}/thirdparty/libpng +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml ) ++ ${JPEG_INCLUDE_DIR} ++ ${PNG_INCLUDE_DIRS} ++ ${TINYXML_INCLUDE_DIR} ) + + # Add executable build target + add_executable(ConsoleDemo ${source_files} ${header_files}) +@@ -26,3 +26,7 @@ add_executable(ConsoleDemo ${source_files} ${header_files}) + target_link_libraries(ConsoleDemo CrashRpt) + + set_target_properties(ConsoleDemo PROPERTIES DEBUG_POSTFIX d ) ++ ++install(TARGETS ConsoleDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/MFCDemo/CMakeLists.txt b/demos/MFCDemo/CMakeLists.txt +index a250ecc..ade93cb 100644 +--- a/demos/MFCDemo/CMakeLists.txt ++++ b/demos/MFCDemo/CMakeLists.txt +@@ -44,7 +44,7 @@ if(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" +@@ -53,9 +53,13 @@ else(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" + ) +-endif(CMAKE_CL_64) +\ No newline at end of file ++endif(CMAKE_CL_64) ++ ++install(TARGETS MFCDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/WTLDemo/AboutDlg.h b/demos/WTLDemo/AboutDlg.h +index 83eaac0..e96d1c2 100644 +--- a/demos/WTLDemo/AboutDlg.h ++++ b/demos/WTLDemo/AboutDlg.h +@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #pragma once + #include "stdafx.h" + #include +-#include ++#include + #include "CrashRpt.h" + + class CAboutDlg : public CDialogImpl +diff --git a/demos/WTLDemo/CMakeLists.txt b/demos/WTLDemo/CMakeLists.txt +index 40aaefb..42c0f5a 100644 +--- a/demos/WTLDemo/CMakeLists.txt ++++ b/demos/WTLDemo/CMakeLists.txt +@@ -19,7 +19,7 @@ fix_default_compiler_settings_() + + # Add include dir + include_directories(${CMAKE_SOURCE_DIR}/include +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl) ++ ${WTL_INCLUDE_DIR}) + + # Add executable build target + add_executable(WTLDemo WIN32 ${source_files} ${header_files}) +@@ -36,7 +36,7 @@ if(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" +@@ -45,9 +45,13 @@ else(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" + ) +-endif(CMAKE_CL_64) +\ No newline at end of file ++endif(CMAKE_CL_64) ++ ++install(TARGETS WTLDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/WTLDemo/DocumentDlg.h b/demos/WTLDemo/DocumentDlg.h +index afce8fe..9b47728 100644 +--- a/demos/WTLDemo/DocumentDlg.h ++++ b/demos/WTLDemo/DocumentDlg.h +@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #pragma once + #include "stdafx.h" + #include +-#include ++#include + #include "CrashRpt.h" + + class CDocumentDlg : public CDialogImpl +diff --git a/demos/WTLDemo/WTLDemo.rc b/demos/WTLDemo/WTLDemo.rc +index c651841..71f4b39 100644 +--- a/demos/WTLDemo/WTLDemo.rc ++++ b/demos/WTLDemo/WTLDemo.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/demos/WTLDemo/stdafx.h b/demos/WTLDemo/stdafx.h +index a601446..658d9e5 100644 +--- a/demos/WTLDemo/stdafx.h ++++ b/demos/WTLDemo/stdafx.h +@@ -16,10 +16,10 @@ be found in the Authors.txt file in the root of the source tree. + #pragma once + + // Change these values to use different versions +-#define WINVER 0x0500 ++#define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 +-#define _WIN32_IE 0x0501 +-#define _RICHEDIT_VER 0x0200 ++#define _WIN32_IE 0x0600 ++#define _RICHEDIT_VER 0x0300 + + #include + #if ( _ATL_VER < 0x0800 ) +@@ -52,18 +52,18 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include ++#include ++#include ++#include + + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER>=1400 + #if defined _M_IX86 +diff --git a/processing/crashrptprobe/CMakeLists.txt b/processing/crashrptprobe/CMakeLists.txt +index a6c692a..c513c6d 100644 +--- a/processing/crashrptprobe/CMakeLists.txt ++++ b/processing/crashrptprobe/CMakeLists.txt +@@ -21,11 +21,11 @@ fix_default_compiler_settings_() + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/crashrpt + ${CMAKE_SOURCE_DIR}/reporting/crashsender +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml +- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include) ++ ${TINYXML_INCLUDE_DIR} ++ ${DBGHELP_INCLUDE_DIR}) + + # Add library build target + if(CRASHRPT_BUILD_SHARED_LIBS) +@@ -34,15 +34,15 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + add_library(CrashRptProbe STATIC ${source_files} ${header_files}) + endif(CRASHRPT_BUILD_SHARED_LIBS) + +-if(CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) +- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) +-else(CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) +- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) +-endif(CMAKE_CL_64) ++#if(CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) ++# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) ++#else(CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) ++# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) ++#endif(CMAKE_CL_64) + +-target_link_libraries(CrashRptProbe zlib minizip tinyxml Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) ++target_link_libraries(CrashRptProbe ZLIB::ZLIB minizip ${TINYXML_LIBRARY} ${DBGHELP_LIBRARY} Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) + + if(CRASHRPT_BUILD_SHARED_LIBS) + +@@ -58,4 +58,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + + endif(CRASHRPT_BUILD_SHARED_LIBS) + ++set_target_properties(CrashRptProbe PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRptProbe.h) + ++INSTALL(TARGETS CrashRptProbe ++ PUBLIC_HEADER DESTINATION include/crashrpt ++ LIBRARY ++ ARCHIVE ++ RUNTIME ++) +diff --git a/processing/crashrptprobe/CrashRptProbe.rc b/processing/crashrptprobe/CrashRptProbe.rc +index a08f63e..e12b8e9 100644 +--- a/processing/crashrptprobe/CrashRptProbe.rc ++++ b/processing/crashrptprobe/CrashRptProbe.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/processing/crashrptprobe/stdafx.h b/processing/crashrptprobe/stdafx.h +index 2b027b2..0b60659 100644 +--- a/processing/crashrptprobe/stdafx.h ++++ b/processing/crashrptprobe/stdafx.h +@@ -70,13 +70,13 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + extern CAppModule _Module; + #include + + // CString-related includes + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER<1400 + #define WCSNCPY_S(strDest, sizeInBytes, strSource, count) wcsncpy(strDest, strSource, count) +diff --git a/processing/crprober/CMakeLists.txt b/processing/crprober/CMakeLists.txt +index 046ba57..255e200 100644 +--- a/processing/crprober/CMakeLists.txt ++++ b/processing/crprober/CMakeLists.txt +@@ -18,4 +18,8 @@ add_executable(crprober ${source_files} ${header_files}) + # Add input link libraries + target_link_libraries(crprober CrashRptProbe) + +-set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file ++set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) ++ ++install(TARGETS crprober ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/reporting/crashrpt/CMakeLists.txt b/reporting/crashrpt/CMakeLists.txt +index 42d40e2..c7e4fd6 100644 +--- a/reporting/crashrpt/CMakeLists.txt ++++ b/reporting/crashrpt/CMakeLists.txt +@@ -18,7 +18,7 @@ add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE) + fix_default_compiler_settings_() + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl) ++include_directories( ${CMAKE_SOURCE_DIR}/include ${WTL_INCLUDE_DIR}) + + # Add library build target + if(CRASHRPT_BUILD_SHARED_LIBS) +@@ -55,3 +55,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + RELEASE_POSTFIX LIB ) + endif(CRASHRPT_BUILD_SHARED_LIBS) + ++set_target_properties(CrashRpt PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRpt.h) ++ ++INSTALL(TARGETS CrashRpt ++ PUBLIC_HEADER DESTINATION include/crashrpt ++ LIBRARY ++ ARCHIVE ++ RUNTIME ++) +diff --git a/reporting/crashrpt/CrashRpt.rc b/reporting/crashrpt/CrashRpt.rc +index 95e7502..a8c821b 100644 +--- a/reporting/crashrpt/CrashRpt.rc ++++ b/reporting/crashrpt/CrashRpt.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/reporting/crashrpt/StdAfx.h b/reporting/crashrpt/StdAfx.h +index 77d8c36..13bbe50 100644 +--- a/reporting/crashrpt/StdAfx.h ++++ b/reporting/crashrpt/StdAfx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + #include + #include +@@ -54,12 +54,12 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + extern CAppModule _Module; + #include + // CString-related includes + #define _WTL_USE_CSTRING +-#include ++#include + #include + #include + #include +diff --git a/reporting/crashsender/CMakeLists.txt b/reporting/crashsender/CMakeLists.txt +index 9b444c5..aa4ab8a 100644 +--- a/reporting/crashsender/CMakeLists.txt ++++ b/reporting/crashsender/CMakeLists.txt +@@ -22,27 +22,27 @@ fix_default_compiler_settings_() + # Add include dir + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg +- ${CMAKE_SOURCE_DIR}/thirdparty/libpng +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml +- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include +- ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include +- ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) +- +-if(NOT CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) +-else(NOT CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) +-endif(NOT CMAKE_CL_64) ++ ${ZLIB_INCLUDE_DIRS} ++ ${JPEG_INCLUDE_DIR} ++ ${PNG_INCLUDE_DIRS} ++ ${TINYXML_INCLUDE_DIR} ++ ${DBGHELP_INCLUDE_DIR} ++ ${OGG_INCLUDE_DIRS} ++ ${THEORA_INCLUDE_DIR}) ++ ++#if(NOT CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) ++#else(NOT CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) ++#endif(NOT CMAKE_CL_64) + + # Add executable build target + add_executable(CrashSender WIN32 ${source_files} ${header_files}) + + # Add input link libraries +-target_link_libraries(CrashSender zlib minizip libjpeg libpng tinyxml libogg libtheora WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) ++target_link_libraries(CrashSender ZLIB::ZLIB minizip ${JPEG_LIBRARIES} PNG::PNG ${TINYXML_LIBRARY} Ogg::ogg ${THEORA_LIBRARY} WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) + + # Add compiler flags (/MP for multi-processor compilation, /Os to favor small code) + set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") +@@ -52,4 +52,12 @@ set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") + + set_target_properties(CrashSender PROPERTIES + DEBUG_POSTFIX ${CRASHRPT_VER}d +- RELEASE_POSTFIX ${CRASHRPT_VER} ) +\ No newline at end of file ++ RELEASE_POSTFIX ${CRASHRPT_VER} ) ++ ++install(TARGETS CrashSender ++ RUNTIME DESTINATION tools/crashrpt ++) ++ ++file(GLOB LANG_FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_*.ini") ++install(FILES ${LANG_FILES} DESTINATION tools/crashrpt) ++install(FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_EN.ini" DESTINATION tools/crashrpt RENAME crashrpt_lang.ini) +diff --git a/reporting/crashsender/CrashSender.rc b/reporting/crashsender/CrashSender.rc +index 0502962..e10e269 100644 +--- a/reporting/crashsender/CrashSender.rc ++++ b/reporting/crashsender/CrashSender.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -243,7 +243,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/reporting/crashsender/ErrorReportSender.cpp b/reporting/crashsender/ErrorReportSender.cpp +index ac9603c..64cf2b5 100644 +--- a/reporting/crashsender/ErrorReportSender.cpp ++++ b/reporting/crashsender/ErrorReportSender.cpp +@@ -722,9 +722,9 @@ BOOL CErrorReportSender::CreateMiniDump() + CompiledApiVer.Reserved = 0; + LPAPI_VERSION pActualApiVer = lpImagehlpApiVersionEx(&CompiledApiVer); + pActualApiVer; +- ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); +- ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); +- ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); ++ //ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); ++ //ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); ++ //ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); + } + + // Write minidump to the file +@@ -1086,7 +1086,7 @@ BOOL CErrorReportSender::CreateCrashDescriptionXML(CErrorReportInfo& eri) + goto cleanup; + } + +- doc.useMicrosoftBOM = true; ++ //doc.useMicrosoftBOM = true; + bool bSave = doc.SaveFile(f); + if(!bSave) + { +diff --git a/reporting/crashsender/FilePreviewCtrl.cpp b/reporting/crashsender/FilePreviewCtrl.cpp +index e71aafc..5650291 100644 +--- a/reporting/crashsender/FilePreviewCtrl.cpp ++++ b/reporting/crashsender/FilePreviewCtrl.cpp +@@ -365,7 +365,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + if (!png_ptr) + goto cleanup; + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + goto cleanup; + + info_ptr = png_create_info_struct(png_ptr); +@@ -389,7 +389,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + width = png_get_image_width(png_ptr, info_ptr); + height = png_get_image_height(png_ptr, info_ptr); + +- if(info_ptr->channels==3) ++ if (png_get_channels(png_ptr, info_ptr) == 3) + { + png_set_strip_16(png_ptr); + png_set_packing(png_ptr); +@@ -408,14 +408,14 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + pBMI = (BITMAPINFO*)new BYTE[sizeof(BITMAPINFO)+256*4]; + memset(pBMI, 0, sizeof(BITMAPINFO)+256*4); + pBMI->bmiHeader.biSize = sizeof(BITMAPINFO); +- pBMI->bmiHeader.biBitCount = 8*info_ptr->channels; ++ pBMI->bmiHeader.biBitCount = 8 * png_get_channels(png_ptr, info_ptr); + pBMI->bmiHeader.biWidth = width; + pBMI->bmiHeader.biHeight = height; + pBMI->bmiHeader.biPlanes = 1; + pBMI->bmiHeader.biCompression = BI_RGB; + pBMI->bmiHeader.biSizeImage = rowbytes*height; + +- if( info_ptr->channels == 1 ) ++ if (png_get_channels(png_ptr, info_ptr) == 1) + { + RGBQUAD* palette = pBMI->bmiColors; + +@@ -431,7 +431,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + + for(y=height-1; y>=0; y--) + { +- png_read_rows(png_ptr, &row, png_bytepp_NULL, 1); ++ png_read_rows(png_ptr, &row, NULL, 1); + + { + CAutoLock lock(&m_csLock); +diff --git a/reporting/crashsender/ScreenCap.cpp b/reporting/crashsender/ScreenCap.cpp +index c183c19..8f5643d 100644 +--- a/reporting/crashsender/ScreenCap.cpp ++++ b/reporting/crashsender/ScreenCap.cpp +@@ -11,6 +11,7 @@ be found in the Authors.txt file in the root of the source tree. + #include "stdafx.h" + #include "ScreenCap.h" + #include "Utility.h" ++#include "zlib.h" + + // Disable warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable + #pragma warning(disable:4611) +diff --git a/reporting/crashsender/stdafx.h b/reporting/crashsender/stdafx.h +index f087ff4..4494d3a 100644 +--- a/reporting/crashsender/stdafx.h ++++ b/reporting/crashsender/stdafx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + typedef __int64 off_t, _off_t; + #define _OFF_T_DEFINED +@@ -61,19 +61,19 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + #define _WTL_USE_CSTRING +-#include ++#include + + #include + #include +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index f7bfede..9358bef 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -32,7 +32,7 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG") + # Add include dir + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl ) ++ ${WTL_INCLUDE_DIR} ) + + # Add executable build target + add_executable(Tests ${source_files} ${header_files}) +@@ -42,3 +42,10 @@ target_link_libraries(Tests CrashRpt CrashRptProbe) + + set_target_properties(Tests PROPERTIES DEBUG_POSTFIX d ) + #set_target_properties(Tests PROPERTIES COMPILE_FLAGS "/Zi" LINK_FLAGS "/DEBUG") ++ ++install(TARGETS Tests ++ RUNTIME DESTINATION tools/crashrpt ++) ++ ++install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.ini" DESTINATION tools/crashrpt) ++install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.log" DESTINATION tools/crashrpt) +diff --git a/tests/stdafx.h b/tests/stdafx.h +index f12675b..0ec2117 100644 +--- a/tests/stdafx.h ++++ b/tests/stdafx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + #include + #include +@@ -58,15 +58,15 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + #include +@@ -75,7 +75,7 @@ extern CAppModule _Module; + #include + + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER<1400 + #define _TCSCPY_S(strDestination, numberOfElements, strSource) _tcscpy(strDestination, strSource) +diff --git a/thirdparty/libpng/CMakeLists.txt b/thirdparty/libpng/CMakeLists.txt +index b358c4e..e0f7a33 100644 +--- a/thirdparty/libpng/CMakeLists.txt ++++ b/thirdparty/libpng/CMakeLists.txt +@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4267) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) ++include_directories( ${ZLIB_INCLUDE_DIRS} ) + + fix_default_compiler_settings_() + +@@ -15,6 +15,6 @@ fix_default_compiler_settings_() + add_library(libpng STATIC ${source_files}) + + # Add linker input libraries +-target_link_libraries(libpng zlib) ++target_link_libraries(libpng ZLIB::ZLIB) + + set_target_properties(libpng PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file +diff --git a/thirdparty/libtheora/CMakeLists.txt b/thirdparty/libtheora/CMakeLists.txt +index 896fb47..f3cf5eb 100644 +--- a/thirdparty/libtheora/CMakeLists.txt ++++ b/thirdparty/libtheora/CMakeLists.txt +@@ -8,7 +8,7 @@ aux_source_directory( ./lib/x86_vc x86_source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4700 /wd4214 /wd4554 /wd4018 /wd4100 /wd4132 /wd4389 /wd4127 /wd4701 /wd4245 /wd4267 /wd4334) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include ++include_directories( ${OGG_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) + + fix_default_compiler_settings_() +diff --git a/thirdparty/minizip/CMakeLists.txt b/thirdparty/minizip/CMakeLists.txt +index 5f4d0af..2b015c9 100644 +--- a/thirdparty/minizip/CMakeLists.txt ++++ b/thirdparty/minizip/CMakeLists.txt +@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4127 /wd4131 /wd4100 /wd4189 /wd4244) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) ++include_directories( ${ZLIB_INCLUDE_DIRS} ) + + fix_default_compiler_settings_() + +@@ -15,6 +15,6 @@ fix_default_compiler_settings_() + add_library(minizip STATIC ${source_files}) + + # Add linker input libraries +-target_link_libraries(minizip zlib) ++target_link_libraries(minizip ZLIB::ZLIB) + + set_target_properties(minizip PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file diff --git a/ports/crashrpt/CONTROL b/ports/crashrpt/CONTROL new file mode 100644 index 00000000000000..4b15e9d2336243 --- /dev/null +++ b/ports/crashrpt/CONTROL @@ -0,0 +1,16 @@ +Source: crashrpt +Version: 1.4.3 +Description: A crash reporting system for Windows applications +Homepage: http://crashrpt.sourceforge.net/ +Build-Depends: dbghelp, libjpeg-turbo, libogg, libpng, libtheora, tinyxml, wtl, zlib +Default-Features: + +Feature: probe +Description: The CrashRptProbe library + +Feature: tests +Description: Test application for crashrpt +Build-Depends: crashrpt[core,probe] + +Feature: demos +Description: Demo applications for CrashRptProbe diff --git a/ports/crashrpt/portfile.cmake b/ports/crashrpt/portfile.cmake new file mode 100644 index 00000000000000..f52f8e19a24b8f --- /dev/null +++ b/ports/crashrpt/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux" "UWP") + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(ARCH_DIR "") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(ARCH_DIR "x64/") +else() + vcpkg_fail_port_install(MESSAGE "${PORT} only supports x86 and x64 architectures" ALWAYS) +endif() + +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://git.code.sf.net/p/crashrpt/code + REF 4616504670be5a425a525376648d912a72ce18f2 + PATCHES + 001-add-install-target-and-find-deps.patch +) + +# Remove vendored dependencies to ensure they are not picked up by the build +# Vendored minizip is still used since it contains modifications needed for CrashRpt +foreach(DEPENDENCY dbghelp jpeg libogg libpng libtheora tinyxml wtl zlib) + if(EXISTS ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) + file(REMOVE_RECURSE ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) + endif() +endforeach() + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CRASHRPT_BUILD_SHARED_LIBS) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" CRASHRPT_LINK_CRT_AS_DLL) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + probe CRASHRPT_BUILD_PROBE + tests CRASHRPT_BUILD_TESTS + demos CRASHRPT_BUILD_DEMOS +) + +# PREFER_NINJA is not used below since CrashSender fails to build with errors like this one: +# C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\ATLMFC\include\atlconv.h(788): error C2440: 'return': cannot convert from 'LPCTSTR' to 'LPCOLESTR' +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # PREFER_NINJA + OPTIONS + -DCRASHRPT_BUILD_SHARED_LIBS=${CRASHRPT_BUILD_SHARED_LIBS} + -DCRASHRPT_LINK_CRT_AS_DLL=${CRASHRPT_LINK_CRT_AS_DLL} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cspice/CMakeLists.txt b/ports/cspice/CMakeLists.txt index e82b3a2804a3ae..af5c3e22b15a82 100644 --- a/ports/cspice/CMakeLists.txt +++ b/ports/cspice/CMakeLists.txt @@ -18,8 +18,12 @@ if (WIN32) target_compile_definitions(cspice PUBLIC "_COMPLEX_DEFINED;MSDOS;OMIT_BLANK_CC;NON_ANSI_STDIO") set_target_properties(cspice PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) elseif (UNIX) - target_compile_definitions(cspice PUBLIC "NON_ANSI_STDIO") - target_compile_options(cspice PUBLIC -m64 -ansi -fPIC) + target_compile_definitions(cspice PUBLIC "NON_UNIX_STDIO") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + target_compile_options(cspice PUBLIC -m64 -ansi -fPIC) + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(cspice PUBLIC -m32 -ansi -fPIC) + endif() endif () if (NOT _SKIP_HEADERS) diff --git a/ports/cspice/CONTROL b/ports/cspice/CONTROL index 670f75a3ae1f88..bb83e586d2ae9b 100644 --- a/ports/cspice/CONTROL +++ b/ports/cspice/CONTROL @@ -1,3 +1,6 @@ Source: cspice -Version: 66-1 +Version: 66 +Port-Version: 2 +Homepage: https://naif.jpl.nasa.gov/naif/toolkit_C.html Description: NASA C SPICE toolkit +Supports: !uwp \ No newline at end of file diff --git a/ports/cspice/portfile.cmake b/ports/cspice/portfile.cmake index 7c52772f355fb4..865325a7a3b5ef 100644 --- a/ports/cspice/portfile.cmake +++ b/ports/cspice/portfile.cmake @@ -1,31 +1,49 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() - -if (WIN32) - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip" - FILENAME "cspice.zip" - SHA512 4f6129b26543729f4eb4f8240b43ca87530db9c6d9a5c0e3f43faf30561eaad95dcf507e3fecfd1c3d4388ccaa4e22a76df7bf7945b6ce9a68eb3b4893885992 - ) -elseif (APPLE) - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" - FILENAME "cspice.tar.Z" - SHA512 bd5cc20206e48b3712c5077a2beb05c98cd58a25ce374ed363699a04998eb8ba93e42b5f7c2104c5296db95b3bccdc7cc9b6a2ba45875454d0c3914834aa4c42 - ) -else () - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" - FILENAME "cspice.tar.Z" - SHA512 b387bc2cfca4deccc451d198af49564ea0b19cf665ba143d39196ed532639cbc11aad7e1d63f71f1bb88d72c0e6ac30757b6e1babca9e0ee3b92f9c205c1b908 - ) +if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + FILENAME "cspice_32bit.zip" + SHA512 4f6129b26543729f4eb4f8240b43ca87530db9c6d9a5c0e3f43faf30561eaad95dcf507e3fecfd1c3d4388ccaa4e22a76df7bf7945b6ce9a68eb3b4893885992 + ) + elseif (VCPKG_TARGET_IS_OSX) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" + FILENAME "cspice_32bit.tar.Z" + SHA512 bd5cc20206e48b3712c5077a2beb05c98cd58a25ce374ed363699a04998eb8ba93e42b5f7c2104c5296db95b3bccdc7cc9b6a2ba45875454d0c3914834aa4c42 + ) + else () + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" + FILENAME "cspice_32bit.tar.Z" + SHA512 b387bc2cfca4deccc451d198af49564ea0b19cf665ba143d39196ed532639cbc11aad7e1d63f71f1bb88d72c0e6ac30757b6e1babca9e0ee3b92f9c205c1b908 + ) + endif() +else() + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + FILENAME "cspice_64bit.zip" + SHA512 7b5353c638fdba67ed2e9fd21c4f78ac56c0afba408caa70f910f23bb025f6dc822fbaa7d6d7fa277d1038f835e6a962563f4b11a6adf63150d48354959e3c62 + ) + elseif (VCPKG_TARGET_IS_OSX) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z" + FILENAME "cspice_64bit.tar.Z" + SHA512 0d4ef95dfa65d127c1d6f9cf1f637d41ca6680660ee3003f357652f12ed9d04a21888ef796f347ba90354a445b5aea9ffca7dedc6c1617f253b0002683d54a0f + ) + else () + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z" + FILENAME "cspice_64bit.tar.Z" + SHA512 7d090e9196596436740b53180a7c6ca885c12e301771a83fc62d625a63691129c69012cb0385a6c8f246cc5edf1c1af57ffac8a9d766061e1bde8584c57c6ca4 + ) + endif() endif() set(PATCHES isatty.patch) -if (NOT WIN32) +if (NOT VCPKG_TARGET_IS_WINDOWS) set(PATCHES ${PATCHES} mktemp.patch) endif() @@ -55,6 +73,6 @@ vcpkg_copy_pdbs() file( INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/cspice + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright -) +) \ No newline at end of file diff --git a/ports/cudnn/CONTROL b/ports/cudnn/CONTROL index 4ab7c941b9d053..24714f97fd2a87 100644 --- a/ports/cudnn/CONTROL +++ b/ports/cudnn/CONTROL @@ -1,5 +1,6 @@ Source: cudnn Version: 7.6 +Port-Version: 2 Description: NVIDIA's cuDNN deep neural network acceleration library Build-Depends: cuda Supports: (windows|linux)&x64 diff --git a/ports/cudnn/FindCUDNN.cmake b/ports/cudnn/FindCUDNN.cmake index 1b6916577ffd25..5dc2e339266a74 100644 --- a/ports/cudnn/FindCUDNN.cmake +++ b/ports/cudnn/FindCUDNN.cmake @@ -38,6 +38,11 @@ endif() if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn.h") file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS) + if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn_version.h") + file(READ "${CUDNN_INCLUDE_DIR}/cudnn_version.h" CUDNN_VERSION_H_CONTENTS) + string(APPEND CUDNN_HEADER_CONTENTS "${CUDNN_VERSION_H_CONTENTS}") + unset(CUDNN_VERSION_H_CONTENTS) + endif() string(REGEX MATCH "define CUDNN_MAJOR * +([0-9]+)" CUDNN_VERSION_MAJOR "${CUDNN_HEADER_CONTENTS}") string(REGEX REPLACE "define CUDNN_MAJOR * +([0-9]+)" "\\1" diff --git a/ports/cudnn/vcpkg-cmake-wrapper.cmake b/ports/cudnn/vcpkg-cmake-wrapper.cmake index bbda1d04d68e9a..5a69edec56201c 100644 --- a/ports/cudnn/vcpkg-cmake-wrapper.cmake +++ b/ports/cudnn/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(CUDNN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT CUDNN_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${CUDNN_PREV_MODULE_PATH}) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index ae36158755b964..5aa451bf401d91 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,15 +1,28 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 62b7b33..9b0e2e1 100644 +index 62b7b33..8a4bd71 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -107,7 +107,9 @@ endif() +@@ -107,6 +107,10 @@ endif() target_link_libraries(${LIB_NAME} ${CURL_LIBS}) --if(WIN32) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) -+elseif(WIN32) ++endif() ++ + if(WIN32) add_definitions(-D_USRDLL) endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e47967..7694f04 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -505,7 +505,7 @@ if(USE_QUICHE) + cmake_pop_check_state() + endif() + +-if(WIN32) ++if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(USE_WIN32_CRYPTO ON) + endif() diff --git a/ports/curl/0008_fix_tools_path.patch b/ports/curl/0008_fix_tools_path.patch deleted file mode 100644 index 7c411bf8004f8e..00000000000000 --- a/ports/curl/0008_fix_tools_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5838805..d2ca468 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -103,7 +103,7 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) - - #INCLUDE(ModuleInstall OPTIONAL) - --install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(TARGETS ${EXE_NAME} DESTINATION tools) - #export(TARGETS ${EXE_NAME} - # APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake - # NAMESPACE ${PROJECT_NAME}:: diff --git a/ports/curl/0011_fix_static_build.patch b/ports/curl/0011_fix_static_build.patch new file mode 100644 index 00000000000000..a50fa287f54cfe --- /dev/null +++ b/ports/curl/0011_fix_static_build.patch @@ -0,0 +1,13 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 8a4bd71..1927fb0 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -111,7 +111,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) + endif() + +-if(WIN32) ++if(WIN32 AND BUILD_SHARED_LIBS) + add_definitions(-D_USRDLL) + endif() + diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 079b75d83f2d37..1207ea9ef3e601 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,5 +1,5 @@ Source: curl -Version: 7.71.1 +Version: 7.72.0 Build-Depends: zlib Homepage: https://github.com/curl/curl Description: A library for transferring data with URLs @@ -23,15 +23,18 @@ Feature: ssh Build-Depends: curl[core,openssl], libssh2, curl[core,non-http] Description: SSH support via libssh2 -# SSL backends Feature: openssl Build-Depends: openssl Description: SSL support (OpenSSL) -Feature: winssl -Description: SSL support (Secure Channel / "WinSSL") +Feature: schannel +Description: SSL support (Secure Channel) Build-Depends: curl[core,sspi] +Feature: winssl +Description: Legacy name for schannel +Build-Depends: curl[schannel] + Feature: mbedtls Build-Depends: mbedtls Description: SSL support (mbedTLS) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index d34441170d0c53..2375d5ab9772d3 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF 5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 #curl-7_71_1 - SHA512 a58d2f23c4fb82610b8d68181fd29a4007983f88950b3eb3362170f3187d86116628151c5e09c713f047aca77cad7b9900bb58e368bbddca31599b4fde0dfa22 + REF 9d954e49bce3706a9a2efb119ecd05767f0f2a9e #curl-7_72_0 + SHA512 c6af3d772571d4c12ac797c0f5a29db4081ebb964693f2c1d93527f103afb29744f4ed2dde6832f63b28afc402166be2f1336dc868a46eb9a6a296c95d61ab71 HEAD_REF master PATCHES 0002_fix_uwp.patch @@ -10,16 +10,16 @@ vcpkg_from_github( 0005_remove_imp_suffix.patch 0006_fix_tool_depends.patch 0007_disable_tool_export_curl_target.patch - 0008_fix_tools_path.patch 0009_fix_openssl_config.patch 0010_fix_othertests_cmake.patch + 0011_fix_static_build.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) -# winssl will enable sspi, but sspi do not support uwp -if(("winssl" IN_LIST FEATURES OR "sspi" IN_LIST FEATURES OR "tool" IN_LIST FEATURES) AND (NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)) - message(FATAL_ERROR "winssl,sspi,tool are not supported on non-Windows and uwp platforms") +# schannel will enable sspi, but sspi do not support uwp +if(("schannel" IN_LIST FEATURES OR "sspi" IN_LIST FEATURES OR "tool" IN_LIST FEATURES) AND (NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)) + message(FATAL_ERROR "schannel,sspi,tool are not supported on non-Windows and uwp platforms") endif() if("sectransp" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_OSX) @@ -29,15 +29,15 @@ endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES # Support HTTP2 TLS Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location. - http2 USE_NGHTTP2 - openssl CMAKE_USE_OPENSSL - mbedtls CMAKE_USE_MBEDTLS - ssh CMAKE_USE_LIBSSH2 - tool BUILD_CURL_EXE - c-ares ENABLE_ARES - sspi CURL_WINDOWS_SSPI - brotli CURL_BROTLI - winssl CMAKE_USE_WINSSL + http2 USE_NGHTTP2 + openssl CMAKE_USE_OPENSSL + mbedtls CMAKE_USE_MBEDTLS + ssh CMAKE_USE_LIBSSH2 + tool BUILD_CURL_EXE + c-ares ENABLE_ARES + sspi CURL_WINDOWS_SSPI + brotli CURL_BROTLI + schannel CMAKE_USE_SCHANNEL sectransp CMAKE_USE_SECTRANSP INVERTED_FEATURES @@ -71,6 +71,7 @@ vcpkg_configure_cmake( -DCURL_STATICLIB=${CURL_STATICLIB} -DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON -DENABLE_DEBUG=ON + -DCURL_CA_FALLBACK=ON ) vcpkg_install_cmake() @@ -78,7 +79,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if ("tool" IN_LIST FEATURES) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/curl) + vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN) endif() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CURL) diff --git a/ports/darknet/CONTROL b/ports/darknet/CONTROL index 3f22eeb31e3c3a..32e5b629f37c9a 100644 --- a/ports/darknet/CONTROL +++ b/ports/darknet/CONTROL @@ -1,7 +1,7 @@ Source: darknet -Version: 2020-03-02 +Version: 2020-08-30 Description: Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities. -Build-Depends: pthreads (windows), stb +Build-Depends: pthreads, stb Feature: cuda Build-Depends: cuda diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake index 9d15802b00f7f1..b1ba7cf1598c94 100644 --- a/ports/darknet/portfile.cmake +++ b/ports/darknet/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO AlexeyAB/darknet - REF 81290b07376c5abb4988a492dda70913bb90133d - SHA512 094197cde851dfdd1e102a3ffaed34d67a789dd75dc288bde611144dc9aa484ca0b9e3468abc297d075d3753553f7f09a214be279af9e58ccb642aa757909f79 + REF ecad770071eb776208a46977347e6d2410d4f50e + SHA512 1de0dc3f4842c68f5c12addf100996f7176ffb50dcd89a0b57446ba996d9199e31531f64c32eedbc2ea6a449459573811444dd35f1a50ece3880f58717c795ab HEAD_REF master ) @@ -51,11 +51,31 @@ if ("cuda" IN_LIST FEATURES) endif() if("weights" IN_LIST FEATURES) + vcpkg_download_distfile(YOLOV4-TINY_WEIGHTS + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights" + FILENAME "darknet-cache/yolov4-tiny.weights" + SHA512 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 + ) + vcpkg_download_distfile(YOLOV4_WEIGHTS + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights" + FILENAME "darknet-cache/yolov4.weights" + SHA512 77f779c58df67975b187cfead99c1e62d72c57e76c3715e35b97a1c7aba1c7b092be97ffb17907099543ac3957085a0fe9688df4a653ea62dfe8322afca53e40 + ) + vcpkg_download_distfile(YOLOV3-TINY-PRN_WEIGHTS + URLS "https://drive.google.com/u/0/uc?id=18yYZWyKbo4XSDVyztmsEcF9B_6bxrhUY&export=download" + FILENAME "darknet-cache/yolov3-tiny-prn.weights" + SHA512 0be26786103866868751bb8c5cc0b5147b3e8528d0cf5b387f5aefc72807fd7f1bf8049d5b0a47e9b4445d34e773ea8e3abc95330edb2a3ecd6103e158df2677 + ) vcpkg_download_distfile(YOLOV3_WEIGHTS URLS "https://pjreddie.com/media/files/yolov3.weights" FILENAME "darknet-cache/yolov3.weights" SHA512 293c70e404ff0250d7c04ca1e5e053fc21a78547e69b5b329d34f25981613e59b982d93fff2c352915ef7531d6c3b02a9b0b38346d05c51d6636878d8883f2c1 ) + vcpkg_download_distfile(YOLOV3-OPENIMAGES_WEIGHTS + URLS "https://pjreddie.com/media/files/yolov3-openimages.weights" + FILENAME "darknet-cache/yolov3-openimages.weights" + SHA512 616e90057946c9588d045cff6ec36b63254660af4377201dc02642e798d62f392e8f3cdb5b10a1c4bcbe5c056e690275dca35b68db7fd802783a0c6bbd959ba8 + ) vcpkg_download_distfile(YOLOV2_WEIGHTS URLS "https://pjreddie.com/media/files/yolov2.weights" FILENAME "darknet-cache/yolov2.weights" @@ -74,12 +94,22 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) - vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V3 + vcpkg_download_distfile(YOLOV4-TINY-CONV-29 + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.conv.29" + FILENAME "darknet-cache/yolov4-tiny.conv.29" + SHA512 318e47f4bdf43b7f4eff8f3669bc9ba66cd7bd8ffb31df5bc1978682c85fec8e63a8349958022fd933cc676cbf5241953f2181bf4d1789f7cf9d371e012e3e49 + ) + vcpkg_download_distfile(YOLOV4-CONV-137 + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.conv.137" + FILENAME "darknet-cache/yolov4.conv.137" + SHA512 d146a61762bf6ef91deb6c627ede475f63b3975fbeeb1ff5e0949470b29be8fc28ee81280041937e7ded49679276fbabacdb92d02fa246cc622853633fd3d992 + ) + vcpkg_download_distfile(DARKNET53-CONV-74 URLS "https://pjreddie.com/media/files/darknet53.conv.74" FILENAME "darknet-cache/darknet53.conv.74" SHA512 8983e1c129e2d6e8e3da0cc0781ecb7a07813830ef5a87c24b53100df6a5f23db6c6e6a402aec78025a93fe060b75d1958f1b8f7439a04b54a3f19c81e2ae99b ) - vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V2 + vcpkg_download_distfile(DARKNET19-448-CONV-23 URLS "https://pjreddie.com/media/files/darknet19_448.conv.23" FILENAME "darknet-cache/darknet19_448.conv.23" SHA512 8016f5b7ddc15c5d7dad231592f5351eea65f608ebdb204f545034dde904e11962f693080dfeb5a4510e7b71bdda151a9121ba0f8a243018d680f01b1efdbd31 @@ -133,6 +163,10 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if("weights" IN_LIST FEATURES) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny-prn.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-openimages.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov2.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -140,6 +174,8 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.conv.29 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.conv.137 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet53.conv.74 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet19_448.conv.23 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() diff --git a/ports/date/0003-find-dependency-pthread.patch b/ports/date/0003-find-dependency-pthread.patch new file mode 100644 index 00000000000000..72c6c765a15b54 --- /dev/null +++ b/ports/date/0003-find-dependency-pthread.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/dateConfig.cmake b/cmake/dateConfig.cmake +index 20f86e8..2198ad1 100644 +--- a/cmake/dateConfig.cmake ++++ b/cmake/dateConfig.cmake +@@ -1,8 +1,8 @@ + include( CMakeFindDependencyMacro ) + include( "${CMAKE_CURRENT_LIST_DIR}/dateTargets.cmake" ) +-if( NOT MSVC AND TARGET date::tz ) ++if( NOT MSVC AND TARGET date::date-tz ) + find_dependency( Threads REQUIRED) +- get_target_property( _tzill date::tz INTERFACE_LINK_LIBRARIES ) ++ get_target_property( _tzill date::date-tz INTERFACE_LINK_LIBRARIES ) + if( _tzill AND "${_tzill}" MATCHES "libcurl" ) + find_dependency( CURL ) + endif( ) diff --git a/ports/date/CONTROL b/ports/date/CONTROL index c912bd283e9856..b44b024cdb7d8c 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,5 +1,6 @@ Source: date Version: 3.0.0 +Port-Version: 1 Homepage: https://github.com/HowardHinnant/date Description: A date and time library based on the C++17 header diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index 3fd9121c4b346c..4dd5a40eb470db 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( PATCHES 0001-fix-uwp.patch 0002-fix-cmake-3.14.patch + 0003-find-dependency-pthread.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS INVERTED_FEATURES @@ -39,9 +40,5 @@ endif() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) -# Remove the wrapper when backwards compatibility when the unofficial::date::date and unofficial::date::tz -# targets are no longer required. -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright) diff --git a/ports/date/usage b/ports/date/usage deleted file mode 100644 index 82f42f7f2d1469..00000000000000 --- a/ports/date/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package date provides CMake targets: - - find_package(date CONFIG REQUIRED) - target_link_libraries(main PRIVATE date::date date::tz) diff --git a/ports/date/vcpkg-cmake-wrapper.cmake b/ports/date/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 317c49b8c049e3..00000000000000 --- a/ports/date/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,11 +0,0 @@ -_find_package(${ARGS}) - -if(NOT TARGET unofficial::date::date AND TARGET date::date) - add_library(unofficial::date::date INTERFACE IMPORTED) - target_link_libraries(unofficial::date::date INTERFACE date::date) -endif() - -if(NOT TARGET unofficial::date::tz AND TARGET date::tz) - add_library(unofficial::date::tz INTERFACE IMPORTED) - target_link_libraries(unofficial::date::tz INTERFACE date::tz) -endif() diff --git a/ports/dbghelp/CONTROL b/ports/dbghelp/CONTROL new file mode 100644 index 00000000000000..e92599d577c28e --- /dev/null +++ b/ports/dbghelp/CONTROL @@ -0,0 +1,4 @@ +Source: dbghelp +Version: 0.0 +Description: Windows Debug Help Library +Supports: windows \ No newline at end of file diff --git a/ports/dbghelp/portfile.cmake b/ports/dbghelp/portfile.cmake new file mode 100644 index 00000000000000..832bec6d74c498 --- /dev/null +++ b/ports/dbghelp/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_get_windows_sdk(WINDOWS_SDK) + +if (WINDOWS_SDK VERSION_GREATER "10") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Debuggers\\lib\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.lib") + message("LIBFILEPATH: ${LIBFILEPATH}") + set(DLLFILEPATH "$ENV{WindowsSdkDir}Debuggers\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.dll") + message("DLLFILEPATH: ${DLLFILEPATH}") + set(HEADERPATH "$ENV{WindowsSdkDir}Debuggers\\inc\\dbghelp.h") + message("HEADERPATH: ${HEADERPATH}") +else() + message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") +endif() + +if (NOT EXISTS "${LIBFILEPATH}" OR NOT EXISTS "${DLLFILEPATH}" OR NOT EXISTS "${HEADERPATH}") + message(FATAL_ERROR "Cannot find debugging tools in Windows SDK ${WINDOWS_SDK}. Please reinstall the Windows SDK and select \"Debugging Tools\".") +endif() + +file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(INSTALL ${HEADERPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license") diff --git a/ports/directxmesh/CONTROL b/ports/directxmesh/CONTROL index 55e8360d8eee3f..f4470fe6a01582 100644 --- a/ports/directxmesh/CONTROL +++ b/ports/directxmesh/CONTROL @@ -1,4 +1,4 @@ Source: directxmesh -Version: jul2020 +Version: aug2020 Homepage: https://walbourn.github.io/directxmesh Description: DirectXMesh geometry processing library \ No newline at end of file diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake index ceece913af81f8..56f6ab6ac4d3ae 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXMesh - REF jul2020 - SHA512 27618f56fbce39d908417a44ea42ef0040254888fbb92108ecb06f6d70e06c1b168c0366c01f65c6b3d2c9915e445d1da85a48e11c23980cb4ab4b41e0b2904a + REF aug2020 + SHA512 4a116b6266070a075aca523d9439eeab878b5406ffe5f94f7c008d659842750eab17b11c027c7f1da1ed12a0b8a43ab53dc5aaea8477a0bb029654cd477b5424 HEAD_REF master ) diff --git a/ports/directxsdk/portfile.cmake b/ports/directxsdk/portfile.cmake new file mode 100644 index 00000000000000..86fa8a14914d14 --- /dev/null +++ b/ports/directxsdk/portfile.cmake @@ -0,0 +1,60 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm") + +vcpkg_download_distfile(ARCHIVE + URLS "https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe" + FILENAME "DXSDK_Jun10.exe" + SHA512 4869ac947a35cd0d6949fbda17547256ea806fef36f48474dda63651f751583e9902641087250b6e8ccabaab85e51effccd9235dc6cdf64e21ec2b298227fe19 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + + +set(LIB_DIR "${SOURCE_PATH}/Lib/${VCPKG_TARGET_ARCHITECTURE}") +set(DEBUG_LIBS + ${LIB_DIR}/D3DCSXd.lib + ${LIB_DIR}/d3dx10d.lib + ${LIB_DIR}/d3dx11d.lib + ${LIB_DIR}/d3dx9d.lib + ${LIB_DIR}/xapobased.lib +) +set(RELEASE_LIBS + ${LIB_DIR}/D3DCSX.lib + ${LIB_DIR}/d3dx10.lib + ${LIB_DIR}/d3dx11.lib + ${LIB_DIR}/d3dx9.lib + ${LIB_DIR}/xapobase.lib +) +# Libs without a debug part +set(OTHER_LIBS + ${LIB_DIR}/d2d1.lib + ${LIB_DIR}/d3d10.lib + ${LIB_DIR}/d3d10_1.lib + ${LIB_DIR}/d3d11.lib + ${LIB_DIR}/d3d9.lib + ${LIB_DIR}//d3dcompiler.lib + ${LIB_DIR}/d3dxof.lib + ${LIB_DIR}/dinput8.lib + ${LIB_DIR}/dsound.lib + ${LIB_DIR}/dwrite.lib + ${LIB_DIR}/DxErr.lib + ${LIB_DIR}/dxgi.lib + ${LIB_DIR}/dxguid.lib + ${LIB_DIR}/X3DAudio.lib + ${LIB_DIR}/XAPOFX.lib + ${LIB_DIR}/XInput.lib +) +if(${VCPKG_TARGET_ARCHITECTURE} STREQUAL "x86") + list(APPEND OTHER_LIBS ${LIB_DIR}/dsetup.lib) +endif() + +#install(DIRECTORY "${SOURCE_PATH}/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY "${SOURCE_PATH}/Include/" DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) +file(COPY ${RELEASE_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${DEBUG_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + +# # Handle copyright +file(INSTALL "${SOURCE_PATH}/Documentation/License Agreements/DirectX SDK EULA.txt" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/directxsdk/vcpkg.json b/ports/directxsdk/vcpkg.json new file mode 100644 index 00000000000000..fa1f7a348d81bd --- /dev/null +++ b/ports/directxsdk/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "directxsdk", + "version-string": "jun10", + "description": "DirectX SDK", + "homepage": "https://www.microsoft.com/en-us/download/details.aspx?id=6812", + "supports": "windows & !arm & !uwp" +} diff --git a/ports/directxtex/CONTROL b/ports/directxtex/CONTROL index c4bcd2b9d3f6a2..a31a921c80f20e 100644 --- a/ports/directxtex/CONTROL +++ b/ports/directxtex/CONTROL @@ -1,4 +1,4 @@ Source: directxtex -Version: jul2020 +Version: aug2020 Homepage: https://walbourn.github.io/directxtex Description: DirectXTex texture processing library \ No newline at end of file diff --git a/ports/directxtex/portfile.cmake b/ports/directxtex/portfile.cmake index 79d4466aa847a6..bec2ca9ca3298b 100644 --- a/ports/directxtex/portfile.cmake +++ b/ports/directxtex/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXTex - REF jul2020 - SHA512 5e0c8b181527eb613a830f2228cf66633591c43fd4424dde9efae08d366c7957fdee02ad716a26a7b40b106b1a17f22a0728c2b57d12e12e1dc55ed297f7825c + REF aug2020 + SHA512 f646ff51444f5f51da77e2c21998c7f9a6e014f1ffb1b814937e36e76d20c6a993808f34bda5721177d506f21f1bf36b09e94b18859c41f99043cd0eec5bc9d7 HEAD_REF master ) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index 0f627f6c848af3..c4bc1b1d6cdf2a 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,4 +1,4 @@ Source: directxtk -Version: jul2020 +Version: aug2020 Homepage: https://walbourn.github.io/directxtk Description: A collection of helper classes for writing DirectX 11.x code in C++. diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index b309add34fde73..5f0be158bef113 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXTK - REF jul2020 - SHA512 e1e77795c12e82d12f491b19b43353b0f7e9cce6343a648728d083e63ae369404029344168b84d6a5162b74c1db4ee5160cd5e01aef26c7fad2ee890e26f41c0 + REF aug2020 + SHA512 8f79104f7cebab20a739144471337c24fe5078d6d21760d76ec897569609a0a1f25fe2b16782e0561308470cb73a8901c1dd18f7b2741e30c0aa0cee09a30621 HEAD_REF master ) diff --git a/ports/directxtk12/CONTROL b/ports/directxtk12/CONTROL index 2eb9266b852c98..934d3f612aaf7e 100644 --- a/ports/directxtk12/CONTROL +++ b/ports/directxtk12/CONTROL @@ -1,4 +1,4 @@ Source: directxtk12 -Version: jul2020 +Version: aug2020 Homepage: https://walbourn.github.io/directx-tool-kit-for-directx-12 Description: A collection of helper classes for writing DirectX 12 code in C++. diff --git a/ports/directxtk12/portfile.cmake b/ports/directxtk12/portfile.cmake index c3b7eca990ae8e..148ce6cfc24d9e 100644 --- a/ports/directxtk12/portfile.cmake +++ b/ports/directxtk12/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXTK12 - REF jul2020 - SHA512 e658797029140fdfa6313f958367caba656b47637c5973ce1fa05cb777491d2523d2a8f592babd15f1eb839dc8371db9a47a47620a14fe632d0058d93d53e886 + REF aug2020 + SHA512 ad462fd36175a11f5825a3d49c2363ed37a15f3e849e95694bef1d7f40fb6b1c6c579565884eb1d099efaabd91c0d9222c335d92bfba5b83a363cb9934ef503f HEAD_REF master ) diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 9828f97265b278..f651f9d62fcc1d 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,6 +1,7 @@ Source: dlib -Version: 19.19-1 -Build-Depends: libjpeg-turbo, libpng, openblas (!osx), clapack (!osx) +Version: 19.21 +Port-Version: 4 +Build-Depends: libjpeg-turbo, libpng, openblas, lapack Homepage: https://github.com/davisking/dlib Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ Default-Features: fftw3, sqlite3 diff --git a/ports/dlib/fix-sqlite3-fftw-linkage.patch b/ports/dlib/fix-sqlite3-fftw-linkage.patch index 84ab0c26535a5a..41ba700b420872 100644 --- a/ports/dlib/fix-sqlite3-fftw-linkage.patch +++ b/ports/dlib/fix-sqlite3-fftw-linkage.patch @@ -15,8 +15,8 @@ diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt - set(DLIB_LINK_WITH_SQLITE3 OFF CACHE STRING ${DLIB_LINK_WITH_SQLITE3_STR} FORCE ) - endif() - mark_as_advanced(sqlite sqlite_path) -+ find_package(sqlite3 CONFIG) -+ set(dlib_needed_libraries ${dlib_needed_libraries} sqlite3 ) ++ find_package(unofficial-sqlite3 CONFIG) ++ set(dlib_needed_libraries ${dlib_needed_libraries} unofficial::sqlite3::sqlite3) endif() @@ -49,7 +49,7 @@ diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt + find_dependency(FFTW3 CONFIG) +endif() +if("@DLIB_LINK_WITH_SQLITE3@") -+ find_dependency(sqlite3 CONFIG) ++ find_dependency(unofficial-sqlite3 CONFIG) +endif() + set(dlib_LIBRARIES dlib::dlib) diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake index 13d0ee1758d317..00f45d25f2083d 100644 --- a/ports/dlib/portfile.cmake +++ b/ports/dlib/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO davisking/dlib - REF v19.19 - SHA512 013f0c37fa98b0b93824ef94f2c50cb7b41461906ddec1df3021b489e8a02d299b20802416e9dcd6483fd55197e3792119e7b7774ca8dd9c307e8be68a39fe6b + REF v19.21 + SHA512 57133cdcbc5017d324a368ff36a628de55001f1ec0b3ac078b4ad49a63c8c9fb48674617c6a5838ca4e381a6b001fe4aa5a7b3353eb288c58062d2a8fc7b171e HEAD_REF master PATCHES fix-sqlite3-fftw-linkage.patch diff --git a/ports/drogon/CONTROL b/ports/drogon/CONTROL index 7b859565b57559..d9577bb307bb04 100644 --- a/ports/drogon/CONTROL +++ b/ports/drogon/CONTROL @@ -1,5 +1,5 @@ Source: drogon -Version: v1.0.0-beta18 +Version: v1.0.0-beta21 Homepage: https://github.com/an-tao/drogon Description:Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows -Build-Depends: trantor, zlib, jsoncpp, libmariadb, libpq, sqlite3, brotli \ No newline at end of file +Build-Depends: trantor, zlib, jsoncpp, libmariadb, libpq, sqlite3, brotli, libuuid (!windows) diff --git a/ports/drogon/drogon_ctl_install.patch b/ports/drogon/drogon_ctl_install.patch deleted file mode 100644 index 71643248ee399c..00000000000000 --- a/ports/drogon/drogon_ctl_install.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt -index bbc01fe..99500f0 100755 ---- a/drogon_ctl/CMakeLists.txt -+++ b/drogon_ctl/CMakeLists.txt -@@ -40,13 +40,13 @@ if(WIN32) - target_link_libraries(drogon_ctl PRIVATE ws2_32 Rpcrt4) - endif(WIN32) - message(STATUS "bin:" ${INSTALL_BIN_DIR}) --install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR}) -+install(TARGETS drogon_ctl RUNTIME DESTINATION tools/drogon) - if(WIN32) - set(CTL_FILE $) - add_custom_command(TARGET drogon_ctl POST_BUILD - COMMAND ${CMAKE_COMMAND} - -DCTL_FILE=${CTL_FILE} -- -DINSTALL_BIN_DIR=${INSTALL_BIN_DIR} -+ -DINSTALL_BIN_DIR=tools/drogon - -P - ${CMAKE_CURRENT_SOURCE_DIR}/CopyDlls.cmake) - else(WIN32) diff --git a/ports/drogon/pg.patch b/ports/drogon/pg.patch new file mode 100644 index 00000000000000..6e718c5e3d6353 --- /dev/null +++ b/ports/drogon/pg.patch @@ -0,0 +1,27 @@ +diff --git a/cmake_modules/Findpg.cmake b/cmake_modules/Findpg.cmake +index 53037f2..d13f384 100644 +--- a/cmake_modules/Findpg.cmake ++++ b/cmake_modules/Findpg.cmake +@@ -4,20 +4,14 @@ + # + # This module defines PG_INCLUDE_DIRS, where to find header, etc. PG_LIBRARIES, + # the libraries needed to use PostgreSQL. pg_FOUND, If false, do not try to use +-# PostgreSQL. +-# pg_lib - The imported target library. ++# PostgreSQL. pg_lib - The imported target library. + + find_package(PostgreSQL) + if(PostgreSQL_FOUND) + set(PG_LIBRARIES ${PostgreSQL_LIBRARIES}) + set(PG_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIRS}) +- message(STATUS "pg inc: " ${PostgreSQL_INCLUDE_DIRS}) + add_library(pg_lib INTERFACE IMPORTED) +- set_target_properties(pg_lib +- PROPERTIES INTERFACE_INCLUDE_DIRECTORIES +- "${PostgreSQL_INCLUDE_DIRS}" +- INTERFACE_LINK_LIBRARIES +- "${PostgreSQL_LIBRARIES}") ++ target_link_libraries(pg_lib INTERFACE PostgreSQL::PostgreSQL) + mark_as_advanced(PG_INCLUDE_DIRS PG_LIBRARIES) + endif(PostgreSQL_FOUND) + include(FindPackageHandleStandardArgs) diff --git a/ports/drogon/portfile.cmake b/ports/drogon/portfile.cmake index 31d8e662a65cc1..d66100591c2969 100644 --- a/ports/drogon/portfile.cmake +++ b/ports/drogon/portfile.cmake @@ -1,33 +1,37 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO an-tao/drogon - REF v1.0.0-beta18 - SHA512 38d57e6b5cc43bd1ac07c980453dda1f4c23a8c78eca942dd531d20661d7f088fc0a3d0f4e7cedddf98bac5a32be0330911cbf839d4956e05ee0265a68c7faa6 - HEAD_REF master - PATCHES - vcpkg.patch - drogon_ctl_install.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_EXAMPLES=OFF -) - -vcpkg_install_cmake() - -# Fix CMake files -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/drogon) - -# # Remove includes in debug -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# Copy pdb files -vcpkg_copy_pdbs() - -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/drogon) \ No newline at end of file +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO an-tao/drogon + REF v1.0.0-beta21 + SHA512 bacd3c0d20c9d5eb22e6c872c8bea6865a6beb93d83165e117b11a30b7fffd65de48838b599cda81043e7ae1394a9d13390910baa4b84d8cfad3050f152a4c36 + HEAD_REF master + PATCHES + vcpkg.patch + pg.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_EXAMPLES=OFF +) + +vcpkg_install_cmake() + +# Fix CMake files +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Drogon) +# Copy drogon_ctl +vcpkg_copy_tools(TOOL_NAMES drogon_ctl + AUTO_CLEAN) +# # Remove includes in debug +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# Copy pdb files +vcpkg_copy_pdbs() + diff --git a/ports/edlib/CONTROL b/ports/edlib/CONTROL new file mode 100644 index 00000000000000..3a3e4b5e3796d1 --- /dev/null +++ b/ports/edlib/CONTROL @@ -0,0 +1,4 @@ +Source: edlib +Version: 1.2.6 +Homepage: https://github.com/Martinsos/edlib +Description: Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance. \ No newline at end of file diff --git a/ports/edlib/fix-cmake-install.patch b/ports/edlib/fix-cmake-install.patch new file mode 100644 index 00000000000000..8081bba782c661 --- /dev/null +++ b/ports/edlib/fix-cmake-install.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 767d808..21f0cfc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,14 +74,42 @@ if (NOT WIN32) # If on windows, do not build binaries that do not support window + target_link_libraries(edlib-aligner edlib) + endif() + +- +-# Create target 'install' for installing libraries. +-install(TARGETS edlib DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install(FILES edlib/include/edlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- + # configure and install pkg-config file + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/edlib.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/edlib-1.pc + @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/edlib-1.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ ++### Additional config for VCPKG ++include(CMakePackageConfigHelpers) ++set(EDLIB_CMAKE_DIR "lib/cmake/edlib" CACHE STRING ++ "Installation directory for cmake files, relative to ${CMAKE_INSTALL_PREFIX}.") ++set(version_config "${PROJECT_BINARY_DIR}/edlib-config-version.cmake") ++set(project_config "${PROJECT_BINARY_DIR}/edlib-config.cmake") ++set(targets_export_name edlib-targets) ++ ++# Generate the version, config and target files into the build directory. ++write_basic_package_version_file( ++ ${version_config} ++ VERSION ${VERSION} ++ COMPATIBILITY AnyNewerVersion) ++configure_package_config_file( ++ ${PROJECT_SOURCE_DIR}/edlib-config.cmake.in ++ ${project_config} ++ INSTALL_DESTINATION ${EDLIB_CMAKE_DIR}) ++export(TARGETS edlib NAMESPACE edlib:: ++ FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) ++ ++# Install version, config and target files. ++install( ++ FILES ${project_config} ${version_config} ++ DESTINATION ${EDLIB_CMAKE_DIR}) ++install(EXPORT ${targets_export_name} DESTINATION ${EDLIB_CMAKE_DIR} ++ NAMESPACE edlib::) ++ ++### // ++ ++# Create target 'install' for installing libraries. ++install(TARGETS edlib EXPORT ${targets_export_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(FILES edlib/include/edlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +\ No newline at end of file +diff --git a/edlib-config.cmake.in b/edlib-config.cmake.in +new file mode 100644 +index 0000000..f2cc030 +--- /dev/null ++++ b/edlib-config.cmake.in +@@ -0,0 +1,4 @@ ++@PACKAGE_INIT@ ++ ++include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake) ++check_required_components(edlib) +\ No newline at end of file diff --git a/ports/edlib/portfile.cmake b/ports/edlib/portfile.cmake new file mode 100644 index 00000000000000..788320015ec262 --- /dev/null +++ b/ports/edlib/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Martinsos/edlib + REF v1.2.6 + SHA512 75b470c1403113e5f0895b3c1bb4163e65c6e04ccf41a75297a5b4cc915a567567ebcc79f3b9ea74b5e7188adfab2eceda5ac75e2d861aef8b3fefc6d4f39200 + HEAD_REF master + PATCHES + fix-cmake-install.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/edlib) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index 9a60167d29af70..90d0726e2ab0a9 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,5 +1,5 @@ Source: eigen3 Version: 3.3.7 -Port-Version: 6 +Port-Version: 7 Homepage: http://eigen.tuxfamily.org Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index dedfd026b7fbcb..6d72fdc5e7fdde 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -25,16 +25,9 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) - -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake - "set(_IMPORT_PREFIX " "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}/../..\" ABSOLUTE) #" -) - +vcpkg_fixup_cmake_targets() vcpkg_fixup_pkgconfig() -file(GLOB INCLUDES ${CURRENT_PACKAGES_DIR}/include/eigen3/*) -file(COPY ${INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/embree3/CONTROL b/ports/embree3/CONTROL old mode 100644 new mode 100755 index d7013ff75b12a3..1b11e6904e1770 --- a/ports/embree3/CONTROL +++ b/ports/embree3/CONTROL @@ -1,5 +1,6 @@ Source: embree3 -Version: 3.8.0 +Version: 3.11.0 +Port-Version: 1 Homepage: https://github.com/embree/embree Description: High Performance Ray Tracing Kernels. Build-Depends: tbb diff --git a/ports/embree3/fix-InstallPath.patch b/ports/embree3/fix-InstallPath.patch deleted file mode 100644 index 316fa594d0a5db..00000000000000 --- a/ports/embree3/fix-InstallPath.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake -index 3c3980d..0c365ac 100644 ---- a/common/cmake/package.cmake -+++ b/common/cmake/package.cmake -@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm - # create a config file for the build directory - CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) - --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} RENAME "embree-config.cmake" COMPONENT devel) --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) - - ############################################################## - # CPack specific stuff diff --git a/ports/embree3/fix-cmake-path.patch b/ports/embree3/fix-cmake-path.patch deleted file mode 100644 index e1e65eda37d3d8..00000000000000 --- a/ports/embree3/fix-cmake-path.patch +++ /dev/null @@ -1,163 +0,0 @@ -diff --git a/common/lexers/CMakeLists.txt b/common/lexers/CMakeLists.txt -index 10c8caf..95d96dc 100644 ---- a/common/lexers/CMakeLists.txt -+++ b/common/lexers/CMakeLists.txt -@@ -23,7 +23,7 @@ SET_PROPERTY(TARGET lexers PROPERTY FOLDER common) - SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT lexers-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS lexers EXPORT lexers-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT lexers-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(lexers) - ENDIF() -diff --git a/common/math/CMakeLists.txt b/common/math/CMakeLists.txt -index e7ed3b1..13247ca 100644 ---- a/common/math/CMakeLists.txt -+++ b/common/math/CMakeLists.txt -@@ -19,8 +19,8 @@ SET_PROPERTY(TARGET math PROPERTY FOLDER common) - SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT math-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS math EXPORT math-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT math-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(math) - ENDIF() - -diff --git a/common/simd/CMakeLists.txt b/common/simd/CMakeLists.txt -index 5b1658c..81d7c80 100644 ---- a/common/simd/CMakeLists.txt -+++ b/common/simd/CMakeLists.txt -@@ -19,7 +19,7 @@ SET_PROPERTY(TARGET simd PROPERTY FOLDER common) - SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT simd-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS simd EXPORT simd-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT simd-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(simd) - ENDIF() -diff --git a/common/sys/CMakeLists.txt b/common/sys/CMakeLists.txt -index e0e0848..b57e6be 100644 ---- a/common/sys/CMakeLists.txt -+++ b/common/sys/CMakeLists.txt -@@ -35,7 +35,7 @@ SET_PROPERTY(TARGET sys PROPERTY FOLDER common) - SET_PROPERTY(TARGET sys APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS sys EXPORT sys-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT sys-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS sys EXPORT sys-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT sys-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(sys) - ENDIF() -diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt -index f5db33f..b96671a 100644 ---- a/common/tasking/CMakeLists.txt -+++ b/common/tasking/CMakeLists.txt -@@ -28,7 +28,7 @@ SET_PROPERTY(TARGET tasking PROPERTY FOLDER common) - SET_PROPERTY(TARGET tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS tasking EXPORT tasking-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT tasking-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS tasking EXPORT tasking-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT tasking-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(tasking) - ENDIF() -diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt -index a5774d2..b637321 100644 ---- a/kernels/CMakeLists.txt -+++ b/kernels/CMakeLists.txt -@@ -255,8 +255,8 @@ IF (EMBREE_ISA_SSE42 AND EMBREE_LIBRARY_FILES_SSE42) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_sse42) - CheckGlobals(embree_sse42) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_sse42-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_sse42-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF () - -@@ -268,8 +268,8 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx) - CheckGlobals(embree_avx) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx EXPORT embree_avx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx EXPORT embree_avx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -281,8 +281,8 @@ IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx2) - CheckGlobals(embree_avx2) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx2-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx2-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -294,8 +294,8 @@ IF (EMBREE_ISA_AVX512KNL AND EMBREE_LIBRARY_FILES_AVX512KNL) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512knl) - CheckGlobals(embree_avx512knl) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx512knl-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx512knl-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -307,8 +307,8 @@ IF (EMBREE_ISA_AVX512SKX AND EMBREE_LIBRARY_FILES_AVX512SKX) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512skx) - CheckGlobals(embree_avx512skx) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx512skx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx512skx-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -331,7 +331,7 @@ ELSE() - SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR}) - ENDIF() - --INSTALL(TARGETS embree EXPORT embree-targets -+INSTALL(TARGETS embree EXPORT embree-targets DESTINATION share/embree3 - LIBRARY NAMELINK_SKIP DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib - # on Windows put the dlls into bin - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples -@@ -340,7 +340,7 @@ INSTALL(TARGETS embree EXPORT embree-targets - ) - - IF (EMBREE_STATIC_LIB) -- INSTALL(EXPORT embree-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(EXPORT embree-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - - IF (NOT EMBREE_STATIC_LIB) -diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake -index 0c365ac..7b140a5 100644 ---- a/common/cmake/package.cmake -+++ b/common/cmake/package.cmake -@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm - # create a config file for the build directory - CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) - --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION share/embree3 RENAME "embree-config.cmake" COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION share/embree3 COMPONENT devel) - - ############################################################## - # CPack specific stuff diff --git a/ports/embree3/fix-embree-path.patch b/ports/embree3/fix-embree-path.patch deleted file mode 100644 index 31611275549eff..00000000000000 --- a/ports/embree3/fix-embree-path.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake -index cab4d41..da84d3d 100644 ---- a/common/cmake/embree-config.cmake -+++ b/common/cmake/embree-config.cmake -@@ -14,11 +14,19 @@ - ## limitations under the License. ## - ## ======================================================================== ## - --SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) -+SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../@EMBREE_RELATIV_ROOT_DIR@) - GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) - - SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) --SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ -+IF (CMAKE_BUILD_TYPE STREQUAL Debug) -+ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/debug/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ENDIF () -+ -+IF (CMAKE_BUILD_TYPE STREQUAL Release) -+ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ENDIF () -+ - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) - - MARK_AS_ADVANCED(embree_DIR) diff --git a/ports/embree3/fix-path.patch b/ports/embree3/fix-path.patch new file mode 100755 index 00000000000000..ff25a43aad5a89 --- /dev/null +++ b/ports/embree3/fix-path.patch @@ -0,0 +1,117 @@ +diff --git a/common/algorithms/CMakeLists.txt b/common/algorithms/CMakeLists.txt +index 5667d2bd3..cb26776a4 100644 +--- a/common/algorithms/CMakeLists.txt ++++ b/common/algorithms/CMakeLists.txt +@@ -17,11 +17,4 @@ ADD_LIBRARY(algorithms OBJECT + SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common) + SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + +-# ideally we would use target_link_libraries to provide the algorithms target +-# with the TBB include directory information. Howeve, this is only possible in +-# very recent versions of TBB and therefore we use the target property instead +-GET_TARGET_PROPERTY(tasking_include_dirs tasking INCLUDE_DIRECTORIES) +-if (tasking_include_dirs) +- TARGET_INCLUDE_DIRECTORIES(algorithms PUBLIC "${tasking_include_dirs}") +- GET_TARGET_PROPERTY(algorithms_include_dirs algorithms INCLUDE_DIRECTORIES) +-endif() ++TARGET_LINK_LIBRARIES(algorithms PUBLIC tasking) +diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake +index 9b7370ccd..14ce929d6 100644 +--- a/common/cmake/embree-config.cmake ++++ b/common/cmake/embree-config.cmake +@@ -5,8 +5,6 @@ SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) + GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) + + SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) +-SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) +-SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) + + SET(EMBREE_VERSION @EMBREE_VERSION@) + SET(EMBREE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@) +@@ -22,7 +20,6 @@ SET(EMBREE_ISA_AVX2 @EMBREE_ISA_AVX2@) + SET(EMBREE_ISA_AVX512KNL @EMBREE_ISA_AVX512KNL@) + SET(EMBREE_ISA_AVX512SKX @EMBREE_ISA_AVX512SKX@) + +-SET(EMBREE_BUILD_TYPE @CMAKE_BUILD_TYPE@) + SET(EMBREE_ISPC_SUPPORT @EMBREE_ISPC_SUPPORT@) + SET(EMBREE_STATIC_LIB @EMBREE_STATIC_LIB@) + SET(EMBREE_TUTORIALS @EMBREE_TUTORIALS@) +@@ -53,10 +50,6 @@ IF (EMBREE_STATIC_LIB) + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/simd-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/lexers-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake") +- +- add_library(TBB::tbb SHARED IMPORTED) +- set_target_properties(TBB::tbb PROPERTIES IMPORTED_LOCATION "${EMBREE_ROOT_DIR}/@EMBREE_INSTALLED_TBB@") +- + ENDIF() + + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake") +diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake +index a4da0001a..b6f82e981 100644 +--- a/common/cmake/package.cmake ++++ b/common/cmake/package.cmake +@@ -20,16 +20,6 @@ ELSE() + ENDIF() + ENDIF() + +-############################################################## +-# Install MSVC runtime +-############################################################## +- +-IF (WIN32) +- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) +- INCLUDE(InstallRequiredSystemLibraries) +- LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll") +- INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT lib) +-ENDIF() + + ############################################################## + # Install Headers +@@ -106,18 +96,9 @@ ELSE() + ENDIF() + ENDIF() + +-IF (WIN32 OR EMBREE_ZIP_MODE) +- # for local "installs" and on Windows we want the cmake config files placed +- # in the install root, such that users can point the CMake variable +- # embree_DIR just to the install folder +- SET(EMBREE_CMAKECONFIG_DIR ".") +- SET(EMBREE_CMAKEEXPORT_DIR "cmake") +- SET(EMBREE_RELATIV_ROOT_DIR ".") +-ELSE() +- SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") +- SET(EMBREE_CMAKEEXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") +- FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/") +-ENDIF() ++SET(EMBREE_CMAKECONFIG_DIR "share/embree") ++SET(EMBREE_CMAKEEXPORT_DIR "share/embree3") ++SET(EMBREE_RELATIV_ROOT_DIR "../..") + + CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY) + CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY) +diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt +index 71ef29612..c846004e3 100644 +--- a/common/tasking/CMakeLists.txt ++++ b/common/tasking/CMakeLists.txt +@@ -10,7 +10,7 @@ ELSEIF (TASKING_TBB) + if (NOT ${EMBREE_TBB_ROOT} STREQUAL "") + set(TBB_ROOT ${EMBREE_TBB_ROOT}) + endif() +- FIND_PACKAGE(TBB REQUIRED tbb) ++ FIND_PACKAGE(TBB CONFIG REQUIRED tbb) + + ############################################################## + # Create tasking target and link against TBB. Also set include directory +@@ -18,10 +18,7 @@ ELSEIF (TASKING_TBB) + # with the TBB header files + ############################################################## + ADD_LIBRARY(tasking STATIC taskschedulertbb.cpp) +- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB) +- TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}") +- +- include(installTBB) ++ TARGET_LINK_LIBRARIES(tasking PUBLIC TBB::tbb) + + ELSEIF (TASKING_PPL) + ADD_LIBRARY(tasking STATIC taskschedulerppl.cpp) diff --git a/ports/embree3/fix-static-usage.patch b/ports/embree3/fix-static-usage.patch new file mode 100644 index 00000000000000..7af99df167ab2b --- /dev/null +++ b/ports/embree3/fix-static-usage.patch @@ -0,0 +1,21 @@ +diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake +index 14ce929..7e2e8f5 100644 +--- a/common/cmake/embree-config.cmake ++++ b/common/cmake/embree-config.cmake +@@ -50,6 +50,16 @@ IF (EMBREE_STATIC_LIB) + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/simd-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/lexers-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake") ++ ++ IF(EMBREE_ISA_SSE42) ++ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_sse42-targets.cmake") ++ ENDIF() ++ IF(EMBREE_ISA_AVX) ++ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx-targets.cmake") ++ ENDIF() ++ IF(EMBREE_ISA_AVX2) ++ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx2-targets.cmake") ++ ENDIF() + ENDIF() + + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake") diff --git a/ports/embree3/portfile.cmake b/ports/embree3/portfile.cmake old mode 100644 new mode 100755 index af320ffc1480b9..94530619ea209b --- a/ports/embree3/portfile.cmake +++ b/ports/embree3/portfile.cmake @@ -1,64 +1,41 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO embree/embree - REF 539d4eec716085484f957d7b0d697b1891dafec4 # v3.8.0 - SHA512 77ab07cc7283f1a0c50d7cec07d1cbe4a24a41482b8b043f79a045953fccfa41a854bbc29a76beb67385d1bbb6d43097287ccfd3e1d2c84c1a5d55a2696d0815 + REF v3.11.0 + SHA512 a20acb07103d322eebc85d41152210466f8d9b97e7a332589c692f649ee02079465f89561748ddc8448fb40bc63f2595d728cc31a927f7b95bea13446c5c775d HEAD_REF master PATCHES - fix-InstallPath.patch - fix-cmake-path.patch - fix-embree-path.patch + fix-path.patch + fix-static-usage.patch ) -file(REMOVE ${SOURCE_PATH}/common/cmake/FindTBB.cmake) - -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(EMBREE_STATIC_RUNTIME ON) -else() - set(EMBREE_STATIC_RUNTIME OFF) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(EMBREE_STATIC_LIB ON) -else() - set(EMBREE_STATIC_LIB OFF) -endif() +string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static EMBREE_STATIC_LIB) +string(COMPARE EQUAL ${VCPKG_CRT_LINKAGE} static EMBREE_STATIC_RUNTIME) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE - PREFER_NINJA # Disable this option if project cannot be built with Ninja + PREFER_NINJA OPTIONS -DEMBREE_ISPC_SUPPORT=OFF -DEMBREE_TUTORIALS=OFF -DEMBREE_STATIC_RUNTIME=${EMBREE_STATIC_RUNTIME} -DEMBREE_STATIC_LIB=${EMBREE_STATIC_LIB} - "-DTBB_LIBRARIES=TBB::tbb" - "-DTBB_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include" ) -# just wait, the release build of embree is insanely slow in MSVC -# a single file will took about 2-10 min vcpkg_install_cmake() vcpkg_copy_pdbs() - -vcpkg_fixup_cmake_targets(CONFIG_PATH share/embree3 TARGET_PATH share/embree) +vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -if (EXISTS ${CURRENT_PACKAGES_DIR}/uninstall.command) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/uninstall.command) +if(APPLE) + file(REMOVE ${CURRENT_PACKAGES_DIR}/uninstall.command ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) endif() -if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) -endif() - -file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/embree/doc) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/${PORT}/doc) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${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) \ No newline at end of file diff --git a/ports/embree3/usage b/ports/embree3/usage new file mode 100755 index 00000000000000..8622f121d74664 --- /dev/null +++ b/ports/embree3/usage @@ -0,0 +1,4 @@ +The package embree3 provides CMake targets: + + find_package(embree 3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE embree) diff --git a/ports/ensmallen/CONTROL b/ports/ensmallen/CONTROL index 2a93222c607da1..39a63bc91594a7 100644 --- a/ports/ensmallen/CONTROL +++ b/ports/ensmallen/CONTROL @@ -1,6 +1,6 @@ Source: ensmallen Version: 2.11.2 +Port-Version: 2 Homepage: https://github.com/mlpack/ensmallen Description: A header-only C++ library for mathematical optimization. -Build-Depends: openblas (!osx), clapack (!osx), armadillo - +Build-Depends: openblas, lapack, armadillo diff --git a/ports/entt/CONTROL b/ports/entt/CONTROL index 5bcd721ef14c1d..a713aaff95a5ae 100644 --- a/ports/entt/CONTROL +++ b/ports/entt/CONTROL @@ -1,4 +1,4 @@ Source: entt -Version: 3.4.0 +Version: 3.5.1 Description: Gaming meets modern C++ - a fast and reliable entity-component system and much more. Homepage: https://github.com/skypjack/entt diff --git a/ports/entt/portfile.cmake b/ports/entt/portfile.cmake index 7be4e0527d10ed..68e26364957bf4 100644 --- a/ports/entt/portfile.cmake +++ b/ports/entt/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO skypjack/entt - REF v3.4.0 - SHA512 0094d2bff106754a3d8500152ea3206d2e0e0a8043ab54794faf6b5caa02dd2f0675011dafdd6e33de105c464204034b2a7d9380fe77a4d8b67f07f05e7f0152 + REF v3.5.1 + SHA512 41d4c56f04e6d98218ce5994636407cef7a73c75a4f3b982b0756b0496002b841c22a652a28575e5d683c45459d66dba47dec3d51a92963b372cb72e95df8a0f HEAD_REF master ) diff --git a/ports/evpp/CONTROL b/ports/evpp/CONTROL index 68244157bf24e1..047c77a4404031 100644 --- a/ports/evpp/CONTROL +++ b/ports/evpp/CONTROL @@ -1,5 +1,6 @@ Source: evpp -Version: 0.7.0-3 +Version: 0.7.0 +Port-Version: 4 Homepage: https://github.com/Qihoo360/evpp Description: A modern C++ network library based on libevent for developing high performance network services in TCP/UDP/HTTP protocols. Build-Depends: glog, libevent (windows), libevent[openssl] (!windows), rapidjson, concurrentqueue (!windows), boost-lockfree (!windows) \ No newline at end of file diff --git a/ports/evpp/fix-linux-build.patch b/ports/evpp/fix-linux-build.patch index 2b772a145a49ea..b5673b27c49cd3 100644 --- a/ports/evpp/fix-linux-build.patch +++ b/ports/evpp/fix-linux-build.patch @@ -11,7 +11,7 @@ index 7872fc8..2a06614 100644 + find_path(GLOG_INCLUDE_DIRS logging.h PATH_SUFFIXES glog) + find_package(Libevent CONFIG REQUIRED) + list(APPEND DEPENDENT_INCLUDE_DIRS "${GLOG_INCLUDE_DIRS}/../") -+ SET(DEPENDENT_LIBRARIES event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) ++ SET(DEPENDENT_LIBRARIES libevent::core libevent::extra libevent::openssl glog::glog pthread) else (UNIX) SET(DEPENDENT_LIBRARIES event glog) endif (UNIX) @@ -24,7 +24,7 @@ index 469ed1c..8219424 100644 if (UNIX) -set(LIBRARIES evpp_concurrentqueue event glog pthread) -+set(LIBRARIES evpp_concurrentqueue event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) ++set(LIBRARIES evpp_concurrentqueue libevent::core libevent::extra libevent::openssl glog::glog pthread) link_directories("/home/s/safe/lib" ${PROJECT_BUILD_DIR}/lib) else(UNIX) set(LIBRARIES evpp_static event glog) @@ -36,7 +36,7 @@ index 1148616..0356b71 100644 add_executable(benchmark_http_libevent libevent_http_bench.c) -target_link_libraries(benchmark_http_libevent event) -+target_link_libraries(benchmark_http_libevent event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_http_libevent libevent::core libevent::extra libevent::openssl) diff --git a/benchmark/ioevent/libevent/CMakeLists.txt b/benchmark/ioevent/libevent/CMakeLists.txt index dfa51a3..de4849d 100644 --- a/benchmark/ioevent/libevent/CMakeLists.txt @@ -45,7 +45,7 @@ index dfa51a3..de4849d 100644 add_executable(benchmark_ioevent_libevent libevent_ioevent_bench.c) -target_link_libraries(benchmark_ioevent_libevent event) -+target_link_libraries(benchmark_ioevent_libevent event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_ioevent_libevent libevent::core libevent::extra libevent::openssl) diff --git a/benchmark/throughput/libevent/CMakeLists.txt b/benchmark/throughput/libevent/CMakeLists.txt index 21dab84..aefe698 100644 --- a/benchmark/throughput/libevent/CMakeLists.txt @@ -53,11 +53,11 @@ index 21dab84..aefe698 100644 @@ -1,5 +1,5 @@ add_executable(benchmark_tcp_libevent_client client.c) -target_link_libraries(benchmark_tcp_libevent_client event) -+target_link_libraries(benchmark_tcp_libevent_client event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_tcp_libevent_client libevent::core libevent::extra libevent::openssl) add_executable(benchmark_tcp_libevent_server server.c) -target_link_libraries(benchmark_tcp_libevent_server event) -+target_link_libraries(benchmark_tcp_libevent_server event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_tcp_libevent_server libevent::core libevent::extra libevent::openssl) diff --git a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt index 7834db4..82294c5 100644 --- a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt @@ -67,7 +67,7 @@ index 7834db4..82294c5 100644 add_executable(example_recipes_self_control_timer_basic_01 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_01 event) -+target_link_libraries(example_recipes_self_control_timer_basic_01 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_basic_01 libevent::core libevent::extra libevent::openssl) @@ -80,7 +80,7 @@ index a8be419..0329ccc 100644 add_executable(example_recipes_self_control_timer_basic_02 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_02 event) -+target_link_libraries(example_recipes_self_control_timer_basic_02 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_basic_02 libevent::core libevent::extra libevent::openssl) @@ -93,7 +93,7 @@ index 1cae9bb..218b771 100644 add_executable(example_recipes_self_control_timer_cancel_03 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_cancel_03 event) -+target_link_libraries(example_recipes_self_control_timer_cancel_03 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_cancel_03 libevent::core libevent::extra libevent::openssl) @@ -106,7 +106,7 @@ index 749c584..e7c658e 100644 add_executable(example_recipes_self_control_timer_periodic_04 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_periodic_04 event) -+target_link_libraries(example_recipes_self_control_timer_periodic_04 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_periodic_04 libevent::core libevent::extra libevent::openssl) diff --git a/ports/exiv2/CONTROL b/ports/exiv2/CONTROL index 35af4ff70ce241..14be794c7699ae 100644 --- a/ports/exiv2/CONTROL +++ b/ports/exiv2/CONTROL @@ -1,8 +1,17 @@ Source: exiv2 Version: 0.27.3 -Build-Depends: zlib, expat, libiconv, gettext +Port-Version: 2 +Build-Depends: zlib, libiconv, gettext Description: Image metadata library and tools Homepage: https://www.exiv2.org +Supports: !uwp Feature: unicode Description: Compile with unicode support on windows + +Feature: xmp +Description: Build with XMP metadata support +Build-Depends: expat + +Feature: video +Description: Build video support into library diff --git a/ports/exiv2/portfile.cmake b/ports/exiv2/portfile.cmake index 966c9eff81c392..262be9d358d286 100644 --- a/ports/exiv2/portfile.cmake +++ b/ports/exiv2/portfile.cmake @@ -1,3 +1,6 @@ +#https://github.com/Exiv2/exiv2/issues/1063 +vcpkg_fail_port_install(ON_TARGET "uwp") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Exiv2/exiv2 @@ -6,17 +9,21 @@ vcpkg_from_github( HEAD_REF master ) -if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND ("unicode" IN_LIST FEATURES)) - set(enable_win_unicode TRUE) -elseif() - set(enable_win_unicode FALSE) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + unicode EXIV2_ENABLE_WIN_UNICODE + xmp EXIV2_ENABLE_XMP + video EXIV2_ENABLE_VIDEO +) + +if("unicode" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS) + message(FATAL_ERROR "Feature unicode only supports Windows platform.") endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DEXIV2_ENABLE_WIN_UNICODE:BOOL=${enable_win_unicode} + ${FEATURE_OPTIONS} -DEXIV2_BUILD_EXIV2_COMMAND:BOOL=FALSE -DEXIV2_BUILD_UNIT_TESTS:BOOL=FALSE -DEXIV2_BUILD_SAMPLES:BOOL=FALSE @@ -27,7 +34,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/exiv2) configure_file( ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - ${CURRENT_PACKAGES_DIR}/share/exiv2 + ${CURRENT_PACKAGES_DIR}/share/${PORT} @ONLY ) @@ -42,5 +49,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/exiv2) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/exiv2/COPYING ${CURRENT_PACKAGES_DIR}/share/exiv2/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/expat/CONTROL b/ports/expat/CONTROL index 9007da6cdd7703..2bfc11ab7f6430 100644 --- a/ports/expat/CONTROL +++ b/ports/expat/CONTROL @@ -1,5 +1,4 @@ Source: expat -Version: 2.2.7 +Version: 2020-08-18 Homepage: https://github.com/libexpat/libexpat Description: XML parser library written in C -Supports: !uwp \ No newline at end of file diff --git a/ports/expat/pkgconfig.patch b/ports/expat/pkgconfig.patch new file mode 100644 index 00000000000000..401daf737e10c0 --- /dev/null +++ b/ports/expat/pkgconfig.patch @@ -0,0 +1,15 @@ +diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt +index a67f081b1..cc220f2a1 100644 +--- a/expat/CMakeLists.txt ++++ b/expat/CMakeLists.txt +@@ -294,7 +294,9 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL + # + # pkg-config file + # ++string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER) ++set(_EXPAT_OUTPUT_NAME ${_EXPAT_OUTPUT_NAME}${CMAKE_${BUILD_TYPE_UPPER}_POSTFIX}) +-if(NOT MSVC) ++if(1) + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") + set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index 7b97fb3de8f244..252d0f8ef855d3 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -1,14 +1,12 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() - -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libexpat/libexpat - REF R_2_2_7 - SHA512 11b1f9a135c4501ef0112e17da8381e956366165a11a384daedd4cdef9a00c3112c8f6ff8c8f6d3b5e7b71b9a73041f23beac0f27e9cfafe1ec0266d95870408 - HEAD_REF master) + REF c092d40c300c6d219cb3b111932a824022265370 #Head from commit 2020-08-18 + SHA512 5a5d41b500f5602a32aea8f4e15593e639206bb3f97553497e80b2975360cac88ac90386f5efc11728614f24bbb620fb908a3c8ca71c9e7b312f6157b2477afe + HEAD_REF master + PATCHES + pkgconfig.patch +) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(EXPAT_LINKAGE ON) @@ -20,28 +18,30 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/expat PREFER_NINJA OPTIONS - -DBUILD_examples=OFF - -DBUILD_tests=OFF - -DBUILD_tools=OFF - -DBUILD_shared=${EXPAT_LINKAGE} + -DEXPAT_BUILD_EXAMPLES=OFF + -DEXPAT_BUILD_TESTS=OFF + -DEXPAT_BUILD_TOOLS=OFF + -DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE} ) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) -file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat RENAME copyright) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/expat-2.2.9) +vcpkg_fixup_pkgconfig() -vcpkg_copy_pdbs() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -# CMake's FindExpat currently doesn't look for expatd.lib -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/expatd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/expatd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/expat.lib) -endif() - -file(READ ${CURRENT_PACKAGES_DIR}/include/expat_external.h EXPAT_EXTERNAL_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "!defined(XML_STATIC)" "/* vcpkg static build !defined(XML_STATIC) */ 0" EXPAT_EXTERNAL_H "${EXPAT_EXTERNAL_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/expat_external.h + "! defined(XML_STATIC)" + "/* vcpkg static build ! defined(XML_STATIC) */ 0" + ) endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}") -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat) +vcpkg_copy_pdbs() + +#Handle copyright +file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/expat/usage b/ports/expat/usage deleted file mode 100644 index a2d35a66e39bf8..00000000000000 --- a/ports/expat/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package expat is compatible with built-in CMake targets: - - find_package(EXPAT REQUIRED) - target_link_libraries(main PRIVATE EXPAT::EXPAT) diff --git a/ports/expat/vcpkg-cmake-wrapper.cmake b/ports/expat/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..4d3e9e05d9c84d --- /dev/null +++ b/ports/expat/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,27 @@ +include(SelectLibraryConfigurations) + +set(EXPATNAMES expat expatw libexpat libexpatw) +set(DEBUGNAMES) +foreach(_CRT "" MT MD) + foreach(name IN LISTS EXPATNAMES) + list(APPEND EXPATNAMES ${name}${_CRT}) + list(APPEND DEBUGNAMES ${name}d${_CRT}) + endforeach() +endforeach() + +find_library(EXPAT_LIBRARY_DEBUG NAMES ${DEBUGNAMES} ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) +find_library(EXPAT_LIBRARY_RELEASE NAMES ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) +select_library_configurations(EXPAT) +set(EXPAT_LIBRARY "${EXPAT_LIBRARIES}" CACHE STRING "" FORCE) +_find_package(${ARGS}) +if(EXPAT_FOUND AND TARGET EXPAT::EXPAT) + if(EXPAT_LIBRARY_DEBUG) + set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_DEBUG "${EXPAT_LIBRARY_DEBUG}") + endif() + if(EXPAT_LIBRARY_RELEASE) + set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_RELEASE "${EXPAT_LIBRARY_RELEASE}") + endif() +endif() + +unset(EXPATNAMES) +unset(DEBUGNAMES) \ No newline at end of file diff --git a/ports/farmhash/CONTROL b/ports/farmhash/CONTROL index f27140fbd01d5a..7d7f4d386f528c 100644 --- a/ports/farmhash/CONTROL +++ b/ports/farmhash/CONTROL @@ -1,5 +1,6 @@ Source: farmhash -Version: 1.1-1 +Version: 1.1 +Port-Version: 2 Homepage: https://github.com/google/farmhash Description: FarmHash, a family of hash functions. Supports: !arm diff --git a/ports/farmhash/portfile.cmake b/ports/farmhash/portfile.cmake index d9bcc924063610..801e0570651319 100644 --- a/ports/farmhash/portfile.cmake +++ b/ports/farmhash/portfile.cmake @@ -14,6 +14,7 @@ if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This endif() file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) diff --git a/ports/fdk-aac/CMakeLists.txt b/ports/fdk-aac/CMakeLists.txt index a7f6c09b2c197a..67db1b323093fc 100644 --- a/ports/fdk-aac/CMakeLists.txt +++ b/ports/fdk-aac/CMakeLists.txt @@ -198,6 +198,6 @@ if(NOT DISABLE_INSTALL_HEADERS) libSYS/include/FDK_audio.h libSYS/include/genericStds.h libSYS/include/machine_type.h - DESTINATION include + DESTINATION include/fdk-aac ) endif() diff --git a/ports/fdk-aac/CONTROL b/ports/fdk-aac/CONTROL index c7262f86132d2b..fe523b9b8101b3 100644 --- a/ports/fdk-aac/CONTROL +++ b/ports/fdk-aac/CONTROL @@ -1,4 +1,4 @@ Source: fdk-aac -Version: 2018-07-08-1 +Version: 2018-07-08-2 Homepage: https://github.com/mstorsjo/fdk-aac Description: A standalone library of the Fraunhofer FDK AAC code diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index 6fe0780db17aff..f1ea01e6b513e5 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -12,7 +12,7 @@ index bd2de34..fba948a 100755 *) optname="${opt%%=*}" optname="${optname#--}" -@@ -6152,8 +6155,13 @@ fi +@@ -6152,8 +6153,13 @@ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || check_lib zlib zlib.h zlibVersion -lz; } @@ -28,3 +28,16 @@ index bd2de34..fba948a 100755 # On some systems dynamic loading requires no extra linker flags check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl +@@ -6350,7 +6350,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8 + enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer + enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || + require libsmbclient libsmbclient.h smbc_init -lsmbclient; } +-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++if enabled debug_configure; then ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappyd -lstdc++ ++else ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++fi + enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index 9fffd9d7e51ae4..bec0303681b9dc 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -2,15 +2,35 @@ diff --git a/configure b/configure index 3bdcfc6..00b2f13 100644 --- a/configure +++ b/configure -@@ -6360,6 +6360,7 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" +@@ -6251,7 +6251,8 @@ if enabled libmfx; then + enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit || + { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } + enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load +-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ++enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs || ++ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; } + enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load || + require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; } + enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei || +@@ -6292,7 +6293,7 @@ if enabled debug_configure; then + else + enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ + fi +-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr ++enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init + enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket +@@ -6360,6 +6361,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel || check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL || + check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32|| ++ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl || die "ERROR: opencl not found"; } && { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || -@@ -6379,6 +6380,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP +@@ -6379,6 +6382,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || @@ -18,3 +38,12 @@ index 3bdcfc6..00b2f13 100644 die "ERROR: openssl not found"; } enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create && +@@ -6707,7 +6711,7 @@ enabled amf && + if enabled libc_iconv; then + check_func_headers iconv.h iconv + elif enabled iconv; then +- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv ++ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -llibcharset + fi + + enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch new file mode 100644 index 00000000000000..c9fb9db216ec13 --- /dev/null +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -0,0 +1,15 @@ +diff --git a/configure b/configure +index d6c4388..75b96c3 100644 +--- a/configure ++++ b/configure +@@ -4378,6 +4378,10 @@ msvc_common_flags(){ + -march=*) ;; + -lz) echo zlib.lib ;; + -lx264) echo libx264.lib ;; ++ -lx265) echo libx265.lib ;; ++ -lmp3lame) echo libmp3lame.lib ;; ++ -liconv) echo libiconv.lib ;; ++ -lm) ;; + -lstdc++) ;; + -l*) echo ${flag#-l}.lib ;; + -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/0008-Fix-wavpack-detection.patch b/ports/ffmpeg/0008-Fix-wavpack-detection.patch new file mode 100644 index 00000000000000..959ee8a1bf54e9 --- /dev/null +++ b/ports/ffmpeg/0008-Fix-wavpack-detection.patch @@ -0,0 +1,27 @@ +diff --git a/configure b/configure +index e7162dbc56..0f04af2a81 100755 +--- a/configure ++++ b/configure +@@ -6391,7 +6391,7 @@ enabled libvpx && { + fi + } + +-enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack ++enabled libwavpack && { check_pkg_config libwavpack wavpack wavpack.h WavpackOpenFileOutput || check_lib libwavpack wavpack.h WavpackOpenFileOutput -lwavpack || check_lib libwavpack wavpack.h WavpackOpenFileOutput -llibwavpack || require libwavpack wavpack.h WavpackOpenFileOutput -lwavpackdll; } + enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } +diff --git a/libavcodec/libwavpackenc.c b/libavcodec/libwavpackenc.c +index e84b074893..9adf39861b 100644 +--- a/libavcodec/libwavpackenc.c ++++ b/libavcodec/libwavpackenc.c +@@ -16,7 +16,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#include ++#include + #include + + #include "libavutil/attributes.h" + diff --git a/ports/ffmpeg/0009-Fix-fdk-detection.patch b/ports/ffmpeg/0009-Fix-fdk-detection.patch new file mode 100644 index 00000000000000..3d280fd2b33aa5 --- /dev/null +++ b/ports/ffmpeg/0009-Fix-fdk-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34c92230f4 100755 +--- a/configure ++++ b/configure +@@ -6331,7 +6331,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2. + enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new + enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion + enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || +- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && ++ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac -lm -lstdc++ && + warn "using libfdk without pkg-config"; } } + flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" + enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs + diff --git a/ports/ffmpeg/0010-Fix-x264-detection.patch b/ports/ffmpeg/0010-Fix-x264-detection.patch new file mode 100644 index 00000000000000..2cbf85eaf81a8b --- /dev/null +++ b/ports/ffmpeg/0010-Fix-x264-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34a2e644c4 100755 +--- a/configure ++++ b/configure +@@ -6443,7 +6443,7 @@ enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } + enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || +- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && ++ { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" && + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" + diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch new file mode 100644 index 00000000000000..54a216ac242813 --- /dev/null +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index 34a2e644c4..0ea64bd306 100755 +--- a/configure ++++ b/configure +@@ -6447,7 +6447,9 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" +-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && ++enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || ++ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" && ++ warn "using libx265 without pkg-config"; } } && + require_cpp_condition libx265 x265.h "X265_BUILD >= 68" + enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" + enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get + diff --git a/ports/ffmpeg/0012-Fix-ssl-110-detection.patch b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch new file mode 100644 index 00000000000000..b8666e6b0588d3 --- /dev/null +++ b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 2be953f7e7..e075949ffc 100755 +--- a/configure ++++ b/configure +@@ -6497,6 +6497,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR + die "ERROR: OpenMAX IL headers not found"; } && enable omx + enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || + check_pkg_config openssl openssl openssl/ssl.h SSL_library_init || ++ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index fadb1a29c892c4..55f47aaf336f43 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,10 +1,10 @@ Source: ffmpeg -Version: 4.2-13 -Build-Depends: zlib +Version: 4.2 +Port-Version: 23 Homepage: https://ffmpeg.org Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. -Default-Features: avresample +Default-Features: avresample, avcodec, avformat, avdevice, avfilter, postproc, swresample, swscale Feature: ffmpeg Description: build the ffmpeg.exe application @@ -13,34 +13,35 @@ Feature: ffserver Description: ffserver appplication support in ffmpeg Feature: ffplay +Build-Depends: ffmpeg[sdl2] Description: ffplay appplication support in ffmpeg Feature: ffprobe Description: ffprobe appplication support in ffmpeg -Feature: openssl -Build-Depends: openssl, ffmpeg[nonfree] -Description: openssl support in ffmpeg +Feature: avcodec +Description: Codec support in ffmpeg -Feature: lzma -Build-Depends: liblzma -Description: lzma support in ffmpeg +Feature: avformat +Description: Format support in ffmpeg -Feature: bzip2 -Build-Depends: bzip2 -Description: bzip2 support in ffmpeg +Feature: avdevice +Description: Device support in ffmpeg -Feature: vpx -Build-Depends: libvpx -Description: WebM VP8/VP9 support in ffmpeg +Feature: avfilter +Description: Filter support in ffmpeg -Feature: x264 -Build-Depends: x264, ffmpeg[gpl] -Description: x264 support in ffmpeg +Feature: postproc +Description: Postproc support in ffmpeg -Feature: opencl -Build-Depends: opencl -Description: opencl support in ffmpeg +Feature: swresample +Description: Swresample support in ffmpeg + +Feature: swscale +Description: Swscale support in ffmpeg + +Feature: avresample +Description: Libav audio resampling library support in ffmpeg Feature: nonfree Description: allow nonfree and unredistributable libraries @@ -51,13 +52,86 @@ Description: allow GPL licensed libraries Feature: version3 Description: upgrade (L)GPL to version 3 -Feature: avresample -Description: Libav audio resampling library support in ffmpeg +Feature: avisynthplus +Build-Depends: avisynthplus, ffmpeg[gpl] +Description: avisynthplus support in ffmpeg + +Feature: bzip2 +Build-Depends: bzip2 +Description: bzip2 support in ffmpeg + +Feature: iconv +Build-Depends: libiconv +Description: iconv support in ffmpeg + +Feature: fdk-aac +Build-Depends: fdk-aac, ffmpeg[nonfree] +Description: AAC de/encoding via libfdk-aac support in ffmpeg + +Feature: lzma +Build-Depends: liblzma +Description: lzma support in ffmpeg + +Feature: mp3lame +Build-Depends: mp3lame +Description: MP3 encoding via libmp3lame support in ffmpeg Feature: nvcodec -Build-Depends: ffnvcodec, cuda +Build-Depends: ffnvcodec Description: Hardware accelerated codecs -Feature: avisynthplus -Build-Depends: avisynthplus, ffmpeg[gpl] -Description: avisynthplus support in ffmpeg +Feature: opencl +Build-Depends: opencl +Description: OpenCL processing support in ffmpeg + +Feature: openssl +Build-Depends: openssl, ffmpeg[nonfree] +Description: openssl support in ffmpeg + +Feature: opus +Build-Depends: opus +Description: Opus de/encoding via libopus support in ffmpeg + +Feature: sdl2 +Build-Depends: sdl2 +Description: sdl2 support in ffmpeg + +Feature: snappy +Build-Depends: snappy +Description: Snappy compression, needed for hap encoding support in ffmpeg + +Feature: soxr +Build-Depends: soxr +Description: libsoxr resampling support in ffmpeg + +Feature: speex +Build-Depends: speex +Description: Speex de/encoding via libspeex support in ffmpeg + +Feature: theora +Build-Depends: libtheora +Description: Theora encoding via libtheora support in ffmpeg + +Feature: vorbis +Build-Depends: libvorbis +Description: Vorbis en/decoding via libvorbis support in ffmpeg + +Feature: vpx +Build-Depends: libvpx +Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg + +Feature: wavpack +Build-Depends: wavpack +Description: wavpack encoding via libwavpack support in ffmpeg + +Feature: x264 +Build-Depends: x264, ffmpeg[gpl] +Description: H.264 encoding via x264 support in ffmpeg + +Feature: x265 +Build-Depends: x265, ffmpeg[gpl] +Description: HEVC encoding via x265 support in ffmpeg + +Feature: zlib +Build-Depends: zlib +Description: zlib support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index cd61ffcc85604b..778666a75384e2 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,7 +33,10 @@ set(FFMPEG_VERSION "4.2") find_dependency(Threads) if(UNIX) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lX11) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread) +endif() +if(UNIX AND NOT APPLE) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11) endif() if(@ENABLE_BZIP2@) @@ -43,60 +46,183 @@ if(@ENABLE_BZIP2@) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${BZip2_LIBRARY_DEBUG}>$<$:${BZip2_LIBRARY_RELEASE}>") endif() +if(@ENABLE_ICONV@) + find_dependency(unofficial-iconv) + get_target_property(ICONV_LIBRARY_RELEASE unofficial::iconv::libiconv IMPORTED_LOCATION_RELEASE) + get_target_property(ICONV_LIBRARY_DEBUG unofficial::iconv::libiconv IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${ICONV_LIBRARY_DEBUG}>$<$:${ICONV_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_FDKAAC@) + find_library(FDK_LIBRARY_RELEASE NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FDK_LIBRARY_DEBUG NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(FDK) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${FDK_LIBRARY_DEBUG}>$<$:${FDK_LIBRARY_RELEASE}>") +endif() + if(@ENABLE_LZMA@) find_dependency(LibLZMA) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LibLZMA_LIBRARY_DEBUG}>$<$:${LibLZMA_LIBRARY_RELEASE}>") endif() +if(@ENABLE_LAME@) + find_dependency(mp3lame) + get_target_property(LAME_LIBRARY_RELEASE mp3lame::mp3lame IMPORTED_LOCATION_RELEASE) + get_target_property(LAME_LIBRARY_DEBUG mp3lame::mp3lame IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LAME_LIBRARY_DEBUG}>$<$:${LAME_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENCL@) + find_dependency(OpenCL) + get_target_property(OPENCL_LIBRARY_RELEASE OpenCL::OpenCL IMPORTED_LOCATION_RELEASE) + get_target_property(OPENCL_LIBRARY_DEBUG OpenCL::OpenCL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${OPENCL_LIBRARY_DEBUG}>$<$:${OPENCL_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENSSL@) + find_dependency(OpenSSL) + get_target_property(LIBSSL_LIBRARY_RELEASE OpenSSL::SSL IMPORTED_LOCATION_RELEASE) + get_target_property(LIBSSL_LIBRARY_DEBUG OpenSSL::SSL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LIBSSL_LIBRARY_DEBUG}>$<$:${LIBSSL_LIBRARY_RELEASE}>") + get_target_property(LIBCRYPTO_LIBRARY_RELEASE OpenSSL::Crypto IMPORTED_LOCATION_RELEASE) + get_target_property(LIBCRYPTO_LIBRARY_DEBUG OpenSSL::Crypto IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LIBCRYPTO_LIBRARY_DEBUG}>$<$:${LIBCRYPTO_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPUS@) + find_dependency(Opus) + get_target_property(OPUS_LIBRARY_RELEASE Opus::opus IMPORTED_LOCATION_RELEASE) + get_target_property(OPUS_LIBRARY_DEBUG Opus::opus IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${OPUS_LIBRARY_DEBUG}>$<$:${OPUS_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SDL2@) + find_dependency(SDL2) + get_target_property(SDL2_LIBRARY_RELEASE SDL2::SDL2 IMPORTED_LOCATION_RELEASE) + get_target_property(SDL2_LIBRARY_DEBUG SDL2::SDL2 IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SDL2_LIBRARY_DEBUG}>$<$:${SDL2_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SNAPPY@) + find_dependency(Snappy) + get_target_property(SNAPPY_LIBRARY_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE) + get_target_property(SNAPPY_LIBRARY_DEBUG Snappy::snappy IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SNAPPY_LIBRARY_DEBUG}>$<$:${SNAPPY_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SOXR@) + find_library(SOXR_LIBRARY_RELEASE NAMES soxr PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SOXR_LIBRARY_DEBUG NAMES soxr PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SOXR) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SOXR_LIBRARY_DEBUG}>$<$:${SOXR_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SPEEX@) + find_library(SPEEX_LIBRARY_RELEASE NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SPEEX_LIBRARY_DEBUG NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SPEEX_LIBRARY_DEBUG}>$<$:${SPEEX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_THEORA@) + find_library(THEORA_LIBRARY_RELEASE NAMES theora PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(THEORA_LIBRARY_DEBUG NAMES theora PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${THEORA_LIBRARY_DEBUG}>$<$:${THEORA_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_VORBIS@) + find_dependency(Vorbis) + get_target_property(VORBIS_LIBRARY_RELEASE Vorbis::vorbis IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_LIBRARY_DEBUG Vorbis::vorbis IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBIS_LIBRARY_DEBUG}>$<$:${VORBIS_LIBRARY_RELEASE}>") + get_target_property(VORBISENC_LIBRARY_RELEASE Vorbis::vorbisenc IMPORTED_LOCATION_RELEASE) + get_target_property(VORBISENC_LIBRARY_DEBUG Vorbis::vorbisenc IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBISENC_LIBRARY_DEBUG}>$<$:${VORBISENC_LIBRARY_RELEASE}>") + get_target_property(VORBIS_DEP_LIBRARIES Vorbis::vorbis INTERFACE_LINK_LIBRARIES) + foreach(deps ${VORBIS_DEP_LIBRARIES}) + if(TARGET ${deps}) + get_target_property(VORBIS_DEP_LIBRARY_RELEASE ${deps} IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_DEP_LIBRARY_DEBUG ${deps} INTERFACE_LINK_LIBRARIES) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBIS_DEP_LIBRARY_DEBUG}>$<$:${VORBIS_DEP_LIBRARY_RELEASE}>") + endif() + endforeach() +endif() + +if(@ENABLE_VPX@) + find_dependency(unofficial-libvpx) + get_target_property(VPX_LIBRARY_RELEASE unofficial::libvpx::libvpx IMPORTED_LOCATION_RELEASE) + get_target_property(VPX_LIBRARY_DEBUG unofficial::libvpx::libvpx IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VPX_LIBRARY_DEBUG}>$<$:${VPX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_WAVPACK@) + find_dependency(wavpack) + get_target_property(WAVPACK_LIBRARY_RELEASE WavPack::wavpack IMPORTED_LOCATION_RELEASE) + get_target_property(WAVPACK_LIBRARY_DEBUG WavPack::wavpack IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${WAVPACK_LIBRARY_DEBUG}>$<$:${WAVPACK_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X264@) + find_library(X264_LIBRARY_RELEASE NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X264_LIBRARY_DEBUG NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X264) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${X264_LIBRARY_DEBUG}>$<$:${X264_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X265@) + find_library(X265_LIBRARY_RELEASE NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X265_LIBRARY_DEBUG NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X265) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${X265_LIBRARY_DEBUG}>$<$:${X265_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_ZLIB@) + find_dependency(ZLIB) + get_target_property(ZLIB_LIBRARY_RELEASE ZLIB::ZLIB IMPORTED_LOCATION_RELEASE) + get_target_property(ZLIB_LIBRARY_DEBUG ZLIB::ZLIB IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${ZLIB_LIBRARY_DEBUG}>$<$:${ZLIB_LIBRARY_RELEASE}>") +endif() + # Platform dependent libraries required by FFMPEG if(WIN32) if(NOT CYGWIN) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt strmiids Vfw32 Shlwapi) endif() else() list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m) endif() -macro(FFMPEG_FIND varname shortname headername) - if(NOT FFMPEG_${varname}_INCLUDE_DIRS) - find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg) - endif() - if(NOT FFMPEG_${varname}_LIBRARY) - find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib) - get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY) - find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib) - get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY) - select_library_configurations(FFMPEG_${varname}) - endif() - if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS) - set(FFMPEG_${varname}_FOUND 1) - list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR}) - endif() -endmacro(FFMPEG_FIND) +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +set(_IMPORT_PREFIX) -macro(FFMPEG_FIND_GENEX varname shortname headername) +macro(FFMPEG_FIND varname shortname headername) if(NOT FFMPEG_${varname}_INCLUDE_DIRS) - find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg) + find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${_IMPORT_PREFIX}/include NO_DEFAULT_PATH) endif() if(NOT FFMPEG_${varname}_LIBRARY) - find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib) + find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY) - find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib) get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY) + #select_library_configurations(FFMPEG_${varname}) set(FFMPEG_${varname}_LIBRARY "$<$:${FFMPEG_${varname}_LIBRARY_DEBUG}>$<$:${FFMPEG_${varname}_LIBRARY_RELEASE}>" CACHE STRING "") set(FFMPEG_${varname}_LIBRARIES ${FFMPEG_${varname}_LIBRARY} CACHE STRING "") endif() if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS) - set(FFMPEG_${varname}_FOUND 1) + set(FFMPEG_${varname}_FOUND TRUE BOOL) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${varname}_INCLUDE_DIRS}) + list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${varname}_LIBRARY}) list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR}) endif() -endmacro(FFMPEG_FIND_GENEX) - -if(WIN32) - FFMPEG_FIND_GENEX(libzlib zlib zlib.h) -else() - FFMPEG_FIND_GENEX(libzlib z zlib.h) -endif() +endmacro(FFMPEG_FIND) if(APPLE) find_library(VT_UNIT VideoToolbox) @@ -127,45 +253,66 @@ if(APPLE) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) endif() -FFMPEG_FIND(libavcodec avcodec avcodec.h) -FFMPEG_FIND(libavdevice avdevice avdevice.h) -FFMPEG_FIND(libavfilter avfilter avfilter.h) -FFMPEG_FIND(libavformat avformat avformat.h) -FFMPEG_FIND(libavresample avresample avresample.h) -FFMPEG_FIND(libavutil avutil avutil.h) -FFMPEG_FIND(libswresample swresample swresample.h) -FFMPEG_FIND(libswscale swscale swscale.h) +if(@ENABLE_AVCODEC@) + FFMPEG_FIND(libavcodec avcodec avcodec.h) +endif() +if(@ENABLE_AVDEVICE@) + FFMPEG_FIND(libavdevice avdevice avdevice.h) +endif() +if(@ENABLE_AVFILTER@) + FFMPEG_FIND(libavfilter avfilter avfilter.h) +endif() +if(@ENABLE_AVFORMAT@) + FFMPEG_FIND(libavformat avformat avformat.h) +endif() +if(@ENABLE_AVRESAMPLE@) + FFMPEG_FIND(libavresample avresample avresample.h) +endif() +FFMPEG_FIND(libavutil avutil avutil.h) +if(@ENABLE_POSTPROC@) + FFMPEG_FIND(libpostproc postproc postprocess.h) +endif() +if(@ENABLE_SWRESAMPLE@) + FFMPEG_FIND(libswresample swresample swresample.h) +endif() +if(@ENABLE_SWSCALE@) + FFMPEG_FIND(libswscale swscale swscale.h) +endif() -if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS}) +if (FFMPEG_libavutil_FOUND) list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) + set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + if(FFMPEG_libavcodec_FOUND) + set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavdevice_FOUND) + set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavfilter_FOUND) + set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavformat_FOUND) + set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() if(FFMPEG_libavresample_FOUND) set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") endif() - set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + if(FFMPEG_libswresample_FOUND) + set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libswscale_FOUND) + set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() list(APPEND FFMPEG_LIBRARIES - ${FFMPEG_libavdevice_LIBRARY} - ${FFMPEG_libavfilter_LIBRARY} - ${FFMPEG_libavformat_LIBRARY} - ${FFMPEG_libswscale_LIBRARY} - ${FFMPEG_libavcodec_LIBRARY} - ${FFMPEG_libswresample_LIBRARY} - ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} - ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) + set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES}) + set(FFMPEG_FOUND TRUE CACHE BOOL "") set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "") set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "") set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "") diff --git a/ports/ffmpeg/build.sh b/ports/ffmpeg/build.sh deleted file mode 100644 index 40f1797cdad767..00000000000000 --- a/ports/ffmpeg/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/bash -set -e -export PATH=/usr/bin:$PATH -export PKG_CONFIG_PATH="`cygpath -p ${PKG_CONFIG_PATH}`" -# Export HTTP(S)_PROXY as http(s)_proxy: -if [ "$HTTP_PROXY" ]; then - export http_proxy=$HTTP_PROXY -fi -if [ "$HTTPS_PROXY" ]; then - export https_proxy=$HTTPS_PROXY -fi - -PATH_TO_BUILD_DIR="`cygpath "$1"`" -PATH_TO_SRC_DIR="`cygpath "$2"`" -PATH_TO_PACKAGE_DIR="`cygpath "$3"`" -# Note: $4 is extra configure options - -cd "$PATH_TO_BUILD_DIR" -echo "=== CONFIGURING ===" -"$PATH_TO_SRC_DIR/configure" --toolchain=msvc "--prefix=$PATH_TO_PACKAGE_DIR" $4 -echo "=== BUILDING ===" -make -j6 -echo "=== INSTALLING ===" -make install diff --git a/ports/ffmpeg/build.sh.in b/ports/ffmpeg/build.sh.in new file mode 100644 index 00000000000000..58040884b11f6c --- /dev/null +++ b/ports/ffmpeg/build.sh.in @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +export PATH="/usr/bin:$PATH" + +command -v cygpath >/dev/null && have_cygpath=1 + +cygpath() { + if [ -n "$have_cygpath" ]; then + command cygpath "$@" + else + eval _p='$'$# + printf '%s\n' "$_p" + fi +} + +export PKG_CONFIG_PATH="$(cygpath -p "${PKG_CONFIG_PATH}")" + +# Export HTTP(S)_PROXY as http(s)_proxy: +[ -n "$HTTP_PROXY" ] && export http_proxy="$HTTP_PROXY" +[ -n "$HTTPS_PROXY" ] && export https_proxy="$HTTPS_PROXY" + +PATH_TO_BUILD_DIR=$( cygpath "@BUILD_DIR@") +PATH_TO_SRC_DIR=$( cygpath "@SOURCE_PATH@") +PATH_TO_PACKAGE_DIR=$(cygpath "@INST_PREFIX@") + +JOBS=@VCPKG_CONCURRENCY@ + +# Default to hardware concurrency if unset. +: ${JOBS:=$(nproc)} + +cd "$PATH_TO_BUILD_DIR" + +echo "=== CONFIGURING ===" + +sh "$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" @CONFIGURE_OPTIONS@ + +echo "=== BUILDING ===" + +make -j${JOBS} + +echo "=== INSTALLING ===" + +make install diff --git a/ports/ffmpeg/build_linux.sh b/ports/ffmpeg/build_linux.sh deleted file mode 100644 index d7360ce1df0300..00000000000000 --- a/ports/ffmpeg/build_linux.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/bash -set -e -export PATH=/usr/bin:$PATH -# Export HTTP(S)_PROXY as http(s)_proxy: -if [ "$HTTP_PROXY" ]; then - export http_proxy=$HTTP_PROXY -fi -if [ "$HTTPS_PROXY" ]; then - export https_proxy=$HTTPS_PROXY -fi - -PATH_TO_BUILD_DIR=$1 -PATH_TO_SRC_DIR=$2 -PATH_TO_PACKAGE_DIR=$3 -# Note: $4 is extra configure options - -cd "$PATH_TO_BUILD_DIR" -echo "=== CONFIGURING ===" -chmod a+x "$PATH_TO_SRC_DIR/configure" -"$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" $4 -echo "=== BUILDING ===" -make -j6 -echo "=== INSTALLING ===" -make install diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 14eb4ae100299b..49cff1d23d3c62 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -10,9 +10,15 @@ vcpkg_from_github( 0004-fix-debug-build.patch 0005-fix-libvpx-linking.patch 0006-fix-StaticFeatures.patch + 0007-fix-lib-naming.patch + 0008-Fix-wavpack-detection.patch + 0009-Fix-fdk-detection.patch + 0010-Fix-x264-detection.patch + 0011-Fix-x265-detection.patch + 0012-Fix-ssl-110-detection.patch ) -if (${SOURCE_PATH} MATCHES " ") +if (SOURCE_PATH MATCHES " ") message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces") endif() @@ -20,43 +26,51 @@ vcpkg_find_acquire_program(YASM) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) if(VCPKG_TARGET_IS_WINDOWS) - set(SEP ";") #We're assuming that if we're building for Windows we're using MSVC set(INCLUDE_VAR "INCLUDE") set(LIB_PATH_VAR "LIB") else() - set(SEP ":") set(INCLUDE_VAR "CPATH") set(LIB_PATH_VAR "LIBRARY_PATH") endif() -if(VCPKG_TARGET_IS_WINDOWS) - set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") - - set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) +set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${YASM_EXE_PATH}") +set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect") +if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) + vcpkg_acquire_msys(MSYS_ROOT + DIRECT_PACKAGES + # Required for "cpp.exe" preprocessor + "https://repo.msys2.org/msys/x86_64/gcc-9.3.0-1-x86_64.pkg.tar.xz" + 76af0192a092278e6b26814b2d92815a2c519902a3fec056b057faec19623b1770ac928a59a39402db23cfc23b0d7601b7f88b367b27269361748c69d08654b2 + "https://repo.msys2.org/msys/x86_64/isl-0.22.1-1-x86_64.pkg.tar.xz" + f4db50d00bad0fa0abc6b9ad965b0262d936d437a9faa35308fa79a7ee500a474178120e487b2db2259caf51524320f619e18d92acf4f0b970b5cbe5cc0f63a2 + "https://repo.msys2.org/msys/x86_64/zlib-1.2.11-1-x86_64.pkg.tar.xz" + b607da40d3388b440f2a09e154f21966cd55ad77e02d47805f78a9dee5de40226225bf0b8335fdfd4b83f25ead3098e9cb974d4f202f28827f8468e30e3b790d + "https://repo.msys2.org/msys/x86_64/mpc-1.1.0-1-x86_64.pkg.tar.xz" + 7d0715c41c27fdbf91e6dcc73d6b8c02ee62c252e027f0a17fa4bfb974be8a74d8e3a327ef31c2460721902299ef69a7ef3c7fce52c8f02ce1cb47f0b6e073e9 + "https://repo.msys2.org/msys/x86_64/mpfr-4.1.0-1-x86_64.pkg.tar.zst" + d64fa60e188124591d41fc097d7eb51d7ea4940bac05cdcf5eafde951ed1eaa174468f5ede03e61106e1633e3428964b34c96de76321ed8853b398fbe8c4d072 + "https://repo.msys2.org/msys/x86_64/gmp-6.2.0-1-x86_64.pkg.tar.xz" + 1389a443e775bb255d905665dd577bef7ed71d51a8c24d118097f8119c08c4dfe67505e88ddd1e9a3764dd1d50ed8b84fa34abefa797d257e90586f0cbf54de8 + ) else() - vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) + vcpkg_acquire_msys(MSYS_ROOT) endif() - set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) + set(SHELL ${MSYS_ROOT}/usr/bin/bash.exe) + set(OPTIONS "--toolchain=msvc ${OPTIONS}") else() - set(ENV{PATH} "$ENV{PATH}:${YASM_EXE_PATH}") - set(BASH /bin/bash) - set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/build_linux.sh) + set(SHELL /bin/sh) endif() -set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${SEP}$ENV{${INCLUDE_VAR}}") +set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${VCPKG_HOST_PATH_SEPARATOR}$ENV{${INCLUDE_VAR}}") set(_csc_PROJECT_PATH ffmpeg) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug") -set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect") - if("nonfree" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-nonfree") endif() @@ -69,12 +83,6 @@ if("version3" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-version3") endif() -if("openssl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-openssl") -else() - set(OPTIONS "${OPTIONS} --disable-openssl") -endif() - if("ffmpeg" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-ffmpeg") else() @@ -93,58 +101,240 @@ else() set(OPTIONS "${OPTIONS} --disable-ffprobe") endif() -if("vpx" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libvpx") +if("avcodec" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avcodec") + set(ENABLE_AVCODEC ON) else() - set(OPTIONS "${OPTIONS} --disable-libvpx") + set(OPTIONS "${OPTIONS} --disable-avcodec") + set(ENABLE_AVCODEC OFF) endif() -if("x264" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libx264") +if("avdevice" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avdevice") + set(ENABLE_AVDEVICE ON) else() - set(OPTIONS "${OPTIONS} --disable-libx264") + set(OPTIONS "${OPTIONS} --disable-avdevice") + set(ENABLE_AVDEVICE OFF) endif() -if("opencl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-opencl") +if("avformat" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avformat") + set(ENABLE_AVFORMAT ON) else() - set(OPTIONS "${OPTIONS} --disable-opencl") + set(OPTIONS "${OPTIONS} --disable-avformat") + set(ENABLE_AVFORMAT OFF) endif() -set (ENABLE_LZMA OFF) -if("lzma" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-lzma") - set (ENABLE_LZMA ON) #necessary for configuring FFMPEG CMake Module +if("avfilter" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avfilter") + set(ENABLE_AVFILTER ON) else() - set(OPTIONS "${OPTIONS} --disable-lzma") + set(OPTIONS "${OPTIONS} --disable-avfilter") + set(ENABLE_AVFILTER OFF) +endif() + +if("postproc" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-postproc") + set(ENABLE_POSTPROC ON) +else() + set(OPTIONS "${OPTIONS} --disable-postproc") + set(ENABLE_POSTPROC OFF) +endif() + +if("swresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-swresample") + set(ENABLE_SWRESAMPLE ON) +else() + set(OPTIONS "${OPTIONS} --disable-swresample") + set(ENABLE_SWRESAMPLE OFF) +endif() + +if("swscale" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-swscale") + set(ENABLE_SWSCALE ON) +else() + set(OPTIONS "${OPTIONS} --disable-swscale") + set(ENABLE_SWSCALE OFF) +endif() + +set(ENABLE_AVRESAMPLE OFF) +if("avresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avresample") + set(ENABLE_AVRESAMPLE ON) endif() -set (ENABLE_BZIP2 OFF) +if("avisynthplus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avisynth") +else() + set(OPTIONS "${OPTIONS} --disable-avisynth") +endif() + +set(STATIC_LINKAGE OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") +set(STATIC_LINKAGE ON) +endif() + +set(ENABLE_BZIP2 OFF) if("bzip2" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-bzlib") - set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module + set(ENABLE_BZIP2 ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() -if("avresample" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avresample") +set(ENABLE_ICONV OFF) +if("iconv" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-iconv") + set(ENABLE_ICONV ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-iconv") endif() -if (VCPKG_TARGET_IS_OSX) - set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX +set(ENABLE_FDKAAC OFF) +if("fdk-aac" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libfdk-aac") + set(ENABLE_FDKAAC ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libfdk-aac") +endif() + +set(ENABLE_LZMA OFF) +if("lzma" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-lzma") + set(ENABLE_LZMA ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-lzma") +endif() + +set(ENABLE_LAME OFF) +if("mp3lame" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libmp3lame") + set(ENABLE_LAME ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libmp3lame") endif() if("nvcodec" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp") + #Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading + set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid") else() - set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") + set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid") endif() -if("avisynthplus" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avisynth") +set(ENABLE_OPENCL OFF) +if("opencl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-opencl") + set(ENABLE_OPENCL ${STATIC_LINKAGE}) else() - set(OPTIONS "${OPTIONS} --disable-avisynth") + set(OPTIONS "${OPTIONS} --disable-opencl") +endif() + +set(ENABLE_OPENSSL OFF) +if("openssl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-openssl") + set(ENABLE_OPENSSL ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-openssl") +endif() + +set(ENABLE_OPUS OFF) +if("opus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libopus") + set(ENABLE_OPUS ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libopus") +endif() + +set(ENABLE_SDL2 OFF) +if("sdl2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-sdl2") + set(ENABLE_SDL2 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-sdl2") +endif() + +set(ENABLE_SNAPPY OFF) +if("snappy" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsnappy") + set(ENABLE_SNAPPY ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libsnappy") +endif() + +set(ENABLE_SOXR OFF) +if("soxr" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsoxr") + set(ENABLE_SOXR ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libsoxr") +endif() + +set(ENABLE_SPEEX OFF) +if("speex" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libspeex") + set(ENABLE_SPEEX ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libspeex") +endif() + +set(ENABLE_THEORA OFF) +if("theora" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libtheora") + set(ENABLE_THEORA ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libtheora") +endif() + +set(ENABLE_VORBIS OFF) +if("vorbis" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvorbis") + set(ENABLE_VORBIS ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libvorbis") +endif() + +set(ENABLE_VPX OFF) +if("vpx" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvpx") + set(ENABLE_VPX ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libvpx") +endif() + +set(ENABLE_WAVPACK OFF) +if("wavpack" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libwavpack") + set(ENABLE_WAVPACK ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libwavpack") +endif() + +set(ENABLE_X264 OFF) +if("x264" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx264") + set(ENABLE_X264 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libx264") +endif() + +set(ENABLE_X265 OFF) +if("x265" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx265") + set(ENABLE_X265 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libx265") +endif() + +set(ENABLE_ZLIB OFF) +if("zlib" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-zlib") + set(ENABLE_ZLIB ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-zlib") +endif() + +if (VCPKG_TARGET_IS_OSX) + set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX endif() set(OPTIONS_CROSS "") @@ -154,7 +344,7 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQU vcpkg_find_acquire_program(GASPREPROCESSOR) foreach(GAS_PATH ${GASPREPROCESSOR}) get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}") + set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${GAS_ITEM_PATH}") endforeach(GAS_PATH) elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") @@ -192,26 +382,33 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") +endif() + set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") -set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building Options: ${OPTIONS}") # Release build if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) message(STATUS "Building Release Options: ${OPTIONS_RELEASE}") - set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}") + set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_RELEASE}") + set(INST_PREFIX "${CURRENT_PACKAGES_DIR}") + + configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY) + vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR - "${SOURCE_PATH}" # SOURCE DIR - "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR - "${OPTIONS} ${OPTIONS_RELEASE}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + COMMAND ${SHELL} ./build.sh + WORKING_DIRECTORY ${BUILD_DIR} LOGNAME build-${TARGET_TRIPLET}-rel ) endif() @@ -219,52 +416,56 @@ endif() # Debug build if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) message(STATUS "Building Debug Options: ${OPTIONS_DEBUG}") - set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}") + set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR - "${SOURCE_PATH}" # SOURCE DIR - "${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR - "${OPTIONS} ${OPTIONS_DEBUG}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg - ) -endif() -file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def) + set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_DEBUG}") + set(INST_PREFIX "${CURRENT_PACKAGES_DIR}/debug") -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(LIB_MACHINE_ARG /machine:ARM) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(LIB_MACHINE_ARG /machine:ARM64) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(LIB_MACHINE_ARG /machine:x86) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(LIB_MACHINE_ARG /machine:x64) -else() - message(FATAL_ERROR "Unsupported target architecture") -endif() + configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY) -foreach(DEF_FILE ${DEF_FILES}) - get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY) - get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME) - string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}") - file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE) - file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE) - message(STATUS "Generating ${OUT_FILE_NATIVE}") vcpkg_execute_required_process( - COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG} - WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR} - LOGNAME libconvert-${TARGET_TRIPLET} + COMMAND ${SHELL} ./build.sh + WORKING_DIRECTORY ${BUILD_DIR} + LOGNAME build-${TARGET_TRIPLET}-dbg ) -endforeach() +endif() + +if(VCPKG_TARGET_IS_WINDOWS) + file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def) + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(LIB_MACHINE_ARG /machine:ARM) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(LIB_MACHINE_ARG /machine:ARM64) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(LIB_MACHINE_ARG /machine:x86) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(LIB_MACHINE_ARG /machine:x64) + else() + message(FATAL_ERROR "Unsupported target architecture") + endif() -# Handle tools -if (VCPKG_TARGET_IS_WINDOWS) + foreach(DEF_FILE ${DEF_FILES}) + get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY) + get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME) + string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}") + file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE) + file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE) + message(STATUS "Generating ${OUT_FILE_NATIVE}") + vcpkg_execute_required_process( + COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG} + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR} + LOGNAME libconvert-${TARGET_TRIPLET} + ) + endforeach() + + # Handle tools file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp) file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) file(GLOB EXE_FILES_REL ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) @@ -294,15 +495,15 @@ vcpkg_copy_pdbs() # Handle copyright file(STRINGS ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-out.log LICENSE_STRING REGEX "License: .*" LIMIT_COUNT 1) -if(${LICENSE_STRING} STREQUAL "License: LGPL version 2.1 or later") +if(LICENSE_STRING STREQUAL "License: LGPL version 2.1 or later") set(LICENSE_FILE "COPYING.LGPLv2.1") -elseif(${LICENSE_STRING} STREQUAL "License: LGPL version 3 or later") +elseif(LICENSE_STRING STREQUAL "License: LGPL version 3 or later") set(LICENSE_FILE "COPYING.LGPLv3") -elseif(${LICENSE_STRING} STREQUAL "License: GPL version 2 or later") +elseif(LICENSE_STRING STREQUAL "License: GPL version 2 or later") set(LICENSE_FILE "COPYING.GPLv2") -elseif(${LICENSE_STRING} STREQUAL "License: GPL version 3 or later") +elseif(LICENSE_STRING STREQUAL "License: GPL version 3 or later") set(LICENSE_FILE "COPYING.GPLv3") -elseif(${LICENSE_STRING} STREQUAL "License: nonfree and unredistributable") +elseif(LICENSE_STRING STREQUAL "License: nonfree and unredistributable") set(LICENSE_FILE "COPYING.NONFREE") file(WRITE ${SOURCE_PATH}/${LICENSE_FILE} ${LICENSE_STRING}) else() diff --git a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake index 322387565d03e8..8e2dd44d008eb1 100644 --- a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake +++ b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT FFMPEG_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH}) diff --git a/ports/ffnvcodec/CONTROL b/ports/ffnvcodec/CONTROL index 4a2ce6d71c70d8..38a58cc5a118a8 100644 --- a/ports/ffnvcodec/CONTROL +++ b/ports/ffnvcodec/CONTROL @@ -1,4 +1,5 @@ Source: ffnvcodec -Version: 9.1.23.1-1 +Version: 9.1.23.1 +Port-Version: 3 Homepage: https://github.com/FFmpeg/nv-codec-headers Description: FFmpeg version of Nvidia Codec SDK headers. diff --git a/ports/ffnvcodec/portfile.cmake b/ports/ffnvcodec/portfile.cmake index 66d8bcb18c2c25..1c8b59be48c2a0 100644 --- a/ports/ffnvcodec/portfile.cmake +++ b/ports/ffnvcodec/portfile.cmake @@ -29,6 +29,8 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} LOGNAME build-${TARGET_TRIPLET} ) + + file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) # Linux, etc. else() @@ -46,8 +48,11 @@ else() # FFmpeg uses pkgconfig to find ffnvcodec.pc, so install it where # FFMpeg's call to pkgconfig expects to find it. file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) + file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) endif() # Install the files to their default vcpkg locations file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +vcpkg_fixup_pkgconfig() diff --git a/ports/field3d/0001_fix_build_errors.patch b/ports/field3d/0001_fix_build_errors.patch new file mode 100644 index 00000000000000..95149e39d893fd --- /dev/null +++ b/ports/field3d/0001_fix_build_errors.patch @@ -0,0 +1,148 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1610c2e..b012008 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,25 +31,17 @@ + + # Author : Nicholas Yue yue.nicholas@gmail.com + +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) ++CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) + + PROJECT ( field3d ) + + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) + + FIND_PACKAGE (Doxygen) +-FIND_PACKAGE (HDF5 COMPONENTS C) +-IF ( CMAKE_HOST_WIN32 ) +-# f3dinfo relies on program_options but don't include it, since +-# for some reason, unlike all the other boost components, a link is +-# forced via a pragma. +-FIND_PACKAGE (Boost COMPONENTS regex thread) +-ELSE () +-FIND_PACKAGE (Boost COMPONENTS regex thread program_options system) +-FIND_PACKAGE (MPI) +-ENDIF () ++FIND_PACKAGE (HDF5 COMPONENTS C REQUIRED) ++FIND_PACKAGE (Boost COMPONENTS regex thread program_options system REQUIRED) + +-FIND_PACKAGE (ILMBase) ++FIND_PACKAGE (OpenEXR REQUIRED) + + # Allow the developer to select if Dynamic or Static libraries are built + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) +@@ -79,26 +71,14 @@ IF ( CMAKE_HOST_UNIX ) + ENDIF ( ) + IF ( CMAKE_HOST_WIN32 ) + ADD_DEFINITIONS ( +- -D_HAS_ITERATOR_DEBUGGING=0 + -D_CRT_SECURE_NO_WARNINGS=1 + ) + ENDIF ( ) + + SET ( LIB_TYPE SHARED ) + IF ( NOT BUILD_SHARED_LIBS ) +- IF ( CMAKE_HOST_WIN32 ) +- # User wants to build static libraries, so change the LIB_TYPE variable to CMake keyword 'STATIC' + SET ( LIB_TYPE STATIC ) + ADD_DEFINITIONS( -DFIELD3D_STATIC ) +- ENDIF() +-ELSE () +- IF ( CMAKE_HOST_WIN32 ) +- ADD_DEFINITIONS ( +- -DOPENEXR_DLL +- -D_HDF5USEDLL_ +- -DHDF5CPP_USEDLL +- ) +- ENDIF() + ENDIF ( NOT BUILD_SHARED_LIBS ) + + ADD_LIBRARY ( Field3D ${LIB_TYPE} +@@ -147,24 +128,22 @@ IF ( CMAKE_HOST_UNIX ) + ${MPI_LIBRARIES} ) + ENDIF ( MPI_FOUND ) + LIST ( APPEND Field3D_Libraries_Shared +- Iex Half IlmThread Imath + pthread dl z ) + SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) + SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} + ${Boost_LIBRARIES} ) + ENDIF ( ) + IF ( CMAKE_HOST_WIN32 ) +- # Add OpenEXR and zlib release/debug +- FOREACH ( lib Iex Half IlmThread Imath zdll ) ++ FOREACH ( lib zlib ) + LIST ( APPEND Field3D_Libraries_Shared + optimized ${lib} +- debug ${lib}_d ) ++ debug ${lib}d ) + ENDFOREACH() + SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} Shlwapi.lib) + SET ( Field3D_BIN_Libraries Field3D ${Boost_LIBRARIES} ) + ENDIF () + +-TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES}) ++TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES} OpenEXR::IlmImf) + + # Parase version and soversion from export/ns.h + +@@ -214,33 +193,7 @@ ADD_EXECUTABLE ( f3dinfo + + TARGET_LINK_LIBRARIES ( f3dinfo ${Field3D_BIN_Libraries} ) + +-# field3d - sparse_field_io +-ADD_EXECUTABLE ( sparse_field_io +- apps/sample_code/sparse_field_io/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( sparse_field_io ${Field3D_BIN_Libraries} ) +- +-# field3d - read +-ADD_EXECUTABLE ( read +- apps/sample_code/read/main.cpp +- ) + +-TARGET_LINK_LIBRARIES ( read ${Field3D_BIN_Libraries} ) +- +-# field3d - mixed_types +-ADD_EXECUTABLE ( mixed_types +- apps/sample_code/mixed_types/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( mixed_types ${Field3D_BIN_Libraries} ) +- +-# field3d - create_and_write +-ADD_EXECUTABLE ( create_and_write +- apps/sample_code/create_and_write/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( create_and_write ${Field3D_BIN_Libraries} ) + + IF (DOXYGEN_FOUND) + ADD_CUSTOM_TARGET ( doc +@@ -249,7 +202,7 @@ IF (DOXYGEN_FOUND) + WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} + ) + IF (INSTALL_DOCS) +- INSTALL (DIRECTORY ++ INSTALL (DIRECTORY + ${CMAKE_HOME_DIRECTORY}/docs + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) +@@ -263,12 +216,11 @@ INSTALL ( TARGETS + + FILE(GLOB Field3d_Includes "${CMAKE_CURRENT_SOURCE_DIR}/export/*.h") + +-INSTALL ( FILES +- ${Field3d_Includes} ++INSTALL ( FILES ++ ${Field3d_Includes} + DESTINATION include/Field3D + ) + +-INSTALL ( TARGETS f3dinfo ++INSTALL ( TARGETS f3dinfo + RUNTIME DESTINATION bin + ) +- diff --git a/ports/field3d/0002_improve_win_compatibility.patch b/ports/field3d/0002_improve_win_compatibility.patch new file mode 100644 index 00000000000000..08167be692f4c0 --- /dev/null +++ b/ports/field3d/0002_improve_win_compatibility.patch @@ -0,0 +1,43 @@ +diff --git a/include/UtilFoundation.h b/include/UtilFoundation.h +index 2eb6290..a449b5b 100644 +--- a/include/UtilFoundation.h ++++ b/include/UtilFoundation.h +@@ -90,6 +90,9 @@ + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif ++#ifndef NOMINMAX ++#define NOMINMAX ++#endif + + // needed for mutex stuff + #include +diff --git a/src/FieldMapping.cpp b/src/FieldMapping.cpp +index b1f1a1f..90612b1 100644 +--- a/src/FieldMapping.cpp ++++ b/src/FieldMapping.cpp +@@ -49,9 +49,6 @@ + #include "FieldMapping.h" + #include "Types.h" + +-#ifdef WIN32 +-#define isnan(__x__) _isnan(__x__) +-#endif + + //----------------------------------------------------------------------------// + +diff --git a/src/Log.cpp b/src/Log.cpp +index f78229c..d095a50 100644 +--- a/src/Log.cpp ++++ b/src/Log.cpp +@@ -40,8 +40,9 @@ + */ + + //----------------------------------------------------------------------------// +- ++#ifndef _WIN32 + #include ++#endif + #include + #include + diff --git a/ports/field3d/0003_hdf5_api.patch b/ports/field3d/0003_hdf5_api.patch new file mode 100644 index 00000000000000..183a49c9e6e071 --- /dev/null +++ b/ports/field3d/0003_hdf5_api.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b57057f..e809880 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,6 +35,7 @@ CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) + + PROJECT ( field3d ) + ++add_definitions(-DH5_USE_110_API) + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) + + FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/CONTROL b/ports/field3d/CONTROL index 965ad7477fe62c..d16bd4cb4839de 100644 --- a/ports/field3d/CONTROL +++ b/ports/field3d/CONTROL @@ -1,6 +1,7 @@ Source: field3d Version: 1.7.3 +Port-Version: 1 Homepage: https://github.com/imageworks/Field3D Description: An open source library for storing voxel data. It provides C++ classes that handle in-memory storage and a file format based on HDF5 that allows the C++ objects to be written to and read from disk. -Build-Depends: hdf5[core], boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format -Supports: !(windows|arm|uwp) \ No newline at end of file +Build-Depends: hdf5, boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format +Supports: !(uwp) diff --git a/ports/field3d/fix-build_error.patch b/ports/field3d/fix-build_error.patch deleted file mode 100644 index e2f44c093e5c5a..00000000000000 --- a/ports/field3d/fix-build_error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e9ad44f..45f3fad 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -147,7 +147,7 @@ IF ( CMAKE_HOST_UNIX ) - ${MPI_LIBRARIES} ) - ENDIF ( MPI_FOUND ) - LIST ( APPEND Field3D_Libraries_Shared -- Iex Half IlmThread Imath -+ Iex-2_3 Half-2_3 IlmThread-2_3 Imath-2_3 - pthread dl z ) - SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) - SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} diff --git a/ports/field3d/hdf5.api.patch b/ports/field3d/hdf5.api.patch deleted file mode 100644 index 21a08baebe419a..00000000000000 --- a/ports/field3d/hdf5.api.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1e608b3ec..5ff2c3c31 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -34,7 +34,8 @@ - CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) - - PROJECT ( field3d ) -- -+add_definitions(-UH5_USE_112_API_DEFAULT) -+add_definitions(-DH5_USE_110_API_DEFAULT) - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) - - FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/portfile.cmake b/ports/field3d/portfile.cmake index ccbfcd95a34c41..a23e042494b94a 100644 --- a/ports/field3d/portfile.cmake +++ b/ports/field3d/portfile.cmake @@ -1,21 +1,23 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") -if (TRIPLET_SYSTEM_ARCH MATCHES "arm") - message(FATAL_ERROR "ARM is currently not supported.") -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - message(FATAL_ERROR "Error: UWP builds are currently not supported.") +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO imageworks/Field3D - REF v1.7.3 - SHA512 de3f10ff120420925de67064b2169f2a30c9180e308acc9090d70567b45be5423f4b1f7eb32bb376c887cea1364803cf7b2db66c2bc49f8a39a1037bbf0e5f39 + REF 0cf75ad982917e0919f59e5cb3d483517d06d7da + SHA512 e6f137013dd7b64b51b2ec3cc3ed8f4dbfadb85858946f08393653d78136cf8f93ae124716db11358e325c5e64ba04802afd4b89ca36ad65a14dd3db17f3072c HEAD_REF master PATCHES - fix-build_error.patch - hdf5.api.patch # Switches the HDF5 default API for this port to 1.10 + 0001_fix_build_errors.patch + 0002_improve_win_compatibility.patch + 0003_hdf5_api.patch # Switches the HDF5 default API for this port to 1.10 ) +file(REMOVE ${SOURCE_PATH}/cmake/FindILMBase.cmake) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -30,6 +32,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/fizz/CONTROL b/ports/fizz/CONTROL index 9ad27acd8c1c66..152f53ad56d48f 100644 --- a/ports/fizz/CONTROL +++ b/ports/fizz/CONTROL @@ -1,4 +1,5 @@ Source: fizz -Version: 2020.02.03.00 +Version: 2020.02.03.00 +Port-Version: 1 Build-Depends: folly, openssl, libsodium, zlib, fmt Description: a TLS 1.3 implementation by Facebook \ No newline at end of file diff --git a/ports/fizz/fix-build_error.patch b/ports/fizz/fix-build_error.patch deleted file mode 100644 index c6bafbb15e581f..00000000000000 --- a/ports/fizz/fix-build_error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt -index ccbbbb6..ee10c90 100644 ---- a/fizz/CMakeLists.txt -+++ b/fizz/CMakeLists.txt -@@ -86,7 +86,7 @@ if(TARGET event) - message(STATUS "Found libevent from package config") - list(APPEND FIZZ_SHINY_DEPENDENCIES event) - else() -- find_package(Libevent MODULE REQUIRED) -+ find_package(Libevent CONFIG REQUIRED) - list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - endif() diff --git a/ports/fizz/portfile.cmake b/ports/fizz/portfile.cmake index 1dc4fa30c2d080..869dfcd2e57e94 100644 --- a/ports/fizz/portfile.cmake +++ b/ports/fizz/portfile.cmake @@ -3,18 +3,16 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebookincubator/fizz - REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 + REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 SHA512 7db706ffdd79f6d753c5530eb67646747d1e7b8b380387f34bd1fc7a06b289a68a6bb4c13faa74e108d4dede72bb2d993d7ad8f60fabcfb3b48abbf4326291c2 HEAD_REF master PATCHES find-zlib.patch - fix-build_error.patch ) # Prefer installed config files file(REMOVE ${SOURCE_PATH}/fizz/cmake/FindGflags.cmake - ${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake ${SOURCE_PATH}/fizz/cmake/FindGlog.cmake ) diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL index c9d660cee9f7bc..c6db1c1bbdcbb7 100644 --- a/ports/fltk/CONTROL +++ b/ports/fltk/CONTROL @@ -1,5 +1,6 @@ Source: fltk -Version: 1.3.5-2 +Version: 1.3.5 +Port-Version: 3 Homepage: https://www.fltk.org/ Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. Build-Depends: zlib, libpng, libjpeg-turbo diff --git a/ports/fltk/config-path.patch b/ports/fltk/config-path.patch new file mode 100644 index 00000000000000..b308f750f50655 --- /dev/null +++ b/ports/fltk/config-path.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/setup.cmake b/CMake/setup.cmake +index 4d960a5..194887d 100644 +--- a/CMake/setup.cmake ++++ b/CMake/setup.cmake +@@ -88,6 +88,8 @@ else() + set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk) + endif(WIN32 AND NOT CYGWIN) + ++set(FLTK_CONFIG_PATH share/fltk) ++ + include(TestBigEndian) + TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + diff --git a/ports/fltk/include.patch b/ports/fltk/include.patch new file mode 100644 index 00000000000000..27207fdbd7ed24 --- /dev/null +++ b/ports/fltk/include.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/macros.cmake b/CMake/macros.cmake +index ca03371..bde2c7e 100644 +--- a/CMake/macros.cmake ++++ b/CMake/macros.cmake +@@ -36,6 +36,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) + + add_library(${LIBRARY_NAME} ${LIBTYPE} ${LIBFILES}) + ++ target_include_directories(${LIBRARY_NAME} PUBLIC $) ++ + set_target_properties(${LIBRARY_NAME} + PROPERTIES + OUTPUT_NAME ${LIBRARY_NAME} diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index 905b140bbb15be..1721c9072ba26c 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -4,20 +4,19 @@ vcpkg_download_distfile(ARCHIVE SHA512 db7ea7c5f3489195a48216037b9371a50f1119ae7692d66f71b6711e5ccf78814670581bae015e408dee15c4bba921728309372c1cffc90113cdc092e8540821 ) +# FLTK has many improperly shared global variables that get duplicated into every DLL +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} PATCHES findlibsfix.patch add-link-libraries.patch + config-path.patch + include.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(BUILD_SHARED ON) -else() - set(BUILD_SHARED OFF) -endif() - if (VCPKG_TARGET_ARCHITECTURE MATCHES "arm" OR VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") set(OPTION_USE_GL "-DOPTION_USE_GL=OFF") else() @@ -34,55 +33,36 @@ vcpkg_configure_cmake( -DOPTION_USE_SYSTEM_ZLIB=ON -DOPTION_USE_SYSTEM_LIBPNG=ON -DOPTION_USE_SYSTEM_LIBJPEG=ON - -DOPTION_BUILD_SHARED_LIBS=${BUILD_SHARED} + -DOPTION_BUILD_SHARED_LIBS=OFF + -DFLTK_CONFIG_PATH=share/fltk ${OPTION_USE_GL} ) vcpkg_install_cmake() -if (VCPKG_TARGET_IS_LINUX) - vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT} TARGET_PATH share/${PORT}) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid) -elseif (VCPKG_TARGET_IS_OSX) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.app DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.app) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.app) -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.exe) -endif() - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share -) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/fltk) -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) +if(VCPKG_TARGET_IS_OSX) + vcpkg_copy_tools(TOOL_NAMES fluid.app fltk-config AUTO_CLEAN) +elseif(VCPKG_TARGET_IS_WINDOWS) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) + vcpkg_copy_tools(TOOL_NAMES fluid AUTO_CLEAN) +else() + vcpkg_copy_tools(TOOL_NAMES fluid fltk-config AUTO_CLEAN) +endif() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/fltk) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin ) -else() - file(GLOB SHARED_LIBS "${CURRENT_PACKAGES_DIR}/lib/*_SHARED.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*_SHAREDd.lib") - file(GLOB STATIC_LIBS "${CURRENT_PACKAGES_DIR}/lib/*.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*.lib") - list(FILTER STATIC_LIBS EXCLUDE REGEX "_SHAREDd?\\.lib\$") - file(REMOVE ${STATIC_LIBS}) - foreach(SHARED_LIB ${SHARED_LIBS}) - string(REGEX REPLACE "_SHARED(d?)\\.lib\$" "\\1.lib" NEWNAME ${SHARED_LIB}) - file(RENAME ${SHARED_LIB} ${NEWNAME}) - endforeach() endif() +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) foreach(FILE Fl_Export.H fl_utf8.h) file(READ ${CURRENT_PACKAGES_DIR}/include/FL/${FILE} FLTK_HEADER) diff --git a/ports/fluidlite/CONTROL b/ports/fluidlite/CONTROL new file mode 100644 index 00000000000000..b591dcf027317d --- /dev/null +++ b/ports/fluidlite/CONTROL @@ -0,0 +1,4 @@ +Source: fluidlite +Version: 2020-08-27 +Homepage: https://github.com/divideconcept/FluidLite +Description: FluidLite is a very light version of FluidSynth designed to be hardware, platform and external dependency independant. diff --git a/ports/fluidlite/portfile.cmake b/ports/fluidlite/portfile.cmake new file mode 100644 index 00000000000000..707fcd720b8a7c --- /dev/null +++ b/ports/fluidlite/portfile.cmake @@ -0,0 +1,31 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/fluidsynth/settings.h") + message(FATAL_ERROR "Can't build fluidlite if fluidsynth is installed. Please remove fluidsynth, and try to install fluidlite again if you need it.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO divideconcept/FluidLite + REF fdd05bad03cdb24d1f78b5fe3453842890c1b0e8 + SHA512 8118bec2cb5ee48b8064ed2111610f1917ee8e6f1dc213121b2311d056da21d7f618ef50735e7653d2cccf1e96652f3ccf026101fccb9863448008918add53e0 + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" FLUIDLITE_BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" FLUIDLITE_BUILD_SHARED) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DFLUIDLITE_BUILD_STATIC=${FLUIDLITE_BUILD_STATIC} + -DFLUIDLITE_BUILD_SHARED=${FLUIDLITE_BUILD_SHARED} + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON +) + +vcpkg_install_cmake() + +# Remove unnecessary files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/fluidsynth/CONTROL b/ports/fluidsynth/CONTROL index f6fc690558026c..470dc2c0b61bc3 100644 --- a/ports/fluidsynth/CONTROL +++ b/ports/fluidsynth/CONTROL @@ -1,5 +1,5 @@ Source: fluidsynth -Version: 2.1.0 +Version: 2.1.4 Homepage: https://github.com/FluidSynth/fluidsynth Description: FluidSynth reads and handles MIDI events from the MIDI input device. It is the software analogue of a MIDI synthesizer. FluidSynth can also play midifiles using a Soundfont. Build-Depends: glib \ No newline at end of file diff --git a/ports/fluidsynth/force-x86-gentables.patch b/ports/fluidsynth/force-x86-gentables.patch index d477ebd3681d1c..7f909ec510d36c 100644 --- a/ports/fluidsynth/force-x86-gentables.patch +++ b/ports/fluidsynth/force-x86-gentables.patch @@ -1,34 +1,38 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index f731632..226f408 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -368,10 +368,23 @@ endif ( MACOSX_FRAMEWORK ) - # ******* Auto Generated Lookup Tables ****** - - include(ExternalProject) --ExternalProject_Add(gentables -- DOWNLOAD_COMMAND "" -- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables -- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables -- INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" --) -+if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) -+ ExternalProject_Add(gentables -+ DOWNLOAD_COMMAND "" -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables -+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables -+ CONFIGURE_COMMAND -+ "${CMAKE_COMMAND}" "${CMAKE_CURRENT_SOURCE_DIR}/gentables" -G "${CMAKE_GENERATOR}" -A Win32 -B "${CMAKE_CURRENT_BINARY_DIR}/gentables" -+ BUILD_COMMAND -+ "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/gentables" -+ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" -+ ) -+else() -+ ExternalProject_Add(gentables -+ DOWNLOAD_COMMAND "" -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables -+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables -+ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" -+ ) -+endif() - add_dependencies(libfluidsynth-OBJ gentables) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 356bb73..b4c43d7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -410,14 +410,23 @@ set (GENTAB_BDIR ${CMAKE_CURRENT_BINARY_DIR}/gentables) + # To fix cross-compiling fluidsynth from Win32 to ARM (using vcpkg), we need to pass the current generator + # on to the external project, otherwise (for some unknown reason) the target compiler will be used rather + # than the host compiler. +-ExternalProject_Add(gentables +- DOWNLOAD_COMMAND "" +- SOURCE_DIR ${GENTAB_SDIR} +- BINARY_DIR ${GENTAB_BDIR} +- CONFIGURE_COMMAND +- "${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}" +- BUILD_COMMAND +- "${CMAKE_COMMAND}" --build "${GENTAB_BDIR}" +- INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${CMAKE_BINARY_DIR}/" +-) ++if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) ++ ExternalProject_Add(gentables ++ DOWNLOAD_COMMAND "" ++ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables ++ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables ++ CONFIGURE_COMMAND ++ "${CMAKE_COMMAND}" "${CMAKE_CURRENT_SOURCE_DIR}/gentables" -G "${CMAKE_GENERATOR}" -A Win32 -B "${CMAKE_CURRENT_BINARY_DIR}/gentables" ++ BUILD_COMMAND ++ "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/gentables" ++ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" ++ ) ++else() ++ ExternalProject_Add(gentables ++ DOWNLOAD_COMMAND "" ++ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables ++ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables ++ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" ++ ) ++endif() + add_dependencies(libfluidsynth-OBJ gentables) diff --git a/ports/fluidsynth/portfile.cmake b/ports/fluidsynth/portfile.cmake index 0bc33fd7210d03..fed30db03674a8 100644 --- a/ports/fluidsynth/portfile.cmake +++ b/ports/fluidsynth/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO FluidSynth/fluidsynth - REF 37c9ae2bf431a764032f023b3b2c0c0b86b7c272 #v2.1.0 - SHA512 1eea26b7d71fd09e748df0989f7df42ab57a74d8d853a835da734120ee1198c0b8d73a39b8640aef8ef0c1788c9a329671de899882601da55ec20ab6ca3ff778 + REF 2393aef3bd0b4e78084cfe16735d402bc1497edd #v2.1.4 + SHA512 181914f883982d931dfa4d8c0d0391fb91fbf3448e1eb1ea1541c938d874d7611066e7e289859d83b610a85ba089463e0a93f77db5a6253349f6b328a7373dc6 HEAD_REF master PATCHES force-x86-gentables.patch @@ -16,13 +16,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # Copy fluidsynth.exe to tools dir -file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluidsynth.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fluidsynth) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/fluidsynth) +vcpkg_copy_tools(TOOL_NAMES fluidsynth AUTO_CLEAN) # Remove unnecessary files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluidsynth.exe) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluidsynth.exe) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index ce04fe4371a0b8..356f69981be04c 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,4 +1,5 @@ Source: fmt -Version: 6.2.1 +Version: 7.0.3 +Port-Version: 2 Homepage: https://github.com/fmtlib/fmt Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index c44da534a6654c..33529f65f3740e 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fmtlib/fmt - REF 19bd751020a1f3c3363b2eb67a039852f139a8d3#version 6.2.1 - SHA512 5d03445c64c3b7973bdf4e445238c63fa41bf0fa8c2d5b32cd56f0a6b3036b039d9c303a06300f3af87795a07f80f2ed28b90ddbf9c3f7398796d77906c21f40 + REF cd4af11efc9c622896a3e4cb599fa28668ca3d05#version 7.0.3 + SHA512 24b42288be97849533dc82282fc08833d74642ad2afeb511e65c6389d88c709cf25345dec5b550c18af3705f4c0847fa0d4066308b51cd41ccfdda1a2c3babd0 HEAD_REF master PATCHES fix-warning4189.patch ) @@ -33,10 +33,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() endif() - # Force FMT_SHARED to 1 - file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/core.h FMT_CORE_H) - string(REPLACE "defined(FMT_SHARED)" "1" FMT_CORE_H "${FMT_CORE_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/core.h "${FMT_CORE_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h + "defined(FMT_SHARED)" + "1" + ) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -45,14 +45,16 @@ vcpkg_fixup_pkgconfig() if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) - string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake + "lib/fmtd.dll" + "bin/fmtd.dll" + ) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) - string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake + "lib/fmt.dll" + "bin/fmt.dll" + ) endif() endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/folly/CONTROL b/ports/folly/CONTROL index c0714c3fe93dd9..302e7a924637a6 100644 --- a/ports/folly/CONTROL +++ b/ports/folly/CONTROL @@ -1,6 +1,6 @@ Source: folly Version: 2019.10.21.00 -Port-Version: 3 +Port-Version: 4 Homepage: https://github.com/facebook/folly Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows Build-Depends: openssl, libevent, double-conversion, glog, gflags, boost-chrono, boost-context, boost-conversion, boost-crc, boost-date-time, boost-filesystem, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-thread, boost-smart-ptr diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake index b9a2c05f2f3e58..3853569d9f3c5c 100644 --- a/ports/folly/portfile.cmake +++ b/ports/folly/portfile.cmake @@ -90,6 +90,7 @@ FILE(WRITE ${CURRENT_PACKAGES_DIR}/share/folly/folly-config.cmake find_dependency(Threads) find_dependency(glog CONFIG) find_dependency(gflags CONFIG REQUIRED) +find_dependency(ZLIB) ${_contents}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/fontconfig/CMakeLists.txt b/ports/fontconfig/CMakeLists.txt index a556e705932c7b..61197ed92dbd04 100644 --- a/ports/fontconfig/CMakeLists.txt +++ b/ports/fontconfig/CMakeLists.txt @@ -6,7 +6,7 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DHAVE_CONF # find dependencies find_package(unofficial-iconv CONFIG REQUIRED) find_package(Freetype REQUIRED) -find_package(EXPAT REQUIRED) +find_package(expat CONFIG REQUIRED) add_library(fontconfig src/fcatomic.c @@ -52,7 +52,7 @@ else() target_include_directories(fontconfig PRIVATE ${FC_INCLUDE_DIR}/unix) endif() -target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype EXPAT::EXPAT) +target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype expat::expat) install(TARGETS fontconfig EXPORT fontconfig-targets @@ -89,7 +89,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-fontconfig-config.cmake " include(CMakeFindDependencyMacro) find_dependency(unofficial-iconv CONFIG) find_dependency(Freetype) -find_dependency(EXPAT) +find_dependency(expat CONFIG) include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-fontconfig-targets.cmake) ") diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index e1deedec930b18..e541f560a71d26 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -1,6 +1,7 @@ Source: fontconfig Version: 2.12.4 -Port-Version: 11 +Port-Version: 13 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. Build-Depends: freetype, expat, libiconv, dirent +Supports: !uwp \ No newline at end of file diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 360c449a600640..5d9492f706c997 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + set(FONTCONFIG_VERSION 2.12.4) vcpkg_download_distfile(ARCHIVE URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" @@ -32,16 +34,19 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) foreach(HEADER fcfreetype.h fontconfig.h) - file(READ ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} FC_HEADER) - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}") + if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} + "#define FcPublic" + "#define FcPublic __declspec(dllimport)" + ) else() - string(REPLACE "#define FcPublic" "#define FcPublic __attribute__((visibility(\"default\")))" FC_HEADER "${FC_HEADER}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} + "#define FcPublic" + "#define FcPublic __attribute__((visibility(\"default\")))" + ) endif() - file(WRITE ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} "${FC_HEADER}") endforeach() endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -#vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig) diff --git a/ports/freeimage/CMakeLists.txt b/ports/freeimage/CMakeLists.txt index f8fd969297db71..2e73e9b26709d7 100644 --- a/ports/freeimage/CMakeLists.txt +++ b/ports/freeimage/CMakeLists.txt @@ -9,10 +9,6 @@ if(MSVC) set(CMAKE_CXX_FLAGS "/wd4828 ${CMAKE_CXX_FLAGS}") endif() -if(BUILD_SHARED_LIBS) - add_definitions("-DOPENEXR_DLL") -endif() - find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) @@ -100,7 +96,6 @@ target_include_directories(FreeImage PRIVATE ${REAL_SOURCE_DIR} ${WEBP_INCLUDE_DIRS} ${JXR_INCLUDE_DIRS} ${LibRaw_INCLUDE_DIRS} - ${OpenEXR_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) @@ -112,7 +107,7 @@ target_link_libraries(FreeImage ${ZLIB_LIBRARIES} ${WEBP_LIBRARIES} ${JXR_LIBRARIES} ${LibRaw_LIBRARIES} - ${OpenEXR_LIBRARIES}) + OpenEXR::IlmImf) target_compile_definitions(FreeImage PRIVATE ${PNG_DEFINITIONS}) diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL index 36829adc7a51bf..643c7b39877548 100644 --- a/ports/freeimage/CONTROL +++ b/ports/freeimage/CONTROL @@ -1,5 +1,6 @@ Source: freeimage -Version: 3.18.0-12 +Version: 3.18.0 +Port-Version: 13 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr Homepage: https://sourceforge.net/projects/freeimage/ Description: Support library for graphics image formats diff --git a/ports/freetype-gl/CONTROL b/ports/freetype-gl/CONTROL index 5419d6596b336c..a4081715e36f10 100644 --- a/ports/freetype-gl/CONTROL +++ b/ports/freetype-gl/CONTROL @@ -1,5 +1,6 @@ Source: freetype-gl -Version: 2019-03-29-3 +Version: 2019-03-29 +Port-Version: 4 Homepage: https://github.com/rougier/freetype-gl Description: OpenGL text using one vertex buffer, one texture and FreeType Build-Depends: glew, freetype diff --git a/ports/freetype-gl/glew.patch b/ports/freetype-gl/glew.patch new file mode 100644 index 00000000000000..01b7f616d9c940 --- /dev/null +++ b/ports/freetype-gl/glew.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c2e89fba..9e2d112c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -92,7 +92,7 @@ include_directories( + ${OPENGL_INCLUDE_DIRS} + ${FREETYPE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +- ${GLEW_INCLUDE_PATH} ++ ${GLEW_INCLUDE_DIRS} + ) + + if(MSVC) diff --git a/ports/freetype-gl/portfile.cmake b/ports/freetype-gl/portfile.cmake index 5d931ced5d3b63..9dfd38719ae7b6 100644 --- a/ports/freetype-gl/portfile.cmake +++ b/ports/freetype-gl/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF a91a3dda326ceaf66b7279bf64ba07014d3f81b8 SHA512 8e04573dfb400e14e2c1d3a2cd851a66f8218ccfdaa4f701ed9369d7f040d7028582e72af9b236af42d9d3c6c128014670e8ae0261c6f4770affd1aea1454b1e HEAD_REF master + PATCHES glew.patch ) # make sure that no "internal" libraries are used by removing them diff --git a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch b/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch deleted file mode 100644 index 1120cd096319cb..00000000000000 --- a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c00902521..b24508654 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -176,6 +176,8 @@ option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) - option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF) - option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF) - -+# vcpkg config install path -+option(CONFIG_INSTALL_PATH "location to install cmake config files" lib/cmake/freetype) - - # Disallow in-source builds - if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") -@@ -559,7 +561,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - COMPONENT libraries) - install( - EXPORT freetype-targets -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype -+ DESTINATION ${CONFIG_INSTALL_PATH} - FILE freetype-config.cmake - COMPONENT headers) - endif () diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 7ba2032bf3107f..eb2b102727d5b9 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,7 +1,7 @@ Source: freetype Version: 2.10.2 -Port-Version: 1 -Build-Depends: zlib +Port-Version: 4 +Build-Depends: zlib, brotli Homepage: https://www.freetype.org/ Description: A library to render fonts. Default-Features: bzip2, png diff --git a/ports/freetype/brotli-static.patch b/ports/freetype/brotli-static.patch new file mode 100644 index 00000000000000..1635311ade0ecc --- /dev/null +++ b/ports/freetype/brotli-static.patch @@ -0,0 +1,29 @@ +diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake +index 7c484c7df..0bd49b825 100644 +--- a/builds/cmake/FindBrotliDec.cmake ++++ b/builds/cmake/FindBrotliDec.cmake +@@ -34,14 +34,22 @@ find_path(BROTLIDEC_INCLUDE_DIRS + PATH_SUFFIXES brotli) + + find_library(BROTLIDEC_LIBRARIES +- NAMES brotlidec ++ NAMES brotlidec brotlidec-static + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) + ++find_library(BROTLICOMMON_LIBRARIES ++ NAMES brotlicommon-static ++ HINTS ${PC_BROTLIDEC_LIBDIR} ++ ${PC_BROTLIDEC_LIBRARY_DIRS}) ++ ++if(BROTLICOMMON_LIBRARIES) ++ set(BROTLIDEC_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( +- brotlidec ++ BrotliDec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR BROTLIDEC_VERSION) diff --git a/ports/freetype/pkgconfig.patch b/ports/freetype/pkgconfig.patch new file mode 100644 index 00000000000000..615434a34bbc6e --- /dev/null +++ b/ports/freetype/pkgconfig.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 65839ac58..54f2ce8ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -517,7 +517,6 @@ endif () + + if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + # Generate the pkg-config file +- if (UNIX) + file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN) + + string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}") +@@ -551,7 +550,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + FILES ${PROJECT_BINARY_DIR}/freetype2.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + COMPONENT pkgconfig) +- endif () + + install( + TARGETS freetype diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index eddc993da16511..ed8cbcbf3f05e4 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,8 +11,9 @@ vcpkg_extract_source_archive_ex( REF ${FT_VERSION} PATCHES 0001-Fix-install-command.patch - 0002-Add-CONFIG_INSTALL_PATH-option.patch 0003-Fix-UWP.patch + pkgconfig.patch + brotli-static.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -28,50 +29,56 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCONFIG_INSTALL_PATH=share/freetype -DFT_WITH_ZLIB=ON # Force system zlib. - ${FEATURE_OPTIONS} + -DFT_WITH_BROTLI=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype) +# Rename for easy usage (VS integration; CMake and autotools will not care) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config-debug.cmake DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-debug.cmake "${DEBUG_MODULE}") -endif() +# Fix the include dir [freetype2 -> freetype] +file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include" CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlicommon-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlicommon-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlicommon-static.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec-static.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake RELEASE_MODULE) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake "${RELEASE_MODULE}") +find_library(FREETYPE_DEBUG NAMES freetyped PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/" NO_DEFAULT_PATH) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc") + file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents) + if(FREETYPE_DEBUG) + string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}") + endif() + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}") endif() - -# Fix the include dir [freetype2 -> freetype] -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config.cmake CONFIG_MODULE) -else() #if(VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc") + file(READ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" _contents) + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" "${_contents}") endif() -string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY - ${SOURCE_PATH}/docs/LICENSE.TXT ${SOURCE_PATH}/docs/FTL.TXT ${SOURCE_PATH}/docs/GPLv2.TXT - DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/freetype/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/freetype/copyright) +file(INSTALL ${SOURCE_PATH}/docs/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -83,5 +90,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(USE_PNG ON) endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/freetype/vcpkg-cmake-wrapper.cmake @ONLY) + configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake + ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) endif() diff --git a/ports/freetype/vcpkg-cmake-wrapper.cmake b/ports/freetype/vcpkg-cmake-wrapper.cmake index 01da0b1dc271fb..355ddbcf575eeb 100644 --- a/ports/freetype/vcpkg-cmake-wrapper.cmake +++ b/ports/freetype/vcpkg-cmake-wrapper.cmake @@ -10,6 +10,14 @@ if(@USE_PNG@) find_package(PNG) endif() +find_library(BROTLIDEC_LIBRARY_RELEASE NAMES brotlidec brotlidec-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLIDEC_LIBRARY_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +include(SelectLibraryConfigurations) +select_library_configurations(BROTLIDEC) +select_library_configurations(BROTLICOMMON) + if(TARGET Freetype::Freetype) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) @@ -20,6 +28,7 @@ if(TARGET Freetype::Freetype) if(@USE_PNG@) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES PNG::PNG) endif() + target_link_libraries(Freetype::Freetype INTERFACE ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() if(FREETYPE_LIBRARIES) @@ -32,4 +41,6 @@ if(FREETYPE_LIBRARIES) if(@USE_PNG@) list(APPEND FREETYPE_LIBRARIES ${PNG_LIBRARIES}) endif() + + list(APPEND FREETYPE_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() diff --git a/ports/freexl/CONTROL b/ports/freexl/CONTROL index 68d0d291fc6b88..1a887b1932ad42 100644 --- a/ports/freexl/CONTROL +++ b/ports/freexl/CONTROL @@ -1,5 +1,6 @@ Source: freexl -Version: 1.0.4-9 +Version: 1.0.4 +Port-Version: 10 Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet Build-Depends: libiconv diff --git a/ports/freexl/portfile.cmake b/ports/freexl/portfile.cmake index 3c4629dce5137f..6a79451dd77d95 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -64,6 +64,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX ) file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS_DEBUG INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" diff --git a/ports/fribidi/CONTROL b/ports/fribidi/CONTROL index edfb9c77707406..570fd13621e5b2 100644 --- a/ports/fribidi/CONTROL +++ b/ports/fribidi/CONTROL @@ -1,4 +1,4 @@ Source: fribidi -Version: 1.0.9-1 +Version: 1.0.10 Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) Build-Depends: tool-meson diff --git a/ports/fribidi/fix-win-static-suffix.patch b/ports/fribidi/fix-win-static-suffix.patch index 87f288e939641a..953b1b91be7d19 100644 --- a/ports/fribidi/fix-win-static-suffix.patch +++ b/ports/fribidi/fix-win-static-suffix.patch @@ -1,39 +1,25 @@ diff --git a/lib/meson.build b/lib/meson.build -index 573d47f..c9b249e 100644 +index aaf2aed..3fe8937 100644 --- a/lib/meson.build +++ b/lib/meson.build -@@ -71,14 +71,26 @@ fribidi_sources = [ +@@ -71,6 +71,10 @@ fribidi_sources = [ 'fribidi-shape.c', ] --libfribidi = library('fribidi', -- fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -- generated_tab_include_files, config_h, -- include_directories: incs, -- c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -- version: libversion, -- soversion: soversion, -- install: true) ++libsuffix = [] +if host_machine.system() == 'windows' and get_option('default_library') == 'static' -+ libfribidi = library('fribidi', -+ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -+ generated_tab_include_files, config_h, -+ include_directories: incs, -+ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -+ version: libversion, -+ soversion: soversion, -+ install: true, -+ name_suffix: 'lib') -+else -+ libfribidi = library('fribidi', -+ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -+ generated_tab_include_files, config_h, -+ include_directories: incs, -+ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -+ version: libversion, -+ soversion: soversion, -+ install: true) ++ libsuffix = 'lib' +endif + libfribidi = library('fribidi', + fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, + generated_tab_include_files, config_h, +@@ -78,7 +82,8 @@ libfribidi = library('fribidi', + c_args: ['-DHAVE_CONFIG_H', '-DFRIBIDI_BUILD'] + fribidi_static_cargs + visibility_args, + version: libversion, + soversion: soversion, +- install: true) ++ install: true, ++ name_suffix: libsuffix) libfribidi_dep = declare_dependency(link_with: libfribidi, include_directories: incs, diff --git a/ports/fribidi/portfile.cmake b/ports/fribidi/portfile.cmake index 342b4d3c5786c6..740502bdd8c88d 100644 --- a/ports/fribidi/portfile.cmake +++ b/ports/fribidi/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fribidi/fribidi - REF abea9f626732a9b10499d76c1cd69ce5457950cc # v1.0.9 - SHA512 5cb28f9e35d0df205c9fb88a56776d371fdd8bca12c211cec282334cfbf12a05e3324cd14a3ae71bcc06e15ce07b06cbe97eaafe1c7368e517a4ce5a4c3a2bcc + REF 5464c284034da9c058269377b7f5013bb089f553 # v1.0.10 + SHA512 82e42b022f23d6ecebac5071f997c9f46db6aa41c36f87a7f1a28a79b4ccaada10d68b233bbf687c552fc94d91f4b47161e0ef4909fd1de0b483089f1d1377f9 HEAD_REF master PATCHES fix-win-static-suffix.patch ) @@ -11,23 +11,22 @@ vcpkg_configure_meson( SOURCE_PATH ${SOURCE_PATH} OPTIONS -Ddocs=false + -Dbin=false + -Dtests=false --backend=ninja ) vcpkg_install_meson() vcpkg_copy_pdbs() -file(GLOB EXE_FILES - "${CURRENT_PACKAGES_DIR}/bin/*.exe" - "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe" -) -if (EXE_FILES) - file(REMOVE ${EXE_FILES}) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +# Define static macro +file(READ ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h FRIBIDI_COMMON_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 0" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") +else() + string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 1" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h "${FRIBIDI_COMMON_H}") # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/g2o/CONTROL b/ports/g2o/CONTROL index 80b321d5bd7e15..5234914a2de257 100644 --- a/ports/g2o/CONTROL +++ b/ports/g2o/CONTROL @@ -1,5 +1,6 @@ Source: g2o Version: 2020-02-07 -Build-Depends: suitesparse, eigen3, clapack (!osx), ceres +Port-Version: 1 +Build-Depends: suitesparse, eigen3, lapack, ceres Description: g2o: A General Framework for Graph Optimization Homepage: https://openslam.org/g2o.html diff --git a/ports/gamedev-framework/CONTROL b/ports/gamedev-framework/CONTROL new file mode 100644 index 00000000000000..d152e8426fc981 --- /dev/null +++ b/ports/gamedev-framework/CONTROL @@ -0,0 +1,7 @@ +Source: gamedev-framework +Version: 0.17 +Port-Version: 1 +Homepage: https://github.com/GamedevFramework/gf +Description: gf is a framework to build 2D games in C++14. +Build-Depends: sdl2, freetype, zlib, boost-algorithm, boost-filesystem, boost-heap, boost-container, stb, pugixml +Supports: !arm diff --git a/ports/gamedev-framework/portfile.cmake b/ports/gamedev-framework/portfile.cmake new file mode 100644 index 00000000000000..511bf9c23f42e9 --- /dev/null +++ b/ports/gamedev-framework/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_fail_port_install( + ON_ARCH "arm" +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO GamedevFramework/gf + HEAD_REF master + REF v0.17.4 + SHA512 b35e0fef3c9dc397ec43132dcd6ca87f78217c55d72fc1117b1f530d568ad3537a0f682e285840471faa4e06eb7f396b784da767e83686519d0694b198a86379 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DGF_VCPKG=ON + -DGF_USE_EMBEDDED_LIBS=OFF + -DGF_BUILD_GAMES=OFF + -DGF_BUILD_EXAMPLES=OFF + -DGF_BUILD_TESTS=OFF + -DGF_BUILD_DOCUMENTATION=OFF + -DGF_SINGLE_COMPILTATION_UNIT=ON + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + OPTIONS_RELEASE -DGF_DEBUG=OFF + OPTIONS_DEBUG -DGF_DEBUG=ON +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/gf TARGET_PATH share/gf) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/share/doc" + "${CURRENT_PACKAGES_DIR}/debug/bin/gf_info.exe" + "${CURRENT_PACKAGES_DIR}/bin/gf_info.exe" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/bin" + "${CURRENT_PACKAGES_DIR}/debug/bin" + ) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index 48e48c08052c5d..531811ecc1025c 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,8 +1,10 @@ Source: gdal -Version: 2.4.1-9 +Version: 2.4.1 +Port-Version: 11 Homepage: https://gdal.org/ Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. Build-Depends: proj4, libpng, geos, sqlite3, curl, expat, libpq, openjpeg, libwebp, libxml2, liblzma, netcdf-c, hdf5, zlib +Supports: !arm Feature: mysql-libmariadb Build-Depends: libmariadb @@ -10,4 +12,4 @@ Description: Add mysql support using libmariadb Feature: libspatialite Build-Depends: libspatialite -Description: Create or update SpatiaLite databases using libspatialite +Description: Create or update SpatiaLite databases using libspatialite \ No newline at end of file diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 73840e1641236e..298dd06880310c 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -1,16 +1,10 @@ -# vcpkg portfile.cmake for GDAL -# # NOTE: update the version and checksum for new GDAL release -include(vcpkg_common_functions) - set(GDAL_VERSION_STR "2.4.1") set(GDAL_VERSION_PKG "241") set(GDAL_VERSION_LIB "204") set(GDAL_PACKAGE_SUM "edb9679ee6788334cf18971c803615ac9b1c72bc0c96af8fd4852cb7e8f58e9c4f3d9cb66406bc8654419612e1a7e9d0e62f361712215f4a50120f646bb0a738") -if (TRIPLET_SYSTEM_ARCH MATCHES "arm") - message(FATAL_ERROR "ARM is currently not supported.") -endif() +vcpkg_fail_port_install(ON_ARCH "arm") vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/gdal/${GDAL_VERSION_STR}/gdal${GDAL_VERSION_PKG}.zip" @@ -54,7 +48,7 @@ foreach(BUILD_TYPE IN LISTS BUILD_TYPES) ) endforeach() -if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) # Check build system first find_program(NMAKE nmake REQUIRED) @@ -80,18 +74,23 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor # Setup geos libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" GEOS_INCLUDE_DIR) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libgeos_c.lib ${CURRENT_INSTALLED_DIR}/lib/libgeos.lib" GEOS_LIBRARY_REL) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libgeos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/libgeosd.lib" GEOS_LIBRARY_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib" GEOS_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib" GEOS_LIBRARY_DBG) else() file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib" GEOS_LIBRARY_REL) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib" GEOS_LIBRARY_DBG) endif() - + # Setup expat libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" EXPAT_INCLUDE_DIR) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/expat.lib" EXPAT_LIBRARY_REL) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/expat.lib" EXPAT_LIBRARY_DBG) - + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libexpatMD.lib" EXPAT_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libexpatdMD.lib" EXPAT_LIBRARY_DBG) + else() + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libexpat.lib" EXPAT_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libexpatd.lib" EXPAT_LIBRARY_DBG) + endif() + # Setup curl libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" CURL_INCLUDE_DIR) if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/libcurl.lib") @@ -212,9 +211,12 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor if (VCPKG_LIBRARY_LINKAGE STREQUAL static) list(APPEND NMAKE_OPTIONS CURL_CFLAGS=-DCURL_STATICLIB) + list(APPEND NMAKE_OPTIONS DLLBUILD=0) + list(APPEND NMAKE_OPTIONS "PROJ_FLAGS=-DPROJ_STATIC -DPROJ_VERSION=5") else() # Enables PDBs for release and debug builds list(APPEND NMAKE_OPTIONS WITH_PDB=1) + list(APPEND NMAKE_OPTIONS DLLBUILD=1) endif() if (VCPKG_CRT_LINKAGE STREQUAL static) @@ -255,7 +257,7 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor "PG_LIB=${PGSQL_LIBRARY_DBG} Secur32.lib Shell32.lib Advapi32.lib Crypt32.lib Gdi32.lib ${OPENSSL_LIBRARY_DBG}" DEBUG=1 ) - + # Begin build process if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") ################ @@ -305,12 +307,12 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(COPY ${SOURCE_PATH_RELEASE}/gdal_i.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${SOURCE_PATH_RELEASE}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(COPY ${SOURCE_PATH_DEBUG}/gdal_i.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdal_id.lib) + file(COPY ${SOURCE_PATH_DEBUG}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdald.lib) endif() else() @@ -422,5 +424,8 @@ else() # Other build system message(FATAL_ERROR "Unsupport build system.") endif() +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) + # Handle copyright -configure_file(${SOURCE_PATH_RELEASE}/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/gdal/copyright COPYONLY) +configure_file(${SOURCE_PATH_RELEASE}/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/gdal/usage b/ports/gdal/usage new file mode 100644 index 00000000000000..2ee0072acd1e40 --- /dev/null +++ b/ports/gdal/usage @@ -0,0 +1,5 @@ +The package GDAL provides CMake targets: + + find_package(GDAL REQUIRED) + target_include_directories(main PRIVATE ${GDAL_INCLUDE_DIR}) + target_link_libraries(main PRIVATE ${GDAL_LIBRARY}) \ No newline at end of file diff --git a/ports/gdal/vcpkg-cmake-wrapper.cmake b/ports/gdal/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..ba3c6926e29d45 --- /dev/null +++ b/ports/gdal/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,12 @@ +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(GDAL_INCLUDE_DIR NAMES gdal.h HINTS ${CURRENT_INSTALLED_DIR}) + +find_library(GDAL_LIBRARY_DEBUG NAMES gdald libgdal NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(GDAL_LIBRARY_RELEASE NAMES gdal libgdal NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(GDAL) + +set(GDAL_INCLUDE_DIR ${GDAL_INCLUDE_DIR}) +set(GDAL_LIBRARY ${GDAL_LIBRARY}) \ No newline at end of file diff --git a/ports/gdcm/CONTROL b/ports/gdcm/CONTROL index 85f634cd680c13..aafb13a8dbcae2 100644 --- a/ports/gdcm/CONTROL +++ b/ports/gdcm/CONTROL @@ -1,5 +1,7 @@ Source: gdcm Version: 3.0.5 +Port-Version: 2 Homepage: https://github.com/malaterre/GDCM Description: Grassroots DICOM library Build-Depends: zlib, expat, openjpeg +Supports: !uwp \ No newline at end of file diff --git a/ports/gdcm/portfile.cmake b/ports/gdcm/portfile.cmake index 5626e812b26a21..3edb205d75aec0 100644 --- a/ports/gdcm/portfile.cmake +++ b/ports/gdcm/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -42,14 +44,14 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ) -file(READ ${CURRENT_PACKAGES_DIR}/share/gdcm/GDCMTargets.cmake GDCM_TARGETS) -string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" - "set(CMAKE_IMPORT_FILE_VERSION 1) -find_package(OpenJPEG QUIET)" GDCM_TARGETS "${GDCM_TARGETS}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/gdcm/GDCMTargets.cmake "${GDCM_TARGETS}") +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/gdcm/GDCMTargets.cmake + "set(CMAKE_IMPORT_FILE_VERSION 1)" + "set(CMAKE_IMPORT_FILE_VERSION 1) + find_package(OpenJPEG QUIET)" +) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/geogram/CONTROL b/ports/geogram/CONTROL index 4eb40eee04619b..c74c9d216f91dd 100644 --- a/ports/geogram/CONTROL +++ b/ports/geogram/CONTROL @@ -1,8 +1,10 @@ Source: geogram -Version: 1.6.9-7 +Version: 1.7.5 +Port-Version: 1 Homepage: https://gforge.inria.fr/projects/geogram/ Description: Geogram is a programming library of geometric algorithms. -Build-Depends: openblas (!osx), clapack (!osx) +Build-Depends: openblas, lapack +Supports: !uwp Feature: graphics Description: Build viewers and geogram_gfx library. diff --git a/ports/geogram/fix-cmake-config-and-install.patch b/ports/geogram/fix-cmake-config-and-install.patch index 2c7790923f1426..8eb16c364bec17 100644 --- a/ports/geogram/fix-cmake-config-and-install.patch +++ b/ports/geogram/fix-cmake-config-and-install.patch @@ -1,9 +1,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 17dc02e..e489d75 100644 +index 2e54997..169e33c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -42,7 +42,7 @@ set(VORPALINE_VERSION_MINOR 6) - set(VORPALINE_VERSION_PATCH 9) +@@ -51,7 +51,7 @@ set(VORPALINE_VERSION_MINOR 7) + set(VORPALINE_VERSION_PATCH 5) set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH}) -set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR}) @@ -11,7 +11,7 @@ index 17dc02e..e489d75 100644 # Determine the current Build-OS (Build-platform without the compiler info) string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM}) -@@ -106,6 +106,11 @@ if(GEOGRAM_WITH_VORPALINE) +@@ -113,6 +113,11 @@ if(GEOGRAM_WITH_VORPALINE) add_subdirectory(src/lib/vorpalib) endif() @@ -23,7 +23,7 @@ index 17dc02e..e489d75 100644 add_subdirectory(src/lib/third_party) if(GEOGRAM_WITH_GRAPHICS) -@@ -138,8 +143,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) +@@ -145,8 +150,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) # FindGeogram.cmake @@ -70,10 +70,10 @@ index 17dc02e..e489d75 100644 # Configure CPack diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt -index d90bc48..927f857 100644 +index 49cb2ba..82c2f39 100755 --- a/src/lib/geogram/CMakeLists.txt +++ b/src/lib/geogram/CMakeLists.txt -@@ -47,7 +47,14 @@ if(WIN32) +@@ -62,7 +62,14 @@ if(WIN32) endif() # Install the library @@ -90,10 +90,10 @@ index d90bc48..927f857 100644 # Install include files for the standard devkit install( diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt -index f319b93..e24039d 100644 +index b155975..ad66440 100755 --- a/src/lib/geogram_gfx/CMakeLists.txt +++ b/src/lib/geogram_gfx/CMakeLists.txt -@@ -33,14 +33,21 @@ if(VORPALINE_BUILD_DYNAMIC) +@@ -47,14 +47,21 @@ if(VORPALINE_BUILD_DYNAMIC) endif() # Install the library @@ -117,7 +117,7 @@ index f319b93..e24039d 100644 ) # Install include files for the full devkit -@@ -48,7 +55,7 @@ install( +@@ -62,7 +69,7 @@ install( DIRECTORY . DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx COMPONENT devkit-full @@ -127,7 +127,7 @@ index f319b93..e24039d 100644 install( diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt -index 5789cd2..e4262e3 100644 +index c9c3a6e..f16d7ec 100644 --- a/src/lib/third_party/numerics/CMakeLists.txt +++ b/src/lib/third_party/numerics/CMakeLists.txt @@ -10,16 +10,19 @@ endif() @@ -154,7 +154,7 @@ index 5789cd2..e4262e3 100644 target_link_libraries(geogram_num_3rdparty m) endif() diff --git a/src/lib/third_party/numerics/LIBF2C/getarg_.c b/src/lib/third_party/numerics/LIBF2C/getarg_.c -index 2b69a1e..a504538 100644 +index 2b69a1e..1cde8b6 100755 --- a/src/lib/third_party/numerics/LIBF2C/getarg_.c +++ b/src/lib/third_party/numerics/LIBF2C/getarg_.c @@ -17,20 +17,20 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls; @@ -193,7 +193,7 @@ index 2b69a1e..a504538 100644 } #endif diff --git a/src/lib/third_party/numerics/LIBF2C/iargc_.c b/src/lib/third_party/numerics/LIBF2C/iargc_.c -index 2f29da0..50b00de 100644 +index 2f29da0..50b00de 100755 --- a/src/lib/third_party/numerics/LIBF2C/iargc_.c +++ b/src/lib/third_party/numerics/LIBF2C/iargc_.c @@ -9,8 +9,9 @@ ftnint iargc_() diff --git a/ports/geogram/portfile.cmake b/ports/geogram/portfile.cmake index 3bf583d51245f3..b4b55943367df1 100644 --- a/ports/geogram/portfile.cmake +++ b/ports/geogram/portfile.cmake @@ -1,11 +1,9 @@ -include(vcpkg_common_functions) - -set(GEOGRAM_VERSION 1.6.9) +set(GEOGRAM_VERSION 1.7.5) vcpkg_download_distfile(ARCHIVE - URLS "https://gforge.inria.fr/frs/download.php/file/37779/geogram_${GEOGRAM_VERSION}.tar.gz" - FILENAME "geogram_${GEOGRAM_VERSION}.tar.gz" - SHA512 1b5c7540bef734c1908f213f26780aba63b4911a8022d5eb3f7c90eabe2cb69efd1f298b30cdc8e2c636a5b37c8c25832dd4aad0b7c2ff5f0a5b5caa17970136 + URLS "https://gforge.inria.fr/frs/download.php/file/38314/geogram_${GEOGRAM_VERSION}.tar.gz" + FILENAME "geogram_${GEOGRAM_VERSION}_47dcbb8.tar.gz" + SHA512 47dcbb8a5c4e5f791feb8d9b209b04b575b0757e8b89de09c82ef2324a36d4056a1f3001537038c8a752045b0e6b6eedf5421ad49132214c0f60163ff095c36f ) vcpkg_extract_source_archive_ex( @@ -18,35 +16,36 @@ vcpkg_extract_source_archive_ex( file(COPY ${CURRENT_PORT_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH}/cmake) -set(GEOGRAM_WITH_GRAPHICS OFF) -if("graphics" IN_LIST FEATURES) - set(GEOGRAM_WITH_GRAPHICS ON) -endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "graphics" GEOGRAM_WITH_GRAPHICS +) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(VORPALINE_BUILD_DYNAMIC FALSE) - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + if (VCPKG_TARGET_IS_WINDOWS) set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") + if (VCPKG_TARGET_IS_LINUX) message("geogram on Linux only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") + if (VCPKG_TARGET_IS_OSX) message("geogram on Darwin only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() else() set(VORPALINE_BUILD_DYNAMIC TRUE) - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + if (VCPKG_TARGET_IS_WINDOWS) set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") + if (VCPKG_TARGET_IS_LINUX) set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") + if (VCPKG_TARGET_IS_OSX) set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() endif() @@ -57,11 +56,11 @@ vcpkg_configure_cmake( #PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DVORPALINE_BUILD_DYNAMIC=${VORPALINE_BUILD_DYNAMIC} - -DGEOGRAM_WITH_GRAPHICS=${GEOGRAM_WITH_GRAPHICS} -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_USE_SYSTEM_GLFW3=ON -DVORPALINE_PLATFORM=${VORPALINE_PLATFORM} -DGEOGRAM_WITH_VORPALINE=OFF + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -73,11 +72,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(READ ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake TARGET_CONFIG) -string(REPLACE [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] - [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] TARGET_CONFIG "${TARGET_CONFIG}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake "${TARGET_CONFIG}") +vcpkg_replace_string( + ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake + [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] + [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] + ) # Handle copyright -file(COPY ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/geogram) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/geogram/license.dox ${CURRENT_PACKAGES_DIR}/share/geogram/copyright) +file(INSTALL ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/geographiclib/vcpkg.json b/ports/geographiclib/vcpkg.json index a60a5e7db2e1dc..8ec469c9025971 100644 --- a/ports/geographiclib/vcpkg.json +++ b/ports/geographiclib/vcpkg.json @@ -1,8 +1,8 @@ { "name": "geographiclib", "version-string": "1.50.1", - "homepage": "https://geographiclib.sourceforge.io", "description": "GeographicLib, a C++ library for performing geographic conversions", + "homepage": "https://geographiclib.sourceforge.io", "features": [ { "name": "tools", diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL index 356c93269d1d9b..c5d99f6f6e8c0b 100644 --- a/ports/geos/CONTROL +++ b/ports/geos/CONTROL @@ -1,4 +1,4 @@ Source: geos -Version: 3.6.4 +Version: 3.8.1 Homepage: https://www.osgeo.org/projects/geos/ Description: Geometry Engine Open Source diff --git a/ports/geos/dont-build-astyle.patch b/ports/geos/dont-build-astyle.patch new file mode 100644 index 00000000000000..6d48cabfbfbc38 --- /dev/null +++ b/ports/geos/dont-build-astyle.patch @@ -0,0 +1,12 @@ +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 1f27b802..ecf836b4 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -21,7 +21,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/geos-config + PERMISSIONS + OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + +-add_subdirectory(astyle) + + # if(UNIX OR MINGW) + diff --git a/ports/geos/dont-build-docs.patch b/ports/geos/dont-build-docs.patch new file mode 100644 index 00000000000000..fcd2742c8cd75a --- /dev/null +++ b/ports/geos/dont-build-docs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b78ca54b..507df2af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -264,7 +264,6 @@ add_subdirectory(benchmarks) + #----------------------------------------------------------------------------- + # Documentation/Examples + #----------------------------------------------------------------------------- +-add_subdirectory(doc) + + #----------------------------------------------------------------------------- + # Install and export targets - support 'make install' or equivalent diff --git a/ports/geos/geos_c-static-support.patch b/ports/geos/geos_c-static-support.patch deleted file mode 100644 index 8cc49520c4fcfd..00000000000000 --- a/ports/geos/geos_c-static-support.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e7d2451..f8cc1ba 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -66,11 +66,7 @@ if(NOT MSVC) - "Set to ON|OFF (default) to build GEOS with assert() macro enabled" OFF) - endif() - --option(GEOS_BUILD_STATIC -- "Set to OFF|ON (default) to build GEOS static libraries" ON) -- --option(GEOS_BUILD_SHARED -- "Set to OFF|ON (default) to build GEOS shared libraries" ON) -+option(BUILD_SHARED_LIBS "Build GEOS as a shared library" ON) - - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - option(GEOS_ENABLE_FLOATSTORE -diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt -index 0607b16..877d611 100644 ---- a/capi/CMakeLists.txt -+++ b/capi/CMakeLists.txt -@@ -21,17 +21,25 @@ set(geos_c_SOURCES - - file(GLOB geos_capi_HEADERS ${CMAKE_BINARY_DIR}/capi/*.h) # fix source_group issue - --if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK AND GEOS_BUILD_SHARED) -+if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK) - # if building OS X framework or only building static libs, CAPI built into C++ library) -- add_library(geos_c SHARED ${geos_c_SOURCES}) -+ add_library(geos_c ${geos_c_SOURCES}) - - target_link_libraries(geos_c geos) - - if (WIN32) -- set_target_properties(geos_c -- PROPERTIES -- VERSION ${CAPI_VERSION} -- CLEAN_DIRECT_OUTPUT 1) -+ if(BUILD_SHARED_LIBS) -+ set_target_properties(geos_c -+ PROPERTIES -+ VERSION ${CAPI_VERSION} -+ CLEAN_DIRECT_OUTPUT 1) -+ else() -+ set_target_properties(geos_c -+ PROPERTIES -+ OUTPUT_NAME "geos_c" -+ PREFIX "lib" -+ CLEAN_DIRECT_OUTPUT 1) -+ endif() - else() - set_target_properties(geos_c - PROPERTIES -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 3894a56..f86d823 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -24,7 +24,7 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK) - # also 1 binary, so include CAPI here - # and, make name all caps - -- add_library(GEOS SHARED ${geos_SOURCES} ${geos_c_SOURCES}) -+ add_library(GEOS ${geos_SOURCES} ${geos_c_SOURCES}) - - math(EXPR CVERSION "${VERSION_MAJOR} + 1") - # VERSION = current version, SOVERSION = compatibility version -@@ -62,38 +62,27 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK) - - else() - -- if(GEOS_BUILD_SHARED) -- add_library(geos SHARED ${geos_SOURCES} ${geos_ALL_HEADERS}) -+ add_library(geos ${geos_SOURCES} ${geos_ALL_HEADERS}) - -+ if(BUILD_SHARED_LIBS) - set_target_properties(geos - PROPERTIES - DEFINE_SYMBOL GEOS_DLL_EXPORT - VERSION ${VERSION} - CLEAN_DIRECT_OUTPUT 1) -- -- install(TARGETS geos -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib) -- endif() -- -- if(GEOS_BUILD_STATIC) -- file(GLOB geos_capi_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../capi/*.h) # fix source_group issue -- add_library(geos-static STATIC ${geos_SOURCES} ${geos_c_SOURCES} ${geos_ALL_HEADERS} ${geos_capi_HEADERS}) -- -- set_target_properties(geos-static -+ else() -+ set_target_properties(geos - PROPERTIES - OUTPUT_NAME "geos" - PREFIX "lib" - CLEAN_DIRECT_OUTPUT 1) -- -- install(TARGETS geos-static -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib) -- - endif() - -+ install(TARGETS geos -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ - endif() # (GEOS_ENABLE_MACOSX_FRAMEWORK) - - # if(APPLE) diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index 82a4e627624a53..d6b4e083037839 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -1,15 +1,17 @@ -set(GEOS_VERSION 3.6.4) +set(GEOS_VERSION 3.8.1) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2" FILENAME "geos-${GEOS_VERSION}.tar.bz2" - SHA512 860513d86ee1294814ff3b3240373ee3a9ce88be9508b45f61ccc982bb698d0a1916e9458c37853ce8d69a977db6f12483745859f86617d704a688cfeb83b1e9 + SHA512 1d8d8b3ece70eb388ea128f4135c7455899f01828223b23890ad3a2401e27104efce03987676794273a9b9d4907c0add2be381ff14b8420aaa9a858cc5941056 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} REF ${GEOS_VERSION} - PATCHES geos_c-static-support.patch + PATCHES + dont-build-docs.patch + dont-build-astyle.patch ) # NOTE: GEOS provides CMake as optional build configuration, it might not be actively @@ -20,9 +22,10 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DCMAKE_DEBUG_POSTFIX=d - -DGEOS_ENABLE_TESTS=False + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GEOS) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 9a7fd7e9c2324e..6409f87e7f4ce9 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,4 +1,4 @@ Source: glew -Version: 2.1.0-7 +Version: 2.1.0-8 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. Homepage: https://github.com/nigels-com/glew diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 504a91dcf4a976..de436818cddc67 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -26,7 +26,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glew) -if(VCPKG_TARGET_IS_WINDOWS) +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(_targets_cmake_files) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake") diff --git a/ports/gmp/CONTROL b/ports/gmp/CONTROL deleted file mode 100644 index 3f42c9d2a06d8f..00000000000000 --- a/ports/gmp/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: gmp -Version: 6.2.0-1 -Homepage: https://gmplib.org/ -Description: The GNU Multiple Precision Arithmetic Library -Build-Depends: vs-yasm (windows) \ No newline at end of file diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index ee4b51c087b56a..b8a289628dfc9f 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -1,3 +1,7 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.") +endif() + if(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -5,9 +9,10 @@ if(VCPKG_TARGET_IS_WINDOWS) REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 HEAD_REF master - PATCHES vs.build.patch - runtime.patch - prefix.patch + PATCHES + vs.build.patch + runtime.patch + prefix.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -102,6 +107,4 @@ else() # # Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -endif() - - +endif() \ No newline at end of file diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json new file mode 100644 index 00000000000000..77b237197aa826 --- /dev/null +++ b/ports/gmp/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "gmp", + "version-string": "6.2.0", + "port-version": 3, + "description": "The GNU Multiple Precision Arithmetic Library", + "homepage": "https://gmplib.org", + "dependencies": [ + { + "name": "vs-yasm", + "platform": "windows" + } + ] +} diff --git a/ports/google-cloud-cpp/CONTROL b/ports/google-cloud-cpp/CONTROL index fa905504f67a85..8ffcb895dc914f 100644 --- a/ports/google-cloud-cpp/CONTROL +++ b/ports/google-cloud-cpp/CONTROL @@ -1,6 +1,6 @@ Source: google-cloud-cpp -Version: 1.15.0 -Build-Depends: abseil, grpc, curl[ssl], crc32c +Version: 1.17.1 +Build-Depends: abseil, grpc, curl[ssl], crc32c, nlohmann-json Description: C++ Client Libraries for Google Cloud Platform APIs. Homepage: https://github.com/googleapis/google-cloud-cpp Supports: !uwp diff --git a/ports/google-cloud-cpp/portfile.cmake b/ports/google-cloud-cpp/portfile.cmake index 836115f01d6529..b9a9d9207ab924 100644 --- a/ports/google-cloud-cpp/portfile.cmake +++ b/ports/google-cloud-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp - REF v1.15.0 - SHA512 193599a0ae64ee72a130417e7ce11b0e1c4af353b14124be6c781cde4f7478313460adfcf429a14195486c7d17be197410c37c2778265f08cfcba97af603b86c + REF v1.17.1 + SHA512 1cad4c679f3dc5438e39b91d432756d33c1f4c470c7a2a6d08086c805813e0ed31411d9167e7f6f1a39255f8a64b67e17159d072461938e5dc256867f03c54be HEAD_REF master ) diff --git a/ports/grpc/00001-fix-uwp.patch b/ports/grpc/00001-fix-uwp.patch index eee4f14d195b1d..a66f03f49a992a 100644 --- a/ports/grpc/00001-fix-uwp.patch +++ b/ports/grpc/00001-fix-uwp.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8561c67..84de29f 100644 +index a067308142..086d4c5837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -150,6 +150,9 @@ if(UNIX) +@@ -153,6 +153,9 @@ if(UNIX) endif() if(WIN32) set(_gRPC_PLATFORM_WINDOWS ON) @@ -12,7 +12,7 @@ index 8561c67..84de29f 100644 endif() # Use C99 standard -@@ -174,6 +177,9 @@ if(MSVC) +@@ -191,6 +194,9 @@ if(MSVC) set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267") # TODO(jtattermusch): needed to build boringssl with VS2017, revisit later set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619") @@ -20,9 +20,9 @@ index 8561c67..84de29f 100644 + add_definitions(-DGRPC_ARES=0) + endif() endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}") -@@ -237,6 +243,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) + if (MINGW) + add_definitions(-D_WIN32_WINNT=0x600) +@@ -258,6 +264,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) # ``.proto`` files # function(protobuf_generate_grpc_cpp) @@ -33,7 +33,7 @@ index 8561c67..84de29f 100644 if(NOT ARGN) message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") return() -@@ -309,6 +319,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) +@@ -330,6 +340,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin) endif () @@ -41,7 +41,7 @@ index 8561c67..84de29f 100644 add_custom_target(plugins DEPENDS ${_gRPC_PLUGIN_LIST} ) -@@ -327,6 +338,7 @@ add_custom_target(tools_cxx +@@ -348,6 +359,7 @@ add_custom_target(tools_cxx add_custom_target(tools DEPENDS tools_c tools_cxx) @@ -50,7 +50,7 @@ index 8561c67..84de29f 100644 protobuf_generate_grpc_cpp( src/proto/grpc/channelz/channelz.proto diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc -index 0fc0279..aaf2b09 100644 +index dbe84e3466..cda40b6435 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -945,7 +945,7 @@ bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size, @@ -63,7 +63,7 @@ index 0fc0279..aaf2b09 100644 bool was_zero_or_negative = resource_user->free_pool <= 0; resource_user->free_pool += static_cast(size); diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -index 59432cf..fed574d 100644 +index 59432cff36..fed574d5bc 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc @@ -39,6 +39,7 @@ bool check_bios_data(const char*) { return false; } diff --git a/ports/grpc/00002-static-linking-in-linux.patch b/ports/grpc/00002-static-linking-in-linux.patch index 371873888b7caa..80ec441b352824 100644 --- a/ports/grpc/00002-static-linking-in-linux.patch +++ b/ports/grpc/00002-static-linking-in-linux.patch @@ -1,16 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 84de29f..0c6dc0e 100644 +index 086d4c5837..e556a99b47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -165,6 +165,11 @@ set(CMAKE_CXX_EXTENSIONS OFF) - - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) +@@ -183,6 +183,11 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") -+ + +if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS) + # Force to static link + set(CMAKE_EXE_LINKER_FLAGS "-Bstatic") +endif() - ++ if(MSVC) include(cmake/msvc_static_runtime.cmake) + add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) diff --git a/ports/grpc/00003-undef-base64-macro.patch b/ports/grpc/00003-undef-base64-macro.patch index b4beb932f3eb65..3f540a53444cc9 100644 --- a/ports/grpc/00003-undef-base64-macro.patch +++ b/ports/grpc/00003-undef-base64-macro.patch @@ -1,5 +1,5 @@ diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc -index 6adcd8d..20745df 100644 +index 99a32980aa..f55db67113 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -97,6 +97,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, diff --git a/ports/grpc/00004-link-gdi32-on-windows.patch b/ports/grpc/00004-link-gdi32-on-windows.patch index 2a6fcea31bce2e..1e3e4cf5c5c210 100644 --- a/ports/grpc/00004-link-gdi32-on-windows.patch +++ b/ports/grpc/00004-link-gdi32-on-windows.patch @@ -1,11 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index c4057b3..a6a0f23 100644 +index e556a99b47..a337149f1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -220,7 +220,7 @@ elseif(UNIX) +@@ -250,7 +250,7 @@ elseif(UNIX) endif() - if(WIN32 AND MSVC) + if(WIN32) - set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32) + set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32 gdi32) endif() diff --git a/ports/grpc/00005-fix-uwp-error.patch b/ports/grpc/00005-fix-uwp-error.patch index 93ac05d1b2a0b7..ad890cf0062415 100644 --- a/ports/grpc/00005-fix-uwp-error.patch +++ b/ports/grpc/00005-fix-uwp-error.patch @@ -1,8 +1,8 @@ diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc -index c0e2164..331e54c 100644 +index 0dacbfef3e..310bf1de1b 100644 --- a/src/core/lib/slice/slice.cc +++ b/src/core/lib/slice/slice.cc -@@ -214,6 +214,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, +@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, size_t len) { uint8_t* ptr = reinterpret_cast(p.get()); grpc_slice slice; @@ -10,16 +10,25 @@ index c0e2164..331e54c 100644 if (len <= sizeof(slice.data.inlined.bytes)) { slice.refcount = nullptr; slice.data.inlined.length = len; +@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p) { + } + + grpc_slice grpc_slice_from_cpp_string(std::string str) { +- grpc_slice slice; ++ grpc_slice slice = { 0 }; + if (str.size() <= sizeof(slice.data.inlined.bytes)) { + slice.refcount = nullptr; + slice.data.inlined.length = str.size(); diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc -index 998eb6d..a6e26d3 100644 +index cab0cd56c4..2c88fd625b 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc -@@ -1095,7 +1095,7 @@ grpc_call_error queue_call_request(grpc_server* server, size_t cq_idx, +@@ -1301,7 +1301,7 @@ grpc_call_error queue_call_request(grpc_server* server, size_t cq_idx, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown")); return GRPC_CALL_OK; } - RequestMatcherInterface* rm; + RequestMatcherInterface* rm = nullptr; switch (rc->type) { - case BATCH_CALL: - rm = server->unregistered_request_matcher; + case RequestedCallType::BATCH_CALL: + rm = server->unregistered_request_matcher.get(); diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index de6f07f5d09a93..0c8c90cf6170c1 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5ec669e..f71a212 100644 +index a337149f1f..6baab5d37b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -81,6 +81,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package") +@@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package") set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library") set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package") @@ -12,7 +12,7 @@ index 5ec669e..f71a212 100644 set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package") set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE") -@@ -1765,7 +1768,6 @@ target_link_libraries(grpc +@@ -1807,7 +1810,6 @@ target_link_libraries(grpc ${_gRPC_ALLTARGETS_LIBRARIES} gpr address_sorting @@ -20,7 +20,7 @@ index 5ec669e..f71a212 100644 absl::optional absl::strings absl::inlined_vector -@@ -1844,7 +1846,6 @@ target_link_libraries(grpc_csharp_ext +@@ -1887,7 +1889,6 @@ target_link_libraries(grpc_csharp_ext grpc gpr address_sorting @@ -28,7 +28,7 @@ index 5ec669e..f71a212 100644 ) -@@ -2351,7 +2352,6 @@ target_link_libraries(grpc_unsecure +@@ -2409,7 +2410,6 @@ target_link_libraries(grpc_unsecure ${_gRPC_ALLTARGETS_LIBRARIES} gpr address_sorting @@ -36,7 +36,7 @@ index 5ec669e..f71a212 100644 absl::optional absl::strings absl::inlined_vector -@@ -2545,7 +2545,6 @@ target_link_libraries(grpc++ +@@ -2606,7 +2606,6 @@ target_link_libraries(grpc++ grpc gpr address_sorting @@ -44,7 +44,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -2821,7 +2820,6 @@ target_link_libraries(grpc++_alts +@@ -2876,7 +2875,6 @@ target_link_libraries(grpc++_alts grpc gpr address_sorting @@ -52,7 +52,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -2889,7 +2887,6 @@ target_link_libraries(grpc++_error_details +@@ -2945,7 +2943,6 @@ target_link_libraries(grpc++_error_details grpc gpr address_sorting @@ -60,7 +60,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -2962,7 +2959,6 @@ target_link_libraries(grpc++_reflection +@@ -3019,7 +3016,6 @@ target_link_libraries(grpc++_reflection grpc gpr address_sorting @@ -68,7 +68,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -3239,7 +3235,6 @@ target_link_libraries(grpc++_unsecure +@@ -3300,7 +3296,6 @@ target_link_libraries(grpc++_unsecure grpc_unsecure gpr address_sorting @@ -76,7 +76,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -3586,7 +3581,6 @@ target_link_libraries(grpcpp_channelz +@@ -3642,7 +3637,6 @@ target_link_libraries(grpcpp_channelz grpc gpr address_sorting @@ -84,7 +84,7 @@ index 5ec669e..f71a212 100644 ) foreach(_hdr -@@ -3613,6 +3607,7 @@ endif() +@@ -3669,6 +3663,7 @@ endif() endif() @@ -92,7 +92,7 @@ index 5ec669e..f71a212 100644 add_library(upb third_party/upb/upb/decode.c third_party/upb/upb/encode.c -@@ -3662,7 +3657,7 @@ if(gRPC_INSTALL) +@@ -3719,7 +3714,7 @@ if(gRPC_INSTALL) ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ) endif() @@ -102,19 +102,19 @@ index 5ec669e..f71a212 100644 add_executable(check_epollexclusive diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 5bfa73c..db0865e 100644 +index 3623f4aa5e..df6ced560e 100644 --- a/cmake/gRPCConfig.cmake.in +++ b/cmake/gRPCConfig.cmake.in -@@ -7,6 +7,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) - @_gRPC_FIND_SSL@ +@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) @_gRPC_FIND_CARES@ @_gRPC_FIND_ABSL@ + @_gRPC_FIND_RE2@ +@_gRPC_FIND_UPB@ # Targets include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index 2c0ab84..07dd613 100644 +index 2c0ab84e67..07dd613a78 100644 --- a/cmake/upb.cmake +++ b/cmake/upb.cmake @@ -12,9 +12,18 @@ diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 8fb59a60e8eade..8940cd2d63cb92 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f71a212..77cf3de 100644 +index 6baab5d37b..48bc6cf0de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1771,6 +1771,8 @@ target_link_libraries(grpc +@@ -1813,6 +1813,8 @@ target_link_libraries(grpc absl::optional absl::strings absl::inlined_vector @@ -11,7 +11,7 @@ index f71a212..77cf3de 100644 ) if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) target_link_libraries(grpc "-framework CoreFoundation") -@@ -2355,6 +2357,8 @@ target_link_libraries(grpc_unsecure +@@ -2413,6 +2415,8 @@ target_link_libraries(grpc_unsecure absl::optional absl::strings absl::inlined_vector @@ -21,7 +21,7 @@ index f71a212..77cf3de 100644 if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) target_link_libraries(grpc_unsecure "-framework CoreFoundation") diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake -index 078d495..b6f50bd 100644 +index 078d495417..b6f50bd14c 100644 --- a/cmake/abseil-cpp.cmake +++ b/cmake/abseil-cpp.cmake @@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch new file mode 100644 index 00000000000000..67450425be1405 --- /dev/null +++ b/ports/grpc/00011-fix-csharp_plugin.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 48bc6cf0de..399aff7d1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1854,10 +1854,14 @@ endif() + + if(gRPC_BUILD_CSHARP_EXT) + +-add_library(grpc_csharp_ext SHARED ++add_library(grpc_csharp_ext + src/csharp/ext/grpc_csharp_ext.c + ) + ++if (WIN32 AND BUILD_SHARED_LIBS) ++ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) ++endif() ++ + set_target_properties(grpc_csharp_ext PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +@@ -1871,6 +1875,12 @@ if(WIN32 AND MSVC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) ++ ++ install(TARGETS grpc_csharp_ext ++ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ) + endif() + endif() + diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index af06e82a490f4e..95f05177d99ac3 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,6 +1,6 @@ Source: grpc -Version: 1.29.1 -Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil +Version: 1.31.1 +Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil, re2 Homepage: https://github.com/grpc/grpc Description: An RPC library and framework diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 57fba090bd15f7..79e344b5455a6a 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -5,8 +5,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO grpc/grpc - REF 7d89dbb311f049b43bda7bbf6f7d7bf1b4c24419 #v1.29.1 - SHA512 403fa5e3f012786bb17ca32c760b6dfb22c5a5cfb473ba7fad657e26ab3986eb0203f7cbb501a8647fd5ef2571e5f4ee08c2c97d1dfda18ec5ab6a92c9fc3263 + REF 7d7e4567625db7cfebf8969a225948097a3f9f89 #v1.31.1 + SHA512 a348b8779f533c53b99c052264e0a008121087267bcf836fb2310819ab384effdc0996df031f407ee4bf8bb0cb37a81e061e65ab24ab7011ce6400de3808f5a4 HEAD_REF master PATCHES 00001-fix-uwp.patch @@ -16,6 +16,7 @@ vcpkg_from_github( 00005-fix-uwp-error.patch 00009-use-system-upb.patch 00010-add-feature-absl-sync.patch + 00011-fix-csharp_plugin.patch snprintf.patch ) @@ -51,12 +52,13 @@ vcpkg_configure_cmake( -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ABSL_PROVIDER=package -DgRPC_UPB_PROVIDER=package + -DgRPC_RE2_PROVIDER=package -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} -DgRPC_GFLAGS_PROVIDER=none -DgRPC_BENCHMARK_PROVIDER=none -DgRPC_INSTALL_CSHARP_EXT=OFF - -DgRPC_INSTALL_BINDIR:STRING=tools/grpc + -DgRPC_INSTALL_BINDIR:STRING=bin -DgRPC_INSTALL_LIBDIR:STRING=lib -DgRPC_INSTALL_INCLUDEDIR:STRING=include -DgRPC_INSTALL_CMAKEDIR:STRING=share/gRPC @@ -67,10 +69,21 @@ vcpkg_install_cmake(ADD_BIN_TO_PATH) vcpkg_fixup_cmake_targets(CONFIG_PATH share/gRPC TARGET_PATH share/gRPC) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools") +if (gRPC_BUILD_CODEGEN) + vcpkg_copy_tools( + AUTO_CLEAN + TOOL_NAMES + grpc_php_plugin + grpc_python_plugin + grpc_node_plugin + grpc_objective_c_plugin + grpc_csharp_plugin + grpc_cpp_plugin + grpc_ruby_plugin + ) +endif() # Ignore the C# extension DLL in bin/ SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/grpc/snprintf.patch b/ports/grpc/snprintf.patch index f658f9c4f5ee4f..d1fd52e48d893f 100644 --- a/ports/grpc/snprintf.patch +++ b/ports/grpc/snprintf.patch @@ -1,12 +1,12 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index c638ce7..3dc3b2e 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - #include - +diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc +index 02b1ac4492..191f462277 100644 +--- a/src/core/tsi/alts/crypt/aes_gcm.cc ++++ b/src/core/tsi/alts/crypt/aes_gcm.cc +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL index e5901fca747107..ff4434872abc2b 100644 --- a/ports/gsoap/CONTROL +++ b/ports/gsoap/CONTROL @@ -1,6 +1,6 @@ Source: gsoap -Version: 2.8.102-4 +Version: 2.8.105 Build-Depends: curl Homepage: https://sourceforge.net/projects/gsoap2/ Description: The gSOAP toolkit is a C and C++ software development toolkit for SOAP and REST XML Web services and generic C/C++ XML data bindings. -Supports: (x86 | x64) & windows +Supports: !(linux|osx|arm|uwp) diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index b759fb876cca5b..1a4e75adbb63dc 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -4,8 +4,8 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO gsoap2 REF gsoap-2.8 - FILENAME "gsoap_2.8.102.zip" - SHA512 3cff65605b15f820c9d56e32575231fb6fb89927bafc1db85ac1f879acd8496d6f38b558e994d17cce475beae0976d5fafcff7f22b28cdfbec8b7ec4b08bcbe7 + FILENAME "gsoap_2.8.105.zip" + SHA512 3b7b66ef738e9ba78f0c9d5ec141faab102dc2ed7c528e84358d530ec8cb913c559438bb86ae0f22e0736c4cd9be9e74f364a44257189ccaa1e6d001317f99de PATCHES fix-build-in-windows.patch ) @@ -43,6 +43,9 @@ file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOUR # Handle import files file(COPY ${SOURCE_PATH}/gsoap/import DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +# Handle custom files +file(COPY ${SOURCE_PATH}/gsoap/custom DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + # Handle plugin files file(COPY ${SOURCE_PATH}/gsoap/plugin DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/gtest/CONTROL b/ports/gtest/CONTROL index 9d3934072f8244..a18713fe43b6c6 100644 --- a/ports/gtest/CONTROL +++ b/ports/gtest/CONTROL @@ -1,4 +1,5 @@ Source: gtest Version: 1.10.0 +Port-Version: 1 Homepage: https://github.com/google/googletest Description: GoogleTest and GoogleMock testing frameworks. diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index 585f380c49841b..f0606eaa39fc4c 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -26,7 +26,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GTest) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GTest TARGET_PATH share/GTest) file( INSTALL diff --git a/ports/gtkmm/CONTROL b/ports/gtkmm/CONTROL index ecdab2cc3853dc..71a648f1578a12 100644 --- a/ports/gtkmm/CONTROL +++ b/ports/gtkmm/CONTROL @@ -1,5 +1,6 @@ Source: gtkmm -Version: 3.22.2-2 +Version: 3.22.2 +Port-Version: 4 Homepage: https://www.gtkmm.org/ Description: gtkmm is the official C++ interface for the popular GUI library GTK+. Build-Depends: glib, atk, gtk, gdk-pixbuf, pango, cairo, libepoxy, gettext, glibmm, atkmm, cairomm, pangomm diff --git a/ports/gtkmm/fix_treeviewcolumn.patch b/ports/gtkmm/fix_treeviewcolumn.patch new file mode 100644 index 00000000000000..8daf91afbd00a9 --- /dev/null +++ b/ports/gtkmm/fix_treeviewcolumn.patch @@ -0,0 +1,15 @@ +diff --git a/gtk/gtkmm/treeviewcolumn.h b/gtk/gtkmm/treeviewcolumn.h +index f2a77c1..c66302a 100644 +--- a/gtk/gtkmm/treeviewcolumn.h ++++ b/gtk/gtkmm/treeviewcolumn.h +@@ -1026,9 +1026,7 @@ void TreeViewColumn::pack_end(const TreeModelColumn& column, + template inline + TreeViewColumn::TreeViewColumn(const Glib::ustring& title, + const TreeModelColumn& column) +-: +- Glib::ObjectBase(nullptr), // not (yet) a custom class +- Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), nullptr)) ++: TreeViewColumn (title) + { + pack_start(column, true /* expand */); + } diff --git a/ports/gtkmm/portfile.cmake b/ports/gtkmm/portfile.cmake index 23e939608dbe89..feedbf2886b706 100644 --- a/ports/gtkmm/portfile.cmake +++ b/ports/gtkmm/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES fix_properties.patch + fix_treeviewcolumn.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/msvc_recommended_pragmas.h DESTINATION ${SOURCE_PATH}/MSVC_Net2013) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 4dbeebf7c25b1a..31901b9d980671 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,5 +1,6 @@ Source: harfbuzz Version: 2.6.6 +Port-Version: 1 Description: HarfBuzz OpenType text shaping engine Homepage: https://github.com/behdad/harfbuzz Build-Depends: freetype[core], ragel, gettext (osx) diff --git a/ports/harfbuzz/fix_include.patch b/ports/harfbuzz/fix_include.patch new file mode 100644 index 00000000000000..894f7b37c4acf5 --- /dev/null +++ b/ports/harfbuzz/fix_include.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c4dc524..bfd15ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -431,6 +431,7 @@ endif () + + ## Define harfbuzz library + add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers}) ++target_include_directories(harfbuzz PUBLIC $) + target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) + + diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 8e82f9d6e65800..d155044018a62f 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( find-package-freetype-2.patch # This patch is required for propagating the full list of dependencies from glib glib-cmake.patch + fix_include.patch ) file(READ ${SOURCE_PATH}/CMakeLists.txt _contents) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index d03fcc590efad7..0c8ee3c083eba0 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -1,3 +1,5 @@ +# highfive should be updated together with hdf5 + vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( diff --git a/ports/healpix/CONTROL b/ports/healpix/CONTROL index 629b095ee45004..8b1e856e2a947f 100644 --- a/ports/healpix/CONTROL +++ b/ports/healpix/CONTROL @@ -1,5 +1,6 @@ Source: healpix -Version: 1.12.10-5 +Version: 1.12.10 +Port-Version: 6 Homepage: http://healpix.sourceforge.net/ Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere. Build-Depends: cfitsio diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index 8b1a401517b07b..c1fa90f368a628 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_sourceforge( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx COPY_SOURCE diff --git a/ports/highfive/CONTROL b/ports/highfive/CONTROL index f072f8f912ef7e..22fd1209ee4556 100644 --- a/ports/highfive/CONTROL +++ b/ports/highfive/CONTROL @@ -1,5 +1,13 @@ Source: highfive -Version: 2.1.1 +Version: 2.2.2 Homepage: https://github.com/BlueBrain/HighFive Description: HighFive is a modern C++/C++11 friendly interface for libhdf5 Build-Depends: hdf5 + +Feature: boost +Description: Enables Boost support +Build-Depends: boost-ublas, boost-multi-array + +Feature: tests +Description: Build unit tests +Build-Depends: highfive[boost], boost-test diff --git a/ports/highfive/portfile.cmake b/ports/highfive/portfile.cmake index a3ec43b6952a8a..2d79274efc1a81 100644 --- a/ports/highfive/portfile.cmake +++ b/ports/highfive/portfile.cmake @@ -3,11 +3,16 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO BlueBrain/HighFive - REF b9b25da543145166b01bcca01c3cbedfcbd06307 # v2.1.1 - SHA512 f1de563bf811c285447fdf8e88e4861f1ac0e10bf830cedec587b7a85dcfb2fc9b038dd1f71cbbbf4774c517b5097f3c4afad5048b6a3dfd21f8f0e23ab67ec1 + REF v2.2.2 + SHA512 7e562951b18425f1bfc96c30d0e47b6d218830417a732856a27943cd7ee6feab54d833b94aa303c40ca5038ac1aaf0eadd8c61800ffe82b6da46a465b21b1fc4 HEAD_REF master ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tests HIGHFIVE_UNIT_TESTS + boost HIGHFIVE_USE_BOOST +) + if(${VCPKG_LIBRARY_LINKAGE} MATCHES "static") set(HDF5_USE_STATIC_LIBRARIES ON) endif() @@ -16,14 +21,22 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DHIGHFIVE_UNIT_TESTS=OFF + ${FEATURE_OPTIONS} -DHIGHFIVE_EXAMPLES=OFF - -DUSE_BOOST=OFF -DHIGH_FIVE_DOCUMENTATION=OFF -DHDF5_USE_STATIC_LIBRARIES=${HDF5_USE_STATIC_LIBRARIES} ) vcpkg_install_cmake() +if("tests" IN_LIST FEATURES) + vcpkg_copy_tools( + TOOL_NAMES + tests_high_five_base + tests_high_five_easy + tests_high_five_multi_dims + SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/tests/unit" # Tools are not installed so release version tools are manually copied + ) +endif() vcpkg_fixup_cmake_targets(CONFIG_PATH share/HighFive/CMake) diff --git a/ports/hpx/CONTROL b/ports/hpx/CONTROL index 4bc7d7b6280a95..8363947afe3d54 100644 --- a/ports/hpx/CONTROL +++ b/ports/hpx/CONTROL @@ -1,6 +1,6 @@ Source: hpx -Version: 1.4.1-1 -Build-Depends: hwloc, boost-accumulators, boost-algorithm, boost-asio, boost-assign, boost-bimap, boost-config, boost-context, boost-dynamic-bitset, boost-exception, boost-filesystem, boost-iostreams, boost-lockfree, boost-program-options, boost-range, boost-spirit, boost-system, boost-throw-exception, boost-variant, boost-winapi +Version: 1.5.0 +Build-Depends: hwloc, boost-accumulators, boost-algorithm, boost-asio, boost-bimap, boost-config, boost-context, boost-dynamic-bitset, boost-exception, boost-filesystem, boost-iostreams, boost-lockfree, boost-program-options, boost-range, boost-spirit, boost-system, boost-throw-exception, boost-variant, boost-winapi Homepage: https://github.com/STEllAR-GROUP/hpx Description: The C++ Standards Library for Concurrency and Parallelism HPX is a C++ Standards Library for Concurrency and Parallelism. It implements all of the corresponding facilities as defined by the C++ Standard. Additionally, in HPX we implement functionalities proposed as part of the ongoing C++ standardization process. We also extend the C++ Standard APIs to the distributed case. diff --git a/ports/hpx/boost-1.73.patch b/ports/hpx/boost-1.73.patch deleted file mode 100644 index d45e5cc7fedab4..00000000000000 --- a/ports/hpx/boost-1.73.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/runtime/agas/addressing_service.cpp b/src/runtime/agas/addressing_service.cpp -index f30760c..7c2785e 100644 ---- a/src/runtime/agas/addressing_service.cpp -+++ b/src/runtime/agas/addressing_service.cpp -@@ -2356,6 +2356,8 @@ void addressing_service::register_counter_types() - util::bind_front( - &addressing_service::get_cache_erase_entry_time, this)); - -+ using util::placeholders::_1; -+ using util::placeholders::_2; - performance_counters::generic_counter_type_data const counter_types[] = - { - { "/agas/count/cache/entries", performance_counters::counter_raw, diff --git a/ports/hpx/portfile.cmake b/ports/hpx/portfile.cmake index 6c369e0a2934f2..dc0129861230be 100644 --- a/ports/hpx/portfile.cmake +++ b/ports/hpx/portfile.cmake @@ -4,11 +4,9 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO STEllAR-GROUP/hpx - REF 1.4.1 - SHA512 f110d5e5c10ec396f6e762568c9ecd5b767cb6efe91168b5caa8fe1e07bb5870cd13b3392fa4e008a2cc0e044b02084a35b0866e943d9b9c7435599c131f1582 + REF 1.5.0 + SHA512 3ce52def94d2d76bc19f0c3a411581a69af95123bbc38b4bd777b8d89523d0e22769ac2e7bb62c756f0126f39c378dfdd503a10499d3497bfe40cc71c046c70b HEAD_REF stable - PATCHES - boost-1.73.patch ) vcpkg_configure_cmake( diff --git a/ports/hypre/CONTROL b/ports/hypre/CONTROL index a4db2f1e760254..63f36cd7bb171c 100644 --- a/ports/hypre/CONTROL +++ b/ports/hypre/CONTROL @@ -1,5 +1,5 @@ Source: hypre -Version: 2.11.2-3 +Version: 2.19.0 Homepage: https://computation.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods Description: SCALABLE LINEAR SOLVERS AND MULTIGRID METHODS -Build-Depends: mpi +Build-Depends: mpi, openblas, lapack diff --git a/ports/hypre/fix-blas-vs14-math.patch b/ports/hypre/fix-blas-vs14-math.patch deleted file mode 100644 index 424b16eb0e7b4c..00000000000000 --- a/ports/hypre/fix-blas-vs14-math.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/src/blas/f2c.h Fri Sep 11 18:57:56 2015 -+++ b/src/blas/f2c.h Thu Dec 22 18:20:08 2016 -@@ -190,18 +190,18 @@ - typedef struct Namelist Namelist; - - /* The following undefs are to prevent conflicts with external libraries */ --#undef abs --#define abs(x) ((x) >= 0 ? (x) : -(x)) --#define dabs(x) (doublereal)abs(x) --#ifndef min --#define min(a,b) ((a) <= (b) ? (a) : (b)) --#define max(a,b) ((a) >= (b) ? (a) : (b)) --#endif --#define dmin(a,b) (doublereal)min(a,b) --#define dmax(a,b) (doublereal)max(a,b) --#define bit_test(a,b) ((a) >> (b) & 1) --#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) --#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) -+//#undef abs -+//#define abs(x) ((x) >= 0 ? (x) : -(x)) -+//#define dabs(x) (doublereal)abs(x) -+//#ifndef min -+//#define min(a,b) ((a) <= (b) ? (a) : (b)) -+//#define max(a,b) ((a) >= (b) ? (a) : (b)) -+//#endif -+//#define dmin(a,b) (doublereal)min(a,b) -+//#define dmax(a,b) (doublereal)max(a,b) -+//#define bit_test(a,b) ((a) >> (b) & 1) -+//#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) -+//#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) - - /* procedure parameter types for -A and -C++ */ - diff --git a/ports/hypre/fix-export-global-data-symbols.patch b/ports/hypre/fix-export-global-data-symbols.patch deleted file mode 100644 index 2714e365ac5cf7..00000000000000 --- a/ports/hypre/fix-export-global-data-symbols.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/utilities/_hypre_utilities.h Thu Jun 09 15:56:18 2016 -+++ b/src/utilities/_hypre_utilities.h Wed Jan 04 18:08:27 2017 -@@ -13,6 +13,7 @@ - #ifndef hypre_UTILITIES_HEADER - #define hypre_UTILITIES_HEADER - -+#include "_hypre_export.h" - #include "HYPRE_utilities.h" - - #ifdef HYPRE_USING_OPENMP -@@ -610,7 +611,7 @@ - #ifdef HYPRE_TIMING_GLOBALS - hypre_TimingType *hypre_global_timing = NULL; - #else --extern hypre_TimingType *hypre_global_timing; -+extern HYPRE_EXPORT hypre_TimingType *hypre_global_timing; - #endif - - /*------------------------------------------------------- -@@ -781,7 +782,7 @@ - * Global variable used in hypre error checking - *--------------------------------------------------------------------------*/ - --extern HYPRE_Int hypre__global_error; -+extern HYPRE_EXPORT HYPRE_Int hypre__global_error; - #define hypre_error_flag hypre__global_error - - /*-------------------------------------------------------------------------- diff --git a/ports/hypre/fix-lapack-vs14-math.patch b/ports/hypre/fix-lapack-vs14-math.patch deleted file mode 100644 index 7be84aeb680867..00000000000000 --- a/ports/hypre/fix-lapack-vs14-math.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/src/lapack/f2c.h Fri Sep 11 18:57:56 2015 -+++ b/src/lapack/f2c.h Thu Dec 22 18:22:26 2016 -@@ -190,18 +190,18 @@ - typedef struct Namelist Namelist; - - /* The following undefs are to prevent conflicts with external libraries */ --#undef abs --#define abs(x) ((x) >= 0 ? (x) : -(x)) --#define dabs(x) (doublereal)abs(x) --#ifndef min --#define min(a,b) ((a) <= (b) ? (a) : (b)) --#define max(a,b) ((a) >= (b) ? (a) : (b)) --#endif --#define dmin(a,b) (doublereal)min(a,b) --#define dmax(a,b) (doublereal)max(a,b) --#define bit_test(a,b) ((a) >> (b) & 1) --#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) --#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) -+//#undef abs -+//#define abs(x) ((x) >= 0 ? (x) : -(x)) -+//#define dabs(x) (doublereal)abs(x) -+//#ifndef min -+//#define min(a,b) ((a) <= (b) ? (a) : (b)) -+//#define max(a,b) ((a) >= (b) ? (a) : (b)) -+//#endif -+//#define dmin(a,b) (doublereal)min(a,b) -+//#define dmax(a,b) (doublereal)max(a,b) -+//#define bit_test(a,b) ((a) >> (b) & 1) -+//#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) -+//#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) - - /* procedure parameter types for -A and -C++ */ - diff --git a/ports/hypre/fix-macro-to-template.patch b/ports/hypre/fix-macro-to-template.patch deleted file mode 100644 index ca98e5d703f0f1..00000000000000 --- a/ports/hypre/fix-macro-to-template.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/src/struct_ls/pfmg3_setup_rap.c Thu Jun 09 15:56:18 2016 -+++ b/src/struct_ls/pfmg3_setup_rap.c Thu Dec 22 17:45:20 2016 -@@ -19,13 +19,28 @@ - * allow for coarsening to be done in the x- and y-directions also. - *--------------------------------------------------------------------------*/ - --#define MapIndex(in_index, cdir, out_index) \ -- hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 2); \ -- cdir = (cdir + 1) % 3; \ -- hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 0); \ -- cdir = (cdir + 1) % 3; \ -- hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 1); \ -- cdir = (cdir + 1) % 3; -+//#define MapIndex(in_index, cdir, out_index) \ -+// hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 2); \ -+// cdir = (cdir + 1) % 3; \ -+// hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 0); \ -+// cdir = (cdir + 1) % 3; \ -+// hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 1); \ -+// cdir = (cdir + 1) % 3; -+ -+template -+void MapIndex(T& in_index, U& cdir, V& out_index) -+{ -+ if(cdir > 3) cdir = cdir - (cdir / 3) * 3; -+ hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 2); -+ if(cdir == 3) cdir = 1; -+ else ++cdir; -+ hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 0); -+ if(cdir == 3) cdir = 1; -+ else ++cdir; -+ hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 1); -+ if(cdir == 3) cdir = 1; -+ else ++cdir; -+} - - /*-------------------------------------------------------------------------- - * Sets up new coarse grid operator stucture. diff --git a/ports/hypre/fix-root-cmakelists.patch b/ports/hypre/fix-root-cmakelists.patch deleted file mode 100644 index b64914eb38ca99..00000000000000 --- a/ports/hypre/fix-root-cmakelists.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/src/CMakeLists.txt Mon Mar 13 21:37:24 2017 -+++ b/src/CMakeLists.txt Sun Aug 06 19:34:00 2017 -@@ -1,6 +1,8 @@ - cmake_minimum_required (VERSION 2.8.8) - project (hypre) - -+include(GenerateExportHeader) -+ - # The version number. - set (HYPRE_VERSION 2.11.2) - set (HYPRE_DATE 2017/03/13) -@@ -618,6 +620,8 @@ - struct_ls/sparse_msg_solve.c - ) - -+set_source_files_properties(struct_ls/pfmg3_setup_rap.c PROPERTIES LANGUAGE CXX) -+ - # Headers and sources: sstruct_mv - list (APPEND HYPRE_HEADERS - sstruct_mv/HYPRE_sstruct_mv.h -@@ -758,11 +762,11 @@ - find_package (MPI) - if ((MPI_C_FOUND) AND (NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER)) - include_directories (${MPI_C_INCLUDE_PATH}) -- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}") -+ #set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}") - endif () - if ((MPI_CXX_FOUND) AND (NOT CMAKE_CXX_COMPILER STREQUAL MPI_CXX_COMPILER)) - include_directories (${MPI_CXX_INCLUDE_PATH}) -- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}") -+ #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}") - endif () - endif (NOT HYPRE_SEQUENTIAL) - -@@ -807,7 +811,23 @@ - - add_library (HYPRE ${HYPRE_SOURCES} ${FEI_LIBS}) - --install (TARGETS HYPRE DESTINATION lib) -+if (NOT HYPRE_SEQUENTIAL) -+ target_link_libraries(HYPRE ${MPI_C_LIBRARIES}) -+endif() -+ -+if (WIN32 AND BUILD_SHARED_LIBS) -+ set_target_properties(HYPRE PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) -+endif() -+ -+generate_export_header(HYPRE EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/_hypre_export.h) -+list(APPEND HYPRE_HEADERS ${CMAKE_BINARY_DIR}/_hypre_export.h) -+ -+install (TARGETS HYPRE -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+) -+ - install (FILES ${HYPRE_HEADERS} DESTINATION include) - - # add_subdirectory (test EXCLUDE_FROM_ALL) diff --git a/ports/hypre/portfile.cmake b/ports/hypre/portfile.cmake index 92dd78a0d58d8b..5d854d98522b1d 100644 --- a/ports/hypre/portfile.cmake +++ b/ports/hypre/portfile.cmake @@ -1,20 +1,13 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://computation.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods/download/hypre-2.11.2.tar.gz" - FILENAME "hypre-2.11.2.tar.gz" - SHA512 a06321028121e5420fa944ce4fae5f9b96e6021ec2802e68ec3c349f19a20543ed7eff774a4735666c5807ce124eb571b3f86757c67e91faa1c683c3f657469f -) +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - PATCHES - fix-root-cmakelists.patch - fix-macro-to-template.patch - fix-blas-vs14-math.patch - fix-lapack-vs14-math.patch - fix-export-global-data-symbols.patch + REPO hypre-space/hypre + REF v2.19.0 + SHA512 999979bc2e7d32aef7c084fc8508fb818e6f904db0ee3ebf6b8e8132f290201c407aaba0aa89e7bf09e7264f4e99caf04f3147458847de816fc8ffc81dbee2df + HEAD_REF master ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -28,6 +21,8 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS ${OPTIONS} + -DHYPRE_ENABLE_HYPRE_BLAS=OFF + -DHYPRE_ENABLE_HYPRE_LAPACK=OFF OPTIONS_RELEASE -DHYPRE_BUILD_TYPE=Release -DHYPRE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} @@ -39,7 +34,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/HYPRE) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/hypre/copyright) +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index 4ba1c8e96f774a..5cbf72816a2fa9 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,5 +1,5 @@ Source: icu -Version: 67.1-2 +Version: 67.1-3 Homepage: http://icu-project.org/apiref/icu4c/ Description: Mature and widely used Unicode and localization library. Supports: !(arm|uwp) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 82fd00464d63c7..20ca4dab1792f3 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -169,8 +169,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/icu ${CURRENT_PACKAGES_DIR}/debug/lib/icud) @@ -203,6 +201,15 @@ else() file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sicu${MODULE}d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/icu${MODULE}d.lib) endif() endforeach() + + file(GLOB_RECURSE pkg_files LIST_DIRECTORIES false ${CURRENT_PACKAGES_DIR}/*.pc) + message(STATUS "${pkg_files}") + foreach(pkg_file IN LISTS pkg_files) + message(STATUS "${pkg_file}") + file(READ ${pkg_file} PKG_FILE) + string(REGEX REPLACE "-ls([^ \\t\\n]+)" "-l\\1" PKG_FILE "${PKG_FILE}" ) + file(WRITE ${pkg_file} "${PKG_FILE}") + endforeach() endif() # force U_STATIC_IMPLEMENTATION macro @@ -226,6 +233,7 @@ endif() # Generates warnings about missing pdbs for icudt.dll # This is expected because ICU database contains no executable code vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread m) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index efde5f1b4c2357..e52ae90a5a50e4 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,3 +1,4 @@ Source: ignition-modularscripts Version: 2020-05-16 +Port-Version: 1 Description: Vcpkg helpers to package ignition libraries diff --git a/ports/ignition-modularscripts/ignition_modular_library.cmake b/ports/ignition-modularscripts/ignition_modular_library.cmake index f7b772d5f06d13..b294c097b6fcf1 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -38,7 +38,10 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PAC # Make pkg-config files relocatable if(NOT IML_DISABLE_PKGCONFIG_INSTALL) - vcpkg_fixup_pkgconfig() + if(VCPKG_TARGET_IS_LINUX) + set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) + endif() + vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) diff --git a/ports/ignition-msgs5/CONTROL b/ports/ignition-msgs5/CONTROL index fd7b362df7bc48..690ded1b6a60f5 100644 --- a/ports/ignition-msgs5/CONTROL +++ b/ports/ignition-msgs5/CONTROL @@ -1,5 +1,6 @@ Source: ignition-msgs5 Version: 5.1.0 +Port-Version: 1 Build-Depends: ignition-modularscripts, ignition-cmake2, ignition-math6, protobuf, tinyxml2 Description: Middleware protobuf messages for robotics Supports: !(arm|linux|uwp) \ No newline at end of file diff --git a/ports/ignition-msgs5/portfile.cmake b/ports/ignition-msgs5/portfile.cmake index 812a1bca73d394..aec3a6cd75c385 100644 --- a/ports/ignition-msgs5/portfile.cmake +++ b/ports/ignition-msgs5/portfile.cmake @@ -17,4 +17,4 @@ ignition_modular_library(NAME msgs "01-protobuf.patch") # Restore old path -set(ENV{PATH} ${path_backup}) +set(ENV{PATH} "${path_backup}") diff --git a/ports/imgui-sfml/CONTROL b/ports/imgui-sfml/CONTROL index ee43509de39647..a792691ad5a789 100644 --- a/ports/imgui-sfml/CONTROL +++ b/ports/imgui-sfml/CONTROL @@ -1,5 +1,5 @@ Source: imgui-sfml -Version: 2.1-1 +Version: 2.1-2 Homepage: https://github.com/eliasdaler/imgui-sfml Description: ImGui binding for use with SFML -Build-Depends: sfml, imgui +Build-Depends: sfml, imgui, opengl diff --git a/ports/imgui-sfml/portfile.cmake b/ports/imgui-sfml/portfile.cmake index d283a2624537d4..aedb31ced7abfe 100644 --- a/ports/imgui-sfml/portfile.cmake +++ b/ports/imgui-sfml/portfile.cmake @@ -13,23 +13,9 @@ vcpkg_from_github( 004-fix-find-sfml.patch ) -if (VCPKG_TARGET_IS_WINDOWS) - file(GLOB SFML_DYNAMIC_LIBS "${CURRENT_INSTALLED_DIR}/bin/sfml-*") -else() - file(GLOB SFML_DYNAMIC_LIBS "${CURRENT_INSTALLED_DIR}/bin/libsfml-*") -endif() - -if (SFML_DYNAMIC_LIBS) - set(SFML_STATIC OFF) -else() - set(SFML_STATIC ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS - -DSFML_STATIC_LIBRARIES=${SFML_STATIC} ) vcpkg_install_cmake() vcpkg_copy_pdbs() diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index a4f3cf61148290..e8d57c21cdae82 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -22,6 +22,13 @@ target_sources( ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp ) + +if(IMGUI_USE_WCHAR32) + FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h IMCONFIG) + STRING(REGEX REPLACE "//#define IMGUI_USE_WCHAR32" "#define IMGUI_USE_WCHAR32" IMCONFIG "${IMCONFIG}") + FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h "${IMCONFIG}") +endif() + if(IMGUI_BUILD_ALLEGRO5_BINDING) find_path(ALLEGRO5_INCLUDE_DIRS allegro5/allegro.h) target_include_directories(${PROJECT_NAME} PRIVATE ${ALLEGRO5_INCLUDE_DIRS}) @@ -131,9 +138,11 @@ install( if(NOT IMGUI_SKIP_HEADERS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/imgui.h - ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_rectpack.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_truetype.h ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h DESTINATION include ) @@ -170,7 +179,7 @@ if(NOT IMGUI_SKIP_HEADERS) file(GLOB MARMALADE_BINDING_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_marmalade.*) install(FILES ${MARMALADE_BINDING_SRCS} DESTINATION include/bindings) endif() - + if(IMGUI_BUILD_METAL_BINDING) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_metal.h DESTINATION include) endif() diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 88fb1440cee253..df074e58f61715 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,6 +1,6 @@ Source: imgui -Version: 1.77 -Port-Version: 1 +Version: 1.78 +Port-Version: 3 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. @@ -70,3 +70,9 @@ Description: Make available Win32 binding Feature: freetype Description: Build font atlases using FreeType instead of stb_truetype Build-Depends: freetype + +Feature: libigl-imgui +Description: Install the libigl-imgui headers + +Feature: wchar32 +Description: Use WCHAR32 instead of WCHAR16 diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 6ee33622b9c27b..bb8ee6e649aaa9 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -3,13 +3,17 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ocornut/imgui - REF v1.77 - SHA512 d5ebf4bb5e1ce83b226f2e68b3afe0f0abaeb55245fedf754e5453afd8d1df4dac8b5c47fc284c2588b40d05a55fc191b5e55c7be279c5e5e23f7c5b70150546 + REF v1.78 + SHA512 2410df5b39d5ca14ea7181ef4f3b501ad8879e10895ed540f079f213dcc528b50e57cc16fce6f50a67e8a7be00b03c5833cabfd5db4ba210cafce6d95da389c6 HEAD_REF master ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +if(("metal-binding" IN_LIST FEATURES OR "osx-binding" IN_LIST FEATURES) AND (NOT VCPKG_TARGET_IS_OSX)) + message(FATAL_ERROR "Feature metal-binding and osx-binding are only supported on osx.") +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS allegro5-binding IMGUI_BUILD_ALLEGRO5_BINDING dx9-binding IMGUI_BUILD_DX9_BINDING @@ -30,8 +34,22 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vulkan-binding IMGUI_BUILD_VULKAN_BINDING win32-binding IMGUI_BUILD_WIN32_BINDING freetype IMGUI_FREETYPE + wchar32 IMGUI_USE_WCHAR32 ) +if ("libigl-imgui" IN_LIST FEATURES) + vcpkg_download_distfile( + IMGUI_FONTS_DROID_SANS_H + URLS + https://raw.githubusercontent.com/libigl/libigl-imgui/c3efb9b62780f55f9bba34561f79a3087e057fc0/imgui_fonts_droid_sans.h + FILENAME "imgui_fonts_droid_sans.h" + SHA512 + abe9250c9a5989e0a3f2285bbcc83696ff8e38c1f5657c358e6fe616ff792d3c6e5ff2fa23c2eeae7d7b307392e0dc798a95d14f6d10f8e9bfbd7768d36d8b31 + ) + + file(INSTALL ${IMGUI_FONTS_DROID_SANS_H} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -46,4 +64,4 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/implot/CONTROL b/ports/implot/CONTROL index f887c457940c89..0f6633b28ffd44 100644 --- a/ports/implot/CONTROL +++ b/ports/implot/CONTROL @@ -1,5 +1,5 @@ Source: implot -Version: 0.3-1 +Version: 0.4 Homepage: https://github.com/epezent/implot Description: Advanced 2D Plotting for Dear ImGui Build-Depends: imgui diff --git a/ports/implot/portfile.cmake b/ports/implot/portfile.cmake index d9b59d430ce45b..b783f57ae595bd 100644 --- a/ports/implot/portfile.cmake +++ b/ports/implot/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO epezent/implot - REF v0.3 - SHA512 28d25a76b725879ad796249edc87910fec721fcd43b80171947e00c4983a945f82f2b555f1794882b79c96a4497da982dc45695fed5eedcf6009f87c05576817 + REF v0.4 + SHA512 ab54a97fcfcdc21c47d56e7e9ba1fbd05ae0f9e8f9bf0bd742e9daa6231931ac0c3a7cb0a1637b254df531b2611b27a301cc9f51d6caa950e20d05ab5fc31247 HEAD_REF master ) diff --git a/ports/infoware/CONTROL b/ports/infoware/CONTROL index c0bec34efd3718..d65130342b8f92 100644 --- a/ports/infoware/CONTROL +++ b/ports/infoware/CONTROL @@ -1,6 +1,6 @@ Source: infoware Homepage: https://github.com/ThePhD/infoware -Version: 0.5.4 +Version: 0.5.5 Description: C++ Library for pulling system and hardware information, without hitting the command line. # Note that independent usage and testing may work, but it seems to fail in CI environments for potential cross-compilation, # and is thusly noted here to note break how vcpkg builds things! diff --git a/ports/infoware/portfile.cmake b/ports/infoware/portfile.cmake index 7fbfe1fd8aeebf..bff5976d77bbe1 100644 --- a/ports/infoware/portfile.cmake +++ b/ports/infoware/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ThePhD/infoware - REF v0.5.4 - SHA512 16c7c39ca59128fe6489ec70b0d840d48cc44e57fe0d7d2dc864443cf8be288ceaf32e28246f6ac2dda495662d7a38d1e6ddf49172a73aac55445ecea95a29a8 + REF v0.5.5 + SHA512 06aea2c3a51df30cfc220eafb603620c3cf5f00b0d5935486ac46c6c2333972910af2b53fc1e2187b5fce0aa9650323a0dff526d768ff54888bfc549a8173903 HEAD_REF master ) diff --git a/ports/intel-mkl/CONTROL b/ports/intel-mkl/CONTROL index f0b7f12a817702..0286f25def9c10 100644 --- a/ports/intel-mkl/CONTROL +++ b/ports/intel-mkl/CONTROL @@ -1,3 +1,3 @@ Source: intel-mkl -Version: 2018.0.1 +Version: 2020.0.0 Description: Intel® Math Kernel Library (Intel® MKL) accelerates math processing routines, increases application performance, and reduces development time on Intel® processors. \ No newline at end of file diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index be54f0ec454ba5..4e656948ea961d 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -4,7 +4,7 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -set(MKL_REQUIRED_VERSION "20180000") +set(MKL_REQUIRED_VERSION "20200000") set(ProgramFilesx86 "ProgramFiles(x86)") set(INTEL_ROOT $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows) diff --git a/ports/io2d/CONTROL b/ports/io2d/CONTROL index 4e69350d482210..596cdcd23814d8 100644 --- a/ports/io2d/CONTROL +++ b/ports/io2d/CONTROL @@ -1,4 +1,5 @@ Source: io2d -Version: 2019-07-11-2 +Version: 2019-07-11 +Port-Version: 3 Description: a lightweight, cross platform drawing library Build-Depends: cairo (!osx), cairo[x11] (linux), graphicsmagick (!osx) diff --git a/ports/io2d/fix-expat.patch b/ports/io2d/fix-expat.patch new file mode 100644 index 00000000000000..25d38bb10507f8 --- /dev/null +++ b/ports/io2d/fix-expat.patch @@ -0,0 +1,13 @@ +diff --git a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt +index abb1501..412f3d4 100644 +--- a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt ++++ b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt +@@ -32,7 +32,7 @@ if(MSVC) + find_library(BZ_LIB bz2) + find_library(JPEG_LIB jpeg) + find_library(TIFF_LIB tiff) +- find_library(EXPAT_LIB expat) ++ find_library(EXPAT_LIB libexpat) + find_library(LZMA_LIB lzma) + find_library(ICONV_LIB libiconv) + find_library(CHARSET_LIB libcharset) diff --git a/ports/io2d/portfile.cmake b/ports/io2d/portfile.cmake index cb07ea3d88befc..f6f9011e5a6e02 100644 --- a/ports/io2d/portfile.cmake +++ b/ports/io2d/portfile.cmake @@ -9,9 +9,10 @@ vcpkg_from_github( PATCHES fix-linux-build.patch Fix-FindCairo.patch + fix-expat.patch ) -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) +if (VCPKG_TARGET_IS_OSX) set(IO2D_DEFAULT_OPTION "-DIO2D_DEFAULT=COREGRAPHICS_MAC") endif() @@ -31,7 +32,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/io2d) -if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) +if (NOT VCPKG_TARGET_IS_OSX) file(RENAME ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake ${CURRENT_PACKAGES_DIR}/share/io2d/io2dTargets.cmake) file(WRITE ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake " include(CMakeFindDependencyMacro) @@ -42,6 +43,4 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) ") endif() -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_test_cmake(PACKAGE_NAME io2d) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/irrlicht/fix-sysctl.patch b/ports/irrlicht/fix-sysctl.patch new file mode 100644 index 00000000000000..98c70273ecbf48 --- /dev/null +++ b/ports/irrlicht/fix-sysctl.patch @@ -0,0 +1,12 @@ +--- a/source/Irrlicht/COSOperator.cpp ++++ b/source/Irrlicht/COSOperator.cpp +@@ -11,8 +11,8 @@ + #else + #include + #include +-#ifndef _IRR_SOLARIS_PLATFORM_ + #include ++#ifdef _IRR_OSX_PLATFORM_ + #include + #endif + #endif diff --git a/ports/irrlicht/portfile.cmake b/ports/irrlicht/portfile.cmake index cad4ca5a03f5ab..754119f3ed9ec2 100644 --- a/ports/irrlicht/portfile.cmake +++ b/ports/irrlicht/portfile.cmake @@ -6,7 +6,7 @@ vcpkg_from_sourceforge( REF 1.8/1.8.4 FILENAME "irrlicht-1.8.4.zip" SHA512 de69ddd2c6bc80a1b27b9a620e3697b1baa552f24c7d624076d471f3aecd9b15f71dce3b640811e6ece20f49b57688d428e3503936a7926b3e3b0cc696af98d1 - PATCHES fix-encoding.patch + PATCHES fix-encoding.patch fix-sysctl.patch ) configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY) @@ -45,4 +45,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/irrlicht) endif() -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/itk/CONTROL b/ports/itk/CONTROL index 282ac4b3c6a647..94135373ec0260 100644 --- a/ports/itk/CONTROL +++ b/ports/itk/CONTROL @@ -1,9 +1,38 @@ Source: itk -Version: 5.0.1-2 +Version: 5.1.0 +Port-Version: 2 Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis. Homepage: https://github.com/InsightSoftwareConsortium/ITK -Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[cpp], openjpeg +Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc Feature: vtk Description: Build ITKVtkGlue module. -Build-Depends: vtk +Build-Depends: vtk[core] + +Feature: python +Description: Python functionality for ITK +Build-Depends: python3 + +Feature: opencl +Description: Use OpenCL +Build-Depends: opencl + +Feature: cufftw +Description: Use CUDA FFTW +Build-Depends: cuda + +Feature: cuda +Description: Build CUDA module +Build-Depends: cuda, itk[core, opencl] + +Feature: tbb +Description: Build TBB Module +Build-Depends: tbb + +Feature: rtk +Description: Build RTK Module + +Feature: tools +Description: Build RTK with tools +Build-Depends: itk[core, rtk] + diff --git a/ports/itk/cufftw.patch b/ports/itk/cufftw.patch new file mode 100644 index 00000000000000..17365fb2f1f0e3 --- /dev/null +++ b/ports/itk/cufftw.patch @@ -0,0 +1,58 @@ +From 0f47aae05217884193a39690c2beef566f4ed3b1 Mon Sep 17 00:00:00 2001 +From: Stephen Aylward +Date: Sat, 25 Apr 2020 20:15:21 -0400 +Subject: [PATCH] BUG: CUFFTW paths were not being set and unnecessary FFTW + files used + +FindFFTW sets the FFTW_INCLUDES variable. The FFTW_INCLUDE_PATH var is +specific to FFTW (not used by CUFFTW). + +FFTWGlobalConfiguration file is only needed if FFTW is being used, +not if CUFFT is being used. +--- + CMake/FindFFTW.cmake | 2 +- + Modules/Filtering/FFT/CMakeLists.txt | 2 +- + Modules/Filtering/FFT/src/CMakeLists.txt | 9 +++++---- + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake +index 785edc2b628..e1935899cab 100644 +--- a/CMake/FindFFTW.cmake ++++ b/CMake/FindFFTW.cmake +@@ -62,7 +62,7 @@ if(ITK_USE_FFTWD OR ITK_USE_FFTWF) + find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) + endif() + +- if(FFTW_INCLUDE_PATH) ++ if(FFTW_INCLUDE_PATH OR CUFFTW_INCLUDE_PATH) + if(ITK_USE_CUFFTW) + file(TO_CMAKE_PATH "${CUFFTW_INCLUDE_PATH}" CUFFTW_INCLUDE_PATH) + set(FFTW_INCLUDE ${CUFFTW_INCLUDE_PATH}) +diff --git a/Modules/Filtering/FFT/CMakeLists.txt b/Modules/Filtering/FFT/CMakeLists.txt +index 7d9d1900b56..713530149cb 100644 +--- a/Modules/Filtering/FFT/CMakeLists.txt ++++ b/Modules/Filtering/FFT/CMakeLists.txt +@@ -5,5 +5,5 @@ if(ITK_USE_CUFFTW) + else() + set(ITKFFT_LIBRARIES ITKFFT) + endif() +-set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE_PATH}) ++set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE}) + itk_module_impl() +diff --git a/Modules/Filtering/FFT/src/CMakeLists.txt b/Modules/Filtering/FFT/src/CMakeLists.txt +index 3f3137b8cd4..bde3ee906f8 100644 +--- a/Modules/Filtering/FFT/src/CMakeLists.txt ++++ b/Modules/Filtering/FFT/src/CMakeLists.txt +@@ -1,7 +1,8 @@ +-set(ITKFFT_SRCS +- itkFFTWGlobalConfiguration.cxx +- itkComplexToComplexFFTImageFilter.cxx +- ) ++set(ITKFFT_SRCS itkComplexToComplexFFTImageFilter.cxx) ++ ++if( ITK_USE_FFTWF OR ITK_USE_FFTWD AND NOT ITK_USE_CUFFTW) ++ list(APPEND ITKFFT_SRCS itkFFTWGlobalConfiguration.cxx ) ++endif() + + itk_module_add_library(ITKFFT ${ITKFFT_SRCS}) + diff --git a/ports/itk/double-conversion.patch b/ports/itk/double-conversion.patch new file mode 100644 index 00000000000000..636dd8c4c7d816 --- /dev/null +++ b/ports/itk/double-conversion.patch @@ -0,0 +1,16 @@ +diff --git a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt +index 16c611fd3..13978724c 100644 +--- a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt ++++ b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt +@@ -9,7 +9,10 @@ mark_as_advanced(ITK_USE_SYSTEM_DOUBLECONVERSION) + if(ITK_USE_SYSTEM_DOUBLECONVERSION) + find_package(double-conversion REQUIRED) + get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES) +- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION) ++ get_target_property(ITKDoubleConversion_LIBRARY_RELEASE double-conversion::double-conversion LOCATION_RELEASE) ++ get_target_property(ITKDoubleConversion_LIBRARY_DEBUG double-conversion::double-conversion LOCATION_DEBUG) ++ include(SelectLibraryConfigurations) ++ select_library_configurations(ITKDoubleConversion) + else() + set(ITKDoubleConversion_INCLUDE_DIRS + ${ITKDoubleConversion_SOURCE_DIR}/src diff --git a/ports/itk/fix_libminc_config_path.patch b/ports/itk/fix_libminc_config_path.patch deleted file mode 100644 index 3ff305d4be9776..00000000000000 --- a/ports/itk/fix_libminc_config_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -index 305b2c63..63f81a53 100644 ---- a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -+++ b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -@@ -550,7 +550,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake - DESTINATION -- ${LIBMINC_INSTALL_LIB_DIR}/cmake -+ share/itk - COMPONENT Development) - ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) - diff --git a/ports/itk/fix_openjpeg_search.patch b/ports/itk/fix_openjpeg_search.patch deleted file mode 100644 index d17a1ab8405f03..00000000000000 --- a/ports/itk/fix_openjpeg_search.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -index 6ac16ab6..4638f13c 100644 ---- a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -+++ b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -@@ -373,7 +373,7 @@ else() - endif() - - if(GDCM_USE_SYSTEM_OPENJPEG) -- find_package(OpenJPEG 2.0.0 REQUIRED) -+ find_package(OpenJPEG REQUIRED) - set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) - else() - set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) diff --git a/ports/itk/hdf5.patch b/ports/itk/hdf5.patch new file mode 100644 index 00000000000000..091594cda0e933 --- /dev/null +++ b/ports/itk/hdf5.patch @@ -0,0 +1,20 @@ +diff --git a/Modules/ThirdParty/HDF5/CMakeLists.txt b/Modules/ThirdParty/HDF5/CMakeLists.txt +index a700ecdfb..0a683a52b 100644 +--- a/Modules/ThirdParty/HDF5/CMakeLists.txt ++++ b/Modules/ThirdParty/HDF5/CMakeLists.txt +@@ -25,11 +25,11 @@ endif() + ") + endif() + +- set(ITKHDF5_LIBRARIES ) +- if(BUILD_SHARED_LIBS) +- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_SHARED_LIBRARY} ${HDF5_CXX_SHARED_LIBRARY}) ++ set(ITKHDF5_LIBRARIES) ++ if(HDF5_BUILD_SHARED_LIBS) ++ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-shared hdf5::hdf5-shared) + else() +- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_STATIC_LIBRARY} ${HDF5_CXX_STATIC_LIBRARY}) ++ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-static hdf5::hdf5-static) + endif() + + set(ITKHDF5_INCLUDE_DIRS diff --git a/ports/itk/opencl.patch b/ports/itk/opencl.patch new file mode 100644 index 00000000000000..f935d09d40dade --- /dev/null +++ b/ports/itk/opencl.patch @@ -0,0 +1,176 @@ +diff --git a/Modules/Core/GPUCommon/CMakeLists.txt b/Modules/Core/GPUCommon/CMakeLists.txt +index da2d66b63..6fb476680 100644 +--- a/Modules/Core/GPUCommon/CMakeLists.txt ++++ b/Modules/Core/GPUCommon/CMakeLists.txt +@@ -24,9 +24,13 @@ if(ITK_USE_GPU AND APPLE AND NOT ITK_COMPILER_HAS_BLOCKS) + endif() + + if(ITK_USE_GPU) ++ message(STATUS "OPENCL_LIBRARIES:${OPENCL_LIBRARIES}") ++ if(TARGET OpenCL::OpenCL) ++ message(STATUS "OPENCL_LIBRARIES:${OpenCL_LIBRARIES}") ++ endif() + set(ITKGPUCommon_LIBRARIES ITKGPUCommon) +- set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Core/GPUCommon/src/CMakeLists.txt b/Modules/Core/GPUCommon/src/CMakeLists.txt +index 0b39f2a9a..160f7a752 100644 +--- a/Modules/Core/GPUCommon/src/CMakeLists.txt ++++ b/Modules/Core/GPUCommon/src/CMakeLists.txt +@@ -14,5 +14,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUCommon_Kernels}" ITKGPUCommon_SRCS) + + itk_module_add_library(ITKGPUCommon ${ITKGPUCommon_SRCS}) +- target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Core/GPUFiniteDifference/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/CMakeLists.txt +index c1bfde450..a642d9230 100644 +--- a/Modules/Core/GPUFiniteDifference/CMakeLists.txt ++++ b/Modules/Core/GPUFiniteDifference/CMakeLists.txt +@@ -9,8 +9,8 @@ if(NOT ITK_SOURCE_DIR) + endif() + + if (ITK_USE_GPU) +- set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + set(ITKGPUFiniteDifference_LIBRARIES ITKGPUFiniteDifference) + endif() + +diff --git a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt +index 8425cc025..8335c69a0 100644 +--- a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt ++++ b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUFiniteDifference_Kernels}" ITKGPUFiniteDifference_SRCS) + + itk_module_add_library(ITKGPUFiniteDifference ${ITKGPUFiniteDifference_SRCS}) +- target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt +index f36fd887d..310d983fa 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUAnisotropicSmoothing_LIBRARIES ITKGPUAnisotropicSmoothing) +- set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt +index 078905521..67fd7b832 100644 +--- a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt ++++ b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUImageFilterBase_LIBRARIES ITKGPUImageFilterBase) +- set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt +index 251493f5e..6d33fa964 100644 +--- a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt +@@ -10,5 +10,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUImageFilterBase_Kernels}" ITKGPUImageFilterBase_SRCS) + + itk_module_add_library(ITKGPUImageFilterBase ${ITKGPUImageFilterBase_SRCS}) +- target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUSmoothing/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/CMakeLists.txt +index 9bac40921..2ed493d40 100644 +--- a/Modules/Filtering/GPUSmoothing/CMakeLists.txt ++++ b/Modules/Filtering/GPUSmoothing/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUSmoothing_LIBRARIES ITKGPUSmoothing) +- set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt +index d2120e842..2c6ca4a4a 100644 +--- a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUSmoothing_Kernels}" ITKGPUSmoothing_SRCS) + + itk_module_add_library(ITKGPUSmoothing ${ITKGPUSmoothing_SRCS}) +- target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUThresholding/CMakeLists.txt b/Modules/Filtering/GPUThresholding/CMakeLists.txt +index 4390785f5..61786b7a8 100644 +--- a/Modules/Filtering/GPUThresholding/CMakeLists.txt ++++ b/Modules/Filtering/GPUThresholding/CMakeLists.txt +@@ -2,8 +2,8 @@ project(ITKGPUThresholding) + + if (ITK_USE_GPU) + set(ITKGPUThresholding_LIBRARIES ITKGPUThresholding) +- set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + itk_module_impl() +diff --git a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt +index 326c86859..c07c80414 100644 +--- a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUThresholding_Kernels}" ITKGPUThresholding_SRCS) + + itk_module_add_library(ITKGPUThresholding ${ITKGPUThresholding_SRCS}) +- target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt +index c8d70a423..097c974c5 100644 +--- a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt ++++ b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt +@@ -2,8 +2,8 @@ project(ITKGPUPDEDeformableRegistration) + + if (ITK_USE_GPU) + set(ITKGPUPDEDeformableRegistration_LIBRARIES ITKGPUPDEDeformableRegistration) +- set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + itk_module_impl() +diff --git a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt +index 28b1d194c..1a049bdde 100644 +--- a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt ++++ b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt +@@ -10,5 +10,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUPDEDeformableRegistration_Kernels}" ITKGPUPDEDeformableRegistration_SRCS) + + itk_module_add_library(ITKGPUPDEDeformableRegistration ${ITKGPUPDEDeformableRegistration_SRCS}) +- target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() diff --git a/ports/itk/openjpeg.patch b/ports/itk/openjpeg.patch new file mode 100644 index 00000000000000..0fe1f34c9c097c --- /dev/null +++ b/ports/itk/openjpeg.patch @@ -0,0 +1,548 @@ +diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +index 1b1fe9526..0da4aa0c4 100644 +--- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx ++++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +@@ -26,9 +26,9 @@ + + extern "C" + { +-#include "openjpeg.h" +-#include "j2k.h" +-#include "jp2.h" ++#include ++//#include "j2k.h" ++//##include "jp2.h" + } + + +@@ -62,8 +62,7 @@ public: + OPJ_UINT32 m_TileStartX; + OPJ_UINT32 m_TileStartY; + +- OPJ_UINT32 m_NumberOfTilesInX; +- OPJ_UINT32 m_NumberOfTilesInY; ++ OPJ_UINT32 m_NumberOfTiles; + + opj_dparameters_t m_DecompressionParameters; /* decompression parameters */ + }; +@@ -86,8 +85,7 @@ JPEG2000ImageIO::JPEG2000ImageIO() + this->m_Internal->m_TileStartX = 0; + this->m_Internal->m_TileStartY = 0; + +- this->m_Internal->m_NumberOfTilesInX = 0; +- this->m_Internal->m_NumberOfTilesInY = 0; ++ this->m_Internal->m_NumberOfTiles = 0; + + const char * extensions[] = { ".j2k", ".jp2", ".jpt" }; + +@@ -139,22 +137,16 @@ JPEG2000ImageIO::ReadImageInformation() + { + itkDebugMacro(<< "ReadImageInformation()"); + +- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); +- +- /* decompression parameters */ ++ /* set decoding parameters to default values */ ++ opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); + +- if (!l_file) ++ opj_stream_t * cio = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); ++ if (!cio) + { + itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl + << "Reason: " + << itksys::SystemTools::GetLastSystemError()); + } +- +- /* set decoding parameters to default values */ +- opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); +- +- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, true); +- + this->m_Internal->m_Dinfo = nullptr; /* handle to a decompressor */ + + opj_image_t * l_image = nullptr; +@@ -187,14 +179,14 @@ JPEG2000ImageIO::ReadImageInformation() + /* JPEG-2000 codestream */ + + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); + } + break; + } +@@ -202,14 +194,14 @@ JPEG2000ImageIO::ReadImageInformation() + { + /* JPEG 2000 compressed image data */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); + } + break; + } +@@ -217,20 +209,19 @@ JPEG2000ImageIO::ReadImageInformation() + { + /* JPEG 2000, JPIP */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); + } + break; + } + default: + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl + << "Reason: " +@@ -247,27 +238,11 @@ JPEG2000ImageIO::ReadImageInformation() + << "Reason: opj_setup_decoder returns false"); + } + +- // Image parameters - first tile +- OPJ_INT32 l_tile_x0; +- OPJ_INT32 l_tile_y0; + +- // Image parameters - tile width, height and number of tiles +- OPJ_UINT32 l_tile_width; +- OPJ_UINT32 l_tile_height; +- OPJ_UINT32 l_nb_tiles_x; +- OPJ_UINT32 l_nb_tiles_y; + + itkDebugMacro(<< "Trying to read header now..."); + +- bResult = opj_read_header(this->m_Internal->m_Dinfo, +- &l_image, +- &l_tile_x0, +- &l_tile_y0, +- &l_tile_width, +- &l_tile_height, +- &l_nb_tiles_x, +- &l_nb_tiles_y, +- cio); ++ bResult = opj_read_header(cio, this->m_Internal->m_Dinfo, &l_image); + + if (!bResult) + { +@@ -283,14 +258,22 @@ JPEG2000ImageIO::ReadImageInformation() + << "Reason: Error whle reading image header"); + } + ++ // Image parameters - first tile ++ OPJ_INT32 l_tile_x0=l_image->x0; ++ OPJ_INT32 l_tile_y0=l_image->y0; ++ ++ // Image parameters - tile width, height and number of tiles ++ OPJ_UINT32 l_tile_width=l_image->x1; ++ OPJ_UINT32 l_tile_height=l_image->y1; ++ OPJ_UINT32 l_nb_tiles=l_image->numcomps; ++ + this->m_Internal->m_TileStartX = l_tile_x0; + this->m_Internal->m_TileStartY = l_tile_y0; + + this->m_Internal->m_TileWidth = l_tile_width; + this->m_Internal->m_TileHeight = l_tile_height; + +- this->m_Internal->m_NumberOfTilesInX = l_nb_tiles_x; +- this->m_Internal->m_NumberOfTilesInY = l_nb_tiles_y; ++ this->m_Internal->m_NumberOfTiles = l_nb_tiles; + + + itkDebugMacro(<< "Number of Components = " << l_image->numcomps); +@@ -319,7 +302,7 @@ JPEG2000ImageIO::ReadImageInformation() + this->SetPixelType(IOPixelEnum::SCALAR); + break; + case 3: +- if (l_image->color_space != CLRSPC_SRGB) ++ if (l_image->color_space != OPJ_CLRSPC_SRGB) + { + itkWarningMacro(<< "file does not specify color space, assuming sRGB"); + } +@@ -335,8 +318,7 @@ JPEG2000ImageIO::ReadImageInformation() + itkDebugMacro(<< "Tile Start Y = " << this->m_Internal->m_TileStartY); + itkDebugMacro(<< "Tile Width = " << this->m_Internal->m_TileWidth); + itkDebugMacro(<< "Tile Height = " << this->m_Internal->m_TileHeight); +- itkDebugMacro(<< "Number of Tiles X = " << this->m_Internal->m_NumberOfTilesInX); +- itkDebugMacro(<< "Number of Tiles Y = " << this->m_Internal->m_NumberOfTilesInY); ++ itkDebugMacro(<< "Number of Tiles = " << this->m_Internal->m_NumberOfTiles); + + itkDebugMacro(<< "image->x1 = " << l_image->x1); + itkDebugMacro(<< "image->y1 = " << l_image->y1); +@@ -349,7 +331,6 @@ JPEG2000ImageIO::ReadImageInformation() + + /* close the byte stream */ + opj_stream_destroy(cio); +- fclose(l_file); + + if (this->m_Internal->m_Dinfo) + { +@@ -368,16 +349,7 @@ JPEG2000ImageIO::Read(void * buffer) + { + itkDebugMacro(<< "JPEG2000ImageIO::Read() Begin"); + +- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); +- +- if (!l_file) +- { +- itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl +- << "Reason: " +- << itksys::SystemTools::GetLastSystemError()); +- } +- +- opj_stream_t * l_stream = opj_stream_create_default_file_stream(l_file, true); ++ opj_stream_t * l_stream = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); + if (!l_stream) + { + itkExceptionMacro("JPEG2000ImageIO failed to read file: " +@@ -397,12 +369,13 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG-2000 codestream */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); + } + break; + } +@@ -410,12 +383,13 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG 2000 compressed image data */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); + } + break; + } +@@ -423,17 +397,18 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG 2000, JPIP */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); + } + break; + } + default: +- fclose(l_file); ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl + << "Reason: " +@@ -448,29 +423,13 @@ JPEG2000ImageIO::Read(void * buffer) + << "Reason: opj_setup_decoder returns false"); + } + +- OPJ_INT32 l_tile_x0, l_tile_y0; +- +- OPJ_UINT32 l_tile_width; +- OPJ_UINT32 l_tile_height; +- OPJ_UINT32 l_nb_tiles_x; +- OPJ_UINT32 l_nb_tiles_y; +- +- bool bResult = opj_read_header(this->m_Internal->m_Dinfo, +- &l_image, +- &l_tile_x0, +- &l_tile_y0, +- &l_tile_width, +- &l_tile_height, +- &l_nb_tiles_x, +- &l_nb_tiles_y, +- l_stream); ++ bool bResult = opj_read_header(l_stream, this->m_Internal->m_Dinfo,&l_image); + + if (!bResult) + { + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: opj_read_header returns false"); + } +@@ -499,7 +458,7 @@ JPEG2000ImageIO::Read(void * buffer) + itkDebugMacro(<< "p_end_x = " << p_end_x); + itkDebugMacro(<< "p_end_y = " << p_end_y); + +- bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, p_start_x, p_start_y, p_end_x, p_end_y); ++ bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, l_image, p_start_x, p_start_y, p_end_x, p_end_y); + + itkDebugMacro(<< "opj_set_decode_area() after"); + +@@ -508,7 +467,6 @@ JPEG2000ImageIO::Read(void * buffer) + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: opj_set_decode_area returns false"); + } +@@ -525,13 +483,13 @@ JPEG2000ImageIO::Read(void * buffer) + + OPJ_UINT32 l_max_data_size = 1000; + +- bool l_go_on = true; ++ int l_go_on = true; // should be OBJ_BOOL + + auto * l_data = (OPJ_BYTE *)malloc(1000); + + while (l_go_on) + { +- bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, ++ bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, l_stream, + &l_tile_index, + &l_data_size, + &l_current_tile_x0, +@@ -539,14 +497,12 @@ JPEG2000ImageIO::Read(void * buffer) + &l_current_tile_x1, + &l_current_tile_y1, + &l_nb_comps, +- &l_go_on, +- l_stream); ++ &l_go_on); + + if (!tileHeaderRead) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -571,7 +527,6 @@ JPEG2000ImageIO::Read(void * buffer) + if (!l_data) + { + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -590,7 +545,6 @@ JPEG2000ImageIO::Read(void * buffer) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -654,7 +608,6 @@ JPEG2000ImageIO::Read(void * buffer) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -666,14 +619,12 @@ JPEG2000ImageIO::Read(void * buffer) + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: error whle reading image"); + } + + /* close the byte stream */ + opj_stream_destroy(l_stream); +- fclose(l_file); + + if (this->m_Internal->m_Dinfo) + { +@@ -840,13 +791,13 @@ JPEG2000ImageIO ::Write(const void * buffer) + + parameters.numresolution = numberOfResolutions; + +- OPJ_COLOR_SPACE color_space = CLRSPC_GRAY; ++ OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; + opj_image_cmptparm_t cmptparms[3]; + + if (this->GetNumberOfComponents() == 3) + { + +- color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? CLRSPC_SRGB : CLRSPC_UNSPECIFIED; ++ color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_UNSPECIFIED; + + /* initialize image components */ + memset(&cmptparms[0], 0, 3 * sizeof(opj_image_cmptparm_t)); +@@ -864,7 +815,7 @@ JPEG2000ImageIO ::Write(const void * buffer) + + if (this->GetNumberOfComponents() == 1) + { +- color_space = CLRSPC_GRAY; ++ color_space = OPJ_CLRSPC_GRAY; + + /* initialize image components */ + memset(&cmptparms[0], 0, sizeof(opj_image_cmptparm_t)); +@@ -940,32 +891,32 @@ JPEG2000ImageIO ::Write(const void * buffer) + opj_codec_t * cinfo = nullptr; + if (extension == ".j2k") + { +- cinfo = opj_create_compress(CODEC_J2K); ++ cinfo = opj_create_compress(OPJ_CODEC_J2K); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_J2K) returns nullptr"); + } + } + else if (extension == ".jp2") + { +- cinfo = opj_create_compress(CODEC_JP2); ++ cinfo = opj_create_compress(OPJ_CODEC_JP2); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_JP2) returns nullptr"); + } + } + else if (extension == ".jpt") + { +- cinfo = opj_create_compress(CODEC_JPT); ++ cinfo = opj_create_compress(OPJ_CODEC_JPT); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_JPT) returns nullptr"); + } + } + else +@@ -989,17 +940,9 @@ JPEG2000ImageIO ::Write(const void * buffer) + << "Reason: opj_setup_encoder returns false"); + } + +- FILE * l_file = fopen(parameters.outfile, "wb"); +- if (!l_file) +- { +- itkExceptionMacro("JPEG2000ImageIO failed to open file for writing: " << this->GetFileName() << std::endl +- << "Reason: " +- << itksys::SystemTools::GetLastSystemError()); +- } +- + /* open a byte stream for writing */ + /* allocate memory for all tiles */ +- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, false); ++ opj_stream_t * cio = opj_stream_create_default_file_stream(parameters.outfile, false); + if (!cio) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " +@@ -1017,8 +960,7 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); +- itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl ++ itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_start_compress returns false"); + } + +@@ -1026,7 +968,6 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_encode returns false"); + } +@@ -1035,14 +976,12 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_end_compress returns false"); + } + + /* close and free the byte stream */ + opj_stream_destroy(cio); +- fclose(l_file); + + /* free remaining compression structures */ + opj_destroy_codec(cinfo); +diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +index 103eaa9dd..eb8989135 100644 +--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +@@ -1,12 +1,25 @@ + project(ITKOpenJPEG) + set(ITKOpenJPEG_THIRD_PARTY 1) + +-set(ITKOpenJPEG_INCLUDE_DIRS +- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg +- ) +-set(ITKOpenJPEG_LIBRARIES itkopenjpeg) +-set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) ++if(ITK_USE_SYSTEM_OpenJPEG) ++ find_package(OpenJPEG REQUIRED) ++ if(TARGET openjp2) ++ set(ITKOpenJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) ++ else() ++ message(FATAL_ERROR "OpenJPEG target openjp2 missing!") ++ endif() ++ set(ITKOpenJPEG_INCLUDE_DIRS ++ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ ) ++else() ++ set(ITKOpenJPEG_INCLUDE_DIRS ++ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ ) ++ set(ITKOpenJPEG_LIBRARIES itkopenjpeg) ++ set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) ++endif() + + itk_module_impl() + diff --git a/ports/itk/openjpeg2.patch b/ports/itk/openjpeg2.patch new file mode 100644 index 00000000000000..86631f5f99b2db --- /dev/null +++ b/ports/itk/openjpeg2.patch @@ -0,0 +1,58 @@ +diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt +index 565cc338b..c061f0721 100644 +--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt ++++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt +@@ -194,7 +194,7 @@ mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) ++set(MANGLE_PREFIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in + ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h + @ONLY) +diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt +index c4adb91a2..89b731d88 100644 +--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt ++++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt +@@ -3,7 +3,7 @@ include_regular_expression("^.*$") + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) ++set(MANGLE_PREFIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in + ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h + @ONLY) +diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +index 3811e52f4..a41e9264e 100644 +--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +@@ -8,10 +8,10 @@ if(ITK_USE_SYSTEM_OpenJPEG) + else() + message(FATAL_ERROR "OpenJPEG target openjp2 missing!") + endif() +- set(ITKOpenJPEG_INCLUDE_DIRS +- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg +- ) ++ # set(ITKOpenJPEG_INCLUDE_DIRS ++ # ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ # ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ # ) + else() + set(ITKOpenJPEG_INCLUDE_DIRS + ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +diff --git a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt +index e62e43eda..35dc89976 100644 +--- a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt +@@ -68,7 +68,7 @@ CONFIGURE_FILE(${ITK3P_OpenJPEG_SOURCE_DIR}/opj_configure.h.in + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX itk) ++#set(MANGLE_PREFIX itk) + configure_file(${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in + ${ITK3P_OpenJPEG_BINARY_DIR}/openjpeg_mangle.h + @ONLY) diff --git a/ports/itk/portfile.cmake b/ports/itk/portfile.cmake index a666b57132051c..b16ba194aa83ac 100644 --- a/ports/itk/portfile.cmake +++ b/ports/itk/portfile.cmake @@ -1,22 +1,129 @@ -include(vcpkg_common_functions) - vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO InsightSoftwareConsortium/ITK - REF v5.0.1 - SHA512 242ce66cf83f82d26f20d2099108295e28c8875e7679126ba023834bf0e94454460ba86452a94c8ddaea93d2314befc399f2b151d7294370d4b47f0e9798e77f + REF d3286c9cc04ba16cc8f73de9a98fbcd7c02f3c7b + SHA512 c358449870d580aeb10e32f8be0ca39e8a76d8dc06fda973788fafb5971333e546611c399190be49d40f5f3c18a1105d9699eef271a560aff25ce168a396926e HEAD_REF master PATCHES - fix_openjpeg_search.patch - fix_libminc_config_path.patch + hdf5.patch + double-conversion.patch + openjpeg.patch + openjpeg2.patch + var_libraries.patch + wrapping.patch + python_gpu_wrapping.patch + opencl.patch + cufftw.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "vtk" Module_ITKVtkGlue + "cuda" Module_ITKCudaCommon # Requires RTK? + #"cuda" CUDA_HAVE_GPU # Automatically set by FindCUDA? + "cufftw" ITK_USE_CUFFTW + "opencl" ITK_USE_GPU + "tbb" Module_ITKTBB + "rtk" Module_RTK + "tools" RTK_BUILD_APPLICATIONS + # There are a lot of more (remote) modules and options in ITK + # feel free to add those as a feature ) -if ("vtk" IN_LIST FEATURES) - set(ITKVtkGlue ON) -else() - set(ITKVtkGlue OFF) +if("cufftw" IN_LIST FEATURES) + # Alternativly set CUFFT_LIB and CUFFTW_LIB + if(WIN32) + file(TO_CMAKE_PATH "$ENV{CUDA_PATH}" CUDA_PATH) + set(CUDA_LIB_PATH "${CUDA_PATH}") + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + string(APPEND CUDA_LIB_PATH "/lib/x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + string(APPEND CUDA_LIB_PATH "/lib/Win32") + message(FATAL_ERROR "CUFFTW is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") + else() + message(FATAL_ERROR "Architecture ${VCPKG_TARGET_ARCHITECTURE} not supported !") + endif() + + list(APPEND ADDITIONAL_OPTIONS + "-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}" + "-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include" + "-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include" + ) + endif() +endif() + +if("rtk" IN_LIST FEATURES) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + message(FATAL_ERROR "RTK is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") + endif() + SET(BUILD_RTK ON) + list(APPEND ADDITIONAL_OPTIONS + "-DModule_RTK_GIT_TAG=8099212f715231d093f7d6a1114daecf45d871ed" # RTK latest versions (11.05.2020) + ) + if("cuda" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS "-DRTK_USE_CUDA=ON") + #RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes. + endif() +endif() +file(REMOVE_RECURSE "${SOURCE_PATH}/Modules/Remote/RTK") + +if("opencl" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS # Wrapping options required by OpenCL if build with Python Wrappers + -DITK_WRAP_unsigned_long_long=ON + -DITK_WRAP_signed_long_long=ON + ) +endif() +if("tools" IN_LIST FEATURES) + + if("rtk" IN_LIST FEATURES) + list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient + rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal + rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart + rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster + rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom + rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient + rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition + rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient + rtkwangdisplaceddetectorweighting rtkwarpedbackprojectsequence rtkwarpedforwardprojectsequence rtkwaveletsdenoising rtkxradgeometry) + endif() +endif() +if("vtk" IN_LIST FEATURES) + vcpkg_find_acquire_program(PYTHON3) + list(APPEND ADDITIONAL_OPTIONS + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by mvtk if vtk[python] was build + ) +endif() +if("python" IN_LIST FEATURES) + message(STATUS "${PORT} builds a long time (>1h) with python wrappers enabled!") + vcpkg_find_acquire_program(PYTHON3) + vcpkg_find_acquire_program(SWIG) # Swig is only required for wrapping! + get_filename_component(SWIG_DIR "${SWIG}" DIRECTORY) + list(APPEND ADDITIONAL_OPTIONS + -DITK_WRAP_PYTHON=ON + -DPython3_FIND_REGISTRY=NEVER + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature + "-DSWIG_EXECUTABLE=${SWIG}" + "-DSWIG_DIR=${SWIG_DIR}" + ) + # Due to ITKs internal shenanigans with the variables ...... + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib" + "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib" + "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8") + list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib") + list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib") + elseif(VCPKG_TARGET_IS_LINUX) + list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a" + "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a" + "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m") + list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a") + list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a") + elseif(VCPKG_TARGET_IS_OSX) + #Need Python3 information on OSX within VCPKG + endif() + #ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg endif() set(USE_64BITS_IDS OFF) @@ -24,6 +131,7 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL x64 OR VCPKG_TARGET_ARCHITECTURE STREQUAL set(USE_64BITS_IDS ON) endif() +file(REMOVE_RECURSE "${SOURCE_PATH}/CMake/FindOpenCL.cmake") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -31,7 +139,10 @@ vcpkg_configure_cmake( OPTIONS -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF + -DBUILD_PKGCONFIG_FILES=OFF + -DITK_DOXYGEN_HTML=OFF -DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON + -DITK_SKIP_PATH_LENGTH_CHECKS=ON -DITK_INSTALL_DATA_DIR=share/itk/data -DITK_INSTALL_DOC_DIR=share/itk/doc -DITK_INSTALL_PACKAGE_DIR=share/itk @@ -45,31 +156,58 @@ vcpkg_configure_cmake( -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_EIGEN=ON - # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break - -DITK_FORBID_DOWNLOADS=OFF - - -DITK_SKIP_PATH_LENGTH_CHECKS=ON - - # I haven't tried Python wrapping in vcpkg - #-DITK_WRAP_PYTHON=ON - #-DITK_PYTHON_VERSION=3 + -DITK_USE_SYSTEM_FFTW=ON + -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past and still is. ITK still has not figured out how to do it correctly! + -DITK_USE_SYSTEM_GDCM=ON + -DITK_USE_SYSTEM_OpenJPEG=ON # Added by VCPKG + -DITK_USE_SYSTEM_DCMTK=ON + -DDCMTK_USE_ICU=ON + -DITK_USE_SYSTEM_ICU=ON + #-DITK_USE_SYSTEM_VXL=ON + #-DITK_USE_SYSTEM_CASTXML=ON # needs to be added to vcpkg_find_acquire_program https://data.kitware.com/api/v1/file/hashsum/sha512/b8b6f0aff11fe89ab2fcd1949cc75f2c2378a7bc408827a004396deb5ff5a9976bffe8a597f8db1b74c886ea39eb905e610dce8f5bd7586a4d6c196d7349da8d/download + -DITK_USE_SYSTEM_MINC=ON + -DITK_USE_SYSTEM_SWIG=ON + -DITK_FORBID_DOWNLOADS=OFF # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break. Remote Modules would probably break with this! + -DINSTALL_GTEST=OFF + -DITK_USE_SYSTEM_GOOGLETEST=ON + -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} + + # TODO + #-DVXL_USE_GEOTIFF=ON + -DVXL_USE_LFS=ON + + -DITK_MINIMUM_COMPLIANCE_LEVEL:STRING=1 # To Display all remote modules within cmake-gui + #-DModule_IOSTL=ON # example how to turn on a non-default module + #-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module + #-DModule_RLEImage=ON # example how to turn on a remote module + + # Some additional wraping options + #-DITK_WRAP_double=ON + #-DITK_WRAP_complex_double=ON + #-DITK_WRAP_covariant_vector_double=ON + #-DITK_WRAP_vector_double=ON - -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past - -DModule_ITKVtkGlue=${ITKVtkGlue} # optional feature - - -DModule_IOSTL=ON # example how to turn on a non-default module - -DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module - -DModule_RLEImage=ON # example how to turn on a remote module - -DGDCM_USE_SYSTEM_OPENJPEG=ON #Use port openjpeg instead of own third-party + ${FEATURE_OPTIONS} ${ADDITIONAL_OPTIONS} + + OPTIONS_DEBUG ${OPTIONS_DEBUG} + OPTIONS_RELEASE ${OPTIONS_RELEASE} ) - +if(BUILD_RTK) # Remote Modules are only downloaded on configure. + # TODO: In the future try to download via vcpkg_from_github and move the files. That way patching does not need this workaround + vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}/Modules/Remote/RTK" QUIET PATCHES rtk/already_defined.patch rtk/unresolved.patch) +endif() vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/itk/python_gpu_wrapping.patch b/ports/itk/python_gpu_wrapping.patch new file mode 100644 index 00000000000000..37367d979e0fb8 --- /dev/null +++ b/ports/itk/python_gpu_wrapping.patch @@ -0,0 +1,178 @@ +diff --git a/CMake/itkOpenCL.cmake b/CMake/itkOpenCL.cmake +index 0ccbe144d..fa381524f 100644 +--- a/CMake/itkOpenCL.cmake ++++ b/CMake/itkOpenCL.cmake +@@ -48,7 +48,7 @@ if(ITK_USE_GPU) + ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE} + PROPERTIES GENERATED ON) +- set(${SRC_VAR} ${${SRC_VAR}} ${OUTPUT_FILE}) ++ set(${SRC_VAR} ${${SRC_VAR}} ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}) + endmacro() + + macro(write_gpu_kernels GPUKernels GPU_SRC) +diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h +index 1816f722a..3a6a8aee5 100644 +--- a/Modules/Core/Common/include/itkMacro.h ++++ b/Modules/Core/Common/include/itkMacro.h +@@ -1141,7 +1141,7 @@ compilers. + #define itkGetVectorMacro(name, type, count) \ + virtual type * Get##name() const { return this->m_##name; } + +-/**\def itkGPUKernelClassMacro ++/**\def class itkGPUKernelClassMacro + * Construct a non-templatized helper class that + * provides the GPU kernel source code as a const char* + */ +@@ -1150,7 +1150,7 @@ compilers. + * Workaround KWstyle bug \ \ + * \ingroup ITKCommon \ \ + */ \ +- class kernel \ ++ kernel \ + { \ + public: \ + static const char * \ +diff --git a/Modules/Core/GPUCommon/include/itkGPUImageOps.h b/Modules/Core/GPUCommon/include/itkGPUImageOps.h +index f4eb8f33b..fbdf3d757 100644 +--- a/Modules/Core/GPUCommon/include/itkGPUImageOps.h ++++ b/Modules/Core/GPUCommon/include/itkGPUImageOps.h +@@ -23,7 +23,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUImageOps */ +-itkGPUKernelClassMacro(GPUImageOpsKernel); ++class itkGPUKernelClassMacro(GPUImageOpsKernel); + + /** \class GPUImageOps + * +diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.h b/Modules/Core/GPUCommon/include/itkGPUReduction.h +index 524a5cd01..1b3ce91e9 100644 +--- a/Modules/Core/GPUCommon/include/itkGPUReduction.h ++++ b/Modules/Core/GPUCommon/include/itkGPUReduction.h +@@ -26,7 +26,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUReduction */ +-itkGPUKernelClassMacro(GPUReductionKernel); ++class itkGPUKernelClassMacro(GPUReductionKernel); + + /** + * \class GPUReduction +diff --git a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h +index 853801cec..2fccf0bc5 100644 +--- a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h ++++ b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h +@@ -24,7 +24,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUDenseFiniteDifferenceImageFilter */ +-itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); ++class ITKGPUFiniteDifference_EXPORT itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); + + /** + * \class GPUDenseFiniteDifferenceImageFilter +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h +index 4245ff914..1b21b709e 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h +@@ -54,7 +54,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUGradientNDAnisotropicDiffusionFunction */ +-itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); ++class itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUGradientNDAnisotropicDiffusionFunction +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h +index 305f6490e..d0d433080 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h +@@ -32,7 +32,7 @@ namespace itk + * */ + + /** Create a helper GPU Kernel class for GPUScalarAnisotropicDiffusionFunction */ +-itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); ++class itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUScalarAnisotropicDiffusionFunction : public GPUAnisotropicDiffusionFunction +diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h +index 23530ac5c..e1b83f696 100644 +--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h ++++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h +@@ -29,7 +29,7 @@ namespace itk + { + + /** Create a helper GPU Kernel class for GPUCastImageFilter */ +-itkGPUKernelClassMacro(GPUCastImageFilterKernel); ++class itkGPUKernelClassMacro(GPUCastImageFilterKernel); + + /** \class GPUCastImageFilter + * \brief GPU version of CastImageFilter. +diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h +index c4adc2967..69aeac6db 100644 +--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h ++++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h +@@ -41,7 +41,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUNeighborhoodOperatorImageFilter */ +-itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); ++class itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); + + template + class ITK_TEMPLATE_EXPORT GPUMeanImageFilter +diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h +index 8d26dcfc5..613bc623f 100644 +--- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h ++++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h +@@ -85,7 +85,7 @@ private: + } // end of namespace Functor + + /** Create a helper GPU Kernel class for GPUBinaryThresholdImageFilter */ +-itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); ++class itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); + + /** + * \class GPUBinaryThresholdImageFilter +diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h +index 28b21d592..0b46e27b8 100644 +--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h ++++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h +@@ -51,7 +51,7 @@ namespace itk + * \ingroup ITKGPUPDEDeformableRegistration + */ + /** Create a helper GPU Kernel class for GPUDemonsRegistrationFunction */ +-itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); ++class itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUDemonsRegistrationFunction +diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h +index 93ab975ec..0afd84871 100644 +--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h ++++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h +@@ -73,7 +73,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUPDEDeformableRegistrationFilter */ +-itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); ++class itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); + + template + ++#include "RTKExport.h" + #include "rtkMacro.h" + + namespace rtk +@@ -67,25 +68,18 @@ public: + * with the i-th matrix provides the physical coordinate on + * the i-th projection. + */ +- const std::vector & +- GetMatrices() const +- { +- return this->m_Matrices; +- } ++ itkGetConstReferenceMacro(Matrices,std::vector) + + /** Get the i-th projection matrix. */ + MatrixType +- GetMatrix(const unsigned int i) const +- { +- return this->m_Matrices[i]; +- } ++ GetMatrix(const unsigned int i) const; + + /** Empty the geometry object. */ + virtual void + Clear(); + + protected: +- ProjectionGeometry() = default; ++ ProjectionGeometry(); + ~ProjectionGeometry() override = default; + + void +@@ -93,11 +87,7 @@ protected: + + /** Add projection matrix */ + virtual void +- AddMatrix(const MatrixType & m) +- { +- this->m_Matrices.push_back(m); +- this->Modified(); +- } ++ AddMatrix(const MatrixType & m); + + private: + /** Projection matrices */ +@@ -105,6 +95,9 @@ private: + }; + } // namespace rtk + +-#include "rtkProjectionGeometry.hxx" ++#ifndef ITK_MANUAL_INSTANTIATION ++# include "rtkProjectionGeometry.hxx" ++#endif ++ + + #endif // rtkProjectionGeometry_h +diff --git a/include/rtkProjectionGeometry.hxx b/include/rtkProjectionGeometry.hxx +index 192265812..97dfe8c3a 100644 +--- a/include/rtkProjectionGeometry.hxx ++++ b/include/rtkProjectionGeometry.hxx +@@ -23,6 +23,8 @@ + + namespace rtk + { ++template ++ProjectionGeometry::ProjectionGeometry() = default; + + template + void +@@ -43,6 +45,21 @@ ProjectionGeometry::Clear() + this->Modified(); + } + ++template ++typename ProjectionGeometry::MatrixType ++ProjectionGeometry::GetMatrix(const unsigned int i) const ++{ ++ return this->m_Matrices[i]; ++} ++ ++template ++void ++ProjectionGeometry::AddMatrix(const typename ProjectionGeometry::MatrixType & m) ++{ ++ this->m_Matrices.push_back(m); ++ this->Modified(); ++} ++ + } // namespace rtk + + #endif // rtkProjectionGeometry_hxx diff --git a/ports/itk/rtk/unresolved.patch b/ports/itk/rtk/unresolved.patch new file mode 100644 index 00000000000000..e2209ec7574070 --- /dev/null +++ b/ports/itk/rtk/unresolved.patch @@ -0,0 +1,213 @@ +diff --git a/include/rtkDCMImagXImageIO.h b/include/rtkDCMImagXImageIO.h +index 2a70ae046..69abb409e 100644 +--- a/include/rtkDCMImagXImageIO.h ++++ b/include/rtkDCMImagXImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkDCMImagXImageIO_h + #define rtkDCMImagXImageIO_h +- ++#include "RTKExport.h" + #include + + #include "rtkMacro.h" +@@ -32,7 +32,7 @@ namespace rtk + * + * \ingroup RTK + */ +-class DCMImagXImageIO : public itk::GDCMImageIO ++class RTK_EXPORT DCMImagXImageIO : public itk::GDCMImageIO + { + public: + ITK_DISALLOW_COPY_AND_ASSIGN(DCMImagXImageIO); +diff --git a/include/rtkEdfImageIO.h b/include/rtkEdfImageIO.h +index 66499c56b..7b16fbc5a 100644 +--- a/include/rtkEdfImageIO.h ++++ b/include/rtkEdfImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkEdfImageIO_h + #define rtkEdfImageIO_h +- ++#include "RTKExport.h" + #include + #include + #include +@@ -36,7 +36,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class EdfImageIO : public itk::ImageIOBase ++class RTK_EXPORT EdfImageIO : public itk::ImageIOBase + { + public: + ITK_DISALLOW_COPY_AND_ASSIGN(EdfImageIO); +diff --git a/include/rtkHisImageIO.h b/include/rtkHisImageIO.h +index 2ef2005dd..95449b8a6 100644 +--- a/include/rtkHisImageIO.h ++++ b/include/rtkHisImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkHisImageIO_h + #define rtkHisImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include + #include "rtkMacro.h" +@@ -35,7 +37,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HisImageIO : public itk::ImageIOBase ++class RTK_EXPORT HisImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHncImageIO.h b/include/rtkHncImageIO.h +index 7b9539bde..dc9dca759 100644 +--- a/include/rtkHncImageIO.h ++++ b/include/rtkHncImageIO.h +@@ -19,9 +19,11 @@ + #ifndef rtkHncImageIO_h + #define rtkHncImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include +-#include "itksys/SystemTools.hxx" ++//#include "itksys/SystemTools.hxx" + + #if defined(_MSC_VER) && (_MSC_VER < 1600) + // SR: taken from +@@ -43,7 +45,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HncImageIO : public itk::ImageIOBase ++class RTK_EXPORT HncImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHncImageIOFactory.h b/include/rtkHncImageIOFactory.h +index 2bca8f77e..1d5a97938 100644 +--- a/include/rtkHncImageIOFactory.h ++++ b/include/rtkHncImageIOFactory.h +@@ -38,7 +38,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HncImageIOFactory : public itk::ObjectFactoryBase ++class RTK_EXPORT HncImageIOFactory : public itk::ObjectFactoryBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHndImageIO.h b/include/rtkHndImageIO.h +index 5a07897cc..5f843362a 100644 +--- a/include/rtkHndImageIO.h ++++ b/include/rtkHndImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkHndImageIO_h + #define rtkHndImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include + +@@ -43,7 +45,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HndImageIO : public itk::ImageIOBase ++class RTK_EXPORT HndImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkImagXImageIO.h b/include/rtkImagXImageIO.h +index d69e9a790..d6cc8388e 100644 +--- a/include/rtkImagXImageIO.h ++++ b/include/rtkImagXImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkImagXImageIO_h + #define rtkImagXImageIO_h +- ++#include "RTKExport.h" + #include + #include + #include +@@ -34,7 +34,7 @@ namespace rtk + * + * \ingroup RTK + */ +-class ImagXImageIO : public itk::ImageIOBase ++class RTK_EXPORT ImagXImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkOraImageIO.h b/include/rtkOraImageIO.h +index ece525a42..2d5332872 100644 +--- a/include/rtkOraImageIO.h ++++ b/include/rtkOraImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkOraImageIO_h + #define rtkOraImageIO_h + ++#include "RTKExport.h" ++ + // This is done to avoid any interference with zlib + #ifdef OF + # undef OF +@@ -41,7 +43,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class OraImageIO : public itk::MetaImageIO ++class RTK_EXPORT OraImageIO : public itk::MetaImageIO + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkXRadImageIO.h b/include/rtkXRadImageIO.h +index a72c934e4..0a92afa22 100644 +--- a/include/rtkXRadImageIO.h ++++ b/include/rtkXRadImageIO.h +@@ -19,6 +19,7 @@ + #ifndef rtkXRadImageIO_h + #define rtkXRadImageIO_h + ++#include "RTKExport.h" + #include + #include + #include +@@ -37,7 +38,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class XRadImageIO : public itk::ImageIOBase ++class RTK_EXPORT XRadImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkXimImageIO.h b/include/rtkXimImageIO.h +index ae789dbf9..741f05183 100644 +--- a/include/rtkXimImageIO.h ++++ b/include/rtkXimImageIO.h +@@ -19,6 +19,7 @@ + #ifndef rtkXimImageIO_h + #define rtkXimImageIO_h + ++#include "RTKExport.h" + #include "rtkMacro.h" + + // itk include +@@ -43,7 +44,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class XimImageIO : public itk::ImageIOBase ++class RTK_EXPORT XimImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ diff --git a/ports/itk/var_libraries.patch b/ports/itk/var_libraries.patch new file mode 100644 index 00000000000000..738fa980f131ca --- /dev/null +++ b/ports/itk/var_libraries.patch @@ -0,0 +1,27 @@ +diff --git a/CMake/ITKModuleMacros.cmake b/CMake/ITKModuleMacros.cmake +index da9f3a902..60420bb0a 100644 +--- a/CMake/ITKModuleMacros.cmake ++++ b/CMake/ITKModuleMacros.cmake +@@ -162,9 +162,6 @@ macro(itk_module_impl) + foreach(dep IN LISTS ITK_MODULE_${itk-module}_DEPENDS) + list(APPEND ${itk-module}_LIBRARIES "${${dep}_LIBRARIES}") + endforeach() +- if(${itk-module}_LIBRARIES) +- list(REMOVE_DUPLICATES ${itk-module}_LIBRARIES) +- endif() + endif() + + if(EXISTS ${${itk-module}_SOURCE_DIR}/include) +diff --git a/CMake/ITKModuleAPI.cmake b/CMake/ITKModuleAPI.cmake +index af64d96dc..809335e6d 100644 +--- a/CMake/ITKModuleAPI.cmake ++++ b/CMake/ITKModuleAPI.cmake +@@ -133,7 +133,7 @@ macro(itk_module_config ns) + endforeach() + unset(_${ns}_USED_MODULES) + +- foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS ++ foreach(v ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS + ${ns}_RUNTIME_LIBRARY_DIRS ${ns}_FACTORY_NAMES ${ns}_FACTORY_LIST) + if(${v}) + list(REMOVE_DUPLICATES ${v}) diff --git a/ports/itk/wrapping.patch b/ports/itk/wrapping.patch new file mode 100644 index 00000000000000..1e2e531504eb23 --- /dev/null +++ b/ports/itk/wrapping.patch @@ -0,0 +1,19 @@ +diff --git a/Wrapping/TypedefMacros.cmake b/Wrapping/TypedefMacros.cmake +index e6f8d0bf3..6c000dba8 100644 +--- a/Wrapping/TypedefMacros.cmake ++++ b/Wrapping/TypedefMacros.cmake +@@ -57,13 +57,12 @@ macro(itk_wrap_module library_name) + + # WRAPPER_LIBRARY_DEPENDS. List of names of other wrapper libraries that + # define symbols used by this wrapper library. + INTERSECTION(WRAPPER_LIBRARY_DEPENDS "${ITK_MODULE_${library_name}_DEPENDS}" "${WRAP_ITK_MODULES}") + # set(WRAPPER_LIBRARY_DEPENDS ${ITK_MODULE_${library_name}_DEPENDS}) + + # WRAPPER_LIBRARY_LINK_LIBRARIES. List of other libraries that should + # be linked to the wrapper library. +- set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${itk-module}_LIBRARIES}) +- ++ set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${library_name}_LIBRARIES}) + # WRAPPER_SUBMODULE_ORDER. List of *.wrap submodules in the source dir + # that should be included/wrapped before the rest in the given order. + # Just the submodule group name is needed, not the full path or file name. diff --git a/ports/josuttis-jthread/CONTROL b/ports/josuttis-jthread/CONTROL new file mode 100644 index 00000000000000..8a0fc3c58d6608 --- /dev/null +++ b/ports/josuttis-jthread/CONTROL @@ -0,0 +1,5 @@ +Source: josuttis-jthread +Version: 2020-07-21 +Port-Version: 1 +Homepage: https://github.com/josuttis/jthread +Description: C++ class for a joining and cooperative interruptible thread (std::jthread) with stop_token helper diff --git a/ports/josuttis-jthread/portfile.cmake b/ports/josuttis-jthread/portfile.cmake new file mode 100644 index 00000000000000..9563442b1d58e3 --- /dev/null +++ b/ports/josuttis-jthread/portfile.cmake @@ -0,0 +1,15 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO josuttis/jthread + REF 3e1908f3bbaba6d2195bb423840c23e107c9e8b2 + SHA512 b6e4df35b364848a433eb31023a8b5b5045b2445aaf9a81406a6b3ce7cfdda08bcdb486be9201f5b1e54df38884c1763fae336fdcb9ad79f11658a92c535055d + HEAD_REF master +) + +file(INSTALL ${SOURCE_PATH}/source/jthread.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/source/stop_token.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/source/condition_variable_any2.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/json5-parser/CONTROL b/ports/json5-parser/CONTROL index 891aa1c713c901..99041602192373 100644 --- a/ports/json5-parser/CONTROL +++ b/ports/json5-parser/CONTROL @@ -1,5 +1,6 @@ Source: json5-parser -Version: 1.0.0-1 -Homepage: https://bitbucket.org/wlandry/json5_parser +Version: 1.0.0 +Port-Version: 2 +Homepage: https://github.com/Caltech-IPAC/json5_parser Description: An enhancement of the JSON Spirit C++ library to understand json5. Build-Depends: boost-spirit diff --git a/ports/json5-parser/portfile.cmake b/ports/json5-parser/portfile.cmake index 18ac091bb567d0..79e4d1afc6895b 100644 --- a/ports/json5-parser/portfile.cmake +++ b/ports/json5-parser/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_from_bitbucket( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO wlandry/json5_parser - REF 1.0.0 - SHA512 105d0cccb28dd9045c06d73ab1e98a5e744ffdb38310a4581b8f1517b0edffb2cba424dc557a3490dfdcd4627d3bd1c6850eb38f588e1627dcab1de120d70717 + REPO Caltech-IPAC/json5_parser + REF 580bfe30c5ee5e06a0f536d7bddb75c07a29eda6 # 1.0.0 + SHA512 25cdbc02ed2e3b05f0644c3398230ab82ede093ed6f7d8f140a9810509dd05feab1187d62fc38818725a92c47029fe3dc5ecfdbe14e1e0a2ef314e925b369d59 HEAD_REF master PATCHES 00001-fix-build.patch ) @@ -23,4 +21,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/json5-parser) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/json5-parser/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/jsoncons/CONTROL b/ports/jsoncons/CONTROL index 4063d9323c2be2..a867c1b42c365c 100644 --- a/ports/jsoncons/CONTROL +++ b/ports/jsoncons/CONTROL @@ -1,4 +1,4 @@ Source: jsoncons -Version: 0.153.3 -Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, CSV, MessagePack, CBOR, BSON, UBJSON +Version: 0.155.1 +Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON Homepage: https://github.com/danielaparker/jsoncons diff --git a/ports/jsoncons/portfile.cmake b/ports/jsoncons/portfile.cmake index 7da19ced61374b..960e199d54dcae 100644 --- a/ports/jsoncons/portfile.cmake +++ b/ports/jsoncons/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danielaparker/jsoncons - REF 41302e394917a71e7e73db9a50f7d496d2862fd3 # v0.153.3 - SHA512 8b1859f484eada1db02c7f146efd1a53b412f06e4b4c2b0a1aaf4b96242a839093c5eb5b588e1e29b56830223e07b6d0b6418cca616d901316d9cb30de4e803e + REF 0fd102277ca361b8a82cdab97df67d18fe335409 # v0.155.1 + SHA512 77c64bd0f8ce681a5b517c4a94fbe718e15fa4c5047e718c93413dfa173614818f435419d64313555653966d3a2c35deec15702d9d3768eeba6aba129625fea4 HEAD_REF master ) diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL index ac2559064dbef2..c92324b4ffce53 100644 --- a/ports/jxrlib/CONTROL +++ b/ports/jxrlib/CONTROL @@ -1,4 +1,4 @@ Source: jxrlib -Version: 2019.10.9 +Version: 2019.10.9-1 Homepage: https://github.com/4creators/jxrlib Description: Open source implementation of the jpegxr image format standard. diff --git a/ports/jxrlib/vcpkg-cmake-wrapper.cmake b/ports/jxrlib/vcpkg-cmake-wrapper.cmake index e95a66bdc4ed6a..4bee9171d8197c 100644 --- a/ports/jxrlib/vcpkg-cmake-wrapper.cmake +++ b/ports/jxrlib/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(JXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT JXR_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${JXR_PREV_MODULE_PATH}) diff --git a/ports/kangaru/CONTROL b/ports/kangaru/CONTROL index 4c7b8de4211d84..3ea64eb81d8721 100644 --- a/ports/kangaru/CONTROL +++ b/ports/kangaru/CONTROL @@ -1,3 +1,3 @@ Source: kangaru -Version: 4.2.2 +Version: 4.2.4 Description: A dependency injection container for C++11, C++14 and later diff --git a/ports/kangaru/portfile.cmake b/ports/kangaru/portfile.cmake index 68bd1ed2c7cfe0..7043acf5c18b09 100644 --- a/ports/kangaru/portfile.cmake +++ b/ports/kangaru/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gracicot/kangaru - REF 8b62cede3d66803ae7df5663eb52ff3f2a1f8bf5 # v4.2.2 - SHA512 ae6730d5e7c59c4eec08d72e3bd311042c57e0a23cf5c26348cc21f4e08c1a4f58721cfcfaf81ec3f19db3540d49acc2a0816f5ba34d09cfb1f853de92481327 + REF 8da8f0d5a434a6fb2f317022221ea0809914d4a6 # v4.2.4 + SHA512 e5cfdad793db3b3d5ff093e4120a5131000677504eed09c02817c9a49699c044a88183413ad7b09946abb0258df34fe444078c375a5bf70589345d2aa2c2283b HEAD_REF master ) diff --git a/ports/kf5archive/CONTROL b/ports/kf5archive/CONTROL index a8f1d30ab2cbb6..16592e34e80d1d 100644 --- a/ports/kf5archive/CONTROL +++ b/ports/kf5archive/CONTROL @@ -1,4 +1,5 @@ Source: kf5archive Version: 5.64.0-1 +Homepage: https://api.kde.org/frameworks/karchive/html/index.html Description: File compression Build-Depends: ecm, qt5-base[core], zlib, bzip2 diff --git a/ports/kf5archive/portfile.cmake b/ports/kf5archive/portfile.cmake index aaaa48de0bbce0..c7b99e8526c8de 100644 --- a/ports/kf5archive/portfile.cmake +++ b/ports/kf5archive/portfile.cmake @@ -9,10 +9,11 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() @@ -22,4 +23,5 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/kf5archive RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5completion/CONTROL b/ports/kf5completion/CONTROL new file mode 100644 index 00000000000000..fb1f4309acea58 --- /dev/null +++ b/ports/kf5completion/CONTROL @@ -0,0 +1,5 @@ +Source: kf5completion +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcompletion/html/index.html +Description: Text completion helpers and widgets +Build-Depends: ecm, qt5-tools, kf5config, kf5widgetsaddons \ No newline at end of file diff --git a/ports/kf5completion/add-qdbus-to-required-libraries.patch b/ports/kf5completion/add-qdbus-to-required-libraries.patch new file mode 100644 index 00000000000000..b5c285a652b693 --- /dev/null +++ b/ports/kf5completion/add-qdbus-to-required-libraries.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a86a05e..688bae2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,7 +32,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KCOMPLETION + # Dependencies + set(REQUIRED_QT_VERSION 5.11.0) + +-find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets) ++find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets DBus) + + find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) + find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED) diff --git a/ports/kf5completion/portfile.cmake b/ports/kf5completion/portfile.cmake new file mode 100644 index 00000000000000..d9e697dcf3cd34 --- /dev/null +++ b/ports/kf5completion/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcompletion + REF v5.64.0 + SHA512 1d597bc0e82d1570b1ff7b254425ab18d4d505a0b7f475a43b51d70566b91e763b86675837421c3f09073544efa77e673e9d2cfef586c12684fc9fe7b0c6a0cc + HEAD_REF master + # reported issue, just a manual workaround until the issue is fixed upstream + PATCHES + "add-qdbus-to-required-libraries.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Completion) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5config/CONTROL b/ports/kf5config/CONTROL new file mode 100644 index 00000000000000..8c0c49e3114d5d --- /dev/null +++ b/ports/kf5config/CONTROL @@ -0,0 +1,5 @@ +Source: kf5config +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kconfig/html/index.html +Description: Configuration system +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5config/portfile.cmake b/ports/kf5config/portfile.cmake new file mode 100644 index 00000000000000..444b1aed5abe24 --- /dev/null +++ b/ports/kf5config/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kconfig + REF v5.64.0 + SHA512 b8919e552a35ed3f4882d2d15205c5576be985e9f6e4e834d26587c9288e85a2ab27504a1531d1af70e8db4dc7ed71a6b0caf91c7310dace81177b68aa6a97e5 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconfig_compiler_kf5.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconfig_compiler_kf5.exe) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconf_update.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconf_update.exe) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5.exe) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5.exe) + file (GLOB EXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) + file(REMOVE ${EXES}) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kreadconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kwriteconfig5) +endif() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Config) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5coreaddons/CONTROL b/ports/kf5coreaddons/CONTROL new file mode 100644 index 00000000000000..03d14a3545db45 --- /dev/null +++ b/ports/kf5coreaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5coreaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcoreaddons/html/index.html +Description: Addons to QtCore +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5coreaddons/portfile.cmake b/ports/kf5coreaddons/portfile.cmake new file mode 100644 index 00000000000000..14862e07f1188c --- /dev/null +++ b/ports/kf5coreaddons/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcoreaddons + REF v5.64.0 + SHA512 b6849c072aa33cd2d93477e7a08ffc8ec7034f7d8530b6492faa9a53e4e15af0da778fc54e5d865e68b36c32aa6559f3d178a03046f5120d11dcb61d35ed7a60 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_DATAROOTDIR=data +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5CoreAddons) +vcpkg_copy_pdbs() + +vcpkg_copy_tools( + TOOL_NAMES desktoptojson + AUTO_CLEAN +) + +file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/desktoptojson${EXECUTABLE_SUFFIX}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5crash/CONTROL b/ports/kf5crash/CONTROL new file mode 100644 index 00000000000000..927eca46cd0919 --- /dev/null +++ b/ports/kf5crash/CONTROL @@ -0,0 +1,6 @@ +Source: kf5crash +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcrash/html/index.html +Description: KCrash provides support for intercepting and handling application crashes. +Supports: linux +Build-Depends: ecm, kf5coreaddons, kf5widgetsaddons diff --git a/ports/kf5crash/add_x11extras.patch b/ports/kf5crash/add_x11extras.patch new file mode 100644 index 00000000000000..a6ff6fc66ce412 --- /dev/null +++ b/ports/kf5crash/add_x11extras.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a9d1c6..0d5fb3f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKA + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + + set(REQUIRED_QT_VERSION 5.11.0) +-find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) ++find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core X11Extras) + include(KDEInstallDirs) + include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + include(KDECMakeSettings) diff --git a/ports/kf5crash/portfile.cmake b/ports/kf5crash/portfile.cmake new file mode 100644 index 00000000000000..dc608d37153250 --- /dev/null +++ b/ports/kf5crash/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_fail_port_install(ON_TARGET "osx" "uwp" "windows") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcrash + REF v5.64.0 + SHA512 28749b220002fef756dbd8436cf684b7e3eb1d72ae00ae8b1bfded5c4a446683dc925a3be9beb55ad0872e71d3c23411d32b4fab935909816efa339cedaeda3d + HEAD_REF master + PATCHES + add_x11extras.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Crash) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) + +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5guiaddons/CONTROL b/ports/kf5guiaddons/CONTROL new file mode 100644 index 00000000000000..a364eecc1d79d3 --- /dev/null +++ b/ports/kf5guiaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5guiaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kguiaddons/html/index.html +Description: Addons to QtGui +Build-Depends: ecm, qt5-winextras (windows), qt5-x11extras (linux), qt5-tools diff --git a/ports/kf5guiaddons/portfile.cmake b/ports/kf5guiaddons/portfile.cmake new file mode 100644 index 00000000000000..8234e4cd8787ea --- /dev/null +++ b/ports/kf5guiaddons/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kguiaddons + REF v5.64.0 + SHA512 98d07360f02b473997cdbf9e9b832ea8c4a459a73669eff1db5276dfbd63e9a9088e3c1ed99d70cc1433468e1efcbce43d22fefdf75a399f4812e0fc4a4f13b1 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5GuiAddons) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5i18n/CONTROL b/ports/kf5i18n/CONTROL new file mode 100644 index 00000000000000..d963ed00809e38 --- /dev/null +++ b/ports/kf5i18n/CONTROL @@ -0,0 +1,6 @@ +Source: kf5i18n +Version: 5.64.0 +Port-Version: 1 +Homepage: https://api.kde.org/frameworks/ki18n/html/index.html +Description: Advanced internationalization framework +Build-Depends: ecm, qt5-declarative, qt5-tools, gettext diff --git a/ports/kf5i18n/portfile.cmake b/ports/kf5i18n/portfile.cmake new file mode 100644 index 00000000000000..779fd60e8399ea --- /dev/null +++ b/ports/kf5i18n/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/ki18n + REF v5.64.0 + SHA512 13b5d701003edea704ffc86a886d86b27ff2198d4cde4ee732b9241cf04dba0fba403f1f78b45facd7c2d3b543f8f0a098369035270a61b347331eb495fae1d3 +) + +if(CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT NO_DEFAULT_PACKAGES DIRECT_PACKAGES + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-9-any.pkg.tar.zst" + c632877544183def8b19659421c5511b87f8339596e1606bd47608277a0bf427d370aba1732915c2832c91f6d525261623401f145b951ff3015f79ac54179c19 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz" + ba236e1efc990cb91d459f938be6ca6fc2211be95e888d73f8de301bce55d586f9d2b6be55dacb975ec1afa7952b510906284eff70210238919e341dffbdbeb8 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-1-any.pkg.tar.zst" + 113d8b3b155ea537be8b99688d454f781d70c67c810c2643bc02b83b332d99bfbf3a7fcada6b927fda67ef02cf968d4fdf930466c5909c4338bda64f1f3f483e + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz" + d236b815ec3cf569d24d96a386eca9f69a2b1e8af18e96c3f1e5a4d68a3598d32768c7fb3c92207ecffe531259822c1a421350949f2ffabd8ee813654f1af864 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.1.0-2-any.pkg.tar.zst" + caac5cb73395082b479597a73c7398bf83009dbc0051755ef15157dc34996e156d4ed7881ef703f9e92861cfcad000888c4c32e4bf38b2596c415a19aafcf893 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz" + 37747f3f373ebff1a493f5dec099f8cd6d5abdc2254d9cd68a103ad7ba44a81a9a97ccaba76eaee427b4d67b2becb655ee2c379c2e563c8051b6708431e3c588 + ) + set(GETTEXT_PATH ${MSYS_ROOT}/mingw32/bin) + vcpkg_add_to_path(${GETTEXT_PATH}) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_PLUGINDIR=plugins +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5I18n) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemmodels/CONTROL b/ports/kf5itemmodels/CONTROL new file mode 100644 index 00000000000000..f94f20fa9d9fa4 --- /dev/null +++ b/ports/kf5itemmodels/CONTROL @@ -0,0 +1,5 @@ +Source: kf5itemmodels +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kitemmodels/html/index.html +Description: Models for Qt Model/View system +Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemmodels/portfile.cmake b/ports/kf5itemmodels/portfile.cmake new file mode 100644 index 00000000000000..9facbb120bea25 --- /dev/null +++ b/ports/kf5itemmodels/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kitemmodels + REF v5.64.0 + SHA512 c29911b5ff521a8d1dae9b72250be59267da7bf059aeb1efec6a7361204957c12a1ae95fd34a00067b277ce3a61d88930326501c361341a316d6c0afb109b7ed +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemModels) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemviews/CONTROL b/ports/kf5itemviews/CONTROL new file mode 100644 index 00000000000000..8d83844ebeae86 --- /dev/null +++ b/ports/kf5itemviews/CONTROL @@ -0,0 +1,5 @@ +Source: kf5itemviews +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kitemviews/html/index.html +Description: Widget addons for Qt Model/View +Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemviews/portfile.cmake b/ports/kf5itemviews/portfile.cmake new file mode 100644 index 00000000000000..f134b477ceb43a --- /dev/null +++ b/ports/kf5itemviews/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kitemviews + REF v5.64.0 + SHA512 c40d1dee94badac2e58098138522d72be00082ac9ce70e8f5690b5bd5ae0705fa79a7edc3af391230a86d08a4a8b7dac1c28f148758f7ee8c09195a178e35bcb +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemViews) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5widgetsaddons/CONTROL b/ports/kf5widgetsaddons/CONTROL new file mode 100644 index 00000000000000..2e5f2eb515d499 --- /dev/null +++ b/ports/kf5widgetsaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5widgetsaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kwidgetsaddons/html/index.html +Description: Addons to QtWidgets +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5widgetsaddons/portfile.cmake b/ports/kf5widgetsaddons/portfile.cmake new file mode 100644 index 00000000000000..fe7106e224bd09 --- /dev/null +++ b/ports/kf5widgetsaddons/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kwidgetsaddons + REF v5.64.0 + SHA512 f49bade85b97468ad4c2faa34b71c6d04ff95c720c27e5b7adfb9a7b5acf8ff30b91d2beca7472dec6b8241f918b4fb15bddc1429be86a62bcefefe918311307 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WidgetsAddons) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5windowsystem/CONTROL b/ports/kf5windowsystem/CONTROL new file mode 100644 index 00000000000000..d5cb904870e089 --- /dev/null +++ b/ports/kf5windowsystem/CONTROL @@ -0,0 +1,5 @@ +Source: kf5windowsystem +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kwindowsystem/html/ +Description: Access to the windowing system +Build-Depends: ecm, qt5-winextras (windows), qt5-tools diff --git a/ports/kf5windowsystem/portfile.cmake b/ports/kf5windowsystem/portfile.cmake new file mode 100644 index 00000000000000..0284c7408e5205 --- /dev/null +++ b/ports/kf5windowsystem/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kwindowsystem + REF v5.64.0 + SHA512 7e1033ac383042b76254f35676c8aa011f02192e80ac2eb0554014a483749b13002062e7e928884f95dc7cb2a1c390bd2a93a7871d3f107b7042f7219dadecf5 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_PLUGINDIR=plugins +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WindowSystem) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/knet/portfile.cmake b/ports/knet/portfile.cmake new file mode 100644 index 00000000000000..f974cec0c26d0b --- /dev/null +++ b/ports/knet/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO kibaamor/knet + REF v1.0.1 + SHA512 c9d3d876bef89d2b2c10f4f91ff3dc70a036e2437bf96fd57df8de07275b7b99b214ad332db94d7f1da587b22e6bd00bfde1d7d4b23277639ea0cef1f0a6f59c + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DKNET_BUILD_EXAMPLE:BOOL=OFF + -DKNET_BUILD_TEST:BOOL=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/knet TARGET_PATH share/knet) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/knet/usage b/ports/knet/usage new file mode 100644 index 00000000000000..2a83afe1b230a3 --- /dev/null +++ b/ports/knet/usage @@ -0,0 +1,4 @@ +The package knet provides CMake integration: + + find_package(knet CONFIG REQUIRED) + target_link_libraries(main PRIVATE knet) diff --git a/ports/knet/vcpkg.json b/ports/knet/vcpkg.json new file mode 100644 index 00000000000000..5ac2b02499c8fc --- /dev/null +++ b/ports/knet/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "knet", + "version-string": "1.0.1", + "description": "A cross platform lock-free and timer-supported C++11 network library.", + "homepage": "https://github.com/kibaamor/knet", + "license": "MIT", + "supports": "!(arm | uwp)" +} diff --git a/ports/lapack-reference/CONTROL b/ports/lapack-reference/CONTROL new file mode 100644 index 00000000000000..3d8bb855dc071d --- /dev/null +++ b/ports/lapack-reference/CONTROL @@ -0,0 +1,17 @@ +Source: lapack-reference +Version: 3.8.0 +Port-Version: 3 +Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/ +Default-Features: blas-select +Build-Depends: vcpkg-gfortran (windows) + +Feature: cblas +Description: Builds CBLAS + +Feature: noblas +Build-Depends: openblas +Description: Use external optimized BLAS + +Feature: blas-select +Build-Depends: lapack-reference[core, noblas](!windows|!static) +Description: Use external optimized BLAS diff --git a/ports/lapack-reference/FindLAPACK.cmake b/ports/lapack-reference/FindLAPACK.cmake new file mode 100644 index 00000000000000..a411c7c18e9a92 --- /dev/null +++ b/ports/lapack-reference/FindLAPACK.cmake @@ -0,0 +1,551 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindLAPACK +---------- + +Find Linear Algebra PACKage (LAPACK) library + +This module finds an installed Fortran library that implements the +LAPACK linear-algebra interface (see http://www.netlib.org/lapack/). + +The approach follows that taken for the ``autoconf`` macro file, +``acx_lapack.m4`` (distributed at +http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). + +Input Variables +^^^^^^^^^^^^^^^ + +The following variables may be set to influence this module's behavior: + +``BLA_STATIC`` + if ``ON`` use static linkage + +``BLA_VENDOR`` + If set, checks only the specified vendor, if not set checks all the + possibilities. List of vendors valid in this module: + + * ``OpenBLAS`` + * ``FLAME`` + * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) + * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) + * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) + * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model) + * ``Intel10_64_dyn`` (intel mkl v10+ 64 bit, single dynamic library) + * ``Intel`` (obsolete versions of mkl 32 and 64 bit) + * ``ACML`` + * ``Apple`` + * ``NAS`` + * ``Arm`` + * ``Arm_mp`` + * ``Arm_ilp64`` + * ``Arm_ilp64_mp`` + * ``Generic`` + +``BLA_F95`` + if ``ON`` tries to find the BLAS95/LAPACK95 interfaces + +Imported targets +^^^^^^^^^^^^^^^^ + +This module defines the following :prop_tgt:`IMPORTED` target: + +``LAPACK::LAPACK`` + The libraries to use for LAPACK, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +``LAPACK_FOUND`` + library implementing the LAPACK interface is found +``LAPACK_LINKER_FLAGS`` + uncached list of required linker flags (excluding ``-l`` and ``-L``). +``LAPACK_LIBRARIES`` + uncached list of libraries (using full path name) to link against + to use LAPACK +``LAPACK95_LIBRARIES`` + uncached list of libraries (using full path name) to link against + to use LAPACK95 +``LAPACK95_FOUND`` + library implementing the LAPACK95 interface is found + +.. note:: + + C, CXX or Fortran must be enabled to detect a BLAS/LAPACK library. + C or CXX must be enabled to use Intel Math Kernel Library (MKL). + + For example, to use Intel MKL libraries and/or Intel compiler: + + .. code-block:: cmake + + set(BLA_VENDOR Intel10_64lp) + find_package(LAPACK) +#]=======================================================================] + +enable_language(C) +# Check the language being used +if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED)) + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.") + else() + message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)") + return() + endif() +endif() + +if(CMAKE_Fortran_COMPILER_LOADED) + include(${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +else() + include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +endif() +include(${CMAKE_ROOT}/Modules/CMakePushCheckState.cmake) + +cmake_push_check_state() +set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY}) + +set(LAPACK_FOUND FALSE) +set(LAPACK95_FOUND FALSE) + +# TODO: move this stuff to a separate module + +macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _addlibdir _subdirs _blas) + # This macro checks for the existence of the combination of fortran libraries + # given by _list. If the combination is found, this macro checks (using the + # Check_Fortran_Function_Exists macro) whether can link against that library + # combination using the name of a routine given by _name using the linker + # flags given by _flags. If the combination of libraries is found and passes + # the link test, LIBRARIES is set to the list of complete library paths that + # have been found. Otherwise, LIBRARIES is set to FALSE. + + # N.B. _prefix is the prefix applied to the names of all cached variables that + # are generated internally and marked advanced by this macro. + # _addlibdir is a list of additional search paths. _subdirs is a list of path + # suffixes to be used by find_library(). + + set(_libraries_work TRUE) + set(${LIBRARIES}) + set(_combined_name) + + set(_extaddlibdir "${_addlibdir}") + if(WIN32) + list(APPEND _extaddlibdir ENV LIB) + elseif(APPLE) + list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH) + else() + list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH) + endif() + list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + + foreach(_library ${_list}) + if(_library MATCHES "^-Wl,--(start|end)-group$") + # Respect linker flags like --start/end-group (required by MKL) + set(${LIBRARIES} ${${LIBRARIES}} "${_library}") + else() + set(_combined_name ${_combined_name}_${_library}) + if(_libraries_work) + find_library(${_prefix}_${_library}_LIBRARY + NAMES ${_library} + PATHS ${_extaddlibdir} + PATH_SUFFIXES ${_subdirs} + ) + #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}") + mark_as_advanced(${_prefix}_${_library}_LIBRARY) + set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) + set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) + endif() + endif() + endforeach() + + if(_libraries_work) + # Test this combination of libraries. + set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threadlibs}) + #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") + if(CMAKE_Fortran_COMPILER_LOADED) + check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) + else() + check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) + endif() + set(CMAKE_REQUIRED_LIBRARIES) + set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) + endif() + + if(_libraries_work) + if("${_list}${_blas}" STREQUAL "") + set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + else() + set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threadlibs}) + endif() + else() + set(${LIBRARIES} FALSE) + endif() + #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") +endmacro() + +set(LAPACK_LINKER_FLAGS) +set(LAPACK_LIBRARIES) +set(LAPACK95_LIBRARIES) + +include(CMakeFindDependencyMacro) +find_dependency(BLAS) + +if(BLAS_FOUND) + set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) + if(NOT $ENV{BLA_VENDOR} STREQUAL "") + set(BLA_VENDOR $ENV{BLA_VENDOR}) + else() + if(NOT BLA_VENDOR) + set(BLA_VENDOR "All") + endif() + endif() + + # LAPACK in the Intel MKL 10+ library? + if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + if(CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) + # System-specific settings + if(NOT WIN32) + set(LAPACK_mkl_LM "-lm") + set(LAPACK_mkl_LDL "-ldl") + endif() + + if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + find_package(Threads) + else() + find_package(Threads REQUIRED) + endif() + + if(BLA_VENDOR MATCHES "_64ilp") + set(LAPACK_mkl_ILP_MODE "ilp64") + else() + set(LAPACK_mkl_ILP_MODE "lp64") + endif() + + set(LAPACK_SEARCH_LIBS "") + + if(BLA_F95) + set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") + set(_LIBRARIES LAPACK95_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) + + # old + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95") + # new >= 10.3 + list(APPEND LAPACK_SEARCH_LIBS + "mkl_intel_c") + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95_${LAPACK_mkl_ILP_MODE}") + else() + set(LAPACK_mkl_SEARCH_SYMBOL "cheev") + set(_LIBRARIES LAPACK_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) + + # old and new >= 10.3 + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack") + endif() + + # MKL uses a multitude of partially platform-specific subdirectories: + if(BLA_VENDOR STREQUAL "Intel10_32") + set(LAPACK_mkl_ARCH_NAME "ia32") + else() + set(LAPACK_mkl_ARCH_NAME "intel64") + endif() + if(WIN32) + set(LAPACK_mkl_OS_NAME "win") + elseif(APPLE) + set(LAPACK_mkl_OS_NAME "mac") + else() + set(LAPACK_mkl_OS_NAME "lin") + endif() + if(DEFINED ENV{MKLROOT}) + file(TO_CMAKE_PATH "$ENV{MKLROOT}" LAPACK_mkl_MKLROOT) + # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead + # so we can better detect other relevant libraries in 'compiler' or 'tbb': + get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME) + if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl") + get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY) + endif() + endif() + set(LAPACK_mkl_LIB_PATH_SUFFIXES + "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}") + + # First try empty lapack libs + if(NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "" + "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" + "${LAPACK_mkl_MKLROOT}" + "${LAPACK_mkl_LIB_PATH_SUFFIXES}" + "${_BLAS_LIBRARIES}" + ) + endif() + + # Then try the search libs + foreach(IT ${LAPACK_SEARCH_LIBS}) + string(REPLACE " " ";" SEARCH_LIBS ${IT}) + if(NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "${SEARCH_LIBS}" + "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" + "${LAPACK_mkl_MKLROOT}" + "${LAPACK_mkl_LIB_PATH_SUFFIXES}" + "${_BLAS_LIBRARIES}" + ) + endif() + endforeach() + + unset(LAPACK_mkl_ILP_MODE) + unset(LAPACK_mkl_SEARCH_SYMBOL) + unset(LAPACK_mkl_LM) + unset(LAPACK_mkl_LDL) + unset(LAPACK_mkl_MKLROOT) + unset(LAPACK_mkl_ARCH_NAME) + unset(LAPACK_mkl_OS_NAME) + unset(LAPACK_mkl_LIB_PATH_SUFFIXES) + endif() + endif() + endif() + + # gotoblas? (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) + if(BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "goto2" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # OpenBLAS? (http://www.openblas.net) + if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "openblas" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # ArmPL? (https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries) + if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All") + + # Check for 64bit Integer support + if(BLA_VENDOR MATCHES "_ilp64") + set(LAPACK_armpl_LIB "armpl_ilp64") + else() + set(LAPACK_armpl_LIB "armpl_lp64") + endif() + + # Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp + if(BLA_VENDOR MATCHES "_mp") + set(LAPACK_armpl_LIB "${LAPACK_armpl_LIB}_mp") + endif() + + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "${LAPACK_armpl_LIB}" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # FLAME's blis library? (https://github.com/flame/blis) + if(BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "flame" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # BLAS in acml library? + if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") + if(BLAS_LIBRARIES MATCHES ".+acml.+") + set(LAPACK_LIBRARIES ${BLAS_LIBRARIES}) + endif() + endif() + + # Apple LAPACK library? + if(BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "Accelerate" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # Apple NAS (vecLib) library? + if(BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "vecLib" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # Generic LAPACK library? + if(BLA_VENDOR STREQUAL "Generic" OR + BLA_VENDOR STREQUAL "ATLAS" OR + BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "lapack" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + if(NOT LAPACK_LIBRARIES AND NOT WIN32) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "lapack;m;gfortran" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() +else() + message(STATUS "LAPACK requires BLAS") +endif() + +if(BLA_F95) + if(LAPACK95_LIBRARIES) + set(LAPACK95_FOUND TRUE) + else() + set(LAPACK95_FOUND FALSE) + endif() + if(NOT LAPACK_FIND_QUIETLY) + if(LAPACK95_FOUND) + message(STATUS "A library with LAPACK95 API found.") + else() + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR + "A required library with LAPACK95 API not found. Please specify library location." + ) + else() + message(STATUS + "A library with LAPACK95 API not found. Please specify library location." + ) + endif() + endif() + endif() + set(LAPACK_FOUND "${LAPACK95_FOUND}") + set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") +else() + if(LAPACK_LIBRARIES) + set(LAPACK_FOUND TRUE) + else() + set(LAPACK_FOUND FALSE) + endif() + + if(NOT LAPACK_FIND_QUIETLY) + if(LAPACK_FOUND) + message(STATUS "A library with LAPACK API found.") + else() + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR + "A required library with LAPACK API not found. Please specify library location." + ) + else() + message(STATUS + "A library with LAPACK API not found. Please specify library location." + ) + endif() + endif() + endif() +endif() + +# On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines) +# we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above. +if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + set(LAPACK_LIBRARIES "") +endif() + +if(NOT TARGET LAPACK::LAPACK) + add_library(LAPACK::LAPACK INTERFACE IMPORTED) + set(_lapack_libs "${LAPACK_LIBRARIES}") + if(_lapack_libs AND TARGET BLAS::BLAS) + # remove the ${BLAS_LIBRARIES} from the interface and replace it + # with the BLAS::BLAS target + list(REMOVE_ITEM _lapack_libs "${BLAS_LIBRARIES}") + endif() + + if(_lapack_libs) + set_target_properties(LAPACK::LAPACK PROPERTIES + INTERFACE_LINK_LIBRARIES "${_lapack_libs}" + ) + endif() + unset(_lapack_libs) +endif() + +cmake_pop_check_state() diff --git a/ports/lapack-reference/portfile.cmake b/ports/lapack-reference/portfile.cmake new file mode 100644 index 00000000000000..11655858c9d384 --- /dev/null +++ b/ports/lapack-reference/portfile.cmake @@ -0,0 +1,143 @@ +#TODO: Features to add: +# USE_XBLAS??? extended precision blas. needs xblas +# LAPACKE should be its own PORT +# USE_OPTIMIZED_LAPACK (Probably not what we want. Does a find_package(LAPACK): probably for LAPACKE only builds _> own port?) +# LAPACKE Builds LAPACKE +# LAPACKE_WITH_TMG Build LAPACKE with tmglib routines +if(EXISTS "${CURRENT_INSTALLED_DIR}/share/clapack/copyright") + message(FATAL_ERROR "Can't build ${PORT} if clapack is installed. Please remove clapack:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again.") +endif() + +include(vcpkg_find_fortran) +SET(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +set(lapack_ver 3.8.0) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Reference-LAPACK/lapack" + REF "v${lapack_ver}" + SHA512 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f + HEAD_REF master +) + +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(ENV{FFLAGS} "$ENV{FFLAGS} -fPIC") +endif() + +set(CBLAS OFF) +if("cblas" IN_LIST FEATURES) + set(CBLAS ON) + if("noblas" IN_LIST FEATURES) + message(FATAL_ERROR "Cannot built feature 'cblas' together with feature 'noblas'. cblas requires blas!") + endif() +endif() + +set(USE_OPTIMIZED_BLAS OFF) +if("noblas" IN_LIST FEATURES) + set(USE_OPTIMIZED_BLAS ON) + set(pcfile "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/openblas.pc") + if(EXISTS "${pcfile}") + file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) + endif() + set(pcfile "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig/openblas.pc") + if(EXISTS "${pcfile}") + file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) + endif() +endif() + +set(VCPKG_CRT_LINKAGE_BACKUP ${VCPKG_CRT_LINKAGE}) +vcpkg_find_fortran(FORTRAN_CMAKE) +if(VCPKG_USE_INTERNAL_Fortran) + if(VCPKG_CRT_LINKAGE_BACKUP STREQUAL static) + # If openblas has been built with static crt linkage we cannot use it with gfortran! + set(USE_OPTIMIZED_BLAS OFF) + #Cannot use openblas from vcpkg if we are building with gfortran here. + if("noblas" IN_LIST FEATURES) + message(FATAL_ERROR "Feature 'noblas' cannot be used without supplying an external fortran compiler") + endif() + endif() +else() + set(USE_OPTIMIZED_BLAS ON) +endif() +vcpkg_configure_cmake( + PREFER_NINJA + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + "-DUSE_OPTIMIZED_BLAS=${USE_OPTIMIZED_BLAS}" + "-DCBLAS=${CBLAS}" + ${FORTRAN_CMAKE} + ) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/lapack-${lapack_ver}) #Should the target path be lapack and not lapack-reference? + +set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/lapack.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") +endif() +set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/lapack.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") +endif() +if(NOT USE_OPTIMIZED_BLAS) + set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() + set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() +endif() +if("cblas" IN_LIST FEATURES) + set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/cblas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() + set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/cblas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() +endif() +vcpkg_fixup_pkgconfig() + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +# remove debug includes +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_TARGET_IS_WINDOWS) + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/lib/lapack.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/lapack.lib") + endif() + if(NOT USE_OPTIMIZED_BLAS) + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libblas.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/lib/blas.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/blas.lib") + endif() + endif() +endif() + +if(NOT VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) +endif() diff --git a/ports/lapack-reference/vcpkg-cmake-wrapper.cmake b/ports/lapack-reference/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..b3a7128fff0150 --- /dev/null +++ b/ports/lapack-reference/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,11 @@ +message(STATUS "Using VCPKG FindLAPACK from package 'lapack-reference'") +set(LAPACK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +list(REMOVE_ITEM ARGS "NO_MODULE") +list(REMOVE_ITEM ARGS "CONFIG") +list(REMOVE_ITEM ARGS "MODULE") + +_find_package(${ARGS}) + +set(CMAKE_MODULE_PATH ${LAPACK_PREV_MODULE_PATH}) diff --git a/ports/lapack/CMakeLists.txt b/ports/lapack/CMakeLists.txt new file mode 100644 index 00000000000000..07b2818b1a4a97 --- /dev/null +++ b/ports/lapack/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.17) + +project(Find_LAPACK_external) +find_package(LAPACK REQUIRED) +#TODO make sure that the found LAPACK is outside VCPKG \ No newline at end of file diff --git a/ports/lapack/CONTROL b/ports/lapack/CONTROL new file mode 100644 index 00000000000000..aad8e3cf826243 --- /dev/null +++ b/ports/lapack/CONTROL @@ -0,0 +1,4 @@ +Source: lapack +Version: 3 +Description: Metapackage for packages which provide LAPACK +Build-Depends: clapack(arm&windows), lapack-reference(!arm|!windows) diff --git a/ports/lapack/portfile.cmake b/ports/lapack/portfile.cmake new file mode 100644 index 00000000000000..2a59fa7267d7c2 --- /dev/null +++ b/ports/lapack/portfile.cmake @@ -0,0 +1,5 @@ +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +# Make sure LAPACK can be found +vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR} + OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}") diff --git a/ports/levmar/add-install.patch b/ports/levmar/add-install.patch new file mode 100644 index 00000000000000..d256c77adb41cb --- /dev/null +++ b/ports/levmar/add-install.patch @@ -0,0 +1,11 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cc6789f..d2757f9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,3 +95,6 @@ IF(BUILD_DEMO) + ENDIF(BUILD_DEMO) + + #SUBDIRS(matlab) ++ ++install(TARGETS levmar LIBRARY DESTINATION "lib/") ++install(FILES "${CMAKE_SOURCE_DIR}/levmar.h" DESTINATION "include/levmar/") diff --git a/ports/levmar/portfile.cmake b/ports/levmar/portfile.cmake new file mode 100644 index 00000000000000..020d4252082cd8 --- /dev/null +++ b/ports/levmar/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_fail_port_install(MESSAGE "levmar currently only checked on Windows" + ON_TARGET "OSX" "Linux" "UWP" +) + +vcpkg_download_distfile(ARCHIVE + URLS "http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz" + FILENAME "levmar-2.6.tgz" + SHA512 5b4c64b63be9b29d6ad2df435af86cd2c2e3216313378561a670ac6a392a51bbf1951e96c6b1afb77c570f23dd8e194017808e46929fec2d8d9a7fe6cf37022b +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES add-install.patch # patch just adding the install commands to original CMakeLists.txt +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DHAVE_LAPACK=OFF + -DHAVE_PLASMA=OFF + -DBUILD_DEMO=OFF +) + +vcpkg_install_cmake() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# Handle duplicated debug includes +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/levmar/vcpkg.json b/ports/levmar/vcpkg.json new file mode 100644 index 00000000000000..99c22de7301ad5 --- /dev/null +++ b/ports/levmar/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "levmar", + "version-string": "2.6", + "description": "Levenberg-Marquardt nonlinear least squares optimization algorithm", + "homepage": "http://users.ics.forth.gr/~lourakis/levmar/", + "supports": "!(uwp | osx | linux)" +} diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index 0fd8a794802bc3..155b09146e3ab5 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,6 +1,5 @@ Source: libarchive -Version: 3.4.1 -Port-Version: 5 +Version: 3.4.3 Homepage: https://github.com/libarchive/libarchive Description: Library for reading and writing streaming archives Build-Depends: zlib diff --git a/ports/libarchive/disable-c4061.patch b/ports/libarchive/disable-warnings.patch similarity index 53% rename from ports/libarchive/disable-c4061.patch rename to ports/libarchive/disable-warnings.patch index e09c9ca6ebf3ca..455939479a04df 100644 --- a/ports/libarchive/disable-c4061.patch +++ b/ports/libarchive/disable-warnings.patch @@ -1,14 +1,14 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 911ae5b..0e12b56 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -151,9 +151,6 @@ IF (MSVC) - ################################################################# - # Set compile flags for debug build. - # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" -- # Enable level 4 C4061: The enumerate has no associated handler in a switch -- # statement. -- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") - # Enable level 4 C4254: A larger bit field was assigned to a smaller bit - # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..d037071 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -155,9 +155,6 @@ IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" +- # Enable level 4 C4062: The enumerate has no associated handler in a switch +- # statement and there is no default that can catch it. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14062") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14254") diff --git a/ports/libarchive/fix-buildsystem.patch b/ports/libarchive/fix-buildsystem.patch index 51dbbf2ec1ef1c..9ed57f6f1041bf 100644 --- a/ports/libarchive/fix-buildsystem.patch +++ b/ports/libarchive/fix-buildsystem.patch @@ -1,159 +1,163 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd80b12..6509541 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -148,10 +148,6 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use") - ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$") - IF (MSVC) -- if (ENABLE_WERROR) -- # /WX option is the same as gcc's -Werror option. -- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") -- endif () - ################################################################# - # Set compile flags for debug build. - # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" -@@ -377,8 +373,6 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") - # Maybe DLL path is "C:/Program Files/GnuWin32/bin". - # The zlib and the bzip2 Setup program have installed programs and DLLs into - # "C:/Program Files/GnuWin32" by default. -- # This is convenience setting for Windows. -- SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) - # - # If you didn't use Setup program or installed into nonstandard path, - # cmake cannot find out your zlib or bzip2 libraries and include files, -@@ -415,14 +409,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) -@@ -482,8 +469,6 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -- SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) - # Test if a macro is needed for the library. -@@ -1327,7 +1312,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1359,11 +1344,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1375,10 +1360,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -@@ -1419,9 +1404,13 @@ CHECK_C_SOURCE_COMPILES( - "#include \nint main() { return major(256); }" - MAJOR_IN_SYSMACROS) - -+CMAKE_PUSH_CHECK_STATE() -+SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - CHECK_C_SOURCE_COMPILES( - "#include \n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}" - HAVE_LZMA_STREAM_ENCODER_MT) -+CMAKE_POP_CHECK_STATE() - - IF(HAVE_STRERROR_R) - SET(HAVE_DECL_STRERROR_R 1) -@@ -1977,13 +1966,10 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in - INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - ADD_DEFINITIONS(-DHAVE_CONFIG_H) - --# Handle generation of the libarchive.pc file for pkg-config --INCLUDE(CreatePkgConfigFile) -- - # - # Register installation of PDF documents. - # --IF(WIN32 AND NOT CYGWIN) -+IF(0) - # - # On Windows platform, It's better that we install PDF documents - # on one's computer. -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ec775bb..d63ac7c 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -235,28 +235,22 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library --ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) -+ADD_LIBRARY(archive ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) --SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) -- --# archive_static is a static library --ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) --TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) --SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS -+IF(BUILD_SHARED_LIBS) -+ SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) -+ELSE() -+ SET_TARGET_PROPERTIES(archive PROPERTIES COMPILE_DEFINITIONS - LIBARCHIVE_STATIC) --# On Posix systems, libarchive.so and libarchive.a can co-exist. --IF(NOT WIN32 OR CYGWIN) -- SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) --ENDIF(NOT WIN32 OR CYGWIN) -+ENDIF() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ INSTALL(TARGETS archive - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -- INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..6a1dc1f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -148,10 +148,6 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use") + ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$") + IF (MSVC) +- if (ENABLE_WERROR) +- # /WX option is the same as gcc's -Werror option. +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") +- endif () + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" +@@ -382,8 +378,6 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # Maybe DLL path is "C:/Program Files/GnuWin32/bin". + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. +- # This is convenience setting for Windows. +- SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, +@@ -420,14 +414,7 @@ IF(ZLIB_FOUND) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) +- # +- # Test if ZLIB_WINAPI macro is needed to use. +- # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) +@@ -487,8 +474,6 @@ IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() +- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) +- SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) + # Test if a macro is needed for the library. +@@ -1356,7 +1341,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1388,11 +1373,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1405,10 +1390,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + +@@ -1449,6 +1434,9 @@ CHECK_C_SOURCE_COMPILES( + "#include \nint main() { return major(256); }" + MAJOR_IN_SYSMACROS) + ++CMAKE_PUSH_CHECK_STATE() ++SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) ++SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + IF(ENABLE_LZMA) + CHECK_C_SOURCE_COMPILES( + "#include \n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}" +@@ -1456,6 +1444,7 @@ CHECK_C_SOURCE_COMPILES( + ELSE() + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) + ENDIF(ENABLE_LZMA) ++CMAKE_POP_CHECK_STATE() + + IF(HAVE_STRERROR_R) + SET(HAVE_DECL_STRERROR_R 1) +@@ -2012,13 +2001,10 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + ADD_DEFINITIONS(-DHAVE_CONFIG_H) + +-# Handle generation of the libarchive.pc file for pkg-config +-INCLUDE(CreatePkgConfigFile) +- + # + # Register installation of PDF documents. + # +-IF(WIN32 AND NOT CYGWIN) ++IF(0) + # + # On Windows platform, It's better that we install PDF documents + # on one's computer. +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index 9389bbc..0793d96 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -236,28 +236,22 @@ ELSEIF(ARCHIVE_ACL_SUNOS) + ENDIF() + + # Libarchive is a shared library +-ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) ++ADD_LIBRARY(archive ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) + TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) +-SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) +- +-# archive_static is a static library +-ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) +-TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +-SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS ++IF(BUILD_SHARED_LIBS) ++ SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) ++ELSE() ++ SET_TARGET_PROPERTIES(archive PROPERTIES COMPILE_DEFINITIONS + LIBARCHIVE_STATIC) +-# On Posix systems, libarchive.so and libarchive.a can co-exist. +-IF(NOT WIN32 OR CYGWIN) +- SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) +-ENDIF(NOT WIN32 OR CYGWIN) ++ENDIF() + + IF(ENABLE_INSTALL) + # How to install the libraries +- INSTALL(TARGETS archive archive_static ++ INSTALL(TARGETS archive + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() + diff --git a/ports/libarchive/fix-dependencies.patch b/ports/libarchive/fix-dependencies.patch index 2a18d55a5ed320..1e511b823cad4b 100644 --- a/ports/libarchive/fix-dependencies.patch +++ b/ports/libarchive/fix-dependencies.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 61c3b2a..c47b5b4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -783,7 +783,7 @@ main(int argc, char **argv) - IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) -- LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) -+ #LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) - ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) - ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..8608efc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -914,7 +914,7 @@ main(int argc, char **argv) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) +- LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) ++ #LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) diff --git a/ports/libarchive/fix-lz4.patch b/ports/libarchive/fix-lz4.patch index 163e55ed0e0c1e..84b6b2d39da2a2 100644 --- a/ports/libarchive/fix-lz4.patch +++ b/ports/libarchive/fix-lz4.patch @@ -1,16 +1,16 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 80871bc9..2a16dc70 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -517,7 +517,10 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY_DEBUG NAMES lz4d liblz4d) -+ FIND_LIBRARY(LZ4_LIBRARY_RELEASE NAMES lz4 liblz4) -+ INCLUDE(SelectLibraryConfigurations) -+ SELECT_LIBRARY_CONFIGURATIONS(LZ4) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..3b6da5d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -574,7 +574,10 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY_DEBUG NAMES lz4d liblz4d) ++ FIND_LIBRARY(LZ4_LIBRARY_RELEASE NAMES lz4 liblz4) ++ INCLUDE(SelectLibraryConfigurations) ++ SELECT_LIBRARY_CONFIGURATIONS(LZ4) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) diff --git a/ports/libarchive/fix-zstd.patch b/ports/libarchive/fix-zstd.patch index 5c3b6cd54005fd..8f28979811445c 100644 --- a/ports/libarchive/fix-zstd.patch +++ b/ports/libarchive/fix-zstd.patch @@ -1,28 +1,16 @@ -From 9397ed51eddf43481d5710eb80441ce4a64356ea Mon Sep 17 00:00:00 2001 -From: Julian Scholle -Date: Fri, 11 Oct 2019 16:46:06 +0200 -Subject: [PATCH] test - ---- - CMakeLists.txt | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 13da432..911ae5b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -588,7 +588,10 @@ IF(ENABLE_ZSTD) - ENDIF (ZSTD_INCLUDE_DIR) - - FIND_PATH(ZSTD_INCLUDE_DIR zstd.h) -- FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd) -+ FIND_LIBRARY(ZSTD_LIBRARY_DEBUG NAMES zstdd libzstdd) -+ FIND_LIBRARY(ZSTD_LIBRARY_RELEASE NAMES zstd libzstd) -+ INCLUDE(SelectLibraryConfigurations) -+ SELECT_LIBRARY_CONFIGURATIONS(ZSTD) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR) - ELSE(ENABLE_ZSTD) --- -2.16.1.windows.1 - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..e43b041 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -605,7 +605,10 @@ IF(ENABLE_ZSTD) + ENDIF (ZSTD_INCLUDE_DIR) + + FIND_PATH(ZSTD_INCLUDE_DIR zstd.h) +- FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd) ++ FIND_LIBRARY(ZSTD_LIBRARY_DEBUG NAMES zstdd libzstdd) ++ FIND_LIBRARY(ZSTD_LIBRARY_RELEASE NAMES zstd libzstd) ++ INCLUDE(SelectLibraryConfigurations) ++ SELECT_LIBRARY_CONFIGURATIONS(ZSTD) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR) + ELSE(ENABLE_ZSTD) diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index a9bb4955cf764c..bf9fb71e372543 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libarchive/libarchive - REF cce09646b566c61c2debff58a70da780b8457883 - SHA512 3eef6844269ecb9c3b7c848013539529e6ef2d298b6ca6c3c939a2a2e39da98db36bd66eea8893224bc4318edc073639136fbca71b2b0bec65216562e8188749 + REF fc6563f5130d8a7ee1fc27c0e55baef35119f26c #v3.4.3 + SHA512 54ca4f3cc3b38dcf6588b2369ce43109c4a57a04061348ab8bf046c5c13ace0c4f42c9f3961288542cb5fe12c05359d572b39fe7cec32a10151dbac78e8a3707 HEAD_REF master PATCHES fix-buildsystem.patch @@ -12,7 +12,7 @@ vcpkg_from_github( fix-lz4.patch fix-zstd.patch fix-cpu-set.patch - disable-c4061.patch + disable-warnings.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/libass/CMakeLists.txt b/ports/libass/CMakeLists.txt index 32d7ef097d3a5c..aacf89d86b0b75 100644 --- a/ports/libass/CMakeLists.txt +++ b/ports/libass/CMakeLists.txt @@ -7,18 +7,30 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -# This is Windows-specific. Other acceptable values on different platforms should be -# macOS - CONFIG_CORETEXT -# linux - CONFIG_FONTCONFIG -add_compile_definitions(CONFIG_DIRECTWRITE) +if(WIN32) + add_compile_definitions(CONFIG_DIRECTWRITE) +elseif(APPLE) + add_compile_definitions(CONFIG_CORETEXT) +else() + add_compile_definitions(CONFIG_FONTCONFIG) +endif() + add_compile_definitions(CONFIG_FREETYPE) add_compile_definitions(CONFIG_FRIBIDI) add_compile_definitions(CONFIG_HARFBUZZ) file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/libass/*.c) -list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") -list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +if(WIN32) + list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +elseif(APPLE) + list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +else() + list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") +endif() find_package(Freetype REQUIRED) @@ -30,18 +42,24 @@ find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h PATH_SUFFIXES harfbuzz) -find_library(FRIBIDI_LIBRARY NAMES fribidi) +find_path(DIRENT_INCLUDE_DIR + NAMES dirent.h) + +find_library(FRIBIDI_LIBRARY NAMES libfribidi fribidi) find_library(HARFBUZZ_LIBRARY NAMES harfbuzz) add_library(ass ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/libass.def) -target_include_directories(ass PRIVATE - ${FRIBIDI_INCLUDE_DIR} +target_include_directories(ass PRIVATE + ${FRIBIDI_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}) - -target_link_libraries(ass PRIVATE - Freetype::Freetype - ${FRIBIDI_LIBRARY} +if(DIRENT_INCLUDE_DIR) + target_include_directories(ass PRIVATE + ${DIRENT_INCLUDE_DIR}) +endif() +target_link_libraries(ass PRIVATE + Freetype::Freetype + ${FRIBIDI_LIBRARY} ${HARFBUZZ_LIBRARY}) install(TARGETS ass diff --git a/ports/libass/CONTROL b/ports/libass/CONTROL deleted file mode 100644 index ea25ea9a189f84..00000000000000 --- a/ports/libass/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: libass -Version: 0.14.0 -Build-Depends: freetype, fribidi, harfbuzz, dirent (windows) -Description: libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. diff --git a/ports/libass/portfile.cmake b/ports/libass/portfile.cmake index 040cadc661dca5..f5ab6606c07ef4 100644 --- a/ports/libass/portfile.cmake +++ b/ports/libass/portfile.cmake @@ -1,6 +1,3 @@ - -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libass/libass @@ -14,9 +11,6 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/libass.def DESTINATION ${SOURCE_PATH}) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libass RENAME copyright) - # Since libass uses automake, make and configure, we use a custom CMake file file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -27,4 +21,7 @@ vcpkg_configure_cmake( PREFER_NINJA) vcpkg_install_cmake() -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libass/vcpkg.json b/ports/libass/vcpkg.json new file mode 100644 index 00000000000000..151d87cdd6a69e --- /dev/null +++ b/ports/libass/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "libass", + "version-string": "0.14.0", + "port-version": 3, + "description": "libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format", + "homepage": "https://github.com/libass/libass", + "dependencies": [ + { + "name": "dirent", + "platform": "windows" + }, + "freetype", + "fribidi", + "harfbuzz" + ] +} diff --git a/ports/libb2/portfile.cmake b/ports/libb2/portfile.cmake index 2401cf0c1e2e62..992c59f4be3eb5 100644 --- a/ports/libb2/portfile.cmake +++ b/ports/libb2/portfile.cmake @@ -14,6 +14,7 @@ if(CMAKE_HOST_WIN32) endif() vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS ${OPTIONS} ) diff --git a/ports/libb2/vcpkg.json b/ports/libb2/vcpkg.json index 1d2f19db823e96..dbe8dc265e8ed7 100644 --- a/ports/libb2/vcpkg.json +++ b/ports/libb2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libb2", "version-string": "0.98.1", - "port-version": 3, + "port-version": 4, "description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp", "homepage": "https://github.com/BLAKE2/libb2", "supports": "!windows" diff --git a/ports/libcrafter/CONTROL b/ports/libcrafter/CONTROL index b8ebac0bf72624..47538dae935abe 100644 --- a/ports/libcrafter/CONTROL +++ b/ports/libcrafter/CONTROL @@ -1,5 +1,6 @@ Source: libcrafter -Version: 0.3-1 +Version: 0.3 +Port-Version: 2 Homepage: https://github.com/pellegre/libcrafter Description: Libcrafter is a high level library for C++ designed to create and decode network packets. -Build-Depends: libpcap \ No newline at end of file +Build-Depends: libpcap diff --git a/ports/libcrafter/portfile.cmake b/ports/libcrafter/portfile.cmake index 9965b7d3c9f0e9..565a0c3462a575 100644 --- a/ports/libcrafter/portfile.cmake +++ b/ports/libcrafter/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH libcrafter OPTIONS diff --git a/ports/libde265/CONTROL b/ports/libde265/CONTROL new file mode 100644 index 00000000000000..09ab2f2318147f --- /dev/null +++ b/ports/libde265/CONTROL @@ -0,0 +1,5 @@ +Source: libde265 +Version: 1.0.5 +Homepage: https://www.libde265.org/ +Description: Open h.265 video codec implementation. +Supports: !(arm|uwp) diff --git a/ports/libde265/portfile.cmake b/ports/libde265/portfile.cmake new file mode 100644 index 00000000000000..70cfe2e3015b32 --- /dev/null +++ b/ports/libde265/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO strukturag/libde265 + REF v1.0.5 + SHA512 3ff7310fc4621cac0ef1cb9bbc4df61724f8943d57f5263a3663a77f4d90d84716b2a708ee9fec306e909dc8b5e7fe645a641b6a6db795a89a01799be910831e + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libde265/) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index daf330e83442ef..93d1aede793073 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,5 +1,6 @@ Source: libepoxy Version: 1.5.4 +Port-Version: 1 Homepage: https://github.com/anholt/libepoxy Description: Epoxy is a library for handling OpenGL function pointer management for you Build-Depends: tool-meson diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index 69482f9c227c9a..caaa02ab200522 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -11,8 +11,7 @@ vcpkg_from_github( libepoxy-1.5.4_Add_call_convention_to_mock_function.patch ) - -if (VCPKG_TARGET_IS_WINDOWS) +if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX) vcpkg_configure_meson(SOURCE_PATH ${SOURCE_PATH} OPTIONS -Denable-glx=no @@ -24,7 +23,7 @@ else() if (NOT autoreconf OR NOT EXISTS "/usr/share/doc/libgles2/copyright") message(FATAL_ERROR "autoreconf and libgles2-mesa-dev must be installed before libepoxy can build. Install them with \"apt-get install dh-autoreconf libgles2-mesa-dev\".") endif() - + find_program(MAKE make) if (NOT MAKE) message(FATAL_ERROR "MAKE not found") @@ -32,34 +31,34 @@ else() file(REMOVE_RECURSE ${SOURCE_PATH}/m4) file(MAKE_DIRECTORY ${SOURCE_PATH}/m4) - + set(LIBEPOXY_CONFIG_ARGS "--enable-x11=yes --enable-glx=yes --enable-egl=yes") - + vcpkg_execute_required_process( COMMAND "autoreconf" -v --install WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME autoreconf-${TARGET_TRIPLET} ) - + message(STATUS "Configuring ${TARGET_TRIPLET}") set(OUT_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/make-build-${TARGET_TRIPLET}-release) - + file(REMOVE_RECURSE ${OUT_PATH_RELEASE}) file(MAKE_DIRECTORY ${OUT_PATH_RELEASE}) - + vcpkg_execute_required_process( COMMAND "./configure" --prefix=${OUT_PATH_RELEASE} "${LIBEPOXY_CONFIG_ARGS}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME config-${TARGET_TRIPLET} ) - + message(STATUS "Building ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-release ) - + message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make install diff --git a/ports/libevent/CONTROL b/ports/libevent/CONTROL index 4df532990ce45d..fd98e588a12ddd 100644 --- a/ports/libevent/CONTROL +++ b/ports/libevent/CONTROL @@ -1,5 +1,5 @@ Source: libevent -Version: 2.1.11-5 +Version: 2.1.12 Homepage: https://github.com/libevent/libevent Description: An event notification library Supports: !uwp diff --git a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch index b444ae3e724047..9566f152cc4b27 100644 --- a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch +++ b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch @@ -1,13 +1,13 @@ diff --git a/cmake/LibeventConfig.cmake.in b/cmake/LibeventConfig.cmake.in -index 5422336..d436100 100644 +index 7b808c3..fbf67be 100644 --- a/cmake/LibeventConfig.cmake.in +++ b/cmake/LibeventConfig.cmake.in -@@ -8,7 +8,7 @@ +@@ -58,7 +58,7 @@ endif() + + # Get the path of the current file. get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - - # Set the include directories. --set(LIBEVENT_INCLUDE_DIRS "@EVENT_INSTALL_INCLUDE_DIR@") -+set(LIBEVENT_INCLUDE_DIRS "${LIBEVENT_CMAKE_DIR}/../../include") - - # Include the project Targets file, this contains definitions for IMPORTED targets. - include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake) +-get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE) ++get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../.." ABSOLUTE) + + macro(message_if_needed _flag _msg) + if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) diff --git a/ports/libevent/fix-crt_linkage.patch b/ports/libevent/fix-crt_linkage.patch deleted file mode 100644 index b766b455652ced..00000000000000 --- a/ports/libevent/fix-crt_linkage.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bf333f3..5bc2a54 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -230,7 +230,7 @@ endif() - - if (${MSVC}) - set(msvc_static_runtime OFF) -- if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC") -+ if ("${VCPKG_CRT_LINKAGE}" STREQUAL "STATIC") - set(msvc_static_runtime ON) - endif() - diff --git a/ports/libevent/fix-file_path.patch b/ports/libevent/fix-file_path.patch index 179700b7ed2c17..fb34080f8790d8 100644 --- a/ports/libevent/fix-file_path.patch +++ b/ports/libevent/fix-file_path.patch @@ -1,26 +1,22 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6e91c08..44b6e18 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1430,7 +1430,7 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in - # Calculate the relative directory from the Cmake dir. - file(RELATIVE_PATH - REL_INCLUDE_DIR -- "${EVENT_INSTALL_CMAKE_DIR}" -+ "${CURRENT_PACKAGES_DIR}/${EVENT_INSTALL_CMAKE_DIR}" - "${CMAKE_INSTALL_PREFIX}/include") - - # Note the LIBEVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in, diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake -index 9de4484..411ca9d 100644 +index 04f5837..95d9808 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake -@@ -113,7 +113,7 @@ macro(add_event_library LIB_NAME) - EXPORT LibeventTargets - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib -- RUNTIME DESTINATION "lib" COMPONENT lib -+ RUNTIME DESTINATION "bin" COMPONENT bin - PUBLIC_HEADER DESTINATION "include/event2" - COMPONENT dev - ) +@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + install(TARGETS "${LIB_NAME}_${TYPE}" + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT bin + COMPONENT dev + ) + else() +@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + EXPORT LibeventTargets-${TYPE} + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT bin + COMPONENT dev + ) + endif() diff --git a/ports/libevent/portfile.cmake b/ports/libevent/portfile.cmake index bd44d8428a5a45..9865cecea3faae 100644 --- a/ports/libevent/portfile.cmake +++ b/ports/libevent/portfile.cmake @@ -3,11 +3,10 @@ vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP" ON_TARG vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libevent/libevent - REF release-2.1.11-stable - SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02 + REF release-2.1.12-stable + SHA512 5d6c6f0072f69a68b190772d4c973ce8f33961912032cdc104ad0854c0950f9d7e28bc274ca9df23897937f0cd8e45d1f214543d80ec271c5a6678814a7f195e PATCHES fix-file_path.patch - fix-crt_linkage.patch fix-LibeventConfig_cmake_in_path.patch ) @@ -23,13 +22,18 @@ else() set(LIBEVENT_LIB_TYPE STATIC) endif() +if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(LIBEVENT_STATIC_RUNTIME ON) +else() + set(LIBEVENT_STATIC_RUNTIME OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} - -DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent -DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE} - -DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE} + -DEVENT__MSVC_STATIC_RUNTIME=${LIBEVENT_STATIC_RUNTIME} -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_REGRESS=ON @@ -38,20 +42,28 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent) -else () - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libevent/) file(RENAME ${CURRENT_PACKAGES_DIR}/bin/event_rpcgen.py ${CURRENT_PACKAGES_DIR}/tools/libevent/event_rpcgen.py) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() +set(_target_suffix) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(_target_suffix static) +else() + set(_target_suffix shared) +endif() +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/libevent/LibeventTargets-${_target_suffix}.cmake + "${CURRENT_PACKAGES_DIR}" + "${CURRENT_INSTALLED_DIR}" +) + vcpkg_copy_pdbs() #Handle copyright diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt index d7c741859a1165..693fcc93584cd2 100644 --- a/ports/libffi/CMakeLists.txt +++ b/ports/libffi/CMakeLists.txt @@ -11,7 +11,7 @@ endif() # config variables for ffi.h.in set(VERSION 3.3) -set(KNOWN_PROCESSORS x86 x86_64 AMD64 ARM ARM64 i386) +set(KNOWN_PROCESSORS x86 x86_64 AMD64 ARM ARM64 i386 armv7l aarch64) if(NOT CMAKE_SYSTEM_PROCESSOR IN_LIST KNOWN_PROCESSORS) message(FATAL_ERROR "Unknown processor: ${CMAKE_SYSTEM_PROCESSOR}") @@ -19,6 +19,10 @@ endif() if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM") set(TARGET ARM) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l") + set(TARGET ARM) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(TARGET ARM64) elseif(CMAKE_SYSTEM_NAME MATCHES "BSD" AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(TARGET X86_FREEBSD) elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") @@ -50,9 +54,9 @@ set(FFI_EXEC_TRAMPOLINE_TABLE 0) configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h) file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR}) -if ("${TARGET}" STREQUAL "ARM_WIN64") +if ("${TARGET}" STREQUAL "ARM_WIN64" OR "${TARGET}" STREQUAL "ARM64") file(COPY src/aarch64/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) -elseif ("${TARGET}" STREQUAL "ARM_WIN32") +elseif ("${TARGET}" STREQUAL "ARM_WIN32" OR "${TARGET}" STREQUAL "ARM") file(COPY src/arm/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) else() file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) @@ -72,11 +76,11 @@ set(FFI_SOURCES src/prep_cif.c src/types.c) -if ("${TARGET}" STREQUAL "ARM_WIN64") +if ("${TARGET}" STREQUAL "ARM_WIN64" OR "${TARGET}" STREQUAL "ARM64") set(FFI_SOURCES ${FFI_SOURCES} src/aarch64/ffi.c) -elseif("${TARGET}" STREQUAL "ARM_WIN32") +elseif("${TARGET}" STREQUAL "ARM_WIN32" OR "${TARGET}" STREQUAL "ARM") set(FFI_SOURCES ${FFI_SOURCES} src/arm/ffi.c) @@ -162,8 +166,12 @@ elseif("${TARGET}" STREQUAL "X86_WIN64") add_assembly(src/x86/win64_intel.S) elseif("${TARGET}" STREQUAL "ARM_WIN32") add_assembly(src/arm/sysv_msvc_arm32.S) +elseif("${TARGET}" STREQUAL "ARM") + add_assembly(src/arm/sysv.S) elseif("${TARGET}" STREQUAL "ARM_WIN64") add_assembly(src/aarch64/win64_armasm.S) +elseif("${TARGET}" STREQUAL "ARM64") + add_assembly(src/aarch64/sysv.S) else() message(FATAL_ERROR "Target not implemented") endif() diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 95dfbeb56ea68c..6f1154eda4f2f9 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,4 +1,5 @@ Source: libffi -Version: 3.3-3 +Version: 3.3 +Port-Version: 5 Homepage: https://github.com/libffi/libffi Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 3033319249ce1a..7748d1cb63ca2e 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -6,6 +6,9 @@ vcpkg_from_github( REF v3.3 SHA512 62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83 HEAD_REF master + PATCHES + win64-disable-stackframe-check.patch + win32-disable-stackframe-check.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libffi/win32-disable-stackframe-check.patch b/ports/libffi/win32-disable-stackframe-check.patch new file mode 100644 index 00000000000000..8fdca8b011ff19 --- /dev/null +++ b/ports/libffi/win32-disable-stackframe-check.patch @@ -0,0 +1,50 @@ +Rolf Gebhardt +22 Jul 2020 +[PATCH] x86/win32: disable runtime stack frame checks with msvc + around built assembly + +based on the patch for x86/win64: + +From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Fri, 16 Mar 2018 15:10:04 +1100 +Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc + around built assembly + +MSVC can add truntime code that checks if a stack frame is mismanaged +however our custom assembly delibrately accesses and modifies the parent +stack frame. Fortunately we can disable that specific check for the +function call so do that. +--- + src/x86/ffi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/x86/ffi.c b/src/x86/ffi.c +index 9a59218..9f5d703 100644 +--- a/src/x86/ffi.c ++++ b/src/x86/ffi.c +@@ -255,6 +255,14 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = { + + extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; + ++/* we perform some black magic here to use some of the parent's ++ * stack frame in ff_call_win() that breaks with the msvc compiler ++ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time ++ * error checking' for this function so we don't hit weird exceptions ++ * in debug builds */ ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", off) ++#endif + static void + ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +@@ -390,6 +398,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + + ffi_call_i386 (frame, stack); + } ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", restore) ++#endif + + void + ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libffi/win64-disable-stackframe-check.patch b/ports/libffi/win64-disable-stackframe-check.patch new file mode 100644 index 00000000000000..ce3d3ca5574009 --- /dev/null +++ b/ports/libffi/win64-disable-stackframe-check.patch @@ -0,0 +1,43 @@ +From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Fri, 16 Mar 2018 15:10:04 +1100 +Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc + around built assembly + +MSVC can add truntime code that checks if a stack frame is mismanaged +however our custom assembly delibrately accesses and modifies the parent +stack frame. Fortunately we can disable that specific check for the +function call so do that. +--- + src/x86/ffiw64.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/x86/ffiw64.c b/src/x86/ffiw64.c +index f7875252..88bb3a34 100644 +--- a/src/x86/ffiw64.c ++++ b/src/x86/ffiw64.c +@@ -106,6 +106,14 @@ EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) + return FFI_OK; + } + ++/* we perform some black magic here to use some of the parent's ++ * stack frame in ff_call_win64() that breaks with the msvc compiler ++ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time ++ * error checking' for this function so we don't hit weird exceptions ++ * in debug builds */ ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", off) ++#endif + static void + ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +@@ -170,6 +178,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + + ffi_call_win64 (stack, frame, closure); + } ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", restore) ++#endif + + void + EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 745494c7705fed..696e9fffb2ed5d 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,5 +1,6 @@ Source: libflac -Version: 1.3.3-1 +Version: 1.3.3 +Port-Version: 3 Homepage: https://xiph.org/flac/ Description: Library for manipulating FLAC files Build-Depends: libogg diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 72309d9bbaf900..36f7b997ee7612 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -9,6 +9,20 @@ vcpkg_from_github( "${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(BUILD_SHARED_LIBS ON) +else() + set(BUILD_SHARED_LIBS OFF) +endif() + +if(VCPKG_TARGET_IS_MINGW) + set(WITH_STACK_PROTECTOR OFF) + string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0") + string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0") +else() + set(WITH_STACK_PROTECTOR ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -16,7 +30,9 @@ vcpkg_configure_cmake( -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF - -DBUILD_TESTING=OFF) + -DBUILD_TESTING=OFF + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + -DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR}) vcpkg_install_cmake() vcpkg_fixup_cmake_targets( @@ -28,7 +44,26 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + "#if defined(FLAC__NO_DLL)" + "#if 0" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + "#if defined(FLAC__NO_DLL)" + "#if 0" + ) +else() + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + "#if defined(FLAC__NO_DLL)" + "#if 1" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + "#if defined(FLAC__NO_DLL)" + "#if 1" + ) +endif() + # This license (BSD) is relevant only for library - if someone would want to install # FLAC cmd line tools as well additional license (GPL) should be included -file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libfreenect2/CONTROL b/ports/libfreenect2/CONTROL index b24480c83d768f..3618d2a7395a56 100644 --- a/ports/libfreenect2/CONTROL +++ b/ports/libfreenect2/CONTROL @@ -1,5 +1,6 @@ Source: libfreenect2 -Version: 0.2.0-4 +Version: 0.2.0 +Port-Version: 5 Build-Depends: libusb, libjpeg-turbo Homepage: https://github.com/OpenKinect/libfreenect2 Description: Open source drivers for the Kinect for Windows v2 device diff --git a/ports/libfreenect2/fix-dependency-libusb.patch b/ports/libfreenect2/fix-dependency-libusb.patch new file mode 100644 index 00000000000000..a5de8f3bee1940 --- /dev/null +++ b/ports/libfreenect2/fix-dependency-libusb.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1e0d192..aedc576 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -90,7 +90,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + + # dependencies + FIND_PACKAGE(PkgConfig) # try find PKGConfig as it will be used if found +-FIND_PACKAGE(LibUSB REQUIRED) ++FIND_PACKAGE(libusb CONFIG REQUIRED) + + # Add includes + INCLUDE_DIRECTORIES( +@@ -98,7 +98,7 @@ INCLUDE_DIRECTORIES( + "${MY_DIR}/include/internal" + ${PROJECT_BINARY_DIR} # for generated headers + ${LIBFREENECT2_THREADING_INCLUDE_DIR} +- ${LibUSB_INCLUDE_DIRS} ++ ${LIBUSB_INCLUDE_DIRS} + ) + + SET(RESOURCES_INC_FILE "${PROJECT_BINARY_DIR}/resources.inc.h") +@@ -154,7 +154,7 @@ SET(SOURCES + ) + + SET(LIBRARIES +- ${LibUSB_LIBRARIES} ++ ${LIBUSB_LIBRARIES} + ${LIBFREENECT2_THREADING_LIBRARIES} + ) + diff --git a/ports/libfreenect2/portfile.cmake b/ports/libfreenect2/portfile.cmake index ff1ef220b37578..3405097713e604 100644 --- a/ports/libfreenect2/portfile.cmake +++ b/ports/libfreenect2/portfile.cmake @@ -1,11 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OpenKinect/libfreenect2 REF v0.2.0 SHA512 3525e3f21462cecd3b198f64545786ffddc2cafdfd8146e5a46f0300b83f29f1ad0739618a07ab195c276149d7e2e909f7662e2d379a2880593cac75942b0666 HEAD_REF master + PATCHES fix-dependency-libusb.patch ) file(READ ${SOURCE_PATH}/cmake_modules/FindLibUSB.cmake FINDLIBUSB) @@ -34,16 +33,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freenect2) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freenect2 TARGET_PATH share/freenect2) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# The cmake config is actually called freenect2Config.cmake instead of libfreenect2Config.cmake ... -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libfreenect2 ${CURRENT_PACKAGES_DIR}/share/freenect2) - -# license file needs to be in share/libfreenect2 otherwise vcpkg will complain -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/libfreenect2/) -file(COPY ${SOURCE_PATH}/GPL2 DESTINATION ${CURRENT_PACKAGES_DIR}/share/libfreenect2/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libfreenect2/GPL2 ${CURRENT_PACKAGES_DIR}/share/libfreenect2/copyright) +file(INSTALL ${SOURCE_PATH}/GPL2 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libftdi1/CONTROL b/ports/libftdi1/CONTROL index d282ad9eb8d28a..daab99f1793d30 100644 --- a/ports/libftdi1/CONTROL +++ b/ports/libftdi1/CONTROL @@ -1,4 +1,4 @@ Source: libftdi1 -Version: 1.4 +Version: 1.4-1 Build-Depends: libusb Description: FTDI USB driver with bitbang mode (v1.4) diff --git a/ports/libftdi1/portfile.cmake b/ports/libftdi1/portfile.cmake index 4007e91220b3f5..e05ccca2064556 100644 --- a/ports/libftdi1/portfile.cmake +++ b/ports/libftdi1/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.4.tar.bz2" FILENAME "libftdi1-1.4.tar.bz2" @@ -26,7 +24,6 @@ vcpkg_configure_cmake( -DEXAMPLES=OFF -DPYTHON_BINDINGS=OFF -DLINK_PYTHON_LIBRARY=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON -DCMAKE_DISABLE_FIND_PACKAGE_Confuse=ON @@ -41,7 +38,10 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libftdi1 TARGET_PATH share/libft file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libftdi1) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libftdi1/LICENSE ${CURRENT_PACKAGES_DIR}/share/libftdi1/copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libgpod/CMakeLists.txt b/ports/libgpod/CMakeLists.txt index 233efc72231f26..ea1294906ee3ae 100644 --- a/ports/libgpod/CMakeLists.txt +++ b/ports/libgpod/CMakeLists.txt @@ -4,7 +4,7 @@ project (libgpod C) option(WITH_INTERNAL_GCHECKSUM OFF) -find_package(sqlite3 CONFIG REQUIRED) +find_package(unofficial-sqlite3 CONFIG REQUIRED) include(SelectLibraryConfigurations) find_path(glib_PATH glib.h PATHS include) @@ -66,7 +66,7 @@ if (WITH_INTERNAL_GCHECKSUM) endif() target_compile_definitions(libgpod PRIVATE -DLIBGPOD_BLOB_DIR=\"${LIBGPOD_BLOB_DIR}\" -DGETTEXT_PACKAGE="libgpod") -target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} sqlite3) +target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} unofficial::sqlite3::sqlite3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/itdb.h DESTINATION include/libgpod/gpod) diff --git a/ports/libgpod/CONTROL b/ports/libgpod/CONTROL index 01134d30349476..2d6fe295cbb868 100644 --- a/ports/libgpod/CONTROL +++ b/ports/libgpod/CONTROL @@ -1,5 +1,6 @@ Source: libgpod Version: 2019-08-29 +Port-Version: 1 Homepage: https://github.com/fadingred/libgpod Description: libgpod is a library meant to abstract access to an iPod content. Build-Depends: glib, libplist, sqlite3 \ No newline at end of file diff --git a/ports/libheif/CONTROL b/ports/libheif/CONTROL new file mode 100644 index 00000000000000..c6dc34356082a4 --- /dev/null +++ b/ports/libheif/CONTROL @@ -0,0 +1,6 @@ +Source: libheif +Version: 1.7.0 +Port-Version: 1 +Homepage: http://www.libheif.org/ +Description: Open h.265 video codec implementation. +Build-Depends: x265, libde265 diff --git a/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch b/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch new file mode 100644 index 00000000000000..78bab905a380dc --- /dev/null +++ b/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4463476..3a5cfbc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,6 +80,6 @@ configure_file(libheif.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-add_subdirectory (examples) ++#add_subdirectory (examples) + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) ++#add_subdirectory (gdk-pixbuf) diff --git a/ports/libheif/install-extra-headers.patch b/ports/libheif/install-extra-headers.patch new file mode 100644 index 00000000000000..eb32ee8a408dab --- /dev/null +++ b/ports/libheif/install-extra-headers.patch @@ -0,0 +1,12 @@ +diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt +index 6d683ec..dc2c4eb 100644 +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -17,6 +17,7 @@ set(libheif_headers + heif_plugin_registry.h + heif_limits.h + heif_plugin.h ++ heif_cxx.h + logging.h + ${CMAKE_CURRENT_BINARY_DIR}/heif_version.h + ) diff --git a/ports/libheif/portfile.cmake b/ports/libheif/portfile.cmake new file mode 100644 index 00000000000000..97068d449bae66 --- /dev/null +++ b/ports/libheif/portfile.cmake @@ -0,0 +1,21 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO strukturag/libheif + REF v1.7.0 + SHA512 7da6ab9daf253c2493e0c3960c6f817e0234dfbd0463467cd1e5f11f7d6804735e401b73fb1038b8f81cfc6527fafb6ac7f4668c3de9400a0131c1292bdbe660 + HEAD_REF master + PATCHES + dont_build_examples_and_gdk_pixbuf.patch + remove_finding_pkgconfig.patch + install-extra-headers.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libheif/) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libheif/remove_finding_pkgconfig.patch b/ports/libheif/remove_finding_pkgconfig.patch new file mode 100644 index 00000000000000..ed8913a22b352b --- /dev/null +++ b/ports/libheif/remove_finding_pkgconfig.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3a5cfbc..9a3046e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,10 +52,9 @@ if (has_potentially_evaluated_expression) + endif() + + if (UNIX) +- find_package(PkgConfig) +- pkg_check_modules(LIBDE265 libde265) +- pkg_check_modules(X265 x265) +- pkg_check_modules(AOM aom) ++ find_package(libde265) ++ find_package(x265) ++ find_package(aom) + endif() + + # Create libheif pkgconfig file diff --git a/ports/libhsplasma/CONTROL b/ports/libhsplasma/CONTROL new file mode 100644 index 00000000000000..eb5c047edd67db --- /dev/null +++ b/ports/libhsplasma/CONTROL @@ -0,0 +1,10 @@ +Source: libhsplasma +Version: 2020.08.30 +Homepage: https://github.com/H-uru/libhsplasma +Description: Cross-platform Plasma data and network library +Build-Depends: libjpeg-turbo, libpng, string-theory, zlib +Supports: !(arm|uwp) + +Feature: net +Description: Network functionality +Build-Depends: openssl diff --git a/ports/libhsplasma/portfile.cmake b/ports/libhsplasma/portfile.cmake new file mode 100644 index 00000000000000..506f09d20acbf0 --- /dev/null +++ b/ports/libhsplasma/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO H-uru/libhsplasma + REF afd9c46fa72afbbaf5260800ecfde0704ba2a475 + SHA512 21774b465ede7fe5e44df4470ed6867977ac9249400ba6d0bed33fd0e856d467de1afe79afb8a4dc6145eef21c5a3f79590b5cfa3ea1337cc355ca8f3bf1a11c + HEAD_REF master +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + net ENABLE_NET +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DENABLE_PHYSX=OFF + -DENABLE_PYTHON=OFF + -DENABLE_TOOLS=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets( + CONFIG_PATH share/cmake/HSPlasma + TARGET_PATH share/HSPlasma +) + +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libigl/CONTROL b/ports/libigl/CONTROL index 90c5313fbd8572..3b23040024fdd0 100644 --- a/ports/libigl/CONTROL +++ b/ports/libigl/CONTROL @@ -1,8 +1,9 @@ Source: libigl -Version: 2.1.0-2 +Version: 2.2.0 Homepage: https://github.com/libigl/libigl Description: libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB. Build-Depends: eigen3 +Supports: !(arm|uwp) Feature: embree Description: Build with embree @@ -14,24 +15,12 @@ Build-Depends: opengl, glad Feature: glfw Description: Build with glfw -Build-Depends: glfw3 +Build-Depends: libigl[opengl], glfw3 Feature: imgui Description: Build with imgui -Build-Depends: imgui[bindings] - -Feature: png -Description: Build with libpng -Build-Depends: libpng, stb +Build-Depends: libigl[glfw], imgui[glfw-binding, opengl3-glew-binding, libigl-imgui] Feature: xml Description: Build with libxml Build-Depends: tinyxml2 - -Feature: python -Description: Build with python bind -Build-Depends: pybind11 - -Feature: test -Description: Build test -Build-Depends: catch2 \ No newline at end of file diff --git a/ports/libigl/fix-dependency.patch b/ports/libigl/fix-dependency.patch index 06e3d0f7d00064..fad85af0a76cf1 100644 --- a/ports/libigl/fix-dependency.patch +++ b/ports/libigl/fix-dependency.patch @@ -1,47 +1,51 @@ +diff --git a/cmake/LibiglWindows.cmake b/cmake/LibiglWindows.cmake +index b98aa55..46c68a7 100644 +--- a/cmake/LibiglWindows.cmake ++++ b/cmake/LibiglWindows.cmake +@@ -1,4 +1,4 @@ +-if(MSVC) ++if(0) + option(IGL_STATIC_RUNTIME "Use libigl with the static MSVC runtime." OFF) + if(IGL_STATIC_RUNTIME) + message(STATUS "MSVC -> forcing use of statically-linked runtime.") diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake -index 7016cbf..3a6b4dd 100644 +index d07bbb3..a33cefa 100644 --- a/cmake/libigl.cmake +++ b/cmake/libigl.cmake -@@ -96,8 +96,9 @@ if(UNIX) +@@ -107,7 +107,8 @@ if(HUNTER_ENABLED) endif() # Eigen --if(TARGET Eigen3::Eigen) -+if(1) - # If an imported target already exists, use it -+ find_package(Eigen3 CONFIG REQUIRED) - target_link_libraries(igl_common INTERFACE Eigen3::Eigen) - else() +-if(NOT TARGET Eigen3::Eigen) ++find_package(Eigen3 CONFIG REQUIRED) ++if(0) igl_download_eigen() -@@ -182,7 +183,7 @@ compile_igl_module("core" ${SOURCES_IGL}) + add_library(igl_eigen INTERFACE) + target_include_directories(igl_eigen SYSTEM INTERFACE +@@ -296,9 +297,9 @@ endif() ################################################################################ - ### Download the python part ### - if(LIBIGL_WITH_PYTHON) -- igl_download_pybind11() -+ #igl_download_pybind11() - endif() - - ################################################################################ -@@ -281,7 +282,8 @@ if(LIBIGL_WITH_EMBREE) - set(EMBREE_STATIC_RUNTIME ON CACHE BOOL " " FORCE) - endif() + ### Compile the embree part ### + if(LIBIGL_WITH_EMBREE) +- set(EMBREE_DIR "${LIBIGL_EXTERNAL}/embree") ++ find_package(embree 3 CONFIG REQUIRED) - if(NOT TARGET embree) -+ find_package(embree 3 CONFIG REQUIRED) + if(0) - # TODO: Should probably save/restore the CMAKE_CXX_FLAGS_*, since embree seems to be - # overriding them on Windows. But well... it works for now. igl_download_embree() -@@ -289,7 +291,7 @@ if(LIBIGL_WITH_EMBREE) + + set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "") +@@ -315,8 +316,8 @@ if(LIBIGL_WITH_EMBREE) endif() compile_igl_module("embree") - target_link_libraries(igl_embree ${IGL_SCOPE} embree) -+ target_link_libraries(igl_embree ${IGL_SCOPE} sys math simd embree) - target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) +- target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) ++ target_link_libraries(igl_embree ${IGL_SCOPE} ${EMBREE_LIBRARIES}) ++ target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_INCLUDE_DIRS}) target_compile_definitions(igl_embree ${IGL_SCOPE} -DEMBREE_STATIC_LIB) endif() -@@ -332,11 +334,12 @@ if(LIBIGL_WITH_OPENGL) + +@@ -358,11 +359,12 @@ if(LIBIGL_WITH_OPENGL) endif() # glad module @@ -56,17 +60,17 @@ index 7016cbf..3a6b4dd 100644 endif() ################################################################################ -@@ -345,7 +348,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) +@@ -371,7 +373,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) if(TARGET igl::opengl) # GLFW module compile_igl_module("opengl/glfw") - if(NOT TARGET glfw) + find_package(glfw3 CONFIG REQUIRED) + if(0) - set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) - set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE) - set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE) -@@ -363,9 +367,10 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) + igl_download_glfw() + option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) + option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) +@@ -394,11 +397,12 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) if(TARGET igl::opengl_glfw) # ImGui module compile_igl_module("opengl/glfw/imgui") @@ -74,12 +78,14 @@ index 7016cbf..3a6b4dd 100644 + find_package(imgui CONFIG REQUIRED) + if(0) igl_download_imgui() -- add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) -+ add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui::imgui) + add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) endif() - target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) +- target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) ++ target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui::imgui) endif() -@@ -377,12 +382,21 @@ if(LIBIGL_WITH_PNG) + endif() + +@@ -408,12 +412,22 @@ if(LIBIGL_WITH_PNG) # png/ module is anomalous because it also depends on opengl it really should # be moved into the opengl/ directory and namespace ... if(TARGET igl_opengl) @@ -87,6 +93,7 @@ index 7016cbf..3a6b4dd 100644 + find_path(stb_include_dir stb.h) + find_package(opengl REQUIRED) + find_package(libpng CONFIG REQUIRED) ++ find_package(glad CONFIG REQUIRED) + if (BUILD_SHARED_LIBS) + set(libpng_LIBRARIES png) + else() @@ -98,12 +105,12 @@ index 7016cbf..3a6b4dd 100644 endif() compile_igl_module("png" "") - target_link_libraries(igl_png ${IGL_SCOPE} igl_stb_image igl_opengl) -+ target_include_directories(igl_png PUBLIC ${stb_include_dir}) -+ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES}) ++ target_include_directories(igl_png INTERFACE ${stb_include_dir}) ++ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES} glad::glad) endif() endif() -@@ -430,7 +444,8 @@ endif() +@@ -461,7 +475,8 @@ endif() ### Compile the xml part ### if(LIBIGL_WITH_XML) set(TINYXML2_DIR "${LIBIGL_EXTERNAL}/tinyxml2") @@ -113,7 +120,7 @@ index 7016cbf..3a6b4dd 100644 igl_download_tinyxml2() add_library(tinyxml2 STATIC ${TINYXML2_DIR}/tinyxml2.cpp ${TINYXML2_DIR}/tinyxml2.h) target_include_directories(tinyxml2 PUBLIC ${TINYXML2_DIR}) -@@ -440,7 +455,7 @@ if(LIBIGL_WITH_XML) +@@ -471,7 +486,7 @@ if(LIBIGL_WITH_XML) SOVERSION "3") endif() compile_igl_module("xml") @@ -136,10 +143,10 @@ index 1d3e3bc..682b6d7 100644 #include #include diff --git a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -index 3939b03..835b208 100644 +index 47de487..6c607de 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp +++ b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -@@ -9,7 +9,7 @@ +@@ -9,9 +9,9 @@ #include "ImGuiMenu.h" #include "ImGuiHelpers.h" #include @@ -148,8 +155,11 @@ index 3939b03..835b208 100644 #include #include #include + #include + #include + //////////////////////////////////////////////////////////////////////////////// diff --git a/include/igl/opengl/glfw/imgui/ImGuiTraits.h b/include/igl/opengl/glfw/imgui/ImGuiTraits.h -index fbc892f..e8828b1 100644 +index 7dae22a..e6911c5 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiTraits.h +++ b/include/igl/opengl/glfw/imgui/ImGuiTraits.h @@ -8,7 +8,7 @@ @@ -161,30 +171,11 @@ index fbc892f..e8828b1 100644 // Extend ImGui by populating its namespace directly namespace ImGui -diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt -index 7a14775..f5c84a8 100644 ---- a/python/CMakeLists.txt -+++ b/python/CMakeLists.txt -@@ -23,8 +23,8 @@ endif() - # set(PYTHON_INCLUDE_DIR "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m") - - set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7) --find_package(PythonInterp 3.4 REQUIRED) --find_package(PythonLibs 3.4 REQUIRED) -+find_package(PythonInterp REQUIRED) -+find_package(PythonLibs REQUIRED) - - ## libigl - if(NOT TARGET igl::core) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 8a0af13..5c6a350 100644 +index 273324d..cefbd52 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt -@@ -11,16 +11,14 @@ else() - endif() - - ### Download data --igl_download_test_data() +@@ -15,12 +15,11 @@ igl_download_test_data() set(IGL_TEST_DATA ${LIBIGL_EXTERNAL}/../tests/data) ### Download Catch2 unit test framework @@ -199,7 +190,7 @@ index 8a0af13..5c6a350 100644 # Create test executable diff --git a/tutorial/106_ViewerMenu/main.cpp b/tutorial/106_ViewerMenu/main.cpp -index 09f3272..9e1a19d 100644 +index cc514e5..f1be538 100644 --- a/tutorial/106_ViewerMenu/main.cpp +++ b/tutorial/106_ViewerMenu/main.cpp @@ -2,7 +2,7 @@ diff --git a/ports/libigl/fix-imgui-set-cond.patch b/ports/libigl/fix-imgui-set-cond.patch new file mode 100644 index 00000000000000..964f6f3f4980f1 --- /dev/null +++ b/ports/libigl/fix-imgui-set-cond.patch @@ -0,0 +1,26 @@ +diff --git a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp +index 47de4870..7e6f13a8 100644 +--- a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp ++++ b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp +@@ -167,8 +167,8 @@ IGL_INLINE void ImGuiMenu::draw_menu() + IGL_INLINE void ImGuiMenu::draw_viewer_window() + { + float menu_width = 180.f * menu_scaling(); +- ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f), ImGuiSetCond_FirstUseEver); +- ImGui::SetNextWindowSize(ImVec2(0.0f, 0.0f), ImGuiSetCond_FirstUseEver); ++ ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f), ImGuiCond_FirstUseEver); ++ ImGui::SetNextWindowSize(ImVec2(0.0f, 0.0f), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSizeConstraints(ImVec2(menu_width, -1.0f), ImVec2(menu_width, -1.0f)); + bool _viewer_menu_visible = true; + ImGui::Begin( +@@ -310,8 +310,8 @@ IGL_INLINE void ImGuiMenu::draw_viewer_menu() + IGL_INLINE void ImGuiMenu::draw_labels_window() + { + // Text labels +- ImGui::SetNextWindowPos(ImVec2(0,0), ImGuiSetCond_Always); +- ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize, ImGuiSetCond_Always); ++ ImGui::SetNextWindowPos(ImVec2(0,0), ImGuiCond_Always); ++ ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize, ImGuiCond_Always); + bool visible = true; + ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0,0,0,0)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0); diff --git a/ports/libigl/portfile.cmake b/ports/libigl/portfile.cmake index 6407ca812639eb..063f5a723ae9b3 100644 --- a/ports/libigl/portfile.cmake +++ b/ports/libigl/portfile.cmake @@ -1,12 +1,16 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libigl/libigl - REF f6b406427400ed7ddb56cfc2577b6af571827c8c #2.1.0 - SHA512 262f0b16e6c018d86d11a7cc90f8f4f8088fa7190634a7cd5cc392ebdefe47e2218b4f9276e411498ae0001d66d0207f4108c87c5090e3a39df4a2760930e945 + REF 3cb4894eaf8ea4610467189ca292be349425d44b #2.2.0 + SHA512 339f96e36b6a99ae8301ec2e234e18cecba7b7c42289ed68a26c20b279dce3135405f9b49e292c321fba962d56c083ae61831057bec9a19ad1495e2afa379b8b HEAD_REF master - PATCHES fix-dependency.patch + PATCHES + fix-dependency.patch + fix-imgui-set-cond.patch ) set(LIBIGL_BUILD_STATIC OFF) @@ -14,10 +18,9 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(LIBIGL_BUILD_STATIC ON) endif() -if ("python" IN_LIST FEATURES) - vcpkg_find_acquire_program(PYTHON2) - get_filename_component(PYTHON2_DIR ${PYTHON2} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}") +if ("imgui" IN_LIST FEATURES AND NOT VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Remove this after add port libigl-imgui + message(FATAL_ERROR "Feature imgui does not support non-static build currently") endif() if ("test" IN_LIST FEATURES AND NOT EXISTS ${SOURCE_PATH}/tests/data) @@ -37,10 +40,9 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS opengl LIBIGL_WITH_OPENGL glfw LIBIGL_WITH_OPENGL_GLFW imgui LIBIGL_WITH_OPENGL_GLFW_IMGUI - png LIBIGL_WITH_PNG + #png LIBIGL_WITH_PNG # Disable this feature due to issue https://github.com/libigl/libigl/issues/1199 xml LIBIGL_WITH_XML - python LIBIGL_WITH_PYTHON - test LIBIGL_BUILD_TESTS + #python LIBIGL_WITH_PYTHON # Python binding are in the process of being redone. ) vcpkg_configure_cmake( @@ -55,7 +57,9 @@ vcpkg_configure_cmake( -DLIBIGL_WITH_TRIANGLE=OFF -DLIBIGL_WITH_PREDICATES=OFF -DLIBIGL_BUILD_TUTORIALS=OFF - -DPYTHON_EXECUTABLE=${PYTHON2} + -DLIBIGL_WITH_PNG=OFF + -DLIBIGL_BUILD_TESTS=OFF + -DPYTHON_EXECUTABLE=${PYTHON2} ) vcpkg_install_cmake() @@ -70,4 +74,3 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE.GPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL index 42825d88363ee0..3ee860999a74b5 100644 --- a/ports/libjpeg-turbo/CONTROL +++ b/ports/libjpeg-turbo/CONTROL @@ -1,4 +1,4 @@ Source: libjpeg-turbo -Version: 2.0.4 +Version: 2.0.5 Homepage: https://github.com/libjpeg-turbo/libjpeg-turbo Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 893c25adbd7e27..95fae01c2b3afc 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libjpeg-turbo/libjpeg-turbo - REF 166e34213e4f4e2363ce058a7bcc69fd03e38b76 # 2.0.4 - SHA512 e4ac657cdb5df0b37e9429d21c2c49eed0c195408469597b49c06791fc5899a66f7f7dbb0b253f32eb28e63e5382fcf3afe68e5e30b04f76e145f6151d8f1112 + REF ae87a958613b69628b92088b313ded0d4f59a716 # 2.0.5 + SHA512 25e8857a3542cc74c48775959f11811529fe6a853990cb285f91a6218c1cde5dd1e58043208e81709fb7a71c376396b2de1f20b53b2c5b8595ca097fa02992fd HEAD_REF master PATCHES add-options-for-exes-docs-headers.patch @@ -66,7 +64,7 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE.md - DESTINATION ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -85,4 +83,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PAC vcpkg_copy_pdbs() -vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE) diff --git a/ports/libkml/CONTROL b/ports/libkml/CONTROL index 3783e0d3d8a3da..33de1219bec3de 100644 --- a/ports/libkml/CONTROL +++ b/ports/libkml/CONTROL @@ -1,5 +1,6 @@ Source: libkml -Version: 1.3.0-4 +Version: 1.3.0 +Port-Version: 6 Homepage: https://github.com/libkml/libkml Description: Reference implementation of OGC KML 2.2 -Build-Depends: zlib, expat, minizip[bzip2], uriparser, boost-smart-ptr +Build-Depends: zlib, expat, minizip[bzip2], uriparser, boost-smart-ptr \ No newline at end of file diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index a6e23b863845e4..581a3b6089b15d 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libkml/libkml @@ -22,11 +20,11 @@ vcpkg_copy_pdbs() if (VCPKG_TARGET_IS_WINDOWS) vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) -elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") +elseif (VCPKG_TARGET_IS_LINUX) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libkml) -elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") +elseif (VCPKG_TARGET_IS_OSX) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libkml) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libkml RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index e95b13c3c0d49e..dc9d0fda86c7e5 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,4 +1,5 @@ Source: liblzma Version: 5.2.5 +Port-Version: 1 Homepage: https://github.com/xz-mirror/xz Description: Compression library with an API similar to that of zlib. diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index acc0dbaaa9b01d..c29dbafedc367e 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -68,9 +68,13 @@ set(LZMA_FOUND TRUE CACHE BOOL \"\") set(LIBLZMA_FOUND TRUE CACHE BOOL \"\") ") -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(APPEND ${CURRENT_PACKAGES_DIR}/share/liblzma/LibLZMAConfig.cmake "add_definitions(-DLZMA_API_STATIC)") +file(READ ${CURRENT_PACKAGES_DIR}/include/lzma.h _contents) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(LZMA_API_STATIC)" "1" _contents "${_contents}") +else() + string(REPLACE "defined(LZMA_API_STATIC)" "0" _contents "${_contents}") endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/lzma.h "${_contents}") if (VCPKG_BUILD_TYPE STREQUAL debug) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include) diff --git a/ports/libmagic/CONTROL b/ports/libmagic/CONTROL index 07fce2a682e2b0..750b6513901124 100644 --- a/ports/libmagic/CONTROL +++ b/ports/libmagic/CONTROL @@ -1,4 +1,5 @@ Source: libmagic -Version: 5.37-1 +Version: 5.37 +Port-Version: 2 Homepage: https://github.com/file/file -Description: This library can be used to classify files according to magic number tests. \ No newline at end of file +Description: This library can be used to classify files according to magic number tests. diff --git a/ports/libmagic/portfile.cmake b/ports/libmagic/portfile.cmake index 65fe8d8ab6cbfe..363fa148f3f4da 100644 --- a/ports/libmagic/portfile.cmake +++ b/ports/libmagic/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index 6507c55c71c49e..d3b39d0afc406a 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,4 +1,14 @@ Source: libmariadb -Version: 3.1.7-1 +Version: 3.1.7 +Port-Version: 2 Homepage: https://github.com/MariaDB/mariadb-connector-c Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases +Default-Features: zlib, openssl + +Feature: zlib +Build-Depends: zlib +Description: Use internal zlib + +Feature: openssl +Build-Depends: openssl +Description: Enable SSL support diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index 06f54bb41d55e3..6943c934c0bb88 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -8,7 +8,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO MariaDB/mariadb-connector-c - REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 + REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 SHA512 b663effe7794d997c0589a9a20dab6b7359414612e60e3cb43e3fd0ddeae0391bcbc2d816cba4a7438602566ad6781cbf8e18b0062f1d37a2b2bd521af16033c HEAD_REF master PATCHES @@ -17,12 +17,17 @@ vcpkg_from_github( fix-InstallPath.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + zlib WITH_EXTERNAL_ZLIB + openssl WITH_SSL +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DWITH_UNITTEST=OFF - -DWITH_SSL=OFF -DWITH_CURL=OFF ) diff --git a/ports/libmediainfo/CONTROL b/ports/libmediainfo/CONTROL index e877ba23327877..1ca85c7870b062 100644 --- a/ports/libmediainfo/CONTROL +++ b/ports/libmediainfo/CONTROL @@ -1,5 +1,5 @@ Source: libmediainfo -Version: 20.03 +Version: 20.08 Homepage: https://github.com/MediaArea/MediaInfoLib Description: Get most relevant technical and tag data from video and audio files Build-Depends: libzen, curl, zlib diff --git a/ports/libmediainfo/portfile.cmake b/ports/libmediainfo/portfile.cmake index d6b00279714617..955bb9c7778681 100644 --- a/ports/libmediainfo/portfile.cmake +++ b/ports/libmediainfo/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO MediaArea/MediaInfoLib - REF v20.03 - SHA512 c5d3444c8694ca68ee08f97f387cef3aefd9fbb23623b643a6daf9ed7d247521f1291a8a13c9088b31be9a9d594ca772d3125d6eb3d3770bee1f7c50b3b23c07 + REF v20.08 + SHA512 271742af2b2407c04a0555d851fc9ef5590326f4101413ef2092d0a0b99e8367d01bb6442464d171b582b00bb2f45edb9bc9867e74a8d14daba99e2416bc08f3 HEAD_REF master PATCHES vcpkg_support_in_cmakelists.patch ) @@ -10,7 +10,9 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/Project/CMake PREFER_NINJA - OPTIONS -DBUILD_ZENLIB=0 -DBUILD_ZLIB=0 + OPTIONS + -DBUILD_ZENLIB=0 + -DBUILD_ZLIB=0 ) vcpkg_install_cmake() diff --git a/ports/libmediainfo/vcpkg_support_in_cmakelists.patch b/ports/libmediainfo/vcpkg_support_in_cmakelists.patch index d0f988d7b93cbd..d3c22ab021690a 100644 --- a/ports/libmediainfo/vcpkg_support_in_cmakelists.patch +++ b/ports/libmediainfo/vcpkg_support_in_cmakelists.patch @@ -2,16 +2,6 @@ diff --git a/Project/CMake/CMakeLists.txt b/Project/CMake/CMakeLists.txt index 47c4ed13..f13ff531 100644 --- a/Project/CMake/CMakeLists.txt +++ b/Project/CMake/CMakeLists.txt -@@ -1,7 +1,7 @@ --project(MediaInfoLib) -- - cmake_minimum_required(VERSION 2.8.11) - -+project(MediaInfoLib) -+ - set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - - set(MediaInfoLib_MAJOR_VERSION 20) @@ -88,7 +88,7 @@ endif() find_package(TinyXML) diff --git a/ports/libmicrohttpd/CONTROL b/ports/libmicrohttpd/CONTROL index c78627c7f2b022..c1a76d5f9f1223 100644 --- a/ports/libmicrohttpd/CONTROL +++ b/ports/libmicrohttpd/CONTROL @@ -1,5 +1,6 @@ Source: libmicrohttpd -Version: 0.9.63-3 +Version: 0.9.63 +Port-Version: 4 Homepage: https://www.gnu.org/software/libmicrohttpd/ Description: GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/libmicrohttpd/portfile.cmake b/ports/libmicrohttpd/portfile.cmake index 98d0cfab2758aa..e055a246a38fce 100644 --- a/ports/libmicrohttpd/portfile.cmake +++ b/ports/libmicrohttpd/portfile.cmake @@ -3,7 +3,9 @@ vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm") set(MICROHTTPD_VERSION 0.9.63) vcpkg_download_distfile(ARCHIVE - URLS "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" + URLS + "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" + "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" FILENAME "libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" SHA512 cb99e7af84fb6d7c0fd3894a9dc0fbff14959b35347506bd3211a65bbfad36455007b9e67493e97c9d8394834408df10eeabdc7758573e6aae0ba6f5f87afe17 ) @@ -15,32 +17,21 @@ vcpkg_extract_source_archive_ex( ) if (VCPKG_TARGET_IS_WINDOWS) - if (TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(MSBUILD_PLATFORM "Win32") - else () - set(MSBUILD_PLATFORM "x64") - endif() - - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(MICROHTTPD_CONFIGURATION_RELEASE "Release-dll") - set(MICROHTTPD_CONFIGURATION_DEBUG "Debug-dll") + if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CFG_SUFFIX "dll") else() - set(MICROHTTPD_CONFIGURATION_RELEASE "Release-static") - set(MICROHTTPD_CONFIGURATION_DEBUG "Debug-static") + set(CFG_SUFFIX "static") endif() vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" PROJECT_SUBPATH w32/VS2015/libmicrohttpd.vcxproj - PLATFORM ${MSBUILD_PLATFORM} - RELEASE_CONFIGURATION ${MICROHTTPD_CONFIGURATION_RELEASE} - DEBUG_CONFIGURATION ${MICROHTTPD_CONFIGURATION_DEBUG} + RELEASE_CONFIGURATION "Release-${CFG_SUFFIX}" + DEBUG_CONFIGURATION "Debug-${CFG_SUFFIX}" ) - file(GLOB MICROHTTPD_HEADERS ${SOURCE_PATH}/src/include/*h) - foreach(MICROHTTPD_HEADER ${MICROHTTPD_HEADERS}) - file(COPY ${MICROHTTPD_HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - endforeach() + file(GLOB MICROHTTPD_HEADERS ${SOURCE_PATH}/src/include/microhttpd*.h) + file(COPY ${MICROHTTPD_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) else() vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" diff --git a/ports/libmodbus/CMakeLists.txt b/ports/libmodbus/CMakeLists.txt index c08abe838c3026..618ba5f6cb8992 100644 --- a/ports/libmodbus/CMakeLists.txt +++ b/ports/libmodbus/CMakeLists.txt @@ -59,9 +59,10 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) if(BUILD_SHARED_LIBS) add_compile_options(-DDLLBUILD=ON) +else() + add_compile_options(-DLIBBUILD=ON) endif() - set(MODBUS_PUBLIC_HEADERS src/modbus-rtu.h src/modbus-tcp.h diff --git a/ports/libmodbus/CONTROL b/ports/libmodbus/CONTROL deleted file mode 100644 index cb3f5a295b73e6..00000000000000 --- a/ports/libmodbus/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: libmodbus -Version: 3.1.6 -Description: libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol diff --git a/ports/libmodbus/fix-static-linkage.patch b/ports/libmodbus/fix-static-linkage.patch new file mode 100644 index 00000000000000..7d7ae79f509e66 --- /dev/null +++ b/ports/libmodbus/fix-static-linkage.patch @@ -0,0 +1,13 @@ +diff --git a/src/modbus.h b/src/modbus.h +index fbe20bc..895d05d 100644 +--- a/src/modbus.h ++++ b/src/modbus.h +@@ -24,6 +24,8 @@ + # if defined(DLLBUILD) + /* define DLLBUILD when building the DLL */ + # define MODBUS_API __declspec(dllexport) ++# elif defined(LIBBUILD) ++# define MODBUS_API + # else + # define MODBUS_API __declspec(dllimport) + # endif diff --git a/ports/libmodbus/portfile.cmake b/ports/libmodbus/portfile.cmake index fda250e4f33310..a607f5a9ed6b8d 100644 --- a/ports/libmodbus/portfile.cmake +++ b/ports/libmodbus/portfile.cmake @@ -1,27 +1,32 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO stephane/libmodbus - REF v3.1.6 - SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 - HEAD_REF master + OUT_SOURCE_PATH SOURCE_PATH + REPO stephane/libmodbus + REF v3.1.6 + SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 + HEAD_REF master + PATCHES fix-static-linkage.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${CMAKE_CURRENT_LIST_DIR}/config.h.cmake DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( - SOURCE_PATH "${SOURCE_PATH}" - PREFER_NINJA - OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=ON + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/modbus.h "elif defined(LIBBUILD)" "elif 1") +endif() + # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmodbus RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) \ No newline at end of file diff --git a/ports/libmodbus/vcpkg.json b/ports/libmodbus/vcpkg.json new file mode 100644 index 00000000000000..cea78893150e31 --- /dev/null +++ b/ports/libmodbus/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "libmodbus", + "version-string": "3.1.6", + "port-version": 1, + "description": "libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol", + "homepage": "https://github.com/stephane/libmodbus", + "supports": "!uwp" +} diff --git a/ports/libmodman/CONTROL b/ports/libmodman/CONTROL index c1fd4cd49c5bf2..21b45a2c6ea368 100644 --- a/ports/libmodman/CONTROL +++ b/ports/libmodman/CONTROL @@ -1,5 +1,5 @@ Source: libmodman -Version: 2.0.1-1 +Version: 2.0.1-2 Homepage: https://code.google.com/p/libmodman Description: a simple library for managing modules diff --git a/ports/libmodman/vcpkg-cmake-wrapper.cmake b/ports/libmodman/vcpkg-cmake-wrapper.cmake index 6d67806f51b153..f3722577475339 100644 --- a/ports/libmodman/vcpkg-cmake-wrapper.cmake +++ b/ports/libmodman/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(LIBMODMAN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT LIBMODMAN_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${LIBMODMAN_PREV_MODULE_PATH}) diff --git a/ports/libmodplug/CONTROL b/ports/libmodplug/CONTROL index 7fd84e775c323d..c8339b10483474 100644 --- a/ports/libmodplug/CONTROL +++ b/ports/libmodplug/CONTROL @@ -1,4 +1,5 @@ Source: libmodplug -Version: 0.8.9.0-5 +Version: 0.8.9.0 +Port-Version: 6 Homepage: https://github.com/Konstanty/libmodplug Description: The ModPlug mod file playing library. diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index 74dcfa26434d46..9cc8e5ac31652d 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -31,11 +31,16 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_TARGET_IS_MINGW) + set(BIN_NAME libmodplug.dll) + else() + set(BIN_NAME modplug.dll) + endif() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/bin/modplug.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${BIN_NAME} ${CURRENT_PACKAGES_DIR}/bin/${BIN_NAME}) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/debug/bin/modplug.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/${BIN_NAME} ${CURRENT_PACKAGES_DIR}/debug/bin/${BIN_NAME}) vcpkg_copy_pdbs() endif() diff --git a/ports/libmupdf/CONTROL b/ports/libmupdf/CONTROL index bcf4172e4f2842..e18d96642ab47a 100644 --- a/ports/libmupdf/CONTROL +++ b/ports/libmupdf/CONTROL @@ -1,5 +1,5 @@ Source: libmupdf -Version: 1.16.1-1 +Version: 1.17.0 Build-Depends: freetype, libjpeg-turbo, harfbuzz, zlib, curl, glfw3, openjpeg, jbig2dec Homepage: https://github.com/ArtifexSoftware/mupdf Description: a lightweight PDF, XPS, and E-book library diff --git a/ports/libmupdf/Fix-error-C2169.patch b/ports/libmupdf/Fix-error-C2169.patch deleted file mode 100644 index 4647d6b9538efd..00000000000000 --- a/ports/libmupdf/Fix-error-C2169.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h -index 0552771..42fd037 100644 ---- a/include/mupdf/fitz/system.h -+++ b/include/mupdf/fitz/system.h -@@ -131,7 +131,6 @@ #define isnan(x) _isnan(x) - #define isinf(x) (!_finite(x)) - #endif - --#define hypotf _hypotf - #define atoll _atoi64 - - #endif diff --git a/ports/libmupdf/portfile.cmake b/ports/libmupdf/portfile.cmake index 0722fc679b214a..0ecbeafff6e8b7 100644 --- a/ports/libmupdf/portfile.cmake +++ b/ports/libmupdf/portfile.cmake @@ -5,11 +5,9 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ArtifexSoftware/mupdf - REF c35d29bf873744d2e74f20444eb6dbef6acfe21c # 1.16.1 - SHA512 e21780283666224f2e5b8e70ff9dee7f6a43468fa4ed295301d5a97f6ecbf56870a07a3fe509a816dc5c1453e6532d27d27a46a1c2381c30770d0ebf45222ee9 + REF 96751b25462f83d6e16a9afaf8980b0c3f979c8b # 1.17.0 + SHA512 ee8603a606895c7362fc44905f627f2a05e3c9d8a682b27051b5c67dac971719e315a08da3cd51107024bcc67d7d43cafcb9a6ad8b534c89a55982001f400537 HEAD_REF master - PATCHES - Fix-error-C2169.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index 8a62ab9a876df2..e0689fa91f3a36 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) -find_package(sqlite3 CONFIG) +find_package(unofficial-sqlite3 CONFIG) configure_file(config.unix.h.in odb/sqlite/details/config.h COPYONLY) set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") @@ -17,7 +17,7 @@ target_include_directories(libodb-sqlite $ ) -target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3) +target_link_libraries(libodb-sqlite PRIVATE odb::libodb unofficial::sqlite3::sqlite3) if(BUILD_SHARED_LIBS) target_compile_definitions(libodb-sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB diff --git a/ports/libodb-sqlite/CONTROL b/ports/libodb-sqlite/CONTROL index e7afd76e0ef20e..ae35fc37219ab1 100644 --- a/ports/libodb-sqlite/CONTROL +++ b/ports/libodb-sqlite/CONTROL @@ -1,5 +1,6 @@ Source: libodb-sqlite -Version: 2.4.0-6 +Version: 2.4.0 +Port-Version: 7 Homepage: https://www.codesynthesis.com/products/odb/ Description: Sqlite support for the ODB ORM library Build-Depends: libodb, sqlite3 diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL index bc36d27b6f9304..c89497a19fa74f 100644 --- a/ports/libogg/CONTROL +++ b/ports/libogg/CONTROL @@ -1,4 +1,5 @@ Source: libogg Version: 1.3.4 +Port-Version: 2 Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs. Homepage: https://github.com/xiph/ogg diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index 476feb7d2d307e..617a8a65aac206 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -11,7 +11,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DINSTALL_DOCS=0 -DINSTALL_PKG_CONFIG_MODULE=0 + OPTIONS -DINSTALL_DOCS=0 -DINSTALL_PKG_CONFIG_MODULE=1 ) vcpkg_install_cmake() @@ -21,6 +21,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Ogg TARGET_PATH share/ogg) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 0258a720e625ff..988f95ebf9e65a 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,6 @@ Source: libpng -Version: 1.6.37-9 +Version: 1.6.37 +Port-Version: 11 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/libpng/pkgconfig.2.patch b/ports/libpng/pkgconfig.2.patch new file mode 100644 index 00000000000000..99c1b19300d950 --- /dev/null +++ b/ports/libpng/pkgconfig.2.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6451fcf..4090f42 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -821,20 +821,31 @@ endif() + # Only do this on Windows for Cygwin - the files don't make much sense outside + # of a UNIX look-alike. + if(NOT WIN32 OR CYGWIN OR MINGW) +- set(prefix ${CMAKE_INSTALL_PREFIX}) +- set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +- set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) +- set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +- set(LIBS "-lz -lm") +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in +- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) +- create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) +- +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in +- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) +- create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) ++ set(LIBS "-lz") ++ if(NOT APPLE) ++ string(APPEND LIBS " -lm") ++ endif() ++else() ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(LIBS "-lzlibd") ++ else() ++ set(LIBS "-lzlib") ++ endif() + endif() + ++set(prefix ${CMAKE_INSTALL_PREFIX}) ++set(exec_prefix ${CMAKE_INSTALL_PREFIX}) ++set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) ++set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) ++ ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) ++create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) ++ ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) ++create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) ++ + # SET UP LINKS + if(PNG_SHARED) + set_target_properties(png PROPERTIES diff --git a/ports/libpng/pkgconfig.patch b/ports/libpng/pkgconfig.patch new file mode 100644 index 00000000000000..5640f3834ca44c --- /dev/null +++ b/ports/libpng/pkgconfig.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6599e1d7d..c0bb2fad2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -894,13 +894,13 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) + install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) + install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) + # Install pkg-config files ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config +- DESTINATION bin) ++ DESTINATION tools/libpng) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config +- DESTINATION bin) ++ DESTINATION tools/libpng) + endif() diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 28fee46f3a4522..d366283b1ebc62 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -14,16 +14,13 @@ if ("apng" IN_LIST FEATURES) FILENAME "${LIBPNG_APG_PATCH_NAME}.gz" SHA512 226adcb3a8c60f2267fe2976ab531329ae43c2603dab4d0cf8f16217d64069936b879f3d6516b75d259c47d6f5c5b1f24f887602206c8e46abde0fb7f5c7946b ) - vcpkg_find_acquire_program(7Z) - vcpkg_execute_required_process( COMMAND ${7Z} x ${LIBPNG_APNG_PATCH_ARCHIVE} -aoa WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src LOGNAME extract-patch.log ) endif() - set(APNG_EXTRA_PATCH ${LIBPNG_APG_PATCH_PATH}) set(LIBPNG_APNG_OPTION "-DPNG_PREFIX=a") endif() @@ -37,6 +34,8 @@ vcpkg_from_github( PATCHES use_abort.patch cmake.patch + pkgconfig.patch + pkgconfig.2.patch ${APNG_EXTRA_PATCH} ) @@ -62,6 +61,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DPNG_MAN_DIR=share/${PORT}/man ${LIBPNG_APNG_OPTION} ${LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION} ${LD_VERSION_SCRIPT_OPTION} @@ -71,15 +71,65 @@ vcpkg_configure_cmake( -DPNG_TESTS=OFF -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON - -DSKIP_INSTALL_FILES=ON - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON + -DSKIP_INSTALL_FILES=OFF + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON ) - vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpng) +set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng16.pc") +if(EXISTS ${_file}) + file(READ "${_file}" _contents) + if(VCPKG_TARGET_IS_WINDOWS) + string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") + else() + string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") + endif() + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") + else() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") +endif() +set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng.pc") +if(EXISTS ${_file}) + file(READ "${_file}" _contents) + if(VCPKG_TARGET_IS_WINDOWS) + string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") + else() + string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") + endif() + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") + else() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") +endif() +if(VCPKG_TARGET_IS_WINDOWS) + set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng16.pc") + if(EXISTS ${_file}) + file(READ "${_file}" _contents) + string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlib" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + endif() + set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng.pc") + if(EXISTS ${_file}) + file(READ "${_file}" _contents) + string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlib" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + endif() +endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) vcpkg_copy_pdbs() - +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index cd63f76717490f..e42dd5f5e20c60 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,6 +1,6 @@ Source: libpq Version: 12.2 -Port-Version: 5 +Port-Version: 6 Build-Depends: libpq[bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 756e20d1b2e383..3d147104e2d3f1 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -67,7 +67,11 @@ vcpkg_extract_source_archive_ex( ) unset(buildenv_contents) # Get paths to required programs -foreach(program_name BISON FLEX PERL) +set(REQUIRED_PROGRAMS PERL) +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND REQUIRED_PROGRAMS BISON FLEX) +endif() +foreach(program_name ${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_name}_EXE_PATH ${${program_name}} DIRECTORY) diff --git a/ports/libproxy/CONTROL b/ports/libproxy/CONTROL index 051420c855651a..1855f9947a3e46 100644 --- a/ports/libproxy/CONTROL +++ b/ports/libproxy/CONTROL @@ -1,5 +1,5 @@ Source: libproxy -Version: 0.4.15-1 +Version: 0.4.15-2 Homepage: https://github.com/libproxy/libproxy Description: libproxy is a library that provides automatic proxy configuration management. Build-Depends: libmodman diff --git a/ports/libproxy/vcpkg-cmake-wrapper.cmake b/ports/libproxy/vcpkg-cmake-wrapper.cmake index 31c99f39f07d25..63158432bc5ae4 100644 --- a/ports/libproxy/vcpkg-cmake-wrapper.cmake +++ b/ports/libproxy/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(LIBPROXY_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT LIBPROXY_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${LIBPROXY_PREV_MODULE_PATH}) diff --git a/ports/libraqm/CMakeLists.txt b/ports/libraqm/CMakeLists.txt index 22f4e59d9d98d0..9ad1db64a6bc86 100644 --- a/ports/libraqm/CMakeLists.txt +++ b/ports/libraqm/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(harfbuzz CONFIG REQUIRED) find_path(HARFBUZZ_INCLUDE_DIRS NAMES hb.h PATH_SUFFIXES harfbuzz) -find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h) +find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2) configure_file(src/raqm-version.h.in src/raqm-version.h) diff --git a/ports/libraqm/CONTROL b/ports/libraqm/CONTROL index d768af76f72dda..460e66c1676a97 100644 --- a/ports/libraqm/CONTROL +++ b/ports/libraqm/CONTROL @@ -1,4 +1,5 @@ Source: libraqm -Version: 0.7.0-1 +Version: 0.7.0 +Port-Version: 2 Description: A library for complex text layout Build-Depends: freetype, harfbuzz, fribidi \ No newline at end of file diff --git a/ports/librdkafka/CONTROL b/ports/librdkafka/CONTROL index f88fa9bb325cac..12f1ae21bde613 100644 --- a/ports/librdkafka/CONTROL +++ b/ports/librdkafka/CONTROL @@ -1,5 +1,5 @@ Source: librdkafka -Version: 1.2.0-2 +Version: 1.5.0 Description: The Apache Kafka C/C++ library Homepage: https://github.com/edenhill/librdkafka diff --git a/ports/librdkafka/portfile.cmake b/ports/librdkafka/portfile.cmake index f64aa17f069f22..5ae2b695e846e9 100644 --- a/ports/librdkafka/portfile.cmake +++ b/ports/librdkafka/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO edenhill/librdkafka - REF v1.2.0 - SHA512 7caddeec09bd1556688f0011f5cae49f8b0cde55b8dbc1296b3d2a39879badc42b7f59369bb1938ce7c4c4ff8b0fe4f1973b923c3db603466c10a4c015306522 + REF 39796d359898c07ea422849e6d7cd34cd13ec466 #v1.5.0 + SHA512 96bc1e1063d4387483f955315a8523045a308aba5fc40197c805f14ceb12ff5241f98b6937c41ab84094fe39e034e8b11ba66dd4d69a758b6ecb20d56d78cbfe HEAD_REF master PATCHES fix-arm64.patch @@ -78,6 +76,3 @@ configure_file(${SOURCE_PATH}/LICENSES.txt ${CURRENT_PACKAGES_DIR}/share/${PORT} # Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME RdKafka) diff --git a/ports/libressl/CONTROL b/ports/libressl/CONTROL index a5dfd10c70e388..2b7d62ec20a9a6 100644 --- a/ports/libressl/CONTROL +++ b/ports/libressl/CONTROL @@ -1,5 +1,6 @@ Source: libressl -Version: 2.9.1-2 +Version: 2.9.1 +Port-Version: 3 Description: LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes. Supports: !(uwp|arm) diff --git a/ports/libressl/portfile.cmake b/ports/libressl/portfile.cmake index 5c8e5b964ce65d..7e37c207edd966 100644 --- a/ports/libressl/portfile.cmake +++ b/ports/libressl/portfile.cmake @@ -1,26 +1,17 @@ -cmake_minimum_required(VERSION 3.13) - if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") message(WARNING "Can't build libressl if openssl is installed. Please remove openssl, and try install libressl again if you need it. Build will continue since libressl is a subset of openssl") set(VCPKG_POLICY_EMPTY_PACKAGE enabled) return() endif() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() -if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - message(FATAL_ERROR "${PORT} does not support ARM") -endif() - -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") set(LIBRESSL_VERSION 2.9.1) set(LIBRESSL_HASH 7051911e566bb093c48a70da72c9981b870e3bf49a167ba6c934eece873084cc41221fbe3cd0c8baba268d0484070df7164e4b937854e716337540a87c214354) vcpkg_download_distfile( LIBRESSL_SOURCE_ARCHIVE - URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz + URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz https://ftp.fau.de/openbsd/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz FILENAME ${PORT}-${LIBRESSL_VERSION}.tar.gz SHA512 ${LIBRESSL_HASH} ) @@ -34,16 +25,15 @@ vcpkg_extract_source_archive_ex( 0002-suppress-msvc-warnings.patch ) -set(LIBRESSL_APPS OFF) -if("tools" IN_LIST FEATURES) - set(LIBRESSL_APPS ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "tools" LIBRESSL_APPS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DLIBRESSL_APPS=${LIBRESSL_APPS} + ${FEATURE_OPTIONS} -DLIBRESSL_TESTS=OFF OPTIONS_DEBUG -DLIBRESSL_APPS=OFF @@ -51,8 +41,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(LIBRESSL_APPS) - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) +if("tools" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) set(EXECUTABLE_SUFFIX .exe) endif() file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl") @@ -73,15 +63,12 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" ) -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") -endif() vcpkg_copy_pdbs() file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) +if((VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) file(GLOB_RECURSE LIBS "${CURRENT_PACKAGES_DIR}/*.lib") foreach(LIB ${LIBS}) string(REGEX REPLACE "(.+)-[0-9]+\\.lib" "\\1.lib" LINK "${LIB}") diff --git a/ports/libsndfile/0001-Improve-UWP-support.patch b/ports/libsndfile/0001-Improve-UWP-support.patch new file mode 100644 index 00000000000000..9821aa30ffc295 --- /dev/null +++ b/ports/libsndfile/0001-Improve-UWP-support.patch @@ -0,0 +1,37 @@ +diff --git a/src/file_io.c b/src/file_io.c +index e5762ce8..90ef23d5 100644 +--- a/src/file_io.c ++++ b/src/file_io.c +@@ -777,6 +777,21 @@ psf_open_handle (PSF_FILE * pfile) + return NULL ; + } ; + ++#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) ++ if (!pfile->use_wchar) ++ return NULL ; ++ ++ CREATEFILE2_EXTENDED_PARAMETERS cfParams = { 0 } ; ++ cfParams.dwSize = sizeof (CREATEFILE2_EXTENDED_PARAMETERS) ; ++ cfParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL ; ++ ++ handle = CreateFile2 (pfile->path.wc, dwDesiredAccess, dwShareMode, dwCreationDistribution, &cfParams) ; ++ ++ if (handle == INVALID_HANDLE_VALUE) ++ return NULL ; ++ ++ return handle ; ++#else + if (pfile->use_wchar) + handle = CreateFileW ( + pfile->path.wc, /* pointer to name of the file */ +@@ -802,6 +817,7 @@ psf_open_handle (PSF_FILE * pfile) + return NULL ; + + return handle ; ++#endif + } /* psf_open_handle */ + + /* USE_WINDOWS_API */ static void +-- +2.27.0.windows.1 + diff --git a/ports/libsndfile/CONTROL b/ports/libsndfile/CONTROL deleted file mode 100644 index ed59ac139eaf4c..00000000000000 --- a/ports/libsndfile/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: libsndfile -Version: 1.0.29-9 -Description: Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo -Homepage: https://github.com/erikd/libsndfile -Default-Features: external-libs - -Feature: external-libs -Description: Support Ogg Vorbis and FLAC audio files -Build-Depends: libogg, libflac, libvorbis diff --git a/ports/libsndfile/fix-install-path.patch b/ports/libsndfile/fix-install-path.patch deleted file mode 100644 index 38c6ff734f066d..00000000000000 --- a/ports/libsndfile/fix-install-path.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cc35414..d629adf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -641,12 +641,12 @@ if (ENABLE_PACKAGE_CONFIG) - LibSndFileConfig.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}) - -- install(EXPORT LibSndFileTargets DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}) -+ install(EXPORT LibSndFileTargets DESTINATION share/libsndfile) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/LibSndFileConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/LibSndFileConfigVersion.cmake - DESTINATION -- ${CMAKE_INSTALL_PACKAGEDIR}) -+ share/libsndfile) - - elseif (NOT ENABLE_PACKAGE_CONFIG) - -@@ -698,9 +698,9 @@ set (html_DATA - doc/embedded_files.html - doc/octave.html - doc/tutorial.html) --install (FILES ${html_DATA} DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+#install (FILES ${html_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/libsndfile) - --install (FILES ${CMAKE_CURRENT_BINARY_DIR}/sndfile.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -+#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/sndfile.pc DESTINATION share/libsndfile/pkgconfig) - - # - # Testing diff --git a/ports/libsndfile/portfile.cmake b/ports/libsndfile/portfile.cmake index ce8f9427b7b93b..78eb4bc751e6cd 100644 --- a/ports/libsndfile/portfile.cmake +++ b/ports/libsndfile/portfile.cmake @@ -1,31 +1,22 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO erikd/libsndfile - REF 6830c421899e32f8d413a903a21a9b6cf384d369 - SHA512 b13c5d7bc27218eff8a8c4ce89a964b4920b1d3946e4843e60be965d77ec205845750a82bf654a7c2c772bf3a24f6ff5706881b24ff12115f2525c8134b6d0b9 + REF v1.0.29 + SHA512 ff19e8cea629af9dea51c79f3446f7a63520525c8578c56b8b4b7a6f0ce07d2458ca488f0be9daeaf9ea3a1124b1fa7cac9a3b313b1ae1f43c76de852a10eed5 HEAD_REF master - PATCHES - uwp-createfile-getfilesize.patch - uwp-createfile-getfilesize-addendum.patch - fix-install-path.patch + PATCHES 0001-Improve-UWP-support.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" CRT_LIB_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) - -option(BUILD_EXECUTABLES "Build sndfile tools and install to folder tools" OFF) -if("external-libs" IN_LIST FEATURES) - set(SNDFILE_WITHOUT_EXTERNAL_LIBS OFF) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(FLAC_EXPORT_DEFINITION "-DFLAC__NO_DLL") - endif() -else() - set(SNDFILE_WITHOUT_EXTERNAL_LIBS ON) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_find_acquire_program(PYTHON3) endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES external-libs ENABLE_EXTERNAL_LIBS +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -34,50 +25,27 @@ vcpkg_configure_cmake( -DBUILD_REGTEST=OFF -DBUILD_TESTING=OFF -DENABLE_BOW_DOCS=OFF + -DBUILD_PROGRAMS=OFF -DENABLE_STATIC_RUNTIME=${CRT_LIB_STATIC} - -DBUILD_STATIC_LIBS=${BUILD_STATIC} - -DDISABLE_EXTERNAL_LIBS=${SNDFILE_WITHOUT_EXTERNAL_LIBS} - -DCMAKE_C_FLAGS=${FLAC_EXPORT_DEFINITION} - OPTIONS_RELEASE - -DBUILD_PROGRAMS=${BUILD_EXECUTABLES} - OPTIONS_DEBUG - -DBUILD_PROGRAMS=0 + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON + -DPYTHON_EXECUTABLE=${PYTHON3} + ${FEATURE_OPTIONS} ) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_install_cmake() + +if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN)) + set(CONFIG_PATH cmake) +else() + set(CONFIG_PATH lib/cmake/SndFile) +endif() -# Fix applied for 6830c421899e32f8d413a903a21a9b6cf384d369 -file(READ "${CURRENT_PACKAGES_DIR}/share/libsndfile/LibSndFileTargets.cmake" _contents) -string(REPLACE "INTERFACE_INCLUDE_DIRECTORIES \"\${_IMPORT_PREFIX}/lib\"" "INTERFACE_INCLUDE_DIRECTORIES \"\${_IMPORT_PREFIX}/include\"" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/share/libsndfile/LibSndFileTargets.cmake" "${_contents}") +vcpkg_fixup_cmake_targets(CONFIG_PATH ${CONFIG_PATH} TARGET_PATH share/SndFile) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) - -if(CMAKE_HOST_WIN32) - set(EXECUTABLE_SUFFIX ".exe") - set(SHARED_LIB_SUFFIX ".dll") -else() - set(EXECUTABLE_SUFFIX) - set(SHARED_LIB_SUFFIX) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/libsndfile-1${SHARED_LIB_SUFFIX}) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/libnsdfile-1${SHARED_LIB_SUFFIX}) -endif() - -if(BUILD_EXECUTABLES) - file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${EXECUTABLE_SUFFIX}) - file(COPY ${TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(REMOVE ${TOOLS}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -endif(BUILD_EXECUTABLES) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libsndfile/uwp-createfile-getfilesize-addendum.patch b/ports/libsndfile/uwp-createfile-getfilesize-addendum.patch deleted file mode 100644 index 62e6b1131f1009..00000000000000 --- a/ports/libsndfile/uwp-createfile-getfilesize-addendum.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/file_io.c b/src/file_io.c -index 47351bc..54741c9 100644 ---- a/src/file_io.c -+++ b/src/file_io.c -@@ -799,6 +799,8 @@ psf_open_handle (PSF_FILE * pfile) - - if (handle == INVALID_HANDLE_VALUE) - return NULL; -+ -+ return handle; - #else - if (pfile->use_wchar) - handle = CreateFileW ( diff --git a/ports/libsndfile/uwp-createfile-getfilesize.patch b/ports/libsndfile/uwp-createfile-getfilesize.patch deleted file mode 100644 index 0e60cde54529f6..00000000000000 --- a/ports/libsndfile/uwp-createfile-getfilesize.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/src/file_io.c b/src/file_io.c -index 7cf8f0c..47351bc 100644 ---- a/src/file_io.c -+++ b/src/file_io.c -@@ -787,6 +787,19 @@ psf_open_handle (PSF_FILE * pfile) - return NULL ; - } ; - -+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) -+ if (!pfile->use_wchar) -+ return NULL; -+ -+ CREATEFILE2_EXTENDED_PARAMETERS cfParams = {0}; -+ cfParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); -+ cfParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; -+ -+ handle = CreateFile2(pfile->path.wc, dwDesiredAccess, dwShareMode, dwCreationDistribution, &cfParams); -+ -+ if (handle == INVALID_HANDLE_VALUE) -+ return NULL; -+#else - if (pfile->use_wchar) - handle = CreateFileW ( - pfile->path.wc, /* pointer to name of the file */ -@@ -812,6 +825,7 @@ psf_open_handle (PSF_FILE * pfile) - return NULL ; - - return handle ; -+#endif - } /* psf_open_handle */ - - /* USE_WINDOWS_API */ static void -@@ -1104,7 +1118,16 @@ psf_is_pipe (SF_PRIVATE *psf) - - /* USE_WINDOWS_API */ sf_count_t - psf_get_filelen_handle (HANDLE handle) --{ sf_count_t filelen ; -+{ -+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) -+ LARGE_INTEGER size; -+ -+ if (!GetFileSizeEx(handle, &size) && GetLastError() != NO_ERROR) -+ return (sf_count_t) -1 ; -+ -+ return size.QuadPart; -+#else -+ sf_count_t filelen ; - DWORD dwFileSizeLow, dwFileSizeHigh, dwError = NO_ERROR ; - - dwFileSizeLow = GetFileSize (handle, &dwFileSizeHigh) ; -@@ -1118,6 +1141,7 @@ psf_get_filelen_handle (HANDLE handle) - filelen = dwFileSizeLow + ((__int64) dwFileSizeHigh << 32) ; - - return filelen ; -+#endif - } /* psf_get_filelen_handle */ - - /* USE_WINDOWS_API */ void diff --git a/ports/libsndfile/vcpkg.json b/ports/libsndfile/vcpkg.json new file mode 100644 index 00000000000000..b9dcdb1476281d --- /dev/null +++ b/ports/libsndfile/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "libsndfile", + "version-string": "1.0.29", + "port-version": 11, + "description": "Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo", + "homepage": "https://github.com/erikd/libsndfile", + "license": "LGPL-2.1", + "default-features": [ + "external-libs" + ], + "features": [ + { + "name": "external-libs", + "description": "Default feature. Enables Ogg Vorbis, FLAC and Ogg Opus formats support.", + "dependencies": [ + "libflac", + "libvorbis", + "opus" + ] + } + ] +} diff --git a/ports/libspatialite/CONTROL b/ports/libspatialite/CONTROL index 51d6a4f5e24ba9..364bd887c6ec0c 100644 --- a/ports/libspatialite/CONTROL +++ b/ports/libspatialite/CONTROL @@ -1,5 +1,6 @@ Source: libspatialite -Version: 4.3.0a-4 +Version: 4.3.0a +Port-Version: 5 Homepage: https://www.gaia-gis.it/gaia-sins/libspatialite-sources Description: SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities. Build-Depends: libxml2, sqlite3, geos, proj4, zlib, freexl, libiconv diff --git a/ports/libspatialite/portfile.cmake b/ports/libspatialite/portfile.cmake index 77e51b34598e4f..043fce90b7edb6 100644 --- a/ports/libspatialite/portfile.cmake +++ b/ports/libspatialite/portfile.cmake @@ -31,8 +31,8 @@ if (VCPKG_TARGET_IS_WINDOWS) else() set(CL_FLAGS_DBG "/MTd /Zi /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(CL_FLAGS_REL "/MT /Ox /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") - set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libgeos_c.lib ${CURRENT_INSTALLED_DIR}/lib/libgeos.lib") - set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libgeos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/libgeosd.lib") + set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib") + set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib") set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib") set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib") endif() diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index ed878e2509dfeb..965489a19fa146 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,10 +1,10 @@ Source: libtorrent -Version: 1.2.7 +Version: 1.2.10 Port-Version: 1 Homepage: https://github.com/arvidn/libtorrent Description: An efficient feature complete C++ BitTorrent implementation Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision, boost-variant -Supports: !uwp +Supports: !uwp&!(windows&arm) Feature: deprfun Description: build with deprecated functions enabled diff --git a/ports/libtorrent/add-datetime-to-boost-libs.patch b/ports/libtorrent/add-datetime-to-boost-libs.patch index 1ef09021a8d6d0..e9eeae91921ae1 100644 --- a/ports/libtorrent/add-datetime-to-boost-libs.patch +++ b/ports/libtorrent/add-datetime-to-boost-libs.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4f329339f..36f033b92 100644 +index 9efd451fb..7ff587631 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -672,9 +672,9 @@ else() +@@ -719,9 +719,9 @@ else() endif() # Boost diff --git a/ports/libtorrent/fix_find_iconv.patch b/ports/libtorrent/fix_find_iconv.patch index cf30ef18f17f55..2c22c15e0a26f7 100644 --- a/ports/libtorrent/fix_find_iconv.patch +++ b/ports/libtorrent/fix_find_iconv.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 303f905e4..6bdbc5ac4 100644 +index 9efd451fb..d85b31fd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -603,24 +603,19 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl +@@ -643,24 +643,19 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME streaming DEFAULT ON DESCRIPTION "Enables support for piece deadline" DISABLED TORRENT_DISABLE_STREAMING) diff --git a/ports/libtorrent/fix_python_cmake.patch b/ports/libtorrent/fix_python_cmake.patch index 942b8e3b8a563a..f114b8621a351e 100644 --- a/ports/libtorrent/fix_python_cmake.patch +++ b/ports/libtorrent/fix_python_cmake.patch @@ -1,5 +1,5 @@ diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt -index 0b9b3ebe7..74e608901 100644 +index 53e09439f..de027f965 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -1,7 +1,6 @@ @@ -26,7 +26,7 @@ index 0b9b3ebe7..74e608901 100644 list(APPEND _tmp 3.5 3.6 3.7 3.8) endif() set(${_ret} ${_tmp} PARENT_SCOPE) -@@ -31,31 +27,26 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT skip-python-runtime-test) +@@ -31,23 +27,22 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT skip-python-runtime-test) _get_compatible_python_versions(Python_ADDITIONAL_VERSIONS) endif() @@ -48,15 +48,15 @@ index 0b9b3ebe7..74e608901 100644 if (NOT boost-python-module-name) # use active python -- if (PYTHON_VERSION_STRING VERSION_GREATER_EQUAL "3") -- set(_boost-python-module-name "python${PYTHON_VERSION_MAJOR}") -- else() + # if (PYTHON_VERSION_STRING VERSION_GREATER_EQUAL "3") + # set(_boost-python-module-name "python${PYTHON_VERSION_MAJOR}") + # else() - set(_boost-python-module-name "python") # to overwrite possible value from a previous run -- endif() -+ set(_boost-python-module-name "python${Python3_VERSION_MAJOR}") ++ set(_boost-python-module-name "python${Python3_VERSION_MAJOR}") # to overwrite possible value from a previous run + # endif() endif() - set(boost-python-module-name ${_boost-python-module-name} CACHE STRING "Boost:python module name, e.g. 'pythom-3.6'") +@@ -55,7 +50,7 @@ set(boost-python-module-name ${_boost-python-module-name} CACHE STRING "Boost:py find_package(Boost REQUIRED COMPONENTS ${boost-python-module-name}) @@ -65,7 +65,7 @@ index 0b9b3ebe7..74e608901 100644 src/module.cpp src/sha1_hash.cpp src/converters.cpp -@@ -80,12 +71,12 @@ python_add_module(python-libtorrent +@@ -80,12 +75,12 @@ python_add_module(python-libtorrent set_target_properties(python-libtorrent PROPERTIES @@ -80,7 +80,7 @@ index 0b9b3ebe7..74e608901 100644 ) string(TOUPPER "${boost-python-module-name}" boost_python_module_name_uppercase) -@@ -96,7 +87,7 @@ target_link_libraries(python-libtorrent +@@ -96,7 +91,7 @@ target_link_libraries(python-libtorrent # Boost::python adds that but without a path to the library. Therefore we have to either # provide the path (but, unfortunately, FindPythonLibs.cmake does not return the library dir), # or give the full file name here (this FindPythonLibs.cmake provides to us). @@ -89,7 +89,7 @@ index 0b9b3ebe7..74e608901 100644 ) # Bindings module uses deprecated libtorrent features, thus we disable these warnings -@@ -108,7 +99,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +@@ -108,7 +103,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") endif() execute_process(COMMAND @@ -98,7 +98,7 @@ index 0b9b3ebe7..74e608901 100644 print(';'.join(map(str, [ distutils.sysconfig.get_python_lib(plat_specific=True, prefix=''), distutils.sysconfig.get_config_var('EXT_SUFFIX') -@@ -119,13 +110,11 @@ list(GET _python_sysconfig_vars 0 PYTHON_SITE_PACKAGES) +@@ -119,13 +114,11 @@ list(GET _python_sysconfig_vars 0 PYTHON_SITE_PACKAGES) list(GET _python_sysconfig_vars 1 PYTHON_EXT_SUFFIX) message(STATUS "Python site packages: ${PYTHON_SITE_PACKAGES}") @@ -117,7 +117,7 @@ index 0b9b3ebe7..74e608901 100644 set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.cmake.in") set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") -@@ -135,8 +124,8 @@ set(DEPS python-libtorrent "${SETUP_PY}") +@@ -135,8 +128,8 @@ set(DEPS python-libtorrent "${SETUP_PY}") configure_file(${SETUP_PY_IN} ${SETUP_PY} @ONLY) add_custom_command(OUTPUT ${OUTPUT} diff --git a/ports/libtorrent/no_use_iconv.patch b/ports/libtorrent/no_use_iconv.patch index 8e62a950c8ce91..3f275299a6743a 100644 --- a/ports/libtorrent/no_use_iconv.patch +++ b/ports/libtorrent/no_use_iconv.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 303f905e4..1810c23c6 100644 +index 9efd451fb..05066be82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -603,26 +603,6 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl +@@ -643,26 +643,6 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME streaming DEFAULT ON DESCRIPTION "Enables support for piece deadline" DISABLED TORRENT_DISABLE_STREAMING) diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index bdab0a37400fb9..54d40d63dece28 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -39,8 +39,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO arvidn/libtorrent - REF libtorrent_1_2_7 - SHA512 8a6b0ab387e538351ad770ad189ceaa29f0c382b7152d65d3b40b4271716c8f1550c51189ac1e2550683b69f24abbd667d13a0197e7db2ac9ea06ffa37933495 + REF libtorrent-1.2.10 + SHA512 e6de939fb6527783695e0b6623ddbe27f85842a36c0899b93ea0284cb3c6f3d14b8c39e29316adb3bf9acac7804f38385cc06854a32df28e7f4f6839af9f382d HEAD_REF RC_1_2 PATCHES add-datetime-to-boost-libs.patch diff --git a/ports/libu2f-server/CONTROL b/ports/libu2f-server/CONTROL index 26803fbb7ecd09..1af6aa8f1d5cb6 100644 --- a/ports/libu2f-server/CONTROL +++ b/ports/libu2f-server/CONTROL @@ -1,4 +1,7 @@ Source: libu2f-server Version: 1.1.0 +Port-Version: 2 Build-Depends: openssl, json-c +Homepage: https://developers.yubico.com/libu2f-server/ Description: Yubico Universal 2nd Factor (U2F) Server C Library +Supports: (x86 | x64) & windows diff --git a/ports/libu2f-server/portfile.cmake b/ports/libu2f-server/portfile.cmake index 86e5d9bbebf2b8..e4f7c6ddbfac39 100644 --- a/ports/libu2f-server/portfile.cmake +++ b/ports/libu2f-server/portfile.cmake @@ -23,6 +23,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +# The include file must be patched after the build has completed, because the source files use the wrong subdirectory name! +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libu2f-server/u2f-server.h + "#include " + "#include " +) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL index 8e351613262ec8..c2a9653317e2db 100644 --- a/ports/libusb/CONTROL +++ b/ports/libusb/CONTROL @@ -1,4 +1,6 @@ Source: libusb Version: 1.0.23 +Port-Version: 3 Homepage: https://github.com/libusb/libusb Description: a cross-platform library to access USB devices +Supports: !uwp diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake index 1beb053aa12353..c8d49f1c8e06fc 100644 --- a/ports/libusb/portfile.cmake +++ b/ports/libusb/portfile.cmake @@ -1,8 +1,6 @@ -if (VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "Error: the port is unsupported on your platform. Please open an issue on github.com/Microsoft/vcpkg to request a fix") -endif() +vcpkg_fail_port_install(ON_TARGET "uwp") -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(VCPKG_TARGET_IS_LINUX) message("${PORT} currently requires the following tools and libraries from the system package manager:\n autoreconf\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install autoreconf libudev-dev") endif() @@ -41,78 +39,24 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() + # The README file in the archive is a symlink to README.md + # which causes issues with the windows MSBUILD process + file(REMOVE ${SOURCE_PATH}/README) + vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH msvc/libusb_${LIBUSB_PROJECT_TYPE}_${MSVS_VERSION}.vcxproj LICENSE_SUBPATH COPYING ) + file(INSTALL ${SOURCE_PATH}/libusb/libusb.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0) else() - set(BASH /bin/bash) - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - # Copy sources - message(STATUS "Copying source files...") - file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - endforeach() - message(STATUS "Copying source files... done") - # Configure release - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - # Copy sources - message(STATUS "Copying source files...") - file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - endforeach() - message(STATUS "Copying source files... done") - # Configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}/debug\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - # Build release - message(STATUS "Package ${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"make install\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Build debug - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"make install\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") - endif() + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + ) + vcpkg_install_make() endif() -file(INSTALL - ${SOURCE_PATH}/libusb/libusb.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0 -) - +configure_file(${CURRENT_PORT_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) +file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libusb/usage b/ports/libusb/usage new file mode 100644 index 00000000000000..de236d46ad389c --- /dev/null +++ b/ports/libusb/usage @@ -0,0 +1,5 @@ +The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: + + find_package(@PORT@ CONFIG REQUIRED) + target_include_directories(main PRIVATE ${LIBUSB_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${LIBUSB_LIBRARIES}) diff --git a/ports/libusb/vcpkg-cmake-wrapper.cmake b/ports/libusb/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..8f0f35811157ed --- /dev/null +++ b/ports/libusb/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,10 @@ +include(SelectLibraryConfigurations) + +find_path(LIBUSB_INCLUDE_DIR libusb.h PATH_SUFFIXES libusb-1.0) +find_library(LIBUSB_LIBRARY_DEBUG NAMES libusb-1.0 usb-1.0 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(LIBUSB_LIBRARY_RELEASE NAMES libusb-1.0 usb-1.0 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(LIBUSB) + +set(LIBUSB_INCLUDE_DIRS ${LIBUSB_INCLUDE_DIR}) +set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY}) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL deleted file mode 100644 index 8ea6bbc44886dd..00000000000000 --- a/ports/libvorbis/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: libvorbis -Version: 1.3.6-4d963fe -Homepage: https://github.com/xiph/vorbis -Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. -Build-Depends: libogg diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index cf6b86a5cb7671..d6d29cf9fbd7a6 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xiph/vorbis - REF 4d963fe0b4ba3bdb45233de4b959ce2f36963f7a - SHA512 c739cebf1a7ff4739447e899d3373e2fa7a0f3a87affd59c9c0c65d69e7611ceadcdcd1592c279e65123d7d2e1c9f8f8e7dee93def8753bcdd6d115677232d83 + REF v1.3.7 + SHA512 bfb6f5dbfd49ed38b2b08b3667c06d02e68f649068a050f21a3cc7e1e56b27afd546aaa3199c4f6448f03f6e66a82f9a9dc2241c826d3d1d4acbd38339b9e9fb HEAD_REF master PATCHES 0001-Dont-export-vorbisenc-functions.patch @@ -24,4 +24,10 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) -vcpkg_copy_pdbs() +vcpkg_copy_pdbs() + +if(WIN32 AND (NOT MINGW)) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/vorbis.pc" "-lm" "") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/vorbis.pc" "-lm" "") +endif() +vcpkg_fixup_pkgconfig() diff --git a/ports/libvorbis/vcpkg.json b/ports/libvorbis/vcpkg.json new file mode 100644 index 00000000000000..9f467363dcddc1 --- /dev/null +++ b/ports/libvorbis/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "libvorbis", + "version-string": "1.3.7", + "description": "Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format", + "homepage": "https://github.com/xiph/vorbis", + "license": "BSD-3-Clause", + "dependencies": [ + "libogg" + ] +} diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index 969ae8a10961c7..a61d534b53f2ad 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -1,6 +1,6 @@ Source: libvpx -Version: 1.8.1 -Port-Version: 8 +Version: 1.9.0 +Port-Version: 1 Homepage: https://github.com/webmproject/libvpx Description: The reference software implementation for the video coding formats VP8 and VP9. Supports: !(uwp&arm) diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index 1d818ddf169db0..1e4ad6d3cec7f4 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -1,17 +1,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -set(LIBVPX_VERSION 1.8.1) -set(LIBVPX_HASH 615476a929e46befdd4782a39345ce55cd30176ecb2fcd8a875c31694ae2334b395dcab9c5ba58d53ceb572ed0c022d2a3748ca4bbd36092e22b01cf3c9b2e8e) +set(LIBVPX_VERSION 1.9.0) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/webmproject/libvpx/archive/v${LIBVPX_VERSION}/libvpx-${LIBVPX_VERSION}.tar.gz" - FILENAME "libvpx-${LIBVPX_VERSION}.tar.gz" - SHA512 ${LIBVPX_HASH} -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO webmproject/libvpx + REF v${LIBVPX_VERSION} + SHA512 8d544552b35000ea5712aec220b78bb5f7dc210704b2f609365214cb95a4f5a0e343b362723d829cb4a9ac203b10d5443700ba84b28fd6b2fefbabb40663e298 + HEAD_REF master ) vcpkg_find_acquire_program(YASM) @@ -22,7 +18,6 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) if(CMAKE_HOST_WIN32) vcpkg_acquire_msys(MSYS_ROOT PACKAGES make) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{PATH} "${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH};${PERL_EXE_PATH}") else() @@ -83,23 +78,24 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) OPTIONS /p:UseEnv=True ) + # note: pdb file names are hardcoded in the lib file, cannot rename if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmt.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmt.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") endif() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmdd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmdd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmtd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmtd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") endif() endif() diff --git a/ports/libwandio/CONTROL b/ports/libwandio/CONTROL index 5fc36ba357f7f2..1150b06ec140fb 100644 --- a/ports/libwandio/CONTROL +++ b/ports/libwandio/CONTROL @@ -1,5 +1,7 @@ Source: libwandio -Version: 4.2.1-2 +Version: 4.2.1 +Port-Version: 3 Homepage: https://github.com/wanduow/wandio Description: C library for simple and efficient file IO. -Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2 \ No newline at end of file +Build-Depends: zlib, zstd, liblzma, lzo, lz4, curl, pthread, bzip2 +Supports: !windows diff --git a/ports/libwandio/configure.lib.patch b/ports/libwandio/configure.lib.patch index 57719581ea09ac..3898836b7bc082 100644 --- a/ports/libwandio/configure.lib.patch +++ b/ports/libwandio/configure.lib.patch @@ -120,21 +120,3 @@ index 4579fbb3d..f6be008c8 100644 fi AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support") with_lz4=streamapi -@@ -296,12 +304,14 @@ AC_ARG_WITH([http], - AS_IF([test "x$with_http" != "xno"], - [ - # we need curl_easy_pause which was added in 7.18.0 -- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) -+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) -+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) - ], [have_curl=no]) - - AS_IF([test "x$have_curl" = "xyes"], [ -- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then -- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" -+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then -+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" -+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" - fi - AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") - with_http=yes], diff --git a/ports/libwandio/configure.patch b/ports/libwandio/configure.patch new file mode 100644 index 00000000000000..929662d6703296 --- /dev/null +++ b/ports/libwandio/configure.patch @@ -0,0 +1,14 @@ +diff --git a/configure.ac b/configure.ac +index e250c0c31..0465120ba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -83,7 +83,7 @@ ADD_INCLS="" + ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib" + LIBWANDIO_LIBS="" + +-CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1" ++CFLAGS="$CFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" +-CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1" ++CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" + + # Check for -fvisibility diff --git a/ports/libwandio/curl.patch b/ports/libwandio/curl.patch new file mode 100644 index 00000000000000..326700ed0bb142 --- /dev/null +++ b/ports/libwandio/curl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 4579fbb3d..f6be008c8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -296,12 +304,14 @@ AC_ARG_WITH([http], + AS_IF([test "x$with_http" != "xno"], + [ + # we need curl_easy_pause which was added in 7.18.0 +- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) ++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d libcurl libcurl-d], have_curl=yes, have_curl=no, [-lCrypt32 -lWldap32 -lWs2_32 -ladvapi32]) ++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) + ], [have_curl=no]) + + AS_IF([test "x$have_curl" = "xyes"], [ +- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" ++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lCrypt32 -lWldap32 -lWs2_32 -ladvapi32 $ac_cv_search_curl_easy_pause" ++ LIBS="$LIBS" + fi + AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") + with_http=yes], diff --git a/ports/libwandio/openssl.patch b/ports/libwandio/openssl.patch new file mode 100644 index 00000000000000..586cdfab569bf9 --- /dev/null +++ b/ports/libwandio/openssl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 4579fbb3d..f6be008c8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -296,12 +304,14 @@ AC_ARG_WITH([http], + AS_IF([test "x$with_http" != "xno"], + [ + # we need curl_easy_pause which was added in 7.18.0 +- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) ++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) ++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) + ], [have_curl=no]) + + AS_IF([test "x$have_curl" = "xyes"], [ +- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" ++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" ++ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" + fi + AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") + with_http=yes], diff --git a/ports/libwandio/portfile.cmake b/ports/libwandio/portfile.cmake index c9be34be64f4ae..a03d5c79f2c768 100644 --- a/ports/libwandio/portfile.cmake +++ b/ports/libwandio/portfile.cmake @@ -1,3 +1,11 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + set(PATCHES curl.patch) + #TODO: Still does not work. Requires proper "signal" support and "unistd" +else() + set(PATCHES openssl.patch) # needed if curl is using openssl +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wanduow/wandio @@ -5,9 +13,12 @@ vcpkg_from_github( SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d HEAD_REF master PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed. + configure.patch + ${PATCHES} ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} COPY_SOURCE ) diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL index 3c19f8738019d4..6f8d18956acdd7 100644 --- a/ports/libxml2/CONTROL +++ b/ports/libxml2/CONTROL @@ -1,6 +1,5 @@ Source: libxml2 -Version: 2.9.9 -Port-Version: 8 +Version: 2.9.10 Homepage: https://xmlsoft.org/ Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform) Build-Depends: zlib, libiconv, liblzma diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index f7b0cd81a3ef2d..7dda32359aeb71 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GNOME/libxml2 - REF v2.9.9 - SHA512 bfcc08bd033f538a968205f0f9e2da4c3438ec2f35f017289783903365e13ed93d83f2f63c7497344a362b7418170ee586a5ecb45493e30feaa0f62b22a57b54 + REF v2.9.10 + SHA512 de8d7c6c90f9d0441747deec320c4887faee1fd8aff9289115caf7ce51ab73b6e2c4628ae7eaad4a33a64561d23a92fd5e8a5afa7fa74183bdcd9a7b06bc67f1 HEAD_REF master PATCHES RemoveIncludeFromWindowsRcFile.patch @@ -31,5 +29,5 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxml2) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) endif() diff --git a/ports/libxmlmm/CMakeLists.txt b/ports/libxmlmm/CMakeLists.txt new file mode 100644 index 00000000000000..721641a64be0bc --- /dev/null +++ b/ports/libxmlmm/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 3.8) +project(libxmlmm CXX) + +set(CMAKE_SHARED_LIBRARY_PREFIX) +set(CMAKE_STATIC_LIBRARY_PREFIX) + +find_package(LibXml2 REQUIRED) + +set(HEADERS_LIBXMLMM + libxmlmm/Attribute.h + libxmlmm/CData.h + libxmlmm/Comment.h + libxmlmm/Content.h + libxmlmm/defines.h + libxmlmm/Document.h + libxmlmm/Element.h + libxmlmm/exceptions.h + libxmlmm/libxmlmm.h + libxmlmm/LibXmlSentry.h + libxmlmm/Node.h + libxmlmm/ProcessingInstruction.h + libxmlmm/Text.h + libxmlmm/utils.h +) + +set(SOURCES_LIBXMLMM + libxmlmm/Attribute.cpp + libxmlmm/CData.cpp + libxmlmm/Comment.cpp + libxmlmm/Content.cpp + libxmlmm/Document.cpp + libxmlmm/Element.cpp + libxmlmm/LibXmlSentry.cpp + libxmlmm/Node.cpp + libxmlmm/ProcessingInstruction.cpp + libxmlmm/Text.cpp + libxmlmm/utils.cpp +) + +add_library(libxmlmm ${SOURCES_LIBXMLMM}) +include_directories(${LIBXML2_INCLUDE_DIR}) +target_link_libraries (libxmlmm ${LIBXML2_LIBRARIES}) + +set_target_properties(libxmlmm PROPERTIES + CXX_STANDARD 17 + PUBLIC_HEADER "${HEADERS_LIBXMLMM}" +) + +target_include_directories(libxmlmm PUBLIC + $ + $) + +install(TARGETS ${PROJECT_NAME} + EXPORT litehtmlTargets + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + PUBLIC_HEADER DESTINATION include/libxmlmm +) diff --git a/ports/libxmlmm/CONTROL b/ports/libxmlmm/CONTROL new file mode 100644 index 00000000000000..a943bcf289eec9 --- /dev/null +++ b/ports/libxmlmm/CONTROL @@ -0,0 +1,5 @@ +Source: libxmlmm +Version: 0.6.0 +Homepage: https://github.com/rioki/libxmlmm +Description: Libxmlmm is a C++ wrapper for libxml 2.0 that only relies on standard C++ and libxml2. +Build-Depends: libxml2 diff --git a/ports/libxmlmm/portfile.cmake b/ports/libxmlmm/portfile.cmake new file mode 100644 index 00000000000000..552bd6cb2436bf --- /dev/null +++ b/ports/libxmlmm/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rioki/libxmlmm + REF r0.6 + SHA512 4f619e730de2f88b891ef31dd7ced2e6be75fff7f3852ec178843bf8d099d2e1ea84e0fcde35ff7fefc201b026f63e4b5d55f88e48334c49a0333be0327894df + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +# Handle copyright +configure_file(${SOURCE_PATH}/README.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/libzip/CONTROL b/ports/libzip/CONTROL index 9ed941bccf718b..8a3d1513724495 100644 --- a/ports/libzip/CONTROL +++ b/ports/libzip/CONTROL @@ -1,5 +1,6 @@ Source: libzip Version: 1.7.1 +Port-Version: 1 Homepage: https://github.com/nih-at/libzip Build-Depends: zlib Default-Features: bzip2,default-aes diff --git a/ports/libzip/fix-findpackage.patch b/ports/libzip/fix-findpackage.patch new file mode 100644 index 00000000000000..94ef7d93a0dcc5 --- /dev/null +++ b/ports/libzip/fix-findpackage.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6e35082..d90c0c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -482,7 +482,7 @@ CONFIGURE_PACKAGE_CONFIG_FILE("${PROJECT_NAME}.cmake.in" "${PROJECT_BINARY_DIR}/ + IF(LIBZIP_DO_INSTALL) + INSTALL(EXPORT ${PROJECT_NAME}-targets + FILE ${PROJECT_NAME}-targets.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake + ) + ENDIF() + +@@ -494,7 +494,7 @@ EXPORT(TARGETS zip + IF(LIBZIP_DO_INSTALL) + INSTALL(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-version.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake + ) + ENDIF() + +diff --git a/libzip.cmake.in b/libzip.cmake.in +index 462439b..6caf754 100644 +--- a/libzip.cmake.in ++++ b/libzip.cmake.in +@@ -1,7 +1,7 @@ + @PACKAGE_INIT@ + + # Provide all our library targets to users. +-include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/cmake/libzip/libzip-targets.cmake") ++include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/../share/libzip/libzip-targets.cmake") + + get_filename_component(LIBZIP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + set(LIBZIP_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/ports/libzip/portfile.cmake b/ports/libzip/portfile.cmake index 5b325363b6dbb4..131c3ccfcaf006 100644 --- a/ports/libzip/portfile.cmake +++ b/ports/libzip/portfile.cmake @@ -4,6 +4,7 @@ vcpkg_from_github( REF dcd9a0bfe1ac2893d7f62bafb19f0a4d7b08c0f7 #v1.7.1 SHA512 33ad594398f79544636464d6ae0892553a212dc833b508820f81f10823c3a5c4016288d05953176fb8d52919414edd28f26da6037b93129a58826abdcb501d18 HEAD_REF master + PATCHES fix-findpackage.patch ) vcpkg_check_features( diff --git a/ports/llvm/0004-fix-dr-1734.patch b/ports/llvm/0004-fix-dr-1734.patch new file mode 100644 index 00000000000000..adfbe5a131e21d --- /dev/null +++ b/ports/llvm/0004-fix-dr-1734.patch @@ -0,0 +1,14 @@ +diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h +index b7d48e8e1ad..53ba24efc00 100644 +--- a/llvm/include/llvm/Support/type_traits.h ++++ b/llvm/include/llvm/Support/type_traits.h +@@ -177,7 +177,8 @@ class is_trivially_copyable { + (has_deleted_copy_assign || has_trivial_copy_assign) && + (has_deleted_copy_constructor || has_trivial_copy_constructor); + +-#ifdef HAVE_STD_IS_TRIVIALLY_COPYABLE ++ // due to DR 1734, a type can be std::is_trivially_copyable but not llvm::is_trivially_copyable ++#if 0 + static_assert(value == std::is_trivially_copyable::value, + "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable"); + #endif diff --git a/ports/llvm/CONTROL b/ports/llvm/CONTROL index 3c25713791f621..f461f1cb51422d 100644 --- a/ports/llvm/CONTROL +++ b/ports/llvm/CONTROL @@ -1,5 +1,6 @@ Source: llvm -Version: 10.0.0-4 +Version: 10.0.0 +Port-Version: 5 Homepage: https://llvm.org/ Description: The LLVM Compiler Infrastructure Supports: !uwp diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake index 9351047e65799b..305e6bf78a4138 100644 --- a/ports/llvm/portfile.cmake +++ b/ports/llvm/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0001-allow-to-use-commas.patch 0002-fix-install-paths.patch 0003-fix-vs2019-v16.6.patch + 0004-fix-dr-1734.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL index ec84f40653626d..11d3c0207b19aa 100644 --- a/ports/log4cpp/CONTROL +++ b/ports/log4cpp/CONTROL @@ -1,5 +1,6 @@ Source: log4cpp -Version: 2.9.1-2 +Version: 2.9.1 +Port-Version: 3 Homepage: https://github.com/orocos-toolchain/log4cpp Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable. Supports: !uwp diff --git a/ports/log4cpp/fix-includepath.patch b/ports/log4cpp/fix-includepath.patch new file mode 100644 index 00000000000000..2fdac90fe82c12 --- /dev/null +++ b/ports/log4cpp/fix-includepath.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index beace9e..c8264ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,7 +136,7 @@ SET(prefix "${CMAKE_INSTALL_PREFIX}") + SET(exec_prefix "\${prefix}") + SET(log4cpp_cflags "") + SET(log4cpp_libs "${LOG4CPP_LIBS}") +-SET(includedir "\${prefix}/include/orocos") ++SET(includedir "\${prefix}/include") + SET(libdir "\${prefix}/lib") + CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc @ONLY) + +@@ -147,7 +147,7 @@ INSTALL( + + INSTALL ( + DIRECTORY include/log4cpp +- DESTINATION include/orocos ++ DESTINATION include + PATTERN "config.h.in" EXCLUDE + PATTERN ".svn" EXCLUDE + PATTERN "*.am" EXCLUDE +@@ -157,7 +157,7 @@ INSTALL ( + + INSTALL ( + FILES ${CMAKE_CURRENT_BINARY_DIR}/include/log4cpp/config.h +- DESTINATION include/orocos/log4cpp ++ DESTINATION include/log4cpp + ) + + INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake index 44c91587655720..e8de2c0e342b62 100644 --- a/ports/log4cpp/portfile.cmake +++ b/ports/log4cpp/portfile.cmake @@ -1,8 +1,4 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP.") -endif() +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -13,6 +9,7 @@ vcpkg_from_github( PATCHES fix-install-targets.patch Fix-StaticSupport.patch + fix-includepath.patch ) vcpkg_configure_cmake( @@ -29,5 +26,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/lzokay/portfile.cmake b/ports/lzokay/portfile.cmake new file mode 100644 index 00000000000000..719c63d979da4c --- /dev/null +++ b/ports/lzokay/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jackoalan/lzokay + REF 546a9695271e8a8b4711383f828172754fd825f2 + SHA512 b4e96183ea52dc5ba0d88b4b9b27baa2c3e2c540b1bfd50cf7a3c2569337fbe9d73dd9939cb456d5f7459df8e10d84677d40ee33f7d524f0f5f8a723d7a70583 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/lzokay/vcpkg.json b/ports/lzokay/vcpkg.json new file mode 100644 index 00000000000000..fb2b0787a587db --- /dev/null +++ b/ports/lzokay/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "lzokay", + "version-string": "2020-07-30", + "description": "lzokay – MIT licensed C++ implementation of LZO compression/decompression algorithm", + "homepage": "https://github.com/jackoalan/lzokay" +} diff --git a/ports/magnum-plugins/002-fix-stb-conflict.patch b/ports/magnum-plugins/002-fix-stb-conflict.patch new file mode 100644 index 00000000000000..13d535b321d481 --- /dev/null +++ b/ports/magnum-plugins/002-fix-stb-conflict.patch @@ -0,0 +1,13 @@ +diff --git a/src/MagnumPlugins/StbImageImporter/StbImageImporter.cpp b/src/MagnumPlugins/StbImageImporter/StbImageImporter.cpp +index c24a968..1a38162 100644 +--- a/src/MagnumPlugins/StbImageImporter/StbImageImporter.cpp ++++ b/src/MagnumPlugins/StbImageImporter/StbImageImporter.cpp +@@ -45,7 +45,7 @@ + #endif + + /* Not defining malloc/free, because there's no equivalent for realloc in C++ */ +-#include "stb_image.h" ++#include "external/stb/stb_image.h" + + namespace Magnum { namespace Trade { + diff --git a/ports/magnum-plugins/CONTROL b/ports/magnum-plugins/CONTROL index 24e3e2fbb2c951..dee9a32de315dd 100644 --- a/ports/magnum-plugins/CONTROL +++ b/ports/magnum-plugins/CONTROL @@ -1,5 +1,6 @@ Source: magnum-plugins Version: 2020.06 +Port-Version: 1 Build-Depends: magnum[core] Description: Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-plugins/portfile.cmake b/ports/magnum-plugins/portfile.cmake index 62e4da7bc17b5f..766d91cfc3db42 100644 --- a/ports/magnum-plugins/portfile.cmake +++ b/ports/magnum-plugins/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 001-tools-path.patch + 002-fix-stb-conflict.patch ) if("basisimporter" IN_LIST FEATURES OR "basisimageconverter" IN_LIST FEATURES) diff --git a/ports/marble/CONTROL b/ports/marble/CONTROL new file mode 100644 index 00000000000000..20dd30c0c313fd --- /dev/null +++ b/ports/marble/CONTROL @@ -0,0 +1,6 @@ +Source: marble +Version: 19.08.2 +Homepage: https://marble.kde.org +Description: Marble KDE library +Supports: windows & x64 & !static +Build-Depends: qt5-base, qt5-svg, qt5-quickcontrols, qt5-webchannel diff --git a/ports/marble/portfile.cmake b/ports/marble/portfile.cmake new file mode 100644 index 00000000000000..665eb31d10e9b9 --- /dev/null +++ b/ports/marble/portfile.cmake @@ -0,0 +1,45 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/marble + REF 552cb9ae1f34482d1ec56532a703e0d820856286 #v20.04.3 + SHA512 ac6106a6db53534c96d7281b1a07624c2852ed8c78cce0b91c5f865b106487f1f49aaa4c72d00ffb1f79a761d8d2eca18129ef9517bef463a1840554ed3e51fb + HEAD_REF master + PATCHES "qtfix.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) + +# Install plugins and data files +file(GLOB_RECURSE PLUGINS "${CURRENT_PACKAGES_DIR}/plugins/*") +file(GLOB_RECURSE PLUGINS_DESIGNER "${CURRENT_PACKAGES_DIR}/lib/plugins/*") +file(GLOB_RECURSE PLUGINS_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/plugins/*") +file(GLOB_RECURSE MKSPECS "${CURRENT_PACKAGES_DIR}/mkspecs/*") + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) +file(COPY ${PLUGINS} ${PLUGINS_DESIGNER} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/plugins) +file(COPY ${PLUGINS_DEBUG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/plugins) +file(COPY "${CURRENT_PACKAGES_DIR}/data" DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) # have to keep folder structure here +file(COPY ${MKSPECS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/mkspecs) + +# remove plugin folder +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/plugins ${CURRENT_PACKAGES_DIR}/debug/plugins + ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/debug/data + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/mkspecs ${CURRENT_PACKAGES_DIR}/debug/mkspecs + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/debug/lib/plugins ${CURRENT_PACKAGES_DIR}/lib/plugins +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/marble/qtfix.patch b/ports/marble/qtfix.patch new file mode 100644 index 00000000000000..39a420be02ce3a --- /dev/null +++ b/ports/marble/qtfix.patch @@ -0,0 +1,97 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3b2139dc..1f9a10513 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,7 +171,7 @@ set (PEDANTIC FALSE CACHE BOOL "Determines if we should compile with -Wall -Werr + set (WITH_DESIGNER_PLUGIN TRUE CACHE BOOL "Build plugins for Qt Designer") + add_feature_info("Qt Designer plugins" WITH_DESIGNER_PLUGIN "Marble widget support in Qt Designer. Toggle with WITH_DESIGNER_PLUGIN=YES/NO") + +-set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory for executables and libraries" FORCE) ++set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "Base directory for executables and libraries" FORCE) + if (NOT QT_PLUGINS_DIR) + set(QT_PLUGINS_DIR ${CMAKE_INSTALL_LIBDIR}/plugins) + endif() +@@ -248,7 +248,7 @@ add_definitions( + -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +- -DQT_STRICT_ITERATORS ++# -DQT_STRICT_ITERATORS + -DQT_DISABLE_DEPRECATED_BEFORE=0x050700 + ) + +diff --git a/src/apps/marble-qt/CMakeLists.txt b/src/apps/marble-qt/CMakeLists.txt +index d28e3aa5e..7bbf4a63c 100644 +--- a/src/apps/marble-qt/CMakeLists.txt ++++ b/src/apps/marble-qt/CMakeLists.txt +@@ -48,7 +48,7 @@ if(STATIC_BUILD) + endif(STATIC_BUILD) + + if(WIN32) +-install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) ++ install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/marble) + else(WIN32) + if (APPLE) + # No need for this when installing to a bundle +diff --git a/src/lib/astro/CMakeLists.txt b/src/lib/astro/CMakeLists.txt +index 5e1afd60f..fc53985f4 100644 +--- a/src/lib/astro/CMakeLists.txt ++++ b/src/lib/astro/CMakeLists.txt +@@ -50,7 +50,7 @@ target_include_directories(astro + + # choose the correct target install library path + if(WIN32) +- INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + elseif(APPLE) + INSTALL(TARGETS astro LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) + else() +diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt +index 7d27be94b..f1f377967 100644 +--- a/src/lib/marble/CMakeLists.txt ++++ b/src/lib/marble/CMakeLists.txt +@@ -448,7 +448,7 @@ target_include_directories(marblewidget + + # choose the correct target install library path + if(WIN32) +- install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + elseif(APPLE) + install(TARGETS marblewidget LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) + else() +diff --git a/src/lib/marble/declarative/CMakeLists.txt b/src/lib/marble/declarative/CMakeLists.txt +index dd5d519c4..482a02ad5 100644 +--- a/src/lib/marble/declarative/CMakeLists.txt ++++ b/src/lib/marble/declarative/CMakeLists.txt +@@ -53,7 +53,7 @@ if(Qt5Positioning_FOUND) + endif() + + if(WIN32) +- install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + else() + install(TARGETS marbledeclarative LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +diff --git a/src/plugins/positionprovider/CMakeLists.txt b/src/plugins/positionprovider/CMakeLists.txt +index 85591098e..87011876e 100644 +--- a/src/plugins/positionprovider/CMakeLists.txt ++++ b/src/plugins/positionprovider/CMakeLists.txt +@@ -12,12 +12,12 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} + COMPONENTS + Positioning + ) +-marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) +-marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) +-marble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) +-if(Qt5Positioning_FOUND) +- ADD_SUBDIRECTORY( qtpositioning ) +-endif() ++#marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) ++#marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) ++#arble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) ++#if(Qt5Positioning_FOUND) ++# ADD_SUBDIRECTORY( qtpositioning ) ++#endif() + + + macro_optional_find_package(libwlocate) diff --git a/ports/matplotlib-cpp/CONTROL b/ports/matplotlib-cpp/CONTROL index cdbf0afc236fe0..807f6c1cb51516 100644 --- a/ports/matplotlib-cpp/CONTROL +++ b/ports/matplotlib-cpp/CONTROL @@ -1,4 +1,4 @@ Source: matplotlib-cpp -Version: 2019-09-24 +Version: 2020-08-27 Description: Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib Homepage: https://github.com/lava/matplotlib-cpp diff --git a/ports/matplotlib-cpp/portfile.cmake b/ports/matplotlib-cpp/portfile.cmake index ed2ff5b9a38e56..e3b61c2375671e 100644 --- a/ports/matplotlib-cpp/portfile.cmake +++ b/ports/matplotlib-cpp/portfile.cmake @@ -1,12 +1,10 @@ # header-only library -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lava/matplotlib-cpp - REF f4ad842e70cc56a38f3e4cd852968c7c1cecc9a7 - SHA512 433eb2bc60aa65b9bc40310d7a55b728737e59aafe13e06ddf1a71b25e3cc365cd10f64121fba936180c98eaf5c96dfaf2547e0e3c0daef0b808d1527a37cc17 + REF 70d508fcb7febc66535ba923eac1b1a4e571e4d1 + SHA512 4da452fc38b6c349a1b08b97775ef2d90354fabd3c8c3a0383f08609b22dea222b7f3e091efc1b833755f6b5c1e8564e675d2ed54cdc21f8b07b1b7bb44a82f4 HEAD_REF master ) diff --git a/ports/minc/CONTROL b/ports/minc/CONTROL new file mode 100644 index 00000000000000..6cd1d54997367d --- /dev/null +++ b/ports/minc/CONTROL @@ -0,0 +1,9 @@ +Source: minc +Version: 2.4.03 +Description: MINC - Medical Image NetCDF or MINC isn't netCDF +Homepage: https://github.com/BIC-MNI/libminc +Build-Depends: nifticlib, hdf5[core], zlib + +Feature: minc1 +Description: Support minc1 file format, requires NETCDF +Build-Depends: netcdf[core] \ No newline at end of file diff --git a/ports/minc/build.patch b/ports/minc/build.patch new file mode 100644 index 00000000000000..d0275c20d4c61e --- /dev/null +++ b/ports/minc/build.patch @@ -0,0 +1,67 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52cc81ace..d7a1f63f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -403,9 +404,11 @@ ENDIF(LIBMINC_MINC1_SUPPORT) + # Keep this variable for compatibility + SET(VOLUME_IO_LIBRARY ${LIBMINC_EXTERNAL_LIB_PREFIX}minc2) + SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + + ADD_LIBRARY(${LIBMINC_LIBRARY} ${LIBRARY_TYPE} ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} ) +- ++if(WIN32) ++ target_link_libraries(${LIBMINC_LIBRARY} ws2_32) ++endif() + IF(NIFTI_FOUND AND NOT LIBMINC_USE_SYSTEM_NIFTI) + ADD_DEPENDENCIES(${LIBMINC_LIBRARY} NIFTI) + ENDIF() +@@ -453,7 +456,7 @@ IF( LIBMINC_INSTALL_LIB_DIR ) + ${LIBMINC_EXPORTED_TARGETS} + LIBRARY DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries + ARCHIVE DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries +- RUNTIME DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries ++ RUNTIME DESTINATION ${LIBMINC_INSTALL_BIN_DIR} COMPONENT libraries + ) + ENDIF( LIBMINC_INSTALL_LIB_DIR ) + +@@ -538,7 +541,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake + DESTINATION +- ${LIBMINC_INSTALL_LIB_DIR} ++ ${LIBMINC_INSTALL_LIB_DIR}/cmake + COMPONENT Development) + + ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) +diff --git a/config.h.cmake b/config.h.cmake +index 9ceffa8fc..21c2f3baf 100644 +--- a/config.h.cmake ++++ b/config.h.cmake +@@ -1,4 +1,8 @@ + /* various defines */ ++#ifdef _MSC_VER ++#define strcasecmp _stricmp ++#define strncasecmp _strnicmp ++#endif + + #ifndef MINC2 + #define MINC2 @MINC2@ +diff --git a/libcommon/minc_config.c b/libcommon/minc_config.c +index 531ef108e..5472d9274 100644 +--- a/libcommon/minc_config.c ++++ b/libcommon/minc_config.c +@@ -20,14 +20,6 @@ + + #include "minc_config.h" + +-#ifdef _MSC_VER +-#define snprintf _snprintf +-#define vsnprintf _vsnprintf +-#define strcasecmp _stricmp +-#define strncasecmp _strnicmp +-#endif +- +- + static const char *_CONFIG_VAR[]= + { + "MINC_FORCE_V2", diff --git a/ports/minc/config.patch b/ports/minc/config.patch new file mode 100644 index 00000000000000..a726b9a57f0392 --- /dev/null +++ b/ports/minc/config.patch @@ -0,0 +1,15 @@ +diff --git a/LIBMINCConfig.cmake.in b/LIBMINCConfig.cmake.in +index 7790597b2..c041b685a 100644 +--- a/LIBMINCConfig.cmake.in ++++ b/LIBMINCConfig.cmake.in +@@ -1,3 +1,4 @@ ++set(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../") + # LIBMINC CMake configuration file + + get_filename_component(LIBMINC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) +@@ -37,3 +38,4 @@ set( LIBMINC_FOUND 1 ) + # set( LIBMINC_TARGETS_IMPORTED 1 ) + # include( "${LIBMINC_CMAKE_DIR}/@LIBMINC_EXPORTED_TARGETS@.cmake" ) + #endif() ++unset(_IMPORT_PREFIX) +\ No newline at end of file diff --git a/ports/minc/portfile.cmake b/ports/minc/portfile.cmake new file mode 100644 index 00000000000000..4b9ff63b149d80 --- /dev/null +++ b/ports/minc/portfile.cmake @@ -0,0 +1,47 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO BIC-MNI/libminc + REF e75a936c12a305b596d743c26a5437196ebce2a4 + SHA512 744f879ac8f0594c310d1c1b7fe67543c5feeb3e5a0979035918dbb2bf1d0973fbd389e5357a75631e618cc614b648c21179f7467576bd68e3522e63f21451b0 + HEAD_REF master + PATCHES build.patch + config.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "minc1" LIBMINC_MINC1_SUPPORT +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # Symbols are not properly exported +endif() + +set(OPTIONS) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=ON") +else() + list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + "-DBUILD_TESTING=OFF" + "-DLIBMINC_USE_SYSTEM_NIFTI=ON" + ${OPTIONS} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libminc) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index dfccb9025821df..7c997451023ad2 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -1,8 +1,10 @@ Source: mlpack -Version: 3.2.2-3 +Version: 3.2.2 +Port-Version: 6 Homepage: https://github.com/mlpack/mlpack Description: mlpack is a fast, flexible machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms. -Build-Depends: openblas (!osx), clapack (!osx), boost, armadillo, ensmallen, stb +Build-Depends: openblas, lapack, boost, armadillo, ensmallen, stb +Supports: !uwp Feature: tools Description: Build command-line executables. diff --git a/ports/mlpack/cmakelists.patch b/ports/mlpack/cmakelists.patch index 9db41f91267dc5..79f176419bed90 100644 --- a/ports/mlpack/cmakelists.patch +++ b/ports/mlpack/cmakelists.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 26757a5..c200b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -288,6 +288,7 @@ endif() +@@ -288,6 +282,7 @@ endif() # and find LAPACK and BLAS ourselves, using a slightly modified variant of the # script Armadillo uses to find these. if (WIN32) @@ -10,16 +10,14 @@ index 26757a5..c200b40 100644 find_library(LAPACK_LIBRARY NAMES lapack liblapack lapack_win32_MT lapack_win32 PATHS "C:/Program Files/Armadillo" -@@ -305,24 +306,31 @@ if (WIN32) +@@ -305,24 +306,25 @@ if (WIN32) if (NOT BLAS_LIBRARY) message(FATAL_ERROR "Cannot find BLAS library (.lib)!") endif () + endif() -+ find_package(clapack CONFIG REQUIRED) -+ set(LAPACK_LIBRARIES lapack) -+ find_package(OpenBLAS CONFIG REQUIRED) -+ set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) ++ find_package(LAPACK REQUIRED) ++ find_package(BLAS REQUIRED) # Piggyback LAPACK and BLAS linking into Armadillo link. set(ARMADILLO_LIBRARIES - ${ARMADILLO_LIBRARIES} ${BLAS_LIBRARY} ${LAPACK_LIBRARY}) @@ -28,23 +26,19 @@ index 26757a5..c200b40 100644 # Ensure that the libraries are added to the MSVC IDE runtime path. - get_filename_component(BLAS_DIR ${BLAS_LIBRARY} DIRECTORY) - get_filename_component(LAPACK_DIR ${LAPACK_LIBRARY} DIRECTORY) -+ get_property(BLAS_DIR TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_LOCATION_RELEASE) -+ get_filename_component(BLAS_DIR ${BLAS_DIR} DIRECTORY) -+ get_property(LAPACK_DIR TARGET lapack PROPERTY IMPORTED_LOCATION_RELEASE) -+ get_filename_component(LAPACK_DIR ${LAPACK_DIR} DIRECTORY) # Sometimes, especially with an OpenBLAS install via nuget, the DLLs are # actually in ../../bin/x64/. Automatically add these. - if (EXISTS "${BLAS_DIR}/../../bin/x64/") - get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}/../../bin/x64" ABSOLUTE) -+ if (EXISTS "${BLAS_DIR}") ++ if (0) + get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () - if (EXISTS "${LAPACK_DIR}/../../bin/x64/") - get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}/../../bin/x64" ABSOLUTE) -+ if (EXISTS "${LAPACK_DIR}") ++ if (0) + get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () diff --git a/ports/mlpack/portfile.cmake b/ports/mlpack/portfile.cmake index a7d73b2e310ae7..11f6aa815ad9a7 100644 --- a/ports/mlpack/portfile.cmake +++ b/ports/mlpack/portfile.cmake @@ -38,14 +38,56 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if("tools" IN_LIST FEATURES) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) - file(GLOB MLPACK_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) - file(COPY ${MLPACK_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(REMOVE ${MLPACK_TOOLS}) - file(GLOB MLPACK_TOOLS_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) - file(REMOVE ${MLPACK_TOOLS_DEBUG}) + vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES + mlpack_adaboost + mlpack_approx_kfn + mlpack_cf + mlpack_dbscan + mlpack_decision_stump + mlpack_decision_tree + mlpack_det + mlpack_emst + mlpack_fastmks + mlpack_gmm_generate + mlpack_gmm_probability + mlpack_gmm_train + mlpack_hmm_generate + mlpack_hmm_loglik + mlpack_hmm_train + mlpack_hmm_viterbi + mlpack_hoeffding_tree + mlpack_kde + mlpack_kernel_pca + mlpack_kfn + mlpack_kmeans + mlpack_knn + mlpack_krann + mlpack_lars + mlpack_linear_regression + mlpack_linear_svm + mlpack_lmnn + mlpack_local_coordinate_coding + mlpack_logistic_regression + mlpack_lsh + mlpack_mean_shift + mlpack_nbc + mlpack_nca + mlpack_nmf + mlpack_pca + mlpack_perceptron + mlpack_preprocess_binarize + mlpack_preprocess_describe + mlpack_preprocess_imputer + mlpack_preprocess_scale + mlpack_preprocess_split + mlpack_radical + mlpack_random_forest + mlpack_range_search + mlpack_softmax_regression + mlpack_sparse_coding + ) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYRIGHT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYRIGHT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/monkeys-audio/CONTROL b/ports/monkeys-audio/CONTROL index 8b66f9027d06a4..388299f8c7e25f 100644 --- a/ports/monkeys-audio/CONTROL +++ b/ports/monkeys-audio/CONTROL @@ -1,5 +1,5 @@ Source: monkeys-audio -Version: 5.46 +Version: 5.48 Homepage: https://monkeysaudio.com Description: Monkey's Audio is an excellent audio compression tool which has multiple advantages over traditional methods. Audio files compressed with it end with .ape extension. diff --git a/ports/monkeys-audio/portfile.cmake b/ports/monkeys-audio/portfile.cmake index 320aeada95b312..f0edaaf32e0c77 100644 --- a/ports/monkeys-audio/portfile.cmake +++ b/ports/monkeys-audio/portfile.cmake @@ -2,12 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "UWP" "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) -set(MA_VERSION 546) +set(MA_VERSION 548) vcpkg_download_distfile(ARCHIVE URLS "https://monkeysaudio.com/files/MAC_SDK_${MA_VERSION}.zip" FILENAME "MAC_SDK_${MA_VERSION}.zip" - SHA512 5fd426e3fa1d9283ef812a039fe4290e67881aaf1c374ce912b31df894128413c57e23fda0e79c0ae1e1d117ba15c8dd635b784d150451602f06f2fd3fe41566 + SHA512 036c75f4cc8dc54837b2f9f822d260ebdbed918dff9ac744746e2786d13a33364d0cd7f380f015e89eaf5ebedd7180df979dfd15cb8f0160e339fafebc93f4ba ) vcpkg_extract_source_archive_ex( diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL deleted file mode 100644 index 6955ef15da9404..00000000000000 --- a/ports/mosquitto/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: mosquitto -Version: 1.6.8-1 -Build-Depends: c-ares, libwebsockets, openssl, pthreads -Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1. - MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino. -Homepage: https://mosquitto.org/download/ diff --git a/ports/mosquitto/portfile.cmake b/ports/mosquitto/portfile.cmake index 2c04a7bb05debd..8c83401c94e366 100644 --- a/ports/mosquitto/portfile.cmake +++ b/ports/mosquitto/portfile.cmake @@ -46,4 +46,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +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/ports/mosquitto/usage b/ports/mosquitto/usage new file mode 100644 index 00000000000000..1f4e6735c12c5e --- /dev/null +++ b/ports/mosquitto/usage @@ -0,0 +1,5 @@ +The package mosquitto provides CMake targets: + + find_package(mosquitto REQUIRED) + target_include_directories(main PRIVATE ${MOSQUITTO_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${MOSQUITTO_LIBRARIES}) diff --git a/ports/mosquitto/vcpkg-cmake-wrapper.cmake b/ports/mosquitto/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..ad8124c677974e --- /dev/null +++ b/ports/mosquitto/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,15 @@ +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h) + +find_library(MOSQUITTO_LIBRARY_DEBUG NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTO_LIBRARY_RELEASE NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTOPP_LIBRARY_DEBUG NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTOPP_LIBRARY_RELEASE NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(MOSQUITTO) +select_library_configurations(MOSQUITTOPP) + +set(MOSQUITTO_INCLUDE_DIRS ${MOSQUITTO_INCLUDE_DIR}) +set(MOSQUITTO_LIBRARIES ${MOSQUITTO_LIBRARY} ${MOSQUITTOPP_LIBRARY}) diff --git a/ports/mosquitto/vcpkg.json b/ports/mosquitto/vcpkg.json new file mode 100644 index 00000000000000..2e3654754bd238 --- /dev/null +++ b/ports/mosquitto/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "mosquitto", + "version-string": "1.6.8", + "port-version": 2, + "description": "Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1, MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model, This makes it suitable for machine to machine messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino", + "homepage": "https://mosquitto.org/download/", + "dependencies": [ + "c-ares", + "libwebsockets", + "openssl", + "pthreads" + ] +} diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL index 867ba8bcaebd88..998e5eacfe4b3f 100644 --- a/ports/mozjpeg/CONTROL +++ b/ports/mozjpeg/CONTROL @@ -1,4 +1,5 @@ Source: mozjpeg -Version: 2020-06-02 +Version: 2020-06-02-1 +Build-Depends: libpng Homepage: https://github.com/mozilla/mozjpeg Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg. diff --git a/ports/mozjpeg/fix-install-error.patch b/ports/mozjpeg/fix-install-error.patch index b0ba9ac2d7b71b..0d0a283652a6c2 100644 --- a/ports/mozjpeg/fix-install-error.patch +++ b/ports/mozjpeg/fix-install-error.patch @@ -1,126 +1,33 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 51f4714..9ca3463 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1370,21 +1370,28 @@ endif() +@@ -1369,13 +1369,13 @@ + ############################################################################### set(EXE ${CMAKE_EXECUTABLE_SUFFIX}) -+if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ set(REAL_BUILDS_PATH "Debug/") -+else() -+ set(REAL_BUILDS_PATH "Release/") -+endif() -+ if(WITH_TURBOJPEG) if(ENABLE_SHARED) - install(TARGETS turbojpeg tjbench -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) +- install(TARGETS turbojpeg tjbench ++ install(TARGETS turbojpeg #tjbench + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND CMAKE_C_LINKER_SUPPORTS_PDB) install(FILES "$" -- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) -+ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) - endif() - endif() - if(ENABLE_STATIC) -- install(TARGETS turbojpeg-static ARCHIVE -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS turbojpeg-static -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) - if(NOT ENABLE_SHARED) - if(MSVC_IDE OR XCODE) - set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") -@@ -1392,15 +1399,15 @@ if(WITH_TURBOJPEG) - set(DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif() - install(PROGRAMS ${DIR}/tjbench-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) -+ DESTINATION tools/mozjpeg RENAME tjbench${EXE}) - endif() - endif() - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h -- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) - endif() - - if(ENABLE_STATIC) -- install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) - if(NOT ENABLE_SHARED) - if(MSVC_IDE OR XCODE) - set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") -@@ -1408,15 +1415,15 @@ if(ENABLE_STATIC) - set(DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif() - install(PROGRAMS ${DIR}/cjpeg-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) -+ DESTINATION tools/mozjpeg RENAME cjpeg${EXE}) - install(PROGRAMS ${DIR}/djpeg-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) -+ DESTINATION tools/mozjpeg RENAME djpeg${EXE}) +@@ -1413,13 +1413,13 @@ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) install(PROGRAMS ${DIR}/jpegtran-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) -+ DESTINATION tools/mozjpeg RENAME jpegtran${EXE}) + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) endif() endif() -install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) ++#install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt -@@ -1424,10 +1431,10 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt - ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt -- ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION share/mozjpeg) - if(WITH_JAVA) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java -- DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+ DESTINATION share/mozjpeg) - endif() - - if(UNIX OR MINGW) -@@ -1439,12 +1446,12 @@ if(UNIX OR MINGW) - endif() - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc - ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/mozjpeg) - - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h - ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h -- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) - - include(cmakescripts/BuildPackages.cmake) - -diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt -index f0a7d87..1e82349 100644 ---- a/sharedlib/CMakeLists.txt -+++ b/sharedlib/CMakeLists.txt -@@ -92,11 +92,11 @@ add_executable(jcstest ../jcstest.c) - target_link_libraries(jcstest jpeg) - - install(TARGETS jpeg cjpeg djpeg jpegtran -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) - if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND - CMAKE_C_LINKER_SUPPORTS_PDB) - install(FILES "$" -- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) -+ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) - endif() diff --git a/ports/mozjpeg/portfile.cmake b/ports/mozjpeg/portfile.cmake index 93f9c86e94c8f4..9c756e778d11e8 100644 --- a/ports/mozjpeg/portfile.cmake +++ b/ports/mozjpeg/portfile.cmake @@ -12,34 +12,41 @@ vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) vcpkg_add_to_path(${NASM_EXE_PATH}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(ENABLE_STATIC_BUILD ON) - set(ENABLE_SHARED_BUILD OFF) -else() - set(ENABLE_STATIC_BUILD OFF) - set(ENABLE_SHARED_BUILD ON) -endif() - +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DDENABLE_SHARED=${ENABLE_SHARED_BUILD} - -DENABLE_STATIC=${ENABLE_STATIC_BUILD} + -DENABLE_SHARED=${ENABLE_SHARED} + -DENABLE_STATIC=${ENABLE_STATIC} -DWITH_CRT_DLL=${WITH_CRT_DLL} ) vcpkg_install_cmake() -#remove extra debug files +# 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() +endif() + +# Remove extra debug files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_tools(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) +vcpkg_copy_tools(TOOL_NAMES cjpeg djpeg jpegtran AUTO_CLEAN) +vcpkg_fixup_pkgconfig() -#remove empty folders after static build +# Remove empty folders after static build if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/mpg123/CONTROL b/ports/mpg123/CONTROL index deefddbdaa079b..3e7705ab08f280 100644 --- a/ports/mpg123/CONTROL +++ b/ports/mpg123/CONTROL @@ -1,4 +1,5 @@ Source: mpg123 -Version: 1.25.8-12 +Version: 1.25.8 +Port-Version: 13 Homepage: https://sourceforge.net/projects/mpg123/ Description: mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers 1, 2 and 3 (MPEG 1.0 layer 3 also known as MP3). diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 5190a17db091e5..9438c58115e5fa 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -116,97 +116,38 @@ elseif(VCPKG_TARGET_IS_WINDOWS) ${SOURCE_PATH}/src/libmpg123/mpg123.h.in DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") - file(REMOVE_RECURSE ${SOURCE_PATH}/build/debug) - file(REMOVE_RECURSE ${SOURCE_PATH}/build/release) - - ################ - # Debug build - ################ - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/debug --enable-debug=yes --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done.") - - message(STATUS "Installing ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg done.") - - ################ - # Release build - ################ - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make distclean - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/release --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done.") - - message(STATUS "Installing ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-rel - ) - message(STATUS "Installing ${TARGET_TRIPLET}-rel done.") - - file( - INSTALL - "${SOURCE_PATH}/build/debug/include/fmt123.h" - "${SOURCE_PATH}/build/debug/include/mpg123.h" - "${SOURCE_PATH}/build/debug/include/out123.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include +elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX) + set(MPG123_OPTIONS + --disable-dependency-tracking ) - if(EXISTS "${SOURCE_PATH}/build/debug/lib64/libmpg123.a") - file( - INSTALL - "${SOURCE_PATH}/build/debug/lib64/libmpg123.a" - "${SOURCE_PATH}/build/debug/lib64/libout123.a" - DESTINATION - ${CURRENT_INSTALLED_DIR}/debug/lib - ) - else() - file( - INSTALL - "${SOURCE_PATH}/build/debug/lib/libmpg123.a" - "${SOURCE_PATH}/build/debug/lib/libout123.a" - DESTINATION - ${CURRENT_INSTALLED_DIR}/debug/lib - ) + # Find cross-compiler prefix + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") endif() - - if(EXISTS "${SOURCE_PATH}/build/release/lib64/libmpg123.a") - file( - INSTALL - "${SOURCE_PATH}/build/release/lib64/libmpg123.a" - "${SOURCE_PATH}/build/release/lib64/libout123.a" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib + if(CMAKE_C_COMPILER) + vcpkg_execute_required_process( + COMMAND ${CMAKE_C_COMPILER} -dumpmachine + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME dumpmachine-${TARGET_TRIPLET} ) - else() - file( - INSTALL - "${SOURCE_PATH}/build/release/lib/libmpg123.a" - "${SOURCE_PATH}/build/release/lib/libout123.a" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib + file(READ ${CURRENT_BUILDTREES_DIR}/dumpmachine-${TARGET_TRIPLET}-out.log MPG123_HOST) + string(REPLACE "\n" "" MPG123_HOST "${MPG123_HOST}") + message(STATUS "Cross-compiling with ${CMAKE_C_COMPILER}") + message(STATUS "Detected autoconf triplet --host=${MPG123_HOST}") + set(MPG123_OPTIONS + --host=${MPG123_HOST} + ${MPG123_OPTIONS} ) endif() + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${MPG123_OPTIONS} + ) + vcpkg_install_make() + + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL deleted file mode 100644 index 0871ce157b27a6..00000000000000 --- a/ports/mpir/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: mpir -Version: 3.0.0-8 -Homepage: https://github.com/wbhart/mpir -Description: Multiple Precision Integers and Rationals. -Supports: !(uwp|arm) \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 118a19602e25c0..856e4e273d4b55 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,5 +1,9 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if gmp is installed. Please remove gmp, and try to install ${PORT} again if you need it.") +endif() + if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs") endif() @@ -30,44 +34,29 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) set(OPTIONS --disable-silent-rules --enable-gmpcompat --enable-cxx ${SHARED_STATIC}) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG} -O0 -g") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME configure-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Building ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME install-${TARGET_TRIPLET}-dbg - ) + string(APPEND VCPKG_C_FLAGS " -Wno-implicit-function-declaration") + string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE} -O2") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O2") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME configure-${TARGET_TRIPLET}-rel - ) - message(STATUS "Building ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME install-${TARGET_TRIPLET}-rel + # on Linux, autoconf is required; on macOS, it isn't + if(VCPKG_TARGET_IS_LINUX) + set(AUTOCONFIG "AUTOCONFIG") + endif() + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + ${AUTOCONFIG} + OPTIONS ${OPTIONS} ) + + vcpkg_install_make() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + endif() + + configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) - file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -113,37 +102,52 @@ elseif(VCPKG_TARGET_IS_WINDOWS) OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" ) - file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) - file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) + endif() endif() - file(GLOB HEADERS - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h - ) - file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - - file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) - file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) - - file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) - file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) - - list(APPEND REL_LIBS ${REL_LIBS_CXX}) - list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) - - file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB HEADERS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h + ) + file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) + file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) + list(APPEND REL_LIBS ${REL_LIBS_CXX}) + + file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) endif() - + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB HEADERS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmp.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmpxx.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.h + ) + file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + + file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) + file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) + list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) + + file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + endif() + vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -endif() \ No newline at end of file +endif() diff --git a/ports/mpir/vcpkg.json b/ports/mpir/vcpkg.json new file mode 100644 index 00000000000000..29754ccd9ace40 --- /dev/null +++ b/ports/mpir/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "mpir", + "version-string": "3.0.0", + "port-version": 10, + "description": "Multiple Precision Integers and Rationals", + "homepage": "https://github.com/wbhart/mpir", + "supports": "!(uwp | arm)" +} diff --git a/ports/msgpack/CONTROL b/ports/msgpack/CONTROL index 1715eb78059d7e..1ea2e19c2e72ca 100644 --- a/ports/msgpack/CONTROL +++ b/ports/msgpack/CONTROL @@ -1,4 +1,5 @@ Source: msgpack -Version: 3.2.0-1 +Version: 3.2.0 +Port-Version: 2 Homepage: https://github.com/msgpack/msgpack-c Description: MessagePack is an efficient binary serialization format, which lets you exchange data among multiple languages like JSON, except that it's faster and smaller. diff --git a/ports/msgpack/portfile.cmake b/ports/msgpack/portfile.cmake index b0939176c2c064..f6c6b4ed9f5d00 100644 --- a/ports/msgpack/portfile.cmake +++ b/ports/msgpack/portfile.cmake @@ -1,4 +1,7 @@ -include(vcpkg_common_functions) +if (EXISTS ${CURRENT_INSTALLED_DIR}/include/msgpack/pack.h) + message(FATAL_ERROR "Cannot install ${PORT} when rest-rpc is already installed, please remove rest-rpc using \"./vcpkg remove rest-rpc:${TARGET_TRIPLET}\"") +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO msgpack/msgpack-c diff --git a/ports/nana/CMakeLists.txt b/ports/nana/CMakeLists.txt index 7cd9865dcb60af..eca50614d0aa81 100644 --- a/ports/nana/CMakeLists.txt +++ b/ports/nana/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -project(nana VERSION 1.5.5 LANGUAGES CXX) +project(nana VERSION 1.7.2 LANGUAGES CXX) option(NANA_ENABLE_PNG "Enable PNG support" OFF) option(NANA_ENABLE_JPEG "Enable JPEG support" OFF) @@ -26,7 +26,7 @@ target_include_directories(nana PUBLIC $ $) -target_compile_features(nana PUBLIC cxx_std_14) +target_compile_features(nana PUBLIC cxx_std_17) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_link_libraries(nana PUBLIC c++experimental) diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL index c0abb1df034ad6..d6c94949850503 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,5 +1,6 @@ Source: nana -Version: 1.7.2-3 +Version: 1.7.2 +Port-Version: 4 Homepage: https://github.com/cnjinhao/nana Description: Cross-platform library for GUI programming in modern C++ style. Build-Depends: libpng, libjpeg-turbo, freetype (!uwp&&!windows), fontconfig (!uwp&&!windows) diff --git a/ports/nanogui/CONTROL b/ports/nanogui/CONTROL index 63b70db69f0055..9c532e4f15e2ee 100644 --- a/ports/nanogui/CONTROL +++ b/ports/nanogui/CONTROL @@ -1,5 +1,7 @@ Source: nanogui Version: 2019-09-23 +Port-Version: 1 Homepage: https://github.com/wjakob/nanogui Description: NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x or higher. -Build-Depends: glfw3, nanovg, eigen3 \ No newline at end of file +Build-Depends: glfw3, nanovg, eigen3 +Supports: !uwp diff --git a/ports/nanogui/portfile.cmake b/ports/nanogui/portfile.cmake index bc868e5498210a..f1cb824a72d1f8 100644 --- a/ports/nanogui/portfile.cmake +++ b/ports/nanogui/portfile.cmake @@ -1,21 +1,20 @@ -include(vcpkg_common_functions) - -if(VCPKG_TARGET_IS_UWP) - message(FATAL_ERROR "nanogui doesn't support UWP.") -endif() +vcpkg_fail_port_install(ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wjakob/nanogui - REF e9ec8a1a9861cf578d9c6e85a6420080aa715c03 #Commits on Sep 23, 2019 + REF e9ec8a1a9861cf578d9c6e85a6420080aa715c03 #Commits on Sep 23, 2019 SHA512 36c93bf977862ced2df4030211e2b83625e60a11fc9fdb6c1f2996bb234758331d3f41a7fbafd25a5bca0239ed9bac9c93446a4a7fac4c5e6d7943af2be3e14a HEAD_REF master PATCHES - fix-cmakelists.patch + fix-cmakelists.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DNANOGUI_EIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3 + -DEIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3 ) vcpkg_install_cmake() @@ -23,4 +22,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/neargye-semver/CONTROL b/ports/neargye-semver/CONTROL new file mode 100644 index 00000000000000..4b7745b394b8c0 --- /dev/null +++ b/ports/neargye-semver/CONTROL @@ -0,0 +1,4 @@ +Source: neargye-semver +Version: 0.2.2 +Description: C++17 header-only dependency-free versioning library complying with Semantic Versioning 2.0.0 +Homepage: https://github.com/Neargye/semver diff --git a/ports/neargye-semver/portfile.cmake b/ports/neargye-semver/portfile.cmake new file mode 100644 index 00000000000000..8a74ee93a98e2b --- /dev/null +++ b/ports/neargye-semver/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Neargye/semver + REF v0.2.2 + SHA512 f299e6d74f0232f40e20959ed3d7138d5faff924f60748827849e21951d76d34070bac2479a35f3ea6e801ec5e23ebf8391adedc70d778c4aa5e4c89b20c332c + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/include/semver.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/neargye) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index d277cd975fb649..92d0439d96285a 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,5 +1,6 @@ Source: netcdf-c -Version: 4.7.3-1 +Version: 4.7.3 +Port-Version: 4 Build-Depends: hdf5, curl Homepage: https://github.com/Unidata/netcdf-c Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/fix-dependency-libmath.patch b/ports/netcdf-c/fix-dependency-libmath.patch new file mode 100644 index 00000000000000..0db00ccaff9056 --- /dev/null +++ b/ports/netcdf-c/fix-dependency-libmath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 35c694f..e2c03e5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -839,7 +839,7 @@ ENDIF() + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ FIND_LIBRARY(HAVE_LIBM NAMES m libm math) + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index d1af9d9f175d18..4813aa5b83824d 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( config-pkg-location.patch use_targets.patch mpi.patch + fix-dependency-libmath.patch ) #Remove outdated find modules diff --git a/ports/netcdf-c/usage b/ports/netcdf-c/usage index 98824b337bfa8d..681a20f8c1bde9 100644 --- a/ports/netcdf-c/usage +++ b/ports/netcdf-c/usage @@ -1,4 +1,4 @@ The package netcdf-c provides CMake targets: find_package(netCDF CONFIG REQUIRED) - target_link_libraries(main PRIVATE netcdf) \ No newline at end of file + target_link_libraries(main PRIVATE netcdf) diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL index baf0147c68b475..b628a3825bd4e3 100644 --- a/ports/netcdf-cxx4/CONTROL +++ b/ports/netcdf-cxx4/CONTROL @@ -1,5 +1,6 @@ Source: netcdf-cxx4 Version: 4.3.1 +Port-Version: 1 Build-Depends: hdf5, netcdf-c Homepage: https://github.com/Unidata/netcdf-cxx4 Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch index 5d289ec2efdac1..73b9a0d0134ddb 100644 --- a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch +++ b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch @@ -1,32 +1,41 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 60c699d..6bd7822 100644 +index 60c699d..f06fcc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -402,7 +402,7 @@ ELSE(MSVC) - FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) - ENDIF(MSVC) - --CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) -+set(HAVE_H5FREE_MEMORY ON) - IF(NOT HAVE_H5FREE_MEMORY) - MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") - SET(NC_HAS_DEF_VAR_FILTER "") -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6a48709..79de128 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -399,7 +399,13 @@ IF(MSVC) +@@ -395,14 +395,20 @@ ENDIF(NC_HAS_DEF_VAR_FILTER) + ### + # Find HDF5 + ### +-IF(MSVC) ++IF(0) SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL NO_MODULES REQUIRED ${NC_HDF5_LINK_TYPE}) ELSE(MSVC) - FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + FIND_PACKAGE(hdf5 CONFIG REQUIRED) + set(HDF5_FOUND ${hdf5_FOUND}) -+ if (BUILD_SHARED_LIBS) ++ if (NOT HDF5_USE_STATIC_LIBRARIES) + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared hdf5::hdf5_hl-shared) + else() + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static hdf5::hdf5_hl-static) + endif() ENDIF(MSVC) - set(HAVE_H5FREE_MEMORY ON) +-CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) ++set(HAVE_H5FREE_MEMORY ON) + IF(NOT HAVE_H5FREE_MEMORY) + MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") + SET(NC_HAS_DEF_VAR_FILTER "") +diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt +index 30a4a96..1809d29 100644 +--- a/plugins/CMakeLists.txt ++++ b/plugins/CMakeLists.txt +@@ -23,7 +23,7 @@ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES OUTPUT_NAME "bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "h5bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "h5bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES RUNTIME_OUTPUT_NAME "h5bzip2") +-TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS}) ++TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS} ${HDF5_C_LIBRARY_hdf5}) + + ADD_LIBRARY(misc MODULE ${libmisc_SOURCES}) + SET_TARGET_PROPERTIES(misc PROPERTIES LIBRARY_OUTPUT_NAME "misc") diff --git a/ports/netcdf-cxx4/portfile.cmake b/ports/netcdf-cxx4/portfile.cmake index d90ea7131ab3c0..3efd8e3aa0eefc 100644 --- a/ports/netcdf-cxx4/portfile.cmake +++ b/ports/netcdf-cxx4/portfile.cmake @@ -1,6 +1,6 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HDF5_USE_STATIC_LIBRARIES) -set(HDF5_USE_STATIC_LIBRARIES ON) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH diff --git a/ports/nettle/CONTROL b/ports/nettle/CONTROL index e73b0df663cb18..c6e3e37353b7cc 100644 --- a/ports/nettle/CONTROL +++ b/ports/nettle/CONTROL @@ -1,5 +1,5 @@ Source: nettle -Version: 3.5.1-1 +Version: 3.5.1-2 Homepage: https://git.lysator.liu.se/nettle/nettle Description: Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space. Build-Depends: gmp, vs-yasm (windows) \ No newline at end of file diff --git a/ports/ngspice/CONTROL b/ports/ngspice/CONTROL new file mode 100644 index 00000000000000..40a5d35b9cacc0 --- /dev/null +++ b/ports/ngspice/CONTROL @@ -0,0 +1,5 @@ +Source: ngspice +Version: 32 +Homepage: http://ngspice.sourceforge.net/ +Description: Ngspice is a mixed-level/mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley SPICE +Supports: !(linux|osx|arm|uwp) diff --git a/ports/ngspice/portfile.cmake b/ports/ngspice/portfile.cmake new file mode 100644 index 00000000000000..5265ac816ce4f8 --- /dev/null +++ b/ports/ngspice/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "arm" "arm64") + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO ngspice/ng-spice-rework + REF 32 + FILENAME "ngspice-32.tar.gz" + SHA512 222eaa0cd6577a6eb8454bb49a7050a162d430c4b07a4fdc6baf350c5b3f5b018bac640fd44f465ec09c8cba6a9729b1cbe8d3d8c097f672acc2c22fabe8f4bc + PATCHES + use-winbison-global.patch +) + +vcpkg_find_acquire_program(BISON) + +get_filename_component(BISON_DIR "${BISON}" DIRECTORY) +vcpkg_add_to_path(PREPEND "${BISON_DIR}") + +# Ensure its windows +if (VCPKG_TARGET_IS_WINDOWS) + # Sadly, vcpkg globs .libs inside install_msbuild and whines that the 47 year old SPICE format isn't a MSVC lib ;) + # We need to kill them off first before the source tree is copied to a tmp location by install_msbuild + + file(REMOVE_RECURSE ${SOURCE_PATH}/contrib) + file(REMOVE_RECURSE ${SOURCE_PATH}/examples) + file(REMOVE_RECURSE ${SOURCE_PATH}/man) + file(REMOVE_RECURSE ${SOURCE_PATH}/tests) + + # We use build_msbuild because install_msbuild is incompatible due to SPICE using .lib for the last 47 years.... + vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION + SOURCE_PATH ${SOURCE_PATH} + INCLUDES_SUBPATH /src/include + LICENSE_SUBPATH COPYING + PLATFORM ${TRIPLET_SYSTEM_ARCH} # install_msbuild swaps x86 for win32(bad) if we dont force our own setting + PROJECT_SUBPATH visualc/sharedspice.sln + TARGET Build + ) +else() + message(FATAL_ERROR "Sorry but ngspice only can be built in Windows") +endif() + +# Unforunately install_msbuild isn't able to dual include directories that effectively layer +file(GLOB NGSPICE_INCLUDES + ${SOURCE_PATH}/visualc/src/include/ngspice/* +) +file(COPY ${NGSPICE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ngspice) + +vcpkg_copy_pdbs() diff --git a/ports/ngspice/use-winbison-global.patch b/ports/ngspice/use-winbison-global.patch new file mode 100644 index 00000000000000..f28a34acec3da9 --- /dev/null +++ b/ports/ngspice/use-winbison-global.patch @@ -0,0 +1,13 @@ +diff --git a/visualc/sharedspice.vcxproj b/visualc/sharedspice.vcxproj +index 96786b1..f5d9322 100644 +--- a/visualc/sharedspice.vcxproj ++++ b/visualc/sharedspice.vcxproj +@@ -879,7 +879,7 @@ + + + invoke win_bison.exe for %(Identity) +- ..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 ++ win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 + .\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h + + diff --git a/ports/nifticlib/CONTROL b/ports/nifticlib/CONTROL new file mode 100644 index 00000000000000..acd8aedaa51db3 --- /dev/null +++ b/ports/nifticlib/CONTROL @@ -0,0 +1,25 @@ +Source: nifticlib +Version: 2020-04-30 +Description: Nifticlib is a C I/O library for reading and writing files in the nifti-1 data format. +Homepage: NIFTI-Imaging/nifti_clib +Build-Depends: zlib +Default-Features: nifti2, nifticdf +Supports: !uwp + +Feature: cifti +Description: Build cifti libraries and tools + +Feature: fsl +Description: Build fsl libraries and tools + +Feature: nifti2 +Description: Build nifti2 libraries and tools + +Feature: nifticdf +Description: Build nifticdf libraries and tools + +Feature: tools +Description: Build tools + +Feature: tests +Description: Build tests diff --git a/ports/nifticlib/portfile.cmake b/ports/nifticlib/portfile.cmake new file mode 100644 index 00000000000000..c9d74a49e5c39e --- /dev/null +++ b/ports/nifticlib/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NIFTI-Imaging/nifti_clib + REF 65f801b9c2f1f15f4de4a19d45e6595c25765632 + SHA512 be03cdc6cf17fd9ff74c5ecc1f6b2132121bb4b7973a731da334af2a8428d1f0dbbf7b94b2511d1ff7e515b8cc4cf3316d62b189566fb6ffc88c6146eebd48ff + HEAD_REF master + PATCHES zlib_include.patch +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "cifti" USE_CIFTI_CODE + "fsl" USE_FSL_CODE + "nifti2" USE_NIFTI2_CODE + "nifticdf" USE_NIFTICDF_CODE + "tools" NIFTI_BUILD_APPLICATIONS + "tests" BUILD_TESTING +) +set(TOOL_NAMES) +if("tools" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifti_stats nifti_tool nifti1_tool) +endif() +if("tests" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifit_test) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake TARGET_PATH share) + +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nifticlib/zlib_include.patch b/ports/nifticlib/zlib_include.patch new file mode 100644 index 00000000000000..1ef462b7f1f8de --- /dev/null +++ b/ports/nifticlib/zlib_include.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54150d739..c3ca8fe50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,6 +77,7 @@ set_if_not_defined(ZNZ_COMPILE_DEF "") + if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package + ### USE AS STAND ALONE PACKAGE + find_package(ZLIB REQUIRED) ++ include_directories(${ZLIB_INCLUDE_DIRS}) + set(NIFTI_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + endif() + #message(STATUS "---------------------ZLIB -${NIFTI_ZLIB_LIBRARIES}--") diff --git a/ports/nlohmann-json/CONTROL b/ports/nlohmann-json/CONTROL index 3e8f51fa6a8b43..f474ce9067e82e 100644 --- a/ports/nlohmann-json/CONTROL +++ b/ports/nlohmann-json/CONTROL @@ -1,5 +1,4 @@ Source: nlohmann-json -Version: 3.8.0 -Port-Version: 2 +Version: 3.9.1 Homepage: https://github.com/nlohmann/json Description: JSON for Modern C++ diff --git a/ports/nlohmann-json/portfile.cmake b/ports/nlohmann-json/portfile.cmake index 1f5f8575cf52df..448ca04b399c1d 100644 --- a/ports/nlohmann-json/portfile.cmake +++ b/ports/nlohmann-json/portfile.cmake @@ -1,4 +1,4 @@ -set(SOURCE_VERSION 3.8.0) +set(SOURCE_VERSION 3.9.1) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${PORT}-v${SOURCE_VERSION}) file(MAKE_DIRECTORY ${SOURCE_PATH}) @@ -13,16 +13,17 @@ function(download_src SUBPATH SHA512) file(COPY ${FILE} DESTINATION ${SUBPATH_DIR}) endfunction() -download_src(CMakeLists.txt 18151b19cb5258e58feffac8d4aed559c87e158dc217f47be23351b15c86e1d3f3c5ad2f7d11beabe3f0c0f948f3da1b9a807d425b1a9a0bb1ed74767cefafa9) +download_src(CMakeLists.txt d0ea797de0e3f98778cfcfa1249e9a363f0ae14f057f8f4338a2026d59eb929ddee9e45889c7f25d2c48633baa89ae9b4db4e5d99205f5ce7e1238fd82f3c113) download_src(LICENSE.MIT d5f7bb6a33469e19250a5e20db44e7ba09602ee85bc0afb03e4932402b08ca1c0dbbe6376b7e0a84eb11c782d70ae96f130755967204d35420c6ecbcafd301e5) download_src(nlohmann_json.natvis 9bce6758db0e54777394a4e718e60a281952b15f0c6dc6a6ad4a6d023c958b5515b2d39b7d4c66c03f0d3fdfdc1d6c23afb8b8419f1345c9d44d7b9a9ee2582b) download_src(cmake/config.cmake.in 7caab6166baa891f77f5b632ac4a920e548610ec41777b885ec51fe68d3665ffe91984dd2881caf22298b5392dfbd84b526fda252467bb66de9eb90e6e6ade5a) +download_src(cmake/pkg-config.pc.in 34afe9f9ef9c77c9053f81bdc5605523ba5c20ca1bc2e0cb26afe1754362b25e88d809df47cdd63024c60f346240010a6aa343ff46d6a959a38612b3f1955664) download_src(cmake/nlohmann_jsonConfigVersion.cmake.in 3b3ca2cfe740ba9646e5976b1112ba37c229bf527959bfb47a5e6c2fcd5ba6b5626d3c2455c181fe41a72ec78500738e2950e4fe76a2e91ba2073ba01f5595a8) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/nlohmann/json/releases/download/v${SOURCE_VERSION}/include.zip" FILENAME ${PORT}-v${SOURCE_VERSION}-include.zip - SHA512 f4453aced8d74cf7c65d038fdf8da1e2b2153a1c15e26c7f25394ab1ce81f78920dd30b418b1db4cbf3f934df0459024230700bdd943aad569b2525b6a26e5d0 + SHA512 24984da33c5bf80eb276712d4bdc698c2724e72dc0f4c70e87527fb6b16e21f535f5a022d52c7ed2f59dcfe4a4e5b61a56101b61def09b31c827689f6c7ec673 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH OUT_PATH diff --git a/ports/numcpp/portfile.cmake b/ports/numcpp/portfile.cmake new file mode 100644 index 00000000000000..d605b19da6b892 --- /dev/null +++ b/ports/numcpp/portfile.cmake @@ -0,0 +1,24 @@ +# header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO dpilger26/NumCpp + REF fc68d897f8c2ae4f5b14baff3eefda897351abbd # 2.1.0 + SHA512 ce407d9782d304658853cd66ba5901a4dc84d8cf74d45b2dd466ca6328f6bf60b39906efd5373624df6b46c4253f861208b15254d0e156fdb09f32ca731ad2bc + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DNUMCPP_TEST=OFF + -DNUMCPP_EXAMPLES=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/NumCpp/cmake TARGET_PATH share/NumCpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/numcpp/vcpkg.json b/ports/numcpp/vcpkg.json new file mode 100644 index 00000000000000..db31f6a3b095d1 --- /dev/null +++ b/ports/numcpp/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "numcpp", + "version-string": "2.1.0", + "description": "C++ implementation of the Python Numpy library", + "homepage": "https://dpilger26.github.io/NumCpp", + "license": "MIT", + "dependencies": [ + "boost-algorithm", + "boost-endian", + "boost-integer", + "boost-math", + "boost-predef", + "boost-random", + "boost-type-traits" + ], + "features": [ + { + "name": "python", + "description": "Interacting with python with pybind11 interface", + "dependencies": [ + "boost-python", + "pybind11" + ] + } + ] +} diff --git a/ports/ocilib/CONTROL b/ports/ocilib/CONTROL index c5d4fbb3742c95..a4d44f4a36d902 100644 --- a/ports/ocilib/CONTROL +++ b/ports/ocilib/CONTROL @@ -1,5 +1,6 @@ Source: ocilib -Version: 4.6.4-1 +Version: 4.6.4 +Port-Version: 2 Homepage: https://vrogier.github.io/ocilib/ Description: OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases. Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/ocilib/portfile.cmake b/ports/ocilib/portfile.cmake index 84912c10f6c5d5..a8a451f484d899 100644 --- a/ports/ocilib/portfile.cmake +++ b/ports/ocilib/portfile.cmake @@ -1,62 +1,64 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO vrogier/ocilib - REF v4.6.4 - SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a - HEAD_REF master - PATCHES - out_of_source_build_version_file_configure.patch + OUT_SOURCE_PATH SOURCE_PATH + REPO vrogier/ocilib + REF v4.6.4 + SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a + HEAD_REF master + PATCHES + out_of_source_build_version_file_configure.patch ) if(VCPKG_TARGET_IS_WINDOWS) - if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") set(SOLUTION_TYPE vs2019) set(OCILIB_ARCH_X86 x86) set(OCILIB_ARCH_X64 x64) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(SOLUTION_TYPE vs2017) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - else() + else() set(SOLUTION_TYPE vs2015) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - endif() + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM ${OCILIB_ARCH_X86}) else() set(PLATFORM ${OCILIB_ARCH_X64}) endif() - - # There is no debug configuration - # As it is a C library, build the release configuration and copy its output to the debug folder - set(VCPKG_BUILD_TYPE release) - vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln - INCLUDES_SUBPATH include - LICENSE_SUBPATH LICENSE - RELEASE_CONFIGURATION "Release - ANSI" - PLATFORM ${PLATFORM} - USE_VCPKG_INTEGRATION - ALLOW_ROOT_INCLUDES) + + # There is no debug configuration + # As it is a C library, build the release configuration and copy its output to the debug folder + set(VCPKG_BUILD_TYPE release) + vcpkg_install_msbuild( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln + INCLUDES_SUBPATH include + LICENSE_SUBPATH LICENSE + RELEASE_CONFIGURATION "Release - ANSI" + PLATFORM ${PLATFORM} + USE_VCPKG_INTEGRATION + ALLOW_ROOT_INCLUDES) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) - file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) + file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) else() - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - --with-oracle-import=runtime - ) + vcpkg_configure_make( + COPY_SOURCE + AUTOCONFIG + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + --with-oracle-import=runtime + ) - vcpkg_install_make() + vcpkg_install_make() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endif() diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL deleted file mode 100644 index 521f13f1738f14..00000000000000 --- a/ports/ogre/CONTROL +++ /dev/null @@ -1,18 +0,0 @@ -Source: ogre -Version: 1.12.1-1 -Build-Depends: freeimage, freetype, zlib, zziplib -Homepage: https://github.com/OGRECave/ogre -Description: 3D Object-Oriented Graphics Rendering Engine - -Feature: d3d9 -Description: Build Direct3D9 RenderSystem - -Feature: csharp -Description: Build csharp bindings - -Feature: java -Description: Build Java (JNI) bindings - -Feature: python -Description: Build Python bindings -Build-Depends: python3 diff --git a/ports/ogre/fix-dependency.patch b/ports/ogre/fix-dependency.patch new file mode 100644 index 00000000000000..ba7e7516de72fa --- /dev/null +++ b/ports/ogre/fix-dependency.patch @@ -0,0 +1,45 @@ +diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake +index 959fdf5..dcd28bb 100644 +--- a/CMake/Dependencies.cmake ++++ b/CMake/Dependencies.cmake +@@ -217,7 +217,7 @@ find_package(FreeImage) + macro_log_feature(FreeImage_FOUND "freeimage" "Support for commonly used graphics image formats" "http://freeimage.sourceforge.net" FALSE "" "") + + # Find FreeType +-find_package(Freetype) ++find_package(freetype CONFIG REQUIRED) + macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "") + + # Find X11 +@@ -291,7 +291,7 @@ macro_log_feature(SWIG_FOUND "SWIG" "Language bindings (Python, Java, C#) for OG + # Find sdl2 + if(NOT ANDROID AND NOT EMSCRIPTEN) + # find script does not work in cross compilation environment +- find_package(SDL2 QUIET) ++ find_package(SDL2 CONFIG REQUIRED) + macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "") + if(SDL2_FOUND AND NOT TARGET SDL2::SDL2) + add_library(SDL2::SDL2 INTERFACE IMPORTED) +diff --git a/PlugIns/DotScene/CMakeLists.txt b/PlugIns/DotScene/CMakeLists.txt +index fd285df..ab8e9c1 100644 +--- a/PlugIns/DotScene/CMakeLists.txt ++++ b/PlugIns/DotScene/CMakeLists.txt +@@ -1,4 +1,4 @@ +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") + list(APPEND HEADER_FILES ${PROJECT_BINARY_DIR}/include/OgreDotScenePluginExports.h) +diff --git a/Tools/XMLConverter/CMakeLists.txt b/Tools/XMLConverter/CMakeLists.txt +index 8fe9683..2a516b2 100644 +--- a/Tools/XMLConverter/CMakeLists.txt ++++ b/Tools/XMLConverter/CMakeLists.txt +@@ -22,7 +22,7 @@ set(SOURCE_FILES + ) + + # allow override by cmake +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + add_executable(OgreXMLConverter ${HEADER_FILES} ${SOURCE_FILES}) + target_include_directories(OgreXMLConverter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/ports/ogre/fix-findimgui.patch b/ports/ogre/fix-findimgui.patch new file mode 100644 index 00000000000000..efd30d061ea704 --- /dev/null +++ b/ports/ogre/fix-findimgui.patch @@ -0,0 +1,35 @@ +diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt +index 1cea873..d3e756e 100644 +--- a/Components/Overlay/CMakeLists.txt ++++ b/Components/Overlay/CMakeLists.txt +@@ -19,12 +19,8 @@ list(APPEND HEADER_FILES + file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + + if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) +- list(APPEND SOURCE_FILES +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_draw.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_widgets.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_demo.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype/imgui_freetype.cpp) ++ find_package(imgui CONFIG REQUIRED) ++ find_path(IMGUI_INCLUDE_DIR imgui.h) + else() + list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreImGuiOverlay.cpp") + endif() +@@ -32,13 +28,13 @@ endif() + # setup target + add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) + set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) +-target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) ++target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB imgui::imgui) + target_include_directories(OgreOverlay PUBLIC + "$" + $ + PRIVATE ${FREETYPE_INCLUDE_DIRS}) + +-if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) ++if(0) + target_include_directories(OgreOverlay PUBLIC + PUBLIC "$" + PRIVATE "$") diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index f5faac14b88890..408ce416bf6544 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -9,11 +9,13 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OGRECave/ogre - REF 8083067c1835147de5d82015347d95c710e36bc0 - SHA512 0690aaff0bea74c38598894939396cab8077b84bda166deb4790fba87566114bc5267660e8efc4de9babeb1b8bddf73530e1a1dbbc63c7e24b14bc012b033bc8 + REF 8ff1a4046716244fc4b3a3e44e5b6abeda755b0a #v1.12.7 + SHA512 60c66118e35904cbabe881301f3e59026483507341450956f99b67220e1aaebd7035caac69c3e06cf45f08163254264da111b93d0c6b3402c3fba64858786b66 HEAD_REF master PATCHES toolchain_fixes.patch + fix-dependency.patch + fix-findimgui.patch ) file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake") diff --git a/ports/ogre/toolchain_fixes.patch b/ports/ogre/toolchain_fixes.patch index 9ff2d87dfe6b1d..cae36e1ebbbf9a 100644 --- a/ports/ogre/toolchain_fixes.patch +++ b/ports/ogre/toolchain_fixes.patch @@ -20,10 +20,10 @@ index a7a3796..2e21403 100644 set(INST_FILES Utils/FindPkgMacros.cmake) diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake -index 783755e..79f7514 100644 +index 06a055b..09d10bd 100644 --- a/CMake/InstallResources.cmake +++ b/CMake/InstallResources.cmake -@@ -208,10 +208,12 @@ endif () +@@ -201,10 +201,12 @@ endif () # Create the CMake package files include(CMakePackageConfigHelpers) @@ -38,8 +38,8 @@ index 783755e..79f7514 100644 + set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") + endif() endif() - configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${PROJECT_BINARY_DIR}/cmake/OGREConfig.cmake - INSTALL_DESTINATION ${OGRE_CMAKE_DIR} + if(WIN32) + set(OGRE_PLUGIN_DIR_CMAKE "bin") diff --git a/CMake/Packages/FindCg.cmake b/CMake/Packages/FindCg.cmake index 4501cf9..7eb57c3 100644 --- a/CMake/Packages/FindCg.cmake @@ -93,7 +93,7 @@ index 7125895..13a306f 100644 findpkg_finish(HLSL2GLSL) add_parent_dir(HLSL2GLSL_INCLUDE_DIRS HLSL2GLSL_INCLUDE_DIR) diff --git a/CMake/Packages/FindNVAPI.cmake b/CMake/Packages/FindNVAPI.cmake -index 2b9deba..f33a298 100644 +index 95c70cd..893ce01 100644 --- a/CMake/Packages/FindNVAPI.cmake +++ b/CMake/Packages/FindNVAPI.cmake @@ -44,7 +44,7 @@ findpkg_framework(NVAPI) @@ -238,10 +238,10 @@ index 374f84b..dc7066d 100644 # Generate debug names from given release names diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3e09d2d..58968f0 100644 +index 1602572..9fddbe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -274,7 +274,7 @@ elseif(EMSCRIPTEN) +@@ -269,7 +269,7 @@ elseif(EMSCRIPTEN) elseif (APPLE AND NOT APPLE_IOS) set(XCODE_ATTRIBUTE_SDKROOT macosx) @@ -250,32 +250,6 @@ index 3e09d2d..58968f0 100644 execute_process(COMMAND xcodebuild -version -sdk "${XCODE_ATTRIBUTE_SDKROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT) string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}") else() -diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt -index bdb303d..d9cc221 100644 ---- a/Components/Overlay/CMakeLists.txt -+++ b/Components/Overlay/CMakeLists.txt -@@ -21,7 +21,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") - # setup target - add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} ${PLATFORM_SOURCE_FILES}) - set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) --target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE "${FREETYPE_LIBRARIES}" ZLIB::ZLIB) -+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) - target_include_directories(OgreOverlay PUBLIC - "$" - $ -diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt -index 6ec4e34..cc9cb9d 100644 ---- a/OgreMain/CMakeLists.txt -+++ b/OgreMain/CMakeLists.txt -@@ -225,8 +225,6 @@ if (APPLE) - set_target_properties(OgreMain PROPERTIES - LINK_FLAGS "-framework IOKit -framework Cocoa -framework Carbon -framework OpenGL -framework CoreVideo" - ) -- -- set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)") - - if(OGRE_BUILD_LIBS_AS_FRAMEWORKS) - add_custom_command(TARGET OgreMain POST_BUILD diff --git a/PlugIns/EXRCodec/CMakeLists.txt b/PlugIns/EXRCodec/CMakeLists.txt index e9c936a..bb8747e 100644 --- a/PlugIns/EXRCodec/CMakeLists.txt diff --git a/ports/ogre/vcpkg.json b/ports/ogre/vcpkg.json new file mode 100644 index 00000000000000..133fb3cfb200e8 --- /dev/null +++ b/ports/ogre/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "ogre", + "version-string": "1.12.7", + "description": "3D Object-Oriented Graphics Rendering Engine", + "homepage": "https://github.com/OGRECave/ogre", + "dependencies": [ + "freeimage", + "freetype", + { + "name": "imgui", + "features": [ + "freetype" + ] + }, + "pugixml", + "sdl2", + "zlib", + "zziplib" + ], + "features": [ + { + "name": "csharp", + "description": "Build csharp bindings" + }, + { + "name": "d3d9", + "description": "Build Direct3D9 RenderSystem" + }, + { + "name": "java", + "description": "Build Java (JNI) bindings" + }, + { + "name": "python", + "description": "Build Python bindings", + "dependencies": [ + "python3" + ] + } + ] +} diff --git a/ports/ompl/CONTROL b/ports/ompl/CONTROL index 8a60f34cdd4bc2..c82008ed65beea 100644 --- a/ports/ompl/CONTROL +++ b/ports/ompl/CONTROL @@ -1,5 +1,5 @@ Source: ompl -Version: 1.4.2-4 +Version: 1.5.0 Homepage: https://bitbucket.org/ompl Description: The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms Build-Depends: boost-dynamic-bitset, boost-filesystem, boost-graph, boost-odeint, boost-program-options, boost-serialization, boost-system, boost-test, boost-ublas, boost-timer, eigen3 diff --git a/ports/ompl/portfile.cmake b/ports/ompl/portfile.cmake index 074d2b852aa14a..3dab51fcd061e8 100644 --- a/ports/ompl/portfile.cmake +++ b/ports/ompl/portfile.cmake @@ -1,34 +1,37 @@ vcpkg_buildpath_length_warning(37) -set(OMPL_VERSION 1.4.2) -set(OMPL_DISTNAME "ompl") -set(OMPL_CHECKSUM "1dc477ee471c0570fd94838b072105960e09186f29634e2f61d885153df36532ab40e30912b534c61f222c09dad63fc6097d324b53c265f9284f20c585d3095c") +set(OMPL_VERSION 1.5.0) if("app" IN_LIST FEATURES) - set(OMPL_DISTNAME "omplapp") - set(OMPL_CHECKSUM "04812a659fd81c2c541907911cbf4e5987be034546e8e48ed3d11b2b2f9ad3f7931f15d30a32ce3b64deb66b13875970797ac5072e92bfa0841e8d27d85fcb18") + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/ompl/omplapp/releases/download/1.5.0/omplapp-1.5.0-Source.tar.gz" + FILENAME "omplapp-${OMPL_VERSION}.tar.gz" + SHA512 ad221b67146915cb63be6731ca2fa7d827d85b7fd175d87ee64c799311dfe4878935881b1ae6447357fdd178f70c9aa01b178e857261a8d8769affa1e58ed72b + ) +else() + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/ompl/ompl/archive/1.5.0.tar.gz" + FILENAME "ompl-${OMPL_VERSION}.tar.gz" + SHA512 a300682fa0af40768c93e44b819c677b6121812e4f968ad89b5ae4044f3171a7febca63fa5645f2ad0f99ec3dfb3b02fe8c7443c4e389bf19a4a4bc9c7a5d013 + ) endif() -vcpkg_download_distfile(ARCHIVE - URLS "https://bitbucket.org/ompl/ompl/downloads/${OMPL_DISTNAME}-${OMPL_VERSION}-Source.tar.gz" - FILENAME "${OMPL_DISTNAME}-${OMPL_VERSION}.tar.gz" - SHA512 ${OMPL_CHECKSUM} -) - vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} REF ${OMPL_VERSION} ) -#Due to there are URL before the change text, using patch modify this change failed, so use the following command instead of patch. +# Based on selected features different files get downloaded, so use the following command instead of patch. file(READ ${SOURCE_PATH}/CMakeLists.txt _contents) -string(REPLACE "find_package(Eigen3 REQUIRED)" "find_package(Eigen3 CONFIG REQUIRED)" _contents "${_contents}") +string(REPLACE "find_package(Eigen3 REQUIRED)" "find_package(Eigen3 REQUIRED CONFIG)" _contents "${_contents}") +string(REPLACE "find_package(ccd REQUIRED)" "find_package(ccd REQUIRED CONFIG)" _contents "${_contents}") file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${_contents}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE OPTIONS -DOMPL_VERSIONED_INSTALL=OFF -DOMPL_REGISTRATION=OFF @@ -57,6 +60,7 @@ if ("app" IN_LIST FEATURES) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/include/omplapp/CMakeFiles ${CURRENT_PACKAGES_DIR}/share/ompl/resources ${CURRENT_PACKAGES_DIR}/share/ompl/webapp ) diff --git a/ports/openal-soft/CONTROL b/ports/openal-soft/CONTROL index 6b84e63ff2b8b5..a139fb9e8085a8 100644 --- a/ports/openal-soft/CONTROL +++ b/ports/openal-soft/CONTROL @@ -1,6 +1,6 @@ Source: openal-soft Version: 1.20.1 -Port-Version: 4 +Port-Version: 5 Homepage: https://github.com/kcat/openal-soft Description: OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. Supports: !uwp diff --git a/ports/openal-soft/fix-mingw-build.patch b/ports/openal-soft/fix-mingw-build.patch new file mode 100644 index 00000000000000..ffb2db303a4ad4 --- /dev/null +++ b/ports/openal-soft/fix-mingw-build.patch @@ -0,0 +1,14 @@ +diff --git a/common/alstring.h b/common/alstring.h +index 194e54a1..5a5f87ed 100644 +--- a/common/alstring.h ++++ b/common/alstring.h +@@ -4,6 +4,9 @@ + #include + #include + ++// This fixes MinGW link errors. It defines strcasecmp and strncasecmp in string.h. ++#include ++ + #include "almalloc.h" + + diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 5b6c8067ce5948..31ebc6bae143ad 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES dont-export-symbols-in-static-build.patch fix-arm-builds.patch + fix-mingw-build.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL index 3c2b0b7ebe68d7..a5240e2b49b079 100644 --- a/ports/openblas/CONTROL +++ b/ports/openblas/CONTROL @@ -1,5 +1,6 @@ Source: openblas -Version: 0.3.9-1 +Version: 0.3.9 +Port-Version: 3 Homepage: https://github.com/xianyi/OpenBLAS -Build-Depends: pthread (linux) +Build-Depends: pthread (linux&osx) Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/ports/openblas/FindBLAS.cmake b/ports/openblas/FindBLAS.cmake deleted file mode 100644 index 164e79f3b24c8c..00000000000000 --- a/ports/openblas/FindBLAS.cmake +++ /dev/null @@ -1,816 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#[=======================================================================[.rst: -FindBLAS --------- - -Find Basic Linear Algebra Subprograms (BLAS) library - -This module finds an installed Fortran library that implements the -BLAS linear-algebra interface (see http://www.netlib.org/blas/). The -list of libraries searched for is taken from the ``autoconf`` macro file, -``acx_blas.m4`` (distributed at -http://ac-archive.sourceforge.net/ac-archive/acx_blas.html). - -Input Variables -^^^^^^^^^^^^^^^ - -The following variables may be set to influence this module's behavior: - -``BLA_STATIC`` - if ``ON`` use static linkage - -``BLA_VENDOR`` - If set, checks only the specified vendor, if not set checks all the - possibilities. List of vendors valid in this module: - - * Goto - * OpenBLAS - * FLAME - * ATLAS PhiPACK - * CXML - * DXML - * SunPerf - * SCSL - * SGIMATH - * IBMESSL - * Intel10_32 (intel mkl v10 32 bit) - * Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model) - * Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model) - * Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model) - * Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model) - * Intel (obsolete versions of mkl 32 and 64 bit) - * ACML - * ACML_MP - * ACML_GPU - * Apple - * NAS - * Generic - -``BLA_F95`` - if ``ON`` tries to find the BLAS95 interfaces - -``BLA_PREFER_PKGCONFIG`` - if set ``pkg-config`` will be used to search for a BLAS library first - and if one is found that is preferred - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -``BLAS_FOUND`` - library implementing the BLAS interface is found -``BLAS_LINKER_FLAGS`` - uncached list of required linker flags (excluding ``-l`` and ``-L``). -``BLAS_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use BLAS (may be empty if compiler implicitly links BLAS) -``BLAS95_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use BLAS95 interface -``BLAS95_FOUND`` - library implementing the BLAS95 interface is found - -.. note:: - - C or CXX must be enabled to use Intel Math Kernel Library (MKL) - - For example, to use Intel MKL libraries and/or Intel compiler: - - .. code-block:: cmake - - set(BLA_VENDOR Intel10_64lp) - find_package(BLAS) - -Hints -^^^^^ - -Set ``MKLROOT`` environment variable to a directory that contains an MKL -installation. - -#]=======================================================================] - -include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -include(${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -include(${CMAKE_ROOT}/Modules/CMakePushCheckState.cmake) -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -cmake_push_check_state() -set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY}) - -set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - -# Check the language being used -if( NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED) ) - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.") - else() - message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)") - return() - endif() -endif() - -if(BLA_PREFER_PKGCONFIG) - find_package(PkgConfig) - pkg_check_modules(PKGC_BLAS blas) - if(PKGC_BLAS_FOUND) - set(BLAS_FOUND ${PKGC_BLAS_FOUND}) - set(BLAS_LIBRARIES "${PKGC_BLAS_LINK_LIBRARIES}") - return() - endif() -endif() - -macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) - # This macro checks for the existence of the combination of fortran libraries - # given by _list. If the combination is found, this macro checks (using the - # Check_Fortran_Function_Exists macro) whether can link against that library - # combination using the name of a routine given by _name using the linker - # flags given by _flags. If the combination of libraries is found and passes - # the link test, LIBRARIES is set to the list of complete library paths that - # have been found. Otherwise, LIBRARIES is set to FALSE. - - # N.B. _prefix is the prefix applied to the names of all cached variables that - # are generated internally and marked advanced by this macro. - - set(_libdir ${ARGN}) - - set(_libraries_work TRUE) - set(${LIBRARIES}) - set(_combined_name) - if (NOT _libdir) - if (WIN32) - set(_libdir ENV LIB) - elseif (APPLE) - set(_libdir ENV DYLD_LIBRARY_PATH) - else () - set(_libdir ENV LD_LIBRARY_PATH) - endif () - endif () - - list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") - - foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - if(NOT "${_thread}" STREQUAL "") - set(_combined_name ${_combined_name}_thread) - endif() - if(_libraries_work) - if (BLA_STATIC) - if (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif () - if (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else () - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif () - else () - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # for ubuntu's libblas3gf and liblapack3gf packages - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) - endif () - endif () - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_libdir} - ) - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif() - endforeach() - if(_libraries_work) - # Test this combination of libraries. - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) - # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if (CMAKE_Fortran_COMPILER_LOADED) - check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) - else() - check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - endif() - set(CMAKE_REQUIRED_LIBRARIES) - set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) - endif() - if(_libraries_work) - if("${_list}" STREQUAL "") - set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") - else() - set(${LIBRARIES} ${${LIBRARIES}} ${_thread}) # for static link - endif() - else() - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro() - -set(BLAS_LINKER_FLAGS) -set(BLAS_LIBRARIES) -set(BLAS95_LIBRARIES) -if (NOT $ENV{BLA_VENDOR} STREQUAL "") - set(BLA_VENDOR $ENV{BLA_VENDOR}) -else () - if(NOT BLA_VENDOR) - set(BLA_VENDOR "All") - endif() -endif () - -if (BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # Implicitly linked BLAS libraries - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "" - "" - ) - endif() -endif () - -#BLAS in intel mkl 10+ library? (em64t 64bit) -if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") - if (NOT BLAS_LIBRARIES) - - # System-specific settings - if (WIN32) - if (BLA_STATIC) - set(BLAS_mkl_DLL_SUFFIX "") - else() - set(BLAS_mkl_DLL_SUFFIX "_dll") - endif() - else() - # Switch to GNU Fortran support layer if needed (but not on Apple, where MKL does not provide it) - if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) - set(BLAS_mkl_INTFACE "gf") - set(BLAS_mkl_THREADING "gnu") - set(BLAS_mkl_OMP "gomp") - else() - set(BLAS_mkl_INTFACE "intel") - set(BLAS_mkl_THREADING "intel") - set(BLAS_mkl_OMP "iomp5") - endif() - set(BLAS_mkl_LM "-lm") - set(BLAS_mkl_LDL "-ldl") - endif() - - if (BLA_VENDOR MATCHES "_64ilp") - set(BLAS_mkl_ILP_MODE "ilp64") - else () - set(BLAS_mkl_ILP_MODE "lp64") - endif () - - if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) - if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) - find_package(Threads) - else() - find_package(Threads REQUIRED) - endif() - - set(BLAS_SEARCH_LIBS "") - - if(BLA_F95) - set(BLAS_mkl_SEARCH_SYMBOL sgemm_f95) - set(_LIBRARIES BLAS95_LIBRARIES) - if (WIN32) - # Find the main file (32-bit or 64-bit) - set(BLAS_SEARCH_LIBS_WIN_MAIN "") - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN - "mkl_blas95${BLAS_mkl_DLL_SUFFIX} mkl_intel_c${BLAS_mkl_DLL_SUFFIX}") - endif() - if (BLA_VENDOR MATCHES "^Intel10_64i?lp" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN - "mkl_blas95_${BLAS_mkl_ILP_MODE}${BLAS_mkl_DLL_SUFFIX} mkl_intel_${BLAS_mkl_ILP_MODE}${BLAS_mkl_DLL_SUFFIX}") - endif () - - # Add threading/sequential libs - set(BLAS_SEARCH_LIBS_WIN_THREAD "") - if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "mkl_sequential${BLAS_mkl_DLL_SUFFIX}") - endif() - if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") - endif() - - # Cartesian product of the above - foreach (MAIN ${BLAS_SEARCH_LIBS_WIN_MAIN}) - foreach (THREAD ${BLAS_SEARCH_LIBS_WIN_THREAD}) - list(APPEND BLAS_SEARCH_LIBS - "${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}") - endforeach() - endforeach() - else () - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") - - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") - endif () - if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") - - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") - endif () - if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") - endif () - endif () - else () - set(BLAS_mkl_SEARCH_SYMBOL sgemm) - set(_LIBRARIES BLAS_LIBRARIES) - if (WIN32) - # Find the main file (32-bit or 64-bit) - set(BLAS_SEARCH_LIBS_WIN_MAIN "") - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN - "mkl_intel_c${BLAS_mkl_DLL_SUFFIX}") - endif() - if (BLA_VENDOR MATCHES "^Intel10_64i?lp" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN - "mkl_intel_${BLAS_mkl_ILP_MODE}${BLAS_mkl_DLL_SUFFIX}") - endif () - - # Add threading/sequential libs - set(BLAS_SEARCH_LIBS_WIN_THREAD "") - if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") - endif() - if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD - "mkl_sequential${BLAS_mkl_DLL_SUFFIX}") - endif() - - # Cartesian product of the above - foreach (MAIN ${BLAS_SEARCH_LIBS_WIN_MAIN}) - foreach (THREAD ${BLAS_SEARCH_LIBS_WIN_THREAD}) - list(APPEND BLAS_SEARCH_LIBS - "${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}") - endforeach() - endforeach() - else () - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") - - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS - "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") - endif () - if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") - - # mkl >= 10.3 - list(APPEND BLAS_SEARCH_LIBS - "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") - endif () - if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") - endif () - - #older vesions of intel mkl libs - if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl") - list(APPEND BLAS_SEARCH_LIBS - "mkl_ia32") - list(APPEND BLAS_SEARCH_LIBS - "mkl_em64t") - endif () - endif () - endif () - - if (DEFINED ENV{MKLROOT}) - if (BLA_VENDOR STREQUAL "Intel10_32") - set(_BLAS_MKLROOT_LIB_DIR "$ENV{MKLROOT}/lib/ia32") - elseif (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$") - set(_BLAS_MKLROOT_LIB_DIR "$ENV{MKLROOT}/lib/intel64") - endif () - endif () - if (_BLAS_MKLROOT_LIB_DIR) - if (WIN32) - string(APPEND _BLAS_MKLROOT_LIB_DIR "_win") - elseif (APPLE) - string(APPEND _BLAS_MKLROOT_LIB_DIR "_mac") - else () - string(APPEND _BLAS_MKLROOT_LIB_DIR "_lin") - endif () - endif () - - foreach (IT ${BLAS_SEARCH_LIBS}) - string(REPLACE " " ";" SEARCH_LIBS ${IT}) - if (NOT ${_LIBRARIES}) - check_fortran_libraries( - ${_LIBRARIES} - BLAS - ${BLAS_mkl_SEARCH_SYMBOL} - "" - "${SEARCH_LIBS}" - "${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}" - "${_BLAS_MKLROOT_LIB_DIR}" - ) - endif () - endforeach () - - endif () - unset(BLAS_mkl_ILP_MODE) - unset(BLAS_mkl_INTFACE) - unset(BLAS_mkl_THREADING) - unset(BLAS_mkl_OMP) - unset(BLAS_mkl_DLL_SUFFIX) - unset(BLAS_mkl_LM) - unset(BLAS_mkl_LDL) - endif () -endif () - -if(BLA_F95) - find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES) - set(BLAS95_FOUND ${BLAS_FOUND}) - if(BLAS_FOUND) - set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") - endif() -endif() - -if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "goto2" - "" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # OpenBLAS (http://www.openblas.net) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "openblas" - "" - ) - endif() - if(NOT BLAS_LIBRARIES) - find_package(Threads) - # OpenBLAS (http://www.openblas.net) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "openblas" - "${CMAKE_THREAD_LIBS_INIT}" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # FLAME's blis library (https://github.com/flame/blis) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "blis" - "" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "f77blas;atlas" - "" - ) - endif() -endif () - -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "sgemm;dgemm;blas" - "" - ) - endif() -endif () - -# BLAS in Alpha CXML library? -if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "cxml" - "" - ) - endif() -endif () - -# BLAS in Alpha DXML library? (now called CXML, see above) -if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "dxml" - "" - ) - endif() -endif () - -# BLAS in Sun Performance library? -if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "-xlic_lib=sunperf" - "sunperf;sunmath" - "" - ) - if(BLAS_LIBRARIES) - set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") - endif() - endif() -endif () - -# BLAS in SCSL library? (SGI/Cray Scientific Library) -if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "scsl" - "" - ) - endif() -endif () - -# BLAS in SGIMATH library? -if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "complib.sgimath" - "" - ) - endif() -endif () - -# BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "essl;blas" - "" - ) - endif() -endif () - -#BLAS in acml library? -if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") - if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR - ((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR - ((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS)) - ) - # try to find acml in "standard" paths - if( WIN32 ) - file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" ) - else() - file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" ) - endif() - if( WIN32 ) - file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" ) - else() - file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" ) - endif() - list(GET _ACML_ROOT 0 _ACML_ROOT) - list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT) - if( _ACML_ROOT ) - get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH ) - if( SIZEOF_INTEGER EQUAL 8 ) - set( _ACML_PATH_SUFFIX "_int64" ) - else() - set( _ACML_PATH_SUFFIX "" ) - endif() - if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" ) - set( _ACML_COMPILER32 "ifort32" ) - set( _ACML_COMPILER64 "ifort64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" ) - set( _ACML_COMPILER32 "sun32" ) - set( _ACML_COMPILER64 "sun64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" ) - set( _ACML_COMPILER32 "pgi32" ) - if( WIN32 ) - set( _ACML_COMPILER64 "win64" ) - else() - set( _ACML_COMPILER64 "pgi64" ) - endif() - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" ) - # 32 bit builds not supported on Open64 but for code simplicity - # We'll just use the same directory twice - set( _ACML_COMPILER32 "open64_64" ) - set( _ACML_COMPILER64 "open64_64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" ) - set( _ACML_COMPILER32 "nag32" ) - set( _ACML_COMPILER64 "nag64" ) - else() - set( _ACML_COMPILER32 "gfortran32" ) - set( _ACML_COMPILER64 "gfortran64" ) - endif() - - if( BLA_VENDOR STREQUAL "ACML_MP" ) - set(_ACML_MP_LIB_DIRS - "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib" - "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" ) - else() - set(_ACML_LIB_DIRS - "${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib" - "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" ) - endif() - endif() -elseif(BLAS_${BLA_VENDOR}_LIB_DIRS) - set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS}) -endif() - -if( BLA_VENDOR STREQUAL "ACML_MP" ) - foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS}) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() -elseif( BLA_VENDOR STREQUAL "ACML_GPU" ) - foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS}) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() -else() - foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() -endif() - -# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both -if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml;acml_mv" - "" - ) -endif() -if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml_mp;acml_mv" - "" - ) -endif() -if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml;acml_mv;CALBLAS" - "" - ) -endif() -endif () # ACML - -# Apple BLAS library? -if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "Accelerate" - "" - ) - endif() -endif () - -if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") - if ( NOT BLAS_LIBRARIES ) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "vecLib" - "" - ) - endif () -endif () - -# Generic BLAS library? -if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "blas" - "" - ) - endif() -endif () - -if(NOT BLA_F95) - find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS_LIBRARIES) -endif() - -# On compilers that implicitly link BLAS (such as ftn, cc, and CC on Cray HPC machines) -# we used a placeholder for empty BLAS_LIBRARIES to get through our logic above. -if (BLAS_LIBRARIES STREQUAL "BLAS_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") - set(BLAS_LIBRARIES "") -endif() - -cmake_pop_check_state() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/ports/openblas/fix-pkg-config.patch b/ports/openblas/fix-pkg-config.patch new file mode 100644 index 00000000000000..9ed84d1bb7a514 --- /dev/null +++ b/ports/openblas/fix-pkg-config.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c324e224..4b82d767 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -389,11 +389,9 @@ if(NOT NO_LAPACKE) + install (FILES ${CMAKE_BINARY_DIR}/lapacke_mangling.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openblas${SUFFIX64}) + endif() + +-include(FindPkgConfig QUIET) +-if(PKG_CONFIG_FOUND) +- configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/openblas${SUFFIX64}.pc @ONLY) +- install (FILES ${PROJECT_BINARY_DIR}/openblas${SUFFIX64}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/) +-endif() ++# Install pkg-config files ++configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/openblas${SUFFIX64}.pc @ONLY) ++install (FILES ${PROJECT_BINARY_DIR}/openblas${SUFFIX64}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/) + + + # GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". diff --git a/ports/openblas/openblas_common.h b/ports/openblas/openblas_common.h index 6652a17e9902d5..9b798e577e50cb 100644 --- a/ports/openblas/openblas_common.h +++ b/ports/openblas/openblas_common.h @@ -13,6 +13,7 @@ #ifdef NEEDBUNDERSCORE #define BLASFUNC(FUNC) FUNC##_ + #else #define BLASFUNC(FUNC) FUNC #endif @@ -57,18 +58,3 @@ typedef int blasint; predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs as a side effect of including either or . */ #include -#ifndef OPENBLAS_COMPLEX_STRUCT -#define OPENBLAS_COMPLEX_STRUCT -typedef struct { float real, imag; } openblas_complex_float; -typedef struct { double real, imag; } openblas_complex_double; -typedef struct { xdouble real, imag; } openblas_complex_xdouble; -#define openblas_make_complex_float(real, imag) {(real), (imag)} -#define openblas_make_complex_double(real, imag) {(real), (imag)} -#define openblas_make_complex_xdouble(real, imag) {(real), (imag)} -#define openblas_complex_float_real(z) ((z).real) -#define openblas_complex_float_imag(z) ((z).imag) -#define openblas_complex_double_real(z) ((z).real) -#define openblas_complex_double_imag(z) ((z).imag) -#define openblas_complex_xdouble_real(z) ((z).real) -#define openblas_complex_xdouble_imag(z) ((z).imag) -#endif \ No newline at end of file diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index 2decb588380674..b1f2a512d54e31 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xianyi/OpenBLAS @@ -11,6 +9,7 @@ vcpkg_from_github( fix-space-path.patch fix-redefinition-function.patch github_2481.patch + fix-pkg-config.patch ) find_program(GIT NAMES git git.cmd) @@ -22,13 +21,15 @@ set(SED_EXE_PATH "${GIT_EXE_PATH}/../usr/bin") # openblas require perl to generate .def for exports vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${SED_EXE_PATH}") +set(PATH_BACKUP "$ENV{PATH}") +vcpkg_add_to_path("${PERL_EXE_PATH}") +vcpkg_add_to_path("${SED_EXE_PATH}") set(COMMON_OPTIONS -DBUILD_WITHOUT_LAPACK=ON) # for UWP version, must build non uwp first for helper # binaries. -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_UWP) message(STATUS "Building Windows helper files") set(TEMP_CMAKE_SYSTEM_NAME "${VCPKG_CMAKE_SYSTEM_NAME}") set(TEMP_CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}") @@ -46,7 +47,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") # add just built path to environment for gen_config_h.exe, # getarch.exe and getarch_2nd.exe - set(ENV{PATH} "$ENV{PATH};${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + vcpkg_add_to_path("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") # restore target build information set(VCPKG_CMAKE_SYSTEM_NAME "${TEMP_CMAKE_SYSTEM_NAME}") @@ -57,13 +58,13 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS ${COMMON_OPTIONS} -DCMAKE_SYSTEM_PROCESSOR=AMD64 -DVS_WINRT_COMPONENT=TRUE "-DBLASHELPER_BINARY_DIR=${CURRENT_BUILDTREES_DIR}/x64-windows-rel") -elseif(NOT VCPKG_CMAKE_SYSTEM_NAME) +elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} @@ -85,6 +86,23 @@ endif() vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) +set(ENV{PATH} "${PATH_BACKUP}") + +set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openblas.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) +endif() +set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/openblas.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) +endif() +vcpkg_fixup_pkgconfig() #maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file # openblas do not make the config file , so I manually made this @@ -96,13 +114,8 @@ file(READ ${SOURCE_PATH}/cblas.h CBLAS_H) string(REPLACE "#include \"common.h\"" "#include \"openblas_common.h\"" CBLAS_H "${CBLAS_H}") file(WRITE ${CURRENT_PACKAGES_DIR}/include/cblas.h "${CBLAS_H}") -# openblas is BSD -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openblas) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openblas/LICENSE ${CURRENT_PACKAGES_DIR}/share/openblas/copyright) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindBLAS.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) - vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openblas/vcpkg-cmake-wrapper.cmake b/ports/openblas/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index fc074f33ca15e6..00000000000000 --- a/ports/openblas/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,2 +0,0 @@ -message(STATUS "Using VCPKG FindBLAS. Remove if CMake has been updated to account for Threads in OpenBLAS!") -include(${CMAKE_CURRENT_LIST_DIR}/FindBLAS.cmake) diff --git a/ports/opencl/CONTROL b/ports/opencl/CONTROL index 9ad614bbf67b9e..41069be8225e56 100644 --- a/ports/opencl/CONTROL +++ b/ports/opencl/CONTROL @@ -1,5 +1,6 @@ Source: opencl -Version: 2.2-2-1 +Version: 2.2 +Port-Version: 3 Homepage: https://github.com/KhronosGroup/OpenCL-Headers Description: C/C++ headers and ICD loader (Installable Client Driver) for OpenCL diff --git a/ports/opencl/vcpkg-cmake-wrapper.cmake b/ports/opencl/vcpkg-cmake-wrapper.cmake index 73c9da576937b5..0893710ff58a4a 100644 --- a/ports/opencl/vcpkg-cmake-wrapper.cmake +++ b/ports/opencl/vcpkg-cmake-wrapper.cmake @@ -4,6 +4,9 @@ if(NOT BUILD_SHARED_LIBS AND (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")) set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) if(CMAKE_SYSTEM_NAME MATCHES "Windows") list(APPEND OpenCL_Extra_Libs cfgmgr32) + if($ENV{WindowsSDKVersion} MATCHES "^10") + list(APPEND OpenCL_Extra_Libs OneCoreUAP) + endif() endif(CMAKE_SYSTEM_NAME MATCHES "Windows") if(TARGET OpenCL::OpenCL) diff --git a/ports/opencolorio-tools/0001-lcms-dependency-search.patch b/ports/opencolorio-tools/0001-lcms-dependency-search.patch new file mode 100644 index 00000000000000..353a8061501cbb --- /dev/null +++ b/ports/opencolorio-tools/0001-lcms-dependency-search.patch @@ -0,0 +1,40 @@ +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index d31b4e3..2b57d1c 100644 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE + FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" + "${LCMS_INCLUDE_DIR}") + else() ++ find_path(LCMS_INCLUDE_DIRS ++ NAMES ++ lcms2.h ++ lcms2_plugin.h ++ HINTS ++ ${LCMS_INCLUDEDIR} ++ ${LCMS_INCLUDE_DIRS} ++ ) ++ ++ find_library(LCMS_LIBRARIES ++ LIBRARY_NAMES ++ lcms ++ lcms2 ++ HINTS ++ ${LCMS_LIBRARY_DIRS} ++ ) ++ ++ get_filename_component(LCMS_LIBRARY_DIRS ${LCMS_LIBRARIES} DIRECTORY) ++ ++ find_package_handle_standard_args(LCMS ++ REQUIRED_VARS ++ LCMS_LIBRARIES ++ LCMS_LIBRARY_DIRS ++ LCMS_INCLUDE_DIRS ++ ) ++ mark_as_advanced(LCMS_LIBRARIES LCMS_INCLUDE_DIRS LCMS_LIBRARY_DIRS LCMS_FOUND) ++endif() ++ ++if(NOT LCMS_FOUND) + find_package(Git) + if(NOT GIT_EXECUTABLE) + message("Git not found, could not build external LCMS as we cannot apply patch") diff --git a/ports/opencolorio-tools/0002-msvc-cpluscplus.patch b/ports/opencolorio-tools/0002-msvc-cpluscplus.patch new file mode 100644 index 00000000000000..c4349ea1276bb8 --- /dev/null +++ b/ports/opencolorio-tools/0002-msvc-cpluscplus.patch @@ -0,0 +1,84 @@ +diff --git a/src/apps/ocioconvert/CMakeLists.txt b/src/apps/ocioconvert/CMakeLists.txt +index 82b0792..7d16bdf 100644 +--- a/src/apps/ocioconvert/CMakeLists.txt ++++ b/src/apps/ocioconvert/CMakeLists.txt +@@ -6,16 +6,23 @@ if (OIIO_FOUND) + ${OIIO_INCLUDES} + ${ILMBASE_INCLUDES} + ) +- ++ + file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") +- ++ + add_executable(ocioconvert ${share_src_files} main.cpp) +- ++ ++ target_compile_options(ocioconvert ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + set_target_properties(ocioconvert PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + + target_link_libraries(ocioconvert ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) +- ++ + target_link_OCIO(ocioconvert) +- ++ + install(TARGETS ocioconvert EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) + endif() +diff --git a/src/apps/ociodisplay/CMakeLists.txt b/src/apps/ociodisplay/CMakeLists.txt +index d11b9e1..0f27d86 100644 +--- a/src/apps/ociodisplay/CMakeLists.txt ++++ b/src/apps/ociodisplay/CMakeLists.txt +@@ -11,6 +11,13 @@ if (OIIO_FOUND) + + add_executable(ociodisplay main.cpp) + ++ target_compile_options(ociodisplay ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + # set_target_properties(ociodisplay PROPERTIES INSTALL_RPATH ${OIIO_LIBRARIES} ) + set_target_properties(ociodisplay PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + target_link_libraries(ociodisplay ${GLEW_LIBRARIES} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${OIIO_LIBRARIES}) +diff --git a/src/apps/ociolutimage/CMakeLists.txt b/src/apps/ociolutimage/CMakeLists.txt +index 528333f..821155d 100644 +--- a/src/apps/ociolutimage/CMakeLists.txt ++++ b/src/apps/ociolutimage/CMakeLists.txt +@@ -6,16 +6,23 @@ if (OIIO_FOUND) + ${OIIO_INCLUDES} + ${ILMBASE_INCLUDES} + ) +- ++ + file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") +- ++ + add_executable(ociolutimage ${share_src_files} main.cpp) +- ++ ++ target_compile_options(ociolutimage ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + set_target_properties(ociolutimage PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + + target_link_libraries(ociolutimage ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) +- ++ + target_link_OCIO(ociolutimage) +- ++ + install(TARGETS ociolutimage EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) + endif() diff --git a/ports/opencolorio-tools/0003-osx-self-assign-field.patch b/ports/opencolorio-tools/0003-osx-self-assign-field.patch new file mode 100644 index 00000000000000..18947bbbdeed1e --- /dev/null +++ b/ports/opencolorio-tools/0003-osx-self-assign-field.patch @@ -0,0 +1,13 @@ +diff --git a/src/core/Config.cpp b/src/core/Config.cpp +index f5cb379..5ea178e 100644 +--- a/src/core/Config.cpp ++++ b/src/core/Config.cpp +@@ -330,7 +330,7 @@ OCIO_NAMESPACE_ENTER + sanitytext_ = rhs.sanitytext_; + + cacheids_ = rhs.cacheids_; +- cacheidnocontext_ = cacheidnocontext_; ++ cacheidnocontext_ = rhs.cacheidnocontext_; + } + return *this; + } diff --git a/ports/opencolorio-tools/0004-yaml-dependency-search.patch b/ports/opencolorio-tools/0004-yaml-dependency-search.patch new file mode 100644 index 00000000000000..30c01d41a83239 --- /dev/null +++ b/ports/opencolorio-tools/0004-yaml-dependency-search.patch @@ -0,0 +1,108 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4f3119..5cfa601 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,34 +244,49 @@ else(USE_EXTERNAL_TINYXML) + endif() + set_target_properties(TINYXML_LIB PROPERTIES FOLDER External) + endif(USE_EXTERNAL_TINYXML) +- ++ + ############################################################################### + ### YAML ### + + if(USE_EXTERNAL_YAML) +- # Set minimum yaml version for non-patched sources. +- set(YAML_VERSION_MIN "0.3.0") +- include(FindPkgConfig) +- pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) +- find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h +- HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) +- find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp +- HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) +- set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) +- set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) +- set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) +- +- if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) +- message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") +- endif() ++ find_package(yaml-cpp 0.3.0) ++ if(yaml-cpp_FOUND) ++ include(FindPackageMessage) ++ ++ set(YAML_CPP_FOUND ${yaml-cpp_FOUND}) ++ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) ++ set(YAML_CPP_VERSION ${yaml-cpp_VERSION}) ++ set(YAML_CPP_LIBRARIES yaml-cpp) ++ ++ find_package_message(yaml-cpp ++ "Found yaml ${YAML_CPP_VERSION}: ${YAML_CPP_INCLUDE_DIRS}" ++ "${YAML_CPP_INCLUDE_DIRS}:${YAML_CPP_LIBRARIES}" ++ ) ++ else() ++ # Set minimum yaml version for non-patched sources. ++ set(YAML_VERSION_MIN "0.3.0") ++ include(FindPkgConfig) ++ pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) ++ find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h ++ HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) ++ find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp ++ HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) ++ set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) ++ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) ++ set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) ++ ++ if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) ++ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") ++ endif() + +- find_package_handle_standard_args(yaml-cpp +- REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) +- set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) +- mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) ++ find_package_handle_standard_args(yaml-cpp ++ REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) ++ set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) ++ mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) ++ endif() + + if(YAML_CPP_FOUND) +- if(YAML_CPP_VERSION VERSION_GREATER "0.5.0") ++ if(YAML_CPP_VERSION VERSION_GREATER "0.5.0" AND YAML_CPP_VERSION VERSION_LESS "0.6.0") + # Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them. + # Don't bother doing this step if we are already including the boost headers for shared_ptr + if(NOT OCIO_USE_BOOST_PTR) +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 4b931ef..12a1dbf 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -77,7 +77,14 @@ endif() + if(OCIO_BUILD_STATIC) + list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) +- add_dependencies(OpenColorIO_STATIC TINYXML_LIB YAML_CPP_LIB) ++ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ ++ if(USE_EXTERNAL_YAML) ++ target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) ++ else(USE_EXTERNAL_YAML) ++ add_dependencies(OpenColorIO_STATIC YAML_CPP_LIB) ++ endif() ++ + if(EXTERNAL_LIBRARIES) + target_link_libraries(OpenColorIO_STATIC ${EXTERNAL_LIBRARIES}) + endif() +diff --git a/src/core/OCIOYaml.cpp b/src/core/OCIOYaml.cpp +index aeee4d1..f1c662d 100644 +--- a/src/core/OCIOYaml.cpp ++++ b/src/core/OCIOYaml.cpp +@@ -69,7 +69,7 @@ namespace YAML { + + #ifdef WIN32 + #pragma warning( push ) +-#pragma warning( disable: 4146 ) ++#pragma warning( disable: 4146 4251 ) + #endif + + #include diff --git a/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch b/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch new file mode 100644 index 00000000000000..319f88b733fdf0 --- /dev/null +++ b/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch @@ -0,0 +1,18 @@ +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 45e55f9..f4b687d 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -77,7 +77,12 @@ endif() + if(OCIO_BUILD_STATIC) + list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) +- add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ ++ if(USE_EXTERNAL_TINYXML) ++ target_link_libraries(OpenColorIO_STATIC ${TINYXML_LIBRARIES}) ++ else(USE_EXTERNAL_TINYXML) ++ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ endif(USE_EXTERNAL_TINYXML) + + if(USE_EXTERNAL_YAML) + target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) diff --git a/ports/opencolorio-tools/0006-oiio-dependency-search.patch b/ports/opencolorio-tools/0006-oiio-dependency-search.patch new file mode 100644 index 00000000000000..09624e55c70740 --- /dev/null +++ b/ports/opencolorio-tools/0006-oiio-dependency-search.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cfa601..f79807c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,7 +475,8 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ find_package(OpenImageIO CONFIG REQUIRED) ++ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio-tools/CONTROL b/ports/opencolorio-tools/CONTROL new file mode 100644 index 00000000000000..679933a250eb60 --- /dev/null +++ b/ports/opencolorio-tools/CONTROL @@ -0,0 +1,5 @@ +Source: opencolorio-tools +Version: 1.1.1 +Homepage: https://opencolorio.org/ +Description: OpenColorIO applications, same source with port OpenColorIO. +Build-Depends: openimageio[opencolorio] diff --git a/ports/opencolorio-tools/portfile.cmake b/ports/opencolorio-tools/portfile.cmake new file mode 100644 index 00000000000000..f08786a325c3d0 --- /dev/null +++ b/ports/opencolorio-tools/portfile.cmake @@ -0,0 +1,68 @@ +# Note: Should be maintained simultaneously with opencolorio! +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(_BUILD_SHARED OFF) + set(_BUILD_STATIC ON) +else() + set(_BUILD_SHARED ON) + set(_BUILD_STATIC OFF) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO imageworks/OpenColorIO + REF v1.1.1 + SHA512 bed722f9ddce1887d28aacef2882debccd7c3f3c0c708d2723fea58a097de9f02721af9e85453e089ffda5406aef593ab6536c6886307823c132aa787e492e33 + HEAD_REF master + PATCHES + 0001-lcms-dependency-search.patch + 0002-msvc-cpluscplus.patch + 0003-osx-self-assign-field.patch + 0004-yaml-dependency-search.patch + 0005-tinyxml-dependency-search.patch + 0006-oiio-dependency-search.patch +) + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) +vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) + +# TODO(theblackunknown) build additional targets based on feature + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DOCIO_BUILD_APPS=ON + -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} + -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} + -DOCIO_BUILD_TRUELIGHT:BOOL=OFF + -DOCIO_BUILD_NUKE:BOOL=OFF + -DOCIO_BUILD_DOCS:BOOL=OFF + -DOCIO_BUILD_TESTS:BOOL=OFF + -DOCIO_BUILD_PYGLUE:BOOL=OFF + -DOCIO_BUILD_JNIGLUE:BOOL=OFF + -DOCIO_STATIC_JNIGLUE:BOOL=OFF + -DUSE_EXTERNAL_TINYXML:BOOL=ON + -DUSE_EXTERNAL_YAML:BOOL=ON +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +vcpkg_copy_tools(TOOL_NAMES ociobakelut ociocheck) + +# Clean redundant files +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug + ${CURRENT_PACKAGES_DIR}/include + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/cmake + ${CURRENT_PACKAGES_DIR}/share) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/OpenColorIOConfig.cmake) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencolorio/0001-lcms-dependency-search.patch b/ports/opencolorio/0001-lcms-dependency-search.patch index 597609a6e6e95e..353a8061501cbb 100644 --- a/ports/opencolorio/0001-lcms-dependency-search.patch +++ b/ports/opencolorio/0001-lcms-dependency-search.patch @@ -1,8 +1,8 @@ diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index d31b4e3..778b631 100644 +index d31b4e3..2b57d1c 100644 --- a/src/apps/ociobakelut/CMakeLists.txt +++ b/src/apps/ociobakelut/CMakeLists.txt -@@ -5,6 +5,34 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE +@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" "${LCMS_INCLUDE_DIR}") else() @@ -18,6 +18,7 @@ index d31b4e3..778b631 100644 + find_library(LCMS_LIBRARIES + LIBRARY_NAMES + lcms ++ lcms2 + HINTS + ${LCMS_LIBRARY_DIRS} + ) diff --git a/ports/opencolorio/0006-oiio-dependency-search.patch b/ports/opencolorio/0006-oiio-dependency-search.patch new file mode 100644 index 00000000000000..09624e55c70740 --- /dev/null +++ b/ports/opencolorio/0006-oiio-dependency-search.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cfa601..f79807c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,7 +475,8 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ find_package(OpenImageIO CONFIG REQUIRED) ++ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio/CONTROL b/ports/opencolorio/CONTROL index 9d57a22e3b0138..9380823b2e671c 100644 --- a/ports/opencolorio/CONTROL +++ b/ports/opencolorio/CONTROL @@ -1,9 +1,6 @@ Source: opencolorio -Version: 1.1.1-2 +Version: 1.1.1 +Port-Version: 4 Homepage: https://opencolorio.org/ Description: OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation. OCIO provides a straightforward and consistent user experience across all supporting applications while allowing for sophisticated back-end configuration options suitable for high-end production usage. OCIO is compatible with the Academy Color Encoding Specification (ACES) and is LUT-format agnostic, supporting many popular formats. -Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] - -Feature: applications -Description: Enable OpenColorIO tools -Build-Depends: openimageio[core], openexr[core] +Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] \ No newline at end of file diff --git a/ports/opencolorio/portfile.cmake b/ports/opencolorio/portfile.cmake index 1d9ee2d7e1cbcf..6d970d3a6724c6 100644 --- a/ports/opencolorio/portfile.cmake +++ b/ports/opencolorio/portfile.cmake @@ -1,3 +1,4 @@ +# Note: Should be maintained simultaneously with opencolorio-tools! if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(_BUILD_SHARED OFF) set(_BUILD_STATIC ON) @@ -8,9 +9,9 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO imageworks/OpenColorIO - REF v1.1.1 - SHA512 bed722f9ddce1887d28aacef2882debccd7c3f3c0c708d2723fea58a097de9f02721af9e85453e089ffda5406aef593ab6536c6886307823c132aa787e492e33 + REPO AcademySoftwareFoundation/OpenColorIO + REF ebdec4111f449bea995d01ecd9693b7e704498fe # v1.1.1 + SHA512 b93796541f8b086f137eaebeef102e29a4aabac6dba5b1696c9ab23d62af39b233ca52ce97b04ea432d85ae0a1fe186939c52aab0cd2c4cd5d2775ac5c021eef HEAD_REF master PATCHES 0001-lcms-dependency-search.patch @@ -20,12 +21,6 @@ vcpkg_from_github( 0005-tinyxml-dependency-search.patch ) -vcpkg_check_features( - OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - applications OCIO_BUILD_APPS -) - vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) @@ -36,7 +31,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - ${FEATURE_OPTIONS} + -DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} -DOCIO_BUILD_TRUELIGHT:BOOL=OFF @@ -56,33 +51,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake") vcpkg_copy_pdbs() -if("applications" IN_LIST FEATURES) - # port applications to tools - file(MAKE_DIRECTORY - "${CURRENT_PACKAGES_DIR}/tools/${PORT}" - "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}" - ) - - file(GLOB_RECURSE _TOOLS - "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" - ) - foreach(_TOOL IN LISTS _TOOLS) - get_filename_component(_NAME ${_TOOL} NAME) - file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${_NAME}") - endforeach() - - file(GLOB_RECURSE _TOOLS - "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" - ) - foreach(_TOOL IN LISTS _TOOLS) - get_filename_component(_NAME ${_TOOL} NAME) - file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/${_NAME}") - endforeach() - - vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") - vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}") -endif() - # Clean redundant files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -93,4 +61,4 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/OpenColorIOConfig.cmake ) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 7b5ba5af93765b..768d8fda7d9ee4 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,102 +1,102 @@ -Source: opencv -Version: 4.1.1-1 -Homepage: https://github.com/opencv/opencv -Description: Computer vision library -Build-Depends: opencv4[core] -Default-Features: dnn, jpeg, opengl, png, tiff, webp - -Feature: nonfree -Build-Depends: opencv4[nonfree] -Description: opencv nonfree module - -Feature: ade -Build-Depends: opencv4[ade] -Description: graph api - -Feature: contrib -Build-Depends: opencv4[contrib] -Description: opencv_contrib module - -Feature: cuda -Build-Depends: opencv4[cuda] -Description: CUDA support for opencv - -Feature: dnn -Build-Depends: opencv4[dnn] -Description: Enable dnn module - -Feature: eigen -Build-Depends: opencv4[eigen] -Description: Eigen support for opencv - -Feature: ffmpeg -Build-Depends: opencv4[ffmpeg] -Description: ffmpeg support for opencv - -Feature: gdcm -Build-Depends: opencv4[gdcm] -Description: GDCM support for opencv - -Feature: ipp -Build-Depends: opencv4[ipp] -Description: Enable Intel Integrated Performance Primitives - -Feature: jasper -Build-Depends: opencv4[jasper] -Description: JPEG 2000 support for opencv - -Feature: jpeg -Build-Depends: opencv4[jpeg] -Description: JPEG support for opencv - -Feature: openexr -Build-Depends: opencv4[openexr] -Description: OpenEXR support for opencv - -Feature: opengl -Build-Depends: opencv4[opengl] -Description: opengl support for opencv - -Feature: openmp -Build-Depends: opencv4[openmp] -Description: Enable openmp support for opencv - -Feature: ovis -Build-Depends: opencv4[ovis] -Description: opencv_ovis module - -Feature: png -Build-Depends: opencv4[png] -Description: PNG support for opencv - -Feature: qt -Build-Depends: opencv4[qt] -Description: Qt GUI support for opencv - -Feature: sfm -Build-Depends: opencv4[sfm] -Description: opencv_sfm module - -Feature: tbb -Build-Depends: opencv4[tbb] -Description: Enable Intel Threading Building Blocks - -Feature: tiff -Build-Depends: opencv4[tiff] -Description: TIFF support for opencv - -Feature: vtk -Build-Depends: opencv4[vtk] -Description: vtk support for opencv - -Feature: webp -Build-Depends: opencv4[webp] -Description: WebP support for opencv - -Feature: halide -Build-Depends: opencv4[halide] -Description: Halide support for opencv - -Feature: world -Build-Depends: opencv4[world] -Description: Compile to a single package support for opencv +Source: opencv +Version: 4.3.0 +Homepage: https://github.com/opencv/opencv +Description: Computer vision library +Build-Depends: opencv4[core] +Default-Features: dnn, jpeg, opengl, png, tiff, webp + +Feature: nonfree +Build-Depends: opencv4[core,nonfree] +Description: opencv nonfree module + +Feature: ade +Build-Depends: opencv4[core,ade] +Description: graph api + +Feature: contrib +Build-Depends: opencv4[core,contrib] +Description: opencv_contrib module + +Feature: cuda +Build-Depends: opencv4[core,cuda] +Description: CUDA support for opencv + +Feature: dnn +Build-Depends: opencv4[core,dnn] +Description: Enable dnn module + +Feature: eigen +Build-Depends: opencv4[core,eigen] +Description: Eigen support for opencv + +Feature: ffmpeg +Build-Depends: opencv4[core,ffmpeg] +Description: ffmpeg support for opencv + +Feature: gdcm +Build-Depends: opencv4[core,gdcm] +Description: GDCM support for opencv + +Feature: halide +Build-Depends: opencv4[core,halide] +Description: Halide support for opencv + +Feature: ipp +Build-Depends: opencv4[core,ipp] +Description: Enable Intel Integrated Performance Primitives + +Feature: jasper +Build-Depends: opencv4[core,jasper] +Description: JPEG 2000 support for opencv + +Feature: jpeg +Build-Depends: opencv4[core,jpeg] +Description: JPEG support for opencv + +Feature: openexr +Build-Depends: opencv4[core,openexr] +Description: OpenEXR support for opencv + +Feature: opengl +Build-Depends: opencv4[core,opengl] +Description: opengl support for opencv + +Feature: openmp +Build-Depends: opencv4[core,openmp] +Description: Enable openmp support for opencv + +Feature: ovis +Build-Depends: opencv4[core,ovis] +Description: opencv_ovis module + +Feature: png +Build-Depends: opencv4[core,png] +Description: PNG support for opencv + +Feature: qt +Build-Depends: opencv4[core,qt] +Description: Qt GUI support for opencv + +Feature: sfm +Build-Depends: opencv4[core,sfm] +Description: opencv_sfm module + +Feature: tbb +Build-Depends: opencv4[core,tbb] +Description: Enable Intel Threading Building Blocks + +Feature: tiff +Build-Depends: opencv4[core,tiff] +Description: TIFF support for opencv + +Feature: vtk +Build-Depends: opencv4[core,vtk] +Description: vtk support for opencv + +Feature: webp +Build-Depends: opencv4[core,webp] +Description: WebP support for opencv + +Feature: world +Build-Depends: opencv4[core,world] +Description: Compile to a single package support for opencv diff --git a/ports/opencv2/CONTROL b/ports/opencv2/CONTROL index 391621beecdcb8..d2cff4b6a612b5 100644 --- a/ports/opencv2/CONTROL +++ b/ports/opencv2/CONTROL @@ -1,5 +1,6 @@ Source: opencv2 -Version: 2.4.13.7-2 +Version: 2.4.13.7 +Port-Version: 2 Build-Depends: zlib Description: computer vision library, version 2 Default-Features: eigen, jpeg, opengl, png, tiff diff --git a/ports/opencv2/FindCUDA.cmake b/ports/opencv2/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv2/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv2/portfile.cmake b/ports/opencv2/portfile.cmake index 8033ba4b4fdd8f..e901c77a9eb874 100644 --- a/ports/opencv2/portfile.cmake +++ b/ports/opencv2/portfile.cmake @@ -30,10 +30,10 @@ vcpkg_from_github( file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) #contains fixes for CUDA 11 compat, remove when CMake has support for it vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" WITH_CUDA - "cuda" WITH_CUBLAS "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "jasper" WITH_JASPER @@ -105,6 +105,7 @@ vcpkg_configure_cmake( -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENMP=OFF -DWITH_ZLIB=ON + -DWITH_CUBLAS=OFF # newer libcublas cannot be found by the old cuda cmake script in opencv2, requires a fix ) vcpkg_install_cmake() @@ -115,7 +116,14 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES) string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" "set(CMAKE_IMPORT_FILE_VERSION 1) +find_package(CUDA QUIET) +find_package(Threads QUIET) find_package(PNG QUIET) +find_package(OpenEXR QUIET) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(TIFF QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") diff --git a/ports/opencv3/0001-disable-downloading.patch b/ports/opencv3/0001-disable-downloading.patch index 7e49fae2a1e2f2..41131c6a811b21 100644 --- a/ports/opencv3/0001-disable-downloading.patch +++ b/ports/opencv3/0001-disable-downloading.patch @@ -1,13 +1,14 @@ diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake -index cdc47ad..175aaf3 100644 +index 63cf6d3..01e84a5 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -154,6 +154,8 @@ function(ocv_download) +@@ -157,6 +157,9 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" - INACTIVITY_TIMEOUT 60 - TIMEOUT 600 ++ + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" diff --git a/ports/opencv3/0002-install-options.patch b/ports/opencv3/0002-install-options.patch index 3d334a0a150880..4f0197f9d23304 100644 --- a/ports/opencv3/0002-install-options.patch +++ b/ports/opencv3/0002-install-options.patch @@ -1,69 +1,65 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ce583b..e9ea757 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -665,7 +665,7 @@ endif() - - if(WIN32) - # Postfix of DLLs: -- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") -+ set(OPENCV_DLLVERSION "") - set(OPENCV_DEBUG_POSTFIX d) - else() - # Postfix of so's: -@@ -716,7 +716,7 @@ endif() - ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) - - # --- Python Support --- --if(NOT IOS) -+if(0) - include(cmake/OpenCVDetectPython.cmake) - endif() - -diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index 0b9d669..142b21b 100644 ---- a/cmake/OpenCVCompilerOptions.cmake -+++ b/cmake/OpenCVCompilerOptions.cmake -@@ -254,7 +254,6 @@ if(MSVC) - #endif() - - if(BUILD_WITH_DEBUG_INFO) -- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") - set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") - set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") - endif() -diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index 2c7c42b..e7bc157 100644 ---- a/cmake/OpenCVGenConfig.cmake -+++ b/cmake/OpenCVGenConfig.cmake -@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) - endif() - endfunction() - --if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(NOT ANDROID) - ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") - endif() - -@@ -121,7 +121,7 @@ endif() - # -------------------------------------------------------------------------------------------- - # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages - # -------------------------------------------------------------------------------------------- --if(WIN32) -+if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - if(BUILD_SHARED_LIBS) - set(_lib_suffix "lib") -diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt -index 1f0d720..0bb1ff7 100644 ---- a/data/CMakeLists.txt -+++ b/data/CMakeLists.txt -@@ -1,8 +1,6 @@ - file(GLOB HAAR_CASCADES haarcascades/*.xml) - file(GLOB LBP_CASCADES lbpcascades/*.xml) - --install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) --install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) - - if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) - install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 614baa2..1e930a3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -601,7 +601,7 @@ endif() + ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) + + # --- Python Support --- +-if(NOT IOS) ++if(0) + include(cmake/OpenCVDetectPython.cmake) + endif() + +diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake +index 476156f..4b27b6a 100644 +--- a/cmake/OpenCVCompilerOptions.cmake ++++ b/cmake/OpenCVCompilerOptions.cmake +@@ -261,7 +261,6 @@ if(MSVC) + #endif() + + if(BUILD_WITH_DEBUG_INFO) +- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") + set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") + set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") + endif() +diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake +index c7f9fc2..84bd302 100644 +--- a/cmake/OpenCVGenConfig.cmake ++++ b/cmake/OpenCVGenConfig.cmake +@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) + endif() + endfunction() + +-if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) ++if(TRUE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") + endif() + +-if(ANDROID) ++if(FALSE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") + install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) + endif() +@@ -121,7 +121,7 @@ endif() + # -------------------------------------------------------------------------------------------- + # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages + # -------------------------------------------------------------------------------------------- +-if(WIN32) ++if(0) + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) + ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" + "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index 1f0d720..0bb1ff7 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -1,8 +1,6 @@ + file(GLOB HAAR_CASCADES haarcascades/*.xml) + file(GLOB LBP_CASCADES lbpcascades/*.xml) + +-install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) +-install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) + + if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) + install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") diff --git a/ports/opencv3/0003-force-package-requirements.patch b/ports/opencv3/0003-force-package-requirements.patch index d43ccf4f6e3263..7f1b0c906f23f3 100644 --- a/ports/opencv3/0003-force-package-requirements.patch +++ b/ports/opencv3/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index fcf716b..bda80e9 100644 +index fcf716b..f3951e3 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -70,7 +70,7 @@ index fcf716b..bda80e9 100644 # --- GDAL (optional) --- if(WITH_GDAL) - find_package(GDAL QUIET) -+ find_package(GDAL REQUIRED) ++ find_package(GDAL REQUIRED) if(NOT GDAL_FOUND) set(HAVE_GDAL NO) @@ -83,3 +83,39 @@ index fcf716b..bda80e9 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) +diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake +index b9b1a95..596c152 100644 +--- a/cmake/OpenCVFindLibsPerf.cmake ++++ b/cmake/OpenCVFindLibsPerf.cmake +@@ -51,14 +51,9 @@ endif(WITH_CUDA) + + # --- Eigen --- + if(WITH_EIGEN AND NOT HAVE_EIGEN) +- find_package(Eigen3 QUIET) ++ find_package(Eigen3 REQUIRED) + + if(Eigen3_FOUND) +- if(TARGET Eigen3::Eigen) +- # Use Eigen3 imported target if possible +- list(APPEND OPENCV_LINKER_LIBS Eigen3::Eigen) +- set(HAVE_EIGEN 1) +- else() + if(DEFINED EIGEN3_INCLUDE_DIRS) + set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) + set(HAVE_EIGEN 1) +@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) + set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) + set(HAVE_EIGEN 1) + endif() +- endif() + if(HAVE_EIGEN) + if(DEFINED EIGEN3_WORLD_VERSION) # CMake module + set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) +@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) + set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) + set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) + endif() ++ ocv_include_directories(${EIGEN_INCLUDE_PATH}) + endif() + endif() + diff --git a/ports/opencv3/0004-add-missing-stdexcept-include.patch b/ports/opencv3/0004-add-missing-stdexcept-include.patch new file mode 100644 index 00000000000000..4f0df7d06615e5 --- /dev/null +++ b/ports/opencv3/0004-add-missing-stdexcept-include.patch @@ -0,0 +1,12 @@ +diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp +index fef3fea..68d1a80 100644 +--- a/modules/cvv/src/util/observer_ptr.hpp ++++ b/modules/cvv/src/util/observer_ptr.hpp +@@ -11,6 +11,7 @@ + #include //size_t + #include // [u]intXX_t + #include // since some people like to forget that one ++#include + + namespace cvv + { diff --git a/ports/opencv3/0009-fix-uwp.patch b/ports/opencv3/0009-fix-uwp.patch index cba3963dc9693f..73cac14531af2a 100644 --- a/ports/opencv3/0009-fix-uwp.patch +++ b/ports/opencv3/0009-fix-uwp.patch @@ -1,67 +1,13 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index c2fda8f..3f7dfdc 100644 +index 634b5b2..07a96fb 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -850,7 +850,7 @@ macro(ocv_create_module) - set(the_module_target ${the_module}) - endif() - -- if(WINRT) -+ if(WINRT AND BUILD_TESTS) - # removing APPCONTAINER from modules to run from console - # in case of usual starting of WinRT test apps output is missing - # so starting of console version w/o APPCONTAINER is required to get test results -diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp -index f1107b0..c613ca2 100644 ---- a/modules/core/src/utils/datafile.cpp -+++ b/modules/core/src/utils/datafile.cpp -@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) - CV_UNUSED(addr); - #ifdef _WIN32 - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if (_WIN32_WINNT >= 0x0501) && (!WINRT_STORE) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -diff --git a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -index f4147f3..b92efdd 100644 ---- a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -+++ b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -@@ -24,6 +24,7 @@ - // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - // POSSIBILITY OF SUCH DAMAGE. - -+#include "opencv2/core/cvdef.h" - using namespace Windows::UI::Xaml::Controls; - - namespace cv -diff --git a/modules/highgui/src/window_winrt_bridge.hpp b/modules/highgui/src/window_winrt_bridge.hpp -index 25f4aef..5429f0b 100644 ---- a/modules/highgui/src/window_winrt_bridge.hpp -+++ b/modules/highgui/src/window_winrt_bridge.hpp -@@ -28,6 +28,7 @@ - - #include - #include -+#include "opencv2/highgui/highgui_c.h" - - using namespace Windows::UI::Xaml::Controls; - -diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -index 236e227..e2417dc 100644 ---- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -@@ -94,10 +94,10 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() - - void Media::CaptureFrameGrabber::ShowCameraSettings() - { --#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP -+#if (WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY!=WINAPI_FAMILY_APP) - if (_state == State::Started) - { -- CameraOptionsUI::Show(_capture.Get()); -+ CameraOptionsUI::Show(_capture.Get()); // TODO: Turn it on again in UWP mode by adding reference to UWP Desktop Extensions - } - #endif - } +@@ -1183,7 +1183,7 @@ function(ocv_add_perf_tests) + set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") + endif() + +- if(WINRT) ++ if(WINRT AND BUILD_TESTS) + # removing APPCONTAINER from tests to run from console + # look for detailed description inside of ocv_create_module macro above + add_custom_command(TARGET "opencv_perf_${name}" diff --git a/ports/opencv3/CONTROL b/ports/opencv3/CONTROL index a103e97a6d9dd2..623eb99218e3af 100644 --- a/ports/opencv3/CONTROL +++ b/ports/opencv3/CONTROL @@ -1,5 +1,5 @@ Source: opencv3 -Version: 3.4.7-4 +Version: 3.4.10 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -12,11 +12,11 @@ Feature: flann Description: opencv_flann module Feature: contrib -Build-Depends: opencv3[dnn], hdf5 (!uwp) +Build-Depends: opencv3[dnn], hdf5 (!uwp), tesseract (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv3[contrib], cuda +Build-Depends: opencv3[contrib], cuda, cudnn Description: CUDA support for opencv Feature: dnn @@ -35,6 +35,10 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv +Feature: halide +Build-Depends: halide, opencv3[core], opencv3[dnn] +Description: Halide support for opencv + Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -86,9 +90,5 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv -Feature: halide -Build-Depends: halide, opencv3[core], opencv3[dnn] -Description: Halide support for opencv - Feature: world Description: Compile to a single package support for opencv diff --git a/ports/opencv3/FindCUDA.cmake b/ports/opencv3/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv3/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv3/portfile.cmake b/ports/opencv3/portfile.cmake index 6c7320c42c8cca..f190376c28e96e 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -6,15 +6,13 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4") message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4") endif() -include(vcpkg_common_functions) - -set(OPENCV_VERSION "3.4.7") +set(OPENCV_VERSION "3.4.10") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 ba1336ad4e5208748aa09c99770392cc71ef72688560d0b03287ddafd36093ef30cbdf6422f87f8f878663ab8085cc0ff8a8c65fd1ff0ec6800855ea01309beb + SHA512 7ccdc7fef26436b2f643cce2a13c9f9f77e56d3fd0340117419df3c1665ca12416277b626cce3c056fdc14899805bbe9ece391f11d28c6adea716d47ce8894bc HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -23,6 +21,11 @@ vcpkg_from_github( 0009-fix-uwp.patch ) +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") +file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -48,8 +51,17 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "world" BUILD_opencv_world ) -# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "dnn", "ipp", ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. +set(BUILD_opencv_dnn OFF) +if("dnn" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_ANDROID) + set(BUILD_opencv_dnn ON) + else() + message(WARNING "The dnn module cannot be enabled on Android") + endif() +endif() + set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) @@ -94,11 +106,13 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 922620f3e8754fc15dedf8993bdc1f00c06b623cbeeb72afb984ddaad6e0e04f46561a0ee4d20f5e260616c1f32c6dc0dd7248355d417873ae72bd03cb5d57fd + SHA512 70b4ecfaf9881390ad826a2aba24cced8514a680965ec7151df9926082fff53364bbe6be36458bb9ff466fda6f6f6ca2174eeac94c10a6bada989f07ed1c4da1 HEAD_REF master + PATCHES + 0004-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") - # Used for opencv's face module + vcpkg_download_distfile(OCV_DOWNLOAD URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat" FILENAME "opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat" @@ -144,9 +158,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" - SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" + SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -155,15 +169,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" - SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" + SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" - SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" + SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -172,15 +186,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" - FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" - SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" + FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" + SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" - FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" - SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" + FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" + SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -238,14 +252,20 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= + -DOPENCV_BIN_INSTALL_PATH=bin + -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv + -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d - -DOpenCV_DISABLE_ARCH_PATH=ON + -DOPENCV_DLLVERSION= + -DOPENCV_DEBUG_POSTFIX=d + -DOPENCV_GENERATE_SETUPVARS=OFF # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -257,6 +277,9 @@ vcpkg_configure_cmake( -DBUILD_TIFF=OFF -DBUILD_WEBP=OFF -DBUILD_ZLIB=OFF + -DBUILD_TBB=OFF + -DBUILD_IPP_IW=OFF + -DBUILD_ITT=OFF ###### Disable build 3rd party components -DBUILD_PROTOBUF=OFF ###### OpenCV Build components @@ -264,14 +287,21 @@ vcpkg_configure_cmake( -DBUILD_opencv_bgsegm=${BUILD_opencv_bgsegm} -DBUILD_opencv_line_descriptor=${BUILD_opencv_line_descriptor} -DBUILD_opencv_saliency=${BUILD_opencv_saliency} + -DBUILD_ANDROID_PROJECT=OFF + -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_PACKAGE=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_WITH_DEBUG_INFO=ON -DBUILD_WITH_STATIC_CRT=${BUILD_WITH_STATIC_CRT} + -DBUILD_JAVA=OFF + -DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR} ###### PROTOBUF -DPROTOBUF_UPDATE_FILES=ON -DUPDATE_PROTO_FILES=ON + ###### PYLINT/FLAKE8 + -DENABLE_PYLINT=OFF + -DENABLE_FLAKE8=OFF # CMAKE -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON @@ -284,18 +314,23 @@ vcpkg_configure_cmake( ###### customized properties ## Options from vcpkg_check_features() ${FEATURE_OPTIONS} + -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MATLAB=OFF -DWITH_MSMF=${WITH_MSMF} + -DWITH_OPENMP=OFF -DWITH_PROTOBUF=ON -DWITH_OPENCLAMDBLAS=OFF -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} + -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} + -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} ###### Additional build flags @@ -326,6 +361,8 @@ if(Protobuf_FOUND) ) endif() endif() +find_package(CUDA QUIET) +find_package(Threads QUIET) find_package(TIFF QUIET) find_package(HDF5 QUIET) find_package(Freetype QUIET) @@ -336,8 +373,19 @@ find_package(ade QUIET) find_package(VTK QUIET) find_package(OpenMP QUIET) find_package(Tesseract QUIET) +find_package(OpenEXR QUIET) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") + if(BUILD_opencv_ovis) + string(REPLACE "OgreGLSupportStatic" + "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") + endif() + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -345,8 +393,12 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv3.cmd) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv3.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) + +if(VCPKG_TARGET_IS_ANDROID) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencv4/0001-disable-downloading.patch b/ports/opencv4/0001-disable-downloading.patch index 28b00251fe4f23..41131c6a811b21 100644 --- a/ports/opencv4/0001-disable-downloading.patch +++ b/ports/opencv4/0001-disable-downloading.patch @@ -1,11 +1,14 @@ +diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake +index 63cf6d3..01e84a5 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -151,6 +151,8 @@ function(ocv_download) +@@ -157,6 +157,9 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" - INACTIVITY_TIMEOUT 60 - TIMEOUT 600 ++ + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" diff --git a/ports/opencv4/0002-install-options.patch b/ports/opencv4/0002-install-options.patch index 10aa08c24449da..9707a6a323695c 100644 --- a/ports/opencv4/0002-install-options.patch +++ b/ports/opencv4/0002-install-options.patch @@ -1,17 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8631bbc..e801558 100644 +index 4c0b388..16c0ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -647,7 +647,7 @@ endif() - - if(WIN32) - # Postfix of DLLs: -- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") -+ set(OPENCV_DLLVERSION "") - set(OPENCV_DEBUG_POSTFIX d) - else() - # Postfix of so's: -@@ -698,7 +698,7 @@ endif() +@@ -594,7 +594,7 @@ endif() ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) # --- Python Support --- @@ -21,10 +12,10 @@ index 8631bbc..e801558 100644 endif() diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index e3ae62f..d866162 100644 +index 87b2161..5192875 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake -@@ -256,7 +256,6 @@ if(MSVC) +@@ -263,7 +263,6 @@ if(MSVC) #endif() if(BUILD_WITH_DEBUG_INFO) @@ -33,27 +24,32 @@ index e3ae62f..d866162 100644 set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") endif() diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index cef9d0b..b6ddb81 100644 +index 6991289..3a691c5 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake -@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) +@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) endif() endfunction() -if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(NOT ANDROID) ++if(TRUE) ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") endif() +-if(ANDROID) ++if(FALSE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") + install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) + endif() @@ -121,7 +121,7 @@ endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- -if(WIN32) +if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - if(BUILD_SHARED_LIBS) - set(_lib_suffix "lib") + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) + ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" + "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 1f0d720..0bb1ff7 100644 --- a/data/CMakeLists.txt diff --git a/ports/opencv4/0003-force-package-requirements.patch b/ports/opencv4/0003-force-package-requirements.patch index b6051f8498b66b..b25668b38325ee 100644 --- a/ports/opencv4/0003-force-package-requirements.patch +++ b/ports/opencv4/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index 227cfb2..7a97a19 100644 +index 0beaf19..3ba1ebd 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -38,7 +38,7 @@ index 227cfb2..7a97a19 100644 if(WEBP_FOUND) set(HAVE_WEBP 1) endif() -@@ -158,7 +158,7 @@ if(WITH_JASPER) +@@ -173,7 +173,7 @@ if(WITH_JASPER AND NOT HAVE_OPENJPEG) if(BUILD_JASPER) ocv_clear_vars(JASPER_FOUND) else() @@ -47,7 +47,7 @@ index 227cfb2..7a97a19 100644 endif() if(NOT JASPER_FOUND) -@@ -182,7 +182,7 @@ if(WITH_PNG) +@@ -197,7 +197,7 @@ if(WITH_PNG) if(BUILD_PNG) ocv_clear_vars(PNG_FOUND) else() @@ -56,7 +56,7 @@ index 227cfb2..7a97a19 100644 if(PNG_FOUND) include(CheckIncludeFile) check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H) -@@ -213,7 +213,7 @@ endif() +@@ -228,7 +228,7 @@ endif() if(WITH_OPENEXR) ocv_clear_vars(HAVE_OPENEXR) if(NOT BUILD_OPENEXR) @@ -65,7 +65,7 @@ index 227cfb2..7a97a19 100644 endif() if(OPENEXR_FOUND) -@@ -231,7 +231,7 @@ endif() +@@ -246,7 +246,7 @@ endif() # --- GDAL (optional) --- if(WITH_GDAL) @@ -74,7 +74,7 @@ index 227cfb2..7a97a19 100644 if(NOT GDAL_FOUND) set(HAVE_GDAL NO) -@@ -243,7 +243,7 @@ if(WITH_GDAL) +@@ -258,7 +258,7 @@ if(WITH_GDAL) endif() if (WITH_GDCM) @@ -83,18 +83,11 @@ index 227cfb2..7a97a19 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) -@@ -273,4 +273,4 @@ if(WITH_IMGCODEC_PFM) - set(HAVE_IMGCODEC_PFM ON) - elseif(DEFINED WITH_IMGCODEC_PFM) - set(HAVE_IMGCODEC_PFM OFF) --endif() -\ No newline at end of file -+endif() diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake -index a658bf6..5c9411a 100644 +index b9b1a95..596c152 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake -@@ -41,14 +41,9 @@ endif(WITH_CUDA) +@@ -51,14 +51,9 @@ endif(WITH_CUDA) # --- Eigen --- if(WITH_EIGEN AND NOT HAVE_EIGEN) @@ -110,7 +103,7 @@ index a658bf6..5c9411a 100644 if(DEFINED EIGEN3_INCLUDE_DIRS) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) set(HAVE_EIGEN 1) -@@ -56,7 +51,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) set(HAVE_EIGEN 1) endif() @@ -118,7 +111,7 @@ index a658bf6..5c9411a 100644 if(HAVE_EIGEN) if(DEFINED EIGEN3_WORLD_VERSION) # CMake module set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) -@@ -67,6 +61,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) endif() diff --git a/ports/opencv4/0004-fix-policy-CMP0057.patch b/ports/opencv4/0004-fix-policy-CMP0057.patch index ed25d501dfe7c2..7f0f0c0271ba01 100644 --- a/ports/opencv4/0004-fix-policy-CMP0057.patch +++ b/ports/opencv4/0004-fix-policy-CMP0057.patch @@ -1,5 +1,5 @@ diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt -index 1608655..a394f04 100644 +index c1c6754..360aa6b 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -1,3 +1,4 @@ diff --git a/ports/opencv4/0005-add-missing-stdexcept-include.patch b/ports/opencv4/0005-add-missing-stdexcept-include.patch new file mode 100644 index 00000000000000..4f0df7d06615e5 --- /dev/null +++ b/ports/opencv4/0005-add-missing-stdexcept-include.patch @@ -0,0 +1,12 @@ +diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp +index fef3fea..68d1a80 100644 +--- a/modules/cvv/src/util/observer_ptr.hpp ++++ b/modules/cvv/src/util/observer_ptr.hpp +@@ -11,6 +11,7 @@ + #include //size_t + #include // [u]intXX_t + #include // since some people like to forget that one ++#include + + namespace cvv + { diff --git a/ports/opencv4/0009-fix-uwp.patch b/ports/opencv4/0009-fix-uwp.patch index 5c54256a598c5f..1c40cf1e17d4aa 100644 --- a/ports/opencv4/0009-fix-uwp.patch +++ b/ports/opencv4/0009-fix-uwp.patch @@ -1,17 +1,8 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 799592b..3f44173 100644 +index 9053957..d2b6412 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -852,7 +852,7 @@ macro(ocv_create_module) - set(the_module_target ${the_module}) - endif() - -- if(WINRT) -+ if(WINRT AND BUILD_TESTS) - # removing APPCONTAINER from modules to run from console - # in case of usual starting of WinRT test apps output is missing - # so starting of console version w/o APPCONTAINER is required to get test results -@@ -1175,7 +1175,7 @@ function(ocv_add_perf_tests) +@@ -1196,7 +1196,7 @@ function(ocv_add_perf_tests) set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") endif() @@ -20,38 +11,3 @@ index 799592b..3f44173 100644 # removing APPCONTAINER from tests to run from console # look for detailed description inside of ocv_create_module macro above add_custom_command(TARGET "opencv_perf_${name}" -diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp -index aafbfdf..10543ae 100644 ---- a/modules/core/src/utils/datafile.cpp -+++ b/modules/core/src/utils/datafile.cpp -@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) - CV_UNUSED(addr); - #ifdef _WIN32 - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -@@ -155,7 +155,7 @@ bool getBinLocation(std::wstring& dst) - { - void* addr = (void*)getModuleLocation; // using code address, doesn't work with static linkage! - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -index 236e227..eccf97e 100644 ---- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -@@ -94,7 +94,7 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() - - void Media::CaptureFrameGrabber::ShowCameraSettings() - { --#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP -+#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PC_APP) - if (_state == State::Started) - { - CameraOptionsUI::Show(_capture.Get()); diff --git a/ports/opencv4/CONTROL b/ports/opencv4/CONTROL index 60c1e0aa7d2df8..f06945f4420f0a 100644 --- a/ports/opencv4/CONTROL +++ b/ports/opencv4/CONTROL @@ -1,5 +1,6 @@ Source: opencv4 -Version: 4.1.1-6 +Version: 4.3.0 +Port-Version: 1 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -13,11 +14,11 @@ Build-Depends: ade Description: graph api Feature: contrib -Build-Depends: hdf5 (!uwp) +Build-Depends: hdf5 (!uwp), tesseract (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv4[contrib], cuda +Build-Depends: opencv4[core,contrib], cuda, cudnn Description: CUDA support for opencv Feature: dnn @@ -35,6 +36,10 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv +Feature: halide +Build-Depends: halide, opencv4[core], opencv4[dnn] +Description: Halide support for opencv + Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -58,7 +63,7 @@ Feature: openmp Description: Enable openmp support for opencv Feature: ovis -Build-Depends: opencv4[contrib], ogre +Build-Depends: opencv4[core,contrib], ogre Description: opencv_ovis module Feature: png @@ -70,7 +75,7 @@ Build-Depends: qt5-base[core] Description: Qt GUI support for opencv Feature: sfm -Build-Depends: opencv4[contrib], eigen3, glog, gflags, ceres +Build-Depends: opencv4[core,contrib], opencv4[core,eigen], glog, gflags, ceres Description: opencv_sfm module Feature: tbb @@ -89,13 +94,5 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv -Feature: halide -Build-Depends: halide, opencv4[core], opencv4[dnn] -Description: Halide support for opencv - Feature: world Description: Compile to a single package support for opencv - -Feature: gtk -Build-Depends: gtk -Description: gtk support for opencv diff --git a/ports/opencv4/FindCUDA.cmake b/ports/opencv4/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv4/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 660a4e263bc73d..0ea97e77769d38 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -6,15 +6,13 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3") message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3") endif() -include(vcpkg_common_functions) - -set(OPENCV_VERSION "4.1.1") +set(OPENCV_VERSION "4.3.0") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 80fa48d992ca06a2a4ab6740df6d8c21f4926165486b393969da2c5bbe2f3a0b799fb76dee5e3654e90c743e49bbd2b5b02ad59a4766896bbf4cd5b4e3251e0f + SHA512 ac22b41fffa3e3138701fa0df0d19900b3ce72e168f4478ecdc593c5c9fd004b4b1b26612d62c25b681db99a8720db7a11b5b224e576e595624965fa79b0f383 HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -24,6 +22,11 @@ vcpkg_from_github( 0009-fix-uwp.patch ) +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") +file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) set(ADE_DIR ${CURRENT_INSTALLED_DIR}/share/ade CACHE PATH "Path to existing ADE CMake Config file") @@ -33,7 +36,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "contrib" WITH_CONTRIB "cuda" WITH_CUDA "cuda" WITH_CUBLAS - "dnn" BUILD_opencv_dnn "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "gdcm" WITH_GDCM @@ -43,23 +45,39 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "nonfree" OPENCV_ENABLE_NONFREE "openexr" WITH_OPENEXR "opengl" WITH_OPENGL - "openmp" WITH_OPENMP "png" WITH_PNG "qt" WITH_QT "sfm" BUILD_opencv_sfm "tiff" WITH_TIFF "webp" WITH_WEBP "world" BUILD_opencv_world - "gtk" WITH_GTK ) -# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "dnn", ipp", "openmp", "ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. +set(BUILD_opencv_dnn OFF) +if("dnn" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_ANDROID) + set(BUILD_opencv_dnn ON) + else() + message(WARNING "The dnn module cannot be enabled on Android") + endif() +endif() + set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) endif() +set(WITH_OPENMP OFF) +if("openmp" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_OSX) + set(WITH_OPENMP ON) + else() + message(WARNING "The OpenMP feature is not supported on macOS") + endif() +endif() + set(BUILD_opencv_ovis OFF) if("ovis" IN_LIST FEATURES) set(BUILD_opencv_ovis ON) @@ -107,8 +125,10 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 8af13f0a5f350360316662c1ce5e58c21d906a58591acfbd575a8dacde19b6f3bbd694c3c199feb35c33549cf8c37e3fb4c494b586a00ad29fe3b4aeeb2d22ab + SHA512 cfeda06a9f86ccaedbca9521c35bf685c3d8d3a182fb943f9378a7ecd1949d6e2e9df1673f0e3e9686840ca4c9e5a8e8cf2ac962a33b6e1f88f8278abd8c37e5 HEAD_REF master + PATCHES + 0005-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") @@ -178,9 +198,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" - SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" + SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -189,15 +209,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" - SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" + SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" - SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" + SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -206,15 +226,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" - FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" - SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" + FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" + SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" - FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" - SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" + FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" + SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -263,13 +283,20 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= + -DOPENCV_BIN_INSTALL_PATH=bin + -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv + -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d + -DOPENCV_DLLVERSION= + -DOPENCV_DEBUG_POSTFIX=d + -DOPENCV_GENERATE_SETUPVARS=OFF # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -320,17 +347,23 @@ vcpkg_configure_cmake( ${FEATURE_OPTIONS} -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON + -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MSMF=${WITH_MSMF} + -DWITH_OPENMP=${WITH_OPENMP} -DWITH_PROTOBUF=ON -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} + -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} + -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} + ###### The following module is disabled because it's broken #https://github.com/opencv/opencv_contrib/issues/2307 + -DBUILD_opencv_rgbd=OFF ###### Additional build flags ${ADDITIONAL_BUILD_FLAGS} ) @@ -341,17 +374,16 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES) - string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" - "set(CMAKE_IMPORT_FILE_VERSION 1) -find_package(Protobuf REQUIRED) -if(Protobuf_FOUND) + set(DEPS_STRING "include(CMakeFindDependencyMacro) +find_dependency(protobuf CONFIG) +if(protobuf_FOUND) if(TARGET protobuf::libprotobuf) - add_library(libprotobuf INTERFACE IMPORTED) + add_library (libprotobuf INTERFACE IMPORTED) set_target_properties(libprotobuf PROPERTIES INTERFACE_LINK_LIBRARIES protobuf::libprotobuf ) else() - add_library(libprotobuf UNKNOWN IMPORTED) + add_library (libprotobuf UNKNOWN IMPORTED) set_target_properties(libprotobuf PROPERTIES IMPORTED_LOCATION \"${Protobuf_LIBRARY}\" INTERFACE_INCLUDE_DIRECTORIES \"${Protobuf_INCLUDE_DIR}\" @@ -359,25 +391,70 @@ if(Protobuf_FOUND) ) endif() endif() -find_package(TIFF QUIET) -find_package(HDF5 QUIET) -find_package(Freetype QUIET) -find_package(Ogre QUIET) -find_package(gflags QUIET) -find_package(Ceres QUIET) -find_package(ade QUIET) -find_package(VTK QUIET) -find_package(OpenMP QUIET) -find_package(Tesseract QUIET) -find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") - - if("openmp" IN_LIST FEATURES) +find_dependency(Threads)") + if("tiff" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(TIFF)") + endif() + if("cuda" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(CUDA)") + endif() + if(BUILD_opencv_quality) + string(APPEND DEPS_STRING " +# C language is required for try_compile tests in FindHDF5 +enable_language(C) +find_dependency(HDF5) +find_dependency(Tesseract)") + endif() + if(WITH_TBB) + string(APPEND DEPS_STRING "\nfind_dependency(TBB)") + endif() + if(WITH_VTK) + string(APPEND DEPS_STRING "\nfind_dependency(VTK)") + endif() + if("sfm" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(gflags CONFIG)\nfind_dependency(Ceres CONFIG)") + endif() + if("eigen" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(Eigen3 CONFIG)") + endif() + if("openexr" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(OpenEXR CONFIG)") + endif() + if(WITH_OPENMP) + string(APPEND DEPS_STRING "\nfind_dependency(OpenMP CONFIG)") + endif() + if(BUILD_opencv_ovis) + string(APPEND DEPS_STRING "\nfind_dependency(Ogre)\nfind_dependency(Freetype)") + endif() + if("qt" IN_LIST FEATURES) + string(APPEND DEPS_STRING " +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +find_dependency(Qt5 COMPONENTS OpenGL Concurrent Test)") + endif() + if("ade" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(ade)") + endif() + if("gdcm" IN_LIST FEATURES) + string(APPEND DEPS_STRING "\nfind_dependency(GDCM)") + endif() + + string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" + "set(CMAKE_IMPORT_FILE_VERSION 1)\n${DEPS_STRING}" OPENCV_MODULES "${OPENCV_MODULES}") + + if(WITH_OPENMP) string(REPLACE "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"" "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"\$;" OPENCV_MODULES "${OPENCV_MODULES}") endif() + if(BUILD_opencv_ovis) + string(REPLACE "OgreGLSupportStatic" + "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") + endif() + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -385,9 +462,12 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv4.cmd) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv4.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) +if(VCPKG_TARGET_IS_ANDROID) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openexr/CONTROL b/ports/openexr/CONTROL index ddf7b0fbd2be03..0a725a0424a3a9 100644 --- a/ports/openexr/CONTROL +++ b/ports/openexr/CONTROL @@ -1,6 +1,7 @@ Source: openexr -Version: 2.3.0-5 +Version: 2.5.0 +Port-Version: 1 Homepage: https://www.openexr.com/ Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications -Build-Depends: zlib -Supports: !uwp \ No newline at end of file +Build-Depends: zlib, python3 +Supports: !uwp diff --git a/ports/openexr/FindOpenEXR.cmake b/ports/openexr/FindOpenEXR.cmake deleted file mode 100644 index f036c742e1ffd8..00000000000000 --- a/ports/openexr/FindOpenEXR.cmake +++ /dev/null @@ -1,94 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path(OpenEXR_INCLUDE_DIRS OpenEXR/OpenEXRConfig.h) -find_path(OPENEXR_INCLUDE_PATHS NAMES ImfRgbaFile.h PATH_SUFFIXES OpenEXR) - -file(STRINGS "${OpenEXR_INCLUDE_DIRS}/OpenEXR/OpenEXRConfig.h" OPENEXR_CONFIG_H) - -string(REGEX REPLACE "^.*define OPENEXR_VERSION_MAJOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MAJOR "${OPENEXR_CONFIG_H}") -string(REGEX REPLACE "^.*define OPENEXR_VERSION_MINOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MINOR "${OPENEXR_CONFIG_H}") -set(OpenEXR_LIB_SUFFIX "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}") - -include(SelectLibraryConfigurations) - -if(NOT OpenEXR_BASE_LIBRARY) - find_library(OpenEXR_BASE_LIBRARY_RELEASE NAMES IlmImf-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_BASE_LIBRARY_DEBUG NAMES IlmImf-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_BASE) -endif() - -if(NOT OpenEXR_UTIL_LIBRARY) - find_library(OpenEXR_UTIL_LIBRARY_RELEASE NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_UTIL_LIBRARY_DEBUG NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_UTIL) -endif() - -if(NOT OpenEXR_HALF_LIBRARY) - find_library(OpenEXR_HALF_LIBRARY_RELEASE NAMES Half-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_HALF_LIBRARY_DEBUG NAMES Half-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_HALF) -endif() - -if(NOT OpenEXR_IEX_LIBRARY) - find_library(OpenEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_IEX) -endif() - -if(NOT OpenEXR_MATH_LIBRARY) - find_library(OpenEXR_MATH_LIBRARY_RELEASE NAMES Imath-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_MATH_LIBRARY_DEBUG NAMES Imath-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_MATH) -endif() - -if(NOT OpenEXR_THREAD_LIBRARY) - find_library(OpenEXR_THREAD_LIBRARY_RELEASE NAMES IlmThread-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_THREAD_LIBRARY_DEBUG NAMES IlmThread-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_THREAD) -endif() - -if(NOT OpenEXR_IEXMATH_LIBRARY) - find_library(OpenEXR_IEXMATH_LIBRARY_RELEASE NAMES IexMath-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_IEXMATH_LIBRARY_DEBUG NAMES IexMath-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_IEXMATH) -endif() - -set(OPENEXR_HALF_LIBRARY "${OpenEXR_HALF_LIBRARY}") -set(OPENEXR_Half_LIBRARY "${OpenEXR_HALF_LIBRARY}") -set(OPENEXR_IEX_LIBRARY "${OpenEXR_IEX_LIBRARY}") -set(OPENEXR_Iex_LIBRARY "${OpenEXR_IEX_LIBRARY}") -set(OPENEXR_IMATH_LIBRARY "${OpenEXR_MATH_LIBRARY}") -set(OPENEXR_ILMIMF_LIBRARY "${OpenEXR_BASE_LIBRARY}") -set(OPENEXR_IlmImf_LIBRARY "${OpenEXR_BASE_LIBRARY}") -set(OPENEXR_ILMIMFUTIL_LIBRARY "${OpenEXR_UTIL_LIBRARY}") -set(OPENEXR_ILMTHREAD_LIBRARY "${OpenEXR_THREAD_LIBRARY}") - -set(OpenEXR_LIBRARY "${OpenEXR_BASE_LIBRARY}") - -set(OpenEXR_LIBRARIES - ${OpenEXR_LIBRARY} - ${OpenEXR_MATH_LIBRARY} - ${OpenEXR_IEXMATH_LIBRARY} - ${OpenEXR_UTIL_LIBRARY} - ${OpenEXR_HALF_LIBRARY} - ${OpenEXR_IEX_LIBRARY} - ${OpenEXR_THREAD_LIBRARY} -) - -set(OPENEXR_LIBRARIES - ${OPENEXR_HALF_LIBRARY} - ${OPENEXR_IEX_LIBRARY} - ${OPENEXR_IMATH_LIBRARY} - ${OPENEXR_ILMIMF_LIBRARY} - ${OPENEXR_ILMTHREAD_LIBRARY} -) - -set(OpenEXR_INCLUDE_DIR ${OpenEXR_INCLUDE_DIRS}) -set(OPENEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS}) -set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATHS}) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR REQUIRED_VARS OpenEXR_LIBRARIES OpenEXR_INCLUDE_DIRS) - -if(OpenEXR_FOUND) - set(OPENEXR_FOUND 1) -endif() diff --git a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch deleted file mode 100644 index 05e86b50c6e4ef..00000000000000 --- a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/IlmBase/CMakeLists.txt b/IlmBase/CMakeLists.txt -index e13c768..95942c8 100644 ---- a/IlmBase/CMakeLists.txt -+++ b/IlmBase/CMakeLists.txt -@@ -110,7 +110,7 @@ ENDIF () - - IF (OPENEXR_FORCE_CXX03) - FILE ( APPEND ${ILMBASE_TMP_CONFIG} "#define ILMBASE_FORCE_CXX03 1\n" ) --ELSEIF (NOT WIN32) -+ELSEIF (NOT WIN32 AND NOT APPLE) - # really only care about c++11 right now for the threading bits, but this can be changed to 14 - # when needed... - # Note that the __cplusplus check is not valid under MSVC diff --git a/ports/openexr/fix_install_ilmimf.patch b/ports/openexr/fix_install_ilmimf.patch deleted file mode 100644 index db65be73684da1..00000000000000 --- a/ports/openexr/fix_install_ilmimf.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt -index e1a8740..d31cf68 100644 ---- a/OpenEXR/IlmImf/CMakeLists.txt -+++ b/OpenEXR/IlmImf/CMakeLists.txt -@@ -2,14 +2,6 @@ - - SET(CMAKE_INCLUDE_CURRENT_DIR 1) - --IF (WIN32) -- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/bin) -- SET(WORKING_DIR ${RUNTIME_DIR}) --ELSE () -- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/lib) -- SET(WORKING_DIR .) --ENDIF () -- - SET(BUILD_B44EXPLOGTABLE OFF) - IF (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/b44ExpLogTable.h") - SET(BUILD_B44EXPLOGTABLE ON) diff --git a/ports/openexr/fix_linux_static_library_names.patch b/ports/openexr/fix_linux_static_library_names.patch deleted file mode 100644 index e7a41daa7ee0f2..00000000000000 --- a/ports/openexr/fix_linux_static_library_names.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b06d97e..ad360f8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -53,10 +53,13 @@ endif() - if (WIN32 AND OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_OPENEXR AND OPENEXR_BUILD_SHARED) - # necessary for building dwa lookup tables, and b44log tables on windows - set(BUILD_ILMBASE_STATIC ON) -+ set(OPENEXR_STATIC_SUFFIX "_s") - elseif (OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_STATIC) - set(BUILD_ILMBASE_STATIC ON) -+ set(OPENEXR_STATIC_SUFFIX "") - else() - set(BUILD_ILMBASE_STATIC OFF) -+ set(OPENEXR_STATIC_SUFFIX "") - endif() - - if (NOT OPENEXR_BUILD_SHARED) -diff --git a/IlmBase/Half/CMakeLists.txt b/IlmBase/Half/CMakeLists.txt -index 3d24cd7..d92aa67 100644 ---- a/IlmBase/Half/CMakeLists.txt -+++ b/IlmBase/Half/CMakeLists.txt -@@ -60,7 +60,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Half_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - - ADD_DEPENDENCIES ( Half_static toFloat eLut ) -diff --git a/IlmBase/Iex/CMakeLists.txt b/IlmBase/Iex/CMakeLists.txt -index 847518c..9425430 100644 ---- a/IlmBase/Iex/CMakeLists.txt -+++ b/IlmBase/Iex/CMakeLists.txt -@@ -34,7 +34,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Iex_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF() - -diff --git a/IlmBase/IexMath/CMakeLists.txt b/IlmBase/IexMath/CMakeLists.txt -index 472fd33..1427fa8 100644 ---- a/IlmBase/IexMath/CMakeLists.txt -+++ b/IlmBase/IexMath/CMakeLists.txt -@@ -36,7 +36,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( IexMath_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF( ) - -diff --git a/IlmBase/IlmThread/CMakeLists.txt b/IlmBase/IlmThread/CMakeLists.txt -index 3a24823..b281916 100644 ---- a/IlmBase/IlmThread/CMakeLists.txt -+++ b/IlmBase/IlmThread/CMakeLists.txt -@@ -49,7 +49,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( IlmThread_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF () - -diff --git a/IlmBase/Imath/CMakeLists.txt b/IlmBase/Imath/CMakeLists.txt -index 8faa97a..bf29000 100644 ---- a/IlmBase/Imath/CMakeLists.txt -+++ b/IlmBase/Imath/CMakeLists.txt -@@ -37,7 +37,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Imath_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF () - -diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt -index d31cf68..52c2b6e 100644 ---- a/OpenEXR/IlmImf/CMakeLists.txt -+++ b/OpenEXR/IlmImf/CMakeLists.txt -@@ -226,7 +226,7 @@ IF (OPENEXR_BUILD_STATIC) - SET_TARGET_PROPERTIES ( IlmImf_static - PROPERTIES - VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} -- OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - SET_ILMBASE_INCLUDE_DIRS(IlmImf_static) - -diff --git a/OpenEXR/IlmImfUtil/CMakeLists.txt b/OpenEXR/IlmImfUtil/CMakeLists.txt -index 4cc53de..26df90e 100644 ---- a/OpenEXR/IlmImfUtil/CMakeLists.txt -+++ b/OpenEXR/IlmImfUtil/CMakeLists.txt -@@ -60,7 +60,7 @@ IF ( OPENEXR_BUILD_STATIC ) - PROPERTIES - VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} - SOVERSION ${OPENEXR_SOVERSION} -- OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF() - diff --git a/ports/openexr/fixup_cmake_exports_path.patch b/ports/openexr/fixup_cmake_exports_path.patch new file mode 100644 index 00000000000000..e39bd3792ff8a7 --- /dev/null +++ b/ports/openexr/fixup_cmake_exports_path.patch @@ -0,0 +1,78 @@ +diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt +index d9c5ae4..45ee6cc 100644 +--- a/IlmBase/config/CMakeLists.txt ++++ b/IlmBase/config/CMakeLists.txt +@@ -105,7 +105,7 @@ endif() + include(CMakePackageConfigHelpers) + configure_package_config_file(IlmBaseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ INSTALL_DESTINATION share/ilmbase + ) + write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${ILMBASE_VERSION} +@@ -113,10 +113,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/ilmbase + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/ilmbase + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES +diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt +index b52ad0d..3dc6d22 100644 +--- a/OpenEXR/config/CMakeLists.txt ++++ b/OpenEXR/config/CMakeLists.txt +@@ -19,7 +19,7 @@ int main() + sysconf(_SC_NPROCESSORS_ONLN); + } + " OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN +-) ++) + + check_cxx_source_compiles( + " +@@ -100,7 +100,7 @@ endif() + include(CMakePackageConfigHelpers) + configure_package_config_file(OpenEXRConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ INSTALL_DESTINATION share/openexr + ) + write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${OPENEXR_VERSION} +@@ -108,10 +108,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/openexr + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/openexr + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES +diff --git a/PyIlmBase/config/CMakeLists.txt b/PyIlmBase/config/CMakeLists.txt +index 1872c89..bc61f43 100644 +--- a/PyIlmBase/config/CMakeLists.txt ++++ b/PyIlmBase/config/CMakeLists.txt +@@ -39,10 +39,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + COMPATIBILITY SameMajorVersion + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/pyilmbase + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/pyilmbase + FILE ${PROJECT_NAME}Config.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake index 31b0582ed4d780..d73520cea1f9b2 100644 --- a/ports/openexr/portfile.cmake +++ b/ports/openexr/portfile.cmake @@ -1,65 +1,49 @@ -include(vcpkg_common_functions) - if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") message(FATAL_ERROR "UWP build not supported") endif() -set(OPENEXR_VERSION 2.3.0) -set(OPENEXR_HASH 268ae64b40d21d662f405fba97c307dad1456b7d996a447aadafd41b640ca736d4851d9544b4741a94e7b7c335fe6e9d3b16180e710671abfc0c8b2740b147b2) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openexr/openexr - REF v${OPENEXR_VERSION} - SHA512 ${OPENEXR_HASH} + REF ed64d5467dee9763f28baf300f7699e6288b9f5f + SHA512 549d37ed1ef4d1ff7e732d583f7213ee15c7f92625aea9fd65345e4c5b854902c02e5940d0692b1af5ae0a02abf46aaefea2662db2389d1b2fb4264a373baac2 HEAD_REF master PATCHES - fix_clang_not_setting_modern_cplusplus.patch - fix_install_ilmimf.patch - fix_linux_static_library_names.patch + remove_find_package_macro.patch + fixup_cmake_exports_path.patch + remove_symlinks.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENEXR_BUILD_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENEXR_BUILD_SHARED) - vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DOPENEXR_BUILD_PYTHON_LIBS:BOOL=FALSE - -DOPENEXR_BUILD_STATIC=${OPENEXR_BUILD_STATIC} - -DOPENEXR_BUILD_SHARED=${OPENEXR_BUILD_SHARED} - OPTIONS_DEBUG - -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}/debug - OPTIONS_RELEASE - -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}) + -DCMAKE_DEBUG_POSTFIX=_d + -DPYILMBASE_ENABLE=FALSE +) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/ilmbase TARGET_PATH share/ilmbase) +vcpkg_fixup_cmake_targets() + +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) -# NOTE: Only use ".exe" extension on Windows executables. -# Is there a cleaner way to do this? -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(EXECUTABLE_SUFFIX ".exe") -else() - set(EXECUTABLE_SUFFIX "") -endif() -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${EXECUTABLE_SUFFIX}) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/openexr/) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openexr) vcpkg_copy_pdbs() @@ -68,6 +52,8 @@ if (VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOpenEXR.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openexr/remove_find_package_macro.patch b/ports/openexr/remove_find_package_macro.patch new file mode 100644 index 00000000000000..967e89a83c7e3f --- /dev/null +++ b/ports/openexr/remove_find_package_macro.patch @@ -0,0 +1,87 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 111a603..109394f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,22 +25,12 @@ endif() + project(OpenEXRMetaProject) + + +-# An "official" way to make this a super-project +-# basically overrides the find_package to not find anything +-# for stuff we're including locally +-set(as_subproject IlmBase OpenEXR) +-macro(find_package) +- if(NOT "${ARGV0}" IN_LIST as_subproject) +- _find_package(${ARGV}) +- endif() +-endmacro() +- + + # If you want to use ctest to configure, build and + # upload the results, cmake has builtin support for + # submitting to CDash, or any server who speaks the + # same protocol +-# ++# + # These settings will need to be set for your environment, + # and then a script such as the example in + # +@@ -51,7 +41,7 @@ endmacro() + # cmake -S cmake/SampleCTestScript.cmake + # + # [or whatever you name the file you edit] +-# ++# + #set(CTEST_PROJECT_NAME "OpenEXR") + #set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC") + #set(CTEST_DROP_METHOD "http") # there are others... +diff --git a/OpenEXR/CMakeLists.txt b/OpenEXR/CMakeLists.txt +index 390b27f..87b2d01 100644 +--- a/OpenEXR/CMakeLists.txt ++++ b/OpenEXR/CMakeLists.txt +@@ -35,7 +35,6 @@ include(config/OpenEXRSetup.cmake) + + # Everyone depends on IlmBase, and we currently rely on + # the version matched with our release +-find_package(IlmBase ${OPENEXR_VERSION} EXACT REQUIRED CONFIG) + + # generates config headers, package config files + add_subdirectory(config) +diff --git a/OpenEXR/config/OpenEXRSetup.cmake b/OpenEXR/config/OpenEXRSetup.cmake +index 5116726..34c7c87 100644 +--- a/OpenEXR/config/OpenEXRSetup.cmake ++++ b/OpenEXR/config/OpenEXRSetup.cmake +@@ -33,7 +33,7 @@ endif() + # Whether to build & install the various command line utility programs + option(OPENEXR_BUILD_UTILS "Enables building of utility programs" ON) + +-# This is a variable here for use in controlling where include files are ++# This is a variable here for use in controlling where include files are + # installed. Care must be taken when changing this, as many things + # probably assume this is OpenEXR + set(OPENEXR_OUTPUT_SUBDIR OpenEXR CACHE STRING "Destination sub-folder of the include path for install") +diff --git a/OpenEXR_Viewers/CMakeLists.txt b/OpenEXR_Viewers/CMakeLists.txt +index 5efa353..5246fa7 100644 +--- a/OpenEXR_Viewers/CMakeLists.txt ++++ b/OpenEXR_Viewers/CMakeLists.txt +@@ -24,8 +24,6 @@ project(OpenEXR_Viewers VERSION ${OPENEXR_VIEWERS_VERSION}) + ####################################### + include(config/OpenEXRViewersSetup.cmake) + +-find_package(IlmBase ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) +-find_package(OpenEXR ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) + + # This is for newer cmake versions who know about vendor versions + set(OpenGL_GL_PREFERENCE GLVND) +diff --git a/PyIlmBase/CMakeLists.txt b/PyIlmBase/CMakeLists.txt +index 291b96e..7d5074f 100644 +--- a/PyIlmBase/CMakeLists.txt ++++ b/PyIlmBase/CMakeLists.txt +@@ -27,7 +27,6 @@ project(PyIlmBase VERSION ${PYILMBASE_VERSION} LANGUAGES C CXX) + include(config/PyIlmBaseSetup.cmake) + + # we have a strong dependence on IlmBase being an exact match +-find_package(IlmBase ${PYILMBASE_VERSION} EXACT REQUIRED CONFIG) + + # we are building a python extension, so of course we depend on + # python as well. Except we don't know which version... diff --git a/ports/openexr/remove_symlinks.patch b/ports/openexr/remove_symlinks.patch new file mode 100644 index 00000000000000..89b9c53f3c96fc --- /dev/null +++ b/ports/openexr/remove_symlinks.patch @@ -0,0 +1,40 @@ +diff --git a/IlmBase/config/LibraryDefine.cmake b/IlmBase/config/LibraryDefine.cmake +index 44254a7..1f5d2a6 100644 +--- a/IlmBase/config/LibraryDefine.cmake ++++ b/IlmBase/config/LibraryDefine.cmake +@@ -101,15 +101,6 @@ function(ILMBASE_DEFINE_LIBRARY libname) + if(BUILD_SHARED_LIBS AND (NOT "${ILMBASE_LIB_SUFFIX}" STREQUAL "")) + set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${ILMBASE_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) +- if(WIN32) +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") +- else() +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_LIBDIR} ${baselibname} -> ${verlibname}\")") +- endif() +- set(verlibname) +- set(baselibname) + endif() + + if(ILMBASE_BUILD_BOTH_STATIC_SHARED) +diff --git a/OpenEXR/config/LibraryDefine.cmake b/OpenEXR/config/LibraryDefine.cmake +index a9561dc..42853af 100644 +--- a/OpenEXR/config/LibraryDefine.cmake ++++ b/OpenEXR/config/LibraryDefine.cmake +@@ -95,15 +95,6 @@ function(OPENEXR_DEFINE_LIBRARY libname) + if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "")) + set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) +- if(WIN32) +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") +- else() +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_DIR} ${baselibname} -> ${verlibname}\")") +- endif() +- set(verlibname) +- set(baselibname) + endif() + + if(OPENEXR_BUILD_BOTH_STATIC_SHARED) diff --git a/ports/openexr/vcpkg-cmake-wrapper.cmake b/ports/openexr/vcpkg-cmake-wrapper.cmake index a977a420e867d7..479cd302782d11 100644 --- a/ports/openexr/vcpkg-cmake-wrapper.cmake +++ b/ports/openexr/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,38 @@ -set(OPENEXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +_find_package(${ARGS}) -if(NOT OpenEXR_LIBRARIES OR OPENEXR_LIBRARIES) - _find_package(${ARGS}) +if(TARGET OpenEXR::IlmImf AND NOT OPENEXR_LIBRARIES AND NOT OPENEXR_FOUND) + set(OPENEXR_FOUND TRUE CACHE BOOL "") + set(OpenEXR_FOUND TRUE CACHE BOOL "") + set(OPENEXR_VERSION "2.5.0" CACHE STRING "") + set(OpenEXR_VERSION "2.5.0" CACHE STRING "") + get_target_property(OpenEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_PATHS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_DIR OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS} CACHE STRING "") + set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} CACHE STRING "") + set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIRS} CACHE STRING "") + set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR} CACHE STRING "") + set(OPENEXR_ILMIMF_LIBRARY "OpenEXR::IlmImf" CACHE STRING "") + set(OPENEXR_ILMIMFUTIL_LIBRARY "OpenEXR::IlmImfUtil" CACHE STRING "") + set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMFUTIL_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} CACHE STRING "") endif() -set(CMAKE_MODULE_PATH ${OPENEXR_PREV_MODULE_PATH}) +if(TARGET IlmBase::Half AND NOT ILMBASE_LIBRARIES AND NOT ILMBASE_FOUND) + set(ILMBASE_FOUND TRUE CACHE BOOL "") + set(IlmBASE_FOUND TRUE CACHE BOOL "") + set(ILMBASE_VERSION "2.5.0" CACHE STRING "") + set(IlmBASE_VERSION "2.5.0" CACHE STRING "") + get_target_property(ILMBASE_INCLUDE_DIR IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(ILMBASE_INCLUDE_DIRS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(ILMBASE_INCLUDE_PATHS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + set(ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_DIR} CACHE STRING "") + set(ILMBASE_INCLUDE_DIRS ${ILMBASE_INCLUDE_DIRS} CACHE STRING "") + set(ILMBASE_INCLUDE_PATHS ${ILMBASE_INCLUDE_PATHS} CACHE STRING "") + set(OPENEXR_HALF_LIBRARY "IlmBase::Half" CACHE STRING "") + set(OPENEXR_IEX_LIBRARY "IlmBase::Iex" CACHE STRING "") + set(OPENEXR_IEXMATH_LIBRARY "IlmBase::IexMath" CACHE STRING "") + set(OPENEXR_ILMTHREAD_LIBRARY "IlmBase::IlmThread" CACHE STRING "") + set(OPENEXR_IMATH_LIBRARY "IlmBase::Imath" CACHE STRING "") + set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "") +endif() diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index c68f5cf8aeea2b..3612d396d1a61e 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -1,8 +1,9 @@ Source: openimageio Version: 2.1.16.0 +Port-Version: 3 Homepage: https://github.com/OpenImageIO/oiio Description: A library for reading and writing images, and a bunch of related classes, utilities, and application -Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt +Build-Depends: libjpeg-turbo, tiff, libpng, libheif, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt Feature: libraw Build-Depends: libraw diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 8e3e90ef84a6fd..f549457afbb5c6 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -66,7 +66,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO TARGET_PATH share/OpenImageIO) if ("tools" IN_LIST FEATURES) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openimageio) @@ -78,8 +78,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openimageio/vcpkg-cmake-wrapper.cmake b/ports/openimageio/vcpkg-cmake-wrapper.cmake index 82dc991f066967..688c83f3cc99d8 100644 --- a/ports/openimageio/vcpkg-cmake-wrapper.cmake +++ b/ports/openimageio/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(OPENIMAGEIO_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT OPENIMAGEIO_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${OPENIMAGEIO_PREV_MODULE_PATH}) diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index 0fd7d64a6a0ca2..07afd75f16236e 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,4 +1,17 @@ Source: openjpeg -Version: 2.3.1-1 +Version: 2.3.1 +Port-Version: 2 Homepage: https://github.com/uclouvain/openjpeg Description: JPEG 2000 image library + +Feature: jpwl +Description: Build optional component jpwl + +Feature: mj2 +Description: Build optional component mj2 + +Feature: jpip +Description: Build optional component jpip + +Feature: jp3d +Description: Build optional component jp3d diff --git a/ports/openjpeg/dll.location.patch b/ports/openjpeg/dll.location.patch new file mode 100644 index 00000000000000..bdc77a5427c31d --- /dev/null +++ b/ports/openjpeg/dll.location.patch @@ -0,0 +1,32 @@ +diff --git a/src/lib/openjp3d/CMakeLists.txt b/src/lib/openjp3d/CMakeLists.txt +index b0469af1f..75048ef13 100644 +--- a/src/lib/openjp3d/CMakeLists.txt ++++ b/src/lib/openjp3d/CMakeLists.txt +@@ -34,8 +34,9 @@ endif() + # Install library + install(TARGETS ${OPENJP3D_LIBRARY_NAME} + EXPORT OpenJP3DTargets +- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} +- COMPONENT Libraries ++ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ++ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries + ) + + # Install includes files +diff --git a/src/lib/openmj2/CMakeLists.txt b/src/lib/openmj2/CMakeLists.txt +index 25294b20e..e3acfe8e7 100644 +--- a/src/lib/openmj2/CMakeLists.txt ++++ b/src/lib/openmj2/CMakeLists.txt +@@ -53,8 +53,9 @@ endif() + # Install library + install(TARGETS ${OPENMJ2_LIBRARY_NAME} + EXPORT OpenMJ2Targets +- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} +- COMPONENT Libraries ++ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ++ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries + ) + + # Install includes files diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 2296734ad1c872..c6d854490fa0c5 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -1,27 +1,65 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO uclouvain/openjpeg REF v2.3.1 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 HEAD_REF master + PATCHES dll.location.patch ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=OFF" + "-DBUILD_STATIC_LIBS=ON") +else() + list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_STATIC_LIBS=OFF") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "jpwl" BUILD_JPWL + "mj2" BUILD_MJ2 + "jpip" BUILD_JPIP + "jp3d" BUILD_JP3D + ) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_CODEC:BOOL=OFF + -DBUILD_DOC:BOOL=OFF -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg -DOPENJPEG_INSTALL_INCLUDE_DIR=include + -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} + -DBUILD_PKGCONFIG_FILES=ON + ${FEATURE_OPTIONS} + ${OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() +if(VCPKG_TARGET_IS_WINDOWS) + # TODO: remove -lm from *.pc files +endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_fixup_cmake_targets() - +set(TOOL_NAMES) +if("jpwl" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_dec_server opj_jpwl_compress opj_jpwl_decompress) +endif() +if("mj2" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_compress opj_decompress opj_dump opj_mj2_compress opj_mj2_decompress opj_mj2_extract opj_mj2_wrap) +endif() +if("jpip" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_jpip_addxml opj_jpip_test opj_jpip_transcode) +endif() +if("jp3d" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_jp3d_compress opj_jp3d_decompress) +endif() +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg.h OPENJPEG_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}") @@ -32,7 +70,6 @@ string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}") file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg.h "${OPENJPEG_H}") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/openmama/CONTROL b/ports/openmama/CONTROL index 5dc512d82185a3..5f0fd3c5c8b524 100644 --- a/ports/openmama/CONTROL +++ b/ports/openmama/CONTROL @@ -1,5 +1,7 @@ Source: openmama Version: 6.3.0 +Port-Version: 1 Build-Depends: libevent, apr, qpid-proton +Supports: windows&(x64|x86) Homepage: https://github.com/OpenMAMA/OpenMAMA Description: OpenMAMA is a high performance vendor neutral lightweight wrapper that provides a common API interface to different middleware and messaging solutions across a variety of platforms and languages. diff --git a/ports/openmama/portfile.cmake b/ports/openmama/portfile.cmake index 997d11ec32c0b2..34b737e3ebda03 100644 --- a/ports/openmama/portfile.cmake +++ b/ports/openmama/portfile.cmake @@ -11,74 +11,43 @@ vcpkg_from_github( HEAD_REF next ) -set(OPENMAMA_TARGET_ARCH ${TRIPLET_SYSTEM_ARCH}) -if(${TRIPLET_SYSTEM_ARCH} STREQUAL x64) - set(OPENMAMA_TARGET_ARCH x86_64) -endif() - -# Clean from any previous builds -vcpkg_execute_required_process( - COMMAND ${SCONS} - -c - target_arch=${OPENMAMA_TARGET_ARCH} - libevent_home=${CURRENT_INSTALLED_DIR} - apr_home=${CURRENT_INSTALLED_DIR} - qpid_home=${CURRENT_INSTALLED_DIR} - vcpkg_build=y - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME clean-${TARGET_TRIPLET}.log -) - -# This build -vcpkg_execute_required_process( - COMMAND ${SCONS} - with_unittest=False - with_examples=False - product=mamda - lex=${FLEX} - middleware=qpid - buildtype=dynamic,dynamic-debug - prefix=\#install - with_dependency_runtimes=False - target_arch=${OPENMAMA_TARGET_ARCH} - libevent_home=${CURRENT_INSTALLED_DIR} - apr_home=${CURRENT_INSTALLED_DIR} - qpid_home=${CURRENT_INSTALLED_DIR} - vcpkg_build=y - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}.log +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DPROTON_ROOT=${CURRENT_INSTALLED_DIR} + -DAPR_ROOT=${CURRENT_INSTALLED_DIR} + -DINSTALL_RUNTIME_DEPENDENCIES=OFF + -DFLEX_EXECUTABLE=${FLEX} + -DWITH_EXAMPLES=OFF + -DWITH_TESTTOOLS=OFF ) -# Remove dependency files which build system creates for convenience -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic/libapr-1.dll) -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic/libapr-1.pdb) -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic-debug/libapr-1.dll) -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic-debug/libapr-1.pdb) -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic/qpid-proton.dll) -file(REMOVE ${SOURCE_PATH}/install/bin/dynamic-debug/qpid-protond.dll) - -# Custom install target - the build system doesn't really -# do prefixes properly and it has a different directory -# structure than vcpkg expects so reorganizing here -file(COPY ${SOURCE_PATH}/install/include - DESTINATION ${CURRENT_PACKAGES_DIR}) -file(COPY ${SOURCE_PATH}/install/lib/dynamic/ - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/install/lib/dynamic-debug/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(COPY ${SOURCE_PATH}/install/bin/dynamic/ - DESTINATION ${CURRENT_PACKAGES_DIR}/bin - FILES_MATCHING PATTERN "*.dll") -file(COPY ${SOURCE_PATH}/install/bin/dynamic-debug/ - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin - FILES_MATCHING PATTERN "*.dll") +vcpkg_install_cmake() # Copy across license files and copyright file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/openmama) -file(COPY ${SOURCE_PATH}/install/LICENSE.md - ${SOURCE_PATH}/install/LICENSE-3RD-PARTY.txt +file(COPY ${SOURCE_PATH}/LICENSE.md + ${SOURCE_PATH}/LICENSE-3RD-PARTY.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmama/) -file(COPY ${SOURCE_PATH}/install/LICENSE.md +file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmama/copyright) +# Clean up LICENSE file - vcpkg doesn't expect it to be there +file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE.MD ${CURRENT_PACKAGES_DIR}/debug/LICENSE.MD) + +# Temporary workaround until upstream project puts dll in right place +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libmamaplugindqstrategymd.dll") + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libmamaplugindqstrategymd.dll ${CURRENT_PACKAGES_DIR}/bin/libmamaplugindqstrategymd.dll) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libmamaplugindqstrategymd.dll") + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmamaplugindqstrategymd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmamaplugindqstrategymd.dll) +endif() + +# Vcpkg does not expect include files to be in the debug directory +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Vcpkg does not like this header name and shouldn't be required anyway, so remove it +file(REMOVE "${CURRENT_PACKAGES_DIR}/include/platform.h") + vcpkg_copy_pdbs() diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL index 4da1df53ed4e66..b9c4df053c68d3 100644 --- a/ports/openmpi/CONTROL +++ b/ports/openmpi/CONTROL @@ -1,5 +1,6 @@ Source: openmpi Version: 4.0.3 +Port-Version: 3 Homepage: https://www.open-mpi.org/ Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers. Supports: !(windows|uwp) diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake index 6dbb01127c78ae..a51f55d0d4cd34 100644 --- a/ports/openmpi/portfile.cmake +++ b/ports/openmpi/portfile.cmake @@ -21,6 +21,7 @@ get_filename_component(PERL_PATH ${PERL} DIRECTORY) vcpkg_add_to_path(${PERL_PATH}) vcpkg_configure_make( + COPY_SOURCE SOURCE_PATH ${SOURCE_PATH} OPTIONS --with-hwloc=internal @@ -29,7 +30,7 @@ vcpkg_configure_make( --enable-debug ) -vcpkg_install_make() +vcpkg_install_make(DISABLE_PARALLEL) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/openmvg/CONTROL b/ports/openmvg/CONTROL index dd7dc1e9b261c8..288d530acd1515 100644 --- a/ports/openmvg/CONTROL +++ b/ports/openmvg/CONTROL @@ -1,7 +1,8 @@ Source: openmvg Version: 1.5 +Port-Version: 1 Description: open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion. -Build-Depends: coinutils, clp, osi, liblemon, flann, eigen3, ceres, cereal, libjpeg-turbo, tiff, libpng, zlib, suitesparse +Build-Depends: coinutils, clp, osi, liblemon, flann, eigen3, ceres[suitesparse,cxsparse], cereal, libjpeg-turbo, tiff, libpng, zlib, vlfeat Feature: opencv Build-Depends: opencv[contrib] @@ -9,3 +10,7 @@ Description: opencv support for openmvg Feature: openmp Description: openmp support for openmvg + +Feature: software +Build-Depends: qt5-base, qt5-svg +Description: build openMVG tools diff --git a/ports/openmvg/fixcmake.patch b/ports/openmvg/build_fixes.patch similarity index 57% rename from ports/openmvg/fixcmake.patch rename to ports/openmvg/build_fixes.patch index fc84774c4608ff..fff8846d28e9e2 100644 --- a/ports/openmvg/fixcmake.patch +++ b/ports/openmvg/build_fixes.patch @@ -1,421 +1,723 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9cfd06c..a4dea06 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -14,6 +14,7 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "In-source builds not allowed.") - endif() - -+if(0) - # ============================================================================== - # OpenMVG build options - # ============================================================================== -@@ -31,7 +32,7 @@ option(OpenMVG_USE_OPENMP "Enable OpenMP parallelization" ON) - # and openMVG simultaneously - # ============================================================================== - option(OpenMVG_USE_OPENCV "Build or not opencv+openMVG samples programs" OFF) -- -+endif() - # ============================================================================== - # Since OpenCV 3, SIFT is no longer in the default modules. See - # https://github.com/itseez/opencv_contrib for more informations. -@@ -85,6 +86,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - register_definitions(-DOPENMVG_STD_UNORDERED_MAP) - endif() - -+if(0) - # ============================================================================== - # Check that submodule have been initialized and updated - # ============================================================================== -@@ -93,6 +95,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) - "\n submodule(s) are missing, please update your repository:\n" - " > git submodule update -i\n") - endif() -+endif() - - # ============================================================================== - # Additional cmake find modules -@@ -128,7 +131,6 @@ if (OpenMVG_USE_OPENMP) - find_package(OpenMP) - if (OPENMP_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" ON) - register_definitions(-DOPENMVG_USE_OPENMP) - if (NOT MSVC) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -@@ -139,11 +141,6 @@ if (OpenMVG_USE_OPENMP) - endif() - endif (NOT MSVC) - endif (OPENMP_FOUND) --else (OpenMVG_USE_OPENMP) -- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" OFF) -- include(UpdateCacheVariable) -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENMP OFF) -- remove_definitions(-DOPENMVG_USE_OPENMP) - endif (OpenMVG_USE_OPENMP) - - # ============================================================================== -@@ -182,6 +179,7 @@ if (OpenMVG_BUILD_OPENGL_EXAMPLES) - set_property(TARGET glfw PROPERTY FOLDER OpenMVG/3rdParty/glfw) - endif (OpenMVG_BUILD_OPENGL_EXAMPLES) - -+if(0) - # Dependencies install rules - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/ -@@ -189,7 +187,7 @@ install( - COMPONENT headers - FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" - ) -- -+endif() - # ============================================================================== - # --END-- SUBMODULE CONFIGURATION - # ============================================================================== -@@ -225,6 +223,7 @@ ENDMACRO(UNIT_TEST) - # - external by default - # - internal if cereal not found - # ============================================================================== -+if(0) - find_package(cereal QUIET CONFIG) - if (NOT TARGET cereal) - add_library(cereal INTERFACE) -@@ -237,6 +236,10 @@ if (NOT TARGET cereal) - - set(OpenMVG_USE_INTERNAL_CEREAL ON) - endif() -+endif() -+ -+find_package(cereal REQUIRED CONFIG) -+get_target_property(CEREAL_INCLUDE_DIRS cereal INTERFACE_INCLUDE_DIRECTORIES) - - # ============================================================================== - # Eigen -@@ -245,6 +248,7 @@ endif() - # - external if EIGEN_INCLUDE_DIR_HINTS is defined - # - internal if Eigen not found - # ============================================================================== -+if(0) - find_package(Eigen3 QUIET) - if (NOT Eigen3_FOUND) - set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen) -@@ -253,13 +257,17 @@ if (NOT Eigen3_FOUND) - else() - set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) - endif() -+endif() - -+find_package(Eigen3 REQUIRED) -+set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) - # ============================================================================== - # Ceres - # ============================================================================== - # - external by default if CERES_DIR_HINTS or find_package found a valid Ceres - # - internal if ceres not found (ceres-solver+cxsparse+miniglog) - # ============================================================================== -+if(0) - find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS}) - if (NOT Ceres_FOUND) - set(OpenMVG_USE_INTERNAL_CERES ON) -@@ -271,13 +279,16 @@ if (NOT Ceres_FOUND) - STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG}) - set(CERES_LIBRARIES openMVG_ceres) - endif() -+endif() - -+find_package(Ceres REQUIRED) - # ============================================================================== - # Flann - # ============================================================================== - # - internal by default (flann), - # - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS) - set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) - set(OpenMVG_USE_INTERNAL_FLANN ON) -@@ -286,13 +297,16 @@ find_package(Flann QUIET) - if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN) - set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) - endif() -+endif() - -+find_package(flann REQUIRED) - # ============================================================================== - # CoinUtils - # ============================================================================== - # - internal by default (CoinUtils), - # - external if COINUTILS_INCLUDE_DIR_HINTS and a valid CoinUtils setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS) - set(COINUTILS_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/CoinUtils/src/) - set(OpenMVG_USE_INTERNAL_COINUTILS ON) -@@ -302,13 +316,16 @@ if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS) - else() - find_package(CoinUtils QUIET) - endif() -+endif() - -+find_package(CoinUtils REQUIRED) - ## ============================================================================== - ## Clp - ## ============================================================================== - ## - internal by default (Clp), - ## - external if CLP_INCLUDE_DIR_HINTS and a valid Clp setup is found - ## ============================================================================== -+if(0) - if (NOT DEFINED CLP_INCLUDE_DIR_HINTS) - set(CLP_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/) - set(OpenMVG_USE_INTERNAL_CLP ON) -@@ -320,6 +337,9 @@ if (NOT DEFINED CLP_INCLUDE_DIR_HINTS) - else() - find_package(Clp QUIET) - endif() -+endif() -+ -+find_package(Clp REQUIRED) - - # ============================================================================== - # Osi -@@ -327,6 +347,7 @@ endif() - # - internal by default (Osi), - # - external if OSI_INCLUDE_DIR_HINTS and a valid Osi setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED OSI_INCLUDE_DIR_HINTS) - set(OSI_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Osi/src/) - set(OpenMVG_USE_INTERNAL_OSI ON) -@@ -336,6 +357,9 @@ if (NOT DEFINED OSI_INCLUDE_DIR_HINTS) - else() - find_package(Osi QUIET) - endif() -+endif() -+ -+find_package(Osi REQUIRED) - - # ============================================================================== - # Internal CLP/OSI/COINUTILS libraries: -@@ -354,6 +378,7 @@ endif() - # - internal by default (Lemon), - # - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS) - set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon) - set(OpenMVG_USE_INTERNAL_LEMON ON) -@@ -365,6 +390,9 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) - ${PROJECT_BINARY_DIR}/third_party/lemon) - set(LEMON_LIBRARY openMVG_lemon) - endif() -+endif() -+ -+find_package(LEMON REQUIRED) - - # ============================================================================== - # OpenCV -@@ -372,15 +400,13 @@ endif() - # - only external and enabled only if OpenMVG_USE_OPENCV is set to ON - # ============================================================================== - if (OpenMVG_USE_OPENCV) -- find_package( OpenCV QUIET ) -- if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") -- message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENCV OFF) -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OCVSIFT OFF) -- endif() -+ find_package( OpenCV REQUIRED ) - endif() - -- -+# ============================================================================== -+# Suitesparse -+# ============================================================================== -+find_package(suitesparse REQUIRED) - # ============================================================================== - # Third-party libraries: - # ============================================================================== -@@ -472,67 +498,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT}) - - message("\n") - --if (DEFINED OpenMVG_USE_INTERNAL_CEREAL) -+if (OpenMVG_USE_INTERNAL_CEREAL) - message(STATUS "CEREAL: (internal)") - else() - message(STATUS "CEREAL: (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) -+if (OpenMVG_USE_INTERNAL_EIGEN) - message(STATUS "EIGEN: " ${EIGEN_VERSION} " (internal)") - else() - message(STATUS "EIGEN: " ${EIGEN_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_CERES) -+if (OpenMVG_USE_INTERNAL_CERES) - message(STATUS "CERES: " ${CERES_VERSION} " (internal)") - else() - message(STATUS "CERES: " ${CERES_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (OpenMVG_USE_INTERNAL_FLANN) - message(STATUS "FLANN: " ${FLANN_VERSION} " (internal)") - else() - message(STATUS "FLANN: " ${FLANN_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_TIFF) -+if (OpenMVG_USE_INTERNAL_TIFF) - message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (internal)") - else() - message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_PNG) -+if (OpenMVG_USE_INTERNAL_PNG) - message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (internal)") - else() - message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_JPEG) -+if (OpenMVG_USE_INTERNAL_JPEG) - message(STATUS "LIBJPEG (internal)") - else() - message(STATUS "LIBJPEG (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_CLP) -+if (OpenMVG_USE_INTERNAL_CLP) - message(STATUS "CLP: " ${CLP_VERSION} " (internal)") - else() - message(STATUS "CLP: " ${CLP_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_COINUTILS) -+if (OpenMVG_USE_INTERNAL_COINUTILS) - message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (internal)") - else() - message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_OSI) -+if (OpenMVG_USE_INTERNAL_OSI) - message(STATUS "OSI: " ${OSI_VERSION} " (internal)") - else() - message(STATUS "OSI: " ${OSI_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_LEMON) -+if (OpenMVG_USE_INTERNAL_LEMON) - message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)") - else() - message(STATUS "LEMON: " ${LEMON_VERSION} " (external)") -diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake -index 8a69c23..6a81580 100644 ---- a/src/cmakeFindModules/FindClp.cmake -+++ b/src/cmakeFindModules/FindClp.cmake -@@ -51,9 +51,8 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "") - SET(CLP_INCLUDE_DIR ${CLP_DIR}) - - FIND_LIBRARY(CLP_LIBRARY NAMES Clp) -- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver) -- FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp) -- -+ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp) -+ FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp Clp) - # locate Clp libraries - IF(DEFINED CLP_LIBRARY AND DEFINED CLPSOLVER_LIBRARY AND DEFINED OSICLP_LIBRARY) - SET(CLP_LIBRARIES ${CLP_LIBRARY} ${CLPSOLVER_LIBRARY} ${OSICLP_LIBRARY}) -diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt -index cc5212f..acc57dd 100644 ---- a/src/openMVG/linearProgramming/CMakeLists.txt -+++ b/src/openMVG/linearProgramming/CMakeLists.txt -@@ -15,16 +15,12 @@ target_link_libraries(openMVG_linearProgramming - PUBLIC - openMVG_numeric - PRIVATE -- ${CLP_LIBRARIES} # clp + solver wrapper -- ${COINUTILS_LIBRARY} # container tools -- ${OSI_LIBRARY} # generic LP -+ Coin::Clp # clp + solver wrapper -+ Coin::CoinUtils # container tools -+ Coin::Osi # generic LP - ) - - target_include_directories(openMVG_linearProgramming -- PRIVATE -- ${CLP_INCLUDE_DIRS} -- ${COINUTILS_INCLUDE_DIRS} -- ${OSI_INCLUDE_DIRS} - PUBLIC - $ - ) -diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt -index 5fcd972..b21ea7b 100644 ---- a/src/openMVG/matching/CMakeLists.txt -+++ b/src/openMVG/matching/CMakeLists.txt -@@ -18,6 +18,7 @@ list(REMOVE_ITEM matching_files_cpp ${REMOVEFILESUNITTEST}) - - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) -+find_package(flann REQUIRED) - - set_source_files_properties(${matching_files_cpp} PROPERTIES LANGUAGE CXX) - add_library(openMVG_matching -@@ -39,10 +40,10 @@ target_link_libraries(openMVG_matching - Threads::Threads - cereal - ) --if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (NOT OpenMVG_USE_INTERNAL_FLANN) - target_link_libraries(openMVG_matching - PUBLIC -- ${FLANN_LIBRARIES} -+ flann::flann - ) - endif() - set_target_properties(openMVG_matching PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}") -diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt -index 816a941..f0b7145 100644 ---- a/src/third_party/CMakeLists.txt -+++ b/src/third_party/CMakeLists.txt -@@ -18,7 +18,7 @@ add_subdirectory(stlplus3) - set(STLPLUS_LIBRARY openMVG_stlplus PARENT_SCOPE) - - # Add graph library --if(DEFINED OpenMVG_USE_INTERNAL_LEMON) -+if(OpenMVG_USE_INTERNAL_LEMON) - add_subdirectory(lemon) - set_property(TARGET openMVG_lemon PROPERTY FOLDER OpenMVG/3rdParty/lemon) - set_property(TARGET check PROPERTY FOLDER OpenMVG/3rdParty/lemon) -@@ -68,7 +68,7 @@ endif (NOT TIFF_FOUND) - add_subdirectory(vectorGraphics) - - # Add ceres-solver (A Nonlinear Least Squares Minimizer) --if (DEFINED OpenMVG_USE_INTERNAL_CERES) -+if (OpenMVG_USE_INTERNAL_CERES) - add_subdirectory(cxsparse) - add_subdirectory(ceres-solver) - set_property(TARGET openMVG_cxsparse PROPERTY FOLDER OpenMVG/3rdParty/ceres) -@@ -76,7 +76,7 @@ if (DEFINED OpenMVG_USE_INTERNAL_CERES) - endif() - - # Add an Approximate Nearest Neighbor library --if (DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (OpenMVG_USE_INTERNAL_FLANN) - set(FLANN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/flann/src/cpp) - add_subdirectory(flann) - endif() -@@ -90,7 +90,7 @@ add_subdirectory(fast) - ## - # Install Header only libraries if necessary - ## --if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) -+if (OpenMVG_USE_INTERNAL_EIGEN) - #Configure Eigen install - set(EIGEN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen) - add_subdirectory(eigen) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9cfd06c..8859469 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -14,6 +14,7 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds not allowed.") + endif() + ++if(0) + # ============================================================================== + # OpenMVG build options + # ============================================================================== +@@ -31,7 +32,7 @@ option(OpenMVG_USE_OPENMP "Enable OpenMP parallelization" ON) + # and openMVG simultaneously + # ============================================================================== + option(OpenMVG_USE_OPENCV "Build or not opencv+openMVG samples programs" OFF) +- ++endif() + # ============================================================================== + # Since OpenCV 3, SIFT is no longer in the default modules. See + # https://github.com/itseez/opencv_contrib for more informations. +@@ -85,6 +86,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + register_definitions(-DOPENMVG_STD_UNORDERED_MAP) + endif() + ++if(0) + # ============================================================================== + # Check that submodule have been initialized and updated + # ============================================================================== +@@ -93,6 +95,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) + "\n submodule(s) are missing, please update your repository:\n" + " > git submodule update -i\n") + endif() ++endif() + + # ============================================================================== + # Additional cmake find modules +@@ -128,7 +131,6 @@ if (OpenMVG_USE_OPENMP) + find_package(OpenMP) + if (OPENMP_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" ON) + register_definitions(-DOPENMVG_USE_OPENMP) + if (NOT MSVC) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +@@ -139,11 +141,6 @@ if (OpenMVG_USE_OPENMP) + endif() + endif (NOT MSVC) + endif (OPENMP_FOUND) +-else (OpenMVG_USE_OPENMP) +- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" OFF) +- include(UpdateCacheVariable) +- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENMP OFF) +- remove_definitions(-DOPENMVG_USE_OPENMP) + endif (OpenMVG_USE_OPENMP) + + # ============================================================================== +@@ -160,10 +157,10 @@ endif() + # ============================================================================== + # IMAGE IO detection + # ============================================================================== +-find_package(JPEG QUIET) +-find_package(PNG QUIET) +-find_package(TIFF QUIET) +- ++find_package(JPEG REQUIRED) ++find_package(PNG REQUIRED) ++find_package(TIFF REQUIRED) ++find_package(vlfeat REQUIRED) + # Folders + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +@@ -182,6 +179,7 @@ if (OpenMVG_BUILD_OPENGL_EXAMPLES) + set_property(TARGET glfw PROPERTY FOLDER OpenMVG/3rdParty/glfw) + endif (OpenMVG_BUILD_OPENGL_EXAMPLES) + ++if(0) + # Dependencies install rules + install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/ +@@ -189,7 +187,7 @@ install( + COMPONENT headers + FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" + ) +- ++endif() + # ============================================================================== + # --END-- SUBMODULE CONFIGURATION + # ============================================================================== +@@ -225,6 +223,7 @@ ENDMACRO(UNIT_TEST) + # - external by default + # - internal if cereal not found + # ============================================================================== ++if(0) + find_package(cereal QUIET CONFIG) + if (NOT TARGET cereal) + add_library(cereal INTERFACE) +@@ -237,6 +236,10 @@ if (NOT TARGET cereal) + + set(OpenMVG_USE_INTERNAL_CEREAL ON) + endif() ++endif() ++ ++find_package(cereal REQUIRED CONFIG) ++get_target_property(CEREAL_INCLUDE_DIRS cereal INTERFACE_INCLUDE_DIRECTORIES) + + # ============================================================================== + # Eigen +@@ -245,6 +248,7 @@ endif() + # - external if EIGEN_INCLUDE_DIR_HINTS is defined + # - internal if Eigen not found + # ============================================================================== ++if(0) + find_package(Eigen3 QUIET) + if (NOT Eigen3_FOUND) + set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen) +@@ -253,13 +257,17 @@ if (NOT Eigen3_FOUND) + else() + set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) + endif() ++endif() + ++find_package(Eigen3 REQUIRED) ++set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) + # ============================================================================== + # Ceres + # ============================================================================== + # - external by default if CERES_DIR_HINTS or find_package found a valid Ceres + # - internal if ceres not found (ceres-solver+cxsparse+miniglog) + # ============================================================================== ++if(0) + find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS}) + if (NOT Ceres_FOUND) + set(OpenMVG_USE_INTERNAL_CERES ON) +@@ -271,13 +279,16 @@ if (NOT Ceres_FOUND) + STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG}) + set(CERES_LIBRARIES openMVG_ceres) + endif() ++endif() + ++find_package(Ceres REQUIRED) + # ============================================================================== + # Flann + # ============================================================================== + # - internal by default (flann), + # - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS) + set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) + set(OpenMVG_USE_INTERNAL_FLANN ON) +@@ -286,13 +297,16 @@ find_package(Flann QUIET) + if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN) + set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) + endif() ++endif() + ++find_package(flann REQUIRED) + # ============================================================================== + # CoinUtils + # ============================================================================== + # - internal by default (CoinUtils), + # - external if COINUTILS_INCLUDE_DIR_HINTS and a valid CoinUtils setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS) + set(COINUTILS_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/CoinUtils/src/) + set(OpenMVG_USE_INTERNAL_COINUTILS ON) +@@ -302,13 +316,16 @@ if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS) + else() + find_package(CoinUtils QUIET) + endif() ++endif() + ++find_package(CoinUtils REQUIRED) + ## ============================================================================== + ## Clp + ## ============================================================================== + ## - internal by default (Clp), + ## - external if CLP_INCLUDE_DIR_HINTS and a valid Clp setup is found + ## ============================================================================== ++if(0) + if (NOT DEFINED CLP_INCLUDE_DIR_HINTS) + set(CLP_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/) + set(OpenMVG_USE_INTERNAL_CLP ON) +@@ -320,6 +337,9 @@ if (NOT DEFINED CLP_INCLUDE_DIR_HINTS) + else() + find_package(Clp QUIET) + endif() ++endif() ++ ++find_package(Clp REQUIRED) + + # ============================================================================== + # Osi +@@ -327,6 +347,7 @@ endif() + # - internal by default (Osi), + # - external if OSI_INCLUDE_DIR_HINTS and a valid Osi setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED OSI_INCLUDE_DIR_HINTS) + set(OSI_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Osi/src/) + set(OpenMVG_USE_INTERNAL_OSI ON) +@@ -336,6 +357,9 @@ if (NOT DEFINED OSI_INCLUDE_DIR_HINTS) + else() + find_package(Osi QUIET) + endif() ++endif() ++ ++find_package(Osi REQUIRED) + + # ============================================================================== + # Internal CLP/OSI/COINUTILS libraries: +@@ -354,6 +378,7 @@ endif() + # - internal by default (Lemon), + # - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS) + set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon) + set(OpenMVG_USE_INTERNAL_LEMON ON) +@@ -365,6 +390,9 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) + ${PROJECT_BINARY_DIR}/third_party/lemon) + set(LEMON_LIBRARY openMVG_lemon) + endif() ++endif() ++ ++find_package(LEMON REQUIRED) + + # ============================================================================== + # OpenCV +@@ -372,20 +400,13 @@ endif() + # - only external and enabled only if OpenMVG_USE_OPENCV is set to ON + # ============================================================================== + if (OpenMVG_USE_OPENCV) +- find_package( OpenCV QUIET ) +- if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") +- message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") +- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENCV OFF) +- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OCVSIFT OFF) +- endif() ++ find_package( OpenCV REQUIRED ) + endif() + +- + # ============================================================================== + # Third-party libraries: + # ============================================================================== + add_subdirectory(third_party) +-add_subdirectory(testing) + + # ============================================================================== + # openMVG modules +@@ -472,67 +493,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT}) + + message("\n") + +-if (DEFINED OpenMVG_USE_INTERNAL_CEREAL) ++if (OpenMVG_USE_INTERNAL_CEREAL) + message(STATUS "CEREAL: (internal)") + else() + message(STATUS "CEREAL: (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) ++if (OpenMVG_USE_INTERNAL_EIGEN) + message(STATUS "EIGEN: " ${EIGEN_VERSION} " (internal)") + else() + message(STATUS "EIGEN: " ${EIGEN_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_CERES) ++if (OpenMVG_USE_INTERNAL_CERES) + message(STATUS "CERES: " ${CERES_VERSION} " (internal)") + else() + message(STATUS "CERES: " ${CERES_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_FLANN) ++if (OpenMVG_USE_INTERNAL_FLANN) + message(STATUS "FLANN: " ${FLANN_VERSION} " (internal)") + else() + message(STATUS "FLANN: " ${FLANN_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_TIFF) ++if (OpenMVG_USE_INTERNAL_TIFF) + message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (internal)") + else() + message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_PNG) ++if (OpenMVG_USE_INTERNAL_PNG) + message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (internal)") + else() + message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_JPEG) ++if (OpenMVG_USE_INTERNAL_JPEG) + message(STATUS "LIBJPEG (internal)") + else() + message(STATUS "LIBJPEG (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_CLP) ++if (OpenMVG_USE_INTERNAL_CLP) + message(STATUS "CLP: " ${CLP_VERSION} " (internal)") + else() + message(STATUS "CLP: " ${CLP_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_COINUTILS) ++if (OpenMVG_USE_INTERNAL_COINUTILS) + message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (internal)") + else() + message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_OSI) ++if (OpenMVG_USE_INTERNAL_OSI) + message(STATUS "OSI: " ${OSI_VERSION} " (internal)") + else() + message(STATUS "OSI: " ${OSI_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_LEMON) ++if (OpenMVG_USE_INTERNAL_LEMON) + message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)") + else() + message(STATUS "LEMON: " ${LEMON_VERSION} " (external)") +diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake +index 8a69c23..6a81580 100644 +--- a/src/cmakeFindModules/FindClp.cmake ++++ b/src/cmakeFindModules/FindClp.cmake +@@ -51,9 +51,8 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "") + SET(CLP_INCLUDE_DIR ${CLP_DIR}) + + FIND_LIBRARY(CLP_LIBRARY NAMES Clp) +- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver) +- FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp) +- ++ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp) ++ FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp Clp) + # locate Clp libraries + IF(DEFINED CLP_LIBRARY AND DEFINED CLPSOLVER_LIBRARY AND DEFINED OSICLP_LIBRARY) + SET(CLP_LIBRARIES ${CLP_LIBRARY} ${CLPSOLVER_LIBRARY} ${OSICLP_LIBRARY}) +diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in +index e7dfbfd..c01910d 100644 +--- a/src/cmakeFindModules/OpenMVGConfig.cmake.in ++++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in +@@ -19,7 +19,7 @@ + # OPENMVG_VERSION: Version of OpenMVG found. + # + +-# Called if we failed to find OpenMVG or any of it's required dependencies, ++# Called if we failed to find OpenMVG or any of its required dependencies, + # unsets all public (designed to be used externally) variables and reports + # error message at priority depending upon [REQUIRED/QUIET/] argument. + macro(OPENMVG_REPORT_NOT_FOUND REASON_MSG) +@@ -59,9 +59,19 @@ set(CALLERS_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) + # script. + set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) + ++include(CMakeFindDependencyMacro) ++find_dependency(CoinUtils) ++find_dependency(Clp) ++find_dependency(Osi) ++find_dependency(flann) ++find_dependency(Threads) ++find_dependency(cereal) ++find_dependency(Ceres) ++find_dependency(vlfeat) ++ + # Build the absolute root install directory as a relative path + get_filename_component(CURRENT_ROOT_INSTALL_DIR +- ${CMAKE_MODULE_PATH}/../../../ ABSOLUTE) ++ ${CMAKE_MODULE_PATH}/../../ ABSOLUTE) + if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) + OPENMVG_REPORT_NOT_FOUND( + "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " +diff --git a/src/nonFree/sift/CMakeLists.txt b/src/nonFree/sift/CMakeLists.txt +index 402a2d8..60ddc11 100644 +--- a/src/nonFree/sift/CMakeLists.txt ++++ b/src/nonFree/sift/CMakeLists.txt +@@ -1,36 +1,36 @@ + +-# libs should be static +-set(BUILD_SHARED_LIBS OFF) +- +-# use PIC code for link into shared lib +-if(UNIX) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +-endif(UNIX) +- +-if(NOT USE_SSE2) +- add_definitions(-DVL_DISABLE_SSE2) +-endif() +- +-add_definitions(-DVL_DISABLE_THREADS) +- +-include_directories(./vl) +-set(FEATS +- vl/generic.c +- vl/imopv_sse2.c +- vl/sift.c +- vl/imopv.c +- vl/mathop_sse2.c +- vl/sift.c +- vl/host.c +- vl/mathop.c +- vl/random.c) +-set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C) +-add_library(vlsift ${FEATS}) +-install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets) +-set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree) ++## libs should be static ++#set(BUILD_SHARED_LIBS OFF) ++# ++## use PIC code for link into shared lib ++#if(UNIX) ++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ++#endif(UNIX) ++# ++#if(NOT USE_SSE2) ++# add_definitions(-DVL_DISABLE_SSE2) ++#endif() ++# ++#add_definitions(-DVL_DISABLE_THREADS) ++# ++#include_directories(./vl) ++#set(FEATS ++# vl/generic.c ++# vl/imopv_sse2.c ++# vl/sift.c ++# vl/imopv.c ++# vl/mathop_sse2.c ++# vl/sift.c ++# vl/host.c ++# vl/mathop.c ++# vl/random.c) ++#set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C) ++#add_library(vlsift ${FEATS}) ++#install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets) ++#set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree) + install( + DIRECTORY . + DESTINATION include/openMVG_dependencies/nonFree/sift + COMPONENT headers +- FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" ++ FILES_MATCHING PATTERN "*.hpp" + ) +diff --git a/src/nonFree/sift/SIFT_describer.hpp b/src/nonFree/sift/SIFT_describer.hpp +index cd800b0..20e9c8e 100644 +--- a/src/nonFree/sift/SIFT_describer.hpp ++++ b/src/nonFree/sift/SIFT_describer.hpp +@@ -17,9 +17,7 @@ + #include + #include + +-extern "C" { +-#include "nonFree/sift/vl/sift.h" +-} ++#include + + namespace openMVG { + namespace features { +@@ -174,7 +172,7 @@ public: + const int nkeys = vl_sift_get_nkeypoints(filt); + + // Update gradient before launching parallel extraction +- vl_sift_update_gradient(filt); ++ update_gradient(filt); + + #ifdef OPENMVG_USE_OPENMP + #pragma omp parallel for private(descr, descriptor) +diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt +index cc5212f..acc57dd 100644 +--- a/src/openMVG/linearProgramming/CMakeLists.txt ++++ b/src/openMVG/linearProgramming/CMakeLists.txt +@@ -15,16 +15,12 @@ target_link_libraries(openMVG_linearProgramming + PUBLIC + openMVG_numeric + PRIVATE +- ${CLP_LIBRARIES} # clp + solver wrapper +- ${COINUTILS_LIBRARY} # container tools +- ${OSI_LIBRARY} # generic LP ++ Coin::Clp # clp + solver wrapper ++ Coin::CoinUtils # container tools ++ Coin::Osi # generic LP + ) + + target_include_directories(openMVG_linearProgramming +- PRIVATE +- ${CLP_INCLUDE_DIRS} +- ${COINUTILS_INCLUDE_DIRS} +- ${OSI_INCLUDE_DIRS} + PUBLIC + $ + ) +diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt +index 5fcd972..b21ea7b 100644 +--- a/src/openMVG/matching/CMakeLists.txt ++++ b/src/openMVG/matching/CMakeLists.txt +@@ -18,6 +18,7 @@ list(REMOVE_ITEM matching_files_cpp ${REMOVEFILESUNITTEST}) + + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) ++find_package(flann REQUIRED) + + set_source_files_properties(${matching_files_cpp} PROPERTIES LANGUAGE CXX) + add_library(openMVG_matching +@@ -39,10 +40,10 @@ target_link_libraries(openMVG_matching + Threads::Threads + cereal + ) +-if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN) ++if (NOT OpenMVG_USE_INTERNAL_FLANN) + target_link_libraries(openMVG_matching + PUBLIC +- ${FLANN_LIBRARIES} ++ flann::flann + ) + endif() + set_target_properties(openMVG_matching PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}") +diff --git a/src/openMVG/numeric/CMakeLists.txt b/src/openMVG/numeric/CMakeLists.txt +index 06baee7..47255be 100644 +--- a/src/openMVG/numeric/CMakeLists.txt ++++ b/src/openMVG/numeric/CMakeLists.txt +@@ -24,7 +24,7 @@ target_include_directories(openMVG_numeric + $ + $ + ) +-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) ++if (OpenMVG_USE_INTERNAL_EIGEN) + target_include_directories(openMVG_numeric PUBLIC + $) + else() +diff --git a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt +index 862ffc7..326fc9a 100644 +--- a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt ++++ b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt +@@ -18,7 +18,7 @@ if (OpenMVG_BUILD_GUI_SOFTWARES) + add_executable( openMVG_sample_describe_and_match_GUI WIN32 ${FEATURES_PAIR_DEMO_SRCS} ${FEATURES_PAIR_DEMO_HDRS} ) + endif( APPLE ) + +- target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching vlsift ) ++ target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching unofficial::vlfeat::vl ) + + set_target_properties( openMVG_sample_describe_and_match_GUI PROPERTIES CXX_STANDARD 11) + +diff --git a/src/openMVG_Samples/features_image_matching/CMakeLists.txt b/src/openMVG_Samples/features_image_matching/CMakeLists.txt +index 18fb385..d44ffce 100644 +--- a/src/openMVG_Samples/features_image_matching/CMakeLists.txt ++++ b/src/openMVG_Samples/features_image_matching/CMakeLists.txt +@@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_image_matching + openMVG_features + openMVG_matching + ${STLPLUS_LIBRARY} +- vlsift) ++ unofficial::vlfeat::vl) + target_compile_definitions(openMVG_sample_image_matching + PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") + +diff --git a/src/openMVG_Samples/features_repeatability/CMakeLists.txt b/src/openMVG_Samples/features_repeatability/CMakeLists.txt +index fd2b7c6..91f2766 100644 +--- a/src/openMVG_Samples/features_repeatability/CMakeLists.txt ++++ b/src/openMVG_Samples/features_repeatability/CMakeLists.txt +@@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_main_features_repeatability_dataset + openMVG_matching + openMVG_system + openMVG_multiview +- vlsift ++ unofficial::vlfeat::vl + ${STLPLUS_LIBRARY}) + + set_property(TARGET openMVG_sample_main_features_repeatability_dataset PROPERTY FOLDER OpenMVG/Samples) +diff --git a/src/software/Localization/CMakeLists.txt b/src/software/Localization/CMakeLists.txt +index 2f60393..0d57d0a 100644 +--- a/src/software/Localization/CMakeLists.txt ++++ b/src/software/Localization/CMakeLists.txt +@@ -11,7 +11,7 @@ target_link_libraries(openMVG_main_SfM_Localization + openMVG_sfm + openMVG_exif + ${STLPLUS_LIBRARY} +- vlsift ++ unofficial::vlfeat::vl + ) + + # Installation rules +diff --git a/src/software/SfM/CMakeLists.txt b/src/software/SfM/CMakeLists.txt +index 013a6c8..f38daa9 100644 +--- a/src/software/SfM/CMakeLists.txt ++++ b/src/software/SfM/CMakeLists.txt +@@ -44,7 +44,7 @@ target_link_libraries(openMVG_main_ComputeFeatures + openMVG_multiview + openMVG_sfm + ${STLPLUS_LIBRARY} +- vlsift ++ unofficial::vlfeat::vl + ) + if (MSVC) + set_target_properties(openMVG_main_ComputeFeatures PROPERTIES COMPILE_FLAGS "/bigobj") +@@ -235,7 +235,7 @@ if(OpenMVG_USE_OPENCV) + openMVG_multiview + openMVG_sfm + ${STLPLUS_LIBRARY} +- vlsift ++ unofficial::vlfeat::vl + ${OpenCV_LIBS}) + target_include_directories(openMVG_main_ComputeFeatures_OpenCV PRIVATE ${OpenCV_INCLUDE_DIRS}) + +diff --git a/src/software/SfM/SfM_GlobalPipeline.py.in b/src/software/SfM/SfM_GlobalPipeline.py.in +index 42405a4..28b0246 100644 +--- a/src/software/SfM/SfM_GlobalPipeline.py.in ++++ b/src/software/SfM/SfM_GlobalPipeline.py.in +@@ -21,7 +21,7 @@ + OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@" + + # Indicate the openMVG camera sensor width directory +-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database" ++CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@" + + import os + import subprocess +@@ -77,5 +77,3 @@ pRecons.wait() + + pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/robust.bin", "-o", os.path.join(reconstruction_dir,"robust_colorized.ply")] ) + pRecons.wait() +- +- +diff --git a/src/software/SfM/SfM_SequentialPipeline.py.in b/src/software/SfM/SfM_SequentialPipeline.py.in +index 9a5a482..e804a19 100644 +--- a/src/software/SfM/SfM_SequentialPipeline.py.in ++++ b/src/software/SfM/SfM_SequentialPipeline.py.in +@@ -21,7 +21,7 @@ + OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@" + + # Indicate the openMVG camera sensor width directory +-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database" ++CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@" + + import os + import subprocess +@@ -77,5 +77,3 @@ pRecons.wait() + + pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/robust.bin", "-o", os.path.join(reconstruction_dir,"robust_colorized.ply")] ) + pRecons.wait() +- +- +diff --git a/src/software/SfM/tutorial_demo.py.in b/src/software/SfM/tutorial_demo.py.in +index 259e24e..1097062 100644 +--- a/src/software/SfM/tutorial_demo.py.in ++++ b/src/software/SfM/tutorial_demo.py.in +@@ -12,7 +12,7 @@ + OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@" + + # Indicate the openMVG camera sensor width directory +-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database" ++CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@" + + import os + import subprocess +@@ -89,5 +89,3 @@ pRecons.wait() + print ("4. Structure from Known Poses (robust triangulation)") + pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeStructureFromKnownPoses"), "-i", reconstruction_dir+"/sfm_data.bin", "-m", matches_dir, "-o", os.path.join(reconstruction_dir,"robust.ply")] ) + pRecons.wait() +- +- +diff --git a/src/software/VO/Tracker_opencv_klt.hpp b/src/software/VO/Tracker_opencv_klt.hpp +index aa7dffe..2c4d237 100644 +--- a/src/software/VO/Tracker_opencv_klt.hpp ++++ b/src/software/VO/Tracker_opencv_klt.hpp +@@ -80,7 +80,7 @@ struct Tracker_opencv_KLT : public Abstract_Tracker + std::vector m_nextKeypoints; + + cv::Ptr m_detector = cv::GFTTDetector::create(count); +- if (m_detector == NULL) ++ if (m_detector == nullptr) + return false; + + m_detector->detect(current_img, m_nextKeypoints); +diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt +index 816a941..f0b7145 100644 +--- a/src/third_party/CMakeLists.txt ++++ b/src/third_party/CMakeLists.txt +@@ -18,7 +18,7 @@ add_subdirectory(stlplus3) + set(STLPLUS_LIBRARY openMVG_stlplus PARENT_SCOPE) + + # Add graph library +-if(DEFINED OpenMVG_USE_INTERNAL_LEMON) ++if(OpenMVG_USE_INTERNAL_LEMON) + add_subdirectory(lemon) + set_property(TARGET openMVG_lemon PROPERTY FOLDER OpenMVG/3rdParty/lemon) + set_property(TARGET check PROPERTY FOLDER OpenMVG/3rdParty/lemon) +@@ -68,7 +68,7 @@ endif (NOT TIFF_FOUND) + add_subdirectory(vectorGraphics) + + # Add ceres-solver (A Nonlinear Least Squares Minimizer) +-if (DEFINED OpenMVG_USE_INTERNAL_CERES) ++if (OpenMVG_USE_INTERNAL_CERES) + add_subdirectory(cxsparse) + add_subdirectory(ceres-solver) + set_property(TARGET openMVG_cxsparse PROPERTY FOLDER OpenMVG/3rdParty/ceres) +@@ -76,7 +76,7 @@ if (DEFINED OpenMVG_USE_INTERNAL_CERES) + endif() + + # Add an Approximate Nearest Neighbor library +-if (DEFINED OpenMVG_USE_INTERNAL_FLANN) ++if (OpenMVG_USE_INTERNAL_FLANN) + set(FLANN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/flann/src/cpp) + add_subdirectory(flann) + endif() +@@ -90,7 +90,7 @@ add_subdirectory(fast) + ## + # Install Header only libraries if necessary + ## +-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) ++if (OpenMVG_USE_INTERNAL_EIGEN) + #Configure Eigen install + set(EIGEN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen) + add_subdirectory(eigen) diff --git a/ports/openmvg/fix-config-cmake.patch b/ports/openmvg/fix-config-cmake.patch deleted file mode 100644 index f229502ce5c2aa..00000000000000 --- a/ports/openmvg/fix-config-cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in -index e7dfbfd..357a25c 100644 ---- a/src/cmakeFindModules/OpenMVGConfig.cmake.in -+++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in -@@ -61,7 +61,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) - - # Build the absolute root install directory as a relative path - get_filename_component(CURRENT_ROOT_INSTALL_DIR -- ${CMAKE_MODULE_PATH}/../../../ ABSOLUTE) -+ ${CMAKE_MODULE_PATH}/../../ ABSOLUTE) - if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) - OPENMVG_REPORT_NOT_FOUND( - "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " diff --git a/ports/openmvg/portfile.cmake b/ports/openmvg/portfile.cmake index c62ceaa4daca89..0b3265d6a3c6f5 100644 --- a/ports/openmvg/portfile.cmake +++ b/ports/openmvg/portfile.cmake @@ -3,22 +3,33 @@ vcpkg_buildpath_length_warning(37) #the port produces some empty dlls when building shared libraries, since some components do not export anything, breaking the internal build itself vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +if("software" IN_LIST FEATURES AND VCPKG_CRT_LINKAGE STREQUAL static) + message(FATAL_ERROR "OpenMVG software currently cannot be built with static CRT linking. Please open an issue if you require this feature.") +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openMVG/openMVG REF 606d1c9e82123dd50de282128151a50bf42262fc # v1.5 SHA512 eddcf4c5f86541112840a6d89bbf360d30b085c2b3ff3e39b357030a465163b465e89d01474f8dbd65b66f8bccfc1f54a58963324f622482e2960f00214b2b75 PATCHES - fixcmake.patch - fix-config-cmake.patch + build_fixes.patch ) +set(OpenMVG_USE_OPENMP OFF) +if("openmp" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_WINDOWS) + message(WARNING "OpenMP feature is broken on Windows, disabled until fixed https://github.com/openMVG/openMVG/issues/1765") + else() + set(OpenMVG_USE_OPENMP ON) + endif() +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - openmp OpenMVG_USE_OPENMP - openmp ENABLE_OPENMP opencv OpenMVG_USE_OPENCV opencv OpenMVG_USE_OCVSIFT - opencv ENABLE_OPENCV + software OpenMVG_BUILD_SOFTWARES + software OpenMVG_BUILD_GUI_SOFTWARES ) # remove some deps to prevent conflict @@ -44,13 +55,12 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/src PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} + -DOpenMVG_USE_OPENMP=${OpenMVG_USE_OPENMP} -DOpenMVG_BUILD_SHARED=OFF -DOpenMVG_BUILD_TESTS=OFF -DOpenMVG_BUILD_DOC=OFF -DOpenMVG_BUILD_EXAMPLES=OFF -DOpenMVG_BUILD_OPENGL_EXAMPLES=OFF - -DOpenMVG_BUILD_SOFTWARES=OFF - -DOpenMVG_BUILD_GUI_SOFTWARES=OFF -DOpenMVG_BUILD_COVERAGE=OFF -DOpenMVG_USE_INTERNAL_CLP=OFF -DOpenMVG_USE_INTERNAL_COINUTILS=OFF @@ -64,28 +74,102 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/openMVG/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -#remove extra deprecated cmake target files left in unappropriate folders -file(GLOB REMOVE_CMAKE ${CURRENT_PACKAGES_DIR}/lib/*.cmake) -file(REMOVE_RECURSE ${REMOVE_CMAKE}) -file(GLOB REMOVE_CMAKE ${CURRENT_PACKAGES_DIR}/debug/lib/*.cmake) -file(REMOVE_RECURSE ${REMOVE_CMAKE}) +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/openMVG/image/image_test - ${CURRENT_PACKAGES_DIR}/include/openMVG/exif/image_data) + ${CURRENT_PACKAGES_DIR}/include/openMVG/exif/image_data + ${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/nonFree/sift/vl) if(OpenMVG_BUILD_SHARED) - # release - file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/lib/*.dll) - file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${DLL_FILES}) - # debug - file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) - file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE_RECURSE ${DLL_FILES}) + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + # release + file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/lib/*.dll) + file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${DLL_FILES}) + endif() + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # debug + file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) + file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${DLL_FILES}) + endif() endif() vcpkg_copy_pdbs() +if("software" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_OSX) + vcpkg_copy_tools(TOOL_NAMES + openMVG_main_AlternativeVO.app + ui_openMVG_MatchesViewer.app + ) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/openMVG_main_AlternativeVO.app) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ui_openMVG_MatchesViewer.app) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/openMVG_main_AlternativeVO.app) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ui_openMVG_MatchesViewer.app) + else() + vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES + openMVG_main_AlternativeVO + ui_openMVG_MatchesViewer + ) + endif() + vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES + openMVG_main_ChangeLocalOrigin + openMVG_main_ColHarmonize + openMVG_main_ComputeClusters + openMVG_main_ComputeFeatures + openMVG_main_ComputeMatches + openMVG_main_ComputeSfM_DataColor + openMVG_main_ComputeStructureFromKnownPoses + openMVG_main_ConvertList + openMVG_main_ConvertSfM_DataFormat + openMVG_main_evalQuality + openMVG_main_ExportCameraFrustums + openMVG_main_exportKeypoints + openMVG_main_exportMatches + openMVG_main_exportTracks + openMVG_main_ExportUndistortedImages + openMVG_main_FrustumFiltering + openMVG_main_geodesy_registration_to_gps_position + openMVG_main_GlobalSfM + openMVG_main_IncrementalSfM + openMVG_main_IncrementalSfM2 + openMVG_main_ListMatchingPairs + openMVG_main_MatchesToTracks + openMVG_main_openMVG2Agisoft + openMVG_main_openMVG2CMPMVS + openMVG_main_openMVG2Colmap + openMVG_main_openMVG2MESHLAB + openMVG_main_openMVG2MVE2 + openMVG_main_openMVG2MVSTEXTURING + openMVG_main_openMVG2NVM + openMVG_main_openMVG2openMVS + openMVG_main_openMVG2PMVS + openMVG_main_openMVG2WebGL + openMVG_main_openMVGSpherical2Cubic + openMVG_main_PointsFiltering + openMVG_main_SfMInit_ImageListing + openMVG_main_SfMInit_ImageListingFromKnownPoses + openMVG_main_SfM_Localization + openMVG_main_SplitMatchFileIntoMatchFiles + ui_openMVG_control_points_registration + ) + if("opencv" IN_LIST FEATURES) + vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES + openMVG_main_ComputeFeatures_OpenCV + ) + endif() + + file(COPY ${SOURCE_PATH}/src/openMVG/exif/sensor_width_database/sensor_width_camera_database.txt DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + set(OPENMVG_SOFTWARE_SFM_BUILD_DIR ${CURRENT_INSTALLED_DIR}/tools/${PORT}) + set(OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY ${CURRENT_INSTALLED_DIR}/tools/${PORT}) + configure_file("${SOURCE_PATH}/src/software/SfM/tutorial_demo.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/tutorial_demo.py" @ONLY) + configure_file("${SOURCE_PATH}/src/software/SfM/SfM_GlobalPipeline.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/SfM_GlobalPipeline.py" @ONLY) + configure_file("${SOURCE_PATH}/src/software/SfM/SfM_SequentialPipeline.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/SfM_SequentialPipeline.py" @ONLY) + message(STATUS "To use tools, you need graphviz installed and manually added to path (to have neato executable)") +endif() + # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openmvs/CONTROL b/ports/openmvs/CONTROL index bc06aef4a50501..0b3560d316741f 100644 --- a/ports/openmvs/CONTROL +++ b/ports/openmvs/CONTROL @@ -1,5 +1,13 @@ Source: openmvs -Version: 1.1-1 +Version: 1.1 +Port-Version: 3 Description: OpenMVS: open Multi-View Stereo reconstruction library Homepage: https://cdcseacave.github.io/openMVS -Build-Depends: zlib, boost-iostreams, boost-program-options, boost-system, boost-serialization, eigen3, ceres, opencv, cgal[core], glew, glfw3, vcglib +Build-Depends: zlib, boost-iostreams, boost-program-options, boost-system, boost-serialization, eigen3, opencv, cgal[core], glew, glfw3, vcglib, openmvg[software] (!(windows&static)), libpng, tiff + +Feature: cuda +Build-Depends: cuda +Description: cuda support for openmvs + +Feature: openmp +Description: openmp support for openmvs diff --git a/ports/openmvs/fix-build.patch b/ports/openmvs/fix-build.patch new file mode 100644 index 00000000000000..6c7eac2dcaf690 --- /dev/null +++ b/ports/openmvs/fix-build.patch @@ -0,0 +1,393 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,7 +63,7 @@ INCLUDE_DIRECTORIES("${OpenMVS_SOURCE_DIR}") + SET(OpenMVS_EXTRA_LIBS "") + if(OpenMVS_USE_OPENMP) + SET(OpenMP_LIBS "") +- FIND_PACKAGE(OpenMP) ++ FIND_PACKAGE(OpenMP REQUIRED) + if(OPENMP_FOUND) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + ADD_DEFINITIONS(-D_USE_OPENMP) +@@ -83,7 +83,7 @@ if(OpenMVS_USE_OPENGL) + if(POLICY CMP0072) + cmake_policy(SET CMP0072 NEW) + endif() +- FIND_PACKAGE(OpenGL) ++ FIND_PACKAGE(OpenGL REQUIRED) + if(OPENGL_FOUND) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + ADD_DEFINITIONS(${OpenGL_DEFINITIONS} -D_USE_OPENGL) +@@ -94,7 +94,7 @@ if(OpenMVS_USE_OPENGL) + endif() + + if(OpenMVS_USE_CUDA) +- FIND_PACKAGE(CUDA) ++ FIND_PACKAGE(CUDA REQUIRED) + if(CUDA_FOUND) + INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) + ADD_DEFINITIONS(-D_USE_CUDA) +@@ -108,7 +108,7 @@ else() + endif() + + if(OpenMVS_USE_BREAKPAD) +- FIND_PACKAGE(BREAKPAD) ++ FIND_PACKAGE(BREAKPAD REQUIRED) + if(BREAKPAD_FOUND) + INCLUDE_DIRECTORIES(${BREAKPAD_INCLUDE_DIRS}) + ADD_DEFINITIONS(${BREAKPAD_DEFINITIONS} -D_USE_BREAKPAD) +@@ -119,7 +119,7 @@ if(OpenMVS_USE_BREAKPAD) + endif() + endif() + +-FIND_PACKAGE(Boost ${SYSTEM_PACKAGE_REQUIRED} COMPONENTS iostreams program_options system serialization) ++FIND_PACKAGE(Boost COMPONENTS iostreams program_options system serialization REQUIRED) + if(Boost_FOUND) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + ADD_DEFINITIONS(${Boost_DEFINITIONS} -D_USE_BOOST) +@@ -127,14 +127,14 @@ if(Boost_FOUND) + SET(_USE_BOOST TRUE) + endif() + +-FIND_PACKAGE(Eigen ${SYSTEM_PACKAGE_REQUIRED}) +-if(EIGEN_FOUND) +- INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIRS}) +- ADD_DEFINITIONS(${EIGEN_DEFINITIONS} -D_USE_EIGEN) ++FIND_PACKAGE(Eigen3 REQUIRED) ++if(EIGEN3_FOUND) ++ INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIRS}) ++ ADD_DEFINITIONS(${EIGEN3_DEFINITIONS} -D_USE_EIGEN) + SET(_USE_EIGEN TRUE) + endif() + +-FIND_PACKAGE(OpenCV ${SYSTEM_PACKAGE_REQUIRED}) ++FIND_PACKAGE(OpenCV REQUIRED) + if(OpenCV_FOUND) + INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) + ADD_DEFINITIONS(${OpenCV_DEFINITIONS}) +@@ -170,7 +170,9 @@ ADD_DEFINITIONS(${OpenMVS_DEFINITIONS}) + + # Add modules + ADD_SUBDIRECTORY(libs) ++if(OpenMVS_BUILD_TOOLS) + ADD_SUBDIRECTORY(apps) ++endif() + ADD_SUBDIRECTORY(docs) + + if(OpenMVS_USE_CERES) +@@ -188,7 +190,7 @@ export(TARGETS Common IO Math MVS FILE "${PROJECT_BINARY_DIR}/OpenMVSTargets.cma + # Export the package for use from the build-tree + # (this registers the build-tree with a global CMake-registry) + export(PACKAGE OpenMVS) +- ++ + # Create the OpenMVSConfig.cmake and OpenMVSConfigVersion files + file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}") + # ... for the build tree +@@ -199,7 +201,7 @@ set(CONF_INCLUDE_DIRS "${INSTALL_CMAKE_DIR}/${REL_INCLUDE_DIR}") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/OpenMVSConfig.cmake.in" "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMVSConfig.cmake" @ONLY) + # ... for both + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/OpenMVSConfigVersion.cmake.in" "${PROJECT_BINARY_DIR}/OpenMVSConfigVersion.cmake" @ONLY) +- ++ + # Install the OpenMVSConfig.cmake and OpenMVSConfigVersion.cmake + install(FILES + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMVSConfig.cmake" +diff --git a/MvgMvsPipeline.py b/MvgMvsPipeline.py.in +similarity index 97% +rename from MvgMvsPipeline.py +rename to MvgMvsPipeline.py.in +index f4914bf..23d03e6 100644 +--- a/MvgMvsPipeline.py ++++ b/MvgMvsPipeline.py.in +@@ -91,12 +91,12 @@ def find(afile): + return None + + # Try to find openMVG and openMVS binaries in PATH +-OPENMVG_BIN = whereis("openMVG_main_SfMInit_ImageListing") +-OPENMVS_BIN = whereis("ReconstructMesh") ++OPENMVG_BIN = "@OPENMVG_TOOLS_PATH@" ++OPENMVS_BIN = "@OPENMVS_TOOLS_PATH@" + + # Try to find openMVG camera sensor database +-CAMERA_SENSOR_DB_FILE = "sensor_width_camera_database.txt" +-CAMERA_SENSOR_DB_DIRECTORY = find(CAMERA_SENSOR_DB_FILE) ++CAMERA_SENSOR_DB_FILE = "@SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH@" ++CAMERA_SENSOR_DB_DIRECTORY = "@OPENMVG_TOOLS_PATH@" + + # Ask user for openMVG and openMVS directories if not found + if not OPENMVG_BIN: +@@ -175,10 +175,10 @@ class StepsStore: + ["-i", "%input_dir%", "-o", "%matches_dir%", "-d", "%camera_file_params%"]], + ["Compute features", # 1 + os.path.join(OPENMVG_BIN, "openMVG_main_ComputeFeatures"), +- ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT", "-n", "4"]], ++ ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-m", "SIFT"]], + ["Compute matches", # 2 + os.path.join(OPENMVG_BIN, "openMVG_main_ComputeMatches"), +- ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-n", "HNSWL2", "-r", ".8"]], ++ ["-i", "%matches_dir%/sfm_data.json", "-o", "%matches_dir%", "-n", "AUTO", "-r", ".8"]], + ["Incremental reconstruction", # 3 + os.path.join(OPENMVG_BIN, "openMVG_main_IncrementalSfM"), + ["-i", "%matches_dir%/sfm_data.json", "-m", "%matches_dir%", "-o", "%reconstruction_dir%"]], +--- a/apps/Viewer/CMakeLists.txt ++++ b/apps/Viewer/CMakeLists.txt +@@ -16,18 +16,6 @@ else() + MESSAGE("-- Can't find GLEW. Continuing without it.") + RETURN() + endif() +-if(CMAKE_COMPILER_IS_GNUCXX) +- FIND_PACKAGE(PkgConfig QUIET) +- pkg_search_module(GLFW QUIET glfw3) +- if(GLFW_FOUND) +- INCLUDE_DIRECTORIES(${GLFW_INCLUDE_DIRS}) +- ADD_DEFINITIONS(${GLFW_DEFINITIONS}) +- MESSAGE(STATUS "GLFW3 ${GLFW_VERSION} found (include: ${GLFW_INCLUDE_DIRS})") +- else() +- MESSAGE("-- Can't find GLFW3. Continuing without it.") +- RETURN() +- endif() +-else() + FIND_PACKAGE(glfw3 QUIET) + if(glfw3_FOUND) + INCLUDE_DIRECTORIES(${glfw3_INCLUDE_DIRS}) +@@ -37,7 +25,6 @@ else() + MESSAGE("-- Can't find GLFW3. Continuing without it.") + RETURN() + endif() +-endif() + + # List sources files + FILE(GLOB PCH_C "Common.cpp") +--- a/build/OpenMVSConfig.cmake.in ++++ b/build/OpenMVSConfig.cmake.in +@@ -3,16 +3,71 @@ + # OpenMVS_INCLUDE_DIRS - include directories for OpenMVS + # OpenMVS_LIBRARIES - libraries to link against + # OpenMVS_BINARIES - the binaries +- ++ + # Compute paths + get_filename_component(OpenMVS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + set(OpenMVS_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") +- ++list(APPEND CMAKE_MODULE_PATH "${OpenMVS_CMAKE_DIR}") ++ ++if (MSVC) ++ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL") ++ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") ++ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") ++ set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") ++endif() ++ ++set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ ++include(CMakeFindDependencyMacro) ++ ++if(@OpenMVS_USE_OPENMP@) ++ find_dependency(OpenMP) ++ add_definitions(-D_USE_OPENMP) ++endif() ++ ++if(@OpenMVS_USE_OPENGL@) ++ find_dependency(OpenGL) ++ add_definitions(${OpenGL_DEFINITIONS} -D_USE_OPENGL) ++endif() ++ ++if(@OpenMVS_USE_CUDA@) ++ find_dependency(CUDA) ++ add_definitions(-D_USE_CUDA) ++ include_directories(${CUDA_INCLUDE_DIRS}) ++endif() ++ ++if(@OpenMVS_USE_BREAKPAD@) ++ find_dependency(BREAKPAD) ++ add_definitions(${BREAKPAD_DEFINITIONS} -D_USE_BREAKPAD) ++endif() ++ ++find_dependency(Boost) ++add_definitions(${Boost_DEFINITIONS} -D_USE_BOOST) ++include_directories(${Boost_INCLUDE_DIRS}) ++find_dependency(Eigen3) ++add_definitions(${EIGEN3_DEFINITIONS} -D_USE_EIGEN) ++include_directories(${EIGEN3_INCLUDE_DIRS}) ++find_dependency(OpenCV) ++add_definitions(${OpenCV_DEFINITIONS}) ++find_dependency(CGAL) ++add_definitions(${CGAL_DEFINITIONS}) ++ ++find_dependency(VCG REQUIRED) ++add_definitions(${VCG_DEFINITIONS}) ++ ++if(@OpenMVS_USE_CERES@) ++ find_dependency(Ceres) ++ add_definitions(${CERES_DEFINITIONS}) ++endif() ++ ++add_definitions(@OpenMVS_DEFINITIONS@) ++ + # Our library dependencies (contains definitions for IMPORTED targets) + if(NOT TARGET MVS AND NOT OpenMVS_BINARY_DIR) + include("${OpenMVS_CMAKE_DIR}/OpenMVSTargets.cmake") + endif() +- ++ + # These are IMPORTED targets created by OpenMVSTargets.cmake + set(OpenMVS_LIBRARIES MVS) + set(OpenMVS_BINARIES InterfaceVisualSFM DensifyPointCloud ReconstructMesh RefineMesh TextureMesh) +--- a/build/Utils.cmake ++++ b/build/Utils.cmake +@@ -160,7 +160,7 @@ macro(GetOperatingSystemArchitectureBitness) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES i686.*|i386.*|x86.*) + set(X86 1) + endif() +- ++ + if(NOT ${MY_VAR_PREFIX}_PACKAGE_REQUIRED) + set(${MY_VAR_PREFIX}_PACKAGE_REQUIRED "REQUIRED") + endif() +@@ -173,30 +173,6 @@ macro(ComposePackageLibSuffix) + set(PACKAGE_LIB_SUFFIX "") + set(PACKAGE_LIB_SUFFIX_DBG "") + set(PACKAGE_LIB_SUFFIX_REL "") +- if(MSVC) +- if("${MSVC_VERSION}" STREQUAL "1921") +- set(PACKAGE_LIB_SUFFIX "/vc16") +- elseif("${MSVC_VERSION}" STREQUAL "1916") +- set(PACKAGE_LIB_SUFFIX "/vc15") +- elseif("${MSVC_VERSION}" STREQUAL "1900") +- set(PACKAGE_LIB_SUFFIX "/vc14") +- elseif("${MSVC_VERSION}" STREQUAL "1800") +- set(PACKAGE_LIB_SUFFIX "/vc12") +- elseif("${MSVC_VERSION}" STREQUAL "1700") +- set(PACKAGE_LIB_SUFFIX "/vc11") +- elseif("${MSVC_VERSION}" STREQUAL "1600") +- set(PACKAGE_LIB_SUFFIX "/vc10") +- elseif("${MSVC_VERSION}" STREQUAL "1500") +- set(PACKAGE_LIB_SUFFIX "/vc9") +- endif() +- if("${SYSTEM_BITNESS}" STREQUAL "64") +- set(PACKAGE_LIB_SUFFIX "${PACKAGE_LIB_SUFFIX}/x64") +- else() +- set(PACKAGE_LIB_SUFFIX "${PACKAGE_LIB_SUFFIX}/x86") +- endif() +- set(PACKAGE_LIB_SUFFIX_DBG "${PACKAGE_LIB_SUFFIX}/Debug") +- set(PACKAGE_LIB_SUFFIX_REL "${PACKAGE_LIB_SUFFIX}/Release") +- endif() + endmacro() + + +@@ -511,7 +487,7 @@ macro(optimize_default_compiler_settings) + endif() + add_extra_compiler_option(-fdiagnostics-show-option) + add_extra_compiler_option(-ftemplate-backtrace-limit=0) +- ++ + # The -Wno-long-long is required in 64bit systems when including sytem headers. + if(X86_64) + add_extra_compiler_option(-Wno-long-long) +@@ -817,7 +793,7 @@ macro(ConfigCompilerAndLinker) + else() + set(cxx_rtti_support "${cxx_no_rtti_flags}") + endif() +- ++ + SET(cxx_default "${cxx_exception_support} ${cxx_rtti_support}" CACHE PATH "Common compile CXX flags") + SET(c_default "${CMAKE_C_FLAGS} ${cxx_base_flags}" CACHE PATH "Common compile C flags") + endmacro() +@@ -825,16 +801,12 @@ endmacro() + # Initialize variables needed for a library type project. + macro(ConfigLibrary) + # Offer the user the choice of overriding the installation directories +- set(INSTALL_LIB_DIR "lib/${PROJECT_NAME}" CACHE PATH "Installation directory for libraries") +- set(INSTALL_BIN_DIR "bin/${PROJECT_NAME}" CACHE PATH "Installation directory for executables") +- set(INSTALL_INCLUDE_DIR "include/${PROJECT_NAME}" CACHE PATH "Installation directory for header files") +- if(WIN32 AND NOT CYGWIN) +- set(DEF_INSTALL_CMAKE_DIR "CMake") +- else() +- set(DEF_INSTALL_CMAKE_DIR "lib/CMake/${PROJECT_NAME}") +- endif() ++ set(INSTALL_LIB_DIR "lib" CACHE PATH "Installation directory for libraries") ++ set(INSTALL_BIN_DIR "bin" CACHE PATH "Installation directory for executables") ++ set(INSTALL_INCLUDE_DIR "include/openmvs" CACHE PATH "Installation directory for header files") ++ set(DEF_INSTALL_CMAKE_DIR "share/openmvs") + set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") +- ++ + # Make relative paths absolute (needed later on) + foreach(p LIB BIN INCLUDE CMAKE) + set(var INSTALL_${p}_DIR) +--- a/libs/Common/CMakeLists.txt ++++ b/libs/Common/CMakeLists.txt +@@ -18,6 +18,7 @@ set_target_pch(Common Common.h) + + # Link its dependencies + TARGET_LINK_LIBRARIES(Common ${Boost_LIBRARIES} ${OpenCV_LIBS}) ++TARGET_INCLUDE_DIRECTORIES(Common PUBLIC $ $) + + # Install + SET_TARGET_PROPERTIES(Common PROPERTIES +--- a/libs/IO/CMakeLists.txt ++++ b/libs/IO/CMakeLists.txt +@@ -43,7 +43,8 @@ cxx_library_with_type_no_pch(IO "Libs" "STATIC" "${cxx_default}" + set_target_pch(IO Common.h) + + # Link its dependencies +-TARGET_LINK_LIBRARIES(IO Common ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${EXIV2_LIBS}) ++TARGET_LINK_LIBRARIES(IO Common ${TIFF_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${EXIV2_LIBS}) ++TARGET_INCLUDE_DIRECTORIES(IO PUBLIC $ $) + + # Install + SET_TARGET_PROPERTIES(IO PROPERTIES +--- a/libs/MVS/CMakeLists.txt ++++ b/libs/MVS/CMakeLists.txt +@@ -1,12 +1,12 @@ + # Find required packages +-FIND_PACKAGE(CGAL ${SYSTEM_PACKAGE_REQUIRED}) ++FIND_PACKAGE(CGAL REQUIRED) + if(CGAL_FOUND) + include_directories(${CGAL_INCLUDE_DIRS}) + add_definitions(${CGAL_DEFINITIONS}) + link_directories(${CGAL_LIBRARY_DIRS}) + endif() + +-FIND_PACKAGE(VCG ${SYSTEM_PACKAGE_REQUIRED}) ++FIND_PACKAGE(VCG REQUIRED) + if(VCG_FOUND) + include_directories(${VCG_INCLUDE_DIRS}) + add_definitions(${VCG_DEFINITIONS}) +@@ -14,12 +14,10 @@ endif() + + set(CERES_LIBS "") + if(OpenMVS_USE_CERES) +- FIND_PACKAGE(CERES) ++ FIND_PACKAGE(Ceres REQUIRED) + if(CERES_FOUND) + include_directories(${CERES_INCLUDE_DIRS}) + add_definitions(${CERES_DEFINITIONS}) +- else() +- set(OpenMVS_USE_CERES OFF) + endif() + endif() + +@@ -42,7 +40,8 @@ cxx_library_with_type_no_pch(MVS "Libs" "" "${cxx_default}" + set_target_pch(MVS Common.h) + + # Link its dependencies +-TARGET_LINK_LIBRARIES(MVS PRIVATE Common Math IO ${CERES_LIBS} ${CGAL_LIBS} ${CUDA_CUDA_LIBRARY}) ++TARGET_LINK_LIBRARIES(MVS PRIVATE Common Math IO ${CERES_LIBS} CGAL::CGAL ${CUDA_CUDA_LIBRARY}) ++TARGET_INCLUDE_DIRECTORIES(MVS PUBLIC $ $) + + # Install + SET_TARGET_PROPERTIES(MVS PROPERTIES +--- a/libs/Math/CMakeLists.txt ++++ b/libs/Math/CMakeLists.txt +@@ -35,6 +35,7 @@ set_target_pch(Math Common.h) + + # Link its dependencies + TARGET_LINK_LIBRARIES(Math Common) ++TARGET_INCLUDE_DIRECTORIES(Math PUBLIC $ $) + + # Install + INSTALL(FILES ${LIBRARY_FILES_H} DESTINATION "${INSTALL_INCLUDE_DIR}/Math" COMPONENT dev) diff --git a/ports/openmvs/portfile.cmake b/ports/openmvs/portfile.cmake index e0a771751161b0..2ec1bd0944171d 100644 --- a/ports/openmvs/portfile.cmake +++ b/ports/openmvs/portfile.cmake @@ -6,17 +6,35 @@ vcpkg_from_github( REF v1.1 SHA512 baa9149853dc08c602deeb1a04cf57643d1cb0733aee2776f4e99b210279aad3b4a1013ab1d790e91a3a95b7c72b9c12c6be25f2c30a76b69b5319b610cb8e7a HEAD_REF master + PATCHES + fix-build.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + cuda OpenMVS_USE_CUDA + openmp OpenMVS_USE_OPENMP +) + +file(REMOVE "${SOURCE_PATH}/build/Modules/FindCERES.cmake") +file(REMOVE "${SOURCE_PATH}/build/Modules/FindCGAL.cmake") +file(REMOVE "${SOURCE_PATH}/build/Modules/FindEIGEN.cmake") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} + -DOpenMVS_USE_NONFREE=ON + -DOpenMVS_USE_CERES=OFF + -DOpenMVS_USE_FAST_FLOAT2INT=ON + -DOpenMVS_USE_FAST_INVSQRT=OFF + -DOpenMVS_USE_FAST_CBRT=ON + -DOpenMVS_USE_SSE=ON + -DOpenMVS_USE_OPENGL=ON -DOpenMVS_USE_BREAKPAD=OFF - -DOpenMVS_USE_CUDA=OFF - -DINSTALL_CMAKE_DIR:STRING=share/openmvs - -DINSTALL_BIN_DIR:STRING=bin - -DINSTALL_LIB_DIR:STRING=lib + OPTIONS_RELEASE + -DOpenMVS_BUILD_TOOLS=ON + OPTIONS_DEBUG + -DOpenMVS_BUILD_TOOLS=OFF ) vcpkg_install_cmake() @@ -24,10 +42,30 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_fixup_cmake_targets() +file(READ ${CURRENT_PACKAGES_DIR}/share/openmvs/OpenMVSTargets-release.cmake TARGETS_CMAKE) +string(REPLACE "bin/InterfaceCOLMAP" "tools/openmvs/InterfaceCOLMAP" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/InterfaceVisualSFM" "tools/openmvs/InterfaceVisualSFM" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/DensifyPointCloud" "tools/openmvs/DensifyPointCloud" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/ReconstructMesh" "tools/openmvs/ReconstructMesh" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/RefineMesh" "tools/openmvs/RefineMesh" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/TextureMesh" "tools/openmvs/TextureMesh" TARGETS_CMAKE "${TARGETS_CMAKE}") +string(REPLACE "bin/Viewer" "tools/openmvs/Viewer" TARGETS_CMAKE "${TARGETS_CMAKE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/openmvs/OpenMVSTargets-release.cmake "${TARGETS_CMAKE}") + +vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES + DensifyPointCloud + InterfaceCOLMAP + InterfaceVisualSFM + ReconstructMesh + RefineMesh + TextureMesh + Viewer +) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/openmvs) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openmvs) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +set(OPENMVG_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/openmvg") +set(OPENMVS_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/${PORT}") +set(SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH "${OPENMVG_TOOLS_PATH}/sensor_width_camera_database.txt") +configure_file("${SOURCE_PATH}/MvgMvsPipeline.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/MvgMvsPipeline.py" @ONLY) +file(INSTALL "${SOURCE_PATH}/build/Modules/FindVCG.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt index 7857058f0a0dd2..7e09222c92e2e0 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -11,10 +11,29 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux") else() set(PLATFORM linux-generic32) endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") + set(PLATFORM ios64-xcrun) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + set(PLATFORM ios-xcrun) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" OR + VCPKG_TARGET_ARCHITECTURE MATCHES "x64") + set(PLATFORM 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 DISABLES no-stdio no-ui no-asm) elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(PLATFORM darwin64-x86_64-cc) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(PLATFORM BSD-generic64) +elseif(MINGW) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(PLATFORM mingw64) + else() + set(PLATFORM mingw) + endif() else() message(FATAL_ERROR "Unknown platform") endif() @@ -34,10 +53,10 @@ set(CFLAGS "${CMAKE_C_FLAGS}") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CFLAGS "-Wno-error=unused-command-line-argument ${CMAKE_C_FLAGS}") endif() -if(CMAKE_C_COMPILER_TARGET) +if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET) set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}") endif() -if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN) +if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN AND CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN) set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}") endif() if(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT) @@ -73,13 +92,18 @@ if(BUILD_SHARED_LIBS) REGEX "^#[\t ]*define[\t ]+SHLIB_VERSION_NUMBER[\t ]+\".*\".*") string(REGEX REPLACE "^.*SHLIB_VERSION_NUMBER[\t ]+\"([^\"]*)\".*$" "\\1" SHLIB_VERSION "${SHLIB_VERSION}") - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") set(LIB_EXT dylib) set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT}) + elseif(MINGW) + string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}") + set(BIN_EXT dll) + set(LIB_EXT dll.a) else() set(LIB_EXT so) set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION}) endif() + list(APPEND BIN_EXTS ${BIN_EXT}) list(APPEND LIB_EXTS ${LIB_EXT}) else() set(SHARED no-shared) @@ -89,6 +113,14 @@ foreach(lib ssl crypto) foreach(ext ${LIB_EXTS}) list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}") endforeach() + foreach(ext ${BIN_EXTS}) + # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}") + else() + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}") + endif() + endforeach() endforeach() if(CMAKE_HOST_WIN32) @@ -99,6 +131,8 @@ else() set(PATH_VAR ":$ENV{PATH}") endif() + + add_custom_command( OUTPUT "${BUILDDIR}/Makefile" COMMAND ${ENV_COMMAND} CC=${CMAKE_C_COMPILER} @@ -119,6 +153,7 @@ add_custom_command( no-seed no-md2 no-tests + ${DISABLES} ${PLATFORM} "--prefix=${CMAKE_INSTALL_PREFIX}" "--openssldir=/etc/ssl" @@ -142,3 +177,7 @@ install( FILES ${INSTALL_LIBS} DESTINATION lib ) +install( + FILES ${INSTALL_BINS} + DESTINATION bin +) \ No newline at end of file diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index a28775cc22e7a5..9c28728ff7b24e 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,4 +1,5 @@ Source: openssl-unix Version: 1.1.1g +Port-Version: 4 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. Supports: !(windows|uwp) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index 633cef70d2a2d0..b3bdf72cdd3e92 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -1,9 +1,9 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") +if (NOT VCPKG_TARGET_IS_MINGW) + vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") +endif() if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + 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() diff --git a/ports/openssl-uwp/CONTROL b/ports/openssl-uwp/CONTROL index ccb3fb1e9dcd42..d82bb645523464 100644 --- a/ports/openssl-uwp/CONTROL +++ b/ports/openssl-uwp/CONTROL @@ -1,4 +1,5 @@ Source: openssl-uwp Version: 1.1.1g +Port-Version: 1 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. Supports: uwp diff --git a/ports/openssl-uwp/portfile.cmake b/ports/openssl-uwp/portfile.cmake index d8e2301de9f0b5..e601742aa9f6a9 100644 --- a/ports/openssl-uwp/portfile.cmake +++ b/ports/openssl-uwp/portfile.cmake @@ -1,9 +1,7 @@ vcpkg_fail_port_install(MESSAGE "${PORT} is only for Windows Universal Platform" ON_TARGET "Linux" "OSX") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + 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() vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL index e9ea27a427846b..e70ab221cb2bc9 100644 --- a/ports/openssl-windows/CONTROL +++ b/ports/openssl-windows/CONTROL @@ -1,4 +1,5 @@ Source: openssl-windows Version: 1.1.1g +Port-Version: 1 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. Supports: windows diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index a802c84c509a8c..44de5156997d31 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -1,9 +1,7 @@ vcpkg_fail_port_install(MESSAGE "${PORT} is only for Windows Desktop" ON_TARGET "UWP" "Linux" "OSX") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + 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() vcpkg_find_acquire_program(PERL) @@ -20,8 +18,8 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} ) vcpkg_find_acquire_program(NASM) @@ -32,10 +30,10 @@ vcpkg_find_acquire_program(JOM) set(OPENSSL_SHARED no-shared) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPENSSL_SHARED shared) + set(OPENSSL_SHARED shared) endif() -set(CONFIGURE_COMMAND ${PERL} Configure +set(CONFIGURE_OPTIONS enable-static-engine enable-capieng no-ssl2 @@ -44,6 +42,12 @@ set(CONFIGURE_COMMAND ${PERL} Configure ${OPENSSL_SHARED} ) +if(DEFINED OPENSSL_USE_NOPINSHARED) + set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) +endif() + +set(CONFIGURE_COMMAND ${PERL} Configure ${CONFIGURE_OPTIONS}) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(OPENSSL_ARCH VC-WIN32) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") @@ -170,13 +174,15 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) endif() -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) -string(REPLACE "" "" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" + "" + "" +) -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) -string(REPLACE "# include " "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" + "# include " + "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " +) vcpkg_copy_pdbs() diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index 4591141bf8f5ac..d643a3c2949957 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,5 +1,6 @@ Source: openssl Version: 1.1.1g +Port-Version: 1 Homepage: https://www.openssl.org 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. Build-Depends: openssl-windows (!uwp&windows), openssl-uwp (uwp), openssl-unix (!uwp&!windows) diff --git a/ports/openxr-loader/001-fix-array-decl.patch b/ports/openxr-loader/001-fix-array-decl.patch new file mode 100644 index 00000000000000..9bd25eb319cf92 --- /dev/null +++ b/ports/openxr-loader/001-fix-array-decl.patch @@ -0,0 +1,26 @@ +--- openxr.hpp 2020-08-16 14:42:30.845279600 -0700 ++++ openxr.hpp 2020-08-16 14:45:19.707229200 -0700 +@@ -18249,9 +18249,9 @@ + public: + // ctor + SpatialGraphNodeSpaceCreateInfoMSFT ( +- const SpatialGraphNodeTypeMSFT& nodeType_ = {}, +- uint8_t nodeId[16]_ = 0, +- const Posef& pose_ = {} ++ const SpatialGraphNodeTypeMSFT& nodeType_, ++ uint8_t nodeId_[16], ++ const Posef& pose_ + ) + : + +@@ -18259,9 +18259,9 @@ + ) , + + nodeType {nodeType_} , +- nodeId {nodeId_} , + pose {pose_} + { ++ memcpy(nodeId, nodeId_, 16); + } + operator const XrSpatialGraphNodeSpaceCreateInfoMSFT&() const { return *reinterpret_cast(this); } + operator XrSpatialGraphNodeSpaceCreateInfoMSFT &() { diff --git a/ports/openxr-loader/CONTROL b/ports/openxr-loader/CONTROL index 632fadab740b55..451ffe0da5a649 100644 --- a/ports/openxr-loader/CONTROL +++ b/ports/openxr-loader/CONTROL @@ -1,5 +1,5 @@ Source: openxr-loader -Version: 1.0.3.0 +Version: 1.0.11 Description: Khronos API for abstracting VR/MR/AR hardware Supports: !(arm|uwp) diff --git a/ports/openxr-loader/portfile.cmake b/ports/openxr-loader/portfile.cmake index 19e2cda6ce419f..25c2dcbb81c7d9 100644 --- a/ports/openxr-loader/portfile.cmake +++ b/ports/openxr-loader/portfile.cmake @@ -1,25 +1,32 @@ -if (VCPKG_TARGET_ARCHITECTURE MATCHES "^arm*") - message(FATAL_ERROR "OpenXR does not support arm") -endif() +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - # Due to UWP restricting the usage of static CRT OpenXR cannot be built. - message(FATAL_ERROR "OpenXR does not support UWP") -endif() +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/OpenXR-SDK + REF e3a4e41d61544d8e2eba73f00da99b6818ec472b + SHA512 26c6b547aa30d89895efcc835dddc3b58ab57f0e450a4ae82655a990a816dd57c70e43267a10da75b1c2bd160189942e443c8e27367d6648417d1c9c134e7694 + HEAD_REF master +) -include(vcpkg_common_functions) +vcpkg_from_github( + OUT_SOURCE_PATH SDK_SOURCE_PATH + REPO KhronosGroup/OpenXR-SDK-Source + REF 6dee6e228f47857adf5d7673eb90c64f04d33c60 + SHA512 0c522eef95b4d8bdc8e4f1ca852cd9798ff2bca9ef8511446d9cdf80bc314b0da454ab5c203658bbe43d3e7ff3d757b9427c3f75829b2a022a25041d1a2d2b12 + HEAD_REF master +) vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO jherico/OpenXR-SDK - REF e3dcdb820fae01fb8d25dfd32e15d14caa14b411 - SHA512 421eb3651e388b69d70d3200a1c40d363c0ac9eb1d35c89a53430ea764dd3dd0e864b756dfff0e0f98ac574309331782c95a1cadcfe84eb5a6c34434737d7a38 + OUT_SOURCE_PATH HPP_SOURCE_PATH + REPO KhronosGroup/OpenXR-hpp + REF 097a7535563fc84bb7648ea9c5a4531a1e909458 + SHA512 fe953405724e9c4a8218cd269a23317ebc8164330a519eb82de75e832bc05e2c51d24bca24e4ce13724bf275c33b26f6646e25f29eeffe6840ffc552f3351ad0 HEAD_REF master ) # Weird behavior inside the OpenXR loader. On Windows they force shared libraries to use static crt, and # vice-versa. Might be better in future iterations to patch the CMakeLists.txt for OpenXR -if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if (VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(DYNAMIC_LOADER OFF) set(VCPKG_CRT_LINKAGE dynamic) @@ -44,11 +51,29 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +set(ENV{OPENXR_REPO} ${SDK_SOURCE_PATH}) + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${HPP_SOURCE_PATH}/scripts/hpp_genxr.py -registry ${SDK_SOURCE_PATH}/specification/registry/xr.xml -o ${CURRENT_PACKAGES_DIR}/include/openxr openxr.hpp + WORKING_DIRECTORY ${HPP_SOURCE_PATH} + LOGFILE openxrhpp +) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include/openxr + PATCHES + 001-fix-array-decl.patch +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/OpenXR) +else(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/openxr TARGET_PATH share/OpenXR) +endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -# No CMake files are contained in /share only docs -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openxr-loader RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/opus/CONTROL b/ports/opus/CONTROL index cf2fdfa0152b89..1576fd3c997053 100644 --- a/ports/opus/CONTROL +++ b/ports/opus/CONTROL @@ -1,5 +1,6 @@ Source: opus -Version: 1.3.1-3 +Version: 1.3.1 +Port-Version: 4 Homepage: https://github.com/xiph/opus Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/opus/portfile.cmake b/ports/opus/portfile.cmake index 24be07b6f0a22d..4102542c1c6203 100644 --- a/ports/opus/portfile.cmake +++ b/ports/opus/portfile.cmake @@ -14,13 +14,23 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS avx AVX_SUPPORTED ) +if(VCPKG_TARGET_IS_MINGW) + set(STACK_PROTECTOR OFF) + string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0") + string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0") +else() + set(STACK_PROTECTOR ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} + -DOPUS_STACK_PROTECTOR=${STACK_PROTECTOR} PREFER_NINJA) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Opus) vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() file(INSTALL ${SOURCE_PATH}/COPYING diff --git a/ports/orocos-kdl/CONTROL b/ports/orocos-kdl/CONTROL index edef89076a3e9c..1270962d769369 100644 --- a/ports/orocos-kdl/CONTROL +++ b/ports/orocos-kdl/CONTROL @@ -1,5 +1,6 @@ Source: orocos-kdl -Version: 1.4-2 +Version: 1.4 +Port-Version: 3 Homepage: https://github.com/orocos/orocos_kinematics_dynamics Description: Kinematics and Dynamics Library Build-Depends: eigen3 diff --git a/ports/orocos-kdl/portfile.cmake b/ports/orocos-kdl/portfile.cmake index f0549d14522524..8044d3ee9d4af7 100644 --- a/ports/orocos-kdl/portfile.cmake +++ b/ports/orocos-kdl/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO orocos/orocos_kinematics_dynamics @@ -20,6 +18,11 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/orocos_kdl/cmake TARGET_PATH share/orocos_kdl) +file(READ ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake _contents) +string(REPLACE "\${CMAKE_CURRENT_LIST_DIR}/../../.." "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") +string(REPLACE "\${_IMPORT_PREFIX}" "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake "${_contents}") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index 598ec59b1cd107..6a7d856da9c853 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -1,5 +1,5 @@ Source: osg -Version: 3.6.4-3 +Version: 3.6.5 Homepage: https://github.com/openscenegraph/OpenSceneGraph Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. Build-Depends: zlib, fontconfig, boost-asio (!windows), boost-core (!windows), boost-logic (!windows), boost-lexical-cast (!windows), boost-smart-ptr (!windows), boost-tuple (!windows), boost-bind (!windows), freeglut (windows), expat (windows), openimageio (osx) @@ -24,4 +24,4 @@ Feature: packages Description: Set to ON to generate CPack configuration files and packaging targets Feature: docs -Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads \ No newline at end of file +Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index d8c8a846532ac3..332359122441ba 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -1,10 +1,10 @@ -set(OSG_VER 3.6.4) +set(OSG_VER 3.6.5) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openscenegraph/OpenSceneGraph REF OpenSceneGraph-${OSG_VER} - SHA512 7cb34fc279ba62a7d7177d3f065f845c28255688bd29026ffb305346e1bb2e515a22144df233e8a7246ed392044ee3e8b74e51bf655282d33ab27dcaf12f4b19 + SHA512 7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b HEAD_REF master PATCHES collada.patch diff --git a/ports/osg/remove-prefix.patch b/ports/osg/remove-prefix.patch index 62b1466c961328..ced94522cdb579 100644 --- a/ports/osg/remove-prefix.patch +++ b/ports/osg/remove-prefix.patch @@ -11,15 +11,6 @@ index bb3be63..356edcd 100644 HANDLE_MSVC_DLL() ENDIF() -@@ -33,7 +33,7 @@ INSTALL( - ) - - IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) -- GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) -+ set(PREFIX "") - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) - ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) diff --git a/src/OpenThreads/win32/CMakeLists.txt b/src/OpenThreads/win32/CMakeLists.txt index 84550bd..0e816f7 100644 --- a/src/OpenThreads/win32/CMakeLists.txt diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 74f1c5875af302..3585c467e3f041 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,4 +1,5 @@ Source: osgearth -Version: 2.10.2-1 +Version: 3.0 +Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. Build-Depends: osg[plugins] diff --git a/ports/osgearth/RocksDB.patch b/ports/osgearth/RocksDB.patch index 07fd7e6031a11e..c73cdad19b869d 100644 --- a/ports/osgearth/RocksDB.patch +++ b/ports/osgearth/RocksDB.patch @@ -1,84 +1,79 @@ -diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake -index 109b383..8382ed9 100644 ---- a/CMakeModules/FindRocksDB.cmake -+++ b/CMakeModules/FindRocksDB.cmake -@@ -40,5 +40,49 @@ find_package_handle_standard_args(ROCKSDB - "Could NOT find ROCKSDB" - ) - -+if(ROCKSDB_FOUND) -+ FIND_PACKAGE(ZLIB REQUIRED) -+ -+ include(SelectLibraryConfigurations) -+ # Find Snappy library -+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) -+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) -+ select_library_configurations(SNAPPY) -+ find_package_handle_standard_args(SNAPPY -+ FOUND_VAR -+ SNAPPY_FOUND -+ REQUIRED_VARS -+ SNAPPY_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find SNAPPY" -+ ) -+ -+ # Find LZ4 library -+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) -+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) -+ select_library_configurations(LZ4) -+ find_package_handle_standard_args(LZ4 -+ FOUND_VAR -+ LZ4_FOUND -+ REQUIRED_VARS -+ LZ4_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find LZ4" -+ ) -+ -+ # Find ZSTD library -+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) -+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) -+ select_library_configurations(ZSTD) -+ find_package_handle_standard_args(ZSTD -+ FOUND_VAR -+ ZSTD_FOUND -+ REQUIRED_VARS -+ ZSTD_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find ZSTD_" -+ ) -+endif(ROCKSDB_FOUND) -+ - set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) - set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) -- -- - -diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -index 68ad85d..86bb18a 100644 ---- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -@@ -16,7 +16,19 @@ SET(TARGET_SRC - RocksDBCacheDriver.cpp - ) - --SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) -+if(SNAPPY_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) -+endif(SNAPPY_FOUND) -+ -+if(LZ4_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) -+endif(LZ4_FOUND) -+ -+if(ZSTD_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) -+endif(ZSTD_FOUND) -+ -+SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) - - IF(MSVC) - SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) -- -- \ No newline at end of file +diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake +index b0692b0..984d3f2 100644 +--- a/CMakeModules/FindRocksDB.cmake ++++ b/CMakeModules/FindRocksDB.cmake +@@ -39,5 +39,49 @@ find_package_handle_standard_args(ROCKSDB + "Could NOT find ROCKSDB" + ) + ++if(ROCKSDB_FOUND) ++ FIND_PACKAGE(ZLIB REQUIRED) ++ ++ include(SelectLibraryConfigurations) ++ # Find Snappy library ++ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) ++ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) ++ select_library_configurations(SNAPPY) ++ find_package_handle_standard_args(SNAPPY ++ FOUND_VAR ++ SNAPPY_FOUND ++ REQUIRED_VARS ++ SNAPPY_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find SNAPPY" ++ ) ++ ++ # Find LZ4 library ++ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) ++ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) ++ select_library_configurations(LZ4) ++ find_package_handle_standard_args(LZ4 ++ FOUND_VAR ++ LZ4_FOUND ++ REQUIRED_VARS ++ LZ4_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find LZ4" ++ ) ++ ++ # Find ZSTD library ++ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) ++ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) ++ select_library_configurations(ZSTD) ++ find_package_handle_standard_args(ZSTD ++ FOUND_VAR ++ ZSTD_FOUND ++ REQUIRED_VARS ++ ZSTD_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find ZSTD_" ++ ) ++endif(ROCKSDB_FOUND) ++ + set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) + set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) +diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +index ecaac34..b4ec764 100644 +--- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt ++++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +@@ -34,7 +34,19 @@ IF(ROCKSDB_FOUND OR RocksDB_FOUND) + RocksDBCacheDriver.cpp + ) + +- SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) ++ if(SNAPPY_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) ++ endif(SNAPPY_FOUND) ++ ++ if(LZ4_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) ++ endif(LZ4_FOUND) ++ ++ if(ZSTD_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) ++ endif(ZSTD_FOUND) ++ ++ SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) + + IF(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 8f74dea63c421c..3be639cb46b314 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) file(GLOB OSG_PLUGINS_SUBDIR ${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*) @@ -12,11 +10,11 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OS vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gwaldron/osgearth - REF osgearth-2.10.2 - SHA512 fa306a82374716dafae9d834ed0fb07a7369ae0961696de36b6e2af45bc150040295985d9b9781ab713fd0707691451a6a8f173b34253749ab22764f51e60045 + REF 90ad04f281cbc87ffc45bed847ebaaecb188e593 #version 3.0 + SHA512 d1d59ae65cb4ef8a71e01b42411029e61bef20e2fd6d95b81c091d7d32b8c30f96d3156d7fd28e177ca83fd74ed113b9e31bf5ef360757524beb7cec7ced4996 HEAD_REF master PATCHES - RocksDB.patch + RocksDB.patch ) vcpkg_configure_cmake( @@ -27,7 +25,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() #Release -set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/osgearth) +set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT}) set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH}) @@ -45,7 +43,7 @@ file(REMOVE_RECURSE ${OSGDB_PLUGINS}) #Debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/osgearth) +set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH}) @@ -62,5 +60,4 @@ file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS}) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osgearth) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/osgearth/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osgearth/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/outcome/CONTROL b/ports/outcome/CONTROL index a90346b67e6d8e..449485ed9611fc 100644 --- a/ports/outcome/CONTROL +++ b/ports/outcome/CONTROL @@ -1,4 +1,4 @@ Source: outcome -Version: 2.1 +Version: 2.1.3 Homepage: https://github.com/ned14/outcome -Description: Provides very lightweight outcome and result (non-Boost edition) \ No newline at end of file +Description: Provides very lightweight outcome and result (non-Boost edition) diff --git a/ports/outcome/portfile.cmake b/ports/outcome/portfile.cmake index a9686b31c1e8f1..0d1223fc74a3d4 100644 --- a/ports/outcome/portfile.cmake +++ b/ports/outcome/portfile.cmake @@ -1,16 +1,13 @@ -# single header file - -include(vcpkg_common_functions) - +# header-only library vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ned14/outcome - REF 525478ed519d7c3400d60110649c315d705a07ad #v2.1 - SHA512 cf05f7c09ced02fa5fe3d9ad6533358a2fb63e31b5d5be81c16c285250cd275467217b8f9364b4ff1947d8c4aa6a86e10cef310d8475dcd9f7a0a713f1a01c8e + REF 34f3bd55e2bcaf246cb79efe64a5600e89b91b66 #v2.1.3 + SHA512 83eba50e2095e7c768dacb3af5f82db117c3451f1d5bc2f73d716608d56f7b73006ec33d0f3842fdefd076f0e82b72ece5777868712f75e83eac93aa8adf351c HEAD_REF develop ) file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") -file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt index 5fdd730ba79ee4..127b92319c7dce 100644 --- a/ports/pango/CMakeLists.txt +++ b/ports/pango/CMakeLists.txt @@ -49,11 +49,7 @@ find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARY fontconfig) # find freetype -find_path(FREETYPE_INCLUDE_DIR ft2build.h) -if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(FT_SUFFIX d) -endif() -find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) +find_package(Freetype REQUIRED) # find harfbuzz find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) @@ -65,7 +61,7 @@ if (APPLE) endif() set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) -set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) +set(FONT_LIBRARIES Freetype::Freetype ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) macro(pango_add_module MODULE_NAME) add_library(${MODULE_NAME} ${ARGN}) diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL index 2e1d6679e44832..cea8f146423d8e 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -1,5 +1,6 @@ Source: pango -Version: 1.40.11-7 +Version: 1.40.11 +Port-Version: 8 Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ Description: Text and font handling library. Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/pangolin/CONTROL b/ports/pangolin/CONTROL index 8963cc26bbe352..8fb88660e8de8b 100644 --- a/ports/pangolin/CONTROL +++ b/ports/pangolin/CONTROL @@ -1,5 +1,7 @@ Source: pangolin -Version: 0.5-7 +Version: 0.5 +Port-Version: 9 Build-Depends: eigen3, glew, libpng, libjpeg-turbo, ffmpeg Homepage: https://github.com/stevenlovegrove/Pangolin Description: Lightweight GUI Library +Supports: !uwp & !osx & !(windows&static) diff --git a/ports/pangolin/fix-dependency-python.patch b/ports/pangolin/fix-dependency-python.patch new file mode 100644 index 00000000000000..67eae1288cf54a --- /dev/null +++ b/ports/pangolin/fix-dependency-python.patch @@ -0,0 +1,14 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7f364a7..9e0baac 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -213,6 +213,9 @@ endif() + find_package(PythonLibs QUIET) + if(BUILD_PANGOLIN_GUI AND BUILD_PANGOLIN_VARS AND PYTHONLIBS_FOUND AND NOT _WIN_) + set(HAVE_PYTHON 1) ++ if (UNIX) ++ set(PYTHON_LIBRARY ${PYTHON_LIBRARY} dl util) ++ endif() + list(APPEND HEADERS + ${INCDIR}/console/ConsoleInterpreter.h + ${INCDIR}/console/ConsoleView.h diff --git a/ports/pangolin/fix-dependeny-ffmpeg.patch b/ports/pangolin/fix-dependeny-ffmpeg.patch new file mode 100644 index 00000000000000..2c52bb710c3755 --- /dev/null +++ b/ports/pangolin/fix-dependeny-ffmpeg.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeModules/FindFFMPEG.cmake b/CMakeModules/FindFFMPEG.cmake +index 4f77e5a..151762f 100644 +--- a/CMakeModules/FindFFMPEG.cmake ++++ b/CMakeModules/FindFFMPEG.cmake +@@ -21,6 +21,14 @@ FIND_PATH( + SWSCALE_INCLUDE_DIR libswscale/swscale.h + /usr/include /usr/local/include /opt/local/include + ) ++FIND_PATH( ++ AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h ++ /usr/include /usr/local/include /opt/local/include ++) ++FIND_PATH( ++ SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h ++ /usr/include /usr/local/include /opt/local/include ++) + + # Find Library files + FIND_LIBRARY( +@@ -43,15 +51,28 @@ FIND_LIBRARY( + NAMES swscale + PATH /usr/lib /usr/local/lib /opt/local/lib + ) ++FIND_LIBRARY( ++ AVDEVICE_LIBRARY ++ NAMES avdevice ++ PATH /usr/lib /usr/local/lib /opt/local/lib ++) ++FIND_LIBRARY( ++ SWRESAMPLE_LIBRARY ++ NAMES swresample ++ PATH /usr/lib /usr/local/lib /opt/local/lib ++) + + IF( EXISTS "${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" ) + SET( AVUTIL_HAVE_PIXDESC TRUE) + endif() + + IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC) ++ IF (WIN32) ++ SET(AVFORMAT_LIBRARY ${AVFORMAT_LIBRARY} Ws2_32 Secur32 Bcrypt) ++ ENDIF() + SET(FFMPEG_FOUND TRUE) +- SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY}) +- SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR}) ++ SET(FFMPEG_LIBRARIES ${AVFORMAT_LIBRARY} ${AVDEVICE_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} ${SWRESAMPLE_LIBRARY}) ++ SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR}) + + include(CheckCXXSourceCompiles) + diff --git a/ports/pangolin/portfile.cmake b/ports/pangolin/portfile.cmake index e22672ec00dd55..4f48fc1c66beca 100644 --- a/ports/pangolin/portfile.cmake +++ b/ports/pangolin/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -11,6 +9,8 @@ vcpkg_from_github( PATCHES deprecated_constants.patch # Change from upstream pangolin to address build failures from latest ffmpeg library fix-includepath-error.patch # include path has one more ../ + fix-dependeny-ffmpeg.patch + fix-dependency-python.patch ) file(REMOVE ${SOURCE_PATH}/CMakeModules/FindGLEW.cmake) @@ -33,7 +33,9 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Pangolin) vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(GLOB EXE ${CURRENT_PACKAGES_DIR}/lib/*.dll) file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE ${EXE}) @@ -42,21 +44,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${DEBUG_EXE}) - file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake PANGOLIN_TARGETS) - string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake "${PANGOLIN_TARGETS}") - - file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake PANGOLIN_TARGETS) - string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake "${PANGOLIN_TARGETS}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake + "lib/pangolin.dll" "bin/pangolin.dll" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake + "lib/pangolin.dll" "bin/pangolin.dll" + ) + + # Copy missing header file + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# Copy missing header file -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) - # Put the license file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) -file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/Pangolin/LICENCE ${CURRENT_PACKAGES_DIR}/share/Pangolin/copyright) +file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/) +file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/paraview/CONTROL b/ports/paraview/CONTROL index 56aa3cbaadfa49..d40b55adc6282a 100644 --- a/ports/paraview/CONTROL +++ b/ports/paraview/CONTROL @@ -1,8 +1,9 @@ Source: paraview -Version: 5.8.0-2 +Version: 5.8.0 +Port-Version: 3 Homepage: https://www.paraview.org/ Description: VTK-based Data Analysis and Visualization Application -Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm, embree3(linux) +Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm Feature: vtkm Description: enables vtkm for the build of paraview diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index 84f1d1aab2cc53..ab64ef34af2c8f 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -1,9 +1,5 @@ set(VERSION 5.8) -if ("tools" IN_LIST FEATURES AND VCPKG_TARGET_IS_OSX) - mesage(FATAL_ERROR "Feature tools are currently not supported.") -endif() - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" PARAVIEW_USE_CUDA #untested; probably only affects internal VTK build so it does nothing here "all_modules" PARAVIEW_BUILD_ALL_MODULES #untested @@ -65,13 +61,9 @@ if("python" IN_LIST FEATURES) -DPython3_FIND_REGISTRY=NEVER "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature ) - #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages endif() -string(APPEND VCPKG_C_FLAGS " -DH5_USE_110_API") -string(APPEND VCPKG_CXX_FLAGS " -DH5_USE_110_API") - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja @@ -82,15 +74,15 @@ vcpkg_configure_cmake( -DVTK_MODULE_ENABLE_ParaView_qttesting=YES -DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF -DPARAVIEW_USE_QTHELP:BOOL=OFF - + #A little bit of help in finding the boost headers "-DBoost_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include" - + # Workarounds for CMake issues -DHAVE_SYS_TYPES_H=0 ## For some strange reason the test first succeeds and then fails the second time around -DWORDS_BIGENDIAN=0 ## Tests fails in VisItCommon.cmake for some unknown reason this is just a workaround since most systems are little endian. ${ADDITIONAL_OPTIONS} - + #-DPARAVIEW_ENABLE_FFMPEG:BOOL=OFF ) if(CMAKE_HOST_UNIX) @@ -120,7 +112,7 @@ set(TOOLS paraview smTestDriver vtkProcessXML vtkWrapClientServer) - + foreach(tool ${TOOLS}) # Remove debug tools set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL index 1577832fd66730..e7f0cc3c06c3e1 100644 --- a/ports/pbc/CONTROL +++ b/ports/pbc/CONTROL @@ -1,6 +1,7 @@ Source: pbc -Version: 0.5.14-2 -Build-Depends: mpir (windows) +Version: 0.5.14 +Port-Version: 4 +Build-Depends: mpir (windows), gmp (!windows) Homepage: https://crypto.stanford.edu/pbc Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems. -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/ports/pbc/portfile.cmake b/ports/pbc/portfile.cmake index 3f47fa56ea3fde..93b06c5dbe090f 100644 --- a/ports/pbc/portfile.cmake +++ b/ports/pbc/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP") set(PBC_VERSION 0.5.14) -if(VCPKG_CMAKE_SYSTEM_NAME) +if(NOT VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile( ARCHIVE URLS "https://crypto.stanford.edu/pbc/files/pbc-${PBC_VERSION}.tar.gz" @@ -27,45 +27,16 @@ if(VCPKG_CMAKE_SYSTEM_NAME) endif() set(OPTIONS ${SHARED_STATIC} LEX=${FLEX} YACC=${BISON}\ -y) - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/setup - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME setup-${TARGET_TRIPLET} - ) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g -I${SOURCE_PATH}/include") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME configure-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Building ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME install-${TARGET_TRIPLET}-dbg + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + COPY_SOURCE + OPTIONS + ${OPTIONS} ) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O3 -I${SOURCE_PATH}/include") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME configure-${TARGET_TRIPLET}-rel - ) - message(STATUS "Building ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME install-${TARGET_TRIPLET}-rel - ) + vcpkg_install_make() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pcl/CONTROL b/ports/pcl/CONTROL index d21a0b8fd22175..92b6dc7401f875 100644 --- a/ports/pcl/CONTROL +++ b/ports/pcl/CONTROL @@ -1,8 +1,10 @@ Source: pcl -Version: 1.9.1-13 +Version: 1.11.0 +Port-Version: 2 Homepage: https://github.com/PointCloudLibrary/pcl Description: Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing. -Build-Depends: eigen3, flann, qhull, vtk, libpng, boost-system, boost-filesystem, boost-thread, boost-date-time, boost-iostreams, boost-random, boost-foreach, boost-dynamic-bitset, boost-property-map, boost-graph, boost-multi-array, boost-signals2, boost-ptr-container, boost-uuid, boost-interprocess, boost-asio +Build-Depends: eigen3, flann, qhull, libpng, boost-system, boost-filesystem, boost-thread, boost-date-time, boost-iostreams, boost-random, boost-foreach, boost-dynamic-bitset, boost-property-map, boost-graph, boost-multi-array, boost-signals2, boost-sort, boost-ptr-container, boost-uuid, boost-interprocess, boost-asio +Supports: !(arm64&windows) Feature: openni2 Description: OpenNI2 support for PCL @@ -26,3 +28,7 @@ Build-Depends: cuda Feature: opengl Description: OpenGL support for PCL + +Feature: vtk +Description: VTK-Visualizations support for PCL +Build-Depends: vtk diff --git a/ports/pcl/boost-1.70.patch b/ports/pcl/boost-1.70.patch index c4b9955d29f2e2..eed9be033a3e4c 100644 --- a/ports/pcl/boost-1.70.patch +++ b/ports/pcl/boost-1.70.patch @@ -1,27 +1,14 @@ -diff --git a/segmentation/include/pcl/segmentation/supervoxel_clustering.h b/segmentation/include/pcl/segmentation/supervoxel_clustering.h -index 05e6002..99e3a07 100644 ---- a/segmentation/include/pcl/segmentation/supervoxel_clustering.h -+++ b/segmentation/include/pcl/segmentation/supervoxel_clustering.h -@@ -525,7 +525,7 @@ namespace pcl - }; - - //Make boost::ptr_list can access the private class SupervoxelHelper -- friend void boost::checked_delete<> (const typename pcl::SupervoxelClustering::SupervoxelHelper *); -+ //friend void boost::checked_delete<> (const typename pcl::SupervoxelClustering::SupervoxelHelper *); - - typedef boost::ptr_list HelperListT; - HelperListT supervoxel_helpers_; -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 68cc438..8cfa1c6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -416,6 +416,9 @@ endif() - - # Boost (required) - include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake") -+if (NOT APPLE) -+ add_definitions(-fext-numeric-literals) -+endif() - - ### ---[ Create the config.h file - set(pcl_config_h_in "${CMAKE_CURRENT_SOURCE_DIR}/pcl_config.h.in") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b301cf1..789b660 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -462,6 +462,9 @@ endif() + + # Boost (required) + include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake") ++if (NOT APPLE AND NOT WIN32) ++ add_definitions(-fext-numeric-literals) ++endif() + + ### ---[ Create the config.h file + set(pcl_config_h_in "${CMAKE_CURRENT_SOURCE_DIR}/pcl_config.h.in") diff --git a/ports/pcl/boost-1.73.patch b/ports/pcl/boost-1.73.patch deleted file mode 100644 index d634d84bb298bf..00000000000000 --- a/ports/pcl/boost-1.73.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/common/include/pcl/PCLPointCloud2.h b/common/include/pcl/PCLPointCloud2.h -index 6a00c1f..5d4ac1c 100644 ---- a/common/include/pcl/PCLPointCloud2.h -+++ b/common/include/pcl/PCLPointCloud2.h -@@ -8,7 +8,7 @@ - #include - #include - #include --#include -+#include - - // Include the correct Header path here - #include -@@ -23,9 +23,9 @@ namespace pcl - is_bigendian (false), point_step (0), row_step (0), - data (), is_dense (false) - { --#if defined(BOOST_BIG_ENDIAN) -+#if BOOST_ENDIAN_BIG_BYTE - is_bigendian = true; --#elif defined(BOOST_LITTLE_ENDIAN) -+#elif BOOST_ENDIAN_LITTLE_BYTE - is_bigendian = false; - #else - #error "unable to determine system endianness" -diff --git a/io/include/pcl/io/ply/byte_order.h b/io/include/pcl/io/ply/byte_order.h -index 2af95d0..8328015 100644 ---- a/io/include/pcl/io/ply/byte_order.h -+++ b/io/include/pcl/io/ply/byte_order.h -@@ -40,7 +40,7 @@ - #ifndef PCL_IO_PLY_BYTE_ORDER_H - #define PCL_IO_PLY_BYTE_ORDER_H - --#include -+#include - - namespace pcl - { -@@ -58,9 +58,9 @@ namespace pcl - { - little_endian_byte_order, - big_endian_byte_order, --#if defined(BOOST_BIG_ENDIAN) -+#if BOOST_ENDIAN_BIG_BYTE - host_byte_order = big_endian_byte_order, --#elif defined(BOOST_LITTLE_ENDIAN) -+#elif BOOST_ENDIAN_LITTLE_BYTE - host_byte_order = little_endian_byte_order, - #else - #error "unable to determine system endianness" diff --git a/ports/pcl/cuda_10_1.patch b/ports/pcl/cuda_10_1.patch deleted file mode 100644 index 4b46149a4b1f72..00000000000000 --- a/ports/pcl/cuda_10_1.patch +++ /dev/null @@ -1,133 +0,0 @@ -diff --git a/cuda/common/include/pcl/cuda/thrust.h b/cuda/common/include/pcl/cuda/thrust.h -index 57586ab..af073d7 100644 ---- a/cuda/common/include/pcl/cuda/thrust.h -+++ b/cuda/common/include/pcl/cuda/thrust.h -@@ -42,6 +42,7 @@ - - #include - #include -+#include - #include - #include - #include -diff --git a/gpu/features/src/fpfh.cu b/gpu/features/src/fpfh.cu -index 8d34f76..59a5f0c 100644 ---- a/gpu/features/src/fpfh.cu -+++ b/gpu/features/src/fpfh.cu -@@ -231,12 +231,12 @@ namespace pcl - int *sinds = sindices + Warp::WARP_SIZE * warp_idx; - int size = sizes[idx]; - -- for(int i = lane; __any(i < size); i += Warp::STRIDE) -+ for(int i = lane; __any_sync(0xFFFFFFFF, i < size); i += Warp::STRIDE) - { - if (i < size) - sinds[lane] = ginds[i]; - -- int inds_num = __popc(__ballot(i < size)); -+ int inds_num = __popc(__ballot_sync(0xFFFFFFFF, i < size)); - - for(int j = 0; j < inds_num; ++j) - { -diff --git a/gpu/octree/src/cuda/approx_nsearch.cu b/gpu/octree/src/cuda/approx_nsearch.cu -index e457255..3e1adfe 100644 ---- a/gpu/octree/src/cuda/approx_nsearch.cu -+++ b/gpu/octree/src/cuda/approx_nsearch.cu -@@ -141,7 +141,7 @@ namespace pcl { namespace device { namespace appnearest_search - { - __shared__ volatile int per_warp_buffer[KernelPolicy::WARPS_COUNT]; - -- int mask = __ballot(node_idx != -1); -+ int mask = __ballot_sync(0xFFFFFFFF, node_idx != -1); - - while(mask) - { -@@ -275,7 +275,7 @@ namespace pcl { namespace device { namespace appnearest_search - - bool active = query_index < batch.queries_num; - -- if (__all(active == false)) -+ if (__all_sync(0xFFFFFFFF, active == false)) - return; - - Warp_appNearestSearch search(batch, query_index); -diff --git a/gpu/octree/src/cuda/knn_search.cu b/gpu/octree/src/cuda/knn_search.cu -index a99655d..b55e3c1 100644 ---- a/gpu/octree/src/cuda/knn_search.cu -+++ b/gpu/octree/src/cuda/knn_search.cu -@@ -106,7 +106,7 @@ namespace pcl { namespace device { namespace knn_search - else - query_index = -1; - -- while(__any(active)) -+ while(__any_sync(0xFFFFFFFF, active)) - { - int leaf = -1; - -@@ -163,7 +163,7 @@ namespace pcl { namespace device { namespace knn_search - - __device__ __forceinline__ void processLeaf(int node_idx) - { -- int mask = __ballot(node_idx != -1); -+ int mask = __ballot_sync(0xFFFFFFFF, node_idx != -1); - - unsigned int laneId = Warp::laneId(); - unsigned int warpId = Warp::id(); -@@ -310,7 +310,7 @@ namespace pcl { namespace device { namespace knn_search - - bool active = query_index < batch.queries_num; - -- if (__all(active == false)) -+ if (__all_sync(0xFFFFFFFF, active == false)) - return; - - Warp_knnSearch search(batch, query_index); -diff --git a/gpu/octree/src/cuda/radius_search.cu b/gpu/octree/src/cuda/radius_search.cu -index f90273f..8ae84e7 100644 ---- a/gpu/octree/src/cuda/radius_search.cu -+++ b/gpu/octree/src/cuda/radius_search.cu -@@ -155,7 +155,7 @@ namespace pcl - else - query_index = -1; - -- while(__any(active)) -+ while(__any_sync(0xFFFFFFFF, active)) - { - int leaf = -1; - -@@ -217,7 +217,7 @@ namespace pcl - - __device__ __forceinline__ void processLeaf(int leaf) - { -- int mask = __ballot(leaf != -1); -+ int mask = __ballot_sync(0xFFFFFFFF, leaf != -1); - - while(mask) - { -@@ -255,7 +255,7 @@ namespace pcl - int *out = batch.output + active_query_index * batch.max_results + active_found_count; - int length_left = batch.max_results - active_found_count; - -- int test = __any(active_lane == laneId && (leaf & KernelPolicy::CHECK_FLAG)); -+ int test = __any_sync(0xFFFFFFFF, active_lane == laneId && (leaf & KernelPolicy::CHECK_FLAG)); - - if (test) - { -@@ -329,7 +329,7 @@ namespace pcl - total_new += new_nodes; - out += new_nodes; - -- if (__all(idx >= length) || __any(out_of_bounds) || total_new == length_left) -+ if (__all_sync(0xFFFFFFFF, idx >= length) || __any_sync(0xFFFFFFFF, out_of_bounds) || total_new == length_left) - break; - } - return min(total_new, length_left); -@@ -343,7 +343,7 @@ namespace pcl - - bool active = query_index < batch.queries.size; - -- if (__all(active == false)) -+ if (__all_sync(0xFFFFFFFF, active == false)) - return; - - Warp_radiusSearch search(batch, query_index); diff --git a/ports/pcl/fix-check-sse.patch b/ports/pcl/fix-check-sse.patch new file mode 100644 index 00000000000000..4fd6e676b36a0e --- /dev/null +++ b/ports/pcl/fix-check-sse.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e580b1a..572ea06 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,7 +86,7 @@ endif() + + # check for SSE flags + include("${PCL_SOURCE_DIR}/cmake/pcl_find_sse.cmake") +-if(PCL_ENABLE_SSE AND "${CMAKE_CXX_FLAGS}" STREQUAL "${CMAKE_CXX_FLAGS_DEFAULT}") ++if(PCL_ENABLE_SSE) + PCL_CHECK_FOR_SSE() + endif() + diff --git a/ports/pcl/fix-link-libpng.patch b/ports/pcl/fix-link-libpng.patch index 9d1e25a1788898..2d5ea5f3bd3f98 100644 --- a/ports/pcl/fix-link-libpng.patch +++ b/ports/pcl/fix-link-libpng.patch @@ -1,20 +1,20 @@ diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt -index a17cb2d..b2a56b3 100644 +index f234971..86ea242 100644 --- a/io/CMakeLists.txt +++ b/io/CMakeLists.txt -@@ -330,11 +330,13 @@ if(build) - add_definitions(${VTK_DEFINES}) - PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${compression_incs} ${impl_incs} ${OPENNI_INCLUDES} ${OPENNI2_INCLUDES}) - target_include_directories(${LIB_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ${VTK_INCLUDE_DIRECTORIES}) -- link_directories(${VTK_LINK_DIRECTORIES}) -- target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES} ) -+ - if(PNG_FOUND) - target_link_libraries("${LIB_NAME}" ${PNG_LIBRARIES}) - endif(PNG_FOUND) -+ -+ link_directories(${VTK_LINK_DIRECTORIES}) -+ target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES} ) +@@ -333,12 +333,13 @@ set(LIB_NAME "pcl_${SUBSYS_NAME}") + add_definitions(${VTK_DEFINES}) + PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${compression_incs} ${impl_incs} ${OPENNI_INCLUDES} ${OPENNI2_INCLUDES}) + target_include_directories(${LIB_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +-link_directories(${VTK_LINK_DIRECTORIES}) +-target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES}) + if(PNG_FOUND) + target_link_libraries("${LIB_NAME}" ${PNG_LIBRARIES}) + endif() - if(LIBUSB_1_FOUND) - target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES}) ++link_directories(${VTK_LINK_DIRECTORIES}) ++target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES}) ++ + if(LIBUSB_1_FOUND) + target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES}) + endif() diff --git a/ports/pcl/pcl_config.patch b/ports/pcl/pcl_config.patch index 17af6cfb6ef843..60bcec8a502efc 100644 --- a/ports/pcl/pcl_config.patch +++ b/ports/pcl/pcl_config.patch @@ -1,45 +1,33 @@ diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in -index 7ec40baa0..837d78c82 100644 +index 9f78fcf..0cbe94f 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in -@@ -388,25 +388,18 @@ file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR) +@@ -396,25 +396,16 @@ file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR) if(WIN32 AND NOT MINGW) # PCLConfig.cmake is installed to PCL_ROOT/cmake get_filename_component(PCL_ROOT "${PCL_DIR}" PATH) + get_filename_component(PCL_ROOT "${PCL_ROOT}" PATH) - else(WIN32 AND NOT MINGW) + else() # PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) - endif(WIN32 AND NOT MINGW) + endif() # check whether PCLConfig.cmake is found into a PCL installation or in a build tree -if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h") -+if(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h") - # Found a PCL installation - # pcl_message("Found a PCL installation") -- set(PCL_INCLUDE_DIRS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}") +- # Found a PCL installation +- # pcl_message("Found a PCL installation") +- set(PCL_CONF_INCLUDE_DIR "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}") - set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@") - if(EXISTS "${PCL_ROOT}/3rdParty") - set(PCL_ALL_IN_ONE_INSTALLER ON) -- endif(EXISTS "${PCL_ROOT}/3rdParty") +- endif() -elseif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h") - # Found a non-standard (likely ANDROID) PCL installation - # pcl_message("Found a PCL installation") - set(PCL_INCLUDE_DIRS "${PCL_ROOT}/include") ++if(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h") + set(PCL_CONF_INCLUDE_DIR "${PCL_ROOT}/include") - set(PCL_LIBRARY_DIRS "${PCL_ROOT}/lib") + set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@" "${PCL_ROOT}/debug/@LIB_INSTALL_DIR@") if(EXISTS "${PCL_ROOT}/3rdParty") set(PCL_ALL_IN_ONE_INSTALLER ON) - endif(EXISTS "${PCL_ROOT}/3rdParty") -@@ -416,9 +409,9 @@ elseif(EXISTS "${PCL_DIR}/include/pcl/pcl_config.h") - set(PCL_INCLUDE_DIRS "${PCL_DIR}/include") # for pcl_config.h - set(PCL_LIBRARY_DIRS "${PCL_DIR}/@LIB_INSTALL_DIR@") - set(PCL_SOURCES_TREE "@CMAKE_SOURCE_DIR@") --else(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h") -+else(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h") - pcl_report_not_found("PCL can not be found on this machine") --endif(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h") -+endif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h") - - #set a suffix for debug libraries - set(PCL_DEBUG_SUFFIX "@CMAKE_DEBUG_POSTFIX@") + endif() diff --git a/ports/pcl/pcl_utils.patch b/ports/pcl/pcl_utils.patch index 9c12e4d05e8c3c..21b7593ac2723e 100644 --- a/ports/pcl/pcl_utils.patch +++ b/ports/pcl/pcl_utils.patch @@ -1,28 +1,28 @@ diff --git a/cmake/pcl_utils.cmake b/cmake/pcl_utils.cmake -index f523dbc8c..a171b6d24 100644 +index d87d02d..7c951bf 100644 --- a/cmake/pcl_utils.cmake +++ b/cmake/pcl_utils.cmake -@@ -97,21 +97,12 @@ macro(SET_INSTALL_DIRS) - if (NOT DEFINED LIB_INSTALL_DIR) +@@ -94,21 +94,12 @@ macro(SET_INSTALL_DIRS) + if(NOT DEFINED LIB_INSTALL_DIR) set(LIB_INSTALL_DIR "lib") - endif (NOT DEFINED LIB_INSTALL_DIR) + endif() - if(NOT ANDROID) - set(INCLUDE_INSTALL_ROOT - "include/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}") -- else(NOT ANDROID) +- else() - set(INCLUDE_INSTALL_ROOT "include") # Android, don't put into subdir -- endif(NOT ANDROID) -+ set(INCLUDE_INSTALL_ROOT "include") +- endif() ++ set(INCLUDE_INSTALL_ROOT "include") set(INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT}/pcl") set(DOC_INSTALL_DIR "share/doc/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}") set(BIN_INSTALL_DIR "bin") set(PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig") - if(WIN32 AND NOT MINGW) - set(PCLCONFIG_INSTALL_DIR "cmake") -- else(WIN32 AND NOT MINGW) +- else() - set(PCLCONFIG_INSTALL_DIR "share/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}") -- endif(WIN32 AND NOT MINGW) +- endif() + set(PCLCONFIG_INSTALL_DIR "share/pcl") - endmacro(SET_INSTALL_DIRS) + endmacro() diff --git a/ports/pcl/portfile.cmake b/ports/pcl/portfile.cmake index ef3cf959ede812..06cd056dec28cd 100644 --- a/ports/pcl/portfile.cmake +++ b/ports/pcl/portfile.cmake @@ -1,25 +1,31 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO PointCloudLibrary/pcl - REF pcl-1.9.1 - SHA512 ca95028c23861ac2df0fa7e18fdd0202255cb2e49ab714325eb36c35289442c6eedbf489e6f9f232b30fa2a93eff4c9619f8a14d3fdfe58f353a4a6e26206bdf + REF f9f214f34a38d5bb67441140703a681c5d299906 # pcl-1.11.0 + SHA512 7d1bbadcd6843001895bd1faeb5ad4166f7746bf77f83573160507746d438797fbe9e283a8989f517fe1dc7195934ad59e008b4fce61e5943ce6426d49141365 HEAD_REF master PATCHES pcl_utils.patch pcl_config.patch use_flann_targets.patch boost-1.70.patch - cuda_10_1.patch - # Patch for https://github.com/microsoft/vcpkg/issues/7660 - use_target_link_libraries_in_pclconfig.patch fix-link-libpng.patch - boost-1.73.patch + remove-broken-targets.patch + fix-check-sse.patch ) file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindFLANN.cmake) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PCL_SHARED_LIBS) +if ("cuda" IN_LIST FEATURES AND VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + message(FATAL_ERROR "Feature cuda only supports 64-bit compilation.") +endif() + +if ("tools" IN_LIST FEATURES AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(FATAL_ERROR "Feature tools only supports dynamic build") +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS openni2 WITH_OPENNI2 qt WITH_QT @@ -29,6 +35,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS cuda BUILD_GPU tools BUILD_tools opengl WITH_OPENGL + vtk WITH_VTK ) vcpkg_configure_cmake( @@ -46,7 +53,6 @@ vcpkg_configure_cmake( -DWITH_LIBUSB=OFF -DWITH_PNG=ON -DWITH_QHULL=ON - -DWITH_VTK=OFF # disabled due to API changes in 9.0 # FEATURES ${FEATURE_OPTIONS} ) diff --git a/ports/pcl/remove-broken-targets.patch b/ports/pcl/remove-broken-targets.patch new file mode 100644 index 00000000000000..b6a583153968ed --- /dev/null +++ b/ports/pcl/remove-broken-targets.patch @@ -0,0 +1,20 @@ +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 1911f7b..11566a2 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -123,15 +123,6 @@ target_link_libraries(pcl_concatenate_points_pcd pcl_common pcl_io) + PCL_ADD_EXECUTABLE(pcl_poisson_reconstruction COMPONENT ${SUBSYS_NAME} SOURCES poisson_reconstruction.cpp) + target_link_libraries(pcl_poisson_reconstruction pcl_common pcl_io pcl_surface) + +-PCL_ADD_EXECUTABLE(pcl_train_linemod_template COMPONENT ${SUBSYS_NAME} SOURCES train_linemod_template.cpp) +-target_link_libraries(pcl_train_linemod_template pcl_common pcl_io pcl_segmentation pcl_recognition) +- +-PCL_ADD_EXECUTABLE(pcl_match_linemod_template COMPONENT ${SUBSYS_NAME} SOURCES match_linemod_template.cpp) +-target_link_libraries(pcl_match_linemod_template pcl_common pcl_io pcl_recognition) +- +-PCL_ADD_EXECUTABLE(pcl_linemod_detection COMPONENT ${SUBSYS_NAME} SOURCES linemod_detection.cpp) +-target_link_libraries(pcl_linemod_detection pcl_common pcl_io pcl_recognition) +- + PCL_ADD_EXECUTABLE(pcl_fast_bilateral_filter COMPONENT ${SUBSYS_NAME} SOURCES fast_bilateral_filter.cpp) + target_link_libraries(pcl_fast_bilateral_filter pcl_common pcl_io pcl_filters) + diff --git a/ports/pcl/use_flann_targets.patch b/ports/pcl/use_flann_targets.patch index 7e6289267a7eb5..a948cc010c739a 100644 --- a/ports/pcl/use_flann_targets.patch +++ b/ports/pcl/use_flann_targets.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0b4c1a3..94bb484 100755 +index 93a6448..b24f681 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -280,11 +280,9 @@ find_package(Eigen REQUIRED) +@@ -302,10 +302,9 @@ find_package(Eigen 3.1 REQUIRED) include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) # FLANN (required) @@ -11,145 +11,87 @@ index 0b4c1a3..94bb484 100755 -endif() +set(FLANN_USE_STATIC ON) find_package(FLANN 1.7.0 REQUIRED) --include_directories(${FLANN_INCLUDE_DIRS}) +find_package(lz4) # libusb-1.0 option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE) diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in -index 6fadb59..6a9c5b7 100755 +index 79077fb..042467b 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in -@@ -226,12 +226,6 @@ endmacro(find_rssdk) +@@ -88,11 +88,6 @@ endmacro() - #remove this as soon as flann is shipped with FindFlann.cmake - macro(find_flann) + ### ---[ 3rd party libraries + macro(find_boost) - if(PCL_ALL_IN_ONE_INSTALLER) -- set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann") -- elseif(NOT FLANN_ROOT) -- get_filename_component(FLANN_ROOT "@FLANN_INCLUDE_DIRS@" PATH) -- endif(PCL_ALL_IN_ONE_INSTALLER) -- - set(FLANN_USE_STATIC @FLANN_USE_STATIC@) - find_package(FLANN) - endmacro(find_flann) -@@ -651,7 +645,7 @@ endif(NOT "${PCL_DEFINITIONS}" STREQUAL "") - pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES) +- set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost") +- elseif(NOT BOOST_INCLUDEDIR) +- set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@") +- endif() + # use static Boost in Windows + if(WIN32) + set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@) +@@ -667,8 +662,8 @@ pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES) # Add 3rd party libraries, as user code might include our .HPP implementations --list(APPEND PCL_LIBRARIES ${BOOST_LIBRARIES} ${QHULL_LIBRARIES} ${OPENNI_LIBRARIES} ${OPENNI2_LIBRARIES} ${ENSENSO_LIBRARIES} ${davidSDK_LIBRARIES} ${DSSDK_LIBRARIES} ${RSSDK_LIBRARIES} ${FLANN_LIBRARIES} ${VTK_LIBRARIES}) -+list(APPEND PCL_LIBRARIES ${BOOST_LIBRARIES} ${QHULL_LIBRARIES} ${OPENNI_LIBRARIES} ${OPENNI2_LIBRARIES} ${ENSENSO_LIBRARIES} ${davidSDK_LIBRARIES} ${DSSDK_LIBRARIES} ${RSSDK_LIBRARIES} flann::flann_cpp ${VTK_LIBRARIES}) + list(APPEND PCL_LIBRARIES ${BOOST_LIBRARIES} ${QHULL_LIBRARIES} ${OPENNI_LIBRARIES} ${OPENNI2_LIBRARIES} ${ENSENSO_LIBRARIES} ${davidSDK_LIBRARIES} ${DSSDK_LIBRARIES} ${RSSDK_LIBRARIES} ${RSSDK2_LIBRARIES} ${VTK_LIBRARIES}) +-if (TARGET FLANN::FLANN) +- list(APPEND PCL_LIBRARIES FLANN::FLANN) ++if (TARGET flann::flann_cpp) ++ list(APPEND PCL_LIBRARIES flann::flann_cpp) + endif() find_package_handle_standard_args(PCL DEFAULT_MSG PCL_LIBRARIES PCL_INCLUDE_DIRS) - mark_as_advanced(PCL_LIBRARIES PCL_INCLUDE_DIRS PCL_LIBRARY_DIRS) diff --git a/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt b/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt -index 9693792..dcd4373 100755 +index 7d25d3f..18227a6 100644 --- a/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt +++ b/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt -@@ -1,6 +1,6 @@ - cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +@@ -16,7 +16,7 @@ include_directories(SYSTEM --# we need FindFLANN.cmake -+# we need FindFLANN.cmake - list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + add_executable(build_tree build_tree.cpp) + target_link_libraries(build_tree ${PCL_LIBRARIES} ${Boost_LIBRARIES} +- FLANN::FLANN ${HDF5_LIBRARIES}) ++ flann::flann_cpp ${HDF5_LIBRARIES}) - project(vfh_cluster_classifier) -@@ -14,16 +14,15 @@ find_package(HDF5) - if(HDF5_FOUND) - - find_package(FLANN) -- include_directories(${FLANN_INCLUDE_DIRS}) - - include_directories(${HDF5_INCLUDE_DIR}) - - add_executable(build_tree build_tree.cpp) - target_link_libraries(build_tree ${PCL_LIBRARIES} ${Boost_LIBRARIES} -- ${FLANN_LIBRARIES} ${HDF5_hdf5_LIBRARY}) -+ flann::flann_cpp ${HDF5_hdf5_LIBRARY}) - - add_executable(nearest_neighbors nearest_neighbors.cpp) -- target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} -- ${Boost_LIBRARIES} ${FLANN_LIBRARIES} ${HDF5_hdf5_LIBRARY} -+ target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} -+ ${Boost_LIBRARIES} flann::flann_cpp ${HDF5_hdf5_LIBRARY} - ) - endif(HDF5_FOUND) + add_executable(nearest_neighbors nearest_neighbors.cpp) +-target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} ${Boost_LIBRARIES} FLANN::FLANN ${HDF5_LIBRARIES}) ++target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} ${Boost_LIBRARIES} flann::flann_cpp ${HDF5_LIBRARIES}) diff --git a/kdtree/CMakeLists.txt b/kdtree/CMakeLists.txt -index 311dffc..1a7712f 100755 +index 826e902..f714130 100644 --- a/kdtree/CMakeLists.txt +++ b/kdtree/CMakeLists.txt -@@ -9,18 +9,18 @@ PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} EXT_DEPS flann) - PCL_ADD_DOC("${SUBSYS_NAME}") +@@ -31,7 +31,7 @@ set(impl_incs + set(LIB_NAME "pcl_${SUBSYS_NAME}") + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") + PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) +-target_link_libraries("${LIB_NAME}" pcl_common FLANN::FLANN) ++target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp) + set(EXT_DEPS flann) + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${EXT_DEPS}) - if(build) -- set(srcs -+ set(srcs - src/kdtree_flann.cpp - ) - -- set(incs -+ set(incs - "include/pcl/${SUBSYS_NAME}/kdtree.h" - "include/pcl/${SUBSYS_NAME}/io.h" - "include/pcl/${SUBSYS_NAME}/flann.h" - "include/pcl/${SUBSYS_NAME}/kdtree_flann.h" - ) - -- set(impl_incs -+ set(impl_incs - "include/pcl/${SUBSYS_NAME}/impl/io.hpp" - "include/pcl/${SUBSYS_NAME}/impl/kdtree_flann.hpp" - ) -@@ -28,7 +28,7 @@ if(build) - set(LIB_NAME "pcl_${SUBSYS_NAME}") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") - PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${impl_incs}) -- target_link_libraries("${LIB_NAME}" pcl_common ${FLANN_LIBRARIES}) -+ target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp) - set(EXT_DEPS flann) - PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}" - "${SUBSYS_DEPS}" "${EXT_DEPS}" "" "" "") -@@ -38,4 +38,3 @@ if(build) - PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs}) - - endif(build) -- diff --git a/search/CMakeLists.txt b/search/CMakeLists.txt -index cd82a0e..1d15241 100755 +index 46f4632..67c5e53 100644 --- a/search/CMakeLists.txt +++ b/search/CMakeLists.txt -@@ -38,7 +38,7 @@ if(build) - set(LIB_NAME "pcl_${SUBSYS_NAME}") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") - PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${impl_incs}) -- target_link_libraries("${LIB_NAME}" pcl_common ${FLANN_LIBRARIES} pcl_octree pcl_kdtree) -+ target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp pcl_octree pcl_kdtree) - list(APPEND EXT_DEPS flann) - PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}" "${SUBSYS_DEPS}" "" "" "" "") - -@@ -46,4 +46,3 @@ if(build) - PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs}) +@@ -41,7 +41,7 @@ set(impl_incs + set(LIB_NAME "pcl_${SUBSYS_NAME}") + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") + PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) +-target_link_libraries("${LIB_NAME}" pcl_common FLANN::FLANN pcl_octree pcl_kdtree) ++target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp pcl_octree pcl_kdtree) + list(APPEND EXT_DEPS flann) + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) - endif(build) -- diff --git a/test/features/CMakeLists.txt b/test/features/CMakeLists.txt -index cedb0cb..4b37c73 100755 +index 9775415..bf582ac 100644 --- a/test/features/CMakeLists.txt +++ b/test/features/CMakeLists.txt -@@ -81,14 +81,14 @@ if (build) - PCL_ADD_TEST(feature_flare_estimation test_flare_estimation - FILES test_flare_estimation.cpp - LINK_WITH pcl_gtest pcl_features pcl_io -- ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") -+ ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") - PCL_ADD_TEST(feature_shot_lrf_estimation test_shot_lrf_estimation - FILES test_shot_lrf_estimation.cpp - LINK_WITH pcl_gtest pcl_features pcl_io - ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") - PCL_ADD_TEST(features_narf test_narf - FILES test_narf.cpp -- LINK_WITH pcl_gtest pcl_features ${FLANN_LIBRARIES}) -+ LINK_WITH pcl_gtest pcl_features flann::flann_cpp) - PCL_ADD_TEST(a_ii_normals_test test_ii_normals - FILES test_ii_normals.cpp - LINK_WITH pcl_gtest pcl_io pcl_features +@@ -91,7 +91,7 @@ if(BUILD_io) + ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") + PCL_ADD_TEST(features_narf test_narf + FILES test_narf.cpp +- LINK_WITH pcl_gtest pcl_features FLANN::FLANN) ++ LINK_WITH pcl_gtest pcl_features flann::flann_cpp) + PCL_ADD_TEST(a_ii_normals_test test_ii_normals + FILES test_ii_normals.cpp + LINK_WITH pcl_gtest pcl_io pcl_features diff --git a/ports/pcl/use_target_link_libraries_in_pclconfig.patch b/ports/pcl/use_target_link_libraries_in_pclconfig.patch deleted file mode 100644 index 65f622e6fff14b..00000000000000 --- a/ports/pcl/use_target_link_libraries_in_pclconfig.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in -index f1c2ca5..d28cb63 100644 ---- a/PCLConfig.cmake.in -+++ b/PCLConfig.cmake.in -@@ -609,7 +609,7 @@ foreach(component ${PCL_TO_FIND_COMPONENTS}) - INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${PCL_${COMPONENT}_LINK_LIBRARIES}" - ) -- else() -+ elseif(CMAKE_VERSION VERSION_LESS 3.11) - set_target_properties(${pcl_component} - PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "${definitions}" -@@ -617,6 +617,17 @@ foreach(component ${PCL_TO_FIND_COMPONENTS}) - INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${PCL_${COMPONENT}_LINK_LIBRARIES}" - ) -+ else() -+ set_target_properties(${pcl_component} -+ PROPERTIES -+ INTERFACE_COMPILE_DEFINITIONS "${definitions}" -+ INTERFACE_COMPILE_OPTIONS "$<$:${PCL_COMPILE_OPTIONS}>" -+ INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}" -+ ) -+ # If possible, we use target_link_libraries to avoid problems with link-type keywords, -+ # see https://github.com/PointCloudLibrary/pcl/issues/2989 -+ # target_link_libraries on imported libraries is supported only since CMake 3.11 -+ target_link_libraries(${pcl_component} INTERFACE ${PCL_${COMPONENT}_LINK_LIBRARIES}) - endif() - set(PCL_${COMPONENT}_LIBRARIES ${pcl_component}) - endif() diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index a36dec4e8298a5..cbd70b86927bb0 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,5 +1,5 @@ Source: pcre Version: 8.44 -Port-Version: 5 +Port-Version: 7 Homepage: https://www.pcre.org/ Description: Perl Compatible Regular Expressions diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index fe989d66013df8..6175b0bbb1f43c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -73,44 +73,46 @@ if(VCPKG_TARGET_IS_LINUX) # Used here in .pc.in files: Libs.private: @PTHREAD_CFLAGS@ set(PTHREAD_CFLAGS "-pthread") endif() - -configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) - +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + + configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) +endif() # debug set(prefix "${CURRENT_INSTALLED_DIR}/debug") set(exec_prefix "\${prefix}") set(libdir "\${prefix}/lib") set(includedir "\${prefix}/../include") +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) - -if(VCPKG_TARGET_IS_WINDOWS) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc LIBPCRE.PC) - string(REPLACE "-lpcre" "-lpcred" LIBPCRE.PC ${LIBPCRE.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc ${LIBPCRE.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc LIBPCRE16.PC) - string(REPLACE "-lpcre16" "-lpcre16d" LIBPCRE16.PC ${LIBPCRE16.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc ${LIBPCRE16.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc LIBPCRE32.PC) - string(REPLACE "-lpcre32" "-lpcre32d" LIBPCRE32.PC ${LIBPCRE32.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc ${LIBPCRE32.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc LIBPCRECPP.PC) - string(REPLACE "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" LIBPCRECPP.PC ${LIBPCRECPP.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc ${LIBPCRECPP.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc LIBPCREPOSIX.PC) - string(REPLACE "-lpcreposix" "-lpcreposixd" LIBPCREPOSIX.PC ${LIBPCREPOSIX.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc ${LIBPCREPOSIX.PC}) + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc + "-lpcre" "-lpcred" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc + "-lpcre16" "-lpcre16d" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc + "-lpcre32" "-lpcre32d" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc + "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc + "-lpcreposix" "-lpcreposixd" + ) + endif() endif() -vcpkg_fixup_pkgconfig() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/physx/CONTROL b/ports/physx/CONTROL index c744a2ae36c38d..7b8c12c2a8db7f 100644 --- a/ports/physx/CONTROL +++ b/ports/physx/CONTROL @@ -1,4 +1,5 @@ Source: physx -Version: 4.1.1-3 +Version: 4.1.1 +Port-Version: 5 Description: The NVIDIA PhysX SDK is a scalable multi-platform physics solution supporting a wide range of devices, from smartphones to high-end multicore CPUs and GPUs Supports: !uwp diff --git a/ports/physx/internalMBP_symbols.patch b/ports/physx/internalMBP_symbols.patch new file mode 100644 index 00000000000000..a74e2eaab79199 --- /dev/null +++ b/ports/physx/internalMBP_symbols.patch @@ -0,0 +1,49 @@ +diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp +index f19ba271..51580049 100644 +--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp ++++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp +@@ -90,6 +90,8 @@ using namespace Cm; + return ir; + }*/ + ++namespace internalMBP { ++ + struct RegionHandle : public Ps::UserAllocated + { + PxU16 mHandle; // Handle from region +@@ -582,6 +584,10 @@ struct RegionData : public Ps::UserAllocated + #endif + #endif + ++} ++ ++using namespace internalMBP; ++ + /////////////////////////////////////////////////////////////////////////////// + + MBP_PairManager::MBP_PairManager() : +diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h +index cf15f6d3..90f43e47 100644 +--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h ++++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h +@@ -35,8 +35,10 @@ + #include "BpBroadPhaseMBPCommon.h" + #include "BpMBPTasks.h" + ++namespace internalMBP { + class MBP; +- ++} ++ + namespace physx + { + namespace Bp +@@ -84,7 +86,7 @@ namespace Bp + MBPUpdateWorkTask mMBPUpdateWorkTask; + MBPPostUpdateWorkTask mMBPPostUpdateWorkTask; + +- MBP* mMBP; // PT: TODO: aggregate ++ internalMBP::MBP* mMBP; // PT: TODO: aggregate + + MBP_Handle* mMapping; + PxU32 mCapacity; diff --git a/ports/physx/portfile.cmake b/ports/physx/portfile.cmake index c77b18773dc178..2dcb5bdc1e0d36 100644 --- a/ports/physx/portfile.cmake +++ b/ports/physx/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(SYSTEM_PLATFORM "32") set(SYSTEM_PLATFORM_PATH "x86_32") @@ -13,30 +11,30 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(SYSTEM_PLATFORM "arm64") set(SYSTEM_PLATFORM_PATH "arm_64") else() - message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(GENERATE_STATIC_LIBRARIES "True") elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(GENERATE_STATIC_LIBRARIES "False") + set(GENERATE_STATIC_LIBRARIES "False") endif() -if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(MSBUILD_PLATFORM "Win32") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(MSBUILD_PLATFORM "x64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + elseif(VCPKG_TARGET_IS_UWP) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") set(MSBUILD_PLATFORM "ARM") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(MSBUILD_PLATFORM "ARM64") else() - message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() else() - message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140") @@ -56,7 +54,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL set(BUILD_SNIPPETS "False") set(BUILD_PUBLIC_SAMPLES "False") - if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "") + if(VCPKG_TARGET_IS_WINDOWS) set(SYSTEM "win") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") set(USE_STATIC_WINCRT "False") @@ -69,7 +67,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL set(COMPILER "vc${MSVC_VERSION}${SYSTEM}${SYSTEM_PLATFORM}") set(PRESET_FILE ${COMPILER}-${RUNTIME_LIBRARY_LINKAGE}-${VCPKG_LIBRARY_LINKAGE}) set(BUILD_PATH "${SYSTEM}.${SYSTEM_PLATFORM_PATH}.vc${TOOLSET_VERSION}.${RUNTIME_LIBRARY_LINKAGE}") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + elseif(VCPKG_TARGET_IS_UWP) set(SYSTEM "uwp") set(USE_STATIC_WINCRT "False") set(USE_DEBUG_CRT "False") @@ -87,9 +85,10 @@ vcpkg_from_github( REF ae80dede0546d652040ae6260a810e53e20a06fa SHA512 f3a690039cf39fe2db9a728b82af0d39eaa02340a853bdad4b5152d63532367eb24fc7033a614882168049b80d803b6225fc60ed2900a9d0deab847f220540be HEAD_REF master - PATCHES - msvc_142_bug_workaround.patch - vs16_3_typeinfo_header_fix.patch + PATCHES + internalMBP_symbols.patch + msvc_142_bug_workaround.patch + vs16_3_typeinfo_header_fix.patch ) file(REMOVE ${SOURCE_PATH}/physx/buildtools/presets/public/${PRESET_FILE}.xml) @@ -110,14 +109,16 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET} ) -set(RELEASE_CONFIGURATION "release") +if(NOT DEFINED RELEASE_CONFIGURATION) + set(RELEASE_CONFIGURATION "release") +endif() set(DEBUG_CONFIGURATION "debug") vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln + PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} - PLATFORM ${MSBUILD_PLATFORM} + PLATFORM ${MSBUILD_PLATFORM} ) file(INSTALL ${SOURCE_PATH}/physx/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}/) @@ -136,9 +137,9 @@ endif() file( GLOB RELEASE_LIBS - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb - ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb ) file(INSTALL ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) diff --git a/ports/pmdk/CONTROL b/ports/pmdk/CONTROL index e37a8c9b21763d..2c84efbfda06ec 100644 --- a/ports/pmdk/CONTROL +++ b/ports/pmdk/CONTROL @@ -1,5 +1,5 @@ Source: pmdk -Version: 1.8 +Version: 1.9 Homepage: https://github.com/pmem/pmdk Description: Persistent Memory Development Kit Supports: !(arm|x86) \ No newline at end of file diff --git a/ports/pmdk/portfile.cmake b/ports/pmdk/portfile.cmake index 4445749c456aae..6f436e969ec2e0 100644 --- a/ports/pmdk/portfile.cmake +++ b/ports/pmdk/portfile.cmake @@ -2,13 +2,13 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_fail_port_install(ON_ARCH "arm" "x86") -set(PMDK_VERSION "1.8") +set(PMDK_VERSION "1.9") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pmem/pmdk - REF 0245d75eaf0f6106c86a7926a45fdf2149e37eaa #Commit id corresponding to the version 1.8 - SHA512 1628f1f6be9e70c28ed490cec2db27aa31a9c6d43e11755a4232686a8523df6dff768e75e64479e22aca52d72500e3a75b256e4ae4de1f518f33cc07c5c26d9b + REF 1926ffb8f3f5f0617b3b3ed32029d437c272f187 #Commit id corresponding to the version 1.9 + SHA512 dc828866291f1c4a6901de5845d21a60eb2c7951c6b5ebc680b309a4e5f7596b0d9bea663f997dff9f08f666124850aecd2219caf12bab571b4c2b63db28ec7f HEAD_REF master PATCHES remove-non-ascii-character.patch @@ -49,7 +49,7 @@ file(GLOB LIB_RELEASE_FILES ${RELEASE_ARTIFACTS_PATH}/libs/libpmem*.dll) file(INSTALL ${LIB_RELEASE_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) # Install tools (release only) -file(INSTALL ${RELEASE_ARTIFACTS_PATH}/libs/pmempool.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/pmdk) +file(INSTALL ${RELEASE_ARTIFACTS_PATH}/libs/pmempool.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/pmdk) diff --git a/ports/pngpp/portfile.cmake b/ports/pngpp/portfile.cmake new file mode 100644 index 00000000000000..1fa23e4445ab07 --- /dev/null +++ b/ports/pngpp/portfile.cmake @@ -0,0 +1,15 @@ +# Header only library +vcpkg_download_distfile(ARCHIVE + URLS "http://download.savannah.nongnu.org/releases/pngpp/png++-0.2.10.tar.gz" + FILENAME "png++-0.2.10.tar.gz" + SHA512 c54a74c0c20212bd0dcf86386c0c11dd824ad14952917ba0ff4c184b6547744458728a4f06018371acb7d5b842b641708914ccaa81bad8e72e173903f494ca85 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +file(GLOB HEADER_FILES ${SOURCE_PATH}/*.hpp) +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/png++) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pngpp/vcpkg.json b/ports/pngpp/vcpkg.json new file mode 100644 index 00000000000000..67312ef2f9f1dd --- /dev/null +++ b/ports/pngpp/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "pngpp", + "version-string": "0.2.10", + "description": "A C++ wrapper for libpng library.", + "dependencies": [ + "libpng" + ] +} diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index be032c6de71cb7..939a74945fb7a4 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,5 +1,6 @@ Source: poco -Version: 1.9.2-2 +Version: 1.9.2 +Port-Version: 4 Build-Depends: expat, libpq, pcre, sqlite3, zlib, libpng Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. Homepage: https://github.com/pocoproject/poco diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 27eddc98256726..184db9c73198bf 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pocoproject/poco @@ -119,8 +117,6 @@ else() file(RENAME ${CURRENT_PACKAGES_DIR}/bin/tec ${CURRENT_PACKAGES_DIR}/tools/tec) endif() - -# if (VCPKG_LIBRARY_LINKAGE STREQUAL static OR VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin @@ -141,7 +137,6 @@ else() ${CURRENT_PACKAGES_DIR}/debug/bin/tec.pdb) endif() -# if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake") vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/Poco") @@ -152,7 +147,6 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # copy license -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/podofo/CONTROL b/ports/podofo/CONTROL index a6965d832de761..933f7363fc410d 100644 --- a/ports/podofo/CONTROL +++ b/ports/podofo/CONTROL @@ -1,5 +1,6 @@ Source: podofo -Version: 0.9.6-11 +Version: 0.9.6 +Port-Version: 12 Homepage: https://sourceforge.net/projects/podofo/ Description: PoDoFo is a library to work with the PDF file format Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openssl, freetype diff --git a/ports/podofo/freetype.patch b/ports/podofo/freetype.patch new file mode 100644 index 00000000000000..f241690f719136 --- /dev/null +++ b/ports/podofo/freetype.patch @@ -0,0 +1,18 @@ +diff --git a/cmake/modules/FindFREETYPE.cmake b/cmake/modules/FindFREETYPE.cmake +index 41114798f..0911dc092 100644 +--- a/cmake/modules/FindFREETYPE.cmake ++++ b/cmake/modules/FindFREETYPE.cmake +@@ -15,9 +15,13 @@ SET(FREETYPE_FIND_QUIETLY 1) + # first we try to find ft2build.h in the new location as + # of freetype 2.5.1 + FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h ++ PATHS + /usr/include/freetype2 + /usr/local/include/freetype2 + /usr/X11/include/freetype2 ++ PATH_SUFFIXES ++ freetype2 ++ include/freetype2 + NO_CMAKE_SYSTEM_PATH + ) + diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake index d9b34614a8c2e6..36bd2c48e4cd50 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_sourceforge( PATCHES 0001-unique_ptr.patch 0002-HAVE_UNISTD_H.patch + freetype.patch ${ADDITIONAL_PATCH} ) diff --git a/ports/polyhook2/CONTROL b/ports/polyhook2/CONTROL index d867d5ebaa666e..8d04e2a1d86418 100644 --- a/ports/polyhook2/CONTROL +++ b/ports/polyhook2/CONTROL @@ -1,5 +1,5 @@ Source: polyhook2 -Version: 2020-07-01 +Version: 2020-08-29 Homepage: https://github.com/stevemk14ebr/PolyHook_2_0 Description: C++17, x86/x64 Hooking Libary v2.0 Supports: !(arm|uwp|linux|osx) diff --git a/ports/polyhook2/portfile.cmake b/ports/polyhook2/portfile.cmake index 93e1ead79a6c22..82951c96ac7776 100644 --- a/ports/polyhook2/portfile.cmake +++ b/ports/polyhook2/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "Linux" "OSX" "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stevemk14ebr/PolyHook_2_0 - REF d8d0eb9b0932783f7d6be2d96e4d2c8adbf08c4b - SHA512 4e08614818dac648596118c62c38b36f88b39bd7c299cdbb44604249b3d7201541dcb64e926e3f5a92327603342f8393e4c7c84feda37e9f4250a5bf06ab2473 + REF b3c0baf639614c4b4ca56e5df2e9da688986917b + SHA512 a1fb531fcbd7d6ac084efc7a67b7a1d9e661f0e770df02db7458a311c54ca1a1f11b8be0ae438a40259603414bfb2e64bab69d45754bc910363daa912e995550 HEAD_REF master ) diff --git a/ports/portmidi/CONTROL b/ports/portmidi/CONTROL index f5518c3e14c30c..9f9f60c365d6a3 100644 --- a/ports/portmidi/CONTROL +++ b/ports/portmidi/CONTROL @@ -1,5 +1,5 @@ Source: portmidi -Version: 0.217.1-4 +Version: 0.234 Homepage: https://sourceforge.net/projects/portmedia/ Description: Free, cross-platform, open-source I/O library for MIDI -Supports: !uwp \ No newline at end of file +Supports: windows&!uwp&!arm diff --git a/ports/portmidi/portfile.cmake b/ports/portmidi/portfile.cmake index b78b34fb461ada..a2049278bf6c9e 100644 --- a/ports/portmidi/portfile.cmake +++ b/ports/portmidi/portfile.cmake @@ -1,13 +1,15 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") +vcpkg_fail_port_install(ON_TARGET "linux" "osx" "uwp" ON_ARCH "arm") vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - REPO portmedia/portmidi - REF 217 - FILENAME "portmidi-src-217.zip" - SHA512 d08d4d57429d26d292b5fe6868b7c7a32f2f1d2428f6695cd403a697e2d91629bd4380242ab2720e8f21c895bb75cb56b709fb663a20e8e623120e50bfc5d90b + REPO portmedia + FILENAME "portmedia-code-r234.zip" + SHA512 cbc332d89bc465450b38245a83cc300dfd2e1e6de7c62284edf754ff4d8a9aa3dc49a395dcee535ed9688befb019186fa87fd6d8a3698898c2acbf3e6b7a0794 ) +# Alter path to main portmidi root +set(SOURCE_PATH "${SOURCE_PATH}/portmidi/trunk") + # Mark portmidi-static as static, disable pmjni library depending on the Java SDK file(READ "${SOURCE_PATH}/pm_common/CMakeLists.txt" PM_CMAKE) diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL index 523e449a1e018e..ef83912c6408fc 100644 --- a/ports/proj4/CONTROL +++ b/ports/proj4/CONTROL @@ -1,5 +1,6 @@ Source: proj4 -Version: 6.3.1-1 +Version: 6.3.1 +Port-Version: 2 Homepage: https://github.com/OSGeo/PROJ Description: PROJ.4 library for cartographic projections Build-Depends: sqlite3[core] @@ -7,4 +8,4 @@ Default-Features: database Feature: database Build-Depends: sqlite3[tool] (!uwp&!arm) -Description: generate database \ No newline at end of file +Description: generate database diff --git a/ports/proj4/fix-sqlite-dependency-export.patch b/ports/proj4/fix-sqlite-dependency-export.patch index 774d1acfdd28e0..06ea71c79ba9a3 100644 --- a/ports/proj4/fix-sqlite-dependency-export.patch +++ b/ports/proj4/fix-sqlite-dependency-export.patch @@ -7,7 +7,7 @@ index 2e90f98f..dc171e91 100644 include_directories(${SQLITE3_INCLUDE_DIR}) -target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} PUBLIC ${SQLITE3_LIBRARY}) ++target_link_libraries(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_LIBRARY}) if(MSVC AND BUILD_LIBPROJ_SHARED) target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index be633ef0ce6a00..b669bfd729df40 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( fix-win-output-name.patch fix-sqlite-dependency-export.patch fix-linux-build.patch + use-sqlite3-config.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/proj4/use-sqlite3-config.patch b/ports/proj4/use-sqlite3-config.patch new file mode 100644 index 00000000000000..050a88415eab8a --- /dev/null +++ b/ports/proj4/use-sqlite3-config.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c617912..bed0428 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,23 @@ if(NOT EXE_SQLITE3) + message(SEND_ERROR "sqlite3 binary not found!") + endif() + +-find_package(Sqlite3 REQUIRED) ++#find_package(Sqlite3 REQUIRED) ++find_package(unofficial-sqlite3 CONFIG REQUIRED) ++if(unofficial-sqlite3_FOUND) ++ set(SQLITE3_FOUND true) ++ get_target_property(SQLITE3_INCLUDE_DIR unofficial::sqlite3::sqlite3 INTERFACE_INCLUDE_DIRECTORIES) ++ set(SQLITE3_LIBRARY unofficial::sqlite3::sqlite3) ++ # Extract version information from the header file ++ if(SQLITE3_INCLUDE_DIR) ++ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line ++ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" ++ LIMIT_COUNT 1) ++ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ++ SQLITE3_VERSION "${_ver_line}") ++ unset(_ver_line) ++ endif() ++endif() ++ + if(NOT SQLITE3_FOUND) + message(SEND_ERROR "sqlite3 dependency not found!") + endif() +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 92197c8..ab65de7 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -25,6 +25,10 @@ else () + endif () + + string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) ++set(FIND_DEPENDENCY_SQLITE3 "") ++if(NOT BUILD_LIBPROJ_SHARED) ++ set(FIND_DEPENDENCY_SQLITE3 "find_package(unofficial-sqlite3 CONFIG REQUIRED)") ++endif() + configure_file(project-config.cmake.in project-config.cmake @ONLY) + configure_file(project-config-version.cmake.in + project-config-version.cmake @ONLY) +diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in +index 9a52b3b..295d95d 100644 +--- a/cmake/project-config.cmake.in ++++ b/cmake/project-config.cmake.in +@@ -13,6 +13,8 @@ message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}") + message (STATUS + "@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}") + ++@FIND_DEPENDENCY_SQLITE3@ ++ + # Tell the user project where to find our headers and libraries + get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE) diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 2daa1ecaa17339..ecacb7c28a82ee 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,6 +1,7 @@ Source: protobuf -Version: 3.12.3 -Homepage: https://github.com/google/protobuf +Version: 3.13.0 +Port-Version: 1 +Homepage: https://github.com/protocolbuffers/protobuf Description: Protocol Buffers - Google's data interchange format Feature: zlib diff --git a/ports/protobuf/fix-uwp.patch b/ports/protobuf/fix-uwp.patch index af3795df415f07..44f23579f27842 100644 --- a/ports/protobuf/fix-uwp.patch +++ b/ports/protobuf/fix-uwp.patch @@ -1,8 +1,8 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 849679995..dba537a68 100644 +index 9ca31ac0b..237468c55 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt -@@ -198,6 +198,7 @@ if (MSVC) +@@ -207,6 +207,7 @@ if (MSVC) /wd4506 # no definition for inline function 'function' /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning) /wd4996 # The compiler encountered a deprecated declaration. diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index f8610470ac6b86..ab2578f7473e6a 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/protobuf - REF 31ebe2ac71400344a5db91ffc13c4ddfb7589f92 #v3.12.3 - SHA512 74e623547bb9448ccea29925172bf13fcbffab80eb02f58d248180000b4ae7249f0dee88bb4ef438857b0e1a96a600ab270ebf3b58568da28cbf97d8a2398297 + REF fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a #v3.13.0 + SHA512 b458410311a0905048c86d70ded263ae0cbb6693fd42cba730d3a95c69ca533cf453eb15c5f8bf8b00003ddc63fe96b3c4242907e2d6b00d5bec5d37b2ae1c5e HEAD_REF master PATCHES fix-uwp.patch @@ -12,7 +12,7 @@ vcpkg_from_github( if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(protobuf_BUILD_PROTOC_BINARIES OFF) -elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME) +elseif(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_IS_MINGW AND NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)) set(protobuf_BUILD_PROTOC_BINARIES OFF) else() set(protobuf_BUILD_PROTOC_BINARIES ON) @@ -38,6 +38,11 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS zlib protobuf_WITH_ZLIB ) +if (VCPKG_DOWNLOAD_MODE) + # download PKGCONFIG in download mode which is used in `vcpkg_fixup_pkgconfig()` at the end of this script. + # download it here because `vcpkg_configure_cmake()` halts execution in download mode when running configure process. + vcpkg_find_acquire_program(PKGCONFIG) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/cmake @@ -90,8 +95,7 @@ protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) if(CMAKE_HOST_WIN32) if(protobuf_BUILD_PROTOC_BINARIES) - file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tools(TOOL_NAMES protoc) else() file(COPY ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/${PORT} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() @@ -122,3 +126,15 @@ endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() +set(packages protobuf protobuf-lite) +foreach(_package IN LISTS packages) + set(_file ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_package}.pc) + if(EXISTS "${_file}") + vcpkg_replace_string(${_file} "-l${_package}" "-l${_package}d") + endif() +endforeach() + +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) +endif() +vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL index 2df8d9472f54a7..aecb34d98b36c5 100644 --- a/ports/python3/CONTROL +++ b/ports/python3/CONTROL @@ -1,6 +1,6 @@ Source: python3 Version: 3.8.3 -Port-Version: 1 +Port-Version: 2 Homepage: https://github.com/python/cpython Description: The Python programming language as an embeddable library Build-Depends: libffi, openssl, zlib (!uwp&!windows) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index c680aeb2e049ef..087e59a03c58f2 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -161,17 +161,16 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) ) message(STATUS "Installing ${TARGET_TRIPLET}-rel lib files...") - file(GLOB LIBS + file(GLOB PY_LIBS ${OUT_PATH_RELEASE}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/*) - file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/Lib + file(INSTALL ${PY_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/Lib PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE ) message(STATUS "Installing ${TARGET_TRIPLET}-rel share files...") - file(GLOB LIBS - ${OUT_PATH_RELEASE}/lib/pkgconfig/*) - file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR} + file(GLOB PKGCFG ${OUT_PATH_RELEASE}/lib/pkgconfig/*) + file(INSTALL ${PKGCFG} DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR} PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE ) @@ -179,6 +178,9 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) message(STATUS "Installing ${TARGET_TRIPLET}-rel Python library files...") file(GLOB LIBS ${OUT_PATH_RELEASE}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.*) + if (NOT LIBS) + file(GLOB LIBS ${OUT_PATH_RELEASE}/lib64/*) + endif() file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE @@ -233,6 +235,10 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) message(STATUS "Installing ${TARGET_TRIPLET}-dbg Python library files...") file(GLOB LIBS ${OUT_PATH_DEBUG}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}d.*) + if (NOT LIBS) + file(GLOB LIBS + ${OUT_PATH_DEBUG}/lib64/*) + endif() file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 4788f4b3852d6c..28247c42d506bc 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,8 +1,9 @@ Source: qt5-base Version: 5.15.0 +Port-Version: 2 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. -Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) +Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) Feature: latest Description: Build latest qt version (5.15.0) instead of LTS (latest and LTS are currently the same) diff --git a/ports/qt5-base/cmake/install_qt.cmake b/ports/qt5-base/cmake/install_qt.cmake index a188138f499c7b..97f2e71a20e920 100644 --- a/ports/qt5-base/cmake/install_qt.cmake +++ b/ports/qt5-base/cmake/install_qt.cmake @@ -4,6 +4,7 @@ function(install_qt) if(CMAKE_HOST_WIN32) vcpkg_find_acquire_program(JOM) set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY}) + set(INVOKE_SINGLE "${JOM}" /J 1) else() find_program(MAKE make) set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY}) @@ -62,8 +63,9 @@ function(install_qt) endif() message(STATUS "Building ${_build_triplet}") - vcpkg_execute_required_process( + vcpkg_execute_build_process( COMMAND ${INVOKE} + NO_PARALLEL_COMMAND ${INVOKE_SINGLE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet} LOGNAME build-${_build_triplet} ) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index f989926730ef66..1044df3174644f 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -130,6 +130,13 @@ find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux) find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_RELEASE NAMES brotlienc brotlienc-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_DEBUG NAMES brotlienc brotlienc-static brotliencd brotlienc-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(ICUTU_RELEASE NAMES icutu libicutu PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) @@ -166,8 +173,8 @@ find_library(SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DI find_library(EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}") -set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}") +set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_ENC_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}") +set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_ENC_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_RELEASE}") # If HarfBuzz is built with GLib enabled, it must be statically link set(GLIB_LIB_VERSION 2.0) @@ -186,7 +193,7 @@ set(RELEASE_OPTIONS "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}" "ICU_LIBS=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" ) set(DEBUG_OPTIONS "LIBJPEG_LIBS=${JPEG_DEBUG}" @@ -261,7 +268,7 @@ elseif(VCPKG_TARGET_IS_OSX) set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) message(STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}") FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) - string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) + string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) endif() #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) diff --git a/ports/qt5-connectivity/CONTROL b/ports/qt5-connectivity/CONTROL index 7ffc9959c974c0..aefaea84647020 100644 --- a/ports/qt5-connectivity/CONTROL +++ b/ports/qt5-connectivity/CONTROL @@ -1,4 +1,5 @@ Source: qt5-connectivity Version: 5.15.0 +Port-Version: 1 Description: Qt5 Connectivity module - Provides access to Bluetooth and NFC hardware Build-Depends: qt5-base[core] diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL index 277ba3c0ca29db..6cc1b86eadd211 100644 --- a/ports/qt5-imageformats/CONTROL +++ b/ports/qt5-imageformats/CONTROL @@ -1,4 +1,5 @@ Source: qt5-imageformats Version: 5.15.0 +Port-Version: 1 Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP Build-Depends: qt5-base[core], tiff, libwebp, jasper diff --git a/ports/qt5-location/CONTROL b/ports/qt5-location/CONTROL index ecc878edf71715..c0e66e5ac1ec53 100644 --- a/ports/qt5-location/CONTROL +++ b/ports/qt5-location/CONTROL @@ -1,4 +1,5 @@ Source: qt5-location Version: 5.15.0 +Port-Version: 1 Description: Qt5 Location Module - Displays map, navigation, and place content in a QML application. Build-Depends: qt5-base[core], qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport diff --git a/ports/qt5-webengine/CONTROL b/ports/qt5-webengine/CONTROL index 8dc1dc5a953bd1..a157652411afcc 100644 --- a/ports/qt5-webengine/CONTROL +++ b/ports/qt5-webengine/CONTROL @@ -1,5 +1,6 @@ Source: qt5-webengine Version: 5.15.0 +Port-Version: 1 Description: Qt5 webengine Module; Build-Depends: qt5-base[core], qt5-declarative, qt5-location, qt5-quickcontrols, qt5-quickcontrols2, qt5-tools, qt5-webchannel, atlmfc (windows), ffmpeg[core] (!windows) Supports: !static diff --git a/ports/qt5-webengine/portfile.cmake b/ports/qt5-webengine/portfile.cmake index 9da6797ca90ba1..611a3c7c035ddb 100644 --- a/ports/qt5-webengine/portfile.cmake +++ b/ports/qt5-webengine/portfile.cmake @@ -10,8 +10,6 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) endif() include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) - - vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) vcpkg_find_acquire_program(GPERF) @@ -38,7 +36,10 @@ vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") vcpkg_add_to_path(PREPEND "${GPERF_DIR}") vcpkg_add_to_path(PREPEND "${NINJA_DIR}") -set(PATCHES common.pri.patch gl.patch build.patch) +set(PATCHES common.pri.patch + gl.patch + build.patch + vs2017.patch) if(NOT VCPKG_TARGET_IS_WINDOWS) list(APPEND CORE_OPTIONS "BUILD_OPTIONS" "-webengine-system-libwebp" "-webengine-system-ffmpeg" "-webengine-system-icu") diff --git a/ports/qt5-webengine/vs2017.patch b/ports/qt5-webengine/vs2017.patch new file mode 100644 index 00000000000000..07eb79e16fb6bd --- /dev/null +++ b/ports/qt5-webengine/vs2017.patch @@ -0,0 +1,12 @@ +diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc +index 33d5cb1f6f6..1ba53aee4b3 100644 +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc +@@ -26,6 +26,7 @@ + #include "src/trace_processor/slice_tracker.h" + #include "src/trace_processor/track_tracker.h" + ++#include + #include + #include + #include diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 0f5121a287f50d..928cc3672c6729 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,9 +1,10 @@ Source: qt5 Version: 5.15.0 +Port-Version: 2 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Build-Depends: qt5-base[core] -Default-Features: essentials, default +Default-Features: essentials Feature: essentials Build-Depends: qt5[core, tools, networkauth, quickcontrols2, multimedia, imageformats, declarative, svg, activeqt] @@ -13,29 +14,25 @@ Feature: latest Build-Depends: qt5-base[core, latest] Description: Build latest qt version (5.14.2) instead of LTS -Feature: default -Build-Depends: qt5[core, 3d, webchannel, websockets, extras, sensors, serialport, speech, virtualkeyboard, purchasing, scxml, charts, datavis3d, gamepad, graphicaleffects, location, webglplugin, webview, translations, remoteobjects, connectivity] -Description: Build the essential qt modules - Feature: all Build-Depends: qt5[3d, webchannel, websockets, extras, xmlpatterns, sensors, serialport, speech, svg, tools, virtualkeyboard, networkauth, purchasing, quickcontrols, quickcontrols2, script, scxml, activeqt, charts, datavis3d, declarative, gamepad, graphicaleffects, imageformats, location, multimedia, mqtt, webglplugin, webview, serialbus, translations, doc, remoteobjects, connectivity], qt5[core,webengine] (!static), qt5[core,wayland] (!windows) Description: Install all Qt5 submodules (Warning: Could take a long time and fail...) Feature: extras Build-Depends: qt5-winextras (windows), qt5-macextras (osx), qt5-x11extras (linux), qt5-androidextras (android) -Description: +Description: Feature: 3d Build-Depends: qt5-3d -Description: +Description: Feature: webchannel Build-Depends: qt5-webchannel -Description: +Description: Feature: websockets Build-Depends: qt5-websockets -Description: +Description: Feature: xmlpatterns Build-Depends: qt5-xmlpatterns @@ -43,35 +40,35 @@ Description: (deprecated) Feature: sensors Build-Depends: qt5-sensors -Description: +Description: Feature: serialport Build-Depends: qt5-serialport -Description: +Description: Feature: speech Build-Depends: qt5-speech -Description: +Description: Feature: svg Build-Depends: qt5-svg -Description: +Description: Feature: tools Build-Depends: qt5-tools -Description: +Description: Feature: virtualkeyboard Build-Depends: qt5-virtualkeyboard -Description: +Description: Feature: networkauth Build-Depends: qt5-networkauth -Description: +Description: Feature: purchasing Build-Depends: qt5-purchasing -Description: +Description: Feature: quickcontrols Build-Depends: qt5-quickcontrols @@ -79,7 +76,7 @@ Description: (deprecated) Feature: quickcontrols2 Build-Depends: qt5-quickcontrols2 -Description: +Description: Feature: script Build-Depends: qt5-script @@ -87,7 +84,7 @@ Description: (deprecated) Feature: scxml Build-Depends: qt5-scxml -Description: +Description: Feature: activeqt Build-Depends: qt5-activeqt (windows) @@ -95,76 +92,72 @@ Description: Windows Only Feature: charts Build-Depends: qt5-charts -Description: +Description: Feature: datavis3d Build-Depends: qt5-datavis3d -Description: +Description: Feature: declarative Build-Depends: qt5-declarative -Description: +Description: Feature: gamepad Build-Depends: qt5-gamepad -Description: +Description: Feature: graphicaleffects Build-Depends: qt5-graphicaleffects -Description: - -Feature: declarative -Build-Depends: qt5-declarative -Description: +Description: Feature: imageformats Build-Depends: qt5-imageformats -Description: +Description: Feature: location Build-Depends: qt5-location -Description: +Description: Feature: multimedia Build-Depends: qt5-multimedia -Description: +Description: Feature: mqtt Build-Depends: qt5-mqtt -Description: +Description: Feature: webglplugin Build-Depends: qt5-webglplugin -Description: +Description: Feature: webview Build-Depends: qt5-webview -Description: +Description: Feature: wayland Build-Depends: qt5-wayland -Description: +Description: Feature: webengine Build-Depends: qt5-webengine -Description: +Description: Feature: serialbus Build-Depends: qt5-serialbus -Description: +Description: Feature: translations Build-Depends: qt5-translations -Description: +Description: Feature: doc Build-Depends: qt5-doc -Description: +Description: Feature: remoteobjects Build-Depends: qt5-remoteobjects -Description: +Description: Feature: connectivity Build-Depends: qt5-connectivity -Description: +Description: diff --git a/ports/quazip/CONTROL b/ports/quazip/CONTROL new file mode 100644 index 00000000000000..853be24c058248 --- /dev/null +++ b/ports/quazip/CONTROL @@ -0,0 +1,5 @@ +Source: quazip +Version: 0.9.1 +Homepage: https://stachenov.github.io/quazip/ +Description: Qt/C++ wrapper over minizip +Build-Depends: qt5-base, zlib diff --git a/ports/quazip/portfile.cmake b/ports/quazip/portfile.cmake new file mode 100644 index 00000000000000..4c8602b69234a2 --- /dev/null +++ b/ports/quazip/portfile.cmake @@ -0,0 +1,20 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO stachenov/quazip + REF v0.9.1 + SHA512 db31f3c7e3d7e95c25090ceb8379643e0b49ed69ece009dd015bee120b2b60f42e73408f580caed3138fa19ca64dcd23a05f16435abb54e2b8df21105c7b42c0 + PATCHES + vcpkg_remove_extra_static.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/QuaZip5/) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright) \ No newline at end of file diff --git a/ports/quazip/vcpkg_remove_extra_static.patch b/ports/quazip/vcpkg_remove_extra_static.patch new file mode 100644 index 00000000000000..e600424751c1d1 --- /dev/null +++ b/ports/quazip/vcpkg_remove_extra_static.patch @@ -0,0 +1,30 @@ +diff --git a/quazip/CMakeLists.txt b/quazip/CMakeLists.txt +index 1efb5e2..2412b8a 100644 +--- a/quazip/CMakeLists.txt ++++ b/quazip/CMakeLists.txt +@@ -10,22 +10,13 @@ ADD_DEFINITIONS(-DQUAZIP_BUILD) + qt_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS}) + set(SRCS ${SRCS} ${MOC_SRCS}) + +-add_library(${QUAZIP_LIB_TARGET_NAME} SHARED ${SRCS}) +-add_library(quazip_static STATIC ${SRCS}) +- +-# Windows uses .lib extension for both static and shared library +-# *nix systems use different extensions for SHARED and STATIC library and by convention both libraries have the same name +-if (NOT WIN32) +- set_target_properties(quazip_static PROPERTIES OUTPUT_NAME quazip${QUAZIP_LIB_VERSION_SUFFIX}) +-endif () ++add_library(${QUAZIP_LIB_TARGET_NAME} ${SRCS}) + + target_include_directories(${QUAZIP_LIB_TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) +-target_include_directories(quazip_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) +-set_target_properties(${QUAZIP_LIB_TARGET_NAME} quazip_static PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) ++set_target_properties(${QUAZIP_LIB_TARGET_NAME} PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) + + # Link against ZLIB_LIBRARIES if needed (on Windows this variable is empty) + target_link_libraries(${QUAZIP_LIB_TARGET_NAME} ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) +-target_link_libraries(quazip_static ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) + + install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip${QUAZIP_LIB_VERSION_SUFFIX}) +-install(TARGETS ${QUAZIP_LIB_TARGET_NAME} quazip_static LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION}) ++install(TARGETS ${QUAZIP_LIB_TARGET_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ports/quill/CONTROL b/ports/quill/CONTROL index c69e4ffab6da44..fc1938e3163d58 100644 --- a/ports/quill/CONTROL +++ b/ports/quill/CONTROL @@ -1,5 +1,5 @@ Source: quill -Version: 1.3.1 +Version: 1.4.0 Homepage: https://github.com/odygrd/quill/ Description: C++14 Asynchronous Low Latency Logging Library Supports: !(arm|arm64|uwp|android) diff --git a/ports/quill/portfile.cmake b/ports/quill/portfile.cmake index 9f35ddc2b28681..d9dc6aee8fb918 100644 --- a/ports/quill/portfile.cmake +++ b/ports/quill/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO odygrd/quill - REF 3d72126ab749277267c45da80b65ee76aaafff6d #v1.3.1 - SHA512 06ca205d291cb5161bc956b472c00e791d8ff9bd512ac4b9d3592e0f5af19aac425836d77131d0294ceea83aaec386dbdb86179cf93fbb0c3972e5547c216287 + REF 914a76122f4f1d781fbb09a1b1d8558c794c055a # v1.4.0 + SHA512 088824356c134292d9d698afcd6b8bdc6774af32e5b68217a49f13e966098eceaaa69f9a3ab6d01869f1c5ad483daedd5859496efe3d0e07f51af7e64861695c HEAD_REF master ) diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 4a2407b343b8a7..8353f4670f4306 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,5 +1,6 @@ Source: qwt Version: 6.1.4 +Port-Version: 1 Homepage: https://sourceforge.net/projects/qwt Description: Qt widgets library for technical applications Build-Depends: qt5-base[core], qt5-svg, qt5-tools diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index bbf03abc1482aa..795fe53b0bb408 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -31,4 +31,4 @@ file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qwtw/CONTROL b/ports/qwtw/CONTROL new file mode 100644 index 00000000000000..6b60796cbef817 --- /dev/null +++ b/ports/qwtw/CONTROL @@ -0,0 +1,6 @@ +Source: qwtw +Version: 3.1.0 +Homepage: https://github.com/ig-or/qwtw +Description: qwt-based 2D plotting library +Supports: windows & x64 & !static +Build-Depends: qt5-base, qt5-svg, qt5-networkauth, qwt, marble, boost-system, boost-filesystem, boost-date-time, boost-chrono, boost-regex, boost-thread, boost-circular-buffer, boost-asio diff --git a/ports/qwtw/portfile.cmake b/ports/qwtw/portfile.cmake new file mode 100644 index 00000000000000..27dd91786110de --- /dev/null +++ b/ports/qwtw/portfile.cmake @@ -0,0 +1,18 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ig-or/qwtw + REF 7d6e7c95437cbc7d5d123fc1ccf0d6a3c4e419e6 # v3.1.0 + SHA512 de5abf26d0975b9f0ed88e10cd4d5b4d12e25cce8c87ab6a18d8e7064697de6fc8da83e118b5a4e2819c09e2dbbfd20daeecc6a42748c019c6699666276d075a + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rapidcheck/CONTROL b/ports/rapidcheck/CONTROL index 9c3e4c7b505db5..5f46ed702b842c 100644 --- a/ports/rapidcheck/CONTROL +++ b/ports/rapidcheck/CONTROL @@ -1,4 +1,4 @@ Source: rapidcheck -Version: 2018-11-05-2 +Version: 2020-08-25 Homepage: https://github.com/emil-e/rapidcheck Description: A property-based testing library for C++ (a la QuickCheck) with the goal of being simple to use with as little boilerplate as possible. diff --git a/ports/rapidcheck/fix-addiosfwd.patch b/ports/rapidcheck/fix-addiosfwd.patch deleted file mode 100644 index 016f859c2384a4..00000000000000 --- a/ports/rapidcheck/fix-addiosfwd.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/rapidcheck/Random.h b/include/rapidcheck/Random.h -index e510673..4b01f58 100644 ---- a/include/rapidcheck/Random.h -+++ b/include/rapidcheck/Random.h -@@ -3,6 +3,7 @@ - #include - #include - #include -+#include - - namespace rc { - diff --git a/ports/rapidcheck/portfile.cmake b/ports/rapidcheck/portfile.cmake index 892942d32058e7..544319ce50f752 100644 --- a/ports/rapidcheck/portfile.cmake +++ b/ports/rapidcheck/portfile.cmake @@ -3,10 +3,9 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO emil-e/rapidcheck - REF cf9e0d8bd8c94e9dc00dc0ab302352bfaf1a3ac5 - SHA512 6cef62edbda391c3527d63db350842f669841ad2c751a64773250cd40bb65f26c2c394b107ef5530c2d3bd15b7079148fa9778d68a7346225bbb15227b1553c5 + REF 7bc7d302191a4f3d0bf005692677126136e02f60 + SHA512 8631f1034a0a24293d61a91cbb8f8b69c70acde02d60377d0a68d045e4d57acb878aafbea76907574c0cc6cdac3a16d207d310b49d7c48ee7edbede3236ed15b HEAD_REF master - PATCHES fix-addiosfwd.patch ) vcpkg_configure_cmake( diff --git a/ports/rappture/CMakeLists.txt b/ports/rappture/CMakeLists.txt new file mode 100644 index 00000000000000..57d7739258e359 --- /dev/null +++ b/ports/rappture/CMakeLists.txt @@ -0,0 +1,110 @@ +cmake_minimum_required(VERSION 3.11) +cmake_policy(VERSION 3.11) + +project (rappture) + +set(SRC_RAPPTURE_CORE + src/core/scew_extras.c + src/core/RpBindingsDict.cc + src/core/RpBuffer.cc + src/core/RpBufferCInterface.cc + src/core/RpDXWriter.cc + src/core/RpDXWriterFInterface.cc + src/core/RpEncode.cc + src/core/RpEntityRef.cc + src/core/RpFortranCommon.cc + src/core/RpLibrary.cc + src/core/RpLibraryCInterface.cc + src/core/RpLibraryFInterface.cc + src/core/RpOutcome.cc + src/core/RpOutcomeCInterface.cc + src/core/RpPtr.cc + src/core/RpResult.cc + src/core/RpUnits.cc + src/core/RpUnitsCInterface.cc + src/core/RpUnitsFInterface.cc + src/core/RpUnitsStd.cc + src/core/RpUtils.cc + src/core/RpUtilsCInterface.cc + src/core/RpUtilsFInterface.cc + src/core/b64/cdecode.c + src/core/b64/cencode.c + src/core/scew/attribute.c + src/core/scew/element.c + src/core/scew/error.c + src/core/scew/parser.c + src/core/scew/str.c + src/core/scew/tree.c + src/core/scew/writer.c + src/core/scew/xattribute.c + src/core/scew/xerror.c + src/core/scew/xhandler.c + src/core/scew/xparser.c + src/core/scew/xprint.c +) + +set(HEADERS + src/core/rappture.h + src/core/RpBindingsDict.h + src/core/RpBuffer.h + src/core/RpBufferCHelper.h + src/core/RpBufferCInterface.h + src/core/RpDict.h + src/core/RpDXWriter.h + src/core/RpDXWriterFInterface.h + src/core/RpDXWriterFStubs.h + src/core/RpEncode.h + src/core/RpEntityRef.h + src/core/RpFortranCommon.h + src/core/RpLibrary.h + src/core/RpLibraryCInterface.h + src/core/RpLibraryFInterface.h + src/core/RpLibraryFStubs.h + src/core/RpOutcome.h + src/core/RpOutcomeCHelper.h + src/core/RpOutcomeCInterface.h + src/core/RpPtr.h + src/core/RpSimpleBuffer.h + src/core/RpUnits.h + src/core/RpUnitsCInterface.h + src/core/RpUnitsFInterface.h + src/core/RpUnitsFStubs.h + src/core/RpUnitsStd.h + src/core/RpUtils.h + src/core/RpUtilsCInterface.h + src/core/RpUtilsFInterface.h + src/core/RpUtilsFStubs.h + src/core/scew_extras.h + +) + +add_library(rappture ${SRC_RAPPTURE_CORE} ${HEADERS}) + +target_include_directories(rappture PUBLIC + $ + $ +) + +find_package(expat CONFIG REQUIRED) +find_package(ZLIB REQUIRED) + +target_compile_definitions(rappture PUBLIC + -D_CRT_SECURE_NO_WARNINGS + -DRAPPTURE_VERSION=1.9 + -DSVN_VERSION=6713 + -D_USE_MATH_DEFINES +) + +target_link_libraries(rappture PRIVATE + expat::expat + ZLIB::ZLIB +) + +install(TARGETS rappture EXPORT rappture-config + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + ) + +install(FILES ${HEADERS} DESTINATION include/rappture) +install(EXPORT rappture-config NAMESPACE unofficial::rappture:: DESTINATION share/rappture) diff --git a/ports/rappture/CONTROL b/ports/rappture/CONTROL new file mode 100644 index 00000000000000..611bda78a82f59 --- /dev/null +++ b/ports/rappture/CONTROL @@ -0,0 +1,4 @@ +Source: rappture +Version: 1.9 +Description: Rappture is a toolkit supporting Rapid application infrastructure, making it quick and easy to develop powerful scientific applications. +Build-Depends: expat, zlib diff --git a/ports/rappture/portfile.cmake b/ports/rappture/portfile.cmake new file mode 100644 index 00000000000000..00bde7d3a97121 --- /dev/null +++ b/ports/rappture/portfile.cmake @@ -0,0 +1,36 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_download_distfile(ARCHIVE + URLS "https://nanohub.org/app/site/downloads/rappture/rappture-src-20130903.tar.gz" + FILENAME "rappture-src-20130903.tar.gz" + SHA512 3b42569d056c5e80762eada3aff23d230d4ba8f6f0078de44d8571a713dde91e31e66fe3c37ceb66e934a1410b338fb481aeb5a29ef56b53da4ad2e8a2a2ae59 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/rappture.patch" +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file( + INSTALL ${SOURCE_PATH}/license.terms + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) diff --git a/ports/rappture/rappture.patch b/ports/rappture/rappture.patch new file mode 100644 index 00000000000000..d8c7ff6c8ca548 --- /dev/null +++ b/ports/rappture/rappture.patch @@ -0,0 +1,89 @@ +diff --git a/src/core/RpBuffer.cc b/src/core/RpBuffer.cc +index 6d439fe..ec45405 100644 +--- a/src/core/RpBuffer.cc ++++ b/src/core/RpBuffer.cc +@@ -16,7 +16,6 @@ + #include + #include + #include +-#include + #include + #include + #include "b64/encode.h" +@@ -24,6 +23,11 @@ + #include "RpBuffer.h" + #include "RpEncode.h" + ++#if defined(_MSC_VER) ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + namespace Rappture { + + /** +@@ -109,6 +113,9 @@ Buffer::operator+=(const Buffer& b) + Buffer::~Buffer() + {} + ++#ifndef _WIN32 ++# define _fileno fileno ++#endif + + bool + Buffer::load (Outcome &status, const char *path) +@@ -123,7 +130,7 @@ Buffer::load (Outcome &status, const char *path) + } + + struct stat stat; +- if (fstat(fileno(f), &stat) < 0) { ++ if (fstat(_fileno(f), &stat) < 0) { + status.addError("can't stat \"%s\": %s", path, strerror(errno)); + return false; + } +diff --git a/src/core/RpDXWriter.cc b/src/core/RpDXWriter.cc +index e4748b3..8990c0f 100644 +--- a/src/core/RpDXWriter.cc ++++ b/src/core/RpDXWriter.cc +@@ -18,6 +18,12 @@ + #include + #include + #include ++ ++#if defined(_MSC_VER) ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + using namespace Rappture; + + DXWriter::DXWriter() : +diff --git a/src/core/RpLibrary.cc b/src/core/RpLibrary.cc +index 2b9a540..4da787b 100644 +--- a/src/core/RpLibrary.cc ++++ b/src/core/RpLibrary.cc +@@ -11,7 +11,6 @@ + * ====================================================================== + */ + +-#include "config.h" + #include "scew/scew.h" + #include "scew_extras.h" + #include "RpLibrary.h" +diff --git a/src/core/scew/scew.h b/src/core/scew/scew.h +index 9741ed5..e335c2d 100644 +--- a/src/core/scew/scew.h ++++ b/src/core/scew/scew.h +@@ -61,12 +61,6 @@ + # define SCEW_LIB_D + # endif /* _DEBUG */ + +-# if defined(SCEW_LIB_U) || defined(SCEW_LIB_S) || defined(SCEW_LIB_D) +-# pragma comment( lib, "scew_" SCEW_LIB_U SCEW_LIB_S SCEW_LIB_D ".lib" ) +-# else +-# pragma comment( lib, "scew.lib" ) +-# endif +- + #endif /* _WIN32 */ + + #endif /* SCEW_H_ALEIX0211250134 */ diff --git a/ports/raylib/CONTROL b/ports/raylib/CONTROL index 382de52f3fcee3..7308a4e43f8a95 100644 --- a/ports/raylib/CONTROL +++ b/ports/raylib/CONTROL @@ -1,9 +1,13 @@ Source: raylib Version: 3.0.0 -Port-Version: 1 +Port-Version: 3 Description: A simple and easy-to-use library to enjoy videogames programming Homepage: https://github.com/raysan5/raylib Supports: !(arm|uwp) +Default-Features: use-audio -Feature: non-audio -Description: Build raylib without audio module +Feature: hidpi +Description: Support high-DPI displays + +Feature: use-audio +Description: Build raylib with audio module diff --git a/ports/raylib/portfile.cmake b/ports/raylib/portfile.cmake index f39d61d1cf6cab..ba63fff8484560 100644 --- a/ports/raylib/portfile.cmake +++ b/ports/raylib/portfile.cmake @@ -25,8 +25,9 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - non-audio USE_AUDIO + FEATURES + hidpi SUPPORT_HIGH_DPI + use-audio USE_AUDIO ) vcpkg_configure_cmake( @@ -37,8 +38,8 @@ vcpkg_configure_cmake( -DBUILD_GAMES=OFF -DSHARED=${SHARED} -DSTATIC=${STATIC} - -DUSE_AUDIO=${USE_AUDIO} -DUSE_EXTERNAL_GLFW=OFF # externl glfw3 causes build errors on Windows + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DENABLE_ASAN=ON -DENABLE_UBSAN=ON @@ -55,12 +56,6 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -configure_file( - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake - @ONLY -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share @@ -74,8 +69,5 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() -# Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/raylib/usage b/ports/raylib/usage index 936b74f502a845..94ce10978f78d5 100644 --- a/ports/raylib/usage +++ b/ports/raylib/usage @@ -1,5 +1,5 @@ The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: find_package(@PORT@ CONFIG REQUIRED) - target_include_directories(main PRIVATE ${raylib_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${raylib_LIBRARIES}) + target_include_directories(main PRIVATE ${RAYLIB_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${RAYLIB_LIBRARIES}) diff --git a/ports/raylib/vcpkg-cmake-wrapper.cmake b/ports/raylib/vcpkg-cmake-wrapper.cmake index 81e9989ec0d357..34484ea6fe3e41 100644 --- a/ports/raylib/vcpkg-cmake-wrapper.cmake +++ b/ports/raylib/vcpkg-cmake-wrapper.cmake @@ -1,14 +1,11 @@ -set(raylib_USE_STATIC_LIBS @STATIC@) +include(SelectLibraryConfigurations) -_find_package(${ARGS}) +find_path(RAYLIB_INCLUDE_DIR raylib.h) -if(raylib_FOUND) - get_filename_component(_raylib_lib_name ${raylib_LIBRARY} NAME) +find_library(RAYLIB_LIBRARY_DEBUG NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(RAYLIB_LIBRARY_RELEASE NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) - set(raylib_LIBRARY - debug ${CURRENT_INSTALLED_DIR}/debug/lib/${_raylib_lib_name} - optimized ${CURRENT_INSTALLED_DIR}/lib/${_raylib_lib_name} - ) +select_library_configurations(RAYLIB) - set(raylib_LIBRARIES ${raylib_LIBRARY}) -endif() +set(RAYLIB_INCLUDE_DIRS ${RAYLIB_INCLUDE_DIR}) +set(RAYLIB_LIBRARIES ${RAYLIB_LIBRARY}) diff --git a/ports/re2/CONTROL b/ports/re2/CONTROL index 5b4231eaec753a..39deaf459b85bd 100644 --- a/ports/re2/CONTROL +++ b/ports/re2/CONTROL @@ -1,4 +1,4 @@ Source: re2 -Version: 2020-01-01 +Version: 2020-06-01 Homepage: https://github.com/google/re2 Description: RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library. diff --git a/ports/re2/portfile.cmake b/ports/re2/portfile.cmake index 1963a6e6da0337..fac44a194edca4 100644 --- a/ports/re2/portfile.cmake +++ b/ports/re2/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/re2 - REF 2020-01-01 - SHA512 ca9c5e3b63b55074ad1d74b73bcf115ae285b3b8989bb56de0bccdfd7b423df742cfd1d1b6eb963da6dc550b81f492eaef9a9c582e354906b8dd1b92fb451ed0 + REF 2020-06-01 + SHA512 8592a5409cb087c3188023746a4121bd58972a7a21bae98022af587f6191b3096bbb5d379e622ea853ff3373c76972fb61f331354550715c9a7e77d08fba6f3c HEAD_REF master ) diff --git a/ports/readosm/CONTROL b/ports/readosm/CONTROL index 104ef3b5ce9645..7a2d817ff7f5d9 100644 --- a/ports/readosm/CONTROL +++ b/ports/readosm/CONTROL @@ -1,5 +1,7 @@ Source: readosm -Version: 1.1.0-2 +Version: 1.1.0 +Port-Version: 3 Homepage: https://www.gaia-gis.it/gaia-sins/readosm-sources Description: ReadOSM is an open source library to extract valid data from within an Open Street Map input file (.osm or .osm.pbf) Build-Depends: expat, zlib +Supports: !(linux|osx|uwp) diff --git a/ports/readosm/portfile.cmake b/ports/readosm/portfile.cmake index 8059a6ffabd7aa..522e6fdf53b99d 100644 --- a/ports/readosm/portfile.cmake +++ b/ports/readosm/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP") vcpkg_download_distfile(ARCHIVE URLS "http://www.gaia-gis.it/gaia-sins/readosm-sources/readosm-1.1.0.tar.gz" @@ -16,13 +16,14 @@ vcpkg_extract_source_archive_ex( find_program(NMAKE nmake) -set(LIBS_ALL_DBG "\"${CURRENT_INSTALLED_DIR}/debug/lib/expat.lib\" \"${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib\"") -set(LIBS_ALL_REL "\"${CURRENT_INSTALLED_DIR}/lib/expat.lib\" \"${CURRENT_INSTALLED_DIR}/lib/zlib.lib\"") - if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(LIBS_ALL_DBG "\"${CURRENT_INSTALLED_DIR}/debug/lib/libexpatd.lib\" \"${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib\"") + set(LIBS_ALL_REL "\"${CURRENT_INSTALLED_DIR}/lib/libexpat.lib\" \"${CURRENT_INSTALLED_DIR}/lib/zlib.lib\"") set(CL_FLAGS_DBG "/MDd /Zi") set(CL_FLAGS_REL "/MD /Ox") else() + set(LIBS_ALL_DBG "\"${CURRENT_INSTALLED_DIR}/debug/lib/libexpatdMD.lib\" \"${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib\"") + set(LIBS_ALL_REL "\"${CURRENT_INSTALLED_DIR}/lib/libexpatMD.lib\" \"${CURRENT_INSTALLED_DIR}/lib/zlib.lib\"") set(CL_FLAGS_DBG "/MTd /Zi") set(CL_FLAGS_REL "/MT /Ox") endif() @@ -64,7 +65,6 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/readosm RENAME copyright) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) @@ -82,5 +82,7 @@ else() endif() endif() - message(STATUS "Packaging ${TARGET_TRIPLET} done") + +#Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index 7304016c6032c1..bd0e05a76b342f 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -1,7 +1,8 @@ Source: realsense2 -Version: 2.34.0 +Version: 2.38.1 Homepage: https://github.com/IntelRealSense/librealsense Description: Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300). +Build-Depends: libusb(linux) Feature: tools Build-Depends: opengl, glfw3 diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index 2db0f278ad638c..2a64e8ea34a6cd 100644 --- a/ports/realsense2/portfile.cmake +++ b/ports/realsense2/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO IntelRealSense/librealsense - REF 025fccf76803ee6a6e60de9f18ac6193b7ff8597 #v2.34.0 - SHA512 c502fba6b3dbb34b0ac0094deef9ffce330faf435bbc7612148fd8ba3d5b380f7990604a67236e7da815c8e6988ae58c17fa597571a2462f75c8f5000007cc0a + REF 0adceb9dc6fce63c348346e1aef1b63c052a1db9 #v2.38.1 + SHA512 bbbbf1afd4227d7cd46cb47c5cd71bc430c439ee1d8a54b3d1732017e2d34d9d696ced12c4d2449ce153b3deed422f6b3d2f561b44ca373ec9c69d5d3a766090 HEAD_REF master PATCHES fix_openni2.patch diff --git a/ports/redis-plus-plus/CONTROL b/ports/redis-plus-plus/CONTROL index 7e5d3e1964dbd9..77a355f405bc52 100644 --- a/ports/redis-plus-plus/CONTROL +++ b/ports/redis-plus-plus/CONTROL @@ -1,5 +1,5 @@ Source: redis-plus-plus -Version: 1.1.1 +Version: 1.1.2 Homepage: https://github.com/sewenew/redis-plus-plus Description: This is a C++ client for Redis. It's based on hiredis, and written in C++ 11. Build-Depends: hiredis \ No newline at end of file diff --git a/ports/redis-plus-plus/disable-build-test.patch b/ports/redis-plus-plus/disable-build-test.patch deleted file mode 100644 index a180250e1abfe9..00000000000000 --- a/ports/redis-plus-plus/disable-build-test.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fb160b5..6235d89 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -34,7 +34,7 @@ set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) - set_target_properties(${STATIC_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(${SHARED_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1) - --add_subdirectory(test) -+#add_subdirectory(test) - - # Install static lib. - install(TARGETS ${STATIC_LIB} diff --git a/ports/redis-plus-plus/portfile.cmake b/ports/redis-plus-plus/portfile.cmake index 8eba51a38dc7dc..5878671e4d60aa 100644 --- a/ports/redis-plus-plus/portfile.cmake +++ b/ports/redis-plus-plus/portfile.cmake @@ -1,17 +1,19 @@ +#Blocked by ninja: error: build.ninja:348: multiple rules generate lib/redis++.lib [-w dupbuild=err] vcpkg_fail_port_install(ON_TARGET "Windows") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO sewenew/redis-plus-plus - REF d35267580568517f09bdf70cb582e5284c25401a - SHA512 f065b97d438772300e30485a7550bc0fff00005f1056cf9c23216ea388fa088303869ccf2eaa70ee8b06cc0fc2406c9c6faddd5ad08759ee2d0665ac91761914 + REF b08b36a9a91de00636e583307610f49af7876f50 # 1.1.2 + SHA512 6dcead9fca9e7082ace28dcd72a1b325e229297080eea3e5a28ef5e6b9e4a7d1bcb3568997a5e7a031d7937a025a017ed92d7869db5829ba6113783c84bc5a68 HEAD_REF master - PATCHES disable-build-test.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJIA + PREFER_NINJA + OPTIONS + -DREDIS_PLUS_PLUS_BUILD_TEST=OFF ) vcpkg_install_cmake() diff --git a/ports/rest-rpc/CONTROL b/ports/rest-rpc/CONTROL new file mode 100644 index 00000000000000..ed7023bb4ae4af --- /dev/null +++ b/ports/rest-rpc/CONTROL @@ -0,0 +1,6 @@ +Source: rest-rpc +Version: 0.07 +Port-Version: 1 +Homepage: https://github.com/qicosmos/rest_rpc +Description: c++11, high performance, cross platform, easy to use rpc framework +Build-Depends: asio diff --git a/ports/rest-rpc/portfile.cmake b/ports/rest-rpc/portfile.cmake new file mode 100644 index 00000000000000..551ff14288eefe --- /dev/null +++ b/ports/rest-rpc/portfile.cmake @@ -0,0 +1,28 @@ +if (EXISTS ${CURRENT_INSTALLED_DIR}/include/msgpack/pack.h) + message(FATAL_ERROR "Cannot install ${PORT} when msgpack is already installed, please remove msgpack using \"./vcpkg remove msgpack:${TARGET_TRIPLET}\"") +endif() + +# header-only library +set(RESTRPC_VERSION V0.07) +set(RESTRPC_HASH 148152776c8c4f16e404c62ab3f46618e1817c0b4b186dbcc399c859efd110ed5a207bf56e961c312f80844f696f597068e0abc00e426409d50a2889d30c6d8e) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rest-rpc-${RESTRPC_VERSION}) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO qicosmos/rest_rpc + REF ${RESTRPC_VERSION} + SHA512 ${RESTRPC_HASH} + HEAD_REF master +) + +file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/third/msgpack/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/include/rest_rpc.hpp" + "#include \"rest_rpc/rpc_server.h\"" + "#define ASIO_STANDALONE\n#include \"rest_rpc/rpc_server.h\"" +) + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/restinio/CONTROL b/ports/restinio/CONTROL index d953dcfee202ca..290e1676766eef 100644 --- a/ports/restinio/CONTROL +++ b/ports/restinio/CONTROL @@ -1,5 +1,5 @@ Source: restinio -Version: 0.6.8 +Version: 0.6.10 Description: A header-only C++14 library that gives you an embedded HTTP/Websocket server targeted primarily for asynchronous processing of HTTP-requests. Build-Depends: asio, fmt, http-parser Homepage: https://github.com/stiffstream/restinio diff --git a/ports/restinio/portfile.cmake b/ports/restinio/portfile.cmake index c2cbbb05712c57..9a1995f75d3bda 100644 --- a/ports/restinio/portfile.cmake +++ b/ports/restinio/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stiffstream/restinio - REF c34f83a68e60537eba52e2d076ed22495ad4c5df # v.0.6.8 - SHA512 1c03a2cc96f44ce004870136ffdaa7a9abc5bc5173edadfe58e4f92f2e3c67c1555b4604094ad3a1dab1f0bf01cf9d79cf7d5a381f357aa4bdff90656a27e0c1 + REF bac11ec9cd08e3d1ebe663a9be17f0808e74d7af # v.0.6.10 + SHA512 c41f71c13346ca07b78ec8d451c2a591e819eb7459386b24d527d349564562be582969e969dc18cbaf45e9689203c6f7d43e69245dd7af0f82d38afdcb8cd804 ) vcpkg_configure_cmake( diff --git a/ports/robin-hood-hashing/CONTROL b/ports/robin-hood-hashing/CONTROL index 8d7eda75586bba..6aa499d881356b 100644 --- a/ports/robin-hood-hashing/CONTROL +++ b/ports/robin-hood-hashing/CONTROL @@ -1,4 +1,4 @@ Source: robin-hood-hashing -Version: 3.7.0 +Version: 3.8.0 Homepage: https://github.com/martinus/robin-hood-hashing Description: Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 diff --git a/ports/robin-hood-hashing/portfile.cmake b/ports/robin-hood-hashing/portfile.cmake index 209fb611e6d314..4169c32483f009 100644 --- a/ports/robin-hood-hashing/portfile.cmake +++ b/ports/robin-hood-hashing/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO martinus/robin-hood-hashing - REF 3.7.0 - SHA512 3dd7c7ace50bd16579ef9db8f9a89e1b2fd8406d7f3af6a4cedb674ea14303bd70332da403b87b2f0fb3c7f415dd93e9a7b330cb86ca2f58d5916ca42666a8e5 + REF 3.8.0 + SHA512 f64635a2fc3ebd975d40dc4fd3e3df81a6bed11e8bb9df1d6d100e408c2c81da2679e9836313444e573c6bfb160eeecd7fde68988e9d0246601c8993ecc42085 HEAD_REF master ) diff --git a/ports/rpclib/CONTROL b/ports/rpclib/CONTROL index 15e6abd3edabad..44d28780d97bbd 100644 --- a/ports/rpclib/CONTROL +++ b/ports/rpclib/CONTROL @@ -1,4 +1,5 @@ Source: rpclib -Version: 2.2.1-1 +Version: 2.2.1 +Port-Version: 2 Homepage: https://github.com/rpclib/rpclib Description: a RPC library for C++, providing both a client and server implementation. It is built using modern C++14. diff --git a/ports/rpclib/portfile.cmake b/ports/rpclib/portfile.cmake index 9865a2afe24820..eb42ebeba1a8fc 100644 --- a/ports/rpclib/portfile.cmake +++ b/ports/rpclib/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -12,6 +10,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + DISABLE_PARALLEL_CONFIGURE PREFER_NINJA ) @@ -23,5 +22,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/rpclib) vcpkg_copy_pdbs() -file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/rpclib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/rpclib/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/rpclib/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rsocket/CONTROL b/ports/rsocket/CONTROL new file mode 100644 index 00000000000000..333fe0df395f43 --- /dev/null +++ b/ports/rsocket/CONTROL @@ -0,0 +1,6 @@ +Source: rsocket +Version: 2020.05.04.00-1 +Homepage: https://github.com/rsocket/rsocket-cpp +Description: C++ implementation of RSocket http://rsocket.io +Build-Depends: folly, double-conversion, openssl, gflags, glog, fmt, boost-system, boost-thread, boost-filesystem, boost-regex, boost-context, boost-program-options, zlib +Supports: !(windows&x64) diff --git a/ports/rsocket/fix-cmake-config.patch b/ports/rsocket/fix-cmake-config.patch new file mode 100644 index 00000000000000..d3bf7b886ee444 --- /dev/null +++ b/ports/rsocket/fix-cmake-config.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/rsocket-config.cmake.in b/cmake/rsocket-config.cmake.in +index d5579a85..ea12752a 100644 +--- a/cmake/rsocket-config.cmake.in ++++ b/cmake/rsocket-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET rsocket::ReactiveSocket) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/rsocket/rsocket-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/rsocket-exports.cmake") + endif() + + if (NOT rsocket_FIND_QUIETLY) +diff --git a/yarpl/cmake/yarpl-config.cmake.in b/yarpl/cmake/yarpl-config.cmake.in +index d557b213..1b83fffc 100644 +--- a/yarpl/cmake/yarpl-config.cmake.in ++++ b/yarpl/cmake/yarpl-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET yarpl::yarpl) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/yarpl/yarpl-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/yarpl-exports.cmake") + endif() + + set(YARPL_LIBRARIES yarpl::yarpl) diff --git a/ports/rsocket/fix-find-dependencies.patch b/ports/rsocket/fix-find-dependencies.patch new file mode 100644 index 00000000000000..287a6fa99df0fe --- /dev/null +++ b/ports/rsocket/fix-find-dependencies.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f69e907..22570b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,7 +124,7 @@ option(BUILD_BENCHMARKS "Build benchmarks" ON) + option(BUILD_EXAMPLES "Build examples" ON) + option(BUILD_TESTS "Build tests" ON) + +-enable_testing() ++#enable_testing() + + include(ExternalProject) + include(CTest) +@@ -172,7 +172,9 @@ endif() + + if("${BUILD_TYPE_LOWER}" MATCHES "debug") + message("debug mode was set") ++ if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code") ++ endif() + else() + message("release mode was set") + endif() +@@ -181,18 +183,25 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(TEST_CXX_FLAGS ${TEST_CXX_FLAGS} -Wno-inconsistent-missing-override) + endif() + +-find_library(DOUBLE-CONVERSION double-conversion) ++find_package(double-conversion CONFIG REQUIRED) + + find_package(OpenSSL REQUIRED) + +-find_package(Gflags REQUIRED) ++find_package(gflags CONFIG REQUIRED) + +-# find glog::glog to satisfy the folly dep. +-find_package(Glog REQUIRED) ++find_package(ZLIB REQUIRED) + +-find_package(fmt CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() + +-include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) ++# find glog::glog to satisfy the folly dep. ++find_package(folly CONFIG REQUIRED) ++#find_package(glog CONFIG REQUIRED) ++# ++#find_package(fmt CONFIG REQUIRED) + + include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) + +@@ -327,7 +336,7 @@ target_compile_options( + ReactiveSocket + PRIVATE ${EXTRA_CXX_FLAGS}) + +-enable_testing() ++#enable_testing() + + install(TARGETS ReactiveSocket EXPORT rsocket-exports DESTINATION lib) + install(DIRECTORY rsocket DESTINATION include FILES_MATCHING PATTERN "*.h") +@@ -470,7 +479,7 @@ if(BUILD_TESTS) + ${GMOCK_LIBS} # This also needs the preceding `add_dependencies` + glog::glog + gflags +- ${DOUBLE-CONVERSION}) ++ double-conversion::double-conversion) + + # Download the latest TCK drivers JAR. + set(TCK_DRIVERS_JAR rsocket-tck-drivers-0.9.10.jar) +diff --git a/yarpl/CMakeLists.txt b/yarpl/CMakeLists.txt +index f4159b8..8c01ffb 100644 +--- a/yarpl/CMakeLists.txt ++++ b/yarpl/CMakeLists.txt +@@ -53,8 +53,14 @@ endif() + # Using NDEBUG in Release builds. + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") + +-find_package(Gflags REQUIRED) +-find_package(Glog REQUIRED) ++find_package(gflags CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() ++ ++find_package(glog CONFIG REQUIRED) + find_package(fmt CONFIG REQUIRED) + + IF(NOT FOLLY_VERSION) diff --git a/ports/rsocket/portfile.cmake b/ports/rsocket/portfile.cmake new file mode 100644 index 00000000000000..4ae31c106ef0fe --- /dev/null +++ b/ports/rsocket/portfile.cmake @@ -0,0 +1,44 @@ +# yarpl only support static build in Windows +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_fail_port_install(ON_ARCH "x64") + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rsocket/rsocket-cpp #v2020.05.04.00 + REF 8038d05e741c3d3ecd6adb069b4a1b3daa230e14 + SHA512 d7bc93af7b6130d73fa0823f534ad57a531dfa7d7aa990a2a1a1b72b6761db7eeb60573d0d38f55daa991554e3ab4ac507047f8051a4390b3343cd708a48efbb + HEAD_REF master + PATCHES + fix-cmake-config.patch + fix-find-dependencies.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF + -DBUILD_BENCHMARKS=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/include/yarpl/perf + ${CURRENT_PACKAGES_DIR}/include/yarpl/cmake + ${CURRENT_PACKAGES_DIR}/include/yarpl/test + ${CURRENT_PACKAGES_DIR}/include/rsocket/examples + ${CURRENT_PACKAGES_DIR}/include/rsocket/test +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rtmidi/CMakeLists.txt b/ports/rtmidi/CMakeLists.txt deleted file mode 100644 index 91782fd1817485..00000000000000 --- a/ports/rtmidi/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(rtmidi CXX) - -add_library(rtmidi RtMidi.cpp rtmidi_c.cpp) -if(BUILD_SHARED_LIBS) - target_compile_definitions(rtmidi PRIVATE -DRTMIDI_EXPORT) -endif() - -file(READ "${PROJECT_SOURCE_DIR}/rtmidi_c.h" RTMIDI_EXPORT) -if (BUILD_SHARED_LIBS) - string(REPLACE "if defined(RTMIDI_EXPORT)" "if 1" RTMIDI_EXPORT "${RTMIDI_EXPORT}") -else() - string(REPLACE "if defined(RTMIDI_EXPORT)" "if 0" RTMIDI_EXPORT "${RTMIDI_EXPORT}") -endif() -file(WRITE "${PROJECT_BINARY_DIR}/rtmidi_c.h" "${RTMIDI_EXPORT}") - -install( - TARGETS rtmidi - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -if(NOT DISABLE_INSTALL_HEADERS) - install(FILES "RtMidi.h" DESTINATION include) - install(FILES "${PROJECT_BINARY_DIR}/rtmidi_c.h" DESTINATION include) -endif() diff --git a/ports/rtmidi/CONTROL b/ports/rtmidi/CONTROL index 3742ec9b16a450..7c2c39f2ad8f29 100644 --- a/ports/rtmidi/CONTROL +++ b/ports/rtmidi/CONTROL @@ -1,4 +1,6 @@ Source: rtmidi Version: 4.0.0 +Port-Version: 2 Homepage: https://github.com/thestk/rtmidi Description: A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMidi & JACK) and Windows (Multimedia) +Supports: !uwp diff --git a/ports/rtmidi/portfile.cmake b/ports/rtmidi/portfile.cmake index 8aa949b5a4cea5..4a9fccbcc078fb 100644 --- a/ports/rtmidi/portfile.cmake +++ b/ports/rtmidi/portfile.cmake @@ -1,22 +1,29 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") + +# Upstream uses CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, which causes issues +# https://github.com/thestk/rtmidi/blob/4.0.0/CMakeLists.txt#L20 +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO thestk/rtmidi - REF 4.0.0 - SHA512 39383f121320c9471b31f8b9d283167bfadf4c7328b6664d1d54a4c52e3dd9b76362875258d90363c6044e87fcee31ccce80e19435dc620c88e6d60fc82d0f9d + REF dda792c5394375769466ab1c1d7773e741bbd950 # 4.0.0 + SHA512 cb1ded29c0b22cf7f38719131a9572a4daba7071fd8cf8b5b8d7306560a218bb0ef42150bf341b76f4ddee0ae087da975116c3b153e7bb908f2a674ecacb9d7a HEAD_REF master - PATCHES - fix-POSIXname.patch + PATCHES + fix-POSIXname.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON + OPTIONS -DRTMIDI_API_ALSA=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtmidi RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sdl1/CONTROL b/ports/sdl1/CONTROL index d34e89ad008880..87bb7b2afb825f 100644 --- a/ports/sdl1/CONTROL +++ b/ports/sdl1/CONTROL @@ -1,4 +1,5 @@ Source: sdl1 -Version: 1.2.15-11 +Version: 1.2.15 +Port-Version: 12 Homepage: https://www.libsdl.org Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl1/portfile.cmake b/ports/sdl1/portfile.cmake index e84582bf0a9a8d..6dd7da6876d573 100644 --- a/ports/sdl1/portfile.cmake +++ b/ports/sdl1/portfile.cmake @@ -54,11 +54,13 @@ else() message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".") vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() - vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread) + vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib + -Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib + SYSTEM_LIBRARIES pthread) file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") foreach (SDL1_TOOL ${SDL1_TOOLS}) diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt index b5b5eac619b265..cc9816d0b781a2 100644 --- a/ports/sdl2-mixer/CMakeLists.txt +++ b/ports/sdl2-mixer/CMakeLists.txt @@ -91,7 +91,7 @@ add_library(SDL2_mixer music_wav.c version.rc) -if(WIN32 OR APPLE) +if((WIN32 OR APPLE) AND SDL_MIXER_ENABLE_NATIVEMIDI) list(APPEND SDL_MIXER_DEFINES MUSIC_MID_NATIVE) target_sources(SDL2_mixer PRIVATE music_nativemidi.c native_midi/native_midi_common.c) target_link_libraries(SDL2_mixer ${SDL_MIXER_LIBRARIES}) diff --git a/ports/sdl2-mixer/CONTROL b/ports/sdl2-mixer/CONTROL index 4ea51192ef4168..ef18e139debe36 100644 --- a/ports/sdl2-mixer/CONTROL +++ b/ports/sdl2-mixer/CONTROL @@ -1,12 +1,17 @@ Source: sdl2-mixer -Version: 2.0.4-9 +Version: 2.0.4 +Port-Version: 10 Homepage: https://www.libsdl.org/projects/SDL_mixer Description: Multi-channel audio mixer library for SDL. Build-Depends: sdl2 +Default-Features: nativemidi Feature: dynamic-load Description: Load plugins with dynamic call +Feature: nativemidi +Description: Support for MIDI audio format on Windows and macOS. + Feature: libflac Description: Support for FLAC audio format. Build-Depends: libflac diff --git a/ports/sdl2-mixer/portfile.cmake b/ports/sdl2-mixer/portfile.cmake index 74037d2f6b1d0d..16e45c5d88ab76 100644 --- a/ports/sdl2-mixer/portfile.cmake +++ b/ports/sdl2-mixer/portfile.cmake @@ -34,6 +34,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS libmodplug SDL_MIXER_ENABLE_MOD libvorbis SDL_MIXER_ENABLE_OGGVORBIS opusfile SDL_MIXER_ENABLE_OPUS + nativemidi SDL_MIXER_ENABLE_NATIVEMIDI ) vcpkg_configure_cmake( diff --git a/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch b/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch new file mode 100644 index 00000000000000..064885b08cded4 --- /dev/null +++ b/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dfd35389..7944f401b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1916,9 +1916,10 @@ listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS) + set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) + + # Compat helpers for the configuration files +-if(NOT WINDOWS OR CYGWIN) + # TODO: we need a Windows script, too ++ if(NOT WINDOWS OR CYGWIN) + execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh) ++ endif() + + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") +@@ -1960,7 +1961,6 @@ if(NOT WINDOWS OR CYGWIN) + "${SDL2_BINARY_DIR}/sdl2-config" @ONLY) + configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in" + "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY) +-endif() + + ##### Info output ##### + message(STATUS "") +@@ -2198,6 +2198,7 @@ if(NOT (WINDOWS OR CYGWIN)) + # TODO: what about the .spec file? Is it only needed for RPM creation? + install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal") + endif() ++install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig") + + ##### Uninstall target ##### + + diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index f9bdadb699e4d8..7ea6329358b48f 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,5 +1,6 @@ Source: sdl2 -Version: 2.0.12-1 +Version: 2.0.12 +Port-Version: 3 Homepage: https://www.libsdl.org/download-2.0.php Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 366ad1e3ad8a04..ef287e3011c826 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_extract_source_archive_ex( fix-space-in-path.patch disable-wcslcpy-and-wcslcat-for-windows.patch fix-EventToken-header-reference.patch + 0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) @@ -83,3 +84,14 @@ endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() + +set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)") +set(DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)") +file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${DYLIB_COMPATIBILITY_VERSION_REGEX}) +file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${DYLIB_CURRENT_VERSION_REGEX}) +string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}") +string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}") + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2" "-lSDL2d") + +vcpkg_fixup_pkgconfig(IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined" "-Wl,-undefined,error" "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}" "-Wl,-current_version,${DYLIB_CURRENT_VERSION}" "-Wl,-weak_framework,Metal" "-Wl,-weak_framework,QuartzCore") diff --git a/ports/secp256k1/CMakeLists.txt b/ports/secp256k1/CMakeLists.txt index 2e6b46198aabd8..a3af313b6e7109 100644 --- a/ports/secp256k1/CMakeLists.txt +++ b/ports/secp256k1/CMakeLists.txt @@ -12,15 +12,24 @@ add_definitions( file(GLOB SOURCES src/secp256k1.c) add_library(secp256k1 ${SOURCES}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) -install(TARGETS secp256k1 +target_include_directories(secp256k1 PUBLIC $ $) + +if(INSTALL_HEADERS) + file(GLOB HEADERS include/*.h) + install(FILES ${HEADERS} DESTINATION include) +endif() + +install(TARGETS secp256k1 EXPORT unofficial-secp256k1-targets RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -if(INSTALL_HEADERS) - file(GLOB HEADERS include/*.h) - install(FILES ${HEADERS} DESTINATION include) -endif() \ No newline at end of file +install( + EXPORT unofficial-secp256k1-targets + FILE unofficial-secp256k1-targets.cmake + NAMESPACE unofficial:: + DESTINATION share/unofficial-secp256k1 +) \ No newline at end of file diff --git a/ports/secp256k1/CONTROL b/ports/secp256k1/CONTROL index a0414b60c0af59..10d73e4c08d73c 100644 --- a/ports/secp256k1/CONTROL +++ b/ports/secp256k1/CONTROL @@ -1,4 +1,5 @@ Source: secp256k1 -Version: 2017-19-10-0b7024185045a49a1a6a4c5615bf31c94f63d9c4-2 +Version: 2017-19-10 +Port-Version: 3 Homepage: https://github.com/bitcoin-core/secp256k1 Description: Optimized C library for EC operations on curve diff --git a/ports/secp256k1/portfile.cmake b/ports/secp256k1/portfile.cmake index 28291c7eca389f..3bf158816ae426 100644 --- a/ports/secp256k1/portfile.cmake +++ b/ports/secp256k1/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -20,6 +18,8 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +configure_file(${CMAKE_CURRENT_LIST_DIR}/secp256k1-config.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-secp256k1-config.cmake @ONLY) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/secp256k1/secp256k1-config.cmake b/ports/secp256k1/secp256k1-config.cmake new file mode 100644 index 00000000000000..5cc40fe829a9ae --- /dev/null +++ b/ports/secp256k1/secp256k1-config.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-secp256k1-targets.cmake") diff --git a/ports/selene/CONTROL b/ports/selene/CONTROL index 03eeb9185cf53f..0a1ef52782ee59 100644 --- a/ports/selene/CONTROL +++ b/ports/selene/CONTROL @@ -1,5 +1,10 @@ Source: selene -Version: 0.3.1-2 +Version: 0.3.1 +Port-Version: 3 Homepage: https://github.com/kmhofmann/selene Description: A C++17 image representation, processing and I/O library. Build-Depends: zlib, libpng, libjpeg-turbo, tiff + +Feature: opencv +Description: Enable using OpenCV +Build-Depends: opencv[core] diff --git a/ports/selene/portfile.cmake b/ports/selene/portfile.cmake index e6a94288522abf..703c3d2bc7d232 100644 --- a/ports/selene/portfile.cmake +++ b/ports/selene/portfile.cmake @@ -10,9 +10,12 @@ vcpkg_from_github( disable_x86_intrinsics_on_arm.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "opencv" SELENE_USE_OPENCV) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() diff --git a/ports/sentry-native/CONTROL b/ports/sentry-native/CONTROL new file mode 100644 index 00000000000000..46691143bda04b --- /dev/null +++ b/ports/sentry-native/CONTROL @@ -0,0 +1,7 @@ +Source: sentry-native +Version: 0.4.1 +Port-Version: 2 +Homepage: https://sentry.io/ +Description: Sentry SDK for C, C++ and native applications. +Build-Depends: curl (!windows) +Supports: !(arm|arm64|uwp) diff --git a/ports/sentry-native/portfile.cmake b/ports/sentry-native/portfile.cmake new file mode 100644 index 00000000000000..85bce660ad40be --- /dev/null +++ b/ports/sentry-native/portfile.cmake @@ -0,0 +1,67 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP") + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/getsentry/sentry-native/releases/download/0.4.1/sentry-native.zip" + FILENAME "sentry-native-0.4.1.zip" + SHA512 644e18e89e63c21f7aef9fd389ae768e4f4951ba970d52c529782391e8acb47cb49136dabc156365bdfa13cdd1bd21745d486f836bb21c88f282bd1a533e6420 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + NO_REMOVE_ONE_LEVEL +) + +if (NOT DEFINED SENTRY_BACKEND) + if(MSVC AND CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") + set(SENTRY_BACKEND "breakpad") + elseif(APPLE OR WIN32) + set(SENTRY_BACKEND "crashpad") + elseif(LINUX) + set(SENTRY_BACKEND "breakpad") + else() + set(SENTRY_BACKEND "inproc") + endif() +endif() + +if (VCPKG_TARGET_IS_WINDOWS) + set(SENTRY_NATIVE_C_STANDARD 99) +else() + set(SENTRY_NATIVE_C_STANDARD 11) +endif() + + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSENTRY_BUILD_TESTS=OFF + -DSENTRY_BUILD_EXAMPLES=OFF + -DCMAKE_C_STANDARD=${SENTRY_NATIVE_C_STANDARD} + -DSENTRY_BACKEND=${SENTRY_BACKEND} +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sentry TARGET_PATH share/sentry) + +if (WIN32 AND SENTRY_BACKEND STREQUAL "crashpad") + vcpkg_copy_tools( + TOOL_NAMES crashpad_handler + AUTO_CLEAN + ) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file( + INSTALL ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) diff --git a/ports/serd/CMakeLists.txt b/ports/serd/CMakeLists.txt new file mode 100644 index 00000000000000..2f07119871083d --- /dev/null +++ b/ports/serd/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.17) +project(serd C) + +add_library(serd + src/byte_source.c + src/env.c + src/n3.c + src/node.c + src/reader.c + src/string.c + src/uri.c + src/writer.c +) + +file(WRITE "${CMAKE_BINARY_DIR}/serd_config.h" "") + +target_include_directories(serd + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" +) + +set_target_properties(serd PROPERTIES + C_STANDARD 99 + C_STANDARD_REQUIRED ON +) + +target_compile_definitions(serd PRIVATE SERD_INTERNAL _CRT_SECURE_NO_WARNINGS) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(serd PUBLIC SERD_SHARED) +endif() + +install( + TARGETS serd + EXPORT serd-config + INCLUDES DESTINATION include +) + +if(NOT DISABLE_INSTALL_HEADERS) + install(DIRECTORY serd DESTINATION include) +endif() + +install( + EXPORT serd-config + NAMESPACE serd:: + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/serd" +) diff --git a/ports/serd/portfile.cmake b/ports/serd/portfile.cmake new file mode 100644 index 00000000000000..6e6173cc0bb103 --- /dev/null +++ b/ports/serd/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.com + OUT_SOURCE_PATH SOURCE_PATH + REPO drobilla/serd + REF v0.30.4 + SHA512 59b4f67dfa8a2c01119b1c69609030d851339ba6d85c5c559b7c2454492ef40498ce710e5cf5f7a698a292db81e6bffacb86f9dafa5d7f3fe0c60d53d6e2281f + HEAD_REF master +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1 +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets() +file( + INSTALL "${SOURCE_PATH}/COPYING" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright +) diff --git a/ports/serd/vcpkg.json b/ports/serd/vcpkg.json new file mode 100644 index 00000000000000..db40b57c24df3c --- /dev/null +++ b/ports/serd/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "serd", + "version-string": "0.30.4", + "description": "Serd is a lightweight C library for RDF syntax which supports reading and writing Turtle, TRiG, NTriples, and NQuads.", + "homepage": "https://drobilla.net/software/serd", + "license": "ISC" +} diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL index 6f46156a93519e..d126e395edfef1 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,5 +1,6 @@ Source: sfml -Version: 2.5.1-7 +Version: 2.5.1 +Port-Version: 9 Homepage: https://github.com/sfml/sfml Description: Simple and fast multimedia library Build-Depends: freetype, libflac, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index efbcdd135912d0..0a028db194019b 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH SHA512 7aed2fc29d1da98e6c4d598d5c86cf536cb4eb5c2079cdc23bb8e502288833c052579dadbe0ce13ad6461792d959bf6d9660229f54c54cf90a541c88c6b03d59 PATCHES use-system-freetype.patch + stb_include.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) @@ -32,9 +33,11 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SFML) vcpkg_copy_pdbs() +FILE(READ ${CURRENT_PACKAGES_DIR}/share/sfml/SFMLConfig.cmake SFML_CONFIG) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - FILE(READ ${CURRENT_PACKAGES_DIR}/share/sfml/SFMLConfig.cmake SFML_CONFIG) FILE(WRITE ${CURRENT_PACKAGES_DIR}/share/sfml/SFMLConfig.cmake "set(SFML_STATIC_LIBRARIES true)\ninclude(CMakeFindDependencyMacro)\nfind_dependency(Freetype)\n${SFML_CONFIG}") +else() + FILE(WRITE ${CURRENT_PACKAGES_DIR}/share/sfml/SFMLConfig.cmake "set(SFML_STATIC_LIBRARIES false)\n${SFML_CONFIG}") endif() # move sfml-main to manual link dir diff --git a/ports/sfml/stb_include.patch b/ports/sfml/stb_include.patch new file mode 100644 index 00000000000000..3519b1c1e61233 --- /dev/null +++ b/ports/sfml/stb_include.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e821a49bc..c68264ef2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,6 +188,9 @@ if(SFML_USE_SYSTEM_DEPS) + endforeach() + + list(REMOVE_DUPLICATES CMAKE_IGNORE_PATH) ++ ++ find_path(STB_INCLUDE_DIR stb.h) ++ include_directories(${STB_INCLUDE_DIR}) + endif() + + # Visual C++: remove warnings regarding SL security and algorithms on pointers diff --git a/ports/shapelib/CONTROL b/ports/shapelib/CONTROL index 283b66b442d812..e656682756f7b9 100644 --- a/ports/shapelib/CONTROL +++ b/ports/shapelib/CONTROL @@ -1,4 +1,4 @@ Source: shapelib -Version: 1.4.1-2 +Version: 1.5.0 Homepage: https://download.osgeo.org/shapelib Description: Shapefile C Library is simple C API for reading and writing ESRI Shapefiles diff --git a/ports/shapelib/portfile.cmake b/ports/shapelib/portfile.cmake index 788e21e2e3f5fe..3aceff84d7a016 100644 --- a/ports/shapelib/portfile.cmake +++ b/ports/shapelib/portfile.cmake @@ -1,7 +1,5 @@ -include(vcpkg_common_functions) - -set(SHAPELIB_VERSION 1.4.1) -set(SHAPELIB_HASH e3e02dde8006773fed25d630896e79fd79d2008a029cc86b157fe0d92c143a9fab930fdb93d9700d4e1397c3b23ae4b86e91db1dbaca1c5388d4e3aea0309341) +set(SHAPELIB_VERSION 1.5.0) +set(SHAPELIB_HASH 230939afb33aee042808a32b38ee9dfc7ec1f39432e5a4ebe3fda99c2f87bfbebc91830d4e21691c51aae3f4bb65d7e71e7061472bb08124dcd3402c46800d6c) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/shapelib/shapelib-${SHAPELIB_VERSION}.zip" @@ -44,8 +42,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/shapelib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/shapelib/COPYING ${CURRENT_PACKAGES_DIR}/share/shapelib/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/shapelib) diff --git a/ports/shogun/CONTROL b/ports/shogun/CONTROL index 5f46ded2a07afa..580a8be31b8782 100644 --- a/ports/shogun/CONTROL +++ b/ports/shogun/CONTROL @@ -1,5 +1,6 @@ Source: shogun -Version: 6.1.4-1 -Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent +Version: 6.1.4 +Port-Version: 2 +Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas, nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent Homepage: https://github.com/shogun-toolbox/shogun Description: Unified and efficient Machine Learning \ No newline at end of file diff --git a/ports/shogun/portfile.cmake b/ports/shogun/portfile.cmake index ce68bcb57c1796..47555a75b6379a 100644 --- a/ports/shogun/portfile.cmake +++ b/ports/shogun/portfile.cmake @@ -1,11 +1,5 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(CMAKE_DISABLE_FIND_PACKAGE_BLAS 0) -else() - set(CMAKE_DISABLE_FIND_PACKAGE_BLAS 1) -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO shogun-toolbox/shogun @@ -44,10 +38,9 @@ vcpkg_configure_cmake( -DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Ctags=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_CCache=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_LAPACK=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_BLAS=${CMAKE_DISABLE_FIND_PACKAGE_BLAS} + -DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE -DINSTALL_TARGETS=shogun-static ) @@ -62,4 +55,4 @@ file(REMOVE_RECURSE ) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake index 409182a72b54f8..6770577165376c 100644 --- a/ports/simdjson/portfile.cmake +++ b/ports/simdjson/portfile.cmake @@ -1,9 +1,9 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO simdjson/simdjson - REF 74870a81898ba44407f5dce1f0f50d4ea53fca04 # v0.4.6 + REF 5d355f1a8b584519ed39256c3be949ef7f8b0dbd # v0.5.0 HEAD_REF master - SHA512 abd8621cb5ed2a9ccad54c2b9e09a2fc8c8fe5d6a70501d23b879f33e34a6c25d33901b385615e9bb29817c302977aa89bc0ab2a13365e413da557f1a099dd21 + SHA512 ad92e4bafa596baf878c0c4945828b00cdb431e719dd6aaa1752dcb4b12c9ce13061105a7ca206b160865b3d1c724d675cd3c347691c81972d64804846dfa2a9 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SIMDJSON_BUILD_STATIC) diff --git a/ports/simdjson/vcpkg.json b/ports/simdjson/vcpkg.json index 618dcaf1230d62..34f749a62cd06c 100644 --- a/ports/simdjson/vcpkg.json +++ b/ports/simdjson/vcpkg.json @@ -1,6 +1,6 @@ { "name": "simdjson", - "version-string": "0.4.6", + "version-string": "0.5.0", "description": "A extremely fast JSON library that can parse gigabytes of JSON per second", "homepage": "https://simdjson.org/", "license": "Apache-2.0" diff --git a/ports/simple-fft/CONTROL b/ports/simple-fft/CONTROL new file mode 100644 index 00000000000000..6595558bbd83df --- /dev/null +++ b/ports/simple-fft/CONTROL @@ -0,0 +1,4 @@ +Source: simple-fft +Version: 2020-06-14 +Homepage: https://github.com/d1vanov/Simple-FFT +Description: Header-only C++ library implementing fast Fourier transform of 1D, 2D and 3D data diff --git a/ports/simple-fft/portfile.cmake b/ports/simple-fft/portfile.cmake new file mode 100644 index 00000000000000..81f33e054c4b66 --- /dev/null +++ b/ports/simple-fft/portfile.cmake @@ -0,0 +1,20 @@ +# Header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO d1vanov/Simple-FFT + REF a0cc843ff36d33ad09c08674b9503614742ad0b9 + SHA512 6fbbda1f172505f6627f97ae671d12ff282844ca50e6e6c8016f78ee333c32ce6d17763837c281e47f10cfc277cb1f67394169f6bbf137b09885c1a053d6d342 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/include/simple_fft/check_fft.hpp + ${SOURCE_PATH}/include/simple_fft/copy_array.hpp + ${SOURCE_PATH}/include/simple_fft/error_handling.hpp + ${SOURCE_PATH}/include/simple_fft/fft.h + ${SOURCE_PATH}/include/simple_fft/fft.hpp + ${SOURCE_PATH}/include/simple_fft/fft_impl.hpp + ${SOURCE_PATH}/include/simple_fft/fft_settings.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include/simple_fft +) + +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/skia/CONTROL b/ports/skia/CONTROL index 3a8cd97a0c1daf..e06605d1d0a946 100644 --- a/ports/skia/CONTROL +++ b/ports/skia/CONTROL @@ -1,5 +1,6 @@ Source: skia -Version: 2020-05-18-1 +Version: 2020-05-18 +Port-Version: 4 Homepage: https://skia.org Description: Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products. diff --git a/ports/skia/add-missing-tuple.patch b/ports/skia/add-missing-tuple.patch new file mode 100644 index 00000000000000..e33d44e3aefa0a --- /dev/null +++ b/ports/skia/add-missing-tuple.patch @@ -0,0 +1,12 @@ +diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h +index 7afe4f9..502f83e 100644 +--- a/include/private/SkPathRef.h ++++ b/include/private/SkPathRef.h +@@ -21,6 +21,7 @@ + + #include + #include ++#include + + class SkRBuffer; + class SkWBuffer; diff --git a/ports/skia/portfile.cmake b/ports/skia/portfile.cmake index cf3132b2b00062..30feaf013ddda6 100644 --- a/ports/skia/portfile.cmake +++ b/ports/skia/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_git( OUT_SOURCE_PATH SOURCE_PATH URL https://skia.googlesource.com/skia.git REF fb0b35fed5580d49392df7ce9374551b348fffbf + PATCHES add-missing-tuple.patch ) function(checkout_in_path PATH URL REF) @@ -95,7 +96,7 @@ endfunction() set(_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include") -replace_skia_dep(expat "/include" "expat" "expat" "") +replace_skia_dep(expat "/include" "libexpat,libexpatd,libexpatdMD" "libexpat,libexpatMD" "") replace_skia_dep(freetype2 "/include" "freetype,freetyped" "freetype" "") replace_skia_dep(harfbuzz "/include/harfbuzz" "harfbuzz-icu" "harfbuzz-icu" "") replace_skia_dep(icu "/include" "icuuc,icuucd" "icuuc" "U_USING_ICU_NAMESPACE=0") diff --git a/ports/spatialite-tools/CONTROL b/ports/spatialite-tools/CONTROL index 73a698deeb335d..7ef2a3284a6a0d 100644 --- a/ports/spatialite-tools/CONTROL +++ b/ports/spatialite-tools/CONTROL @@ -1,5 +1,6 @@ Source: spatialite-tools -Version: 4.3.0-2 +Version: 4.3.0 +Port-Version: 4 Homepage: https://www.gaia-gis.it/fossil/spatialite-tools/index Description: Contains spatialite.exe and other command line tools to work with SpatiaLite databases (import, export, SQL queries) Build-Depends: sqlite3, libspatialite, geos, readosm, proj4, zlib, libiconv, expat diff --git a/ports/spatialite-tools/portfile.cmake b/ports/spatialite-tools/portfile.cmake index 7a731fd3f02a1f..eacba0c367fad0 100644 --- a/ports/spatialite-tools/portfile.cmake +++ b/ports/spatialite-tools/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - option(BUILD_DEBUG_TOOLS "Build debug version of tools" OFF) vcpkg_download_distfile(ARCHIVE @@ -30,17 +28,21 @@ if(VCPKG_CRT_LINKAGE STREQUAL dynamic) set(SPATIALITE_LIBS_DBG "${LDIR}/debug/lib/spatialite.lib") set(ICONV_LIBS_REL "${LDIR}/lib/libiconv.lib") set(ICONV_LIBS_DBG "${LDIR}/debug/lib/libiconv.lib") + set(EXPAT_LIBS_REL "${LDIR}/lib/libexpat.lib") + set(EXPAT_LIBS_DBG "${LDIR}/debug/lib/libexpatd.lib") else() set(CL_FLAGS_DBG "/MTd /Zi /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(CL_FLAGS_REL "/MT /Ox /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") - set(GEOS_LIBS_REL "${LDIR}/lib/libgeos_c.lib ${LDIR}/lib/libgeos.lib") - set(GEOS_LIBS_DBG "${LDIR}/debug/lib/libgeos_c.lib ${LDIR}/debug/lib/libgeos.lib") + set(GEOS_LIBS_REL "${LDIR}/lib/geos_c.lib ${LDIR}/lib/geos.lib") + set(GEOS_LIBS_DBG "${LDIR}/debug/lib/geos_cd.lib ${LDIR}/debug/lib/geosd.lib") set(LIBXML2_LIBS_REL "${LDIR}/lib/libxml2.lib ${LDIR}/lib/lzma.lib ws2_32.lib") - set(LIBXML2_LIBS_DBG "${LDIR}/debug/lib/libxml2.lib ${LDIR}/debug/lib/lzma.lib ws2_32.lib") + set(LIBXML2_LIBS_DBG "${LDIR}/debug/lib/libxml2.lib ${LDIR}/debug/lib/lzmad.lib ws2_32.lib") set(SPATIALITE_LIBS_REL "${LDIR}/lib/spatialite.lib ${LDIR}/lib/freexl.lib") set(SPATIALITE_LIBS_DBG "${LDIR}/debug/lib/spatialite.lib ${LDIR}/debug/lib/freexl.lib") set(ICONV_LIBS_REL "${LDIR}/lib/libiconv.lib ${LDIR}/lib/libcharset.lib") set(ICONV_LIBS_DBG "${LDIR}/debug/lib/libiconv.lib ${LDIR}/debug/lib/libcharset.lib ") + set(EXPAT_LIBS_REL "${LDIR}/lib/libexpatMD.lib") + set(EXPAT_LIBS_DBG "${LDIR}/debug/lib/libexpatdMD.lib") endif() set(LIBS_ALL_DBG @@ -49,8 +51,8 @@ set(LIBS_ALL_DBG ${SPATIALITE_LIBS_DBG} \ ${LIBXML2_LIBS_DBG} \ ${GEOS_LIBS_DBG} \ + ${EXPAT_LIBS_DBG} \ ${LDIR}/debug/lib/readosm.lib \ - ${LDIR}/debug/lib/expat.lib \ ${LDIR}/debug/lib/zlibd.lib \ ${LDIR}/debug/lib/proj_d.lib" ) @@ -60,8 +62,8 @@ set(LIBS_ALL_REL ${SPATIALITE_LIBS_REL} \ ${LIBXML2_LIBS_REL} \ ${GEOS_LIBS_REL} \ + ${EXPAT_LIBS_REL} \ ${LDIR}/lib/readosm.lib \ - ${LDIR}/lib/expat.lib \ ${LDIR}/lib/zlib.lib \ ${LDIR}/lib/proj.lib" ) diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index 9005193609cad1..8636d8ba951701 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,5 +1,5 @@ Source: spdlog -Version: 1.6.1 +Version: 1.7.0 Homepage: https://github.com/gabime/spdlog Description: Very fast, header only, C++ logging library Build-Depends: fmt diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 0c8b0df72c3458..844575c134759a 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gabime/spdlog - REF 22a169bc319ac06948e7ee0be6b9b0ac81386604 #v1.6.1 - SHA512 29eac6f1be8d9fc08a257eab7f59cf70d63b2978fa4b8b63c825b39cf77f2505083bfd9db3fa2925739cea71d07986c022fc3d236cce351b3570d543f100a8a5 + REF 616caa5d30172b65cc3a06800894c575d70cb8e6 #v1.7.0 + SHA512 47411e8a607a339bffe2d5e13b4568b825ee8a07d88e69cf32096b08b76cdb60cbd64003620506e9c5748d3f66d8df76fa8880bb1a092923b7b405fedd18ad0c HEAD_REF v1.x ) diff --git a/ports/speex/0001-make-pkg-config-lib-name-configurable.patch b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch new file mode 100644 index 00000000000000..72b61f4cc5a4e3 --- /dev/null +++ b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch @@ -0,0 +1,13 @@ +diff --git a/speex.pc.in b/speex.pc.in +index 97bba4f..52a1d3c 100644 +--- a/speex.pc.in ++++ b/speex.pc.in +@@ -10,6 +10,6 @@ Description: Speex is an audio codec tuned for speech + Version: @SPEEX_VERSION@ + Requires: + Conflicts: +-Libs: -L${libdir} -lspeex ++Libs: -L${libdir} -l@SPEEXLIB@ + Libs.private: @LIBM@ + Cflags: -I${includedir} + diff --git a/ports/speex/CMakeLists.txt b/ports/speex/CMakeLists.txt index bdce0b3c3389d9..b151b2439f7077 100644 --- a/ports/speex/CMakeLists.txt +++ b/ports/speex/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required (VERSION 3.8.0) project (libspeex C) +include(GNUInstallDirs) +include(CheckLibraryExists) + option(USE_SSE "USE_SSE used Note: USE_SSE and FIXED_POINT are mutually exclusive." ON) if(MSVC) add_definitions(-DHAVE_CONFIG_H) @@ -28,6 +31,15 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def" "speex_header_free\n" ) +file(STRINGS "configure.ac" + _speex_version_defines REGEX "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") +foreach(ver ${_speex_version_defines}) + if(ver MATCHES "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") + set(SPEEX_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}" CACHE INTERNAL "") + endif() +endforeach() +set(SPEEX_VERSION ${SPEEX_MAJOR_VERSION}.${SPEEX_MINOR_VERSION}.${SPEEX_MICRO_VERSION}) + set(SRC "libspeex/bits.c" "libspeex/cb_search.c" @@ -78,3 +90,22 @@ install( if(NOT DISABLE_INSTALL_HEADERS) install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h") endif() + +# pkgconfig file +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) +set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) +set(LIBM ) +check_library_exists(m ceil "" LIBMEXIST) +if(LIBMEXIST) + list(APPEND LIBM -lm) +endif() +set(SPEEXLIB "${CMAKE_PROJECT_NAME}") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(SPEEXLIB "${CMAKE_PROJECT_NAME}d") +endif() +configure_file(speex.pc.in speex.pc @ONLY) +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/speex.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL index 3291927c2888ba..0185b9b07b31e1 100644 --- a/ports/speex/CONTROL +++ b/ports/speex/CONTROL @@ -1,4 +1,6 @@ Source: speex -Version: 1.2.0-4 +Version: 1.2.0 +Port-Version: 7 Homepage: https://github.com/xiph/speex Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech. +Supports: !(linux | osx) \ No newline at end of file diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake index 271c2bc8873c5f..a8431db7627e15 100644 --- a/ports/speex/portfile.cmake +++ b/ports/speex/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -6,6 +6,8 @@ vcpkg_from_github( REF Speex-1.2.0 SHA512 612dfd67a9089f929b7f2a613ed3a1d2fda3d3ec0a4adafe27e2c1f4542de1870b42b8042f0dcb16d52e08313d686cc35b76940776419c775417f5bad18b448f HEAD_REF master + PATCHES + 0001-make-pkg-config-lib-name-configurable.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -24,4 +26,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(WRITE "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" "${_contents}") endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/speex RENAME copyright) +vcpkg_fixup_pkgconfig() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sqlite-orm/CONTROL b/ports/sqlite-orm/CONTROL index c86beeb3d9f281..e5f4bccb04db44 100644 --- a/ports/sqlite-orm/CONTROL +++ b/ports/sqlite-orm/CONTROL @@ -1,4 +1,13 @@ Source: sqlite-orm Version: 1.5 +Port-Version: 2 +Homepage: https://github.com/fnc12/sqlite_orm Build-Depends: sqlite3 Description: SQLite ORM light header only library for modern C++ + +Feature: test +Description: Build sqlite_orm unit tests +Build-Depends: catch2 + +Feature: example +Description: Build examples diff --git a/ports/sqlite-orm/fix-build-error.patch b/ports/sqlite-orm/fix-build-error.patch new file mode 100644 index 00000000000000..ca4e005d46b425 --- /dev/null +++ b/ports/sqlite-orm/fix-build-error.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5ffbdf3..6debae6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,6 +39,9 @@ set(ProjectName "SqliteOrm") + + option(SqliteOrm_BuildTests "Build sqlite_orm unit tests" ON) + ++find_package(unofficial-sqlite3 CONFIG REQUIRED) ++link_libraries(unofficial::sqlite3::sqlite3) ++ + set(SqliteOrm_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/include") + add_library(sqlite_orm INTERFACE) + +@@ -75,7 +78,9 @@ if(SqliteOrm_BuildTests AND BUILD_TESTING) + add_subdirectory(tests) + endif() + ++if(BUILD_EXAMPLES) + add_subdirectory(examples) ++endif() + + install(TARGETS sqlite_orm EXPORT "${ProjectName}Targets" + INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Development diff --git a/ports/sqlite-orm/fix-example-feature.patch b/ports/sqlite-orm/fix-example-feature.patch new file mode 100644 index 00000000000000..ad68dade0fc9cc --- /dev/null +++ b/ports/sqlite-orm/fix-example-feature.patch @@ -0,0 +1,11 @@ +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 2857b65..3ee46e6 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -4,5 +4,5 @@ file(GLOB files "*.cpp") + foreach(file ${files}) + get_filename_component(file_basename ${file} NAME_WE) + add_executable(${file_basename} ${file}) +- target_link_libraries(${file_basename} PRIVATE sqlite_orm sqlite3) ++ target_link_libraries(${file_basename} PRIVATE sqlite_orm) + endforeach() diff --git a/ports/sqlite-orm/fix-test-feature.patch b/ports/sqlite-orm/fix-test-feature.patch new file mode 100644 index 00000000000000..2f825938451914 --- /dev/null +++ b/ports/sqlite-orm/fix-test-feature.patch @@ -0,0 +1,30 @@ +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 578cbed..c1c6d56 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -4,11 +4,11 @@ option(SQLITE_ORM_OMITS_CODECVT "Omits codec testing" OFF) + + option(SqliteOrm_SysSqlite "Use system version of sqlite library" OFF) + +-if(SqliteOrm_SysSqlite) +- message(FATAL_ERROR "WIP: please, disable the SqliteOrm_SysSqlite option.") +-else() +- add_subdirectory(third_party/sqlite) +-endif() ++#if(SqliteOrm_SysSqlite) ++# message(FATAL_ERROR "WIP: please, disable the SqliteOrm_SysSqlite option.") ++#else() ++# add_subdirectory(third_party/sqlite) ++#endif() + + add_executable(unit_tests tests.cpp tests2.cpp tests3.cpp tests4.cpp tests4.cpp private_getters_tests.cpp pragma_tests.cpp explicit_columns.cpp core_functions_tests.cpp composite_key.cpp static_tests.cpp operators.cpp operators/like.cpp operators/glob.cpp operators/in.cpp operators/cast.cpp operators/is_null.cpp dynamic_order_by.cpp prepared_statement_tests/select.cpp prepared_statement_tests/get_all.cpp prepared_statement_tests/get_all_pointer.cpp prepared_statement_tests/get_all_optional.cpp prepared_statement_tests/update_all.cpp prepared_statement_tests/remove_all.cpp prepared_statement_tests/get.cpp prepared_statement_tests/get_pointer.cpp prepared_statement_tests/get_optional.cpp prepared_statement_tests/update.cpp prepared_statement_tests/remove.cpp prepared_statement_tests/insert.cpp prepared_statement_tests/replace.cpp prepared_statement_tests/insert_range.cpp prepared_statement_tests/replace_range.cpp prepared_statement_tests/insert_explicit.cpp pragma_tests.cpp simple_query.cpp static_tests/is_bindable.cpp static_tests/arithmetic_operators_result_type.cpp static_tests/tuple_conc.cpp static_tests/node_tuple.cpp static_tests/bindable_filter.cpp static_tests/count_tuple.cpp constraints/default.cpp constraints/foreign_key.cpp) + +@@ -19,7 +19,7 @@ if(SQLITE_ORM_OMITS_CODECVT) + endif() + + find_package(Catch2 REQUIRED) +-target_link_libraries(unit_tests PRIVATE sqlite_orm sqlite3 Catch2::Catch2) ++target_link_libraries(unit_tests PRIVATE sqlite_orm Catch2::Catch2) + + enable_testing() + diff --git a/ports/sqlite-orm/fix-usage.patch b/ports/sqlite-orm/fix-usage.patch new file mode 100644 index 00000000000000..7e90b0edff6bfe --- /dev/null +++ b/ports/sqlite-orm/fix-usage.patch @@ -0,0 +1,59 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6debae6..facdc1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,7 @@ add_library(sqlite_orm INTERFACE) + + target_sources(sqlite_orm INTERFACE + $ +- $) ++ $) + + target_include_directories(sqlite_orm INTERFACE + $ +@@ -83,11 +83,11 @@ add_subdirectory(examples) + endif() + + install(TARGETS sqlite_orm EXPORT "${ProjectName}Targets" +- INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Development +- PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Development) ++ INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" ++ PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}") + + install(FILES "include/sqlite_orm/sqlite_orm.h" +- DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Development) ++ DESTINATION "${INCLUDE_INSTALL_DIR}") + + export(EXPORT "${ProjectName}Targets" + FILE "${CMAKE_CURRENT_BINARY_DIR}/${ProjectName}/${ProjectName}Targets.cmake" +diff --git a/build/cmake/GenerateConfigModule.cmake b/build/cmake/GenerateConfigModule.cmake +index 3c5143d..a49f76a 100644 +--- a/build/cmake/GenerateConfigModule.cmake ++++ b/build/cmake/GenerateConfigModule.cmake +@@ -1,7 +1,7 @@ + include(CMakePackageConfigHelpers) + +-set(PACKAGE_INCLUDE_INSTALL_DIR "${includedir}/sqlite_orm") +-set(PACKAGE_CMAKE_INSTALL_DIR "${cmakedir}/sqlite_orm") ++set(PACKAGE_INCLUDE_INSTALL_DIR "${includedir}") ++set(PACKAGE_CMAKE_INSTALL_DIR "${cmakedir}") + + # In CYGWIN enviroment below commands does not work properly + if (NOT CYGWIN) +diff --git a/build/cmake/SqliteOrmConfig.cmake.in b/build/cmake/SqliteOrmConfig.cmake.in +index a6b6f20..7411aa1 100644 +--- a/build/cmake/SqliteOrmConfig.cmake.in ++++ b/build/cmake/SqliteOrmConfig.cmake.in +@@ -3,10 +3,10 @@ set(SQLITE_ORM_VERSION ${sqlite_orm_VERSION}) + @PACKAGE_INIT@ + + set_and_check(SQLITE_ORM_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") +-set_and_check(SQLITE_ORM_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@") ++set_and_check(SQLITE_ORM_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@/../../") + + if (NOT TARGET sqlite_orm::sqlite_orm) +- include("${SQLITE_ORM_CMAKE_DIR}/SqliteOrmTargets.cmake") ++ include("${SQLITE_ORM_CMAKE_DIR}/share/SqliteOrm/SqliteOrmTargets.cmake") + endif() + + set(SQLITE_ORM_LIBRARIES sqlite_orm::sqlite_orm) diff --git a/ports/sqlite-orm/portfile.cmake b/ports/sqlite-orm/portfile.cmake index 3b93af0b841e80..140ab42c612bea 100644 --- a/ports/sqlite-orm/portfile.cmake +++ b/ports/sqlite-orm/portfile.cmake @@ -1,15 +1,44 @@ -include(vcpkg_common_functions) +# header-only library + +set(FEATURE_PATCHES) + +if(test IN_LIST FEATURES) + list(APPEND FEATURE_PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-test-feature.patch) +endif() + +if(example IN_LIST FEATURES) + list(APPEND FEATURE_PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-example-feature.patch) +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fnc12/sqlite_orm - REF e8a9e9416f421303f4b8970caab26dadf8bae98b # v1.5 - SHA512 9774345e0209482a137e5f3058e2f27db55ea72fd08c44e67c0989df8927fee896cb789dcb2cd21167689c2f2be1c126bd730a6ea1083a48e6dd58fb048c6f5e + REF b30ddc6a50dc582c93cd49d8d0cf8f5025ba1d2b # 1.5 + SHA512 faeeef88aef11e89e9565850c23087925fb4d75ef48a16434055f18831db8e230d044c81574d840dacca406d7095cb83a113afc326996e289ab11a02d8caa2f4 HEAD_REF master + PATCHES + fix-build-error.patch + fix-usage.patch + ${FEATURE_PATCHES} +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + test SqliteOrm_BuildTests + example BUILD_EXAMPLES ) -file(COPY ${SOURCE_PATH}/include/sqlite_orm DESTINATION ${CURRENT_PACKAGES_DIR}/include/) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} + -DSQLITE_ORM_ENABLE_CXX_17=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sqlite_orm TARGET_PATH share/SqliteOrm) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL - ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/sqlite-orm RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 3c1fc071c26c29..6250eb7111b979 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -24,6 +24,15 @@ target_compile_definitions( -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_COLUMN_METADATA ) + +if(WITH_GEOPOLY) + add_compile_definitions(SQLITE_ENABLE_GEOPOLY) +endif() + +if(WITH_JSON1) + add_compile_definitions(SQLITE_ENABLE_JSON1) +endif() + target_include_directories(sqlite3 INTERFACE $) if(NOT WIN32) find_package(Threads REQUIRED) @@ -46,11 +55,11 @@ endif() install( TARGETS sqlite3 - EXPORT sqlite3 + EXPORT unofficial-sqlite3-targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release) -install(EXPORT sqlite3 FILE sqlite3-targets.cmake DESTINATION share/sqlite3) +install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index c48578eef46afe..01df1c91abe0d6 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,7 +1,14 @@ Source: sqlite3 Version: 3.32.3 +Port-Version: 1 Homepage: https://sqlite.org/ Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Feature: tool Description: sqlite3 executable + +Feature: geopoly +Description: enable geopoly functionality for sqlite3 + +Feature: json1 +Description: enable JSON functionality for sqlite3 diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 21d60ab9f6a554..7a1a5775e73e43 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -17,6 +17,9 @@ vcpkg_extract_source_archive_ex( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + geopoly WITH_GEOPOLY + json1 WITH_JSON1 INVERTED_FEATURES tool SQLITE3_SKIP_TOOLS ) @@ -30,7 +33,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -40,7 +43,7 @@ endif() configure_file( ${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake - ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake + ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake @ONLY ) diff --git a/ports/sqlite3/sqlite3-config.in.cmake b/ports/sqlite3/sqlite3-config.in.cmake index 538342cf42961f..e7e26bf2cde563 100644 --- a/ports/sqlite3/sqlite3-config.in.cmake +++ b/ports/sqlite3/sqlite3-config.in.cmake @@ -4,4 +4,4 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) find_dependency(Threads) endif() -include(${CMAKE_CURRENT_LIST_DIR}/sqlite3-targets.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake) diff --git a/ports/sqlitecpp/0001-Find-external-sqlite3.patch b/ports/sqlitecpp/0001-Find-external-sqlite3.patch index b2371490c07833..5914dc17d04700 100644 --- a/ports/sqlitecpp/0001-Find-external-sqlite3.patch +++ b/ports/sqlitecpp/0001-Find-external-sqlite3.patch @@ -7,10 +7,10 @@ index 9363c0d..0f47f0f 100644 target_link_libraries(SQLiteCpp PUBLIC sqlite3) else (SQLITECPP_INTERNAL_SQLITE) - find_package (SQLite3 REQUIRED) -+ find_package(sqlite3 CONFIG) ++ find_package(unofficial-sqlite3 CONFIG) message(STATUS "Link to sqlite3 system library") - target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) -+ target_link_libraries(SQLiteCpp PRIVATE sqlite3) ++ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3) if(SQLite3_VERSION VERSION_LESS "3.19") set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") endif() diff --git a/ports/sqlitecpp/CONTROL b/ports/sqlitecpp/CONTROL index d05dcec852980f..a0566c03773123 100644 --- a/ports/sqlitecpp/CONTROL +++ b/ports/sqlitecpp/CONTROL @@ -1,5 +1,5 @@ Source: sqlitecpp -Version: 3.0.0 +Version: 3.1.1 Build-Depends: sqlite3 Homepage: https://github.com/SRombauts/SQLiteCpp Description: SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper. diff --git a/ports/sqlitecpp/fix_dependency.patch b/ports/sqlitecpp/fix_dependency.patch new file mode 100644 index 00000000000000..a55c94cffebd8e --- /dev/null +++ b/ports/sqlitecpp/fix_dependency.patch @@ -0,0 +1,11 @@ +diff --git a/cmake/SQLiteCppConfig.cmake.in b/cmake/SQLiteCppConfig.cmake.in +index 568922f..01196db 100644 +--- a/cmake/SQLiteCppConfig.cmake.in ++++ b/cmake/SQLiteCppConfig.cmake.in +@@ -1,5 +1,5 @@ + include(CMakeFindDependencyMacro) +-find_dependency(SQLite3 REQUIRED) ++find_dependency(unofficial-sqlite3 REQUIRED) + if(@UNIX@) + set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) + find_dependency(Threads REQUIRED) diff --git a/ports/sqlitecpp/portfile.cmake b/ports/sqlitecpp/portfile.cmake index 9f2febab0fc1d8..85e4e819ed5e96 100644 --- a/ports/sqlitecpp/portfile.cmake +++ b/ports/sqlitecpp/portfile.cmake @@ -2,11 +2,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH REPO "SRombauts/SQLiteCpp" - REF be1a8eeace02ce98dfa3da688d1011c5bb895985 #v3.0.0 + REF 3.1.1 HEAD_REF master - SHA512 d48b5915a2674f7f6da2737fa365e2202373e95cd20e819281b765a597e2fa8b8ae33f6553d65b6a8a93741e31633de3c75caf84fffa4313154c43ce634b1323 + SHA512 9030b5249c149db8a5b2fe350f71613e4ee91061765a771640ed3ffa7c24aada4000ba884ef91790fdc0f13dc4519038c1edeba64b85b85ac09c3e955a7988a1 PATCHES 0001-Find-external-sqlite3.patch + fix_dependency.patch ) vcpkg_configure_cmake( diff --git a/ports/stb/CONTROL b/ports/stb/CONTROL index d54f21412a5221..b048cb8a057b53 100644 --- a/ports/stb/CONTROL +++ b/ports/stb/CONTROL @@ -1,4 +1,4 @@ Source: stb -Version: 2020-02-08 +Version: 2020-02-08-1 Homepage: https://github.com/nothings/stb Description: public domain header-only libraries diff --git a/ports/stb/vcpkg-cmake-wrapper.cmake b/ports/stb/vcpkg-cmake-wrapper.cmake index e13d523becdc6d..e787d29f05cbe3 100644 --- a/ports/stb/vcpkg-cmake-wrapper.cmake +++ b/ports/stb/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT Stb_INCLUDE_DIR) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH}) diff --git a/ports/stx/CMakeLists.patch b/ports/stx/CMakeLists.patch new file mode 100644 index 00000000000000..70aaccbfda8e73 --- /dev/null +++ b/ports/stx/CMakeLists.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4ed99e..b0d2b15 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -204,12 +204,7 @@ endif() + # =============================================== + + if(STX_ENABLE_BACKTRACE) +- if(NOT EXISTS third_party/abseil) +- execute_process( +- COMMAND git submodule update --init --recursive third_party/abseil +- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) +- endif() +- add_subdirectory(third_party/abseil) ++ find_package(absl CONFIG REQUIRED) + endif() + + # the atomics library doesn't automatically link on my Android phone +@@ -246,13 +241,17 @@ else() + add_library(stx STATIC ${STX_SRCS}) + endif() + +-target_include_directories(stx PUBLIC include) ++target_include_directories(stx PUBLIC ++ $ ++ $ ++) ++ + target_compile_options(stx PRIVATE ${STX_FLAGS} ${STX_WARNING_FLAGS}) + target_compile_definitions(stx PUBLIC ${STX_COMPILER_DEFS}) + target_link_libraries(stx ${STX_LIB_DEPENDENCIES}) + + if(STX_ENABLE_BACKTRACE) +- target_link_libraries(stx absl::stacktrace absl::symbolize) ++ target_link_libraries(stx PUBLIC absl::stacktrace absl::symbolize) + endif() + + if(ANDROID) +@@ -288,6 +287,7 @@ endif() + # + # =============================================== + ++ + if(STX_BUILD_BENCHMARKS) + + if(NOT EXISTS third_party/benchmark) +@@ -433,3 +433,24 @@ if(STX_BUILD_DOCS) + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/docs/html/assets) + + endif() ++ ++install( ++ TARGETS stx ++ EXPORT stx ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++) ++ ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ ++ DESTINATION include ++ FILES_MATCHING PATTERN "*.h*") ++ ++install( ++ EXPORT stx ++ DESTINATION share/stx ++ FILE stxConfig.cmake ++ NAMESPACE stx:: ++) ++ diff --git a/ports/stx/CONTROL b/ports/stx/CONTROL new file mode 100644 index 00000000000000..cd6886925d1d35 --- /dev/null +++ b/ports/stx/CONTROL @@ -0,0 +1,8 @@ +Source: stx +Version: 1.0.1 +Homepage: https://github.com/lamarrr/STX +Description: C++17 & C++ 20 error-handling and utility extensions + +Feature: backtrace +Description: stacktrace support for STX +Build-Depends: abseil diff --git a/ports/stx/portfile.cmake b/ports/stx/portfile.cmake new file mode 100644 index 00000000000000..ebfca54ab39778 --- /dev/null +++ b/ports/stx/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lamarrr/STX + REF v1.0.1 + SHA512 544ca32f07cd863082fa9688f5d56e2715b0129ff90d2a8533cc24a92c943e5848c4b2b06a71f54c12668f6e89e9e3c649f595f9eb886f671a5fa18d343f794b + HEAD_REF master + PATCHES + "CMakeLists.patch" +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + backtrace STX_ENABLE_BACKTRACE +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DSTX_BUILD_DOCS=OFF + -DSTX_BUILD_BENCHMARKS=OFF + -DSTX_BUILD_SHARED=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/stx) +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" +) diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 5481ea4014540a..832306d5a8c37f 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,9 +1,5 @@ Source: suitesparse -Version: 5.4.0-6 -Build-Depends: clapack (!osx) -Homepage: http://faculty.cse.tamu.edu/davis/SuiteSparse +Version: 5.8.0 +Build-Depends: lapack, metis +Homepage: http://suitesparse.com Description: algebra library - -Feature: metis -Build-Depends: metis -Description: Use metis in SuiteSparse diff --git a/ports/suitesparse/FindCXSparse.cmake b/ports/suitesparse/FindCXSparse.cmake new file mode 100644 index 00000000000000..94ba41e045f786 --- /dev/null +++ b/ports/suitesparse/FindCXSparse.cmake @@ -0,0 +1,75 @@ +# Distributed under the OSI-approved BSD 3-Clause License. +# +#.rst: +# FindCXSparse +# -------- +# +# Find the CXSparse library +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# The following variables will be defined: +# +# ``CXSparse_FOUND`` +# True if CXSparse found on the local system +# +# ``CXSPARSE_FOUND`` +# True if CXSparse found on the local system +# +# ``CXSparse_INCLUDE_DIRS`` +# Location of CXSparse header files +# +# ``CXSPARSE_INCLUDE_DIRS`` +# Location of CXSparse header files +# +# ``CXSparse_LIBRARIES`` +# List of the CXSparse libraries found +# +# ``CXSPARSE_LIBRARIES`` +# List of the CXSparse libraries found +# +# + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) +include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) + +find_path(CXSPARSE_INCLUDE_DIR NAMES cs.h) + +find_library(CXSPARSE_LIBRARY_RELEASE NAMES cxsparse libcxsparse) +find_library(CXSPARSE_LIBRARY_DEBUG NAMES cxsparsed libcxsparsed) +select_library_configurations(CXSPARSE) + +if(CXSPARSE_INCLUDE_DIR) + set(CXSPARSE_VERSION_FILE ${CXSPARSE_INCLUDE_DIR}/cs.h) + file(READ ${CXSPARSE_INCLUDE_DIR}/cs.h CXSPARSE_VERSION_FILE_CONTENTS) + + string(REGEX MATCH "#define CS_VER [0-9]+" + CXSPARSE_MAIN_VERSION "${CXSPARSE_VERSION_FILE_CONTENTS}") + string(REGEX REPLACE "#define CS_VER ([0-9]+)" "\\1" + CXSPARSE_MAIN_VERSION "${CXSPARSE_MAIN_VERSION}") + + string(REGEX MATCH "#define CS_SUBVER [0-9]+" + CXSPARSE_SUB_VERSION "${CXSPARSE_VERSION_FILE_CONTENTS}") + string(REGEX REPLACE "#define CS_SUBVER ([0-9]+)" "\\1" + CXSPARSE_SUB_VERSION "${CXSPARSE_SUB_VERSION}") + + string(REGEX MATCH "#define CS_SUBSUB [0-9]+" + CXSPARSE_SUBSUB_VERSION "${CXSPARSE_VERSION_FILE_CONTENTS}") + string(REGEX REPLACE "#define CS_SUBSUB ([0-9]+)" "\\1" + CXSPARSE_SUBSUB_VERSION "${CXSPARSE_SUBSUB_VERSION}") + + set(CXSPARSE_VERSION "${CXSPARSE_MAIN_VERSION}.${CXSPARSE_SUB_VERSION}.${CXSPARSE_SUBSUB_VERSION}") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CXSparse + REQUIRED_VARS CXSPARSE_INCLUDE_DIRS CXSPARSE_LIBRARIES + VERSION_VAR CXSPARSE_VERSION) + +set(CXSPARSE_FOUND ${CXSparse_FOUND}) +set(CXSPARSE_INCLUDE_DIRS ${CXSPARSE_INCLUDE_DIR}) +set(CXSPARSE_LIBRARIES ${CXSPARSE_LIBRARY}) +set(CXSparse_INCLUDE_DIRS ${CXSPARSE_INCLUDE_DIR}) +set(CXSparse_LIBRARIES ${CXSPARSE_LIBRARY}) diff --git a/ports/suitesparse/add-find-package-metis.patch b/ports/suitesparse/add-find-package-metis.patch deleted file mode 100644 index 297309ea08728a..00000000000000 --- a/ports/suitesparse/add-find-package-metis.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b8c2e63..d443390 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -199,12 +199,15 @@ if(LAPACK_FOUND AND BLAS_FOUND) - endif() # LAPACK is not found - - IF(BUILD_METIS OR USE_VCPKG_METIS) -+ find_package(metis REQUIRED) - set(SuiteSparse_LINKER_METIS_LIBS "metis") - ## namespaced library target for config -- set(SuiteSparse_EXPORTED_METIS_LIBS "SuiteSparse::metis") -+ set(SuiteSparse_EXPORTED_METIS_LIBS "metis") -+ set(SuiteSparse_FIND_PACKAGE_METIS "find_package(metis REQUIRED)") - else() - set(SuiteSparse_LINKER_METIS_LIBS "") - set(SuiteSparse_EXPORTED_METIS_LIBS "") -+ set(SuiteSparse_FIND_PACKAGE_METIS "") - ENDIF() - - add_subdirectory(SuiteSparse) -diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt -index 5ef08a6..6c7abfd 100644 ---- a/SuiteSparse/CMakeLists.txt -+++ b/SuiteSparse/CMakeLists.txt -@@ -13,7 +13,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug") - - # Global flags: - IF (BUILD_METIS OR USE_VCPKG_METIS) -- INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include") -+ #INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include") - ELSE () - ADD_DEFINITIONS(-DNPARTITION) - ENDIF () -diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in -index 49387b8..553d9c7 100644 ---- a/cmake/SuiteSparse-config-install.cmake.in -+++ b/cmake/SuiteSparse-config-install.cmake.in -@@ -5,6 +5,7 @@ get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) - get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) - - find_package(LAPACK REQUIRED) -+@SuiteSparse_FIND_PACKAGE_METIS@ - - # Load targets from the install tree. - include(${_SuiteSparse_SELF_DIR}/suitesparse-targets.cmake) diff --git a/ports/suitesparse/build_fixes.patch b/ports/suitesparse/build_fixes.patch new file mode 100644 index 00000000000000..2734bb02cef03f --- /dev/null +++ b/ports/suitesparse/build_fixes.patch @@ -0,0 +1,281 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9602cce..dafb434 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,14 +5,6 @@ + # Updated by jesnault (jerome.esnault@inria.fr) 2014-01-21 + # ----------------------------------------------------------------- + +-option(HUNTER_ENABLED "Enable Hunter package manager support" OFF) +-include(cmake/HunterGate.cmake) +- +-HunterGate( +- URL "https://github.com/ruslo/hunter/archive/v0.23.214.tar.gz" +- SHA1 "e14bc153a7f16d6a5eeec845fb0283c8fad8c358" +-) +- + PROJECT(SuiteSparseProject) + + cmake_minimum_required(VERSION 3.1) +@@ -47,29 +39,9 @@ else() + message(STATUS "Using user defined CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") + endif() + +-# Fix GKlib path: +-IF(NOT WIN32) +- SET(GKLIB_PATH "${${PROJECT_NAME}_SOURCE_DIR}/SuiteSparse/metis-5.1.0/GKlib" CACHE INTERNAL "Path to GKlib (for METIS)" FORCE) +-ENDIF() +- +-# allow creating DLLs in Windows without touching the source code: +-IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.4.0" AND WIN32) +- set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +-ENDIF() +- + ## get CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBDIR + include(GNUInstallDirs) + +-if(CMAKE_SIZEOF_VOID_P MATCHES "8") +- set(SUITESPARSE_LIB_POSTFIX "64") +-else() +- set(SUITESPARSE_LIB_POSTFIX "") +-endif() +- +-## get POSTFIX for lib install dir +-set(LIB_POSTFIX "${SUITESPARSE_LIB_POSTFIX}" CACHE STRING "suffix for 32/64 inst dir placement") +-mark_as_advanced(LIB_POSTFIX) +- + # We want libraries to be named "libXXX" and "libXXXd" in all compilers: + # ------------------------------------------------------------------------ + set(CMAKE_DEBUG_POSTFIX "d") +@@ -77,59 +49,6 @@ IF(MSVC) + set(SP_LIB_PREFIX "lib") # Libs are: "libXXX" + ENDIF(MSVC) + +-## check if we can build metis +-SET(BUILD_METIS_DEFAULT ON) +-if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/SuiteSparse/metis-5.1.0/CMakeLists.txt") +- SET(BUILD_METIS_DEFAULT OFF) +-endif() +- +-SET(WITH_CUDA OFF CACHE BOOL "Build with CUDA support") +- +-SET(BUILD_METIS ${BUILD_METIS_DEFAULT} CACHE BOOL "Build METIS for partitioning?") +-SET(METIS_DIR ${${PROJECT_NAME}_SOURCE_DIR}/SuiteSparse/metis-5.1.0 CACHE PATH "Source directory of METIS") +- +-if(BUILD_METIS) +- ## prepare the installation : +- ## using metis target here is not possible because this target is added in another branch of the CMake structure +- ## TRICK: need to dynamically modify the metis CMakeLists.txt file before it going to parsed... +- ## (very ugly/poor for a metis project get from SCM (git/svn/cvs) but it's works ;) and it doesn't matter if metis was get from .zip) +- if(EXISTS "${METIS_DIR}/libmetis/CMakeLists.txt") +- file(READ "${METIS_DIR}/libmetis/CMakeLists.txt" contentFile) +- string(REGEX MATCH "EXPORT SuiteSparseTargets" alreadyModified ${contentFile}) ## use a string pattern to check if we have to do the modif +- if(NOT alreadyModified) +- file(APPEND "${METIS_DIR}/libmetis/CMakeLists.txt" +- " +- set_target_properties(metis PROPERTIES PUBLIC_HEADER \"../include/metis.h\") +- install(TARGETS metis ## this line is also the string pattern to check if the modification had already done +- EXPORT SuiteSparseTargets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- PUBLIC_HEADER DESTINATION include +- ) +- " +- ) +- endif() +- endif() +- add_subdirectory(SuiteSparse/metis-5.1.0) ## important part for building metis from its src files +-endif(BUILD_METIS) +- +- +-## For EXPORT only : +-## Previous version of cmake (>2.8.12) doesn't auto take into account external lib (here I mean blas and lapack) we need to link to for our current target we want to export. +-## Or at least we need to investigate how to do with previous version. +-## This may cause some trouble in case you want to build in static mode and then use it into another custom project. +-## You will need to manually link your target into your custom project to the correct dependencies link interfaces. +-if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" GREATER 2.8.11) ## (policies introduced both in 2.8.12) +- set(EXPORT_USE_INTERFACE_LINK_LIBRARIES ON CACHE BOOL "") +- mark_as_advanced(EXPORT_USE_INTERFACE_LINK_LIBRARIES) +- if(EXPORT_USE_INTERFACE_LINK_LIBRARIES) +- cmake_policy(SET CMP0023 NEW) ## just for respecting the new target_link_libraries(...) signature procedure +- cmake_policy(SET CMP0022 NEW) ## use INTERFACE_LINK_LIBRARIES property for in-build targets and ignore old properties (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_)? +- ## Here, next version of cmake 2.8.12 auto take into account the link interface dependencies (see generated cmake/SuiteSparse-config*.cmake into your install dir) +- endif() +-endif() +- + ## install_suitesparse_project(targetName headersList) + ## factorise the way we will install all projects (part of the suitesparse project) + ## is the target of the current project you build +@@ -176,16 +95,16 @@ macro(declare_suitesparse_library targetName srcsList headersList) + set(dsl_TARGET_PUBLIC_LINK "") + endif() + if(WITH_CUDA) +- find_package(CUDA) ++ find_package(CUDA REQUIRED) + endif() +- IF(${CUDA_FOUND}) ++ IF(CUDA_FOUND) + INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${SuiteSparse_GPUQREngine_INCLUDE}) + INCLUDE_DIRECTORIES(${SuiteSparse_GPURuntime_INCLUDE}) + CUDA_ADD_LIBRARY(${targetName} ${srcsList} ${headersList}) +- ELSE(${CUDA_FOUND}) ++ ELSE() + ADD_LIBRARY(${targetName} ${srcsList} ${headersList}) +- ENDIF(${CUDA_FOUND}) ++ ENDIF() + SET_TARGET_PROPERTIES(${targetName} PROPERTIES + OUTPUT_NAME ${SP_LIB_PREFIX}${targetName} + ) +@@ -211,44 +130,30 @@ MACRO(REMOVE_MATCHING_FILES_FROM_LIST match_expr lst_files) + ENDMACRO(REMOVE_MATCHING_FILES_FROM_LIST) + + if(WITH_CUDA) +- FIND_PACKAGE(cuda) +- IF(${CUDA_FOUND}) ++ FIND_PACKAGE(CUDA REQUIRED) ++ IF(CUDA_FOUND) + ADD_DEFINITIONS(-DGPU_BLAS) +- ENDIF(${CUDA_FOUND}) ++ ENDIF() + endif() + +-hunter_add_package(LAPACK) # only in effect if HUNTER_ENABLED is set +-# prefer LAPACK config file +-find_package(LAPACK CONFIG) +-if (LAPACK_FOUND AND TARGET blas AND TARGET lapack) +- message(STATUS "found lapack and blas config file. Linking targets lapack and blas") +- message(STATUS "- LAPACK_CONFIG: ${LAPACK_CONFIG}") +- set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS lapack blas) +- # for suitesparse-config file set method used to find LAPACK (and BLAS) +- set(SuiteSparse_LAPACK_used_CONFIG YES) +-else() +- # missing config file or targets, try BLAS and LAPACK +- find_package(BLAS) +- find_package(LAPACK) +- if (BLAS_FOUND AND LAPACK_FOUND) ++ find_package(BLAS REQUIRED) ++ find_package(LAPACK REQUIRED) + message(STATUS "found lapack and blas config file. Linking targets lapack and blas") + message(STATUS "- LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}") + message(STATUS "- BLAS_LIBRARIES: ${BLAS_LIBRARIES}") + set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) + # for suitesparse-config file set method used to find LAPACK (and BLAS) + set(SuiteSparse_LAPACK_used_CONFIG NO) +- else () # LAPACK is not found +- message(FATAL_ERROR "lapack not found") +- endif() +-endif() + +-IF(BUILD_METIS) ++IF(USE_VCPKG_METIS) ++ find_package(metis REQUIRED) + set(SuiteSparse_LINKER_METIS_LIBS "metis") +- ## namespaced library target for config +- set(SuiteSparse_EXPORTED_METIS_LIBS "SuiteSparse::metis") ++ set(SuiteSparse_EXPORTED_METIS_LIBS "metis") ++ set(SuiteSparse_FIND_DEPENDENCY_METIS "find_dependency(metis REQUIRED)") + else() + set(SuiteSparse_LINKER_METIS_LIBS "") + set(SuiteSparse_EXPORTED_METIS_LIBS "") ++ set(SuiteSparse_FIND_PACKAGE_METIS "") + ENDIF() + + add_subdirectory(SuiteSparse) +@@ -287,7 +192,7 @@ endmacro() + # get SuiteSparse version + get_SuiteSparse_Version() + +-set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/suitesparse-${SuiteSparse_VERSION}) ++set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/suitesparse) + ## create targets file + export(EXPORT SuiteSparseTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/suitesparse/suitesparse-targets.cmake" +@@ -301,7 +206,7 @@ configure_file(cmake/SuiteSparse-config-install.cmake.in + ## do the EXPORT for allowing other project to easily use suitesparse with cmake + install(EXPORT SuiteSparseTargets + FILE +- SuiteSparse-targets.cmake ++ suitesparse-targets.cmake + NAMESPACE + SuiteSparse:: + DESTINATION +diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt +index c6e2834..6fdfb01 100644 +--- a/SuiteSparse/CMakeLists.txt ++++ b/SuiteSparse/CMakeLists.txt +@@ -1,23 +1,5 @@ + PROJECT(SuiteSparse) + +-# Set optimized building: +-IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") +- # only optimize for native processer when NOT cross compiling +- if(NOT CMAKE_CROSSCOMPILING) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=native") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=native") +- endif(NOT CMAKE_CROSSCOMPILING) +-ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug") +- +-# Global flags: +-IF (BUILD_METIS) +- INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include") +-ELSE (BUILD_METIS) +- ADD_DEFINITIONS(-DNPARTITION) +-ENDIF ( BUILD_METIS) +- + # Disable COMPLEX numbers: disable it by default, since it causes problems in some platforms. + SET(HAVE_COMPLEX OFF CACHE BOOL "Enables building SuiteSparse with complex numbers (disabled by default to avoid problems in some platforms)") + IF (NOT HAVE_COMPLEX) +@@ -38,12 +20,12 @@ if(WITH_CUDA) + set(SUBPROJECTS_TO_ADD + ${SUBPROJECTS_TO_ADD} + SuiteSparse_GPURuntime +- GPUQREngine ++ GPUQREngine + ) + endif() + + set(SUBPROJECTS_TO_ADD +- ${SUBPROJECTS_TO_ADD} ++ ${SUBPROJECTS_TO_ADD} + SuiteSparse_config + AMD + BTF +diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in +index 1e587d1..fd8f3a7 100644 +--- a/cmake/SuiteSparse-config-install.cmake.in ++++ b/cmake/SuiteSparse-config-install.cmake.in +@@ -2,20 +2,14 @@ + get_filename_component(_SuiteSparse_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_SELF_DIR}" PATH) + get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) +-get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) + + include(CMakeFindDependencyMacro) +-if (@SuiteSparse_LAPACK_used_CONFIG@) # SuiteSparse_LAPACK_used_CONFIG +- # use config file which provides LAPACK (and BLAS) for us +- find_dependency(LAPACK CONFIG) +-else() +- # try to find BLAS and LAPACK with modules + find_dependency(BLAS) + find_dependency(LAPACK) +-endif () ++ @SuiteSparse_FIND_DEPENDENCY_METIS@ + + # Load targets from the install tree. +-include(${_SuiteSparse_SELF_DIR}/SuiteSparse-targets.cmake) ++include(${_SuiteSparse_SELF_DIR}/suitesparse-targets.cmake) + + # Report SuiteSparse header search locations. + set(SuiteSparse_INCLUDE_DIRS ${_SuiteSparse_PREFIX}/include) +@@ -39,3 +33,7 @@ set(SuiteSparse_LIBRARIES + + unset(_SuiteSparse_PREFIX) + unset(_SuiteSparse_SELF_DIR) ++set(SUITESPARSE_FOUND TRUE) ++set(SuiteSparse_FOUND TRUE) ++set(SUITESPARSE_LIBRARIES ${SuiteSparse_LIBRARIES}) ++set(SUITESPARSE_INCLUDE_DIRS ${SuiteSparse_INCLUDE_DIRS}) diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index d5568812126969..44dfa8c36234b4 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -1,54 +1,41 @@ -set(SUITESPARSE_VER 5.4.0) -set(SUITESPARSEWIN_VER 1.4.0) - -vcpkg_download_distfile(SUITESPARSE - URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${SUITESPARSE_VER}.tar.gz" - FILENAME "SuiteSparse-${SUITESPARSE_VER}.tar.gz" - SHA512 8328bcc2ef5eb03febf91b9c71159f091ff405c1ba7522e53714120fcf857ceab2d2ecf8bf9a2e1fc45e1a934665a341e3a47f954f87b59934f4fce6164775d6 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${SUITESPARSE} + REPO DrTimothyAldenDavis/SuiteSparse + REF 71e330ca2bc0a2f12f416c461d23dbca21db4d8f + SHA512 06c75927c924cfd5511b07504e826714f504586243d6f3449d67408a33f3ecea824a7f2de7a165171791b9bda4fc09c0d7093125970895c2ed8d4d37ca1d5a3d + HEAD_REF master ) vcpkg_from_github( OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH REPO jlblancoc/suitesparse-metis-for-windows - REF v${SUITESPARSEWIN_VER} - SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162 + REF c11e8dd7a2ef7d0d93af4c16f75374dd8ca029e2 + SHA512 fbd2a9e6f7df47eeb5d890c7b286bef7fc4c8bcb22783ce800723bacaf2cfe902177828ce5b9e1c2ed9fb5c54591c5fb046a8667e7d354d452a4baac693e47d2 HEAD_REF master PATCHES - suitesparse.patch - add-find-package-metis.patch + build_fixes.patch ) # Copy suitesparse sources. -message(STATUS "Copying SuiteSparse source files...") +message(STATUS "Overwriting SuiteSparseWin source files with SuiteSparse source files...") # Should probably remove everything but CMakeLists.txt files? file(GLOB SUITESPARSE_SOURCE_FILES ${SOURCE_PATH}/*) foreach(SOURCE_FILE ${SUITESPARSE_SOURCE_FILES}) file(COPY ${SOURCE_FILE} DESTINATION "${SUITESPARSEWIN_SOURCE_PATH}/SuiteSparse") endforeach() -message(STATUS "Copying SuiteSparse source files... done") -message(STATUS "Removing integrated lapack and metis libs...") +message(STATUS "Overwriting SuiteSparseWin source files with SuiteSparse source files... done") +message(STATUS "Removing integrated lapack and metis lib...") file(REMOVE_RECURSE ${SUITESPARSEWIN_SOURCE_PATH}/lapack_windows) -file(REMOVE_RECURSE ${SUITESPARSEWIN_SOURCE_PATH}/metis) -message(STATUS "Removing integrated lapack and metis libs... done") - -set(USE_VCPKG_METIS OFF) -if("metis" IN_LIST FEATURES) - set(USE_VCPKG_METIS ON) - set(ADDITIONAL_BUILD_OPTIONS "-DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}") -endif() +file(REMOVE_RECURSE ${SUITESPARSEWIN_SOURCE_PATH}/SuiteSparse/metis-5.1.0) +message(STATUS "Removing integrated lapack and metis lib... done") vcpkg_configure_cmake( SOURCE_PATH ${SUITESPARSEWIN_SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_METIS=OFF - -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} - ${ADDITIONAL_BUILD_OPTIONS} + -DUSE_VCPKG_METIS=ON + "-DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}" OPTIONS_DEBUG -DSUITESPARSE_INSTALL_PREFIX="${CURRENT_PACKAGES_DIR}/debug" OPTIONS_RELEASE @@ -57,9 +44,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/suitesparse-${SUITESPARSE_VER}) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/suitesparse) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(INSTALL ${SUITESPARSEWIN_SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright_suitesparse-metis-for-windows) + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cxsparse) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper_cxsparse.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/cxsparse RENAME vcpkg-cmake-wrapper.cmake) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCXSparse.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/cxsparse) diff --git a/ports/suitesparse/suitesparse.patch b/ports/suitesparse/suitesparse.patch deleted file mode 100644 index 2255565ac173b1..00000000000000 --- a/ports/suitesparse/suitesparse.patch +++ /dev/null @@ -1,151 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3486f05..b8c2e63 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -191,68 +191,14 @@ if(WITH_CUDA) - ENDIF(${CUDA_FOUND}) - endif() - --find_package(BLAS) --find_package(LAPACK) --if (LAPACK_FOUND AND BLAS_FOUND) -+find_package(BLAS REQUIRED) -+find_package(LAPACK REQUIRED) -+if(LAPACK_FOUND AND BLAS_FOUND) - message(STATUS "found lapack and blas config file. Linking targets lapack and blas") - set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) --else () # LAPACK is not found -- --## Need to use SuiteSparse_LINKER_LAPACK_BLAS_LIBS in our subproject in case of SHARED flag is set to ON --SET(SUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS OFF CACHE BOOL "Check if you have custom LAPACK/BLAS libraries (AMD,...)") --IF (SUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS) -- SET(SUITESPARSE_CUSTOM_BLAS_LIB "" CACHE FILE "Path to custom library file for BLAS") -- SET(SUITESPARSE_CUSTOM_LAPACK_LIB "" CACHE FILE "Path to custom library file for LAPACK") -- IF (NOT EXISTS "${SUITESPARSE_CUSTOM_BLAS_LIB}" OR NOT EXISTS "${SUITESPARSE_CUSTOM_LAPACK_LIB}") -- MESSAGE("*Error*: Correctly set SUITESPARSE_CUSTOM_BLAS_LIB and SUITESPARSE_CUSTOM_LAPACK_LIB or uncheck SUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS") -- ELSE() -- SET(SuiteSparse_LINKER_LAPACK_BLAS_LIBS ${SUITESPARSE_CUSTOM_BLAS_LIB} ${SUITESPARSE_CUSTOM_LAPACK_LIB}) -- ENDIF() --ELSE() -- IF (UNIX) -- SET(SuiteSparse_LINKER_LAPACK_BLAS_LIBS lapack blas rt) -- ELSE() -- IF(CMAKE_SIZEOF_VOID_P EQUAL 8) # Size in bytes! -- set(PATH_WORD_SIZE "x64") -- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) # Size in bytes! -- set(PATH_WORD_SIZE "x32") -- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) -- -- add_library(blas SHARED IMPORTED) -- set_property(TARGET blas PROPERTY IMPORTED_LOCATION ${SuiteSparseProject_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/libblas.dll) -- set_property(TARGET blas PROPERTY IMPORTED_IMPLIB ${SuiteSparseProject_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/libblas.lib) -- -- add_library(lapack SHARED IMPORTED) -- set_property(TARGET lapack PROPERTY IMPORTED_LOCATION ${SuiteSparseProject_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/liblapack.dll) -- set_property(TARGET lapack PROPERTY IMPORTED_IMPLIB ${SuiteSparseProject_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/liblapack.lib) -- -- SET(SuiteSparse_LINKER_LAPACK_BLAS_LIBS blas lapack) -- -- ## install lapack and blas dependencies -- file(GLOB lapack_blas_windows_libs "${CMAKE_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/*.lib") -- file(GLOB lapack_blas_windows_dll "${CMAKE_SOURCE_DIR}/lapack_windows/${PATH_WORD_SIZE}/*.dll") -- if(lapack_blas_windows_dll AND lapack_blas_windows_libs) -- set(SuiteSparse_LAPACK_BLAS_LIB_DIR "lib${LIB_POSTFIX}/lapack_blas_windows") -- install(FILES ${lapack_blas_windows_libs} -- ${lapack_blas_windows_dll} -- DESTINATION ${SuiteSparse_LAPACK_BLAS_LIB_DIR} -- ) -- endif() -- ENDIF() --ENDIF() --ENDIF() # LAPACK found -- --if(SuiteSparse_LAPACK_BLAS_LIB_DIR) # "Export" the imported targets in config.cmake manually -- set(ExternConfig "add_library(blas SHARED IMPORTED) -- set_property(TARGET blas PROPERTY IMPORTED_LOCATION \${_SuiteSparse_PREFIX}/${SuiteSparse_LAPACK_BLAS_LIB_DIR}/libblas.dll) -- set_property(TARGET blas PROPERTY IMPORTED_IMPLIB \${_SuiteSparse_PREFIX}/${SuiteSparse_LAPACK_BLAS_LIB_DIR}/libblas.lib) -- -- add_library(lapack SHARED IMPORTED) -- set_property(TARGET lapack PROPERTY IMPORTED_LOCATION \${_SuiteSparse_PREFIX}/${SuiteSparse_LAPACK_BLAS_LIB_DIR}/liblapack.dll) -- set_property(TARGET lapack PROPERTY IMPORTED_IMPLIB \${_SuiteSparse_PREFIX}/${SuiteSparse_LAPACK_BLAS_LIB_DIR}/liblapack.lib)") --endif() -+endif() # LAPACK is not found - --IF(BUILD_METIS) -+IF(BUILD_METIS OR USE_VCPKG_METIS) - set(SuiteSparse_LINKER_METIS_LIBS "metis") - ## namespaced library target for config - set(SuiteSparse_EXPORTED_METIS_LIBS "SuiteSparse::metis") -@@ -311,7 +257,7 @@ configure_file(cmake/SuiteSparse-config-install.cmake.in - ## do the EXPORT for allowing other project to easily use suitesparse with cmake - install(EXPORT SuiteSparseTargets - FILE -- SuiteSparse-targets.cmake -+ suitesparse-targets.cmake - NAMESPACE - SuiteSparse:: - DESTINATION -diff --git a/SuiteSparse/CHOLMOD/Include/cholmod_blas.h b/SuiteSparse/CHOLMOD/Include/cholmod_blas.h -index aef3e63..907512b 100644 ---- a/SuiteSparse/CHOLMOD/Include/cholmod_blas.h -+++ b/SuiteSparse/CHOLMOD/Include/cholmod_blas.h -@@ -27,6 +27,7 @@ - #elif defined (__linux) || defined (MGLNX86) || defined (ARCH_GLNX86) - #define CHOLMOD_LINUX - #define CHOLMOD_ARCHITECTURE "Linux" -+#define BLAS_NO_UNDERSCORE - - #elif defined (__APPLE__) - #define CHOLMOD_MAC -diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt -index c6e2834..5ef08a6 100644 ---- a/SuiteSparse/CMakeLists.txt -+++ b/SuiteSparse/CMakeLists.txt -@@ -12,11 +12,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug") - ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug") - - # Global flags: --IF (BUILD_METIS) -+IF (BUILD_METIS OR USE_VCPKG_METIS) - INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include") --ELSE (BUILD_METIS) -+ELSE () - ADD_DEFINITIONS(-DNPARTITION) --ENDIF ( BUILD_METIS) -+ENDIF () - - # Disable COMPLEX numbers: disable it by default, since it causes problems in some platforms. - SET(HAVE_COMPLEX OFF CACHE BOOL "Enables building SuiteSparse with complex numbers (disabled by default to avoid problems in some platforms)") -diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in -index cb1f51f..12f654c 100644 ---- a/cmake/SuiteSparse-config-install.cmake.in -+++ b/cmake/SuiteSparse-config-install.cmake.in -@@ -2,15 +2,11 @@ - get_filename_component(_SuiteSparse_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_SELF_DIR}" PATH) - get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) --get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) - --find_package(LAPACK CONFIG) --if (NOT LAPACK_FOUND) # Load the LAPACK package with which we were built. -- @ExternConfig@ --endif () -+find_package(LAPACK REQUIRED) - - # Load targets from the install tree. --include(${_SuiteSparse_SELF_DIR}/SuiteSparse-targets.cmake) -+include(${_SuiteSparse_SELF_DIR}/suitesparse-targets.cmake) - - # Report SuiteSparse header search locations. - set(SuiteSparse_INCLUDE_DIRS ${_SuiteSparse_PREFIX}/include) -@@ -31,6 +27,10 @@ set(SuiteSparse_LIBRARIES - SuiteSparse::spqr - @SuiteSparse_EXPORTED_METIS_LIBS@ - ) -+set(SUITESPARSE_LIBRARIES ${SuiteSparse_LIBRARIES}) - - unset(_SuiteSparse_PREFIX) - unset(_SuiteSparse_SELF_DIR) -+ -+set(SUITESPARSE_FOUND TRUE) -+set(SuiteSparse_FOUND TRUE) diff --git a/ports/suitesparse/vcpkg-cmake-wrapper_cxsparse.cmake b/ports/suitesparse/vcpkg-cmake-wrapper_cxsparse.cmake new file mode 100644 index 00000000000000..67d87e8b69055b --- /dev/null +++ b/ports/suitesparse/vcpkg-cmake-wrapper_cxsparse.cmake @@ -0,0 +1,10 @@ +set(CXSPARSE_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +list(REMOVE_ITEM ARGS "NO_MODULE") +list(REMOVE_ITEM ARGS "CONFIG") +list(REMOVE_ITEM ARGS "MODULE") + +_find_package(${ARGS}) + +set(CMAKE_MODULE_PATH ${CXSPARSE_PREV_MODULE_PATH}) diff --git a/ports/superlu/CONTROL b/ports/superlu/CONTROL index 69d67385cc1754..11b27ea763bf9c 100644 --- a/ports/superlu/CONTROL +++ b/ports/superlu/CONTROL @@ -1,5 +1,7 @@ Source: superlu Version: 2020-01-07 +Port-Version: 2 Build-Depends: openblas Description: Supernodal sparse direct solver. Homepage: https://github.com/xiaoyeli/superlu +Supports: !(uwp|arm) \ No newline at end of file diff --git a/ports/tcl/CONTROL b/ports/tcl/CONTROL index 7a74eafaf366e5..0d451b046ce739 100644 --- a/ports/tcl/CONTROL +++ b/ports/tcl/CONTROL @@ -1,5 +1,6 @@ Source: tcl Version: core-9-0-a1 +Port-Version: 1 Homepage: https://github.com/tcltk/tcl Description: Tcl provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications. diff --git a/ports/tcl/force-shell-install.patch b/ports/tcl/force-shell-install.patch new file mode 100644 index 00000000000000..0725945f7719c6 --- /dev/null +++ b/ports/tcl/force-shell-install.patch @@ -0,0 +1,27 @@ +From 85842ba83b70d99f90ee3fff8c956e82d17759f2 Mon Sep 17 00:00:00 2001 +From: Marek Roszko +Date: Tue, 18 Aug 2020 23:11:27 -0400 +Subject: [PATCH] Remove broken exist check for shell install + +--- + win/makefile.vc | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/win/makefile.vc b/win/makefile.vc +index f5d2f4a..6bffe32 100644 +--- a/win/makefile.vc ++++ b/win/makefile.vc +@@ -869,10 +869,8 @@ install-binaries: + @$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\" + !endif + @$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\" +-!if exist($(TCLSH)) + @echo Installing $(TCLSHNAME) + @$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\" +-!endif + @echo Installing $(TCLSTUBLIBNAME) + @$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\" + +-- +2.28.0.windows.1 + diff --git a/ports/tcl/portfile.cmake b/ports/tcl/portfile.cmake index 6e2757f33967ea..7dbfe7b271545e 100644 --- a/ports/tcl/portfile.cmake +++ b/ports/tcl/portfile.cmake @@ -2,7 +2,9 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tcltk/tcl REF 0fa6a4e5aad821a5c34fdfa070c37c3f1ffc8c8e - SHA512 9d7f35309fe8b1a7c116639aaea50cc01699787c7afb432389bee2b9ad56a67034c45d90c9585ef1ccf15bdabf0951cbef86257c0c6aedbd2591bbfae3e93b76) + SHA512 9d7f35309fe8b1a7c116639aaea50cc01699787c7afb432389bee2b9ad56a67034c45d90c9585ef1ccf15bdabf0951cbef86257c0c6aedbd2591bbfae3e93b76 + PATCHES force-shell-install.patch +) if (VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64") @@ -47,13 +49,28 @@ if (VCPKG_TARGET_IS_WINDOWS) INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0 OPTIONS_RELEASE - ${TCL_BUILD_OPTS} release + ${TCL_BUILD_OPTS} INSTALLDIR=${CURRENT_PACKAGES_DIR} SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0 ) + + # Install + # Note: tcl shell requires it to be in a folder adjacent to the /lib/ folder, i.e. in a /bin/ folder if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + file(GLOB_RECURSE TOOL_BIN + ${CURRENT_PACKAGES_DIR}/bin/*.exe + ${CURRENT_PACKAGES_DIR}/bin/*.dll + ) + file(COPY ${TOOL_BIN} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/bin/) + + # Remove .exes only after copying + file(GLOB_RECURSE TOOL_EXES + ${CURRENT_PACKAGES_DIR}/bin/*.exe + ) + file(REMOVE ${TOOL_EXES}) + file(GLOB_RECURSE TOOLS ${CURRENT_PACKAGES_DIR}/lib/dde1.4/* ${CURRENT_PACKAGES_DIR}/lib/nmake/* @@ -76,6 +93,18 @@ if (VCPKG_TARGET_IS_WINDOWS) ) endif() if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + file(GLOB_RECURSE TOOL_BIN + ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/*.dll + ) + file(COPY ${TOOL_BIN} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug/bin/) + + # Remove .exes only after copying + file(GLOB_RECURSE EXES + ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe + ) + file(REMOVE ${EXES}) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/dde1.4 ${CURRENT_PACKAGES_DIR}/debug/lib/nmake ${CURRENT_PACKAGES_DIR}/debug/lib/reg1.3 @@ -107,4 +136,4 @@ else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) endif() -file(INSTALL ${SOURCE_PATH}/license.terms DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/license.terms DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/teemo/CONTROL b/ports/teemo/CONTROL index 159990ec4fa89e..843f68e834b1a2 100644 --- a/ports/teemo/CONTROL +++ b/ports/teemo/CONTROL @@ -1,5 +1,5 @@ Source: teemo -Version: 1.3 -Build-Depends: curl[non-http], cpprestsdk +Version: 2.1 +Build-Depends: curl[non-http] Description: C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed. Homepage: https://github.com/winsoft666/teemo \ No newline at end of file diff --git a/ports/teemo/portfile.cmake b/ports/teemo/portfile.cmake index b6baba5637bf49..55afaf490f1fef 100644 --- a/ports/teemo/portfile.cmake +++ b/ports/teemo/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO winsoft666/teemo - REF 1ee566747fba3febade554718a2db6a6c71c6fc4 - SHA512 10b391a0c629bdcd3737c1e04ac09300412322c8a4b87a8008d368663a223442fe7d7dac4fbd423b5051afcab60bb4c619cfc451a9c5902d396b7a7081a4d3c4 + REF 99b012f827ba126fe43986e6c9266f656120edd6 + SHA512 b6fcbba897b370154965a5e884a6dbd13aa1dab1ec25f404125b62f3857752b5c8e791a90014ef058e839c21f1deae8b88df2d9a8084a9e48f7f676561aa9dc9 HEAD_REF master ) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index a9830adb24f719..2d0ff50073eb4a 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,6 @@ Source: tensorflow-cc -Version: 1.14-3 +Version: 1.14 +Port-Version: 5 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8d2c187b057b86..0aa53e7aed6d71 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -26,29 +26,34 @@ get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") +vcpkg_find_acquire_program(GIT) +get_filename_component(GIT_DIR "${GIT}" DIRECTORY) +vcpkg_add_to_path(PREPEND ${GIT_DIR}) + function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) if (EXISTS "${PATH_TO_REMOVE}") - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) + _execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) endif() endfunction() -# we currently only support the release version -tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -file(GLOB SOURCES ${SOURCE_PATH}/*) -file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils) + vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_VS} $ENV{VSInstallDir}) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() +# we currently only support the release version +tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +file(RENAME ${SOURCE_PATH} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + # tensorflow has long file names, which will not work on windows set(ENV{TEST_TMPDIR} ${CURRENT_BUILDTREES_DIR}/../.bzl) @@ -79,7 +84,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) message(STATUS "Configuring TensorFlow") vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) diff --git a/ports/theia/CONTROL b/ports/theia/CONTROL index 2d527adcdf1295..521468056ad91c 100644 --- a/ports/theia/CONTROL +++ b/ports/theia/CONTROL @@ -1,5 +1,6 @@ Source: theia -Version: 0.8-2 +Version: 0.8 +Port-Version: 3 Build-Depends: flann, cereal, ceres[suitesparse], openimageio, glew, freeglut (!osx) Homepage: https://github.com/sweeneychris/TheiaSfM Description: An open source library for multiview geometry and structure from motion diff --git a/ports/theia/fix-external-dependencies.patch b/ports/theia/fix-external-dependencies.patch index 7a4b009611cf99..fc6e540f31e227 100644 --- a/ports/theia/fix-external-dependencies.patch +++ b/ports/theia/fix-external-dependencies.patch @@ -1,7 +1,22 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9c1b150..5810156 100644 +index 9c1b150..1adbfed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt +@@ -105,10 +105,10 @@ add_definitions(-DTHEIA_DATA_DIR="${CMAKE_SOURCE_DIR}/data") + + # Eigen + set(MIN_EIGEN_VERSION 3.2.0) +-find_package(Eigen ${MIN_EIGEN_VERSION} REQUIRED) +-if (EIGEN_FOUND) +- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") +-endif (EIGEN_FOUND) ++find_package(Eigen3 ${MIN_EIGEN_VERSION} REQUIRED) ++if (EIGEN3_FOUND) ++ message("-- Found Eigen version ${EIGEN3_VERSION}: ${EIGEN3_INCLUDE_DIRS}") ++endif (EIGEN3_FOUND) + + # Use a larger inlining threshold for Clang, since it hobbles Eigen, + # resulting in an unreasonably slow version of the blas routines. The @@ -129,70 +129,27 @@ endif () # GFlags. The namespace patch is borrow from Ceres Solver (see license in @@ -299,10 +314,48 @@ index 84f3829..f88d75a 100644 -add_subdirectory(visual_sfm) \ No newline at end of file +add_subdirectory(visual_sfm) +diff --git a/libraries/optimo/CMakeLists.txt b/libraries/optimo/CMakeLists.txt +index 80f5e5f..ea57f1b 100644 +--- a/libraries/optimo/CMakeLists.txt ++++ b/libraries/optimo/CMakeLists.txt +@@ -67,11 +67,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + + # Locations to search for Eigen + # Eigen +-find_package(Eigen REQUIRED) +-if (EIGEN_FOUND) +- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") +-endif (EIGEN_FOUND) +-include_directories(${EIGEN_INCLUDE_DIRS}) ++find_package(Eigen3 REQUIRED) ++if (EIGEN3_FOUND) ++ message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") ++endif (EIGEN3_FOUND) ++include_directories(${EIGEN3_INCLUDE_DIRS}) + + # Setting CXX FLAGS appropriately. The code below was inspired from + # Google CERES and modified for this library. diff --git a/libraries/statx/CMakeLists.txt b/libraries/statx/CMakeLists.txt -index 23b9e49..af236a3 100644 +index 23b9e49..c58a550 100644 --- a/libraries/statx/CMakeLists.txt +++ b/libraries/statx/CMakeLists.txt +@@ -72,11 +72,11 @@ message("-- Default Install prefix: ${CMAKE_INSTALL_PREFIX}") + option(STATX_WITH_CERES "Enables GEV parameter estimation using Ceres" ON) + + # Eigen +-find_package(Eigen REQUIRED) +-if (EIGEN_FOUND) +- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") +-endif (EIGEN_FOUND) +-include_directories(${EIGEN_INCLUDE_DIRS}) ++find_package(Eigen3 REQUIRED) ++if (EIGEN3_FOUND) ++ message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") ++endif (EIGEN3_FOUND) ++include_directories(${EIGEN3_INCLUDE_DIRS}) + + # Google Flags + find_package(Gflags REQUIRED) @@ -103,7 +103,11 @@ if(STATX_WITH_CERES) endif(CERES_FOUND) diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index c131ac095435c3..77b4c11c3d58db 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -15,6 +13,7 @@ vcpkg_from_github( file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake) +file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -40,5 +39,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/datase file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen) # Handle copyright -file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia RENAME copyright) -file(COPY ${SOURCE_PATH}/data/camera_sensor_database_license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia) +file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/data/camera_sensor_database_license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index d8f79b2f90c2f3..f37049768efb92 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,5 +1,5 @@ Source: tiff -Version: 4.0.10-9 +Version: 4.1.0 Build-Depends: zlib, libjpeg-turbo, liblzma Homepage: https://download.osgeo.org/libtiff Description: A library that supports the manipulation of TIFF image files diff --git a/ports/tiff/cmakelists.patch b/ports/tiff/cmakelists.patch index 597c980c5571f4..a82de0452b33be 100644 --- a/ports/tiff/cmakelists.patch +++ b/ports/tiff/cmakelists.patch @@ -73,21 +73,6 @@ diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index 1cf1b75..4ee29f6 100644 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt -@@ -104,11 +104,11 @@ set(tiffxx_HEADERS - set(tiffxx_SOURCES - tif_stream.cxx) - --if(WIN32_IO) -- extra_dist(tif_unix.c) -+if(USE_WIN32_FILEIO) -+ extra_dist(tif_win32.c) - list(APPEND tiff_SOURCES tif_win32.c) - else() -- extra_dist(tif_win32.c) -+ extra_dist(tif_unix.c) - list(APPEND tiff_SOURCES tif_unix.c) - endif() - @@ -143,7 +143,7 @@ install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 828e8ec0baedf0..ab610d3287484b 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,9 +1,9 @@ -set(LIBTIFF_VERSION 4.0.10) +set(LIBTIFF_VERSION 4.1.0) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz" FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz" - SHA512 d213e5db09fd56b8977b187c5a756f60d6e3e998be172550c2892dbdb4b2a8e8c750202bc863fe27d0d1c577ab9de1710d15e9f6ed665aadbfd857525a81eea8 + SHA512 fd541dcb11e3d5afaa1ec2f073c9497099727a52f626b338ef87dc93ca2e23ca5f47634015a4beac616d4e8f05acf7b7cd5797fb218758cc2ad31b390491c5a6 ) vcpkg_extract_source_archive_ex( @@ -49,8 +49,8 @@ file(REMOVE_RECURSE ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff) -file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff RENAME copyright) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if ("tool" IN_LIST FEATURES) file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) diff --git a/ports/tinygltf/CONTROL b/ports/tinygltf/CONTROL index 4baf2cf212dcf6..ceba5f92b1148d 100644 --- a/ports/tinygltf/CONTROL +++ b/ports/tinygltf/CONTROL @@ -1,4 +1,5 @@ Source: tinygltf -Version: 2.2.0 +Version: 2020-07-28 +Homepage: https://github.com/syoyo/tinygltf Description: A header only C++11 glTF 2.0 library. Build-Depends: stb, nlohmann-json \ No newline at end of file diff --git a/ports/tinygltf/portfile.cmake b/ports/tinygltf/portfile.cmake index f78f2b0174dfa5..ef263046bb0d49 100644 --- a/ports/tinygltf/portfile.cmake +++ b/ports/tinygltf/portfile.cmake @@ -1,11 +1,9 @@ # Header-only library -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO syoyo/tinygltf - REF v2.2.0 - SHA512 5a63fab31dd49e25fe2a32f66bbcae5a6340ced403dc51de65ee7363bb9b358e546bbecd116a53062099f90a2579a5178dcc5c4268d4b99c0afe30fac20ad7cf + REF 91da29972987bb4d715a09d94ecd2cefd3a487d4 #v2.4.2 + SHA512 bede1f995b8f6cdab04140ab284576444ddb5baa8894150ac697e53bafbe03c339c274a2b9559572751a9408b33750d86105d8d24ebccbdfbc98555e7b3a1efd HEAD_REF master ) diff --git a/ports/tlx/CONTROL b/ports/tlx/CONTROL new file mode 100644 index 00000000000000..b65af72604a4ca --- /dev/null +++ b/ports/tlx/CONTROL @@ -0,0 +1,4 @@ +Source: tlx +Version: 0.5.20191212 +Homepage: https://github.com/tlx/tlx +Description: tlx is a collection of C++ helpers and extensions universally needed, but not found in the STL diff --git a/ports/tlx/portfile.cmake b/ports/tlx/portfile.cmake new file mode 100644 index 00000000000000..525894d28041b9 --- /dev/null +++ b/ports/tlx/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +# TODO: Fix .dlls not producing .lib files + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tlx/tlx + REF 903b9b35df8731496a90d8d74f8bedbad2517d9b + SHA512 17087973f2f4751538c589e9f80d2b5ea872d2e7d90659769ae3350d441bda0b64aec9a4150d01a7cf5323ce327ebd104cdca7b4a3bc4eebdf574e71e013ba6e + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DVERBOSE=1 + -DTLX_BUILD_TESTS=off + -DTLX_USE_GCOV=off + -DTLX_TRY_COMPILE_HEADERS=off + -DTLX_MORE_TESTS=off + -DTLX_BUILD_STATIC_LIBS=${BUILD_STATIC} + -DTLX_BUILD_SHARED_LIBS=${BUILD_SHARED} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake/") +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/tlx") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/toml11/CONTROL b/ports/toml11/CONTROL index 9ba3f67f744b5f..2dc57462d3aaf9 100644 --- a/ports/toml11/CONTROL +++ b/ports/toml11/CONTROL @@ -1,4 +1,4 @@ Source: toml11 -Version: 3.3.0 +Version: 3.5.0 Homepage: https://github.com/ToruNiina/toml11 Description: A C++11 header-only toml parser/encoder depending only on C++ standard library. diff --git a/ports/toml11/portfile.cmake b/ports/toml11/portfile.cmake index 4f056759db2bab..bb35b3dc2c7952 100644 --- a/ports/toml11/portfile.cmake +++ b/ports/toml11/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ToruNiina/toml11 - REF v3.3.0 - SHA512 3de018972bd2d9da193ca3d4746f1a77a120d563dbfb0e8f72800a0b01e24fb95fe83e4bd1a93d4bc10b3a603e7e63dd9478079bd0a31692d8412cbcf4860c37 + REF v3.5.0 + SHA512 19c6ee42aa1e186689062e5d2be05f375c8ae4be40be4b6a8e803a642f37214270d5600ccec3d06b4e69aec6896d823e3a8faea29a41643279922d1fe9fae70a HEAD_REF master ) diff --git a/ports/tomlplusplus/CONTROL b/ports/tomlplusplus/CONTROL new file mode 100644 index 00000000000000..5cba84a104489a --- /dev/null +++ b/ports/tomlplusplus/CONTROL @@ -0,0 +1,5 @@ +Source: tomlplusplus +Version: 2.1.0 +Homepage: https://marzer.github.io/tomlplusplus/ +Description: Header-only TOML config file parser and serializer for modern C++. +Supports: !(arm|uwp|linux|osx) diff --git a/ports/tomlplusplus/portfile.cmake b/ports/tomlplusplus/portfile.cmake new file mode 100644 index 00000000000000..26b8f81713fafd --- /dev/null +++ b/ports/tomlplusplus/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO marzer/tomlplusplus + REF v2.1.0 + SHA512 7bd0ea4ecfc90946487acd545bc8635a85353506c90553f4a6f8e3d83c30f85ac12e1ce82c10e03a4ea335c1b622e64ea0753efca9b2829907996e3a6d28867a + HEAD_REF master +) + +vcpkg_configure_meson( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DGENERATE_CMAKE_CONFIG=enabled + -DBUILD_TESTS=disabled + -DBUILD_EXAMPLES=disabled +) + +vcpkg_install_meson() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/tool-meson/CONTROL b/ports/tool-meson/CONTROL index 483508089e66e3..c5fe40dfc1344b 100644 --- a/ports/tool-meson/CONTROL +++ b/ports/tool-meson/CONTROL @@ -1,4 +1,4 @@ Source: tool-meson -Version: 0.54.2 +Version: 0.55.1 Homepage: https://github.com/mesonbuild/meson Description: Meson build system diff --git a/ports/tool-meson/portfile.cmake b/ports/tool-meson/portfile.cmake index ad32823bdec75c..c39e614071f42d 100644 --- a/ports/tool-meson/portfile.cmake +++ b/ports/tool-meson/portfile.cmake @@ -3,3 +3,5 @@ # Currently is used in ports that call vcpkg_find_acquire_program(MESON) in order to force rebuilds. set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +vcpkg_find_acquire_program(MESON) +message(STATUS "Using meson: ${MESON}") \ No newline at end of file diff --git a/ports/trantor/CONTROL b/ports/trantor/CONTROL index 7bb7c4e7e087cf..14160e5b49045e 100644 --- a/ports/trantor/CONTROL +++ b/ports/trantor/CONTROL @@ -1,5 +1,5 @@ -Source: trantor -Version: v1.0.0-rc14 -Homepage: https://github.com/an-tao/trantor -Description: A non-blocking I/O cross-platform TCP network library, using C++14. -Build-Depends: openssl, c-ares +Source: trantor +Version: v1.0.0-rc16 +Homepage: https://github.com/an-tao/trantor +Description: A non-blocking I/O cross-platform TCP network library, using C++14. +Build-Depends: openssl, c-ares diff --git a/ports/trantor/portfile.cmake b/ports/trantor/portfile.cmake index aa5758d5121d90..b26d10bc1e7110 100644 --- a/ports/trantor/portfile.cmake +++ b/ports/trantor/portfile.cmake @@ -1,26 +1,26 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO an-tao/trantor - REF v1.0.0-rc14 - SHA512 8d7e165afa85e37ba7075c2c180b9c1f92226541f2181092314d9550f6968bb8f7c9f0e121d4dc4984b91733e61db5ad22fd8b4537aa7036ea2cdc95d5789f39 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() - -# Fix CMake files -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Trantor) - -# # Remove includes in debug -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -# Handle copyright -file(INSTALL ${SOURCE_PATH}/License DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# Copy pdb files -vcpkg_copy_pdbs() +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO an-tao/trantor + REF v1.0.0-rc16 + SHA512 b2c3156dd6c213805803e05f86f7d2c70647976a6144ac823e3de99d07f4ff65f08b53004a8783e08256116f94c3b98be92abd7a82e37fb9416b2c92df067bba + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +# Fix CMake files +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Trantor) + +# # Remove includes in debug +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +# Handle copyright +file(INSTALL ${SOURCE_PATH}/License DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# Copy pdb files +vcpkg_copy_pdbs() diff --git a/ports/treehopper/CONTROL b/ports/treehopper/CONTROL index f50e84f1b74462..b54e10dde0f5ad 100644 --- a/ports/treehopper/CONTROL +++ b/ports/treehopper/CONTROL @@ -1,5 +1,5 @@ Source: treehopper -Version: 1.11.3-3 +Version: 1.11.3-4 Description: Treehopper connects the physical world to your computer, tablet, or smartphone. Homepage: https://treehopper.io Build-Depends: libusb diff --git a/ports/treehopper/portfile.cmake b/ports/treehopper/portfile.cmake index 46ed0d85e386d1..c9e9855ceffbe4 100644 --- a/ports/treehopper/portfile.cmake +++ b/ports/treehopper/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( @@ -18,8 +16,9 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(INSTALL ${SOURCE_PATH}/C++/API/inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Treehopper/) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/treehopper RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/upb/CONTROL b/ports/upb/CONTROL index 4ca52fa0377bc5..a24ac31ab2f8ff 100644 --- a/ports/upb/CONTROL +++ b/ports/upb/CONTROL @@ -1,4 +1,4 @@ Source: upb -Version: 2019-10-21-2 +Version: 2020-08-19 Homepage: https://github.com/protocolbuffers/upb/ Description: μpb (often written 'upb') is a small protobuf implementation written in C. diff --git a/ports/upb/add-cmake-install.patch b/ports/upb/add-cmake-install.patch index ece6b8db430195..cdda0340779d7c 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 836c5ff..6eb8bb5 100644 +index 4dd6454..eda6a72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ else() @@ -11,27 +11,25 @@ index 836c5ff..6eb8bb5 100644 cmake_policy(SET CMP0048 NEW) project(upb) -@@ -59,7 +59,7 @@ elseif(UNIX) - endif() +@@ -62,6 +62,7 @@ enable_testing() - enable_testing() -- + add_library(port + upb/port.c) +add_library(descriptor_upbproto INTERFACE) add_library(upb upb/decode.c upb/encode.c -@@ -136,12 +136,35 @@ target_link_libraries(upb_cc_bindings INTERFACE - descriptor_upbproto +@@ -154,6 +155,7 @@ target_link_libraries(upb_cc_bindings INTERFACE handlers + port upb) --add_library(upb_test +if(ENABLE_TESTING) -+add_executable(upb_test + add_library(upb_test tests/testmain.cc tests/test_util.h - tests/upb_test.h) - target_link_libraries(upb_test +@@ -162,5 +164,28 @@ target_link_libraries(upb_test handlers + port upb) +endif() @@ -41,8 +39,9 @@ index 836c5ff..6eb8bb5 100644 + DESTINATION include + FILES_MATCHING + PATTERN "*.h" ++ PATTERN "*.hpp" + PATTERN "*.inc" -+ PATTERN "*.int.h" EXCLUDE ++ PATTERN "*.int.h" +) +target_include_directories(upb PUBLIC $) +install(TARGETS @@ -50,10 +49,10 @@ index 836c5ff..6eb8bb5 100644 + upb_cc_bindings + upb_json + upb_pb ++ port + table + descriptor_upbproto + handlers -+ legacy_msg_reflection + reflection + EXPORT upb-config +) diff --git a/ports/upb/fix-uwp.patch b/ports/upb/fix-uwp.patch index 91c45b416c4f67..bbc8e257a053f5 100644 --- a/ports/upb/fix-uwp.patch +++ b/ports/upb/fix-uwp.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 577000a..759e35b 100644 +index eda6a72..386966f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,10 @@ elseif(UNIX) @@ -11,5 +11,18 @@ index 577000a..759e35b 100644 +endif() + enable_testing() - add_library(descriptor_upbproto INTERFACE) - add_library(upb + + add_library(port +diff --git a/upb/json_decode.c b/upb/json_decode.c +index 953d238..5185ffd 100644 +--- a/upb/json_decode.c ++++ b/upb/json_decode.c +@@ -1138,7 +1138,7 @@ static void jsondec_struct(jsondec *d, upb_msg *msg, const upb_msgdef *m) { + static void jsondec_wellknownvalue(jsondec *d, upb_msg *msg, + const upb_msgdef *m) { + upb_msgval val; +- const upb_fielddef *f; ++ const upb_fielddef *f = NULL; + upb_msg *submsg; + + switch (jsondec_peek(d)) { diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index 9d475670e0f949..fdb59441f115f5 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/upb - REF 9effcbcb27f0a665f9f345030188c0b291e32482 - SHA512 416ff26ec21181d53be23e94203205072152ab3a8e4b3b28d16263a601995fd2d2f8afe5d8cfbecdac8543249482287b9fe6129314f7c9a7880660f5508bb85e + REF 7338facddb8ce405fe7a0a52a6061a1e7c823279 + SHA512 a2ece65612ca7c3cdc7b79994aa488623e5ce4227988611ab60724fae5dc7ba9311363bf5c73f6c74910a6b91392e0a231c28f0b2f4c8cc2c4d4328ed33bc265 HEAD_REF master PATCHES add-cmake-install.patch diff --git a/ports/v8/3f8dc4b.patch b/ports/v8/3f8dc4b.patch new file mode 100644 index 00000000000000..6360a1d3479485 --- /dev/null +++ b/ports/v8/3f8dc4b.patch @@ -0,0 +1,155 @@ +diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc +index ad831c5..bcd4403 100644 +--- a/src/objects/js-number-format.cc ++++ b/src/objects/js-number-format.cc +@@ -1241,44 +1241,33 @@ + } + + namespace { +-Maybe IcuFormatNumber( ++Maybe IcuFormatNumber( + Isolate* isolate, + const icu::number::LocalizedNumberFormatter& number_format, +- Handle numeric_obj, icu::FieldPositionIterator* fp_iter) { ++ Handle numeric_obj, icu::number::FormattedNumber* formatted) { + // If it is BigInt, handle it differently. + UErrorCode status = U_ZERO_ERROR; +- icu::number::FormattedNumber formatted; + if (numeric_obj->IsBigInt()) { + Handle big_int = Handle::cast(numeric_obj); + Handle big_int_string; + ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string, + BigInt::ToString(isolate, big_int), +- Nothing()); +- formatted = number_format.formatDecimal( ++ Nothing()); ++ *formatted = number_format.formatDecimal( + {big_int_string->ToCString().get(), big_int_string->length()}, status); + } else { + double number = numeric_obj->IsNaN() + ? std::numeric_limits::quiet_NaN() + : numeric_obj->Number(); +- formatted = number_format.formatDouble(number, status); ++ *formatted = number_format.formatDouble(number, status); + } + if (U_FAILURE(status)) { + // This happen because of icu data trimming trim out "unit". + // See https://bugs.chromium.org/p/v8/issues/detail?id=8641 +- THROW_NEW_ERROR_RETURN_VALUE(isolate, +- NewTypeError(MessageTemplate::kIcuError), +- Nothing()); ++ THROW_NEW_ERROR_RETURN_VALUE( ++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing()); + } +- if (fp_iter) { +- formatted.getAllFieldPositions(*fp_iter, status); +- } +- icu::UnicodeString result = formatted.toString(status); +- if (U_FAILURE(status)) { +- THROW_NEW_ERROR_RETURN_VALUE(isolate, +- NewTypeError(MessageTemplate::kIcuError), +- Nothing()); +- } +- return Just(result); ++ return Just(true); + } + + } // namespace +@@ -1289,10 +1278,16 @@ + Handle numeric_obj) { + DCHECK(numeric_obj->IsNumeric()); + +- Maybe maybe_format = +- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr); ++ icu::number::FormattedNumber formatted; ++ Maybe maybe_format = ++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted); + MAYBE_RETURN(maybe_format, Handle()); +- return Intl::ToString(isolate, maybe_format.FromJust()); ++ UErrorCode status = U_ZERO_ERROR; ++ icu::UnicodeString result = formatted.toString(status); ++ if (U_FAILURE(status)) { ++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String); ++ } ++ return Intl::ToString(isolate, result); + } + + namespace { +@@ -1405,12 +1400,18 @@ + } + + namespace { +-Maybe ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, +- icu::FieldPositionIterator* fp_iter, ++Maybe ConstructParts(Isolate* isolate, ++ icu::number::FormattedNumber* formatted, + Handle result, int start_index, + Handle numeric_obj, bool style_is_unit) { ++ UErrorCode status = U_ZERO_ERROR; ++ icu::UnicodeString formatted_text = formatted->toString(status); ++ if (U_FAILURE(status)) { ++ THROW_NEW_ERROR_RETURN_VALUE( ++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing()); ++ } + DCHECK(numeric_obj->IsNumeric()); +- int32_t length = formatted.length(); ++ int32_t length = formatted_text.length(); + int index = start_index; + if (length == 0) return Just(index); + +@@ -1419,13 +1420,14 @@ + // other region covers some part of the formatted string. It's possible + // there's another field with exactly the same begin and end as this backdrop, + // in which case the backdrop's field_id of -1 will give it lower priority. +- regions.push_back(NumberFormatSpan(-1, 0, formatted.length())); ++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length())); + + { +- icu::FieldPosition fp; +- while (fp_iter->next(fp)) { +- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(), +- fp.getEndIndex())); ++ icu::ConstrainedFieldPosition cfp; ++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER); ++ while (formatted->nextPosition(cfp, status)) { ++ regions.push_back( ++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit())); + } + } + +@@ -1447,7 +1449,7 @@ + Handle substring; + ASSIGN_RETURN_ON_EXCEPTION_VALUE( + isolate, substring, +- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos), ++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos), + Nothing()); + Intl::AddElement(isolate, result, index, field_type_string, substring); + ++index; +@@ -1467,20 +1469,19 @@ + number_format->icu_number_formatter().raw(); + CHECK_NOT_NULL(fmt); + +- icu::FieldPositionIterator fp_iter; +- Maybe maybe_format = +- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter); ++ icu::number::FormattedNumber formatted; ++ Maybe maybe_format = ++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted); + MAYBE_RETURN(maybe_format, Handle()); +- + UErrorCode status = U_ZERO_ERROR; ++ + bool style_is_unit = + Style::UNIT == StyleFromSkeleton(fmt->toSkeleton(status)); + CHECK(U_SUCCESS(status)); + + Handle result = factory->NewJSArray(0); +- Maybe maybe_format_to_parts = +- ConstructParts(isolate, maybe_format.FromJust(), &fp_iter, result, 0, +- numeric_obj, style_is_unit); ++ Maybe maybe_format_to_parts = ConstructParts( ++ isolate, &formatted, result, 0, numeric_obj, style_is_unit); + MAYBE_RETURN(maybe_format_to_parts, Handle()); + + return result; diff --git a/ports/v8/CONTROL b/ports/v8/CONTROL new file mode 100644 index 00000000000000..604821739062aa --- /dev/null +++ b/ports/v8/CONTROL @@ -0,0 +1,6 @@ +Source: v8 +Version: 8.3.110.13 +Homepage: https://v8.dev +Description: Google Chrome's JavaScript engine +Build-Depends: icu, zlib, glib (linux), pthread (linux) +Supports: !(arm|arm64|uwp|osx) diff --git a/ports/v8/build.patch b/ports/v8/build.patch new file mode 100644 index 00000000000000..7394c6591205a5 --- /dev/null +++ b/ports/v8/build.patch @@ -0,0 +1,179 @@ +diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn +index 5a0984f54..4f301517b 100644 +--- a/config/compiler/BUILD.gn ++++ b/config/compiler/BUILD.gn +@@ -1473,6 +1473,8 @@ config("default_warnings") { + # Disables. + "-Wno-missing-field-initializers", # "struct foo f = {0};" + "-Wno-unused-parameter", # Unused function parameters. ++ "-Wno-invalid-offsetof", # Use of "conditionally-supported" offsetof in c++17 ++ "-Wno-range-loop-construct", + ] + } + +@@ -1887,11 +1889,21 @@ config("no_incompatible_pointer_warnings") { + # Shared settings for both "optimize" and "optimize_max" configs. + # IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags. + if (is_win) { +- common_optimize_on_cflags = [ ++ common_optimize_on_cflags = [] ++ if(is_clang) { ++ common_optimize_on_cflags += [ + "/Ob2", # Both explicit and auto inlining. ++ ] ++ } else { ++ common_optimize_on_cflags += [ ++ "/Ob3", # Both explicit and auto inlining. ++ ] ++ } ++ common_optimize_on_cflags += [ + "/Oy-", # Disable omitting frame pointers, must be after /O2. + "/Zc:inline", # Remove unreferenced COMDAT (faster links). + ] ++ + if (!is_asan) { + common_optimize_on_cflags += [ + # Put data in separate COMDATs. This allows the linker +diff --git a/config/linux/pkg-config.py b/config/linux/pkg-config.py +index 5adf70cc3..1438c365b 100644 +--- a/config/linux/pkg-config.py ++++ b/config/linux/pkg-config.py +@@ -41,7 +41,11 @@ from optparse import OptionParser + # Additionally, you can specify the option --atleast-version. This will skip + # the normal outputting of a dictionary and instead print true or false, + # depending on the return value of pkg-config for the given package. +- ++# ++# --pkg_config_libdir= allows direct override ++# of the PKG_CONFIG_LIBDIR environment library. ++# ++# --full-path-libs causes lib names to include their full path. + + def SetConfigPath(options): + """Set the PKG_CONFIG_LIBDIR environment variable. +@@ -105,11 +109,29 @@ def RewritePath(path, strip_prefix, sysroot): + return path + + ++flag_regex = re.compile("(-.)(.+)") ++ ++def FlagReplace(matchobj): ++ if matchobj.group(1) == '-I': ++ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8") ++ if matchobj.group(1) == '-L': ++ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8") ++ if matchobj.group(1) == '-l': ++ return matchobj.group(1) + matchobj.group(2) + '.lib' ++ return matchobj.group(0) ++ ++def ConvertGCCToMSVC(flags): ++ """Rewrites GCC flags into MSVC flags.""" ++ if 'win32' not in sys.platform: ++ return flags ++ return [ flag_regex.sub(FlagReplace,flag) for flag in flags] ++ ++ + def main(): + # If this is run on non-Linux platforms, just return nothing and indicate + # success. This allows us to "kind of emulate" a Linux build from other + # platforms. +- if "linux" not in sys.platform: ++ if "linux" not in sys.platform and 'win32' not in sys.platform: + print("[[],[],[],[],[]]") + return 0 + +@@ -122,12 +144,15 @@ def main(): + parser.add_option('-a', action='store', dest='arch', type='string') + parser.add_option('--system_libdir', action='store', dest='system_libdir', + type='string', default='lib') ++ parser.add_option('--pkg_config_libdir', action='store', dest='pkg_config_libdir', ++ type='string') + parser.add_option('--atleast-version', action='store', + dest='atleast_version', type='string') + parser.add_option('--libdir', action='store_true', dest='libdir') + parser.add_option('--dridriverdir', action='store_true', dest='dridriverdir') + parser.add_option('--version-as-components', action='store_true', + dest='version_as_components') ++ parser.add_option('--full-path-libs', action='store_true', dest='full_path_libs') + (options, args) = parser.parse_args() + + # Make a list of regular expressions to strip out. +@@ -144,6 +169,10 @@ def main(): + else: + prefix = '' + ++ # Override PKG_CONFIG_LIBDIR ++ if options.pkg_config_libdir: ++ os.environ['PKG_CONFIG_LIBDIR'] = options.pkg_config_libdir ++ + if options.atleast_version: + # When asking for the return value, just run pkg-config and print the return + # value, no need to do other work. +@@ -203,7 +232,7 @@ def main(): + # For now just split on spaces to get the args out. This will break if + # pkgconfig returns quoted things with spaces in them, but that doesn't seem + # to happen in practice. +- all_flags = flag_string.strip().split(' ') ++ all_flags = ConvertGCCToMSVC(flag_string.strip().split(' ')) + + + sysroot = options.sysroot +@@ -220,7 +249,10 @@ def main(): + continue; + + if flag[:2] == '-l': +- libs.append(RewritePath(flag[2:], prefix, sysroot)) ++ library = RewritePath(flag[2:], prefix, sysroot) ++ # Skip math library on MSVC ++ if library != 'm.lib': ++ libs.append(library) + elif flag[:2] == '-L': + lib_dirs.append(RewritePath(flag[2:], prefix, sysroot)) + elif flag[:2] == '-I': +@@ -237,6 +269,14 @@ def main(): + else: + cflags.append(flag) + ++ if options.full_path_libs: ++ full_path_libs = [] ++ for lib_dir in lib_dirs: ++ for lib in libs: ++ if os.path.isfile(lib_dir+"/"+lib): ++ full_path_libs.append(lib_dir+"/"+lib) ++ libs = full_path_libs ++ + # Output a GN array, the first one is the cflags, the second are the libs. The + # JSON formatter prints GN compatible lists when everything is a list of + # strings. +diff --git a/config/linux/pkg_config.gni b/config/linux/pkg_config.gni +index 428e44ac0..a0d2175ee 100644 +--- a/config/linux/pkg_config.gni ++++ b/config/linux/pkg_config.gni +@@ -45,6 +45,9 @@ declare_args() { + # in similar fashion by setting the `system_libdir` variable in the build's + # args.gn file to 'lib' or 'lib64' as appropriate for the target architecture. + system_libdir = "lib" ++ ++ # Allow directly overriding the PKG_CONFIG_LIBDIR enviroment variable ++ pkg_config_libdir = "" + } + + pkg_config_script = "//build/config/linux/pkg-config.py" +@@ -87,6 +90,17 @@ if (host_pkg_config != "") { + host_pkg_config_args = pkg_config_args + } + ++if (pkg_config_libdir != "") { ++ pkg_config_args += [ ++ "--pkg_config_libdir", ++ pkg_config_libdir, ++ ] ++ host_pkg_config_args += [ ++ "--pkg_config_libdir", ++ pkg_config_libdir, ++ ] ++} ++ + template("pkg_config") { + assert(defined(invoker.packages), + "Variable |packages| must be defined to be a list in pkg_config.") diff --git a/ports/v8/icu.gn b/ports/v8/icu.gn new file mode 100644 index 00000000000000..60dc6b8b7ab656 --- /dev/null +++ b/ports/v8/icu.gn @@ -0,0 +1,71 @@ +import("//build/config/linux/pkg_config.gni") + +declare_args() { + # Tells icu to load an external data file rather than rely on the icudata + # being linked directly into the binary. + icu_use_data_file = true + # If true, compile icu into a standalone static library. Currently this is + # only useful on Chrome OS. + icu_disable_thin_archive = false +} + +pkg_config("system_icui18n") { + packages = [ "icu-i18n" ] + if (is_win) { + extra_args = ["--full-path-libs"] # Workaround the WinSDK having an older version of ICU + } +} + +pkg_config("system_icuuc") { + packages = [ "icu-uc" ] + if (is_win) { + extra_args = ["--full-path-libs"] # Workaround the WinSDK having an older version of ICU + } +} + +group("icu") { + public_deps = [ + ":icui18n", + ":icuuc", + ] +} + +config("icu_config") { + defines = [ + "USING_SYSTEM_ICU=1", + ] + if(is_win){ + if(!is_component_build) { + ldflags = ["/ignore:4099"] # needed on CI builds + } + defines += [ "UCHAR_TYPE=wchar_t" ] + } + else{ + defines += [ "UCHAR_TYPE=uint16_t" ] + } + if (icu_use_data_file) { + defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] + } else { + defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC" ] + } +} + +source_set("icui18n") { + public_configs = [ + ":icu_config", + ":system_icui18n" + ] +} + +source_set("icuuc") { + public_configs = [ + ":icu_config", + ":system_icuuc" + ] +} + +source_set("icudata") { + public_configs = [ + ":icu_config", + ] +} diff --git a/ports/v8/portfile.cmake b/ports/v8/portfile.cmake new file mode 100644 index 00000000000000..e2bb45da94f1d9 --- /dev/null +++ b/ports/v8/portfile.cmake @@ -0,0 +1,186 @@ + +set(pkgver "8.3.110.13") + +set(ENV{DEPOT_TOOLS_WIN_TOOLCHAIN} 0) + +get_filename_component(GIT_PATH ${GIT} DIRECTORY) +vcpkg_find_acquire_program(PYTHON2) +get_filename_component(PYTHON2_PATH ${PYTHON2} DIRECTORY) +vcpkg_find_acquire_program(GN) +get_filename_component(GN_PATH ${GN} DIRECTORY) +vcpkg_find_acquire_program(NINJA) +get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + +vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") +vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") +vcpkg_add_to_path(PREPEND "${GIT_PATH}") +vcpkg_add_to_path(PREPEND "${PYTHON2_PATH}") +vcpkg_add_to_path(PREPEND "${GN_PATH}") +vcpkg_add_to_path(PREPEND "${NINJA_PATH}") +if(WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) + vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") +endif() + +set(VCPKG_KEEP_ENV_VARS PATH;DEPOT_TOOLS_WIN_TOOLCHAIN) + +function(v8_fetch) + set(oneValueArgs DESTINATION URL REF SOURCE) + set(multipleValuesArgs PATCHES) + cmake_parse_arguments(V8 "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + + if(NOT DEFINED V8_DESTINATION) + message(FATAL_ERROR "DESTINATION must be specified.") + endif() + + if(NOT DEFINED V8_URL) + message(FATAL_ERROR "The git url must be specified") + endif() + + if(NOT DEFINED V8_REF) + message(FATAL_ERROR "The git ref must be specified.") + endif() + + if(EXISTS ${V8_SOURCE}/${V8_DESTINATION}) + vcpkg_execute_required_process( + COMMAND ${GIT} reset --hard + WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION} + LOGNAME build-${TARGET_TRIPLET}) + else() + vcpkg_execute_required_process( + COMMAND ${GIT} clone --depth 1 ${V8_URL} ${V8_DESTINATION} + WORKING_DIRECTORY ${V8_SOURCE} + LOGNAME build-${TARGET_TRIPLET}) + vcpkg_execute_required_process( + COMMAND ${GIT} fetch --depth 1 origin ${V8_REF} + WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION} + LOGNAME build-${TARGET_TRIPLET}) + vcpkg_execute_required_process( + COMMAND ${GIT} checkout FETCH_HEAD + WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION} + LOGNAME build-${TARGET_TRIPLET}) + endif() + foreach(PATCH ${V8_PATCHES}) + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${PATCH} + WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION} + LOGNAME build-${TARGET_TRIPLET}) + endforeach() +endfunction() + +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://chromium.googlesource.com/v8/v8.git + REF 90904eb48b16b32f7edbf1f8a92ece561d05e738 + PATCHES ${CURRENT_PORT_DIR}/v8.patch ${CURRENT_PORT_DIR}/3f8dc4b.patch +) + +message(STATUS "Fetching submodules") +v8_fetch( + DESTINATION build + URL https://chromium.googlesource.com/chromium/src/build.git + REF 26e9d485d01d6e0eb9dadd21df767a63494c8fea + SOURCE ${SOURCE_PATH} + PATCHES ${CURRENT_PORT_DIR}/build.patch) +v8_fetch( + DESTINATION third_party/zlib + URL https://chromium.googlesource.com/chromium/src/third_party/zlib.git + REF 156be8c52f80cde343088b4a69a80579101b6e67 + SOURCE ${SOURCE_PATH}) +v8_fetch( + DESTINATION base/trace_event/common + URL https://chromium.googlesource.com/chromium/src/base/trace_event/common.git + REF dab187b372fc17e51f5b9fad8201813d0aed5129 + SOURCE ${SOURCE_PATH}) +v8_fetch( + DESTINATION third_party/googletest/src + URL https://chromium.googlesource.com/external/github.com/google/googletest.git + REF 10b1902d893ea8cc43c69541d70868f91af3646b + SOURCE ${SOURCE_PATH}) +v8_fetch( + DESTINATION third_party/jinja2 + URL https://chromium.googlesource.com/chromium/src/third_party/jinja2.git + REF b41863e42637544c2941b574c7877d3e1f663e25 + SOURCE ${SOURCE_PATH}) +v8_fetch( + DESTINATION third_party/markupsafe + URL https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git + REF 8f45f5cfa0009d2a70589bcda0349b8cb2b72783 + SOURCE ${SOURCE_PATH}) + +vcpkg_execute_required_process( + COMMAND ${PYTHON2} build/util/lastchange.py -o build/util/LASTCHANGE + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET} +) + +file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/icu") +configure_file(${CURRENT_PORT_DIR}/zlib.gn ${SOURCE_PATH}/third_party/zlib/BUILD.gn COPYONLY) +configure_file(${CURRENT_PORT_DIR}/icu.gn ${SOURCE_PATH}/third_party/icu/BUILD.gn COPYONLY) + +if(UNIX) + set(UNIX_CURRENT_INSTALLED_DIR ${CURRENT_INSTALLED_DIR}) + set(LIBS "-ldl -lpthread") + set(REQUIRES ", gmodule-2.0, gobject-2.0, gthread-2.0") +elseif(WIN32) + execute_process(COMMAND cygpath "${CURRENT_INSTALLED_DIR}" OUTPUT_VARIABLE UNIX_CURRENT_INSTALLED_DIR) + string(STRIP ${UNIX_CURRENT_INSTALLED_DIR} UNIX_CURRENT_INSTALLED_DIR) + set(LIBS "-lWinmm -lDbgHelp") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(is_component_build true) + set(v8_monolithic false) + set(v8_use_external_startup_data true) + set(targets :v8_libbase :v8_libplatform :v8) +else() + set(is_component_build false) + set(v8_monolithic true) + set(v8_use_external_startup_data false) + set(targets :v8_monolith) +endif() + +message(STATUS "Generating v8 build files. Please wait...") + +vcpkg_configure_gn( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS "is_component_build=${is_component_build} target_cpu=\"${VCPKG_TARGET_ARCHITECTURE}\" v8_monolithic=${v8_monolithic} v8_use_external_startup_data=${v8_use_external_startup_data} use_sysroot=false is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false icu_use_data_file=false" + OPTIONS_DEBUG "is_debug=true enable_iterator_debugging=true pkg_config_libdir=\"${UNIX_CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig\"" + OPTIONS_RELEASE "is_debug=false enable_iterator_debugging=false pkg_config_libdir=\"${UNIX_CURRENT_INSTALLED_DIR}/lib/pkgconfig\"" +) + +message(STATUS "Building v8. Please wait...") + +vcpkg_install_gn( + SOURCE_PATH ${SOURCE_PATH} + TARGETS ${targets} +) + +set(CFLAGS "-DV8_COMPRESS_POINTERS") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(CFLAGS "${CFLAGS} -DV8_31BIT_SMIS_ON_64BIT_ARCH") +endif() +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h") +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(PREFIX ${CURRENT_PACKAGES_DIR}) + configure_file(${CURRENT_PORT_DIR}/v8.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8.pc @ONLY) + configure_file(${CURRENT_PORT_DIR}/v8_libbase.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libbase.pc @ONLY) + configure_file(${CURRENT_PORT_DIR}/v8_libplatform.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libplatform.pc @ONLY) + set(PREFIX ${CURRENT_PACKAGES_DIR}/debug) + configure_file(${CURRENT_PORT_DIR}/v8.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8.pc @ONLY) + configure_file(${CURRENT_PORT_DIR}/v8_libbase.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libbase.pc @ONLY) + configure_file(${CURRENT_PORT_DIR}/v8_libplatform.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libplatform.pc @ONLY) +else() + set(PREFIX ${CURRENT_PACKAGES_DIR}) + configure_file(${CURRENT_PORT_DIR}/v8_monolith.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_monolith.pc @ONLY) + set(PREFIX ${CURRENT_PACKAGES_DIR}/debug) + configure_file(${CURRENT_PORT_DIR}/v8_monolith.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_monolith.pc @ONLY) +endif() + +vcpkg_copy_pdbs() + +# v8 libraries are listed as SYSTEM_LIBRARIES because the pc files reference each other. +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m dl pthread Winmm DbgHelp v8_libbase v8_libplatform v8) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/v8/v8.patch b/ports/v8/v8.patch new file mode 100644 index 00000000000000..8a58a50b926635 --- /dev/null +++ b/ports/v8/v8.patch @@ -0,0 +1,89 @@ +diff --git a/src/compiler/node-cache.h b/src/compiler/node-cache.h +index 935e5778e3..d5dae22512 100644 +--- a/src/compiler/node-cache.h ++++ b/src/compiler/node-cache.h +@@ -29,7 +29,7 @@ class Node; + // nodes such as constants, parameters, etc. + template , + typename Pred = std::equal_to > +-class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) NodeCache final { ++class V8_EXPORT_PRIVATE NodeCache final { + public: + explicit NodeCache(Zone* zone) : map_(zone) {} + ~NodeCache() = default; +diff --git a/src/objects/feedback-vector.cc b/src/objects/feedback-vector.cc +index 929b312f22..7beff3395d 100644 +--- a/src/objects/feedback-vector.cc ++++ b/src/objects/feedback-vector.cc +@@ -114,9 +114,9 @@ Handle FeedbackMetadata::New(LocalIsolate* isolate, + return metadata; + } + +-template Handle FeedbackMetadata::New( ++template V8_EXPORT Handle FeedbackMetadata::New( + Isolate* isolate, const FeedbackVectorSpec* spec); +-template Handle FeedbackMetadata::New( ++template V8_EXPORT Handle FeedbackMetadata::New( + OffThreadIsolate* isolate, const FeedbackVectorSpec* spec); + + bool FeedbackMetadata::SpecDiffersFrom( +diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h +index b587960432..e80b5757e4 100644 +--- a/src/objects/ordered-hash-table.h ++++ b/src/objects/ordered-hash-table.h +@@ -7,7 +7,11 @@ + + #include "src/base/export-template.h" + #include "src/common/globals.h" ++#if defined(_M_IX86) && defined(_MSC_VER) ++#include "src/objects/fixed-array-inl.h" ++#else + #include "src/objects/fixed-array.h" ++#endif + #include "src/objects/js-objects.h" + #include "src/objects/smi.h" + #include "src/roots/roots.h" +diff --git a/src/snapshot/serializer-common.cc b/src/snapshot/serializer-common.cc +index 9218d4eaa9..7b226de2f9 100644 +--- a/src/snapshot/serializer-common.cc ++++ b/src/snapshot/serializer-common.cc +@@ -8,7 +8,7 @@ + #include "src/objects/foreign-inl.h" + #include "src/objects/objects-inl.h" + #include "src/objects/slots.h" +-#include "third_party/zlib/zlib.h" ++#include "zlib.h" + + namespace v8 { + namespace internal { +diff --git a/test/cctest/BUILD.gn b/test/cctest/BUILD.gn +index 89fe36f65b..588950228b 100644 +--- a/test/cctest/BUILD.gn ++++ b/test/cctest/BUILD.gn +@@ -421,6 +421,9 @@ v8_source_set("cctest_sources") { + # C4309: 'static_cast': truncation of constant value + cflags += [ "/wd4309" ] + ++ # Buffer overrun warning... intended? ++ cflags += [ "/wd4789" ] ++ + # MSVS wants this for gay-{precision,shortest}.cc. + cflags += [ "/bigobj" ] + +diff --git a/tools/v8windbg/BUILD.gn b/tools/v8windbg/BUILD.gn +index 10d06a127f..a269b81136 100644 +--- a/tools/v8windbg/BUILD.gn ++++ b/tools/v8windbg/BUILD.gn +@@ -8,6 +8,12 @@ config("v8windbg_config") { + # Required for successful compilation of SDK header file DbgModel.h. + cflags_cc = [ "/Zc:twoPhase-" ] + ++ if(is_win && !is_clang){ ++ # Avoid "The contents of are available only with C++17 or later." ++ # warning from MSVC ++ cflags_cc += [ "/std:c++latest" ] ++ } ++ + include_dirs = [ "../.." ] + } + diff --git a/ports/v8/v8.pc.in b/ports/v8/v8.pc.in new file mode 100644 index 00000000000000..5f5721725626cc --- /dev/null +++ b/ports/v8/v8.pc.in @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: v8 +Description: V8 JavaScript Engine +Version: @pkgver@ +Requires: zlib, icu-uc, icu-i18n, v8_libbase = @pkgver@ +Libs: -L${libdir} -lv8 +Cflags: -I${includedir} @CFLAGS@ diff --git a/ports/v8/v8_libbase.pc.in b/ports/v8/v8_libbase.pc.in new file mode 100644 index 00000000000000..ad472abf9bc3c3 --- /dev/null +++ b/ports/v8/v8_libbase.pc.in @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: v8 +Description: V8 JavaScript Engine - Base library +Version: @pkgver@ +Libs: -L${libdir} -lv8_libbase +Cflags: -I${includedir} @CFLAGS@ diff --git a/ports/v8/v8_libplatform.pc.in b/ports/v8/v8_libplatform.pc.in new file mode 100644 index 00000000000000..19c54ba7988d1e --- /dev/null +++ b/ports/v8/v8_libplatform.pc.in @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: v8 +Description: V8 JavaScript Engine - Platform library +Version: @pkgver@ +Libs: -L${libdir} -lv8_libplatform +Cflags: -I${includedir} @CFLAGS@ diff --git a/ports/v8/v8_monolith.pc.in b/ports/v8/v8_monolith.pc.in new file mode 100644 index 00000000000000..b23c661e817c85 --- /dev/null +++ b/ports/v8/v8_monolith.pc.in @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: v8 +Description: V8 JavaScript Engine +Version: @pkgver@ +Requires: zlib, icu-uc, icu-i18n @REQUIRES@ +Libs: -L${libdir} -lv8_monolith @LIBS@ +Cflags: -I${includedir} @CFLAGS@ diff --git a/ports/v8/zlib.gn b/ports/v8/zlib.gn new file mode 100644 index 00000000000000..570d0e22a36caa --- /dev/null +++ b/ports/v8/zlib.gn @@ -0,0 +1,21 @@ +import("//build/config/linux/pkg_config.gni") + +pkg_config("system_zlib") { + packages = [ "zlib" ] + defines = [ "USE_SYSTEM_ZLIB=1" ] +} + +config("zlib_config") { + if(is_win && !is_component_build) { + ldflags = ["/ignore:4099"] # needed on VCPKG CI builds + } + configs = [ + ":system_zlib", + ] +} + +source_set("zlib") { + public_configs = [ + ":system_zlib", + ] +} diff --git a/ports/vc/CONTROL b/ports/vc/CONTROL new file mode 100644 index 00000000000000..e56fda2d669037 --- /dev/null +++ b/ports/vc/CONTROL @@ -0,0 +1,5 @@ +Source: vc +Version: 1.4.1 +Homepage: https://github.com/VcDevel/Vc +Description: SIMD Vector Classes for C++ . +Supports: !arm64 diff --git a/ports/vc/correct_cmake_config_path.patch b/ports/vc/correct_cmake_config_path.patch new file mode 100644 index 00000000000000..bb1d5437b3d5a3 --- /dev/null +++ b/ports/vc/correct_cmake_config_path.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/VcConfig.cmake.in b/cmake/VcConfig.cmake.in +index 36de476..5cb0e5b 100644 +--- a/cmake/VcConfig.cmake.in ++++ b/cmake/VcConfig.cmake.in +@@ -4,7 +4,7 @@ + set_and_check(@PROJECT_NAME@_INSTALL_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@) + set_and_check(@PROJECT_NAME@_INCLUDE_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/include) + set_and_check(@PROJECT_NAME@_LIB_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@) +-set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR ${@PROJECT_NAME@_LIB_DIR}/cmake/Vc) ++set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/share/vc) + set(@PROJECT_NAME@_VERSION_STRING "@PROJECT_VERSION@") + + ### Setup @PROJECT_NAME@ defaults +@@ -20,7 +20,7 @@ list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_COMPILE_FLAGS}) + list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_ARCHITECTURE_FLAGS}) + + ### Import targets +-include("@PACKAGE_CMAKE_INSTALL_PREFIX@/@PACKAGE_INSTALL_DESTINATION@/@PROJECT_NAME@Targets.cmake") ++include(${@PROJECT_NAME@_CMAKE_MODULES_DIR}/@PROJECT_NAME@Targets.cmake) + + ### Define @PROJECT_NAME@_LIBRARIES for backwards compatibility + get_target_property(vc_lib_location @PROJECT_NAME@::Vc INTERFACE_LOCATION) diff --git a/ports/vc/portfile.cmake b/ports/vc/portfile.cmake new file mode 100644 index 00000000000000..b5b0da5fb526ec --- /dev/null +++ b/ports/vc/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_fail_port_install(ON_ARCH "arm64") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO VcDevel/Vc + REF 1.4.1 + SHA512 dd17e214099796c41d70416d365ea038c00c5fda285b05e48d7ee4fe03f4db2671d2be006ca7b98b0d4133bfcb57faf04cecfe35c29c3b006cd91c9a185cc04a + HEAD_REF master + PATCHES + "correct_cmake_config_path.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Vc/) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/vcpkg-gfortran/CONTROL b/ports/vcpkg-gfortran/CONTROL new file mode 100644 index 00000000000000..24bf1ce87643c5 --- /dev/null +++ b/ports/vcpkg-gfortran/CONTROL @@ -0,0 +1,4 @@ +Source: vcpkg-gfortran +Version: 3 +Description: Metaport to install gfortran dependencies from msys if VCPKG_USE_EXTERNAL_Fortran is false +Supports: windows & !arm \ No newline at end of file diff --git a/ports/vcpkg-gfortran/portfile.cmake b/ports/vcpkg-gfortran/portfile.cmake new file mode 100644 index 00000000000000..7939c7684da28a --- /dev/null +++ b/ports/vcpkg-gfortran/portfile.cmake @@ -0,0 +1,52 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "linux" "osx") +include(vcpkg_find_fortran) +vcpkg_find_fortran(FORTRAN_CMAKE) +if(VCPKG_USE_INTERNAL_Fortran) + set(VCPKG_CRT_LINKAGE dynamic) # Will always be dynamic no way to overwrite internal CRT linkage here + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(HOST_ARCH MATCHES "(amd|AMD)64") + set(MINGW_W w64) + set(MSYS_HOST x86_64) + elseif(HOST_ARCH MATCHES "(x|X)86") + set(MINGW_W w32) + set(MSYS_HOST i686) + else() + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH}!" ) + endif() + + if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") + set(MSYS_TARGET x86_64) + set(MINGW_W_TARGET 64) + set(GCC_LIB_SUFFIX s_seh-1) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") + set(MSYS_TARGET i686) + set(MINGW_W_TARGET 32) + set(GCC_LIB_SUFFIX s_dw2-1) + else() + message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" ) + endif() + + set(MINGW_BIN "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/bin/") + set(MINGW_Fortran_DLLS + "${MINGW_BIN}/libgfortran-5.dll" + "${MINGW_BIN}/libquadmath-0.dll" + "${MINGW_BIN}/libwinpthread-1.dll" + "${MINGW_BIN}/libgcc_${GCC_LIB_SUFFIX}.dll" + ) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(COPY ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + file(COPY "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + file(INSTALL "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/crt/COPYING.MinGW-w64-runtime.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled) # due to outdated msvcrt + set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) + set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +else() + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +endif() \ No newline at end of file diff --git a/ports/vlfeat/CMakeLists.txt b/ports/vlfeat/CMakeLists.txt new file mode 100644 index 00000000000000..39ecfbc6be59f3 --- /dev/null +++ b/ports/vlfeat/CMakeLists.txt @@ -0,0 +1,159 @@ +cmake_minimum_required (VERSION 3.10) +project (vlfeat) + +set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed") +set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed") +set(INSTALL_INCLUDE_DIR "include/vlfeat" CACHE PATH "Path where headers will be installed") +set(INSTALL_CMAKE_DIR "share/vlfeat" CACHE PATH "Path where cmake configs will be installed") + +# Make relative paths absolute (needed later on) +set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}) +foreach(p LIB BIN INCLUDE CMAKE) + set(var INSTALL_${p}_DIR) + if(NOT IS_ABSOLUTE "${${var}}") + set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif() +endforeach() + +# make sure that the default is a RELEASE +set(default_build_type "Release") +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +if(ENABLE_OPENMP) + find_package(OpenMP REQUIRED) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") +endif() + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D__LITTLE_ENDIAN__) + add_definitions(/Zp8) + add_definitions(/wd4146) + if(CMAKE_C_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W1" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + endif() +endif() + +if(CMAKE_COMPILER_IS_GNUCC) + add_definitions(-std=c99) + add_definitions(-Wno-unused-function) + add_definitions(-Wno-long-long) + add_definitions(-Wno-variadic-macros) +endif() + +if(USE_SSE) + add_definitions(-D__SSE2__) + set(SSE2_VL_C_FILES "vl/mathop_sse2.c" "vl/imopv_sse2.c") + set(SSE2_VL_H_FILES "vl/mathop_sse2.h" "vl/imopv_sse2.h") +else() + add_definitions(-DVL_DISABLE_SSE2) +endif() + +if(USE_AVX) + set(AVX_VL_C_FILES "vl/mathop_avx.c") + set(AVX_VL_H_FILES "vl/mathop_avx.h") +else() + add_definitions(-DVL_DISABLE_AVX) +endif() + + +set (C_SOURCES + vl/aib.c + vl/array.c + vl/covdet.c + vl/dsift.c + vl/fisher.c + vl/generic.c + vl/getopt_long.c + vl/gmm.c + vl/hikmeans.c + vl/hog.c + vl/homkermap.c + vl/host.c + vl/ikmeans.c + vl/imopv.c + vl/kdtree.c + vl/kmeans.c + vl/lbp.c + vl/liop.c + vl/mathop.c + ${AVX_VL_C_FILES} + ${SSE2_VL_C_FILES} + vl/mser.c + vl/pgm.c + vl/quickshift.c + vl/random.c + vl/rodrigues.c + vl/scalespace.c + vl/sift.c + vl/slic.c + vl/stringop.c + vl/svm.c + vl/svmdataset.c + vl/vlad.c +) + +set (H_SOURCES + vl/aib.h + vl/array.h + vl/covdet.h + vl/dsift.h + vl/fisher.h + vl/generic.h + vl/getopt_long.h + vl/gmm.h + vl/heap-def.h + vl/hikmeans.h + vl/hog.h + vl/homkermap.h + vl/host.h + vl/ikmeans.h + vl/imopv.h + vl/kdtree.h + vl/kmeans.h + vl/lbp.h + vl/liop.h + vl/mathop.h + ${AVX_VL_H_FILES} + ${SSE2_VL_H_FILES} + vl/mser.h + vl/pgm.h + vl/qsort-def.h + vl/quickshift.h + vl/random.h + vl/rodrigues.h + vl/scalespace.h + vl/shuffle-def.h + vl/sift.h + vl/slic.h + vl/stringop.h + vl/svm.h + vl/svmdataset.h + vl/vlad.h +) + +add_library(vl ${C_SOURCES} ${H_SOURCES}) +set_property(TARGET vl PROPERTY POSITION_INDEPENDENT_CODE ON) +target_compile_definitions(vl PRIVATE -DVL_BUILD_DLL) +target_include_directories(vl PUBLIC $ $) +set_target_properties(vl PROPERTIES PUBLIC_HEADER "${H_SOURCES}") + +install(TARGETS vl EXPORT vlfeatTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}" + COMPONENT dev +) + +install(EXPORT vlfeatTargets + FILE vlfeatConfig.cmake + NAMESPACE unofficial::vlfeat:: + DESTINATION "${INSTALL_CMAKE_DIR}" +) diff --git a/ports/vlfeat/CONTROL b/ports/vlfeat/CONTROL new file mode 100644 index 00000000000000..d700ed84573f0a --- /dev/null +++ b/ports/vlfeat/CONTROL @@ -0,0 +1,4 @@ +Source: vlfeat +Version: 2020-07-10 +Homepage: https://www.vlfeat.org +Description: An open library of computer vision algorithms diff --git a/ports/vlfeat/expose_missing_symbols.patch b/ports/vlfeat/expose_missing_symbols.patch new file mode 100644 index 00000000000000..02e9ce0a6614c2 --- /dev/null +++ b/ports/vlfeat/expose_missing_symbols.patch @@ -0,0 +1,79 @@ +diff --git a/vl/generic.c b/vl/generic.c +index c6f84a9..8617ed2 100644 +--- a/vl/generic.c ++++ b/vl/generic.c +@@ -1513,13 +1513,13 @@ vl_thread_specific_state_delete (VlThreadState * self) + */ + + #if (defined(VL_OS_LINUX) || defined(VL_OS_MACOSX)) && defined(VL_COMPILER_GNUC) +-static void vl_constructor () __attribute__ ((constructor)) ; +-static void vl_destructor () __attribute__ ((destructor)) ; ++//static void vl_constructor () __attribute__ ((constructor)) ; ++//static void vl_destructor () __attribute__ ((destructor)) ; + #endif + + #if defined(VL_OS_WIN) +-static void vl_constructor () ; +-static void vl_destructor () ; ++//static void vl_constructor () ; ++//static void vl_destructor () ; + + BOOL WINAPI DllMain( + HINSTANCE hinstDLL, // handle to DLL module +@@ -1563,7 +1563,7 @@ BOOL WINAPI DllMain( + /* ---------------------------------------------------------------- */ + + /** @internal @brief Initialize VLFeat state */ +-static void ++void + vl_constructor (void) + { + VlState * state ; +@@ -1637,7 +1637,7 @@ vl_constructor (void) + } + + /** @internal @brief Destruct VLFeat */ +-static void ++void + vl_destructor () + { + VlState * state ; +diff --git a/vl/generic.h b/vl/generic.h +index 4ef87f2..30a974e 100644 +--- a/vl/generic.h ++++ b/vl/generic.h +@@ -206,5 +206,7 @@ VL_EXPORT double vl_toc (void) ; + VL_EXPORT double vl_get_cpu_time (void) ; + /** @} */ + ++VL_EXPORT void vl_constructor(); ++VL_EXPORT void vl_destructor(); + /* VL_GENERIC_H */ + #endif +diff --git a/vl/sift.c b/vl/sift.c +index 03963fe..6477a81 100644 +--- a/vl/sift.c ++++ b/vl/sift.c +@@ -1443,7 +1443,7 @@ vl_sift_detect (VlSiftFilt * f) + ** @remark The minimum octave size is 2x2xS. + **/ + +-static void ++void + update_gradient (VlSiftFilt *f) + { + int s_min = f->s_min ; +diff --git a/vl/sift.h b/vl/sift.h +index 50e03f4..f9558ad 100644 +--- a/vl/sift.h ++++ b/vl/sift.h +@@ -138,7 +138,8 @@ void vl_sift_keypoint_init (VlSiftFilt const *f, + double y, + double sigma) ; + /** @} */ +- ++VL_EXPORT ++void update_gradient(VlSiftFilt* f); + /** @name Retrieve data and parameters + ** @{ + **/ diff --git a/ports/vlfeat/portfile.cmake b/ports/vlfeat/portfile.cmake new file mode 100644 index 00000000000000..a075bdef7ec25b --- /dev/null +++ b/ports/vlfeat/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO vlfeat/vlfeat + REF 1b9075fc42fe54b42f0e937f8b9a230d8e2c7701 + SHA512 6d317a1a9496ccac80244553d555fe060b150ccc7ee397a353b64f3a8451f24d1f03d8c00ed04cd9fc2dc066a5c5089b03695c614cb43ffa09be363660278255 + PATCHES + expose_missing_symbols.patch +) + +set(USE_SSE ON) +set(USE_AVX OFF) # feature is broken, so it's always off anyway + +if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + set(USE_SSE OFF) + set(USE_AVX OFF) +endif() + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DUSE_SSE=${USE_SSE} + -DUSE_AVX=${USE_AVX} +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/vtk/6811.patch b/ports/vtk/6811.patch new file mode 100644 index 00000000000000..86dca7ea0ca298 --- /dev/null +++ b/ports/vtk/6811.patch @@ -0,0 +1,26 @@ +From 34b9d59acb1688f4a9f38908760d5756a0e05ee4 Mon Sep 17 00:00:00 2001 +From: Julien Schueller +Date: Fri, 24 Apr 2020 08:28:23 -0400 +Subject: [PATCH] vtk_hdf5: Stick to 1.10.x API + +Closes #17866 +--- + ThirdParty/hdf5/vtk_hdf5.h.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ThirdParty/hdf5/vtk_hdf5.h.in b/ThirdParty/hdf5/vtk_hdf5.h.in +index 1d802937ba..c4738b2cbf 100644 +--- a/ThirdParty/hdf5/vtk_hdf5.h.in ++++ b/ThirdParty/hdf5/vtk_hdf5.h.in +@@ -18,6 +18,8 @@ + /* Use the hdf5 library configured for VTK. */ + #cmakedefine01 VTK_MODULE_USE_EXTERNAL_vtkhdf5 + ++#define H5_USE_110_API ++ + #if VTK_MODULE_USE_EXTERNAL_vtkhdf5 + #cmakedefine01 vtkhdf5_is_parallel + #if vtkhdf5_is_parallel +-- +GitLab + diff --git a/ports/vtk/CONTROL b/ports/vtk/CONTROL index cb6d5124100ba7..edbe3cc93a6f08 100644 --- a/ports/vtk/CONTROL +++ b/ports/vtk/CONTROL @@ -1,5 +1,6 @@ Source: vtk Version: 9.0.1 +Port-Version: 2 Description: Software system for 3D computer graphics, image processing, and visualization Homepage: https://github.com/Kitware/VTK Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5[core], libjpeg-turbo, proj4, lz4, liblzma, libtheora, eigen3, double-conversion, pugixml, libharu[notiffsymbols], sqlite3, netcdf-c, utfcpp, libogg, pegtl-2 diff --git a/ports/vtk/FindExpat.patch b/ports/vtk/FindExpat.patch new file mode 100644 index 00000000000000..a9fdc46bd54386 --- /dev/null +++ b/ports/vtk/FindExpat.patch @@ -0,0 +1,48 @@ +diff --git a/CMake/FindEXPAT.cmake b/CMake/FindEXPAT.cmake +index 45d923764..0ebcd3c83 100644 +--- a/CMake/FindEXPAT.cmake ++++ b/CMake/FindEXPAT.cmake +@@ -73,15 +73,37 @@ if(EXPAT_FOUND) + + if(NOT TARGET EXPAT::EXPAT) + include(vtkDetectLibraryType) +- vtk_detect_library_type(expat_library_type +- PATH "${EXPAT_LIBRARY}") ++ if(EXPAT_LIBRARY_RELEASE) ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY_RELEASE}") ++ elseif(EXPAT_LIBRARY_DEBUG) ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY_RELEASE}") ++ else() ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY}") ++ endif() ++ + add_library(EXPAT::EXPAT "${expat_library_type}" IMPORTED) + unset(expat_library_type) + set_target_properties(EXPAT::EXPAT PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${EXPAT_LIBRARY}" +- IMPORTED_IMPLIB "${EXPAT_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") ++ if(EXPAT_LIBRARY_RELEASE) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION_RELEASE "${EXPAT_LIBRARY_RELEASE}" ++ IMPORTED_IMPLIB_RELEASE "${EXPAT_LIBRARY_RELEASE}") ++ endif() ++ if(EXPAT_LIBRARY_DEBUG) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION_DEBUG "${EXPAT_LIBRARY_DEBUG}" ++ IMPORTED_IMPLIB_DEBUG "${EXPAT_LIBRARY_DEBUG}") ++ endif() ++ if(EXPAT_LIBRARY_RELEASE OR EXPAT_LIBRARY_DEBUG AND NOT (EXPAT_LIBRARY_RELEASE AND EXPAT_LIBRARY_DEBUG)) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION "${EXPAT_LIBRARY}" ++ IMPORTED_IMPLIB "${EXPAT_LIBRARY}") ++ endif() + endif() + endif() + diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 1fb7a70bd4f520..d2dc3e2c7a6bc2 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -68,6 +68,13 @@ endif() if("mpi" IN_LIST FEATURES) list(APPEND ADDITIONAL_OPTIONS -DVTK_GROUP_ENABLE_MPI=YES + -DVTK_USE_MPI=YES + ) +endif() + +if("mpi" IN_LIST FEATURES AND "python" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=OFF ) endif() @@ -84,6 +91,10 @@ if("opengl" IN_LIST FEATURES) ) endif() +if("cuda" IN_LIST FEATURES AND CMAKE_HOST_WIN32) + vcpkg_add_to_path("$ENV{CUDA_PATH}/bin") +endif() + if("all" IN_LIST FEATURES) list(APPEND ADDITIONAL_OPTIONS -DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg @@ -105,6 +116,7 @@ vcpkg_from_github( SHA512 0efb1845053b6143e5ee7fa081b8be98f6825262c59051e88b2be02497e23362055067b2f811eff82e93eb194e5a9afd2a12e3878a252eb4011a5dab95127a6f HEAD_REF master PATCHES + 6811.patch FindLZMA.patch # Will be fixed in 9.1? FindLZ4.patch Findproj.patch @@ -115,6 +127,7 @@ vcpkg_from_github( python_debug.patch fix-using-hdf5.patch # Last patch TODO: Patch out internal loguru + FindExpat.patch # The find_library calls are taken care of by vcpkg-cmake-wrapper.cmake of expat ) # ============================================================================= diff --git a/ports/vxl/CONTROL b/ports/vxl/CONTROL index d95016ac05c008..4e6ba9d27b76be 100644 --- a/ports/vxl/CONTROL +++ b/ports/vxl/CONTROL @@ -1,8 +1,7 @@ Source: vxl Version: 2.0.2 -Port-Version: 1 +Port-Version: 2 Build-Depends: bzip2, expat, libgeotiff, libjpeg-turbo, libpng, shapelib, tiff, zlib -# Build-Depends: bzip2, dcmtk, expat, libgeotiff, libjpeg-turbo, openjpeg, libpng, shapelib, tiff, zlib Description: A multi-platform collection of C++ software libraries for Computer Vision and Image Understanding. Feature: core-imaging diff --git a/ports/vxl/fix_dependency.patch b/ports/vxl/fix_dependency.patch index 1c8e2ad54921b2..88cecfd660c70d 100644 --- a/ports/vxl/fix_dependency.patch +++ b/ports/vxl/fix_dependency.patch @@ -1,13 +1,13 @@ -diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index b6af7c2..7ca75d3 100644 ---- a/core/CMakeLists.txt -+++ b/core/CMakeLists.txt -@@ -100,7 +100,7 @@ endif() - - - # coordinate systems --if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS) -+if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS AND BUILD_CORE_IMAGING) - add_subdirectory(vcsl) - add_subdirectory(vpgl) - endif() +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 3483f9c..57e149b 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -100,7 +100,7 @@ endif() + + + # coordinate systems +-if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS) ++if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS AND VXL_BUILD_CORE_IMAGING) + add_subdirectory(vcsl) + add_subdirectory(vpgl) + endif() diff --git a/ports/vxl/portfile.cmake b/ports/vxl/portfile.cmake index 232cfa3a534a9c..c3124ce202c978 100644 --- a/ports/vxl/portfile.cmake +++ b/ports/vxl/portfile.cmake @@ -1,8 +1,8 @@ -set(BUILD_CORE_IMAGING OFF) +set(VXL_BUILD_CORE_IMAGING OFF) if("core-imaging" IN_LIST FEATURES) - set(BUILD_CORE_IMAGING ON) + set(VXL_BUILD_CORE_IMAGING ON) if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openjpeg.h") - set(BUILD_CORE_IMAGING OFF) + set(VXL_BUILD_CORE_IMAGING OFF) message(WARNING "Can't build VXL CORE_IMAGING features with non built-in OpenJpeg. Please remove OpenJpeg, and try install VXL again if you need them.") endif() endif() @@ -18,7 +18,7 @@ vcpkg_from_github( ) set(USE_WIN_WCHAR_T OFF) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) set(USE_WIN_WCHAR_T ON) endif() @@ -26,9 +26,9 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DBUILD_EXAMPLES=OFF + -DVXL_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DBUILD_CORE_IMAGING=${BUILD_CORE_IMAGING} + -DVXL_BUILD_CORE_IMAGING=${VXL_BUILD_CORE_IMAGING} -DVXL_FORCE_V3P_BZLIB2=OFF -DVXL_USING_NATIVE_BZLIB2=TRUE # for disable build built-in bzip2 (v3p/bzlib/CMakeLists.txt#L10-L26) -DVXL_FORCE_V3P_CLIPPER=ON # TODO : need add clipper port to turn off @@ -41,7 +41,7 @@ vcpkg_configure_cmake( -DVXL_FORCE_V3P_TIFF=OFF -DVXL_FORCE_V3P_ZLIB=OFF -DVXL_USE_DCMTK=OFF # TODO : need fix dcmtk support to turn on - -DXVL_USE_GEOTIFF=ON + -DVXL_USE_GEOTIFF=ON -DVXL_USE_WIN_WCHAR_T=${USE_WIN_WCHAR_T} ) @@ -53,5 +53,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -# +file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/wavpack/CONTROL b/ports/wavpack/CONTROL index e8edf703e09939..9f09dda52dba2e 100644 --- a/ports/wavpack/CONTROL +++ b/ports/wavpack/CONTROL @@ -1,4 +1,6 @@ Source: wavpack -Version: 5.2.0 +Version: 5.2.0 +Port-Version: 3 Homepage: https://github.com/dbry/WavPack Description: WavPack encode/decode library, command-line programs, and several plugins +Supports: !(arm|arm64) \ No newline at end of file diff --git a/ports/wavpack/portfile.cmake b/ports/wavpack/portfile.cmake index c59374aa36524d..a44e807ee0e9a4 100644 --- a/ports/wavpack/portfile.cmake +++ b/ports/wavpack/portfile.cmake @@ -1,9 +1,9 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO dbry/WavPack - REF e158df5353b57ac7002d5cac4b3a040eba4c0c9f # 5.2.0 + REF e158df5353b57ac7002d5cac4b3a040eba4c0c9f # 5.2.0 SHA512 a144c6a05ddef0c6f4c436b5e45fe1d56893587d983eda49067fbe93059ed7d910d98b82ee5fc8e4a935904bc2ff5596cbee59ed6a5fe81be4717e53cdfc44c0 HEAD_REF master PATCHES @@ -24,7 +24,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/WavPack) +endif() vcpkg_copy_pdbs() @@ -32,5 +36,14 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +if(WIN32 AND (NOT MINGW)) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/wavpack.pc" "-lwavpack" "-lwavpackdll") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/wavpack.pc" "-lwavpack" "-lwavpackdll") + endif() +endif() + +vcpkg_fixup_pkgconfig() + # Post-build test for cmake libraries # vcpkg_test_cmake(PACKAGE_NAME wavpack) diff --git a/ports/winpcap/CONTROL b/ports/winpcap/CONTROL index 14960d89d86c2b..c745c2d96ae12f 100644 --- a/ports/winpcap/CONTROL +++ b/ports/winpcap/CONTROL @@ -1,4 +1,5 @@ Source: winpcap -Version: 4.1.3-3 +Version: 4.1.3 +Port-Version: 4 Homepage: https://www.winpcap.org Description: WinPcap is the industry-standard tool for link-layer network access in Windows environments. diff --git a/ports/winpcap/portfile.cmake b/ports/winpcap/portfile.cmake index 62183624fdd5df..8549c543d26c8a 100644 --- a/ports/winpcap/portfile.cmake +++ b/ports/winpcap/portfile.cmake @@ -45,12 +45,7 @@ vcpkg_extract_source_archive_ex( "${CMAKE_CURRENT_LIST_DIR}/fix-create-lib-batch.patch" ) -file( - COPY - "${CURRENT_PORT_DIR}/create_bin.bat" - DESTINATION - ${SOURCE_PATH} -) +file(COPY "${CURRENT_PORT_DIR}/create_bin.bat" DESTINATION ${SOURCE_PATH}) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM Win32) @@ -111,8 +106,7 @@ vcpkg_execute_required_process( LOGNAME create_include-${TARGET_TRIPLET} ) -file( - INSTALL +file(INSTALL "${SOURCE_PATH}/WpdPack/Include/bittypes.h" "${SOURCE_PATH}/WpdPack/Include/ip6_misc.h" "${SOURCE_PATH}/WpdPack/Include/Packet32.h" @@ -122,12 +116,9 @@ file( "${SOURCE_PATH}/WpdPack/Include/pcap-stdinc.h" "${SOURCE_PATH}/WpdPack/Include/remote-ext.h" "${SOURCE_PATH}/WpdPack/Include/Win32-Extensions.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include -) + DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file( - INSTALL +file(INSTALL "${SOURCE_PATH}/WpdPack/Include/pcap/bluetooth.h" "${SOURCE_PATH}/WpdPack/Include/pcap/bpf.h" "${SOURCE_PATH}/WpdPack/Include/pcap/namedb.h" @@ -135,9 +126,7 @@ file( "${SOURCE_PATH}/WpdPack/Include/pcap/sll.h" "${SOURCE_PATH}/WpdPack/Include/pcap/usb.h" "${SOURCE_PATH}/WpdPack/Include/pcap/vlan.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include/pcap -) + DESTINATION ${CURRENT_PACKAGES_DIR}/include/pcap) vcpkg_execute_required_process( COMMAND ${SOURCE_PATH}/create_lib.bat @@ -150,21 +139,15 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(PCAP_LIBRARY_PATH "${PCAP_LIBRARY_PATH}/x64") endif() -file( - INSTALL +file(INSTALL "${PCAP_LIBRARY_PATH}/Packet.lib" "${PCAP_LIBRARY_PATH}/wpcap.lib" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib -) + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file( - INSTALL +file(INSTALL "${PCAP_LIBRARY_PATH}/debug/Packet.lib" "${PCAP_LIBRARY_PATH}/debug/wpcap.lib" - DESTINATION - ${CURRENT_PACKAGES_DIR}/debug/lib -) + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_execute_required_process( @@ -178,21 +161,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PCAP_BINARY_PATH "${PCAP_BINARY_PATH}/x64") endif() - file( - INSTALL + file(INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION - ${CURRENT_PACKAGES_DIR}/bin - ) + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file( - INSTALL + file(INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION - ${CURRENT_PACKAGES_DIR}/debug/bin - ) + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/winpcap/copyright COPYONLY) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/pcap-stdinc.h "#define inline __inline" "#ifndef __cplusplus\n#define inline __inline\n#endif") + +configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/wpilib/CONTROL b/ports/wpilib/CONTROL index deef611ea76479..913521505e8b5f 100644 --- a/ports/wpilib/CONTROL +++ b/ports/wpilib/CONTROL @@ -1,8 +1,9 @@ Source: wpilib -Version: 2020.1.1 +Version: 2020.3.2 Homepage: https://github.com/wpilibsuite/allwpilib Build-Depends: eigen3, libuv Description: WPILib is the software library package for the FIRST Robotics Competition. The core install includes wpiutil, a common utilies library, and ntcore, the base NetworkTables library. +Supports: !osx Feature: cameraserver Build-Depends: opencv diff --git a/ports/wpilib/portfile.cmake b/ports/wpilib/portfile.cmake index 15041d84ba55cf..cbe4051f75fec1 100644 --- a/ports/wpilib/portfile.cmake +++ b/ports/wpilib/portfile.cmake @@ -3,30 +3,23 @@ vcpkg_fail_port_install(ON_TARGET "OSX") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wpilibsuite/allwpilib - REF e874ba9313a8243aa18eefb13e1d88a3999dd80e - SHA512 9a2e7abb3739008ed59e716d241a4ec8f0848c655ae8bb7e5bd98090109d6d86115c97ef16ea8881cc28715b691d873ab7be77b515efed8c361cb1f47745697f + REF 35eb90c135eba994a2ca2cbd50a68c367910f4b6 + SHA512 55bc608632ab67c097f3cce7c5ad9790b2b123a633c93bf5b4008f90bf79538cc142c911850d5f49b75e3a12f43ffad9f6f5f9bcdf1351cce7513ecc4b04e439 ) -set(WITHOUT_JAVA ON) -set(WITHOUT_CSCORE ON) -set(WITHOUT_ALLWPILIB ON) - -if ("cameraserver" IN_LIST FEATURES) - set(WITHOUT_CSCORE OFF) -endif() - -if ("allwpilib" IN_LIST FEATURES) - set(WITHOUT_ALLWPILIB OFF) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + cameraserver WITHOUT_CSCORE + allwpilib WITHOUT_ALLWPILIB +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DWITHOUT_JAVA=${WITHOUT_JAVA} - -DWITHOUT_CSCORE=${WITHOUT_CSCORE} - -DWITHOUT_ALLWPILIB=${WITHOUT_ALLWPILIB} + -DWITHOUT_JAVA=ON + ${FEATURE_OPTIONS} -DUSE_VCPKG_LIBUV=ON -DUSE_VCPKG_EIGEN=ON -DFLAT_INSTALL_WPILIB=ON @@ -35,26 +28,27 @@ vcpkg_install_cmake() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/ntcore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpiutil/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -if (NOT WITHOUT_ALLWPILIB) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/gen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) + +if ("allwpilib" IN_LIST FEATURES) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) endif() -if (NOT WITHOUT_CSCORE) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +if ("cameraserver" IN_LIST FEATURES) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) endif() if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") endif() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") @@ -65,4 +59,4 @@ file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAG vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wpilib RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/wt/0003-disable-boost-autolink.patch b/ports/wt/0003-disable-boost-autolink.patch deleted file mode 100644 index 9f7069b6ef2042..00000000000000 --- a/ports/wt/0003-disable-boost-autolink.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/WtFindBoost.txt b/cmake/WtFindBoost.txt -index e86fd7e..a017f6f 100644 ---- a/cmake/WtFindBoost.txt -+++ b/cmake/WtFindBoost.txt -@@ -122,7 +122,7 @@ IF (Boost_FOUND) - SET(BOOST_WTHTTP_MT_FOUND TRUE) - SET(BOOST_WTHTTP_FOUND TRUE) - -- IF(MSVC AND Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 70) -+ IF(0) - # use autolink - SET(BOOST_WT_LIBRARIES "") - SET(BOOST_WTHTTP_LIBRARIES "") diff --git a/ports/wt/0004-link-ssl.patch b/ports/wt/0004-link-ssl.patch deleted file mode 100644 index c9efc480b149b7..00000000000000 --- a/ports/wt/0004-link-ssl.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd3b506..560ffb2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -546,6 +546,12 @@ IF(ENABLE_HARU AND HARU_FOUND) - SET(WT_HAS_WPDFIMAGE true) - ENDIF(ENABLE_HARU AND HARU_FOUND) - -+if (WIN32) -+ add_definitions(-DWT_WIN32) -+endif() -+find_package(OpenSSL REQUIRED) -+set(OPENSSL_FOUND OpenSSL_FOUND) -+set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) - IF(ENABLE_SSL AND OPENSSL_FOUND) - SET(HAVE_SSL ON) - SET(WT_WITH_SSL true) -diff --git a/src/isapi/IsapiRequest.h b/src/isapi/IsapiRequest.h -index 6c788e2..3f8d213 100644 ---- a/src/isapi/IsapiRequest.h -+++ b/src/isapi/IsapiRequest.h -@@ -1,5 +1,8 @@ - #include "WebRequest.h" - #include -+#ifdef _WIN32 -+#include -+#endif - #include - - namespace Wt { diff --git a/ports/wt/0006-GraphicsMagick.patch b/ports/wt/0006-GraphicsMagick.patch new file mode 100644 index 00000000000000..2f1b50a60ced61 --- /dev/null +++ b/ports/wt/0006-GraphicsMagick.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5012cfd1b..95f812685 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -338,7 +338,7 @@ ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8) + ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8) + + IF (${WT_WRASTERIMAGE_IMPLEMENTATION} STREQUAL "GraphicsMagick") +- IF (NOT GM_FOUND) ++ IF (0) + MESSAGE(FATAL_ERROR "WT_WRASTERIMAGE_IMPLEMENTATION set to GraphicsMagick but GM is not found. Indicate the location of your graphicsmagick library using -DGM_PREFIX=...") + ENDIF (NOT GM_FOUND) + SET(WT_HAS_WRASTERIMAGE true) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 78d82ee53..01ac5f42a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -595,8 +595,9 @@ ELSE(HAVE_HARU) + ENDIF(HAVE_HARU) + + IF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick") +- TARGET_LINK_LIBRARIES(wt PRIVATE ${GM_LIBRARIES}) +- INCLUDE_DIRECTORIES(${GM_INCLUDE_DIRS}) ++ find_package(unofficial-graphicsmagick REQUIRED) ++ TARGET_LINK_LIBRARIES(wt PRIVATE unofficial::graphicsmagick::graphicsmagick) ++ # INCLUDE_DIRECTORIES(${GM_INCLUDE_DIRS}) + ADD_DEFINITIONS(-DHAVE_GRAPHICSMAGICK) + ELSEIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "skia") + TARGET_LINK_LIBRARIES(wt PRIVATE ${SKIA_LIBRARIES}) diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index 6a8b959a67f9c3..c8ea4d02c5552d 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,5 +1,29 @@ Source: wt -Version: 4.2.2 +Version: 4.4.0 Homepage: https://github.com/emweb/wt Description: Wt is a C++ library for developing web applications -Build-Depends: openssl, sqlite3, libpq, pango, glew, boost-date-time, boost-regex, boost-program-options, boost-signals, boost-system, boost-filesystem, boost-thread, boost-random, boost-multi-index, boost-signals2, boost-asio, boost-ublas, boost-conversion, boost-array, boost-smart-ptr, boost-tuple, boost-algorithm, boost-logic, boost-interprocess +Build-Depends: zlib, libpng, pango (!windows), harfbuzz (!windows), libharu, glew, boost-algorithm, boost-array, boost-asio, boost-bind, boost-config, boost-container-hash, boost-filesystem, boost-fusion, boost-interprocess, boost-lexical-cast, boost-logic, boost-math, boost-multi-index, boost-optional, boost-phoenix, boost-pool, boost-program-options, boost-range, boost-serialization, boost-smart-ptr, boost-spirit, boost-system, boost-thread, boost-tokenizer, boost-tuple, boost-ublas, boost-variant +Default-Features: openssl + +Feature: dbo +Description: Wt::Dbo + +Feature: postgresql +Description: Wt::Dbo PostgreSQL backend +Build-Depends: libpq, wt[dbo] + +Feature: sqlite3 +Description: Wt::Dbo Sqlite 3 backend +Build-Depends: sqlite3, wt[dbo] + +Feature: sqlserver +Description: Wt::Dbo MS SQL Server backend +Build-Depends: unixodbc (!windows), wt[dbo] + +Feature: openssl +Description: TLS support +Build-Depends: openssl + +Feature: graphicsmagick +Description: WRasterImage support on non-Windows based on GraphicsMagick +Build-Depends: graphicsmagick diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index 4e8eed349a0786..f324772210e758 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -1,39 +1,69 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO emweb/wt - REF 3ade528163850b3fd90fac2a31f5e0699342a1a5 # 4.2.2 - SHA512 44c629ca2f3cb129b02d6713814a15620d62070e9937c33e7b5f637a08c59875c721d6ac36963a84c99dab4124c3db4f52d78870f8adaab48d863c60b7dcbf05 + REF 9c6b7807b4fdaefe659ff9ab8ff4ba3937e62b2f # 4.4.0 + SHA512 d9947180bb82750f9fa81212d343e8a719e6085e4c41327fd178ce0f93c5ef0f5a11e64d066871ac339abc973081cbd9580042fb8625f3cf3738a722439ba1e3 HEAD_REF master PATCHES 0002-link-glew.patch - 0003-disable-boost-autolink.patch - 0004-link-ssl.patch - 0005-XML_file_path.patch + 0005-XML_file_path.patch + 0006-GraphicsMagick.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED_LIBS) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + dbo ENABLE_LIBWTDBO + postgresql ENABLE_POSTGRES + sqlite3 ENABLE_SQLITE + sqlserver ENABLE_MSSQLSERVER + openssl ENABLE_SSL +) + +if(VCPKG_TARGET_IS_WINDOWS) + set(WT_PLATFORM_SPECIFIC_OPTIONS + -DWT_WRASTERIMAGE_IMPLEMENTATION=Direct2D + -DCONNECTOR_ISAPI=ON + -DENABLE_PANGO=OFF) +else() + set(WT_PLATFORM_SPECIFIC_OPTIONS + -DCONNECTOR_FCGI=OFF + -DENABLE_PANGO=ON + -DHARFBUZZ_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/harfbuzz) + + if ("graphicsmagick" IN_LIST FEATURES) + list(APPEND WT_PLATFORM_SPECIFIC_OPTIONS + -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick) + else() + list(APPEND WT_PLATFORM_SPECIFIC_OPTIONS + -DWT_WRASTERIMAGE_IMPLEMENTATION=none) + endif() +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DINSTALL_CONFIG_FILE_PATH="${DOWNLOADS}/wt" + -DINSTALL_CONFIG_FILE_PATH="${DOWNLOADS}/wt" -DSHARED_LIBS=${SHARED_LIBS} - -DBOOST_DYNAMIC=ON + -DBOOST_DYNAMIC=${SHARED_LIBS} -DDISABLE_BOOST_AUTOLINK=ON -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF - -DENABLE_SSL=ON - -DENABLE_HARU=OFF - -DENABLE_PANGO=ON - -DENABLE_SQLITE=ON - -DENABLE_POSTGRES=ON - -DENABLE_FIREBIRD=OFF + -DCONNECTOR_HTTP=ON + -DENABLE_HARU=ON + -DHARU_DYNAMIC=${SHARED_LIBS} -DENABLE_MYSQL=OFF + -DENABLE_FIREBIRD=OFF -DENABLE_QT4=OFF - -DENABLE_LIBWTTEST=OFF + -DENABLE_QT5=OFF + -DENABLE_LIBWTTEST=ON -DENABLE_OPENGL=ON + ${FEATURE_OPTIONS} + ${WT_PLATFORM_SPECIFIC_OPTIONS} + -DUSE_SYSTEM_SQLITE3=ON -DUSE_SYSTEM_GLEW=ON diff --git a/ports/wtl/CONTROL b/ports/wtl/CONTROL index 63f618d9b656cd..db55ce52f709d0 100644 --- a/ports/wtl/CONTROL +++ b/ports/wtl/CONTROL @@ -1,4 +1,4 @@ Source: wtl -Version: 10.0-10 +Version: 10.0.10077 Homepage: https://sourceforge.net/projects/wtl/ Description: Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake index e72367e73dd3d6..0f8d189a867d4a 100644 --- a/ports/wtl/portfile.cmake +++ b/ports/wtl/portfile.cmake @@ -1,10 +1,10 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO wtl/WTL%2010 - REF WTL%2010.0.9163 - FILENAME "WTL10_9163.zip" + REF WTL%2010.0.10077 + FILENAME "WTL10_1077..zip" NO_REMOVE_ONE_LEVEL - SHA512 feb7fb1c456e44ad05610f31f8c0f964eb6ce3eadf65a389219051f0ea2547069727666616622631cd90e25ea4a682a7c88c7089a374181870717246ad44e035 + SHA512 5a49283196caf5b2ad8a3fb3cfa5d09cd555d59d4d5871408bf6a5b850cf4546cc6ece4e0bf79d152a4d2589fae3749f0f3e73ab6a3a7bc0cb373efa1474b98b ) file(INSTALL ${SOURCE_PATH}/Include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT} FILES_MATCHING PATTERN "*.h") diff --git a/ports/wxwidgets/CONTROL b/ports/wxwidgets/CONTROL index e69ead3add70a4..35d3b461e98f0f 100644 --- a/ports/wxwidgets/CONTROL +++ b/ports/wxwidgets/CONTROL @@ -1,5 +1,7 @@ Source: wxwidgets -Version: 3.1.3-1 +Version: 3.1.4 +Port-Version: 3 Homepage: https://github.com/wxWidgets/wxWidgets Description: wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. Build-Depends: zlib, libpng, tiff, expat +Supports: !uwp diff --git a/ports/wxwidgets/disable-platform-lib-dir.patch b/ports/wxwidgets/disable-platform-lib-dir.patch index 2a1de613eed16f..930477c010327d 100644 --- a/ports/wxwidgets/disable-platform-lib-dir.patch +++ b/ports/wxwidgets/disable-platform-lib-dir.patch @@ -1,13 +1,13 @@ diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake -index 06256b1..2960a31 100644 +index d013e92..c03135d 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake -@@ -66,7 +66,7 @@ else() +@@ -149,7 +149,7 @@ else() set(wxCOMPILER_PREFIX) endif() --if(MSVC OR MINGW) -+if((MSVC OR MINGW) AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) +-if(MSVC) ++if(MSVC AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) if(wxBUILD_SHARED) set(lib_suffix "dll") else() diff --git a/ports/wxwidgets/fix-macos-clipboard.patch b/ports/wxwidgets/fix-macos-clipboard.patch deleted file mode 100644 index 9f37cc1d9e1d36..00000000000000 --- a/ports/wxwidgets/fix-macos-clipboard.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp -index 274e200..6012d37 100644 ---- a/src/osx/carbon/clipbrd.cpp -+++ b/src/osx/carbon/clipbrd.cpp -@@ -60,7 +60,11 @@ void wxClipboard::Clear() - - bool wxClipboard::Flush() - { -- return false; -+ wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); -+ -+ wxOSXPasteboard::GetGeneralClipboard()->Flush(); -+ -+ return true; - } - - bool wxClipboard::Open() -@@ -105,6 +109,8 @@ bool wxClipboard::AddData( wxDataObject *data ) - - data->WriteToSink(wxOSXPasteboard::GetGeneralClipboard()); - -+ Flush(); -+ - m_data = data; - - return true; diff --git a/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch b/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch new file mode 100644 index 00000000000000..e028112e7ece62 --- /dev/null +++ b/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch @@ -0,0 +1,202 @@ +From 590e32c60b1dfb32b34632f3d1b0b5cf7c8e4b84 Mon Sep 17 00:00:00 2001 +From: Maarten Bent +Date: Sat, 1 Aug 2020 11:54:26 +0200 +Subject: [PATCH] Fix building with wxUSE_STL enabled in VS2019 16.6 + +Exporting standard C++ library types is not allowed any more, see + +https://developercommunity.visualstudio.com/content/problem/1042081/142628801includexhash201332-error-c2338-this-funct.html + +so don't use DLL export declarations for wxHash{Map,Set} classes, which +derive from std::{map,set}. + +Since the classes are header-only, this should have no direct +consequences. Only classes that extend wxHashMap or wxHashSet, like +wxImageHistogram, have to be made header only as well. + +Remove the wxLogError message in wxImageHistogram::FindFirstUnusedColour, so +log.h and translation.h do not have to be included in the header. + +Closes https://github.com/wxWidgets/wxWidgets/pull/2009 +--- + include/wx/hashmap.h | 9 ++++++--- + include/wx/hashset.h | 6 ++++-- + include/wx/image.h | 42 ++++++++++++++++++++++++++++++++++++++---- + src/common/image.cpp | 43 ------------------------------------------- + 4 files changed, 48 insertions(+), 52 deletions(-) + +diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h +index df9092a3823..86700f40ca9 100644 +--- a/include/wx/hashmap.h ++++ b/include/wx/hashmap.h +@@ -678,24 +678,27 @@ public: \ + + // and these do exactly the same thing but should be used inside the + // library ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, \ + CLASSNAME, class WXDLLIMPEXP_CORE ) + ++// note: DECL is not used since the class is inline + #define WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ + _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ +- CLASSNAME, DECL ) ++ CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ + WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ + class WXDLLIMPEXP_CORE ) + ++// note: DECL is not used since the class is inline + #define WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ + _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ +- CLASSNAME, DECL ) ++ CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ + WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ +diff --git a/include/wx/hashset.h b/include/wx/hashset.h +index bb713b87f4f..311aeca9a6e 100644 +--- a/include/wx/hashset.h ++++ b/include/wx/hashset.h +@@ -159,8 +159,9 @@ public: \ + + // and these do exactly the same thing but should be used inside the + // library ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \ +@@ -173,8 +174,9 @@ public: \ + // common compilers (notably Sun CC). + #define WX_DECLARE_HASH_SET_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_SET_WITH_DECL_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) + + // delete all hash elements + // +diff --git a/include/wx/image.h b/include/wx/image.h +index f2b5866d2d7..d53ff0b1165 100644 +--- a/include/wx/image.h ++++ b/include/wx/image.h +@@ -190,7 +190,7 @@ WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry, + wxIntegerHash, wxIntegerEqual, + wxImageHistogramBase); + +-class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase ++class wxImageHistogram : public wxImageHistogramBase + { + public: + wxImageHistogram() : wxImageHistogramBase(256) { } +@@ -211,9 +211,43 @@ class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase + bool FindFirstUnusedColour(unsigned char *r, + unsigned char *g, + unsigned char *b, +- unsigned char startR = 1, +- unsigned char startG = 0, +- unsigned char startB = 0 ) const; ++ unsigned char r2 = 1, ++ unsigned char g2 = 0, ++ unsigned char b2 = 0 ) const ++ { ++ unsigned long key = MakeKey(r2, g2, b2); ++ ++ while ( find(key) != end() ) ++ { ++ // color already used ++ r2++; ++ if ( r2 >= 255 ) ++ { ++ r2 = 0; ++ g2++; ++ if ( g2 >= 255 ) ++ { ++ g2 = 0; ++ b2++; ++ if ( b2 >= 255 ) ++ { ++ return false; ++ } ++ } ++ } ++ ++ key = MakeKey(r2, g2, b2); ++ } ++ ++ if ( r ) ++ *r = r2; ++ if ( g ) ++ *g = g2; ++ if ( b ) ++ *b = b2; ++ ++ return true; ++ } + }; + + //----------------------------------------------------------------------------- +diff --git a/src/common/image.cpp b/src/common/image.cpp +index 096f823f0c1..880c1c4ea74 100644 +--- a/src/common/image.cpp ++++ b/src/common/image.cpp +@@ -3381,49 +3381,6 @@ wxImageHandler::GetResolutionFromOptions(const wxImage& image, int *x, int *y) + // image histogram stuff + // ---------------------------------------------------------------------------- + +-bool +-wxImageHistogram::FindFirstUnusedColour(unsigned char *r, +- unsigned char *g, +- unsigned char *b, +- unsigned char r2, +- unsigned char g2, +- unsigned char b2) const +-{ +- unsigned long key = MakeKey(r2, g2, b2); +- +- while ( find(key) != end() ) +- { +- // color already used +- r2++; +- if ( r2 >= 255 ) +- { +- r2 = 0; +- g2++; +- if ( g2 >= 255 ) +- { +- g2 = 0; +- b2++; +- if ( b2 >= 255 ) +- { +- wxLogError(_("No unused colour in image.") ); +- return false; +- } +- } +- } +- +- key = MakeKey(r2, g2, b2); +- } +- +- if ( r ) +- *r = r2; +- if ( g ) +- *g = g2; +- if ( b ) +- *b = b2; +- +- return true; +-} +- + bool + wxImage::FindFirstUnusedColour(unsigned char *r, + unsigned char *g, diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 530605782383e2..13bbc9c408103c 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -1,15 +1,18 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wxWidgets/wxWidgets - REF v3.1.3 - SHA512 4ecb5c2d13f9bda7aa3c12e887c351a0004509ec24bdd440542bec67e1b6dca20e7838a01236a71dd3cf2e1ba0653c40878047f406464cb2c9ee07c26d6f2599 + REF v3.1.4 + SHA512 108e35220de10afbfc58762498ada9ece0b3166f56a6d11e11836d51bfbaed1de3033c32ed4109992da901fecddcf84ce8a1ba47303f728c159c638dac77d148 HEAD_REF master - PATCHES disable-platform-lib-dir.patch fix-macos-clipboard.patch + PATCHES + disable-platform-lib-dir.patch + fix-stl-build-vs2019-16.6.patch ) set(OPTIONS) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") +if(VCPKG_TARGET_IS_OSX) set(OPTIONS -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=9999) endif() @@ -37,6 +40,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") @@ -56,14 +61,16 @@ if(DLLS) endforeach() endif() -# Handle copyright -file(COPY ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/wxwidgets/licence.txt ${CURRENT_PACKAGES_DIR}/share/wxwidgets/copyright) +# do the copy pdbs now after the dlls got moved to the expected /bin folder above +vcpkg_copy_pdbs() if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/mswu) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/mswud) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index b49bf0a7729147..0a4af3912f140f 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -1,5 +1,6 @@ Source: x264 -Version: 157-303c484ec828ed0-8 +Version: 157-303c484ec828ed0 +Port-Version: 9 Homepage: https://github.com/mirror/x264 Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format -Build-Depends: pthread (linux&osx) \ No newline at end of file +Build-Depends: pthread (linux&osx) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index d7aff89d7b49b5..1c9e32e9251816 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -12,9 +12,24 @@ vcpkg_from_github( "uwp-cflags.patch" ) +if(VCPKG_TARGET_IS_WINDOWS) + _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) + _vcpkg_determine_autotools_target_cpu(HOST_ARCH) + list(APPEND OPTIONS --build=${BUILD_ARCH}-pc-mingw32) + list(APPEND OPTIONS --host=${HOST_ARCH}-pc-mingw32) +endif() + +if(VCPKG_TARGET_IS_UWP) + list(APPEND OPTIONS --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) + list(APPEND OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) +endif() + + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} + NO_ADDITIONAL_PATHS OPTIONS + ${OPTIONS} --enable-strip --disable-lavf --disable-swscale @@ -24,21 +39,17 @@ vcpkg_configure_make( --disable-lsmash --disable-asm --enable-debug + ) vcpkg_install_make() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) +vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/bin/x264.exe - ${CURRENT_PACKAGES_DIR}/debug/include -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/x264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/x264.lib) else() # force U_STATIC_IMPLEMENTATION macro file(READ ${CURRENT_PACKAGES_DIR}/include/x264.h HEADER_CONTENTS) @@ -51,6 +62,8 @@ else() ) endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) + vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/x265/CONTROL b/ports/x265/CONTROL index 31ba77050f0aa1..e9d704c74bbfb2 100644 --- a/ports/x265/CONTROL +++ b/ports/x265/CONTROL @@ -1,4 +1,4 @@ Source: x265 -Version: 3.2-4 -Homepage: https://bitbucket.org/multicoreware/x265 +Version: 3.4 +Homepage: https://github.com/videolan/x265 Description: x265 is a H.265 / HEVC video encoder application library, designed to encode video or images into an H.265 / HEVC encoded bitstream. diff --git a/ports/x265/portfile.cmake b/ports/x265/portfile.cmake index eaef036f1e22f7..3b3ecbba690c34 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -1,17 +1,15 @@ -include(vcpkg_common_functions) - -vcpkg_from_bitbucket( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO multicoreware/x265 - REF 3.2 - SHA512 e98e26a9d3c2eb7f147ba052d9d8009e1c47e54905375b29e813f33ffddf8b7fac55ea455ae6d28ed1ade2d90f887c7cafe374873cd48b6c5e2560ddd21ccb84 + REPO videolan/x265 + REF 07295ba7ab551bb9c1580fdaee3200f1b45711b7 #v3.4 + SHA512 21a4ef8733a9011eec8b336106c835fbe04689e3a1b820acb11205e35d2baba8c786d9d8cf5f395e78277f921857e4eb8622cf2ef3597bce952d374f7fe9ec29 HEAD_REF master PATCHES disable-install-pdb.patch ) set(ENABLE_ASSEMBLY OFF) -if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if (VCPKG_TARGET_IS_WINDOWS) vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") @@ -36,20 +34,24 @@ vcpkg_copy_pdbs() # remove duplicated include files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x265) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x265 ${CURRENT_PACKAGES_DIR}/tools/x265/x265) -elseif(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x265.exe ${CURRENT_PACKAGES_DIR}/tools/x265/x265.exe) -endif() +vcpkg_copy_tools(TOOL_NAMES x265 AUTO_CLEAN) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/x265) +if(WIN32 AND (NOT MINGW)) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static") + endif() +endif() + +if(UNIX) + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES numa) +else() + vcpkg_fixup_pkgconfig() +endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/x265) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/x265/COPYING ${CURRENT_PACKAGES_DIR}/share/x265/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/xbyak/CONTROL b/ports/xbyak/CONTROL index 05a1956cfbd798..5239d99c4b20d7 100644 --- a/ports/xbyak/CONTROL +++ b/ports/xbyak/CONTROL @@ -1,5 +1,5 @@ Source: xbyak -Version: 5.911 +Version: 5.93 Description: Xbyak is a JIT assembler for x86(IA-32)/x64(AMD64, x86-64). Homepage: https://github.com/herumi/xbyak Supports: !(arm|uwp) diff --git a/ports/xbyak/portfile.cmake b/ports/xbyak/portfile.cmake index b07b372f307168..b365c38fc29302 100644 --- a/ports/xbyak/portfile.cmake +++ b/ports/xbyak/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO herumi/xbyak - REF v5.911 - SHA512 3cb6b1e73d7dc2a23dcb31310720f0d4b83b62cfc69ff09eeefafe032e58e04574419f668d5ca957e8fc21e679e25da059f6e93724949e0ff1fcaa6779b88bdd + REF v5.93 + SHA512 0c7052b2aeffc1aec541991a644753327232428ba7d8719e250a3afcc66b26beca2b92476f17af8121ceaacd822515e65d082e94b9f72fa29b4a005e32065843 HEAD_REF master ) diff --git a/ports/xeus/Fix-Compile-nlohmann-json.patch b/ports/xeus/Fix-Compile-nlohmann-json.patch new file mode 100644 index 00000000000000..7381d14caaedfb --- /dev/null +++ b/ports/xeus/Fix-Compile-nlohmann-json.patch @@ -0,0 +1,12 @@ +diff --git a/src/xmessage.cpp b/src/xmessage.cpp +index 0d6ad99..621d838 100644 +--- a/src/xmessage.cpp ++++ b/src/xmessage.cpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #include "xeus/xguid.hpp" + #include "xeus/xmessage.hpp" diff --git a/ports/xeus/portfile.cmake b/ports/xeus/portfile.cmake index 5dd646d7fa0fa8..577dbff1cb02c5 100644 --- a/ports/xeus/portfile.cmake +++ b/ports/xeus/portfile.cmake @@ -4,7 +4,9 @@ vcpkg_from_github( REF 8408f237f33514610a59d19a5ff045ee70dfa02b SHA512 41282addbe5519b6d357e802c48483834cd951604bfeb8c99d96f02d03dec2fc66ea4c091f40ec09348bb60587e8a6efef5e6eb2bb950ba720fc8ceb7a107960 HEAD_REF master - PATCHES Fix-TypeConversion.patch + PATCHES + Fix-TypeConversion.patch + Fix-Compile-nlohmann-json.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) diff --git a/ports/xframe/CONTROL b/ports/xframe/CONTROL new file mode 100644 index 00000000000000..a9b7721c116cd3 --- /dev/null +++ b/ports/xframe/CONTROL @@ -0,0 +1,5 @@ +Source: xframe +Version: 0.3.0 +Description: xframe is a dataframe for C++, based on xtensor and xtl. +Homepage: https://github.com/xtensor-stack/xframe +Build-Depends: xtensor, xtl diff --git a/ports/xframe/portfile.cmake b/ports/xframe/portfile.cmake new file mode 100644 index 00000000000000..cb3111bd984d20 --- /dev/null +++ b/ports/xframe/portfile.cmake @@ -0,0 +1,22 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO xtensor-stack/xframe + REF 0.3.0 + SHA512 880fe8ca00bd189a197cc71e5f32539562db69433fdfa03db5f0db8211230db36eb96757a5ca3c667ae1d4edc96eae38393718e7a1e3f7c1827130cf21579b07 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/xframe) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/xlnt/CONTROL b/ports/xlnt/CONTROL index 2c2736e8e237e6..3e03a5a4ffae17 100644 --- a/ports/xlnt/CONTROL +++ b/ports/xlnt/CONTROL @@ -1,4 +1,4 @@ Source: xlnt -Version: 1.4.0-1 +Version: 1.5.0 Homepage: https://github.com/tfussell/xlnt Description: Cross-platform user-friendly xlsx library for C++14 diff --git a/ports/xlnt/fix-not-found-include.patch b/ports/xlnt/fix-not-found-include.patch new file mode 100644 index 00000000000000..a3068b14ce8c7c --- /dev/null +++ b/ports/xlnt/fix-not-found-include.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/XlntConfig.cmake.in b/cmake/XlntConfig.cmake.in +index 01fe4981..9cefa6e0 100644 +--- a/cmake/XlntConfig.cmake.in ++++ b/cmake/XlntConfig.cmake.in +@@ -7,7 +7,6 @@ + get_filename_component(XLNT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +-set_and_check(XLNT_INCLUDE_DIR "@XLNT_INCLUDE_INSTALL_DIR@") + + check_required_components(xlnt) + + if(NOT TARGET xlnt::xlnt) diff --git a/ports/xlnt/portfile.cmake b/ports/xlnt/portfile.cmake index 0da394c9ab6b75..eb4147f8edfbfa 100644 --- a/ports/xlnt/portfile.cmake +++ b/ports/xlnt/portfile.cmake @@ -7,10 +7,11 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tfussell/xlnt - REF 85e6878cc41d4c5ad002e961dc1fe35e41f936b6 # v1.4.0 - SHA512 335198fbcc1b3028e38bced4ee26047047b02372b6c52727a64c0cab6db19cc31be8ac6c08e96f415875a181d6f717082220b0f63f08ef6ac194927e2184a9df + REF 568ac85346bc37757b0cd16464e7e1ea7656df91 # v1.5.0 + SHA512 414d691b372934326dc0da134eb7752c27c3223b6e92b433494d0758ca657f43b66894ad54ac97a8410387a2531a573c81572daa6a0434fa023e8e29ca74331c HEAD_REF master PATCHES + "fix-not-found-include.patch" ${win_patch} ) diff --git a/ports/xtensor-io/CONTROL b/ports/xtensor-io/CONTROL index 20d92198d457fd..d426f0935f4ac9 100644 --- a/ports/xtensor-io/CONTROL +++ b/ports/xtensor-io/CONTROL @@ -1,5 +1,6 @@ Source: xtensor-io Version: 0.9.0 +Port-Version: 1 Description: xtensor plugin to read and write images, audio files, numpy (compressed) npz and HDF5 Homepage: https://github.com/xtensor-stack/xtensor-io Build-Depends: xtensor, xtl diff --git a/ports/xtensor-io/disable-highfive.patch b/ports/xtensor-io/disable-highfive.patch new file mode 100644 index 00000000000000..e0733b0a94ebfa --- /dev/null +++ b/ports/xtensor-io/disable-highfive.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c3595a1..d38dc21 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,6 +136,7 @@ else() + message(WARNING "ZLIB not found - install zlib for xnpz file support") + endif() + ++if (0) + message(STATUS "Trying to find HighFive for npz file support") + find_package(HighFive) + find_package(HDF5) +@@ -154,6 +155,7 @@ if (${HighFive_FOUND} AND ${HDF5_FOUND}) + else() + message(WARNING "HighFive and/or HDF5 not found - install HighFive and HDF5 for HDF5 file support") + endif() ++endif() + + if(DOWNLOAD_GTEST OR GTEST_SRC_DIR) + set(BUILD_TESTS ON) diff --git a/ports/xtensor-io/portfile.cmake b/ports/xtensor-io/portfile.cmake index d5b85978f21dcc..992aaeb4df87ab 100644 --- a/ports/xtensor-io/portfile.cmake +++ b/ports/xtensor-io/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF 863dd7dad6010038568c169f20e3d3e87bd3b37a # 0.9.0 SHA512 f6190c5c2c487a8170e5af1ddfd2e921c414274762dac6c8f9519d579d5eb5dd3683678e7b4f589b7ced8a42f648742755acb42e2122960d6ca7fc1a82b0723e HEAD_REF master + PATCHES + disable-highfive.patch ) vcpkg_configure_cmake( diff --git a/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch b/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch new file mode 100644 index 00000000000000..8fe2b2f5a6683c --- /dev/null +++ b/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch @@ -0,0 +1,53 @@ +diff --git a/zconf.h.cmakein b/zconf.h.cmakein +index a7f24cc..a1b359b 100644 +--- a/zconf.h.cmakein ++++ b/zconf.h.cmakein +@@ -434,11 +434,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC +diff --git a/zconf.h.in b/zconf.h.in +index 5e1d68a..32f53c8 100644 +--- a/zconf.h.in ++++ b/zconf.h.in +@@ -432,11 +432,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC + diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index b02b948ad50f87..9a79b2e7b0b18e 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,5 +1,5 @@ Source: zlib Version: 1.2.11 -Port-Version: 7 +Port-Version: 9 Homepage: https://www.zlib.net/ Description: A compression library diff --git a/ports/zlib/add_debug_postfix_on_mingw.patch b/ports/zlib/add_debug_postfix_on_mingw.patch new file mode 100644 index 00000000000000..22172ccfcaaef0 --- /dev/null +++ b/ports/zlib/add_debug_postfix_on_mingw.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939d..e4fc213 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,7 @@ endif() + # + check_include_file(unistd.h Z_HAVE_UNISTD_H) + +-if(MSVC) ++if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index c05e7e252aceab..6277d5b0a8b066 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -12,6 +12,8 @@ vcpkg_extract_source_archive_ex( REF ${VERSION} PATCHES "cmake_dont_build_more_than_needed.patch" + "0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch" + "add_debug_postfix_on_mingw.patch" ) # This is generated during the cmake build diff --git a/ports/zxing-cpp/0003-fix-dependency-bigint.patch b/ports/zxing-cpp/0003-fix-dependency-bigint.patch new file mode 100644 index 00000000000000..eff577f4464691 --- /dev/null +++ b/ports/zxing-cpp/0003-fix-dependency-bigint.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54071bd..0edd0e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,6 +44,11 @@ if(WIN32) + set(CMAKE_DEBUG_POSTFIX -debug) + endif() + ++# Bigint ++find_package(bigint CONFIG REQUIRED) ++ ++link_libraries(bigint::bigint) ++ + # OpenCV classes + if(WITH_OPENCV) + find_package(OpenCV REQUIRED) +diff --git a/source_files.cmake b/source_files.cmake +index db3d8d4..39abe82 100644 +--- a/source_files.cmake ++++ b/source_files.cmake +@@ -1,28 +1,4 @@ + set(LIBZXING_FILES +- core/src/bigint/BigInteger.cc +- core/src/bigint/BigInteger.cc +- core/src/bigint/BigInteger.hh +- core/src/bigint/BigInteger.hh +- core/src/bigint/BigIntegerAlgorithms.cc +- core/src/bigint/BigIntegerAlgorithms.cc +- core/src/bigint/BigIntegerAlgorithms.hh +- core/src/bigint/BigIntegerAlgorithms.hh +- core/src/bigint/BigIntegerLibrary.hh +- core/src/bigint/BigIntegerLibrary.hh +- core/src/bigint/BigIntegerUtils.cc +- core/src/bigint/BigIntegerUtils.cc +- core/src/bigint/BigIntegerUtils.hh +- core/src/bigint/BigIntegerUtils.hh +- core/src/bigint/BigUnsigned.cc +- core/src/bigint/BigUnsigned.cc +- core/src/bigint/BigUnsigned.hh +- core/src/bigint/BigUnsigned.hh +- core/src/bigint/BigUnsignedInABase.cc +- core/src/bigint/BigUnsignedInABase.cc +- core/src/bigint/BigUnsignedInABase.hh +- core/src/bigint/BigUnsignedInABase.hh +- core/src/bigint/NumberlikeArray.hh +- core/src/bigint/NumberlikeArray.hh + core/src/zxing/aztec/AztecDetectorResult.cpp + core/src/zxing/aztec/AztecDetectorResult.h + core/src/zxing/aztec/AztecReader.cpp diff --git a/ports/zxing-cpp/CONTROL b/ports/zxing-cpp/CONTROL index 89a07a22273ae0..4f661dd19a4aab 100644 --- a/ports/zxing-cpp/CONTROL +++ b/ports/zxing-cpp/CONTROL @@ -1,7 +1,9 @@ Source: zxing-cpp -Version: 3.3.3-7 +Version: 3.3.3 +Port-Version: 8 Homepage: https://github.com/glassechidna/zxing-cpp Description: Barcode detection and decoding library. +Build-Depends: bigint Default-Features: opencv, iconv Feature: opencv diff --git a/ports/zxing-cpp/portfile.cmake b/ports/zxing-cpp/portfile.cmake index 3e966639076629..9211ef3c6db2b2 100644 --- a/ports/zxing-cpp/portfile.cmake +++ b/ports/zxing-cpp/portfile.cmake @@ -7,11 +7,14 @@ vcpkg_from_github( SHA512 a079ad47171224de4469e76bf0779b6ebc9c6dfb3604bd5dbf5e6e5f321d9e6255f689daa749855f8400023602f1773214013c006442e9b32dd4b8146c888c02 HEAD_REF master PATCHES - 0001-opencv4-compat.patch - 0002-improve-features.patch + 0001-opencv4-compat.patch + 0002-improve-features.patch + 0003-fix-dependency-bigint.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindModules/FindIconv.cmake) +# Depends on port bigint +file(REMOVE_RECURSE ${SOURCE_PATH}/core/src/bigint) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES @@ -22,7 +25,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS ${FEATURE_OPTIONS} + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index 80c547633e3a11..01810eb0f343d9 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -2,8 +2,8 @@ # SPDX-License-Identifier: MIT # variables: - windows-pool: 'PrWin-2020-06-30' - linux-pool: 'PrLin-2020-06-30' + windows-pool: 'PrWin-2020-08-12' + linux-pool: 'PrLin-2020-08-12' stages: - stage: check_cxx_formatting @@ -19,10 +19,14 @@ stages: inputs: filePath: 'scripts/azure-pipelines/windows/Check-CxxFormatting.ps1' arguments: '-Root .' + pwsh: true - stage: check_manifest_formatting displayName: Check the formatting of port manifests pool: $(windows-pool) dependsOn: [] + variables: + - name: VCPKG_DOWNLOADS + value: D:\downloads jobs: - job: workspace: @@ -32,7 +36,8 @@ stages: displayName: 'Check port manifest Formatting' inputs: filePath: 'scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1' - arguments: '-Root . -Downloads D:\Downloads' + arguments: '-Root .' + pwsh: true - stage: run_port_ci displayName: 'Run the Port CI' dependsOn: diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 index b0e44765750b7e..43ec7aa73ede28 100644 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -158,8 +158,13 @@ Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" Require-FileNotExists "$buildtreesRoot/rapidjson/src" Require-FileExists "$TestingRoot/packages.config" -& $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" -Throw-IfFailed +if ($IsLinux -or $IsMacOS) { + mono $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" + Throw-IfFailed +} else { + & $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" + Throw-IfFailed +} Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue mkdir $NuGetRoot @@ -177,3 +182,15 @@ Require-FileExists "$buildtreesRoot/tinyxml/src" if ((Get-ChildItem $NuGetRoot -Filter '*.nupkg' | Measure-Object).Count -ne 1) { throw "In '$CurrentTest': did not create exactly 1 NuGet package" } + +# Test export +$args = $commonArgs + @("export","rapidjson","tinyxml","--nuget","--nuget-id=vcpkg-export","--nuget-version=1.0.0","--output=vcpkg-export-output","--raw","--zip","--output-dir=$TestingRoot") +$CurrentTest = "./vcpkg $($args -join ' ')" +Write-Host $CurrentTest +Require-FileNotExists "$TestingRoot/vcpkg-export-output" +Require-FileNotExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" +Require-FileNotExists "$TestingRoot/vcpkg-export-output.zip" +./vcpkg @args +Require-FileExists "$TestingRoot/vcpkg-export-output" +Require-FileExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" +Require-FileExists "$TestingRoot/vcpkg-export-output.zip" diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index 4d4eada627cbca..0541975043203f 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -9,6 +9,12 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: /mnt/vcpkg-ci + - name: VCPKG_DOWNLOADS + value: /mnt/vcpkg-ci/downloads + steps: - bash: df -h displayName: 'Report on Disk Space' @@ -19,17 +25,15 @@ jobs: displayName: 'Create /home/agent' # Note: /mnt is the Azure machines' temporary disk. - bash: | - sudo mkdir /mnt/vcpkg-ci -m=777 - sudo mkdir /mnt/vcpkg-ci/downloads -m=777 + sudo mkdir ${{ variables.WORKING_ROOT }} -m=777 + sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} -m=777 exit 0 - displayName: 'Create /mnt/vcpkg-ci/downloads' + displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh - arguments: "-buildTests" - env: - VCPKG_DOWNLOADS: '/mnt/vcpkg-ci/downloads' + arguments: '-buildTests' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' - task: PowerShell@2 @@ -37,26 +41,24 @@ jobs: inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot /mnt/vcpkg-ci -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' condition: always() - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: x86-linux Build Failure Logs' + displayName: 'Publish Artifact: failure logs for x64-linux' inputs: PathtoPublish: '$(System.ArtifactsDirectory)/failure-logs' - ArtifactName: 'x64-linux port build failure logs' + ArtifactName: 'failure logs for x64-linux' condition: failed() - bash: | python3 scripts/file_script.py /mnt/vcpkg-ci/installed/vcpkg/info/ displayName: 'Build a file list for all packages' condition: always() - - task: PublishBuildArtifacts@1 - displayName: 'Upload file lists for all packages' + displayName: 'Publish Artifact: file lists for x64-linux' condition: always() - inputs: PathtoPublish: scripts/list_files - ArtifactName: "x64-linux package file lists" + ArtifactName: 'file lists for x64-linux' diff --git a/scripts/azure-pipelines/linux/create-vmss.ps1 b/scripts/azure-pipelines/linux/create-vmss.ps1 index 84c83dfeae2f3f..169a80fc938224 100755 --- a/scripts/azure-pipelines/linux/create-vmss.ps1 +++ b/scripts/azure-pipelines/linux/create-vmss.ps1 @@ -220,7 +220,7 @@ Write-Progress ` -Status 'Running provisioning script provision-image.sh in VM' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -Invoke-AzVMRunCommand ` +$ProvisionImageResult = Invoke-AzVMRunCommand ` -ResourceGroupName $ResourceGroupName ` -VMName $ProtoVMName ` -CommandId 'RunShellScript' ` @@ -228,6 +228,8 @@ Invoke-AzVMRunCommand ` -Parameter @{StorageAccountName=$StorageAccountName; ` StorageAccountKey=$StorageAccountKey;} +Write-Host "provision-image.sh output: $($ProvisionImageResult.value.Message)" + #################################################################################################### Write-Progress ` -Activity $ProgressActivity ` diff --git a/scripts/azure-pipelines/linux/provision-image.sh b/scripts/azure-pipelines/linux/provision-image.sh index 5a59161e6e9a4c..4936cf719074b5 100755 --- a/scripts/azure-pipelines/linux/provision-image.sh +++ b/scripts/azure-pipelines/linux/provision-image.sh @@ -27,7 +27,10 @@ APT_PACKAGES="$APT_PACKAGES libxkbcommon-dev libxcb-keysyms1-dev \ APT_PACKAGES="$APT_PACKAGES libkrb5-dev" # Additionally required by mesa -APT_PACKAGES="$APT_PACKAGES python3-setuptools" +APT_PACKAGES="$APT_PACKAGES python3-setuptools python3-mako" + +# Additionally required by some packages to install additional python packages +APT_PACKAGES="$APT_PACKAGES python3-pip" # Additionally required/installed by Azure DevOps Scale Set Agents APT_PACKAGES="$APT_PACKAGES liblttng-ust0 libkrb5-3 zlib1g libicu60" diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md index b0fdde43464c6b..0395908f0174f0 100644 --- a/scripts/azure-pipelines/osx/README.md +++ b/scripts/azure-pipelines/osx/README.md @@ -25,7 +25,7 @@ and `Setup-VagrantMachines.ps1`, and make sure to push any changes! Before anything else, one must download `brew` and `powershell`. ```sh -$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" $ brew cask install powershell ``` diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 index fb153a28ab26b5..5600cb1ed6fc84 100755 --- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 +++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -19,7 +19,7 @@ The username for the archives share. .PARAMETER ArchivesAccessKey The access key for the archives share. -.PARAMETER ArchivesUri +.PARAMETER ArchivesUrn The URN of the archives share; looks like `foo.windows.core.net`. .PARAMETER ArchivesShare @@ -105,7 +105,7 @@ $configuration = @{ archives = @{ username = $ArchivesUsername; access_key = $ArchivesAccessKey; - url = $ArchivesUri; + urn = $ArchivesUrn; share = $ArchivesShare; }; } diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 index 6fffa15225944d..b7ad489bb7995a 100644 --- a/scripts/azure-pipelines/osx/Utilities.psm1 +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -31,7 +31,7 @@ function Get-CommandExists [String]$Name ) - $null -ne (Get-Command -Name $Command -ErrorAction SilentlyContinue) + $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) } <# @@ -124,6 +124,7 @@ function Get-InstalledVirtualBoxExtensionPacks $currentString = "" $lines | ForEach-Object { + $Line = $_ if ($Line[0] -eq ' ') { $currentString += "`n$($Line.Trim())" } else { diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index cbf401fd353644..0856aada79ec77 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -10,11 +10,15 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: /Users/vagrant/Data + - name: VCPKG_DOWNLOADS + value: /Users/vagrant/Data/downloads + steps: - - bash: | - df -h + - bash: df -h displayName: 'Report on Disk Space' - condition: always() - bash: | brew list autoconf || brew install autoconf brew list automake || brew install automake @@ -22,46 +26,49 @@ jobs: brew list libtool || brew install libtool brew list bison || brew install bison brew list gfortran || brew cask install gfortran + brew list mono || brew install mono + brew list yasm || brew install yasm displayName: 'Install brew dependencies' - bash: | - sudo mkdir /Users/vagrant/Data/downloads || 0 - sudo chmod 777 /Users/vagrant/Data/downloads || 0 + sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} || 0 + sudo chmod 777 ${{ variables.VCPKG_DOWNLOADS }} || 0 exit 0 - displayName: 'Create /Users/vagrant/Data/downloads' + displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh arguments: '-buildTests' - env: - VCPKG_DOWNLOADS: '/Users/vagrant/Data/downloads' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' + - task: PowerShell@2 + displayName: 'Run vcpkg end-to-end tests' + inputs: + filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' + arguments: '-Triplet x64-osx -WorkingRoot ${{ variables.WORKING_ROOT }}' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot /Users/vagrant/Data/archives -WorkingRoot /Users/vagrant/Data -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot ${{ variables.WORKING_ROOT }}/archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' condition: always() - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: x64-osx port build failure logs' + displayName: 'Publish Artifact: failure logs for x64-osx' inputs: PathtoPublish: '$(System.ArtifactsDirectory)/failure-logs' - ArtifactName: 'x64-osx port build failure logs' + ArtifactName: 'failure logs for x64-osx' condition: failed() - bash: | python3 scripts/file_script.py /Users/vagrant/Data/installed/vcpkg/info/ displayName: 'Build a file list for all packages' condition: always() - - task: PublishBuildArtifacts@1 - displayName: 'Upload file lists for all packages' + displayName: 'Publish Artifact: file lists for x64-osx' condition: always() - inputs: PathtoPublish: scripts/list_files - ArtifactName: "x64-osx package file lists" + ArtifactName: 'file lists for x64-osx' diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index b142b8189a95c2..1e1cce50f06c99 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -29,7 +29,7 @@ devops_url = 'https://dev.azure.com/vcpkg' agent_pool = 'vcpkgAgentPool' pat = configuration['pat'] archives = configuration['archives'] -archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['url']}/#{archives['share']}" +archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" Vagrant.configure('2') do |config| # give them extra time to boot up @@ -42,7 +42,25 @@ Vagrant.configure('2') do |config| node.vm.hostname = machine[:hostname] node.vm.synced_folder '.', '/vagrant', disabled: true - node.vm.disk :disk, name: "#{machine[:hostname]}-data", size: "#{config['disk_size']}GB" + diskname = "#{machine[:hostname]}-data.vmdk" + + # I don't like this, but as far as I can tell, it's the only way + # to do this. When vagrant finishes the `disk` feature, switch + # over to that -- Nicole Mazzuca + if (not File.exists? diskname) then + system "VBoxManage createmedium --filename #{diskname} --size #{1024 * 220}" + end + + node.vm.provider 'virtualbox' do |vb| + vb.memory = machine[:ram] + vb.cpus = machine[:cpu] + vb.customize ['modifyvm', :id, '--ioapic', 'on'] + vb.customize ['storageattach', :id, + '--storagectl', 'SATA Controller', + '--port', '1', '--device', '0', '--type', 'hdd', + '--medium', "#{diskname}" + ] + end node.vm.provision 'shell', run: 'once', @@ -71,7 +89,7 @@ Vagrant.configure('2') do |config| node.vm.provision 'shell', run: 'once', name: 'Install brew and xcode command line tools', - inline: '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', + inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', privileged: false node.vm.provision 'shell', diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json index 0518df3b6f1f43..f0abc1673419ce 100644 --- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -34,13 +34,13 @@ "required": [ "username", "access_key", - "url", + "urn", "share" ], "properties": { "username": { "type": "string" }, "access_key": { "type": "string" }, - "url": { "type": "string" }, + "urn": { "type": "string" }, "share": { "type": "string" } } } diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index 9a30321b4637be..27ff3290ca0d27 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -52,7 +52,8 @@ $commonArgs = @( '--binarycaching', "--x-buildtrees-root=$buildtreesRoot", "--x-install-root=$installRoot", - "--x-packages-root=$packagesRoot" + "--x-packages-root=$packagesRoot", + "--overlay-ports=scripts/test_ports" ) $binaryCachingMode = 'readwrite' diff --git a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 index 7f300164f6b060..eaa9e692b09c91 100644 --- a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 @@ -9,8 +9,12 @@ Param( $clangFormat = 'C:\Program Files\LLVM\bin\clang-format.exe' if (-not (Test-Path $clangFormat)) { - Write-Error "clang-format not found; is it installed in the CI machines?" - throw + $clangFormat = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin\clang-format.exe' + if (-not (Test-Path $clangFormat)) + { + Write-Error 'clang-format not found; is it installed in the CI machines?' + throw + } } $toolsrc = Get-Item "$Root/toolsrc" @@ -32,9 +36,9 @@ try $msg = @( "", "The formatting of the C++ files didn't match our expectation.", - "If your build fails here, you need to format the following files with:" + "See github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#vcpkg-internal-code for solution." ) - $msg += " $(& $clangFormat -version)" + $msg += "File list:" $msg += " $changedFiles" $msg += "" diff --git a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 index e4f52ae7b44627..e4c59582d60271 100644 --- a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 @@ -3,8 +3,6 @@ Param( [Parameter(Mandatory=$True)] [string]$Root, [Parameter()] - [string]$DownloadsDirectory, - [Parameter()] [switch]$IgnoreErrors # allows one to just format ) @@ -16,11 +14,6 @@ if (-not (Test-Path "$Root/.vcpkg-root")) throw } -if (-not [string]::IsNullOrEmpty($DownloadsDirectory)) -{ - $env:VCPKG_DOWNLOADS = $DownloadsDirectory -} - if (-not (Test-Path "$Root/vcpkg.exe")) { & "$Root/bootstrap-vcpkg.bat" @@ -32,15 +25,20 @@ if (-not (Test-Path "$Root/vcpkg.exe")) } & "$Root/vcpkg.exe" 'x-format-manifest' '--all' +if (-not $?) +{ + Write-Error "Failed formatting manifests; are they well-formed?" + throw +} + $changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $portsTree if (-not $IgnoreErrors -and $null -ne $changedFiles) { $msg = @( "", "The formatting of the manifest files didn't match our expectation.", - "If your build fails here, you need to run:" + "See github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifest for solution." ) - $msg += " vcpkg x-format-manifest --all" $msg += "" $msg += "vcpkg should produce the following diff:" diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 5ec0b300c290b0..bb8c7435c30d02 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -9,71 +9,80 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: D:\ + - name: VCPKG_DOWNLOADS + value: D:\downloads steps: - task: PowerShell@2 displayName: 'Initialize Environment' inputs: filePath: 'scripts/azure-pipelines/windows/initialize-environment.ps1' + pwsh: true - task: PowerShell@2 displayName: 'Report on Disk Space' condition: always() inputs: filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' + pwsh: true # Note: D: is the Azure machines' temporary disk. - - task: CmdLine@2 + - script: .\bootstrap-vcpkg.bat displayName: 'Build vcpkg' - inputs: - script: | - set VCPKG_DOWNLOADS=D:\downloads - .\bootstrap-vcpkg.bat - task: CmdLine@2 displayName: "Build vcpkg with CMake and Run Tests" condition: eq('${{ parameters.triplet }}', 'x86-windows') inputs: script: | :: TRANSITION, get these tools on the VMs next time we roll them - set VCPKG_DOWNLOADS=D:\downloads .\vcpkg.exe fetch cmake .\vcpkg.exe fetch ninja - set PATH=D:\downloads\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;D:\downloads\tools\ninja-1.10.0-windows;%PATH% + set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.0-windows;%PATH% call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 rmdir /s /q build.x86.debug > nul 2> nul cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc ninja.exe -C build.x86.debug build.x86.debug\vcpkg-test.exe - powershell.exe -NoProfile -ExecutionPolicy Bypass "scripts\azure-pipelines\end-to-end-tests.ps1 -WorkingRoot \"%cd%\testing\" -triplet x86-windows" failOnStderr: true + - task: PowerShell@2 + displayName: 'Run vcpkg end-to-end tests' + condition: eq('${{ parameters.triplet }}', 'x86-windows') + inputs: + filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' + arguments: '-Triplet ${{ parameters.triplet }} -WorkingRoot ${{ variables.WORKING_ROOT }}' + pwsh: true - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot D:\ -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' + pwsh: true - task: PowerShell@2 displayName: 'Report on Disk Space After Build' condition: always() inputs: filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' + pwsh: true - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: ${{ parameters.triplet }} port build failure logs' + displayName: 'Publish Artifact: failure logs for ${{ parameters.triplet }}' inputs: PathtoPublish: '$(System.ArtifactsDirectory)\failure-logs' - ArtifactName: '${{ parameters.triplet }} port build failure logs' + ArtifactName: 'failure logs for ${{ parameters.triplet }}' condition: failed() - task: PowerShell@2 - displayName: "Generating all packages files" + displayName: 'Build a file list for all packages' condition: always() - inputs: targetType: inline script: | - $env:VCPKG_DOWNLOADS = "D:\downloads" ./vcpkg.exe fetch python3 & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\ + pwsh: true - task: PublishBuildArtifacts@1 - displayName: 'Upload file lists for all packages' + displayName: 'Publish Artifact: file lists for ${{ parameters.triplet }}' condition: always() inputs: PathtoPublish: scripts/list_files - ArtifactName: "${{ parameters.triplet }} package file lists" + ArtifactName: 'file lists for ${{ parameters.triplet }}' diff --git a/scripts/azure-pipelines/windows/create-vmss.ps1 b/scripts/azure-pipelines/windows/create-vmss.ps1 index b1aa5d0ce8c4ad..3bb89ee259da45 100644 --- a/scripts/azure-pipelines/windows/create-vmss.ps1 +++ b/scripts/azure-pipelines/windows/create-vmss.ps1 @@ -198,7 +198,7 @@ Write-Progress ` -Status 'Running provisioning script provision-image.txt (as a .ps1) in VM' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -Invoke-AzVMRunCommand ` +$ProvisionImageResult = Invoke-AzVMRunCommand ` -ResourceGroupName $ResourceGroupName ` -VMName $ProtoVMName ` -CommandId 'RunPowerShellScript' ` @@ -207,6 +207,8 @@ Invoke-AzVMRunCommand ` StorageAccountName=$StorageAccountName; ` StorageAccountKey=$StorageAccountKey;} +Write-Host "provision-image.ps1 output: $($ProvisionImageResult.value.Message)" + #################################################################################################### Write-Progress ` -Activity $ProgressActivity ` @@ -221,12 +223,14 @@ Write-Progress ` -Status 'Running provisioning script sysprep.ps1 in VM' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -Invoke-AzVMRunCommand ` +$SysprepResult = Invoke-AzVMRunCommand ` -ResourceGroupName $ResourceGroupName ` -VMName $ProtoVMName ` -CommandId 'RunPowerShellScript' ` -ScriptPath "$PSScriptRoot\sysprep.ps1" +Write-Host "sysprep.ps1 output: $($SysprepResult.value.Message)" + #################################################################################################### Write-Progress ` -Activity $ProgressActivity ` diff --git a/scripts/azure-pipelines/windows/provision-image.txt b/scripts/azure-pipelines/windows/provision-image.txt index 798b96e9a13866..b43b1bf87c198c 100644 --- a/scripts/azure-pipelines/windows/provision-image.txt +++ b/scripts/azure-pipelines/windows/provision-image.txt @@ -7,7 +7,7 @@ Sets up a machine to be an image for a scale set. .DESCRIPTION provision-image.ps1 runs on an existing, freshly provisioned virtual machine, -and sets that virtual machine up as a vcpkg build machine. After this is done, +and sets up that virtual machine as a build machine. After this is done, (outside of this script), we take that machine and make it an image to be copied for setting up new VMs in the scale set. @@ -60,10 +60,14 @@ Function Get-TempFilePath { return Join-Path $tempPath $tempName } -if (-not [string]::IsNullOrEmpty($AdminUserPassword)) { - Write-Host "AdminUser password supplied; switching to AdminUser" +$TranscriptPath = 'C:\provision-image-transcript.txt' + +if ([string]::IsNullOrEmpty($AdminUserPassword)) { + Start-Transcript -Path $TranscriptPath +} else { + Write-Host 'AdminUser password supplied; switching to AdminUser.' $PsExecPath = Get-TempFilePath -Extension 'exe' - Write-Host "Downloading psexec to $PsExecPath" + Write-Host "Downloading psexec to: $PsExecPath" & curl.exe -L -o $PsExecPath -s -S https://live.sysinternals.com/PsExec64.exe $PsExecArgs = @( '-u', @@ -89,8 +93,11 @@ if (-not [string]::IsNullOrEmpty($AdminUserPassword)) { $PsExecArgs += $StorageAccountKey } - Write-Host "Executing $PsExecPath " + @PsExecArgs - & $PsExecPath @PsExecArgs > C:\ProvisionLog.txt + Write-Host "Executing: $PsExecPath $PsExecArgs" + + $proc = Start-Process -FilePath $PsExecPath -ArgumentList $PsExecArgs -Wait -PassThru + Write-Host 'Reading transcript...' + Get-Content -Path $TranscriptPath Write-Host 'Cleaning up...' Remove-Item $PsExecPath exit $proc.ExitCode @@ -118,7 +125,6 @@ $WindowsSDKUrl = 'https://download.microsoft.com/download/1/c/3/1c3d5161-d9e9-4e $WindowsWDKUrl = 'https://download.microsoft.com/download/1/a/7/1a730121-7aa7-46f7-8978-7db729aa413d/wdk/wdksetup.exe' $MpiUrl = 'https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe' -$LlvmUrl = 'https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe' $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' $CudaFeatures = 'nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 ' + ` @@ -127,7 +133,7 @@ $CudaFeatures = 'nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_ad 'cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1 ' + ` 'occupancy_calculator_10.1 fortran_examples_10.1' -$BinSkimUrl = 'https://www.nuget.org/api/v2/package/Microsoft.CodeAnalysis.BinSkim/1.6.0' +$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.msi' $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' @@ -191,7 +197,7 @@ Function InstallVisualStudio { Write-Host 'Downloading Visual Studio...' [string]$bootstrapperExe = Get-TempFilePath -Extension 'exe' curl.exe -L -o $bootstrapperExe -s -S $BootstrapperUrl - Write-Host "Installing Visual Studio..." + Write-Host 'Installing Visual Studio...' $args = @('/c', $bootstrapperExe, '--quiet', '--norestart', '--wait', '--nocache') foreach ($workload in $Workloads) { $args += '--add' @@ -362,59 +368,6 @@ Function InstallWindowsWDK { } } -<# -.SYNOPSIS -Installs LLVM. - -.DESCRIPTION -InstallLLVM installs LLVM from the supplied URL. - -.PARAMETER Url -The URL of the LLVM installer. -#> -Function InstallLLVM { - Param( - [String]$Url - ) - - try { - Write-Host 'Downloading LLVM...' - [string]$installerPath = Get-TempFilePath -Extension 'exe' - curl.exe -L -o $installerPath -s -S $Url - Write-Host 'Installing LLVM...' - $proc = Start-Process -FilePath $installerPath -ArgumentList @('/S') -NoNewWindow -Wait -PassThru - PrintMsiExitCodeMessage $proc.ExitCode - } - catch { - Write-Error "Failed to install LLVM! $($_.Exception.Message)" - throw - } -} - -<# -.SYNOPSIS -Installs LLVM. - -.DESCRIPTION -InstallLLVM installs LLVM from the supplied URL. - -.PARAMETER Url -The URL of the LLVM installer. -#> -Function InstallLLVM { - try { - Write-Host 'Downloading LLVM...' - [string]$installerPath = Get-TempFilePath -Extension 'exe' - curl.exe -L -o $installerPath -s -S $Url - Write-Host 'Installing LLVM...' - $proc = Start-Process -FilePath $installerPath -ArgumentList @('/S') -NoNewWindow -Wait -PassThru - PrintMsiExitCodeMessage $proc.ExitCode - } - catch { - Write-Error "Failed to install LLVM! $($_.Exception.Message)" - } -} - <# .SYNOPSIS Installs MPI @@ -458,7 +411,7 @@ Installs NVIDIA's CUDA Toolkit. .DESCRIPTION InstallCuda installs the CUDA Toolkit with the features specified as a -space separated list of strings in $Features. +space-separated list of strings in $Features. .PARAMETER Url The URL of the CUDA installer. @@ -504,6 +457,7 @@ if ($null -eq $av) { Write-Host 'AntiVirus not installed, skipping exclusions.' } else { Write-Host 'Configuring AntiVirus exclusions...' + Add-MpPreference -ExclusionPath C:\agent Add-MPPreference -ExclusionPath D:\ Add-MPPreference -ExclusionProcess ninja.exe Add-MPPreference -ExclusionProcess clang-cl.exe @@ -515,10 +469,9 @@ if ($null -eq $av) { InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable' InstallWindowsSDK -Url $WindowsSDKUrl InstallWindowsWDK -Url $WindowsWDKUrl -InstallLLVM -Url $LlvmUrl InstallMpi -Url $MpiUrl InstallCuda -Url $CudaUrl -Features $CudaFeatures -InstallZip -Url $BinSkimUrl -Name 'BinSkim' -Dir 'C:\BinSkim' +InstallMSI -Url $PwshUrl -Name 'PowerShell Core' if ([string]::IsNullOrWhiteSpace($StorageAccountName)) { Write-Host 'No storage account name configured.' } else { diff --git a/scripts/azure-pipelines/windows/sysprep.ps1 b/scripts/azure-pipelines/windows/sysprep.ps1 index c0965350d4cd99..a29950044ff6ca 100644 --- a/scripts/azure-pipelines/windows/sysprep.ps1 +++ b/scripts/azure-pipelines/windows/sysprep.ps1 @@ -14,4 +14,4 @@ for more information. $ErrorActionPreference = 'Stop' Write-Host 'Running sysprep' -& C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown +& C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /shutdown diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 992cf37a29981a..8136a9799eb8aa 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -11,25 +11,68 @@ if ($null -eq $portsDir) $portsDir = "$scriptsDir/../../ports" } +# Optionally clear this array when moving to a new boost version +$port_versions = @{ + "asio" = 1; + "context" = 1; + "coroutine" = 1; + "fiber" = 1; + "filesystem" = 1; + "graph-parallel" = 1; + "iostreams" = 1; + "locale" = 1; + "log" = 1; + "mpi" = 1; + "parameter-python" = 1; + "poly-collection" = 1; + "python" = 1; + "safe-numerics" = 1; + "stacktrace" = 1; + "test" = 1; + "wave" = 1; + "boost" = 1 +} + +$per_port_data = @{ + "fiber" = @{ "supports" = "windows&!uwp&!arm" }; + "filesystem" = @{ "supports" = "!uwp" }; + "iostreams" = @{ "supports" = "!uwp" }; + "context" = @{ "supports" = "!uwp" }; + "stacktrace" = @{ "supports" = "!uwp" }; + "coroutine" = @{ "supports" = "!arm&!uwp" }; + "test" = @{ "supports" = "!uwp" }; + "wave" = @{ "supports" = "!uwp" }; + "log" = @{ "supports" = "!uwp" }; + "locale" = @{ + "supports" = "!uwp"; + "features" = @( + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Locale" + )}; + "python" = @{ + "supports" = "!uwp&!(arm&windows)"; + "features" = @( + "Feature: python2" + "Build-Depends: python2 (windows)" + "Description: Build with Python2 support" + )}; + "regex" = @{ "features" = @( + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Regex" + )} +} + function TransformReference() { param ( [string]$library ) - if ($library -match "fiber") - { - # these only work on windows desktop - "$library (windows)" - } - elseif ($library -match "type[_-]erasure|contract") + if ($per_port_data[$library].supports) { - # These only work on x86-derived processors - "$library (!arm)" - } - elseif ($library -match "iostreams|filesystem|context|stacktrace|coroutine`$|locale|test|wave|log`$") - { - "$library (!uwp)" + "$library ($($per_port_data[$library].supports))" } else { @@ -49,48 +92,28 @@ function Generate() $controlDeps = ($Depends | sort) -join ", " - $versionSuffix = "" - - # if ($PortName -eq "") - # { - # $versionSuffix = "-1" - # } - mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null $controlLines = @( "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost-$PortName" - "Version: $version$versionSuffix" + "Version: $version" + ) + if ($port_versions[$PortName]) + { + $controlLines += @("Port-Version: $($port_versions[$PortName])") + } + $controlLines += @( "Build-Depends: $controlDeps" "Homepage: https://github.com/boostorg/$Name" "Description: Boost $Name module" ) - if ($PortName -eq "locale") + if ($per_port_data[$PortName].supports) { - $controlLines += @( - "" - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Locale" - ) - } - if ($PortName -eq "python") - { - $controlLines += @( - "" - "Feature: python2" - "Build-Depends: python2 (windows)" - "Description: Build with Python2 support" - ) + $controlLines += @("Supports: $($per_port_data[$PortName].supports)") } - if ($PortName -eq "regex") + if ($per_port_data[$PortName].features) { - $controlLines += @( - "" - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Regex" - ) + $controlLines += @("") + $per_port_data[$PortName].features } $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL" @@ -115,23 +138,21 @@ function Generate() " SHA512 $Hash" " HEAD_REF master" ) - if ($PortName -eq "asio") + $patches = ls $portsDir/boost-$PortName/*.patch + if ($patches.Count -eq 0) { - $portfileLines += @(" PATCHES windows_alloca_header.patch") } - if ($PortName -eq "iostreams") + elseif ($patches.Count -eq 1) { - $portfileLines += @(" PATCHES Removeseekpos.patch") + $portfileLines += @(" PATCHES $($patches.name)") } - if ($PortName -eq "outcome") - { - # 1.73 Known Issue - $portfileLines += @(" PATCHES 0001-outcome-assert.patch") - } - if ($PortName -eq "beast") + else { - # 1.73 Known Issue - $portfileLines += @(" PATCHES 0002-beast-coroutines.patch") + $portfileLines += @(" PATCHES") + foreach ($patch in $patches) + { + $portfileLines += @(" $($patches.name)") + } } $portfileLines += @( ")" @@ -277,6 +298,7 @@ foreach ($library in $libraries) if ($_ -match "aligned_storage") { "type_traits" } elseif ($_ -match "noncopyable|ref|swap|get_pointer|checked_delete|visit_each") { "core" } elseif ($_ -eq "type") { "core" } + elseif ($_ -eq "concept") { "concept_check" } elseif ($_ -match "unordered_") { "unordered" } elseif ($_ -match "cstdint|integer_fwd|integer_traits") { "integer" } elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" } @@ -340,8 +362,8 @@ foreach ($library in $libraries) (($library -notmatch "iostreams") -or ($_ -notmatch "random"))` -and ` (($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator")) - } | % { "boost-$_" -replace "_","-" } | % { - TransformReference $_ + } | % { $_ -replace "_","-" } | % { + "boost-" + (TransformReference $_) }) $deps += @("boost-vcpkg-helpers") @@ -401,6 +423,7 @@ if ($libraries_in_boost_port.length -gt 1) { "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost" "Version: $version" + "Port-Version: $($port_versions.boost)" "Homepage: https://boost.org" "Description: Peer-reviewed portable C++ source libraries" "Build-Depends: $boostDependsList" diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index c062e58daa47fc..0d87d6ee8939fb 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -57,11 +57,11 @@ while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) } Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" -$vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" +$vcpkgBootstrapPath = "$vcpkgRootDir\toolsrc\windows-bootstrap" -if (!(Test-Path $vcpkgSourcesPath)) +if (-not (Test-Path $vcpkgBootstrapPath)) { - Write-Error "Unable to determine vcpkg sources directory. '$vcpkgSourcesPath' does not exist." + Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist." throw } @@ -339,7 +339,7 @@ if ($disableMetrics) } $platform = "x86" -$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release" +$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x86.release" if($PSVersionTable.PSVersion.Major -le 2) { $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture @@ -356,7 +356,7 @@ if ($win64) } $platform = "x64" - $vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release" + $vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x64.release" } if ($architecture -like "*64*") @@ -379,7 +379,7 @@ $arguments = ( "/verbosity:minimal", "/m", "/nologo", -"`"$vcpkgSourcesPath\dirs.proj`"") -join " " +"`"$vcpkgBootstrapPath\dirs.proj`"") -join " " function vcpkgInvokeCommandClean() { diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 321a16e05d5d95..46f695864b1961 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -79,6 +79,16 @@ vcpkgCheckRepoTool() fi } +vcpkgCheckBuildTool() +{ + __tool=$1 + if ! command -v "$__tool" >/dev/null 2>&1 ; then + echo "Could not find $__tool. Please install it (and other dependencies) with:" + echo "sudo apt-get install cmake ninja-build" + exit 1 + fi +} + vcpkgCheckEqualFileHash() { url=$1; filePath=$2; expectedHash=$3 @@ -226,10 +236,18 @@ selectCXX() # Preparation UNAME="$(uname)" +ARCH="$(uname -m)" + +# Force using system utilities for building vcpkg if host arch is arm or arm64. +if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" ]; then + vcpkgUseSystem=true +fi if $vcpkgUseSystem; then cmakeExe="cmake" ninjaExe="ninja" + vcpkgCheckBuildTool "$cmakeExe" + vcpkgCheckBuildTool "$ninjaExe" else fetchTool "cmake" "$UNAME" cmakeExe || exit 1 fetchTool "ninja" "$UNAME" ninjaExe || exit 1 diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index e27fd39f91a03e..c43837e53c8a67 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -91,8 +91,8 @@ - - + + diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4ee79d179be9c4..f2e89c5db066c7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -5,6 +5,8 @@ mark_as_advanced(CMAKE_TOOLCHAIN_FILE) option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF) mark_as_advanced(VCPKG_VERBOSE) +include(CMakeDependentOption) + function(_vcpkg_get_directory_name_of_file_above OUT DIRECTORY FILENAME) set(_vcpkg_get_dir_candidate ${DIRECTORY}) while(IS_DIRECTORY ${_vcpkg_get_dir_candidate} AND NOT DEFINED _vcpkg_get_dir_out) @@ -23,7 +25,13 @@ function(_vcpkg_get_directory_name_of_file_above OUT DIRECTORY FILENAME) set(${OUT} ${_vcpkg_get_dir_out} CACHE INTERNAL "_vcpkg_get_directory_name_of_file_above: ${OUT}") endfunction() -_vcpkg_get_directory_name_of_file_above(_VCPKG_MANIFEST_DIR ${CMAKE_CURRENT_SOURCE_DIR} "vcpkg.json") +if(NOT DEFINED VCPKG_MANIFEST_DIR) + if(EXISTS "${CMAKE_SOURCE_DIR}/vcpkg.json") + set(_VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}") + endif() +else() + set(_VCPKG_MANIFEST_DIR ${VCPKG_MANIFEST_DIR}) +endif() if(NOT DEFINED VCPKG_MANIFEST_MODE) if(_VCPKG_MANIFEST_DIR) set(VCPKG_MANIFEST_MODE ON) @@ -37,15 +45,26 @@ elseif(VCPKG_MANIFEST_MODE AND NOT _VCPKG_MANIFEST_DIR) "disable manifests by turning off VCPKG_MANIFEST_MODE.") endif() -if(VCPKG_MANIFEST_MODE) - option(VCPKG_MANIFEST_INSTALL -[[ +if(NOT DEFINED _INTERNAL_CHECK_VCPKG_MANIFEST_MODE) + set(_INTERNAL_CHECK_VCPKG_MANIFEST_MODE "${VCPKG_MANIFEST_MODE}" + CACHE INTERNAL "Making sure VCPKG_MANIFEST_MODE doesn't change") +endif() + +if(NOT VCPKG_MANIFEST_MODE STREQUAL _INTERNAL_CHECK_VCPKG_MANIFEST_MODE) + message(FATAL_ERROR [[ +vcpkg manifest mode was enabled for a build directory where it was initially disabled. +This is not supported. Please delete the build directory and reconfigure. +]]) +endif() + +CMAKE_DEPENDENT_OPTION(VCPKG_MANIFEST_INSTALL [[ Install the dependencies listed in your manifest: If this is off, you will have to manually install your dependencies. See https://github.com/microsoft/vcpkg/tree/master/docs/specifications/manifests.md for more info. ]] - ON) -endif() + ON + "VCPKG_MANIFEST_MODE" + OFF) # Determine whether the toolchain is loaded during a try-compile configuration get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) @@ -151,6 +170,12 @@ else() endif() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + set(_VCPKG_TARGET_TRIPLET_ARCH s390x) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) else() if( _CMAKE_IN_TRY_COMPILE ) message(STATUS "Unable to determine target architecture, continuing without vcpkg.") @@ -306,13 +331,23 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE) message(STATUS "Running vcpkg install") + set(_VCPKG_MANIFEST_FEATURES) + foreach(feature ${VCPKG_MANIFEST_FEATURES}) + list(APPEND _VCPKG_MANIFEST_FEATURES "--x-feature=${feature}") + endforeach() + + if(VCPKG_MANIFEST_NO_DEFAULT_FEATURES) + set(_VCPKG_MANIFEST_NO_DEFAULT_FEATURES "--x-no-default-features") + endif() + execute_process( COMMAND "${_VCPKG_EXECUTABLE}" install - --triplet ${VCPKG_TARGET_TRIPLET} - --vcpkg-root ${_VCPKG_ROOT_DIR} - --x-manifest-root=${_VCPKG_MANIFEST_DIR} - --x-install-root=${_VCPKG_INSTALLED_DIR} - --binarycaching + --triplet "${VCPKG_TARGET_TRIPLET}" + --vcpkg-root "${_VCPKG_ROOT_DIR}" + "--x-manifest-root=${_VCPKG_MANIFEST_DIR}" + "--x-install-root=${_VCPKG_INSTALLED_DIR}" + ${_VCPKG_MANIFEST_FEATURES} + ${_VCPKG_MANIFEST_NO_DEFAULT_FEATURES} RESULT_VARIABLE _VCPKG_INSTALL_RESULT) if (NOT _VCPKG_INSTALL_RESULT EQUAL 0) @@ -399,7 +434,11 @@ macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_NO_BOOST_CMAKE ON) unset(Boost_USE_STATIC_RUNTIME CACHE) - set(Boost_COMPILER "-vc140") + if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v120") + set(Boost_COMPILER "-vc120") + else() + set(Boost_COMPILER "-vc140") + endif() _find_package(${ARGV}) elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 5546c1f1ae9aec..d848189b325a70 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -48,8 +48,6 @@ akali:arm-uwp=fail akali:arm64-windows=fail alac:arm-uwp=fail alac:x64-uwp=fail -alembic:x64-osx=fail -alembic:x64-windows-static=fail aliyun-oss-c-sdk:x64-linux=fail aliyun-oss-c-sdk:x64-osx=fail ampl-mp:arm64-windows=fail @@ -74,22 +72,18 @@ asiosdk:x64-osx=fail asiosdk:x64-uwp=fail asiosdk:arm64-windows=fail asiosdk:arm-uwp=fail -asmjit:arm64-windows=fail -asmjit:arm-uwp=fail asyncplusplus:arm-uwp=fail asyncplusplus:x64-uwp=fail atk:x64-osx=fail atk:arm64-windows=fail -atkmm:x64-linux=fail atlmfc:x64-linux=fail atlmfc:x64-osx=fail aubio:x64-linux=fail aubio:x64-osx=fail -avisynthplus:x64-linux=fail -avisynthplus:x64-windows-static=fail avro-c:arm-uwp=fail avro-c:x64-osx=fail avro-c:x64-uwp=fail +avro-cpp:x64-windows-static=fail aws-c-common:arm64-windows=fail aws-c-common:arm-uwp=fail aws-c-common:x64-uwp=fail @@ -103,6 +97,10 @@ aws-lambda-cpp:x86-windows=fail aws-lambda-cpp:x64-osx=fail azure-c-shared-utility:arm-uwp=fail azure-c-shared-utility:x64-uwp=fail +azure-kinect-sensor-sdk:x64-linux=fail +azure-kinect-sensor-sdk:x64-osx=fail +# Requires ATL for ARM64 to be installed in CI +azure-storage-cpp:arm64-windows=fail bde:arm64-windows=fail bde:arm-uwp=fail bde:x64-uwp=fail @@ -122,9 +120,6 @@ bitserializer-rapidyaml:x64-osx=skip bitserializer:arm-uwp=skip bitserializer:arm64-windows=skip bitserializer:x64-osx=skip -blaze:x64-windows=fail -blaze:x64-windows-static=fail -blaze:x86-windows=fail blend2d:arm64-windows=fail blend2d:arm-uwp=fail blend2d:x64-uwp=fail @@ -137,31 +132,9 @@ blosc:x64-uwp=fail bond:arm-uwp=fail bond:x64-osx=fail bond:x64-uwp=fail -boost-coroutine:arm-uwp=fail -boost-coroutine:arm64-windows=fail -boost-fiber:arm-uwp=fail -boost-fiber:arm64-windows=fail -boost-fiber:x64-osx=fail -boost-fiber:x64-uwp=fail -boost-filesystem:arm-uwp=fail -boost-filesystem:x64-uwp=fail -boost-iostreams:arm-uwp=fail -boost-iostreams:x64-uwp=fail -boost-locale:arm-uwp=fail -boost-locale:x64-uwp=fail -boost-log:arm-uwp=fail -boost-log:x64-uwp=fail -boost-stacktrace:arm-uwp=fail -boost-stacktrace:x64-uwp=fail -boost-test:arm-uwp=fail -boost-test:x64-uwp=fail -boost-wave:arm-uwp=fail -boost-wave:x64-uwp=fail botan:arm64-windows=fail botan:arm-uwp=fail botan:x64-uwp=fail -box2d:x64-uwp=fail -box2d:arm-uwp=fail breakpad:arm64-windows=fail bullet3:arm64-windows=fail bullet3:arm-uwp=fail @@ -172,6 +145,11 @@ caf:x64-uwp=fail caffe2:x86-windows=fail caffe2:arm64-windows=fail cairomm:x64-linux=fail +# capnproto currently triggers an ICE +capnproto:x86-windows=fail +capnproto:x64-windows=fail +capnproto:x64-windows-static=fail +# capnproto doesn't support arm, arm64, or UWP capnproto:arm64-windows=fail capnproto:arm-uwp=fail capnproto:x64-uwp=fail @@ -222,10 +200,11 @@ chipmunk:x64-osx=fail chipmunk:x64-uwp=fail chmlib:arm-uwp=fail chmlib:x64-uwp=fail +# Chromium Base requires a recent version of Clang to be installed. +chromium-base:x64-linux=skip civetweb:arm64-windows = skip civetweb:arm-uwp = skip civetweb:x64-uwp = skip -clapack:x64-uwp=fail clblas:arm64-windows=fail clblast:x64-linux=fail clblast:x64-windows-static=fail @@ -244,6 +223,7 @@ coin:arm64-windows=fail coin:arm-uwp=fail coin:x64-uwp=fail collada-dom:x64-windows-static=fail +constexpr-contracts:x64-linux=fail coolprop:arm-uwp=fail coolprop:x64-linux=fail coolprop:x64-osx=fail @@ -263,7 +243,6 @@ cppmicroservices:arm-uwp=fail cppmicroservices:x64-uwp=fail cpp-netlib:arm-uwp=fail cpp-netlib:x64-uwp=fail -cpp-taskflow:x64-osx=fail cppcoro:x64-linux=fail cppcoro:arm-uwp=fail cppcoro:x64-uwp=fail @@ -281,8 +260,6 @@ crashpad:x86-windows=fail crfsuite:arm-uwp=fail crfsuite:x64-uwp=fail crossguid:x64-osx=fail -cspice:arm-uwp=fail -cspice:x64-uwp=fail ctemplate:arm64-windows=fail ctemplate:arm-uwp=fail ctemplate:x64-linux=fail @@ -293,7 +270,15 @@ cudnn:arm-uwp=fail cudnn:x64-uwp=fail cudnn:x64-windows-static=fail cudnn:x86-windows=fail -dbow2:x64-osx=fail +# Since pipeline cannot automatically install dbghelp dependency, skip this detection +dbghelp:arm-uwp=skip +dbghelp:arm64-windows=skip +dbghelp:x64-linux=fail +dbghelp:x64-osx=fail +dbghelp:x64-uwp=skip +dbghelp:x64-windows-static=skip +dbghelp:x64-windows=skip +dbghelp:x86-windows=skip dcmtk:arm-uwp=fail dcmtk:arm64-windows=fail dcmtk:x64-uwp=fail @@ -327,7 +312,6 @@ dlfcn-win32:x64-linux=fail dlfcn-win32:x64-osx=fail dlfcn-win32:x64-uwp=fail dmlc:arm-uwp=fail -dmlc:arm64-windows=fail dmlc:x64-uwp=fail dpdk:arm-uwp=fail dpdk:arm64-windows=fail @@ -397,8 +381,6 @@ epsilon:arm-uwp=fail epsilon:x64-linux=fail epsilon:x64-osx=fail epsilon:x64-uwp=fail -expat:arm-uwp=fail -expat:x64-uwp=fail faad2:x64-linux=fail faad2:x64-osx=fail fann:arm-uwp=fail @@ -429,8 +411,17 @@ flint:x64-linux=fail flint:x64-osx=fail fltk:arm-uwp=fail fltk:x64-uwp=fail -fluidsynth:x64-linux=fail fluidsynth:x64-osx=fail +# fluidlite conflicts with fluidsynth; we test fluidsynth rather than fluidlite because +# fluidlite has no dependencies and thus is less likely to be broken by another package. +fluidlite:arm-uwp=skip +fluidlite:arm64-windows=skip +fluidlite:x64-linux=skip +fluidlite:x64-osx=skip +fluidlite:x64-uwp=skip +fluidlite:x64-windows-static=skip +fluidlite:x64-windows=skip +fluidlite:x86-windows=skip fmem:arm-uwp=fail fmem:x64-uwp=fail fmi4cpp:arm-uwp=fail @@ -447,6 +438,8 @@ freeglut:arm64-windows=fail freeglut:arm-uwp=fail freeglut:x64-uwp=fail freeglut:x64-osx=fail +# Needs /bigobj +freeopcua:arm64-windows=fail freetds:arm-uwp=fail freetds:x64-linux=fail freetds:x64-osx=fail @@ -454,11 +447,8 @@ freetds:x64-uwp=fail freetype-gl:x64-uwp=fail freexl:arm-uwp=fail freexl:x64-uwp=fail -freexl:x64-windows=fail fribidi:arm64-windows=fail fribidi:arm-uwp=fail -fribidi:x64-linux=fail -fribidi:x64-osx=fail fribidi:x64-uwp=fail ftgl:x64-uwp=fail fuzzylite:arm-uwp=fail @@ -516,6 +506,8 @@ gmmlib:x64-uwp=fail gmmlib:x64-windows=fail gmmlib:x64-windows-static=fail gmmlib:x86-windows=fail +# VS 2019 16.7 broke gmp UWP https://github.com/microsoft/vcpkg/issues/13172 +gmp:x64-uwp=fail google-cloud-cpp:arm64-windows=fail google-cloud-cpp:arm-uwp=fail google-cloud-cpp:x64-uwp=fail @@ -534,9 +526,6 @@ graphqlparser:x64-uwp=fail gsl:arm-uwp=fail gsl:x64-uwp=fail # https://github.com/microsoft/vcpkg/pull/11048 -gsoap:x64-linux=fail -gsoap:x64-osx=fail -gsoap:x64-uwp=fail gtk:x64-linux=fail guetzli:x64-osx=fail h3:arm64-windows=fail @@ -562,12 +551,10 @@ hiredis:arm-uwp=fail hiredis:x64-uwp=fail hpx:x64-windows-static=fail hpx:x64-linux=fail +libhsplasma:x64-windows-static=fail hwloc:arm64-windows=fail hwloc:arm-uwp=fail hwloc:x64-uwp=fail -# hypre has a conflict with 'superlu' port -hypre:x64-linux=skip -hypre:x64-osx=skip icu:arm64-windows=fail icu:arm-uwp=fail icu:x64-uwp=fail @@ -611,9 +598,6 @@ isal:x64-uwp=fail isal:x64-windows=fail isal:x64-windows-static=fail isal:x86-windows=fail -itk:x64-windows=fail -itk:x64-windows-static=fail -itk:x86-windows=fail jack2:arm-uwp=fail jack2:x64-uwp=fail jaeger-client-cpp:arm64-windows=fail @@ -629,9 +613,9 @@ jinja2cpplight:arm-uwp=fail jinja2cpplight:x64-uwp=fail keystone:arm-uwp=fail keystone:x64-uwp=fail -kfr:arm64-windows=fail +kfr:arm64-windows=fail kfr:arm-uwp=fail -kfr:x64-linux=fail +kfr:x64-linux=fail kinectsdk1:arm64-windows=fail kinectsdk1:arm-uwp=fail kinectsdk1:x64-linux=fail @@ -652,7 +636,6 @@ leveldb:arm-uwp=fail leveldb:x64-uwp=fail libaiff:x64-linux=fail libarchive:arm-uwp=fail -libass:x64-windows-static=fail libbf:arm64-windows=fail libbf:arm-uwp=fail libbf:x64-uwp=fail @@ -667,7 +650,6 @@ libcds:x64-uwp=fail libconfig:x64-osx=fail libcopp:arm64-windows=fail libcopp:arm-uwp=fail -libcopp:x64-windows-static=fail libcrafter:x86-windows=fail libcrafter:x64-windows=fail cpuid:arm-uwp=fail @@ -683,7 +665,6 @@ libdshowcapture:x64-osx=fail libdshowcapture:x64-uwp=fail libepoxy:arm64-windows=fail libepoxy:arm-uwp=fail -libepoxy:x64-osx=fail libepoxy:x64-uwp=fail libepoxy:x64-windows-static=fail libevent:arm-uwp=fail @@ -700,9 +681,10 @@ libfabric:arm-uwp=fail libfabric:x64-linux=fail libfabric:x64-osx=fail libfabric:x64-uwp=fail -libfabric:x64-windows=fail libfabric:x64-windows-static=fail libfreenect2:arm64-windows=fail +libfreenect2:x64-linux=fail +libfreenect2:x64-osx=fail libgit2:arm-uwp=fail libgit2:x64-uwp=fail libgo:arm-uwp=fail @@ -769,8 +751,6 @@ libmesh:x64-windows-static=skip libmesh:x86-windows=skip libmesh:x64-osx=skip libmesh:x64-linux=skip -libmodbus:arm-uwp=fail -libmodbus:x64-uwp=fail libmodman:arm-uwp=fail libmodman:x64-uwp=fail libmodman:x64-windows-static=fail @@ -873,8 +853,6 @@ libtins:arm-uwp=fail libtins:x64-uwp=fail libtomcrypt:arm64-windows=fail libtomcrypt:arm-uwp=fail -libtorrent:arm-uwp=fail -libtorrent:x64-uwp=fail libudis86:arm-uwp=fail libudis86:x64-linux=fail libudis86:x64-osx=fail @@ -890,8 +868,6 @@ libui:arm-uwp=fail libui:x64-linux=fail libui:x64-uwp=fail libusb:arm-uwp=fail -libusb:x64-linux=fail -libusb:x64-osx=fail libusb:x64-uwp=fail libusbmuxd:arm-uwp=fail libusbmuxd:x64-uwp=fail @@ -951,8 +927,6 @@ lmdb:arm-uwp=fail lmdb:x64-uwp=fail log4cplus:arm-uwp=fail log4cplus:x64-uwp=fail -log4cpp:arm-uwp=fail -log4cpp:x64-uwp=fail log4cxx:arm64-windows=fail log4cxx:arm-uwp=fail log4cxx:x64-linux=fail @@ -973,6 +947,12 @@ luasocket:x64-linux=fail luasocket:x64-osx=fail lzfse:arm-uwp=fail magnum:arm64-windows=skip +marble:x64-windows-static=fail +marble:arm64-windows=fail +marble:arm-uwp=fail +marble:x64-linux=fail +marble:x64-osx=fail +marble:x86-windows=fail marl:arm-uwp=fail marl:x64-uwp=fail mathgl:x64-osx=fail @@ -1075,6 +1055,7 @@ moos-core:x86-windows=fail moos-essential:arm64-windows=fail moos-essential:x64-windows=fail moos-essential:x86-windows=fail +# Conflicts with libjpeg-turbo mozjpeg:arm64-windows = skip mozjpeg:arm-uwp = skip mozjpeg:x64-linux = skip @@ -1089,8 +1070,6 @@ mpir:x86-windows=skip mpir:x64-windows=skip mpir:x64-windows-static=skip mpir:arm64-windows=skip -mpir:arm-uwp=skip -mpir:x64-uwp=skip mpir:x64-osx=skip mpir:x64-linux=skip msix:x64-linux=fail @@ -1104,11 +1083,6 @@ msmpi:x64-uwp=fail munit:arm-uwp=fail munit:arm64-windows=fail munit:x64-uwp=fail -# Though `vcpkg_configure_meson` and `vcpkg_install_meson` support -# `x64-linux` and `x64-osx` now, it still failed on these targets. -# See: https://github.com/microsoft/vcpkg/pull/6780 -munit:x64-linux=fail -munit:x64-osx=fail muparser:arm-uwp=fail muparser:x64-uwp=fail murmurhash:arm-uwp=fail @@ -1146,6 +1120,7 @@ networkdirect-sdk:x64-linux=fail networkdirect-sdk:x64-osx=fail networkdirect-sdk:x64-uwp=fail networkdirect-sdk:x86-windows=fail +ngspice:x64-windows-static=fail nmslib:arm64-windows=fail nmslib:arm-uwp=fail nmslib:x64-uwp=fail @@ -1195,6 +1170,17 @@ ogre-next:x86-windows = skip ois:arm64-windows=fail ois:arm-uwp=fail ois:x64-uwp=fail +# ompl is vulnerable to some form of race in its dependent ports, and adding 'ode' as a dependency +# does not resolve the issue +# src/ompl/CMakeFiles/ompl.dir/extensions/ode/src/OpenDEStateValidityChecker.cpp.o +# -L/mnt/vcpkg-ci/packages/flann_x64-linux/debug/lib -L/mnt/vcpkg-ci/packages/ode_x64-linux/debug/lib +# -Wl,-rpath,/mnt/vcpkg-ci/packages/flann_x64-linux/debug/lib:/mnt/vcpkg-ci/packages/ode_x64-linux/debug/lib:::::::::::::::::::::::::::::::::::::::::::::::: +# -lode /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_serialization.a +# /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_filesystem.a +# /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_system.a -lpthread && : +# /usr/bin/ld: cannot find -lode +ompl:x64-osx=fail +ompl:x64-linux=fail open62541:arm-uwp=fail open62541:x64-uwp=fail openal-soft:arm-uwp=fail @@ -1237,10 +1223,6 @@ openexr:arm-uwp=fail openexr:x64-uwp=fail opengl:arm64-windows=fail opengl:arm-uwp=fail -openmama:x64-windows=fail -openmama:x86-windows=fail -openmama:x64-linux=fail -openmama:x64-osx=fail openmesh:arm64-windows=fail openmesh:arm-uwp=fail openmesh:x64-uwp=fail @@ -1250,7 +1232,6 @@ openmpi:x64-uwp=fail openmpi:x64-windows=fail openmpi:x64-windows-static=fail openmpi:x86-windows=fail -openmvs:x64-linux=fail openni2:x64-uwp=fail openni2:x64-windows-static=fail openscap:x64-linux=fail @@ -1304,10 +1285,6 @@ osgearth:x64-windows-static=fail osg-qt:x64-windows-static=fail paho-mqtt:arm-uwp=fail paho-mqtt:x64-uwp=fail -pangolin:x64-linux=fail -pangolin:x64-osx=fail -pangolin:x64-uwp=fail -pangolin:x64-windows-static=fail pangomm:x64-osx=fail pangomm:arm64-windows=fail parmetis:x64-linux=fail @@ -1365,11 +1342,6 @@ pmdk:x64-windows-static=fail pmdk:x86-windows=fail pngwriter:arm-uwp=fail pngwriter:x64-uwp=fail -polyhook2:arm64-windows=fail -polyhook2:arm-uwp=fail -polyhook2:x64-linux=fail -polyhook2:x64-uwp=fail -polyhook2:x64-osx=fail portable-snippets:arm-uwp=fail # Portaudio was broken by Ninja 1.9.0 https://github.com/ninja-build/ninja/pull/1406 portaudio:arm-uwp=fail @@ -1378,10 +1350,6 @@ portaudio:x64-uwp=fail portaudio:x64-windows-static=fail portaudio:x64-windows=fail portaudio:x86-windows=fail -portmidi:arm-uwp=fail -portmidi:x64-linux=fail -portmidi:x64-osx=fail -portmidi:x64-uwp=fail pqp:arm-uwp=fail pqp:x64-uwp=fail proj4:arm64-windows=fail @@ -1421,7 +1389,7 @@ qpid-proton:x64-uwp=fail qpid-proton:x64-windows-static=fail qt5-activeqt:x64-linux=fail qt5-activeqt:x64-osx=fail -# Skip deprecated Qt module +# Skip deprecated Qt module # (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) qt5-canvas3d:x64-linux=skip qt5-canvas3d:x64-osx=skip @@ -1446,6 +1414,7 @@ qt5-webengine:x64-osx=fail # Fail due to outdated protoc headers. # D:\buildtrees\qt5-webengine\x64-windows-dbg\src\core\debug\gen\net/third_party/quiche/src/quic/core/proto/cached_network_parameters.pb.h(17): # fatal error C1189: #error: This file was generated by an older version of protoc which is +# Succesful built requires protobuf to be installed after qt5-webengine not before. Otherwise the build picks up the wrong headers from inside vcpkg. qt5-webengine:x64-windows=skip qt5-webengine:x86-windows=skip # Static builds of qt5-webengine are not supported by the port itself @@ -1456,18 +1425,12 @@ qt5-x11extras:x64-osx=fail qt5-x11extras:x86-windows=fail qt5-x11extras:x64-windows=fail qt5-x11extras:x64-windows-static=fail -# Broken by VS2019 16.6 and throws a ton of dialogs attempting to build -# fixed by https://github.com/microsoft/vcpkg/pull/11596 -qt5-translations:x64-windows-static=skip quickfix:arm-uwp=fail quickfix:arm64-windows=fail quickfix:x64-uwp=fail quickfix:x64-windows-static=fail quickfix:x64-windows=fail quickfix:x86-windows=fail -quill:arm64-windows=fail -quill:arm-uwp=fail -quill:x64-uwp=fail quirc:arm64-windows = skip quirc:arm-uwp = skip quirc:x64-linux = skip @@ -1504,11 +1467,8 @@ readline-win32:arm-uwp=fail readline-win32:x64-linux=fail readline-win32:x64-osx=fail readline-win32:x64-uwp=fail -readosm:x64-linux=fail -readosm:x64-osx=fail realsense2:arm64-windows=fail realsense2:arm-uwp=fail -realsense2:x64-linux=fail realsense2:x64-uwp=fail redis-plus-plus:x86-windows=fail redis-plus-plus:x64-windows=fail @@ -1520,6 +1480,15 @@ reproc:arm-uwp=fail reproc:x64-uwp=fail restbed:arm-uwp=fail restbed:x64-uwp=fail +# file conflicts with msgpack +rest-rpc:x86-windows=skip +rest-rpc:x64-windows=skip +rest-rpc:x64-windows-static=skip +rest-rpc:x64-uwp=skip +rest-rpc:arm-uwp=skip +rest-rpc:arm64-windows=skip +rest-rpc:x64-linux=skip +rest-rpc:x64-osx=skip rhash:arm64-windows=fail rhash:arm-uwp=fail rhash:x64-uwp=fail @@ -1528,6 +1497,8 @@ rocksdb:x64-uwp=fail rpclib:arm64-windows=fail rpclib:arm-uwp=fail rpclib:x64-uwp=fail +rsocket:x64-windows=fail +rsocket:x64-windows-static=fail rtlsdr:x64-uwp=fail rtlsdr:arm64-windows=fail rtlsdr:arm-uwp=fail @@ -1579,8 +1550,6 @@ sdl2-net:x64-uwp=fail # https://github.com/microsoft/vcpkg/issues/10918 seal:arm-uwp=fail seal:x64-uwp=fail -secp256k1:x64-linux=fail -secp256k1:x64-osx=fail sentencepiece:arm64-windows=fail sentencepiece:arm-uwp=fail sentencepiece:x64-uwp=fail @@ -1622,11 +1591,17 @@ sockpp:arm-uwp=fail sockpp:x64-uwp=fail soem:x64-uwp=fail soem:arm-uwp=fail -soil:arm-uwp=fail -soil:x64-uwp=fail +# soil upstream is gone; if we do not have another source before 2021-03-01 we will remove the port +soil:arm-uwp=skip +soil:x64-uwp=skip +soil:arm64-windows=skip +soil:x64-windows=skip +soil:x86-windows=skip +soil:x64-windows-static=skip +soil:x64-linux=skip +soil:x64-osx=skip soil2:arm-uwp=fail soil2:x64-uwp=fail -sophus:x64-linux=fail soqt:arm64-windows=fail soqt:arm-uwp=fail soqt:x64-uwp=fail @@ -1658,8 +1633,6 @@ spdk-isal:x64-uwp=fail spdk-isal:x64-windows=fail spdk-isal:x64-windows-static=fail spdk-isal:x86-windows=fail -speex:x64-linux=fail -speex:x64-osx=fail speexdsp:x64-linux=fail speexdsp:x64-osx=fail spirv-tools:arm-uwp=fail @@ -1672,26 +1645,6 @@ stxxl:x64-uwp=fail sundials:arm64-windows=fail sundials:x64-windows=fail sundials:x86-windows=fail -# Conflicts between ports: -#The following files are already installed in C:/agent/_work/1/s/installed/x64-windows-static -# and are in conflict with superlu:x64-windows-static -# -#Installed by hypre:x64-windows-static -# include/slu_Cnames.h -# include/slu_cdefs.h -# include/slu_dcomplex.h -# include/slu_ddefs.h -# include/slu_scomplex.h -# include/slu_sdefs.h -# include/slu_util.h -# include/slu_zdefs.h -# include/supermatrix.h -superlu:arm-uwp=skip -superlu:arm-windows=skip -superlu:arm64-windows=skip -superlu:x64-uwp=skip -superlu:x64-windows-static=skip -superlu:x64-windows=skip systemc:arm64-windows=fail systemc:arm-uwp=fail systemc:x64-uwp=fail @@ -1701,7 +1654,6 @@ tbb:x64-uwp=fail tcl:arm-uwp=fail tcl:arm64-windows=fail tcl:x64-uwp=fail -tcl:x64-linux=fail tcl:x64-osx=fail teemo:x64-uwp=fail teemo:arm-uwp=fail @@ -1768,6 +1720,7 @@ torch-th:x64-uwp=fail torch-th:x64-windows-static=fail tre:x64-osx=fail treehopper:x64-windows-static=fail +treehopper:x64-linux=fail turbobase64:arm64-windows=fail turbobase64:arm-uwp=fail turbobase64:x64-uwp=fail @@ -1807,6 +1760,10 @@ uvatlas:arm-uwp=fail uvatlas:x64-linux=fail uvatlas:x64-osx=fail uvatlas:x64-windows-static=fail +v8:arm64-windows=fail +v8:arm-uwp=fail +v8:x64-osx=fail +v8:x64-uwp=fail vectorclass:arm64-windows=fail vectorclass:arm-uwp=fail vlpp:x64-osx=fail @@ -1829,9 +1786,6 @@ vxl:x64-windows = skip vxl:x64-windows-static = skip vxl:x86-windows = skip wampcc:arm64-windows=fail -wavpack:arm64-windows=fail -wavpack:x64-linux=fail -wavpack:x64-osx=fail wepoll:arm-uwp=fail wepoll:x64-uwp=fail wepoll:x64-linux=fail @@ -1934,4 +1888,14 @@ ctp:x64-windows=skip ctp:x64-windows-static=skip ctp:x86-windows=skip protozero:arm-uwp=fail -protozero:x64-uwp=fail \ No newline at end of file +protozero:x64-uwp=fail + +# clapack is replaced by lapack-reference on the platforms lapack-reference supports +clapack:x64-linux=skip +clapack:x64-osx=skip +clapack:x64-windows-static=skip +clapack:x64-windows=skip +clapack:x86-windows=skip +clapack:x64-uwp=skip +lapack-reference:arm64-windows=skip +lapack-reference:arm-uwp=skip diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 1b045985906da7..65e4a01e43cd14 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -4,7 +4,11 @@ ## ## ## Usage ## ```cmake -## vcpkg_acquire_msys( [PACKAGES ...]) +## vcpkg_acquire_msys( +## PACKAGES ... +## [NO_DEFAULT_PACKAGES] +## [DIRECT_PACKAGES ...] +## ) ## ``` ## ## ## Parameters @@ -14,7 +18,22 @@ ## ### PACKAGES ## A list of packages to acquire in msys. ## -## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)` +## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.16)` +## +## ### NO_DEFAULT_PACKAGES +## Exclude the normal base packages. +## +## The list of base packages includes: bash, coreutils, sed, grep, gawk, diffutils, make, and pkg-config +## +## ### DIRECT_PACKAGES +## A list of URL/SHA512 pairs to acquire in msys. +## +## This parameter can be used by a port to privately extend the list of msys packages to be acquired. +## The URLs can be found on the msys2 website[1] and should be a direct archive link: +## +## https://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-9-any.pkg.tar.zst +## +## [1] https://packages.msys2.org/search ## ## ## Notes ## A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: @@ -36,104 +55,262 @@ ## * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) - set(TOOLPATH ${DOWNLOADS}/tools/msys2) - cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) + cmake_parse_arguments(_am "NO_DEFAULT_PACKAGES" "" "PACKAGES;DIRECT_PACKAGES" ${ARGN}) - if(NOT CMAKE_HOST_WIN32) - message(FATAL_ERROR "vcpkg_acquire_msys() can only be used on Windows hosts") - endif() + set(TOTAL_HASH 0) + set(ARCHIVES) - # detect host architecture - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(_vam_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(_vam_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE}) - endif() + set(PACKAGES ${_am_PACKAGES}) - if(_vam_HOST_ARCHITECTURE STREQUAL "AMD64") - set(TOOLSUBPATH msys64) - set(URLS - "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20190524.tar.xz/download" - "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz" - ) - set(ARCHIVE "msys2-base-x86_64-20190524.tar.xz") - set(HASH 50796072d01d30cc4a02df0f9dafb70e2584462e1341ef0eff94e2542d3f5173f20f81e8f743e9641b7528ea1492edff20ce83cb40c6e292904905abe2a91ccc) - set(STAMP "initialized-msys2_64.stamp") - else() - set(TOOLSUBPATH msys32) - set(URLS - "https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20190524.tar.xz/download" - "http://repo.msys2.org/distrib/i686/msys2-base-i686-20190524.tar.xz" - ) - set(ARCHIVE "msys2-base-i686-20190524.tar.xz") - set(HASH b26d7d432e1eabe2138c4caac5f0a62670f9dab833b9e91ca94b9e13d29a763323b0d30160f09a381ac442b473482dac799be0fea5dd7b28ea2ddd3ba3cd3c25) - set(STAMP "initialized-msys2_32.stamp") + if(NOT _am_NO_DEFAULT_PACKAGES) + list(APPEND PACKAGES bash coreutils sed grep gawk diffutils make pkg-config) endif() - set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH}) - - if(NOT EXISTS "${TOOLPATH}/${STAMP}") + macro(msys_package) + cmake_parse_arguments(p "ZST;ANY" "URL;NAME;SHA512;VERSION;REPO" "DEPS" ${ARGN}) + if(p_URL AND NOT p_NAME) + if(NOT p_URL MATCHES "^https://repo\\.msys2\\.org/.*/(([^-]+(-[^0-9][^-]*)*)-.+\\.pkg\\.tar\\.(xz|zst))\$") + message(FATAL_ERROR "Regex does not match supplied URL to vcpkg_acquire_msys: ${p_URL}") + endif() + set(FILENAME "${CMAKE_MATCH_1}") + set(p_NAME "${CMAKE_MATCH_2}") + else() + if(p_ZST) + set(EXT zst) + else() + set(EXT xz) + endif() + if(p_ANY) + set(ARCH any) + else() + set(ARCH x86_64) + endif() + if(NOT p_REPO) + set(p_REPO msys/x86_64) + endif() + set(FILENAME "${p_NAME}-${p_VERSION}-${ARCH}.pkg.tar.${EXT}") + set(p_URL "https://repo.msys2.org/${p_REPO}/${FILENAME}") + endif() + if("${p_NAME}" IN_LIST PACKAGES) + list(REMOVE_ITEM PACKAGES "${p_NAME}") + list(APPEND PACKAGES ${p_DEPS}) + vcpkg_download_distfile(MSYS_ARCHIVE + URLS "${p_URL}" + SHA512 "${p_SHA512}" + FILENAME "msys-${FILENAME}" + QUIET + ) + string(APPEND TOTAL_HASH "${p_SHA512}") + list(APPEND ARCHIVES "${MSYS_ARCHIVE}") + endif() + endmacro() - message(STATUS "Acquiring MSYS2...") - vcpkg_download_distfile(ARCHIVE_PATH - URLS ${URLS} - FILENAME ${ARCHIVE} - SHA512 ${HASH} - ) - - file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) - file(MAKE_DIRECTORY ${TOOLPATH}) - _execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} - WORKING_DIRECTORY ${TOOLPATH} - ) - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" - WORKING_DIRECTORY ${TOOLPATH} - ) - # we have to kill all GnuPG daemons otherwise bash would potentially not be - # able to start after the core system upgrade, additionally vcpkg would - # likely hang waiting for spawned processes to exit - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;gpgconf --homedir /etc/pacman.d/gnupg --kill all" - WORKING_DIRECTORY ${TOOLPATH} - ) - # we need to update pacman before anything else due to pacman transitioning - # to using zstd packages, and our pacman is too old to support those - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Sy pacman --noconfirm" - WORKING_DIRECTORY ${TOOLPATH} - ) - # dash relies on specific versions of the base packages, which prevents us - # from doing a proper update. However, we don't need it so we remove it - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Rc dash --noconfirm" - WORKING_DIRECTORY ${TOOLPATH} - ) - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" - WORKING_DIRECTORY ${TOOLPATH} - ) - file(WRITE "${TOOLPATH}/${STAMP}" "0") - message(STATUS "Acquiring MSYS2... OK") + unset(N) + foreach(P IN LISTS _am_DIRECT_PACKAGES) + if(NOT DEFINED N) + set(N "${P}") + else() + get_filename_component(FILENAME "${N}" NAME) + vcpkg_download_distfile(MSYS_ARCHIVE + URLS "${N}" + SHA512 "${P}" + FILENAME "msys-${FILENAME}" + QUIET + ) + string(APPEND TOTAL_HASH "${P}") + list(APPEND ARCHIVES "${MSYS_ARCHIVE}") + unset(N) + endif() + endforeach() + if(DEFINED N) + message(FATAL_ERROR "vcpkg_acquire_msys(... DIRECT_PACKAGES ...) requires exactly pairs of URL/SHA512") endif() - if(_am_PACKAGES) - message(STATUS "Acquiring MSYS Packages...") - string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}") - - set(_ENV_ORIGINAL $ENV{PATH}) - set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) - vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -S --noconfirm --needed ${_am_PACKAGES}" - WORKING_DIRECTORY ${TOOLPATH} - LOGNAME msys-pacman-${TARGET_TRIPLET} - ) - set(ENV{PATH} "${_ENV_ORIGINAL}") + # To add new entries, use https://packages.msys2.org/package/$PACKAGE?repo=msys + msys_package( + URL "https://repo.msys2.org/msys/x86_64/unzip-6.0-2-x86_64.pkg.tar.xz" + SHA512 b8a1e0ce6deff26939cb46267f80ada0a623b7d782e80873cea3d388b4dc3a1053b14d7565b31f70bc904bf66f66ab58ccc1cd6bfa677065de1f279dd331afb9 + DEPS libbz2 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libbz2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 d128bd1792d0f5750e6a63a24db86a791e7ee457db8c0bef68d217099be4a6eef27c85caf6ad09b0bcd5b3cdac6fc0a2b9842cc58d381a4035505906cc4803ec + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/patch-2.7.6-1-x86_64.pkg.tar.xz" + SHA512 04d06b9d5479f129f56e8290e0afe25217ffa457ec7bed3e576df08d4a85effd80d6e0ad82bd7541043100799b608a64da3c8f535f8ea173d326da6194902e8c + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gzip-1.10-1-x86_64.pkg.tar.xz" + SHA512 2d0a60f2c384e3b9e2bed2212867c85333545e51ee0f583a33914e488e43c265ed0017cd4430a6e3dafdca99c0414b3756a4b9cc92a6f04d5566eff8b68def75 + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/bash-4.4.023-2-x86_64.pkg.tar.xz" + SHA512 1cf2a07022113010e00e150e7004732013a793d49e7a6ac7c2be27a0b2c0ce3366150584b9974e30df042f8876a84d6a77c1a46f0607e38ebe18f8a25f51c32d + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz" + SHA512 66b9c97bd3d1dfe2a2ab576235b6b8c204a9e4c099ba14cf5d0139e564bba1e735e3b1083354b4cac8c6c42233cbdd5e1e277e32cadfe24017b94d2fbdeb5617 + DEPS m4 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz" + SHA512 0c39837a26b2111bb6310cdfe0bc14656e3d57456ad8023f59c9386634a8f1f236915c79a57348b64c508897c73ed88d8abce2b9ac512a427e9a3956939f2040 + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/binutils-2.34-4-x86_64.pkg.tar.zst" + SHA512 5271288d11489879082bc1f2298bb8bedbcfcf6ee19f8a9b3b552b6a4395543d9385bb833e3c32b1560bff1b411d2be503e2c12a7201bf37b85cfacc5f5baba3 + DEPS libiconv libintl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz" + SHA512 b309799e5a9d248ef66eaf11a0bd21bf4e8b9bd5c677c627ec83fa760ce9f0b54ddf1b62cbb436e641fbbde71e3b61cb71ff541d866f8ca7717a3a0dbeb00ebf + DEPS grep sed coreutils + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/coreutils-8.32-1-x86_64.pkg.tar.xz" + SHA512 1a2ae4f296954421ce36f764b9b1c77ca72fc8583c46060b817677d0ad6adc7d7e3c2bbe1ae0179afd116a3d62f28e59eae2f7c84c1c8ffb7d22d2f2b40c0cdc + DEPS libiconv libintl gmp + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/grep-3.0-2-x86_64.pkg.tar.xz" + SHA512 c784d5f8a929ae251f2ffaccf7ab0b3936ae9f012041e8f074826dd6077ad0a859abba19feade1e71b3289cc640626dfe827afe91c272b38a1808f228f2fdd00 + DEPS libiconv libintl libpcre + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/sed-4.8-1-x86_64.pkg.tar.xz" + SHA512 b6e7ed0af9e04aba4992ee26d8616f7ac675c8137bb28558c049d50709afb571b33695ce21d01e5b7fe8e188c008dd2e8cbafc72a7e2a919c2d678506095132b + DEPS libintl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libpcre-8.44-1-x86_64.pkg.tar.xz" + SHA512 e9e56386fc5cca0f3c36cee21eda91300d9a13a962ec2f52eeea00f131915daea1cfeb0e1b30704bf3cc4357d941d356e0d72192bab3006c2548e18cd96dad77 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz" + SHA512 061e9243c1e013aa093546e3872984ad47b7fc9d64d4c39dcce62e750ed632645df00be3fe382a2f55f3bf623dd0d649e2092be23e8f22f921f582e41893e36a + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz" + SHA512 0fcfc80c31fd0bda5a46c55e9100a86d2fc788a92c7e2ca4fd281e551375c62eb5b9cc9ad9338bb44a815bf0b1d1b60b882c8e68ca3ea529b442f2d03d1d3e1f + DEPS gawk + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gawk-5.1.0-1-x86_64.pkg.tar.xz" + SHA512 4e2be747b184f27945df6fb37d52d56fd8117d2fe4b289370bcdb5b15a4cf90cbeaea98cf9e64bcbfa2c13db50d8bd14cbd719c5f31b420842da903006dbc959 + DEPS libintl libreadline mpfr + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/mpfr-4.1.0-1-x86_64.pkg.tar.zst" + SHA512 d64fa60e188124591d41fc097d7eb51d7ea4940bac05cdcf5eafde951ed1eaa174468f5ede03e61106e1633e3428964b34c96de76321ed8853b398fbe8c4d072 + DEPS gmp gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gmp-6.2.0-1-x86_64.pkg.tar.xz" + SHA512 1389a443e775bb255d905665dd577bef7ed71d51a8c24d118097f8119c08c4dfe67505e88ddd1e9a3764dd1d50ed8b84fa34abefa797d257e90586f0cbf54de8 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libreadline-8.0.004-1-x86_64.pkg.tar.xz" + SHA512 42760bddedccc8d93507c1e3a7a81595dc6392b5e4319d24a85275eb04c30eb79078e4247eb2cdd00ff3884d932639130c89bf1b559310a17fa4858062491f97 + DEPS ncurses + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/ncurses-6.2-1-x86_64.pkg.tar.xz" + SHA512 d4dc566d3dbd32e7646e328cb350689ede7eaa7008c8ed971072f8869a2986fe3935e7df1700851b52716af7ef20c49f9e6628d3163a5e9208a8872b5014eaea + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake1.16-1.16.2-1-any.pkg.tar.zst" + SHA512 568d1250a31a53452e029d1c236da66d67fffa786a8713128027d33a6a9408cda6e493e9c1555a816efee6245b05a1ef8f9ce3482c39de71356c2e983d926bf7 + DEPS perl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-1-any.pkg.tar.xz" + SHA512 d5bb245ab1bb6b57c40ef97755bfb0919dcceb0eccc33e848809922bf6b032f9e4eb36d89aedf41542051277d92238bd48a74115867db0bbc1e1db1c975cc72c + DEPS perl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/perl-5.32.0-1-x86_64.pkg.tar.zst" + SHA512 8acc6c4901bd2e24faf1951084d70029847f05e870826e07b8d9a5d90144f4aa0ab6e568e77c28c36650f016ee75ce78b0356c75673b212c992401f7f1543dd8 + DEPS libcrypt + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libcrypt-2.1-2-x86_64.pkg.tar.xz" + SHA512 59a13f79f560934f880d68209a58a3c39ee4a1d24500035bde90d7a6f6ab0d4f72fe14edea6f19a8eb54d4d53b0b6ad4589b388f1521a07ab24a0f8307619cab + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/pkg-config-0.29.2-1-x86_64.pkg.tar.xz" + SHA512 f1d70f0b4ebcfeb3fa2156a7a4f7b0b404795853e05361de14054dc6658a6154915bb982626cbfe76bef0828325f993f30da6817361ca8d7ea440a40023fa864 + DEPS libiconv + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz" + SHA512 7306dec7859edc27d70a24ab4b396728481484a426c5aa2f7e9fed2635b3b25548b05b7d37a161a86a8edaa5922948bee8c99b1e8a078606e69ca48a433fe321 + DEPS libintl msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gettext-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 c8c42d084c297746548963f7ec7a7df46241886f3e637e779811ee4a8fee6058f892082bb2658f6777cbffba2de4bcdfd68e846ba63c6a6552c9efb0c8c1de50 + DEPS libintl libgettextpo libasprintf + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libgettextpo-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 480b782a79b0ce71ed9939ae3a6821fc2f5a63358733965c62cee027d0e6c88e255df1d62379ee47f5a7f8ffe163e554e318dba22c67dc67469b10aa3248edf7 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libasprintf-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 a2e8027b9bbee20f8cf60851130ca2af436641b1fb66054f8deba118da7ebecb1cd188224dcf08e4c5b7cde85b412efab058afef2358e843c9de8eb128ca448c + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libintl-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 4e54c252b828c862f376d8f5a2410ee623a43d70cbb07d0b8ac20c25096f59fb3ae8dcd011d1792bec76f0b0b9411d0e184ee23707995761dc50eb76f9fc6b92 + DEPS libiconv + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz" + SHA512 6f9b778d449410273a50cdd1af737cdcb8890a5536d78211477eed7382340253c7aadfb04977f1038ae4f4cef5a641f1acfda26fd06323d0b196a3e6da7fd425 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gcc-libs-9.3.0-1-x86_64.pkg.tar.xz" + SHA512 2816afbf45aa0ff47f94a623ad083d9421bca5284dc55683c2f1bc09ea0eadfe720afb75aafef60c2ff6384d051c4fbe2a744bb16a20acf34c04dc59b17c3d8c + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/msys2-runtime-3.1.6-3-x86_64.pkg.tar.xz" + SHA512 f094a7f4926195ef7ba015f0c5c56587b1faa94d85530f07aaaa5557a1494c3bd75257d4687c8401cbf1328d23e5586a92b05f0a872caebb1a7e941a07829776 + ) - message(STATUS "Acquiring MSYS Packages... OK") + if(PACKAGES) + message(FATAL_ERROR "Unknown packages were required for vcpkg_acquire_msys(${_am_PACKAGES}): ${PACKAGES}\nThis can be resolved by explicitly passing URL/SHA pairs to DIRECT_PACKAGES.") endif() + string(SHA512 TOTAL_HASH "${TOTAL_HASH}") + string(SUBSTRING "${TOTAL_HASH}" 0 16 TOTAL_HASH) + set(PATH_TO_ROOT ${DOWNLOADS}/tools/msys2/${TOTAL_HASH}) + if(NOT EXISTS "${PATH_TO_ROOT}") + file(REMOVE_RECURSE ${PATH_TO_ROOT}.tmp) + file(MAKE_DIRECTORY ${PATH_TO_ROOT}.tmp/tmp) + set(I 0) + foreach(ARCHIVE IN LISTS ARCHIVES) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE} + LOGNAME msys-${TARGET_TRIPLET}-${I} + WORKING_DIRECTORY ${PATH_TO_ROOT}.tmp + ) + math(EXPR I "${I} + 1") + endforeach() + file(RENAME ${PATH_TO_ROOT}.tmp ${PATH_TO_ROOT}) + endif() + message(STATUS "Using msys root at ${DOWNLOADS}/tools/msys2/${TOTAL_HASH}") set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 17a755890f6360..c957fc62870e5a 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -24,6 +24,9 @@ ## The target passed to the make build command (`./make `). If not specified, the 'all' target will ## be passed. ## +## ### DISABLE_PARALLEL +## The underlying buildsystem will be instructed to not parallelize +## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_make()`](vcpkg_configure_make.md). ## You can use the alias [`vcpkg_install_make()`](vcpkg_configure_make.md) function if your CMake script supports the @@ -36,7 +39,7 @@ ## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) function(vcpkg_build_make) - cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN}) + cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN}) if(NOT _bc_LOGFILE_ROOT) set(_bc_LOGFILE_ROOT "build") @@ -59,19 +62,12 @@ function(vcpkg_build_make) set(INSTALL_OPTS ) if (CMAKE_HOST_WIN32) set(PATH_GLOBAL "$ENV{PATH}") - # These should be moved into the portfile! - # vcpkg_find_acquire_program(YASM) - # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - # vcpkg_add_to_path("${YASM_EXE_PATH}") - # vcpkg_find_acquire_program(PERL) - # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - # vcpkg_add_to_path("${PERL_EXE_PATH}") - vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") vcpkg_acquire_msys(MSYS_ROOT) - find_program(MAKE make REQUIRED) #mingw32-make + find_program(MAKE make REQUIRED) set(MAKE_COMMAND "${MAKE}") set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f Makefile ${_bc_BUILD_TARGET}) + set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} -j 1 --trace -f Makefile ${_bc_BUILD_TARGET}) string(REPLACE " " "\\\ " _VCPKG_PACKAGE_PREFIX ${CURRENT_PACKAGES_DIR}) string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}") @@ -79,49 +75,16 @@ function(vcpkg_build_make) #TODO: optimize for install-data (release) and install-exec (release/debug) else() # Compiler requriements - # set(MAKE_BASH) find_program(MAKE make REQUIRED) set(MAKE_COMMAND "${MAKE}") # Set make command and install command set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f Makefile ${_bc_BUILD_TARGET}) + set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j 1 -f Makefile ${_bc_BUILD_TARGET}) set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR}) endif() - # Backup enviromnent variables - set(C_FLAGS_BACKUP "$ENV{CFLAGS}") - set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") - set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") - set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") - set(INCLUDE_BACKUP "$ENV{INCLUDE}") - set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") - set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") - _vcpkg_backup_env_variable(LD_LIBRARY_PATH) - _vcpkg_backup_env_variable(LIBRARY_PATH) - set(LIBPATH_BACKUP "$ENV{LIBPATH}") - - # Setup include enviromnent - set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") - - # Setup global flags - set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") - set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") - set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") - if(NOT VCPKG_TARGET_IS_WINDOWS) - string(APPEND C_FLAGS_GLOBAL " -fPIC") - string(APPEND CXX_FLAGS_GLOBAL " -fPIC") - else() - string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - string(APPEND LD_FLAGS_GLOBAL " /machine:x64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - string(APPEND LD_FLAGS_GLOBAL " /machine:x86") - endif() - endif() + # Since includes are buildtype independent those are setup by vcpkg_configure_make + _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) @@ -132,6 +95,7 @@ function(vcpkg_build_make) endif() set(SHORT_BUILDTYPE "-dbg") set(CMAKE_BUILDTYPE "DEBUG") + set(PATH_SUFFIX "/debug") else() # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory. if (_VCPKG_NO_DEBUG) @@ -140,68 +104,44 @@ function(vcpkg_build_make) set(SHORT_BUILDTYPE "-rel") endif() set(CMAKE_BUILDTYPE "RELEASE") + set(PATH_SUFFIX "") endif() set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}") message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") + set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") + set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") + #set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") - if(BUILDTYPE STREQUAL "debug") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") - else() - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") - endif() - endif() - - if (CMAKE_HOST_WIN32) - set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_CFLAGS "${TMP_CFLAGS}") - set(ENV{CFLAGS} ${TMP_CFLAGS}) - - set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_CXXFLAGS "${TMP_CXXFLAGS}") - set(ENV{CXXFLAGS} ${TMP_CXXFLAGS}) - - set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_LDFLAGS "${TMP_LDFLAGS}") - set(ENV{LDFLAGS} ${TMP_LDFLAGS}) - - string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - if(BUILDTYPE STREQUAL "debug") - set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}/debug) - else() - set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}) - endif() - - else() - set(ENV{CFLAGS} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") - - if(BUILDTYPE STREQUAL "debug") - set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/debug/lib/ -L${_VCPKG_INSTALLED}/debug/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") - set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - else() - set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/lib/ -L${_VCPKG_INSTALLED}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") - set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - endif() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX}/bin") endif() if(MAKE_BASH) set(MAKE_CMD_LINE "${MAKE_COMMAND} ${MAKE_OPTS}") + set(NO_PARALLEL_MAKE_CMD_LINE "${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS}") else() set(MAKE_CMD_LINE ${MAKE_COMMAND} ${MAKE_OPTS}) + set(NO_PARALLEL_MAKE_CMD_LINE ${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS}) endif() + if (_bc_DISABLE_PARALLEL) + vcpkg_execute_build_process( + COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE} + WORKING_DIRECTORY "${WORKING_DIRECTORY}" + LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" + ) + else() vcpkg_execute_build_process( COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE} + NO_PARALLEL_COMMAND ${MAKE_BASH} ${NO_PARALLEL_MAKE_CMD_LINE} WORKING_DIRECTORY "${WORKING_DIRECTORY}" LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" - ) + ) + endif() if(_bc_ADD_BIN_TO_PATH) set(ENV{PATH} "${_BACKUP_ENV_PATH}") @@ -251,21 +191,9 @@ function(vcpkg_build_make) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") endif() - # Restore enviromnent - set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") - set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") - - set(ENV{INCLUDE} "${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") - _vcpkg_restore_env_variable(LIBRARY_PATH) - _vcpkg_restore_env_variable(LD_LIBRARY_PATH) - if (CMAKE_HOST_WIN32) set(ENV{PATH} "${PATH_GLOBAL}") endif() - + _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 6f3c871de561dc..deecf4f061a2ee 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -28,8 +28,9 @@ function(vcpkg_build_qmake) function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") - vcpkg_execute_required_process( + vcpkg_execute_build_process( COMMAND ${INVOKE} -j ${VCPKG_CONCURRENCY} ${TARGETS} + NO_PARALLEL_COMMAND ${INVOKE} -j 1 ${TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} ) diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index ee6f3484991fb1..8d36803eec2b8a 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -32,6 +32,8 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor endif() elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(VCPKG_TARGET_IS_OSX 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(VCPKG_TARGET_IS_IOS 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") set(VCPKG_TARGET_IS_LINUX 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -122,12 +124,61 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX) endif() # Platforms with libm -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OSX) list(APPEND VCPKG_SYSTEM_LIBRARIES m) endif() +# Platforms with pthread +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES pthread) +endif() + +# Platforms with libstdc++ +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES [=[stdc\+\+]=]) +endif() + +# Platforms with libc++ +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES [=[c\+\+]=]) +endif() + +# Platforms with librt +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES rt) +endif() + +# Platforms with GCC libs +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc_s) +endif() + +# Platforms with system iconv +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES iconv) +endif() + # Windows system libs if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND VCPKG_SYSTEM_LIBRARIES advapi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES bcrypt) + list(APPEND VCPKG_SYSTEM_LIBRARIES dinput8) + list(APPEND VCPKG_SYSTEM_LIBRARIES gdi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES imm32) + list(APPEND VCPKG_SYSTEM_LIBRARIES oleaut32) + list(APPEND VCPKG_SYSTEM_LIBRARIES ole32) + list(APPEND VCPKG_SYSTEM_LIBRARIES psapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES secur32) + list(APPEND VCPKG_SYSTEM_LIBRARIES setupapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES shell32) + list(APPEND VCPKG_SYSTEM_LIBRARIES shlwapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES strmiids) + list(APPEND VCPKG_SYSTEM_LIBRARIES user32) + list(APPEND VCPKG_SYSTEM_LIBRARIES uuid) + list(APPEND VCPKG_SYSTEM_LIBRARIES version) + list(APPEND VCPKG_SYSTEM_LIBRARIES vfw32) + list(APPEND VCPKG_SYSTEM_LIBRARIES winmm) list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) - list(APPEND VCPKG_SYSTEM_LIBRARIES ws2_32) + list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) endif() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 9f75c5e071348d..63d7f87866fa05 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -29,6 +29,8 @@ ## Disables running the CMake configure step in parallel. ## This is needed for libraries which write back into their source directory during configure. ## +## This also disables CMAKE_DISABLE_SOURCE_CHANGES. +## ## ### NO_CHARSET_FLAG ## Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. ## @@ -59,11 +61,11 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_configure_cmake) - cmake_parse_arguments(_csc + # parse parameters such that semicolons in arguments to OPTIONS don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _csc "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;NO_CHARSET_FLAG" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" - ${ARGN} ) if(NOT VCPKG_PLATFORM_TOOLSET) @@ -148,7 +150,7 @@ function(vcpkg_configure_cmake) endif() # If we use Ninja, make sure it's on PATH - if(GENERATOR STREQUAL "Ninja") + if(GENERATOR STREQUAL "Ninja" AND NOT DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) vcpkg_add_to_path("${NINJA_PATH}") @@ -233,6 +235,8 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DVCPKG_LINKER_FLAGS_RELEASE=${VCPKG_LINKER_FLAGS_RELEASE}" + "-DVCPKG_LINKER_FLAGS_DEBUG=${VCPKG_LINKER_FLAGS_DEBUG}" "-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" @@ -266,6 +270,7 @@ function(vcpkg_configure_cmake) -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) if(NINJA_HOST AND CMAKE_HOST_WIN32 AND NOT _csc_DISABLE_PARALLEL_CONFIGURE) + list(APPEND _csc_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 0e47b948b8a296..48937a7271939e 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -7,6 +7,11 @@ ## vcpkg_configure_make( ## SOURCE_PATH <${SOURCE_PATH}> ## [AUTOCONFIG] +## [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] +## [NO_ADDITIONAL_PATHS] +## [CONFIG_DEPENDENT_ENVIRONMENT ...] +## [CONFIGURE_ENVIRONMENT_VARIABLES ...] +## [ADD_BIN_TO_PATH] ## [NO_DEBUG] ## [SKIP_CONFIGURE] ## [PROJECT_SUBPATH <${PROJ_SUBPATH}>] @@ -29,12 +34,24 @@ ## ### SKIP_CONFIGURE ## Skip configure process ## +## ### BUILD_TRIPLET +## Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET +## +## ### NO_ADDITIONAL_PATHS +## Don't pass any additional paths except for --prefix to the configure call +## ## ### AUTOCONFIG ## Need to use autoconfig to generate configure file. ## ## ### PRERUN_SHELL ## Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure) ## +## ### ADD_BIN_TO_PATH +## Adds the appropriate Release and Debug `bin\` directories to the path during configure such that executables can run against the in-tree DLLs. +## +## ## DISABLE_VERBOSE_FLAGS +## do not pass '--disable-silent-rules --verbose' to configure +## ## ### OPTIONS ## Additional options passed to configure during the configuration. ## @@ -44,6 +61,14 @@ ## ### OPTIONS_DEBUG ## Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`. ## +## ### CONFIG_DEPENDENT_ENVIRONMENT +## List of additional configuration dependent environment variables to set. +## Pass SOMEVAR to set the environment and have SOMEVAR_(DEBUG|RELEASE) set in the portfile to the appropriate values +## General environment variables can be set from within the portfile itself. +## +## ### CONFIGURE_ENVIRONMENT_VARIABLES +## List of additional environment variables to pass via the configure call. +## ## ## Notes ## This command supplies many common arguments to configure. To see the full list, examine the source. ## @@ -53,154 +78,207 @@ ## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake) ## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) -macro(_vcpkg_determine_host) - # --build: the machine you are building on - # --host: the machine you are building for - # --target: the machine that GCC will produce binary for - set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) - set(MINGW_W w64) - set(MINGW_PACKAGES) - #message(STATUS "${HOST_ARCH}") +macro(_vcpkg_determine_host_mingw out_var) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() + if(HOST_ARCH MATCHES "(amd|AMD)64") + set(${out_var} mingw64) + elseif(HOST_ARCH MATCHES "(x|X)86") + set(${out_var} mingw32) + else() + message(FATAL_ERROR "Unsupported mingw architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(HOST_ARCH) +endmacro() + +macro(_vcpkg_determine_autotools_host_cpu out_var) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() if(HOST_ARCH MATCHES "(amd|AMD)64") - set(MSYS_HOST x86_64) - set(HOST_ARCH x64) - set(BITS 64) - #list(APPEND MINGW_PACKAGES mingw-w64-x86_64-cccl) + set(${out_var} x86_64) elseif(HOST_ARCH MATCHES "(x|X)86") - set(MSYS_HOST i686) - set(HOST_ARCH x86) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) + set(${out_var} i686) elseif(HOST_ARCH MATCHES "^(ARM|arm)64$") - set(MSYS_HOST arm) - set(HOST_ARCH arm) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) + set(${out_var} aarch64) elseif(HOST_ARCH MATCHES "^(ARM|arm)$") - set(MSYS_HOST arm) - set(HOST_ARCH arm) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) + set(${out_var} arm) else() - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(HOST_ARCH) +endmacro() + +macro(_vcpkg_determine_autotools_target_cpu out_var) + if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") + set(${out_var} x86_64) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") + set(${out_var} i686) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$") + set(${out_var} aarch64) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$") + set(${out_var} arm) + else() + message(FATAL_ERROR "Unsupported VCPKG_TARGET_ARCHITECTURE architecture ${VCPKG_TARGET_ARCHITECTURE} in _vcpkg_determine_autotools_target_cpu!" ) endif() - set(TARGET_ARCH ${VCPKG_TARGET_ARCHITECTURE}) endmacro() macro(_vcpkg_backup_env_variable envvar) - if(ENV{${envvar}}) + if(DEFINED ENV{${envvar}}) set(${envvar}_BACKUP "$ENV{${envvar}}") set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}") else() + set(${envvar}_BACKUP) set(${envvar}_PATHLIKE_CONCAT) endif() endmacro() +macro(_vcpkg_backup_env_variables) + foreach(_var ${ARGV}) + _vcpkg_backup_env_variable(${_var}) + endforeach() +endmacro() + macro(_vcpkg_restore_env_variable envvar) if(${envvar}_BACKUP) - set(ENV{${envvar}} ${${envvar}_BACKUP}) + set(ENV{${envvar}} "${${envvar}_BACKUP}") else() unset(ENV{${envvar}}) endif() endmacro() +macro(_vcpkg_restore_env_variables) + foreach(_var ${ARGV}) + _vcpkg_restore_env_variable(${_var}) + endforeach() +endmacro() function(vcpkg_configure_make) cmake_parse_arguments(_csc - "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE" - "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH" + "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT" ${ARGN} ) - # Backup enviromnent variables - set(C_FLAGS_BACKUP "$ENV{CFLAGS}") - set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") - set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") - set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") - set(INCLUDE_BACKUP "$ENV{INCLUDE}") - set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") - set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") - #set(LD_LIBRARY_PATH_BACKUP "$ENV{LD_LIBRARY_PATH}") - _vcpkg_backup_env_variable(LD_LIBRARY_PATH) - #set(LIBRARY_PATH_BACKUP "$ENV{LIBRARY_PATH}") - _vcpkg_backup_env_variable(LIBRARY_PATH) - set(LIBPATH_BACKUP "$ENV{LIBPATH}") - - if(${CURRENT_PACKAGES_DIR} MATCHES " " OR ${CURRENT_INSTALLED_DIR} MATCHES " ") + if(DEFINED VCPKG_MAKE_BUILD_TRIPLET) + set(_csc_BUILD_TRIPLET ${VCPKG_MAKE_BUILD_TRIPLET}) # Triplet overwrite for crosscompiling + endif() + + set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") + + set(REQUIRES_AUTOGEN FALSE) # use autogen.sh + set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac + if(EXISTS "${SRC_DIR}/configure" AND "${SRC_DIR}/configure.ac") # remove configure; rerun autoconf + if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time + set(REQUIRES_AUTOCONFIG TRUE) + file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts + set(_csc_AUTOCONFIG ON) + endif() + elseif(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) # run normally; no autoconf or autgen required + elseif(EXISTS "${SRC_DIR}/configure.ac") # Run autoconfig + set(REQUIRES_AUTOCONFIG TRUE) + set(_csc_AUTOCONFIG ON) + elseif(EXISTS "${SRC_DIR}/autogen.sh") # Run autogen + set(REQUIRES_AUTOGEN TRUE) + else() + message(FATAL_ERROR "Could not determine method to configure make") + endif() + + debug_message("REQUIRES_AUTOGEN:${REQUIRES_AUTOGEN}") + debug_message("REQUIRES_AUTOCONFIG:${REQUIRES_AUTOCONFIG}") + # Backup environment variables + # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y + set(FLAGPREFIXES CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y) + foreach(_prefix IN LISTS FLAGPREFIXES) + _vcpkg_backup_env_variable(${prefix}FLAGS) + endforeach() + + # FC fotran compiler | FF Fortran 77 compiler + # LDFLAGS -> pass -L flags + # LIBS -> pass -l flags + + #Used by gcc/linux + _vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) + + #Used by cl + _vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) + + if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ") # Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)! message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail") endif() # Pre-processing windows configure requirements if (CMAKE_HOST_WIN32) - # YASM and PERL are not strictly required by all ports. - # So this should probably be moved into the portfile - # vcpkg_find_acquire_program(YASM) - # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - # vcpkg_add_to_path("${YASM_EXE_PATH}") - - # vcpkg_find_acquire_program(PERL) - # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - # vcpkg_add_to_path("${PERL_EXE_PATH}") - - list(APPEND MSYS_REQUIRE_PACKAGES diffutils - pkg-config - binutils - libtool - gettext - gettext-devel - make) - if (_csc_AUTOCONFIG) - list(APPEND MSYS_REQUIRE_PACKAGES autoconf - autoconf-archive - automake - m4 - ) - endif() + _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= + + list(APPEND MSYS_REQUIRE_PACKAGES binutils libtool autoconf automake-wrapper automake1.16 m4) vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) - vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") + # This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe) + string(REPLACE ";$ENV{SystemRoot}\\System32;" ";${MSYS_ROOT}/usr/share/automake-1.16;${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}") + set(ENV{PATH} "${NEWPATH}") set(BASH "${MSYS_ROOT}/usr/bin/bash.exe") - # This is required because PATH contains sort and find from Windows but the MSYS versions are needed - # ${MSYS_ROOT}/urs/bin cannot be prepended to PATH due to other conflicts - file(CREATE_LINK "${MSYS_ROOT}/usr/bin/sort.exe" "${SCRIPTS}/buildsystems/make_wrapper/sort.exe" COPY_ON_ERROR) - file(CREATE_LINK "${MSYS_ROOT}/usr/bin/find.exe" "${SCRIPTS}/buildsystems/make_wrapper/find.exe" COPY_ON_ERROR) - vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there - - # --build: the machine you are building on - # --host: the machine you are building for - # --target: the machine that CC will produce binaries for - _vcpkg_determine_host() # VCPKG_HOST => machine you are building on => --build= - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=i686-pc-mingw32 --host=i686-pc-mingw32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=arm-pc-mingw32 --host=i686-pc-mingw32") + if (_csc_AUTOCONFIG) + # --build: the machine you are building on + # --host: the machine you are building for + # --target: the machine that CC will produce binaries for + # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler + # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host + if(NOT _csc_BUILD_TRIPLET) + set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-pc-mingw32") # This is required since we are running in a msys + # shell which will be otherwise identified as ${BUILD_ARCH}-pc-msys + _vcpkg_determine_autotools_target_cpu(TARGET_ARCH) + if(NOT TARGET_ARCH MATCHES "${BUILD_ARCH}") # we do not need to specify the additional flags if we build nativly. + string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-pc-mingw32") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target) + endif() + if(VCPKG_TARGET_IS_UWP AND NOT _csc_BUILD_TRIPLET MATCHES "--host") + # Needs to be different from --build to enable cross builds. + string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-unknown-mingw32") + endif() + endif() + debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}") endif() - + macro(_vcpkg_append_to_configure_environment inoutstring var defaultval) - # Allows to overwrite settings in custom triplets via the enviromnent - if(ENV{${var}}) + # Allows to overwrite settings in custom triplets via the environment + if(DEFINED ENV{${var}}) string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") else() string(APPEND ${inoutstring} " ${var}='${defaultval}'") endif() endmacro() - set(CONFIGURE_ENV "") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") + set(CONFIGURE_ENV "V=1") + if (_csc_AUTOCONFIG) # without autotools we assume a custom configure script which correctly handles cl and lib. Otherwise the port needs to set CC|CXX|AR and probably CPP + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "compile cl.exe -nologo -E") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "compile cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "compile cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "ar-lib lib.exe -verbose") + else() + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "cl.exe -nologo -E") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "lib.exe -verbose") + endif() _vcpkg_append_to_configure_environment(CONFIGURE_ENV LD "link.exe -verbose") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "${MSYS_ROOT}/usr/share/automake-1.16/ar-lib lib.exe -verbose") _vcpkg_append_to_configure_environment(CONFIGURE_ENV RANLIB ":") # Trick to ignore the RANLIB call + #_vcpkg_append_to_configure_environment(CONFIGURE_ENV OBJDUMP ":") ' Objdump is required to make shared libraries. Otherwise define lt_cv_deplibs_check_method=pass_all _vcpkg_append_to_configure_environment(CONFIGURE_ENV CCAS ":") # If required set the ENV variable CCAS in the portfile correctly - _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers -all") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV STRIP ":") # If required set the ENV variable STRIP in the portfile correctly + _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers") # Would be better to have a true nm here! Some symbols (mainly exported variables) get not properly imported with dumpbin as nm # and require __declspec(dllimport) for some reason (same problem CMake has with WINDOWS_EXPORT_ALL_SYMBOLS) _vcpkg_append_to_configure_environment(CONFIGURE_ENV DLLTOOL "link.exe -verbose -dll") - + + foreach(_env IN LISTS _csc_CONFIGURE_ENVIRONMENT_VARIABLES) + _vcpkg_append_to_configure_environment(CONFIGURE_ENV ${_env} "${${_env}}") + endforeach() # Other maybe interesting variables to control # COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line. # LINK This is the command used to actually link a C program. @@ -228,11 +306,11 @@ function(vcpkg_configure_make) "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") - set(ENV{V} "1") #Enable Verbose MODE - # Set configure paths - set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} - "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}" + set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}") + set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}") + if(NOT _csc_NO_ADDITIONAL_PATHS) + set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} # Important: These should all be relative to prefix! "--bindir=${prefix_var}/tools/${PORT}/bin" "--sbindir=${prefix_var}/tools/${PORT}/sbin" @@ -241,25 +319,25 @@ function(vcpkg_configure_make) "--mandir=${prefix_var}/share/${PORT}" "--docdir=${prefix_var}/share/${PORT}" "--datarootdir=${prefix_var}/share/${PORT}") - set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} - "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}" + set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} # Important: These should all be relative to prefix! "--bindir=${prefix_var}/../tools/${PORT}/debug/bin" "--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin" #"--libdir='\${prefix}'/lib" # already the default! "--includedir=${prefix_var}/../include" "--datarootdir=${prefix_var}/share/${PORT}") - + endif() # Setup common options + if(NOT DISABLE_VERBOSE_FLAGS) + list(APPEND _csc_OPTIONS --disable-silent-rules --verbose) + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-shared --disable-static) - if (VCPKG_TARGET_IS_UWP) - list(APPEND _csc_OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) - endif() + list(APPEND _csc_OPTIONS --enable-shared --disable-static) else() - list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-static --disable-shared) + list(APPEND _csc_OPTIONS --disable-shared --enable-static) endif() - + file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") set(base_cmd) @@ -270,79 +348,63 @@ function(vcpkg_configure_make) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") endif() include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - if(VCPKG_TARGET_IS_UWP) - # Flags should be set in the toolchain instead - set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\") - set(_csc_OPTIONS ${_csc_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) - endif() #Join the options list as a string with spaces between options list(JOIN _csc_OPTIONS " " _csc_OPTIONS) list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE) list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG) endif() - # Setup include enviromnent + # Setup include environment (since these are buildtype independent restoring them is unnecessary) + # Used by CL set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") + # Used by GCC set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") # Setup global flags -> TODO: Further improve with toolchain file in mind! + set(CPP_FLAGS_GLOBAL "$ENV{CPPFLAGS} -I${_VCPKG_INSTALLED}/include") set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") - # Flags should be set in the toolchain instead + # Flags should be set in the toolchain instead (Setting this up correctly requires a function named vcpkg_determined_cmake_compiler_flags which can also be used to setup CC and CXX etc.) if(NOT VCPKG_TARGET_IS_WINDOWS) string(APPEND C_FLAGS_GLOBAL " -fPIC") string(APPEND CXX_FLAGS_GLOBAL " -fPIC") else() - string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") + # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined + string(APPEND CPP_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + if(VCPKG_TARGET_IS_UWP) + # Be aware that configure thinks it is crosscompiling due to: + # error while loading shared libraries: VCRUNTIME140D_APP.dll: + # cannot open shared object file: No such file or directory + # IMPORTANT: The only way to pass linker flags through libtool AND the compile wrapper + # is to use the CL and LINK environment variables !!! + # (This is due to libtool and compiler wrapper using the same set of options to pass those variables around) + string(REPLACE "\\" "/" VCToolsInstallDir "$ENV{VCToolsInstallDir}") + set(ENV{_CL_} "$ENV{_CL_} /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"") + set(ENV{_LINK_} "$ENV{_LINK_} /MANIFEST /DYNAMICBASE WindowsApp.lib /WINMD:NO /APPCONTAINER") + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - string(APPEND LD_FLAGS_GLOBAL " /machine:x64") + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x64") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - string(APPEND LD_FLAGS_GLOBAL " /machine:x86") + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x86") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM64") endif() endif() - if(NOT ENV{PKG_CONFIG}) - find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) - debug_message("Using pkg-config from: ${PKGCONFIG}") - if(NOT PKGCONFIG) - message(STATUS "${PORT} requires pkg-config from the system package manager (example: \"sudo apt-get install pkg-config\")") - endif() - else() - debug_message("ENV{PKG_CONFIG} found! Using: $ENV{PKG_CONFIG}") - set(PKGCONFIG $ENV{PKG_CONFIG}) + vcpkg_find_acquire_program(PKGCONFIG) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT PKGCONFIG STREQUAL "--static") + set(PKGCONFIG "${PKGCONFIG} --static") endif() - - set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") - # Run autoconf if necessary - if(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) - set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac - set(REQUIRES_AUTOGEN FALSE) # use autogen.sh - elseif(EXISTS "${SRC_DIR}/configure.ac") - set(REQUIRES_AUTOCONFIG TRUE) - set(REQUIRES_AUTOGEN FALSE) - elseif(EXISTS "${SRC_DIR}/autogen.sh") - set(REQUIRES_AUTOGEN TRUE) - set(REQUIRES_AUTOCONFIG FALSE) - endif() set(_GENERATED_CONFIGURE FALSE) if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG) - find_program(AUTORECONF autoreconf REQUIRED) + find_program(AUTORECONF autoreconf) if(NOT AUTORECONF) - message(STATUS "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")") - endif() - find_program(LIBTOOL libtool REQUIRED) - if(NOT LIBTOOL) - message(STATUS "${PORT} requires libtool from the system package manager (example: \"sudo apt-get install libtool libtool-bin\")") - endif() - find_program(AUTOPOINT autopoint REQUIRED) - if(NOT AUTOPOINT) - message(STATUS "${PORT} requires autopoint from the system package manager (example: \"sudo apt-get install autopoint\")") + message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")") endif() message(STATUS "Generating configure for ${TARGET_TRIPLET}") if (CMAKE_HOST_WIN32) @@ -353,7 +415,7 @@ function(vcpkg_configure_make) ) else() vcpkg_execute_required_process( - COMMAND autoreconf -vfi + COMMAND ${AUTORECONF} -vfi WORKING_DIRECTORY "${SRC_DIR}" LOGNAME autoconf-${TARGET_TRIPLET} ) @@ -393,10 +455,12 @@ function(vcpkg_configure_make) set(SHORT_NAME_${_VAR_SUFFIX} "dbg") list(APPEND _buildtypes ${_VAR_SUFFIX}) if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead + string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() + set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -408,11 +472,13 @@ function(vcpkg_configure_make) set(PATH_SUFFIX_${_VAR_SUFFIX} "") set(SHORT_NAME_${_VAR_SUFFIX} "rel") list(APPEND _buildtypes ${_VAR_SUFFIX}) - if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead + if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain + string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() + set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -421,6 +487,13 @@ function(vcpkg_configure_make) endif() foreach(_buildtype IN LISTS _buildtypes) + foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) + if(DEFINED ENV{${ENV_VAR}}) + set(BACKUP_CONFIG_${ENV_VAR} "$ENV{${ENV_VAR}}") + endif() + set(ENV{${ENV_VAR}} "${${ENV_VAR}_${_buildtype}}") + endforeach() + set(TAR_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") file(MAKE_DIRECTORY "${TAR_DIR}") file(RELATIVE_PATH RELATIVE_BUILD_PATH "${TAR_DIR}" "${SRC_DIR}") @@ -440,22 +513,28 @@ function(vcpkg_configure_make) set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}") endif() - # Setup enviromnent + # Setup environment + set(ENV{CPPFLAGS} ${CPPFLAGS_${_buildtype}}) set(ENV{CFLAGS} ${CFLAGS_${_buildtype}}) set(ENV{CXXFLAGS} ${CXXFLAGS_${_buildtype}}) set(ENV{LDFLAGS} ${LDFLAGS_${_buildtype}}) set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}") - set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib${VCPKG_HOST_PATH_SEPARATOR}${LIBPATH_BACKUP}") - - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + + set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") + set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - if (CMAKE_HOST_WIN32) - set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${BUILD_TARGET} ${HOST_TYPE}${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") + if (CMAKE_HOST_WIN32) + set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") else() - set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) + set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) endif() - + if(_csc_ADD_BIN_TO_PATH) + set(PATH_BACKUP $ENV{PATH}) + vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/bin") + endif() + debug_message("Configure command:'${command}'") if (NOT _csc_SKIP_CONFIGURE) message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") vcpkg_execute_required_process( @@ -477,20 +556,27 @@ function(vcpkg_configure_make) unset(ENV{PKG_CONFIG_PATH}) endif() unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}) + + if(_csc_ADD_BIN_TO_PATH) + set(ENV{PATH} "${PATH_BACKUP}") + endif() + # Restore environment (config dependent) + foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) + if(BACKUP_CONFIG_${ENV_VAR}) + set(ENV{${ENV_VAR}} "${BACKUP_CONFIG_${ENV_VAR}}") + else() + unset(ENV{${ENV_VAR}}) + endif() + endforeach() + endforeach() + + # Restore environment + foreach(_prefix IN LISTS FLAGPREFIXES) + _vcpkg_restore_env_variable(${prefix}FLAGS) endforeach() - - # Restore enviromnent - set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") - set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") - - set(ENV{INCLUDE} "${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") - _vcpkg_restore_env_variable(LIBRARY_PATH) - _vcpkg_restore_env_variable(LD_LIBRARY_PATH) - set(ENV{LIBPATH} "${LIBPATH_BACKUP}") + + _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE) set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 2af64999e25d53..86a6e558688c9f 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -100,21 +100,10 @@ function(vcpkg_configure_meson) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) vcpkg_add_to_path("${NINJA_PATH}") - if(NOT ENV{PKG_CONFIG}) - find_program(PKGCONFIG pkg-config) - if(NOT PKGCONFIG AND CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) - vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") - endif() - find_program(PKGCONFIG pkg-config REQUIRED) - else() - debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}") - set(PKGCONFIG $ENV{PKG_CONFIG}) - endif() + vcpkg_find_acquire_program(PKGCONFIG) + get_filename_component(PKGCONFIG_PATH ${PKGCONFIG} DIRECTORY) + vcpkg_add_to_path("${PKGCONFIG_PATH}") set(PKGCONFIG_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig/") - if(WIN32) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_SHARE_DIR "${PKGCONFIG_SHARE_DIR}") - endif() # configure debug if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") @@ -123,20 +112,14 @@ function(vcpkg_configure_meson) #setting up PKGCONFIG if(NOT PKGCONFIG MATCHES "--define-variable=prefix") set(PKGCONFIG_PREFIX "${CURRENT_INSTALLED_DIR}/debug") - # if(WIN32) - # string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_PREFIX "${PKGCONFIG_PREFIX}") - # endif() set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}") endif() set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig/") - if(WIN32) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_INSTALLED_DIR "${PKGCONFIG_INSTALLED_DIR}") - endif() if(ENV{PKG_CONFIG_PATH}) set(BACKUP_ENV_PKG_CONFIG_PATH_DEBUG $ENV{PKG_CONFIG_PATH}) - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}: $ENV{PKG_CONFIG_PATH}") + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") else() - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}") + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}") endif() set(CFLAGS "-Dc_args=[${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}]") @@ -191,20 +174,14 @@ function(vcpkg_configure_meson) #setting up PKGCONFIG if(NOT PKGCONFIG MATCHES "--define-variable=prefix") set(PKGCONFIG_PREFIX "${CURRENT_INSTALLED_DIR}") - # if(WIN32) - # string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_PREFIX "${PKGCONFIG_PREFIX}") - # endif() set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}") endif() set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/") - if(WIN32) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_INSTALLED_DIR "${PKGCONFIG_INSTALLED_DIR}") - endif() if(ENV{PKG_CONFIG_PATH}) set(BACKUP_ENV_PKG_CONFIG_PATH_RELEASE $ENV{PKG_CONFIG_PATH}) - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}: $ENV{PKG_CONFIG_PATH}") + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") else() - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}") + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}") endif() # Normalize flags for meson (i.e. " /string /with /flags " -> ['/string', '/with', '/flags']) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index 396d20b41d8e1c..1784a4d145c6d4 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -17,14 +17,21 @@ ## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake) ## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) function(vcpkg_copy_tool_dependencies TOOL_DIR) + find_program(PS_EXE powershell PATHS ${DOWNLOADS}/tool) + if (PS_EXE-NOTFOUND) + message(FATAL_ERROR "Could not find powershell in vcpkg tools, please open an issue to report this.") + endif() macro(search_for_dependencies PATH_TO_SEARCH) file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) - execute_process(COMMAND powershell -noprofile -executionpolicy Bypass -nologo - -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 - -targetBinary ${TOOL} - -installedDir ${PATH_TO_SEARCH} - OUTPUT_VARIABLE OUT) + vcpkg_execute_required_process( + COMMAND ${PS_EXE} -noprofile -executionpolicy Bypass -nologo + -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 + -targetBinary ${TOOL} + -installedDir ${PATH_TO_SEARCH} + WORKING_DIRECTORY ${VCPKG_ROOT_DIR} + LOGNAME copy-tool-dependencies + ) endforeach() endmacro() search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 6ad0738039ed50..c04b070aaed5ba 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -28,6 +28,9 @@ ## ## If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch. ## +## ### QUIET +## Suppress output on cache hit +## ## ### SKIP_SHA512 ## Skip SHA512 hash check for file. ## @@ -47,7 +50,7 @@ ## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake) ## * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake) function(vcpkg_download_distfile VAR) - set(options SKIP_SHA512 SILENT_EXIT) + set(options SKIP_SHA512 SILENT_EXIT QUIET) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS HEADERS) cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) @@ -59,9 +62,6 @@ function(vcpkg_download_distfile VAR) message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") endif() if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK) - if(vcpkg_download_distfile_SKIP_SHA512 AND NOT VCPKG_USE_HEAD_VERSION) - message(FATAL_ERROR "vcpkg_download_distfile only allows SKIP_SHA512 when building with --head") - endif() if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") endif() @@ -106,7 +106,9 @@ function(vcpkg_download_distfile VAR) endfunction() if(EXISTS "${downloaded_file_path}") - message(STATUS "Using cached ${downloaded_file_path}") + if(NOT vcpkg_download_distfile_QUIET) + message(STATUS "Using cached ${downloaded_file_path}") + endif() test_hash("${downloaded_file_path}" "cached file" "Please delete the file and retry if this file should be downloaded again.") else() if(_VCPKG_NO_DOWNLOADS) diff --git a/scripts/cmake/vcpkg_escape_regex_control_characters.cmake b/scripts/cmake/vcpkg_escape_regex_control_characters.cmake new file mode 100644 index 00000000000000..3d9d92b5e4102c --- /dev/null +++ b/scripts/cmake/vcpkg_escape_regex_control_characters.cmake @@ -0,0 +1,4 @@ +function(vcpkg_escape_regex_control_characters out_var string_with_regex_characters) + string(REGEX REPLACE "[][+.*()^\\$?|]" "\\\\\\0" _escaped_content "${string_with_regex_characters}") + set(${out_var} "${_escaped_content}" PARENT_SCOPE) +endfunction() diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index 9da6cec9f57baa..98e3648d506dd5 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -61,8 +61,13 @@ function(vcpkg_execute_build_process) OR err_contents MATCHES "LINK : fatal error LNK1102:" OR err_contents MATCHES " fatal error C1060: " OR out_contents MATCHES "LINK : fatal error LNK1318: Unexpected PDB error; ACCESS_DENIED" OR out_contents MATCHES "LINK : fatal error LNK1104:" - OR out_contents MATCHES "LINK : fatal error LNK1201:") + OR out_contents MATCHES "LINK : fatal error LNK1201:" # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + OR err_contents MATCHES "Cannot create parent directory" OR err_contents MATCHES "Cannot write file" + # Multiple threads using the same directory at the same time cause conflicts, will try again. + OR err_contents MATCHES "Can't open" + # Multiple threads caused the wrong order of creating folders and creating files in folders + ) message(STATUS "Restarting Build without parallelism because memory exceeded") set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err-1.log") diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index f25a5b55e3e44a..af5ab1e9ee60ad 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -8,6 +8,7 @@ ## COMMAND <${PERL}> [...] ## WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg> ## LOGNAME +## [TIMEOUT ] ## ) ## ``` ## ## Parameters @@ -24,6 +25,9 @@ ## ### LOGNAME ## The prefix to use for the log files. ## +## ### TIMEOUT +## Optional timeout after which to terminate the command. +## ## This should be a unique name for different triplets so that the logs don't conflict when building multiple at once. ## ## ## Examples @@ -34,10 +38,16 @@ ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) include(vcpkg_prettify_command) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME;TIMEOUT" "COMMAND" ${ARGN}) set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") + if(vcpkg_execute_required_process_TIMEOUT) + set(TIMEOUT_PARAM "TIMEOUT;${vcpkg_execute_required_process_TIMEOUT}") + else() + set(TIMEOUT_PARAM "") + endif() + set(execute_process_function execute_process) if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) message(FATAL_ERROR @@ -52,7 +62,8 @@ Halting portfile execution. OUTPUT_FILE ${LOG_OUT} ERROR_FILE ${LOG_ERR} RESULT_VARIABLE error_code - WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY}) + WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY} + ${TIMEOUT_PARAM}) if(error_code) set(LOGS) file(READ "${LOG_OUT}" out_contents) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index a5aefdc29297cd..0a6158c77c5d40 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -16,6 +16,7 @@ ## - 7Z ## - ARIA2 (Downloader) ## - BISON +## - CLANG ## - DARK ## - DOXYGEN ## - FLEX @@ -33,6 +34,7 @@ ## - NINJA ## - NUGET ## - SCONS +## - SWIG ## - YASM ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). @@ -51,57 +53,57 @@ function(vcpkg_find_acquire_program VAR) unset(NOEXTRACT) unset(_vfa_RENAME) unset(SUBDIR) + unset(PROG_PATH_SUBDIR) unset(REQUIRED_INTERPRETER) unset(_vfa_SUPPORTED) unset(POST_INSTALL_COMMAND) - - vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS) - set(PROGRAM_FILES_32_BIT $ENV{ProgramFiles\(X86\)}) - if (NOT DEFINED PROGRAM_FILES_32_BIT) - set(PROGRAM_FILES_32_BIT $ENV{PROGRAMFILES}) - endif() + unset(PATHS) if(VAR MATCHES "PERL") set(PROGNAME perl) - set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) + set(PERL_VERSION 5.30.0.1) + set(SUBDIR ${PERL_VERSION}) + set(PATHS ${DOWNLOADS}/tools/perl/${SUBDIR}/perl/bin) set(BREW_PACKAGE_NAME "perl") set(APT_PACKAGE_NAME "perl") set(URL - "https://strawberry.perl.bot/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip" - "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip" + "https://strawberry.perl.bot/download/${PERL_VERSION}/strawberry-perl-${PERL_VERSION}-32bit.zip" + "http://strawberryperl.com/download/${PERL_VERSION}/strawberry-perl-${PERL_VERSION}-32bit.zip" ) - set(ARCHIVE "strawberry-perl-5.30.0.1-32bit.zip") + set(ARCHIVE "strawberry-perl-${PERL_VERSION}-32bit.zip") set(HASH d353d3dc743ebdc6d1e9f6f2b7a6db3c387c1ce6c890bae8adc8ae5deae8404f4c5e3cf249d1e151e7256d4c5ee9cd317e6c41f3b6f244340de18a24b938e0c4) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) - set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.14.02) + set(NASM_VERSION 2.14.02) + set(PATHS ${DOWNLOADS}/tools/nasm/nasm-${NASM_VERSION}) set(BREW_PACKAGE_NAME "nasm") set(APT_PACKAGE_NAME "nasm") set(URL - "http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win32/nasm-2.14.02-win32.zip" - "http://fossies.org/windows/misc/nasm-2.14.02-win32.zip" + "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/win32/nasm-${NASM_VERSION}-win32.zip" + "https://fossies.org/windows/misc/nasm-${NASM_VERSION}-win32.zip" ) - set(ARCHIVE "nasm-2.14.02-win32.zip") + set(ARCHIVE "nasm-${NASM_VERSION}-win32.zip") set(HASH a0f16a9f3b668b086e3c4e23a33ff725998e120f2e3ccac8c28293fd4faeae6fc59398919e1b89eed7461685d2730de02f2eb83e321f73609f35bf6b17a23d1e) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) + set(YASM_VERSION 1.3.0.6.g1962) set(SUBDIR 1.3.0.6) - set(PATHS ${DOWNLOADS}/tools/yasm/${SUBDIR}) set(BREW_PACKAGE_NAME "yasm") set(APT_PACKAGE_NAME "yasm") - set(URL "https://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe") - set(ARCHIVE "yasm-1.3.0.6.g1962.exe") + set(URL "https://www.tortall.net/projects/yasm/snapshots/v${YASM_VERSION}/yasm-${YASM_VERSION}.exe") + set(ARCHIVE "yasm-${YASM_VERSION}.exe") set(_vfa_RENAME "yasm.exe") set(NOEXTRACT ON) set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b) elseif(VAR MATCHES "GIT") set(PROGNAME git) if(CMAKE_HOST_WIN32) - set(SUBDIR "git-2.26.2-1-windows") - set(URL "https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe") - set(ARCHIVE "PortableGit-2.26.2-32-bit.7z.exe") + set(GIT_VERSION 2.26.2) + set(SUBDIR "git-${GIT_VERSION}-1-windows") + set(URL "https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/PortableGit-${GIT_VERSION}-32-bit.7z.exe") + set(ARCHIVE "PortableGit-${GIT_VERSION}-32-bit.7z.exe") set(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36) - set(PATHS + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin" "${DOWNLOADS}/tools/git/${SUBDIR}/mingw32/bin") else() @@ -128,29 +130,30 @@ function(vcpkg_find_acquire_program VAR) set(HASH "263e02bd79eee0cb7b664831b7898565c5656a046328d8f187ef7ae2a4d766991d477b190c9b425fcc960ab76f381cd3e396afb85cba7408ca9e74eb32c175db") endif() set(SUBDIR "${GN_VERSION}") - set(PATHS "${DOWNLOADS}/tools/gn/${SUBDIR}") set(URL "${CIPD_DOWNLOAD_GN}/${GN_PLATFORM}/+/${GN_VERSION}") set(ARCHIVE "gn-${GN_PLATFORM}.zip") elseif(VAR MATCHES "GO") set(PROGNAME go) - set(PATHS ${DOWNLOADS}/tools/go/go/bin) + set(SUBDIR 1.13.1.windows-386) + set(PATHS ${DOWNLOADS}/tools/go/${SUBDIR}/go/bin) set(BREW_PACKAGE_NAME "go") set(APT_PACKAGE_NAME "golang-go") - set(URL "https://dl.google.com/go/go1.13.1.windows-386.zip") - set(ARCHIVE "go1.13.1.windows-386.zip") + set(URL "https://dl.google.com/go/go${SUBDIR}.zip") + set(ARCHIVE "go${SUBDIR}.zip") set(HASH 2ab0f07e876ad98d592351a8808c2de42351ab387217e088bc4c5fa51d6a835694c501e2350802323b55a27dc0157f8b70045597f789f9e50f5ceae50dea3027) elseif(VAR MATCHES "PYTHON3") if(CMAKE_HOST_WIN32) set(PROGNAME python) + set(PYTHON_VERSION 3.8.3) if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(SUBDIR "python-3.8.3-x86") - set(URL "https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-win32.zip") - set(ARCHIVE "python-3.8.3-embed-win32.zip") + set(SUBDIR "python-${PYTHON_VERSION}-x86") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-win32.zip") + set(ARCHIVE "python-${PYTHON_VERSION}-embed-win32.zip") set(HASH 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a) else() - set(SUBDIR "python-3.8.3-x64") - set(URL "https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-amd64.zip") - set(ARCHIVE "python-3.8.3-embed-amd64.zip") + set(SUBDIR "python-${PYTHON_VERSION}-x64") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip") + set(ARCHIVE "python-${PYTHON_VERSION}-embed-amd64.zip") set(HASH a322fc925167edb1897764297cf47e294ad3f52c109a05f8911412807eb83e104f780e9fe783b17fe0d9b18b7838797c15e9b0805dab759829f77a9bc0159424) endif() set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) @@ -163,15 +166,16 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "PYTHON2") if(CMAKE_HOST_WIN32) set(PROGNAME python) + set(PYTHON_VERSION 2.7.16) if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(SUBDIR "python-2.7.16-x86") - set(URL "https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi") - set(ARCHIVE "python-2.7.16.msi") + set(SUBDIR "python-${PYTHON_VERSION}-x86") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.msi") + set(ARCHIVE "python-${PYTHON_VERSION}.msi") set(HASH c34a6fa2438682104dccb53650a2bdb79eac7996deff075201a0f71bb835d60d3ed866652a1931f15a29510fe8e1009ac04e423b285122d2e5747fefc4c10254) else() - set(SUBDIR "python-2.7.16-x64") - set(URL "https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi") - set(ARCHIVE "python-2.7.16.amd64.msi") + set(SUBDIR "python-${PYTHON_VERSION}-x64") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.amd64.msi") + set(ARCHIVE "python-${PYTHON_VERSION}.amd64.msi") set(HASH 47c1518d1da939e3ba6722c54747778b93a44c525bcb358b253c23b2510374a49a43739c8d0454cedade858f54efa6319763ba33316fdc721305bc457efe4ffb) endif() set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) @@ -190,40 +194,48 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME jom) set(SUBDIR "jom-1.1.3") set(PATHS ${DOWNLOADS}/tools/jom/${SUBDIR}) - set(URL - "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" - "http://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip" + set(URL + "https://download.qt.io/official_releases/jom/jom_1_1_3.zip" + "https://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip" ) set(ARCHIVE "jom_1_1_3.zip") set(HASH 5b158ead86be4eb3a6780928d9163f8562372f30bde051d8c281d81027b766119a6e9241166b91de0aa6146836cea77e5121290e62e31b7a959407840fc57b33) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" "${DOWNLOADS}/tools/7z/Files/7-Zip") + set(PATHS "${DOWNLOADS}/tools/7z/Files/7-Zip") set(URL "https://7-zip.org/a/7z1900.msi") set(ARCHIVE "7z1900.msi") set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) - set(SUBDIR "ninja-1.10.0") + set(NINJA_VERSION 1.10.0) + set(_vfa_SUPPORTED ON) if(CMAKE_HOST_WIN32) - set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-windows") - list(APPEND PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + set(ARCHIVE "ninja-win-${NINJA_VERSION}.zip") + set(SUBDIR "${NINJA_VERSION}-windows") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-win.zip") + set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") - set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") + set(ARCHIVE "ninja-mac-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-mac.zip") + set(SUBDIR "${NINJA_VERSION}-osx") + set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-osx") + set(HASH 619a1924067a0b30fc5f8887f868d3ee5481838d2f0f158d031f7614a2a10b95a73d4a56b658d5d560283ebf809e2e536b968c6c01ff0108075c3f393f5780ba) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd") + set(_vfa_SUPPORTED OFF) else() - set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") + set(ARCHIVE "ninja-linux-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip") + set(SUBDIR "${NINJA_VERSION}-linux") + set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-linux") + set(HASH ffb179ab8ea315167fcc99a8f13286e1363590185b18cf819cc73e09f2a7553790e9dc45fd1ccd0bd1d2dbf543aee3f6c0951cf9ce453a7168ffd2ac873cdd29) endif() - set(BREW_PACKAGE_NAME "ninja") - set(APT_PACKAGE_NAME "ninja-build") - set(URL "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip") - set(ARCHIVE "ninja-win-1.10.0.zip") - set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) + set(VERSION_CMD --version) elseif(VAR MATCHES "NUGET") set(PROGNAME nuget) set(SUBDIR "5.5.1") - set(PATHS "${DOWNLOADS}/tools/nuget/${SUBDIR}") + set(PATHS "${DOWNLOADS}/tools/nuget-${SUBDIR}-windows") set(BREW_PACKAGE_NAME "nuget") set(URL "https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe") set(_vfa_RENAME "nuget.exe") @@ -231,19 +243,18 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) elseif(VAR MATCHES "MESON") + set(MESON_VERSION 0.55.1) set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) - set(BREW_PACKAGE_NAME "meson") set(APT_PACKAGE_NAME "meson") - if(CMAKE_HOST_WIN32) - set(SCRIPTNAME meson.py) - else() - set(SCRIPTNAME meson) - endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) - set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") - set(ARCHIVE "meson-0.54.2.zip") - set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) + set(BREW_PACKAGE_NAME "meson") + set(SCRIPTNAME meson meson.py) + set(PATHS ${DOWNLOADS}/tools/meson/meson-${MESON_VERSION}) + set(URL "https://github.com/mesonbuild/meson/releases/download/${MESON_VERSION}/meson-${MESON_VERSION}.tar.gz") + set(ARCHIVE "meson-${MESON_VERSION}.tar.gz") + set(HASH 172b4de8c7474d709f172431b89bf2b2b1c2c38bc842039cccf6be075a45bd3509a1dab8512bc5b2ee025d65d8050d2f717dd15c1f9be17fca3b2e7da0d3e889) + set(_vfa_SUPPORTED ON) + set(VERSION_CMD --version) elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") if(CMAKE_HOST_WIN32) set(SOURCEFORGE_ARGS @@ -274,11 +285,43 @@ function(vcpkg_find_acquire_program VAR) set(PATHS /usr/local/opt/bison/bin) endif() endif() + elseif(VAR MATCHES "CLANG") + set(PROGNAME clang) + set(SUBDIR "clang-10.0.0") + if(CMAKE_HOST_WIN32) + set(PATHS + # Support LLVM in Visual Studio 2019 + "$ENV{LLVMInstallDir}/x64/bin" + "$ENV{LLVMInstallDir}/bin" + "$ENV{VCINSTALLDIR}/Tools/Llvm/x64/bin" + "$ENV{VCINSTALLDIR}/Tools/Llvm/bin" + "${DOWNLOADS}/tools/${SUBDIR}-windows/bin" + "${DOWNLOADS}/tools/clang/${SUBDIR}/bin") + + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH_ $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH_ $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(HOST_ARCH_ MATCHES "64") + set(URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe") + set(ARCHIVE "LLVM-10.0.0-win64.7z.exe") + set(HASH 3603a4be3548dabc7dda94f3ed4384daf8a94337e44ee62c0d54776c79f802b0cb98fc106e902409942e841c39bc672cc6d61153737ad1cc386b609ef25db71c) + else() + set(URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win32.exe") + set(ARCHIVE "LLVM-10.0.0-win32.7z.exe") + set(HASH 8494922b744ca0dc8d075a1d3a35a0db5a9287544afd5c4984fa328bc26f291209f6030175896b4895019126f5832045e06d8ad48072b549916df29a2228348b) + endif() + endif() + set(BREW_PACKAGE_NAME "llvm") + set(APT_PACKAGE_NAME "clang") elseif(VAR MATCHES "GPERF") set(PROGNAME gperf) + set(GPERF_VERSION 3.0.1) set(PATHS ${DOWNLOADS}/tools/gperf/bin) - set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/gperf-3.0.1-bin.zip/download") - set(ARCHIVE "gperf-3.0.1-bin.zip") + set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/${GPERF_VERSION}/gperf-${GPERF_VERSION}-bin.zip/download") + set(ARCHIVE "gperf-${GPERF_VERSION}-bin.zip") set(HASH 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9) elseif(VAR MATCHES "GASPREPROCESSOR") set(NOEXTRACT true) @@ -300,69 +343,191 @@ function(vcpkg_find_acquire_program VAR) set(HASH 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516) elseif(VAR MATCHES "SCONS") set(PROGNAME scons) + set(SCONS_VERSION 3.0.1) + set(SUBDIR ${SCONS_VERSION}) set(REQUIRED_INTERPRETER PYTHON2) set(SCRIPTNAME "scons.py") - set(PATHS ${DOWNLOADS}/tools/scons) - set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") - set(ARCHIVE "scons-local-3.0.1.zip") - set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + set(URL "https://sourceforge.net/projects/scons/files/scons-local-${SCONS_VERSION}.zip/download") + set(ARCHIVE "scons-local-${SCONS_VERSION}.zip") + set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + elseif(VAR MATCHES "SWIG") + set(VERSION 4.0.2) + set(PROGNAME swig) + if(CMAKE_HOST_WIN32) + #set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download") + set(ARCHIVE "swigwin-${VERSION}.zip") + set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d) + set(SUBDIR b8f105f9b9-f0518bc3b7/swigwin-${VERSION}) + #set(SUBDIR "swigwin-${VERSION}") + #set(PATHS "${DOWNLOADS}/tools/swig/swigwin-${VERSION}") + else() + #Not used + set(_vfa_SUPPORTED TRUE) + set(URL https://sourceforge.net/projects/swig/files/swig/swig-${VERSION}/swig-${VERSION}.tar.gz/download) + set(ARCHIVE "swig-${VERSION}.tar.gz") + set(HASH 05e7da70ce6d9a733b96c0bcfa3c1b82765bd859f48c74759bbf4bb1467acb1809caa310cba5e2b3280cd704fca249eaa0624821dffae1d2a75097c7f55d14ed) + set(SUBDIR "swig-${VERSION}") + set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}") + endif() + set(SOURCEFORGE_ARGS + REPO swig/swigwin + REF swigwin-${VERSION} + FILENAME "${ARCHIVE}" + SHA512 "${HASH}" + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/swig" + ) elseif(VAR MATCHES "DOXYGEN") set(PROGNAME doxygen) set(DOXYGEN_VERSION 1.8.17) - set(PATHS ${DOWNLOADS}/tools/doxygen) - set(URL - "http://doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.windows.bin.zip" - "https://sourceforge.net/projects/doxygen/files/rel-${DOXYGEN_VERSION}/doxygen-${DOXYGEN_VERSION}.windows.bin.zip") - set(ARCHIVE "doxygen-${DOXYGEN_VERSION}.windows.bin.zip") - set(HASH 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b) + set(SOURCEFORGE_ARGS + REPO doxygen + REF rel-${DOXYGEN_VERSION} + FILENAME "doxygen-${DOXYGEN_VERSION}.windows.bin.zip" + SHA512 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/doxygen" + ) + set(SUBDIR 6bac47ec55-25c819fd77) elseif(VAR MATCHES "BAZEL") set(PROGNAME bazel) set(BAZEL_VERSION 0.25.2) - set(SUBDIR ${BAZEL_VERSION}) - set(PATHS ${DOWNLOADS}/tools/bazel/${SUBDIR}) set(_vfa_RENAME "bazel") if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_vfa_SUPPORTED ON) - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64") - set(ARCHIVE "bazel-${BAZEL_VERSION}-linux-x86_64") + set(SUBDIR ${BAZEL_VERSION}-linux) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") + set(ARCHIVE "bazel-${SUBDIR}-x86_64") set(NOEXTRACT ON) set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(_vfa_SUPPORTED ON) - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") - set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64") + set(SUBDIR ${BAZEL_VERSION}-darwin) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") + set(ARCHIVE "bazel-${SUBDIR}-x86_64") set(NOEXTRACT ON) set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c) else() - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") - set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip") + set(SUBDIR ${BAZEL_VERSION}-windows) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64.zip") + set(ARCHIVE "bazel-${SUBDIR}-x86_64.zip") set(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53) endif() - # Download Tools elseif(VAR MATCHES "ARIA2") set(PROGNAME aria2c) - set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-1.34.0-win-32bit-build1) - set(URL "https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-32bit-build1.zip") - set(ARCHIVE "aria2-1.34.0-win-32bit-build1.zip") + set(ARIA2_VERSION 1.34.0) + set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-${ARIA2_VERSION}-win-32bit-build1) + set(URL "https://github.com/aria2/aria2/releases/download/release-${ARIA2_VERSION}/aria2-${ARIA2_VERSION}-win-32bit-build1.zip") + set(ARCHIVE "aria2-${ARIA2_VERSION}-win-32bit-build1.zip") set(HASH 2a5480d503ac6e8203040c7e516a3395028520da05d0ebf3a2d56d5d24ba5d17630e8f318dd4e3cc2094cc4668b90108fb58e8b986b1ffebd429995058063c27) + elseif(VAR MATCHES "PKGCONFIG") + set(PROGNAME pkg-config) + set(VERSION 0.29.2-1) + set(LIBWINPTHREAD_VERSION git-8.0.0.5906.c9a21571-1) + if(ENV{PKG_CONFIG}) + debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}") + set(PKGCONFIG $ENV{PKG_CONFIG} PARENT_SCOPE) + return() + elseif(CMAKE_HOST_WIN32) + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${VERSION}") + set(PKGCONFIG "${PROG_PATH_SUBDIR}/mingw32/bin/pkg-config.exe") + if(NOT EXISTS "${PKGCONFIG}") + vcpkg_download_distfile(PKGCONFIG_ARCHIVE + URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.xz" + SHA512 3b1b706a24d9aef7bbdf3ce4427aaa813ba6fbd292ed9dda181b4300e117c3d59a159ddcca8b013fd01ce76da2d95d590314ff9628c0d68a6966bac4842540f0 + FILENAME mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.xz + ) + vcpkg_download_distfile(LIBWINPTHREAD_ARCHIVE + URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-${LIBWINPTHREAD_VERSION}-any.pkg.tar.zst" + SHA512 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c + FILENAME mingw-w64-i686-libwinpthread-${LIBWINPTHREAD_VERSION}-any.pkg.tar.zst + ) + file(REMOVE_RECURSE ${PROG_PATH_SUBDIR} ${PROG_PATH_SUBDIR}.tmp) + file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}.tmp) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${CMAKE_COMMAND} -E tar xzf ${LIBWINPTHREAD_ARCHIVE} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR}.tmp + ) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${CMAKE_COMMAND} -E tar xzf ${PKGCONFIG_ARCHIVE} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR}.tmp + ) + file(RENAME ${PROG_PATH_SUBDIR}.tmp ${PROG_PATH_SUBDIR}) + endif() + set(${VAR} "${${VAR}}" PARENT_SCOPE) + return() + else() + set(BREW_PACKAGE_NAME pkg-config) + set(APT_PACKAGE_NAME pkg-config) + set(PATHS "/bin" "/usr/bin" "/usr/local/bin") + endif() else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() + macro(do_version_check) + if(VERSION_CMD) + _execute_process( + COMMAND ${${VAR}} ${VERSION_CMD} + WORKING_DIRECTORY ${DOWNLOADS} + OUTPUT_VARIABLE ${VAR}_VERSION_OUTPUT + ) + string(STRIP "${${VAR}_VERSION_OUTPUT}" ${VAR}_VERSION_OUTPUT) + #TODO: REGEX MATCH case for more complex cases! + if(NOT ${VAR}_VERSION_OUTPUT VERSION_GREATER_EQUAL ${VAR}_VERSION) + message(STATUS "Found ${PROGNAME}('${${VAR}_VERSION_OUTPUT}') but at least version ${${VAR}_VERSION} is required! Trying to use internal version if possible!") + set(${VAR} "${VAR}-NOTFOUND" CACHE INTERNAL "") + else() + message(STATUS "Found external ${PROGNAME}('${${VAR}_VERSION_OUTPUT}').") + endif() + endif() + endmacro() + macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) find_program(${VAR} ${PROGNAME} PATHS ${PATHS} NO_DEFAULT_PATH) - find_program(${VAR} ${PROGNAME}) + if(NOT ${VAR}) + find_program(${VAR} ${PROGNAME}) + if(${VAR} AND NOT ${VAR}_VERSION_CHECKED) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) - find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) - find_file(SCRIPT_${VAR} ${SCRIPTNAME}) - set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + if(NOT SCRIPT_${VAR}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME}) + if(SCRIPT_${VAR} AND NOT ${VAR}_VERSION_CHECKED) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + if(NOT ${VAR}) + unset(SCRIPT_${VAR} CACHE) + endif() + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() + if(SCRIPT_${VAR}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + endif() endif() endmacro() + if(NOT DEFINED PROG_PATH_SUBDIR) + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") + endif() + if(DEFINED SUBDIR) + list(APPEND PATHS ${PROG_PATH_SUBDIR}) + endif() + do_find() - if("${${VAR}}" MATCHES "-NOTFOUND") + if(NOT ${VAR}) if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _vfa_SUPPORTED) set(EXAMPLE ".") if(DEFINED BREW_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") @@ -385,7 +550,6 @@ function(vcpkg_find_acquire_program VAR) FILENAME ${ARCHIVE} ) - set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) if(DEFINED NOEXTRACT) if(DEFINED _vfa_RENAME) @@ -426,8 +590,11 @@ function(vcpkg_find_acquire_program VAR) LOGNAME ${VAR}-tool-post-install ) endif() - + unset(${VAR} CACHE) do_find() + if(NOT ${VAR}) + message(FATAL_ERROR "Unable to find ${VAR}") + endif() endif() set(${VAR} "${${VAR}}" PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_find_fortran.cmake b/scripts/cmake/vcpkg_find_fortran.cmake new file mode 100644 index 00000000000000..c517fa51bfdb19 --- /dev/null +++ b/scripts/cmake/vcpkg_find_fortran.cmake @@ -0,0 +1,130 @@ +## # vcpkg_find_fortran +## +## Checks if a Fortran compiler can be found. +## Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran +## and return required cmake args for building. +## +## ## Usage +## ```cmake +## vcpkg_find_fortran( +## ) +## ``` + +function(vcpkg_find_fortran additional_cmake_args_out) + set(ARGS_OUT) + set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}") + set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform") + include(CMakeDetermineFortranCompiler) + if(NOT CMAKE_Fortran_COMPILER AND NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + # This intentionally breaks users with a custom toolchain which do not have a Fortran compiler setup + # because they either need to use a port-overlay (for e.g. lapack), remove the toolchain for the port using fortran + # or setup fortran in their VCPKG_CHAINLOAD_TOOLCHAIN_FILE themselfs! + if(WIN32) + message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!") + # If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(MINGW_PATH mingw32) + set(MACHINE_FLAG -m32) + vcpkg_acquire_msys(MSYS_ROOT + DIRECT_PACKAGES + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-10.2.0-1-any.pkg.tar.zst" + ddbdaf9ea865181e16a0931b2ec88c2dcef8add34628e479c7b9de4fa2ccb22e09c7239442e58702e0acd3adabc920565e976984f2bcd90a3668bf7f48a245f1 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst" + 150f355085fcf4c54e8bce8f7f08b90fea9ca7e1f32cff0a2e495faa63cf7723f4bf935f0f4ec77c8dd2ba710ceaed88694cb3da71def5e2088dd65e13c9b002 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-1-any.pkg.tar.zst" + 113d8b3b155ea537be8b99688d454f781d70c67c810c2643bc02b83b332d99bfbf3a7fcada6b927fda67ef02cf968d4fdf930466c5909c4338bda64f1f3f483e + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz" + 37747f3f373ebff1a493f5dec099f8cd6d5abdc2254d9cd68a103ad7ba44a81a9a97ccaba76eaee427b4d67b2becb655ee2c379c2e563c8051b6708431e3c588 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + e87ad4f4071c6b5bba3b13a85abf6657bb494b73c57ebe65bc5a92e2cef1d9de354e6858d1338ee72809e3dc742ba69ce090aaad4560ae1d3479a61dbebf03c6 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz" + d236b815ec3cf569d24d96a386eca9f69a2b1e8af18e96c3f1e5a4d68a3598d32768c7fb3c92207ecffe531259822c1a421350949f2ffabd8ee813654f1af864 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.1.0-2-any.pkg.tar.zst" + caac5cb73395082b479597a73c7398bf83009dbc0051755ef15157dc34996e156d4ed7881ef703f9e92861cfcad000888c4c32e4bf38b2596c415a19aafcf893 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-10.2.0-1-any.pkg.tar.zst" + 3085e744e716301ba8e4c8a391ab09c2d51e587e0a2df5dab49f83b403a32160f8d713cf1a42c1d962885b4c6ee3b6ed36ef40de15c4be2b69dbc3f12f974c3c + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-binutils-2.34-3-any.pkg.tar.zst" + ff06b2adebe6e9b278b63ca5638ff704750a346faad1cdc40089431b0a308edb6f2a131815e0577673a19878ec1bd8d5a4fa592aa227de769496c1fd3aedbc85 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst" + 120c943ce173719e48400fa18299f3458bc9db4cf18bb5a4dda8a91cc3f816510b337a92f7388077c65b50bbbeae9078793891ceaad631d780b10fde19ad3649 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst" + dbb9f8258da306a3441f9882faa472c3665a67b2ea68657f3e8a1402dcfacf9787a886a3daf0eefe4946f04557bc166eb15b21c1093ad85c909002daadba1923 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz" + ba236e1efc990cb91d459f938be6ca6fc2211be95e888d73f8de301bce55d586f9d2b6be55dacb975ec1afa7952b510906284eff70210238919e341dffbdbeb8 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz" + 5b99abc55eaa74cf85ca64a9c91542554cb5c1098bc71effba9bd36242694cfd348503fcd3507fb9ba97486108c092c925e2f38cd744493386b3dc9ab28bc526 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz" + 459850a8c42b1d497268736629ef713beee70cd0d3161d02c7a9fad08aca4560f4e17ba02d5cabda8a19d7c614f7e0ef5a6ec13afd91dd3004057139a5469c8f + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst" + 68f431073717b59549ab0fd26be8df8afcb43f3dd85be2ffcbc7d1a629999eed924656a7fc3f50937b2e6605a5067542d016181106b7bc3408b89b268ced5d23 + ) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(MINGW_PATH mingw64) + set(MACHINE_FLAG -m64) + vcpkg_acquire_msys(MSYS_ROOT + DIRECT_PACKAGES + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst" + 0de02db791e978ae21577e675ee9676f741336c9a5ceb5614dbdfc793e2c1c4749b394f41362af7b069e970302fddf8c6772ebd8445fe1c360861606b1784b4d + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst" + c2dee2957356fa51aae39d907d0cc07f966028b418f74a1ea7ea551ff001c175d86781f980c0cf994207794322dcd369fa122ab78b6c6d0f0ab01e39a754e780 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-1-any.pkg.tar.zst" + d17eff08c83d08ef020d999a2ead0d25036ada1c1bf6ed7c02bad9b56840ee5a3304acd790d86f52b83b09c1e788f0cecdf7254dc6760c3c7e478f65882cd32d + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz" + 0b22b7363e27cec706eb79ee0c45b5fe7088a5ca69e0868e7366481ed2ea9b3f6623d340cebba0b5ed3d79e4dfc7cf15f53530eb260c6d4057bfc3d92eb8c7bc + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + a6969a5db1c55ba458c1a047d0a2a9d2db6cc24266ea47f740598b149a601995d2de734a0984ac5e57ee611d5982cbc03fd6fc0f498435e8d6401bf15724caad + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + 87ae090a8de855de5580f158f4007f88d6dad341429620685dc736be55b1f060487552040327a76003618e214a11c1f8e5105ca2c7abe164908121627449d679 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz" + db075a1406690935db5780af293660385f56699881a1b2cd25ab252183643d71d646b0dadf1e34174df8f0744d51ce8b56dccd719e049efcaf9b7e08e80a7ef6 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.1.0-2-any.pkg.tar.zst" + 14739667242b8852f0d26547eb3297899a51fd1edafc7101b4e7489273e1efb9cb8422fc067361e3c3694c2afcc6c49fc89537f9f811ad5b9b595873112ee890 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-1-any.pkg.tar.zst" + 7a08c7923f688ca8f06d55e1e91b9059a933ee56e27075ea073e6e58ae220310fb5f79869886a61b6987ab08993c9f962a4bfc50b6ea80473e933ce5551f3930 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst" + 4efd5586c344802110ea0061867469a23571df88529d66a943f86add1287f85ef53b6a9a9b16af2cb67bd09e0760a6f290c3b04ba70c0d5861d8a9f79f0ac209 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst" + 0142e4a44c59d17380a4fc7b101a2152486781621d5f9f930045b8f9c4bb2c93ea88211e7d8f8f233e0ae09595c6c8bc948ae80b9673f231e715b0d04c8a1e54 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst" + b547091a45ea7df8182b627edc9a7c91a23f01c0d4e02634a590c02f24311741cad92ceb67b7e4432ffbe4266f135a5289eb3560cc90ffa5c57612c8537a1588 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz" + c8e2fda532c753e0b1004596bf737c3669355f32af9b45d96c23fcef14994ba21ddf4f75138bdecc94cbf8a8c449eff530d24b74a0da47793e24ce92d154f411 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz" + 77d02121416e42ff32a702e21266ce9031b4d8fc9ecdb5dc049d92570b658b3099b65d167ca156367d17a76e53e172ca52d468e440c2cdfd14701da210ffea37 + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz" + bbd4a549efc2a5f4b1e9f1be00331e8726d80401a9c6117afa9d5dd92f4ac42a06cf2ce491a988e5c6ed7a6e536f8f1746081f4944bc6d473ccd16390fea27fe + "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst" + dc2c7289fb206966829c98f6bf4389b423784415532ca3d627a22ae9d756a4fe2faf9844994b3093d814d129d20b2b79897e702aa9569978f58431ea66b55feb + ) + else() + message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!") + endif() + + set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin") + vcpkg_add_to_path(PREPEND "${MINGW_BIN}") + list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON + "-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe" + "-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe" + "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}") + # This is for private use by vcpkg-gfortran + set(vcpkg_find_fortran_MSYS_ROOT "${MSYS_ROOT}" PARENT_SCOPE) + set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE) + set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(VCPKG_CRT_LINKAGE dynamic PARENT_SCOPE) + message(STATUS "VCPKG_CRT_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic CRT linkage") + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(VCPKG_LIBRARY_LINKAGE dynamic PARENT_SCOPE) + message(STATUS "VCPKG_LIBRARY_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic library linkage") + endif() + else() + message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!") + endif() + endif() + set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE) +endfunction() diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index ec5ea05f57ce57..0be2dfc5405e29 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -53,11 +53,7 @@ function(vcpkg_fixup_cmake_targets) set(_vfct_TARGET_PATH share/${PORT}) endif() - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(EXECUTABLE_SUFFIX "\\.exe") - else() - set(EXECUTABLE_SUFFIX) - endif() + string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) @@ -173,6 +169,10 @@ function(vcpkg_fixup_cmake_targets) "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" _contents "${_contents}") + string(REGEX REPLACE + "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\.((\\\\|/)\\.\\.)*\" ABSOLUTE\\)" + "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" + _contents "${_contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}") file(WRITE ${MAIN_CMAKE} "${_contents}") diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 6acb51360bd56c..c39b1fbe9df314 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -8,6 +8,8 @@ ## [RELEASE_FILES ...] ## [DEBUG_FILES ...] ## [SYSTEM_LIBRARIES ...] +## [IGNORE_FLAGS ] +## [SKIP_CHECK] ## ) ## ``` ## @@ -20,10 +22,6 @@ ## Specifies a list of files to apply the fixes for debug paths. ## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ ## -## ### SYSTEM_PACKAGES -## If the *.pc file contains system packages outside vcpkg these need to be listed here. -## Since vcpkg checks the existence of all required packages within vcpkg. -## ## ### SYSTEM_LIBRARIES ## If the *.pc file contains system libraries outside vcpkg these need to be listed here. ## VCPKG checks every -l flag for the existence of the required library within vcpkg. @@ -31,238 +29,306 @@ ## ### IGNORE_FLAGS ## If the *.pc file contains flags in the lib field which are not libraries. These can be listed here ## +## ### SKIP_CHECK +## Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases. +## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them ## ## ## Examples -## ## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. -function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages _ignore_flags) - set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a;.a") - #message(STATUS "Checking configuration: ${_config}") + +include(vcpkg_escape_regex_control_characters) +function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config _system_libs _ignore_flags) + # Setup pkg-config paths + set(_VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") + set(_VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") + + set(PATH_SUFFIX_DEBUG /debug) + set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") + set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig") + + if(ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}") + endif() + + # First make sure everything is ok with the package and its deps + get_filename_component(_package_name "${_file}" NAME_WLE) + debug_message("Checking package (${_config}): ${_package_name}") + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed") + message(STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + # Get all required libs. --static means we get all libraries required for static linkage + # which is the worst case and includes the case without --static + # This retests already tested *.pc files since pkg-config will recursivly search for + # required packages and add there link flags to the one being tested + # as such NOT_STATIC_PKGCONFIG might be used to deactivate the --static arg to pkg-config + + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors ${PKGCONFIG_STATIC} --libs ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_libs_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs ${_package_name} failed") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_libs_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_libs_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --static --libs-only-L ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_lib_paths_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs-only-L ${_package_name} failed") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_lib_paths_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_lib_paths_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + string(REPLACE "\\ " "##" _pkg_lib_paths_output "${_pkg_lib_paths_output}") # Whitespace path protection + string(REGEX REPLACE "(^[\t ]*|[\t ]+)-L" ";" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + debug_message("-L LIST TRANSFORMATION:'${_pkg_lib_paths_output}'") + string(REGEX REPLACE "^[\t ]*;" "" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + string(REPLACE "##" "\\ " _pkg_lib_paths_output "${_pkg_lib_paths_output}") + + list(REMOVE_DUPLICATES _pkg_lib_paths_output) # We don't care about linker order and repeats + ## Remove search paths from LIBS + foreach(_search_path IN LISTS _pkg_lib_paths_output) + debug_message("REMOVING:'${_search_path}'") + debug_message("FROM:'${_pkg_libs_output}'") + vcpkg_escape_regex_control_characters(_search_path "${_search_path}") + string(REGEX REPLACE "(^[\t ]*|[\t ]+|;[\t ]*)-L${_search_path}([\t ]+|[\t ]*$)" ";" _pkg_libs_output "${_pkg_libs_output}") # Remove search paths from libs + endforeach() + debug_message("LIBS AFTER -L REMOVAL:'${_pkg_libs_output}'") + + #Make the remaining libs a proper CMake List + string(REPLACE "\\ " "##" _pkg_libs_output "${_pkg_libs_output}") # Whitespace path protection + string(REGEX REPLACE "(^[\t ]*|[\t ]+)-l" ";-l" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "[\t ]*(-pthreads?)" ";\\1" _pkg_libs_output "${_pkg_libs_output}") # handle pthread without -l here (makes a lot of problems otherwise) + string(REGEX REPLACE "^[\t ]*;[\t ]*" "" _pkg_libs_output "${_pkg_libs_output}") + string(REPLACE "##" "\\ " _pkg_libs_output "${_pkg_libs_output}") + + #Windows path transformations + if(CMAKE_HOST_WIN32) + string(REGEX REPLACE "(^|;)/([a-zA-Z])/" "\\1\\2:/" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + string(REGEX REPLACE " /([a-zA-Z])/" ";\\1:/" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "-l/([a-zA-Z])/" "-l\\1:/" _pkg_libs_output "${_pkg_libs_output}") + debug_message("pkg-config output lib paths after replacement (cmake style):${_pkg_lib_paths_output}") + debug_message("pkg-config output lib after replacement (cmake style):${_pkg_libs_output}") + endif() + if("${_config}" STREQUAL "DEBUG") - set(prefix "${CURRENT_INSTALLED_DIR}/debug/") - set(libprefix "${CURRENT_INSTALLED_DIR}/debug/lib/") - set(installprefix "${CURRENT_PACKAGES_DIR}/debug/") - set(installlibprefix "${CURRENT_PACKAGES_DIR}/debug/lib/") - set(lib_suffixes d _d _debug) + set(lib_suffixes d _d _debug -s -sd _s _sd -static -staticd _static _staticd) elseif("${_config}" STREQUAL "RELEASE") - set(prefix "${CURRENT_INSTALLED_DIR}") - set(libprefix "${CURRENT_INSTALLED_DIR}/lib/") - set(installprefix "${CURRENT_PACKAGES_DIR}/") - set(installlibprefix "${CURRENT_PACKAGES_DIR}/lib/") - set(lib_suffixes "") + set(lib_suffixes -s _s -static _static) else() message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") endif() - debug_message("Default library search paths: ${libprefix} --- ${installlibprefix} --- ${PKG_LIB_SEARCH_PATH}") - set(_contents "${${_contents_var}}") - #message(STATUS "Contents: ${_contents}") - set(_system_lib_normalized) - foreach(_system_lib ${_system_libs}) - string(REPLACE "-l" "" _system_lib "${_system_lib}") - list(APPEND _system_lib_normalized "${_system_lib}") + + debug_message("IGNORED FLAGS:'${_ignore_flags}'") + debug_message("BEFORE IGNORE FLAGS REMOVAL: ${_pkg_libs_output}") + foreach(_ignore IN LISTS _ignore_flags) # Remove ignore with whitespace + debug_message("REMOVING FLAG:'${_ignore}'") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_ignore}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + debug_message("AFTER REMOVAL: ${_pkg_libs_output}") endforeach() - ## Extra libraries: - string(REGEX MATCH "Libs:[^\n#]+" _libs "${_contents}") - #message(STATUS "LIB LINE: ${_libs}") - # The path to the library is either quoted and can not contain a quote or it is unqouted and cannot contain a single unescaped space - string(REGEX REPLACE "Libs:" "" _libs_list_tmp "${_libs}") - string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") - - string(REGEX MATCH "Libs.private:[^\n#]+" _libs_private "${_contents}") - string(REGEX REPLACE "Libs.private:" "" _libs_private_list_tmp "${_libs_private}") - string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") - - #message(STATUS "Found libraries: ${_libs_list_tmp}") - #message(STATUS "Found private libraries: ${_libs_private_list_tmp}") - list(APPEND _all_libs "${_libs_list_tmp}" "${_libs_private_list_tmp}") - list(REMOVE_DUPLICATES _all_libs) - foreach(_lib ${_all_libs}) - string(REGEX REPLACE "(^[\t ]+|[\t ]+$)" "" _lib "${_lib}") # Remove whitespaces at begin & end - if( "x${_lib}x" STREQUAL "xx") #Empty String - continue() - endif() - unset(CHECK_LIB CACHE) - unset(NO_CHECK_LIB) - #message(STATUS "CHECKING: x${_lib}z") - if("${_lib}" MATCHES "^-L((\\ |[^ ]+)+)$") - debug_message("Search path for libraries (unused): ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix + string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal + + debug_message("SYSTEM LIBRARIES:'${_system_libs}'") + debug_message("LIBRARIES in PC:'${_pkg_libs_output}'") + foreach(_system_lib IN LISTS _system_libs) # Remove system libs with whitespace + debug_message("REMOVING:'${_system_lib}'") + debug_message("FROM:'${_pkg_libs_output}'") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + string(TOLOWER "${_system_lib}" _system_lib_lower) + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + debug_message("AFTER REMOVAL:'${_pkg_libs_output}'") + endforeach() + list(REMOVE_DUPLICATES _pkg_libs_output) # We don't care about linker order and repeats + + string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal + + debug_message("Library search paths:${_pkg_lib_paths_output}") + debug_message("Libraries to search:${_pkg_libs_output}") + set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) + list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a) + foreach(_lib IN LISTS _pkg_libs_output) + if(EXISTS "${_lib}" OR "x${_lib}x" STREQUAL "xx" ) # eat; all ok _lib is a fullpath to a library or empty continue() - elseif("${_lib}" MATCHES [[^-l("[^"]+"|(\\ |[^ ]+)+)$]] ) - set(_libname ${CMAKE_MATCH_1}) - debug_message("Searching for library: ${_libname}") - #debug_message("System libraries: ${_system_libs}") - foreach(_system_lib ${_system_libs}) - string(REPLACE "^[\t ]*-l" "" _libname_norm "${_libname}") - string(REGEX REPLACE "[\t ]+$" "" _libname_norm "${_libname_norm}") - #debug_message("${_libname_norm} vs ${_system_lib}") - if("${_libname_norm}" MATCHES "${_system_lib}" OR "-l${_libname_norm}" MATCHES "${_system_lib}") - set(NO_CHECK_LIB ON) - debug_message("${_libname} is SYSTEM_LIBRARY") - break() - endif() - endforeach() - if(NO_CHECK_LIB) - break() + elseif (_lib MATCHES "^-l(.+)$") + debug_message("Library match: CMAKE_MATCH_1:${CMAKE_MATCH_1}") + set(_libname "${CMAKE_MATCH_1}") + if(EXISTS "${_libname}") + debug_message("${_libname} detected as an existing full path!") + continue() # fullpath in -l argument and exists; all ok endif() - #debug_message("Searching for library ${_libname} in ${libprefix}") - if(EXISTS "${_libname}") #full path - set(CHECK_LIB_${_libname} "${_libname}" CACHE INTERNAL FORCE) + debug_message("CHECK_LIB_${_libname}_${_config} before: ${CHECK_LIB_${_libname}_${_config}}") + find_library(CHECK_LIB_${_libname}_${_config} NAMES ${_libname} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) + debug_message("CHECK_LIB_${_libname}_${_config} after: ${CHECK_LIB_${_libname}_${_config}}") + if(CHECK_LIB_${_libname}_${_config}) + unset(CHECK_LIB_${_libname}_${_config} CACHE) # need to unset or else other configurations will not check correctly + debug_message("CHECK_LIB_${_libname}_${_config} after unset: ${CHECK_LIB_${_libname}_${_config}}") + continue() # found library; all ok endif() - find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}" NO_DEFAULT_PATH) - if(NOT CHECK_LIB_${_libname} AND "${_config}" STREQUAL "DEBUG") - #message(STATUS "Unable to locate ${_libname}. Trying with debug suffix") - foreach(_lib_suffix ${lib_suffixes}) - string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") - find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}") - if(CHECK_LIB_${_libname}) - message(FATAL_ERROR "Found ${CHECK_LIB_${_libname}} with additional debug suffix! Please correct the *.pc file!") - string(REGEX REPLACE "(-l${_name_without_extension})(\.dll\.a|\.a|\.lib|\.so)" "\\1${_lib_suffix}\\2" _contents ${_contents}) - endif() - endforeach() - if(NOT CHECK_LIB_${_libname}) - message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + debug_message("Searching with additional suffixes: '${lib_suffixes}'") + foreach(_lib_suffix IN LISTS lib_suffixes) + string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") + set(search_name ${_name_without_extension}${_lib_suffix}) + debug_message("Search name: '${search_name}'") + debug_message("CHECK_LIB_${search_name}_${_config} before: ${CHECK_LIB_${search_name}_${_config}}") + debug_message("Search paths:'${_pkg_lib_paths_output}' '${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib'") + find_library(CHECK_LIB_${search_name}_${_config} NAMES ${search_name} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) + debug_message("CHECK_LIB_${search_name}_${_config} after: ${CHECK_LIB_${search_name}_${_config}}") + if(CHECK_LIB_${search_name}_${_config}) + message(FATAL_ERROR "Found ${CHECK_LIB_${search_name}_${_config}} with additional '${_lib_suffix}' suffix! Please correct the *.pc file!") + unset(CHECK_LIB_${search_name}_${_config} CACHE) # need to unset or else other configurations will not check correctly endif() - elseif(NOT CHECK_LIB_${_libname}) - message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") - else() - debug_message("Found ${_libname} at ${CHECK_LIB_${_libname}}") - endif() - else() - #handle special cases - if(_lib STREQUAL "-pthread" OR _lib STREQUAL "-pthreads") - # Replace with VCPKG version? - #VCPKG should probably rename one of the pthread versions to avoid linking against system pthread? - # set(PTHREAD_SUFFIX ) - # if("${_config}" STREQUAL "DEBUG") - # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/debug/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3d.*") - # elseif("${_config}" STREQUAL "RELEASE") - # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3.*") - # endif() - # get_filename_component(PTHREAD_LIB "${PTHREAD_LIB}" NAME_WE) - # string(REPLACE "Libs: -pthread" "Libs: -L\${libdir} -l${PTHREAD_LIB}" _contents ${_contents}) - elseif(_lib STREQUAL _ignore_flags) - message(STATUS "${_lib} found in *.pc file and ignored!") - else() - message(FATAL_ERROR "Found ${_lib} and no rule to analyse the flag! Please check the *.pc file") - endif() + endforeach() + # Reaching here means error! + message(STATUS "CHECK_LIB_${_libname}_${_config}:${CHECK_LIB_${_libname}_${_config}}") + message(FATAL_ERROR "Library \"${_libname}\" was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file") + else () + message(FATAL_ERROR "Unhandled string \"${_lib}\" was found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file or add the case to vcpkg_fixup_pkgconfig") endif() - unset(CHECK_LIB_${_libname} CACHE) - unset(NO_CHECK_LIB) endforeach() - ## Packages: - string(REGEX MATCH "Requires:[^\n#]+" _pkg_list_tmp "${_contents}") - string(REGEX REPLACE "Requires:[\t ]" "" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" "" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE " " ";" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX MATCH "Requires.private:[^\n#]+" _pkg_private_list_tmp "${_contents}") - string(REGEX REPLACE "Requires.private:[\t ]" "" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]+" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - - debug_message("Required packages: ${_pkg_list_tmp}") - debug_message("Required private packages: ${_pkg_private_list_tmp}") - - #message(STATUS "System packages: ${_system_packages}") - foreach(_package ${_pkg_list_tmp} ${_pkg_private_list_tmp}) - debug_message("Searching for package: ${_package}") - set(PKG_CHECK ON) - if(NOT "${_system_packages}" STREQUAL "") - #message(STATUS "Checking ${_package} for SYSTEM PACKAGE: ${_system_packages}") - if("${_system_packages}" MATCHES "${_package}" ) - debug_message("Package ${_package} is SYSTEM PACKAGE!") - set(PKG_CHECK OFF) - endif() - endif() - if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc" OR EXISTS "${PKG_LIB_SEARCH_PATH}/pkgconfig/${_package}.pc")) - message(FATAL_ERROR "Package ${_package} not found! If it is a system package add it to the SYSTEM_PACKAGES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") - else() - debug_message("Found package ${_package}!") - endif() - endforeach() - ## Push modifications up in scope - set(${_contents_var} "${_contents}" PARENT_SCOPE) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) endfunction() function(vcpkg_fixup_pkgconfig) - cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) + cmake_parse_arguments(_vfpkg "SKIP_CHECK;NOT_STATIC_PKGCONFIG" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) + # Note about SYSTEM_PACKAGES: pkg-config requires all packages mentioned in pc files to exists. Otherwise pkg-config will fail to find the pkg. + # As such naming any SYSTEM_PACKAGES is damned to fail which is why it is not mentioned in the docs at the beginning. if(VCPKG_SYSTEM_LIBRARIES) list(APPEND _vfpkg_SYSTEM_LIBRARIES ${VCPKG_SYSTEM_LIBRARIES}) endif() - message(STATUS "Fixing pkgconfig") + + if(_vfpkg_NOT_STATIC_PKGCONFIG) + set(PKGCONFIG_STATIC) + else() + set(PKGCONFIG_STATIC --static) + endif() + if(_vfpkg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") endif() + vcpkg_escape_regex_control_characters(_vfpkg_ESCAPED_CURRENT_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") if(NOT _vfpkg_RELEASE_FILES) file(GLOB_RECURSE _vfpkg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc") - list(FILTER _vfpkg_RELEASE_FILES EXCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") + list(FILTER _vfpkg_RELEASE_FILES EXCLUDE REGEX "${_vfpkg_ESCAPED_CURRENT_PACKAGES_DIR}/debug/") endif() if(NOT _vfpkg_DEBUG_FILES) file(GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc") - list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") endif() - #Absolute Unix like paths + vcpkg_find_acquire_program(PKGCONFIG) + debug_message("Using pkg-config from: ${PKGCONFIG}") + + #Absolute Unix like paths string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}") - message(STATUS "Fixing pkgconfig - release") - debug_message("Files: ${_vfpkg_RELEASE_FILES}") + debug_message("Release Files: ${_vfpkg_RELEASE_FILES}") foreach(_file ${_vfpkg_RELEASE_FILES}) - message(STATUS "Checking file: ${_file}") + message(STATUS "Fixing pkgconfig file: ${_file}") get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") - string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") + #Correct *.pc file file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - - string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") - file(WRITE "${_file}" "${_contents}") + string(REGEX REPLACE "^prefix[\t ]*=[^\n]*" "" _contents "${_contents}") + string(REGEX REPLACE "[\n]prefix[\t ]*=[^\n]*" "" _contents "${_contents}") + file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() - message(STATUS "Fixing pkgconfig - debug") - debug_message("Files: ${_vfpkg_DEBUG_FILES}") + if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! + foreach(_file ${_vfpkg_RELEASE_FILES}) + vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "RELEASE" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") + endforeach() + endif() + + debug_message("Debug Files: ${_vfpkg_DEBUG_FILES}") foreach(_file ${_vfpkg_DEBUG_FILES}) - message(STATUS "Checking file: ${_file}") + message(STATUS "Fixing pkgconfig file: ${_file}") get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") + #Correct *.pc file file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - string(REPLACE "debug/include" "../include" _contents "${_contents}") string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") string(REPLACE "debug/share" "../share" _contents "${_contents}") string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword - - string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}(/debug)?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. - vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") - file(WRITE "${_file}" "${_contents}") + string(REGEX REPLACE "^prefix[\t ]*=[^\n]*" "" _contents "${_contents}") # make pc file relocatable + string(REGEX REPLACE "[\n]prefix[\t ]*=[^\n]*" "" _contents "${_contents}") # make pc file relocatable + string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. + file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() - message(STATUS "Fixing pkgconfig --- finished") + + if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! + foreach(_file ${_vfpkg_DEBUG_FILES}) + vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "DEBUG" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") + endforeach() + endif() + debug_message("Fixing pkgconfig --- finished") set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) # Variable to check if this function has been called! diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 05253289ea24b9..44581ac6f061f6 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -91,9 +91,22 @@ function(vcpkg_from_gitlab) set(VCPKG_USE_HEAD_VERSION OFF) endif() - string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) - string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) - + string(REPLACE "/" ";" GITLAB_REPO_LINK ${_vdud_REPO}) + + list(LENGTH GITLAB_REPO_LINK len) + if(${len} EQUAL "2") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}) + endif() + + if(${len} EQUAL "3") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 GROUP_NAME) + list(GET GITLAB_REPO_LINK 2 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${GROUP_NAME}/${REPO_NAME}) + endif() + # Handle --no-head scenarios if(NOT VCPKG_USE_HEAD_VERSION) if(NOT _vdud_REF) @@ -103,7 +116,7 @@ function(vcpkg_from_gitlab) string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") vcpkg_download_distfile(ARCHIVE - URLS "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" + URLS "${GITLAB_LINK}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" SHA512 "${_vdud_SHA512}" FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) @@ -120,7 +133,7 @@ function(vcpkg_from_gitlab) endif() # The following is for --head scenarios - set(URL "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") + set(URL "${GITLAB_LINK}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz") set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") @@ -151,7 +164,7 @@ function(vcpkg_from_gitlab) # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision _execute_process(COMMAND ${GIT} ls-remote - "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" + "${GITLAB_LINK}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output ) diff --git a/scripts/cmake/vcpkg_from_sourceforge.cmake b/scripts/cmake/vcpkg_from_sourceforge.cmake index 34b2a12b098acc..10dc8b623268eb 100644 --- a/scripts/cmake/vcpkg_from_sourceforge.cmake +++ b/scripts/cmake/vcpkg_from_sourceforge.cmake @@ -65,6 +65,34 @@ ## * [tinyfiledialogs](https://github.com/Microsoft/vcpkg/blob/master/ports/tinyfiledialogs/portfile.cmake) function(vcpkg_from_sourceforge) + macro(check_file_content) + if (EXISTS ${ARCHIVE}) + file(SIZE ${ARCHIVE} DOWNLOAD_FILE_SIZE) + if (DOWNLOAD_FILE_SIZE LESS_EQUAL 1024) + file(READ ${ARCHIVE} _FILE_CONTENT_) + string(FIND "${_FILE_CONTENT_}" "the Sourceforge site is currently in Disaster Recovery mode." OUT_CONTENT) + message("OUT_CONTENT: ${OUT_CONTENT}") + if (OUT_CONTENT EQUAL -1) + set(download_success 1) + else() + file(REMOVE ${ARCHIVE}) + endif() + endif() + endif() + endmacro() + + macro(check_file_sha512) + file(SHA512 ${ARCHIVE} FILE_HASH) + if(NOT FILE_HASH STREQUAL _vdus_SHA512) + message(FATAL_ERROR + "\nFile does not have expected hash:\n" + " File path: [ ${ARCHIVE} ]\n" + " Expected hash: [ ${_vdus_SHA512} ]\n" + " Actual hash: [ ${FILE_HASH} ]\n" + "${CUSTOM_ERROR_ADVICE}\n") + endif() + endmacro() + set(booleanValueArgs DISABLE_SSL NO_REMOVE_ONE_LEVEL) set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 FILENAME WORKING_DIRECTORY) set(multipleValuesArgs PATCHES) @@ -151,13 +179,15 @@ function(vcpkg_from_sourceforge) message(STATUS "Trying auto-select mirror...") vcpkg_download_distfile(ARCHIVE URLS "${DOWNLOAD_URL}" - SHA512 "${_vdus_SHA512}" + SKIP_SHA512 FILENAME "${_vdus_FILENAME}" SILENT_EXIT ) - - if (EXISTS ${ARCHIVE}) - set(download_success 1) + check_file_content() + if (download_success) + check_file_sha512() + else() + message(STATUS "The default mirror is in Disaster Recovery mode, trying other mirrors...") endif() if (NOT download_success EQUAL 1) @@ -166,13 +196,19 @@ function(vcpkg_from_sourceforge) message(STATUS "Trying mirror ${SOURCEFORGE_MIRROR}...") vcpkg_download_distfile(ARCHIVE URLS "${DOWNLOAD_URL}" - SHA512 "${_vdus_SHA512}" + SKIP_SHA512 FILENAME "${_vdus_FILENAME}" SILENT_EXIT ) if (EXISTS ${ARCHIVE}) set(download_success 1) + check_file_content() + if (download_success) + check_file_sha512() + else() + message(STATUS "Mirror ${SOURCEFORGE_MIRROR} is in Disaster Recovery mode, trying other mirrors...") + endif() break() endif() endforeach() diff --git a/scripts/cmake/vcpkg_prettify_command.cmake b/scripts/cmake/vcpkg_prettify_command.cmake index ca04f9120e18b9..c12332b7a5965b 100644 --- a/scripts/cmake/vcpkg_prettify_command.cmake +++ b/scripts/cmake/vcpkg_prettify_command.cmake @@ -16,10 +16,10 @@ macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR) set(${OUTPUT_VAR} "") foreach(v ${${INPUT_VAR}}) - if(${v} MATCHES "( )") - list(APPEND ${OUTPUT_VAR} \"${v}\") + if(v MATCHES "( )") + list(APPEND ${OUTPUT_VAR} "\"${v}\"") else() - list(APPEND ${OUTPUT_VAR} ${v}) + list(APPEND ${OUTPUT_VAR} "${v}") endif() endforeach() list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR}) diff --git a/scripts/test_ports/cmake/CONTROL b/scripts/test_ports/cmake/CONTROL new file mode 100644 index 00000000000000..8eb6a661f19099 --- /dev/null +++ b/scripts/test_ports/cmake/CONTROL @@ -0,0 +1,5 @@ +Source: cmake +Version: 3.18.1 +Build-Depends: qt5-base, qt5-winextras (windows), bzip2, expat, jsoncpp, liblzma, zlib, zstd, libarchive, curl, libuv, nghttp2 +Homepage: https://cmake.org/ +Description: CMake is an open-source, cross-platform family of tools designed to build, test and package software. diff --git a/scripts/test_ports/cmake/portfile.cmake b/scripts/test_ports/cmake/portfile.cmake new file mode 100644 index 00000000000000..932e1feed72859 --- /dev/null +++ b/scripts/test_ports/cmake/portfile.cmake @@ -0,0 +1,55 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.kitware.com/ + OUT_SOURCE_PATH SOURCE_PATH + REPO cmake/cmake + REF + 63a65baf4c343c73b2142078ef0045d3711dea1d + SHA512 + 7874b26adb739649ea3a8c2d8701b44ea348d5d6387e0e2a3dd87494dfeae62084593f88f46d53a161ac24c46a7712489621213b61315593df4dc2ccc728084b + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + #-DCMAKE_USE_SYSTEM_LIBRARIES=ON + -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON + -DCMAKE_USE_SYSTEM_CURL=ON + -DCMAKE_USE_SYSTEM_EXPAT=OFF # CMake is not compatible with expat 2.2.9 + -DCMAKE_USE_SYSTEM_ZLIB=ON + -DCMAKE_USE_SYSTEM_BZIP2=ON + -DCMAKE_USE_SYSTEM_ZSTD=ON + -DCMAKE_USE_SYSTEM_FORM=ON + -DCMAKE_USE_SYSTEM_JSONCPP=ON + -DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG + -DCMAKE_USE_SYSTEM_LIBUV=ON + -DBUILD_QtDialog=ON # Just to test Qt with CMake +) + +vcpkg_install_cmake(ADD_BIN_TO_PATH) +vcpkg_copy_pdbs() + +if(NOT VCPKG_TARGET_IS_OSX) + set(_tools cmake cmake-gui ctest cpack) + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _tools cmcldeps) + endif() + vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN) +else() + # On OSX everything is within a CMake.app folder + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) + file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app") + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/debug) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app") + endif() +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + +# Handle copyright +configure_file(${SOURCE_PATH}/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/scripts/test_ports/vcpkg-ci-paraview/CONTROL b/scripts/test_ports/vcpkg-ci-paraview/CONTROL new file mode 100644 index 00000000000000..d4816dbf383660 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-paraview/CONTROL @@ -0,0 +1,6 @@ +Source: vcpkg-ci-paraview +Version: 1 +Port-Version: 1 +Homepage: https://github.com/microsoft/vcpkg +Description: Port to force features of certain ports within CI +Build-Depends: paraview[vtkm, tools] diff --git a/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake b/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake new file mode 100644 index 00000000000000..0015715fb66c72 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/scripts/test_ports/vcpkg-find-acquire-program/CONTROL b/scripts/test_ports/vcpkg-find-acquire-program/CONTROL new file mode 100644 index 00000000000000..6f248be58aff52 --- /dev/null +++ b/scripts/test_ports/vcpkg-find-acquire-program/CONTROL @@ -0,0 +1,4 @@ +Source: vcpkg-find-acquire-program +Version: 0 +Description: Test port to exercise vcpkg_find_acquire_program +Supports: windows diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake new file mode 100644 index 00000000000000..88a4856c5f5e1c --- /dev/null +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -0,0 +1,21 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +if(CMAKE_HOST_WIN32) + foreach(PROG GO JOM NASM PERL YASM GIT PYTHON3 PYTHON2 RUBY 7Z NUGET FLEX BISON GPERF GASPREPROCESSOR DARK SCONS SWIG DOXYGEN ARIA2 PKGCONFIG) + vcpkg_find_acquire_program(${PROG}) + foreach(SUBPROG IN LISTS ${PROG}) + if(NOT EXISTS "${SUBPROG}") + message(FATAL_ERROR "Program ${SUBPROG} did not exist.") + endif() + endforeach() + endforeach() +endif() + +foreach(PROG GN NINJA MESON BAZEL) + vcpkg_find_acquire_program(${PROG}) + foreach(SUBPROG IN LISTS ${PROG}) + if(NOT EXISTS "${SUBPROG}") + message(FATAL_ERROR "Program ${SUBPROG} did not exist.") + endif() + endforeach() +endforeach() diff --git a/scripts/toolchains/android.cmake b/scripts/toolchains/android.cmake index 8ffe9fbbc478f9..6f6c98507a7ee0 100644 --- a/scripts/toolchains/android.cmake +++ b/scripts/toolchains/android.cmake @@ -5,13 +5,13 @@ set(ANDROID_TOOLCHAIN clang CACHE STRING "") set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "") set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "") -if (VCPKG_TARGET_TRIPLET STREQUAL "arm64-android") +if (VCPKG_TARGET_TRIPLET MATCHES "^arm64-android") set(ANDROID_ABI arm64-v8a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "arm-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-android") set(ANDROID_ABI armeabi-v7a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "x64-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^x64-android") set(ANDROID_ABI x86_64 CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "x86-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^x86-android") set(ANDROID_ABI x86 CACHE STRING "") else() message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}") @@ -26,7 +26,11 @@ endif() if(DEFINED ENV{ANDROID_NDK_HOME}) set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME}) else() - set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") + set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") + if(NOT EXISTS "${ANDROID_NDK_HOME}") + # Use Xamarin default installation folder + set(ANDROID_NDK_HOME "$ENV{ProgramFiles\(x86\)}/Android/android-sdk/ndk-bundle") + endif() endif() if(NOT EXISTS "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") @@ -39,14 +43,18 @@ if(NOT _VCPKG_ANDROID_TOOLCHAIN) set(_VCPKG_ANDROID_TOOLCHAIN 1) get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if(NOT _CMAKE_IN_TRY_COMPILE) - string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") - string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") - string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") - string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") - string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ") - string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ") - - string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") - string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_C_FLAGS " -fPIC ${VCPKG_C_FLAGS} ") + string(APPEND CMAKE_CXX_FLAGS " -fPIC ${VCPKG_CXX_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_DEBUG " ${VCPKG_C_FLAGS_DEBUG} ") + string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${VCPKG_CXX_FLAGS_DEBUG} ") + string(APPEND CMAKE_C_FLAGS_RELEASE " ${VCPKG_C_FLAGS_RELEASE} ") + string(APPEND CMAKE_CXX_FLAGS_RELEASE " ${VCPKG_CXX_FLAGS_RELEASE} ") + + string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/freebsd.cmake b/scripts/toolchains/freebsd.cmake index b6bf5a4791c2fa..4b1cc3e8c3b4d0 100644 --- a/scripts/toolchains/freebsd.cmake +++ b/scripts/toolchains/freebsd.cmake @@ -16,5 +16,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/ios.cmake b/scripts/toolchains/ios.cmake index b93cdbb8aee788..f173662c0266c4 100644 --- a/scripts/toolchains/ios.cmake +++ b/scripts/toolchains/ios.cmake @@ -52,5 +52,9 @@ if(NOT _VCPKG_IOS_TOOLCHAIN) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index 0c1e15ef13b872..f0fd6df3e0f7ab 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -27,5 +27,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ") endif() + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/mingw.cmake b/scripts/toolchains/mingw.cmake index def98799fea466..e61527db10b82b 100644 --- a/scripts/toolchains/mingw.cmake +++ b/scripts/toolchains/mingw.cmake @@ -36,5 +36,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ") endif() + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/osx.cmake b/scripts/toolchains/osx.cmake index 7f6487c4091a53..1ab3da5e5d442f 100644 --- a/scripts/toolchains/osx.cmake +++ b/scripts/toolchains/osx.cmake @@ -24,5 +24,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ") endif() endif() diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 160e9d9341f729..954f95535dd93e 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -22,20 +22,20 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "") - + unset(CHARSET_FLAG) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "") set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "") - + string(APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE_INIT " /nologo ") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") - + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "") + string(APPEND CMAKE_STATIC_LINKER_FLAGS_DEBUG_INIT " /nologo ") - string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " /nologo ") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " /nologo ") + string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ") endif() endif() diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fed4af09beebf5..c9b7a209c4e237 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -134,10 +134,10 @@ ninja-freebsd-1.8.2.zip - 6.2.1 + 7.0.3 pwsh.exe - https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip - ab1effc926b000a6adc12198a1886514ec203621a53b0cd7ec1cd9a8225dccda7e857feaabcfba4004bea73129b986abaad777c4573f44e0af70411226ce08b0 - PowerShell-6.2.1-win-x86.zip + https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x86.zip + 2e410fc5e429fc6ad478976eff3efcffe9d53a0620c7c31c2b8bfe1f0976cade74632fc202bf58959cec111f03b824ba42ad4d74c8a66d67ec21bbfe9b9c626d + PowerShell-7.0.3-win-x86.zip diff --git a/scripts/vcpkg_get_tags.cmake b/scripts/vcpkg_get_tags.cmake index 35e89149ba6cf0..bec5d933120786 100644 --- a/scripts/vcpkg_get_tags.cmake +++ b/scripts/vcpkg_get_tags.cmake @@ -11,6 +11,7 @@ VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET} VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH} VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE} VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE} +VCPKG_LIBRARY_LINKAGE=${VCPKG_LIBRARY_LINKAGE} e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f") # Just to enforce the user didn't set it in the triplet file diff --git a/toolsrc/.clang-format b/toolsrc/.clang-format index 6c32a733ae18c4..374a4233e6380a 100644 --- a/toolsrc/.clang-format +++ b/toolsrc/.clang-format @@ -40,11 +40,15 @@ IncludeCategories: Priority: -1 - Regex: '^$' Priority: 1 - - Regex: '^$' + - Regex: '^$' Priority: 2 - - Regex: '^$' + - Regex: '^$' Priority: 3 - - Regex: '^<[a-z0-9_]*\.h>$' + - Regex: '^$' Priority: 4 - - Regex: '^<[a-z0-9_]*>$' # C++ standard library + - Regex: '^$' Priority: 5 + - Regex: '^<[a-z0-9_]*\.h>$' + Priority: 6 + - Regex: '^<[a-z0-9_]*>$' # C++ standard library + Priority: 7 diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 10a280faacbd30..aa54a791b56feb 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -1,161 +1,173 @@ -cmake_minimum_required(VERSION 3.14) - -project(vcpkg CXX) -include(cmake/utilities.cmake) - -# =============== -# === Options === -# =============== - -include(CMakeDependentOption) - -option(BUILD_TESTING "Option for enabling testing" ON) -option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) -option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) -option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) -option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) -option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) - -CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF - "BUILD_TESTING" OFF) - -if(WERROR) - message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") -endif() -if(DEFINE_DISABLE_METRICS) - message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") - set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) -endif() - -vcpkg_detect_compiler() -vcpkg_detect_standard_library() -vcpkg_detect_std_filesystem() - -# ====================== -# === Compiler Flags === -# ====================== - -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 17) - -if(MSVC) - # either MSVC, or clang-cl - add_compile_options(-FC) - - if (MSVC_VERSION GREATER 1900) - # Visual Studio 2017 or later - add_compile_options(-permissive- -utf-8) - endif() - - if(VCPKG_DEVELOPMENT_WARNINGS) - string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - add_compile_options(-W4) - if(VCPKG_COMPILER STREQUAL "clang") - add_compile_options(-Wmissing-prototypes -Wno-missing-field-initializers) - else() - add_compile_options(-analyze) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - add_compile_options(-WX) - endif() -else() - if(VCPKG_DEVELOPMENT_WARNINGS) - add_compile_options(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) - - # GCC and clang have different names for the same warning - if(VCPKG_COMPILER STREQUAL "gcc") - add_compile_options(-Wmissing-declarations) - elseif(VCPKG_COMPILER STREQUAL "clang") - add_compile_options(-Wmissing-prototypes) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - add_compile_options(-Werror) - endif() -endif() - -# ======================== -# === System Libraries === -# ======================== - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) -link_libraries(Threads::Threads) - -add_compile_definitions(VCPKG_USE_STD_FILESYSTEM=$) -if(VCPKG_REQUIRE_LINK_CXXFS) - if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") - link_libraries(stdc++fs) - elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") - link_libraries(c++fs) - endif() -endif() - -if (MINGW) - add_compile_definitions( - UNICODE - _WIN32_WINNT=0x0601 - WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 - __fastfail=exit) - link_libraries(winhttp bcrypt version ole32 uuid) -endif() - - -# =============== -# === Targets === -# =============== - -add_compile_definitions(VCPKG_DISABLE_METRICS=$) -include_directories(include) -file(GLOB_RECURSE VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) -add_library(vcpkglib OBJECT ${VCPKGLIB_SOURCES}) - -add_executable(vcpkg src/vcpkg.cpp $) -if(WIN32 AND NOT VCPKG_DISABLE_METRICS) - add_executable(vcpkgmetricsuploader WIN32 src/vcpkgmetricsuploader.cpp $) -endif() - -if (BUILD_TESTING) - file(GLOB_RECURSE VCPKGTEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) - - enable_testing() - add_executable(vcpkg-test ${VCPKGTEST_SOURCES} $) - add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) - - if (VCPKG_BUILD_BENCHMARKING) - target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) - endif() -endif() - -if(VCPKG_BUILD_FUZZING) - file(GLOB_RECURSE VCPKGFUZZ_SOURCES src/vcpkg-fuzz/*.cpp) - add_executable(vcpkg-fuzz ${VCPKGFUZZ_SOURCES} $) -endif() - -find_program(CLANG_FORMAT clang-format) -if(CLANG_FORMAT) - file(GLOB_RECURSE VCPKG_FORMAT_SOURCES CONFIGURE_DEPENDS src/*.cpp include/pch.h include/vcpkg/*.h include/vcpkg-test/*.h) - add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FORMAT_SOURCES}) -endif() - -# =========== -# === PCH === -# =========== - -if(MSVC) - get_target_property(_srcs vcpkglib SOURCES) - - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() - - set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") - target_sources(vcpkglib PRIVATE src/pch.cpp) - target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) -endif() +cmake_minimum_required(VERSION 3.14) + +project(vcpkg CXX) +include(cmake/utilities.cmake) + +# =============== +# === Options === +# =============== + +include(CMakeDependentOption) + +option(BUILD_TESTING "Option for enabling testing" ON) +option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) +option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) +option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) +option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) +option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) + +CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF + "BUILD_TESTING" OFF) + +if(WERROR) + message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") +endif() +if(DEFINE_DISABLE_METRICS) + message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") + set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) +endif() + +# ============= +# === Files === +# ============= + +file(GLOB VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) +file(GLOB VCPKGLIB_BASE_SOURCES CONFIGURE_DEPENDS src/vcpkg/base/*.cpp) +file(GLOB VCPKGLIB_INCLUDES CONFIGURE_DEPENDS include/vcpkg/*.h include/vcpkg/fwd/*.h) +file(GLOB VCPKGLIB_BASE_INCLUDES CONFIGURE_DEPENDS include/vcpkg/base/*.h include/vcpkg/base/fwd/*.h) + +set(VCPKG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkg.cpp) + +set(VCPKGMETRICSUPLOADER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkgmetricsuploader.cpp) + +file(GLOB VCPKG_TEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) +file(GLOB VCPKG_TEST_INCLUDES CONFIGURE_DEPENDS include/vcpkg-test/*.h) + +file(GLOB VCPKG_FUZZ_SOURCES CONFIGURE_DEPENDS src/vcpkg-fuzz/*.cpp) + +# ======================== +# === System detection === +# ======================== + +vcpkg_detect_compiler() +vcpkg_detect_standard_library() +vcpkg_detect_std_filesystem() + +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) +if(MSVC) + string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +endif() + +# =============== +# === Targets === +# =============== + +# === Target: vcpkglib === + +add_library(vcpkglib + ${VCPKGLIB_BASE_SOURCES} + ${VCPKGLIB_SOURCES} + ${VCPKGLIB_BASE_INCLUDES} + ${VCPKGLIB_INCLUDES}) +target_include_directories(vcpkglib PUBLIC include) + +vcpkg_target_add_warning_options(vcpkglib) +target_compile_definitions(vcpkglib PUBLIC + VCPKG_USE_STD_FILESYSTEM=$) + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +target_link_libraries(vcpkglib PRIVATE Threads::Threads) + +if(VCPKG_CXXFS_LIBRARY) + target_link_libraries(vcpkglib PRIVATE ${VCPKG_CXXFS_LIBRARY}) +endif() + +if(MSVC) + get_target_property(_srcs vcpkglib SOURCES) + + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") + set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + endif() + + set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") + target_sources(vcpkglib PRIVATE src/pch.cpp) + target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) +else() + target_compile_options(vcpkglib PRIVATE -include "${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h") +endif() + +if (MINGW) + target_compile_definitions(vcpkglib + PUBLIC + UNICODE + _WIN32_WINNT=0x0601 + WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 + __fastfail=exit) + target_link_libraries(vcpkglib PUBLIC winhttp bcrypt version ole32 uuid) +endif() + +# === Target: vcpkg === + +add_executable(vcpkg ${VCPKG_SOURCES}) +target_link_libraries(vcpkg PRIVATE vcpkglib) +vcpkg_target_add_warning_options(vcpkg) + +# === Target: vcpkgmetricsuploader === + +if(WIN32 AND NOT VCPKG_DISABLE_METRICS) + add_executable(vcpkgmetricsuploader WIN32 ${VCPKGMETRICSUPLOADER_SOURCES}) + target_link_libraries(vcpkgmetricsuploader PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkgmetricsuploader) +endif() + +# === Target: vcpkg-test === + +if (BUILD_TESTING) + enable_testing() + + add_executable(vcpkg-test + ${VCPKG_TEST_SOURCES} + ${VCPKG_TEST_INCLUDES}) + target_link_libraries(vcpkg-test PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkg-test) + + add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) + + if (VCPKG_BUILD_BENCHMARKING) + target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) + endif() +endif() + +# === Target: vcpkg-fuzz === + +if(VCPKG_BUILD_FUZZING) + add_executable(vcpkg-fuzz ${VCPKG_FUZZ_SOURCES}) + target_link_libraries(vcpkg-fuzz PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkg-fuzz) +endif() + +# === Target: format === + +find_program(CLANG_FORMAT clang-format) +if(CLANG_FORMAT) + # doing all of these formats in one line has a tendency to overflow the command line length + add_custom_target(format + COMMAND ${CLANG_FORMAT} -i -verbose ${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_BASE_SOURCES} + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_SOURCES} + COMMAND ${CLANG_FORMAT} -i -verbose ${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_BASE_INCLUDES} + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_INCLUDES} + + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_SOURCES} + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGMETRICSUPLOADER_SOURCES} + + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_TEST_SOURCES} + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_TEST_INCLUDES} + + COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FUZZ_SOURCES}) +endif() diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake index b99063a658ad9c..429a86f5f07c71 100644 --- a/toolsrc/cmake/utilities.cmake +++ b/toolsrc/cmake/utilities.cmake @@ -77,7 +77,7 @@ int main() {} _VCPKG_STANDARD_LIBRARY_LIBCXX) check_cxx_source_compiles([[ #include -#if !defined(_MSVC_STL_VERSION) +#if !defined(_MSVC_STL_VERSION) && !(defined(_MSC_VER) && _MSC_VER <= 1900) #error "not MSVC stl" #endif int main() {} @@ -101,7 +101,7 @@ int main() {} endif() endfunction() -# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_REQUIRE_LINK_CXXFS +# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_CXXFS_LIBRARY function(vcpkg_detect_std_filesystem) vcpkg_detect_standard_library() @@ -129,10 +129,14 @@ int main() {} int main() {} ]] _VCPKG_USE_STD_FILESYSTEM) + + if(_VCPKG_REQUIRE_LINK_CXXFS) + set(_VCPKG_CXXFS_LIBRARY "stdc++fs") + endif() elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") # AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0 - set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + set(_VCPKG_CXXFS_LIBRARY OFF) else() check_cxx_source_compiles([[ #include @@ -142,6 +146,10 @@ int main() {} int main() {} ]] _VCPKG_REQUIRE_LINK_CXXFS) + + if(_VCPKG_REQUIRE_LINK_CXXFS) + set(_VCPKG_CXXFS_LIBRARY "c++fs") + endif() endif() # We don't support versions of libc++ < 7.0.0, and libc++ 7.0.0 has @@ -155,16 +163,16 @@ int main() {} int main() {}" _VCPKG_USE_STD_FILESYSTEM) - set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + set(_VCPKG_CXXFS_LIBRARY OFF) endif() set(VCPKG_USE_STD_FILESYSTEM ${_VCPKG_USE_STD_FILESYSTEM} CACHE BOOL "Whether to use , as opposed to " FORCE) - set(VCPKG_REQUIRE_LINK_CXXFS ${_VCPKG_REQUIRE_LINK_CXXFS} - CACHE BOOL - "Whether it's required to pass -l[std]c++fs in order to use " + set(VCPKG_CXXFS_LIBRARY ${_VCPKG_CXXFS_LIBRARY} + CACHE STRING + "Library to link (if any) in order to use " FORCE) if(VCPKG_USE_STD_FILESYSTEM) @@ -172,10 +180,54 @@ int main() {} else() set(msg "") endif() - if(VCPKG_REQUIRE_LINK_CXXFS) - set(msg "${msg} with -l[std]c++fs") + if(VCPKG_CXXFS_LIBRARY) + set(msg "${msg} with -l${VCPKG_CXXFS_LIBRARY}") endif() message(STATUS "Detecting how to use the C++ filesystem library - ${msg}") endif() endfunction() + +function(vcpkg_target_add_warning_options TARGET) + if(MSVC) + # either MSVC, or clang-cl + target_compile_options(${TARGET} PRIVATE -FC) + + if (MSVC_VERSION GREATER 1900) + # Visual Studio 2017 or later + target_compile_options(${TARGET} PRIVATE -permissive- -utf-8) + endif() + + if(VCPKG_DEVELOPMENT_WARNINGS) + target_compile_options(${TARGET} PRIVATE -W4) + if(VCPKG_COMPILER STREQUAL "clang") + target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes -Wno-missing-field-initializers) + else() + target_compile_options(${TARGET} PRIVATE -analyze) + endif() + else() + target_compile_options(${TARGET} PRIVATE -W3) + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + target_compile_options(${TARGET} PRIVATE -WX) + endif() + else() + if(VCPKG_DEVELOPMENT_WARNINGS) + target_compile_options(${TARGET} PRIVATE + -Wall -Wextra -Wpedantic + -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) + + # GCC and clang have different names for the same warning + if(VCPKG_COMPILER STREQUAL "gcc") + target_compile_options(${TARGET} PRIVATE -Wmissing-declarations) + elseif(VCPKG_COMPILER STREQUAL "clang") + target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes) + endif() + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + target_compile_options(${TARGET} PRIVATE -Werror) + endif() + endif() +endfunction() diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj deleted file mode 100644 index 960374bffd18cb..00000000000000 --- a/toolsrc/dirs.proj +++ /dev/null @@ -1,20 +0,0 @@ - - - $(MSBuildThisFileDirectory) - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index f92792411c9da5..c8ca1ea7c22f5d 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -2,6 +2,7 @@ #include +#include #include #if defined(_WIN32) @@ -23,14 +24,6 @@ #include #include #include - -#if VCPKG_USE_STD_FILESYSTEM -#include -#else -#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING -#include -#endif - #include #include #include diff --git a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h index 482f9ea400dcb9..15b24b8d05027c 100644 --- a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h +++ b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h @@ -19,7 +19,7 @@ namespace vcpkg::Test { for (auto&& spec : specs) tag_vars[spec.package_spec] = {}; - Util::unused(port_provider); + (void)(port_provider); } Optional&> get_generic_triplet_vars( diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h index ce403c308095d8..d2c512f9bf0eae 100644 --- a/toolsrc/include/vcpkg-test/util.h +++ b/toolsrc/include/vcpkg-test/util.h @@ -18,6 +18,22 @@ } \ } while (0) +namespace Catch +{ + template<> + struct StringMaker + { + static std::string convert(vcpkg::FullPackageSpec const& value) + { + return vcpkg::Strings::concat(value.package_spec.name(), + '[', + vcpkg::Strings::join(",", value.features), + "]:", + value.package_spec.triplet()); + } + }; +} + namespace vcpkg::Test { std::unique_ptr make_control_file( @@ -48,6 +64,12 @@ namespace vcpkg::Test const char* depends = "", const char* triplet = "x86-windows"); + extern const Triplet X86_WINDOWS; + extern const Triplet X64_WINDOWS; + extern const Triplet X86_UWP; + extern const Triplet ARM_UWP; + extern const Triplet X64_ANDROID; + /// /// Map of source control files by their package name. /// @@ -55,7 +77,7 @@ namespace vcpkg::Test { std::unordered_map map; Triplet triplet; - PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) { } + PackageSpecMap(Triplet t = X86_WINDOWS) noexcept : triplet(t) { } PackageSpec emplace(const char* name, const char* depends = "", diff --git a/toolsrc/include/vcpkg/archives.h b/toolsrc/include/vcpkg/archives.h index 073217064b1fb1..be2523dfb980cd 100644 --- a/toolsrc/include/vcpkg/archives.h +++ b/toolsrc/include/vcpkg/archives.h @@ -1,8 +1,8 @@ #pragma once -#include +#include -#include +#include namespace vcpkg::Archives { diff --git a/toolsrc/include/vcpkg/base/expected.h b/toolsrc/include/vcpkg/base/expected.h index d8a2cacaa00133..fcf37bcaf24395 100644 --- a/toolsrc/include/vcpkg/base/expected.h +++ b/toolsrc/include/vcpkg/base/expected.h @@ -4,6 +4,7 @@ #include #include +#include namespace vcpkg { @@ -111,7 +112,7 @@ namespace vcpkg ExpectedT(S&& s, ExpectedRightTag = {}) : m_s(std::move(s)) { } ExpectedT(const T& t, ExpectedLeftTag = {}) : m_t(t) { } - template>> + template::value>> ExpectedT(T&& t, ExpectedLeftTag = {}) : m_t(std::move(t)) { } diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index a202bfdef48d60..08bbe790651463 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -2,11 +2,17 @@ #include #include +#include + +#include + +#if !defined(VCPKG_USE_STD_FILESYSTEM) +#error The build system must set VCPKG_USE_STD_FILESYSTEM. +#endif // !defined(VCPKG_USE_STD_FILESYSTEM) #if VCPKG_USE_STD_FILESYSTEM #include #else -#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include #endif @@ -22,7 +28,28 @@ namespace fs using stdfs::directory_iterator; using stdfs::path; using stdfs::perms; - using stdfs::u8path; + + path u8path(vcpkg::StringView s); + inline path u8path(const char* first, const char* last) { return u8path(vcpkg::StringView{first, last}); } + inline path u8path(const char* s) { return u8path(vcpkg::StringView{s, s + ::strlen(s)}); } + +#if defined(_MSC_VER) + inline path u8path(std::string::const_iterator first, std::string::const_iterator last) + { + if (first == last) + { + return path{}; + } + else + { + auto firstp = &*first; + return u8path(vcpkg::StringView{firstp, firstp + (last - first)}); + } + } +#endif + + std::string u8string(const path& p); + std::string generic_u8string(const path& p); #if defined(_WIN32) enum class file_type @@ -130,7 +157,7 @@ namespace vcpkg::Files /// Read text lines from a file /// Lines will have up to one trailing carriage-return character stripped (CRLF) virtual Expected> read_lines(const fs::path& file_path) const = 0; - virtual fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename) const = 0; + virtual fs::path find_file_recursively_up(const fs::path& starting_dir, const fs::path& filename) const = 0; virtual std::vector get_files_recursive(const fs::path& dir) const = 0; virtual std::vector get_files_non_recursive(const fs::path& dir) const = 0; void write_lines(const fs::path& file_path, const std::vector& lines, LineInfo linfo); diff --git a/toolsrc/include/vcpkg/base/fwd/json.h b/toolsrc/include/vcpkg/base/fwd/json.h new file mode 100644 index 00000000000000..73826127ccba03 --- /dev/null +++ b/toolsrc/include/vcpkg/base/fwd/json.h @@ -0,0 +1,44 @@ +#pragma once + +#include +#include +#include + +namespace vcpkg::Json +{ + struct JsonStyle; + enum class ValueKind : int; + struct Value; + struct Object; + struct Array; + + struct ReaderError; + struct BasicReaderError; + struct Reader; + + // This is written all the way out so that one can include a subclass in a header + template + struct IDeserializer + { + using type = Type; + virtual StringView type_name() const = 0; + + virtual Span valid_fields() const; + + virtual Optional visit_null(Reader&); + virtual Optional visit_boolean(Reader&, bool); + virtual Optional visit_integer(Reader& r, int64_t i); + virtual Optional visit_number(Reader&, double); + virtual Optional visit_string(Reader&, StringView); + virtual Optional visit_array(Reader&, const Array&); + virtual Optional visit_object(Reader&, const Object&); + + protected: + IDeserializer() = default; + IDeserializer(const IDeserializer&) = default; + IDeserializer& operator=(const IDeserializer&) = default; + IDeserializer(IDeserializer&&) = default; + IDeserializer& operator=(IDeserializer&&) = default; + virtual ~IDeserializer() = default; + }; +} diff --git a/toolsrc/include/vcpkg/base/fwd/optional.h b/toolsrc/include/vcpkg/base/fwd/optional.h new file mode 100644 index 00000000000000..2c3a7ea6c70b07 --- /dev/null +++ b/toolsrc/include/vcpkg/base/fwd/optional.h @@ -0,0 +1,7 @@ +#pragma once + +namespace vcpkg +{ + template + struct Optional; +} diff --git a/toolsrc/include/vcpkg/base/fwd/span.h b/toolsrc/include/vcpkg/base/fwd/span.h new file mode 100644 index 00000000000000..af78aa642a9457 --- /dev/null +++ b/toolsrc/include/vcpkg/base/fwd/span.h @@ -0,0 +1,7 @@ +#pragma once + +namespace vcpkg +{ + template + struct Span; +} diff --git a/toolsrc/include/vcpkg/base/fwd/stringview.h b/toolsrc/include/vcpkg/base/fwd/stringview.h new file mode 100644 index 00000000000000..e297fd43b4ba6f --- /dev/null +++ b/toolsrc/include/vcpkg/base/fwd/stringview.h @@ -0,0 +1,6 @@ +#pragma once + +namespace vcpkg +{ + struct StringView; +} diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h index 3195c223a72601..54f84f611de0d6 100644 --- a/toolsrc/include/vcpkg/base/json.h +++ b/toolsrc/include/vcpkg/base/json.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -64,10 +66,7 @@ namespace vcpkg::Json int indent = 2; }; - struct Array; - struct Object; - - enum class ValueKind + enum class ValueKind : int { Null, Boolean, @@ -81,18 +80,17 @@ namespace vcpkg::Json namespace impl { struct ValueImpl; - struct SyntaxErrorImpl; } struct Value { Value() noexcept; // equivalent to Value::null() Value(Value&&) noexcept; + Value(const Value&); Value& operator=(Value&&) noexcept; + Value& operator=(const Value&); ~Value(); - Value clone() const noexcept; - ValueKind kind() const noexcept; bool is_null() const noexcept; @@ -122,9 +120,14 @@ namespace vcpkg::Json static Value boolean(bool) noexcept; static Value integer(int64_t i) noexcept; static Value number(double d) noexcept; - static Value string(StringView) noexcept; + static Value string(std::string s) noexcept; static Value array(Array&&) noexcept; + static Value array(const Array&) noexcept; static Value object(Object&&) noexcept; + static Value object(const Object&) noexcept; + + friend bool operator==(const Value& lhs, const Value& rhs); + friend bool operator!=(const Value& lhs, const Value& rhs) { return !(lhs == rhs); } private: friend struct impl::ValueImpl; @@ -138,14 +141,12 @@ namespace vcpkg::Json public: Array() = default; - Array(Array const&) = delete; + Array(Array const&) = default; Array(Array&&) = default; - Array& operator=(Array const&) = delete; + Array& operator=(Array const&) = default; Array& operator=(Array&&) = default; ~Array() = default; - Array clone() const noexcept; - using iterator = underlying_t::iterator; using const_iterator = underlying_t::const_iterator; @@ -177,37 +178,45 @@ namespace vcpkg::Json const_iterator cbegin() const { return underlying_.cbegin(); } const_iterator cend() const { return underlying_.cend(); } + friend bool operator==(const Array& lhs, const Array& rhs); + friend bool operator!=(const Array& lhs, const Array& rhs) { return !(lhs == rhs); } + private: underlying_t underlying_; }; struct Object { private: - using underlying_t = std::vector>; + using value_type = std::pair; + using underlying_t = std::vector; underlying_t::const_iterator internal_find_key(StringView key) const noexcept; public: // these are here for better diagnostics Object() = default; - Object(Object const&) = delete; + Object(Object const&) = default; Object(Object&&) = default; - Object& operator=(Object const&) = delete; + Object& operator=(Object const&) = default; Object& operator=(Object&&) = default; ~Object() = default; - Object clone() const noexcept; - // asserts if the key is found Value& insert(std::string key, Value&& value); + Value& insert(std::string key, const Value& value); Object& insert(std::string key, Object&& value); + Object& insert(std::string key, const Object& value); Array& insert(std::string key, Array&& value); + Array& insert(std::string key, const Array& value); // replaces the value if the key is found, otherwise inserts a new // value. Value& insert_or_replace(std::string key, Value&& value); + Value& insert_or_replace(std::string key, const Value& value); Object& insert_or_replace(std::string key, Object&& value); + Object& insert_or_replace(std::string key, const Object& value); Array& insert_or_replace(std::string key, Array&& value); + Array& insert_or_replace(std::string key, const Array& value); // returns whether the key existed bool remove(StringView key) noexcept; @@ -216,13 +225,13 @@ namespace vcpkg::Json Value& operator[](StringView key) noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); return *res; } const Value& operator[](StringView key) const noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); return *res; } @@ -231,8 +240,12 @@ namespace vcpkg::Json bool contains(StringView key) const noexcept { return this->get(key); } + bool is_empty() const noexcept { return size() == 0; } std::size_t size() const noexcept { return this->underlying_.size(); } + // sorts keys alphabetically + void sort_keys(); + struct const_iterator { using value_type = std::pair; @@ -267,53 +280,120 @@ namespace vcpkg::Json const_iterator cbegin() const noexcept { return const_iterator{this->underlying_.begin()}; } const_iterator cend() const noexcept { return const_iterator{this->underlying_.end()}; } + friend bool operator==(const Object& lhs, const Object& rhs); + friend bool operator!=(const Object& lhs, const Object& rhs) { return !(lhs == rhs); } + private: underlying_t underlying_; }; - struct ReaderError + VCPKG_MSVC_WARNING(push) + VCPKG_MSVC_WARNING(disable : 4505) + + template + Span IDeserializer::valid_fields() const { - virtual void add_missing_field(std::string&& type, std::string&& key) = 0; - virtual void add_expected_type(std::string&& key, std::string&& expected_type) = 0; - virtual void add_extra_fields(std::string&& type, std::vector&& fields) = 0; - virtual void add_mutually_exclusive_fields(std::string&& type, std::vector&& fields) = 0; + return {}; + } - virtual ~ReaderError() = default; - }; + template + Optional IDeserializer::visit_null(Reader&) + { + return nullopt; + } + template + Optional IDeserializer::visit_boolean(Reader&, bool) + { + return nullopt; + } + template + Optional IDeserializer::visit_integer(Reader& r, int64_t i) + { + return this->visit_number(r, static_cast(i)); + } + template + Optional IDeserializer::visit_number(Reader&, double) + { + return nullopt; + } + template + Optional IDeserializer::visit_string(Reader&, StringView) + { + return nullopt; + } + template + Optional IDeserializer::visit_array(Reader&, const Array&) + { + return nullopt; + } + template + Optional IDeserializer::visit_object(Reader&, const Object&) + { + return nullopt; + } + + VCPKG_MSVC_WARNING(pop) struct Reader { - explicit Reader(ReaderError* err) : err(err) { } + const std::vector& errors() const { return m_errors; } + std::vector& errors() { return m_errors; } - ReaderError& error() const { return *err; } + void add_missing_field_error(StringView type, StringView key, StringView key_type) + { + m_errors.push_back( + Strings::concat(path(), " (", type, "): ", "missing required field '", key, "' (", key_type, ")")); + } + void add_expected_type_error(StringView expected_type) + { + m_errors.push_back(Strings::concat(path(), ": mismatched type: expected ", expected_type)); + } + void add_extra_fields_error(StringView type, std::vector&& fields) + { + for (auto&& field : fields) + m_errors.push_back(Strings::concat(path(), " (", type, "): ", "unexpected field '", field, '\'')); + } + + std::string path() const noexcept; private: - ReaderError* err; + std::vector m_errors; + struct Path + { + constexpr Path() = default; + constexpr Path(int64_t i) : index(i) { } + constexpr Path(StringView f) : field(f) { } - template - using VisitorType = typename std::remove_reference_t::type; + int64_t index = -1; + StringView field; + }; + std::vector m_path; - template - Optional> internal_visit(const Value& value, StringView key, Visitor& visitor) + template + Optional internal_visit(const Value& value, IDeserializer& visitor) { switch (value.kind()) { - using VK = Json::ValueKind; - case VK::Null: return visitor.visit_null(*this, key); - case VK::Boolean: return visitor.visit_boolean(*this, key, value.boolean()); - case VK::Integer: return visitor.visit_integer(*this, key, value.integer()); - case VK::Number: return visitor.visit_number(*this, key, value.number()); - case VK::String: return visitor.visit_string(*this, key, value.string()); - case VK::Array: return visitor.visit_array(*this, key, value.array()); - case VK::Object: return visitor.visit_object(*this, key, value.object()); + case ValueKind::Null: return visitor.visit_null(*this); + case ValueKind::Boolean: return visitor.visit_boolean(*this, value.boolean()); + case ValueKind::Integer: return visitor.visit_integer(*this, value.integer()); + case ValueKind::Number: return visitor.visit_number(*this, value.number()); + case ValueKind::String: return visitor.visit_string(*this, value.string()); + case ValueKind::Array: return visitor.visit_array(*this, value.array()); + case ValueKind::Object: + { + const auto& obj = value.object(); + check_for_unexpected_fields(obj, visitor.valid_fields(), visitor.type_name()); + return visitor.visit_object(*this, obj); + } } - vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + vcpkg::Checks::unreachable(VCPKG_LINE_INFO); } // returns whether the field was found, not whether it was valid - template - bool internal_field(const Object& obj, StringView key, VisitorType& place, Visitor& visitor) + template + bool internal_field(const Object& obj, StringView key, Type& place, IDeserializer& visitor) { auto value = obj.get(key); if (!value) @@ -321,7 +401,8 @@ namespace vcpkg::Json return false; } - Optional> opt = internal_visit(*value, key, visitor); + m_path.push_back(key); + Optional opt = internal_visit(*value, visitor); if (auto val = opt.get()) { @@ -329,83 +410,249 @@ namespace vcpkg::Json } else { - err->add_expected_type(key.to_string(), visitor.type_name().to_string()); + add_expected_type_error(visitor.type_name().to_string()); } - + m_path.pop_back(); return true; } + // checks that an object doesn't contain any fields which both: + // * don't start with a `$` + // * are not in `valid_fields` + // if known_fields.empty(), then it's treated as if all field names are valid + void check_for_unexpected_fields(const Object& obj, Span valid_fields, StringView type_name); + public: - template + template void required_object_field( - StringView type, const Object& obj, StringView key, VisitorType& place, Visitor&& visitor) + StringView type, const Object& obj, StringView key, Type& place, Deserializer&& visitor) { if (!internal_field(obj, key, place, visitor)) { - err->add_missing_field(type.to_string(), key.to_string()); + this->add_missing_field_error(type, key, visitor.type_name()); } } - template - void optional_object_field(const Object& obj, StringView key, VisitorType& place, Visitor&& visitor) + // returns whether key \in obj + template + bool optional_object_field(const Object& obj, StringView key, Type& place, Deserializer&& visitor) + { + return internal_field(obj, key, place, visitor); + } + + template + Optional visit_value(const Value& value, IDeserializer& visitor) + { + return internal_visit(value, visitor); + } + template + Optional visit_value(const Value& value, IDeserializer&& visitor) + { + return visit_value(value, visitor); + } + + template + Optional visit_value(const Array& value, IDeserializer& visitor) + { + return visitor.visit_array(*this, value); + } + template + Optional visit_value(const Array& value, IDeserializer&& visitor) + { + return visit_value(value, visitor); + } + + template + Optional visit_value(const Object& value, IDeserializer& visitor) { - internal_field(obj, key, place, visitor); + check_for_unexpected_fields(value, visitor.valid_fields(), visitor.type_name()); + return visitor.visit_object(*this, value); + } + template + Optional visit_value(const Object& value, IDeserializer&& visitor) + { + return visit_value(value, visitor); } - template - Optional>> array_elements(const Array& arr, StringView key, Visitor&& visitor) + template + Optional> array_elements(const Array& arr, IDeserializer& visitor) { - std::vector> result; - for (const auto& el : arr) + std::vector result; + m_path.emplace_back(); + for (size_t i = 0; i < arr.size(); ++i) { - auto opt = internal_visit(el, key, visitor); + m_path.back().index = static_cast(i); + auto opt = internal_visit(arr[i], visitor); if (auto p = opt.get()) { result.push_back(std::move(*p)); } else { - return nullopt; + this->add_expected_type_error(visitor.type_name()); + for (++i; i < arr.size(); ++i) + { + m_path.back().index = static_cast(i); + auto opt2 = internal_visit(arr[i], visitor); + if (!opt2) this->add_expected_type_error(visitor.type_name()); + } } } + m_path.pop_back(); return std::move(result); } + template + Optional> array_elements(const Array& arr, IDeserializer&& visitor) + { + return array_elements(arr, visitor); + } + }; + + struct StringDeserializer final : IDeserializer + { + virtual StringView type_name() const override { return type_name_; } + virtual Optional visit_string(Reader&, StringView sv) override { return sv.to_string(); } + + explicit StringDeserializer(StringView type_name_) : type_name_(type_name_) { } + + private: + StringView type_name_; + }; + + struct PathDeserializer final : IDeserializer + { + virtual StringView type_name() const override { return "a path"; } + virtual Optional visit_string(Reader&, StringView sv) override { return fs::u8path(sv); } + }; + + struct NaturalNumberDeserializer final : IDeserializer + { + virtual StringView type_name() const override { return "a natural number"; } + + virtual Optional visit_integer(Reader&, int64_t value) override + { + if (value > std::numeric_limits::max() || value < 0) + { + return nullopt; + } + return static_cast(value); + } + }; + + struct BooleanDeserializer final : IDeserializer + { + virtual StringView type_name() const override { return "a boolean"; } + + virtual Optional visit_boolean(Reader&, bool b) override { return b; } + }; + + enum class AllowEmpty : bool + { + No, + Yes, }; - // Warning: NEVER use this type except as a CRTP base template - struct VisitorCrtpBase + struct ArrayDeserializer final : IDeserializer> + { + using typename IDeserializer>::type; + + virtual StringView type_name() const override { return type_name_; } + + ArrayDeserializer(StringView type_name_, AllowEmpty allow_empty, Underlying&& t = {}) + : type_name_(type_name_), underlying_visitor_(static_cast(t)), allow_empty_(allow_empty) + { + } + + virtual Optional visit_array(Reader& r, const Array& arr) override + { + if (allow_empty_ == AllowEmpty::No && arr.size() == 0) + { + return nullopt; + } + return r.array_elements(arr, underlying_visitor_); + } + + private: + StringView type_name_; + Underlying underlying_visitor_; + AllowEmpty allow_empty_; + }; + + struct ParagraphDeserializer final : IDeserializer> + { + virtual StringView type_name() const override { return "a string or array of strings"; } + + virtual Optional> visit_string(Reader&, StringView sv) override + { + std::vector out; + out.push_back(sv.to_string()); + return out; + } + + virtual Optional> visit_array(Reader& r, const Array& arr) override + { + return r.array_elements(arr, StringDeserializer{"a string"}); + } + }; + + struct IdentifierDeserializer final : Json::IDeserializer { - // the following function must be defined by the Underlying class - // const char* type_name(); - - // We do this auto dance since function bodies are checked _after_ typedefs in the superclass, - // but function declarations are checked beforehand. Therefore, we can get C++ to use this typedef - // only once the function bodies are checked by returning `auto` and specifying the - // return type in the function body. - auto visit_null(Reader&, StringView) { return Optional(nullopt); } - auto visit_boolean(Reader&, StringView, bool) { return Optional(nullopt); } - auto visit_integer(Reader& r, StringView field_name, int64_t i) - { - return static_cast(*this).visit_number(r, field_name, static_cast(i)); + virtual StringView type_name() const override { return "an identifier"; } + + // [a-z0-9]+(-[a-z0-9]+)*, plus not any of {prn, aux, nul, con, lpt[1-9], com[1-9], core, default} + static bool is_ident(StringView sv); + + virtual Optional visit_string(Json::Reader&, StringView sv) override + { + if (is_ident(sv)) + { + return sv.to_string(); + } + else + { + return nullopt; + } } - auto visit_number(Reader&, StringView, double) { return Optional(nullopt); } - auto visit_string(Reader&, StringView, StringView) { return Optional(nullopt); } - auto visit_array(Reader&, StringView, const Json::Array&) + }; + + struct PackageNameDeserializer final : Json::IDeserializer + { + virtual StringView type_name() const override { return "a package name"; } + + static bool is_package_name(StringView sv) { - return Optional(nullopt); + if (sv.size() == 0) + { + return false; + } + + for (const auto& ident : Strings::split(sv, '.')) + { + if (!IdentifierDeserializer::is_ident(ident)) + { + return false; + } + } + + return true; } - auto visit_object(Reader&, StringView, const Json::Object&) + + virtual Optional visit_string(Json::Reader&, StringView sv) override { - return Optional(nullopt); + if (!is_package_name(sv)) + { + return nullopt; + } + return sv.to_string(); } - // we can't make the SMFs protected because of an issue with /permissive mode }; ExpectedT, std::unique_ptr> parse_file( const Files::Filesystem&, const fs::path&, std::error_code& ec) noexcept; ExpectedT, std::unique_ptr> parse( StringView text, const fs::path& filepath = {}) noexcept; + std::pair parse_file(vcpkg::LineInfo linfo, const Files::Filesystem&, const fs::path&) noexcept; std::string stringify(const Value&, JsonStyle style); std::string stringify(const Object&, JsonStyle style); diff --git a/toolsrc/include/vcpkg/base/optional.h b/toolsrc/include/vcpkg/base/optional.h index 091cd498ed9e3f..54e370dff6eb8e 100644 --- a/toolsrc/include/vcpkg/base/optional.h +++ b/toolsrc/include/vcpkg/base/optional.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -15,6 +17,9 @@ namespace vcpkg const static constexpr NullOpt nullopt{0}; + template + struct Optional; + namespace details { template::value> @@ -167,6 +172,7 @@ namespace vcpkg { constexpr OptionalStorage() noexcept : m_t(nullptr) { } constexpr OptionalStorage(T& t) : m_t(&t) { } + constexpr OptionalStorage(Optional& t) : m_t(t.get()) { } constexpr bool has_value() const { return m_t != nullptr; } @@ -176,6 +182,24 @@ namespace vcpkg T* m_t; }; + template + struct OptionalStorage + { + constexpr OptionalStorage() noexcept : m_t(nullptr) { } + constexpr OptionalStorage(const T& t) : m_t(&t) { } + constexpr OptionalStorage(const Optional& t) : m_t(t.get()) { } + constexpr OptionalStorage(const Optional& t) : m_t(t.get()) { } + constexpr OptionalStorage(Optional&& t) = delete; + constexpr OptionalStorage(Optional&& t) = delete; + + constexpr bool has_value() const { return m_t != nullptr; } + + const T& value() const { return *this->m_t; } + + private: + const T* m_t; + }; + // Note: implemented in checks.cpp to cut the header dependency void exit_if_null(bool b, const LineInfo& line_info); } @@ -325,27 +349,4 @@ namespace vcpkg if (auto p = o.get()) return t != *p; return true; } - - template - auto common_projection(const Container& input, Projection proj) - -> Optional> - { - const auto last = input.end(); - auto first = input.begin(); - if (first == last) - { - return nullopt; - } - - const auto& prototype = proj(*first); - while (++first != last) - { - if (prototype != proj(*first)) - { - return nullopt; - } - } - - return prototype; - } } diff --git a/toolsrc/include/vcpkg/base/span.h b/toolsrc/include/vcpkg/base/span.h index 221cccc8cec8bd..a66205332e33e9 100644 --- a/toolsrc/include/vcpkg/base/span.h +++ b/toolsrc/include/vcpkg/base/span.h @@ -3,6 +3,7 @@ #include #include #include +#include #include namespace vcpkg @@ -29,7 +30,7 @@ namespace vcpkg { } - template>> + template::value>> constexpr Span(std::remove_const_t (&arr)[N]) noexcept : m_ptr(arr), m_count(N) { } diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index cd48380290d675..5042dd15883149 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -185,6 +185,8 @@ namespace vcpkg::Strings std::string trim(std::string&& s); + StringView trim(StringView sv); + void trim_all_and_remove_whitespace_strings(std::vector* strings); std::vector split(StringView s, const char delimiter); diff --git a/toolsrc/include/vcpkg/base/stringview.h b/toolsrc/include/vcpkg/base/stringview.h index 6a5503e1c3e29d..9238990fef737b 100644 --- a/toolsrc/include/vcpkg/base/stringview.h +++ b/toolsrc/include/vcpkg/base/stringview.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -37,6 +39,9 @@ namespace vcpkg constexpr const char* begin() const { return m_ptr; } constexpr const char* end() const { return m_ptr + m_size; } + std::reverse_iterator rbegin() const { return std::make_reverse_iterator(end()); } + std::reverse_iterator rend() const { return std::make_reverse_iterator(begin()); } + constexpr const char* data() const { return m_ptr; } constexpr size_t size() const { return m_size; } diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 0a2e745c468c11..2340728fd032ce 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -25,6 +25,7 @@ namespace vcpkg::System X64, ARM, ARM64, + S390X, }; Optional to_cpu_architecture(StringView arch); diff --git a/toolsrc/include/vcpkg/base/system.process.h b/toolsrc/include/vcpkg/base/system.process.h index 91faa59854b4e2..4bbcba7179435b 100644 --- a/toolsrc/include/vcpkg/base/system.process.h +++ b/toolsrc/include/vcpkg/base/system.process.h @@ -25,8 +25,14 @@ namespace vcpkg::System struct CmdLineBuilder { - CmdLineBuilder& path_arg(const fs::path& p) { return string_arg(p.u8string()); } + CmdLineBuilder& path_arg(const fs::path& p) { return string_arg(fs::u8string(p)); } CmdLineBuilder& string_arg(StringView s); + CmdLineBuilder& ampersand() + { + buf.push_back('&'); + buf.push_back('&'); + return *this; + } std::string extract() noexcept { return std::move(buf); } operator ZStringView() const { return buf; } diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index a6d8781b057239..0453ac20a64b01 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -63,7 +65,10 @@ namespace vcpkg::Util } template - using FmapOut = std::remove_reference_t()(*std::declval().begin()))>; + using FmapRefOut = decltype(std::declval()(*std::declval().begin())); + + template + using FmapOut = std::decay_t>; template> std::vector fmap(Range&& xs, Func&& f) @@ -77,6 +82,28 @@ namespace vcpkg::Util return ret; } + template> + Optional common_projection(Range&& input, Proj&& proj) + { + const auto last = input.end(); + auto first = input.begin(); + if (first == last) + { + return nullopt; + } + + Out prototype = proj(*first); + while (++first != last) + { + if (prototype != proj(*first)) + { + return nullopt; + } + } + + return prototype; + } + template using FmapFlattenOut = std::decay_t()(*begin(std::declval()))))>; @@ -239,15 +266,4 @@ namespace vcpkg::Util return e == E::YES; } } - - template - void unused(const Ts&...) - { - } - - template - T copy(const T& t) - { - return t; - } } diff --git a/toolsrc/include/vcpkg/binarycaching.private.h b/toolsrc/include/vcpkg/binarycaching.private.h index 1b5d587de635bf..46d9d6741d2baf 100644 --- a/toolsrc/include/vcpkg/binarycaching.private.h +++ b/toolsrc/include/vcpkg/binarycaching.private.h @@ -31,9 +31,22 @@ namespace vcpkg std::string nupkg_filename() const { return Strings::concat(id, '.', version, ".nupkg"); } }; + namespace details + { + struct NuGetRepoInfo + { + std::string repo; + std::string branch; + std::string commit; + }; + + NuGetRepoInfo get_nuget_repo_info_from_env(); + } + std::string generate_nuspec(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action, - const NugetReference& ref); + const NugetReference& ref, + details::NuGetRepoInfo rinfo = details::get_nuget_repo_info_from_env()); struct XmlSerializer { diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index 2d2e4cf200de52..f10c41af07bc01 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -39,7 +39,7 @@ namespace vcpkg std::vector default_features; std::vector dependencies; std::string abi; - Type type; + Type type = {Type::UNKNOWN}; }; bool operator==(const BinaryParagraph&, const BinaryParagraph&); diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 0fac8222c07e27..83d797fd1df216 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -346,4 +347,11 @@ namespace vcpkg::Build bool m_compiler_tracking; }; + + struct BuildCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/buildenvironment.h b/toolsrc/include/vcpkg/buildenvironment.h index 1216caa2a018d0..aa69708b670746 100644 --- a/toolsrc/include/vcpkg/buildenvironment.h +++ b/toolsrc/include/vcpkg/buildenvironment.h @@ -1,6 +1,8 @@ -#include +#pragma once + +#include -#include +#include #include #include diff --git a/toolsrc/include/vcpkg/cmakevars.h b/toolsrc/include/vcpkg/cmakevars.h index 1c02376b9ff2ed..66dd287b858206 100644 --- a/toolsrc/include/vcpkg/cmakevars.h +++ b/toolsrc/include/vcpkg/cmakevars.h @@ -1,9 +1,10 @@ #pragma once +#include + #include #include -#include namespace vcpkg::Dependencies { diff --git a/toolsrc/include/vcpkg/commands.autocomplete.h b/toolsrc/include/vcpkg/commands.autocomplete.h new file mode 100644 index 00000000000000..4f518d0f0c6029 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.autocomplete.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Autocomplete +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct AutocompleteCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.buildexternal.h b/toolsrc/include/vcpkg/commands.buildexternal.h new file mode 100644 index 00000000000000..b4e1aa669bf5d0 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.buildexternal.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::BuildExternal +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct BuildExternalCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.cache.h b/toolsrc/include/vcpkg/commands.cache.h new file mode 100644 index 00000000000000..5d18a3f99f49e1 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.cache.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Cache +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CacheCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.ci.h b/toolsrc/include/vcpkg/commands.ci.h new file mode 100644 index 00000000000000..4657741c926d2f --- /dev/null +++ b/toolsrc/include/vcpkg/commands.ci.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::CI +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct CICommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.ciclean.h b/toolsrc/include/vcpkg/commands.ciclean.h new file mode 100644 index 00000000000000..ed9e2f005b209f --- /dev/null +++ b/toolsrc/include/vcpkg/commands.ciclean.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::CIClean +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CICleanCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.contact.h b/toolsrc/include/vcpkg/commands.contact.h new file mode 100644 index 00000000000000..f0af41c14aef4e --- /dev/null +++ b/toolsrc/include/vcpkg/commands.contact.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Contact +{ + extern const CommandStructure COMMAND_STRUCTURE; + const std::string& email(); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + + struct ContactCommand : BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.create.h b/toolsrc/include/vcpkg/commands.create.h new file mode 100644 index 00000000000000..a8eb99b273d0dd --- /dev/null +++ b/toolsrc/include/vcpkg/commands.create.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Create +{ + extern const CommandStructure COMMAND_STRUCTURE; + int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CreateCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.dependinfo.h b/toolsrc/include/vcpkg/commands.dependinfo.h new file mode 100644 index 00000000000000..81301b6d9c6c9c --- /dev/null +++ b/toolsrc/include/vcpkg/commands.dependinfo.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::DependInfo +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct DependInfoCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.edit.h b/toolsrc/include/vcpkg/commands.edit.h new file mode 100644 index 00000000000000..9a37d2ee3d2cfe --- /dev/null +++ b/toolsrc/include/vcpkg/commands.edit.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Edit +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct EditCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.env.h b/toolsrc/include/vcpkg/commands.env.h new file mode 100644 index 00000000000000..5ba58d081daedf --- /dev/null +++ b/toolsrc/include/vcpkg/commands.env.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Env +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct EnvCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.fetch.h b/toolsrc/include/vcpkg/commands.fetch.h new file mode 100644 index 00000000000000..c41965903e9571 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.fetch.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Fetch +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct FetchCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.format-manifest.h b/toolsrc/include/vcpkg/commands.format-manifest.h new file mode 100644 index 00000000000000..1317bbc705febc --- /dev/null +++ b/toolsrc/include/vcpkg/commands.format-manifest.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::FormatManifest +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct FormatManifestCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index cec9237f5737f4..77e4782196e5b7 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -1,173 +1,10 @@ #pragma once #include -#include -#include -#include -#include - -#include -#include -#include +#include namespace vcpkg::Commands { - using CommandTypeA = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - using CommandTypeC = void (*)(const VcpkgCmdArguments& args, Files::Filesystem& fs); - - enum class DryRun : bool - { - No, - Yes, - }; - - namespace BuildExternal - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace CI - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace CIClean - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Env - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Create - { - extern const CommandStructure COMMAND_STRUCTURE; - int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Upgrade - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Edit - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace DependInfo - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Search - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace List - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Owns - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Cache - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Integrate - { - extern const CommandStructure COMMAND_STRUCTURE; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void append_helpstring(HelpTableFormatter& table); - std::string get_helpstring(); - } - - namespace PortsDiff - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace PortHistory - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Autocomplete - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Version - { - const char* base_version(); - const std::string& version(); - void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - } - - namespace Contact - { - extern const CommandStructure COMMAND_STRUCTURE; - const std::string& email(); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - } - - namespace X_VSInstances - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Hash - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Fetch - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace FormatManifest - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace SetInstalled - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit_ex(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - const PortFileProvider::PathsPortFileProvider& provider, - IBinaryProvider& binary_provider, - const CMakeVars::CMakeVarProvider& cmake_vars, - const std::vector& specs, - const Build::BuildPackageOptions& install_plan_options, - DryRun dry_run, - const Optional& pkgsconfig_path); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - template struct PackageNameAndFunction { @@ -175,12 +12,12 @@ namespace vcpkg::Commands T function; }; - Span> get_available_commands_type_a(); - Span> get_available_commands_type_b(); - Span> get_available_commands_type_c(); + Span> get_available_basic_commands(); + Span> get_available_paths_commands(); + Span> get_available_triplet_commands(); template - T find(const std::string& command_name, const std::vector> available_commands) + T find(StringView command_name, Span> available_commands) { for (const PackageNameAndFunction& cmd : available_commands) { diff --git a/toolsrc/include/vcpkg/commands.hash.h b/toolsrc/include/vcpkg/commands.hash.h new file mode 100644 index 00000000000000..aa9b11c056c984 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.hash.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Hash +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct HashCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.info.h b/toolsrc/include/vcpkg/commands.info.h new file mode 100644 index 00000000000000..556d1eb012da82 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.info.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Info +{ + extern const CommandStructure COMMAND_STRUCTURE; + + struct InfoCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.integrate.h b/toolsrc/include/vcpkg/commands.integrate.h new file mode 100644 index 00000000000000..162f49a3c34baf --- /dev/null +++ b/toolsrc/include/vcpkg/commands.integrate.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Integrate +{ + extern const CommandStructure COMMAND_STRUCTURE; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void append_helpstring(HelpTableFormatter& table); + std::string get_helpstring(); + + struct IntegrateCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h new file mode 100644 index 00000000000000..c8bc14ca967993 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.interface.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +#include + +#include + +namespace vcpkg::Commands +{ + enum class DryRun : bool + { + No, + Yes, + }; + + struct BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const = 0; + virtual ~BasicCommand() = default; + }; + + struct PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const = 0; + virtual ~PathsCommand() = default; + }; + + struct TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const = 0; + virtual ~TripletCommand() = default; + }; +} diff --git a/toolsrc/include/vcpkg/commands.list.h b/toolsrc/include/vcpkg/commands.list.h new file mode 100644 index 00000000000000..77a5f41bdb3217 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.list.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::List +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct ListCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h new file mode 100644 index 00000000000000..39037649da3b0e --- /dev/null +++ b/toolsrc/include/vcpkg/commands.owns.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +namespace vcpkg::Commands::Owns +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct OwnsCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.porthistory.h b/toolsrc/include/vcpkg/commands.porthistory.h new file mode 100644 index 00000000000000..3ca5325320f4e7 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.porthistory.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::PortHistory +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct PortHistoryCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.portsdiff.h b/toolsrc/include/vcpkg/commands.portsdiff.h new file mode 100644 index 00000000000000..8cd1b094c68742 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.portsdiff.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::PortsDiff +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct PortsDiffCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h new file mode 100644 index 00000000000000..530a3ac2816e0c --- /dev/null +++ b/toolsrc/include/vcpkg/commands.search.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +namespace vcpkg::Commands::Search +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct SearchCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.setinstalled.h b/toolsrc/include/vcpkg/commands.setinstalled.h new file mode 100644 index 00000000000000..c5723669bd7307 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.setinstalled.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +namespace vcpkg::Commands::SetInstalled +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit_ex(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binary_provider, + const CMakeVars::CMakeVarProvider& cmake_vars, + Dependencies::ActionPlan action_plan, + DryRun dry_run, + const Optional& pkgsconfig_path); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct SetInstalledCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.upgrade.h b/toolsrc/include/vcpkg/commands.upgrade.h new file mode 100644 index 00000000000000..340a70c97cd42b --- /dev/null +++ b/toolsrc/include/vcpkg/commands.upgrade.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Upgrade +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct UpgradeCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.version.h b/toolsrc/include/vcpkg/commands.version.h new file mode 100644 index 00000000000000..0f1717c7462dd0 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.version.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Version +{ + const char* base_version(); + const std::string& version(); + void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + + struct VersionCommand : BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.xvsinstances.h b/toolsrc/include/vcpkg/commands.xvsinstances.h new file mode 100644 index 00000000000000..fc7a39b98bc5ba --- /dev/null +++ b/toolsrc/include/vcpkg/commands.xvsinstances.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::X_VSInstances +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct VSInstancesCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/configuration.h b/toolsrc/include/vcpkg/configuration.h new file mode 100644 index 00000000000000..a4ed38223380aa --- /dev/null +++ b/toolsrc/include/vcpkg/configuration.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include + +#include + +#include + +namespace vcpkg +{ + struct Configuration + { + // This member is set up via two different configuration options, + // `registries` and `default_registry`. The fall back logic is + // taken care of in RegistrySet. + RegistrySet registry_set; + }; + + struct ConfigurationDeserializer final : Json::IDeserializer + { + virtual StringView type_name() const override { return "a configuration object"; } + + constexpr static StringLiteral DEFAULT_REGISTRY = "default-registry"; + constexpr static StringLiteral REGISTRIES = "registries"; + virtual Span valid_fields() const override + { + constexpr static StringView t[] = {DEFAULT_REGISTRY, REGISTRIES}; + return t; + } + + virtual Optional visit_object(Json::Reader& r, const Json::Object& obj) override; + + ConfigurationDeserializer(const VcpkgCmdArguments& args); + + private: + bool print_json; + + bool registries_enabled; + }; +} diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 7308eadb744685..080a28f5226b97 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -4,11 +4,7 @@ #include #include -#include #include -#include -#include -#include #include #include @@ -19,6 +15,21 @@ namespace vcpkg::Graphs struct Randomizer; } +namespace vcpkg::CMakeVars +{ + struct CMakeVarProvider; +} + +namespace vcpkg::PortFileProvider +{ + struct PortFileProvider; +} + +namespace vcpkg +{ + struct StatusParagraphs; +} + namespace vcpkg::Dependencies { enum class RequestType @@ -56,6 +67,7 @@ namespace vcpkg::Dependencies std::string displayname() const; const std::string& public_abi() const; + bool has_package_abi() const; const Build::PreBuildInfo& pre_build_info(LineInfo linfo) const; PackageSpec spec; @@ -153,8 +165,7 @@ namespace vcpkg::Dependencies const CMakeVars::CMakeVarProvider& var_provider, const std::vector& specs, const StatusParagraphs& status_db, - const CreateInstallPlanOptions& options = {}, - bool allFeatures = false); + const CreateInstallPlanOptions& options = {}); ActionPlan create_upgrade_plan(const PortFileProvider::PortFileProvider& provider, const CMakeVars::CMakeVarProvider& var_provider, @@ -162,6 +173,12 @@ namespace vcpkg::Dependencies const StatusParagraphs& status_db, const CreateInstallPlanOptions& options = {}); + // `features` should have "default" instead of missing "core". This is only exposed for testing purposes. + std::vector resolve_deps_as_top_level(const SourceControlFile& scf, + Triplet triplet, + std::vector features, + CMakeVars::CMakeVarProvider& var_provider); + void print_plan(const ActionPlan& action_plan, const bool is_recursive = true, const fs::path& default_ports_dir = {}); diff --git a/toolsrc/include/vcpkg/export.h b/toolsrc/include/vcpkg/export.h index 3605081e3a8367..0dd5b1aacdf930 100644 --- a/toolsrc/include/vcpkg/export.h +++ b/toolsrc/include/vcpkg/export.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace vcpkg::Export { @@ -9,4 +9,11 @@ namespace vcpkg::Export void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths); + + struct ExportCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/export.ifw.h b/toolsrc/include/vcpkg/export.ifw.h index b1573924ed987f..0fe07227c26002 100644 --- a/toolsrc/include/vcpkg/export.ifw.h +++ b/toolsrc/include/vcpkg/export.ifw.h @@ -1,7 +1,8 @@ #pragma once +#include + #include -#include #include #include diff --git a/toolsrc/include/vcpkg/fwd/configuration.h b/toolsrc/include/vcpkg/fwd/configuration.h new file mode 100644 index 00000000000000..5fa9cee343aa74 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/configuration.h @@ -0,0 +1,6 @@ +#pragma once + +namespace vcpkg +{ + struct Configuration; +} diff --git a/toolsrc/include/vcpkg/fwd/registries.h b/toolsrc/include/vcpkg/fwd/registries.h new file mode 100644 index 00000000000000..7352c429d175f4 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/registries.h @@ -0,0 +1,8 @@ +#pragma once + +namespace vcpkg +{ + struct RegistryImpl; + struct Registry; + struct RegistrySet; +} diff --git a/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h new file mode 100644 index 00000000000000..87d6f9eaa8e196 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h @@ -0,0 +1,13 @@ +#pragma once + +namespace vcpkg +{ + struct ParsedArguments; + struct CommandSwitch; + struct CommandSetting; + struct CommandMultiSetting; + struct CommandOptionsStructure; + struct CommandStructure; + struct HelpTableFormatter; + struct VcpkgCmdArguments; +} diff --git a/toolsrc/include/vcpkg/fwd/vcpkgpaths.h b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h new file mode 100644 index 00000000000000..79655bf4a78ac1 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h @@ -0,0 +1,8 @@ +#pragma once + +namespace vcpkg +{ + struct ToolsetArchOption; + struct Toolset; + struct VcpkgPaths; +} diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h index 97bc1186409833..3e1ef381e41317 100644 --- a/toolsrc/include/vcpkg/help.h +++ b/toolsrc/include/vcpkg/help.h @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include #include @@ -12,4 +11,9 @@ namespace vcpkg::Help void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); void help_topic_valid_triplet(const VcpkgPaths& paths); + + struct HelpCommand : Commands::PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; } diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index 2c674e7de6727a..f85d48d8d14513 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -90,7 +91,24 @@ namespace vcpkg::Install const Build::IBuildLogsRecorder& build_logs_recorder, const CMakeVars::CMakeVarProvider& var_provider); + struct CMakeUsageInfo + { + std::string message; + bool usage_file = false; + Optional header_only; + std::map> cmake_targets_map; + }; + + CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths); + extern const CommandStructure COMMAND_STRUCTURE; void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct InstallCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/packagespec.h b/toolsrc/include/vcpkg/packagespec.h index 495056884b0b08..a362d80680eb38 100644 --- a/toolsrc/include/vcpkg/packagespec.h +++ b/toolsrc/include/vcpkg/packagespec.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -47,6 +48,9 @@ namespace vcpkg Triplet m_triplet; }; + bool operator==(const PackageSpec& left, const PackageSpec& right); + inline bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } + /// /// /// Full specification of a feature. Contains all information to reference @@ -108,6 +112,12 @@ namespace vcpkg const std::vector& all_features) const; static ExpectedS from_string(const std::string& spec_as_string, Triplet default_triplet); + + bool operator==(const FullPackageSpec& o) const + { + return package_spec == o.package_spec && features == o.features; + } + bool operator!=(const FullPackageSpec& o) const { return !(*this == o); } }; /// @@ -128,6 +138,11 @@ namespace vcpkg std::string name; std::vector features; PlatformExpression::Expr platform; + + Json::Object extra_info; + + friend bool operator==(const Dependency& lhs, const Dependency& rhs); + friend bool operator!=(const Dependency& lhs, const Dependency& rhs) { return !(lhs == rhs); } }; struct ParsedQualifiedSpecifier @@ -142,9 +157,6 @@ namespace vcpkg Optional parse_package_name(Parse::ParserBase& parser); ExpectedS parse_qualified_specifier(StringView input); Optional parse_qualified_specifier(Parse::ParserBase& parser); - - bool operator==(const PackageSpec& left, const PackageSpec& right); - bool operator!=(const PackageSpec& left, const PackageSpec& right); } namespace std diff --git a/toolsrc/include/vcpkg/paragraphparser.h b/toolsrc/include/vcpkg/paragraphparser.h index 4403b3aea727ca..22060f32fc341d 100644 --- a/toolsrc/include/vcpkg/paragraphparser.h +++ b/toolsrc/include/vcpkg/paragraphparser.h @@ -20,11 +20,13 @@ namespace vcpkg::Parse std::map> extra_fields; std::map expected_types; std::map> mutually_exclusive_fields; + std::vector other_errors; std::string error; bool has_error() const { - return !missing_fields.empty() || !extra_fields.empty() || !expected_types.empty() || !error.empty(); + return !missing_fields.empty() || !extra_fields.empty() || !expected_types.empty() || + !other_errors.empty() || !error.empty(); } }; diff --git a/toolsrc/include/vcpkg/paragraphparseresult.h b/toolsrc/include/vcpkg/paragraphparseresult.h deleted file mode 100644 index 558715bbcc8233..00000000000000 --- a/toolsrc/include/vcpkg/paragraphparseresult.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include - -namespace vcpkg -{ - enum class ParagraphParseResult - { - SUCCESS = 0, - EXPECTED_ONE_PARAGRAPH - }; - - struct ParagraphParseResultCategoryImpl final : std::error_category - { - virtual const char* name() const noexcept override; - - virtual std::string message(int ev) const noexcept override; - }; - - const std::error_category& paragraph_parse_result_category(); - - std::error_code make_error_code(ParagraphParseResult e); - - ParagraphParseResult to_paragraph_parse_result(int i); - - ParagraphParseResult to_paragraph_parse_result(std::error_code ec); -} - -namespace std -{ - // Enable implicit conversion to std::error_code - template<> - struct is_error_code_enum : ::std::true_type - { - }; -} \ No newline at end of file diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index 25d037591bf062..95726f9135ddf5 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -17,23 +17,33 @@ namespace vcpkg::Paragraphs bool is_port_directory(const Files::Filesystem& fs, const fs::path& path); - Parse::ParseExpected try_load_manifest(const Files::Filesystem& fs, - const std::string& port_name, - const fs::path& path_to_manifest, - std::error_code& ec); - Parse::ParseExpected try_load_port(const Files::Filesystem& fs, const fs::path& path); ExpectedS try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec); struct LoadResults { - std::vector> paragraphs; + std::vector paragraphs; std::vector> errors; }; - LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir); - - std::vector> load_all_ports(const Files::Filesystem& fs, - const fs::path& ports_dir); + // this allows one to pass this around as an overload set to stuff like `Util::fmap`, + // as opposed to making it a function + constexpr struct + { + const std::string& operator()(const SourceControlFileLocation* loc) const + { + return (*this)(*loc->source_control_file); + } + const std::string& operator()(const SourceControlFileLocation& loc) const + { + return (*this)(*loc.source_control_file); + } + const std::string& operator()(const SourceControlFile& scf) const { return scf.core_paragraph->name; } + } get_name_of_control_file; + + LoadResults try_load_all_registry_ports(const VcpkgPaths& paths); + + std::vector load_all_registry_ports(const VcpkgPaths& paths); + std::vector load_overlay_ports(const VcpkgPaths& paths, const fs::path& dir); } diff --git a/toolsrc/include/vcpkg/platform-expression.h b/toolsrc/include/vcpkg/platform-expression.h index fd2bb85898d5ee..43ae6e89de5c85 100644 --- a/toolsrc/include/vcpkg/platform-expression.h +++ b/toolsrc/include/vcpkg/platform-expression.h @@ -38,6 +38,31 @@ namespace vcpkg::PlatformExpression bool evaluate(const Context& context) const; bool is_empty() const { return !static_cast(underlying_); } + // returns: + // - 0 for empty + // - 1 for identifiers + // - 1 + complexity(inner) for ! + // - 1 + sum(complexity(inner)) for & and | + int complexity() const; + + // these two are friends so that they're only findable via ADL + + // this does a structural equality, so, for example: + // !structurally_equal((x & y) & z, x & y & z) + // !structurally_equal((x & y) | z, (x | z) & (y | z)) + // even though these expressions are equivalent + friend bool structurally_equal(const Expr& lhs, const Expr& rhs); + + // returns 0 if and only if structurally_equal(lhs, rhs) + // Orders via the following: + // - If complexity(a) < complexity(b) => a < b + // - Otherwise, if to_string(a).size() < to_string(b).size() => a < b + // - Otherwise, if to_string(a) < to_string(b) => a < b + // - else, they must be structurally equal + friend int compare(const Expr& lhs, const Expr& rhs); + + friend std::string to_string(const Expr& expr); + private: std::unique_ptr underlying_; }; diff --git a/toolsrc/include/vcpkg/portfileprovider.h b/toolsrc/include/vcpkg/portfileprovider.h index e4b5d9cb5f6231..d3fa0b51f1c93b 100644 --- a/toolsrc/include/vcpkg/portfileprovider.h +++ b/toolsrc/include/vcpkg/portfileprovider.h @@ -26,14 +26,13 @@ namespace vcpkg::PortFileProvider struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider { - explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, - const std::vector& ports_dirs_paths); + explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, const std::vector& overlay_ports); ExpectedS get_control_file(const std::string& src_name) const override; std::vector load_all_control_files() const override; private: - Files::Filesystem& filesystem; - std::vector ports_dirs; + const VcpkgPaths& paths; + std::vector overlay_ports; mutable std::unordered_map cache; }; } diff --git a/toolsrc/include/vcpkg/registries.h b/toolsrc/include/vcpkg/registries.h new file mode 100644 index 00000000000000..100bee1704dc4b --- /dev/null +++ b/toolsrc/include/vcpkg/registries.h @@ -0,0 +1,95 @@ +#pragma once + +#include + +#include +#include + +#include + +#include +#include +#include +#include + +namespace vcpkg +{ + struct RegistryImpl + { + virtual fs::path get_registry_root(const VcpkgPaths& paths) const = 0; + + virtual ~RegistryImpl() = default; + }; + + struct Registry + { + // requires: static_cast(implementation) + Registry(std::vector&& packages, std::unique_ptr&& implementation); + + Registry(std::vector&&, std::nullptr_t) = delete; + + // always ordered lexicographically + Span packages() const { return packages_; } + const RegistryImpl& implementation() const { return *implementation_; } + + static std::unique_ptr builtin_registry(); + + private: + std::vector packages_; + std::unique_ptr implementation_; + }; + + struct RegistryImplDeserializer : Json::IDeserializer> + { + constexpr static StringLiteral KIND = "kind"; + constexpr static StringLiteral PATH = "path"; + + constexpr static StringLiteral KIND_BUILTIN = "builtin"; + constexpr static StringLiteral KIND_DIRECTORY = "directory"; + + virtual StringView type_name() const override; + virtual Span valid_fields() const override; + + virtual Optional> visit_null(Json::Reader&) override; + virtual Optional> visit_object(Json::Reader&, const Json::Object&) override; + }; + + struct RegistryDeserializer final : Json::IDeserializer + { + constexpr static StringLiteral PACKAGES = "packages"; + + virtual StringView type_name() const override; + virtual Span valid_fields() const override; + + virtual Optional visit_object(Json::Reader&, const Json::Object&) override; + }; + + // this type implements the registry fall back logic from the registries RFC: + // A port name maps to one of the non-default registries if that registry declares + // that it is the registry for that port name, else it maps to the default registry + // if that registry exists; else, there is no registry for a port. + // The way one sets this up is via the `"registries"` and `"default_registry"` + // configuration fields. + struct RegistrySet + { + RegistrySet(); + + // finds the correct registry for the port name + // Returns the null pointer if there is no registry set up for that name + const RegistryImpl* registry_for_port(StringView port_name) const; + + Span registries() const { return registries_; } + + const RegistryImpl* default_registry() const { return default_registry_.get(); } + + // TODO: figure out how to get this to return an error (or maybe it should be a warning?) + void add_registry(Registry&& r); + void set_default_registry(std::unique_ptr&& r); + void set_default_registry(std::nullptr_t r); + + private: + std::unique_ptr default_registry_; + std::vector registries_; + }; + +} diff --git a/toolsrc/include/vcpkg/remove.h b/toolsrc/include/vcpkg/remove.h index c43bc73c20cdaa..f68e8bd9f980b3 100644 --- a/toolsrc/include/vcpkg/remove.h +++ b/toolsrc/include/vcpkg/remove.h @@ -1,8 +1,7 @@ #pragma once +#include #include -#include -#include namespace vcpkg::Remove { @@ -23,4 +22,11 @@ namespace vcpkg::Remove void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); + + struct RemoveCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index 9c3648babad2ae..82073d849a2a63 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -1,7 +1,8 @@ #pragma once +#include + #include -#include #include #include #include @@ -41,6 +42,11 @@ namespace vcpkg std::vector description; std::vector dependencies; PlatformExpression::Expr supports_expression; + + Json::Object extra_info; + + friend bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs); + friend bool operator!=(const FeatureParagraph& lhs, const FeatureParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -61,6 +67,11 @@ namespace vcpkg Type type; PlatformExpression::Expr supports_expression; + + Json::Object extra_info; + + friend bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs); + friend bool operator!=(const SourceParagraph& lhs, const SourceParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -74,7 +85,7 @@ namespace vcpkg { for (const auto& feat_ptr : scf.feature_paragraphs) { - feature_paragraphs.emplace_back(std::make_unique(*feat_ptr)); + feature_paragraphs.push_back(std::make_unique(*feat_ptr)); } } @@ -90,8 +101,14 @@ namespace vcpkg Optional find_feature(const std::string& featurename) const; Optional&> find_dependencies_for_feature(const std::string& featurename) const; + + friend bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs); + friend bool operator!=(const SourceControlFile& lhs, const SourceControlFile& rhs) { return !(lhs == rhs); } }; + Json::Object serialize_manifest(const SourceControlFile& scf); + Json::Object serialize_debug_manifest(const SourceControlFile& scf); + /// /// Full metadata of a package: core and other features. As well as the location the SourceControlFile was /// loaded from. diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index dde4ecb19866cc..1cfa7a17c5b0fd 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -61,4 +63,6 @@ namespace vcpkg const StatusParagraph* core; std::vector features; }; + + Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h index b57ca2918919b9..f9618a52dcbdcd 100644 --- a/toolsrc/include/vcpkg/tools.h +++ b/toolsrc/include/vcpkg/tools.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -7,7 +9,20 @@ namespace vcpkg { - struct VcpkgPaths; + namespace Tools + { + static const std::string SEVEN_ZIP = "7zip"; + static const std::string SEVEN_ZIP_ALT = "7z"; + static const std::string MAVEN = "mvn"; + static const std::string CMAKE = "cmake"; + static const std::string GIT = "git"; + static const std::string MONO = "mono"; + static const std::string NINJA = "ninja"; + static const std::string NUGET = "nuget"; + static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; + static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; + static const std::string IFW_REPOGEN = "ifw_repogen"; + } struct ToolCache { diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index 736b22a2d11b14..42d99dc3e12f1c 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -3,13 +3,12 @@ #include #include -#include - #include namespace vcpkg { struct TripletInstance; + struct VcpkgCmdArguments; struct Triplet { @@ -18,20 +17,6 @@ namespace vcpkg static Triplet from_canonical_name(std::string&& triplet_as_string); - static const Triplet X86_WINDOWS; - static const Triplet X64_WINDOWS; - static const Triplet ARM_WINDOWS; - static const Triplet ARM64_WINDOWS; - static const Triplet X86_UWP; - static const Triplet X64_UWP; - static const Triplet ARM_UWP; - static const Triplet ARM64_UWP; - - static const Triplet ARM_ANDROID; - static const Triplet ARM64_ANDROID; - static const Triplet X86_ANDROID; - static const Triplet X64_ANDROID; - const std::string& canonical_name() const; const std::string& to_string() const; void to_string(std::string& out) const; diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h index 6091da7783792f..2c05e489ea3e69 100644 --- a/toolsrc/include/vcpkg/update.h +++ b/toolsrc/include/vcpkg/update.h @@ -1,10 +1,9 @@ #pragma once +#include #include #include #include -#include -#include #include namespace vcpkg::Update @@ -21,4 +20,9 @@ namespace vcpkg::Update const StatusParagraphs& status_db); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct UpdateCommand : Commands::PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; } diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index ddc407a35a4aff..626e598be6f58c 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + #include #include #include @@ -19,8 +22,6 @@ namespace vcpkg std::unordered_map> multisettings; }; - struct VcpkgPaths; - struct CommandSwitch { constexpr CommandSwitch(const StringLiteral& name, const StringLiteral& short_help_text) @@ -130,6 +131,7 @@ namespace vcpkg constexpr static StringLiteral TRIPLET_ENV = "VCPKG_DEFAULT_TRIPLET"; constexpr static StringLiteral TRIPLET_ARG = "triplet"; std::unique_ptr triplet; + constexpr static StringLiteral OVERLAY_PORTS_ENV = "VCPKG_OVERLAY_PORTS"; constexpr static StringLiteral OVERLAY_PORTS_ARG = "overlay-ports"; std::vector overlay_ports; constexpr static StringLiteral OVERLAY_TRIPLETS_ARG = "overlay-triplets"; @@ -152,6 +154,9 @@ namespace vcpkg constexpr static StringLiteral WAIT_FOR_LOCK_SWITCH = "x-wait-for-lock"; Optional wait_for_lock = nullopt; + constexpr static StringLiteral JSON_SWITCH = "x-json"; + Optional json = nullopt; + // feature flags constexpr static StringLiteral FEATURE_FLAGS_ENV = "VCPKG_FEATURE_FLAGS"; constexpr static StringLiteral FEATURE_FLAGS_ARG = "feature-flags"; @@ -165,9 +170,13 @@ namespace vcpkg Optional compiler_tracking = nullopt; constexpr static StringLiteral MANIFEST_MODE_FEATURE = "manifests"; Optional manifest_mode = nullopt; + constexpr static StringLiteral REGISTRIES_FEATURE = "registries"; + Optional registries_feature = nullopt; bool binary_caching_enabled() const { return binary_caching.value_or(true); } bool compiler_tracking_enabled() const { return compiler_tracking.value_or(true); } + bool registries_enabled() const { return registries_feature.value_or(false); } + bool output_json() const { return json.value_or(false); } std::string command; std::vector command_arguments; diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 594407c4b32194..8abc84129426eb 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -1,33 +1,21 @@ #pragma once +#include + +#include +#include +#include +#include + #include #include #include #include +#include #include -#include -#include -#include -#include - namespace vcpkg { - namespace Tools - { - static const std::string SEVEN_ZIP = "7zip"; - static const std::string SEVEN_ZIP_ALT = "7z"; - static const std::string MAVEN = "mvn"; - static const std::string CMAKE = "cmake"; - static const std::string GIT = "git"; - static const std::string MONO = "mono"; - static const std::string NINJA = "ninja"; - static const std::string NUGET = "nuget"; - static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; - static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; - static const std::string IFW_REPOGEN = "ifw_repogen"; - } - struct ToolsetArchOption { CStringView name; @@ -61,6 +49,10 @@ namespace vcpkg struct VcpkgPathsImpl; } + struct BinaryParagraph; + struct PackageSpec; + struct Triplet; + struct VcpkgPaths : Util::MoveOnlyBase { struct TripletFile @@ -89,6 +81,7 @@ namespace vcpkg fs::path original_cwd; fs::path root; fs::path manifest_root_dir; + fs::path config_root_dir; fs::path buildtrees; fs::path downloads; fs::path packages; @@ -114,6 +107,10 @@ namespace vcpkg const fs::path& get_tool_exe(const std::string& tool) const; const std::string& get_tool_version(const std::string& tool) const; + Optional get_manifest() const; + Optional get_manifest_path() const; + const Configuration& get_configuration() const; + /// Retrieve a toolset matching a VS version /// /// Valid version strings are "v120", "v140", "v141", and "". Empty string gets the latest. @@ -124,7 +121,7 @@ namespace vcpkg const System::Environment& get_action_env(const Build::AbiInfo& abi_info) const; const std::string& get_triplet_info(const Build::AbiInfo& abi_info) const; - bool manifest_mode_enabled() const { return !manifest_root_dir.empty(); } + bool manifest_mode_enabled() const { return get_manifest().has_value(); } void track_feature_flag_metrics() const; diff --git a/toolsrc/src/pch.cpp b/toolsrc/src/pch.cpp index 17305716aacd2a..ebc3d89049e924 100644 --- a/toolsrc/src/pch.cpp +++ b/toolsrc/src/pch.cpp @@ -1 +1,2 @@ -#include "pch.h" \ No newline at end of file +// This file intentionally left blank. It exists to be a target for pch compilation, +// but `#include "pch.h"` is already injected by the compiler. \ No newline at end of file diff --git a/toolsrc/src/vcpkg-test/binarycaching.cpp b/toolsrc/src/vcpkg-test/binarycaching.cpp index a8204f9c2add0e..0b529f959e54ea 100644 --- a/toolsrc/src/vcpkg-test/binarycaching.cpp +++ b/toolsrc/src/vcpkg-test/binarycaching.cpp @@ -11,8 +11,22 @@ #include +#include + using namespace vcpkg; +#define REQUIRE_EQUAL_TEXT(lhs, rhs) \ + { \ + auto lhs_lines = Strings::split((lhs), '\n'); \ + auto rhs_lines = Strings::split((rhs), '\n'); \ + for (size_t i = 0; i < lhs_lines.size() && i < rhs_lines.size(); ++i) \ + { \ + INFO("on line: " << i); \ + REQUIRE(lhs_lines[i] == rhs_lines[i]); \ + } \ + REQUIRE(lhs_lines.size() == rhs_lines.size()); \ + } + TEST_CASE ("reformat_version semver-ish", "[reformat_version]") { REQUIRE(reformat_version("0.0.0", "abitag") == "0.0.0-abitag"); @@ -65,7 +79,7 @@ Build-Depends: bzip REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; - Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Triplet::X64_WINDOWS}, + Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Test::X64_WINDOWS}, scfl, Dependencies::RequestType::USER_REQUESTED, {{"a", {}}, {"b", {}}}); @@ -79,13 +93,43 @@ Build-Depends: bzip REQUIRE(ref.nupkg_filename() == "zlib2_x64-windows.1.5.0-packageabi.nupkg"); - auto nuspec = generate_nuspec(paths, ipa, ref); + { + auto nuspec = generate_nuspec(paths, ipa, ref, {}); +#ifdef _WIN32 +#define PKGPATH "C:\\zlib2_x64-windows\\**" +#else +#define PKGPATH "/zlib2_x64-windows/**" +#endif + std::string expected = R"( + + zlib2_x64-windows + 1.5.0-packageabi + vcpkg + NOT FOR DIRECT USE. Automatically generated cache package. + +a spiffy compression library wrapper + +Version: 1.5 +Triplet/Compiler hash: tripletabi +Features: a, b +Dependencies: + + + + + +)"; + REQUIRE_EQUAL_TEXT(nuspec, expected); + } + + { + auto nuspec = generate_nuspec(paths, ipa, ref, {"urlvalue"}); #ifdef _WIN32 #define PKGPATH "C:\\zlib2_x64-windows\\**" #else #define PKGPATH "/zlib2_x64-windows/**" #endif - std::string expected = R"( + std::string expected = R"( zlib2_x64-windows 1.5.0-packageabi @@ -100,18 +144,42 @@ Features: a, b Dependencies: + )"; - auto expected_lines = Strings::split(expected, '\n'); - auto nuspec_lines = Strings::split(nuspec, '\n'); - for (size_t i = 0; i < expected_lines.size() && i < nuspec_lines.size(); ++i) + REQUIRE_EQUAL_TEXT(nuspec, expected); + } { - INFO("on line: " << i); - REQUIRE(nuspec_lines[i] == expected_lines[i]); + auto nuspec = generate_nuspec(paths, ipa, ref, {"urlvalue", "branchvalue", "commitvalue"}); +#ifdef _WIN32 +#define PKGPATH "C:\\zlib2_x64-windows\\**" +#else +#define PKGPATH "/zlib2_x64-windows/**" +#endif + std::string expected = R"( + + zlib2_x64-windows + 1.5.0-packageabi + vcpkg + NOT FOR DIRECT USE. Automatically generated cache package. + +a spiffy compression library wrapper + +Version: 1.5 +Triplet/Compiler hash: tripletabi +Features: a, b +Dependencies: + + + + + + +)"; + REQUIRE_EQUAL_TEXT(nuspec, expected); } - REQUIRE(nuspec_lines.size() == expected_lines.size()); } TEST_CASE ("XmlSerializer", "[XmlSerializer]") @@ -177,7 +245,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[0].spec = PackageSpec("zlib", Triplet::X64_ANDROID); + plan.install_actions[0].spec = PackageSpec("zlib", Test::X64_ANDROID); plan.install_actions[0].source_control_file_location = scfl; plan.install_actions[0].abi_info = Build::AbiInfo{}; plan.install_actions[0].abi_info.get()->package_abi = "packageabi"; @@ -200,7 +268,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf2.has_value()); SourceControlFileLocation scfl2{std::move(*maybe_scf2.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[1].spec = PackageSpec("zlib2", Triplet::X64_ANDROID); + plan.install_actions[1].spec = PackageSpec("zlib2", Test::X64_ANDROID); plan.install_actions[1].source_control_file_location = scfl2; plan.install_actions[1].abi_info = Build::AbiInfo{}; plan.install_actions[1].abi_info.get()->package_abi = "packageabi2"; diff --git a/toolsrc/src/vcpkg-test/commands.build.cpp b/toolsrc/src/vcpkg-test/commands.build.cpp index 88749e7fe3b17d..76b205426c0bbb 100644 --- a/toolsrc/src/vcpkg-test/commands.build.cpp +++ b/toolsrc/src/vcpkg-test/commands.build.cpp @@ -21,11 +21,11 @@ TEST_CASE ("build smoke test", "[commands-build]") VcpkgCmdArguments args = VcpkgCmdArguments::create_from_arg_sequence(std::begin(args_raw), std::end(args_raw)); args.binary_caching = false; args.buildtrees_root_dir = - std::make_unique((Test::base_temporary_directory() / fs::u8path("buildtrees")).u8string()); + std::make_unique(fs::u8string(Test::base_temporary_directory() / fs::u8path("buildtrees"))); args.install_root_dir = - std::make_unique((Test::base_temporary_directory() / fs::u8path("installed")).u8string()); + std::make_unique(fs::u8string(Test::base_temporary_directory() / fs::u8path("installed"))); args.packages_root_dir = - std::make_unique((Test::base_temporary_directory() / fs::u8path("packages")).u8string()); + std::make_unique(fs::u8string(Test::base_temporary_directory() / fs::u8path("packages"))); VcpkgPaths paths(fs_wrapper, args); if (fs_wrapper.exists(paths.buildtrees)) fs_wrapper.remove_all_inside(paths.buildtrees, VCPKG_LINE_INFO); if (fs_wrapper.exists(paths.packages)) fs_wrapper.remove_all_inside(paths.packages, VCPKG_LINE_INFO); diff --git a/toolsrc/src/vcpkg-test/commands.cpp b/toolsrc/src/vcpkg-test/commands.cpp new file mode 100644 index 00000000000000..2c37798770c3c2 --- /dev/null +++ b/toolsrc/src/vcpkg-test/commands.cpp @@ -0,0 +1,69 @@ +#include + +#include +#include +#include + +using namespace vcpkg; + +TEST_CASE ("test commands are constructible", "[commands]") +{ + Commands::Contact::ContactCommand contact{}; + Commands::Version::VersionCommand version{}; +} + +TEST_CASE ("get_available_basic_commands works", "[commands]") +{ + auto commands_list = Commands::get_available_basic_commands(); + CHECK(commands_list.size() == 2); + CHECK(Commands::find("version", commands_list) != nullptr); + CHECK(Commands::find("contact", commands_list) != nullptr); + CHECK(Commands::find("aang", commands_list) == nullptr); +} + +TEST_CASE ("get_available_paths_commands works", "[commands]") +{ + auto commands_list = Commands::get_available_paths_commands(); + CHECK(commands_list.size() == 19); + + CHECK(Commands::find("/?", commands_list) != nullptr); + CHECK(Commands::find("help", commands_list) != nullptr); + CHECK(Commands::find("search", commands_list) != nullptr); + CHECK(Commands::find("list", commands_list) != nullptr); + CHECK(Commands::find("integrate", commands_list) != nullptr); + CHECK(Commands::find("owns", commands_list) != nullptr); + CHECK(Commands::find("update", commands_list) != nullptr); + CHECK(Commands::find("edit", commands_list) != nullptr); + CHECK(Commands::find("create", commands_list) != nullptr); + CHECK(Commands::find("cache", commands_list) != nullptr); + CHECK(Commands::find("portsdiff", commands_list) != nullptr); + CHECK(Commands::find("autocomplete", commands_list) != nullptr); + CHECK(Commands::find("hash", commands_list) != nullptr); + CHECK(Commands::find("fetch", commands_list) != nullptr); + CHECK(Commands::find("x-ci-clean", commands_list) != nullptr); + CHECK(Commands::find("x-history", commands_list) != nullptr); + CHECK(Commands::find("x-package-info", commands_list) != nullptr); + CHECK(Commands::find("x-vsinstances", commands_list) != nullptr); + CHECK(Commands::find("x-format-manifest", commands_list) != nullptr); + + CHECK(Commands::find("korra", commands_list) == nullptr); +} + +TEST_CASE ("get_available_commands_type_a works", "[commands]") +{ + auto commands_list = Commands::get_available_triplet_commands(); + CHECK(commands_list.size() == 10); + + CHECK(Commands::find("install", commands_list) != nullptr); + CHECK(Commands::find("x-set-installed", commands_list) != nullptr); + CHECK(Commands::find("ci", commands_list) != nullptr); + CHECK(Commands::find("remove", commands_list) != nullptr); + CHECK(Commands::find("upgrade", commands_list) != nullptr); + CHECK(Commands::find("build", commands_list) != nullptr); + CHECK(Commands::find("env", commands_list) != nullptr); + CHECK(Commands::find("build-external", commands_list) != nullptr); + CHECK(Commands::find("export", commands_list) != nullptr); + CHECK(Commands::find("depend-info", commands_list) != nullptr); + + CHECK(Commands::find("mai", commands_list) == nullptr); +} diff --git a/toolsrc/src/vcpkg-test/commands.create.cpp b/toolsrc/src/vcpkg-test/commands.create.cpp index 4d8b2fd5098f0a..0cc93bd57652fb 100644 --- a/toolsrc/src/vcpkg-test/commands.create.cpp +++ b/toolsrc/src/vcpkg-test/commands.create.cpp @@ -2,7 +2,7 @@ #include -#include +#include #include #include diff --git a/toolsrc/src/vcpkg-test/dependencies.cpp b/toolsrc/src/vcpkg-test/dependencies.cpp index 6bd9dfc42b4c4f..ef39bd1efb63fb 100644 --- a/toolsrc/src/vcpkg-test/dependencies.cpp +++ b/toolsrc/src/vcpkg-test/dependencies.cpp @@ -33,12 +33,12 @@ TEST_CASE ("filter depends", "[dependencies]") auto deps_ = parse_dependencies_list("liba (!uwp), libb, libc (uwp)"); REQUIRE(deps_); auto& deps = *deps_.get(); - auto v = filter_dependencies(deps, Triplet::X64_WINDOWS, x64_win_cmake_vars); + auto v = filter_dependencies(deps, Test::X64_WINDOWS, x64_win_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v.at(0).package_spec.name() == "liba"); REQUIRE(v.at(1).package_spec.name() == "libb"); - auto v2 = filter_dependencies(deps, Triplet::ARM_UWP, arm_uwp_cmake_vars); + auto v2 = filter_dependencies(deps, Test::ARM_UWP, arm_uwp_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v2.at(0).package_spec.name() == "libb"); REQUIRE(v2.at(1).package_spec.name() == "libc"); @@ -85,3 +85,67 @@ TEST_CASE ("qualified dependency", "[dependencies]") REQUIRE(plan2.install_actions.size() == 2); REQUIRE(plan2.install_actions.at(0).feature_list == std::vector{"b1", "core"}); } + +TEST_CASE ("resolve_deps_as_top_level", "[dependencies]") +{ + using namespace Test; + PackageSpecMap spec_map; + FullPackageSpec spec_a{spec_map.emplace("a", "b, b[b1] (linux)"), {}}; + FullPackageSpec spec_b{spec_map.emplace("b", "", {{"b1", ""}}), {}}; + FullPackageSpec spec_c{spec_map.emplace("c", "b", {{"c1", "b[b1]"}, {"c2", "c[c1], a"}}, {"c1"}), {"core"}}; + FullPackageSpec spec_d{spec_map.emplace("d", "c[core]"), {}}; + + PortFileProvider::MapPortFileProvider map_port{spec_map.map}; + MockCMakeVarProvider var_provider; + Triplet t_linux = Triplet::from_canonical_name("x64-linux"); + var_provider.dep_info_vars[{"a", t_linux}].emplace("VCPKG_CMAKE_SYSTEM_NAME", "Linux"); + { + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("a").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b); + } + { + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("a").source_control_file, t_linux, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == FullPackageSpec({"b", t_linux}, {"b1"})); + } + { + // without defaults + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b); + } + FullPackageSpec spec_b_with_b1{spec_b.package_spec, {"b1"}}; + { + // with defaults of c (c1) + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"default"}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b_with_b1); + } + { + // with c1 + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c1"}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b_with_b1); + } + { + // with c2 implying c1 + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c2"}, var_provider); + REQUIRE(deps.size() == 2); + REQUIRE(deps.at(0) == spec_a); + REQUIRE(deps.at(1) == spec_b_with_b1); + } + { + // d -> c[core] + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("d").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_c); + } +} diff --git a/toolsrc/src/vcpkg-test/files.cpp b/toolsrc/src/vcpkg-test/files.cpp index bc617d3268303d..a8c7c2ba2ff4f0 100644 --- a/toolsrc/src/vcpkg-test/files.cpp +++ b/toolsrc/src/vcpkg-test/files.cpp @@ -125,7 +125,7 @@ namespace { // regular symlink auto base_link = base; - base_link.replace_filename(base.filename().u8string() + "-orig"); + base_link.replace_filename(fs::u8string(base.filename()) + "-orig"); fs.write_contents(base_link, "", ec); CHECK_EC_ON_FILE(base_link, ec); vcpkg::Test::create_symlink(base_link, base, ec); @@ -155,6 +155,25 @@ namespace } } +TEST_CASE ("fs::combine works correctly", "[filesystem][files]") +{ + using namespace fs; + using namespace vcpkg::Files; + CHECK(combine(u8path("/a/b"), u8path("c/d")) == u8path("/a/b/c/d")); + CHECK(combine(u8path("a/b"), u8path("c/d")) == u8path("a/b/c/d")); + CHECK(combine(u8path("/a/b"), u8path("/c/d")) == u8path("/c/d")); + +#if defined(_WIN32) + CHECK(combine(u8path("C:/a/b"), u8path("c/d")) == u8path("C:/a/b/c/d")); + CHECK(combine(u8path("C:a/b"), u8path("c/d")) == u8path("C:a/b/c/d")); + CHECK(combine(u8path("C:a/b"), u8path("/c/d")) == u8path("C:/c/d")); + CHECK(combine(u8path("C:/a/b"), u8path("/c/d")) == u8path("C:/c/d")); + CHECK(combine(u8path("C:/a/b"), u8path("D:/c/d")) == u8path("D:/c/d")); + CHECK(combine(u8path("C:/a/b"), u8path("D:c/d")) == u8path("D:c/d")); + CHECK(combine(u8path("C:/a/b"), u8path("C:c/d")) == u8path("C:/a/b/c/d")); +#endif +} + TEST_CASE ("remove all", "[files]") { auto urbg = get_urbg(0); diff --git a/toolsrc/src/vcpkg-test/json.cpp b/toolsrc/src/vcpkg-test/json.cpp index 90a3537aba4636..6858a5ac82eeed 100644 --- a/toolsrc/src/vcpkg-test/json.cpp +++ b/toolsrc/src/vcpkg-test/json.cpp @@ -28,8 +28,8 @@ static std::string mystringify(const Value& val) { return Json::stringify(val, J TEST_CASE ("JSON stringify weird strings", "[json]") { - vcpkg::StringView str = U8_STR("😀 😁 😂 🤣 😃 😄 😅 😆 😉"); - REQUIRE(mystringify(Value::string(str)) == ('"' + str.to_string() + "\"\n")); + std::string str = U8_STR("😀 😁 😂 🤣 😃 😄 😅 😆 😉"); + REQUIRE(mystringify(Value::string(str)) == ('"' + str + "\"\n")); REQUIRE(mystringify(Value::string("\xED\xA0\x80")) == "\"\\ud800\"\n"); // unpaired surrogate } @@ -80,6 +80,49 @@ TEST_CASE ("JSON parse strings", "[json]") REQUIRE(res.get()->first.string() == grin); } +TEST_CASE ("JSON parse strings with escapes", "[json]") +{ + auto res = Json::parse(R"("\t")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\t"); + + res = Json::parse(R"("\\")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\\"); + + res = Json::parse(R"("\/")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "/"); + + res = Json::parse(R"("\b")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\b"); + + res = Json::parse(R"("\f")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\f"); + + res = Json::parse(R"("\n")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\n"); + + res = Json::parse(R"("\r")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\r"); + + res = Json::parse(R"("This is a \"test\", hopefully it worked")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == R"(This is a "test", hopefully it worked)"); +} + TEST_CASE ("JSON parse integers", "[json]") { auto res = Json::parse("0"); @@ -185,3 +228,14 @@ TEST_CASE ("JSON parse full file", "[json]") } REQUIRE(res); } + +TEST_CASE ("JSON track newlines", "[json]") +{ + auto res = Json::parse("{\n,", fs::u8path("filename")); + REQUIRE(!res); + REQUIRE(res.error()->format() == + R"(Error: filename:2:1: Unexpected character; expected property name + on expression: , + ^ +)"); +} diff --git a/toolsrc/src/vcpkg-test/manifests.cpp b/toolsrc/src/vcpkg-test/manifests.cpp index 108b2d0c5aad65..9a0ca94e21c653 100644 --- a/toolsrc/src/vcpkg-test/manifests.cpp +++ b/toolsrc/src/vcpkg-test/manifests.cpp @@ -5,9 +5,14 @@ #include #include +#include #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + using namespace vcpkg; using namespace vcpkg::Paragraphs; using namespace vcpkg::Test; @@ -68,10 +73,10 @@ TEST_CASE ("manifest construct maximum", "[manifests]") "name": "iroh", "description": "zuko's uncle", "dependencies": [ + "firebending", { "name": "tea" }, - "firebending", { "name": "order.white-lotus", "features": [ "the-ancient-ways" ], @@ -105,18 +110,20 @@ TEST_CASE ("manifest construct maximum", "[manifests]") REQUIRE(pgh.feature_paragraphs[0]->description.size() == 1); REQUIRE(pgh.feature_paragraphs[0]->description[0] == "zuko's uncle"); REQUIRE(pgh.feature_paragraphs[0]->dependencies.size() == 3); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "tea"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "firebending"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "order.white-lotus"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features.size() == 1); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features[0] == "the-ancient-ways"); - REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "firebending"); + + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "order.white-lotus"); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features.size() == 1); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features[0] == "the-ancient-ways"); + REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "arm"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", "Linux"}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "tea"); + REQUIRE(pgh.feature_paragraphs[1]->name == "zuko"); REQUIRE(pgh.feature_paragraphs[1]->description.size() == 2); REQUIRE(pgh.feature_paragraphs[1]->description[0] == "son of the fire lord"); @@ -134,8 +141,8 @@ TEST_CASE ("SourceParagraph manifest two dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); } TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") @@ -149,9 +156,10 @@ TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); } TEST_CASE ("SourceParagraph manifest construct qualified dependencies", "[manifests]") @@ -239,3 +247,50 @@ TEST_CASE ("SourceParagraph manifest empty supports", "[manifests]") true); REQUIRE_FALSE(m_pgh.has_value()); } + +TEST_CASE ("Serialize all the ports", "[manifests]") +{ + std::vector args_list = {"x-format-manifest"}; + auto& fs = Files::get_real_filesystem(); + auto args = VcpkgCmdArguments::create_from_arg_sequence(args_list.data(), args_list.data() + args_list.size()); + VcpkgPaths paths{fs, args}; + + std::vector scfs; + + for (auto dir : fs::directory_iterator(paths.ports)) + { + const auto control = dir / fs::u8path("CONTROL"); + const auto manifest = dir / fs::u8path("vcpkg.json"); + if (fs.exists(control)) + { + auto contents = fs.read_contents(control, VCPKG_LINE_INFO); + auto pghs = Paragraphs::parse_paragraphs(contents, fs::u8string(control)); + REQUIRE(pghs); + + scfs.push_back(std::move( + *SourceControlFile::parse_control_file(control, std::move(pghs).value_or_exit(VCPKG_LINE_INFO)) + .value_or_exit(VCPKG_LINE_INFO))); + } + else if (fs.exists(manifest)) + { + std::error_code ec; + auto contents = Json::parse_file(fs, manifest, ec); + REQUIRE_FALSE(ec); + REQUIRE(contents); + + auto scf = SourceControlFile::parse_manifest_file(manifest, + contents.value_or_exit(VCPKG_LINE_INFO).first.object()); + REQUIRE(scf); + + scfs.push_back(std::move(*scf.value_or_exit(VCPKG_LINE_INFO))); + } + } + + for (auto& scf : scfs) + { + auto serialized = serialize_manifest(scf); + auto serialized_scf = SourceControlFile::parse_manifest_file({}, serialized).value_or_exit(VCPKG_LINE_INFO); + + REQUIRE(*serialized_scf == scf); + } +} diff --git a/toolsrc/src/vcpkg-test/optional.cpp b/toolsrc/src/vcpkg-test/optional.cpp index 929410eb305178..f3c61387fd894b 100644 --- a/toolsrc/src/vcpkg-test/optional.cpp +++ b/toolsrc/src/vcpkg-test/optional.cpp @@ -1,6 +1,7 @@ #include #include +#include #include @@ -27,9 +28,39 @@ TEST_CASE ("equal", "[optional]") CHECK(Optional{42} == Optional{42}); } +TEST_CASE ("ref conversion", "[optional]") +{ + using vcpkg::Optional; + + Optional i_empty; + Optional i_1 = 1; + const Optional ci_1 = 1; + + Optional ref_empty = i_empty; + Optional cref_empty = i_empty; + + Optional ref_1 = i_1; + Optional cref_1 = ci_1; + + REQUIRE(ref_empty.has_value() == false); + REQUIRE(cref_empty.has_value() == false); + + REQUIRE(ref_1.get() == i_1.get()); + REQUIRE(cref_1.get() == ci_1.get()); + + ref_empty = i_1; + cref_empty = ci_1; + REQUIRE(ref_empty.get() == i_1.get()); + REQUIRE(cref_empty.get() == ci_1.get()); + + const int x = 5; + cref_1 = x; + REQUIRE(cref_1.get() == &x); +} + TEST_CASE ("common_projection", "[optional]") { - using vcpkg::common_projection; + using vcpkg::Util::common_projection; std::vector input; CHECK(!common_projection(input, identity_projection{}).has_value()); input.push_back(42); diff --git a/toolsrc/src/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index 2638a3900df61f..05ba8cfba3d803 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -87,8 +87,9 @@ TEST_CASE ("SourceParagraph two dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); } TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") @@ -102,9 +103,10 @@ TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); } TEST_CASE ("SourceParagraph construct qualified dependencies", "[paragraph]") diff --git a/toolsrc/src/vcpkg-test/plan.cpp b/toolsrc/src/vcpkg-test/plan.cpp index 09c377ecc1da57..55c6740da40acf 100644 --- a/toolsrc/src/vcpkg-test/plan.cpp +++ b/toolsrc/src/vcpkg-test/plan.cpp @@ -28,7 +28,7 @@ using Test::PackageSpecMap; static void features_check(Dependencies::InstallPlanAction& plan, std::string pkg_name, std::vector expected_features, - Triplet triplet = Triplet::X86_WINDOWS) + Triplet triplet = Test::X86_WINDOWS) { const auto& feature_list = plan.feature_list; @@ -54,7 +54,7 @@ static void features_check(Dependencies::InstallPlanAction& plan, /// static void remove_plan_check(Dependencies::RemovePlanAction& plan, std::string pkg_name, - Triplet triplet = Triplet::X86_WINDOWS) + Triplet triplet = Test::X86_WINDOWS) { REQUIRE(plan.spec.triplet().to_string() == triplet.to_string()); REQUIRE(pkg_name == plan.spec.name()); @@ -381,14 +381,14 @@ TEST_CASE ("basic feature test 8", "[plan]") std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; - spec_map.triplet = Triplet::X86_WINDOWS; + spec_map.triplet = Test::X86_WINDOWS; auto spec_a_86 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_86 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_86 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; @@ -401,14 +401,14 @@ TEST_CASE ("basic feature test 8", "[plan]") {spec_c_64, spec_a_86, spec_a_64, spec_c_86}, StatusParagraphs(std::move(status_paragraphs))); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); remove_plan_check(plan.remove_actions.at(1), "a"); auto& install_plan = plan.install_actions; - features_check(install_plan.at(0), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.at(1), "a", {"a1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.at(0), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.at(1), "a", {"a1", "core"}, Test::X64_WINDOWS); features_check(install_plan.at(2), "b", {"core"}); features_check(install_plan.at(3), "a", {"a1", "core"}); - features_check(install_plan.at(4), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.at(4), "c", {"core"}, Test::X64_WINDOWS); features_check(install_plan.at(5), "c", {"core"}); } @@ -416,10 +416,10 @@ TEST_CASE ("install all features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -432,7 +432,7 @@ TEST_CASE ("install all features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 1", "[plan]") @@ -440,11 +440,11 @@ TEST_CASE ("install default features test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" with default features "1" and features "0" and "1". - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -456,23 +456,23 @@ TEST_CASE ("install default features test 1", "[plan]") // Expect the default feature "1" to be installed, but not "0" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 2", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); // Add a port "a" of which "core" is already installed, but we will // install the default features "explicitly" // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -485,8 +485,8 @@ TEST_CASE ("install default features test 2", "[plan]") // Expect "a" to get removed for rebuild and then installed with default // features. REQUIRE(install_plan.size() == 2); - remove_plan_check(install_plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Triplet::X64_WINDOWS); + remove_plan_check(install_plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 3", "[plan]") @@ -494,11 +494,11 @@ TEST_CASE ("install default features test 3", "[plan]") std::vector> status_paragraphs; // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Explicitly install "a" without default features - auto install_specs = FullPackageSpec::from_string("a[core]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -510,7 +510,7 @@ TEST_CASE ("install default features test 3", "[plan]") // Expect the default feature not to get installed. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 1", "[plan]") @@ -518,13 +518,13 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -536,8 +536,8 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("do not install default features of dependency test 1", "[plan]") @@ -545,14 +545,14 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -565,8 +565,8 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 2", "[plan]") @@ -574,14 +574,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -593,14 +593,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("do not install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); @@ -608,10 +608,10 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -622,13 +622,13 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") // Expect "a" to get installed, but not require rebuilding "b" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has a default feature spec_map.emplace("b", "", {{"b1", ""}}, {"b1"}); @@ -636,10 +636,10 @@ TEST_CASE ("install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b", "", "b1")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -650,24 +650,24 @@ TEST_CASE ("install default features of existing dependency", "[plan]") // Expect "b" to be rebuilt REQUIRE(install_plan.install_actions.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 3", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -679,7 +679,7 @@ TEST_CASE ("install default features of dependency test 3", "[plan]") // Expect "a" to get installed, not the defaults of "b", as the required // dependencies are already there, installed explicitly by the user. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install plan action dependencies", "[plan]") @@ -688,13 +688,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -704,13 +704,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); // TODO: Figure out what to do with these tests - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b}); } @@ -720,13 +720,13 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "c, b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -736,12 +736,12 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b, // spec_c}); } @@ -752,11 +752,11 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", "a[0]"}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -766,7 +766,7 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(0).install_action.get()->computed_dependencies == std::vector{}); } @@ -827,7 +827,7 @@ TEST_CASE ("upgrade with default features 2", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); auto spec_b = spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0", "b1"}); @@ -837,10 +837,10 @@ TEST_CASE ("upgrade with default features 2", "[plan]") // The upgrade should install the new default feature b1 but not b0 REQUIRE(plan.size() == 4); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - remove_plan_check(plan.remove_actions.at(1), "b", Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(1), "b", Test::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("upgrade with default features 3", "[plan]") @@ -852,7 +852,7 @@ TEST_CASE ("upgrade with default features 3", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0"}); @@ -862,9 +862,9 @@ TEST_CASE ("upgrade with default features 3", "[plan]") // The upgrade should install the default feature REQUIRE(plan.size() == 3); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Test::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("upgrade with new default feature", "[plan]") @@ -883,20 +883,20 @@ TEST_CASE ("upgrade with new default feature", "[plan]") // The upgrade should install the new default feature but not the old default feature 0 REQUIRE(plan.size() == 2); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X86_WINDOWS); - features_check(plan.install_actions.at(0), "a", {"core", "1"}, Triplet::X86_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X86_WINDOWS); + features_check(plan.install_actions.at(0), "a", {"core", "1"}, Test::X86_WINDOWS); } TEST_CASE ("transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -908,21 +908,21 @@ TEST_CASE ("transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("no transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", ""}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -933,21 +933,21 @@ TEST_CASE ("no transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("only transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -958,9 +958,9 @@ TEST_CASE ("only transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("basic remove scheme", "[plan]") @@ -969,7 +969,7 @@ TEST_CASE ("basic remove scheme", "[plan]") pghs.push_back(make_status_pgh("a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 1); REQUIRE(remove_plan.at(0).spec.name() == "a"); @@ -982,7 +982,7 @@ TEST_CASE ("recurse remove scheme", "[plan]") pghs.push_back(make_status_pgh("b", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -997,7 +997,7 @@ TEST_CASE ("features depend remove scheme", "[plan]") pghs.push_back(make_status_feature_pgh("b", "0", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -1013,7 +1013,7 @@ TEST_CASE ("features depend remove scheme once removed", "[plan]") pghs.push_back(make_status_feature_pgh("opencv", "vtk", "vtk")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"expat", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"expat", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 3); REQUIRE(remove_plan.at(0).spec.name() == "opencv"); diff --git a/toolsrc/src/vcpkg-test/specifier.cpp b/toolsrc/src/vcpkg-test/specifier.cpp index f350ff60132b41..f750f4144f28f3 100644 --- a/toolsrc/src/vcpkg-test/specifier.cpp +++ b/toolsrc/src/vcpkg-test/specifier.cpp @@ -5,6 +5,8 @@ #include +#include + using namespace vcpkg; TEST_CASE ("specifier conversion", "[specifier]") @@ -13,8 +15,8 @@ TEST_CASE ("specifier conversion", "[specifier]") { constexpr std::size_t SPEC_SIZE = 6; - PackageSpec a_spec("a", Triplet::X64_WINDOWS); - PackageSpec b_spec("b", Triplet::X64_WINDOWS); + PackageSpec a_spec("a", Test::X64_WINDOWS); + PackageSpec b_spec("b", Test::X64_WINDOWS); auto fspecs = FullPackageSpec{a_spec, {"0", "1"}}.to_feature_specs({}, {}); auto fspecs2 = FullPackageSpec{b_spec, {"2", "3"}}.to_feature_specs({}, {}); @@ -94,19 +96,18 @@ TEST_CASE ("specifier parsing", "[specifier]") SECTION ("expand wildcards") { - auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); - auto openssl = - vcpkg::FullPackageSpec::from_string("openssl[*]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto openssl = vcpkg::FullPackageSpec::from_string("openssl[*]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); auto specs = zlib.to_feature_specs({}, {}); auto specs2 = openssl.to_feature_specs({}, {}); Util::Vectors::append(&specs, specs2); Util::sort(specs); std::vector spectargets{ - {{"openssl", Triplet::X86_UWP}, "core"}, - {{"zlib", Triplet::X86_UWP}, "core"}, - {{"zlib", Triplet::X86_UWP}, "0"}, - {{"zlib", Triplet::X86_UWP}, "1"}, + {{"openssl", Test::X86_UWP}, "core"}, + {{"zlib", Test::X86_UWP}, "core"}, + {{"zlib", Test::X86_UWP}, "0"}, + {{"zlib", Test::X86_UWP}, "1"}, }; Util::sort(spectargets); REQUIRE(specs.size() == spectargets.size()); diff --git a/toolsrc/src/vcpkg-test/statusparagraphs.cpp b/toolsrc/src/vcpkg-test/statusparagraphs.cpp index 382eab1a72fcdd..f647484e603062 100644 --- a/toolsrc/src/vcpkg-test/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg-test/statusparagraphs.cpp @@ -28,7 +28,7 @@ Status: install ok installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it != status_db.end()); } @@ -49,7 +49,7 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it == status_db.end()); } @@ -78,11 +78,11 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it != status_db.end()); // Feature "openssl" is not installed and should not be found - auto it1 = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); + auto it1 = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); REQUIRE(it1 == status_db.end()); } @@ -111,6 +111,6 @@ Status: install ok installed Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); // Feature "openssl" is installed and should therefore be found - auto it = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); + auto it = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); REQUIRE(it != status_db.end()); } diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index 95a6de2af9d086..cc45365e691a73 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -8,6 +8,10 @@ #include #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + TEST_CASE ("b32 encoding", "[strings]") { using u64 = uint64_t; diff --git a/toolsrc/src/vcpkg-test/system.cpp b/toolsrc/src/vcpkg-test/system.cpp index 01540635816275..dec7b576917d9c 100644 --- a/toolsrc/src/vcpkg-test/system.cpp +++ b/toolsrc/src/vcpkg-test/system.cpp @@ -11,6 +11,10 @@ #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + using vcpkg::nullopt; using vcpkg::Optional; using vcpkg::StringView; diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index 74ade3aeb89220..083861bc2031b7 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -39,6 +39,12 @@ namespace vcpkg::Test { + const Triplet X86_WINDOWS = Triplet::from_canonical_name("x86-windows"); + const Triplet X64_WINDOWS = Triplet::from_canonical_name("x64-windows"); + const Triplet X86_UWP = Triplet::from_canonical_name("x86-uwp"); + const Triplet ARM_UWP = Triplet::from_canonical_name("arm-uwp"); + const Triplet X64_ANDROID = Triplet::from_canonical_name("x64-android"); + std::unique_ptr make_control_file( const char* name, const char* depends, @@ -189,7 +195,9 @@ namespace vcpkg::Test ec.assign(errno, std::system_category()); } #else - Util::unused(target, file, ec); + (void)target; + (void)file; + (void)ec; vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message); #endif } @@ -211,7 +219,9 @@ namespace vcpkg::Test #elif FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_UNIX ::vcpkg::Test::create_symlink(target, file, ec); #else - Util::unused(target, file, ec); + (void)target; + (void)file; + (void)ec; vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message); #endif } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 40ccb1668470ee..6c30f7ced0abbd 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -8,7 +8,9 @@ #include #include +#include #include +#include #include #include #include @@ -66,16 +68,18 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } }; - if (const auto command_function = find_command(Commands::get_available_commands_type_c())) + if (const auto command_function = find_command(Commands::get_available_basic_commands())) { - return command_function->function(args, fs); + return command_function->function->perform_and_exit(args, fs); } const VcpkgPaths paths(fs, args); paths.track_feature_flag_metrics(); fs.current_path(paths.root, VCPKG_LINE_INFO); - if (args.command == "install" || args.command == "remove" || args.command == "export" || args.command == "update") + if ((args.command == "install" || args.command == "remove" || args.command == "export" || + args.command == "update") && + !args.output_json()) { Commands::Version::warn_if_vcpkg_version_mismatch(paths); std::string surveydate = *GlobalState::g_surveydate.lock(); @@ -102,17 +106,17 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } } - if (const auto command_function = find_command(Commands::get_available_commands_type_b())) + if (const auto command_function = find_command(Commands::get_available_paths_commands())) { - return command_function->function(args, paths); + return command_function->function->perform_and_exit(args, paths); } Triplet default_triplet = vcpkg::default_triplet(args); Input::check_triplet(default_triplet, paths); - if (const auto command_function = find_command(Commands::get_available_commands_type_a())) + if (const auto command_function = find_command(Commands::get_available_triplet_commands())) { - return command_function->function(args, paths, default_triplet); + return command_function->function->perform_and_exit(args, paths, default_triplet); } return invalid_command(args.command); @@ -231,6 +235,14 @@ int main(const int argc, const char* const* const argv) load_config(fs); +#if (defined(__aarch64__) || defined(__arm__) || defined(_M_ARM) || defined(_M_ARM64)) && !defined(_WIN32) + if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm platform."); + } +#endif + VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(fs, argc, argv); args.imbue_from_environment(); args.check_feature_flag_consistency(); diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index ca82b3100f29ac..4c97a7b5affbad 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -1,16 +1,16 @@ -#include "pch.h" - #include #include #include +#include +#include namespace vcpkg::Archives { void extract_archive(const VcpkgPaths& paths, const fs::path& archive, const fs::path& to_path) { Files::Filesystem& fs = paths.get_filesystem(); - const fs::path to_path_partial = to_path.u8string() + ".partial" + const fs::path to_path_partial = fs::u8string(to_path) + ".partial" #if defined(_WIN32) + "." + std::to_string(GetCurrentProcessId()) #endif @@ -30,7 +30,7 @@ namespace vcpkg::Archives recursion_limiter_sevenzip_old = true; const auto nuget_exe = paths.get_tool_exe(Tools::NUGET); - const std::string stem = archive.stem().u8string(); + const std::string stem = fs::u8string(archive.stem()); // assuming format of [name].[version in the form d.d.d] // This assumption may not always hold std::smatch match; @@ -38,23 +38,23 @@ namespace vcpkg::Archives Checks::check_exit(VCPKG_LINE_INFO, has_match, "Could not deduce nuget id and version from filename: %s", - archive.u8string()); + fs::u8string(archive)); const std::string nugetid = match[1]; const std::string version = match[2]; const auto code_and_output = System::cmd_execute_and_capture_output(Strings::format( R"("%s" install %s -Version %s -OutputDirectory "%s" -Source "%s" -nocache -DirectDownload -NonInteractive -ForceEnglishOutput -PackageSaveMode nuspec)", - nuget_exe.u8string(), + fs::u8string(nuget_exe), nugetid, version, - to_path_partial.u8string(), - paths.downloads.u8string())); + fs::u8string(to_path_partial), + fs::u8string(paths.downloads))); Checks::check_exit(VCPKG_LINE_INFO, code_and_output.exit_code == 0, "Failed to extract '%s' with message:\n%s", - archive.u8string(), + fs::u8string(archive), code_and_output.output); recursion_limiter_sevenzip_old = false; } @@ -64,12 +64,15 @@ namespace vcpkg::Archives Checks::check_exit(VCPKG_LINE_INFO, !recursion_limiter_sevenzip); recursion_limiter_sevenzip = true; const auto seven_zip = paths.get_tool_exe(Tools::SEVEN_ZIP); - const auto code_and_output = System::cmd_execute_and_capture_output(Strings::format( - R"("%s" x "%s" -o"%s" -y)", seven_zip.u8string(), archive.u8string(), to_path_partial.u8string())); + const auto code_and_output = + System::cmd_execute_and_capture_output(Strings::format(R"("%s" x "%s" -o"%s" -y)", + fs::u8string(seven_zip), + fs::u8string(archive), + fs::u8string(to_path_partial))); Checks::check_exit(VCPKG_LINE_INFO, code_and_output.exit_code == 0, "7zip failed while extracting '%s' with message:\n%s", - archive.u8string(), + fs::u8string(archive), code_and_output.output); recursion_limiter_sevenzip = false; } @@ -77,18 +80,18 @@ namespace vcpkg::Archives if (ext == ".gz" && ext.extension() != ".tar") { const auto code = System::cmd_execute( - Strings::format(R"(cd '%s' && tar xzf '%s')", to_path_partial.u8string(), archive.u8string())); - Checks::check_exit(VCPKG_LINE_INFO, code == 0, "tar failed while extracting %s", archive.u8string()); + Strings::format(R"(cd '%s' && tar xzf '%s')", fs::u8string(to_path_partial), fs::u8string(archive))); + Checks::check_exit(VCPKG_LINE_INFO, code == 0, "tar failed while extracting %s", fs::u8string(archive)); } else if (ext == ".zip") { const auto code = System::cmd_execute( - Strings::format(R"(cd '%s' && unzip -qqo '%s')", to_path_partial.u8string(), archive.u8string())); - Checks::check_exit(VCPKG_LINE_INFO, code == 0, "unzip failed while extracting %s", archive.u8string()); + Strings::format(R"(cd '%s' && unzip -qqo '%s')", fs::u8string(to_path_partial), fs::u8string(archive))); + Checks::check_exit(VCPKG_LINE_INFO, code == 0, "unzip failed while extracting %s", fs::u8string(archive)); } else { - Checks::exit_with_message(VCPKG_LINE_INFO, "Unexpected archive extension: %s", ext.u8string()); + Checks::exit_with_message(VCPKG_LINE_INFO, "Unexpected archive extension: %s", fs::u8string(ext)); } #endif @@ -106,8 +109,8 @@ namespace vcpkg::Archives !ec, "Failed to do post-extract rename-in-place.\n" "fs.rename(%s, %s, %s)", - to_path_partial.u8string(), - to_path.u8string(), + fs::u8string(to_path_partial), + fs::u8string(to_path), ec.message()); } } diff --git a/toolsrc/src/vcpkg/base/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index 42e0835c6bcdeb..c0075e33f546a9 100644 --- a/toolsrc/src/vcpkg/base/checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/chrono.cpp b/toolsrc/src/vcpkg/base/chrono.cpp index 86dc590f8ffad2..971d5f37e04a2d 100644 --- a/toolsrc/src/vcpkg/base/chrono.cpp +++ b/toolsrc/src/vcpkg/base/chrono.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/cofffilereader.cpp b/toolsrc/src/vcpkg/base/cofffilereader.cpp index cb75e084750911..30e0f8588a87fa 100644 --- a/toolsrc/src/vcpkg/base/cofffilereader.cpp +++ b/toolsrc/src/vcpkg/base/cofffilereader.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 051e8306fa0a8a..40f0494f9c2199 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -22,7 +20,7 @@ namespace vcpkg::Downloads const auto dir = fs::path(target_file_path.c_str()).parent_path(); std::error_code ec; fs.create_directories(dir, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directories %s", dir.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directories %s", fs::u8string(dir)); FILE* f = nullptr; const errno_t err = fopen_s(&f, target_file_path.c_str(), "wb"); @@ -164,7 +162,7 @@ namespace vcpkg::Downloads " Expected hash : [ %s ]\n" " Actual hash : [ %s ]\n", url, - path.u8string(), + fs::u8string(path), sha512, actual_hash); } @@ -174,7 +172,7 @@ namespace vcpkg::Downloads const fs::path& download_path, const std::string& sha512) { - const std::string download_path_part = download_path.u8string() + ".part"; + const std::string download_path_part = fs::u8string(download_path) + ".part"; auto download_path_part_path = fs::u8path(download_path_part); std::error_code ec; fs.remove(download_path, ec); diff --git a/toolsrc/src/vcpkg/base/enums.cpp b/toolsrc/src/vcpkg/base/enums.cpp index aa124f3aa9b427..8b99ddf7bacb3f 100644 --- a/toolsrc/src/vcpkg/base/enums.cpp +++ b/toolsrc/src/vcpkg/base/enums.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 902b482d2acb32..42efd473f3f0c9 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -20,6 +18,32 @@ #include #endif // ^^^ defined(__APPLE__) +fs::path fs::u8path(vcpkg::StringView s) +{ +#if defined(_WIN32) + return fs::path(vcpkg::Strings::to_utf16(s)); +#else + return fs::path(s.begin(), s.end()); +#endif +} + +std::string fs::u8string(const fs::path& p) +{ +#if defined(_WIN32) + return vcpkg::Strings::to_utf8(p.native()); +#else + return p.native(); +#endif +} +std::string fs::generic_u8string(const fs::path& p) +{ +#if defined(_WIN32) + return vcpkg::Strings::to_utf8(p.generic_wstring()); +#else + return p.generic_string(); +#endif +} + namespace vcpkg::Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); @@ -133,7 +157,7 @@ namespace vcpkg::Files CloseHandle(handle); return target; } -#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM +#endif // ^^^ defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM void copy_symlink_implementation(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) { @@ -141,7 +165,12 @@ namespace vcpkg::Files const auto target = read_symlink_implementation(oldpath, ec); if (ec) return; - const DWORD flags = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; + const DWORD flags = +#if defined(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE) + SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; +#else + 0; +#endif if (!CreateSymbolicLinkW(newpath.c_str(), target.c_str(), flags)) { const auto err = GetLastError(); @@ -202,13 +231,13 @@ namespace vcpkg::Files return std::move(*p); else Checks::exit_with_message( - linfo, "error reading file: %s: %s", path.u8string(), maybe_contents.error().message()); + linfo, "error reading file: %s: %s", fs::u8string(path), maybe_contents.error().message()); } void Filesystem::write_contents(const fs::path& path, const std::string& data, LineInfo linfo) { std::error_code ec; this->write_contents(path, data, ec); - if (ec) Checks::exit_with_message(linfo, "error writing file: %s: %s", path.u8string(), ec.message()); + if (ec) Checks::exit_with_message(linfo, "error writing file: %s: %s", fs::u8string(path), ec.message()); } void Filesystem::rename(const fs::path& oldpath, const fs::path& newpath, LineInfo linfo) { @@ -216,14 +245,14 @@ namespace vcpkg::Files this->rename(oldpath, newpath, ec); if (ec) Checks::exit_with_message( - linfo, "error renaming file: %s: %s: %s", oldpath.u8string(), newpath.u8string(), ec.message()); + linfo, "error renaming file: %s: %s: %s", fs::u8string(oldpath), fs::u8string(newpath), ec.message()); } bool Filesystem::remove(const fs::path& path, LineInfo linfo) { std::error_code ec; auto r = this->remove(path, ec); - if (ec) Checks::exit_with_message(linfo, "error removing file: %s: %s", path.u8string(), ec.message()); + if (ec) Checks::exit_with_message(linfo, "error removing file: %s: %s", fs::u8string(path), ec.message()); return r; } @@ -242,7 +271,8 @@ namespace vcpkg::Files { std::error_code ec; auto result = this->exists(path, ec); - if (ec) Checks::exit_with_message(li, "error checking existence of file %s: %s", path.u8string(), ec.message()); + if (ec) + Checks::exit_with_message(li, "error checking existence of file %s: %s", fs::u8string(path), ec.message()); return result; } @@ -264,7 +294,7 @@ namespace vcpkg::Files bool result = this->create_directory(path, ec); if (ec) { - vcpkg::Checks::exit_with_message(li, "error creating directory %s", path.u8string(), ec.message()); + vcpkg::Checks::exit_with_message(li, "error creating directory %s", fs::u8string(path), ec.message()); } return result; @@ -282,7 +312,7 @@ namespace vcpkg::Files bool result = this->create_directories(path, ec); if (ec) { - vcpkg::Checks::exit_with_message(li, "error creating directories %s", path.u8string(), ec.message()); + vcpkg::Checks::exit_with_message(li, "error creating directories %s", fs::u8string(path), ec.message()); } return result; @@ -294,7 +324,7 @@ namespace vcpkg::Files this->copy_file(oldpath, newpath, opts, ec); if (ec) vcpkg::Checks::exit_with_message( - li, "error copying file from %s to %s: %s", oldpath.u8string(), newpath.u8string(), ec.message()); + li, "error copying file from %s to %s: %s", fs::u8string(oldpath), fs::u8string(newpath), ec.message()); } fs::file_status Filesystem::status(vcpkg::LineInfo li, const fs::path& p) const noexcept @@ -331,7 +361,7 @@ namespace vcpkg::Files { std::error_code ec; this->write_lines(path, lines, ec); - if (ec) Checks::exit_with_message(linfo, "error writing lines: %s: %s", path.u8string(), ec.message()); + if (ec) Checks::exit_with_message(linfo, "error writing lines: %s: %s", fs::u8string(path), ec.message()); } void Filesystem::remove_all(const fs::path& path, LineInfo li) @@ -468,8 +498,7 @@ namespace vcpkg::Files return output; } - virtual fs::path find_file_recursively_up(const fs::path& starting_dir, - const std::string& filename) const override + virtual fs::path find_file_recursively_up(const fs::path& starting_dir, const fs::path& filename) const override { fs::path current_dir = starting_dir; if (exists(VCPKG_LINE_INFO, current_dir / filename)) @@ -571,7 +600,7 @@ namespace vcpkg::Files std::error_code& ec) override { this->rename(oldpath, newpath, ec); - Util::unused(temp_suffix); + (void)temp_suffix; #if !defined(_WIN32) if (ec) { @@ -705,7 +734,7 @@ namespace vcpkg::Files fs::stdfs::remove(current_path, ec); if (check_ec(ec, current_path, err)) return; } -#else // ^^^ VCPKG_USE_STD_FILESYSTEM // !VCPKG_USE_STD_FILESYSTEM vvv +#else // ^^^ VCPKG_USE_STD_FILESYSTEM // !VCPKG_USE_STD_FILESYSTEM vvv #if defined(_WIN32) else if (path_type == fs::file_type::directory_symlink) { @@ -897,7 +926,7 @@ namespace vcpkg::Files { #if VCPKG_USE_STD_FILESYSTEM return fs::stdfs::absolute(path, ec); -#else // ^^^ VCPKG_USE_STD_FILESYSTEM / !VCPKG_USE_STD_FILESYSTEM vvv +#else // ^^^ VCPKG_USE_STD_FILESYSTEM / !VCPKG_USE_STD_FILESYSTEM vvv #if defined(_WIN32) // absolute was called system_complete in experimental filesystem return fs::stdfs::system_complete(path, ec); @@ -1014,7 +1043,7 @@ namespace vcpkg::Files return res; } - System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); + System::printf("Waiting to take filesystem lock on %s...\n", fs::u8string(path)); const auto wait = std::chrono::milliseconds(1000); for (;;) { @@ -1036,7 +1065,7 @@ namespace vcpkg::Files return res; } - System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); + Debug::print("Waiting to take filesystem lock on ", fs::u8string(path), "...\n"); auto wait = std::chrono::milliseconds(100); // waits, at most, a second and a half. while (wait < std::chrono::milliseconds(1000)) @@ -1089,7 +1118,7 @@ namespace vcpkg::Files if (Util::find(ret, p) == ret.end() && this->exists(p, ec)) { ret.push_back(p); - Debug::print("Found path: ", p.u8string(), '\n'); + Debug::print("Found path: ", fs::u8string(p), '\n'); } } } @@ -1124,7 +1153,8 @@ namespace vcpkg::Files { #if VCPKG_USE_STD_FILESYSTEM return lhs / rhs; -#else // ^^^ VCPKG_USE_STD_FILESYSTEM // !VCPKG_USE_STD_FILESYSTEM vvv +#else // ^^^ std::filesystem // std::experimental::filesystem vvv +#if !defined(_WIN32) if (rhs.is_absolute()) { return rhs; @@ -1133,6 +1163,37 @@ namespace vcpkg::Files { return lhs / rhs; } -#endif +#else // ^^^ unix // windows vvv + auto rhs_root_directory = rhs.root_directory(); + auto rhs_root_name = rhs.root_name(); + + if (rhs_root_directory.empty() && rhs_root_name.empty()) + { + return lhs / rhs; + } + else if (rhs_root_directory.empty()) + { + // !rhs_root_name.empty() + if (rhs_root_name == lhs.root_name()) + { + return lhs / rhs.relative_path(); + } + else + { + return rhs; + } + } + else if (rhs_root_name.empty()) + { + // !rhs_root_directory.empty() + return lhs.root_name() / rhs; + } + else + { + // rhs.absolute() + return rhs; + } +#endif // ^^^ windows +#endif // ^^^ std::experimental::filesystem } } diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 58e17e1ad47803..0070a5f72647c3 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/json.cpp b/toolsrc/src/vcpkg/base/json.cpp index 75b917523e57f3..495a36e32e05a4 100644 --- a/toolsrc/src/vcpkg/base/json.cpp +++ b/toolsrc/src/vcpkg/base/json.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,6 +5,8 @@ #include +#include + namespace vcpkg::Json { using VK = ValueKind; @@ -37,8 +37,11 @@ namespace vcpkg::Json ValueImpl(ValueKindConstant vk, int64_t i) : tag(vk), integer(i) { } ValueImpl(ValueKindConstant vk, double d) : tag(vk), number(d) { } ValueImpl(ValueKindConstant vk, std::string&& s) : tag(vk), string(std::move(s)) { } + ValueImpl(ValueKindConstant vk, const std::string& s) : tag(vk), string(s) { } ValueImpl(ValueKindConstant vk, Array&& arr) : tag(vk), array(std::move(arr)) { } + ValueImpl(ValueKindConstant vk, const Array& arr) : tag(vk), array(arr) { } ValueImpl(ValueKindConstant vk, Object&& obj) : tag(vk), object(std::move(obj)) { } + ValueImpl(ValueKindConstant vk, const Object& obj) : tag(vk), object(obj) { } ValueImpl& operator=(ValueImpl&& other) noexcept { @@ -140,30 +143,30 @@ namespace vcpkg::Json } StringView Value::string() const noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string(), "json value is not string"); return underlying_->string; } const Array& Value::array() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); return underlying_->array; } Array& Value::array() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); return underlying_->array; } Array&& Value::array() && noexcept { return std::move(this->array()); } const Object& Value::object() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); return underlying_->object; } Object& Value::object() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); return underlying_->object; } Object&& Value::object() && noexcept { return std::move(this->object()); } @@ -171,23 +174,65 @@ namespace vcpkg::Json Value::Value() noexcept = default; Value::Value(Value&&) noexcept = default; Value& Value::operator=(Value&&) noexcept = default; - Value::~Value() = default; - Value Value::clone() const noexcept + Value::Value(const Value& other) { - switch (kind()) + switch (other.kind()) { - case ValueKind::Null: return Value::null(nullptr); - case ValueKind::Boolean: return Value::boolean(boolean()); - case ValueKind::Integer: return Value::integer(integer()); - case ValueKind::Number: return Value::number(number()); - case ValueKind::String: return Value::string(string()); - case ValueKind::Array: return Value::array(array().clone()); - case ValueKind::Object: return Value::object(object().clone()); - default: Checks::exit_fail(VCPKG_LINE_INFO); + case ValueKind::Null: return; // default construct underlying_ + case ValueKind::Boolean: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); + break; + case ValueKind::Integer: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); + break; + case ValueKind::Number: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); + break; + case ValueKind::String: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); + break; + case ValueKind::Array: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); + break; + case ValueKind::Object: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); + break; + default: Checks::unreachable(VCPKG_LINE_INFO); } } + Value& Value::operator=(const Value& other) + { + switch (other.kind()) + { + case ValueKind::Null: underlying_.reset(); break; + case ValueKind::Boolean: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); + break; + case ValueKind::Integer: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); + break; + case ValueKind::Number: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); + break; + case ValueKind::String: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); + break; + case ValueKind::Array: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); + break; + case ValueKind::Object: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); + break; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + + return *this; + } + + Value::~Value() = default; + Value Value::null(std::nullptr_t) noexcept { return Value(); } Value Value::boolean(bool b) noexcept { @@ -208,15 +253,15 @@ namespace vcpkg::Json val.underlying_ = std::make_unique(ValueKindConstant(), d); return val; } - Value Value::string(StringView sv) noexcept + Value Value::string(std::string s) noexcept { - if (!Unicode::utf8_is_valid_string(sv.begin(), sv.end())) + if (!Unicode::utf8_is_valid_string(s.data(), s.data() + s.size())) { - Debug::print("Invalid string: ", sv, '\n'); - vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid utf8 passed to Value::string(StringView)"); + Debug::print("Invalid string: ", s, '\n'); + vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid utf8 passed to Value::string(std::string)"); } Value val; - val.underlying_ = std::make_unique(ValueKindConstant(), sv.to_string()); + val.underlying_ = std::make_unique(ValueKindConstant(), std::move(s)); return val; } Value Value::array(Array&& arr) noexcept @@ -225,25 +270,43 @@ namespace vcpkg::Json val.underlying_ = std::make_unique(ValueKindConstant(), std::move(arr)); return val; } + Value Value::array(const Array& arr) noexcept + { + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), arr); + return val; + } Value Value::object(Object&& obj) noexcept { Value val; val.underlying_ = std::make_unique(ValueKindConstant(), std::move(obj)); return val; } - // } struct Value - // struct Array { - Array Array::clone() const noexcept + Value Value::object(const Object& obj) noexcept { - Array arr; - arr.underlying_.reserve(size()); - for (const auto& el : *this) + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), obj); + return val; + } + + bool operator==(const Value& lhs, const Value& rhs) + { + if (lhs.kind() != rhs.kind()) return false; + + switch (lhs.kind()) { - arr.underlying_.push_back(el.clone()); + case ValueKind::Null: return true; + case ValueKind::Boolean: return lhs.underlying_->boolean == rhs.underlying_->boolean; + case ValueKind::Integer: return lhs.underlying_->integer == rhs.underlying_->integer; + case ValueKind::Number: return lhs.underlying_->number == rhs.underlying_->number; + case ValueKind::String: return lhs.underlying_->string == rhs.underlying_->string; + case ValueKind::Array: return lhs.underlying_->string == rhs.underlying_->string; + case ValueKind::Object: return lhs.underlying_->string == rhs.underlying_->string; + default: Checks::unreachable(VCPKG_LINE_INFO); } - return arr; } - + // } struct Value + // struct Array { Value& Array::push_back(Value&& value) { underlying_.push_back(std::move(value)); @@ -265,6 +328,7 @@ namespace vcpkg::Json { return insert_before(it, Value::array(std::move(arr))).array(); } + bool operator==(const Array& lhs, const Array& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Array // struct Object { Value& Object::insert(std::string key, Value&& value) @@ -273,14 +337,29 @@ namespace vcpkg::Json underlying_.push_back({std::move(key), std::move(value)}); return underlying_.back().second; } + Value& Object::insert(std::string key, const Value& value) + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, !contains(key)); + underlying_.push_back({std::move(key), value}); + return underlying_.back().second; + } Array& Object::insert(std::string key, Array&& value) { return insert(std::move(key), Value::array(std::move(value))).array(); } + Array& Object::insert(std::string key, const Array& value) + { + return insert(std::move(key), Value::array(value)).array(); + } Object& Object::insert(std::string key, Object&& value) { return insert(std::move(key), Value::object(std::move(value))).object(); } + Object& Object::insert(std::string key, const Object& value) + { + return insert(std::move(key), Value::object(value)).object(); + } + Value& Object::insert_or_replace(std::string key, Value&& value) { auto v = get(key); @@ -295,14 +374,36 @@ namespace vcpkg::Json return underlying_.back().second; } } + Value& Object::insert_or_replace(std::string key, const Value& value) + { + auto v = get(key); + if (v) + { + *v = value; + return *v; + } + else + { + underlying_.push_back({std::move(key), std::move(value)}); + return underlying_.back().second; + } + } Array& Object::insert_or_replace(std::string key, Array&& value) { return insert_or_replace(std::move(key), Value::array(std::move(value))).array(); } + Array& Object::insert_or_replace(std::string key, const Array& value) + { + return insert_or_replace(std::move(key), Value::array(value)).array(); + } Object& Object::insert_or_replace(std::string key, Object&& value) { return insert_or_replace(std::move(key), Value::object(std::move(value))).object(); } + Object& Object::insert_or_replace(std::string key, const Object& value) + { + return insert_or_replace(std::move(key), Value::object(value)).object(); + } auto Object::internal_find_key(StringView key) const noexcept -> underlying_t::const_iterator { @@ -350,16 +451,14 @@ namespace vcpkg::Json } } - Object Object::clone() const noexcept + void Object::sort_keys() { - Object obj; - obj.underlying_.reserve(size()); - for (const auto& el : *this) - { - obj.insert(el.first.to_string(), el.second.clone()); - } - return obj; + std::sort(underlying_.begin(), underlying_.end(), [](const value_type& lhs, const value_type& rhs) { + return lhs.first < rhs.first; + }); } + + bool operator==(const Object& lhs, const Object& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Object // auto parse() { @@ -390,10 +489,6 @@ namespace vcpkg::Json { return code_point == '-' || is_digit(code_point); } - static bool is_keyword_start(char32_t code_point) noexcept - { - return code_point == 'f' || code_point == 'n' || code_point == 't'; - } static unsigned char from_hex_digit(char32_t code_point) noexcept { @@ -411,7 +506,7 @@ namespace vcpkg::Json } else { - vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + vcpkg::Checks::unreachable(VCPKG_LINE_INFO); } } @@ -448,14 +543,14 @@ namespace vcpkg::Json switch (current) { - case '"': return '"'; - case '\\': return '\\'; - case '/': return '/'; - case 'b': return '\b'; - case 'f': return '\f'; - case 'n': return '\n'; - case 'r': return '\r'; - case 't': return '\t'; + case '"': next(); return '"'; + case '\\': next(); return '\\'; + case '/': next(); return '/'; + case 'b': next(); return '\b'; + case 'f': next(); return '\f'; + case 'n': next(); return '\n'; + case 'r': next(); return '\r'; + case 't': next(); return '\t'; case 'u': { char16_t code_unit = 0; @@ -657,7 +752,7 @@ namespace vcpkg::Json rest = U"ull"; val = Value::null(nullptr); break; - default: vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + default: vcpkg::Checks::unreachable(VCPKG_LINE_INFO); } for (const char32_t* rest_it = rest; *rest_it != '\0'; ++rest_it) @@ -708,6 +803,7 @@ namespace vcpkg::Json } else if (current == ',') { + auto comma_loc = cur_loc(); next(); skip_whitespace(); current = cur(); @@ -718,7 +814,7 @@ namespace vcpkg::Json } if (current == ']') { - add_error("Trailing comma in array"); + add_error("Trailing comma in array", comma_loc); return Value::array(std::move(arr)); } } @@ -804,6 +900,7 @@ namespace vcpkg::Json } else if (current == ',') { + auto comma_loc = cur_loc(); next(); skip_whitespace(); current = cur(); @@ -814,7 +911,7 @@ namespace vcpkg::Json } else if (current == '}') { - add_error("Trailing comma in an object"); + add_error("Trailing comma in an object", comma_loc); return Value(); } } @@ -889,6 +986,33 @@ namespace vcpkg::Json }; } + bool IdentifierDeserializer::is_ident(StringView sv) + { + static const std::regex BASIC_IDENTIFIER = std::regex(R"([a-z0-9]+(-[a-z0-9]+)*)"); + + // we only check for lowercase in RESERVED since we already remove all + // strings with uppercase letters from the basic check + static const std::regex RESERVED = std::regex(R"(prn|aux|nul|con|(lpt|com)[1-9]|core|default)"); + + // back-compat + if (sv == "all_modules") + { + return true; + } + + if (!std::regex_match(sv.begin(), sv.end(), BASIC_IDENTIFIER)) + { + return false; // we're not even in the shape of an identifier + } + + if (std::regex_match(sv.begin(), sv.end(), RESERVED)) + { + return false; // we're a reserved identifier + } + + return true; + } + ExpectedT, std::unique_ptr> parse_file(const Files::Filesystem& fs, const fs::path& path, std::error_code& ec) noexcept @@ -905,10 +1029,30 @@ namespace vcpkg::Json } } + std::pair parse_file(vcpkg::LineInfo linfo, + const Files::Filesystem& fs, + const fs::path& path) noexcept + { + std::error_code ec; + auto ret = parse_file(fs, path, ec); + if (ec) + { + System::print2(System::Color::error, "Failed to read ", fs::u8string(path), ": ", ec.message(), "\n"); + Checks::exit_fail(linfo); + } + else if (!ret) + { + System::print2(System::Color::error, "Failed to parse ", fs::u8string(path), ":\n"); + System::print2(ret.error()->format()); + Checks::exit_fail(linfo); + } + return ret.value_or_exit(linfo); + } + ExpectedT, std::unique_ptr> parse(StringView json, const fs::path& filepath) noexcept { - return Parser::parse(json, filepath.generic_u8string()); + return Parser::parse(json, fs::generic_u8string(filepath)); } // } auto parse() @@ -1114,4 +1258,57 @@ namespace vcpkg::Json } // } auto stringify() + static std::vector invalid_json_fields(const Json::Object& obj, + Span known_fields) noexcept + { + const auto field_is_unknown = [known_fields](StringView sv) { + // allow directives + if (sv.size() != 0 && *sv.begin() == '$') + { + return false; + } + return std::find(known_fields.begin(), known_fields.end(), sv) == known_fields.end(); + }; + + std::vector res; + for (const auto& kv : obj) + { + if (field_is_unknown(kv.first)) + { + res.push_back(kv.first.to_string()); + } + } + + return res; + } + + void Reader::check_for_unexpected_fields(const Object& obj, + Span valid_fields, + StringView type_name) + { + if (valid_fields.size() == 0) + { + return; + } + + auto extra_fields = invalid_json_fields(obj, valid_fields); + if (!extra_fields.empty()) + { + add_extra_fields_error(type_name.to_string(), std::move(extra_fields)); + } + } + + std::string Reader::path() const noexcept + { + std::string p("$"); + for (auto&& s : m_path) + { + if (s.index < 0) + Strings::append(p, '.', s.field); + else + Strings::append(p, '[', s.index, ']'); + } + return p; + } + } diff --git a/toolsrc/src/vcpkg/base/machinetype.cpp b/toolsrc/src/vcpkg/base/machinetype.cpp index 237e1eb8bfcba9..243fa70864537a 100644 --- a/toolsrc/src/vcpkg/base/machinetype.cpp +++ b/toolsrc/src/vcpkg/base/machinetype.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/parse.cpp b/toolsrc/src/vcpkg/base/parse.cpp index 7d6576f4168caa..c6a7de83d32974 100644 --- a/toolsrc/src/vcpkg/base/parse.cpp +++ b/toolsrc/src/vcpkg/base/parse.cpp @@ -1,12 +1,7 @@ -#include "pch.h" - #include #include #include -#include -#include - #include using namespace vcpkg; @@ -71,10 +66,15 @@ namespace vcpkg::Parse { return Unicode::end_of_file; } + auto ch = *m_it; // See https://www.gnu.org/prep/standards/standards.html#Errors - advance_rowcol(*m_it, m_row, m_column); + advance_rowcol(ch, m_row, m_column); ++m_it; + if (ch == '\n') + { + m_start_of_line = m_it; + } if (m_it != m_it.end() && Unicode::utf16_is_surrogate_code_point(*m_it)) { m_it = m_it.end(); @@ -106,128 +106,4 @@ namespace vcpkg::Parse // Avoid error loops by skipping to the end skip_to_eof(); } - - static Optional> remove_field(Paragraph* fields, const std::string& fieldname) - { - auto it = fields->find(fieldname); - if (it == fields->end()) - { - return nullopt; - } - - auto value = std::move(it->second); - fields->erase(it); - return value; - } - - void ParagraphParser::required_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (const auto field = maybe_field.get()) - out = std::move(*field); - else - missing_fields.push_back(fieldname); - } - void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (auto field = maybe_field.get()) out = std::move(*field); - } - void ParagraphParser::required_field(const std::string& fieldname, std::string& out) - { - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - } - std::string ParagraphParser::optional_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - optional_field(fieldname, {out, ignore}); - return out; - } - std::string ParagraphParser::required_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - return out; - } - - std::unique_ptr ParagraphParser::error_info(const std::string& name) const - { - if (!fields.empty() || !missing_fields.empty()) - { - auto err = std::make_unique(); - err->name = name; - err->extra_fields["CONTROL"] = Util::extract_keys(fields); - err->missing_fields["CONTROL"] = std::move(missing_fields); - err->expected_types = std::move(expected_types); - return err; - } - return nullptr; - } - - template - static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) - { - std::vector ret; - parser.skip_whitespace(); - if (parser.at_eof()) return std::vector{}; - do - { - auto item = f(parser); - if (!item) return nullopt; - ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); - parser.skip_whitespace(); - if (parser.at_eof()) return {std::move(ret)}; - if (parser.cur() != ',') - { - parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); - return nullopt; - } - parser.next(); - parser.skip_whitespace(); - } while (true); - } - - ExpectedS> parse_default_features_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_qualified_specifier_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof( - "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_dependencies_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { - auto loc = parser.cur_loc(); - return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { - if (pqs.triplet) - { - parser.add_error("triplet specifier not allowed in this context", loc); - return nullopt; - } - return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; - }); - }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } } diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 44fc3ebd114857..8e1bbdc22431ba 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -146,6 +144,13 @@ std::string Strings::trim(std::string&& s) return std::move(s); } +StringView Strings::trim(StringView sv) +{ + auto last = std::find_if_not(sv.rbegin(), sv.rend(), details::is_space).base(); + auto first = std::find_if_not(sv.begin(), sv.end(), details::is_space); + return StringView(first, last); +} + void Strings::trim_all_and_remove_whitespace_strings(std::vector* strings) { for (std::string& s : *strings) diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index 8ab114a5e4efce..6e03ba543eabf8 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index 63674963e384e3..cbb50fe27e6297 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -19,6 +17,7 @@ namespace vcpkg if (Strings::case_insensitive_ascii_equals(arch, "amd64")) return CPUArchitecture::X64; if (Strings::case_insensitive_ascii_equals(arch, "arm")) return CPUArchitecture::ARM; if (Strings::case_insensitive_ascii_equals(arch, "arm64")) return CPUArchitecture::ARM64; + if (Strings::case_insensitive_ascii_equals(arch, "s390x")) return CPUArchitecture::S390X; return nullopt; } @@ -30,6 +29,7 @@ namespace vcpkg case CPUArchitecture::X64: return "x64"; case CPUArchitecture::ARM: return "arm"; case CPUArchitecture::ARM64: return "arm64"; + case CPUArchitecture::S390X: return "s390x"; default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::System::CPUArchitecture"); } } @@ -45,12 +45,14 @@ namespace vcpkg #else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv #if defined(__x86_64__) || defined(_M_X64) return CPUArchitecture::X64; -#elif defined(__x86__) || defined(_M_X86) +#elif defined(__x86__) || defined(_M_X86) || defined(__i386__) return CPUArchitecture::X86; #elif defined(__arm__) || defined(_M_ARM) return CPUArchitecture::ARM; #elif defined(__aarch64__) || defined(_M_ARM64) return CPUArchitecture::ARM64; +#elif defined(__s390x__) + return CPUArchitecture::S390X; #else // choose architecture #error "Unknown host architecture" #endif // choose architecture @@ -158,25 +160,6 @@ namespace vcpkg return s_home; } #else - static const ExpectedS& get_xdg_config_home() noexcept - { - static ExpectedS s_home = [] { - auto maybe_home = System::get_environment_variable("XDG_CONFIG_HOME"); - if (auto p = maybe_home.get()) - { - return ExpectedS(fs::u8path(*p)); - } - else - { - return System::get_home_dir().map([](fs::path home) { - home /= fs::u8path(".config"); - return home; - }); - } - }(); - return s_home; - } - static const ExpectedS& get_xdg_cache_home() noexcept { static ExpectedS s_home = [] { diff --git a/toolsrc/src/vcpkg/base/system.print.cpp b/toolsrc/src/vcpkg/base/system.print.cpp index fc8e4184c8dad7..458f53155271de 100644 --- a/toolsrc/src/vcpkg/base/system.print.cpp +++ b/toolsrc/src/vcpkg/base/system.print.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -24,7 +22,7 @@ namespace vcpkg::System #else // TODO: add color handling code // it should probably use VT-220 codes - Util::unused(c); + (void)c; System::print2(message); #endif } diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index bc67c111422466..c78838caf3d793 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -175,7 +173,7 @@ namespace vcpkg { } System::CMakeVariable::CMakeVariable(const StringView varname, const fs::path& path) - : CMakeVariable(varname, path.generic_u8string()) + : CMakeVariable(varname, fs::generic_u8string(path)) { } @@ -313,6 +311,7 @@ namespace vcpkg L"CUDA_TOOLKIT_ROOT_DIR", // Environmental variable generated automatically by CUDA after installation L"NVCUDASAMPLES_ROOT", + L"NVTOOLSEXT_PATH", // Enables find_package(Vulkan) in CMake. Environmental variable generated by Vulkan SDK installer L"VULKAN_SDK", // Enable targeted Android NDK diff --git a/toolsrc/src/vcpkg/base/unicode.cpp b/toolsrc/src/vcpkg/base/unicode.cpp index 149bad20f9180a..92b964ed83fa18 100644 --- a/toolsrc/src/vcpkg/base/unicode.cpp +++ b/toolsrc/src/vcpkg/base/unicode.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/binarycaching.cpp b/toolsrc/src/vcpkg/binarycaching.cpp index d63d6b3d498ce5..7bccb0a6c3b59a 100644 --- a/toolsrc/src/vcpkg/binarycaching.cpp +++ b/toolsrc/src/vcpkg/binarycaching.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include using namespace vcpkg; @@ -27,14 +26,16 @@ namespace std::error_code ec; fs.create_directories(pkg_path, ec); auto files = fs.get_files_non_recursive(pkg_path); - Checks::check_exit(VCPKG_LINE_INFO, files.empty(), "unable to clear path: %s", pkg_path.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, files.empty(), "unable to clear path: %s", fs::u8string(pkg_path)); #if defined(_WIN32) auto&& seven_zip_exe = paths.get_tool_exe(Tools::SEVEN_ZIP); - auto cmd = Strings::format( - R"("%s" x "%s" -o"%s" -y)", seven_zip_exe.u8string(), archive_path.u8string(), pkg_path.u8string()); + auto cmd = Strings::format(R"("%s" x "%s" -o"%s" -y)", + fs::u8string(seven_zip_exe), + fs::u8string(archive_path), + fs::u8string(pkg_path)); #else - auto cmd = Strings::format(R"(unzip -qq "%s" "-d%s")", archive_path.u8string(), pkg_path.u8string()); + auto cmd = Strings::format(R"(unzip -qq "%s" "-d%s")", fs::u8string(archive_path), fs::u8string(pkg_path)); #endif return System::cmd_execute_and_capture_output(cmd, System::get_clean_environment()); } @@ -48,17 +49,17 @@ namespace fs.remove(destination, ec); Checks::check_exit( - VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", destination.u8string()); + VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", fs::u8string(destination)); #if defined(_WIN32) auto&& seven_zip_exe = paths.get_tool_exe(Tools::SEVEN_ZIP); System::cmd_execute_and_capture_output( Strings::format( - R"("%s" a "%s" "%s\*")", seven_zip_exe.u8string(), destination.u8string(), source.u8string()), + R"("%s" a "%s" "%s\*")", fs::u8string(seven_zip_exe), fs::u8string(destination), fs::u8string(source)), System::get_clean_environment()); #else System::cmd_execute_clean( - Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", source.u8string(), destination.u8string())); + Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", fs::u8string(source), fs::u8string(destination))); #endif } @@ -83,7 +84,7 @@ namespace const fs::path archive_path = archives_root_dir / archive_subpath; if (fs.exists(archive_path)) { - System::print2("Using cached binary package: ", archive_path.u8string(), "\n"); + System::print2("Using cached binary package: ", fs::u8string(archive_path), "\n"); int archive_result = decompress_archive(paths, spec, archive_path).exit_code; @@ -106,7 +107,7 @@ namespace } } - System::printf("Could not locate cached archive: %s\n", archive_path.u8string()); + System::printf("Could not locate cached archive: %s\n", fs::u8string(archive_path)); } return RestoreResult::missing; @@ -137,11 +138,11 @@ namespace { System::printf(System::Color::warning, "Failed to store binary cache %s: %s\n", - archive_path.u8string(), + fs::u8string(archive_path), ec.message()); } else - System::printf("Stored binary cache: %s\n", archive_path.u8string()); + System::printf("Stored binary cache: %s\n", fs::u8string(archive_path)); } if (m_write_dirs.size() > 1) fs.remove(tmp_archive_path, ignore_errors); } @@ -206,7 +207,7 @@ namespace for (auto&& action : plan.install_actions) { - if (action.build_options.editable == Build::Editable::YES) continue; + if (!action.has_package_abi()) continue; auto& spec = action.spec; fs.remove_all(paths.package_dir(spec), VCPKG_LINE_INFO); @@ -323,7 +324,7 @@ namespace Checks::check_exit(VCPKG_LINE_INFO, !fs.exists(nupkg_path, ignore_errors), "Unable to remove nupkg after restoring: %s", - nupkg_path.u8string()); + fs::u8string(nupkg_path)); m_restored.emplace(nuget_ref.first); ++num_restored; return true; @@ -432,7 +433,7 @@ namespace if (!m_interactive) cmd.string_arg("-NonInteractive"); System::print2( - "Uploading binaries for ", spec, " using NuGet config ", write_cfg.u8string(), ".\n"); + "Uploading binaries for ", spec, " using NuGet config ", fs::u8string(write_cfg), ".\n"); auto rc = [&] { if (Debug::g_debugging) @@ -445,7 +446,7 @@ namespace { System::print2(System::Color::error, "Pushing NuGet with ", - write_cfg.u8string(), + fs::u8string(write_cfg), " failed. Use --debug for more information.\n"); } } @@ -663,6 +664,24 @@ namespace const ExpectedS& default_cache_path() { static auto cachepath = System::get_platform_cache_home().then([](fs::path p) -> ExpectedS { + auto maybe_cachepath = System::get_environment_variable("VCPKG_DEFAULT_BINARY_CACHE"); + if (auto p_str = maybe_cachepath.get()) + { + const auto path = fs::u8path(*p_str); + const auto status = fs::stdfs::status(path); + if (!fs::stdfs::exists(status)) + return {"Path to VCPKG_DEFAULT_BINARY_CACHE does not exist: " + fs::u8string(path), + expected_right_tag}; + if (!fs::stdfs::is_directory(status)) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not a directory: " + + fs::u8string(path), + expected_right_tag}; + if (!path.is_absolute()) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not absolute: " + + fs::u8string(path), + expected_right_tag}; + return ExpectedS(path); + } p /= fs::u8path("vcpkg/archives"); if (p.is_absolute()) { @@ -670,9 +689,13 @@ namespace } else { - return {"default path was not absolute: " + p.u8string(), expected_right_tag}; + return {"default path was not absolute: " + fs::u8string(p), expected_right_tag}; } }); + if (cachepath.has_value()) + Debug::print("Default binary cache path is: ", fs::u8string(*cachepath.get()), '\n'); + else + Debug::print("No binary cache path. Reason: ", cachepath.error(), '\n'); return cachepath; } @@ -950,9 +973,27 @@ std::string vcpkg::reformat_version(const std::string& version, const std::strin return Strings::concat("0.0.0-", abi_tag); } +details::NuGetRepoInfo details::get_nuget_repo_info_from_env() +{ + auto vcpkg_nuget_repository = System::get_environment_variable("VCPKG_NUGET_REPOSITORY"); + if (auto p = vcpkg_nuget_repository.get()) + { + return {std::move(*p)}; + } + auto gh_repo = System::get_environment_variable("GITHUB_REPOSITORY").value_or(""); + if (gh_repo.empty()) return {}; + auto gh_server = System::get_environment_variable("GITHUB_SERVER_URL").value_or(""); + if (gh_server.empty()) return {}; + + return {Strings::concat(gh_server, '/', gh_repo, ".git"), + System::get_environment_variable("GITHUB_REF").value_or(""), + System::get_environment_variable("GITHUB_SHA").value_or("")}; +} + std::string vcpkg::generate_nuspec(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action, - const vcpkg::NugetReference& ref) + const vcpkg::NugetReference& ref, + details::NuGetRepoInfo rinfo) { auto& spec = action.spec; auto& scf = *action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO).source_control_file; @@ -983,10 +1024,17 @@ std::string vcpkg::generate_nuspec(const VcpkgPaths& paths, xml.open_tag("packageTypes"); xml.start_complex_open_tag("packageType").text_attr("name", "vcpkg").finish_self_closing_complex_tag(); xml.close_tag("packageTypes").line_break(); + if (!rinfo.repo.empty()) + { + xml.start_complex_open_tag("repository").text_attr("type", "git").text_attr("url", rinfo.repo); + if (!rinfo.branch.empty()) xml.text_attr("branch", rinfo.branch); + if (!rinfo.commit.empty()) xml.text_attr("commit", rinfo.commit); + xml.finish_self_closing_complex_tag().line_break(); + } xml.close_tag("metadata").line_break(); xml.open_tag("files"); xml.start_complex_open_tag("file") - .text_attr("src", (paths.package_dir(spec) / fs::u8path("**")).u8string()) + .text_attr("src", fs::u8string(paths.package_dir(spec) / fs::u8path("**"))) .text_attr("target", "") .finish_self_closing_complex_tag(); xml.close_tag("files").line_break(); @@ -1024,6 +1072,18 @@ void vcpkg::help_topic_binary_caching(const VcpkgPaths&) "downloading binaries and whether on-demand builds will be uploaded to that remote. It can be specified " "as 'read', 'write', or 'readwrite'."); tbl.blank(); + tbl.text("The `nuget` and `nugetconfig` source providers additionally respect certain environment variables while " + "generating nuget packages. The `metadata.repository` field will be optionally generated like:\n" + "\n" + " \n" + "or\n" + " \n" + "\n" + "if the appropriate environment variables are defined and non-empty.\n"); + tbl.blank(); System::print2(tbl.m_str); const auto& maybe_cachepath = default_cache_path(); if (auto p = maybe_cachepath.get()) @@ -1031,7 +1091,7 @@ void vcpkg::help_topic_binary_caching(const VcpkgPaths&) auto p_preferred = *p; System::print2( "\nBased on your system settings, the default path to store binaries is\n ", - p_preferred.make_preferred().u8string(), + fs::u8string(p_preferred.make_preferred()), "\n\nThis consults %LOCALAPPDATA%/%APPDATA% on Windows and $XDG_CACHE_HOME or $HOME on other platforms."); } } diff --git a/toolsrc/src/vcpkg/binaryparagraph.cpp b/toolsrc/src/vcpkg/binaryparagraph.cpp index 0b0819fd718f3e..4d3bcbc973ac8b 100644 --- a/toolsrc/src/vcpkg/binaryparagraph.cpp +++ b/toolsrc/src/vcpkg/binaryparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index bcd0a7f89c012f..a0ff09327c211c 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -16,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include using namespace vcpkg; @@ -88,7 +88,7 @@ namespace vcpkg::Build { auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; - var_provider.load_dep_info_vars(std::array{full_spec.package_spec}); + var_provider.load_dep_info_vars({{full_spec.package_spec}}); StatusParagraphs status_db = database_load_check(paths); @@ -187,6 +187,13 @@ namespace vcpkg::Build Build::null_build_logs_recorder(), paths); } + + void BuildCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Build::Command::perform_and_exit(args, paths, default_triplet); + } } namespace vcpkg::Build @@ -294,9 +301,9 @@ namespace vcpkg::Build })); } +#if defined(_WIN32) const System::Environment& EnvCache::get_action_env(const VcpkgPaths& paths, const AbiInfo& abi_info) { -#if defined(_WIN32) std::string build_env_cmd = make_build_env_cmd(*abi_info.pre_build_info, abi_info.toolset.value_or_exit(VCPKG_LINE_INFO)); @@ -325,17 +332,20 @@ namespace vcpkg::Build powershell_exe_path, powershell_exe_path.parent_path() / "powershell.exe", fs::copy_options::none); } - auto clean_env = System::get_modified_clean_environment(base_env.env_map, - powershell_exe_path.parent_path().u8string() + ";"); + auto clean_env = System::get_modified_clean_environment( + base_env.env_map, fs::u8string(powershell_exe_path.parent_path()) + ";"); if (build_env_cmd.empty()) return clean_env; else return System::cmd_execute_modify_env(build_env_cmd, clean_env); }); + } #else + const System::Environment& EnvCache::get_action_env(const VcpkgPaths&, const AbiInfo&) + { return System::get_clean_environment(); -#endif } +#endif static std::string load_compiler_hash(const VcpkgPaths& paths, const AbiInfo& abi_info); @@ -380,7 +390,7 @@ namespace vcpkg::Build const auto target = to_vcvarsall_target(pre_build_info.cmake_system_name); return Strings::format(R"(cmd /c ""%s" %s %s %s %s 2>&1 { {"CMD", "BUILD"}, {"TARGET_TRIPLET", triplet.canonical_name()}, - {"TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()}, + {"TARGET_TRIPLET_FILE", fs::u8string(paths.get_triplet_file_path(triplet))}, {"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()}, {"DOWNLOADS", paths.downloads}, {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, @@ -463,7 +473,7 @@ namespace vcpkg::Build #if !defined(_WIN32) // TODO: remove when vcpkg.exe is in charge for acquiring tools. Change introduced in vcpkg v0.0.107. // bootstrap should have already downloaded ninja, but making sure it is present in case it was deleted. - vcpkg::Util::unused(paths.get_tool_exe(Tools::NINJA)); + (void)(paths.get_tool_exe(Tools::NINJA)); #endif std::vector cmake_args{ {"CURRENT_PORT_DIR", paths.scripts / "detect_compiler"}, @@ -483,12 +493,12 @@ namespace vcpkg::Build Checks::check_exit(VCPKG_LINE_INFO, !err.value(), "Failed to create directory '%s', code: %d", - buildpath.u8string(), + fs::u8string(buildpath), err.value()); } auto stdoutlog = buildpath / ("stdout-" + triplet.canonical_name() + ".log"); std::ofstream out_file(stdoutlog.native().c_str(), std::ios::out | std::ios::binary | std::ios::trunc); - Checks::check_exit(VCPKG_LINE_INFO, out_file, "Failed to open '%s' for writing", stdoutlog.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, out_file, "Failed to open '%s' for writing", fs::u8string(stdoutlog)); std::string compiler_hash; System::cmd_execute_and_stream_lines( command, @@ -501,7 +511,7 @@ namespace vcpkg::Build Debug::print(s, '\n'); out_file.write(s.data(), s.size()).put('\n'); Checks::check_exit( - VCPKG_LINE_INFO, out_file, "Error occurred while writing '%s'", stdoutlog.u8string()); + VCPKG_LINE_INFO, out_file, "Error occurred while writing '%s'", fs::u8string(stdoutlog)); }, env); out_file.close(); @@ -516,7 +526,7 @@ namespace vcpkg::Build } Checks::check_exit(VCPKG_LINE_INFO, !compiler_hash.empty(), - "Error occured while detecting compiler information. Pass `--debug` for more information."); + "Error occurred while detecting compiler information. Pass `--debug` for more information."); Debug::print("Detecting compiler hash for triplet ", triplet, ": ", compiler_hash, "\n"); return compiler_hash; @@ -529,7 +539,7 @@ namespace vcpkg::Build #if !defined(_WIN32) // TODO: remove when vcpkg.exe is in charge for acquiring tools. Change introduced in vcpkg v0.0.107. // bootstrap should have already downloaded ninja, but making sure it is present in case it was deleted. - vcpkg::Util::unused(paths.get_tool_exe(Tools::NINJA)); + (void)(paths.get_tool_exe(Tools::NINJA)); #endif auto& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); auto& scf = *scfl.source_control_file; @@ -572,7 +582,7 @@ namespace vcpkg::Build if (fs.is_regular_file(port_config_path)) { - port_configs.emplace_back(port_config_path.u8string()); + port_configs.emplace_back(fs::u8string(port_config_path)); } } @@ -641,22 +651,22 @@ namespace vcpkg::Build auto&& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); Triplet triplet = action.spec.triplet(); - const auto& triplet_file_path = paths.get_triplet_file_path(triplet).u8string(); + const auto& triplet_file_path = fs::u8string(paths.get_triplet_file_path(triplet)); - if (Strings::case_insensitive_ascii_starts_with(triplet_file_path, paths.community_triplets.u8string())) + if (Strings::case_insensitive_ascii_starts_with(triplet_file_path, fs::u8string(paths.community_triplets))) { System::printf(vcpkg::System::Color::warning, "-- Using community triplet %s. This triplet configuration is not guaranteed to succeed.\n", triplet.canonical_name()); System::printf("-- [COMMUNITY] Loading triplet configuration from: %s\n", triplet_file_path); } - else if (!Strings::case_insensitive_ascii_starts_with(triplet_file_path, paths.triplets.u8string())) + else if (!Strings::case_insensitive_ascii_starts_with(triplet_file_path, fs::u8string(paths.triplets))) { System::printf("-- [OVERLAY] Loading triplet configuration from: %s\n", triplet_file_path); } - auto u8portdir = scfl.source_location.u8string(); - if (!Strings::case_insensitive_ascii_starts_with(u8portdir, paths.ports.u8string())) + auto u8portdir = fs::u8string(scfl.source_location); + if (!Strings::case_insensitive_ascii_starts_with(u8portdir, fs::u8string(paths.ports))) { System::printf("-- Installing port from location: %s\n", u8portdir); } @@ -675,19 +685,19 @@ namespace vcpkg::Build Checks::check_exit(VCPKG_LINE_INFO, !err.value(), "Failed to create directory '%s', code: %d", - buildpath.u8string(), + fs::u8string(buildpath), err.value()); } auto stdoutlog = buildpath / ("stdout-" + action.spec.triplet().canonical_name() + ".log"); std::ofstream out_file(stdoutlog.native().c_str(), std::ios::out | std::ios::binary | std::ios::trunc); - Checks::check_exit(VCPKG_LINE_INFO, out_file, "Failed to open '%s' for writing", stdoutlog.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, out_file, "Failed to open '%s' for writing", fs::u8string(stdoutlog)); const int return_code = System::cmd_execute_and_stream_data( command, [&](StringView sv) { System::print2(sv); out_file.write(sv.data(), sv.size()); Checks::check_exit( - VCPKG_LINE_INFO, out_file, "Error occurred while writing '%s'", stdoutlog.u8string()); + VCPKG_LINE_INFO, out_file, "Error occurred while writing '%s'", fs::u8string(stdoutlog)); }, env); out_file.close(); @@ -826,7 +836,7 @@ namespace vcpkg::Build if (fs::is_regular_file(fs.status(VCPKG_LINE_INFO, port_file))) { abi_tag_entries.emplace_back( - port_file.path().filename().u8string(), + fs::u8string(port_file.path().filename()), vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, port_file, Hash::Algorithm::Sha1)); ++port_file_count; @@ -861,6 +871,7 @@ namespace vcpkg::Build abi_tag_entries.emplace_back("features", Strings::join(";", sorted_feature_list)); if (action.build_options.use_head_version == UseHeadVersion::YES) abi_tag_entries.emplace_back("head", ""); + if (action.build_options.editable == Editable::YES) abi_tag_entries.emplace_back("editable", ""); Util::sort(abi_tag_entries); @@ -1009,7 +1020,7 @@ namespace vcpkg::Build std::error_code ec; const fs::path abi_package_dir = paths.package_dir(spec) / "share" / spec.name(); const fs::path abi_file_in_package = paths.package_dir(spec) / "share" / spec.name() / "vcpkg_abi_info.txt"; - if (action.build_options.editable == Build::Editable::NO) + if (action.has_package_abi()) { auto restore = binaries_provider.try_restore(paths, action); if (restore == RestoreResult::build_failed) @@ -1032,9 +1043,9 @@ namespace vcpkg::Build fs.create_directories(abi_package_dir, ec); fs.copy_file(abi_file, abi_file_in_package, fs::copy_options::none, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not copy into file: %s", abi_file_in_package.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not copy into file: %s", fs::u8string(abi_file_in_package)); - if (action.build_options.editable == Build::Editable::NO && result.code == BuildResult::SUCCEEDED) + if (action.has_package_abi() && result.code == BuildResult::SUCCEEDED) { binaries_provider.push_success(paths, action); } @@ -1076,12 +1087,18 @@ namespace vcpkg::Build std::string create_user_troubleshooting_message(const PackageSpec& spec) { - return Strings::format("Please ensure you're using the latest portfiles with `.\\vcpkg update`, then\n" +#if defined(_WIN32) + auto vcpkg_update_cmd = ".\\vcpkg"; +#else + auto vcpkg_update_cmd = "./vcpkg"; +#endif + return Strings::format("Please ensure you're using the latest portfiles with `%s update`, then\n" "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" " Package: %s\n" " Vcpkg version: %s\n" "\n" "Additionally, attach any relevant sections from the log files above.", + vcpkg_update_cmd, spec, Commands::Version::version()); } diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp index 9ef330e660df58..2b63a16b508572 100644 --- a/toolsrc/src/vcpkg/buildenvironment.cpp +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -1,6 +1,6 @@ -#include "pch.h" - #include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg/cmakevars.cpp b/toolsrc/src/vcpkg/cmakevars.cpp index ee718d40822993..ef9906a0882624 100644 --- a/toolsrc/src/vcpkg/cmakevars.cpp +++ b/toolsrc/src/vcpkg/cmakevars.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -78,7 +76,7 @@ namespace vcpkg::CMakeVars Files::Filesystem& fs = paths.get_filesystem(); static int tag_extract_id = 0; - std::string extraction_file("include(\"" + get_tags_path.generic_u8string() + "\")\n\n"); + std::string extraction_file("include(\"" + fs::generic_u8string(get_tags_path) + "\")\n\n"); std::map emitted_triplets; int emitted_triplet_id = 0; @@ -126,7 +124,7 @@ namespace vcpkg::CMakeVars static int dep_info_id = 0; Files::Filesystem& fs = paths.get_filesystem(); - std::string extraction_file("include(\"" + get_dep_info_path.generic_u8string() + "\")\n\n"); + std::string extraction_file("include(\"" + fs::generic_u8string(get_dep_info_path) + "\")\n\n"); std::map emitted_triplets; int emitted_triplet_id = 0; @@ -260,7 +258,7 @@ namespace vcpkg::CMakeVars { auto& scfl = port_provider.get_control_file(spec.package_spec.name()).value_or_exit(VCPKG_LINE_INFO); const fs::path override_path = scfl.source_location / "vcpkg-abi-settings.cmake"; - spec_abi_settings.emplace_back(&spec, override_path.generic_u8string()); + spec_abi_settings.emplace_back(&spec, fs::generic_u8string(override_path)); } std::vector>> vars(spec_abi_settings.size()); diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index 17d38f395f87ac..84a1f5ed5301c8 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -1,12 +1,14 @@ -#include "pch.h" - #include -#include +#include +#include +#include +#include #include #include #include #include +#include #include namespace vcpkg::Commands::Autocomplete @@ -175,4 +177,9 @@ namespace vcpkg::Commands::Autocomplete Checks::exit_success(VCPKG_LINE_INFO); } + + void AutocompleteCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Autocomplete::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.buildexternal.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp index 79a8dd3c4b6895..bfd275542757ed 100644 --- a/toolsrc/src/vcpkg/commands.buildexternal.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -1,11 +1,10 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include +#include namespace vcpkg::Commands::BuildExternal { @@ -43,4 +42,11 @@ namespace vcpkg::Commands::BuildExternal Build::null_build_logs_recorder(), paths); } + + void BuildExternalCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + BuildExternal::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp index e7802498c703f5..3014f87a1eaa35 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -1,12 +1,11 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include +#include namespace vcpkg::Commands::Cache { @@ -38,7 +37,7 @@ namespace vcpkg::Commands::Cache void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); if (binary_paragraphs.empty()) @@ -71,4 +70,9 @@ namespace vcpkg::Commands::Cache Checks::exit_success(VCPKG_LINE_INFO); } + + void CacheCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Cache::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 82aef8d27652c0..ee7b4d4a0d8208 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -9,18 +7,18 @@ #include #include -#include +#include #include #include #include #include #include #include +#include #include +#include #include -#include - using namespace vcpkg; namespace @@ -385,7 +383,6 @@ namespace vcpkg::Commands::CI } else { - // include_all_supported_features_for_triplet(var_provider, p); ret->unknown.emplace_back(p->spec, p->feature_list); b_will_build = true; } @@ -461,9 +458,7 @@ namespace vcpkg::Commands::CI XunitTestResults xunitTestResults; std::vector all_ports = - Util::fmap(provider.load_all_control_files(), [](const SourceControlFileLocation*& scfl) -> std::string { - return scfl->source_control_file.get()->core_paragraph->name; - }); + Util::fmap(provider.load_all_control_files(), Paragraphs::get_name_of_control_file); std::vector results; auto timer = Chrono::ElapsedTimer::create_started(); for (Triplet triplet : triplets) @@ -505,7 +500,7 @@ namespace vcpkg::Commands::CI } auto action_plan = Dependencies::create_feature_install_plan( - new_default_provider, var_provider, split_specs->unknown, status_db, serialize_options, true); + new_default_provider, var_provider, split_specs->unknown, status_db, serialize_options); for (auto&& action : action_plan.install_actions) { @@ -582,4 +577,11 @@ namespace vcpkg::Commands::CI Checks::exit_success(VCPKG_LINE_INFO); } + + void CICommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + CI::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 980e17da8f4a7b..a92b918c80fd0a 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -1,11 +1,10 @@ -#include "pch.h" - #include #include #include -#include +#include #include +#include using namespace vcpkg; @@ -16,12 +15,12 @@ namespace using vcpkg::System::print2; if (fs.is_directory(target)) { - print2("Clearing contents of ", target.u8string(), "\n"); + print2("Clearing contents of ", fs::u8string(target), "\n"); fs.remove_all_inside(target, VCPKG_LINE_INFO); } else { - print2("Skipping clearing contents of ", target.u8string(), " because it was not a directory\n"); + print2("Skipping clearing contents of ", fs::u8string(target), " because it was not a directory\n"); } } } @@ -39,4 +38,9 @@ namespace vcpkg::Commands::CIClean print2("Completed vcpkg CI clean\n"); Checks::exit_success(VCPKG_LINE_INFO); } + + void CICleanCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + CIClean::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp index ce83fab80eff00..e40aa34b29236c 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,12 +1,12 @@ -#include "pch.h" - #include #include #include +#include -#include +#include #include #include +#include namespace vcpkg::Commands::Contact { @@ -58,4 +58,9 @@ namespace vcpkg::Commands::Contact } Checks::exit_success(VCPKG_LINE_INFO); } + + void ContactCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const + { + Contact::perform_and_exit(args, fs); + } } diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp index be6d553047c20b..466cc11c073f49 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -1,10 +1,31 @@ -#include "pch.h" - -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -13,104 +34,87 @@ namespace vcpkg::Commands { - Span> get_available_commands_type_a() + Span> get_available_basic_commands() { - static std::vector> t = { - {"install", &Install::perform_and_exit}, - {"x-set-installed", &SetInstalled::perform_and_exit}, - {"ci", &CI::perform_and_exit}, - {"remove", &Remove::perform_and_exit}, - {"upgrade", &Upgrade::perform_and_exit}, - {"build", &Build::Command::perform_and_exit}, - {"env", &Env::perform_and_exit}, - {"build-external", &BuildExternal::perform_and_exit}, - {"export", &Export::perform_and_exit}, - {"depend-info", &DependInfo::perform_and_exit}, + static const Version::VersionCommand version{}; + static const Contact::ContactCommand contact{}; + static std::vector> t = { + {"version", &version}, + {"contact", &contact}, }; return t; } - Span> get_available_commands_type_b() + Span> get_available_paths_commands() { - static std::vector> t = { - {"/?", &Help::perform_and_exit}, - {"help", &Help::perform_and_exit}, - {"search", &Search::perform_and_exit}, - {"list", &List::perform_and_exit}, - {"integrate", &Integrate::perform_and_exit}, - {"owns", &Owns::perform_and_exit}, - {"update", &Update::perform_and_exit}, - {"edit", &Edit::perform_and_exit}, - {"create", &Create::perform_and_exit}, - {"cache", &Cache::perform_and_exit}, - {"portsdiff", &PortsDiff::perform_and_exit}, - {"autocomplete", &Autocomplete::perform_and_exit}, - {"hash", &Hash::perform_and_exit}, - {"fetch", &Fetch::perform_and_exit}, - {"x-ci-clean", &CIClean::perform_and_exit}, - {"x-history", &PortHistory::perform_and_exit}, - {"x-vsinstances", &X_VSInstances::perform_and_exit}, - {"x-format-manifest", &FormatManifest::perform_and_exit}, - }; - return t; - } + static const Help::HelpCommand help{}; + static const Search::SearchCommand search{}; + static const List::ListCommand list{}; + static const Info::InfoCommand info{}; + static const Integrate::IntegrateCommand integrate{}; + static const Owns::OwnsCommand owns{}; + static const Update::UpdateCommand update{}; + static const Edit::EditCommand edit{}; + static const Create::CreateCommand create{}; + static const Cache::CacheCommand cache{}; + static const PortsDiff::PortsDiffCommand portsdiff{}; + static const Autocomplete::AutocompleteCommand autocomplete{}; + static const Hash::HashCommand hash{}; + static const Fetch::FetchCommand fetch{}; + static const CIClean::CICleanCommand ciclean{}; + static const PortHistory::PortHistoryCommand porthistory{}; + static const X_VSInstances::VSInstancesCommand vsinstances{}; + static const FormatManifest::FormatManifestCommand format_manifest{}; - Span> get_available_commands_type_c() - { - static std::vector> t = { - {"version", &Version::perform_and_exit}, - {"contact", &Contact::perform_and_exit}, + static std::vector> t = { + {"/?", &help}, + {"help", &help}, + {"search", &search}, + {"list", &list}, + {"integrate", &integrate}, + {"owns", &owns}, + {"update", &update}, + {"edit", &edit}, + {"create", &create}, + {"cache", &cache}, + {"portsdiff", &portsdiff}, + {"autocomplete", &autocomplete}, + {"hash", &hash}, + {"fetch", &fetch}, + {"x-ci-clean", &ciclean}, + {"x-package-info", &info}, + {"x-history", &porthistory}, + {"x-vsinstances", &vsinstances}, + {"x-format-manifest", &format_manifest}, }; return t; } -} - -namespace vcpkg::Commands::Fetch -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), - 1, - 1, - {}, - nullptr, - }; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + Span> get_available_triplet_commands() { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + static const Install::InstallCommand install{}; + static const SetInstalled::SetInstalledCommand set_installed{}; + static const CI::CICommand ci{}; + static const Remove::RemoveCommand remove{}; + static const Upgrade::UpgradeCommand upgrade{}; + static const Build::BuildCommand build{}; + static const Env::EnvCommand env{}; + static const BuildExternal::BuildExternalCommand build_external{}; + static const Export::ExportCommand export_command{}; + static const DependInfo::DependInfoCommand depend_info{}; - const std::string tool = args.command_arguments[0]; - const fs::path tool_path = paths.get_tool_exe(tool); - System::print2(tool_path.u8string(), '\n'); - Checks::exit_success(VCPKG_LINE_INFO); - } -} - -namespace vcpkg::Commands::Hash -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), - 1, - 2, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - - const fs::path file_to_hash = args.command_arguments[0]; - - auto algorithm = vcpkg::Hash::Algorithm::Sha512; - if (args.command_arguments.size() == 2) - { - algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); - } - - const std::string hash = - vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); - System::print2(hash, '\n'); - Checks::exit_success(VCPKG_LINE_INFO); + static std::vector> t = { + {"install", &install}, + {"x-set-installed", &set_installed}, + {"ci", &ci}, + {"remove", &remove}, + {"upgrade", &upgrade}, + {"build", &build}, + {"env", &env}, + {"build-external", &build_external}, + {"export", &export_command}, + {"depend-info", &depend_info}, + }; + return t; } } diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index 83d2e109d5dffa..b14b47a8f5e328 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,11 +1,12 @@ -#include "pch.h" - #include #include +#include #include -#include +#include #include +#include +#include namespace vcpkg::Commands::Create { @@ -19,7 +20,7 @@ namespace vcpkg::Commands::Create int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)args.parse_arguments(COMMAND_STRUCTURE); const std::string port_name = args.command_arguments.at(0); const std::string url = args.command_arguments.at(1); @@ -44,4 +45,9 @@ namespace vcpkg::Commands::Create { Checks::exit_with_code(VCPKG_LINE_INFO, perform(args, paths)); } + + void CreateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Create::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.dependinfo.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp index ba6da1aa3fbde7..8c14c4b3d197c2 100644 --- a/toolsrc/src/vcpkg/commands.dependinfo.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -1,15 +1,14 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include #include #include #include +#include #include @@ -328,4 +327,11 @@ namespace vcpkg::Commands::DependInfo } Checks::exit_success(VCPKG_LINE_INFO); } + + void DependInfoCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + DependInfo::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index a433af8ecf8feb..7ee74eae09a529 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -1,12 +1,11 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include +#include #include @@ -86,10 +85,9 @@ namespace vcpkg::Commands::Edit static std::vector valid_arguments(const VcpkgPaths& paths) { - auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports); + auto sources_and_errors = Paragraphs::try_load_all_registry_ports(paths); - return Util::fmap(sources_and_errors.paragraphs, - [](auto&& pgh) -> std::string { return pgh->core_paragraph->name; }); + return Util::fmap(sources_and_errors.paragraphs, Paragraphs::get_name_of_control_file); } static constexpr std::array EDIT_SWITCHES = { @@ -123,16 +121,16 @@ namespace vcpkg::Commands::Edit std::string package_paths; for (auto&& package : packages) { - if (Strings::case_insensitive_ascii_starts_with(package.filename().u8string(), pattern)) + if (Strings::case_insensitive_ascii_starts_with(fs::u8string(package.filename()), pattern)) { - package_paths.append(Strings::format(" \"%s\"", package.u8string())); + package_paths.append(Strings::format(" \"%s\"", fs::u8string(package))); } } return Strings::format(R"###("%s" "%s" "%s"%s)###", - portpath.u8string(), - portfile.u8string(), - buildtrees_current_dir.u8string(), + fs::u8string(portpath), + fs::u8string(portfile), + fs::u8string(buildtrees_current_dir), package_paths); }); } @@ -140,14 +138,14 @@ namespace vcpkg::Commands::Edit if (Util::Sets::contains(options.switches, OPTION_BUILDTREES)) { return Util::fmap(ports, [&](const std::string& port_name) -> std::string { - return Strings::format(R"###("%s")###", paths.build_dir(port_name).u8string()); + return Strings::format(R"###("%s")###", fs::u8string(paths.build_dir(port_name))); }); } return Util::fmap(ports, [&](const std::string& port_name) -> std::string { const auto portpath = paths.ports / port_name; const auto portfile = portpath / "portfile.cmake"; - return Strings::format(R"###("%s" "%s")###", portpath.u8string(), portfile.u8string()); + return Strings::format(R"###("%s" "%s")###", fs::u8string(portpath), fs::u8string(portfile)); }); } @@ -254,9 +252,9 @@ namespace vcpkg::Commands::Edit const fs::path env_editor = *it; const std::vector arguments = create_editor_arguments(paths, options, ports); const auto args_as_string = Strings::join(" ", arguments); - const auto cmd_line = Strings::format(R"("%s" %s -n)", env_editor.u8string(), args_as_string); + const auto cmd_line = Strings::format(R"("%s" %s -n)", fs::u8string(env_editor), args_as_string); - auto editor_exe = env_editor.filename().u8string(); + auto editor_exe = fs::u8string(env_editor.filename()); #ifdef _WIN32 if (editor_exe == "Code.exe" || editor_exe == "Code - Insiders.exe") @@ -267,4 +265,9 @@ namespace vcpkg::Commands::Edit #endif Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line)); } + + void EditCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Edit::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.env.cpp b/toolsrc/src/vcpkg/commands.env.cpp index bcde9916671c1d..15c094e71e6c6f 100644 --- a/toolsrc/src/vcpkg/commands.env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -1,12 +1,11 @@ -#include "pch.h" - #include #include #include #include -#include +#include #include +#include namespace vcpkg::Commands::Env { @@ -58,20 +57,22 @@ namespace vcpkg::Commands::Env const bool add_python = Util::Sets::contains(options.switches, OPTION_PYTHON); std::vector path_vars; - if (add_bin) path_vars.push_back((paths.installed / triplet.to_string() / "bin").u8string()); - if (add_debug_bin) path_vars.push_back((paths.installed / triplet.to_string() / "debug" / "bin").u8string()); - if (add_include) extra_env.emplace("INCLUDE", (paths.installed / triplet.to_string() / "include").u8string()); + if (add_bin) path_vars.push_back(fs::u8string(paths.installed / triplet.to_string() / "bin")); + if (add_debug_bin) path_vars.push_back(fs::u8string(paths.installed / triplet.to_string() / "debug" / "bin")); + if (add_include) extra_env.emplace("INCLUDE", fs::u8string(paths.installed / triplet.to_string() / "include")); if (add_tools) { auto tools_dir = paths.installed / triplet.to_string() / "tools"; auto tool_files = fs.get_files_non_recursive(tools_dir); - path_vars.push_back(tools_dir.u8string()); + path_vars.push_back(fs::u8string(tools_dir)); for (auto&& tool_dir : tool_files) { - if (fs.is_directory(tool_dir)) path_vars.push_back(tool_dir.u8string()); + if (fs.is_directory(tool_dir)) path_vars.push_back(fs::u8string(tool_dir)); } } - if (add_python) extra_env.emplace("PYTHONPATH", (paths.installed / triplet.to_string() / "python").u8string()); + if (add_python) + extra_env.emplace("PYTHONPATH", + fs::u8string(paths.installed / fs::u8path(triplet.to_string()) / fs::u8path("python"))); if (path_vars.size() > 0) extra_env.emplace("PATH", Strings::join(";", path_vars)); auto env = [&] { @@ -99,4 +100,11 @@ namespace vcpkg::Commands::Env #endif Checks::exit_with_code(VCPKG_LINE_INFO, rc); } + + void EnvCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Env::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp new file mode 100644 index 00000000000000..68df98700f13f2 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -0,0 +1,30 @@ +#include + +#include +#include +#include + +namespace vcpkg::Commands::Fetch +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), + 1, + 1, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + (void)args.parse_arguments(COMMAND_STRUCTURE); + const std::string tool = args.command_arguments[0]; + const fs::path tool_path = paths.get_tool_exe(tool); + System::print2(fs::u8string(tool_path), '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } + + void FetchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Fetch::perform_and_exit(args, paths); + } +} diff --git a/toolsrc/src/vcpkg/commands.format-manifest.cpp b/toolsrc/src/vcpkg/commands.format-manifest.cpp index f234722457b286..24beae0d8f29ad 100644 --- a/toolsrc/src/vcpkg/commands.format-manifest.cpp +++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp @@ -1,18 +1,188 @@ -#include "pch.h" - #include #include #include #include -#include +#include +#include #include +#include +#include +#include + +namespace +{ + using namespace vcpkg; + + struct ToWrite + { + SourceControlFile scf; + fs::path file_to_write; + fs::path original_path; + std::string original_source; + }; + + Optional read_manifest(Files::Filesystem& fs, fs::path&& manifest_path) + { + auto path_string = fs::u8string(manifest_path); + Debug::print("Reading ", path_string, "\n"); + auto contents = fs.read_contents(manifest_path, VCPKG_LINE_INFO); + auto parsed_json_opt = Json::parse(contents, manifest_path); + if (!parsed_json_opt.has_value()) + { + System::printf( + System::Color::error, "Failed to parse %s: %s\n", path_string, parsed_json_opt.error()->format()); + return nullopt; + } + + const auto& parsed_json = parsed_json_opt.value_or_exit(VCPKG_LINE_INFO).first; + if (!parsed_json.is_object()) + { + System::printf(System::Color::error, "The file %s is not an object\n", path_string); + return nullopt; + } + + auto parsed_json_obj = parsed_json.object(); + + auto scf = SourceControlFile::parse_manifest_file(manifest_path, parsed_json_obj); + if (!scf.has_value()) + { + System::printf(System::Color::error, "Failed to parse manifest file: %s\n", path_string); + print_error_message(scf.error()); + return nullopt; + } + + return ToWrite{ + std::move(*scf.value_or_exit(VCPKG_LINE_INFO)), + manifest_path, + manifest_path, + std::move(contents), + }; + } + + Optional read_control_file(Files::Filesystem& fs, fs::path&& control_path) + { + std::error_code ec; + auto control_path_string = fs::u8string(control_path); + Debug::print("Reading ", control_path_string, "\n"); + + auto manifest_path = control_path.parent_path(); + manifest_path /= fs::u8path("vcpkg.json"); + + auto contents = fs.read_contents(control_path, VCPKG_LINE_INFO); + auto paragraphs = Paragraphs::parse_paragraphs(contents, control_path_string); + + if (!paragraphs) + { + System::printf(System::Color::error, + "Failed to read paragraphs from %s: %s\n", + control_path_string, + paragraphs.error()); + return {}; + } + auto scf_res = + SourceControlFile::parse_control_file(control_path, std::move(paragraphs).value_or_exit(VCPKG_LINE_INFO)); + if (!scf_res) + { + System::printf(System::Color::error, "Failed to parse control file: %s\n", control_path_string); + print_error_message(scf_res.error()); + return {}; + } + + return ToWrite{ + std::move(*scf_res.value_or_exit(VCPKG_LINE_INFO)), + manifest_path, + control_path, + std::move(contents), + }; + } + + void write_file(Files::Filesystem& fs, const ToWrite& data) + { + auto original_path_string = fs::u8string(data.original_path); + auto file_to_write_string = fs::u8string(data.file_to_write); + if (data.file_to_write == data.original_path) + { + Debug::print("Formatting ", file_to_write_string, "\n"); + } + else + { + Debug::print("Converting ", file_to_write_string, " -> ", original_path_string, "\n"); + } + auto res = serialize_manifest(data.scf); + + auto check = SourceControlFile::parse_manifest_file(fs::path{}, res); + if (!check) + { + System::printf(System::Color::error, + R"([correctness check] Failed to parse serialized manifest file of %s +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: +Error:)", + data.scf.core_paragraph->name); + print_error_message(check.error()); + Checks::exit_with_message(VCPKG_LINE_INFO, + R"( +=== Serialized manifest file === +%s +)", + Json::stringify(res, {})); + } + + auto check_scf = std::move(check).value_or_exit(VCPKG_LINE_INFO); + if (*check_scf != data.scf) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + R"([correctness check] The serialized manifest SCF was different from the original SCF. +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: + +=== Original File === +%s + +=== Serialized File === +%s + +=== Original SCF === +%s + +=== Serialized SCF === +%s +)", + data.original_source, + Json::stringify(res, {}), + Json::stringify(serialize_debug_manifest(data.scf), {}), + Json::stringify(serialize_debug_manifest(*check_scf), {})); + } + + // the manifest scf is correct + std::error_code ec; + fs.write_contents(data.file_to_write, Json::stringify(res, {}), ec); + if (ec) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to write manifest file %s: %s\n", file_to_write_string, ec.message()); + } + if (data.original_path != data.file_to_write) + { + fs.remove(data.original_path, ec); + if (ec) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to remove control file %s: %s\n", original_path_string, ec.message()); + } + } + } +} namespace vcpkg::Commands::FormatManifest { static constexpr StringLiteral OPTION_ALL = "all"; + static constexpr StringLiteral OPTION_CONVERT_CONTROL = "convert-control"; - const CommandSwitch FORMAT_SWITCHES[] = {{OPTION_ALL, "Format all ports' manifest files."}}; + const CommandSwitch FORMAT_SWITCHES[] = { + {OPTION_ALL, "Format all ports' manifest files."}, + {OPTION_CONVERT_CONTROL, "Convert CONTROL files to manifest files."}, + }; const CommandStructure COMMAND_STRUCTURE = { create_example_string(R"###(x-format-manifest --all)###"), @@ -26,23 +196,35 @@ namespace vcpkg::Commands::FormatManifest { auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE); - std::vector files_to_format; - auto& fs = paths.get_filesystem(); bool has_error = false; - if (Util::Sets::contains(parsed_args.switches, OPTION_ALL)) + const bool format_all = Util::Sets::contains(parsed_args.switches, OPTION_ALL); + const bool convert_control = Util::Sets::contains(parsed_args.switches, OPTION_CONVERT_CONTROL); + + if (!format_all && convert_control) { - for (const auto& dir : fs::directory_iterator(paths.ports)) - { - auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); - if (fs.exists(manifest_path)) - { - files_to_format.push_back(std::move(manifest_path)); - } - } + System::print2(System::Color::warning, R"(x-format-manifest was passed '--convert-control' without '--all'. + This doesn't do anything: + we will automatically convert all control files passed explicitly.)"); + } + + if (!format_all && args.command_arguments.empty()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + "No files to format; please pass either --all, or the explicit files to format or convert."); } + std::vector to_write; + + const auto add_file = [&to_write, &has_error](Optional&& opt) { + if (auto t = opt.get()) + to_write.push_back(std::move(*t)); + else + has_error = true; + }; + for (const auto& arg : args.command_arguments) { auto path = fs::u8path(arg); @@ -50,40 +232,47 @@ namespace vcpkg::Commands::FormatManifest { path = paths.original_cwd / path; } - files_to_format.push_back(std::move(path)); - } - for (const auto& path : files_to_format) - { - std::error_code ec; - Debug::print("Formatting ", path.u8string(), "\n"); - auto parsed_json_opt = Json::parse_file(fs, path, ec); - if (ec) - { - System::printf(System::Color::error, "Failed to read %s: %s\n", path.u8string(), ec.message()); - has_error = true; - } - - if (auto pr = parsed_json_opt.get()) + if (path.filename() == fs::u8path("CONTROL")) { - fs.write_contents(path, Json::stringify(pr->first, Json::JsonStyle{}), ec); + add_file(read_control_file(fs, std::move(path))); } else { - System::printf(System::Color::error, - "Failed to parse %s: %s\n", - path.u8string(), - parsed_json_opt.error()->format()); - has_error = true; + add_file(read_manifest(fs, std::move(path))); } + } - if (ec) + if (format_all) + { + for (const auto& dir : fs::directory_iterator(paths.ports)) { - System::printf(System::Color::error, "Failed to write %s: %s\n", path.u8string(), ec.message()); - has_error = true; + auto control_path = dir.path() / fs::u8path("CONTROL"); + auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); + auto manifest_exists = fs.exists(manifest_path); + auto control_exists = fs.exists(control_path); + + Checks::check_exit(VCPKG_LINE_INFO, + !manifest_exists || !control_exists, + "Both a manifest file and a CONTROL file exist in port directory: %s", + fs::u8string(dir.path())); + + if (manifest_exists) + { + add_file(read_manifest(fs, std::move(manifest_path))); + } + if (convert_control && control_exists) + { + add_file(read_control_file(fs, std::move(control_path))); + } } } + for (auto const& el : to_write) + { + write_file(fs, el); + } + if (has_error) { Checks::exit_fail(VCPKG_LINE_INFO); @@ -94,4 +283,9 @@ namespace vcpkg::Commands::FormatManifest Checks::exit_success(VCPKG_LINE_INFO); } } + + void FormatManifestCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + FormatManifest::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp new file mode 100644 index 00000000000000..6b2e81c127ab96 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -0,0 +1,41 @@ +#include +#include +#include + +#include +#include +#include + +namespace vcpkg::Commands::Hash +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), + 1, + 2, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + (void)args.parse_arguments(COMMAND_STRUCTURE); + + const fs::path file_to_hash = args.command_arguments[0]; + + auto algorithm = vcpkg::Hash::Algorithm::Sha512; + if (args.command_arguments.size() == 2) + { + algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); + } + + const std::string hash = + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); + System::print2(hash, '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } + + void HashCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Hash::perform_and_exit(args, paths); + } +} diff --git a/toolsrc/src/vcpkg/commands.info.cpp b/toolsrc/src/vcpkg/commands.info.cpp new file mode 100644 index 00000000000000..71db6a8f4dad47 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.info.cpp @@ -0,0 +1,147 @@ +#include "pch.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace vcpkg::Commands::Info +{ + static constexpr StringLiteral OPTION_TRANSITIVE = "x-transitive"; + static constexpr StringLiteral OPTION_INSTALLED = "x-installed"; + + static constexpr CommandSwitch INFO_SWITCHES[] = { + {OPTION_INSTALLED, "(experimental) Report on installed packages instead of available"}, + {OPTION_TRANSITIVE, "(experimental) Also report on dependencies of installed packages"}, + }; + + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("Display detailed information on packages.\n%s", + create_example_string("x-package-info zlib openssl:x64-windows")), + 1, + SIZE_MAX, + {INFO_SWITCHES, {}}, + nullptr, + }; + + void InfoCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + if (!args.output_json()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "This command currently requires --%s", VcpkgCmdArguments::JSON_SWITCH); + } + + const bool installed = Util::Sets::contains(options.switches, OPTION_INSTALLED); + const bool transitive = Util::Sets::contains(options.switches, OPTION_TRANSITIVE); + + if (transitive && !installed) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "--%s requires --%s", OPTION_TRANSITIVE, OPTION_INSTALLED); + } + + if (installed) + { + const StatusParagraphs status_paragraphs = database_load_check(paths); + std::set specs_written; + std::vector specs_to_write; + for (auto&& arg : args.command_arguments) + { + Parse::ParserBase parser(arg, ""); + auto maybe_qpkg = parse_qualified_specifier(parser); + if (!parser.at_eof() || !maybe_qpkg) + { + parser.add_error("expected a package specifier"); + } + else if (!maybe_qpkg.get()->triplet) + { + parser.add_error("expected an explicit triplet"); + } + else if (maybe_qpkg.get()->features) + { + parser.add_error("unexpected list of features"); + } + else if (maybe_qpkg.get()->platform) + { + parser.add_error("unexpected qualifier"); + } + if (auto err = parser.get_error()) + { + System::print2(err->format(), "\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + auto& qpkg = *maybe_qpkg.get(); + auto t = Triplet::from_canonical_name(std::string(*qpkg.triplet.get())); + Input::check_triplet(t, paths); + specs_to_write.emplace_back(qpkg.name, t); + } + Json::Object response; + Json::Object results; + while (!specs_to_write.empty()) + { + auto spec = std::move(specs_to_write.back()); + specs_to_write.pop_back(); + if (!specs_written.insert(spec).second) continue; + auto maybe_ipv = status_paragraphs.get_installed_package_view(spec); + if (auto ipv = maybe_ipv.get()) + { + results.insert(spec.to_string(), serialize_ipv(*ipv, paths)); + if (transitive) + { + auto deps = ipv->dependencies(); + specs_to_write.insert(specs_to_write.end(), + std::make_move_iterator(deps.begin()), + std::make_move_iterator(deps.end())); + } + } + } + response.insert("results", std::move(results)); + System::print2(Json::stringify(response, {})); + } + else + { + Json::Object response; + Json::Object results; + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); + + for (auto&& arg : args.command_arguments) + { + Parse::ParserBase parser(arg, ""); + auto maybe_pkg = parse_package_name(parser); + if (!parser.at_eof() || !maybe_pkg) + { + parser.add_error("expected only a package identifier"); + } + if (auto err = parser.get_error()) + { + System::print2(err->format(), "\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + auto& pkg = *maybe_pkg.get(); + + if (results.contains(pkg)) continue; + + auto maybe_scfl = provider.get_control_file(pkg); + + Json::Object obj; + if (auto pscfl = maybe_scfl.get()) + { + results.insert(pkg, serialize_manifest(*pscfl->source_control_file)); + } + } + response.insert("results", std::move(results)); + System::print2(Json::stringify(response, {})); + } + } +} diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index a7ef5a012226c3..3a682b4c97c810 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,9 +5,12 @@ #include #include -#include +#include #include +#include #include +#include +#include namespace vcpkg::Commands::Integrate { @@ -76,7 +77,7 @@ namespace vcpkg::Commands::Integrate #if defined(_WIN32) static std::string get_nuget_id(const fs::path& vcpkg_root_dir) { - std::string dir_id = vcpkg_root_dir.generic_u8string(); + std::string dir_id = fs::generic_u8string(vcpkg_root_dir); std::replace(dir_id.begin(), dir_id.end(), '/', '.'); dir_id.erase(1, 1); // Erasing the ":" @@ -254,7 +255,7 @@ namespace vcpkg::Commands::Integrate const fs::path appdata_src_path = tmp_dir / "vcpkg.user.targets"; fs.write_contents(appdata_src_path, - create_appdata_shortcut(paths.buildsystems_msbuild_targets.u8string()), + create_appdata_shortcut(fs::u8string(paths.buildsystems_msbuild_targets)), VCPKG_LINE_INFO); auto appdata_dst_path = get_appdata_targets_path(); @@ -264,16 +265,16 @@ namespace vcpkg::Commands::Integrate { System::print2(System::Color::error, "Error: Failed to copy file: ", - appdata_src_path.u8string(), + fs::u8string(appdata_src_path), " -> ", - appdata_dst_path.u8string(), + fs::u8string(appdata_dst_path), "\n"); Checks::exit_fail(VCPKG_LINE_INFO); } const fs::path appdata_src_path2 = tmp_dir / "vcpkg.user.props"; fs.write_contents(appdata_src_path2, - create_appdata_shortcut(paths.buildsystems_msbuild_props.u8string()), + create_appdata_shortcut(fs::u8string(paths.buildsystems_msbuild_props)), VCPKG_LINE_INFO); auto appdata_dst_path2 = get_appdata_props_path(); @@ -284,9 +285,9 @@ namespace vcpkg::Commands::Integrate { System::print2(System::Color::error, "Error: Failed to copy file: ", - appdata_src_path2.u8string(), + fs::u8string(appdata_src_path2), " -> ", - appdata_dst_path2.u8string(), + fs::u8string(appdata_dst_path2), "\n"); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -295,7 +296,7 @@ namespace vcpkg::Commands::Integrate const auto pathtxt = get_path_txt_path(); std::error_code ec; - fs.write_contents(pathtxt, paths.root.generic_u8string(), VCPKG_LINE_INFO); + fs.write_contents(pathtxt, fs::generic_u8string(paths.root), VCPKG_LINE_INFO); System::print2(System::Color::success, "Applied user-wide integration for this vcpkg root.\n"); const fs::path cmake_toolchain = paths.buildsystems / "vcpkg.cmake"; @@ -308,13 +309,13 @@ Installing new libraries will make them instantly available. CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s" )", - cmake_toolchain.generic_u8string()); + fs::generic_u8string(cmake_toolchain)); #else System::printf( R"( CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s" )", - cmake_toolchain.generic_u8string()); + fs::generic_u8string(cmake_toolchain)); #endif Checks::exit_success(VCPKG_LINE_INFO); @@ -379,9 +380,9 @@ CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s" // Using all forward slashes for the command line const std::string cmd_line = Strings::format(R"("%s" pack -OutputDirectory "%s" "%s")", - nuget_exe.u8string(), - buildsystems_dir.u8string(), - nuspec_file_path.u8string()); + fs::u8string(nuget_exe), + fs::u8string(buildsystems_dir), + fs::u8string(nuspec_file_path)); const int exit_code = System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; @@ -389,9 +390,9 @@ CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s" const fs::path nuget_package = buildsystems_dir / Strings::format("%s.%s.nupkg", nuget_id, nupkg_version); Checks::check_exit( VCPKG_LINE_INFO, exit_code == 0 && fs.exists(nuget_package), "Error: NuGet package creation failed"); - System::print2(System::Color::success, "Created nupkg: ", nuget_package.u8string(), '\n'); + System::print2(System::Color::success, "Created nupkg: ", fs::u8string(nuget_package), '\n'); - auto source_path = buildsystems_dir.u8string(); + auto source_path = fs::u8string(buildsystems_dir); source_path = Strings::replace_all(std::move(source_path), "`", "``"); System::printf(R"( @@ -413,8 +414,9 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console const fs::path script_path = paths.scripts / "addPoshVcpkgToPowershellProfile.ps1"; const auto& ps = paths.get_tool_exe("powershell-core"); - const std::string cmd = Strings::format( - R"("%s" -NoProfile -ExecutionPolicy Bypass -Command "& {& '%s' }")", ps.u8string(), script_path.u8string()); + const std::string cmd = Strings::format(R"("%s" -NoProfile -ExecutionPolicy Bypass -Command "& {& '%s' }")", + fs::u8string(ps), + fs::u8string(script_path)); const int rc = System::cmd_execute(cmd); if (rc) { @@ -423,7 +425,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console "Could not run:\n" " '%s'\n", TITLE, - script_path.generic_u8string()); + fs::generic_u8string(script_path)); { auto locked_metrics = Metrics::g_metrics.lock(); @@ -445,7 +447,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Expected> maybe_bashrc_content = fs.read_lines(bashrc_path); Checks::check_exit( - VCPKG_LINE_INFO, maybe_bashrc_content.has_value(), "Unable to read %s", bashrc_path.u8string()); + VCPKG_LINE_INFO, maybe_bashrc_content.has_value(), "Unable to read %s", fs::u8string(bashrc_path)); std::vector bashrc_content = maybe_bashrc_content.value_or_exit(VCPKG_LINE_INFO); @@ -465,13 +467,13 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console "The following entries were found:\n" " %s\n" "Please make sure you have started a new bash shell for the changes to take effect.\n", - bashrc_path.u8string(), + fs::u8string(bashrc_path), Strings::join("\n ", matches)); Checks::exit_success(VCPKG_LINE_INFO); } - System::printf("Adding vcpkg completion entry to %s\n", bashrc_path.u8string()); - bashrc_content.push_back(Strings::format("source %s", completion_script_path.u8string())); + System::printf("Adding vcpkg completion entry to %s\n", fs::u8string(bashrc_path)); + bashrc_content.push_back(Strings::format("source %s", fs::u8string(completion_script_path))); fs.write_contents(bashrc_path, Strings::join("\n", bashrc_content) + '\n', VCPKG_LINE_INFO); Checks::exit_success(VCPKG_LINE_INFO); } @@ -531,7 +533,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)args.parse_arguments(COMMAND_STRUCTURE); if (args.command_arguments[0] == Subcommand::INSTALL) { @@ -559,4 +561,9 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown parameter %s for integrate", args.command_arguments[0]); } + + void IntegrateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Integrate::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp index f65ba9497974ae..2156857d169117 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include -#include +#include #include +#include #include #include @@ -11,8 +10,6 @@ namespace vcpkg::Commands::List { static constexpr StringLiteral OPTION_FULLDESC = "x-full-desc"; // TODO: This should find a better home, eventually - static constexpr StringLiteral OPTION_JSON = "--x-json"; - static void do_print_json(std::vector installed_packages) { Json::Object obj; @@ -75,9 +72,8 @@ namespace vcpkg::Commands::List } } - static constexpr std::array LIST_SWITCHES = {{ + static constexpr std::array LIST_SWITCHES = {{ {OPTION_FULLDESC, "Do not truncate long text"}, - {OPTION_JSON, "List libraries in JSON format"}, }}; const CommandStructure COMMAND_STRUCTURE = { @@ -115,7 +111,6 @@ namespace vcpkg::Commands::List }); const auto enable_fulldesc = Util::Sets::contains(options.switches, OPTION_FULLDESC.to_string()); - const auto enable_json = Util::Sets::contains(options.switches, OPTION_JSON.to_string()); if (!args.command_arguments.empty()) { @@ -126,7 +121,7 @@ namespace vcpkg::Commands::List installed_packages = pghs; } - if (enable_json) + if (args.output_json()) { do_print_json(installed_packages); } @@ -140,4 +135,9 @@ namespace vcpkg::Commands::List Checks::exit_success(VCPKG_LINE_INFO); } + + void ListCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + List::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp index a71a56ed30153e..8bd020108c4a4e 100644 --- a/toolsrc/src/vcpkg/commands.owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include -#include +#include #include +#include #include namespace vcpkg::Commands::Owns @@ -34,10 +33,15 @@ namespace vcpkg::Commands::Owns void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)args.parse_arguments(COMMAND_STRUCTURE); const StatusParagraphs status_db = database_load_check(paths); search_file(paths, args.command_arguments[0], status_db); Checks::exit_success(VCPKG_LINE_INFO); } + + void OwnsCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Owns::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp index b1bf29f5f3e0b7..4313ab647e056f 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -1,11 +1,12 @@ -#include "pch.h" - #include #include #include -#include +#include #include +#include +#include +#include namespace vcpkg::Commands::PortHistory { @@ -22,7 +23,7 @@ namespace vcpkg::Commands::PortHistory const fs::path dot_git_dir = paths.root / ".git"; const std::string full_cmd = - Strings::format(R"("%s" --git-dir="%s" %s)", git_exe.u8string(), dot_git_dir.u8string(), cmd); + Strings::format(R"("%s" --git-dir="%s" %s)", fs::u8string(git_exe), fs::u8string(dot_git_dir), cmd); auto output = System::cmd_execute_and_capture_output(full_cmd); Checks::check_exit(VCPKG_LINE_INFO, output.exit_code == 0, "Failed to run command: %s", full_cmd); @@ -83,8 +84,7 @@ namespace vcpkg::Commands::PortHistory void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - + (void)args.parse_arguments(COMMAND_STRUCTURE); std::string port_name = args.command_arguments.at(0); std::vector versions = read_versions_from_log(paths, port_name); System::print2(" version date vcpkg commit\n"); @@ -94,4 +94,9 @@ namespace vcpkg::Commands::PortHistory } Checks::exit_success(VCPKG_LINE_INFO); } + + void PortHistoryCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + PortHistory::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp index 94c6e490b410cd..392ca70ddb5c87 100644 --- a/toolsrc/src/vcpkg/commands.portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -1,13 +1,13 @@ -#include "pch.h" - #include #include #include #include -#include +#include #include #include +#include +#include #include namespace vcpkg::Commands::PortsDiff @@ -83,7 +83,7 @@ namespace vcpkg::Commands::PortsDiff auto& fs = paths.get_filesystem(); const fs::path& git_exe = paths.get_tool_exe(Tools::GIT); const fs::path dot_git_dir = paths.root / ".git"; - const std::string ports_dir_name_as_string = paths.ports.filename().u8string(); + const std::string ports_dir_name_as_string = fs::u8string(paths.ports.filename()); const fs::path temp_checkout_path = paths.root / Strings::format("%s-%s", ports_dir_name_as_string, git_commit_id); fs.create_directory(temp_checkout_path, ec); @@ -91,22 +91,22 @@ namespace vcpkg::Commands::PortsDiff Strings::format(R"(.\%s)", ports_dir_name_as_string); // Must be relative to the root of the repository const std::string cmd = Strings::format(R"("%s" --git-dir="%s" --work-tree="%s" checkout %s -f -q -- %s %s)", - git_exe.u8string(), - dot_git_dir.u8string(), - temp_checkout_path.u8string(), + fs::u8string(git_exe), + fs::u8string(dot_git_dir), + fs::u8string(temp_checkout_path), git_commit_id, checkout_this_dir, ".vcpkg-root"); System::cmd_execute_and_capture_output(cmd, System::get_clean_environment()); - System::cmd_execute_and_capture_output(Strings::format(R"("%s" reset)", git_exe.u8string()), + System::cmd_execute_and_capture_output(Strings::format(R"("%s" reset)", fs::u8string(git_exe)), System::get_clean_environment()); - const auto all_ports = - Paragraphs::load_all_ports(paths.get_filesystem(), temp_checkout_path / ports_dir_name_as_string); + const auto ports_at_commit = + Paragraphs::load_overlay_ports(paths, temp_checkout_path / ports_dir_name_as_string); std::map names_and_versions; - for (auto&& port : all_ports) + for (auto&& port : ports_at_commit) { - const auto& core_pgh = *port->core_paragraph; - names_and_versions.emplace(port->core_paragraph->name, VersionT(core_pgh.version, core_pgh.port_version)); + const auto& core_pgh = *port.source_control_file->core_paragraph; + names_and_versions.emplace(core_pgh.name, VersionT(core_pgh.version, core_pgh.port_version)); } fs.remove_all(temp_checkout_path, VCPKG_LINE_INFO); return names_and_versions; @@ -116,7 +116,7 @@ namespace vcpkg::Commands::PortsDiff { static const std::string VALID_COMMIT_OUTPUT = "commit\n"; - const auto cmd = Strings::format(R"("%s" cat-file -t %s)", git_exe.u8string(), git_commit_id); + const auto cmd = Strings::format(R"("%s" cat-file -t %s)", fs::u8string(git_exe), git_commit_id); const System::ExitCodeAndOutput output = System::cmd_execute_and_capture_output(cmd); Checks::check_exit( VCPKG_LINE_INFO, output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", git_commit_id); @@ -133,8 +133,7 @@ namespace vcpkg::Commands::PortsDiff void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - + (void)args.parse_arguments(COMMAND_STRUCTURE); const fs::path& git_exe = paths.get_tool_exe(Tools::GIT); const std::string git_commit_id_for_previous_snapshot = args.command_arguments.at(0); @@ -190,4 +189,9 @@ namespace vcpkg::Commands::PortsDiff Checks::exit_success(VCPKG_LINE_INFO); } + + void PortsDiffCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + PortsDiff::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.search.cpp b/toolsrc/src/vcpkg/commands.search.cpp index b78420b4db2ccf..9f493bf35e6451 100644 --- a/toolsrc/src/vcpkg/commands.search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -1,13 +1,12 @@ -#include "pch.h" - #include -#include +#include #include #include #include #include #include +#include #include #include @@ -16,7 +15,27 @@ using vcpkg::PortFileProvider::PathsPortFileProvider; namespace vcpkg::Commands::Search { static constexpr StringLiteral OPTION_FULLDESC = "x-full-desc"; // TODO: This should find a better home, eventually + static constexpr StringLiteral OPTION_JSON = "x-json"; + + static void do_print_json(std::vector source_control_files) + { + Json::Object obj; + for (const SourceControlFile* scf : source_control_files) + { + auto& source_paragraph = scf->core_paragraph; + Json::Object& library_obj = obj.insert(source_paragraph->name, Json::Object()); + library_obj.insert("package_name", Json::Value::string(source_paragraph->name)); + library_obj.insert("version", Json::Value::string(source_paragraph->version)); + library_obj.insert("port_version", Json::Value::integer(source_paragraph->port_version)); + Json::Array& desc = library_obj.insert("description", Json::Array()); + for (const auto& line : source_paragraph->description) + { + desc.push_back(Json::Value::string(line)); + } + } + System::print2(Json::stringify(obj, Json::JsonStyle{})); + } static void do_print(const SourceParagraph& source_paragraph, bool full_desc) { auto full_version = VersionT(source_paragraph.version, source_paragraph.port_version).to_string(); @@ -60,8 +79,9 @@ namespace vcpkg::Commands::Search } } - static constexpr std::array SEARCH_SWITCHES = {{ + static constexpr std::array SEARCH_SWITCHES = {{ {OPTION_FULLDESC, "Do not truncate long text"}, + {OPTION_JSON, "(experimental) List libraries in JSON format"}, }}; const CommandStructure COMMAND_STRUCTURE = { @@ -78,6 +98,7 @@ namespace vcpkg::Commands::Search { const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); const bool full_description = Util::Sets::contains(options.switches, OPTION_FULLDESC); + const bool enable_json = Util::Sets::contains(options.switches, OPTION_JSON); PathsPortFileProvider provider(paths, args.overlay_ports); auto source_paragraphs = @@ -86,12 +107,19 @@ namespace vcpkg::Commands::Search if (args.command_arguments.empty()) { - for (const auto& source_control_file : source_paragraphs) + if (enable_json) { - do_print(*source_control_file->core_paragraph, full_description); - for (auto&& feature_paragraph : source_control_file->feature_paragraphs) + do_print_json(source_paragraphs); + } + else + { + for (const auto& source_control_file : source_paragraphs) { - do_print(source_control_file->core_paragraph->name, *feature_paragraph, full_description); + do_print(*source_control_file->core_paragraph, full_description); + for (auto&& feature_paragraph : source_control_file->feature_paragraphs) + { + do_print(source_control_file->core_paragraph->name, *feature_paragraph, full_description); + } } } } @@ -138,10 +166,18 @@ namespace vcpkg::Commands::Search } } - System::print2( - "\nIf your library is not listed, please open an issue at and/or consider making a pull request:\n" - " https://github.com/Microsoft/vcpkg/issues\n"); + if (!enable_json) + { + System::print2( + "\nIf your library is not listed, please open an issue at and/or consider making a pull request:\n" + " https://github.com/Microsoft/vcpkg/issues\n"); + } Checks::exit_success(VCPKG_LINE_INFO); } + + void SearchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Search::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.setinstalled.cpp b/toolsrc/src/vcpkg/commands.setinstalled.cpp index 82e1c763f14f9a..4b7ba10cabb7f4 100644 --- a/toolsrc/src/vcpkg/commands.setinstalled.cpp +++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp @@ -1,15 +1,14 @@ -#include "pch.h" - #include #include -#include +#include #include #include #include #include #include #include +#include #include namespace vcpkg::Commands::SetInstalled @@ -39,21 +38,10 @@ namespace vcpkg::Commands::SetInstalled const PortFileProvider::PathsPortFileProvider& provider, IBinaryProvider& binary_provider, const CMakeVars::CMakeVarProvider& cmake_vars, - const std::vector& specs, - const Build::BuildPackageOptions& install_plan_options, + Dependencies::ActionPlan action_plan, DryRun dry_run, const Optional& maybe_pkgsconfig) { - // We have a set of user-requested specs. - // We need to know all the specs which are required to fulfill dependencies for those specs. - // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. - auto action_plan = Dependencies::create_feature_install_plan(provider, cmake_vars, specs, {}); - - for (auto&& action : action_plan.install_actions) - { - action.build_options = install_plan_options; - } - cmake_vars.load_tag_vars(action_plan, provider); Build::compute_all_abis(paths, action_plan, cmake_vars, {}); @@ -106,7 +94,7 @@ namespace vcpkg::Commands::SetInstalled auto pkgsconfig_path = Files::combine(paths.original_cwd, *p_pkgsconfig); auto pkgsconfig_contents = generate_nuget_packages_config(action_plan); fs.write_contents(pkgsconfig_path, pkgsconfig_contents, VCPKG_LINE_INFO); - System::print2("Wrote NuGet packages config information to ", pkgsconfig_path.u8string(), "\n"); + System::print2("Wrote NuGet packages config information to ", fs::u8string(pkgsconfig_path), "\n"); } if (dry_run == DryRun::Yes) @@ -155,14 +143,31 @@ namespace vcpkg::Commands::SetInstalled { pkgsconfig = it_pkgsconfig->second; } + + // We have a set of user-requested specs. + // We need to know all the specs which are required to fulfill dependencies for those specs. + // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. + auto action_plan = Dependencies::create_feature_install_plan(provider, *cmake_vars, specs, {}); + + for (auto&& action : action_plan.install_actions) + { + action.build_options = Build::default_build_package_options; + } + perform_and_exit_ex(args, paths, provider, *binary_provider, *cmake_vars, - specs, - vcpkg::Build::default_build_package_options, + std::move(action_plan), dry_run ? DryRun::Yes : DryRun::No, pkgsconfig); } + + void SetInstalledCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + SetInstalled::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 25fb0de9895aac..5e9ed7ce2511a7 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include #include @@ -12,6 +10,7 @@ #include #include #include +#include #include namespace vcpkg::Commands::Upgrade @@ -82,41 +81,46 @@ namespace vcpkg::Commands::Upgrade else { std::vector not_installed; - std::vector no_portfile; + std::vector no_control_file; std::vector to_upgrade; std::vector up_to_date; for (auto&& spec : specs) { - auto it = status_db.find_installed(spec); - if (it == status_db.end()) + bool skip_version_check = false; + auto installed_status = status_db.find_installed(spec); + if (installed_status == status_db.end()) { not_installed.push_back(spec); + skip_version_check = true; + } + + auto maybe_control_file = provider.get_control_file(spec.name()); + if (!maybe_control_file.has_value()) + { + no_control_file.push_back(spec); + skip_version_check = true; } - auto maybe_scfl = provider.get_control_file(spec.name()); - if (auto p_scfl = maybe_scfl.get()) + if (skip_version_check) continue; + + const auto& control_file = maybe_control_file.value_or_exit(VCPKG_LINE_INFO); + const auto& control_paragraph = *control_file.source_control_file->core_paragraph; + auto control_version = VersionT(control_paragraph.version, control_paragraph.port_version); + const auto& installed_paragraph = (*installed_status)->package; + auto installed_version = VersionT(installed_paragraph.version, installed_paragraph.port_version); + if (control_version == installed_version) { - if (it != status_db.end()) - { - if (p_scfl->source_control_file->core_paragraph->version != (*it)->package.version) - { - to_upgrade.push_back(spec); - } - else - { - up_to_date.push_back(spec); - } - } + up_to_date.push_back(spec); } else { - no_portfile.push_back(spec); + to_upgrade.push_back(spec); } } Util::sort(not_installed); - Util::sort(no_portfile); + Util::sort(no_control_file); Util::sort(up_to_date); Util::sort(to_upgrade); @@ -138,16 +142,17 @@ namespace vcpkg::Commands::Upgrade '\n'); } - if (!no_portfile.empty()) + if (!no_control_file.empty()) { - System::print2(System::Color::error, "The following packages do not have a valid portfile:\n"); + System::print2(System::Color::error, + "The following packages do not have a valid CONTROL or vcpkg.json:\n"); System::print2(Strings::join("", - no_portfile, + no_control_file, [](const PackageSpec& spec) { return " " + spec.to_string() + "\n"; }), '\n'); } - Checks::check_exit(VCPKG_LINE_INFO, not_installed.empty() && no_portfile.empty()); + Checks::check_exit(VCPKG_LINE_INFO, not_installed.empty() && no_control_file.empty()); if (to_upgrade.empty()) Checks::exit_success(VCPKG_LINE_INFO); @@ -192,4 +197,11 @@ namespace vcpkg::Commands::Upgrade Checks::exit_success(VCPKG_LINE_INFO); } + + void UpgradeCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Upgrade::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp index 273b4f10a64e20..c7e33ee6506b53 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -1,10 +1,10 @@ -#include "pch.h" - #include -#include +#include #include #include +#include +#include #define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) @@ -61,15 +61,21 @@ namespace vcpkg::Commands::Version { if (maj1 != maj2 || min1 != min2 || rev1 != rev2) { +#if defined(_WIN32) + auto bootstrap = ".\\bootstrap-vcpkg.bat"; +#else + auto bootstrap = "./bootstrap-vcpkg.sh"; +#endif System::printf(System::Color::warning, "Warning: Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use " - ".\\bootstrap-vcpkg.bat to update.\n", + "%s to update.\n", maj2, min2, rev2, maj1, min1, - rev1); + rev1, + bootstrap); } } } @@ -84,8 +90,7 @@ namespace vcpkg::Commands::Version void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem&) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - + (void)args.parse_arguments(COMMAND_STRUCTURE); System::print2("Vcpkg package management program version ", version(), "\n" @@ -93,4 +98,9 @@ namespace vcpkg::Commands::Version "See LICENSE.txt for license information.\n"); Checks::exit_success(VCPKG_LINE_INFO); } + + void VersionCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const + { + Version::perform_and_exit(args, fs); + } } diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp index 718c73ec015604..67f35f542e89c3 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include -#include +#include #include +#include #include namespace vcpkg::Commands::X_VSInstances @@ -29,8 +28,14 @@ namespace vcpkg::Commands::X_VSInstances Checks::exit_success(VCPKG_LINE_INFO); #else - Util::unused(args, paths); + (void)args; + (void)paths; Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); #endif } + + void VSInstancesCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + X_VSInstances::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/configuration.cpp b/toolsrc/src/vcpkg/configuration.cpp new file mode 100644 index 00000000000000..9363abe8086552 --- /dev/null +++ b/toolsrc/src/vcpkg/configuration.cpp @@ -0,0 +1,67 @@ +#include + +#include +#include + +namespace vcpkg +{ + Optional ConfigurationDeserializer::visit_object(Json::Reader& r, const Json::Object& obj) + { + RegistrySet registries; + + bool registries_feature_flags_warning = false; + + { + std::unique_ptr default_registry; + if (r.optional_object_field(obj, DEFAULT_REGISTRY, default_registry, RegistryImplDeserializer{})) + { + if (!registries_enabled) + { + registries_feature_flags_warning = true; + } + else + { + registries.set_default_registry(std::move(default_registry)); + } + } + } + + std::vector regs; + r.optional_object_field( + obj, + REGISTRIES, + regs, + Json::ArrayDeserializer{"an array of registries", Json::AllowEmpty::Yes}); + + if (!regs.empty() && !registries_enabled) + { + registries_feature_flags_warning = true; + regs.clear(); + } + + for (Registry& reg : regs) + { + registries.add_registry(std::move(reg)); + } + + if (registries_feature_flags_warning && !print_json) + { + System::printf(System::Color::warning, + "Warning: configuration specified the \"registries\" or \"default-registries\" field, but " + "the %s feature flag was not enabled.\n", + VcpkgCmdArguments::REGISTRIES_FEATURE); + } + + return Configuration{std::move(registries)}; + } + + constexpr StringLiteral ConfigurationDeserializer::DEFAULT_REGISTRY; + constexpr StringLiteral ConfigurationDeserializer::REGISTRIES; + + ConfigurationDeserializer::ConfigurationDeserializer(const VcpkgCmdArguments& args) + { + registries_enabled = args.registries_enabled(); + print_json = args.output_json(); + } + +} diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index 426a5c7f0e18b2..58e69290850363 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -49,8 +47,8 @@ namespace vcpkg::Dependencies /// struct Cluster : Util::MoveOnlyBase { - Cluster(const InstalledPackageView& ipv, const SourceControlFileLocation& scfl) - : m_spec(ipv.spec()), m_scfl(scfl), m_installed(ipv) + Cluster(const InstalledPackageView& ipv, ExpectedS&& scfl) + : m_spec(ipv.spec()), m_scfl(std::move(scfl)), m_installed(ipv) { } @@ -91,7 +89,7 @@ namespace vcpkg::Dependencies if (!info.defaults_requested) { info.defaults_requested = true; - for (auto&& f : m_scfl.source_control_file->core_paragraph->default_features) + for (auto&& f : get_scfl_or_exit().source_control_file->core_paragraph->default_features) out_new_dependencies.emplace_back(m_spec, f); } return; @@ -104,7 +102,8 @@ namespace vcpkg::Dependencies } auto maybe_vars = var_provider.get_dep_info_vars(m_spec); const std::vector* qualified_deps = - &m_scfl.source_control_file->find_dependencies_for_feature(feature).value_or_exit(VCPKG_LINE_INFO); + &get_scfl_or_exit().source_control_file->find_dependencies_for_feature(feature).value_or_exit( + VCPKG_LINE_INFO); std::vector dep_list; if (auto vars = maybe_vars.get()) @@ -162,13 +161,13 @@ namespace vcpkg::Dependencies if (defaults_requested) { - for (auto&& def_feature : m_scfl.source_control_file->core_paragraph->default_features) + for (auto&& def_feature : get_scfl_or_exit().source_control_file->core_paragraph->default_features) out_reinstall_requirements.emplace_back(m_spec, def_feature); } else if (request_type != RequestType::USER_REQUESTED) { // If the user did not explicitly request this installation, we need to add all new default features - auto&& new_defaults = m_scfl.source_control_file->core_paragraph->default_features; + auto&& new_defaults = get_scfl_or_exit().source_control_file->core_paragraph->default_features; std::set defaults_set{new_defaults.begin(), new_defaults.end()}; // Install only features that were not previously available @@ -189,8 +188,26 @@ namespace vcpkg::Dependencies } } + const SourceControlFileLocation& get_scfl_or_exit() const + { +#if defined(_WIN32) + static auto vcpkg_remove_cmd = ".\\vcpkg"; +#else + static auto vcpkg_remove_cmd = "./vcpkg"; +#endif + if (!m_scfl) + Checks::exit_with_message( + VCPKG_LINE_INFO, + "Error: while loading control file for %s: %s.\nPlease run \"%s remove %s\" and re-attempt.", + m_spec, + m_scfl.error(), + vcpkg_remove_cmd, + m_spec); + return *m_scfl.get(); + } + PackageSpec m_spec; - const SourceControlFileLocation& m_scfl; + ExpectedS m_scfl; Optional m_installed; Optional m_install_info; @@ -260,18 +277,10 @@ namespace vcpkg::Dependencies ExpectedS maybe_scfl = m_port_provider.get_control_file(ipv.spec().name()); - if (!maybe_scfl) - Checks::exit_with_message( - VCPKG_LINE_INFO, - "Error: while loading %s: %s.\nPlease run \"vcpkg remove %s\" and re-attempt.", - ipv.spec().to_string(), - maybe_scfl.error(), - ipv.spec().to_string()); - return m_graph .emplace(std::piecewise_construct, std::forward_as_tuple(ipv.spec()), - std::forward_as_tuple(ipv, *maybe_scfl.get())) + std::forward_as_tuple(ipv, std::move(maybe_scfl))) .first->second; } @@ -304,16 +313,16 @@ namespace vcpkg::Dependencies const fs::path& install_port_path, const fs::path& default_port_path) { - if (!default_port_path.empty() && - !Strings::case_insensitive_ascii_starts_with(install_port_path.u8string(), default_port_path.u8string())) + if (!default_port_path.empty() && !Strings::case_insensitive_ascii_starts_with(fs::u8string(install_port_path), + fs::u8string(default_port_path))) { const char* const from_head = options.use_head_version == Build::UseHeadVersion::YES ? " (from HEAD)" : ""; switch (request_type) { case RequestType::AUTO_SELECTED: - return Strings::format(" * %s%s -- %s", s, from_head, install_port_path.u8string()); + return Strings::format(" * %s%s -- %s", s, from_head, fs::u8string(install_port_path)); case RequestType::USER_REQUESTED: - return Strings::format(" %s%s -- %s", s, from_head, install_port_path.u8string()); + return Strings::format(" %s%s -- %s", s, from_head, fs::u8string(install_port_path)); default: Checks::unreachable(VCPKG_LINE_INFO); } } @@ -418,6 +427,11 @@ namespace vcpkg::Dependencies default: Checks::unreachable(VCPKG_LINE_INFO); } } + bool InstallPlanAction::has_package_abi() const + { + if (!abi_info) return false; + return !abi_info.get()->package_abi.empty(); + } const Build::PreBuildInfo& InstallPlanAction::pre_build_info(LineInfo linfo) const { return *abi_info.value_or_exit(linfo).pre_build_info.get(); @@ -594,12 +608,75 @@ namespace vcpkg::Dependencies m_graph->get(spec).request_type = RequestType::USER_REQUESTED; } + // `features` should have "default" instead of missing "core" + std::vector resolve_deps_as_top_level(const SourceControlFile& scf, + Triplet triplet, + std::vector features, + CMakeVars::CMakeVarProvider& var_provider) + { + PackageSpec spec{scf.core_paragraph->name, triplet}; + std::map> specs_to_features; + + Optional ctx_storage = var_provider.get_dep_info_vars(spec); + auto ctx = [&]() -> const PlatformExpression::Context& { + if (!ctx_storage) + { + var_provider.load_dep_info_vars({{spec}}); + ctx_storage = var_provider.get_dep_info_vars(spec); + } + return ctx_storage.value_or_exit(VCPKG_LINE_INFO); + }; + + auto handle_deps = [&](View deps) { + for (auto&& dep : deps) + { + if (dep.platform.is_empty() || dep.platform.evaluate(ctx())) + { + if (dep.name == spec.name()) + Util::Vectors::append(&features, dep.features); + else + Util::Vectors::append(&specs_to_features[dep.name], dep.features); + } + } + }; + + handle_deps(scf.core_paragraph->dependencies); + enum class State + { + NotVisited = 0, + Visited, + }; + std::map feature_state; + while (!features.empty()) + { + auto feature = std::move(features.back()); + features.pop_back(); + + if (feature_state[feature] == State::Visited) continue; + feature_state[feature] = State::Visited; + if (feature == "default") + { + Util::Vectors::append(&features, scf.core_paragraph->default_features); + } + else + { + auto it = + Util::find_if(scf.feature_paragraphs, [&feature](const std::unique_ptr& ptr) { + return ptr->name == feature; + }); + if (it != scf.feature_paragraphs.end()) handle_deps(it->get()->dependencies); + } + } + return Util::fmap(specs_to_features, [triplet](std::pair>& p) { + return FullPackageSpec({p.first, triplet}, Util::sort_unique_erase(std::move(p.second))); + }); + } + ActionPlan create_feature_install_plan(const PortFileProvider::PortFileProvider& port_provider, const CMakeVars::CMakeVarProvider& var_provider, const std::vector& specs, const StatusParagraphs& status_db, - const CreateInstallPlanOptions& options, - bool allFeatures) + const CreateInstallPlanOptions& options) { PackageGraph pgraph(port_provider, var_provider, status_db); @@ -611,7 +688,7 @@ namespace vcpkg::Dependencies Checks::check_exit( VCPKG_LINE_INFO, scfl, "Error: Cannot find definition for package `%s`.", spec.package_spec.name()); - std::vector all_features = + const std::vector all_features = Util::fmap(scfl->source_control_file->feature_paragraphs, [](auto&& feature_paragraph) { return feature_paragraph->name; }); @@ -619,24 +696,6 @@ namespace vcpkg::Dependencies spec.to_feature_specs(scfl->source_control_file->core_paragraph->default_features, all_features); feature_specs.insert( feature_specs.end(), std::make_move_iterator(fspecs.begin()), std::make_move_iterator(fspecs.end())); - - if (allFeatures) - { - auto feature_list = feature_specs; - const auto& features_paragraphs = scfl->source_control_file->feature_paragraphs; - PlatformExpression::Context context = - var_provider.get_tag_vars(spec.package_spec).value_or_exit(VCPKG_LINE_INFO); - - for (auto feature = features_paragraphs.begin(); feature != features_paragraphs.end(); feature++) - { - if (feature->get()->supports_expression.evaluate(context)) - { - // if (find(feature_list.begin(), feature_list.end(), feature->get()->name) == - // feature_list.end()) - feature_specs.emplace_back(spec.package_spec, feature->get()->name); - } - } - } } Util::sort_unique_erase(feature_specs); @@ -646,7 +705,9 @@ namespace vcpkg::Dependencies } pgraph.install(feature_specs); - return pgraph.serialize(options); + auto res = pgraph.serialize(options); + + return res; } void PackageGraph::mark_for_reinstall(const PackageSpec& first_remove_spec, @@ -703,14 +764,15 @@ namespace vcpkg::Dependencies const std::vector* paragraph_depends = nullptr; if (spec.feature() == "core") { - paragraph_depends = &clust.m_scfl.source_control_file->core_paragraph->dependencies; + paragraph_depends = &clust.get_scfl_or_exit().source_control_file->core_paragraph->dependencies; } else if (spec.feature() == "default") { } else { - auto maybe_paragraph = clust.m_scfl.source_control_file->find_feature(spec.feature()); + auto maybe_paragraph = + clust.get_scfl_or_exit().source_control_file->find_feature(spec.feature()); Checks::check_exit(VCPKG_LINE_INFO, maybe_paragraph.has_value(), "Package %s does not have a %s feature", @@ -886,8 +948,6 @@ namespace vcpkg::Dependencies // If a cluster only has an installed object and is marked as user requested we should still report it. if (auto info_ptr = p_cluster->m_install_info.get()) { - auto&& scfl = p_cluster->m_scfl; - std::map> computed_edges; for (auto&& kv : info_ptr->build_edges) { @@ -902,7 +962,8 @@ namespace vcpkg::Dependencies auto&& dep_clust = m_graph->get(fspec.spec()); const auto& default_features = [&] { if (dep_clust.m_install_info.has_value()) - return dep_clust.m_scfl.source_control_file->core_paragraph->default_features; + return dep_clust.get_scfl_or_exit() + .source_control_file->core_paragraph->default_features; if (auto p = dep_clust.m_installed.get()) return p->ipv.core->package.default_features; Checks::unreachable(VCPKG_LINE_INFO); }(); @@ -911,14 +972,15 @@ namespace vcpkg::Dependencies } computed_edges[kv.first].assign(fspecs.begin(), fspecs.end()); } - - plan.install_actions.emplace_back( - p_cluster->m_spec, scfl, p_cluster->request_type, std::move(computed_edges)); + plan.install_actions.emplace_back(p_cluster->m_spec, + p_cluster->get_scfl_or_exit(), + p_cluster->request_type, + std::move(computed_edges)); } else if (p_cluster->request_type == RequestType::USER_REQUESTED && p_cluster->m_installed.has_value()) { auto&& installed = p_cluster->m_installed.value_or_exit(VCPKG_LINE_INFO); - plan.already_installed.emplace_back(Util::copy(installed.ipv), p_cluster->request_type); + plan.already_installed.emplace_back(InstalledPackageView(installed.ipv), p_cluster->request_type); } } diff --git a/toolsrc/src/vcpkg/export.chocolatey.cpp b/toolsrc/src/vcpkg/export.chocolatey.cpp index 40564ae135d163..099bcf400e9b2d 100644 --- a/toolsrc/src/vcpkg/export.chocolatey.cpp +++ b/toolsrc/src/vcpkg/export.chocolatey.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -7,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Export::Chocolatey { @@ -39,24 +38,24 @@ namespace vcpkg::Export::Chocolatey const std::map& packages_version, const Options& chocolatey_options) { - static constexpr auto CONTENT_TEMPLATE = R"( - - - @PACKAGE_ID@ - @PACKAGE_VERSION@ - @PACKAGE_MAINTAINER@ - - - @PACKAGE_DEPENDENCIES@ - - - - - - - + static constexpr auto CONTENT_TEMPLATE = R"( + + + @PACKAGE_ID@ + @PACKAGE_VERSION@ + @PACKAGE_MAINTAINER@ + + + @PACKAGE_DEPENDENCIES@ + + + + + + + )"; auto package_version = packages_version.find(binary_paragraph.spec.name()); if (package_version == packages_version.end()) @@ -81,68 +80,68 @@ namespace vcpkg::Export::Chocolatey static std::string create_chocolatey_install_contents() { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$installedDir = Join-Path $rootDir 'installed' - -$whereToInstall = (pwd).path -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Set-Content -Path $whereToInstallCache -Value $whereToInstall -Copy-Item $installedDir -destination $whereToInstall -recurse -force + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$installedDir = Join-Path $rootDir 'installed' + +$whereToInstall = (pwd).path +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Set-Content -Path $whereToInstallCache -Value $whereToInstall +Copy-Item $installedDir -destination $whereToInstall -recurse -force )###"; return CONTENT_TEMPLATE; } static std::string create_chocolatey_uninstall_contents(const BinaryParagraph& binary_paragraph) { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' - -$whereToInstall = $null -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Get-Content $whereToInstallCache | Foreach-Object { - $whereToInstall = $_ -} - -$installedDir = Join-Path $whereToInstall 'installed' -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Leaf) { - Remove-Item $fileToRemove - } -} - -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Container) { - $folderToDelete = Join-Path $fileToRemove * - if (-Not (Test-Path $folderToDelete)) - { - Remove-Item $fileToRemove - } - } -} - -$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' -Remove-Item $listFileToRemove - -if (Test-Path $installedDir) -{ - while ( - $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { - $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 - } - ) { $empties | Remove-Item } -} + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' + +$whereToInstall = $null +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Get-Content $whereToInstallCache | Foreach-Object { + $whereToInstall = $_ +} + +$installedDir = Join-Path $whereToInstall 'installed' +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Leaf) { + Remove-Item $fileToRemove + } +} + +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Container) { + $folderToDelete = Join-Path $fileToRemove * + if (-Not (Test-Path $folderToDelete)) + { + Remove-Item $fileToRemove + } + } +} + +$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' +Remove-Item $listFileToRemove + +if (Test-Path $installedDir) +{ + while ( + $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { + $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 + } + ) { $empties | Remove-Item } +} )###"; std::string chocolatey_uninstall_content = Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_FULLSTEM@", binary_paragraph.fullstem()); @@ -220,9 +219,9 @@ if (Test-Path $installedDir) fs.write_contents(chocolatey_uninstall_file_path, chocolatey_uninstall_content, VCPKG_LINE_INFO); const auto cmd_line = Strings::format(R"("%s" pack -OutputDirectory "%s" "%s" -NoDefaultExcludes)", - nuget_exe.u8string(), - exported_dir_path.u8string(), - nuspec_file_path.u8string()); + fs::u8string(nuget_exe), + fs::u8string(exported_dir_path), + fs::u8string(nuspec_file_path)); const int exit_code = System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 54a1180c1fb8be..967534863054ef 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -15,6 +13,7 @@ #include #include #include +#include #include namespace vcpkg::Export @@ -55,9 +54,9 @@ namespace vcpkg::Export nuspec_file_content = Strings::replace_all(std::move(nuspec_file_content), "@RAW_EXPORTED_DIR@", raw_exported_dir); nuspec_file_content = Strings::replace_all( - std::move(nuspec_file_content), "@TARGETS_REDIRECT_PATH@", targets_redirect_path.u8string()); + std::move(nuspec_file_content), "@TARGETS_REDIRECT_PATH@", fs::u8string(targets_redirect_path)); nuspec_file_content = Strings::replace_all( - std::move(nuspec_file_content), "@PROPS_REDIRECT_PATH@", props_redirect_path.u8string()); + std::move(nuspec_file_content), "@PROPS_REDIRECT_PATH@", fs::u8string(props_redirect_path)); return nuspec_file_content; } @@ -150,13 +149,19 @@ namespace vcpkg::Export fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); // -NoDefaultExcludes is needed for ".vcpkg-root" - const auto cmd_line = Strings::format(R"("%s" pack -OutputDirectory "%s" "%s" -NoDefaultExcludes)", - nuget_exe.u8string(), - output_dir.u8string(), - nuspec_file_path.u8string()); + System::CmdLineBuilder cmd; +#ifndef _WIN32 + cmd.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmd.path_arg(nuget_exe) + .string_arg("pack") + .path_arg(nuspec_file_path) + .string_arg("-OutputDirectory") + .path_arg(output_dir) + .string_arg("-NoDefaultExcludes"); const int exit_code = - System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; + System::cmd_execute_and_capture_output(cmd.extract(), System::get_clean_environment()).exit_code; Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: NuGet package creation failed"); const fs::path output_path = output_dir / (nuget_id + "." + nuget_version + ".nupkg"); @@ -201,19 +206,31 @@ namespace vcpkg::Export { const fs::path& cmake_exe = paths.get_tool_exe(Tools::CMAKE); - const std::string exported_dir_filename = raw_exported_dir.filename().u8string(); + const std::string exported_dir_filename = fs::u8string(raw_exported_dir.filename()); const std::string exported_archive_filename = Strings::format("%s.%s", exported_dir_filename, format.extension()); const fs::path exported_archive_path = (output_dir / exported_archive_filename); - // -NoDefaultExcludes is needed for ".vcpkg-root" - const auto cmd_line = Strings::format(R"("%s" -E tar "cf" "%s" --format=%s -- "%s")", - cmake_exe.u8string(), - exported_archive_path.u8string(), - format.cmake_option(), - raw_exported_dir.u8string()); + System::CmdLineBuilder cmd; + cmd.string_arg("cd").path_arg(raw_exported_dir.parent_path()); + cmd.ampersand(); + cmd.path_arg(cmake_exe) + .string_arg("-E") + .string_arg("tar") + .string_arg("cf") + .path_arg(exported_archive_path) + .string_arg(Strings::concat("--format=", format.cmake_option())) + .string_arg("--") + .path_arg(raw_exported_dir); + + auto cmdline = cmd.extract(); +#ifdef WIN32 + // Invoke through `cmd` to support `&&` + cmdline.insert(0, "cmd /c \""); + cmdline.push_back('"'); +#endif - const int exit_code = System::cmd_execute_clean(cmd_line); + const int exit_code = System::cmd_execute_clean(cmdline); Checks::check_exit( VCPKG_LINE_INFO, exit_code == 0, "Error: %s creation failed", exported_archive_path.generic_string()); return exported_archive_path; @@ -262,6 +279,7 @@ namespace vcpkg::Export bool all_installed = false; Optional maybe_output; + fs::path output_dir; Optional maybe_nuget_id; Optional maybe_nuget_version; @@ -273,6 +291,7 @@ namespace vcpkg::Export }; static constexpr StringLiteral OPTION_OUTPUT = "output"; + static constexpr StringLiteral OPTION_OUTPUT_DIR = "output-dir"; static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; static constexpr StringLiteral OPTION_RAW = "raw"; static constexpr StringLiteral OPTION_NUGET = "nuget"; @@ -314,8 +333,9 @@ namespace vcpkg::Export {OPTION_ALL_INSTALLED, "Export all installed packages"}, }}; - static constexpr std::array EXPORT_SETTINGS = {{ + static constexpr std::array EXPORT_SETTINGS = {{ {OPTION_OUTPUT, "Specify the output name (used to construct filename)"}, + {OPTION_OUTPUT_DIR, "Specify the output directory for produced artifacts"}, {OPTION_NUGET_ID, "Specify the id for the exported NuGet package (overrides --output)"}, {OPTION_NUGET_VERSION, "Specify the version for the exported NuGet package"}, {OPTION_IFW_REPOSITORY_URL, "Specify the remote repository URL for the online installer"}, @@ -342,7 +362,8 @@ namespace vcpkg::Export nullptr, }; - static ExportArguments handle_export_command_arguments(const VcpkgCmdArguments& args, + static ExportArguments handle_export_command_arguments(const VcpkgPaths& paths, + const VcpkgCmdArguments& args, Triplet default_triplet, const StatusParagraphs& status_db) { @@ -361,6 +382,15 @@ namespace vcpkg::Export ret.prefab_options.enable_maven = options.switches.find(OPTION_PREFAB_ENABLE_MAVEN) != options.switches.cend(); ret.prefab_options.enable_debug = options.switches.find(OPTION_PREFAB_ENABLE_DEBUG) != options.switches.cend(); ret.maybe_output = maybe_lookup(options.settings, OPTION_OUTPUT); + auto maybe_output_dir = maybe_lookup(options.settings, OPTION_OUTPUT_DIR); + if (auto output_dir = maybe_output_dir.get()) + { + ret.output_dir = Files::combine(paths.original_cwd, fs::u8path(*output_dir)); + } + else + { + ret.output_dir = paths.root; + } ret.all_installed = options.switches.find(OPTION_ALL_INSTALLED) != options.switches.end(); if (ret.all_installed) @@ -479,8 +509,7 @@ namespace vcpkg::Export const VcpkgPaths& paths) { Files::Filesystem& fs = paths.get_filesystem(); - const fs::path export_to_path = paths.root; - const fs::path raw_exported_dir_path = export_to_path / export_id; + const fs::path raw_exported_dir_path = opts.output_dir / export_id; fs.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); // TODO: error handling @@ -527,7 +556,7 @@ namespace vcpkg::Export System::printf(System::Color::success, R"(Files exported at: "%s")" "\n", - raw_exported_dir_path.u8string()); + fs::u8string(raw_exported_dir_path)); print_next_step_info(raw_exported_dir_path); } @@ -538,8 +567,8 @@ namespace vcpkg::Export const std::string nuget_id = opts.maybe_nuget_id.value_or(raw_exported_dir_path.filename().string()); const std::string nuget_version = opts.maybe_nuget_version.value_or("1.0.0"); const fs::path output_path = - do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, export_to_path); - System::print2(System::Color::success, "NuGet package exported at: ", output_path.u8string(), "\n"); + do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, opts.output_dir); + System::print2(System::Color::success, "NuGet package exported at: ", fs::u8string(output_path), "\n"); System::printf(R"( With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste: @@ -547,15 +576,15 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console )" "\n\n", nuget_id, - output_path.parent_path().u8string()); + fs::u8string(output_path.parent_path())); } if (opts.zip) { System::print2("Creating zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::ZIP); - System::print2(System::Color::success, "Zip archive exported at: ", output_path.u8string(), "\n"); + do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::ZIP); + System::print2(System::Color::success, "Zip archive exported at: ", fs::u8string(output_path), "\n"); print_next_step_info("[...]"); } @@ -563,8 +592,8 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { System::print2("Creating 7zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::SEVEN_ZIP); - System::print2(System::Color::success, "7zip archive exported at: ", output_path.u8string(), "\n"); + do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::SEVEN_ZIP); + System::print2(System::Color::success, "7zip archive exported at: ", fs::u8string(output_path), "\n"); print_next_step_info("[...]"); } @@ -584,7 +613,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console "may use export in classic mode by running vcpkg outside of a manifest-based project."); } const StatusParagraphs status_db = database_load_check(paths); - const auto opts = handle_export_command_arguments(args, default_triplet, status_db); + const auto opts = handle_export_command_arguments(paths, args, default_triplet, status_db); for (auto&& spec : opts.specs) Input::check_triplet(spec.triplet(), paths); @@ -659,4 +688,11 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_success(VCPKG_LINE_INFO); } + + void ExportCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Export::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.exportifw.cpp b/toolsrc/src/vcpkg/export.ifw.cpp similarity index 88% rename from toolsrc/src/vcpkg/commands.exportifw.cpp rename to toolsrc/src/vcpkg/export.ifw.cpp index 8356313cf3f94f..9726a93f92d13a 100644 --- a/toolsrc/src/vcpkg/commands.exportifw.cpp +++ b/toolsrc/src/vcpkg/export.ifw.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -7,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Export::IFW { @@ -92,7 +91,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); auto deps = Strings::join( ",", binary_paragraph.dependencies, [](const std::string& dep) { return "packages." + dep + ":"; }); @@ -138,7 +137,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( R"###( @@ -163,7 +162,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( @@ -197,7 +196,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( R"###( @@ -219,7 +218,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( R"###( @@ -246,7 +245,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( @@ -273,7 +272,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for configuration file %s", - config_xml_file_path.generic_u8string()); + fs::generic_u8string(config_xml_file_path)); std::string formatted_repo_url; std::string ifw_repo_url = ifw_options.maybe_repository_url.value_or(""); @@ -315,10 +314,10 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - tempmaintenancetool.generic_u8string()); + fs::generic_u8string(tempmaintenancetool)); fs.copy_file(installerbase_exe, tempmaintenancetool, fs::copy_options::overwrite_existing, ec); Checks::check_exit( - VCPKG_LINE_INFO, !ec, "Could not write package file %s", tempmaintenancetool.generic_u8string()); + VCPKG_LINE_INFO, !ec, "Could not write package file %s", fs::generic_u8string(tempmaintenancetool)); fs::path package_xml_file_path = ifw_packages_dir_path / "maintenance" / "meta" / "package.xml"; fs::path package_xml_dir_path = package_xml_file_path.parent_path(); @@ -326,7 +325,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for package file %s", - package_xml_file_path.generic_u8string()); + fs::generic_u8string(package_xml_file_path)); fs.write_contents(package_xml_file_path, Strings::format( R"###( @@ -347,7 +346,7 @@ namespace vcpkg::Export::IFW const fs::path script_destination = ifw_packages_dir_path / "maintenance" / "meta" / "maintenance.qs"; fs.copy_file(script_source, script_destination, fs::copy_options::overwrite_existing, ec); Checks::check_exit( - VCPKG_LINE_INFO, !ec, "Could not write package file %s", script_destination.generic_u8string()); + VCPKG_LINE_INFO, !ec, "Could not write package file %s", fs::generic_u8string(script_destination)); System::print2("Exporting maintenance tool... done\n"); } @@ -358,7 +357,7 @@ namespace vcpkg::Export::IFW const fs::path packages_dir = get_packages_dir_path(export_id, ifw_options, paths); const fs::path repository_dir = get_repository_dir_path(export_id, ifw_options, paths); - System::print2("Generating repository ", repository_dir.generic_u8string(), "...\n"); + System::print2("Generating repository ", fs::generic_u8string(repository_dir), "...\n"); std::error_code ec; fs::path failure_point; @@ -368,20 +367,20 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not remove outdated repository directory %s due to file %s", - repository_dir.generic_u8string(), + fs::generic_u8string(repository_dir), failure_point.string()); const auto cmd_line = Strings::format(R"("%s" --packages "%s" "%s")", - repogen_exe.u8string(), - packages_dir.u8string(), - repository_dir.u8string()); + fs::u8string(repogen_exe), + fs::u8string(packages_dir), + fs::u8string(repository_dir)); const int exit_code = System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: IFW repository generating failed"); System::printf( - System::Color::success, "Generating repository %s... done.\n", repository_dir.generic_u8string()); + System::Color::success, "Generating repository %s... done.\n", fs::generic_u8string(repository_dir)); } void do_installer(const std::string& export_id, const Options& ifw_options, const VcpkgPaths& paths) @@ -392,7 +391,7 @@ namespace vcpkg::Export::IFW const fs::path repository_dir = get_repository_dir_path(export_id, ifw_options, paths); const fs::path installer_file = get_installer_file_path(export_id, ifw_options, paths); - System::printf("Generating installer %s...\n", installer_file.generic_u8string()); + System::printf("Generating installer %s...\n", fs::generic_u8string(installer_file)); std::string cmd_line; @@ -400,18 +399,18 @@ namespace vcpkg::Export::IFW if (!ifw_repo_url.empty()) { cmd_line = Strings::format(R"("%s" --online-only --config "%s" --repository "%s" "%s")", - binarycreator_exe.u8string(), - config_file.u8string(), - repository_dir.u8string(), - installer_file.u8string()); + fs::u8string(binarycreator_exe), + fs::u8string(config_file), + fs::u8string(repository_dir), + fs::u8string(installer_file)); } else { cmd_line = Strings::format(R"("%s" --config "%s" --packages "%s" "%s")", - binarycreator_exe.u8string(), - config_file.u8string(), - packages_dir.u8string(), - installer_file.u8string()); + fs::u8string(binarycreator_exe), + fs::u8string(config_file), + fs::u8string(packages_dir), + fs::u8string(installer_file)); } const int exit_code = @@ -419,7 +418,7 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: IFW installer generating failed"); System::printf( - System::Color::success, "Generating installer %s... done.\n", installer_file.generic_u8string()); + System::Color::success, "Generating installer %s... done.\n", fs::generic_u8string(installer_file)); } } @@ -439,17 +438,19 @@ namespace vcpkg::Export::IFW Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not remove outdated packages directory %s due to file %s", - ifw_packages_dir_path.generic_u8string(), + fs::generic_u8string(ifw_packages_dir_path), failure_point.string()); fs.create_directory(ifw_packages_dir_path, ec); - Checks::check_exit( - VCPKG_LINE_INFO, !ec, "Could not create packages directory %s", ifw_packages_dir_path.generic_u8string()); + Checks::check_exit(VCPKG_LINE_INFO, + !ec, + "Could not create packages directory %s", + fs::generic_u8string(ifw_packages_dir_path)); // Export maintenance tool export_maintenance_tool(ifw_packages_dir_path, paths); - System::printf("Exporting packages %s...\n", ifw_packages_dir_path.generic_u8string()); + System::printf("Exporting packages %s...\n", fs::generic_u8string(ifw_packages_dir_path)); // execute the plan std::map unique_packages; @@ -480,11 +481,11 @@ namespace vcpkg::Export::IFW Install::install_package_and_write_listfile(paths, action.spec, dirs); } - System::printf("Exporting packages %s... done\n", ifw_packages_dir_path.generic_u8string()); + System::printf("Exporting packages %s... done\n", fs::generic_u8string(ifw_packages_dir_path)); const fs::path config_file = get_config_file_path(export_id, ifw_options, paths); - System::printf("Generating configuration %s...\n", config_file.generic_u8string()); + System::printf("Generating configuration %s...\n", fs::generic_u8string(config_file)); // Unique packages export_unique_packages(ifw_packages_dir_path, unique_packages, fs); @@ -500,7 +501,7 @@ namespace vcpkg::Export::IFW // Configuration export_config(export_id, ifw_options, paths); - System::printf("Generating configuration %s... done.\n", config_file.generic_u8string()); + System::printf("Generating configuration %s... done.\n", fs::generic_u8string(config_file)); // Do repository (optional) std::string ifw_repo_url = ifw_options.maybe_repository_url.value_or(""); diff --git a/toolsrc/src/vcpkg/export.prefab.cpp b/toolsrc/src/vcpkg/export.prefab.cpp index 7dd516ac55702b..a1a6eb5f102afe 100644 --- a/toolsrc/src/vcpkg/export.prefab.cpp +++ b/toolsrc/src/vcpkg/export.prefab.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include namespace vcpkg::Export::Prefab { @@ -203,17 +202,17 @@ namespace vcpkg::Export::Prefab fs.remove(destination, ec); Checks::check_exit( - VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", destination.u8string()); + VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", fs::u8string(destination)); #if defined(_WIN32) auto&& seven_zip_exe = paths.get_tool_exe(Tools::SEVEN_ZIP); System::cmd_execute_and_capture_output( Strings::format( - R"("%s" a "%s" "%s\*")", seven_zip_exe.u8string(), destination.u8string(), source.u8string()), + R"("%s" a "%s" "%s\*")", fs::u8string(seven_zip_exe), fs::u8string(destination), fs::u8string(source)), System::get_clean_environment()); #else System::cmd_execute_clean( - Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", source.u8string(), destination.u8string())); + Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", fs::u8string(source), fs::u8string(destination))); #endif } @@ -227,9 +226,10 @@ namespace vcpkg::Export::Prefab ? R"("%s" "install:install-file" "-Dfile=%s" "-DpomFile=%s")" : R"("%s" "-q" "install:install-file" "-Dfile=%s" "-DpomFile=%s")"; - const auto cmd_line = Strings::format(cmd_line_format, Tools::MAVEN, aar.u8string(), pom.u8string()); + const auto cmd_line = Strings::format(cmd_line_format, Tools::MAVEN, fs::u8string(aar), fs::u8string(pom)); const int exit_code = System::cmd_execute_clean(cmd_line); - Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: %s installing maven file", aar.generic_u8string()); + Checks::check_exit( + VCPKG_LINE_INFO, exit_code == 0, "Error: %s installing maven file", fs::generic_u8string(aar)); } static std::unique_ptr build_info_from_triplet( @@ -312,13 +312,13 @@ namespace vcpkg::Export::Prefab Checks::check_exit(VCPKG_LINE_INFO, utils.exists(ndk_location), "Error: ANDROID_NDK_HOME Directory does not exists %s", - ndk_location.generic_u8string()); + fs::generic_u8string(ndk_location)); const fs::path source_properties_location = ndk_location / "source.properties"; Checks::check_exit(VCPKG_LINE_INFO, utils.exists(ndk_location), "Error: source.properties missing in ANDROID_NDK_HOME directory %s", - source_properties_location.generic_u8string()); + fs::generic_u8string(source_properties_location)); std::string content = utils.read_contents(source_properties_location, VCPKG_LINE_INFO); @@ -327,7 +327,7 @@ namespace vcpkg::Export::Prefab Checks::check_exit(VCPKG_LINE_INFO, version_opt.has_value(), "Error: NDK version missing %s", - source_properties_location.generic_u8string()); + fs::generic_u8string(source_properties_location)); NdkVersion version = to_version(version_opt.value_or_exit(VCPKG_LINE_INFO)).value_or_exit(VCPKG_LINE_INFO); @@ -499,8 +499,8 @@ namespace vcpkg::Export::Prefab { System::print2( Strings::format("[DEBUG]\n\tWriting manifest\n\tTo %s\n\tWriting prefab meta data\n\tTo %s\n\n", - manifest_path.generic_u8string(), - prefab_path.generic_u8string())); + fs::generic_u8string(manifest_path), + fs::generic_u8string(prefab_path))); } utils.write_contents(manifest_path, manifest, VCPKG_LINE_INFO); @@ -528,7 +528,7 @@ namespace vcpkg::Export::Prefab "Error: Packages not installed %s:%s %s", name, triplet, - listfile.generic_u8string()); + fs::generic_u8string(listfile)); fs::path libs = installed_dir / fs::u8path("lib"); @@ -567,8 +567,8 @@ namespace vcpkg::Export::Prefab { for (const auto& module : modules) { - std::string module_name = module.stem().generic_u8string(); - std::string extension = module.extension().generic_u8string(); + std::string module_name = fs::generic_u8string(module.stem()); + std::string extension = fs::generic_u8string(module.extension()); ABIMetadata ab; ab.abi = triplet_abi_map[triplet]; @@ -597,7 +597,7 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_debug) { System::print2( - Strings::format("\tWriting abi metadata\n\tTo %s\n", abi_path.generic_u8string())); + Strings::format("\tWriting abi metadata\n\tTo %s\n", fs::generic_u8string(abi_path))); } utils.write_contents(abi_path, ab.to_string(), VCPKG_LINE_INFO); @@ -611,8 +611,8 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_debug) { System::print2(Strings::format("\tCopying libs\n\tFrom %s\n\tTo %s\n", - installed_module_path.generic_u8string(), - exported_module_path.generic_u8string())); + fs::generic_u8string(installed_module_path), + fs::generic_u8string(exported_module_path))); } fs::path installed_headers_dir = installed_dir / "include"; fs::path exported_headers_dir = module_libs_dir / "include"; @@ -620,8 +620,8 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_debug) { System::print2(Strings::format("\tCopying headers\n\tFrom %s\n\tTo %s\n", - installed_headers_dir.generic_u8string(), - exported_headers_dir.generic_u8string())); + fs::generic_u8string(installed_headers_dir), + fs::generic_u8string(exported_headers_dir))); } utils.copy(installed_headers_dir, exported_headers_dir, fs::copy_options::recursive); @@ -633,7 +633,7 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_debug) { System::print2(Strings::format("\tWriting module metadata\n\tTo %s\n\n", - module_meta_path.generic_u8string())); + fs::generic_u8string(module_meta_path))); } utils.write_contents(module_meta_path, meta.to_json(), VCPKG_LINE_INFO); @@ -647,8 +647,8 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_debug) { System::print2(Strings::format("[DEBUG] Exporting AAR And POM\n\tAAR Path %s\n\tPOM Path %s\n", - exported_archive_path.generic_u8string(), - pom_path.generic_u8string())); + fs::generic_u8string(exported_archive_path), + fs::generic_u8string(pom_path))); } compress_directory(paths, package_directory, exported_archive_path); @@ -709,7 +709,7 @@ namespace vcpkg::Export::Prefab } System::print2( System::Color::success, - Strings::format("Successfuly exported %s. Checkout %s \n", name, paths.prefab.generic_u8string())); + Strings::format("Successfuly exported %s. Checkout %s \n", name, fs::generic_u8string(paths.prefab))); } } } diff --git a/toolsrc/src/vcpkg/globalstate.cpp b/toolsrc/src/vcpkg/globalstate.cpp index 037232f11e8e25..b07690bbd31741 100644 --- a/toolsrc/src/vcpkg/globalstate.cpp +++ b/toolsrc/src/vcpkg/globalstate.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include namespace vcpkg diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index d341b32ab790e5..ded6592fbe90be 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -1,9 +1,14 @@ -#include "pch.h" - #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -73,24 +78,24 @@ namespace vcpkg::Help vcpkg::Util::group_by(paths.get_available_triplets(), &triplets_per_location, [](const VcpkgPaths::TripletFile& triplet_file) -> std::string { - return triplet_file.location.u8string(); + return fs::u8string(triplet_file.location); }); System::print2("Available architecture triplets\n"); System::print2("VCPKG built-in triplets:\n"); - for (auto* triplet : triplets_per_location[paths.triplets.u8string()]) + for (auto* triplet : triplets_per_location[fs::u8string(paths.triplets)]) { System::print2(" ", triplet->name, '\n'); } - triplets_per_location.erase(paths.triplets.u8string()); + triplets_per_location.erase(fs::u8string(paths.triplets)); System::print2("\nVCPKG community triplets:\n"); - for (auto* triplet : triplets_per_location[paths.community_triplets.u8string()]) + for (auto* triplet : triplets_per_location[fs::u8string(paths.community_triplets)]) { System::print2(" ", triplet->name, '\n'); } - triplets_per_location.erase(paths.community_triplets.u8string()); + triplets_per_location.erase(fs::u8string(paths.community_triplets)); for (auto&& kv_pair : triplets_per_location) { @@ -104,7 +109,7 @@ namespace vcpkg::Help void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)args.parse_arguments(COMMAND_STRUCTURE); if (args.command_arguments.empty()) { @@ -129,4 +134,9 @@ namespace vcpkg::Help help_topics(paths); Checks::exit_fail(VCPKG_LINE_INFO); } + + void HelpCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Help::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/input.cpp b/toolsrc/src/vcpkg/input.cpp index f9184983c67947..b82dc44fb7f153 100644 --- a/toolsrc/src/vcpkg/input.cpp +++ b/toolsrc/src/vcpkg/input.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index da4248c39e1953..0a16294a1683a2 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -8,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,7 +48,7 @@ namespace vcpkg::Install auto& fs = paths.get_filesystem(); auto source_dir = paths.package_dir(spec); Checks::check_exit( - VCPKG_LINE_INFO, fs.exists(source_dir), "Source directory %s does not exist", source_dir.u8string()); + VCPKG_LINE_INFO, fs.exists(source_dir), "Source directory %s does not exist", fs::u8string(source_dir)); auto files = fs.get_files_recursive(source_dir); install_files_and_write_listfile(fs, source_dir, files, destination_dir); } @@ -62,16 +60,17 @@ namespace vcpkg::Install std::vector output; std::error_code ec; - const size_t prefix_length = source_dir.generic_u8string().size(); + const size_t prefix_length = fs::generic_u8string(source_dir).size(); const fs::path& destination = destination_dir.destination(); const std::string& destination_subdirectory = destination_dir.destination_subdirectory(); const fs::path& listfile = destination_dir.listfile(); fs.create_directories(destination, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create destination directory %s", destination.u8string()); + Checks::check_exit( + VCPKG_LINE_INFO, !ec, "Could not create destination directory %s", fs::u8string(destination)); const fs::path listfile_parent = listfile.parent_path(); fs.create_directories(listfile_parent, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for listfile %s", listfile.u8string()); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for listfile %s", fs::u8string(listfile)); output.push_back(Strings::format(R"(%s/)", destination_subdirectory)); for (auto&& file : files) @@ -79,11 +78,11 @@ namespace vcpkg::Install const auto status = fs.symlink_status(file, ec); if (ec) { - System::print2(System::Color::error, "failed: ", file.u8string(), ": ", ec.message(), "\n"); + System::print2(System::Color::error, "failed: ", fs::u8string(file), ": ", ec.message(), "\n"); continue; } - const std::string filename = file.filename().generic_u8string(); + const std::string filename = fs::generic_u8string(file.filename()); if (fs::is_regular_file(status) && (Strings::case_insensitive_ascii_equals(filename, "CONTROL") || Strings::case_insensitive_ascii_equals(filename, "vcpkg.json") || Strings::case_insensitive_ascii_equals(filename, "BUILD_INFO"))) @@ -92,7 +91,7 @@ namespace vcpkg::Install continue; } - const std::string suffix = file.generic_u8string().substr(prefix_length + 1); + const std::string suffix = fs::generic_u8string(file).substr(prefix_length + 1); const fs::path target = destination / suffix; switch (status.type()) @@ -102,7 +101,7 @@ namespace vcpkg::Install fs.create_directory(target, ec); if (ec) { - System::printf(System::Color::error, "failed: %s: %s\n", target.u8string(), ec.message()); + System::printf(System::Color::error, "failed: %s: %s\n", fs::u8string(target), ec.message()); } // Trailing backslash for directories @@ -115,13 +114,13 @@ namespace vcpkg::Install { System::print2(System::Color::warning, "File ", - target.u8string(), + fs::u8string(target), " was already present and will be overwritten\n"); } fs.copy_file(file, target, fs::copy_options::overwrite_existing, ec); if (ec) { - System::printf(System::Color::error, "failed: %s: %s\n", target.u8string(), ec.message()); + System::printf(System::Color::error, "failed: %s: %s\n", fs::u8string(target), ec.message()); } output.push_back(Strings::format(R"(%s/%s)", destination_subdirectory, suffix)); break; @@ -132,19 +131,19 @@ namespace vcpkg::Install { System::print2(System::Color::warning, "File ", - target.u8string(), + fs::u8string(target), " was already present and will be overwritten\n"); } fs.copy_symlink(file, target, ec); if (ec) { - System::printf(System::Color::error, "failed: %s: %s\n", target.u8string(), ec.message()); + System::printf(System::Color::error, "failed: %s: %s\n", fs::u8string(target), ec.message()); } output.push_back(Strings::format(R"(%s/%s)", destination_subdirectory, suffix)); break; } default: - System::printf(System::Color::error, "failed: %s: cannot handle file type\n", file.u8string()); + System::printf(System::Color::error, "failed: %s: cannot handle file type\n", fs::u8string(file)); break; } } @@ -512,6 +511,8 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_USE_ARIA2 = "x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "clean-after-build"; static constexpr StringLiteral OPTION_WRITE_PACKAGES_CONFIG = "x-write-nuget-packages-config"; + static constexpr StringLiteral OPTION_MANIFEST_NO_DEFAULT_FEATURES = "x-no-default-features"; + static constexpr StringLiteral OPTION_MANIFEST_FEATURE = "x-feature"; static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, @@ -524,6 +525,19 @@ namespace vcpkg::Install {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, }}; + static constexpr std::array MANIFEST_INSTALL_SWITCHES = {{ + {OPTION_DRY_RUN, "Do not actually build or install"}, + {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, + {OPTION_NO_DOWNLOADS, "Do not download new sources"}, + {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, + {OPTION_RECURSE, "Allow removal of packages as part of installation"}, + {OPTION_KEEP_GOING, "Continue installing packages on failure"}, + {OPTION_EDITABLE, "Disable source re-extraction and binary caching for libraries on the command line"}, + {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, + {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, + {OPTION_MANIFEST_NO_DEFAULT_FEATURES, "Don't install the default features from the manifest."}, + }}; + static constexpr std::array INSTALL_SETTINGS = {{ {OPTION_XUNIT, "File to output results in XUnit format (Internal use)"}, {OPTION_WRITE_PACKAGES_CONFIG, @@ -531,12 +545,15 @@ namespace vcpkg::Install "binarycaching` for more information."}, }}; + static constexpr std::array MANIFEST_INSTALL_MULTISETTINGS = {{ + {OPTION_MANIFEST_FEATURE, "A feature from the manifest to install."}, + }}; + std::vector get_all_port_names(const VcpkgPaths& paths) { - auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports); + auto sources_and_errors = Paragraphs::try_load_all_registry_ports(paths); - return Util::fmap(sources_and_errors.paragraphs, - [](auto&& pgh) -> std::string { return pgh->core_paragraph->name; }); + return Util::fmap(sources_and_errors.paragraphs, Paragraphs::get_name_of_control_file); } const CommandStructure COMMAND_STRUCTURE = { @@ -551,26 +568,40 @@ namespace vcpkg::Install create_example_string("install --triplet x64-windows"), 0, 0, - {INSTALL_SWITCHES, INSTALL_SETTINGS}, + {MANIFEST_INSTALL_SWITCHES, INSTALL_SETTINGS, MANIFEST_INSTALL_MULTISETTINGS}, nullptr, }; static void print_cmake_information(const BinaryParagraph& bpgh, const VcpkgPaths& paths) + { + auto usage = get_cmake_usage(bpgh, paths); + + if (!usage.message.empty()) + { + System::print2(usage.message); + } + } + + CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths) { static const std::regex cmake_library_regex(R"(\badd_library\(([^\$\s\)]+)\s)", std::regex_constants::ECMAScript); + CMakeUsageInfo ret; + auto& fs = paths.get_filesystem(); auto usage_file = paths.installed / bpgh.spec.triplet().canonical_name() / "share" / bpgh.spec.name() / "usage"; if (fs.exists(usage_file)) { + ret.usage_file = true; auto maybe_contents = fs.read_contents(usage_file); if (auto p_contents = maybe_contents.get()) { - System::print2(*p_contents, '\n'); + ret.message = std::move(*p_contents); + ret.message.push_back('\n'); } - return; + return ret; } auto files = fs.read_lines(paths.listfile_path(bpgh)); @@ -588,7 +619,7 @@ namespace vcpkg::Install // CMake file is inside the share folder auto path = paths.installed / suffix; auto maybe_contents = fs.read_contents(path); - auto find_package_name = path.parent_path().filename().u8string(); + auto find_package_name = fs::u8string(path.parent_path().filename()); if (auto p_contents = maybe_contents.get()) { std::sregex_iterator next(p_contents->begin(), p_contents->end(), cmake_library_regex); @@ -604,7 +635,7 @@ namespace vcpkg::Install } } - auto filename = fs::u8path(suffix).filename().u8string(); + auto filename = fs::u8string(fs::u8path(suffix).filename()); if (Strings::ends_with(filename, "Config.cmake")) { @@ -635,6 +666,8 @@ namespace vcpkg::Install } } + ret.header_only = is_header_only; + if (library_targets.empty()) { if (is_header_only && !header_path.empty()) @@ -653,20 +686,21 @@ namespace vcpkg::Install "The package ", bpgh.spec, " is header only and can be used from CMake via:\n\n"); Strings::append(msg, " find_path(", name, "_INCLUDE_DIRS \"", header_path, "\")\n"); Strings::append(msg, " target_include_directories(main PRIVATE ${", name, "_INCLUDE_DIRS})\n\n"); - System::print2(msg); + + ret.message = std::move(msg); } } else { - System::print2("The package ", bpgh.spec, " provides CMake targets:\n\n"); + auto msg = Strings::concat("The package ", bpgh.spec, " provides CMake targets:\n\n"); for (auto&& library_target_pair : library_targets) { auto config_it = config_files.find(library_target_pair.first); if (config_it != config_files.end()) - System::printf(" find_package(%s CONFIG REQUIRED)\n", config_it->second); + Strings::append(msg, " find_package(", config_it->second, " CONFIG REQUIRED)\n"); else - System::printf(" find_package(%s CONFIG REQUIRED)\n", library_target_pair.first); + Strings::append(msg, " find_package(", library_target_pair.first, " CONFIG REQUIRED)\n"); std::sort(library_target_pair.second.begin(), library_target_pair.second.end(), @@ -678,22 +712,27 @@ namespace vcpkg::Install if (library_target_pair.second.size() <= 4) { - System::printf(" target_link_libraries(main PRIVATE %s)\n\n", - Strings::join(" ", library_target_pair.second)); + Strings::append(msg, + " target_link_libraries(main PRIVATE ", + Strings::join(" ", library_target_pair.second), + ")\n\n"); } else { auto omitted = library_target_pair.second.size() - 4; library_target_pair.second.erase(library_target_pair.second.begin() + 4, library_target_pair.second.end()); - System::printf(" # Note: %zd target(s) were omitted.\n" - " target_link_libraries(main PRIVATE %s)\n\n", - omitted, - Strings::join(" ", library_target_pair.second)); + msg += Strings::format(" # Note: %zd target(s) were omitted.\n" + " target_link_libraries(main PRIVATE %s)\n\n", + omitted, + Strings::join(" ", library_target_pair.second)); } } + ret.message = std::move(msg); } + ret.cmake_targets_map = std::move(library_targets); } + return ret; } /// @@ -741,50 +780,60 @@ namespace vcpkg::Install auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; - if (paths.manifest_mode_enabled()) + if (auto manifest = paths.get_manifest().get()) { - std::error_code ec; - const auto path_to_manifest = paths.manifest_root_dir / "vcpkg.json"; - auto res = Paragraphs::try_load_manifest(paths.get_filesystem(), "user manifest", path_to_manifest, ec); - - if (ec) + Optional pkgsconfig; + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) { - Checks::exit_with_message(VCPKG_LINE_INFO, - "Failed to load manifest file (%s): %s\n", - path_to_manifest.u8string(), - ec.message()); + pkgsconfig = fs::u8path(it_pkgsconfig->second); } + auto manifest_path = paths.get_manifest_path().value_or_exit(VCPKG_LINE_INFO); + auto maybe_manifest_scf = SourceControlFile::parse_manifest_file(manifest_path, *manifest); + if (!maybe_manifest_scf) + { + print_error_message(maybe_manifest_scf.error()); + System::print2( + "See https://github.com/Microsoft/vcpkg/tree/master/docs/specifications/manifests.md for " + "more information.\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + auto& manifest_scf = *maybe_manifest_scf.value_or_exit(VCPKG_LINE_INFO); - std::vector specs; - if (auto val = res.get()) + std::vector features; + auto manifest_feature_it = options.multisettings.find(OPTION_MANIFEST_FEATURE); + if (manifest_feature_it != options.multisettings.end()) { - for (auto& dep : (*val)->core_paragraph->dependencies) - { - specs.push_back(FullPackageSpec{ - {std::move(dep.name), default_triplet}, - std::move(dep.features), - }); - } + features.insert(features.end(), manifest_feature_it->second.begin(), manifest_feature_it->second.end()); + } + auto core_it = Util::find(features, "core"); + if (core_it == features.end()) + { + if (!Util::Sets::contains(options.switches, OPTION_MANIFEST_NO_DEFAULT_FEATURES)) + features.push_back("default"); } else { - print_error_message(res.error()); - Checks::exit_fail(VCPKG_LINE_INFO); + // remove "core" because resolve_deps_as_top_level uses default-inversion + features.erase(core_it); } + auto specs = resolve_deps_as_top_level(manifest_scf, default_triplet, features, var_provider); - Optional pkgsconfig; - auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); - if (it_pkgsconfig != options.settings.end()) + auto install_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, {}); + + for (InstallPlanAction& action : install_plan.install_actions) { - pkgsconfig = fs::u8path(it_pkgsconfig->second); + action.build_options = install_plan_options; + action.build_options.use_head_version = Build::UseHeadVersion::NO; + action.build_options.editable = Build::Editable::NO; } + Commands::SetInstalled::perform_and_exit_ex(args, paths, provider, *binaryprovider, var_provider, - specs, - install_plan_options, + std::move(install_plan), dry_run ? Commands::DryRun::Yes : Commands::DryRun::No, pkgsconfig); } @@ -880,7 +929,7 @@ namespace vcpkg::Install auto pkgsconfig_path = Files::combine(paths.original_cwd, fs::u8path(it_pkgsconfig->second)); auto pkgsconfig_contents = generate_nuget_packages_config(action_plan); fs.write_contents(pkgsconfig_path, pkgsconfig_contents, VCPKG_LINE_INFO); - System::print2("Wrote NuGet packages config information to ", pkgsconfig_path.u8string(), "\n"); + System::print2("Wrote NuGet packages config information to ", fs::u8string(pkgsconfig_path), "\n"); } if (dry_run) @@ -927,6 +976,13 @@ namespace vcpkg::Install Checks::exit_success(VCPKG_LINE_INFO); } + void InstallCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Install::perform_and_exit(args, paths, default_triplet); + } + SpecSummary::SpecSummary(const PackageSpec& spec, const Dependencies::InstallPlanAction* action) : spec(spec), build_result{BuildResult::NULLVALUE, nullptr}, action(action) { diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index f348e32c0fb8ce..019b3a9c2607ac 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -8,6 +6,7 @@ #include #include +#include #include #if defined(_WIN32) @@ -39,6 +38,7 @@ namespace vcpkg::Metrics res.push_back(hex[(bits >> 0) & 0x0F]); } }; + constexpr char append_hexits::hex[17]; // note: this ignores the bits of these numbers that would be where format and variant go static std::string uuid_of_integers(uint64_t top, uint64_t bottom) @@ -179,11 +179,11 @@ namespace vcpkg::Metrics std::string format_event_data_template() const { - auto props_plus_buildtimes = properties.clone(); + auto props_plus_buildtimes = properties; if (buildtime_names.size() > 0) { - props_plus_buildtimes.insert("buildnames_1", Json::Value::array(buildtime_names.clone())); - props_plus_buildtimes.insert("buildtimes", Json::Value::array(buildtime_times.clone())); + props_plus_buildtimes.insert("buildnames_1", buildtime_names); + props_plus_buildtimes.insert("buildtimes", buildtime_times); } Json::Array arr = Json::Array(); @@ -232,9 +232,9 @@ namespace vcpkg::Metrics base_data.insert("ver", Json::Value::integer(2)); base_data.insert("name", Json::Value::string("commandline_test7")); - base_data.insert("properties", Json::Value::object(std::move(props_plus_buildtimes))); - base_data.insert("measurements", Json::Value::object(measurements.clone())); - base_data.insert("feature-flags", Json::Value::object(feature_flags.clone())); + base_data.insert("properties", std::move(props_plus_buildtimes)); + base_data.insert("measurements", measurements); + base_data.insert("feature-flags", feature_flags); } return Json::stringify(arr, vcpkg::Json::JsonStyle()); @@ -381,9 +381,7 @@ namespace vcpkg::Metrics return; } -#if !defined(_WIN32) - Util::unused(payload); -#else +#if defined(_WIN32) HINTERNET connect = nullptr, request = nullptr; BOOL results = FALSE; @@ -465,13 +463,15 @@ namespace vcpkg::Metrics __debugbreak(); auto err = GetLastError(); std::cerr << "[DEBUG] failed to connect to server: " << err << "\n"; -#endif +#endif // NDEBUG } if (request) WinHttpCloseHandle(request); if (connect) WinHttpCloseHandle(connect); if (session) WinHttpCloseHandle(session); -#endif +#else // ^^^ _WIN32 // !_WIN32 vvv + (void)payload; +#endif // ^^^ !_WIN32 } void Metrics::flush(Files::Filesystem& fs) @@ -526,11 +526,11 @@ namespace vcpkg::Metrics #if defined(_WIN32) const std::string cmd_line = Strings::format("cmd /c \"start \"vcpkgmetricsuploader.exe\" \"%s\" \"%s\"\"", - temp_folder_path_exe.u8string(), - vcpkg_metrics_txt_path.u8string()); + fs::u8string(temp_folder_path_exe), + fs::u8string(vcpkg_metrics_txt_path)); System::cmd_execute_no_wait(cmd_line); #else - auto escaped_path = Strings::escape_string(vcpkg_metrics_txt_path.u8string(), '\'', '\\'); + auto escaped_path = Strings::escape_string(fs::u8string(vcpkg_metrics_txt_path), '\'', '\\'); const std::string cmd_line = Strings::format( R"((curl "https://dc.services.visualstudio.com/v2/track" -H "Content-Type: application/json" -X POST --tlsv1.2 --data '@%s' >/dev/null 2>&1; rm '%s') &)", escaped_path, diff --git a/toolsrc/src/vcpkg/packagespec.cpp b/toolsrc/src/vcpkg/packagespec.cpp index d4c293b46f5221..0feb8412a418a1 100644 --- a/toolsrc/src/vcpkg/packagespec.cpp +++ b/toolsrc/src/vcpkg/packagespec.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -93,8 +91,6 @@ namespace vcpkg return left.name() == right.name() && left.triplet() == right.triplet(); } - bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } - ExpectedS Features::from_string(const std::string& name) { return parse_qualified_specifier(name).then([&](ParsedQualifiedSpecifier&& pqs) -> ExpectedS { @@ -262,4 +258,15 @@ namespace vcpkg parser.skip_tabs_spaces(); return ret; } + + bool operator==(const Dependency& lhs, const Dependency& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.features != rhs.features) return false; + if (!structurally_equal(lhs.platform, rhs.platform)) return false; + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + bool operator!=(const Dependency& lhs, const Dependency& rhs); } diff --git a/toolsrc/src/vcpkg/paragraphparseresult.cpp b/toolsrc/src/vcpkg/paragraphparseresult.cpp deleted file mode 100644 index 8bd5c0d7ac1068..00000000000000 --- a/toolsrc/src/vcpkg/paragraphparseresult.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pch.h" - -#include - -#include - -namespace vcpkg -{ - const char* ParagraphParseResultCategoryImpl::name() const noexcept { return "ParagraphParseResult"; } - - std::string ParagraphParseResultCategoryImpl::message(int ev) const noexcept - { - switch (static_cast(ev)) - { - case ParagraphParseResult::SUCCESS: return "OK"; - case ParagraphParseResult::EXPECTED_ONE_PARAGRAPH: return "There should be exactly one paragraph"; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - const std::error_category& paragraph_parse_result_category() - { - static ParagraphParseResultCategoryImpl instance; - return instance; - } - - std::error_code make_error_code(ParagraphParseResult e) - { - return std::error_code(static_cast(e), paragraph_parse_result_category()); - } - - ParagraphParseResult to_paragraph_parse_result(int i) { return static_cast(i); } - - ParagraphParseResult to_paragraph_parse_result(std::error_code ec) { return to_paragraph_parse_result(ec.value()); } -} diff --git a/toolsrc/src/vcpkg/paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp index 20a82ee0c09f32..19c1d266db4c35 100644 --- a/toolsrc/src/vcpkg/paragraphs.cpp +++ b/toolsrc/src/vcpkg/paragraphs.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,12 +5,141 @@ #include #include -#include +#include +#include #include +#include using namespace vcpkg::Parse; using namespace vcpkg; +namespace vcpkg::Parse +{ + static Optional> remove_field(Paragraph* fields, const std::string& fieldname) + { + auto it = fields->find(fieldname); + if (it == fields->end()) + { + return nullopt; + } + + auto value = std::move(it->second); + fields->erase(it); + return value; + } + + void ParagraphParser::required_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (const auto field = maybe_field.get()) + out = std::move(*field); + else + missing_fields.push_back(fieldname); + } + void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (auto field = maybe_field.get()) out = std::move(*field); + } + void ParagraphParser::required_field(const std::string& fieldname, std::string& out) + { + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + } + std::string ParagraphParser::optional_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + optional_field(fieldname, {out, ignore}); + return out; + } + std::string ParagraphParser::required_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + return out; + } + + std::unique_ptr ParagraphParser::error_info(const std::string& name) const + { + if (!fields.empty() || !missing_fields.empty()) + { + auto err = std::make_unique(); + err->name = name; + err->extra_fields["CONTROL"] = Util::extract_keys(fields); + err->missing_fields["CONTROL"] = std::move(missing_fields); + err->expected_types = std::move(expected_types); + return err; + } + return nullptr; + } + + template + static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) + { + std::vector ret; + parser.skip_whitespace(); + if (parser.at_eof()) return std::vector{}; + do + { + auto item = f(parser); + if (!item) return nullopt; + ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); + parser.skip_whitespace(); + if (parser.at_eof()) return {std::move(ret)}; + if (parser.cur() != ',') + { + parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); + return nullopt; + } + parser.next(); + parser.skip_whitespace(); + } while (true); + } + + ExpectedS> parse_default_features_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_qualified_specifier_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof( + "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_dependencies_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { + auto loc = parser.cur_loc(); + return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { + if (pqs.triplet) + { + parser.add_error("triplet specifier not allowed in this context", loc); + return nullopt; + } + return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; + }); + }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } +} + namespace vcpkg::Paragraphs { struct PghParser : private Parse::ParserBase @@ -93,7 +220,7 @@ namespace vcpkg::Paragraphs if (auto p = pghs.get()) { - if (p->size() != 1) return std::error_code(ParagraphParseResult::EXPECTED_ONE_PARAGRAPH).message(); + if (p->size() != 1) return {"There should be exactly one paragraph", expected_right_tag}; return std::move(p->front()); } else @@ -107,7 +234,7 @@ namespace vcpkg::Paragraphs const Expected contents = fs.read_contents(control_path); if (auto spgh = contents.get()) { - return parse_single_paragraph(*spgh, control_path.u8string()); + return parse_single_paragraph(*spgh, fs::u8string(control_path)); } return contents.error().message(); @@ -118,7 +245,7 @@ namespace vcpkg::Paragraphs const Expected contents = fs.read_contents(control_path); if (auto spgh = contents.get()) { - return parse_paragraphs(*spgh, control_path.u8string()); + return parse_paragraphs(*spgh, fs::u8string(control_path)); } return contents.error().message(); @@ -134,10 +261,10 @@ namespace vcpkg::Paragraphs return fs.exists(path / fs::u8path("CONTROL")) || fs.exists(path / fs::u8path("vcpkg.json")); } - ParseExpected try_load_manifest(const Files::Filesystem& fs, - const std::string& port_name, - const fs::path& path_to_manifest, - std::error_code& ec) + static ParseExpected try_load_manifest(const Files::Filesystem& fs, + const std::string& port_name, + const fs::path& path_to_manifest, + std::error_code& ec) { auto error_info = std::make_unique(); auto res = Json::parse_file(fs, path_to_manifest, ec); @@ -173,16 +300,16 @@ namespace vcpkg::Paragraphs vcpkg::Checks::check_exit(VCPKG_LINE_INFO, !fs.exists(path_to_control), "Found both manifest and CONTROL file in port %s; please rename one or the other", - path.u8string()); + fs::u8string(path)); std::error_code ec; - auto res = try_load_manifest(fs, path.filename().u8string(), path_to_manifest, ec); + auto res = try_load_manifest(fs, fs::u8string(path.filename()), path_to_manifest, ec); if (ec) { auto error_info = std::make_unique(); - error_info->name = path.filename().u8string(); + error_info->name = fs::u8string(path.filename()); error_info->error = Strings::format( - "Failed to load manifest file for port: %s\n", path_to_manifest.u8string(), ec.message()); + "Failed to load manifest file for port: %s\n", fs::u8string(path_to_manifest), ec.message()); } return res; @@ -193,7 +320,7 @@ namespace vcpkg::Paragraphs return SourceControlFile::parse_control_file(path_to_control, std::move(*vector_pghs)); } auto error_info = std::make_unique(); - error_info->name = path.filename().u8string(); + error_info->name = fs::u8string(path.filename()); error_info->error = pghs.error(); return error_info; } @@ -218,34 +345,84 @@ namespace vcpkg::Paragraphs return pghs.error(); } - LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir) + static void load_port_names_from_root(std::vector& ports, + const VcpkgPaths& paths, + const fs::path& registry_root) { - LoadResults ret; - auto port_dirs = fs.get_files_non_recursive(ports_dir); + const auto& fs = paths.get_filesystem(); + auto port_dirs = fs.get_files_non_recursive(registry_root); Util::sort(port_dirs); + + // TODO: search in `b-` for ports starting with `b` Util::erase_remove_if(port_dirs, [&](auto&& port_dir_entry) { return fs.is_regular_file(port_dir_entry) && port_dir_entry.filename() == ".DS_Store"; }); for (auto&& path : port_dirs) { - auto maybe_spgh = try_load_port(fs, path); + ports.push_back(fs::u8string(path.filename())); + } + } + + LoadResults try_load_all_registry_ports(const VcpkgPaths& paths) + { + LoadResults ret; + const auto& fs = paths.get_filesystem(); + + std::vector ports; + + const auto& registries = paths.get_configuration().registry_set; + + for (const auto& registry : registries.registries()) + { + load_port_names_from_root(ports, paths, registry.implementation().get_registry_root(paths)); + } + if (auto registry = registries.default_registry()) + { + load_port_names_from_root(ports, paths, registry->get_registry_root(paths)); + } + + Util::sort_unique_erase(ports); + + for (const auto& port_name : ports) + { + auto impl = registries.registry_for_port(port_name); + if (!impl) + { + // this is a port for which no registry is set + // this can happen when there's no default registry, + // and a registry has a port definition which it doesn't own the name of. + continue; + } + + auto root = impl->get_registry_root(paths); + + auto port_path = root / fs::u8path(port_name); + + if (!fs.exists(port_path)) + { + // the registry that owns the name of this port does not actually contain the port + // this can happen if R1 contains the port definition for , but doesn't + // declare it owns . + continue; + } + + auto maybe_spgh = try_load_port(fs, port_path); if (const auto spgh = maybe_spgh.get()) { - ret.paragraphs.emplace_back(std::move(*spgh)); + ret.paragraphs.emplace_back(std::move(*spgh), std::move(port_path)); } else { ret.errors.emplace_back(std::move(maybe_spgh).error()); } } + return ret; } - std::vector> load_all_ports(const Files::Filesystem& fs, - const fs::path& ports_dir) + static void load_results_print_error(const LoadResults& results) { - auto results = try_load_all_ports(fs, ports_dir); if (!results.errors.empty()) { if (Debug::g_debugging) @@ -263,6 +440,39 @@ namespace vcpkg::Paragraphs "Use '--debug' to get more information about the parse failures.\n\n"); } } + } + + std::vector load_all_registry_ports(const VcpkgPaths& paths) + { + auto results = try_load_all_registry_ports(paths); + load_results_print_error(results); return std::move(results.paragraphs); } + + std::vector load_overlay_ports(const VcpkgPaths& paths, const fs::path& directory) + { + LoadResults ret; + + std::vector port_names; + load_port_names_from_root(port_names, paths, directory); + + const auto& fs = paths.get_filesystem(); + + for (const auto& name : port_names) + { + auto path = directory / fs::u8path(name); + auto maybe_spgh = try_load_port(fs, path); + if (const auto spgh = maybe_spgh.get()) + { + ret.paragraphs.emplace_back(std::move(*spgh), std::move(path)); + } + else + { + ret.errors.emplace_back(std::move(maybe_spgh).error()); + } + } + + load_results_print_error(ret); + return std::move(ret.paragraphs); + } } diff --git a/toolsrc/src/vcpkg/platform-expression.cpp b/toolsrc/src/vcpkg/platform-expression.cpp index fadb548c1802cd..3490dbbe266e4c 100644 --- a/toolsrc/src/vcpkg/platform-expression.cpp +++ b/toolsrc/src/vcpkg/platform-expression.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,6 +5,7 @@ #include +#include #include #include @@ -415,6 +414,28 @@ namespace vcpkg::PlatformExpression return Visitor{context, override_ctxt}.visit(*this->underlying_); } + int Expr::complexity() const + { + if (is_empty()) return 0; + + struct Impl + { + int operator()(const std::unique_ptr& expr) const { return (*this)(*expr); } + int operator()(const detail::ExprImpl& expr) const + { + if (expr.kind == ExprKind::identifier) return 1; + + if (expr.kind == ExprKind::op_not) return 1 + (*this)(expr.exprs.at(0)); + + return 1 + std::accumulate(expr.exprs.begin(), expr.exprs.end(), 0, [](int acc, const auto& el) { + return acc + Impl{}(el); + }); + } + }; + + return Impl{}(underlying_); + } + ExpectedS parse_platform_expression(StringView expression, MultipleBinaryOperators multiple_binary_operators) { auto parser = ExpressionParser(expression, multiple_binary_operators); @@ -429,4 +450,100 @@ namespace vcpkg::PlatformExpression return res; } } + + bool structurally_equal(const Expr& lhs, const Expr& rhs) + { + struct Impl + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const detail::ExprImpl& lhs, const detail::ExprImpl& rhs) const + { + if (lhs.kind != rhs.kind) return false; + + if (lhs.kind == ExprKind::identifier) + { + return lhs.identifier == rhs.identifier; + } + else + { + const auto& exprs_l = lhs.exprs; + const auto& exprs_r = rhs.exprs; + return std::equal(exprs_l.begin(), exprs_l.end(), exprs_r.begin(), exprs_r.end(), *this); + } + } + }; + + if (lhs.is_empty()) + { + return rhs.is_empty(); + } + if (rhs.is_empty()) + { + return false; + } + return Impl{}(lhs.underlying_, rhs.underlying_); + } + + int compare(const Expr& lhs, const Expr& rhs) + { + auto lhs_platform_complexity = lhs.complexity(); + auto rhs_platform_complexity = lhs.complexity(); + + if (lhs_platform_complexity < rhs_platform_complexity) return -1; + if (rhs_platform_complexity < lhs_platform_complexity) return 1; + + auto lhs_platform = to_string(lhs); + auto rhs_platform = to_string(rhs); + + if (lhs_platform.size() < rhs_platform.size()) return -1; + if (rhs_platform.size() < lhs_platform.size()) return 1; + + auto platform_cmp = lhs_platform.compare(rhs_platform); + if (platform_cmp < 0) return -1; + if (platform_cmp > 0) return 1; + + return 0; + } + + std::string to_string(const Expr& expr) + { + struct Impl + { + std::string operator()(const std::unique_ptr& expr) const + { + return (*this)(*expr, false); + } + std::string operator()(const detail::ExprImpl& expr, bool outer) const + { + const char* join = nullptr; + switch (expr.kind) + { + case ExprKind::identifier: return expr.identifier; + case ExprKind::op_and: join = " & "; break; + case ExprKind::op_or: join = " | "; break; + case ExprKind::op_not: return Strings::format("!%s", (*this)(expr.exprs.at(0))); + default: Checks::unreachable(VCPKG_LINE_INFO); + } + + if (outer) + { + return Strings::join(join, expr.exprs, *this); + } + else + { + return Strings::format("(%s)", Strings::join(join, expr.exprs, *this)); + } + } + }; + + if (expr.is_empty()) + { + return std::string{}; + } + return Impl{}(*expr.underlying_, true); + } } diff --git a/toolsrc/src/vcpkg/portfileprovider.cpp b/toolsrc/src/vcpkg/portfileprovider.cpp index 707b763a414ef7..0e065eff703378 100644 --- a/toolsrc/src/vcpkg/portfileprovider.cpp +++ b/toolsrc/src/vcpkg/portfileprovider.cpp @@ -1,9 +1,9 @@ -#include "pch.h" - #include +#include #include #include +#include #include namespace vcpkg::PortFileProvider @@ -25,12 +25,12 @@ namespace vcpkg::PortFileProvider return Util::fmap(ports, [](auto&& kvpair) -> const SourceControlFileLocation* { return &kvpair.second; }); } - PathsPortFileProvider::PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, - const std::vector& ports_dirs_paths) - : filesystem(paths.get_filesystem()) + PathsPortFileProvider::PathsPortFileProvider(const vcpkg::VcpkgPaths& paths_, + const std::vector& overlay_ports_) + : paths(paths_) { auto& fs = paths.get_filesystem(); - for (auto&& overlay_path : ports_dirs_paths) + for (auto&& overlay_path : overlay_ports_) { if (!overlay_path.empty()) { @@ -44,20 +44,19 @@ namespace vcpkg::PortFileProvider overlay = fs.canonical(VCPKG_LINE_INFO, paths.original_cwd / overlay); } - Debug::print("Using overlay: ", overlay.u8string(), "\n"); + Debug::print("Using overlay: ", fs::u8string(overlay), "\n"); Checks::check_exit( - VCPKG_LINE_INFO, filesystem.exists(overlay), "Error: Path \"%s\" does not exist", overlay.string()); + VCPKG_LINE_INFO, fs.exists(overlay), "Error: Path \"%s\" does not exist", fs::u8string(overlay)); Checks::check_exit(VCPKG_LINE_INFO, fs::is_directory(fs.status(VCPKG_LINE_INFO, overlay)), "Error: Path \"%s\" must be a directory", overlay.string()); - ports_dirs.emplace_back(overlay); + overlay_ports.emplace_back(overlay); } } - ports_dirs.emplace_back(paths.ports); } ExpectedS PathsPortFileProvider::get_control_file(const std::string& spec) const @@ -68,12 +67,14 @@ namespace vcpkg::PortFileProvider return cache_it->second; } - for (auto&& ports_dir : ports_dirs) + const auto& fs = paths.get_filesystem(); + + for (auto&& ports_dir : overlay_ports) { // Try loading individual port - if (Paragraphs::is_port_directory(filesystem, ports_dir)) + if (Paragraphs::is_port_directory(fs, ports_dir)) { - auto maybe_scf = Paragraphs::try_load_port(filesystem, ports_dir); + auto maybe_scf = Paragraphs::try_load_port(fs, ports_dir); if (auto scf = maybe_scf.get()) { if (scf->get()->core_paragraph->name == spec) @@ -88,28 +89,60 @@ namespace vcpkg::PortFileProvider { vcpkg::print_error_message(maybe_scf.error()); Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Failed to load port from %s", spec, ports_dir.u8string()); + VCPKG_LINE_INFO, "Error: Failed to load port %s from %s", spec, fs::u8string(ports_dir)); } continue; } - auto ports_spec = ports_dir / spec; - if (Paragraphs::is_port_directory(filesystem, ports_spec)) + auto ports_spec = ports_dir / fs::u8path(spec); + if (Paragraphs::is_port_directory(fs, ports_spec)) + { + auto found_scf = Paragraphs::try_load_port(fs, ports_spec); + if (auto scf = found_scf.get()) + { + if (scf->get()->core_paragraph->name == spec) + { + auto it = cache.emplace(std::piecewise_construct, + std::forward_as_tuple(std::move(spec)), + std::forward_as_tuple(std::move(*scf), std::move(ports_spec))); + return it.first->second; + } + Checks::exit_with_message(VCPKG_LINE_INFO, + "Error: Failed to load port from %s: names did not match: '%s' != '%s'", + fs::u8string(ports_spec), + spec, + scf->get()->core_paragraph->name); + } + else + { + vcpkg::print_error_message(found_scf.error()); + Checks::exit_with_message( + VCPKG_LINE_INFO, "Error: Failed to load port %s from %s", spec, fs::u8string(ports_dir)); + } + } + } + + if (auto registry = paths.get_configuration().registry_set.registry_for_port(spec)) + { + auto registry_root = registry->get_registry_root(paths); + auto port_directory = registry_root / fs::u8path(spec); + + if (fs.exists(port_directory)) { - auto found_scf = Paragraphs::try_load_port(filesystem, ports_spec); + auto found_scf = Paragraphs::try_load_port(fs, port_directory); if (auto scf = found_scf.get()) { if (scf->get()->core_paragraph->name == spec) { auto it = cache.emplace(std::piecewise_construct, std::forward_as_tuple(spec), - std::forward_as_tuple(std::move(*scf), ports_dir / spec)); + std::forward_as_tuple(std::move(*scf), std::move(port_directory))); return it.first->second; } Checks::exit_with_message(VCPKG_LINE_INFO, "Error: Failed to load port from %s: names did not match: '%s' != '%s'", - (ports_dir / spec).u8string(), + fs::u8string(port_directory), spec, scf->get()->core_paragraph->name); } @@ -117,7 +150,7 @@ namespace vcpkg::PortFileProvider { vcpkg::print_error_message(found_scf.error()); Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Failed to load port from %s", spec, ports_dir.u8string()); + VCPKG_LINE_INFO, "Error: Failed to load port %s from %s", spec, fs::u8string(port_directory)); } } } @@ -130,20 +163,20 @@ namespace vcpkg::PortFileProvider // Reload cache with ports contained in all ports_dirs cache.clear(); std::vector ret; - for (auto&& ports_dir : ports_dirs) + + for (const fs::path& ports_dir : overlay_ports) { // Try loading individual port - if (Paragraphs::is_port_directory(filesystem, ports_dir)) + if (Paragraphs::is_port_directory(paths.get_filesystem(), ports_dir)) { - auto maybe_scf = Paragraphs::try_load_port(filesystem, ports_dir); + auto maybe_scf = Paragraphs::try_load_port(paths.get_filesystem(), ports_dir); if (auto scf = maybe_scf.get()) { auto port_name = scf->get()->core_paragraph->name; if (cache.find(port_name) == cache.end()) { - auto it = cache.emplace(std::piecewise_construct, - std::forward_as_tuple(port_name), - std::forward_as_tuple(std::move(*scf), ports_dir)); + auto scfl = SourceControlFileLocation{std::move(*scf), ports_dir}; + auto it = cache.emplace(std::move(port_name), std::move(scfl)); ret.emplace_back(&it.first->second); } } @@ -151,25 +184,35 @@ namespace vcpkg::PortFileProvider { vcpkg::print_error_message(maybe_scf.error()); Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Failed to load port from %s", ports_dir.u8string()); + VCPKG_LINE_INFO, "Error: Failed to load port from %s", fs::u8string(ports_dir)); } continue; } // Try loading all ports inside ports_dir - auto found_scf = Paragraphs::load_all_ports(filesystem, ports_dir); - for (auto&& scf : found_scf) + auto found_scfls = Paragraphs::load_overlay_ports(paths, ports_dir); + for (auto&& scfl : found_scfls) { - auto port_name = scf->core_paragraph->name; + auto port_name = scfl.source_control_file->core_paragraph->name; if (cache.find(port_name) == cache.end()) { - auto it = cache.emplace(std::piecewise_construct, - std::forward_as_tuple(port_name), - std::forward_as_tuple(std::move(scf), ports_dir / port_name)); + auto it = cache.emplace(std::move(port_name), std::move(scfl)); ret.emplace_back(&it.first->second); } } } + + auto all_ports = Paragraphs::load_all_registry_ports(paths); + for (auto&& scfl : all_ports) + { + auto port_name = scfl.source_control_file->core_paragraph->name; + if (cache.find(port_name) == cache.end()) + { + auto it = cache.emplace(port_name, std::move(scfl)); + ret.emplace_back(&it.first->second); + } + } + return ret; } } diff --git a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp index e9215ed8ccb69e..182625b7834ec1 100644 --- a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index 753cb5aa513ee1..7b8e65ed6e7237 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -153,12 +151,13 @@ namespace vcpkg::PostBuildLint "config.h", "local.h", "slice.h", + "platform.h", }; static constexpr Span restricted_lists[] = { restricted_sys_filenames, restricted_crt_filenames, restricted_general_filenames}; const fs::path include_dir = package_dir / "include"; auto files = fs.get_files_non_recursive(include_dir); - auto filenames_v = Util::fmap(files, [](const auto& file) { return file.filename().u8string(); }); + auto filenames_v = Util::fmap(files, [](const auto& file) { return fs::u8string(file.filename()); }); std::set filenames_s(filenames_v.begin(), filenames_v.end()); std::vector violations; @@ -392,7 +391,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { const std::string cmd_line = - Strings::format(R"("%s" /exports "%s")", dumpbin_exe.u8string(), dll.u8string()); + Strings::format(R"("%s" /exports "%s")", fs::u8string(dumpbin_exe), fs::u8string(dll)); System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); @@ -430,7 +429,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { const std::string cmd_line = - Strings::format(R"("%s" /headers "%s")", dumpbin_exe.u8string(), dll.u8string()); + Strings::format(R"("%s" /headers "%s")", fs::u8string(dumpbin_exe), fs::u8string(dll)); System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); @@ -481,7 +480,7 @@ namespace vcpkg::PostBuildLint for (const FileAndArch& b : binaries_with_invalid_architecture) { System::print2(" ", - b.file.u8string(), + fs::u8string(b.file), "\n" "Expected ", expected_architecture, @@ -557,7 +556,8 @@ namespace vcpkg::PostBuildLint return LintStatus::ERROR_DETECTED; } #endif - Util::unused(expected_architecture, files); + (void)expected_architecture; + (void)files; return LintStatus::SUCCESS; } @@ -617,7 +617,7 @@ namespace vcpkg::PostBuildLint if (lib_count == 0 && dll_count != 0) { - System::print2(System::Color::warning, "Import libs were not present in ", lib_dir.u8string(), "\n"); + System::print2(System::Color::warning, "Import libs were not present in ", fs::u8string(lib_dir), "\n"); System::printf(System::Color::warning, "If this is intended, add the following line in the portfile:\n" " SET(%s enabled)\n", @@ -644,7 +644,7 @@ namespace vcpkg::PostBuildLint System::printf(System::Color::warning, R"(There should be no bin\ directory in a static build, but %s is present.)" "\n", - bin.u8string()); + fs::u8string(bin)); } if (fs.exists(debug_bin)) @@ -652,7 +652,7 @@ namespace vcpkg::PostBuildLint System::printf(System::Color::warning, R"(There should be no debug\bin\ directory in a static build, but %s is present.)" "\n", - debug_bin.u8string()); + fs::u8string(debug_bin)); } System::print2( @@ -680,7 +680,7 @@ namespace vcpkg::PostBuildLint if (!empty_directories.empty()) { - System::print2(System::Color::warning, "There should be no empty directories in ", dir.u8string(), "\n"); + System::print2(System::Color::warning, "There should be no empty directories in ", fs::u8string(dir), "\n"); System::print2("The following empty directories were found:\n"); Files::print_paths(empty_directories); System::print2( @@ -718,7 +718,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& lib : libs) { const std::string cmd_line = - Strings::format(R"("%s" /directives "%s")", dumpbin_exe.u8string(), lib.u8string()); + Strings::format(R"("%s" /directives "%s")", fs::u8string(dumpbin_exe), fs::u8string(lib)); System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, @@ -772,7 +772,8 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { - const auto cmd_line = Strings::format(R"("%s" /dependents "%s")", dumpbin_exe.u8string(), dll.u8string()); + const auto cmd_line = + Strings::format(R"("%s" /dependents "%s")", fs::u8string(dumpbin_exe), fs::u8string(dll)); System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", cmd_line); @@ -791,7 +792,7 @@ namespace vcpkg::PostBuildLint System::print2(System::Color::warning, "Detected outdated dynamic CRT in the following files:\n\n"); for (const OutdatedDynamicCrtAndFile& btf : dlls_with_outdated_crt) { - System::print2(" ", btf.file.u8string(), ": ", btf.outdated_crt.name, "\n"); + System::print2(" ", fs::u8string(btf.file), ": ", btf.outdated_crt.name, "\n"); } System::print2("\n"); @@ -819,7 +820,7 @@ namespace vcpkg::PostBuildLint if (!misplaced_files.empty()) { - System::print2(System::Color::warning, "The following files are placed in\n", dir.u8string(), ":\n"); + System::print2(System::Color::warning, "The following files are placed in\n", fs::u8string(dir), ":\n"); Files::print_paths(misplaced_files); System::print2(System::Color::warning, "Files cannot be present in those directories.\n\n"); return LintStatus::ERROR_DETECTED; @@ -966,7 +967,7 @@ namespace vcpkg::PostBuildLint "Found ", error_count, " error(s). Please correct the portfile:\n ", - portfile.u8string(), + fs::u8string(portfile), "\n"); } diff --git a/toolsrc/src/vcpkg/registries.cpp b/toolsrc/src/vcpkg/registries.cpp new file mode 100644 index 00000000000000..aa9a3a336a58f4 --- /dev/null +++ b/toolsrc/src/vcpkg/registries.cpp @@ -0,0 +1,131 @@ +#include + +#include + +namespace +{ + struct BuiltinRegistry final : vcpkg::RegistryImpl + { + virtual fs::path get_registry_root(const vcpkg::VcpkgPaths& paths) const override { return paths.ports; } + }; + + struct DirectoryRegistry final : vcpkg::RegistryImpl + { + virtual fs::path get_registry_root(const vcpkg::VcpkgPaths& paths) const override + { + return vcpkg::Files::combine(paths.config_root_dir, path); + } + + DirectoryRegistry(fs::path&& path_) : path(path_) { } + + fs::path path; + }; +} + +namespace vcpkg +{ + std::unique_ptr Registry::builtin_registry() { return std::make_unique(); } + + Registry::Registry(std::vector&& packages, std::unique_ptr&& impl) + : packages_(std::move(packages)), implementation_(std::move(impl)) + { + Checks::check_exit(VCPKG_LINE_INFO, implementation_ != nullptr); + } + + StringView RegistryImplDeserializer::type_name() const { return "a registry"; } + + constexpr StringLiteral RegistryImplDeserializer::KIND; + constexpr StringLiteral RegistryImplDeserializer::PATH; + constexpr StringLiteral RegistryImplDeserializer::KIND_BUILTIN; + constexpr StringLiteral RegistryImplDeserializer::KIND_DIRECTORY; + + Span RegistryImplDeserializer::valid_fields() const + { + static const StringView t[] = {KIND, PATH}; + return t; + } + + Optional> RegistryImplDeserializer::visit_null(Json::Reader&) { return nullptr; } + + Optional> RegistryImplDeserializer::visit_object(Json::Reader& r, + const Json::Object& obj) + { + std::string kind; + r.required_object_field( + type_name(), obj, KIND, kind, Json::StringDeserializer{"a registry implementation kind"}); + + if (kind == KIND_BUILTIN) + { + if (obj.contains(PATH)) + { + r.add_extra_fields_error("a builtin registry", {PATH}); + } + return static_cast>(std::make_unique()); + } + else if (kind == KIND_DIRECTORY) + { + fs::path path; + r.required_object_field("a directory registry", obj, PATH, path, Json::PathDeserializer{}); + + return static_cast>(std::make_unique(std::move(path))); + } + else + { + return nullopt; + } + } + + StringView RegistryDeserializer::type_name() const { return "a registry"; } + + constexpr StringLiteral RegistryDeserializer::PACKAGES; + + Span RegistryDeserializer::valid_fields() const + { + static const StringView t[] = { + RegistryImplDeserializer::KIND, + RegistryImplDeserializer::PATH, + PACKAGES, + }; + return t; + } + + Optional RegistryDeserializer::visit_object(Json::Reader& r, const Json::Object& obj) + { + auto impl = RegistryImplDeserializer{}.visit_object(r, obj); + + if (!impl.has_value()) + { + return nullopt; + } + + std::vector packages; + r.required_object_field( + type_name(), + obj, + PACKAGES, + packages, + Json::ArrayDeserializer{"an array of registries", Json::AllowEmpty::Yes}); + + return Registry{std::move(packages), std::move(impl).value_or_exit(VCPKG_LINE_INFO)}; + } + + RegistrySet::RegistrySet() : default_registry_(Registry::builtin_registry()), registries_() { } + + const RegistryImpl* RegistrySet::registry_for_port(StringView name) const + { + for (const auto& registry : registries()) + { + const auto& packages = registry.packages(); + if (std::find(packages.begin(), packages.end(), name) != packages.end()) + { + return ®istry.implementation(); + } + } + return default_registry(); + } + + void RegistrySet::add_registry(Registry&& r) { registries_.push_back(std::move(r)); } + + void RegistrySet::set_default_registry(std::unique_ptr&& r) { default_registry_ = std::move(r); } + void RegistrySet::set_default_registry(std::nullptr_t) { default_registry_.reset(); } +} diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index 62e203b432c923..8561003a89d299 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -60,7 +58,7 @@ namespace vcpkg::Remove if (ec) { System::print2( - System::Color::error, "failed: status(", target.u8string(), "): ", ec.message(), "\n"); + System::Color::error, "failed: status(", fs::u8string(target), "): ", ec.message(), "\n"); continue; } @@ -80,21 +78,22 @@ namespace vcpkg::Remove if (ec) { System::printf( - System::Color::error, "failed: remove(%s): %s\n", target.u8string(), ec.message()); + System::Color::error, "failed: remove(%s): %s\n", fs::u8string(target), ec.message()); } #else System::printf( - System::Color::error, "failed: remove(%s): %s\n", target.u8string(), ec.message()); + System::Color::error, "failed: remove(%s): %s\n", fs::u8string(target), ec.message()); #endif } } else if (!fs::exists(status)) { - System::printf(System::Color::warning, "Warning: %s: file not found\n", target.u8string()); + System::printf(System::Color::warning, "Warning: %s: file not found\n", fs::u8string(target)); } else { - System::printf(System::Color::warning, "Warning: %s: cannot handle file type\n", target.u8string()); + System::printf( + System::Color::warning, "Warning: %s: cannot handle file type\n", fs::u8string(target)); } } @@ -332,4 +331,11 @@ namespace vcpkg::Remove Checks::exit_success(VCPKG_LINE_INFO); } + + void RemoveCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Remove::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index d1823b2eb949a2..59b472074d1a09 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -16,6 +14,57 @@ namespace vcpkg { using namespace vcpkg::Parse; + template + static bool paragraph_equal(const Lhs& lhs, const Rhs& rhs) + { + return std::equal( + lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](const std::string& lhs, const std::string& rhs) { + return Strings::trim(StringView(lhs)) == Strings::trim(StringView(rhs)); + }); + } + + bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.version != rhs.version) return false; + if (lhs.port_version != rhs.port_version) return false; + if (!paragraph_equal(lhs.description, rhs.description)) return false; + if (!paragraph_equal(lhs.maintainers, rhs.maintainers)) return false; + if (lhs.homepage != rhs.homepage) return false; + if (lhs.documentation != rhs.documentation) return false; + if (lhs.dependencies != rhs.dependencies) return false; + if (lhs.default_features != rhs.default_features) return false; + if (lhs.license != rhs.license) return false; + + if (lhs.type != rhs.type) return false; + if (!structurally_equal(lhs.supports_expression, rhs.supports_expression)) return false; + + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + + bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.dependencies != rhs.dependencies) return false; + if (!paragraph_equal(lhs.description, rhs.description)) return false; + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + + bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs) + { + if (*lhs.core_paragraph != *rhs.core_paragraph) return false; + return std::equal(lhs.feature_paragraphs.begin(), + lhs.feature_paragraphs.end(), + rhs.feature_paragraphs.begin(), + rhs.feature_paragraphs.end(), + [](const std::unique_ptr& lhs, + const std::unique_ptr& rhs) { return *lhs == *rhs; }); + } + namespace SourceParagraphFields { static const std::string BUILD_DEPENDS = "Build-Depends"; @@ -31,24 +80,6 @@ namespace vcpkg static const std::string SUPPORTS = "Supports"; } - namespace ManifestFields - { - constexpr static StringLiteral NAME = "name"; - constexpr static StringLiteral VERSION = "version-string"; - - constexpr static StringLiteral PORT_VERSION = "port-version"; - constexpr static StringLiteral MAINTAINERS = "maintainers"; - constexpr static StringLiteral DESCRIPTION = "description"; - constexpr static StringLiteral HOMEPAGE = "homepage"; - constexpr static StringLiteral DOCUMENTATION = "documentation"; - constexpr static StringLiteral LICENSE = "license"; - constexpr static StringLiteral DEPENDENCIES = "dependencies"; - constexpr static StringLiteral DEV_DEPENDENCIES = "dev-dependencies"; - constexpr static StringLiteral FEATURES = "features"; - constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; - constexpr static StringLiteral SUPPORTS = "supports"; - } - static Span get_list_of_valid_fields() { static const StringView valid_fields[] = { @@ -67,107 +98,7 @@ namespace vcpkg return valid_fields; } - static Span get_list_of_manifest_fields() - { - constexpr static StringView valid_fields[] = { - ManifestFields::NAME, - ManifestFields::VERSION, - - ManifestFields::PORT_VERSION, - ManifestFields::MAINTAINERS, - ManifestFields::DESCRIPTION, - ManifestFields::HOMEPAGE, - ManifestFields::DOCUMENTATION, - ManifestFields::LICENSE, - ManifestFields::DEPENDENCIES, - ManifestFields::DEV_DEPENDENCIES, - ManifestFields::FEATURES, - ManifestFields::DEFAULT_FEATURES, - ManifestFields::SUPPORTS, - }; - - return valid_fields; - } - - void print_error_message(Span> error_info_list) - { - Checks::check_exit(VCPKG_LINE_INFO, error_info_list.size() > 0); - - for (auto&& error_info : error_info_list) - { - Checks::check_exit(VCPKG_LINE_INFO, error_info != nullptr); - if (!error_info->error.empty()) - { - System::print2( - System::Color::error, "Error: while loading ", error_info->name, ":\n", error_info->error, '\n'); - } - } - - bool have_remaining_fields = false; - for (auto&& error_info : error_info_list) - { - if (!error_info->extra_fields.empty()) - { - System::print2(System::Color::error, - "Error: There are invalid fields in the control or manifest file of ", - error_info->name, - '\n'); - System::print2("The following fields were not expected:\n"); - - for (const auto& pr : error_info->extra_fields) - { - System::print2(" In ", pr.first, ": ", Strings::join(", ", pr.second), "\n"); - } - have_remaining_fields = true; - } - } - - if (have_remaining_fields) - { - System::print2("This is the list of valid fields for CONTROL files (case-sensitive): \n\n ", - Strings::join("\n ", get_list_of_valid_fields()), - "\n\n"); - System::print2("And this is the list of valid fields for manifest files: \n\n ", - Strings::join("\n ", get_list_of_manifest_fields()), - "\n\n"); - System::print2("You may need to update the vcpkg binary; try running bootstrap-vcpkg.bat or " - "bootstrap-vcpkg.sh to update.\n\n"); - } - - for (auto&& error_info : error_info_list) - { - if (!error_info->missing_fields.empty()) - { - System::print2(System::Color::error, - "Error: There are missing fields in the control file of ", - error_info->name, - '\n'); - System::print2("The following fields were missing:\n"); - for (const auto& pr : error_info->missing_fields) - { - System::print2(" In ", pr.first, ": ", Strings::join(", ", pr.second), "\n"); - } - } - } - - for (auto&& error_info : error_info_list) - { - if (!error_info->expected_types.empty()) - { - System::print2(System::Color::error, - "Error: There are invalid field types in the CONTROL or manifest file of ", - error_info->name, - '\n'); - System::print2("The following fields had the wrong types:\n\n"); - - for (const auto& pr : error_info->expected_types) - { - System::printf(" %s was expected to be %s\n", pr.first, pr.second); - } - System::print2("\n"); - } - } - } + void print_error_message(Span> error_info_list); std::string Type::to_string(const Type& t) { @@ -197,9 +128,120 @@ namespace vcpkg } } + namespace + { + constexpr static struct Canonicalize + { + struct FeatureLess + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const + { + return lhs.name < rhs.name; + } + }; + struct FeatureEqual + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const + { + return lhs.name == rhs.name; + } + }; + + // assume canonicalized feature list + struct DependencyLess + { + bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const Dependency& lhs, const Dependency& rhs) const + { + auto cmp = lhs.name.compare(rhs.name); + if (cmp < 0) return true; + if (cmp > 0) return false; + + // same dependency name + + // order by platform string: + auto platform_cmp = compare(lhs.platform, rhs.platform); + if (platform_cmp < 0) return true; + if (platform_cmp > 0) return false; + + // then order by features + // smaller list first, then lexicographical + if (lhs.features.size() < rhs.features.size()) return true; + if (rhs.features.size() < lhs.features.size()) return false; + + // then finally order by feature list + if (std::lexicographical_compare( + lhs.features.begin(), lhs.features.end(), rhs.features.begin(), rhs.features.end())) + { + return true; + } + return false; + } + }; + + template + void operator()(std::unique_ptr& ptr) const + { + (*this)(*ptr); + } + + void operator()(Dependency& dep) const + { + std::sort(dep.features.begin(), dep.features.end()); + dep.extra_info.sort_keys(); + } + void operator()(SourceParagraph& spgh) const + { + std::for_each(spgh.dependencies.begin(), spgh.dependencies.end(), *this); + std::sort(spgh.dependencies.begin(), spgh.dependencies.end(), DependencyLess{}); + + std::sort(spgh.default_features.begin(), spgh.default_features.end()); + + spgh.extra_info.sort_keys(); + } + void operator()(FeatureParagraph& fpgh) const + { + std::for_each(fpgh.dependencies.begin(), fpgh.dependencies.end(), *this); + std::sort(fpgh.dependencies.begin(), fpgh.dependencies.end(), DependencyLess{}); + + fpgh.extra_info.sort_keys(); + } + void operator()(SourceControlFile& scf) const + { + (*this)(*scf.core_paragraph); + std::for_each(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), *this); + std::sort(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureLess{}); + + auto adjacent_equal = + std::adjacent_find(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureEqual{}); + if (adjacent_equal != scf.feature_paragraphs.end()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + R"(Multiple features with the same name for port %s: %s + This is invalid; please make certain that features have distinct names.)", + scf.core_paragraph->name, + (*adjacent_equal)->name); + } + } + } canonicalize{}; + } + static ParseExpected parse_source_paragraph(const fs::path& path_to_control, Paragraph&& fields) { - auto origin = path_to_control.u8string(); + auto origin = fs::u8string(path_to_control); ParagraphParser parser(std::move(fields)); @@ -262,7 +304,7 @@ namespace vcpkg static ParseExpected parse_feature_paragraph(const fs::path& path_to_control, Paragraph&& fields) { - auto origin = path_to_control.u8string(); + auto origin = fs::u8string(path_to_control); ParagraphParser parser(std::move(fields)); auto fpgh = std::make_unique(); @@ -303,7 +345,7 @@ namespace vcpkg if (control_paragraphs.size() == 0) { auto ret = std::make_unique(); - ret->name = path_to_control.u8string(); + ret->name = fs::u8string(path_to_control); return ret; } @@ -326,184 +368,162 @@ namespace vcpkg return std::move(maybe_feature).error(); } + canonicalize(*control_file); return control_file; } - static std::vector invalid_json_fields(const Json::Object& obj, - Span known_fields) noexcept + struct PlatformExprDeserializer : Json::IDeserializer { - const auto field_is_unknown = [known_fields](StringView sv) { - // allow directives - if (sv.size() != 0 && *sv.begin() == '$') - { - return false; - } - return std::find(known_fields.begin(), known_fields.end(), sv) == known_fields.end(); - }; + virtual StringView type_name() const override { return "a platform expression"; } - std::vector res; - for (const auto& kv : obj) + virtual Optional visit_string(Json::Reader&, StringView sv) override { - if (field_is_unknown(kv.first)) + auto opt = + PlatformExpression::parse_platform_expression(sv, PlatformExpression::MultipleBinaryOperators::Deny); + if (auto res = opt.get()) { - res.push_back(kv.first.to_string()); + return std::move(*res); + } + else + { + Debug::print("Failed to parse platform expression: ", opt.error(), "\n"); + return nullopt; } } - - return res; - } - - struct StringField : Json::VisitorCrtpBase - { - using type = std::string; - StringView type_name() { return type_name_; } - - Optional visit_string(Json::Reader&, StringView, StringView sv) { return sv.to_string(); } - - explicit StringField(StringView type_name_) : type_name_(type_name_) { } - - private: - StringView type_name_; }; - struct BooleanField : Json::VisitorCrtpBase + struct DependencyDeserializer : Json::IDeserializer { - using type = bool; - StringView type_name() { return "a boolean"; } + virtual StringView type_name() const override { return "a dependency"; } - Optional visit_boolean(Json::Reader&, StringView, bool b) { return b; } - }; - - enum class AllowEmpty : bool - { - No, - Yes, - }; - - template - struct ArrayField : Json::VisitorCrtpBase> - { - using type = std::vector; - - StringView type_name() { return type_name_; } + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral FEATURES = "features"; + constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; + constexpr static StringLiteral PLATFORM = "platform"; - ArrayField(StringView type_name_, AllowEmpty allow_empty, T&& t = {}) - : type_name_(type_name_), underlying_visitor_(static_cast(t)), allow_empty_(allow_empty) + virtual Span valid_fields() const override { + static const StringView t[] = { + NAME, + FEATURES, + DEFAULT_FEATURES, + PLATFORM, + }; + + return t; } - Optional visit_array(Json::Reader& r, StringView key, const Json::Array& arr) + virtual Optional visit_string(Json::Reader&, StringView sv) override { - if (allow_empty_ == AllowEmpty::No && arr.size() == 0) + if (!Json::PackageNameDeserializer::is_package_name(sv)) { return nullopt; } - return r.array_elements(arr, key, underlying_visitor_); - } - - private: - StringView type_name_; - T underlying_visitor_; - AllowEmpty allow_empty_; - }; - struct ParagraphField : Json::VisitorCrtpBase - { - using type = std::vector; - StringView type_name() { return "a string or array of strings"; } - - Optional> visit_string(Json::Reader&, StringView, StringView sv) - { - std::vector out; - out.push_back(sv.to_string()); - return out; - } - - Optional> visit_array(Json::Reader& r, StringView key, const Json::Array& arr) - { - return r.array_elements(arr, key, StringField{"a string"}); + Dependency dep; + dep.name = sv.to_string(); + return dep; } - }; - struct IdentifierField : Json::VisitorCrtpBase - { - using type = std::string; - StringView type_name() { return "an identifier"; } - - // [a-z0-9]+(-[a-z0-9]+)*, plus not any of {prn, aux, nul, con, lpt[1-9], com[1-9], core, default} - static bool is_ident(StringView sv) + virtual Optional visit_object(Json::Reader& r, const Json::Object& obj) override { - static const std::regex BASIC_IDENTIFIER = std::regex(R"([a-z0-9]+(-[a-z0-9]+)*)"); - - // we only check for lowercase in RESERVED since we already remove all - // strings with uppercase letters from the basic check - static const std::regex RESERVED = std::regex(R"(prn|aux|nul|con|(lpt|com)[1-9]|core|default)"); + Dependency dep; - if (!std::regex_match(sv.begin(), sv.end(), BASIC_IDENTIFIER)) + for (const auto& el : obj) { - return false; // we're not even in the shape of an identifier + if (Strings::starts_with(el.first, "$")) + { + dep.extra_info.insert_or_replace(el.first.to_string(), el.second); + } } - if (std::regex_match(sv.begin(), sv.end(), RESERVED)) + r.required_object_field(type_name(), obj, NAME, dep.name, Json::PackageNameDeserializer{}); + r.optional_object_field(obj, + FEATURES, + dep.features, + Json::ArrayDeserializer{"an array of identifiers", + Json::AllowEmpty::Yes}); + + bool default_features = true; + r.optional_object_field(obj, DEFAULT_FEATURES, default_features, Json::BooleanDeserializer{}); + if (!default_features) { - return false; // we're a reserved identifier + dep.features.push_back("core"); } - return true; - } + r.optional_object_field(obj, PLATFORM, dep.platform, PlatformExprDeserializer{}); - Optional visit_string(Json::Reader&, StringView, StringView sv) - { - if (is_ident(sv)) - { - return sv.to_string(); - } - else - { - return nullopt; - } + return dep; } }; - struct PackageNameField : Json::VisitorCrtpBase + constexpr StringLiteral DependencyDeserializer::NAME; + constexpr StringLiteral DependencyDeserializer::FEATURES; + constexpr StringLiteral DependencyDeserializer::DEFAULT_FEATURES; + constexpr StringLiteral DependencyDeserializer::PLATFORM; + + struct FeatureDeserializer : Json::IDeserializer> { - using type = std::string; - StringView type_name() { return "a package name"; } + virtual StringView type_name() const override { return "a feature"; } + + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral DESCRIPTION = "description"; + constexpr static StringLiteral DEPENDENCIES = "dependencies"; + constexpr static StringLiteral SUPPORTS = "support"; - static bool is_package_name(StringView sv) + virtual Span valid_fields() const override { - if (sv.size() == 0) - { - return false; - } + static const StringView t[] = {NAME, DESCRIPTION, DEPENDENCIES}; + return t; + } - for (const auto& ident : Strings::split(sv, '.')) + virtual Optional> visit_object(Json::Reader& r, + const Json::Object& obj) override + { + auto feature = std::make_unique(); + + for (const auto& el : obj) { - if (!IdentifierField::is_ident(ident)) + if (Strings::starts_with(el.first, "$")) { - return false; + feature->extra_info.insert_or_replace(el.first.to_string(), el.second); } } - return true; - } + r.required_object_field(type_name(), obj, NAME, feature->name, Json::IdentifierDeserializer{}); + r.required_object_field(type_name(), obj, DESCRIPTION, feature->description, Json::ParagraphDeserializer{}); + r.optional_object_field( + obj, + DEPENDENCIES, + feature->dependencies, + Json::ArrayDeserializer{"an array of dependencies", Json::AllowEmpty::Yes}); + r.optional_object_field(obj, SUPPORTS, feature->supports_expression, PlatformExprDeserializer{}); - Optional visit_string(Json::Reader&, StringView, StringView sv) - { - if (!is_package_name(sv)) - { - return nullopt; - } - return sv.to_string(); + return std::move(feature); } }; + constexpr StringLiteral FeatureDeserializer::NAME; + constexpr StringLiteral FeatureDeserializer::DESCRIPTION; + constexpr StringLiteral FeatureDeserializer::DEPENDENCIES; + + static constexpr StringView EXPRESSION_WORDS[] = { + "WITH", + "AND", + "OR", + }; + static constexpr StringView VALID_LICENSES[] = +#include "spdx-licenses.inc" + ; + static constexpr StringView VALID_EXCEPTIONS[] = +#include "spdx-licenses.inc" + ; + // We "parse" this so that we can add actual license parsing at some point in the future // without breaking anyone - struct LicenseExpressionField : Json::VisitorCrtpBase + struct LicenseExpressionDeserializer : Json::IDeserializer { - using type = std::string; - StringView type_name() { return "an SPDX license expression"; } + virtual StringView type_name() const override { return "an SPDX license expression"; } enum class Mode { @@ -512,20 +532,7 @@ namespace vcpkg ExpectException, }; - constexpr static StringView EXPRESSION_WORDS[] = { - "WITH", - "AND", - "OR", - }; - constexpr static StringView VALID_LICENSES[] = -#include "spdx-licenses.inc" - ; - - constexpr static StringView VALID_EXCEPTIONS[] = -#include "spdx-exceptions.inc" - ; - - Optional visit_string(Json::Reader&, StringView, StringView sv) + virtual Optional visit_string(Json::Reader&, StringView sv) override { Mode mode = Mode::ExpectExpression; size_t open_parens = 0; @@ -640,190 +647,229 @@ namespace vcpkg } }; - struct PlatformExprField : Json::VisitorCrtpBase + struct ManifestDeserializer : Json::IDeserializer> { - using type = PlatformExpression::Expr; - StringView type_name() { return "a platform expression"; } - - Optional visit_string(Json::Reader&, StringView, StringView sv) - { - auto opt = - PlatformExpression::parse_platform_expression(sv, PlatformExpression::MultipleBinaryOperators::Deny); - if (auto res = opt.get()) - { - return std::move(*res); - } - else - { - Debug::print("Failed to parse platform expression: ", opt.error(), "\n"); - return nullopt; - } - } - }; + virtual StringView type_name() const override { return "a manifest"; } - struct DependencyField : Json::VisitorCrtpBase - { - using type = Dependency; - StringView type_name() { return "a dependency"; } + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral VERSION = "version-string"; - constexpr static StringView NAME = "name"; - constexpr static StringView FEATURES = "features"; - constexpr static StringView DEFAULT_FEATURES = "default-features"; - constexpr static StringView PLATFORM = "platform"; - constexpr static StringView KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; + constexpr static StringLiteral PORT_VERSION = "port-version"; + constexpr static StringLiteral MAINTAINERS = "maintainers"; + constexpr static StringLiteral DESCRIPTION = "description"; + constexpr static StringLiteral HOMEPAGE = "homepage"; + constexpr static StringLiteral DOCUMENTATION = "documentation"; + constexpr static StringLiteral LICENSE = "license"; + constexpr static StringLiteral DEPENDENCIES = "dependencies"; + constexpr static StringLiteral DEV_DEPENDENCIES = "dev-dependencies"; + constexpr static StringLiteral FEATURES = "features"; + constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; + constexpr static StringLiteral SUPPORTS = "supports"; - Optional visit_string(Json::Reader&, StringView, StringView sv) + virtual Span valid_fields() const override { - if (!PackageNameField::is_package_name(sv)) - { - return nullopt; - } + static const StringView t[] = { + NAME, + VERSION, + + PORT_VERSION, + MAINTAINERS, + DESCRIPTION, + HOMEPAGE, + DOCUMENTATION, + LICENSE, + DEPENDENCIES, + DEV_DEPENDENCIES, + FEATURES, + DEFAULT_FEATURES, + SUPPORTS, + }; - Dependency dep; - dep.name = sv.to_string(); - return dep; + return t; } - Optional visit_object(Json::Reader& r, StringView, const Json::Object& obj) + virtual Optional> visit_object(Json::Reader& r, + const Json::Object& obj) override { + auto control_file = std::make_unique(); + control_file->core_paragraph = std::make_unique(); + + auto& spgh = control_file->core_paragraph; + spgh->type = Type{Type::PORT}; + + for (const auto& el : obj) { - auto extra_fields = invalid_json_fields(obj, KNOWN_FIELDS); - if (!extra_fields.empty()) + if (Strings::starts_with(el.first, "$")) { - r.error().add_extra_fields(type_name().to_string(), std::move(extra_fields)); + spgh->extra_info.insert_or_replace(el.first.to_string(), el.second); } } - Dependency dep; - r.required_object_field(type_name(), obj, NAME, dep.name, PackageNameField{}); + constexpr static StringView type_name = "vcpkg.json"; + r.required_object_field(type_name, obj, NAME, spgh->name, Json::IdentifierDeserializer{}); + r.required_object_field(type_name, obj, VERSION, spgh->version, Json::StringDeserializer{"a version"}); + r.optional_object_field(obj, PORT_VERSION, spgh->port_version, Json::NaturalNumberDeserializer{}); + r.optional_object_field(obj, MAINTAINERS, spgh->maintainers, Json::ParagraphDeserializer{}); + r.optional_object_field(obj, DESCRIPTION, spgh->description, Json::ParagraphDeserializer{}); + r.optional_object_field(obj, HOMEPAGE, spgh->homepage, Json::StringDeserializer{"a url"}); + r.optional_object_field(obj, DOCUMENTATION, spgh->documentation, Json::StringDeserializer{"a url"}); + r.optional_object_field(obj, LICENSE, spgh->license, LicenseExpressionDeserializer{}); r.optional_object_field( - obj, FEATURES, dep.features, ArrayField{"an array of identifiers", AllowEmpty::Yes}); + obj, + DEPENDENCIES, + spgh->dependencies, + Json::ArrayDeserializer{"an array of dependencies", Json::AllowEmpty::Yes}); - bool default_features = true; - r.optional_object_field(obj, DEFAULT_FEATURES, default_features, BooleanField{}); - if (!default_features) + if (obj.contains(DEV_DEPENDENCIES)) { - dep.features.push_back("core"); + System::print2(System::Color::error, "dev_dependencies are not yet supported"); + Checks::exit_fail(VCPKG_LINE_INFO); } - r.optional_object_field(obj, PLATFORM, dep.platform, PlatformExprField{}); + r.optional_object_field(obj, SUPPORTS, spgh->supports_expression, PlatformExprDeserializer{}); - return dep; + r.optional_object_field(obj, + DEFAULT_FEATURES, + spgh->default_features, + Json::ArrayDeserializer{"an array of identifiers", + Json::AllowEmpty::Yes}); + + r.optional_object_field( + obj, + FEATURES, + control_file->feature_paragraphs, + Json::ArrayDeserializer{"an array of feature definitions", Json::AllowEmpty::Yes}); + + canonicalize(*control_file); + return std::move(control_file); } }; - struct FeatureField : Json::VisitorCrtpBase + constexpr StringLiteral ManifestDeserializer::NAME; + constexpr StringLiteral ManifestDeserializer::VERSION; + + constexpr StringLiteral ManifestDeserializer::PORT_VERSION; + constexpr StringLiteral ManifestDeserializer::MAINTAINERS; + constexpr StringLiteral ManifestDeserializer::DESCRIPTION; + constexpr StringLiteral ManifestDeserializer::HOMEPAGE; + constexpr StringLiteral ManifestDeserializer::DOCUMENTATION; + constexpr StringLiteral ManifestDeserializer::LICENSE; + constexpr StringLiteral ManifestDeserializer::DEPENDENCIES; + constexpr StringLiteral ManifestDeserializer::DEV_DEPENDENCIES; + constexpr StringLiteral ManifestDeserializer::FEATURES; + constexpr StringLiteral ManifestDeserializer::DEFAULT_FEATURES; + constexpr StringLiteral ManifestDeserializer::SUPPORTS; + + Parse::ParseExpected SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest, + const Json::Object& manifest) { - using type = std::unique_ptr; - StringView type_name() { return "a feature"; } + Json::Reader reader; - constexpr static StringView NAME = "name"; - constexpr static StringView DESCRIPTION = "description"; - constexpr static StringView DEPENDENCIES = "dependencies"; - constexpr static StringView SUPPORTS = "supports"; + auto res = reader.visit_value(manifest, ManifestDeserializer{}); - Optional> visit_object(Json::Reader& r, StringView, const Json::Object& obj) + if (!reader.errors().empty()) { - auto feature = std::make_unique(); - - r.required_object_field(type_name(), obj, NAME, feature->name, IdentifierField{}); - r.required_object_field(type_name(), obj, DESCRIPTION, feature->description, ParagraphField{}); - r.optional_object_field(obj, - DEPENDENCIES, - feature->dependencies, - ArrayField{"an array of dependencies", AllowEmpty::Yes}); - r.optional_object_field(obj, SUPPORTS, feature->supports_expression, PlatformExprField{}); - - return std::move(feature); + auto err = std::make_unique(); + err->name = fs::u8string(path_to_manifest); + err->other_errors = std::move(reader.errors()); + return std::move(err); } - }; + else if (auto p = res.get()) + { + return std::move(*p); + } + else + { + Checks::unreachable(VCPKG_LINE_INFO); + } + } - Parse::ParseExpected SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest, - const Json::Object& manifest) + void print_error_message(Span> error_info_list) { - struct JsonErr final : Json::ReaderError - { - ParseControlErrorInfo pcei; + Checks::check_exit(VCPKG_LINE_INFO, error_info_list.size() > 0); - void add_missing_field(std::string&& type, std::string&& key) override + for (auto&& error_info : error_info_list) + { + Checks::check_exit(VCPKG_LINE_INFO, error_info != nullptr); + if (!error_info->error.empty()) { - pcei.missing_fields[std::move(type)].push_back(std::move(key)); + System::print2( + System::Color::error, "Error: while loading ", error_info->name, ":\n", error_info->error, '\n'); } - void add_expected_type(std::string&& key, std::string&& expected_type) override + + if (!error_info->other_errors.empty()) { - pcei.expected_types.emplace(std::move(key), std::move(expected_type)); + System::print2(System::Color::error, "Errors occurred while parsing ", error_info->name, "\n"); + for (auto&& msg : error_info->other_errors) + System::print2(" ", msg, '\n'); } - void add_extra_fields(std::string&& type, std::vector&& fields) override + } + + bool have_remaining_fields = false; + for (auto&& error_info : error_info_list) + { + if (!error_info->extra_fields.empty()) { - if (!fields.empty()) + System::print2(System::Color::error, + "Error: There are invalid fields in the control or manifest file of ", + error_info->name, + '\n'); + System::print2("The following fields were not expected:\n"); + + for (const auto& pr : error_info->extra_fields) { - auto& fields_for_type = pcei.extra_fields[std::move(type)]; - fields_for_type.insert(fields_for_type.end(), fields.begin(), fields.end()); + System::print2(" In ", pr.first, ": ", Strings::join(", ", pr.second), "\n"); } + have_remaining_fields = true; } - void add_mutually_exclusive_fields(std::string&& type, std::vector&& fields) override + } + + if (have_remaining_fields) + { + System::print2("This is the list of valid fields for CONTROL files (case-sensitive): \n\n ", + Strings::join("\n ", get_list_of_valid_fields()), + "\n\n"); +#if defined(_WIN32) + auto bootstrap = ".\\bootstrap-vcpkg.bat"; +#else + auto bootstrap = "./bootstrap-vcpkg.sh"; +#endif + System::printf("You may need to update the vcpkg binary; try running %s to update.\n\n", bootstrap); + } + + for (auto&& error_info : error_info_list) + { + if (!error_info->missing_fields.empty()) { - if (!fields.empty()) + System::print2(System::Color::error, + "Error: There are missing fields in the control file of ", + error_info->name, + '\n'); + System::print2("The following fields were missing:\n"); + for (const auto& pr : error_info->missing_fields) { - auto& fields_for_type = pcei.mutually_exclusive_fields[std::move(type)]; - fields_for_type.insert(fields_for_type.end(), fields.begin(), fields.end()); + System::print2(" In ", pr.first, ": ", Strings::join(", ", pr.second), "\n"); } } - } err = {}; - auto visit = Json::Reader{&err}; + } - err.pcei.name = path_to_manifest.u8string(); + for (auto&& error_info : error_info_list) { - auto extra_fields = invalid_json_fields(manifest, get_list_of_manifest_fields()); - if (!extra_fields.empty()) + if (!error_info->expected_types.empty()) { - err.pcei.extra_fields["manifest"] = std::move(extra_fields); - } - } - - auto control_file = std::make_unique(); - control_file->core_paragraph = std::make_unique(); - - auto& spgh = control_file->core_paragraph; - - constexpr static StringView type_name = "vcpkg.json"; - visit.required_object_field(type_name, manifest, ManifestFields::NAME, spgh->name, IdentifierField{}); - visit.required_object_field( - type_name, manifest, ManifestFields::VERSION, spgh->version, StringField{"a version"}); - visit.optional_object_field(manifest, ManifestFields::MAINTAINERS, spgh->maintainers, ParagraphField{}); - visit.optional_object_field(manifest, ManifestFields::DESCRIPTION, spgh->description, ParagraphField{}); - visit.optional_object_field(manifest, ManifestFields::HOMEPAGE, spgh->homepage, StringField{"a url"}); - visit.optional_object_field(manifest, ManifestFields::DOCUMENTATION, spgh->documentation, StringField{"a url"}); - visit.optional_object_field(manifest, ManifestFields::LICENSE, spgh->license, LicenseExpressionField{}); - visit.optional_object_field(manifest, - ManifestFields::DEPENDENCIES, - spgh->dependencies, - ArrayField{"an array of dependencies", AllowEmpty::Yes}); - - if (manifest.contains(ManifestFields::DEV_DEPENDENCIES)) - { - System::print2(System::Color::error, "dev_dependencies are not yet supported"); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - visit.optional_object_field(manifest, ManifestFields::SUPPORTS, spgh->supports_expression, PlatformExprField{}); - - visit.optional_object_field(manifest, - ManifestFields::DEFAULT_FEATURES, - spgh->default_features, - ArrayField{"an array of identifiers", AllowEmpty::Yes}); - - visit.optional_object_field(manifest, - ManifestFields::FEATURES, - control_file->feature_paragraphs, - ArrayField{"an array of feature definitions", AllowEmpty::Yes}); + System::print2(System::Color::error, + "Error: There are invalid field types in the CONTROL or manifest file of ", + error_info->name, + '\n'); + System::print2("The following fields had the wrong types:\n\n"); - if (err.pcei.has_error()) - { - return std::make_unique(std::move(err.pcei)); + for (const auto& pr : error_info->expected_types) + { + System::printf(" %s was expected to be %s\n", pr.first, pr.second); + } + System::print2("\n"); + } } - - return std::move(control_file); } Optional SourceControlFile::find_feature(const std::string& featurename) const @@ -862,4 +908,148 @@ namespace vcpkg } return ret; } + + static Json::Object serialize_manifest_impl(const SourceControlFile& scf, bool debug) + { + auto serialize_paragraph = + [&](Json::Object& obj, StringLiteral name, const std::vector& pgh, bool always = false) { + if (!debug) + { + if (pgh.empty()) + { + if (always) + { + obj.insert(name, Json::Array()); + } + return; + } + if (pgh.size() == 1) + { + obj.insert(name, Json::Value::string(pgh.front())); + return; + } + } + + auto& arr = obj.insert(name, Json::Array()); + for (const auto& s : pgh) + { + arr.push_back(Json::Value::string(s)); + } + }; + auto serialize_optional_array = + [&](Json::Object& obj, StringLiteral name, const std::vector& pgh) { + if (pgh.empty() && !debug) return; + + auto& arr = obj.insert(name, Json::Array()); + for (const auto& s : pgh) + { + arr.push_back(Json::Value::string(s)); + } + }; + auto serialize_optional_string = [&](Json::Object& obj, StringLiteral name, const std::string& s) { + if (!s.empty() || debug) + { + obj.insert(name, Json::Value::string(s)); + } + }; + auto serialize_dependency = [&](Json::Array& arr, const Dependency& dep) { + if (dep.features.empty() && dep.platform.is_empty() && dep.extra_info.is_empty()) + { + arr.push_back(Json::Value::string(dep.name)); + } + else + { + auto& dep_obj = arr.push_back(Json::Object()); + for (const auto& el : dep.extra_info) + { + dep_obj.insert(el.first.to_string(), el.second); + } + + dep_obj.insert(DependencyDeserializer::NAME, Json::Value::string(dep.name)); + + auto features_copy = dep.features; + auto core_it = std::find(features_copy.begin(), features_copy.end(), "core"); + if (core_it != features_copy.end()) + { + dep_obj.insert(DependencyDeserializer::DEFAULT_FEATURES, Json::Value::boolean(false)); + features_copy.erase(core_it); + } + + serialize_optional_array(dep_obj, DependencyDeserializer::FEATURES, features_copy); + serialize_optional_string(dep_obj, DependencyDeserializer::PLATFORM, to_string(dep.platform)); + } + }; + + Json::Object obj; + + for (const auto& el : scf.core_paragraph->extra_info) + { + obj.insert(el.first.to_string(), el.second); + } + + obj.insert(ManifestDeserializer::NAME, Json::Value::string(scf.core_paragraph->name)); + obj.insert(ManifestDeserializer::VERSION, Json::Value::string(scf.core_paragraph->version)); + + if (scf.core_paragraph->port_version != 0 || debug) + { + obj.insert(ManifestDeserializer::PORT_VERSION, Json::Value::integer(scf.core_paragraph->port_version)); + } + + serialize_paragraph(obj, ManifestDeserializer::MAINTAINERS, scf.core_paragraph->maintainers); + serialize_paragraph(obj, ManifestDeserializer::DESCRIPTION, scf.core_paragraph->description); + + serialize_optional_string(obj, ManifestDeserializer::HOMEPAGE, scf.core_paragraph->homepage); + serialize_optional_string(obj, ManifestDeserializer::DOCUMENTATION, scf.core_paragraph->documentation); + serialize_optional_string(obj, ManifestDeserializer::LICENSE, scf.core_paragraph->license); + serialize_optional_string( + obj, ManifestDeserializer::SUPPORTS, to_string(scf.core_paragraph->supports_expression)); + + if (!scf.core_paragraph->dependencies.empty() || debug) + { + auto& deps = obj.insert(ManifestDeserializer::DEPENDENCIES, Json::Array()); + + for (const auto& dep : scf.core_paragraph->dependencies) + { + serialize_dependency(deps, dep); + } + } + + serialize_optional_array(obj, ManifestDeserializer::DEFAULT_FEATURES, scf.core_paragraph->default_features); + + if (!scf.feature_paragraphs.empty() || debug) + { + auto& arr = obj.insert(ManifestDeserializer::FEATURES, Json::Array()); + for (const auto& feature : scf.feature_paragraphs) + { + auto& feature_obj = arr.push_back(Json::Object()); + for (const auto& el : feature->extra_info) + { + feature_obj.insert(el.first.to_string(), el.second); + } + + feature_obj.insert(FeatureDeserializer::NAME, Json::Value::string(feature->name)); + serialize_paragraph(feature_obj, FeatureDeserializer::DESCRIPTION, feature->description, true); + + if (!feature->dependencies.empty() || debug) + { + auto& deps = feature_obj.insert(FeatureDeserializer::DEPENDENCIES, Json::Array()); + for (const auto& dep : feature->dependencies) + { + serialize_dependency(deps, dep); + } + } + } + } + + if (debug) + { + obj.insert("TYPE", Json::Value::string(Type::to_string(scf.core_paragraph->type))); + } + + return obj; + } + + Json::Object serialize_debug_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, true); } + + Json::Object serialize_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, false); } } diff --git a/toolsrc/src/vcpkg/statusparagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp index 398129a0484a51..ba4b6f9bdb586e 100644 --- a/toolsrc/src/vcpkg/statusparagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/statusparagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp index d282a5ccbea959..ba181522483bbb 100644 --- a/toolsrc/src/vcpkg/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -1,8 +1,8 @@ -#include "pch.h" - #include +#include #include +#include namespace vcpkg { @@ -145,4 +145,42 @@ namespace vcpkg out_str.push_back('\n'); } } + + Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths) + { + const auto& fs = paths.get_filesystem(); + Json::Object iobj; + iobj.insert("version-string", Json::Value::string(ipv.core->package.version)); + iobj.insert("port-version", Json::Value::integer(ipv.core->package.port_version)); + iobj.insert("triplet", Json::Value::string(ipv.spec().triplet().to_string())); + iobj.insert("abi", Json::Value::string(ipv.core->package.abi)); + Json::Array deps; + for (auto&& dep : ipv.dependencies()) + deps.push_back(Json::Value::string(dep.to_string())); + if (deps.size() != 0) + { + iobj.insert("dependencies", std::move(deps)); + } + Json::Array features; + for (auto&& feature : ipv.features) + { + features.push_back(Json::Value::string(feature->package.feature)); + } + if (features.size() != 0) + { + iobj.insert("features", std::move(features)); + } + auto usage = Install::get_cmake_usage(ipv.core->package, paths); + if (!usage.message.empty()) + { + iobj.insert("usage", Json::Value::string(std::move(usage.message))); + } + auto owns_files = fs.read_lines(paths.listfile_path(ipv.core->package)).value_or_exit(VCPKG_LINE_INFO); + Json::Array owns; + for (auto&& owns_file : owns_files) + owns.push_back(Json::Value::string(std::move(owns_file))); + + iobj.insert("owns", std::move(owns)); + return Json::Value::object(std::move(iobj)); + } } diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 9098cb135fd0cc..5531a1daca3237 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -70,11 +68,11 @@ namespace vcpkg has_xml_version, R"(Could not find in %s)", XML_VERSION, - XML_PATH.u8string()); + fs::u8string(XML_PATH)); Checks::check_exit(VCPKG_LINE_INFO, XML_VERSION == match_xml_version[1], "Expected %s version: [%s], but was [%s]. Please re-run bootstrap-vcpkg.", - XML_PATH.u8string(), + fs::u8string(XML_PATH), XML_VERSION, match_xml_version[1]); @@ -83,8 +81,12 @@ namespace vcpkg const bool has_tool_entry = std::regex_search(XML.cbegin(), XML.cend(), match_tool_entry, tool_regex); if (!has_tool_entry) { - return Strings::format( - "Could not find entry for tool %s in %s for os=%s", tool, XML_PATH.u8string(), OS_STRING); + return Strings::format("Could not automatically acquire %s because there is no entry in %s for os=%s. You " + "may be able to install %s via your system package manager.", + tool, + fs::u8string(XML_PATH), + OS_STRING, + tool); } const std::string tool_data = @@ -134,10 +136,7 @@ namespace vcpkg virtual const std::string& exe_stem() const = 0; virtual std::array default_min_version() const = 0; - virtual void add_special_paths(std::vector& out_candidate_paths) const - { - Util::unused(out_candidate_paths); - } + virtual void add_special_paths(std::vector& out_candidate_paths) const { (void)out_candidate_paths; } virtual Optional get_version(const VcpkgPaths& paths, const fs::path& path_to_exe) const = 0; }; @@ -189,7 +188,7 @@ namespace vcpkg if (!fs.exists(tool_data.download_path)) { System::print2("Downloading ", tool_name, "...\n"); - System::print2(" ", tool_data.url, " -> ", tool_data.download_path.u8string(), "\n"); + System::print2(" ", tool_data.url, " -> ", fs::u8string(tool_data.download_path), "\n"); Downloads::download_file(fs, tool_data.url, tool_data.download_path, tool_data.sha512); } else @@ -212,7 +211,7 @@ namespace vcpkg Checks::check_exit(VCPKG_LINE_INFO, fs.exists(tool_data.exe_path), "Expected %s to exist after fetching", - tool_data.exe_path.u8string()); + fs::u8string(tool_data.exe_path)); return tool_data.exe_path; } @@ -281,12 +280,12 @@ namespace vcpkg out_candidate_paths.push_back(*pf / "CMake" / "bin" / "cmake.exe"); #else // TODO: figure out if this should do anything on non-Windows - Util::unused(out_candidate_paths); + (void)out_candidate_paths; #endif } virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override { - const std::string cmd = Strings::format(R"("%s" --version)", path_to_exe.u8string()); + const std::string cmd = Strings::format(R"("%s" --version)", fs::u8string(path_to_exe)); const auto rc = System::cmd_execute_and_capture_output(cmd); if (rc.exit_code != 0) { @@ -312,7 +311,7 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake). virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override { - const std::string cmd = Strings::format(R"("%s" --version)", path_to_exe.u8string()); + const std::string cmd = Strings::format(R"("%s" --version)", fs::u8string(path_to_exe)); const auto rc = System::cmd_execute_and_capture_output(cmd); if (rc.exit_code != 0) { @@ -340,7 +339,7 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake). #ifndef _WIN32 cmd.path_arg(paths.get_tool_exe(Tools::MONO)); #else - Util::unused(paths); + (void)paths; #endif cmd.path_arg(path_to_exe); const auto rc = System::cmd_execute_and_capture_output(cmd.extract()); @@ -378,13 +377,13 @@ Type 'NuGet help ' for help on a specific command. out_candidate_paths.push_back(*pf / "git" / "cmd" / "git.exe"); #else // TODO: figure out if this should do anything on non-windows - Util::unused(out_candidate_paths); + (void)out_candidate_paths; #endif } virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override { - const std::string cmd = Strings::format(R"("%s" --version)", path_to_exe.u8string()); + const std::string cmd = Strings::format(R"("%s" --version)", fs::u8string(path_to_exe)); const auto rc = System::cmd_execute_and_capture_output(cmd); if (rc.exit_code != 0) { @@ -439,7 +438,7 @@ Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 virtual void add_special_paths(std::vector& out_candidate_paths) const override { - Util::unused(out_candidate_paths); + (void)out_candidate_paths; // TODO: Uncomment later // const std::vector from_path = Files::find_from_PATH("installerbase"); // candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); @@ -451,7 +450,7 @@ Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override { - const std::string cmd = Strings::format(R"("%s" --framework-version)", path_to_exe.u8string()); + const std::string cmd = Strings::format(R"("%s" --framework-version)", fs::u8string(path_to_exe)); const auto rc = System::cmd_execute_and_capture_output(cmd); if (rc.exit_code != 0) { diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp index f9438c00afe871..1d325fb65e721e 100644 --- a/toolsrc/src/vcpkg/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -1,8 +1,7 @@ -#include "pch.h" - #include #include +#include namespace vcpkg { @@ -29,25 +28,9 @@ namespace std namespace vcpkg { - static std::unordered_set g_triplet_instances; - - const Triplet Triplet::X86_WINDOWS = from_canonical_name("x86-windows"); - const Triplet Triplet::X64_WINDOWS = from_canonical_name("x64-windows"); - const Triplet Triplet::ARM_WINDOWS = from_canonical_name("arm-windows"); - const Triplet Triplet::ARM64_WINDOWS = from_canonical_name("arm64-windows"); - const Triplet Triplet::X86_UWP = from_canonical_name("x86-uwp"); - const Triplet Triplet::X64_UWP = from_canonical_name("x64-uwp"); - const Triplet Triplet::ARM_UWP = from_canonical_name("arm-uwp"); - const Triplet Triplet::ARM64_UWP = from_canonical_name("arm64-uwp"); - - // - const Triplet Triplet::ARM_ANDROID = from_canonical_name("arm-android"); - const Triplet Triplet::ARM64_ANDROID = from_canonical_name("arm64-android"); - const Triplet Triplet::X86_ANDROID = from_canonical_name("x86-android"); - const Triplet Triplet::X64_ANDROID = from_canonical_name("x64-android"); - Triplet Triplet::from_canonical_name(std::string&& triplet_as_string) { + static std::unordered_set g_triplet_instances; std::string s(Strings::ascii_to_lowercase(std::move(triplet_as_string))); const auto p = g_triplet_instances.emplace(std::move(s)); return &*p.first; @@ -62,19 +45,19 @@ namespace vcpkg Optional Triplet::guess_architecture() const noexcept { using System::CPUArchitecture; - if (*this == X86_WINDOWS || *this == X86_UWP || *this == X86_ANDROID) + if (Strings::starts_with(this->canonical_name(), "x86-")) { return CPUArchitecture::X86; } - else if (*this == X64_WINDOWS || *this == X64_UWP || *this == X64_ANDROID) + if (Strings::starts_with(this->canonical_name(), "x64-")) { return CPUArchitecture::X64; } - else if (*this == ARM_WINDOWS || *this == ARM_UWP || *this == ARM_ANDROID) + if (Strings::starts_with(this->canonical_name(), "arm-")) { return CPUArchitecture::ARM; } - else if (*this == ARM64_WINDOWS || *this == ARM64_UWP || *this == ARM64_ANDROID) + if (Strings::starts_with(this->canonical_name(), "arm64-")) { return CPUArchitecture::ARM64; } @@ -98,13 +81,19 @@ namespace vcpkg else { #if defined(_WIN32) - return Triplet::X86_WINDOWS; + return Triplet::from_canonical_name("x86-windows"); #elif defined(__APPLE__) return Triplet::from_canonical_name("x64-osx"); #elif defined(__FreeBSD__) return Triplet::from_canonical_name("x64-freebsd"); #elif defined(__GLIBC__) +#if defined(__aarch64__) + return Triplet::from_canonical_name("arm64-linux"); +#elif defined(__arm__) + return Triplet::from_canonical_name("arm-linux"); +#else return Triplet::from_canonical_name("x64-linux"); +#endif #else return Triplet::from_canonical_name("x64-linux-musl"); #endif diff --git a/toolsrc/src/vcpkg/update.cpp b/toolsrc/src/vcpkg/update.cpp index 3a269ea7aeac29..ceb4b987672a21 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -55,7 +53,7 @@ namespace vcpkg::Update void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)args.parse_arguments(COMMAND_STRUCTURE); System::print2("Using local portfile versions. To update the local portfiles, use `git pull`.\n"); const StatusParagraphs status_db = database_load_check(paths); @@ -76,15 +74,28 @@ namespace vcpkg::Update { System::printf(" %-32s %s\n", package.spec, package.version_diff.to_string()); } - System::print2("\n" + +#if defined(_WIN32) + auto vcpkg_cmd = ".\\vcpkg"; +#else + auto vcpkg_cmd = "./vcpkg"; +#endif + System::printf("\n" "To update these packages and all dependencies, run\n" - " .\\vcpkg upgrade\n" + " %s upgrade\n" "\n" "To only remove outdated packages, run\n" - " .\\vcpkg remove --outdated\n" - "\n"); + " %s remove --outdated\n" + "\n", + vcpkg_cmd, + vcpkg_cmd); } Checks::exit_success(VCPKG_LINE_INFO); } + + void UpdateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Update::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/userconfig.cpp b/toolsrc/src/vcpkg/userconfig.cpp index 32588b2bbfbc7d..5236a3c3b62c28 100644 --- a/toolsrc/src/vcpkg/userconfig.cpp +++ b/toolsrc/src/vcpkg/userconfig.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 280faae0d80f19..d56de23a88a959 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include #include #include +#include #include #include #include @@ -50,6 +49,7 @@ namespace vcpkg {VcpkgCmdArguments::BINARY_CACHING_FEATURE, args.binary_caching}, {VcpkgCmdArguments::MANIFEST_MODE_FEATURE, args.manifest_mode}, {VcpkgCmdArguments::COMPILER_TRACKING_FEATURE, args.compiler_tracking}, + {VcpkgCmdArguments::REGISTRIES_FEATURE, args.registries_feature}, }; for (const auto& desc : flag_descriptions) @@ -309,6 +309,7 @@ namespace vcpkg {FEATURE_PACKAGES_SWITCH, &VcpkgCmdArguments::feature_packages}, {BINARY_CACHING_SWITCH, &VcpkgCmdArguments::binary_caching}, {WAIT_FOR_LOCK_SWITCH, &VcpkgCmdArguments::wait_for_lock}, + {JSON_SWITCH, &VcpkgCmdArguments::json}, }; bool found = false; @@ -605,12 +606,13 @@ namespace vcpkg void VcpkgCmdArguments::append_common_options(HelpTableFormatter& table) { static auto opt = [](StringView arg, StringView joiner, StringView value) { - return Strings::format("--%s%s%s", arg, joiner, value); + return Strings::concat("--", arg, joiner, value); }; table.format(opt(TRIPLET_ARG, " ", ""), "Specify the target architecture triplet. See 'vcpkg help triplet'"); table.format("", "(default: " + format_environment_variable("VCPKG_DEFAULT_TRIPLET") + ')'); table.format(opt(OVERLAY_PORTS_ARG, "=", ""), "Specify directories to be used when searching for ports"); + table.format("", "(also: " + format_environment_variable("VCPKG_OVERLAY_PORTS") + ')'); table.format(opt(OVERLAY_TRIPLETS_ARG, "=", ""), "Specify directories containing triplets files"); table.format(opt(BINARY_SOURCES_ARG, "=", ""), "Add sources for binary caching. See 'vcpkg help binarycaching'"); @@ -623,6 +625,7 @@ namespace vcpkg table.format(opt(INSTALL_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the install root directory"); table.format(opt(PACKAGES_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the packages root directory"); table.format(opt(SCRIPTS_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the scripts root directory"); + table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output"); } void VcpkgCmdArguments::imbue_from_environment() @@ -645,6 +648,19 @@ namespace vcpkg } } + { + const auto vcpkg_overlay_ports_env = System::get_environment_variable(OVERLAY_PORTS_ENV); + if (const auto unpacked = vcpkg_overlay_ports_env.get()) + { +#ifdef WIN32 + auto overlays = Strings::split(*unpacked, ';'); +#else + auto overlays = Strings::split(*unpacked, ':'); +#endif + overlay_ports.insert(std::end(overlay_ports), std::begin(overlays), std::end(overlays)); + } + } + if (!vcpkg_root_dir) { const auto vcpkg_root_env = System::get_environment_variable(VCPKG_ROOT_DIR_ENV); @@ -715,6 +731,7 @@ namespace vcpkg {BINARY_CACHING_FEATURE, binary_caching}, {MANIFEST_MODE_FEATURE, manifest_mode}, {COMPILER_TRACKING_FEATURE, compiler_tracking}, + {REGISTRIES_FEATURE, registries_feature}, }; for (const auto& flag : flags) @@ -739,6 +756,7 @@ namespace vcpkg } flags[] = { {BINARY_CACHING_FEATURE, binary_caching_enabled()}, {COMPILER_TRACKING_FEATURE, compiler_tracking_enabled()}, + {REGISTRIES_FEATURE, registries_enabled()}, }; for (const auto& flag : flags) @@ -838,4 +856,46 @@ namespace vcpkg } m_str.append(line_start, best_break); } + + // out-of-line definitions since C++14 doesn't allow inline constexpr static variables + constexpr StringLiteral VcpkgCmdArguments::VCPKG_ROOT_DIR_ENV; + constexpr StringLiteral VcpkgCmdArguments::VCPKG_ROOT_DIR_ARG; + constexpr StringLiteral VcpkgCmdArguments::MANIFEST_ROOT_DIR_ARG; + + constexpr StringLiteral VcpkgCmdArguments::BUILDTREES_ROOT_DIR_ARG; + constexpr StringLiteral VcpkgCmdArguments::DOWNLOADS_ROOT_DIR_ENV; + constexpr StringLiteral VcpkgCmdArguments::DOWNLOADS_ROOT_DIR_ARG; + constexpr StringLiteral VcpkgCmdArguments::INSTALL_ROOT_DIR_ARG; + constexpr StringLiteral VcpkgCmdArguments::PACKAGES_ROOT_DIR_ARG; + constexpr StringLiteral VcpkgCmdArguments::SCRIPTS_ROOT_DIR_ARG; + + constexpr StringLiteral VcpkgCmdArguments::DEFAULT_VISUAL_STUDIO_PATH_ENV; + + constexpr StringLiteral VcpkgCmdArguments::TRIPLET_ENV; + constexpr StringLiteral VcpkgCmdArguments::TRIPLET_ARG; + constexpr StringLiteral VcpkgCmdArguments::OVERLAY_PORTS_ENV; + constexpr StringLiteral VcpkgCmdArguments::OVERLAY_PORTS_ARG; + constexpr StringLiteral VcpkgCmdArguments::OVERLAY_TRIPLETS_ARG; + + constexpr StringLiteral VcpkgCmdArguments::BINARY_SOURCES_ARG; + + constexpr StringLiteral VcpkgCmdArguments::DEBUG_SWITCH; + constexpr StringLiteral VcpkgCmdArguments::SEND_METRICS_SWITCH; + constexpr StringLiteral VcpkgCmdArguments::DISABLE_METRICS_ENV; + constexpr StringLiteral VcpkgCmdArguments::DISABLE_METRICS_SWITCH; + constexpr StringLiteral VcpkgCmdArguments::PRINT_METRICS_SWITCH; + + constexpr StringLiteral VcpkgCmdArguments::WAIT_FOR_LOCK_SWITCH; + + constexpr StringLiteral VcpkgCmdArguments::JSON_SWITCH; + + constexpr StringLiteral VcpkgCmdArguments::FEATURE_FLAGS_ENV; + constexpr StringLiteral VcpkgCmdArguments::FEATURE_FLAGS_ARG; + + constexpr StringLiteral VcpkgCmdArguments::FEATURE_PACKAGES_SWITCH; + constexpr StringLiteral VcpkgCmdArguments::BINARY_CACHING_FEATURE; + constexpr StringLiteral VcpkgCmdArguments::BINARY_CACHING_SWITCH; + constexpr StringLiteral VcpkgCmdArguments::COMPILER_TRACKING_FEATURE; + constexpr StringLiteral VcpkgCmdArguments::MANIFEST_MODE_FEATURE; + constexpr StringLiteral VcpkgCmdArguments::REGISTRIES_FEATURE; } diff --git a/toolsrc/src/vcpkg/vcpkglib.cpp b/toolsrc/src/vcpkg/vcpkglib.cpp index ce9c6273418867..a158cf74ba5349 100644 --- a/toolsrc/src/vcpkg/vcpkglib.cpp +++ b/toolsrc/src/vcpkg/vcpkglib.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -174,7 +172,6 @@ namespace vcpkg { std::map ipv_map; - std::vector installed_packages; for (auto&& pgh : status_db) { if (!pgh->is_installed()) continue; diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index 4837c4b713083e..9f4ffce6b0d1bf 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,11 +5,17 @@ #include #include +#include #include #include +#include #include #include #include +#include +#include +#include +#include #include #include @@ -36,7 +40,7 @@ namespace Files::Filesystem& filesystem, const fs::path& root, std::string* option, StringLiteral name, LineInfo li) { auto result = process_input_directory_impl(filesystem, root, option, name, li); - Debug::print("Using ", name, "-root: ", result.u8string(), '\n'); + Debug::print("Using ", name, "-root: ", fs::u8string(result), '\n'); return result; } @@ -58,7 +62,7 @@ namespace Files::Filesystem& filesystem, const fs::path& root, std::string* option, StringLiteral name, LineInfo li) { auto result = process_output_directory_impl(filesystem, root, option, name, li); - Debug::print("Using ", name, "-root: ", result.u8string(), '\n'); + Debug::print("Using ", name, "-root: ", fs::u8string(result), '\n'); return result; } @@ -80,6 +84,113 @@ namespace namespace vcpkg { + static Configuration deserialize_configuration(const Json::Object& obj, + const VcpkgCmdArguments& args, + const fs::path& filepath) + { + Json::Reader reader; + auto deserializer = ConfigurationDeserializer(args); + + auto parsed_config_opt = reader.visit_value(obj, deserializer); + if (!reader.errors().empty()) + { + System::print2(System::Color::error, "Errors occurred while parsing ", fs::u8string(filepath), "\n"); + for (auto&& msg : reader.errors()) + System::print2(" ", msg, '\n'); + + System::print2("See https://github.com/Microsoft/vcpkg/tree/master/docs/specifications/registries.md for " + "more information.\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + return std::move(parsed_config_opt).value_or_exit(VCPKG_LINE_INFO); + } + + struct ManifestAndConfig + { + fs::path config_directory; + Configuration config; + }; + + static std::pair load_manifest(const Files::Filesystem& fs, + const fs::path& manifest_dir) + { + std::error_code ec; + auto manifest_path = manifest_dir / fs::u8path("vcpkg.json"); + auto manifest_opt = Json::parse_file(fs, manifest_path, ec); + if (ec) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Failed to load manifest from directory %s: %s", + fs::u8string(manifest_dir), + ec.message()); + } + + if (!manifest_opt.has_value()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Failed to parse manifest at %s:\n%s", + fs::u8string(manifest_path), + manifest_opt.error()->format()); + } + auto manifest_value = std::move(manifest_opt).value_or_exit(VCPKG_LINE_INFO); + + if (!manifest_value.first.is_object()) + { + System::print2(System::Color::error, + "Failed to parse manifest at ", + fs::u8string(manifest_path), + ": Manifest files must have a top-level object\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + return {std::move(manifest_value.first.object()), std::move(manifest_value.second)}; + } + + struct ConfigAndPath + { + fs::path config_directory; + Configuration config; + }; + + // doesn't yet implement searching upwards for configurations, nor inheritance of configurations + static ConfigAndPath load_configuration(const Files::Filesystem& fs, + const VcpkgCmdArguments& args, + const fs::path& vcpkg_root, + const fs::path& manifest_dir) + { + fs::path config_dir; + + if (!manifest_dir.empty()) + { + // manifest mode + config_dir = manifest_dir; + } + else + { + // classic mode + config_dir = vcpkg_root; + } + + auto path_to_config = config_dir / fs::u8path("vcpkg-configuration.json"); + if (!fs.exists(path_to_config)) + { + return {}; + } + + auto parsed_config = Json::parse_file(VCPKG_LINE_INFO, fs, path_to_config); + if (!parsed_config.first.is_object()) + { + System::print2(System::Color::error, + "Failed to parse ", + fs::u8string(path_to_config), + ": configuration files must have a top-level object\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + auto config_obj = std::move(parsed_config.first.object()); + + return {std::move(config_dir), deserialize_configuration(config_obj, args, path_to_config)}; + } + namespace details { struct VcpkgPathsImpl @@ -103,6 +214,10 @@ namespace vcpkg Build::EnvCache m_env_cache; fs::SystemHandle file_lock_handle; + + Optional> m_manifest_doc; + fs::path m_manifest_path; + Configuration m_config; }; } @@ -125,7 +240,7 @@ namespace vcpkg } uppercase_win32_drive_letter(root); Checks::check_exit(VCPKG_LINE_INFO, !root.empty(), "Error: Could not detect vcpkg-root."); - Debug::print("Using vcpkg-root: ", root.u8string(), '\n'); + Debug::print("Using vcpkg-root: ", fs::u8string(root), '\n'); std::error_code ec; bool manifest_mode_on = args.manifest_mode.value_or(args.manifest_root_dir != nullptr); @@ -135,13 +250,13 @@ namespace vcpkg } else { - manifest_root_dir = filesystem.find_file_recursively_up(original_cwd, "vcpkg.json"); + manifest_root_dir = filesystem.find_file_recursively_up(original_cwd, fs::u8path("vcpkg.json")); } uppercase_win32_drive_letter(manifest_root_dir); if (!manifest_root_dir.empty() && manifest_mode_on) { - Debug::print("Using manifest-root: ", manifest_root_dir.u8string(), '\n'); + Debug::print("Using manifest-root: ", fs::u8string(manifest_root_dir), '\n'); installed = process_output_directory( filesystem, manifest_root_dir, args.install_root_dir.get(), "vcpkg_installed", VCPKG_LINE_INFO); @@ -157,19 +272,22 @@ namespace vcpkg if (ec) { System::printf( - System::Color::error, "Failed to take the filesystem lock on %s:\n", vcpkg_lock.u8string()); + System::Color::error, "Failed to take the filesystem lock on %s:\n", fs::u8string(vcpkg_lock)); System::printf(System::Color::error, " %s\n", ec.message()); Checks::exit_fail(VCPKG_LINE_INFO); } + + m_pimpl->m_manifest_doc = load_manifest(filesystem, manifest_root_dir); + m_pimpl->m_manifest_path = manifest_root_dir / fs::u8path("vcpkg.json"); } else { // we ignore the manifest root dir if the user requests -manifest - if (!manifest_root_dir.empty() && !args.manifest_mode.has_value()) + if (!manifest_root_dir.empty() && !args.manifest_mode.has_value() && !args.output_json()) { System::print2(System::Color::warning, "Warning: manifest-root detected at ", - manifest_root_dir.generic_u8string(), + fs::generic_u8string(manifest_root_dir), ", but manifests are not enabled.\n"); System::printf(System::Color::warning, R"(If you wish to use manifest mode, you may do one of the following: @@ -197,6 +315,11 @@ If you wish to silence this error and use classic mode, you can: process_output_directory(filesystem, root, args.install_root_dir.get(), "installed", VCPKG_LINE_INFO); } + auto config_file = load_configuration(filesystem, args, root, manifest_root_dir); + + config_root_dir = std::move(config_file.config_directory); + m_pimpl->m_config = std::move(config_file.config); + buildtrees = process_output_directory(filesystem, root, args.buildtrees_root_dir.get(), "buildtrees", VCPKG_LINE_INFO); downloads = @@ -280,7 +403,7 @@ If you wish to silence this error and use classic mode, you can: { if (fs::is_regular_file(fs.status(VCPKG_LINE_INFO, path))) { - output.emplace_back(TripletFile(path.stem().filename().u8string(), triplets_dir)); + output.emplace_back(TripletFile(fs::u8string(path.stem().filename()), triplets_dir)); } } } @@ -300,7 +423,7 @@ If you wish to silence this error and use classic mode, you can: auto stem = file.stem(); if (stem != common_functions) { - helpers.emplace(stem.u8string(), + helpers.emplace(fs::u8string(stem), Hash::get_file_hash(VCPKG_LINE_INFO, fs, file, Hash::Algorithm::Sha1)); } } @@ -335,6 +458,31 @@ If you wish to silence this error and use classic mode, you can: return m_pimpl->m_tool_cache->get_tool_version(*this, tool); } + Optional VcpkgPaths::get_manifest() const + { + if (auto p = m_pimpl->m_manifest_doc.get()) + { + return p->first; + } + else + { + return nullopt; + } + } + Optional VcpkgPaths::get_manifest_path() const + { + if (m_pimpl->m_manifest_doc) + { + return m_pimpl->m_manifest_path; + } + else + { + return nullopt; + } + } + + const Configuration& VcpkgPaths::get_configuration() const { return m_pimpl->m_config; } + const Toolset& VcpkgPaths::get_toolset(const Build::PreBuildInfo& prebuildinfo) const { if (!prebuildinfo.using_vcvars()) @@ -374,7 +522,7 @@ If you wish to silence this error and use classic mode, you can: Checks::check_exit(VCPKG_LINE_INFO, !candidates.empty(), "Could not find Visual Studio instance at %s with %s toolset.", - vsp->u8string(), + fs::u8string(*vsp), *tsv); Checks::check_exit(VCPKG_LINE_INFO, candidates.size() == 1); diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp index b3e5b2590fea6b..c419745c2837f1 100644 --- a/toolsrc/src/vcpkg/versiont.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index a9a5d5565fed2e..7c9331da5bf99b 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #if defined(_WIN32) #include @@ -68,7 +66,8 @@ namespace vcpkg::VisualStudio std::string to_string() const { - return Strings::format("%s, %s, %s", root_path.u8string(), version, release_type_to_string(release_type)); + return Strings::format( + "%s, %s, %s", fs::u8string(root_path), version, release_type_to_string(release_type)); } std::string major_version() const { return version.substr(0, 2); } @@ -86,7 +85,7 @@ namespace vcpkg::VisualStudio if (fs.exists(vswhere_exe)) { const auto code_and_output = System::cmd_execute_and_capture_output( - Strings::format(R"("%s" -all -prerelease -legacy -products * -format xml)", vswhere_exe.u8string())); + Strings::format(R"("%s" -all -prerelease -legacy -products * -format xml)", fs::u8string(vswhere_exe))); Checks::check_exit(VCPKG_LINE_INFO, code_and_output.exit_code == 0, "Running vswhere.exe failed with message:\n%s", @@ -235,7 +234,7 @@ namespace vcpkg::VisualStudio for (const fs::path& subdir : msvc_subdirectories) { - auto toolset_version_full = subdir.filename().u8string(); + auto toolset_version_full = fs::u8string(subdir.filename()); auto toolset_version_prefix = toolset_version_full.substr(0, 4); CStringView toolset_version; std::string vcvars_option; @@ -352,7 +351,7 @@ namespace vcpkg::VisualStudio "Warning: The following VS instances are excluded because the English language pack is unavailable.\n"); for (const Toolset& toolset : excluded_toolsets) { - System::print2(" ", toolset.visual_studio_root_path.u8string(), '\n'); + System::print2(" ", fs::u8string(toolset.visual_studio_root_path), '\n'); } System::print2(System::Color::warning, "Please install the English language pack.\n"); } @@ -363,7 +362,7 @@ namespace vcpkg::VisualStudio System::print2("The following paths were examined:\n"); for (const fs::path& path : paths_examined) { - System::print2(" ", path.u8string(), '\n'); + System::print2(" ", fs::u8string(path), '\n'); } Checks::exit_fail(VCPKG_LINE_INFO); } diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln deleted file mode 100644 index 7f51e701fad235..00000000000000 --- a/toolsrc/vcpkg.sln +++ /dev/null @@ -1,105 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgtest", "vcpkgtest\vcpkgtest.vcxproj", "{F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F5893B21-EA71-4432-84D6-5FB0E0461A2A}" - ProjectSection(SolutionItems) = preProject - ..\scripts\bootstrap.ps1 = ..\scripts\bootstrap.ps1 - ..\scripts\get_triplet_environment.cmake = ..\scripts\get_triplet_environment.cmake - ..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1 - ..\scripts\ports.cmake = ..\scripts\ports.cmake - ..\scripts\vcpkgTools.xml = ..\scripts\vcpkgTools.xml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}" - ProjectSection(SolutionItems) = preProject - ..\scripts\cmake\vcpkg_acquire_msys.cmake = ..\scripts\cmake\vcpkg_acquire_msys.cmake - ..\scripts\cmake\vcpkg_apply_patches.cmake = ..\scripts\cmake\vcpkg_apply_patches.cmake - ..\scripts\cmake\vcpkg_build_cmake.cmake = ..\scripts\cmake\vcpkg_build_cmake.cmake - ..\scripts\cmake\vcpkg_build_msbuild.cmake = ..\scripts\cmake\vcpkg_build_msbuild.cmake - ..\scripts\cmake\vcpkg_build_qmake.cmake = ..\scripts\cmake\vcpkg_build_qmake.cmake - ..\scripts\cmake\vcpkg_common_functions.cmake = ..\scripts\cmake\vcpkg_common_functions.cmake - ..\scripts\cmake\vcpkg_configure_cmake.cmake = ..\scripts\cmake\vcpkg_configure_cmake.cmake - ..\scripts\cmake\vcpkg_configure_meson.cmake = ..\scripts\cmake\vcpkg_configure_meson.cmake - ..\scripts\cmake\vcpkg_configure_qmake.cmake = ..\scripts\cmake\vcpkg_configure_qmake.cmake - ..\scripts\cmake\vcpkg_copy_pdbs.cmake = ..\scripts\cmake\vcpkg_copy_pdbs.cmake - ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake = ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake - ..\scripts\cmake\vcpkg_download_distfile.cmake = ..\scripts\cmake\vcpkg_download_distfile.cmake - ..\scripts\cmake\vcpkg_execute_required_process.cmake = ..\scripts\cmake\vcpkg_execute_required_process.cmake - ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake = ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake - ..\scripts\cmake\vcpkg_extract_source_archive.cmake = ..\scripts\cmake\vcpkg_extract_source_archive.cmake - ..\scripts\cmake\vcpkg_find_acquire_program.cmake = ..\scripts\cmake\vcpkg_find_acquire_program.cmake - ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake = ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake - ..\scripts\cmake\vcpkg_from_bitbucket.cmake = ..\scripts\cmake\vcpkg_from_bitbucket.cmake - ..\scripts\cmake\vcpkg_from_github.cmake = ..\scripts\cmake\vcpkg_from_github.cmake - ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake = ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake - ..\scripts\cmake\vcpkg_get_windows_sdk.cmake = ..\scripts\cmake\vcpkg_get_windows_sdk.cmake - ..\scripts\cmake\vcpkg_install_cmake.cmake = ..\scripts\cmake\vcpkg_install_cmake.cmake - ..\scripts\cmake\vcpkg_install_meson.cmake = ..\scripts\cmake\vcpkg_install_meson.cmake - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BCE555DF-F471-4ACC-98E5-76CBE8E8F79E}" - ProjectSection(SolutionItems) = preProject - vcpkg.natvis = vcpkg.natvis - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.ActiveCfg = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.Build.0 = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.ActiveCfg = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.Build.0 = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.ActiveCfg = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.Build.0 = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.ActiveCfg = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.Build.0 = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.ActiveCfg = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.Build.0 = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.ActiveCfg = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.Build.0 = Release|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.ActiveCfg = Debug|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.Build.0 = Debug|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.ActiveCfg = Debug|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.Build.0 = Debug|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.ActiveCfg = Release|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.Build.0 = Release|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.ActiveCfg = Release|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {A0122231-04D5-420B-81CA-7960946E5E65} = {F5893B21-EA71-4432-84D6-5FB0E0461A2A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {DEDCC7AF-0FE6-4387-9FFE-495D6C1AEE1B} - EndGlobalSection -EndGlobal diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj deleted file mode 100644 index 917cd3b9c86123..00000000000000 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {34671B80-54F9-46F5-8310-AC429C11D4FB} - vcpkg - 8.1 - v140 - - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - - Level4 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - true - false - - - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level4 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - true - false - - - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - - - true - true - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - - - true - true - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - {b98c92b7-2874-4537-9d46-d14e5c237f04} - - - - - - - - - - - - diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters deleted file mode 100644 index 3821d89b399d94..00000000000000 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - Source Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj deleted file mode 100644 index b955e435783794..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ /dev/null @@ -1,301 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {B98C92B7-2874-4537-9D46-D14E5C237F04} - vcpkglib - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - 0 - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - - Level4 - Disabled - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - false - - - - - Level4 - Disabled - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - false - - - - - Level3 - MaxSpeed - true - true - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters deleted file mode 100644 index 5c5beb540527a4..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ /dev/null @@ -1,462 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {69f6b6e6-5ac4-4419-a256-b8a6b0392720} - - - {4a229410-0d09-4dab-953b-f434d6483f96} - - - {75592043-ab63-4905-beee-568a6ab8bf93} - - - {fa1f10e7-58d2-4f7c-ac26-a979baa70061} - - - - - Source Files - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - - - Header Files - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj deleted file mode 100644 index 9e2e8c08ac122e..00000000000000 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE} - vcpkgmetricsuploader - 8.1 - v140 - - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - - Level4 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - true - false - - - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level4 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - true - false - - - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - - - true - true - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - - - true - true - winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - - - - {b98c92b7-2874-4537-9d46-d14e5c237f04} - - - - - - diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters deleted file mode 100644 index ad56c0c7214e35..00000000000000 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj deleted file mode 100644 index 07e10e1a431b56..00000000000000 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - {b98c92b7-2874-4537-9d46-d14e5c237f04} - - - - - - - - - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D} - Win32Proj - vcpkgtest - 8.1 - v140 - - - - Application - true - Unicode - false - - - Application - false - true - Unicode - false - - - Application - true - Unicode - false - - - Application - false - true - Unicode - false - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - true - - - true - - - - - - Level4 - Disabled - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level4 - Disabled - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - _DEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - true - true - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - NDEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - true - true - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - - diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters deleted file mode 100644 index 481fe3b6e79ba5..00000000000000 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters +++ /dev/null @@ -1,69 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/triplets/community/arm-linux.cmake b/triplets/community/arm-linux.cmake new file mode 100644 index 00000000000000..6f69da83b2899b --- /dev/null +++ b/triplets/community/arm-linux.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE arm) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) + +if(NOT CMAKE_HOST_SYSTEM_PROCESSOR) + execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() diff --git a/triplets/community/arm64-linux.cmake b/triplets/community/arm64-linux.cmake new file mode 100644 index 00000000000000..5faf2f0a0ff976 --- /dev/null +++ b/triplets/community/arm64-linux.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) + +if(NOT CMAKE_HOST_SYSTEM_PROCESSOR) + execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() diff --git a/triplets/community/arm64-osx.cmake b/triplets/community/arm64-osx.cmake index 44c0b2852af1e1..62325a696759f3 100644 --- a/triplets/community/arm64-osx.cmake +++ b/triplets/community/arm64-osx.cmake @@ -3,3 +3,4 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/triplets/community/s390x-linux.cmake b/triplets/community/s390x-linux.cmake new file mode 100644 index 00000000000000..0aaefda4e34d16 --- /dev/null +++ b/triplets/community/s390x-linux.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE s390x) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) diff --git a/triplets/community/x86-windows-v120.cmake b/triplets/community/x86-windows-v120.cmake new file mode 100644 index 00000000000000..9cc6c315e1204b --- /dev/null +++ b/triplets/community/x86-windows-v120.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_PLATFORM_TOOLSET "v120") +set(VCPKG_DEP_INFO_OVERRIDE_VARS "v120") \ No newline at end of file