diff --git a/.gitattributes b/.gitattributes index fa1385d99a319b..f402cbb78aa1f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ * -text + +# 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/.github/pull_request_template.md b/.github/pull_request_template.md index 5126cee2a05732..d92a6ae1c01ce9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ **Describe the pull request** -- What does your PR fix? Fixes issue # +- What does your PR fix? Fixes # - Which triplets are supported/not supported? Have you updated the CI baseline? diff --git a/.gitignore b/.gitignore index 43f63c0dfc1cdb..b971df79de29c6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ toolsrc/out* toolsrc/CMakeSettings.json +# fuzzing +sync_dir* # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs @@ -287,40 +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.cmake -!triplets/community/arm64-uwp.cmake -!triplets/community/arm-mingw.cmake -!triplets/community/arm-windows.cmake -!triplets/community/x64-mingw.cmake -!triplets/community/x64-windows-static-md.cmake -!triplets/community/x86-mingw.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/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 @@ -329,4 +316,5 @@ __pycache__/ ############################################################ archives .DS_Store -prefab/ \ No newline at end of file +prefab/ +*.swp diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ff04e5127c73..a0d1b29f9969ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,1801 @@ +vcpkg (2020.04.20 - 2020.06.15) +--- +#### Total port count: 1402 +#### Total port count per triplet (tested): +|triplet|ports available| +|---|---| +|**x64-windows**|1282| +|**x64-osx**|1109| +|**x64-linux**|1181| +|x64-windows-static|1187| +|x86-windows|1261| +|x64-uwp|693| +|arm64-windows|903| +|arm-uwp|656| + +#### The following documentation has been updated: +- [Testing](docs/tool-maintainers/testing.md) + - [(#11007)](https://github.com/microsoft/vcpkg/pull/11007) [vcpkg] Fix Catch2 include path in documentation (by @horenmar) +- [Maintainer Guidelines and Policies](docs/maintainers/maintainer-guide.md) + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools (by @myd7349) +- [Portfile helper functions](docs/maintainers/portfile-functions.md) + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools (by @myd7349) + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @myd7349) +- [vcpkg_clean_executables_in_bin](docs/maintainers/vcpkg_clean_executables_in_bin.md)***[NEW]*** + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools (by @myd7349) +- [vcpkg_copy_tools](docs/maintainers/vcpkg_copy_tools.md)***[NEW]*** + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools (by @myd7349) +- [vcpkg_build_gn](docs/maintainers/vcpkg_build_gn.md)***[NEW]*** + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @vejmartin) +- [vcpkg_build_ninja](docs/maintainers/vcpkg_build_ninja.md)***[NEW]*** + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @vejmartin) +- [vcpkg_configure_gn](docs/maintainers/vcpkg_configure_gn.md)***[NEW]*** + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @vejmartin) +- [vcpkg_find_acquire_program](docs/maintainers/vcpkg_find_acquire_program.md) + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @vejmartin) +- [vcpkg_install_gn](docs/maintainers/vcpkg_install_gn.md)***[NEW]*** + - [(#10505)](https://github.com/microsoft/vcpkg/pull/10505) [gn, crashpad] Add GN build support and crashpad port (by @vejmartin) +- [vcpkg and Android](docs/examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake)***[NEW]*** + - [(#11264)](https://github.com/microsoft/vcpkg/pull/11264) Improve Android doc (triplets, usage with cmake and prefab) (by @pthom) +- [vcpkg telemetry and privacy](docs/about/privacy.md) + - [(#11542)](https://github.com/microsoft/vcpkg/pull/11542) [vcpkg metrics] Allow someone to opt out after build (by @strega-nil) +- [Manifests](docs/specifications/manifests.md)***[NEW]*** + - [(#11203)](https://github.com/microsoft/vcpkg/pull/11203) [vcpkg] RFC: Manifests (by @strega-nil) +- [CONTROL files](docs/maintainers/control-files.md) + - [(#11323)](https://github.com/microsoft/vcpkg/pull/11323) [vcpkg] add x86-wasm.cmake to community triplets (by @MoAlyousef) + - [(#11365)](https://github.com/microsoft/vcpkg/pull/11365) [vcpkg] [cudnn] [msmpi] [openmpi] Update VMSS (by @MoAlyousef) +- [Installing and Using Packagese Example: SQLite](docs/examples/installing-and-using-packages.md) + - [(#11763)](https://github.com/microsoft/vcpkg/pull/11763) docs: fix CMakeLists example for SQLite3 (by @disposedtrolley) + +#### The following changes have been made to the vcpkg tool and infrastructure: +- [(#10828)](https://github.com/microsoft/vcpkg/pull/10828) Onboard Windows PR tests to Azure Pipelines YAML and Scale Sets (by @BillyONeal) +- [(#10932)](https://github.com/microsoft/vcpkg/pull/10932) [vcpkg] Update git to 2.26.2 (by @Cheney-W) +- [(#10973)](https://github.com/microsoft/vcpkg/pull/10973) [vcpkg] Fix toolsrc CMake build error (by @NancyLi1013) +- [(#11009)](https://github.com/microsoft/vcpkg/pull/11009) Fix slack link to current, correct, location. (by @grafikrobot) +- [(#9861)](https://github.com/microsoft/vcpkg/pull/9861) [scripts] add new function vcpkg_fixup_pkgconfig (by @Neumann-A) +- [(#11064)](https://github.com/microsoft/vcpkg/pull/11064) [vcpkg] Copy macos pipelines into azure-pipelines.yml (by @BillyONeal) +- [(#10476)](https://github.com/microsoft/vcpkg/pull/10476) [vcpkg] Add support for VCPKG_BINARY_SOURCES and --x-binarysource=<> (by @ras0219-msft) +- [(#11068)](https://github.com/microsoft/vcpkg/pull/11068) [vcpkg] Small touchups for vcpkg unit tests (by @horenmar) +- [(#11085)](https://github.com/microsoft/vcpkg/pull/11085) [vcpkg] Correctly record default feature list in BinaryParagraphs. Fixes #10678. (by @ras0219-msft) +- [(#11090)](https://github.com/microsoft/vcpkg/pull/11090) [vcpkg] Bump macos build timeouts to 1 day (by @BillyONeal) +- [(#11091)](https://github.com/microsoft/vcpkg/pull/11091) [vcpkg baseline] Ignore mlpack on macOS (by @strega-nil) +- [(#11083)](https://github.com/microsoft/vcpkg/pull/11083) [vcpkg] Warn on unmatched removal with reasonable alternative (by @ras0219-msft) +- [(#11102)](https://github.com/microsoft/vcpkg/pull/11102) [vcpkg] fix undefined working dir in vcpkg_acquire_msys (by @Neumann-A) +- [(#11058)](https://github.com/microsoft/vcpkg/pull/11058) [msbuild]fix use UseEnv-True (by @Voskrese) +- [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot (by @BillyONeal) +- [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools (by @myd7349) +- [(#11166)](https://github.com/microsoft/vcpkg/pull/11166) [vcpkg] Add disk space report on Linux. (by @BillyONeal) +- [(#11170)](https://github.com/microsoft/vcpkg/pull/11170) [vcpkg] fix bug in Filesystem::absolute (by @strega-nil) +- [(#11175)](https://github.com/microsoft/vcpkg/pull/11175) [vcpkg] Point README.md to the correct status badge. (by @BillyONeal) +- [(#11171)](https://github.com/microsoft/vcpkg/pull/11171) [vcpkg] Add telemetry notice to `README.md`. (by @BillyONeal) +- [(#11189)](https://github.com/microsoft/vcpkg/pull/11189) [vcpkg] Add tombstone deletion scripts. (by @BillyONeal) +- [(#11105)](https://github.com/microsoft/vcpkg/pull/11105) [vcpkg/scripts] Fix ninja search path on windows and find binaries within vcpkg first (by @Neumann-A) +- [(#11202)](https://github.com/microsoft/vcpkg/pull/11202) [vcpkg] always pass VSCMD_SKIP_SENDTELEMETRY=1 (by @strega-nil) +- [(#8588)](https://github.com/microsoft/vcpkg/pull/8588) [vcpkg] Add x86 support for Linux toolchain (by @zhbanito) +- [(#11213)](https://github.com/microsoft/vcpkg/pull/11213) [vcpkg] Restrict telemetry uploads to TLS 1.2 (by @BillyONeal) +- [(#11234)](https://github.com/microsoft/vcpkg/pull/11234) [vcpkg] Don't build the metrics uploader when metrics are disabled. (by @BillyONeal) +- [(#11233)](https://github.com/microsoft/vcpkg/pull/11233) [vcpkg] Resolve relative overlay ports to the current working directory. (by @ras0219-msft) +- [(#10760)](https://github.com/microsoft/vcpkg/pull/10760) [vcpkg] Adding support for finding VS2019 by environment variable (by @Honeybunch) +- [(#11174)](https://github.com/microsoft/vcpkg/pull/11174) [vcpkg] [llvm] Bump Linux VM memory size and do all operations on the temporary disk. (by @BillyONeal) +- [(#11266)](https://github.com/microsoft/vcpkg/pull/11266) [vcpkg][android] Link C++ runtime according to VCPKG_CRT_LINKAGE (by @huangqinjin) +- [(#11260)](https://github.com/microsoft/vcpkg/pull/11260) [vcpkg] Update pull request template (by @PhoebeHui) +- [(#11302)](https://github.com/microsoft/vcpkg/pull/11302) [vcpkg] Resolve --overlay-ports is only working for relative parths since fix… (by @TobiasFunk) +- [(#11205)](https://github.com/microsoft/vcpkg/pull/11205) [vcpkg] Hopefully fix build on macOS 10.13/10.14 (by @strega-nil) +- [(#11093)](https://github.com/microsoft/vcpkg/pull/11093) [vcpkg] Fix nuget package import failed. (by @shihaonan369) +- [(#11239)](https://github.com/microsoft/vcpkg/pull/11239) [vcpkg] Turn on tests in CI. (by @BillyONeal) +- [(#11339)](https://github.com/microsoft/vcpkg/pull/11339) [vcpkg] Avoid naming Policheck sensitive term 'Virgin Islands' (by @BillyONeal) +- [(#11368)](https://github.com/microsoft/vcpkg/pull/11368) [vcpkg] Do not build the metrics uploader with MSBuild when metrics are disabled (by @rickertm) +- [(#11315)](https://github.com/microsoft/vcpkg/pull/11315) [vcpkg] Harden expand environment strings path with explicit integer overflow checks and resistance to CP_ACP. (by @BillyONeal) +- [(#11450)](https://github.com/microsoft/vcpkg/pull/11450) [vcpkg CI] Clean git directory before clone (by @strega-nil) +- [(#11432)](https://github.com/microsoft/vcpkg/pull/11432) [vcpkg] Harden file removals and clean directory contents in "CI" inside vcpkg itself. (by @BillyONeal) +- [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 (by @JackBoosY) +- [(#11433)](https://github.com/microsoft/vcpkg/pull/11433) [vcpkg] Optimize string split slightly. (by @BillyONeal) +- [(#11299)](https://github.com/microsoft/vcpkg/pull/11299) [vcpkg] pass -disableMetrics to bootstrap on git bash (by @strega-nil) +- [(#11453)](https://github.com/microsoft/vcpkg/pull/11453) Fix CMake PATH that fails Windows tests. (by @BillyONeal) +- [(#11343)](https://github.com/microsoft/vcpkg/pull/11343) [vcpkg] fix extern C around ctermid (by @strega-nil) +- [(#11380)](https://github.com/microsoft/vcpkg/pull/11380) [tool-meson] Update to 0.54.2 (by @c72578) +- [(#11057)](https://github.com/microsoft/vcpkg/pull/11057) [Vcpkg] Fix macOS applocal.py dependency bundling error (by @kevinhartman) +- [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds (by @Neumann-A) +- [(#11431)](https://github.com/microsoft/vcpkg/pull/11431) [vcpkg] Add static triplet for arm64-windows (by @orudge) +- [(#11466)](https://github.com/microsoft/vcpkg/pull/11466) [vcpkg] Fix cmake architecture detection on windows with ninja generator (by @Chronial) +- [(#11512)](https://github.com/microsoft/vcpkg/pull/11512) [vcpkg] Remove powershell from the 'run vcpkg ci' path to reduce hangs from msys components. (by @BillyONeal) +- [(#11443)](https://github.com/microsoft/vcpkg/pull/11443) [vcpkg-acquire-msys] Update pacman before any other package. (by @emptyVoid) +- [(#11496)](https://github.com/microsoft/vcpkg/pull/11496) [Baseline] Fix boost-*:arm-uwp failure and resolve conflicts in CI (by @PhoebeHui) +- [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports (by @JackBoosY) +- [(#11545)](https://github.com/microsoft/vcpkg/pull/11545) [vcpkg] Move CI cleaning back out of the 'ci' command into a separate command to restore cross-compilation preinstalls. (by @BillyONeal) +- [(#11612)](https://github.com/microsoft/vcpkg/pull/11612) [vcpkg baseline] Fix baseline failures (by @PhoebeHui) +- [(#11542)](https://github.com/microsoft/vcpkg/pull/11542) [vcpkg metrics] Allow someone to opt out after build (by @strega-nil) +- [(#11653)](https://github.com/microsoft/vcpkg/pull/11653) [vcpkg] Rename the msbuild property VcpkgRoot (by @BillyONeal) +- [(#11629)](https://github.com/microsoft/vcpkg/pull/11629) [vcpkg] Use a crypto RNG to generate admin passwords (by @BillyONeal) +- [(#11697)](https://github.com/microsoft/vcpkg/pull/11697) [vcpkg baseline] fix libb2:x64-osx (by @strega-nil) +- [(#11668)](https://github.com/microsoft/vcpkg/pull/11668) [CI|python3] add setuptools (by @Neumann-A) +- [(#11613)](https://github.com/microsoft/vcpkg/pull/11613) [vcpkg-baseline][unixodbc/nanodbc] Fix unixodbc build failure and set it as a dependency on nanodbc (by @JackBoosY) +- [(#11692)](https://github.com/microsoft/vcpkg/pull/11692) [vcpkg baseline] Remove passing port from Ci baseline (by @PhoebeHui) +- [(#11323)](https://github.com/microsoft/vcpkg/pull/11323) [vcpkg] add x86-wasm.cmake to community triplets (by @MoAlyousef) +- [(#11647)](https://github.com/microsoft/vcpkg/pull/11647) [vcpkg baseline][libfabric] Only support dynamic build (by @JackBoosY) +- [(#11483)](https://github.com/microsoft/vcpkg/pull/11483) [vcpkg] Allow CI to pass in all relevant directories and remove use of symbolic links (by @BillyONeal) +- [(#11764)](https://github.com/microsoft/vcpkg/pull/11764) [vcpkg] Add directories to x-ci-clean lost in merge conflict resolution. (by @BillyONeal) +- [(#11742)](https://github.com/microsoft/vcpkg/pull/11742) [vcpkg-baseline][manyport] Fix baseline error (by @JackBoosY) +- [(#11779)](https://github.com/microsoft/vcpkg/pull/11779) [vcpkg] Provide $(VcpkgRoot) and $(VcpkgCurrentInstalledDir) for customers. (by @BillyONeal) +- [(#11750)](https://github.com/microsoft/vcpkg/pull/11750) [vcpkg README] Add #include channel (by @strega-nil) +- [(#11693)](https://github.com/microsoft/vcpkg/pull/11693) [CI|gfortran] Install gfortran for OSX and Linux CI (by @Neumann-A) +- [(#11839)](https://github.com/microsoft/vcpkg/pull/11839) [vcpkg] Fix OSX CI by ensuring the downloads directory exists (by @BillyONeal +- [(#11810)](https://github.com/microsoft/vcpkg/pull/11810) [vcpkg-acquire-msys] Improvement (by @emptyVoid) +- [(#11365)](https://github.com/microsoft/vcpkg/pull/11365) [vcpkg] [cudnn] [msmpi] [openmpi] Update VMSS (by @BillyONeal) +- [(#11146)](https://github.com/microsoft/vcpkg/pull/11146) [vcpkg] Add nologo to windows toolchain (by @Neumann-A) +- [(#11891)](https://github.com/microsoft/vcpkg/pull/11891) [vcpkg] Fix bootstrap on VS2015 (by @BillyONeal) +- [(#11858)](https://github.com/microsoft/vcpkg/pull/11858) [vcpkg] Merge unit test pass into x86-windows. (by @BillyONeal) +- [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error (by @JackBoosY) +- [(#4361)](https://github.com/microsoft/vcpkg/pull/4361) Adds vcpkg item to project settings in Visual Studio (by @Neumann-A) +- [(#11958)](https://github.com/microsoft/vcpkg/pull/11958) Delete g_binary_caching global that should be passed as a parameter. (by @BillyONeal) + +
+The following 79 ports have been added: + +|port|version| +|---|---| +|[ryml](https://github.com/microsoft/vcpkg/pull/10793)| 2020-04-12 +|[qt5-androidextras](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-canvas3d](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-doc](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-serialbus](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-translations](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-wayland](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-webengine](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) [#11120](https://github.com/microsoft/vcpkg/pull/11120) [#11653](https://github.com/microsoft/vcpkg/pull/11653) | 5.12.8 +|[qt5-webglplugin](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[qt5-x11extras](https://github.com/microsoft/vcpkg/pull/10644)[#11026](https://github.com/microsoft/vcpkg/pull/11026) | 5.12.8 +|[iniparser](https://github.com/microsoft/vcpkg/pull/10710)| 2020-04-06 +|[quill](https://github.com/microsoft/vcpkg/pull/10902)[#11326](https://github.com/microsoft/vcpkg/pull/11326) | 1.3.1 +|[frozen](https://github.com/microsoft/vcpkg/pull/10766)| 1.0.0 +|[cppcoro](https://github.com/microsoft/vcpkg/pull/10693)| 2020-2-28-1 +|[libtomcrypt](https://github.com/microsoft/vcpkg/pull/10960)| 1.18.2-1 +|[libtommath](https://github.com/microsoft/vcpkg/pull/10960)| 1.2.0-1 +|[pe-parse](https://github.com/microsoft/vcpkg/pull/11012)| 1.2.0 +|[opencc](https://github.com/microsoft/vcpkg/pull/8474)[#10767](https://github.com/microsoft/vcpkg/pull/10767) [#11559](https://github.com/microsoft/vcpkg/pull/11559) [#11612](https://github.com/microsoft/vcpkg/pull/11612) | 2020-04-26-4 +|[uchardet](https://github.com/microsoft/vcpkg/pull/8477)| 2020-04-26 +|[libqcow](https://github.com/microsoft/vcpkg/pull/11036)[#11238](https://github.com/microsoft/vcpkg/pull/11238) | 20191221-1 +|[mstch](https://github.com/microsoft/vcpkg/pull/11020)| 1.0.2-2 +|[nowide](https://github.com/microsoft/vcpkg/pull/11066)[#11732](https://github.com/microsoft/vcpkg/pull/11732) [#11859](https://github.com/microsoft/vcpkg/pull/11859) | alias +|[discord-game-sdk](https://github.com/microsoft/vcpkg/pull/10763)[#11728](https://github.com/microsoft/vcpkg/pull/11728) | 2.5.6-1 +|[libmpeg2](https://github.com/microsoft/vcpkg/pull/8871)| 0.5.1 +|[opencv2](https://github.com/microsoft/vcpkg/pull/7849)[#11201](https://github.com/microsoft/vcpkg/pull/11201) | 2.4.13.7-1 +|[rtlsdr](https://github.com/microsoft/vcpkg/pull/10901)[#11575](https://github.com/microsoft/vcpkg/pull/11575) | 2020-04-16-1 +|[gasol](https://github.com/microsoft/vcpkg/pull/9550)| 2018-01-04 +|[coin](https://github.com/microsoft/vcpkg/pull/9880)| 4.0.0 +|[simage](https://github.com/microsoft/vcpkg/pull/9880)| 1.8.0 +|[soqt](https://github.com/microsoft/vcpkg/pull/9880)| 1.6.0 +|[gmp](https://github.com/microsoft/vcpkg/pull/10613)[#11565](https://github.com/microsoft/vcpkg/pull/11565) | 6.2.0-1 +|[nettle](https://github.com/microsoft/vcpkg/pull/10613)[#11565](https://github.com/microsoft/vcpkg/pull/11565) | 3.5.1-1 +|[vs-yasm](https://github.com/microsoft/vcpkg/pull/10613)| 0.5.0 +|[uthenticode](https://github.com/microsoft/vcpkg/pull/11199)[#11256](https://github.com/microsoft/vcpkg/pull/11256) [#11362](https://github.com/microsoft/vcpkg/pull/11362) | 1.0.4 +|[bitserializer-pugixml](https://github.com/microsoft/vcpkg/pull/11241)[#11683](https://github.com/microsoft/vcpkg/pull/11683) | alias +|[ignition-math6](https://github.com/microsoft/vcpkg/pull/11232)| 6.4.0 +|[vtk-m](https://github.com/microsoft/vcpkg/pull/11148)| 1.5.0 +|[crashpad](https://github.com/microsoft/vcpkg/pull/10505)| 2020-03-18 +|[bitserializer-rapidyaml](https://github.com/microsoft/vcpkg/pull/11242)[#11683](https://github.com/microsoft/vcpkg/pull/11683) | alias +|[ignition-msgs5](https://github.com/microsoft/vcpkg/pull/11272)[#11397](https://github.com/microsoft/vcpkg/pull/11397) | 5.1.0 +|[ignition-transport8](https://github.com/microsoft/vcpkg/pull/11272)| 8.0.0 +|[sdformat9](https://github.com/microsoft/vcpkg/pull/11265)[#11742](https://github.com/microsoft/vcpkg/pull/11742) | 9.2.0-1 +|[kissfft](https://github.com/microsoft/vcpkg/pull/9237)| 2020-03-30 +|[jaeger-client-cpp](https://github.com/microsoft/vcpkg/pull/9126)[#11583](https://github.com/microsoft/vcpkg/pull/11583) | 0.5.1-1 +|[libmediainfo](https://github.com/microsoft/vcpkg/pull/7005)| 20.03 +|[h5py-lzf](https://github.com/microsoft/vcpkg/pull/10871)| 2019-12-04 +|[microsoft-signalr](https://github.com/microsoft/vcpkg/pull/10833)[#11496](https://github.com/microsoft/vcpkg/pull/11496) | 0.1.0-alpha1-1 +|[oatpp-consul](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp-curl](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp-libressl](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp-mbedtls](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp-swagger](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp-websocket](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[oatpp](https://github.com/microsoft/vcpkg/pull/9402)| 1.0.0 +|[gperftools](https://github.com/microsoft/vcpkg/pull/8750)| 2019-09-02 +|[libvmdk](https://github.com/microsoft/vcpkg/pull/11010)| 2019-12-21 +|[ctp](https://github.com/microsoft/vcpkg/pull/10717)| 6.3.15_20190220_se +|[munit](https://github.com/microsoft/vcpkg/pull/6780)| 2019-04-06 +|[mmloader](https://github.com/microsoft/vcpkg/pull/11381)| 2020-05-15 +|[absent](https://github.com/microsoft/vcpkg/pull/11447)| 0.3.0 +|[ocilib](https://github.com/microsoft/vcpkg/pull/11549)[#11646](https://github.com/microsoft/vcpkg/pull/11646) | 4.6.4-1 +|[tinyply](https://github.com/microsoft/vcpkg/pull/11534)| 2020-05-22 +|[symengine](https://github.com/microsoft/vcpkg/pull/8752)| 2020-05-25 +|[nanoprintf](https://github.com/microsoft/vcpkg/pull/11605)| 2020-05-27 +|[wavelib](https://github.com/microsoft/vcpkg/pull/11611)| 2020-05-29 +|[refl-cpp](https://github.com/microsoft/vcpkg/pull/11622)| 0.9.1 +|[trantor](https://github.com/microsoft/vcpkg/pull/11533)| v1.0.0-rc13 +|[sockpp](https://github.com/microsoft/vcpkg/pull/11562)| 0.7 +|[protozero](https://github.com/microsoft/vcpkg/pull/11652)| 1.6.8 +|[p-ranav-csv2](https://github.com/microsoft/vcpkg/pull/11725)| 2020-06-02 +|[cr](https://github.com/microsoft/vcpkg/pull/11841)| 2020-04-26 +|[json-schema-validator](https://github.com/microsoft/vcpkg/pull/11599)| 2.1.0 +|[log4cxx](https://github.com/microsoft/vcpkg/pull/11659)| 0.10.0-2 +|[xbyak](https://github.com/microsoft/vcpkg/pull/11689)| 5.911 +|[licensepp](https://github.com/microsoft/vcpkg/pull/11711)| 2020-05-19 +|[v-hacd](https://github.com/microsoft/vcpkg/pull/11606)| 3.2.0 +|[libosmium](https://github.com/microsoft/vcpkg/pull/11863)| 2.15.5 +|[gzip-hpp](https://github.com/microsoft/vcpkg/pull/11735)| 0.1.0 +|[infoware](https://github.com/microsoft/vcpkg/pull/11410)| 0.5.3 +
+ +
+The following 375 ports have been updated: + +- otl `4.0.451` -> `4.0.455` + - [(#10922)](https://github.com/microsoft/vcpkg/pull/10922) [vcpkg baseline] Update hash for otl + - [(#11300)](https://github.com/microsoft/vcpkg/pull/11300) [otl] Update to 4.0.455 + +- vtk `8.2.0-12` -> `9.0-2` + - [(#10925)](https://github.com/microsoft/vcpkg/pull/10925) [VTK] Check if VTKTarget files exist + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + - [(#11643)](https://github.com/microsoft/vcpkg/pull/11643) [vtk] Fix single configuration builds + - [(#11708)](https://github.com/microsoft/vcpkg/pull/11708) [python3] Update to Python 3.8 + +- winreg `1.2.1-1` -> `3.1.0` + - [(#10926)](https://github.com/microsoft/vcpkg/pull/10926) [winreg] Update to 2.2.0 + - [(#10976)](https://github.com/microsoft/vcpkg/pull/10976) [WinReg] update to v2.2.2 + - [(#11034)](https://github.com/microsoft/vcpkg/pull/11034) [winreg] Update to 2.2.3 + - [(#11766)](https://github.com/microsoft/vcpkg/pull/11766) [winreg] Update to 2.4.0 + - [(#11883)](https://github.com/microsoft/vcpkg/pull/11883) [WinReg] Update to 3.0.1 + - [(#11888)](https://github.com/microsoft/vcpkg/pull/11888) [WinReg] Update to 3.1.0 + +- libyaml `0.2.2-2` -> `0.2.2-3` + - [(#10908)](https://github.com/microsoft/vcpkg/pull/10908) [libyaml] Fix linkage in non-Windows systems + +- libzippp `2019-07-22` -> `3.1-1.6.1` + - [(#10893)](https://github.com/microsoft/vcpkg/pull/10893) [libzippp] Update to libzippp-v3.1-1.6.1 + +- blend2d `beta_2020-04-15` -> `beta_2020-06-01` + - [(#10891)](https://github.com/microsoft/vcpkg/pull/10891) [blend2d] Update to beta_2020-04-19 + - [(#11155)](https://github.com/microsoft/vcpkg/pull/11155) [blend2d] Update to beta_2020-05-04 + - [(#11778)](https://github.com/microsoft/vcpkg/pull/11778) [blend2d] Update to beta_2020-06-01 + +- pegtl `3.0.0-pre-9d58962` -> `3.0.0-pre-83b6cdc` + - [(#10870)](https://github.com/microsoft/vcpkg/pull/10870) [pegtl] Update to latest commit from 4/5/2020 + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + - [(#11531)](https://github.com/microsoft/vcpkg/pull/11531) [pegtl/cppgraphqlgen] matching updates for dependency + +- skyr-url `1.5.1` -> `1.9.0` + - [(#10868)](https://github.com/microsoft/vcpkg/pull/10868) [skyr-url] Bump version to 1.7.0 + - [(#10954)](https://github.com/microsoft/vcpkg/pull/10954) [skyr-url] Updated port to use version 1.7.3 + - [(#11153)](https://github.com/microsoft/vcpkg/pull/11153) [skyr-url] Changed skyr-url version number to 1.7.5 + - [(#11568)](https://github.com/microsoft/vcpkg/pull/11568) [skyr-url] Changed version number to 1.9.0 + - [(#11774)](https://github.com/microsoft/vcpkg/pull/11774) [skyr-url] Changed version number for skyr-url + +- protobuf `3.11.3` -> `3.12.0-2` + - [(#10863)](https://github.com/microsoft/vcpkg/pull/10863) [protobuf] Update to 3.11.4 + - [(#11228)](https://github.com/microsoft/vcpkg/pull/11228) [protobuf] Correct protobuf under android (Fix issue #8218) + - [(#11397)](https://github.com/microsoft/vcpkg/pull/11397) [protobuf] protobuf v3.12.0 + - [(#11504)](https://github.com/microsoft/vcpkg/pull/11504) [protobuf] Fix RPATH error for static build + - [(#11516)](https://github.com/microsoft/vcpkg/pull/11516) [protobuf] Don't redefine PROTOBUF_USE_DLLS + +- sdformat6 `6.2.0` -> `6.2.0-1` + - [(#10859)](https://github.com/microsoft/vcpkg/pull/10859) [sdformat6] Migrate from Bitbucket to GitHub 🤖 + +- ompl `1.4.2-2` -> `1.4.2-4` + - [(#10854)](https://github.com/microsoft/vcpkg/pull/10854) [ompl] Fix ompl[app] build error + - [(#10972)](https://github.com/microsoft/vcpkg/pull/10972) [ompl] Fix patch apply error + +- dlib `19.17-1` -> `19.19-1` + - [(#10826)](https://github.com/microsoft/vcpkg/pull/10826) [dlib] Updated dlib to v19.19 + - [(#11195)](https://github.com/microsoft/vcpkg/pull/11195) [dlib] add more granularity in features + +- arrow `0.17.0` -> `0.17.1` + - [(#10800)](https://github.com/microsoft/vcpkg/pull/10800) [Arrow] Explicitly enable CSV and JSON + - [(#11016)](https://github.com/microsoft/vcpkg/pull/11016) [Arrow] Add filesystem feature + - [(#11472)](https://github.com/microsoft/vcpkg/pull/11472) [Arrow] Update to 0.17.1 + +- ace `6.5.8` -> `6.5.9-5` + - [(#10984)](https://github.com/microsoft/vcpkg/pull/10984) [ace] Add support for MacOSX + - [(#11112)](https://github.com/microsoft/vcpkg/pull/11112) [ace] Update to 6.5.9 + - [(#11369)](https://github.com/microsoft/vcpkg/pull/11369) [ace] Add patch to fix Visual Studio 2019 16.5 internal compiler error + - [(#11441)](https://github.com/microsoft/vcpkg/pull/11441) [ace] Add support for uwp + - [(#11464)](https://github.com/microsoft/vcpkg/pull/11464) [ace] Simplified port file + - [(#11713)](https://github.com/microsoft/vcpkg/pull/11713) [ace] Fix missing cpp files + - [(#11473)](https://github.com/microsoft/vcpkg/pull/11473) [ace] tao as feature + +- libaaplus `2.12` -> `2.12-1` + - [(#10981)](https://github.com/microsoft/vcpkg/pull/10981) [libaaplus] Use versioned download link + +- spscqueue `2019-07-26` -> `1.0` + - [(#10874)](https://github.com/microsoft/vcpkg/pull/10874) [spscqueue] Update to version 1.0 + +- googleapis `0.8.0` -> `alias` + - [(#10994)](https://github.com/microsoft/vcpkg/pull/10994) [googleapis] update to v0.9.0 + - [(#11698)](https://github.com/microsoft/vcpkg/pull/11698) [google-cloud-cpp] Consolidate all google-cloud* packages + +- ms-gsl `3.0.0` -> `3.0.1` + - [(#10993)](https://github.com/microsoft/vcpkg/pull/10993) [ms-gsl] Update to 3.0.1 + +- ryu `2.0-1` -> `2.0-2` + - [(#10989)](https://github.com/microsoft/vcpkg/pull/10989) [ryu]Ryu include fix + +- glm `0.9.9.7` -> `0.9.9.8` + - [(#10977)](https://github.com/microsoft/vcpkg/pull/10977) [glm, sqlitecpp] update to new version + +- sqlitecpp `2.3.0-1` -> `3.0.0` + - [(#10977)](https://github.com/microsoft/vcpkg/pull/10977) [glm, sqlitecpp] update to new version + +- nngpp `1.2.4` -> `1.3.0` + - [(#10975)](https://github.com/microsoft/vcpkg/pull/10975) [nngpp] Update to 1.3.0 + +- libvpx `1.8.1-1` -> `1.8.1-5` + - [(#10952)](https://github.com/microsoft/vcpkg/pull/10952) [libvpx][mpg123] Fix use of YASM in MSBuild (via path) + - [(#11058)](https://github.com/microsoft/vcpkg/pull/11058) [msbuild]fix use UseEnv-True + - [(#11022)](https://github.com/microsoft/vcpkg/pull/11022) [libvpx] Added support for build on MacOS and Linux + - [(#11500)](https://github.com/microsoft/vcpkg/pull/11500) [libvpx] Change default target on Unix + - [(#11795)](https://github.com/microsoft/vcpkg/pull/11795) [libvpx] Add cmake config file + +- mpg123 `1.25.8-6` -> `1.25.8-9` + - [(#10952)](https://github.com/microsoft/vcpkg/pull/10952) [libvpx][mpg123] Fix use of YASM in MSBuild (via path) + - [(#11058)](https://github.com/microsoft/vcpkg/pull/11058) [msbuild]fix use UseEnv-True + - [(#11287)](https://github.com/microsoft/vcpkg/pull/11287) [mpg123] Enable UWP support + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- qt5-3d `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-activeqt `5.12.5-1` -> `5.12.8-1` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + - [(#11045)](https://github.com/microsoft/vcpkg/pull/11045) [qt5] reactivate qt5-activeqt for CI coverage + +- qt5-base `5.12.5-13` -> `5.12.8-4` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + - [(#11111)](https://github.com/microsoft/vcpkg/pull/11111) [qt5] Add -j to make to parallelize on Linux and MacOS + - [(#11371)](https://github.com/microsoft/vcpkg/pull/11371) [qt5-base] Add Xorg dependency libx11-xcb-dev + - [(#11416)](https://github.com/microsoft/vcpkg/pull/11416) [harfbuzz,skia] Update and replace Skia dependencies with vcpkg + - [(#11483)](https://github.com/microsoft/vcpkg/pull/11483) [vcpkg] Allow CI to pass in all relevant directories and remove use of symbolic links + +- qt5-charts `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-connectivity `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-datavis3d `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-declarative `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-gamepad `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-graphicaleffects `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-imageformats `5.12.5-3` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-location `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-macextras `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-mqtt `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-multimedia `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-networkauth `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-purchasing `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-quickcontrols `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-quickcontrols2 `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-remoteobjects `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-script `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-scxml `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-sensors `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-serialport `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-speech `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-svg `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-tools `5.12.5-5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-virtualkeyboard `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-webchannel `5.12.5-2` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-websockets `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-webview `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-winextras `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5-xmlpatterns `5.12.5-1` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- qt5 `5.12.5` -> `5.12.8` + - [(#10644)](https://github.com/microsoft/vcpkg/pull/10644) [Qt[latest]] Update to 5.14.2 + - [(#10749)](https://github.com/microsoft/vcpkg/pull/10749) [Qt5] Update qt to 5.12.8 + +- libzip `rel-1-5-2--1` -> `rel-1-6-1` + - [(#10784)](https://github.com/microsoft/vcpkg/pull/10784) [libzip] update to rel-1-6-1 + +- nng `1.2.5` -> `1.3.0` + - [(#10974)](https://github.com/microsoft/vcpkg/pull/10974) [nng] Update to 1.3.0 + +- libmupdf `1.16.1` -> `1.16.1-1` + - [(#10708)](https://github.com/microsoft/vcpkg/pull/10708) [libmupdf] fix build error on Linux + +- catch2 `2.11.3` -> `2.12.1` + - [(#10996)](https://github.com/microsoft/vcpkg/pull/10996) [catch2] Update to 2.12.1 + +- websocketpp `0.8.1-1` -> `0.8.2` + - [(#10969)](https://github.com/microsoft/vcpkg/pull/10969) [websocketpp] Update to 0.8.2 + +- coroutine `2020-01-13` -> `1.5.0` + - [(#10692)](https://github.com/microsoft/vcpkg/pull/10692) [coroutine] update to 1.5.0 + +- boost-modular-build-helper `1.72.0-1` -> `1.73.0-1` + - [(#10285)](https://github.com/microsoft/vcpkg/pull/10285) [boost-modular-build-helper] Support Clang '--target=' syntax to enable Android builds + - [(#10814)](https://github.com/microsoft/vcpkg/pull/10814) [boost-modular-build] Fix lack of arm64-linux support + - [(#11427)](https://github.com/microsoft/vcpkg/pull/11427) [boost] MinGW build fixes + +- openssl-unix `1.1.1d-2` -> `1.1.1d-4` + - [(#10450)](https://github.com/microsoft/vcpkg/pull/10450) [openssl-unix] Update header path for shared library compilation + - [(#11344)](https://github.com/microsoft/vcpkg/pull/11344) [openssl-unix] Fix openssl-unix android build + +- sdl2-gfx `1.0.4-5` -> `1.0.4-6` + - [(#10575)](https://github.com/microsoft/vcpkg/pull/10575) [sdl2-gfx] Fix build error on non windows + +- hwloc `1.11.7-3` -> `1.11.7-4` + - [(#10615)](https://github.com/microsoft/vcpkg/pull/10615) [hwloc] Support UNIX + +- pixel `0.3` -> `0.3-1` + - [(#10638)](https://github.com/microsoft/vcpkg/pull/10638) [pixel] Add warning message on Linux + +- qt-advanced-docking-system `2019-08-14-1` -> `3.2.5-1` + - [(#10170)](https://github.com/microsoft/vcpkg/pull/10170) [qt-advanced-docking-system] updated qt-advanced-docking-system to 3.2.1 + - [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot + +- libarchive `3.4.1-1` -> `3.4.1-3` + - [(#11044)](https://github.com/microsoft/vcpkg/pull/11044) [libarchive] expose zstd as a build feature + - [(#11570)](https://github.com/microsoft/vcpkg/pull/11570) [libarchive] Disable C4061 which causes build to fail in Visual Studio 2019 16.6 + +- azure-kinect-sensor-sdk `1.4.0-alpha.0-2` -> `1.4.0-alpha.0-5` + - [(#11033)](https://github.com/microsoft/vcpkg/pull/11033) [azure-kinect-sensor-sdk] Fix pipeline error + - [(#10253)](https://github.com/microsoft/vcpkg/pull/10253) [imgui] Add feature bindings and remove feature example + - [(#11116)](https://github.com/microsoft/vcpkg/pull/11116) [azure-kinect-sensor-sdk] Disable parallel configure due to source directory writes + - [(#11139)](https://github.com/microsoft/vcpkg/pull/11139) [azure-kinect-sensor-sdk] Fix Deploy Azure Kinect Sensor SDK on Windows + +- range-v3 `0.10.0` -> `0.10.0-20200425` + - [(#11031)](https://github.com/microsoft/vcpkg/pull/11031) [range-v3] Update to new version. + +- ode `0.16` -> `0.16.1` + - [(#11029)](https://github.com/microsoft/vcpkg/pull/11029) [ode] Bump version to 0.16.1 + +- boost-coroutine `1.72.0` -> `1.73.0` + - [(#10988)](https://github.com/microsoft/vcpkg/pull/10988) [boost-coroutine] Add patch from boost.org + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- libtorrent `1.2.2-1` -> `1.2.7` + - [(#10686)](https://github.com/microsoft/vcpkg/pull/10686) [libtorrent] Update to 1.2.6 and add features + - [(#11257)](https://github.com/microsoft/vcpkg/pull/11257) [libtorrent] add iconv feature on windows and clean up portfile + - [(#11389)](https://github.com/microsoft/vcpkg/pull/11389) [libtorrent] minor portfile simplification and version bump + - [(#11709)](https://github.com/microsoft/vcpkg/pull/11709) [libtorrent] Update to 1.2.7 + +- geos `3.6.3-3` -> `3.6.4` + - [(#10377)](https://github.com/microsoft/vcpkg/pull/10377) [geos] Upgrade to GEOS 3.6.4 + +- egl-registry `2020-02-03` -> `2020-02-20` + - [(#10676)](https://github.com/microsoft/vcpkg/pull/10676) [egl-registry, opengl-registry] Update egl-registry to 2020-02-20 and opengl-registry to 2020-03-25 + +- opengl-registry `2020-02-03` -> `2020-03-25` + - [(#10676)](https://github.com/microsoft/vcpkg/pull/10676) [egl-registry, opengl-registry] Update egl-registry to 2020-02-20 and opengl-registry to 2020-03-25 + +- murmurhash `2016-01-09` -> `2016-01-09-3` + - [(#11011)](https://github.com/microsoft/vcpkg/pull/11011) [murmurhash] installation fix + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- gts `0.7.6-1` -> `0.7.6-3` + - [(#10055)](https://github.com/microsoft/vcpkg/pull/10055) [gts] Support for build with cmake in unix + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11884)](https://github.com/microsoft/vcpkg/pull/11884) [glib/gts] Add pkgconfig files + +- icu `65.1-3` -> `67.1` + - [(#10656)](https://github.com/microsoft/vcpkg/pull/10656) [icu] Fix configure failure due to not finding python + - [(#11714)](https://github.com/microsoft/vcpkg/pull/11714) [icu] Update to 67.1 + +- ffmpeg `4.2-7` -> `4.2-9` + - [(#8797)](https://github.com/microsoft/vcpkg/pull/8797) [ffmpeg] Fix ffmpeg[opencl, openssl, lzma] static build failed + - [(#11443)](https://github.com/microsoft/vcpkg/pull/11443) [vcpkg-acquire-msys] Update pacman before any other package. + - [(#11810)](https://github.com/microsoft/vcpkg/pull/11810) [vcpkg-acquire-msys] Improvement + +- liblzma `5.2.4-4` -> `5.2.4-5` + - [(#8797)](https://github.com/microsoft/vcpkg/pull/8797) [ffmpeg] Fix ffmpeg[opencl, openssl, lzma] static build failed + +- cpprestsdk `2.10.15-1` -> `2.10.16-2` + - [(#11018)](https://github.com/microsoft/vcpkg/pull/11018) [cpprestsdk] Update to v2.10.16 + - [(#11694)](https://github.com/microsoft/vcpkg/pull/11694) [cpprestsdk] Avoid using pkg-config to find OpenSSL libraries on Linux + - [(#11867)](https://github.com/microsoft/vcpkg/pull/11867) [cpprestsdk] Fix find dependency openssl + +- harfbuzz `2.5.3` -> `2.6.6` + - [(#11082)](https://github.com/microsoft/vcpkg/pull/11082) [harfbuzz] Change build depends from freetype to freetype[core] + - [(#11416)](https://github.com/microsoft/vcpkg/pull/11416) [harfbuzz,skia] Update and replace Skia dependencies with vcpkg + +- pcl `1.9.1-11` -> `1.9.1-13` + - [(#11047)](https://github.com/microsoft/vcpkg/pull/11047) [pcl] Fix link to libpng + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + +- armadillo `2019-04-16-6` -> `2019-04-16-8` + - [(#11063)](https://github.com/microsoft/vcpkg/pull/11063) [armadillo] Add dependent port superlu on osx + +- abseil `2020-03-03-3` -> `2020-03-03-6` + - [(#11039)](https://github.com/microsoft/vcpkg/pull/11039) [abseil] Configure abseil to use std:: types when feature cxx17 is enabled + - [(#11630)](https://github.com/microsoft/vcpkg/pull/11630) [abseil] Fix arm build + - [(#11827)](https://github.com/microsoft/vcpkg/pull/11827) [abseil] Enable dynamic build on Windows + +- metrohash `1.1.3` -> `1.1.3-1` + - [(#10992)](https://github.com/microsoft/vcpkg/pull/10992) [metrohash] installation fix + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- nana `1.7.2-1` -> `1.7.2-3` + - [(#10936)](https://github.com/microsoft/vcpkg/pull/10936) [nana] Revert 1 darkcacok patch nana + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- alembic `1.7.12` -> `1.7.12-1` + - [(#10912)](https://github.com/microsoft/vcpkg/pull/10912) [alembic] linux fixes + +- civetweb `2019-07-05-1` -> `1.12` + - [(#10591)](https://github.com/microsoft/vcpkg/pull/10591) [civetweb] Update to version 1.12 + +- argh `2018-12-18-1` -> `2018-12-18-2` + - [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot + +- ceres `1.14.0-6` -> `1.14.0-7` + - [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot + - [(#11200)](https://github.com/microsoft/vcpkg/pull/11200) [ceres] Added patch to add find_dependency() for suitesparse targets downstream + +- idevicerestore `1.0.12-3` -> `1.0.12-4` + - [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot + - [(#11074)](https://github.com/microsoft/vcpkg/pull/11074) [idevicerestore] Fix libgen.h cannot be found + +- openblas `0.3.7` -> `0.3.9-1` + - [(#10980)](https://github.com/microsoft/vcpkg/pull/10980) [vcpkg] Onboard Linux to VMSS, open 'git' port, and switch back to Azure Spot + +- imgui `1.74` -> `1.76-1` + - [(#10253)](https://github.com/microsoft/vcpkg/pull/10253) [imgui] Add feature bindings and remove feature example + - [(#11388)](https://github.com/microsoft/vcpkg/pull/11388) [imgui] Update to 1.76 + +- libigl `2.1.0-1` -> `2.1.0-2` + - [(#10253)](https://github.com/microsoft/vcpkg/pull/10253) [imgui] Add feature bindings and remove feature example + +- opencv4 `4.1.1-3` -> `4.1.1-6` + - [(#10886)](https://github.com/microsoft/vcpkg/pull/10886) [opencv4] Add GTK support for opencv4 portfile + - [(#7849)](https://github.com/microsoft/vcpkg/pull/7849) [OpenCV2] add new "old" port + - [(#11201)](https://github.com/microsoft/vcpkg/pull/11201) [opencv4] Changed dependency on qt5 to qt5-base, closes microsoft/vcpkg#11138 + - [(#11429)](https://github.com/microsoft/vcpkg/pull/11429) [opencv4] Fix linking halide + +- libbson `1.15.1-1` -> `1.16.1` + - [(#10010)](https://github.com/microsoft/vcpkg/pull/10010) [libbson/mongo-c-driver] Update to 1.16.1 + +- mongo-c-driver `1.15.1-1` -> `1.16.1-1` + - [(#10010)](https://github.com/microsoft/vcpkg/pull/10010) [libbson/mongo-c-driver] Update to 1.16.1 + - [(#11217)](https://github.com/microsoft/vcpkg/pull/11217) [mongo-c-driver] Fix find_package error + +- mongo-cxx-driver `3.4.0-4` -> `3.4.0-5` + - [(#10010)](https://github.com/microsoft/vcpkg/pull/10010) [libbson/mongo-c-driver] Update to 1.16.1 + - [(#11584)](https://github.com/microsoft/vcpkg/pull/11584) [mongo-cxx-driver] Patch std::atomic P0883 changes + +- cpuinfo `2019-07-28` -> `2019-07-28-1` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- czmq `2019-06-10-3` -> `2019-06-10-4` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- libsvm `323` -> `323-1` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- nanomsg `1.1.5-1` -> `1.1.5-2` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- uriparser `0.9.3-4` -> `0.9.3-5` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- zyre `2019-07-07` -> `2019-07-07-1` + - [(#8749)](https://github.com/microsoft/vcpkg/pull/8749) [vcpkg] Add new function vcpkg_copy_tools + +- halide `release_2019_08_27-2` -> `master_2020_03_07` + - [(#10295)](https://github.com/microsoft/vcpkg/pull/10295) [llvm] Update to version 10.0.0 and add new features + +- llvm `8.0.0-5` -> `10.0.0-3` + - [(#10295)](https://github.com/microsoft/vcpkg/pull/10295) [llvm] Update to version 10.0.0 and add new features + - [(#11174)](https://github.com/microsoft/vcpkg/pull/11174) [vcpkg] [llvm] Bump Linux VM memory size and do all operations on the temporary disk. + - [(#11268)](https://github.com/microsoft/vcpkg/pull/11268) [llvm] add more backend options, fix issues + - [(#11703)](https://github.com/microsoft/vcpkg/pull/11703) [llvm] fix llvm-tblgen build with MSVC v19.26 + +- sciter `4.4.1.5` -> `4.4.3.20` + - [(#11161)](https://github.com/microsoft/vcpkg/pull/11161) [sciter] Update to 4.4.3.15.7771 + - [(#11393)](https://github.com/microsoft/vcpkg/pull/11393) [sciter] Update to 4.4.3.18.7817 + - [(#11723)](https://github.com/microsoft/vcpkg/pull/11723) [sciter] Update to 4.4.3.20.7852 + +- apr-util `1.6.0-5` -> `1.6.1-1` + - [(#8579)](https://github.com/microsoft/vcpkg/pull/8579) [apr apr-util] Apr and apr-util for non windows systems + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- apr `1.6.5-3` -> `1.7.0` + - [(#8579)](https://github.com/microsoft/vcpkg/pull/8579) [apr apr-util] Apr and apr-util for non windows systems + +- opencv3 `3.4.7-2` -> `3.4.7-3` + - [(#7849)](https://github.com/microsoft/vcpkg/pull/7849) [OpenCV2] add new "old" port + - [(#11201)](https://github.com/microsoft/vcpkg/pull/11201) [opencv4] Changed dependency on qt5 to qt5-base, closes microsoft/vcpkg#11138 + +- gtest `2019-10-09-1` -> `1.10.0` + - [(#10963)](https://github.com/microsoft/vcpkg/pull/10963) [gtest] Rollback to a release version. + +- ignition-cmake0 `0.6.2-1` -> `0.6.2-2` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + +- ignition-cmake2 `2.1.1` -> `2.2.0-1` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + - [(#11232)](https://github.com/microsoft/vcpkg/pull/11232) [ignition-math6] Add new port 🤖 + - [(#11270)](https://github.com/microsoft/vcpkg/pull/11270) [eigen3] [ignition-modularscripts] Fix installed pkgconfig files + +- ignition-common1 `1.1.1` -> `1.1.1-1` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + +- ignition-fuel-tools1 `1.2.0` -> `1.2.0-2` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + - [(#11270)](https://github.com/microsoft/vcpkg/pull/11270) [eigen3] [ignition-modularscripts] Fix installed pkgconfig files + +- ignition-math4 `4.0.0` -> `4.0.0-1` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + +- ignition-modularscripts `2020-02-10` -> `2020-05-09` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + - [(#11270)](https://github.com/microsoft/vcpkg/pull/11270) [eigen3] [ignition-modularscripts] Fix installed pkgconfig files + +- ignition-msgs1 `1.0.0` -> `1.0.0-1` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + +- ignition-transport4 `4.0.0` -> `4.0.0-2` + - [(#10858)](https://github.com/microsoft/vcpkg/pull/10858) [ignition-modular-scripts] Migrate from Bitbucket to GitHub 🤖 + - [(#11270)](https://github.com/microsoft/vcpkg/pull/11270) [eigen3] [ignition-modularscripts] Fix installed pkgconfig files + +- cuda `10.1` -> `10.1-1` + - [(#10838)](https://github.com/microsoft/vcpkg/pull/10838) [cuda] Fix find cuda in UNIX + +- libiconv `1.16-1` -> `1.16-3` + - [(#9832)](https://github.com/microsoft/vcpkg/pull/9832) libiconv - Fix ICONV_CONST + - [(#11586)](https://github.com/microsoft/vcpkg/pull/11586) [vcpkg-baseline][zxing-cpp] Fix build failure + +- glib `2.52.3-14-5` -> `2.52.3-14-7` + - [(#10856)](https://github.com/microsoft/vcpkg/pull/10856) [glib] Update the usage of string(TOUPPER ...) + - [(#11884)](https://github.com/microsoft/vcpkg/pull/11884) [glib/gts] Add pkgconfig files + +- freerdp `2.0.0-rc4-7` -> `2.0.0-1` + - [(#11051)](https://github.com/microsoft/vcpkg/pull/11051) [freerdp] Update to 2.0.0 + - [(#11639)](https://github.com/microsoft/vcpkg/pull/11639) [freerdp] Optional 'urbdrc' feature + +- wxwidgets `3.1.3` -> `3.1.3-1` + - [(#11178)](https://github.com/microsoft/vcpkg/pull/11178) [wxwidgets] Apply fix to wxWidgets for copy and paste macOS + +- libsquish `1.15-2` -> `1.15-3` + - [(#11124)](https://github.com/microsoft/vcpkg/pull/11124) [libsquish] add missing SQUISH_EXPORT + +- bitserializer-cpprestjson `0.8` -> `alias` + - [(#11157)](https://github.com/microsoft/vcpkg/pull/11157) [BitSerializer] Update to version 0.9 + - [(#11683)](https://github.com/microsoft/vcpkg/pull/11683) [bitserializer] Update to new version 0.10 + +- bitserializer-rapidjson `0.8` -> `alias` + - [(#11157)](https://github.com/microsoft/vcpkg/pull/11157) [BitSerializer] Update to version 0.9 + - [(#11683)](https://github.com/microsoft/vcpkg/pull/11683) [bitserializer] Update to new version 0.10 + +- bitserializer `0.8` -> `0.9` + - [(#11157)](https://github.com/microsoft/vcpkg/pull/11157) [BitSerializer] Update to version 0.9 + - [(#11683)](https://github.com/microsoft/vcpkg/pull/11683) [bitserializer] Update to new version 0.10 + +- gsoap `2.8.93-2` -> `2.8.93-3` + - [(#11048)](https://github.com/microsoft/vcpkg/pull/11048) [gsoap] Add supports for gsoap + - [(#11355)](https://github.com/microsoft/vcpkg/pull/11355) [gSoap] Update to 2.8.102 and re-enable x64 Builds + +- lua `5.3.5-3` -> `5.3.5-5` + - [(#11163)](https://github.com/microsoft/vcpkg/pull/11163) [lua] Compile as position-independent code + - [(#11870)](https://github.com/microsoft/vcpkg/pull/11870) [lua] Add vcpkg-cmake-wrapper + +- gainput `1.0.0-2` -> `1.0.0-3` + - [(#11000)](https://github.com/microsoft/vcpkg/pull/11000) [gainput] imporve cmake search gainput library + +- opencl `2.2-2` -> `2.2-2-1` + - [(#10567)](https://github.com/microsoft/vcpkg/pull/10567) [opencl] Add build type when installing targets + +- azure-iot-sdk-c `2020-02-04.1` -> `2020-02-04.1-1` + - [(#11017)](https://github.com/microsoft/vcpkg/pull/11017) [azure-iot-sdk-c] Fixed the CMake config export. + +- sfml `2.5.1-6` -> `2.5.1-7` + - [(#11246)](https://github.com/microsoft/vcpkg/pull/11246) [sfml] Remove unnecessary patch + +- asmjit `2020-02-08` -> `2020-05-08` + - [(#11245)](https://github.com/microsoft/vcpkg/pull/11245) [asmjit] Update to the latest commit + +- libpq `12.0-1` -> `12.2-2` + - [(#11223)](https://github.com/microsoft/vcpkg/pull/11223) [libpq] link libdl on linux + - [(#10915)](https://github.com/microsoft/vcpkg/pull/10915) [libpq] Update to 12.2 and some feature fixes + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + - [(#11612)](https://github.com/microsoft/vcpkg/pull/11612) [vcpkg baseline] Fix baseline failures + - [(#11483)](https://github.com/microsoft/vcpkg/pull/11483) [vcpkg] Allow CI to pass in all relevant directories and remove use of symbolic links + +- allegro5 `5.2.5.0` -> `5.2.6.0` + - [(#11187)](https://github.com/microsoft/vcpkg/pull/11187) [Allegro] Update to 5.2.6.0 + +- lz4 `1.9.2-1` -> `1.9.2-2` + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + +- pegtl-2 `2.8.1` -> `2.8.1-1` + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + +- vtk-dicom `0.8.12` -> `0.8.12-1` + - [(#11148)](https://github.com/microsoft/vcpkg/pull/11148) [VTK/vtk-m] Update VTK to 9.0 and add vtk-m + +- libzen `0.4.37` -> `0.4.38` + - [(#11237)](https://github.com/microsoft/vcpkg/pull/11237) [libzen] Update to 0.4.38 + +- speexdsp `1.2.0-1` -> `1.2.0-2` + - [(#11218)](https://github.com/microsoft/vcpkg/pull/11218) [speexdsp] Change repo to github + +- restclient-cpp `0.5.1-3` -> `0.5.2` + - [(#9717)](https://github.com/microsoft/vcpkg/pull/9717) [restclient-cpp] Fix portfile and update version. + +- libpng `1.6.37-7` -> `1.6.37-9` + - [(#11162)](https://github.com/microsoft/vcpkg/pull/11162) [libpng] Fix missing symbols when compiling for ARM + - [(#11280)](https://github.com/microsoft/vcpkg/pull/11280) [libpng] Fix android build + +- capstone `4.0.1-120373dc` -> `4.0.2` + - [(#11250)](https://github.com/microsoft/vcpkg/pull/11250) [capstone] Update to 4.0.2 + +- nuspell `3.1.0` -> `3.1.1` + - [(#11291)](https://github.com/microsoft/vcpkg/pull/11291) [nuspell] update port to v3.1.1 + +- zydis `3.1.0` -> `3.1.0-1` + - [(#11173)](https://github.com/microsoft/vcpkg/pull/11173) Update zydis portfile.cmake + +- glog `0.4.0-2` -> `0.4.0-3` + - [(#11288)](https://github.com/microsoft/vcpkg/pull/11288) [glog] Disable tests + +- opus `1.3.1-2` -> `1.3.1-3` + - [(#11279)](https://github.com/microsoft/vcpkg/pull/11279) [opus] Update port to 1.3.1-2 + +- eigen3 `3.3.7-4` -> `3.3.7-5` + - [(#11270)](https://github.com/microsoft/vcpkg/pull/11270) [eigen3] [ignition-modularscripts] Fix installed pkgconfig files + +- nlopt `2.6.1-1` -> `2.6.2-1` + - [(#11254)](https://github.com/microsoft/vcpkg/pull/11254) [nlopt] Update to 2.6.2 + - [(#11398)](https://github.com/microsoft/vcpkg/pull/11398) [nlopt] Enable UWP support + +- string-theory `3.1` -> `3.2` + - [(#11310)](https://github.com/microsoft/vcpkg/pull/11310) [string-theory] Update to 3.2 + +- miniz `2.1.0` -> `2.1.0-1` + - [(#11316)](https://github.com/microsoft/vcpkg/pull/11316) [miniz] Fix broken cmake config file + +- z3 `4.8.6` -> `4.8.8` + - [(#11314)](https://github.com/microsoft/vcpkg/pull/11314) [z3] update port to 4.8.8 + +- jsoncons `0.150.0` -> `0.153.0` + - [(#11311)](https://github.com/microsoft/vcpkg/pull/11311) [jsoncons] Update to v0.151.0 + - [(#11505)](https://github.com/microsoft/vcpkg/pull/11505) [jsoncons] Update to v0.152.0 + - [(#11699)](https://github.com/microsoft/vcpkg/pull/11699) [jsoncons] Update to v0.153.0 + +- units `2.3.0` -> `2.3.1` + - [(#11308)](https://github.com/microsoft/vcpkg/pull/11308) [units] Update to 2.3.1 + +- boost-accumulators `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-algorithm `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-align `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-any `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-array `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-asio `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-assert `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-assign `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-atomic `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-beast `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-bimap `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-bind `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-build `1.72.0` -> `1.73.0-1` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + - [(#11427)](https://github.com/microsoft/vcpkg/pull/11427) [boost] MinGW build fixes + +- boost-callable-traits `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-chrono `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-circular-buffer `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-compatibility `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-compute `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-concept-check `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-config `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-container-hash `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-container `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-context `1.72.0` -> `1.73.0-1` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + - [(#11692)](https://github.com/microsoft/vcpkg/pull/11692) [vcpkg baseline] Remove passing port from Ci baseline + +- boost-contract `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-conversion `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-convert `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-core `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-coroutine2 `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-crc `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-date-time `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-detail `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-dll `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-dynamic-bitset `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-endian `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-exception `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-fiber `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-filesystem `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-flyweight `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-foreach `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-format `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-function-types `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-function `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-functional `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-fusion `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-geometry `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-gil `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-graph-parallel `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- boost-graph `1.72.0` -> `1.73.0` + - [(#11221)](https://github.com/microsoft/vcpkg/pull/11221) [boost] update to 1.73.0 + +- sobjectizer `5.7.0` -> `5.7.0.1` + - [(#11276)](https://github.com/microsoft/vcpkg/pull/11276) [sobjectizer] update to v.5.7.0.1. + +- imgui-sfml `2.1` -> `2.1-1` + - [(#10840)](https://github.com/microsoft/vcpkg/pull/10840) [imgui-sfml] Force imgui-sfml to be a static library + +- gdcm `3.0.4` -> `3.0.5` + - [(#11258)](https://github.com/microsoft/vcpkg/pull/11258) [gdcm] Update to version 3.0.5 + +- opengl `0.0-5` -> `0.0-6` + - [(#11294)](https://github.com/microsoft/vcpkg/pull/11294) [OpenGL] Fix lib files copy when VCPKG_BUILD_TYPE is set + +- libmysql `8.0.4-7` -> `8.0.20` + - [(#11303)](https://github.com/microsoft/vcpkg/pull/11303) [libmysql] Update to 8.0.20 + +- libodb-mysql `2.4.0-6` -> `2.4.0-7` + - [(#11303)](https://github.com/microsoft/vcpkg/pull/11303) [libmysql] Update to 8.0.20 + +- ogre-next `2019-10-20` -> `2019-10-20-1` + - [(#11325)](https://github.com/microsoft/vcpkg/pull/11325) [ogre/ogre-next] Add conflict error message + +- ogre `1.12.1` -> `1.12.1-1` + - [(#11325)](https://github.com/microsoft/vcpkg/pull/11325) [ogre/ogre-next] Add conflict error message + +- paho-mqttpp3 `1.0.1-3` -> `1.1` + - [(#11327)](https://github.com/microsoft/vcpkg/pull/11327) [paho-mqttpp3] update to 1.1 + +- gsl-lite `0.36.0` -> `0.37.0` + - [(#11351)](https://github.com/microsoft/vcpkg/pull/11351) [gsl-lite] update to 0.37.0 + +- restinio `0.6.6` -> `0.6.8` + - [(#11367)](https://github.com/microsoft/vcpkg/pull/11367) [restinio] update to v.0.6.8 + +- tiff `4.0.10-8` -> `4.0.10-9` + - [(#11364)](https://github.com/microsoft/vcpkg/pull/11364) [tiff] Install runtime deps for tiff[tool] + +- sqlite3 `3.31.1` -> `3.32.1` + - [(#11267)](https://github.com/microsoft/vcpkg/pull/11267) [sqlite3] Enable build for android + - [(#11635)](https://github.com/microsoft/vcpkg/pull/11635) [sqlite3] update to 3.32 + - [(#11716)](https://github.com/microsoft/vcpkg/pull/11716) [sqlite] Updated to 3.32.1 to fix a security vulnerability + +- aws-sdk-cpp `1.7.270` -> `1.7.333` + - [(#11332)](https://github.com/microsoft/vcpkg/pull/11332) [aws-sdk-cpp] Update to 1.7.333 + +- libxml2 `2.9.9-5` -> `2.9.9-6` + - [(#11072)](https://github.com/microsoft/vcpkg/pull/11072) [libxml2] Add iconv and charset linkage in vcpkg-cmake-wrapper on osx + +- libgo `2.8-2` -> `3.1-1` + - [(#11263)](https://github.com/microsoft/vcpkg/pull/11263) [libgo] Update to 3.1 + - [(#11435)](https://github.com/microsoft/vcpkg/pull/11435) [libgo] Update CONTROL file for typo + +- ixwebsocket `9.1.9` -> `9.6.2` + - [(#11030)](https://github.com/microsoft/vcpkg/pull/11030) [ixwebsocket] update to 9.6.2 + +- cpuid `0.4.1` -> `0.4.1-1` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- dmlc `2019-08-12-1` -> `2019-08-12-4` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11612)](https://github.com/microsoft/vcpkg/pull/11612) [vcpkg baseline] Fix baseline failures + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- libnice `0.1.15-2` -> `0.1.15-3` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- magnum `2019.10-1` -> `2019.10-2` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- mlpack `3.2.2-1` -> `3.2.2-3` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11785)](https://github.com/microsoft/vcpkg/pull/11785) [mlpack] Explicitly depend on stb + +- nanodbc `2.12.4-5` -> `2.12.4-8` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11613)](https://github.com/microsoft/vcpkg/pull/11613) [vcpkg-baseline][unixodbc/nanodbc] Fix unixodbc build failure and set it as a dependency on nanodbc + +- osg `3.6.4-2` -> `3.6.4-3` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11715)](https://github.com/microsoft/vcpkg/pull/11715) [osg] Fix conflict when asio and boost-asio are installed. + +- podofo `0.9.6-7` -> `0.9.6-8` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- replxx `0.0.2` -> `0.0.2-2` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + - [(#11571)](https://github.com/microsoft/vcpkg/pull/11571) [replxx] Add missing header needed to name std::runtime_error for replxx. + +- stormlib `2019-05-10` -> `2019-05-10-1` + - [(#10767)](https://github.com/microsoft/vcpkg/pull/10767) [cmake] Update to 3.17.2 + +- parallelstl `20191218` -> `20200330` + - [(#11379)](https://github.com/microsoft/vcpkg/pull/11379) [parallelstl] update to 20200330 + +- angle `2019-12-31-2` -> `2020-05-15` + - [(#11394)](https://github.com/microsoft/vcpkg/pull/11394) [angle] update for gcc 10 compatibility + +- parallel-hashmap `1.30` -> `1.32` + - [(#11420)](https://github.com/microsoft/vcpkg/pull/11420) [parallel-hashmap] Update parallel-hashmap version + +- utfcpp `3.1` -> `3.1.1` + - [(#11426)](https://github.com/microsoft/vcpkg/pull/11426) [utfcpp] Update to 3.1.1 + +- realsense2 `2.33.1-1` -> `2.34.0` + - [(#11437)](https://github.com/microsoft/vcpkg/pull/11437) [realsense2] Update to 2.34.0 + +- grpc `1.27.3` -> `1.28.1-1` + - [(#11449)](https://github.com/microsoft/vcpkg/pull/11449) [grpc] upgrade to 1.28.1 + - [(#10307)](https://github.com/microsoft/vcpkg/pull/10307) [grpc] Add feature absl-sync + +- skia `2020-02-15-1` -> `2020-05-18-1` + - [(#11416)](https://github.com/microsoft/vcpkg/pull/11416) [harfbuzz,skia] Update and replace Skia dependencies with vcpkg + +- fribidi `1.0.9` -> `1.0.9-1` + - [(#11380)](https://github.com/microsoft/vcpkg/pull/11380) [tool-meson] Update to 0.54.2 + +- libepoxy `1.5.3-3` -> `1.5.4` + - [(#11380)](https://github.com/microsoft/vcpkg/pull/11380) [tool-meson] Update to 0.54.2 + - [(#11448)](https://github.com/microsoft/vcpkg/pull/11448) [libepoxy] Update to 1.5.4 + +- tool-meson `0.53.2` -> `0.54.2` + - [(#11380)](https://github.com/microsoft/vcpkg/pull/11380) [tool-meson] Update to 0.54.2 + +- monkeys-audio `5.24` -> `5.38` + - [(#11444)](https://github.com/microsoft/vcpkg/pull/11444) [monkeys-audio] Update to 5.38 + +- clapack `3.2.1-12` -> `3.2.1-13` + - [(#9957)](https://github.com/microsoft/vcpkg/pull/9957) [clapack] Add uwp support + +- fcl `0.6.0` -> `0.6.0-1` + - [(#11406)](https://github.com/microsoft/vcpkg/pull/11406) [fcl] Explicity handle FCL_USE_X64_SSE CMake option + +- farmhash `1.1` -> `1.1-1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- freexl `1.0.4-8` -> `1.0.4-9` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- healpix `1.12.10` -> `1.12.10-1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libb2 `0.98.1` -> `0.98.1-2` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + - [(#11692)](https://github.com/microsoft/vcpkg/pull/11692) [vcpkg baseline] Remove passing port from Ci baseline + +- libcrafter `0.3` -> `0.3-1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libmagic `5.37` -> `5.37-1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libmesh `1.5.0` -> `1.5.0-1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libosip2 `5.1.0-3` -> `5.1.0-4` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libudns `0.4-1` -> `0.4-2` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libwandio `4.2.1` -> `4.2.1-2` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libxslt `1.1.33-6` -> `1.1.33-7` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- pfring `2019-10-17-1` -> `2019-10-17-2` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- sdl1 `1.2.15-10` -> `1.2.15-11` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- tcl `8.6.10-3` -> `core-9-0-a1` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- x264 `157-303c484ec828ed0-7` -> `157-303c484ec828ed0-8` + - [(#10402)](https://github.com/microsoft/vcpkg/pull/10402) [vcpkg] Improve make builds + +- libflac `1.3.3` -> `1.3.3-1` + - [(#11152)](https://github.com/microsoft/vcpkg/pull/11152) [libflac] Update to 1.3.3-1 + +- libsndfile `1.0.29-8` -> `1.0.29-9` + - [(#11152)](https://github.com/microsoft/vcpkg/pull/11152) [libflac] Update to 1.3.3-1 + +- octomap `2017-03-11-7` -> `2017-03-11-8` + - [(#11408)](https://github.com/microsoft/vcpkg/pull/11408) [octomap] Cleanup + +- freeglut `3.0.0-9` -> `3.2.1-1` + - [(#11423)](https://github.com/microsoft/vcpkg/pull/11423) [freeglut] updated to 3.2.1 + - [(#11527)](https://github.com/microsoft/vcpkg/pull/11527) [freeglut] fix debug macro patch + +- libpqxx `6.4.5-2` -> `6.4.5-3` + - [(#11442)](https://github.com/microsoft/vcpkg/pull/11442) [libpqxx] linux support + +- marl `2019-09-13` -> `2020-05-21` + - [(#11465)](https://github.com/microsoft/vcpkg/pull/11465) [marl] Update to 2020-05-20 + +- python3 `3.7.3-2` -> `3.8.3` + - [(#11489)](https://github.com/microsoft/vcpkg/pull/11489) [python3] Fix dynamic build error on Linux + - [(#11708)](https://github.com/microsoft/vcpkg/pull/11708) [python3] Update to Python 3.8 + +- azure-storage-cpp `7.3.0` -> `7.4.0` + - [(#11510)](https://github.com/microsoft/vcpkg/pull/11510) [azure-storage-cpp] Upgrade to 7.4.0 + +- entt `3.3.2` -> `3.4.0` + - [(#11509)](https://github.com/microsoft/vcpkg/pull/11509) [entt] Update to 3.4.0 (#11507) + +- wil `2019-11-07` -> `2020-05-19` + - [(#11506)](https://github.com/microsoft/vcpkg/pull/11506) [wil] Update to 2020-05-19 + +- signalrclient `1.0.0-beta1-8` -> `1.0.0-beta1-9` + - [(#11496)](https://github.com/microsoft/vcpkg/pull/11496) [Baseline] Fix boost-*:arm-uwp failure and resolve conflicts in CI + +- bond `8.1.0-3` -> `9.0.0` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + - [(#11628)](https://github.com/microsoft/vcpkg/pull/11628) [bond] Update to 9.0.0 + - [(#10319)](https://github.com/microsoft/vcpkg/pull/10319) [bond] updated version + added bond-over-grpc integration as feature + +- ccfits `2.5-4` -> `2.5-5` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- geographiclib `1.47-patch1-10` -> `1.47-patch1-12` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- libaiff `5.0-2` -> `5.0-3` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- ois `1.5` -> `1.5-1` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- wtl `10.0-4` -> `10.0-5` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- xmsh `0.5.2` -> `0.5.2-1` + - [(#11559)](https://github.com/microsoft/vcpkg/pull/11559) [VCPKG baseline] Fix many ports + +- xmlsec `1.2.29-2` -> `1.2.30` + - [(#11595)](https://github.com/microsoft/vcpkg/pull/11595) [Xmlsec] Update to 1.2.30 + +- activemq-cpp `3.9.5-1` -> `3.9.5-2` + - [(#11589)](https://github.com/microsoft/vcpkg/pull/11589) [libusbmuxd berkeleydb cppcms activemq-cpp] Add Supports and failure message + +- berkeleydb `4.8.30-3` -> `4.8.30-4` + - [(#11589)](https://github.com/microsoft/vcpkg/pull/11589) [libusbmuxd berkeleydb cppcms activemq-cpp] Add Supports and failure message + +- cppcms `1.2.1` -> `1.2.1-1` + - [(#11589)](https://github.com/microsoft/vcpkg/pull/11589) [libusbmuxd berkeleydb cppcms activemq-cpp] Add Supports and failure message + +- libusbmuxd `1.2.185` -> `1.2.185-1` + - [(#11589)](https://github.com/microsoft/vcpkg/pull/11589) [libusbmuxd berkeleydb cppcms activemq-cpp] Add Supports and failure message + +- seal `3.4.5` -> `3.4.5-1` + - [(#11588)](https://github.com/microsoft/vcpkg/pull/11588) [seal] Disable SEAL_USE_MSGSL and add default feature zlib + +- magic-get `2019-09-02` -> `2019-09-02-1` + - [(#11581)](https://github.com/microsoft/vcpkg/pull/11581) [magic-get] Fix improper direct reference to the "downloads" directory + +- lpeg `1.0.1-4` -> `1.0.2-1` + - [(#11554)](https://github.com/microsoft/vcpkg/pull/11554) [luafilesystem][lpeg] Bump versions + +- luafilesystem `1.7.0.2-1` -> `1.8.0-1` + - [(#11554)](https://github.com/microsoft/vcpkg/pull/11554) [luafilesystem][lpeg] Bump versions + +- scnlib `0.1.2` -> `0.3` + - [(#11540)](https://github.com/microsoft/vcpkg/pull/11540) [scnlib] Update to version 0.3 + +- cppgraphqlgen `3.2.1` -> `3.2.2` + - [(#11531)](https://github.com/microsoft/vcpkg/pull/11531) [pegtl/cppgraphqlgen] matching updates for dependency + +- protobuf-c `1.3.2` -> `1.3.2-2` + - [(#11517)](https://github.com/microsoft/vcpkg/pull/11517) [protobuf-c] Fix tool protoc-gen-c crash + - [(#11609)](https://github.com/microsoft/vcpkg/pull/11609) [protobuf-c] Fix wrong dependency for feature test + +- basisu `1.11-3` -> `1.11-4` + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- folly `2019.10.21.00-1` -> `2019.10.21.00-2` + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- gppanel `2018-04-06` -> `2020-05-20` + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- msgpack11 `0.0.10` -> `0.0.10-1` + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- rapidcheck `2018-11-05-1` -> `2018-11-05-2` + - [(#11494)](https://github.com/microsoft/vcpkg/pull/11494) [basisu, gppanel, msgpack11, nana, rapidcheck, folly] Add missing header file of STL + +- simdjson `2019-12-27` -> `2020-05-26` + - [(#11495)](https://github.com/microsoft/vcpkg/pull/11495) [simdjson] Fix error LNK2001 when compile with /fsanitize=address in MSVC + - [(#10709)](https://github.com/microsoft/vcpkg/pull/10709) [simdjson] Update to 0.3.1 + +- ponder `3.0.0` -> `3.0.0-1` + - [(#11582)](https://github.com/microsoft/vcpkg/pull/11582) [ponder] patch missing headers for Visual Studio 2019 16.6 + +- telnetpp `2.0-3` -> `2.0-4` + - [(#11573)](https://github.com/microsoft/vcpkg/pull/11573) [telnetpp] Add missing for Visual Studio 2019 16.6 + +- libpopt `1.16-12` -> `1.16-13` + - [(#11607)](https://github.com/microsoft/vcpkg/pull/11607) [libpopt] Remove invalid URL + +- cpputest `2019-9-16` -> `2019-9-16-1` + - [(#11585)](https://github.com/microsoft/vcpkg/pull/11585) [cpputest] Move library to manual-link + +- unixodbc `2.3.7` -> `2.3.7-1` + - [(#11613)](https://github.com/microsoft/vcpkg/pull/11613) [vcpkg-baseline][unixodbc/nanodbc] Fix unixodbc build failure and set it as a dependency on nanodbc + +- nghttp2 `1.39.2-1` -> `1.39.2-2` + - [(#11638)](https://github.com/microsoft/vcpkg/pull/11638) [nghttp2] Fix to build nghttp2 statically + +- gli `dd17acf` -> `dd17acf-1` + - [(#11634)](https://github.com/microsoft/vcpkg/pull/11634) [gli] Add CMake config support + +- mimalloc `1.6.1` -> `1.6.1-1` + - [(#11632)](https://github.com/microsoft/vcpkg/pull/11632) [mimalloc] Install mimalloc-redirect.dll to CMAKE_INSTALL_BINDIR + +- quickfix `1.15.1-3` -> `1.15.1-4` + - [(#11604)](https://github.com/microsoft/vcpkg/pull/11604) [vcpkg-baseline][quickfix] Fix build failure on arm64-windows + +- zxing-cpp `3.3.3-6` -> `3.3.3-7` + - [(#11586)](https://github.com/microsoft/vcpkg/pull/11586) [vcpkg-baseline][zxing-cpp] Fix build failure + +- ppconsul `0.5` -> `0.5-1` + - [(#11692)](https://github.com/microsoft/vcpkg/pull/11692) [vcpkg baseline] Remove passing port from Ci baseline + +- proj4 `6.3.1` -> `6.3.1-1` + - [(#11692)](https://github.com/microsoft/vcpkg/pull/11692) [vcpkg baseline] Remove passing port from Ci baseline + - [(#11086)](https://github.com/microsoft/vcpkg/pull/11086) [PROJ4] Add search path for sqlite.exe + +- jwt-cpp `2019-05-07-1` -> `0.4.0` + - [(#11625)](https://github.com/microsoft/vcpkg/pull/11625) [jwt-cpp] Update to v0.4.0 + +- polyhook2 `2020-02-17` -> `2020-06-02` + - [(#11561)](https://github.com/microsoft/vcpkg/pull/11561) [polyhook2] Update to 2020-05-25 + - [(#11729)](https://github.com/microsoft/vcpkg/pull/11729) [polyhook2] Update polyhook to latest + +- gdk-pixbuf `2.36.9-4` -> `2.36.9-5` + - [(#11721)](https://github.com/microsoft/vcpkg/pull/11721) [gdk-pixbuf] GdkPixbuf fix for building on macOS + +- yaml-cpp `0.6.2-3` -> `0.6.3` + - [(#11718)](https://github.com/microsoft/vcpkg/pull/11718) [yaml-cpp] Update to 0.6.3 and also fix headers cannot be found + +- fmt `6.2.0` -> `6.2.1` + - [(#11706)](https://github.com/microsoft/vcpkg/pull/11706) [fmt] add vcpkg_fixup_pkgconfig + - [(#11789)](https://github.com/microsoft/vcpkg/pull/11789) [fmt] Update to 6.2.1 + +- magic-enum `0.6.4` -> `0.6.6` + - [(#11704)](https://github.com/microsoft/vcpkg/pull/11704) [magic-enum] Update to v0.6.5 + - [(#11814)](https://github.com/microsoft/vcpkg/pull/11814) [magic-enum] Update to v0.6.6 + +- enet `1.3.13-1` -> `1.3.15` + - [(#11702)](https://github.com/microsoft/vcpkg/pull/11702) [enet] Update to 1.3.15 + +- libfabric `1.8.1` -> `1.8.1-1` + - [(#11647)](https://github.com/microsoft/vcpkg/pull/11647) [vcpkg baseline][libfabric] Only support dynamic build + +- google-cloud-cpp-common `0.25.0` -> `alias` + - [(#11698)](https://github.com/microsoft/vcpkg/pull/11698) [google-cloud-cpp] Consolidate all google-cloud* packages + +- google-cloud-cpp-spanner `1.1.0` -> `alias` + - [(#11698)](https://github.com/microsoft/vcpkg/pull/11698) [google-cloud-cpp] Consolidate all google-cloud* packages + +- google-cloud-cpp `0.21.0` -> `1.14.0` + - [(#11698)](https://github.com/microsoft/vcpkg/pull/11698) [google-cloud-cpp] Consolidate all google-cloud* packages + +- amqpcpp `4.1.5` -> `4.1.7` + - [(#11608)](https://github.com/microsoft/vcpkg/pull/11608) [amqpcpp] Update to 4.1.7 + +- shiva-sfml `1.0` -> `1.0-1` + - [(#11483)](https://github.com/microsoft/vcpkg/pull/11483) [vcpkg] Allow CI to pass in all relevant directories and remove use of symbolic links + +- spirv-tools `2020.1` -> `2020.1-1` + - [(#11483)](https://github.com/microsoft/vcpkg/pull/11483) [vcpkg] Allow CI to pass in all relevant directories and remove use of symbolic links + +- cpp-taskflow `2.2.0` -> `2.2.0-1` + - [(#11742)](https://github.com/microsoft/vcpkg/pull/11742) [vcpkg-baseline][manyport] Fix baseline error + +- eabase `2.09.12` -> `2.09.12-1` + - [(#11742)](https://github.com/microsoft/vcpkg/pull/11742) [vcpkg-baseline][manyport] Fix baseline error + +- fastrtps `1.5.0-2` -> `1.5.0-3` + - [(#11742)](https://github.com/microsoft/vcpkg/pull/11742) [vcpkg-baseline][manyport] Fix baseline error + +- librsvg `2.40.20` -> `2.40.20-2` + - [(#11722)](https://github.com/microsoft/vcpkg/pull/11722) [librsvg] Fix for macOS + - [(#11865)](https://github.com/microsoft/vcpkg/pull/11865) [vcpkg baseline] Fix baseline + +- mozjpeg `3.2-3` -> `2020-06-02` + - [(#11719)](https://github.com/microsoft/vcpkg/pull/11719) [mozjpeg] Update to latest commit + +- pcre `8.44` -> `8.44-1` + - [(#11564)](https://github.com/microsoft/vcpkg/pull/11564) [pcre] Add pkgconfig files + +- tensorflow-cc `1.14-1` -> `1.14-2` + - [(#11839)](https://github.com/microsoft/vcpkg/pull/11839) [vcpkg] Fix OSX CI by ensuring the downloads directory exists + +- sqlpp11-connector-mysql `0.29` -> `0.29-1` + - [(#11771)](https://github.com/microsoft/vcpkg/pull/11771) [sqlpp11] update to v0.59 + +- sqlpp11 `0.58-3` -> `0.59` + - [(#11771)](https://github.com/microsoft/vcpkg/pull/11771) [sqlpp11] update to v0.59 + +- unicorn-lib `2019-07-11` -> `2020-03-02` + - [(#11830)](https://github.com/microsoft/vcpkg/pull/11830) [unicorn-lib] Update to 01cc7fc (2020-03-02) + +- sol2 `3.2.0` -> `3.2.1` + - [(#11826)](https://github.com/microsoft/vcpkg/pull/11826) [sol] Update to version 3.2.1 + +- avisynthplus `3.5.0` -> `3.6.0` + - [(#11736)](https://github.com/microsoft/vcpkg/pull/11736) [avisynthplus] Upgrade to 3.6.0 + +- plibsys `0.0.4-2` -> `0.0.4-3` + - [(#11633)](https://github.com/microsoft/vcpkg/pull/11633) [plibsys] Fix failures on linux and osx + +- libxmp-lite `4.4.1-2` -> `4.4.1-3` + - [(#11865)](https://github.com/microsoft/vcpkg/pull/11865) [vcpkg baseline] Fix baseline + +- msix `1.7` -> `1.7-2` + - [(#11865)](https://github.com/microsoft/vcpkg/pull/11865) [vcpkg baseline] Fix baseline + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- usd `20.02` -> `20.02-1` + - [(#11440)](https://github.com/microsoft/vcpkg/pull/11440) [usd] Fix build error on Linux + +- cryptopp `8.2.0-1` -> `8.2.0-2` + - [(#11711)](https://github.com/microsoft/vcpkg/pull/11711) [licensepp] Add new port + +- libpcap `1.9.1` -> `1.9.1-2` + - [(#9426)](https://github.com/microsoft/vcpkg/pull/9426) [libpcap] Fix pkgconfig libs and include path + - [(#10731)](https://github.com/microsoft/vcpkg/pull/10731) [libpcap] Enable compilation of libpcap port on x86-windows and x64-windows + +- ms-angle `2018-04-18-2` -> `alias` + - [(#11458)](https://github.com/microsoft/vcpkg/pull/11458) [ms-angle] Set ms-angle to empty package + +- libgit2 `1.0.0` -> `1.0.1` + - [(#11844)](https://github.com/microsoft/vcpkg/pull/11844) [libgit2] Update to 1.0.1 + +- uwebsockets `0.17.2` -> `18.1.0` + - [(#11866)](https://github.com/microsoft/vcpkg/pull/11866) [uWbSockets] Update to 18.1.0 + +- nameof `0.9.3` -> `0.9.4` + - [(#11815)](https://github.com/microsoft/vcpkg/pull/11815) [nameof] Update to 0.9.4 + +- cairo `1.16.0-3` -> `1.16.0-4` + - [(#11868)](https://github.com/microsoft/vcpkg/pull/11868) [cairo] Install the xlib header file when selecting feature x11 + +- directxmesh `dec2019-1` -> `jun2020` + - [(#11794)](https://github.com/microsoft/vcpkg/pull/11794) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- directxtex `dec2019` -> `jun2020` + - [(#11794)](https://github.com/microsoft/vcpkg/pull/11794) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- directxtk `2019-12-31` -> `jun2020` + - [(#11794)](https://github.com/microsoft/vcpkg/pull/11794) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- directxtk12 `dec2019` -> `jun2020` + - [(#11794)](https://github.com/microsoft/vcpkg/pull/11794) [directxtk][directxtk12][directxtex][directxmesh] Update to latest version + +- spdlog `1.4.2-1` -> `1.6.1` + - [(#11793)](https://github.com/microsoft/vcpkg/pull/11793) [spdlog] Update to 1.61 + +- msmpi `10.0-2` -> `10.1` + - [(#11365)](https://github.com/microsoft/vcpkg/pull/11365) [vcpkg] [cudnn] [msmpi] [openmpi] Update VMSS + +- openmpi `4.0.1` -> `4.0.3` + - [(#11365)](https://github.com/microsoft/vcpkg/pull/11365) [vcpkg] [cudnn] [msmpi] [openmpi] Update VMSS + +- sdl2 `2.0.12` -> `2.0.12-1` + - [(#11365)](https://github.com/microsoft/vcpkg/pull/11365) [vcpkg] [cudnn] [msmpi] [openmpi] Update VMSS + +- gtk `3.22.19-3` -> `3.22.19-4` + - [(#11892)](https://github.com/microsoft/vcpkg/pull/11892) [gtk] DISABLE_PARALLEL_CONFIGURE + +- xalan-c `1.11-11` -> `1.11-12` + - [(#11869)](https://github.com/microsoft/vcpkg/pull/11869) [xalan-c] Fix import Xalan.exe + +- libuuid `1.0.3-3` -> `1.0.3-4` + - [(#11849)](https://github.com/microsoft/vcpkg/pull/11849) [libuuid] Install uuid.pc file + +- lastools `2019-07-10` -> `2020-05-09` + - [(#11796)](https://github.com/microsoft/vcpkg/pull/11796) [LAStools] Update to 200509 + +- libpmemobj-cpp `1.8` -> `1.10` + - [(#11738)](https://github.com/microsoft/vcpkg/pull/11738) [libpmemobj-cpp] Update to 1.10 + +- librabbitmq `0.10.0` -> `2020-06-03` + - [(#11733)](https://github.com/microsoft/vcpkg/pull/11733) [librabbitmq] Update to use rabbitmq-config.cmake + +- hyperscan `5.2.1` -> `5.2.1-1` + - [(#11708)](https://github.com/microsoft/vcpkg/pull/11708) [python3] Update to Python 3.8 + +- tinyxml2 `7.1.0` -> `8.0.0` + - [(#11616)](https://github.com/microsoft/vcpkg/pull/11616) [tinyxml2] Update to 8.0.0; avoid exporting symbols when building static libraries + +- winpcap `4.1.3-2` -> `4.1.3-3` + - [(#10731)](https://github.com/microsoft/vcpkg/pull/10731) [libpcap] Enable compilation of libpcap port on x86-windows and x64-windows + +- ccd `2.1-3` -> `2.1-4` + - [(#11407)](https://github.com/microsoft/vcpkg/pull/11407) [ccd] Add emscripten support + +- itpp `4.3.1-1` -> `4.3.1-2` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- plplot `5.13.0-4` -> `5.13.0-5` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- pthreads `3.0.0-4` -> `3.0.0-5` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- qwt `6.1.3-10` -> `6.1.3-11` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- soundtouch `2.0.0-4` -> `2.0.0-6` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- tclap `1.2.2-1` -> `1.2.2-2` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- tinyfiledialogs `3.4.3-1` -> `3.4.3-2` + - [(#11896)](https://github.com/microsoft/vcpkg/pull/11896) [vcpkg baseline] Fix baseline error + +- mpir `3.0.0-7` -> `3.0.0-8` + - [(#9205)](https://github.com/microsoft/vcpkg/pull/9205) [mpir] Add mpirxx.lib + +- fftw3 `3.3.8-6` -> `3.3.8-7` + - [(#4361)](https://github.com/microsoft/vcpkg/pull/4361) Adds vcpkg item to project settings in Visual Studio + +
+ +-- vcpkg team vcpkg@microsoft.com MON, 16 June 1400:00 -0700 + +vcpkg (2020.04.01 - 2020.04.20) +--- +#### Total port count: 1322 + +#### Total port count per triplet (tested): +|triplet|ports available| +|---|---| +|**x64-windows**|1218| +|x86-windows|1202| +|x64-windows-static|1130| +|**x64-linux**|1104| +|**x64-osx**|1041| +|arm64-windows|842| +|x64-uwp|654| +|arm-uwp|625| + +#### The following documentation has been updated: +- [vcpkg_from_git](docs/maintainers/vcpkg_from_git.md) + - [(#9446)](https://github.com/microsoft/vcpkg/pull/9446) vcpkg_from_git: Add support for git over ssh (by @marcrambo) +- [Exporting to Android Archives (AAR files)](docs/specifications/prefab.md) ***[NEW]*** + - [(#10271)](https://github.com/microsoft/vcpkg/pull/10271) Android Support: Exporting to Android Archive (AAR) (by @atkawa7) +- [Triplets](docs/users/triplets.md) + - [(#6275)](https://github.com/microsoft/vcpkg/pull/6275) Add initial iOS support (by @alcroito) + +#### The following *remarkable* changes have been made to vcpkg: +- [(#9446)](https://github.com/microsoft/vcpkg/pull/9446) vcpkg_from_git: Add support for git over ssh (by @marcrambo) +- [(#10271)](https://github.com/microsoft/vcpkg/pull/10271) Android Support: Exporting to Android Archive (AAR) (by @atkawa7) +- [(#10395)](https://github.com/microsoft/vcpkg/pull/10395) [vcpkg] Make configure meson sane and work for all targets. (by @Neumann-A) +- [(#10398)](https://github.com/microsoft/vcpkg/pull/10398) [vcpkg] New policy: SKIP_ARCHITECTURE_CHECK. (by @Neumann-A) +- [(#6275)](https://github.com/microsoft/vcpkg/pull/6275) Add initial iOS support (by @alcroito) +- [(#10817)](https://github.com/microsoft/vcpkg/pull/10817) [vcpkg] Add x-set-installed command (by @strega-nil) +- [(#10521)](https://github.com/microsoft/vcpkg/pull/10521) [vcpkg] Add initial JSON support (by @strega-nil) + +#### The following *additional* changes have been made to vcpkg: +- [(#10637)](https://github.com/microsoft/vcpkg/pull/10637) [vcpkg baseline] Ignore osg-qt (by @PhoebeHui) +- [(#10660)](https://github.com/microsoft/vcpkg/pull/10660) [vcpkg] Fix spec instance name (by @PhoebeHui) +- [(#10703)](https://github.com/microsoft/vcpkg/pull/10703) [vcpkg baseline] Remove replxx:x86-windows=fail (by @strega-nil) +- [(#10655)](https://github.com/microsoft/vcpkg/pull/10655) [vcpkg] Fix nuget/aria2/ninja version/filename inconsistent (by @LilyWangL) +- [(#10583)](https://github.com/microsoft/vcpkg/pull/10583) [vcpkg] Correct UInt128 code 😇 (by @strega-nil) +- [(#10543)](https://github.com/microsoft/vcpkg/pull/10543) [vcpkg-test] Fix the check for ability to make symlinks (by @strega-nil) +- [(#10621)](https://github.com/microsoft/vcpkg/pull/10621) [vcpkg] fix vcpkg_find_acquire_program for scripts (by @Neumann-A) +- [(#10834)](https://github.com/microsoft/vcpkg/pull/10834) [vcpkg] Clean up CMake build system (by @strega-nil) +- [(#10846)](https://github.com/microsoft/vcpkg/pull/10846) [vcpkg] Fix bootstrap from out of directory (by @strega-nil) +- [(#10796)](https://github.com/microsoft/vcpkg/pull/10796) [Ninja] Update to 1.10 (by @Voskrese) +- [(#10867)](https://github.com/microsoft/vcpkg/pull/10867) [vcpkg] Fix build scripts on openSUSE and g++9 (by @strega-nil) + +
+The following 5 ports have been added: + +|port|version| +|---|---| +|[skyr-url](https://github.com/microsoft/vcpkg/pull/10463)[#10694](https://github.com/microsoft/vcpkg/pull/10694) | 1.5.1 +|[boringssl](https://github.com/microsoft/vcpkg/pull/8455)| 2020-04-07 +|[quadtree](https://github.com/microsoft/vcpkg/pull/10787)| 2020-04-13 +|[avisynthplus](https://github.com/microsoft/vcpkg/pull/10496)| 3.5.0 +|[c4core](https://github.com/microsoft/vcpkg/pull/10791)| 2020-04-12 +
+ +
+The following 69 ports have been updated: + +- cub `1.8.0` -> `1.8.0-1` + - [(#10660)](https://github.com/microsoft/vcpkg/pull/10660) [vcpkg] Fix spec instance name + +- vulkan-hpp `2019-05-11` -> `2019-05-11-1` + - [(#10660)](https://github.com/microsoft/vcpkg/pull/10660) [vcpkg] Fix spec instance name + +- function2 `4.0.0` -> `4.1.0` + - [(#10666)](https://github.com/microsoft/vcpkg/pull/10666) [function2] Update to version 4.1.0 + +- libwebsockets `3.2.2-1` -> `4.0.1-1` + - [(#10658)](https://github.com/microsoft/vcpkg/pull/10658) [libwebsockets] Update to 4.0.1 + - [(#10636)](https://github.com/microsoft/vcpkg/pull/10636) [mosquitto] Add support for static build + +- googleapis `0.6.0` -> `0.8.0` + - [(#10651)](https://github.com/microsoft/vcpkg/pull/10651) [googleapis] upgrade to v0.7.0 release + - [(#10885)](https://github.com/microsoft/vcpkg/pull/10885) [googleapis] Update to v0.8.0 + +- ixwebsocket `8.0.5` -> `9.1.9` + - [(#10633)](https://github.com/microsoft/vcpkg/pull/10633) [ixwebsocket] Update to 9.1.9 + +- opus `1.3.1` -> `1.3.1-2` + - [(#10634)](https://github.com/microsoft/vcpkg/pull/10634) [opus] Make AVX an optional feature + +- freerdp `2.0.0-rc4-6` -> `2.0.0-rc4-7` + - [(#10630)](https://github.com/microsoft/vcpkg/pull/10630) [freerdp] Fix include paths and output + +- openvr `1.9.16` -> `1.10.30` + - [(#10629)](https://github.com/microsoft/vcpkg/pull/10629) [openvr] Added Linux support and updated to v1.10.30 + +- abseil `2020-03-03-1` -> `2020-03-03-3` + - [(#10620)](https://github.com/microsoft/vcpkg/pull/10620) [abseil] Fix feature name error + - [(#10721)](https://github.com/microsoft/vcpkg/pull/10721) [abseil] Fix CompressedTuple move constructor on MSVC + +- reproc `11.0.1` -> `12.0.0` + - [(#10594)](https://github.com/microsoft/vcpkg/pull/10594) [reproc] Update to version 12.0.0 + +- hunspell `1.7.0` -> `1.7.0-1` + - [(#10574)](https://github.com/microsoft/vcpkg/pull/10574) [hunspell] Disable build tools in non-Windows + +- sciter `4.4.0.7` -> `4.4.1.5` + - [(#10071)](https://github.com/microsoft/vcpkg/pull/10071) [sciter] Update to 4.4.1.5 + +- qt5-base `5.12.5-11` -> `5.12.5-13` + - [(#10641)](https://github.com/microsoft/vcpkg/pull/10641) [qt5-base] Fix EGL absolute path on Linux + - [(#10746)](https://github.com/microsoft/vcpkg/pull/10746) [qt5] fix some remaining absolute paths. + - [(#9705)](https://github.com/microsoft/vcpkg/pull/9705) [qt5-base, qt5-imageformat] fix issues on osx + +- nana `1.7.2` -> `1.7.2-1` + - [(#10605)](https://github.com/microsoft/vcpkg/pull/10605) [nana] Add Xorg dependency libxcursor-dev and modify deprecated functions + +- blend2d `beta_2019-12-27` -> `beta_2020-04-15` + - [(#10600)](https://github.com/microsoft/vcpkg/pull/10600) [blend2d] Update to beta_2020-03-29 + - [(#10844)](https://github.com/microsoft/vcpkg/pull/10844) [blend2d] Update to beta_2020-04-15 + +- libffi `3.3` -> `3.3-2` + - [(#10485)](https://github.com/microsoft/vcpkg/pull/10485) [libffi] Support arm/arm64 + - [(#10469)](https://github.com/microsoft/vcpkg/pull/10469) [libffi] Check return value of execute_process() + +- fribidi `2019-02-04-2` -> `2019-02-04-3` + - [(#10395)](https://github.com/microsoft/vcpkg/pull/10395) [vcpkg] Make configure meson sane and work for all targets. + - [(#10713)](https://github.com/microsoft/vcpkg/pull/10713) [fribidi] Updated to v1.0.9 + +- libepoxy `1.5.3-2` -> `1.5.3-3` + - [(#10395)](https://github.com/microsoft/vcpkg/pull/10395) [vcpkg] Make configure meson sane and work for all targets. + +- egl-registry `2019-08-08` -> `2020-02-03` + - [(#9965)](https://github.com/microsoft/vcpkg/pull/9965) [angle] Improve port + +- glad `0.1.33` -> `0.1.33-1` + - [(#9965)](https://github.com/microsoft/vcpkg/pull/9965) [angle] Improve port + +- opengl-registry `2019-08-22` -> `2020-02-03` + - [(#9965)](https://github.com/microsoft/vcpkg/pull/9965) [angle] Improve port + +- mpfr `4.0.2-1` -> `4.0.2-2` + - [(#10035)](https://github.com/microsoft/vcpkg/pull/10035) [mpfr] Add mirror for mpfr at gnu.org + +- google-cloud-cpp-common `0.21.0` -> `0.25.0` + - [(#10680)](https://github.com/microsoft/vcpkg/pull/10680) [google-cloud-cpp*] update to the latest release + +- google-cloud-cpp-spanner `0.9.0` -> `1.1.0` + - [(#10680)](https://github.com/microsoft/vcpkg/pull/10680) [google-cloud-cpp*] update to the latest release + +- google-cloud-cpp `0.20.0` -> `0.21.0` + - [(#10680)](https://github.com/microsoft/vcpkg/pull/10680) [google-cloud-cpp*] update to the latest release + +- jsoncons `0.149.0` -> `0.150.0` + - [(#10688)](https://github.com/microsoft/vcpkg/pull/10688) [jsoncons] update to v0.150.0 + +- osg-qt `Qt4` -> `Qt4-1` + - [(#9705)](https://github.com/microsoft/vcpkg/pull/9705) [qt5-base, qt5-imageformat] fix issues on osx + +- qt5-imageformats `5.12.5-2` -> `5.12.5-3` + - [(#9705)](https://github.com/microsoft/vcpkg/pull/9705) [qt5-base, qt5-imageformat] fix issues on osx + +- libpng `1.6.37-6` -> `1.6.37-7` + - [(#6275)](https://github.com/microsoft/vcpkg/pull/6275) Add initial iOS support + +- pcre2 `10.30-6` -> `10.30-7` + - [(#6275)](https://github.com/microsoft/vcpkg/pull/6275) Add initial iOS support + +- curlpp `2018-06-15-2` -> `2018-06-15-3` + - [(#10535)](https://github.com/microsoft/vcpkg/pull/10535) [curlpp] Fix target "curlpp" link "ZLIB::ZLIB" error + +- avro-c `1.9.2` -> `1.9.2-1` + - [(#10514)](https://github.com/microsoft/vcpkg/pull/10514) [avro-c] Fix building avro-c in Linux + +- nlohmann-fifo-map `2018.05.07` -> `2018.05.07-1` + - [(#10850)](https://github.com/microsoft/vcpkg/pull/10850) [nlohmann-fifo-map] Fix could not find a package "nlohmann-fifo-map" + +- cppitertools `2019-04-14-3` -> `2.0` + - [(#10848)](https://github.com/microsoft/vcpkg/pull/10848) [cppitertools] Update to version 2.0 + +- python3 `3.7.3-1` -> `3.7.3-2` + - [(#10841)](https://github.com/microsoft/vcpkg/pull/10841) [python3] fix build on macOS and linux + +- restinio `0.6.5` -> `0.6.6` + - [(#10813)](https://github.com/microsoft/vcpkg/pull/10813) [restinio] Updated to v.0.6.6 + +- libgit2 `0.99.0-1` -> `1.0.0` + - [(#10807)](https://github.com/microsoft/vcpkg/pull/10807) [libgit2] Upgrade to 1.0.0 + +- zstd `1.4.4` -> `1.4.4-1` + - [(#10815)](https://github.com/microsoft/vcpkg/pull/10815) [zstd] export zstd-config.cmake + +- blosc `1.17.1` -> `1.18.1-1` + - [(#10816)](https://github.com/microsoft/vcpkg/pull/10816) [blosc] Update to 1.18.1 + +- freetype `2.10.1-5` -> `2.10.1-6` + - [(#10835)](https://github.com/microsoft/vcpkg/pull/10835) [Freetype] Actually prevent linking HarfBuzz on POSIX + +- gsl `2.4-5` -> `2.6` + - [(#10758)](https://github.com/microsoft/vcpkg/pull/10758) [gsl] update to 2.6 + +- physfs `3.0.2-1` -> `3.0.2-2` + - [(#10781)](https://github.com/microsoft/vcpkg/pull/10781) [physfs] mirror url + +- openssl-windows `1.1.1d-1` -> `1.1.1d-2` + - [(#10743)](https://github.com/microsoft/vcpkg/pull/10743) [openssl-windows] Avoid to install docs for openssl-windows + +- coolprop `6.1.0-4` -> `6.1.0-5` + - [(#10755)](https://github.com/microsoft/vcpkg/pull/10755) [fmt] update to 6.2.0 + +- fmt `6.1.2` -> `6.2.0` + - [(#10755)](https://github.com/microsoft/vcpkg/pull/10755) [fmt] update to 6.2.0 + +- directxmesh `dec2019` -> `dec2019-1` + - [(#10739)](https://github.com/microsoft/vcpkg/pull/10739) [DirectXMesh] Add support build for DirectX12 + +- libvorbis `1.3.6-9eadecc-3` -> `1.3.6-4d963fe` + - [(#10756)](https://github.com/microsoft/vcpkg/pull/10756) [libvorbis] Update to latest commit + +- nuspell `3.0.0` -> `3.1.0` + - [(#10737)](https://github.com/microsoft/vcpkg/pull/10737) [nuspell] update port to v3.1.0 + +- raylib `2.6.0` -> `3.0.0` + - [(#10722)](https://github.com/microsoft/vcpkg/pull/10722) [raylib] Update to 3.0.0 + +- entt `3.3.0` -> `3.3.2` + - [(#10672)](https://github.com/microsoft/vcpkg/pull/10672) [entt] Update to version 3.3.2 + +- indicators `1.5` -> `1.7` + - [(#10685)](https://github.com/microsoft/vcpkg/pull/10685) [indicators] Updated indicators to 1.7 + +- realsense2 `2.33.1` -> `2.33.1-1` + - [(#10673)](https://github.com/microsoft/vcpkg/pull/10673) [realsense2] Add tm2 feature for support T265 devices + +- flatbuffers `1.11.0-1` -> `1.12.0` + - [(#10664)](https://github.com/microsoft/vcpkg/pull/10664) [flatbuffers] Update to 1.12.0 + +- curl `7.68.0-2` -> `7.68.0-3` + - [(#10659)](https://github.com/microsoft/vcpkg/pull/10659) [curl] Fix cmake configure error + +- ismrmrd `1.4.1` -> `1.4.2` + - [(#10618)](https://github.com/microsoft/vcpkg/pull/10618) [ismrmrd] updated to version 1.4.2 + +- mosquitto `1.6.8` -> `1.6.8-1` + - [(#10636)](https://github.com/microsoft/vcpkg/pull/10636) [mosquitto] Add support for static build + +- lz4 `1.9.2` -> `1.9.2-1` + - [(#10452)](https://github.com/microsoft/vcpkg/pull/10452) [lz4] Fix for building Linux shared libraries + +- sdl2 `2.0.10-3` -> `2.0.12` + - [(#10500)](https://github.com/microsoft/vcpkg/pull/10500) [sdl2] Update to 2.0.12 version + +- osg `3.6.4-1` -> `3.6.4-2` + - [(#10082)](https://github.com/microsoft/vcpkg/pull/10082) [osg] Add feature examples and plugins, fix configure options + +- osgearth `2.10.2` -> `2.10.2-1` + - [(#10082)](https://github.com/microsoft/vcpkg/pull/10082) [osg] Add feature examples and plugins, fix configure options + +- ms-gsl `2.1.0` -> `3.0.0` + - [(#10872)](https://github.com/microsoft/vcpkg/pull/10872) [ms-gsl] Update version to v3.0.0 + - [(#10831)](https://github.com/microsoft/vcpkg/pull/10831) [ms-gsl] Update to v3.0.0 + +- cppgraphqlgen `3.2.0` -> `3.2.1` + - [(#10869)](https://github.com/microsoft/vcpkg/pull/10869) [cppgraphqlgen] Update to v3.2.1 + +- cgal `5.0.2` -> `5.0.2-1` + - [(#10879)](https://github.com/microsoft/vcpkg/pull/10879) [cgal] Add dependency boost-interval + +- arrow `0.16.0` -> `0.17.0` + - [(#10883)](https://github.com/microsoft/vcpkg/pull/10883) [Arrow] Update to 0.17 + +- xerces-c `3.2.2-13` -> `3.2.3` + - [(#10779)](https://github.com/microsoft/vcpkg/pull/10779) [xerces-c] Update to version 3.2.3 + +- libarchive `3.4.1` -> `3.4.1-1` + - [(#10769)](https://github.com/microsoft/vcpkg/pull/10769) [libarchive, libuv]Fix static linkage + +- libuv `1.34.2` -> `1.34.2-1` + - [(#10769)](https://github.com/microsoft/vcpkg/pull/10769) [libarchive, libuv]Fix static linkage + +- qscintilla `2.10-11` -> `2.11.4-1` + - [(#10511)](https://github.com/microsoft/vcpkg/pull/10511) [qscintilla] Update to 2.11.4 + +
+ +-- vcpkg team vcpkg@microsoft.com MON, 20 April 15:00:00 -0700 + + vcpkg (2020.01.31) --- #### Total port count: 1295 diff --git a/README.md b/README.md index bf8d3bc146a706..f3e19058477270 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,400 @@ -# Vcpkg +# Vcpkg: Overview +[中文总览](README_zh_CN.md) -## Overview -Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constantly evolving; your involvement is vital to its success! +Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. +This tool and ecosystem are constantly evolving, and we always appreciate contributions! -For short description of available commands, run `vcpkg help`. +If you've never used vcpkg before, or if you're trying to figure out how to use vcpkg, +check out our [Getting Started](#getting-started) section for how to start using vcpkg. + +For short description of available commands, once you've installed vcpkg, +you can run `vcpkg help`, or `vcpkg help [command]` for command-specific help. * Github: [https://github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg) -* Slack: [https://cpplang.now.sh/](https://cpplang.now.sh/), the #vcpkg channel +* Slack: [https://cppalliance.org/slack/](https://cppalliance.org/slack/), the #vcpkg channel +* Discord: [\#include \](https://www.includecpp.org), the #🌏vcpkg channel * Docs: [Documentation](docs/index.md) -| Windows (x86, x64, arm, uwp) | MacOS | Linux | -| ------------- | ------------- | ------------- | -| [![Build Status](https://dev.azure.com/vcpkg/public/_apis/build/status/vcpkg-Windows-master-CI?branchName=master)](https://dev.azure.com/vcpkg/public/_build/latest?definitionId=9&branchName=master) | [![Build Status](https://dev.azure.com/vcpkg/public/_apis/build/status/vcpkg-osx-master-CI?branchName=master)](https://dev.azure.com/vcpkg/public/_build/latest?definitionId=11&branchName=master) | [![Build Status](https://dev.azure.com/vcpkg/public/_apis/build/status/vcpkg-Linux-master-CI?branchName=master)](https://dev.azure.com/vcpkg/public/_build/latest?definitionId=6&branchName=master) | +[![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) +- [Table of Contents](#table-of-contents) +- [Getting Started](#getting-started) + - [Quick Start: Windows](#quick-start-windows) + - [Quick Start: Unix](#quick-start-unix) + - [Installing Linux Developer Tools](#installing-linux-developer-tools) + - [Installing macOS Developer Tools](#installing-macos-developer-tools) + - [Installing GCC for macOS before 10.15](#installing-gcc-for-macos-before-1015) + - [Using vcpkg with CMake](#using-vcpkg-with-cmake) + - [Visual Studio Code with CMake Tools](#visual-studio-code-with-cmake-tools) + - [Vcpkg with Visual Studio CMake Projects](#vcpkg-with-visual-studio-cmake-projects) + - [Vcpkg with CLion](#vcpkg-with-clion) + - [Vcpkg as a Submodule](#vcpkg-as-a-submodule) + - [Quick Start: Manifests](#quick-start-manifests) +- [Tab-Completion/Auto-Completion](#tab-completionauto-completion) +- [Examples](#examples) +- [Contributing](#contributing) +- [License](#license) +- [Telemetry](#telemetry) + +# Getting Started + +First, follow the quick start guide for either +[Windows](#quick-start-windows), or [macOS and Linux](#quick-start-unix), +depending on what you're using. + +For more information, see [Installing and Using Packages][getting-started:using-a-package]. +If a library you need is not present in the vcpkg catalog, +you can [open an issue on the GitHub repo][contributing:submit-issue] +where the vcpkg team and community can see it, +and potentially add the port to vcpkg. + +After you've gotten vcpkg installed and working, +you may wish to add [tab completion](#tab-completionauto-completion) to your shell. + +Finally, if you're interested in the future of vcpkg, +check out the [manifest](#quick-start-manifest) guide! +This is an experimental feature and will likely have bugs, +so try it out and [open all the issues][contributing:submit-issue]! + +## Quick Start: Windows -## Quick Start Prerequisites: -- Windows 10, 8.1, 7, Linux, or MacOS -- Visual Studio 2015 Update 3 or newer (on Windows) -- Git -- gcc >= 7 or equivalent clang (on Linux) -- *Optional:* CMake 3.12.4 +- Windows 7 or newer +- [Git][getting-started:git] +- [Visual Studio][getting-started:visual-studio] 2015 Update 3 or greater with the English language pack + +First, download and bootstrap vcpkg itself; it can be installed anywhere, +but generally we recommend using vcpkg as a submodule for CMake projects, +and installing it globally for Visual Studio projects. +We recommend somewhere like `C:\src\vcpkg` or `C:\dev\vcpkg`, +since otherwise you may run into path issues for some port build systems. + +```cmd +> git clone https://github.com/microsoft/vcpkg +> .\vcpkg\bootstrap-vcpkg.bat +``` + +To install the libraries for your project, run: + +```cmd +> .\vcpkg\vcpkg install [packages to install] +``` + +You can also search for the libraries you need with the `search` subcommand: + +```cmd +> .\vcpkg\vcpkg search [search term] +``` + +In order to use vcpkg with Visual Studio, +run the following command (may require administrator elevation): + +```cmd +> .\vcpkg\vcpkg integrate install +``` + +After this, you can now create a New non-CMake Project (or open an existing one). +All installed libraries are immediately ready to be `#include`'d and used +in your project without additional configuration. + +If you're using CMake with Visual Studio, +continue [here](#vcpkg-with-visual-studio-cmake-projects). + +In order to use vcpkg with CMake outside of an IDE, +you can use the toolchain file: -To get started: +```cmd +> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake +> cmake --build [build directory] ``` -> git clone https://github.com/Microsoft/vcpkg.git -> cd vcpkg -PS> .\bootstrap-vcpkg.bat -Linux:~/$ ./bootstrap-vcpkg.sh +With CMake, you will still need to `find_package` and the like to use the libraries. +Check out the [CMake section](#using-vcpkg-with-cmake) for more information, +including on using CMake with an IDE. + +For any other tools, including Visual Studio Code, +check out the [integration guide][getting-started:integration]. + +## Quick Start: Unix + +Prerequisites for Linux: +- [Git][getting-started:git] +- [g++][getting-started:linux-gcc] >= 6 + +Prerequisites for macOS: +- [Apple Developer Tools][getting-started:macos-dev-tools] +- On macOS 10.14 or below, you will also need: + - [Homebrew][getting-started:macos-brew] + - [g++][getting-started:macos-gcc] >= 6 from Homebrew + +First, download and bootstrap vcpkg itself; it can be installed anywhere, +but generally we recommend using vcpkg as a submodule for CMake projects. + +```sh +$ git clone https://github.com/microsoft/vcpkg +$ ./vcpkg/bootstrap-vcpkg.sh ``` -Then, to hook up user-wide [integration](docs/users/integration.md), run (note: requires admin on first use) +To install the libraries for your project, run: + +```sh +$ ./vcpkg/vcpkg install [packages to install] ``` -PS> .\vcpkg integrate install -Linux:~/$ ./vcpkg integrate install + +You can also search for the libraries you need with the `search` subcommand: + +```sh +$ ./vcpkg/vcpkg search [search term] ``` -Install any packages with +In order to use vcpkg with CMake, you can use the toolchain file: + +```sh +$ cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake +$ cmake --build [build directory] ``` -PS> .\vcpkg install sdl2 curl -Linux:~/$ ./vcpkg install sdl2 curl + +With CMake, you will still need to `find_package` and the like to use the libraries. +Check out the [CMake section](#using-vcpkg-with-cmake) +for more information on how best to use vcpkg with CMake, +and CMake Tools for VSCode. + +For any other tools, check out the [integration guide][getting-started:integration]. + +## Installing Linux Developer Tools + +Across the different distros of Linux, there are different packages you'll +need to install: + +- Debian, Ubuntu, popOS, and other Debian-based distributions: + +```sh +$ sudo apt-get update +$ sudo apt-get install build-essential tar curl zip unzip ``` -The best way to use installed libraries with CMake is via the toolchain file `scripts\buildsystems\vcpkg.cmake`. To use this file, you simply need to add it onto your CMake command line as `-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake`. +- CentOS -In Visual Studio, you can create a New Project (or open an existing one). All installed libraries are immediately ready to be `#include`'d and used in your project without additional configuration. +```sh +$ sudo yum install centos-release-scl +$ sudo yum install devtoolset-7 +$ scl enable devtoolset-7 bash +``` + +For any other distributions, make sure you're installing g++ 6 or above. +If you want to add instructions for your specific distro, +[please open a PR][contributing:submit-pr]! -For more information, see our [using a package](docs/examples/installing-and-using-packages.md) example for the specifics. If your library is not present in vcpkg catalog, you can open an [issue on the GitHub repo](https://github.com/microsoft/vcpkg/issues) where the dev team and the community can see it and potentially create the port file for this library. +## Installing macOS Developer Tools -Additional notes on macOS and Linux support can be found in the [official announcement](https://blogs.msdn.microsoft.com/vcblog/2018/04/24/announcing-a-single-c-library-manager-for-linux-macos-and-windows-vcpkg/). +On macOS 10.15, the only thing you should need to do is run the following in your terminal: -## Tab-Completion / Auto-Completion -`vcpkg` supports auto-completion of commands, package names, options etc in Powershell and bash. To enable tab-completion, use one of the following: +```sh +$ xcode-select --install ``` -PS> .\vcpkg integrate powershell -Linux:~/$ ./vcpkg integrate bash + +Then follow along with the prompts in the windows that comes up. + +On macOS 10.14 and previous, you'll also need to install g++ from homebrew; +follow the instructions in the following section. + +### Installing GCC for macOS before 10.15 + +This will _only_ be necessary if you're using a macOS version from before 10.15. +Installing homebrew should be very easy; check out for more information, +but at its simplest, run the following command: + +```sh +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` -and restart your console. +Then, in order to grab an up-to-date version of gcc, run the following: + +```sh +$ brew install gcc +``` -## Examples -See the [documentation](docs/index.md) for specific walkthroughs, including [installing and using a package](docs/examples/installing-and-using-packages.md), [adding a new package from a zipfile](docs/examples/packaging-zipfiles.md), and [adding a new package from a GitHub repo](docs/examples/packaging-github-repos.md). +You'll then be able to bootstrap vcpkg along with the [quick start guide](#quick-start-unix) + +## Using vcpkg with CMake + +If you're using vcpkg with CMake, the following may help! + +### Visual Studio Code with CMake Tools + +Adding the following to your workspace `settings.json` will make +CMake Tools automatically use vcpkg for libraries: + +```json +{ + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "[vcpkg root]/scripts/buildsystems/vcpkg.cmake" + } +} +``` + +### Vcpkg with Visual Studio CMake Projects + +Open the CMake Settings Editor, and under `CMake toolchain file`, +add the path to the vcpkg toolchain file: + +``` +[vcpkg root]/scripts/buildsystems/vcpkg.cmake +``` + +### Vcpkg with CLion + +Open the Toolchains settings +(File > Settings on Windows and Linux, CLion > Preferences on macOS), +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 +``` + +Unfortunately, you'll have to add this to each profile. + +### Vcpkg as a Submodule + +When using vcpkg as a submodule of your project, +you can add the following to your CMakeLists.txt before the first `project()` call, +instead of passing `CMAKE_TOOLCHAIN_FILE` to the cmake invocation. + +```cmake +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake + CACHE STRING "Vcpkg toolchain file") +``` + +This will still allow people to not use vcpkg, +by passing the `CMAKE_TOOLCHAIN_FILE` directly, +but it will make the configure-build step slightly easier. + +## Quick Start: Manifests + +So, you want to look at what the future of vcpkg is going to be like! +We really appreciate it 😄. First, though, a warning: +manifest support in vcpkg is still in beta! Mostly, it should just work, +but there are no guarantees and it's likely you'll hit at least a bug or two +while you're using vcpkg in this mode. Additionally, +we will likely break behavior before stabilizing, so be forewarned. +Please [open issues][contributing:submit-issue] if you hit any bugs! + +First, install vcpkg as normal for [Windows](#quick-start-windows) or +[Unix](#quick-start-unix). +You may wish to install vcpkg in a central place, +as the installed directory exists locally, +and it's fine to run multiple vcpkg commands from the same +vcpkg directory at the same time. + +Then, we must turn on the `manifests` vcpkg feature flag by adding +`manifests` to the comma-separated `--feature-flags` option, +or by adding it to the comma-separated `VCPKG_FEATURE_FLAGS` +environment variable. + +You may also want to add vcpkg to the `PATH`. + +Then, all one has to do is create a manifest; +create a file called `vcpkg.json`, and type the following: + +```json +{ + "name": "", + "version-string": "", + "dependencies": [ + "abseil", + "boost" + ] +} +``` + +The libraries will be installed into the `vcpkg_installed` +directory, in the same directory as your `vcpkg.json`. +If you can use the regular CMake toolchain, +or the Visual Studio/MSBuild integration, +it will install the dependencies automatically, +although you will need to set `VcpkgManifestEnabled` to `On` for MSBuild. +If you wish to install your dependencies without using either CMake or MSBuild, +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/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 +[getting-started:linux-gcc]: #installing-linux-developer-tools +[getting-started:macos-dev-tools]: #installing-macos-developer-tools +[getting-started:macos-brew]: #installing-gcc-on-macos +[getting-started:macos-gcc]: #installing-gcc-on-macos +[getting-started:visual-studio]: https://visualstudio.microsoft.com/ +[getting-started:manifest-spec]: docs/specifications/manifests.md + +# Tab-Completion/Auto-Completion + +`vcpkg` supports auto-completion of commands, package names, +and options in both powershell and bash. +To enable tab-completion in the shell of your choice, run: + +```pwsh +> .\vcpkg integrate powershell +``` + +or + +```sh +$ ./vcpkg integrate bash +``` + +depending on the shell you use, then restart your console. + + +# Examples + +See the [documentation](docs/index.md) for specific walkthroughs, +including [installing and using a package](docs/examples/installing-and-using-packages.md), +[adding a new package from a zipfile](docs/examples/packaging-zipfiles.md), +and [adding a new package from a GitHub repo](docs/examples/packaging-github-repos.md). Our docs are now also available online at ReadTheDocs: ! See a 4 minute [video demo](https://www.youtube.com/watch?v=y41WFKbQFTw). -## Contributing -Vcpkg is built with your contributions. Here are some ways you can contribute: +# Contributing + +Vcpkg is an open source project, and is thus built with your contributions. +Here are some ways you can contribute: + +* [Submit Issues][contributing:submit-issue] in vcpkg or existing packages +* [Submit Fixes and New Packages][contributing:submit-pr] + +Please refer to our [Contributing Guide](CONTRIBUTING.md) for more details. + +This project has adopted the [Microsoft Open Source Code of Conduct][contributing:coc]. +For more information see the [Code of Conduct FAQ][contributing:coc-faq] +or email [opencode@microsoft.com](mailto:opencode@microsoft.com) +with any additional questions or comments. + +[contributing:submit-issue]: https://github.com/microsoft/vcpkg/issues/new/choose +[contributing:submit-pr]: https://github.com/microsoft/vcpkg/pulls +[contributing:coc]: https://opensource.microsoft.com/codeofconduct/ +[contributing:coc-faq]: https://opensource.microsoft.com/codeofconduct/ -* [Submit Issues](https://github.com/Microsoft/vcpkg/issues) in vcpkg or existing packages -* [Submit Fixes and New Packages](https://github.com/Microsoft/vcpkg/pulls) +# License -Please refer to our [Contribution guidelines](CONTRIBUTING.md) for more details. +The code in this repository is licensed under the [MIT License](LICENSE.txt). -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +# Telemetry -## License +vcpkg collects usage data in order to help us improve your experience. +The data collected by Microsoft is anonymous. +You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics, +passing --disable-metrics to vcpkg on the command line, +or by setting the VCPKG_DISABLE_METRICS environment variable. -Code licensed under the [MIT License](LICENSE.txt). +Read more about vcpkg telemetry at docs/about/privacy.md diff --git a/README_zh_CN.md b/README_zh_CN.md index ab53d718010de1..286976dc832dbe 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -1,72 +1,362 @@ -# Vcpkg +# Vcpkg 总览 ## 概要 -Vcpkg 可帮助您在 Windows、Linux 和 MacOS 上管理 C 和 C++ 库。这个工具和生态系统正在不断发展,您的参与对它的成功至关重要! +Vcpkg 可帮助您在 Windows、 Linux 和 MacOS 上管理 C 和 C++ 库。 +这个工具和生态链正在不断发展,我们一直期待您的贡献! -如需获取有关可用命令的简短描述, 请执行 `vcpkg help`。 +若您从未使用过vcpkg或希望了解如何使用vcpkg,请查阅[快速开始](#入门)章节。 + +如需获取有关可用命令的简短描述,请在编译vcpkg后执行 `vcpkg help` 或执行 `vcpkg help [command]` 来获取具体的帮助信息。 + +* Github: [https://github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg) +* Slack: [https://cppalliance.org/slack/](https://cppalliance.org/slack/), #vcpkg 频道 +* Discord: [\#include \](https://www.includecpp.org), #🌏vcpkg 频道 +* 文档: [Documentation](docs/index.md) + +[![当前生成状态](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) + +# 目录 + +- [Vcpkg 总览](#vcpkg-总览) + - [概要](#概要) +- [目录](#目录) +- [入门](#入门) + - [快速开始: Windows](#快速开始-windows) + - [快速开始: Unix](#快速开始-unix) + - [安装 Linux Developer Tools](#安装-linux-developer-tools) + - [安装 macOS Developer Tools](#安装-macos-developer-tools) + - [在 macOS 10.15 之前版本中安装 GCC](#在-macos-1015-之前版本中安装-gcc) + - [在 CMake 中使用 vcpkg](#在-cmake-中使用-vcpkg) + - [Visual Studio Code 中的 CMake Tools](#visual-studio-code-中的-cmake-tools) + - [Visual Studio CMake 工程中使用 vcpkg](#visual-studio-cmake-工程中使用-vcpkg) + - [CLion 中使用 vcpkg](#clion-中使用-vcpkg) + - [将 vcpkg 作为一个子模块](#将-vcpkg-作为一个子模块) + - [快速开始: 清单](#快速开始-清单) +- [Tab补全/自动补全](#tab补全自动补全) + - [示例](#示例) + - [贡献者](#贡献者) +- [License](#license) +- [数据收集](#数据收集) + +# 入门 + +首先,请阅读以下任一方面的快速入门指南: +[Windows](#快速开始-windows) 或 [macOS和Linux](#快速开始-unix), +这取决于您使用的是什么平台。 + +有关更多信息,请参见 [安装和使用软件包][getting-started:using-a-package]。 +如果vcpkg目录中没有您需要的库, +您可以 [在GitHub上打开问题][contributing:submit-issue]。 +vcpkg团队和贡献者可以看到它的地方, +并可能将这个库添加到vcpkg。 + +安装并运行vcpkg后, +您可能希望将 [TAB补全](#tab补全自动补全) 添加到您的Shell中。 + +最后,如果您对vcpkg的未来感兴趣,请查看 [清单](#快速开始-清单)! +这是一项实验性功能,可能会出现错误。 +因此,请尝试一下并[打开所有问题][contributing:submit-issue]! + +## 快速开始: Windows -## 快速开始 需求: -- Windows 10、8.1、7、Linux、或 MacOS -- Visual Studio 2015 Update 3 或更新的版本 (Windows 中) -- Git -- *可选:* CMake 3.12.4 +- Windows 7 或更新的版本 +- [Git][getting-started:git] +- [Visual Studio 2015 Update 3][getting-started:visual-studio] 或更新的版本(包含英文语言包) + +首先,请下载vcpkg并执行 bootstrap.bat 脚本。 +它可以安装在任何地方,但是通常我们建议您使用 vcpkg 作为 CMake 项目的子模块,并将其全局安装到 Visual Studio 项目中。 +我们建议您使用例如 `C:\src\vcpkg` 或 `C:\dev\vcpkg` 的安装目录,否则您可能遇到某些库构建系统的路径问题。 + +```cmd +> git clone https://github.com/microsoft/vcpkg +> .\vcpkg\bootstrap-vcpkg.bat +``` + +使用以下命令安装您的项目所需要的库: + +```cmd +> .\vcpkg\vcpkg install [packages to install] +``` + +您也可以使用 `search` 子命令来查找vcpkg中集成的库: + +```cmd +> .\vcpkg\vcpkg search [search term] +``` + +若您希望在 Visual Studio 中使用vcpkg,请运行以下命令 (首次启动需要管理员权限) + +```cmd +> .\vcpkg\vcpkg integrate install +``` + +在此之后, 您可以创建一个非cmake项目 (或打开已有的项目)。 +在您的项目中,所有已安装的库均可立即使用 `#include` 包含您需使用的库的头文件并无需添加额外配置。 + +若您在 Visual Studio 中使用cmake工程,请查阅[这里](#visual-studio-cmake-工程中使用-vcpkg)。 + +为了在IDE以外在cmake中使用vcpkg, 您需要使用以下工具链文件: + +``` +> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake +> cmake --build [build directory] +``` + +在cmake中,您仍需通过 `find_package` 来使用第三方库。 +请查阅 [CMake 章节](#在-cmake-中使用-vcpkg) 获取更多信息,其中包含了在IDE中使用cmake的内容。 + +对于其他工具 (包括Visual Studio Code),请查阅 [集成指南][getting-started:integration]。 + +## 快速开始: Unix + +Linux平台的使用需求: +- [Git][getting-started:git] +- [g++][getting-started:linux-gcc] >= 6 + +macOS平台的使用需求: +- [Apple Developer Tools][getting-started:macos-dev-tools] +- macOS 10.14 或更低版本中,您也需要: + - [Homebrew][getting-started:macos-brew] + - Homebrew 中 [g++][getting-started:macos-gcc] >= 6 + +首先,请下载vcpkg并执行 bootstrap.sh 脚本。 +我们建议您将vcpkg作为cmake项目的子模块使用。 + +```sh +$ git clone https://github.com/microsoft/vcpkg +$ ./vcpkg/bootstrap-vcpkg.sh +``` + +使用以下命令安装任意包: + +```sh +$ ./vcpkg/vcpkg install [packages to install] +``` + +您也可以使用 `search` 子命令来查找vcpkg中已集成的库: + +```sh +$ ./vcpkg/vcpkg search [search term] +``` + +为了在cmake中使用vcpkg, 您需要使用以下工具链文件: + +``` +> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake +> cmake --build [build directory] +``` + +在cmake中,您仍需通过 `find_package` 来使用第三方库。 +为了您更好的在cmake或 VSCode CMake Tools 中使用vcpkg, +请查阅 [CMake 章节](#在-cmake-中使用-vcpkg) 获取更多信息, +其中包含了在IDE中使用cmake的内容。 + +对于其他工具,请查阅 [集成指南][getting-started:integration]。 + +## 安装 Linux Developer Tools -如何开始: +在Linux的不同发行版中,您需要安装不同的工具包: + +- Debian, Ubuntu, popOS, 或其他基于 Debian 的发行版: + +```sh +$ sudo apt-get update +$ sudo apt-get install build-essential tar curl zip unzip +``` + +- CentOS + +```sh +$ sudo yum install centos-release-scl +$ sudo yum install devtoolset-7 +$ scl enable devtoolset-7 bash +``` + +对于其他的发行版,请确保已安装 g++ 6 或更新的版本。 +若您希望添加特定发行版的说明, [请提交一个 PR][contributing:submit-pr]! + +## 安装 macOS Developer Tools + +在 macOS 10.15 中,唯一需要做的是在终端中运行以下命令: + +```sh +$ xcode-select --install +``` + +然后按照出现的窗口中的提示进行操作。 + +在 macOS 10.14 及先前版本中,您也需要使用 homebrew 安装 g++。 +请遵循以下部分中的说明: + +### 在 macOS 10.15 之前版本中安装 GCC + +此条只在您的macOS版本低于 10.15 时是必须的。 +安装homebrew应当很轻松, 请查阅 以获取更多信息。 +为了更简便,请使用以下命令: + +```sh +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +``` + +然后,为了获取最新版本的gcc,请运行以下命令: + +```sh +$ brew install gcc +``` + +此时,您就可以使用 bootstrap.sh 编译vcpkg了。 请参阅 [快速开始](#快速开始-unix) + +## 在 CMake 中使用 vcpkg + +若您希望在CMake中使用vcpkg, 以下内容可能帮助您: + +### Visual Studio Code 中的 CMake Tools + +将以下内容添加到您的工作区的 `settings.json` 中将使CMake Tools自动使用vcpkg中的第三方库: + +```json +{ + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "[vcpkg root]/scripts/buildsystems/vcpkg.cmake" + } +} ``` -> git clone https://github.com/Microsoft/vcpkg.git -> cd vcpkg -PS> .\bootstrap-vcpkg.bat -Linux:~/$ ./bootstrap-vcpkg.sh +### Visual Studio CMake 工程中使用 vcpkg + +打开CMake设置选项,将 vcpkg toolchain 文件路径在 `CMake toolchain file` 中: + +``` +[vcpkg root]/scripts/buildsystems/vcpkg.cmake ``` -然后,[集成](docs/users/integration.md)至本机环境中,执行 (注意: 首次启动需要管理员权限) +### CLion 中使用 vcpkg + +打开 Toolchains 设置 +(File > Settings on Windows and Linux, CLion > Preferences on macOS), +并打开 CMake 设置 (Build, Execution, Deployment > CMake)。 +最后在 `CMake options` 中添加以下行: + ``` -PS> .\vcpkg integrate install -Linux:~/$ ./vcpkg integrate install +-DCMAKE_TOOLCHAIN_FILE=C:/Users/nimazzuc/src/vcpkg/scripts/buildsystems/vcpkg.cmake ``` -使用以下命令安装任意包 +遗憾的是, 您必须手动将此选项加入每个项目配置文件中。 + +### 将 vcpkg 作为一个子模块 + +当您希望将vcpkg作为一个子模块加入到您的工程中时, +您可以在第一个 `project()` 调用之前将以下内容添加到 CMakeLists.txt 中, +而无需将 `CMAKE_TOOLCHAIN_FILE` 传递给cmake调用。 + +```cmake +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake + CACHE STRING "Vcpkg toolchain file") ``` -PS> .\vcpkg install sdl2 curl -Linux:~/$ ./vcpkg install sdl2 curl + +使用此种方式可无需设置 `CMAKE_TOOLCHAIN_FILE` 即可使用vcpkg,且更容易完成配置工作。 + +## 快速开始: 清单 + +如果您期待vcpkg在未来会更好,我们真的很感激😄。 +但是,首先要警告:vcpkg中的清单支持仍处于beta中! +通常,vcpkg可以正常工作,但您很可能会在使用时遇到至少一个或两个错误。 +另外,我们可能会在稳定之前更改vcpkg的各个功能,请提前知悉。 +如果您遇到任何错误,请[提交一个issue][contributing:submit-issue]! + +首先,在 [Windows](#快速开始-windows) 或 [Unix](#快速开始-unix) 正常安装vcpkg。 +您可能希望将vcpkg安装在常用的位置,由于安装的目录位于本地,并且可以从同一vcpkg目录中同时运行多个vcpkg命令。 + +然后,您必须通过将 `manifests` 添加到以逗号分隔的 `--feature-flags` 选项中来打开 `manifests` vcpkg功能标记, +或将其添加到以逗号分隔的 `VCPKG_FEATURE_FLAGS` 环境变量中。 + +您也可能希望添加vcpkg路径至环境变量 `PATH` 中。 +这时,我们要做的就是创建清单。 +创建一个名为 `vcpkg.json` 的文件,然后添加以下内容: + +```json +{ + "name": "", + "version-string": "", + "dependencies": [ + "abseil", + "boost" + ] +} ``` -与CMake一起使用已安装库的最佳方法是通过工具链文件 `scripts\buildsystems\vcpkg.cmake`。要使用此文件,您只需将 `-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake` 作为参数添加到CMake命令行中。 +您所安装的库将生成在 `vcpkg_installed` 文件夹中,并与您的 `vcpkg.json` 所在的文件夹相同。 +如果您可以使用常规的 CMake toolchain 或 Visual Studio / MSBuild 集成, +它将自动安装依赖项,您需要将MSBuild的 `VcpkgManifestEnabled` 设置为 `On`。 +如果您希望不使用 CMake 或 MSBuild 来安装依赖项,您可以使用命令 `vcpkg install --feature-flags = manifests` 。 + +请查阅 [清单][getting-started:manifest-spec] 获取更多信息。 + +[getting-started:using-a-package]: docs/examples/intalling-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 +[getting-started:linux-gcc]: #installing-linux-developer-tools +[getting-started:macos-dev-tools]: #installing-macos-developer-tools +[getting-started:macos-brew]: #installing-gcc-on-macos +[getting-started:macos-gcc]: #installing-gcc-on-macos +[getting-started:visual-studio]: https://visualstudio.microsoft.com/ +[getting-started:manifest-spec]: docs/specifications/manifests.md + +# Tab补全/自动补全 -在Visual Studio中,您可以创建一个新项目(或打开一个已有项目)。所有已安装的库都可以使用 `#include` 在您的项目中使用,而无需进行其他配置。 +`vcpkg` 支持命令,包名称,以及 Powershell 和 Bash 中的选项。 +若您需要在指定的 shell 中启用Tab补全功能,请依据您使用的shell运行: -若需获取更多信息,请查看[使用一个包](docs/examples/installing-and-using-packages.md)具体示例。 若您需要使用的库不在vcpkg中,请[在GitHub上创建一个issue](https://github.com/microsoft/vcpkg/issues) ,开发团队和贡献者会看到它,并有可能为此库创建端口文件。 +```pwsh +> .\vcpkg integrate powershell +``` -有关 macOS 和 Linux 支持的其他说明,请参见[官方公告](https://blogs.msdn.microsoft.com/vcblog/2018/04/24/announcing-a-single-c-library-manager-for-linux-macos-and-windows-vcpkg/)。 +或 -## Tab补全/自动补全 -`vcpkg`支持在 Powershell 和 bash 中自动补全命令、程序包名称、选项等。如需启用自动补全功能,请使用以下命令: ``` -PS> .\vcpkg integrate powershell -Linux:~/$ ./vcpkg integrate bash +$ ./vcpkg integrate bash ``` -并重启您的控制台。 +然后重新启动控制台。 ## 示例 -请查看[文档](docs/index.md)获取具体示例,其包含[安装并使用包](docs/examples/installing-and-using-packages.md),[使用压缩文件添加包](docs/examples/packaging-zipfiles.md),和[从GitHub源中添加一个包](docs/examples/packaging-github-repos.md)。 -我们的文档现在也可以从[ReadTheDocs](https://vcpkg.readthedocs.io/)在线获取。 +请查看 [文档](docs/index.md) 获取具体示例, +其包含 [安装并使用包](docs/examples/installing-and-using-packages.md), +[使用压缩文件添加包](docs/examples/packaging-zipfiles.md) +和 [从GitHub源中添加一个包](docs/examples/packaging-github-repos.md)。 + +我们的文档现在也可以从 [ReadTheDocs](https://vcpkg.readthedocs.io/) 在线获取。 -观看4分钟[demo视频](https://www.youtube.com/watch?v=y41WFKbQFTw)。 +观看4分钟 [demo视频](https://www.youtube.com/watch?v=y41WFKbQFTw)。 ## 贡献者 -Vcpkg通过您的贡献不断发展。下面是一些您可以贡献的方式: -* 创建一个关于vcpkg或已支持包的[新issue](https://github.com/Microsoft/vcpkg/issues) -* [创建修复PR和创建新包](https://github.com/Microsoft/vcpkg/pulls) +Vcpkg是一个开源项目,并通过您的贡献不断发展。 +下面是一些您可以贡献的方式: + +* [提交一个关于vcpkg或已支持包的新issue][contributing:submit-issue] +* [提交修复PR和创建新包][contributing:submit-pr] + +请参阅我们的 [贡献准则](CONTRIBUTING.md) 了解更多详细信息。 + +该项目采用了 [Microsoft开源行为准则][contributing:coc]。 +获取更多信息请查看 [行为准则FAQ][contributing:coc-faq] 或联系 [opencode@microsoft.com](mailto:opencode@microsoft.com)提出其他问题或意见。 + +[contributing:submit-issue]: https://github.com/microsoft/vcpkg/issues/new/choose +[contributing:submit-pr]: https://github.com/microsoft/vcpkg/pulls +[contributing:coc]: https://opensource.microsoft.com/codeofconduct/ +[contributing:coc-faq]: https://opensource.microsoft.com/codeofconduct/ -请参阅我们的[贡献准则](CONTRIBUTING.md)了解更多详细信息。 +# License -该项目采用了[Microsoft开源行为准则](https://opensource.microsoft.com/codeofconduct/)。获取更多信息请查看 [行为准则FAQ](https://opensource.microsoft.com/codeofconduct/faq/)或联系[opencode@microsoft.com](mailto:opencode@microsoft.com)提出其他问题或意见。 +在此存储库中使用的代码均遵循 [MIT License](LICENSE.txt)。 -## License +# 数据收集 -使用的代码 License 为[MIT License](LICENSE.txt)。 +vcpkg会收集使用情况数据,以帮助我们改善您的体验。 +Microsoft收集的数据是匿名的。 +您也可以通过使用 `-disableMetrics` 、在命令行上将`--disable-metrics`传递给vcpkg,或通过设置环境变量 `VCPKG_DISABLE_METRICS` 并重新运行 bootstrap-vcpkg 脚本来选择禁用数据收集。 +请在 [privacy.md](docs/about/privacy.md) 中了解有关 vcpkg 数据收集的更多信息。 diff --git a/docs/about/privacy.md b/docs/about/privacy.md index 542f2761470c71..15ef69d763458a 100644 --- a/docs/about/privacy.md +++ b/docs/about/privacy.md @@ -1,7 +1,7 @@ # Vcpkg telemetry and privacy vcpkg collects telemetry data to understand usage issues, such as failing packages, and to guide tool improvements. The collected data is anonymous. -For more information about how Microsoft protects your privacy, see https://privacy.microsoft.com/en-US/privacystatement#mainenterprisedeveloperproductsmodule +For more information about how Microsoft protects your privacy, see https://privacy.microsoft.com/en-US/privacystatement#mainenterprisedeveloperproductsmodule ## Scope @@ -22,7 +22,11 @@ vcpkg displays text similar to the following when you build vcpkg. This is how M ``` Telemetry --------- -vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics. +vcpkg collects usage data in order to help us improve your experience. +The data collected by Microsoft is anonymous. +You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics, +passing --disable-metrics to vcpkg on the command line, +or by setting the VCPKG_DISABLE_METRICS environment variable. Read more about vcpkg telemetry at docs/about/privacy.md ``` @@ -37,9 +41,10 @@ We collect various telemetry events such as the command line used, the time of i You can see the telemetry events any command by appending `--printmetrics` after the vcpkg command line. -In the source code (included in `toolsrc\`), you can search for calls to the functions `track_property()` and `track_metric()` to see every specific data point we collect. +In the source code (included in `toolsrc\`), you can search for calls to the functions `track_property()`, `track_feature()`, `track_metric()`, and `track_buildtime()` +to see every specific data point we collect. -## Avoid inadvertent disclosure information +## Avoid inadvertent disclosure information vcpkg contributors and anyone else running a version of vcpkg that they built themselves should consider the path to their source code. If a crash occurs when using vcpkg, the file path from the build machine is collected as part of the stack trace and isn't hashed. Because of this, builds of vcpkg shouldn't be located in directories whose path names expose personal or sensitive information. diff --git a/docs/examples/installing-and-using-packages.md b/docs/examples/installing-and-using-packages.md index 73f9d29a923253..011df93a4cc9f9 100644 --- a/docs/examples/installing-and-using-packages.md +++ b/docs/examples/installing-and-using-packages.md @@ -14,7 +14,7 @@ First, we need to know what name [SQLite](https://sqlite.org) goes by in the por ```no-highlight PS D:\src\vcpkg> .\vcpkg search sqlite libodb-sqlite 2.4.0 Sqlite support for the ODB ORM library -sqlite3 3.15.0 SQLite is a software library that implements a se... +sqlite3 3.32.1 SQLite is a software library that implements a se... If your library is not listed, please open an issue at: https://github.com/Microsoft/vcpkg/issues @@ -24,38 +24,38 @@ Looking at the list, we can see that the port is named "sqlite3". You can also r Installing is then as simple as using the `install` command. ```no-highlight PS D:\src\vcpkg> .\vcpkg install sqlite3 --- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-windows --- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/sqlite3_x86-windows --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/sqlite3 --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/sqlite3/. --- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... --- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... OK --- Testing integrity of downloaded file... --- Testing integrity of downloaded file... OK --- Extracting source D:/src/vcpkg/downloads/sqlite-amalgamation-3150000.zip --- Extracting done --- Configuring x86-windows-rel --- Configuring x86-windows-rel done --- Configuring x86-windows-dbg --- Configuring x86-windows-dbg done --- Build x86-windows-rel --- Build x86-windows-rel done --- Build x86-windows-dbg --- Build x86-windows-dbg done --- Package x86-windows-rel --- Package x86-windows-rel done --- Package x86-windows-dbg --- Package x86-windows-dbg done +Computing installation plan... +The following packages will be built and installed: + sqlite3[core]:x86-windows +Starting package 1/1: sqlite3:x86-windows +Building package sqlite3[core]:x86-windows... +-- Downloading https://sqlite.org/2020/sqlite-amalgamation-3320100.zip... +-- Extracting source C:/src/vcpkg/downloads/sqlite-amalgamation-3320100.zip +-- Applying patch fix-arm-uwp.patch +-- Using source at C:/src/vcpkg/buildtrees/sqlite3/src/3320100-15aeda126a.clean +-- Configuring x86-windows +-- Building x86-windows-dbg +-- Building x86-windows-rel -- Performing post-build validation -- Performing post-build validation done -Package sqlite3:x86-windows is installed +Building package sqlite3[core]:x86-windows... done +Installing package sqlite3[core]:x86-windows... +Installing package sqlite3[core]:x86-windows... done +Elapsed time for package sqlite3:x86-windows: 12 s + +Total elapsed time: 12.04 s + +The package sqlite3:x86-windows provides CMake targets: + + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)) + ``` -We can check that sqlite3 was successfully installed for x86 windows desktop by running the `list` command. +We can check that sqlite3 was successfully installed for x86 Windows desktop by running the `list` command. ```no-highlight PS D:\src\vcpkg> .\vcpkg list -sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... +sqlite3:x86-windows 3.32.1 SQLite is a software library that implements a se... ``` To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. @@ -82,7 +82,7 @@ Installing new libraries will make them instantly available. ``` *Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.* -You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio 2017 and the library will be automatically available. For SQLite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html). +You can now simply use File -> New Project in Visual Studio and the library will be automatically available. For SQLite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html). To remove the integration for your user, you can use `.\vcpkg integrate remove`. @@ -92,7 +92,7 @@ To remove the integration for your user, you can use `.\vcpkg integrate remove`. The best way to use installed libraries with cmake is via the toolchain file `scripts\buildsystems\vcpkg.cmake`. To use this file, you simply need to add it onto your CMake command line as: `-DCMAKE_TOOLCHAIN_FILE=D:\src\vcpkg\scripts\buildsystems\vcpkg.cmake`. -If you are using CMake through Open Folder with Visual Studio 2017 you can define `CMAKE_TOOLCHAIN_FILE` by adding a "variables" section to each of your `CMakeSettings.json` configurations: +If you are using CMake through Open Folder with Visual Studio you can define `CMAKE_TOOLCHAIN_FILE` by adding a "variables" section to each of your `CMakeSettings.json` configurations: ```json { @@ -118,10 +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 REQUIRED) +find_package(unofficial-sqlite3 CONFIG REQUIRED) add_executable(main main.cpp) -target_link_libraries(main 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/examples/packaging-zipfiles.md b/docs/examples/packaging-zipfiles.md index ed63637fd718a8..056eb528727884 100644 --- a/docs/examples/packaging-zipfiles.md +++ b/docs/examples/packaging-zipfiles.md @@ -3,7 +3,7 @@ ### Bootstrap with `create` First, locate a globally accessible archive of the library's sources. Zip, gzip, and bzip are all supported. Strongly prefer official sources or mirrors over unofficial mirrors. -*Looking at zlib's website, the URL http://zlib.net/zlib1211.zip looks appropriate.* +*Looking at zlib's website, the URL http://zlib.net/zlib-1.2.11.tar.gz looks appropriate.* Second, determine a suitable package name. This should be ASCII, lowercase, and recognizable to someone who knows the library's "human name". If the library is already packaged in another package manager, prefer that name. @@ -16,7 +16,7 @@ Finally, if the server's name for the archive is not very descriptive (such as d All this information can then be passed into the `create` command, which will download the sources and bootstrap the packaging process inside `ports\`. ```no-highlight -PS D:\src\vcpkg> .\vcpkg create zlib2 http://zlib.net/zlib-1.2.11.tar.gz zlib-1.2.11.zip +PS D:\src\vcpkg> .\vcpkg create zlib2 http://zlib.net/zlib-1.2.11.tar.gz zlib1211.tar.gz -- Generated portfile: D:/src/vcpkg/ports/zlib2/portfile.cmake ``` @@ -34,25 +34,21 @@ Description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library The generated `portfile.cmake` will need some editing to correctly package most libraries in the wild, however we can start by trying out the build. ```no-highlight -PS D:\src\vcpkg> .\vcpkg build zlib2 --- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-windows --- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/zlib2_x86-windows --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/zlib2 --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/zlib2/. --- Using cached D:/src/vcpkg/downloads/zlib-1.2.11.tar.gz --- Testing integrity of cached file... --- Testing integrity of cached file... OK --- Extracting source D:/src/vcpkg/downloads/zlib-1.2.11.tar.gz --- Extracting done --- Configuring x86-windows-rel --- Configuring x86-windows-rel done --- Configuring x86-windows-dbg --- Configuring x86-windows-dbg done --- Build x86-windows-rel --- Build x86-windows-rel done --- Build x86-windows-dbg --- Build x86-windows-dbg done +PS D:\src\vcpkg> .\vcpkg install zlib2 +Computing installation plan... +The following packages will be built and installed: + zlib2[core]:x64-uwp +Starting package 1/1: zlib2:x64-uwp +Building package zlib2[core]:x64-uwp... +-- Using cached C:/src/vcpkg/downloads/zlib1211.tar.gz +-- Cleaning sources at C:/src/vcpkg/buildtrees/zlib2/src/1.2.11-deec42f53b.clean. Pass --editable to vcpkg to reuse sources. +-- Extracting source C:/src/vcpkg/downloads/zlib1211.tar.gz +-- Applying patch cmake_dont_build_more_than_needed.patch +-- Using source at C:/src/vcpkg/buildtrees/zlib2/src/1.2.11-deec42f53b.clean +-- Configuring x64-uwp +-- Building x64-uwp-dbg +-- Building x64-uwp-rel +-- Installing: C:/src/vcpkg/packages/zlib2_x64-uwp/share/zlib2/copyright -- Performing post-build validation Include files should not be duplicated into the /debug/include directory. If this cannot be disabled in the project cmake, use file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/docs/examples/patching.md b/docs/examples/patching.md index b152231e215810..f55cdea04d8bdf 100644 --- a/docs/examples/patching.md +++ b/docs/examples/patching.md @@ -1,32 +1,29 @@ -## Patching Example: Patching libpng to work for x86-uwp +## Patching Example: Patching libpng to work for x64-uwp ### Initial error logs First, try building: ```no-highlight -PS D:\src\vcpkg> vcpkg install libpng:x86-uwp --- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-uwp --- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/libpng_x86-uwp --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/libpng --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/libpng/. --- Using cached D:/src/vcpkg/downloads/libpng-1.6.24.tar.xz --- Extracting done --- Configuring x86-uwp-rel --- Configuring x86-uwp-rel done --- Configuring x86-uwp-dbg --- Configuring x86-uwp-dbg done --- Build x86-uwp-rel +PS D:\src\vcpkg> vcpkg install libpng:x64-uwp --editable +Computing installation plan... +The following packages will be built and installed: + libpng[core]:x64-uwp +Starting package 1/1: libpng:x64-uwp +Building package libpng[core]:x64-uwp... +-- Using cached D:/src/vcpkg/downloads/glennrp-libpng-v1.6.37.tar.gz +-- Extracting source D:/src/vcpkg/downloads/glennrp-libpng-v1.6.37.tar.gz +-- Using source at D:/src/vcpkg/buildtrees/libpng/src/v1.6.37-c993153cdf +-- Configuring x64-uwp +-- Building x64-uwp-rel CMake Error at scripts/cmake/execute_required_process.cmake:14 (message): - Command failed: C:/Program - Files/CMake/bin/cmake.exe;--build;.;--config;Release + Command failed: C:/Program Files/CMake/bin/cmake.exe;--build;.;--config;Release - Working Directory: D:/src/vcpkg/buildtrees/libpng/x86-uwp-rel + Working Directory: D:/src/vcpkg/buildtrees/libpng/x64-uwp-rel See logs for more information: - D:\src\vcpkg\buildtrees\libpng\build-x86-uwp-rel-out.log - D:\src\vcpkg\buildtrees\libpng\build-x86-uwp-rel-err.log + D:\src\vcpkg\buildtrees\libpng\build-x64-uwp-rel-out.log + D:\src\vcpkg\buildtrees\libpng\build-x64-uwp-rel-err.log Call Stack (most recent call first): scripts/cmake/vcpkg_build_cmake.cmake:3 (execute_required_process) @@ -40,19 +37,19 @@ Error: build command failed Next, looking at the above logs (build-...-out.log and build-...-err.log). ```no-highlight -// build-x86-uwp-rel-out.log +// build-x64-uwp-rel-out.log ... -"D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\ALL_BUILD.vcxproj" (default target) (1) -> -"D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\png.vcxproj" (default target) (3) -> +"D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\ALL_BUILD.vcxproj" (default target) (1) -> +"D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\png.vcxproj" (default target) (3) -> (ClCompile target) -> - D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24\pngerror.c(775): warning C4013: 'ExitProcess' undefined; assuming extern returning int [D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\png.vcxproj] + D:\src\vcpkg\buildtrees\libpng\src\v1.6.37-c993153cdf\pngerror.c(775): warning C4013: 'ExitProcess' undefined; assuming extern returning int [D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\png.vcxproj] -"D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\ALL_BUILD.vcxproj" (default target) (1) -> -"D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\png.vcxproj" (default target) (3) -> +"D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\ALL_BUILD.vcxproj" (default target) (1) -> +"D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\png.vcxproj" (default target) (3) -> (Link target) -> - pngerror.obj : error LNK2019: unresolved external symbol _ExitProcess referenced in function _png_longjmp [D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\png.vcxproj] - D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\Release\libpng16.dll : fatal error LNK1120: 1 unresolved externals [D:\src\vcpkg\buildtrees\libpng\x86-uwp-rel\png.vcxproj] + pngerror.obj : error LNK2019: unresolved external symbol _ExitProcess referenced in function _png_longjmp [D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\png.vcxproj] + D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\Release\libpng16.dll : fatal error LNK1120: 1 unresolved externals [D:\src\vcpkg\buildtrees\libpng\x64-uwp-rel\png.vcxproj] 1 Warning(s) 2 Error(s) @@ -65,7 +62,7 @@ Time Elapsed 00:00:04.19 Taking a look at [MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx) shows that `ExitProcess` is only available for desktop apps. Additionally, it's useful to see the surrounding context: ```c -/* buildtrees\libpng\src\libpng-1.6.24\pngerror.c:769 */ +/* buildtrees\libpng\src\v1.6.37-c993153cdf\pngerror.c:769 */ /* If control reaches this point, png_longjmp() must not return. The only * choice is to terminate the whole process (or maybe the thread); to do * this the ANSI-C abort() function is used unless a different method is @@ -77,7 +74,7 @@ Taking a look at [MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop A recursive search for `PNG_ABORT` reveals the definition: ```no-highlight -PS D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24> findstr /snipl "PNG_ABORT" * +PS D:\src\vcpkg\buildtrees\libpng\src\v1.6.37-c993153cdf> findstr /snipl "PNG_ABORT" * CHANGES:701: Added PNG_SETJMP_SUPPORTED, PNG_SETJMP_NOT_SUPPORTED, and PNG_ABORT() macros libpng-manual.txt:432:errors will result in a call to PNG_ABORT() which defaults to abort(). libpng-manual.txt:434:You can #define PNG_ABORT() to a function that does something @@ -100,7 +97,7 @@ pngpriv.h:463:# define PNG_ABORT() abort() This already gives us some great clues, but the full definition tells the complete story. ```c -/* buildtrees\libpng\src\libpng-1.6.24\pngpriv.h:459 */ +/* buildtrees\libpng\src\v1.6.37-c993153cdf\pngpriv.h:459 */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) @@ -116,15 +113,15 @@ This already gives us some great clues, but the full definition tells the comple We recommend using git to create the patch file, since you'll already have it installed. ```no-highlight -PS D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24> git init . -Initialized empty Git repository in D:/src/vcpkg/buildtrees/libpng/src/libpng-1.6.24/.git/ +PS D:\src\vcpkg\buildtrees\libpng\src\v1.6.37-c993153cdf> git init . +Initialized empty Git repository in D:/src/vcpkg/buildtrees/libpng/src/v1.6.37-c993153cdf/.git/ -PS D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24> git add . +PS D:\src\vcpkg\buildtrees\libpng\src\v1.6.37-c993153cdf> git add . warning: LF will be replaced by CRLF in ANNOUNCE. The file will have its original line endings in your working directory. ... -PS D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24> git commit -m "temp" +PS D:\src\vcpkg\buildtrees\libpng\src\v1.6.37-c993153cdf> git commit -m "temp" [master (root-commit) 68f253f] temp 422 files changed, 167717 insertions(+) ... @@ -132,7 +129,7 @@ PS D:\src\vcpkg\buildtrees\libpng\src\libpng-1.6.24> git commit -m "temp" Now we can modify `pngpriv.h` to use `abort()` everywhere. ```c -/* buildtrees\libpng\src\libpng-1.6.24\pngpriv.h:459 */ +/* buildtrees\libpng\src\v1.6.37-c993153cdf\pngpriv.h:459 */ #ifndef PNG_ABORT # define PNG_ABORT() abort() #endif @@ -140,7 +137,7 @@ Now we can modify `pngpriv.h` to use `abort()` everywhere. The output of `git diff` is already in patch format, so we just need to save the patch into the `ports/libpng` directory. ```no-highlight -PS buildtrees\libpng\src\libpng-1.6.24> git diff | out-file -enc ascii ..\..\..\..\ports\libpng\use-abort-on-all-platforms.patch +PS buildtrees\libpng\src\v1.6.37-c993153cdf> git diff --ignore-space-at-eol | out-file -enc ascii ..\..\..\..\ports\libpng\use-abort-on-all-platforms.patch ``` Finally, we need to apply the patch after extracting the source. @@ -163,35 +160,42 @@ vcpkg_configure_cmake( To be completely sure this works from scratch, we need to remove the package and rebuild it: ```no-highlight -PS D:\src\vcpkg> vcpkg remove libpng:x86-uwp -Package libpng:x86-uwp was successfully removed +PS D:\src\vcpkg> vcpkg remove libpng:x64-uwp +Package libpng:x64-uwp was successfully removed ``` and complete delete the building directory: D:\src\vcpkg\buildtrees\libpng Now we try a fresh, from scratch install. ```no-highlight -PS D:\src\vcpkg> vcpkg install libpng:x86-uwp --- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-uwp --- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/libpng_x86-uwp --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/libpng --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/libpng/. --- Using cached D:/src/vcpkg/downloads/libpng-1.6.24.tar.xz --- Extracting source D:/src/vcpkg/downloads/libpng-1.6.24.tar.xz --- Extracting done --- Configuring x86-uwp-rel --- Configuring x86-uwp-rel done --- Configuring x86-uwp-dbg --- Configuring x86-uwp-dbg done --- Build x86-uwp-rel --- Build x86-uwp-rel done --- Build x86-uwp-dbg --- Build x86-uwp-dbg done --- Package x86-uwp-rel --- Package x86-uwp-rel done --- Package x86-uwp-dbg --- Package x86-uwp-dbg done -Package libpng:x86-uwp is installed +PS D:\src\vcpkg> vcpkg install libpng:x64-uwp +Computing installation plan... +The following packages will be built and installed: + libpng[core]:x64-uwp +Starting package 1/1: libpng:x64-uwp +Building package libpng[core]:x64-uwp... +-- Using cached C:/src/vcpkg/downloads/glennrp-libpng-v1.6.37.tar.gz +-- Cleaning sources at C:/src/vcpkg/buildtrees/libpng/src/v1.6.37-c993153cdf.clean. Pass --editable to vcpkg to reuse sources. +-- Extracting source C:/src/vcpkg/downloads/glennrp-libpng-v1.6.37.tar.gz +-- Applying patch use-abort-on-all-platforms.patch +-- Using source at C:/src/vcpkg/buildtrees/libpng/src/v1.6.37-c993153cdf.clean +-- Configuring x64-uwp +-- Building x64-uwp-dbg +-- Building x64-uwp-rel +-- Installing: C:/src/vcpkg/packages/libpng_x64-uwp/share/libpng/copyright +-- Performing post-build validation +-- Performing post-build validation done +Building package libpng[core]:x64-uwp... done +Installing package libpng[core]:x64-uwp... +Installing package libpng[core]:x64-uwp... done +Elapsed time for package libpng:x64-uwp: 15.31 s + +Total elapsed time: 15.35 s + +The package libpng:x64-uwp provides CMake targets: + + find_package(libpng CONFIG REQUIRED) + target_link_libraries(main PRIVATE png) + ``` Finally, to fully commit and publish the changes, we need to bump the internal release number and add the patch file to source control, then make a Pull Request! @@ -199,6 +203,6 @@ Finally, to fully commit and publish the changes, we need to bump the internal r ```no-highlight # ports\libpng\CONTROL Source: libpng -Version: 1.6.24-1 +Version: 1.6.37-1 Build-Depends: zlib ``` diff --git a/docs/examples/vcpkg_android_example_cmake/.gitignore b/docs/examples/vcpkg_android_example_cmake/.gitignore new file mode 100644 index 00000000000000..378eac25d31170 --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake/.gitignore @@ -0,0 +1 @@ +build diff --git a/docs/examples/vcpkg_android_example_cmake/CMakeLists.txt b/docs/examples/vcpkg_android_example_cmake/CMakeLists.txt new file mode 100644 index 00000000000000..7572bbbc83884f --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.0) +project(test) +find_package(jsoncpp CONFIG REQUIRED) +add_library(my_lib my_lib.cpp) +target_link_libraries(my_lib jsoncpp_lib) diff --git a/docs/examples/vcpkg_android_example_cmake/compile.sh b/docs/examples/vcpkg_android_example_cmake/compile.sh new file mode 100755 index 00000000000000..1d1aa60a920b8f --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake/compile.sh @@ -0,0 +1,54 @@ +# +# 1. Check the presence of required environment variables +# +if [ -z ${ANDROID_NDK_HOME+x} ]; then + echo "Please set ANDROID_NDK_HOME" + exit 1 +fi +if [ -z ${VCPKG_ROOT+x} ]; then + echo "Please set VCPKG_ROOT" + exit 1 +fi + +# +# 2. Set the path to the toolchains +# +vcpkg_toolchain_file=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake +android_toolchain_file=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake + + +# +# 3. Select a pair "Android abi" / "vcpkg triplet" +# Uncomment one of the four possibilities below +# + +android_abi=armeabi-v7a +vcpkg_target_triplet=arm-android + +# android_abi=x86 +# vcpkg_target_triplet=x86-android + +# android_abi=arm64-v8a +# vcpkg_target_triplet=arm64-android + +# android_abi=x86_64 +# vcpkg_target_triplet=x64-android + + +# +# 4. Install the library via vcpkg +# +$VCPKG_ROOT/vcpkg install jsoncpp:$vcpkg_target_triplet + +# +# 5. Test the build +# +rm -rf build +mkdir build +cd build +cmake .. \ + -DCMAKE_TOOLCHAIN_FILE=$vcpkg_toolchain_file \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$android_toolchain_file \ + -DVCPKG_TARGET_TRIPLET=$vcpkg_target_triplet \ + -DANDROID_ABI=$android_abi +make diff --git a/docs/examples/vcpkg_android_example_cmake/my_lib.cpp b/docs/examples/vcpkg_android_example_cmake/my_lib.cpp new file mode 100644 index 00000000000000..f0165d72df6156 --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake/my_lib.cpp @@ -0,0 +1,8 @@ +#include + +int answer() +{ + Json::Value meaning_of; + meaning_of["everything"] = 42; + return meaning_of["everything"].asInt(); +} diff --git a/docs/examples/vcpkg_android_example_cmake_script/.gitignore b/docs/examples/vcpkg_android_example_cmake_script/.gitignore new file mode 100644 index 00000000000000..378eac25d31170 --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/.gitignore @@ -0,0 +1 @@ +build diff --git a/docs/examples/vcpkg_android_example_cmake_script/CMakeLists.txt b/docs/examples/vcpkg_android_example_cmake_script/CMakeLists.txt new file mode 100644 index 00000000000000..d3218866f57b7d --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.0) + +# if -DVCPKG_TARGET_ANDROID=ON is specified when invoking cmake, load cmake/vcpkg_android.cmake +# !!! Important: place this line before calling project() !!! +if (VCPKG_TARGET_ANDROID) + include("cmake/vcpkg_android.cmake") +endif() + +project(test) + +find_package(jsoncpp CONFIG REQUIRED) +add_library(my_lib my_lib.cpp) +target_link_libraries(my_lib jsoncpp_lib) diff --git a/docs/examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake b/docs/examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake new file mode 100644 index 00000000000000..ce6cc4a617e08b --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake @@ -0,0 +1,99 @@ +# +# vcpkg_android.cmake +# +# Helper script when using vcpkg with cmake. It should be triggered via the variable VCPKG_TARGET_ANDROID +# +# For example: +# if (VCPKG_TARGET_ANDROID) +# include("cmake/vcpkg_android.cmake") +# endif() +# +# This script will: +# 1 & 2. check the presence of needed env variables: ANDROID_NDK_HOME and VCPKG_ROOT +# 3. set VCPKG_TARGET_TRIPLET according to ANDROID_ABI +# 4. Combine vcpkg and Android toolchains by setting CMAKE_TOOLCHAIN_FILE +# and VCPKG_CHAINLOAD_TOOLCHAIN_FILE + +# Note: VCPKG_TARGET_ANDROID is not an official Vcpkg variable. +# it is introduced for the need of this script + +if (VCPKG_TARGET_ANDROID) + + # + # 1. Check the presence of environment variable ANDROID_NDK_HOME + # + if (NOT DEFINED ENV{ANDROID_NDK_HOME}) + message(FATAL_ERROR " + Please set an environment variable ANDROID_NDK_HOME + For example: + export ANDROID_NDK_HOME=/home/your-account/Android/Sdk/ndk-bundle + Or: + export ANDROID_NDK_HOME=/home/your-account/Android/android-ndk-r21b + ") + endif() + + # + # 2. Check the presence of environment variable VCPKG_ROOT + # + if (NOT DEFINED ENV{VCPKG_ROOT}) + message(FATAL_ERROR " + Please set an environment variable VCPKG_ROOT + For example: + export VCPKG_ROOT=/path/to/vcpkg + ") + endif() + + + # + # 3. Set VCPKG_TARGET_TRIPLET according to ANDROID_ABI + # + # There are four different Android ABI, each of which maps to + # a vcpkg triplet. The following table outlines the mapping from vcpkg architectures to android architectures + # + # |VCPKG_TARGET_TRIPLET | ANDROID_ABI | + # |---------------------------|----------------------| + # |arm64-android | arm64-v8a | + # |arm-android | armeabi-v7a | + # |x64-android | x86_64 | + # |x86-android | x86 | + # + # The variable must be stored in the cache in order to successfuly the two toolchains. + # + if (ANDROID_ABI MATCHES "arm64-v8a") + set(VCPKG_TARGET_TRIPLET "arm64-android" CACHE STRING "" FORCE) + elseif(ANDROID_ABI MATCHES "armeabi-v7a") + set(VCPKG_TARGET_TRIPLET "arm-android" CACHE STRING "" FORCE) + elseif(ANDROID_ABI MATCHES "x86_64") + set(VCPKG_TARGET_TRIPLET "x64-android" CACHE STRING "" FORCE) + elseif(ANDROID_ABI MATCHES "x86") + set(VCPKG_TARGET_TRIPLET "x86-android" CACHE STRING "" FORCE) + else() + message(FATAL_ERROR " + Please specify ANDROID_ABI + For example + cmake ... -DANDROID_ABI=armeabi-v7a + + Possible ABIs are: arm64-v8a, armeabi-v7a, x64-android, x86-android + ") + endif() + message("vcpkg_android.cmake: VCPKG_TARGET_TRIPLET was set to ${VCPKG_TARGET_TRIPLET}") + + + # + # 4. Combine vcpkg and Android toolchains + # + + # vcpkg and android both provide dedicated toolchains: + # + # vcpkg_toolchain_file=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake + # android_toolchain_file=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake + # + # When using vcpkg, the vcpkg toolchain shall be specified first. + # However, vcpkg provides a way to preload and additional toolchain, + # with the VCPKG_CHAINLOAD_TOOLCHAIN_FILE option. + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE $ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake) + set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) + message("vcpkg_android.cmake: CMAKE_TOOLCHAIN_FILE was set to ${CMAKE_TOOLCHAIN_FILE}") + message("vcpkg_android.cmake: VCPKG_CHAINLOAD_TOOLCHAIN_FILE was set to ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + +endif(VCPKG_TARGET_ANDROID) diff --git a/docs/examples/vcpkg_android_example_cmake_script/compile.sh b/docs/examples/vcpkg_android_example_cmake_script/compile.sh new file mode 100755 index 00000000000000..abd981a6a2c3e4 --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/compile.sh @@ -0,0 +1,37 @@ +# 1. Install the library via vcpkg +# This install jsoncpp for the 4 android target ABIs and for the host computer. +# see the correspondence between ABIs and vcpkg triplets in the table below: +# +# |VCPKG_TARGET_TRIPLET | ANDROID_ABI | +# |---------------------------|----------------------| +# |arm64-android | arm64-v8a | +# |arm-android | armeabi-v7a | +# |x64-android | x86_64 | +# |x86-android | x86 | +$VCPKG_ROOT/vcpkg install \ + jsoncpp \ + jsoncpp:arm-android \ + jsoncpp:arm64-android \ + jsoncpp:x86-android \ + jsoncpp:x64-android + + +# 2. Test the build +# +# First, select an android ABI +# Uncomment one of the four possibilities below +# +android_abi=armeabi-v7a +# android_abi=x86 +# android_abi=arm64-v8a +# android_abi=x86_64 + +rm -rf build +mkdir build && cd build + +# DVCPKG_TARGET_ANDROID will load vcpkg_android.cmake, +# which will then load the android + vcpkg toolchains. +cmake .. \ + -DVCPKG_TARGET_ANDROID=ON \ + -DANDROID_ABI=$android_abi +make diff --git a/docs/examples/vcpkg_android_example_cmake_script/my_lib.cpp b/docs/examples/vcpkg_android_example_cmake_script/my_lib.cpp new file mode 100644 index 00000000000000..f0165d72df6156 --- /dev/null +++ b/docs/examples/vcpkg_android_example_cmake_script/my_lib.cpp @@ -0,0 +1,8 @@ +#include + +int answer() +{ + Json::Value meaning_of; + meaning_of["everything"] = 42; + return meaning_of["everything"].asInt(); +} diff --git a/docs/index.md b/docs/index.md index 579b0e4c829bf7..af1b966a012fac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,6 +14,7 @@ Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This too - [Integration with build systems](users/integration.md) - [Triplet files](users/triplets.md) - [Configuration and Environment](users/config-environment.md) +- [Usage with Android](users/android.md) ### Maintainer help diff --git a/docs/maintainers/control-files.md b/docs/maintainers/control-files.md index 87468e6af8843b..e20669b332c309 100644 --- a/docs/maintainers/control-files.md +++ b/docs/maintainers/control-files.md @@ -13,13 +13,14 @@ The first paragraph in a `CONTROL` file is the Source paragraph. It must have a ### Examples: ```no-highlight Source: ace -Version: 6.5.5-1 +Version: 6.5.5 Description: The ADAPTIVE Communication Environment ``` ```no-highlight Source: vtk -Version: 8.2.0-2 +Version: 8.2.0 +Port-Version: 2 Description: Software system for 3D computer graphics, image processing, and visualization Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, libjpeg-turbo, proj4, lz4, libtheora, atlmfc (windows), eigen3, double-conversion, pugixml, libharu, sqlite3, netcdf-c ``` @@ -39,7 +40,7 @@ Package collections to check for conflicts: + [Packages search](https://pkgs.org/) #### Version -The port version. +The library version. This field is an alphanumeric string that may also contain `.`, `_`, or `-`. No attempt at ordering versions is made; all versions are treated as bit strings and are only evaluated for equality. @@ -47,7 +48,6 @@ For tagged-release ports, we follow the following convention: 1. If the port follows a scheme like `va.b.c`, we remove the leading `v`. In this case, it becomes `a.b.c`. 2. If the port includes its own name in the version like `curl-7_65_1`, we remove the leading name: `7_65_1` -3. If the port has been modified, we append a `-N` to distinguish the versions: `1.2.1-4` For rolling-release ports, we use the date that the _commit was accessed by you_, formatted as `YYYY-MM-DD`. Stated another way: if someone had a time machine and went to that date, they would see this commit as the latest master. @@ -56,11 +56,17 @@ For example, given: 2. The current version string is `2019-02-14-1` 3. Today's date is 2019-06-01. -Then if you update the source version today, you should give it version `2019-06-01`. If you need to make a change which doesn't adjust the source version, you should give it version `2019-02-14-2`. +Then if you update the source version today, you should give it version `2019-06-01`. + +#### Port-Version +The version of the port. + +This field is a non-negative integer. It allows one to version the port file separately from the version of the underlying library; if you make a change to a port, without changing the underlying version of the library, you should increment this field by one (starting at `0`, which is equivalent to no `Port-Version` field). When the version of the underlying library is upgraded, this field should be set back to `0` (i.e., delete the `Port-Version` field). ##### Examples: ```no-highlight -Version: 1.0.5-2 +Version: 1.0.5 +Port-Version: 2 ``` ```no-highlight Version: 2019-03-21 @@ -77,7 +83,7 @@ Description: C++ header-only JSON library ``` ```no-highlight 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 + 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. ```` @@ -138,6 +144,8 @@ The predefined expressions are computed from standard triplet settings: - `osx` - `VCPKG_CMAKE_SYSTEM_NAME` == `"Darwin"` - `android` - `VCPKG_CMAKE_SYSTEM_NAME` == `"Android"` - `static` - `VCPKG_LIBRARY_LINKAGE` == `"static"` +- `wasm32` - `VCPKG_TARGET_ARCHITECTURE` == `"wasm32"` +- `emscripten` - `VCPKG_CMAKE_SYSTEM_NAME` == `"Emscripten"` These predefined expressions can be overridden in the triplet file via the [`VCPKG_DEP_INFO_OVERRIDE_VARS`](../users/triplets.md) option. @@ -171,7 +179,7 @@ Build-Depends: qt5 Feature: mpi Description: MPI functionality for VTK -Build-Depends: msmpi, hdf5[parallel] +Build-Depends: mpi, hdf5[parallel] Feature: python Description: Python functionality for VTK diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 624aa46d3c686c..e0fde7e6885c63 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -42,6 +42,7 @@ At this time, the following helpers are deprecated: 1. `vcpkg_extract_source_archive()` should be replaced by [`vcpkg_extract_source_archive_ex()`](vcpkg_extract_source_archive_ex.md) 2. `vcpkg_apply_patches()` should be replaced by the `PATCHES` arguments to the "extract" helpers (e.g. [`vcpkg_from_github()`](vcpkg_from_github.md)) 3. `vcpkg_build_msbuild()` should be replaced by [`vcpkg_install_msbuild()`](vcpkg_install_msbuild.md) +4. `vcpkg_copy_tool_dependencies()` should be replaced by [`vcpkg_copy_tools()`](vcpkg_copy_tools.md) ### Avoid excessive comments in portfiles @@ -207,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/portfile-functions.md b/docs/maintainers/portfile-functions.md index 776ffdefc38586..aec901dc4eabb7 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -6,17 +6,22 @@ - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) - [vcpkg\_apply\_patches](vcpkg_apply_patches.md) - [vcpkg\_build\_cmake](vcpkg_build_cmake.md) +- [vcpkg\_build\_gn](vcpkg_build_gn.md) - [vcpkg\_build\_make](vcpkg_build_make.md) - [vcpkg\_build\_msbuild](vcpkg_build_msbuild.md) +- [vcpkg\_build\_ninja](vcpkg_build_ninja.md) - [vcpkg\_build\_nmake](vcpkg_build_nmake.md) - [vcpkg\_check\_features](vcpkg_check_features.md) - [vcpkg\_check\_linkage](vcpkg_check_linkage.md) +- [vcpkg\_clean\_executables\_in\_bin](vcpkg_clean_executables_in_bin.md) - [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md) - [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) +- [vcpkg\_configure\_gn](vcpkg_configure_gn.md) - [vcpkg\_configure\_make](vcpkg_configure_make.md) - [vcpkg\_configure\_meson](vcpkg_configure_meson.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) +- [vcpkg\_copy\_tools](vcpkg_copy_tools.md) - [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md) - [vcpkg\_download\_distfile](vcpkg_download_distfile.md) - [vcpkg\_execute\_build\_process](vcpkg_execute_build_process.md) @@ -26,11 +31,14 @@ - [vcpkg\_fail\_port\_install](vcpkg_fail_port_install.md) - [vcpkg\_find\_acquire\_program](vcpkg_find_acquire_program.md) - [vcpkg\_fixup\_cmake\_targets](vcpkg_fixup_cmake_targets.md) +- [vcpkg\_fixup\_pkgconfig](vcpkg_fixup_pkgconfig.md) - [vcpkg\_from\_bitbucket](vcpkg_from_bitbucket.md) - [vcpkg\_from\_git](vcpkg_from_git.md) - [vcpkg\_from\_github](vcpkg_from_github.md) - [vcpkg\_from\_gitlab](vcpkg_from_gitlab.md) +- [vcpkg\_from\_sourceforge](vcpkg_from_sourceforge.md) - [vcpkg\_install\_cmake](vcpkg_install_cmake.md) +- [vcpkg\_install\_gn](vcpkg_install_gn.md) - [vcpkg\_install\_make](vcpkg_install_make.md) - [vcpkg\_install\_meson](vcpkg_install_meson.md) - [vcpkg\_install\_msbuild](vcpkg_install_msbuild.md) diff --git a/docs/maintainers/vcpkg_build_gn.md b/docs/maintainers/vcpkg_build_gn.md new file mode 100644 index 00000000000000..3c3407d9266068 --- /dev/null +++ b/docs/maintainers/vcpkg_build_gn.md @@ -0,0 +1,17 @@ +# vcpkg_build_gn + +Build a GN project + +## Usage: +```cmake +vcpkg_build_gn( + [TARGETS ...] +) +``` + +## Parameters: +### TARGETS +Only build the specified targets. + +## Source +[scripts/cmake/vcpkg_build_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_gn.cmake) diff --git a/docs/maintainers/vcpkg_build_make.md b/docs/maintainers/vcpkg_build_make.md index 5161ba3ce69d1c..3332191d1f7154 100644 --- a/docs/maintainers/vcpkg_build_make.md +++ b/docs/maintainers/vcpkg_build_make.md @@ -4,16 +4,26 @@ Build a linux makefile project. ## Usage: ```cmake -vcpkg_build_make([TARGET ]) +vcpkg_build_make([BUILD_TARGET ] + [ADD_BIN_TO_PATH] + [ENABLE_INSTALL]) + [LOGFILE_ROOT ]) ``` -### TARGET -The target passed to the configure/make build command (`./configure/make/make install`). If not specified, no target will +### BUILD_TARGET +The target passed to the make build command (`./make `). If not specified, the 'all' target will be passed. ### ADD_BIN_TO_PATH Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. +### ENABLE_INSTALL +IF the port supports the install target use vcpkg_install_make() instead of vcpkg_build_make() + +### BUILD_TARGET +The target passed to the make build command (`./make `). If not specified, the 'all' target will +be passed. + ## 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 diff --git a/docs/maintainers/vcpkg_build_ninja.md b/docs/maintainers/vcpkg_build_ninja.md new file mode 100644 index 00000000000000..56a1b6050fef69 --- /dev/null +++ b/docs/maintainers/vcpkg_build_ninja.md @@ -0,0 +1,17 @@ +# vcpkg_build_ninja + +Build a ninja project + +## Usage: +```cmake +vcpkg_build_ninja( + [TARGETS ...] +) +``` + +## Parameters: +### TARGETS +Only build the specified targets. + +## Source +[scripts/cmake/vcpkg_build_ninja.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_ninja.cmake) 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_clean_executables_in_bin.md b/docs/maintainers/vcpkg_clean_executables_in_bin.md new file mode 100644 index 00000000000000..36342790b66f56 --- /dev/null +++ b/docs/maintainers/vcpkg_clean_executables_in_bin.md @@ -0,0 +1,23 @@ +# vcpkg_clean_executables_in_bin + +Remove specified executables found in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. If, after all specified executables have been removed, and the `bin` and `debug/bin` directories are empty, then also delete `bin` and `debug/bin` directories. + +## Usage +```cmake +vcpkg_clean_executables_in_bin( + FILE_NAMES ... +) +``` + +## Parameters +### FILE_NAMES +A list of executable filenames without extension. + +## Notes +Generally, there is no need to call this function manually. Instead, pass an extra `AUTO_CLEAN` argument when calling `vcpkg_copy_tools`. + +## Examples +* [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_clean_executables_in_bin.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_clean_executables_in_bin.cmake) diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md index 276e04190dcac5..21b05aa1df69db 100644 --- a/docs/maintainers/vcpkg_common_definitions.md +++ b/docs/maintainers/vcpkg_common_definitions.md @@ -16,6 +16,7 @@ VCPKG_TARGET_IMPORT_LIBRARY_PREFIX import library prefix for target (same VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX import library suffix for target (same as CMAKE_IMPORT_LIBRARY_SUFFIX) VCPKG_FIND_LIBRARY_PREFIXES target dependent prefixes used for find_library calls in portfiles VCPKG_FIND_LIBRARY_SUFFIXES target dependent suffixes used for find_library calls in portfiles +VCPKG_SYSTEM_LIBRARIES list of libraries are provide by the toolchain and are not managed by vcpkg ``` CMAKE_STATIC_LIBRARY_(PREFIX|SUFFIX), CMAKE_SHARED_LIBRARY_(PREFIX|SUFFIX) and CMAKE_IMPORT_LIBRARY_(PREFIX|SUFFIX) are defined for the target diff --git a/docs/maintainers/vcpkg_configure_gn.md b/docs/maintainers/vcpkg_configure_gn.md new file mode 100644 index 00000000000000..7d98ac9a9fe0ca --- /dev/null +++ b/docs/maintainers/vcpkg_configure_gn.md @@ -0,0 +1,30 @@ +# vcpkg_configure_gn + +Generate Ninja (GN) targets + +## Usage: +```cmake +vcpkg_configure_gn( + SOURCE_PATH + [OPTIONS ] + [OPTIONS_DEBUG ] + [OPTIONS_RELEASE ] +) +``` + +## Parameters: +### SOURCE_PATH (required) +The path to the GN project. + +### OPTIONS +Options to be passed to both the debug and release targets. +Note: Must be provided as a space-separated string. + +### OPTIONS_DEBUG (space-separated string) +Options to be passed to the debug target. + +### OPTIONS_RELEASE (space-separated string) +Options to be passed to the release target. + +## Source +[scripts/cmake/vcpkg_configure_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_gn.cmake) diff --git a/docs/maintainers/vcpkg_configure_make.md b/docs/maintainers/vcpkg_configure_make.md index a18621794a544c..43f7e45f13be95 100644 --- a/docs/maintainers/vcpkg_configure_make.md +++ b/docs/maintainers/vcpkg_configure_make.md @@ -7,9 +7,6 @@ Configure configure for Debug and Release builds of a project. vcpkg_configure_make( SOURCE_PATH <${SOURCE_PATH}> [AUTOCONFIG] - [DISABLE_AUTO_HOST] - [DISABLE_AUTO_DST] - [GENERATOR] [NO_DEBUG] [SKIP_CONFIGURE] [PROJECT_SUBPATH <${PROJ_SUBPATH}>] @@ -28,10 +25,6 @@ By convention, this is usually set in the portfile as the variable `SOURCE_PATH` ### PROJECT_SUBPATH Specifies the directory containing the ``configure`/`configure.ac`. By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. -Should use `GENERATOR NMake` first. - -### NO_DEBUG -This port doesn't support debug mode. ### SKIP_CONFIGURE Skip configure process @@ -39,21 +32,8 @@ Skip configure process ### AUTOCONFIG Need to use autoconfig to generate configure file. -### DISABLE_AUTO_HOST -Don't set host automatically, the default value is `i686`. -If use this option, you will need to set host manually. - -### DISABLE_AUTO_DST -Don't set installation path automatically, the default value is `${CURRENT_PACKAGES_DIR}` and `${CURRENT_PACKAGES_DIR}/debug` -If use this option, you will need to set dst path manually. - -### GENERATOR -Specifies the precise generator to use. -NMake: nmake(windows) make(unix) -MAKE: make(windows) make(unix) - ### PRERUN_SHELL -Script that needs to be called before configuration +Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure) ### OPTIONS Additional options passed to configure during the configuration. diff --git a/docs/maintainers/vcpkg_copy_tools.md b/docs/maintainers/vcpkg_copy_tools.md new file mode 100644 index 00000000000000..1a553eb4028990 --- /dev/null +++ b/docs/maintainers/vcpkg_copy_tools.md @@ -0,0 +1,30 @@ +# vcpkg_copy_tools + +Copy tools and all their DLL dependencies into the `tools` folder. + +## Usage +```cmake +vcpkg_copy_tools( + TOOL_NAMES ... + [SEARCH_DIR <${CURRENT_PACKAGES_DIR}/bin>] + [AUTO_CLEAN] +) +``` +## Parameters +### TOOL_NAMES +A list of tool filenames without extension. + +### SEARCH_DIR +The path to the directory containing the tools. This will be set to `${CURRENT_PACKAGES_DIR}/bin` if ommited. + +### AUTO_CLEAN +Auto clean executables in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. + +## Examples + +* [cpuinfo](https://github.com/microsoft/vcpkg/blob/master/ports/cpuinfo/portfile.cmake) +* [nanomsg](https://github.com/microsoft/vcpkg/blob/master/ports/nanomsg/portfile.cmake) +* [uriparser](https://github.com/microsoft/vcpkg/blob/master/ports/uriparser/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_copy_tools.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_tools.cmake) diff --git a/docs/maintainers/vcpkg_find_acquire_program.md b/docs/maintainers/vcpkg_find_acquire_program.md index 83e01ce0018bb6..a838bb974e6b84 100644 --- a/docs/maintainers/vcpkg_find_acquire_program.md +++ b/docs/maintainers/vcpkg_find_acquire_program.md @@ -25,6 +25,7 @@ The current list of programs includes: - PYTHON2 - PYTHON3 - GIT +- GN - GO - JOM - MESON @@ -43,4 +44,4 @@ Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_ac * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) ## Source -[scripts/cmake/vcpkg_find_acquire_program.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_acquire_program.cmake) +[scripts/cmake/vcpkg_find_acquire_program.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_acquire_program.cmake) diff --git a/docs/maintainers/vcpkg_fixup_cmake_targets.md b/docs/maintainers/vcpkg_fixup_cmake_targets.md index 5abd7c6224d42b..18e8d086797317 100644 --- a/docs/maintainers/vcpkg_fixup_cmake_targets.md +++ b/docs/maintainers/vcpkg_fixup_cmake_targets.md @@ -6,7 +6,7 @@ Additionally corrects common issues with targets, such as absolute paths and inc ## Usage ```cmake -vcpkg_fixup_cmake_targets([CONFIG_PATH ] [TARGET_PATH ]) +vcpkg_fixup_cmake_targets([CONFIG_PATH ] [TARGET_PATH ] [DO_NOT_DELETE_PARENT_CONFIG_PATH]) ``` ## Parameters @@ -22,6 +22,11 @@ This needs to be specified if the port name differs from the `find_package()` na Defaults to `share/${PORT}`. +### DO_NOT_DELETE_PARENT_CONFIG_PATH +By default the parent directory of CONFIG_PATH is removed if it is named "cmake". +Passing this option disable such behavior, as it is convenient for ports that install +more than one CMake package configuration file. + ## Notes Transform all `/debug//*targets-debug.cmake` files and move them to `/`. Removes all `/debug//*targets.cmake` and `/debug//*config.cmake`. diff --git a/docs/maintainers/vcpkg_fixup_pkgconfig.md b/docs/maintainers/vcpkg_fixup_pkgconfig.md new file mode 100644 index 00000000000000..25c6aae5dec0a1 --- /dev/null +++ b/docs/maintainers/vcpkg_fixup_pkgconfig.md @@ -0,0 +1,42 @@ +# vcpkg_fixup_pkgconfig + +Fix common paths in *.pc files and make everything relativ to $(prefix) + +## Usage +```cmake +vcpkg_fixup_pkgconfig( + [RELEASE_FILES ...] + [DEBUG_FILES ...] + [SYSTEM_LIBRARIES ...] +) +``` + +## Parameters +### RELEASE_FILES +Specifies a list of files to apply the fixes for release paths. +Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ + +### DEBUG_FILES +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. + +### IGNORE_FLAGS +If the *.pc file contains flags in the lib field which are not libraries. These can be listed here + +## 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. + +## Source +[scripts/cmake/vcpkg_fixup_pkgconfig.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_pkgconfig.cmake) diff --git a/docs/maintainers/vcpkg_from_sourceforge.md b/docs/maintainers/vcpkg_from_sourceforge.md new file mode 100644 index 00000000000000..c5b5ae6e840c16 --- /dev/null +++ b/docs/maintainers/vcpkg_from_sourceforge.md @@ -0,0 +1,68 @@ +# vcpkg_from_sourceforge + +Download and extract a project from sourceforge. + +## Usage: +```cmake +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO + [REF <2.1-3>] + SHA512 <547b417109332...> + FILENAME + [DISABLE_SSL] + [NO_REMOVE_ONE_LEVEL] + [PATCHES ...] +) +``` + +## Parameters: +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### REPO +The organization or user and repository (optional) on sourceforge. + +### REF +A stable version number that will not change contents. + +### FILENAME +The local name for the file. Files are shared between ports, so the file may need to be renamed to make it clearly attributed to this port and avoid conflicts. + +For example, we can get the download link: +https://sourceforge.net/settings/mirror_choices?projectname=mad&filename=libmad/0.15.1b/libmad-0.15.1b.tar.gz&selected=nchc +So the REPO is `mad/libmad`, the REF is `0.15.1b`, and the FILENAME is `libmad-0.15.1b.tar.gz` + +For some special links: +https://sourceforge.net/settings/mirror_choices?projectname=soxr&filename=soxr-0.1.3-Source.tar.xz&selected=nchc +The REPO is `soxr`, REF is not exist, and the FILENAME is `soxr-0.1.3-Source.tar.xz` + +### SHA512 +The SHA512 hash that should match the archive. + +### WORKING_DIRECTORY +If specified, the archive will be extracted into the working directory instead of `${CURRENT_BUILDTREES_DIR}/src/`. + +Note that the archive will still be extracted into a subfolder underneath that directory (`${WORKING_DIRECTORY}/${REF}-${HASH}/`). + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +### DISABLE_SSL +Disable ssl when downloading source. + +### NO_REMOVE_ONE_LEVEL +Specifies that the default removal of the top level folder should not occur. + +## Examples: + +* [cunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cunit/portfile.cmake) +* [polyclipping](https://github.com/Microsoft/vcpkg/blob/master/ports/polyclipping/portfile.cmake) +* [tinyfiledialogs](https://github.com/Microsoft/vcpkg/blob/master/ports/tinyfiledialogs/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_from_sourceforge.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_sourceforge.cmake) diff --git a/docs/maintainers/vcpkg_install_gn.md b/docs/maintainers/vcpkg_install_gn.md new file mode 100644 index 00000000000000..a1d4156c7e01a6 --- /dev/null +++ b/docs/maintainers/vcpkg_install_gn.md @@ -0,0 +1,23 @@ +# vcpkg_install_gn + +Installs a GN project + +## Usage: +```cmake +vcpkg_install_gn( + SOURCE_PATH + [TARGETS ...] +) +``` + +## Parameters: +### SOURCE_PATH +The path to the source directory + +### TARGETS +Only install the specified targets. + +Note: includes must be handled separately + +## Source +[scripts/cmake/vcpkg_install_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_gn.cmake) diff --git a/docs/specifications/binarycaching.md b/docs/specifications/binarycaching.md new file mode 100644 index 00000000000000..41c5faa5bd3fa2 --- /dev/null +++ b/docs/specifications/binarycaching.md @@ -0,0 +1,155 @@ +# Binary Caching v1.1 + +## Motivation + +The primary motivation of binary caching is to accelerate two broad scenarios in an easily accessible way + +- Continuous Integration + +- Developer Environment Changes (first-time or branch change) + +We generally believe both of these scenarios are addressed with the same feature set, however when differences arise they will be discussed in the individual scenarios. + +It should also be explicitly noted that this specification does not intend to propose a "Microsoft Sanctioned Public Binaries Service" such as nuget.org – we only intend to enable users to leverage services they already have access to, such as GitHub, local file shares, Azure Artifacts, etc. + +## Key User Stories + +### CI -> CI + +In this story, a CI build using either persistent or non-persistent machines wants to potentially reuse binaries built in a previous run of the pipeline. This is partially covered by the Cache tasks in GitHub Actions or Azure DevOps Pipelines, however the Cache task is all-or-nothing: a single package change will prevent restoration and require rebuilding the entire graph which is unacceptable in many scenarios (such as if actively developing one of the packages). + +### CI -> Developer + +In this story, the developer wants to reuse binaries built during a CI run. Given appropriate CI coverage, most developers will always have any needed dependencies pre-built by the CI system. + +Notably, this scenario indicates a need for Read/Write access granularity on the remote storage solution. Developers should not need write access to the output from the CI system for security reasons. + +### Single Developer (same machine reuse) + +With the introduction of manifest files, each project will have separate instances of Vcpkg. The performance costs of rebuilding binaries across each cloned project can be debilitating for those working in micro-repos or open source; for the monolithic enterprise developer it is simply frustrating. + +User-wide binary caching alleviates the pain of this scenario by ensuring the same binaries aren’t built multiple times (as long as the projects truly overlap with respect to versions/packages/etc). + +### Developer <-> Developer (multi-machine / team scenario) + +In a small team scenario, it's reasonable that multiple developer machines can trust each other enough to share binaries. This also applies to developers that have multiple machines and wish to share binaries between them (given a similar enough environment). + +## Solution Aspects + +### Tracking Compilers + +In order to provide reliable binary caching, vcpkg must determine if the produced binaries are appropriate for the current context. Currently, we consider many factors, including: + +- All files in the port directory + +- The toolchain file contents + +- The triplet contents + +- All dependency binaries + +- The version of the CMake tool used to build + +and a few others. + +However, we notably do not currently track the compiler used. This is critical for all cross-machine scenarios, as the environment is likely to change incompatibly from machine to machine. We propose hashing the compiler that will used by CMake. This can be accomplished either by reimplementing the logic of CMake or running some partial project and extracting the results. For performance reasons, we will prefer first using heuristics to approximate the CMake logic with accompanying documentation for users that fall outside those bounds. + +Another aspect of the environment we don't currently track is the CRT version on Linux systems. Currently, we believe this will not cause as many problems in most practices (thus not suitable for an MVP), since the compiler will (generally) link against the system CRT and should sufficiently reflect any differences. This can also be easily worked around by the user with documentation – the toolchain file can simply have a comment such as "# this uses muslc", which will cause it to hash differently. + +### Better control over source modifications + +Currently, vcpkg caches sources inside `buildtrees/$PORT/src/`. The built-in helpers, such as `vcpkg_extract_archive_ex()` assume that if the appropriately named source folder exists, it is true, accurate, and without modification. + +However, the basic workflow for working on ports (specifically, developing patches) breaks this assumption by directly editing whatever extracted source directory the tool is currently using until a successful build is achieved. The user then usually builds a patch file from their changes, then checks it in to the port directory (adding the changes to one of the tracked locations above) and everything is restored to normal. + +However, this causes serious issues with the current tracking system, because modifications to this cached source are not detected and tracked into the binary package. + +Our proposed solution is to force source re-extraction each time during builds that have uploading to any protocol enabled. Uploading/downloading can then be disabled on the command line via the --editable switch to reuse extracted sources and enable the current workflow. + +### Protocols + +To service different scenarios and user requirements, we need to support multiple backends. Currently, our CI system uses our only implemented backend: file-based archives. + +#### Backend #1: File-Based Archives + +This backend simply stores .zip files in a hierarchy similar to git objects: `$VCPKG_ROOT/archives/$XX/$YYYY.zip` with `$XX` being the first two characters of the computed package hash, and `$YYYY` being the full expanded hash. It also supports storing failure logs as `$VCPKG_ROOT/archives/fail/$XX/$YYYY.zip`, however we consider this an internal feature that is not relevant to the key User Stories. + +Our CI system uses this backend by symlinking this directory to an Azure Files share, enabling built binaries and failure logs to be shared by all machines in the pool. Credentials are handled at the time of mounting the Azure Files share, so this does not require interactive authentication. + +This protocol is ideal due to simplicity for same-machine reuse and simple serverless scenarios such as using networked SMB folders across multiple machines for very small teams. However, it has three significant limitations in the current incarnation: + +- It uses the hardcoded directory `$VCPKG_ROOT/archives` (redirectable using symlinks, but unwieldy) + +- It cannot use multiple directories + +- There is no ability to treat directories as "read-only"/immutable + +These second two points are required to implement the very useful concept of "fallback" folders (see https://github.com/NuGet/Home/wiki/%5BSpec%5D-Fallback-package-folders for NuGet’s spec on this topic). + +#### Backend #2: NuGet (Azure DevOps Artifacts, GitHub Packages, etc) + +This backend packages binaries into a "raw" NuGet package (not suitable for direct import by MSBuild projects) and uploads them to supported NuGet servers such as Azure DevOps Artifacts and GitHub Packages. We believe this will best satisfy the CI scenarios – both CI -> CI as well as CI -> Developer by relying on powerful, centralized, managed hosting. + +There is a difference in this case between the developer and CI scenarios. The developer generally wants to configure their remotes for the project and then be able to run vcpkg commands as normal, with packages automatically being downloaded and uploaded to optimize the experience. This is similar to File-Based Archives. + +While a CI system could use the same workflow as a developer, there are a few key differences. First, a CI system must use a stored secret for authentication, because it cannot interactively authenticate. Second, to enable more complex interactions with systems such as package signing and task-based restores, we must also support a 4-step workflow: + +1. Vcpkg computes hashes of any potentially required packages and writes them to a file + +2. An unspecified service/task/etc can parse this file and download any appropriate packages + +3. vcpkg is then invoked a second time, with any downloaded packages. This consumes the packages, performs any installations and builds, and potentially produces new packages to an output folder. + +4. Finally, another unspecified service/task/etc can take these output packages, sign them, and upload them. + +This flow enables arbitrarily complex, user-defined authentication and signing schemes, such as the tasks provided by GitHub Actions and Azure DevOps Pipelines or manual signing as documented in the NuGet documentation: https://docs.microsoft.com/en-us/nuget/create-packages/sign-a-package. + +#### Configuration + +Currently, our file-based backend is enabled by passing the undocumented `--binarycaching` flag to any Vcpkg command or setting the undocumented environment variable `VCPKG_FEATURE_FLAGS` to `binarycaching`. We will replace this feature flag with an on-by-default user-wide behavior, plus command line and environment-based configurability. + +The on-by-default configuration will specify the file-based archive protocol on either `%LOCALAPPDATA%/vcpkg/archives` (Windows) or `$XDG_CACHE_HOME/vcpkg/archives` (Unix). If `XDG_CACHE_HOME` is not defined on Unix, we will fall back to `$HOME/.cache/vcpkg/archives` based on the [XDG Base Directory Specification][1]. This can be redirected with a symlink, or completely overridden with the command line or environment. In the future we can also consider having a user-wide configuration file, however we do not believe this is important for any of our key scenarios. + +On the command line, a backend can be specified via `--binarysource=`. Multiple backends can be specified by passing the option multiple times and the order of evaluation is determined by the order on the command line. Writes will be performed on all upload backends, but only for packages that were built as part of this build (the tool will not repackage/reupload binaries downloaded from other sources). + +The environment variable `VCPKG_BINARY_SOURCES` can be set to a semicolon-delimited list of ``. Empty `` strings are valid and ignored, to support appending like `set VCPKG_BINARY_SOURCES=%VCPKG_BINARY_SOURCES%;foo` or `export VCPKG_BINARY_SOURCES="$VCPKG_BINARY_SOURCES;foo"` + +`` can be any of: + +- `clear` - ignore all lower priority sources (lowest priority is default, then env, then command line) + +- `default[,]` - Reintroduce the default ~/.vcpkg/packages (as read-only or with uploading) + +- `files,[,]` - Add a file-based archive at `` + +- `nuget,[,]` - Add a nuget-based source at ``. This url has a similar semantic as `nuget.exe restore -source ` for reads and `nuget.exe push -source ` for writes; notably it can also be a local path. + +- `nugetconfig,[,]` - Add a nuget-based source using the NuGet.config file at ``. This enables users to fully control NuGet's execution in combination with the documented NuGet environment variables. This has similar semantics to `nuget.exe push -ConfigFile ` and `nuget.exe restore -ConfigFile `. + +- `interactive` - Enables interactive mode (such as manual credential entry) for all other configured backends. + +`` can be any of `read`, `write`, or `readwrite` to control whether packages will be consumed or published. + +Backtick (`) can be used as an escape character within config strings, with double backtick (``) inserting a single backtick. All paths must be absolute. + +For all backends, noninteractive operation will be the default and the vcpkg tool will take a `--interactive` parameter to enable prompting for user credentials (if needed by the backend). + +To enable the 4-step flow, `vcpkg install` will take a command `--write-nuget-packages-config=` which can be used in combination with `--dry-run`. This path can be relative and will resolve with respect to the current working directory. + +[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + +#### Example 4-step flow + +``` +PS> vcpkg install --dry-run pkg1 pkg2 pkg3 --write-nuget-packages-config=packages.config +``` + +An unspecified process, such as `nuget.exe restore packages.config -packagedirectory $packages` or the [ADO task][2], restores the packages to `$packages`. + +``` +PS> vcpkg install pkg1 pkg2 pkg3 --binarysource=clear --binarysource=nuget,$outpkgs,upload --binarysource=nuget,$packages +``` + +Another unspecified process such as `nuget.exe sign $outpkgs/*.nupkg` and `nuget.exe push $outpkgs/*.nupkg` or the ADO task uploads the packages for use in future CI runs. + +[2]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/package/nuget?view=azure-devops diff --git a/docs/specifications/manifests.md b/docs/specifications/manifests.md new file mode 100644 index 00000000000000..350cfd0c7df514 --- /dev/null +++ b/docs/specifications/manifests.md @@ -0,0 +1,298 @@ +# Manifests -- `vcpkg.json` + +For many other language package managers, there exists a way of writing one's dependencies in a declarative +manifest format; we want something similar for vcpkg. What follows is the specification of that feature; +this should mean that vcpkg becomes far more user and enterprise-friendly, and is additionally an important +first step for versioning and package federation. Our primary concern, beyond implementability, is ease-of-use; +it is important that using this feature is all of: + +* Easy for existing users +* Easy for new users to set up +* Easy to extend later for new features like versioning and federation +* _Declarative_, not _Imperative_. + +## Reasoning + +### Why JSON? + +We choose JSON for five main reasons: + +* Everybody knows JSON, and if one doesn't, it's really easy to learn +* Every tool supports JSON in the standard library, or in a commonly used support library + * This means writing tooling should be trivial in any language one is comfortable with + * Most configuration formats don't have a COBOL implementation 😉 +* Specified in an international standard + * There is _one_ right way to parse JSON + * There are no ambiguities of what the parse tree _should_ be +* Simple and secure + * Unlike YAML, for example, there's no weird ACE issues + * Easy to write a parser -- important since we can't depend on external libraries +* Schemas are almost a necessity + +Some have suggested allowing comments or commas in our parser; we chose to use JSON proper +rather than JSON5 or JSON with comments because JSON is the everywhere-supported international +standard. That is not necessarily true of JSON with comments. Additionally, if one needs +to write a comment, they can do so via `"$reason"` or `"$comment"` fields. + +## Specification + +A manifest file shall have the name `vcpkg.json`, and shall be in the root directory of a package. +It also replaces CONTROL files, though existing CONTROL files will still be +supported; there will be no difference between ports and packages, except +that packages do not need to supply portfile.cmake (eventually we would like +to remove the requirement of portfile.cmake for ports that already use +CMake). + +The specification uses definitions from the [Definitions](#definitions) section in order +to specify the shape of a value. Note that any object may contain any directives, written as +a field key that starts with a `$`; these directive shall be ignored by `vcpkg`. Common +directives may include `"$schema"`, `"$comment"`, `"$reason"`. + +A manifest must be a top-level object, and must have at least: + +* `"name"`: a `` +* One (and only one) of the following version fields: + * `"version-string"`: A `string`. Has no semantic meaning. + Equivalent to `CONTROL`'s `Version:` field. + * Other version fields will be defined by the Versions RFC + +The simplest vcpkg.json looks like this: + +```json +{ + "name": "mypackage", + "version-string": "0.1.0-dev" +} +``` + +Additionally, it may contain the following properties: +* `"port-version"`: A non-negative integer. If this field doesn't exist, it's assumed to be `0`. + * Note that this is a change from existing CONTROL files, where versions were a part of the version string +* `"maintainers"`: An array of `string`s which contain the authors of a package + * `"maintainers": [ "Nicole Mazzuca ", "שלום עליכם " ]` +* `"description"`: A string or array of strings containing the description of a package + * `"description": "mypackage is a package of mine"` +* `"homepage"`: A url which points to the homepage of a package + * `"homepage": "https://github.com/strega-nil/mypackage"` +* `"documentation"`: A url which points to the documentation of a package + * `"documentation": "https://readthedocs.io/strega-nil/mypackage"` +* `"license"`: A `` + * `"license": "MIT"` +* `"dependencies"`: An array of ``s +* `"dev-dependencies"`: An array of ``s which are required only for developers (testing and the like) +* `"features"`: An array of ``s that the package supports +* `"default-features"`: An array of ``s that correspond to features, which will be used by default. +* `"supports"`: A `` + * `"supports": "windows & !arm"` + +Any properties which are not listed, and which do not start with a `$`, +will be warned against and are reserved for future use. + +The following is an example of an existing port CONTROL file rewritten as a vcpkg.json file: + +``` +Source: pango +Version: 1.40.11-6 +Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ +Description: Text and font handling library. +Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) +``` + +```json +{ + "name": "pango", + "version-string": "1.40.11", + "port-version": 6, + "homepage": "https://ftp.gnome.org/pub/GNOME/sources/pango/", + "description": "Text and font handling library.", + "dependencies": [ + "glib", + "gettext", + "cairo", + "fontconfig", + "freetype", + { + "name": "harfbuzz", + "features": [ "glib" ], + "platform": "!(windows & static) & !osx" + } + ] +} +``` + +## Behavior of the Tool + +There will be two "modes" for vcpkg from this point forward: "classic", and "manifest". +The former will act exactly like the existing vcpkg workflow, so as to avoid breaking +anyone. The latter will be the mode only when the user either: + +* Passes `--manifest-root-dir=` (initially, `x-manifest-root-dir`) +* Runs `vcpkg` in a directory that contains a file named `vcpkg.json`, or in a + child directory of a directory containing `vcpkg.json`. + * For this, initially vcpkg will warn that the behavior will change in the + future, and simply run in classic mode, unless the feature flag `manifests` is + passed via: + * The environment variable `VCPKG_FEATURE_FLAGS` + * The option `--feature-flags` + * (e.g., `--feature-flags=binarycaching,manifests`) + * If someone wants to use classic mode and silence the warning, they can add the + `-manifests` feature flag to disable the mode. + +When in "manifest" mode, the `installed` directory will be changed to +`/vcpkg_installed` (name up for bikeshedding). +The following commands will change behavior: + +* `vcpkg install` without any port arguments will install the dependencies listed in + the manifest file, and will remove any dependencies + which are no longer in the dependency tree implied by the manifest file. +* `vcpkg install` with port arguments will give an error. + +The following commands will not work in manifest mode, at least initially: + +* `vcpkg x-set-installed`: `vcpkg install` serves the same function +* `vcpkg remove` +* `vcpkg export` + +We may add these features back for manifest mode once we understand how best to +implement them. + +### Behavior of the Toolchain + +Mostly, the toolchain file stays the same; however, we shall add +two public options: + +```cmake +VCPKG_MANIFEST_MODE:BOOL= +VCPKG_MANIFEST_INSTALL:BOOL=ON +``` + +The first option either explicitly turns on, or off, manifest mode; +otherwise, we default to looking for a manifest file in the directory +tree upwards from the source directory. + +The `VCPKG_MANIFEST_INSTALL` option tells the toolchain whether to +install the packages or not -- if you wish to install the manifest +dependencies manually, you can set this to off, and we also turn it +off for packages installed by vcpkg. + +Additionally, if `-manifests` is set in the feature flags environment +variable, we turn off manifest mode in the toolchain, and we act like +the classic toolchain. + +### Example - CMake Integration + +An example of using the new vcpkg manifests feature for a new +project follows: + +The filesystem structure should look something like: + +``` +example/ + src/ + main.cxx + CMakeLists.txt + vcpkg.json +``` + +Then, `main.cxx` might look like: + +```cpp +#include + +int main() { + fmt::print("Hello, {}!", "world"); +} +``` + +Therefore, in `vcpkg.json`, we'll need to depend on `fmt`: + +```json +{ + "name": "example", + "version-string": "0.0.1", + "dependencies": [ + "fmt" + ] +} +``` + +Then, let's write our `CMakeLists.txt`: + +```cmake +cmake_minimum_required(VERSION 3.14) + +project(example CXX) + +add_executable(example src/main.cxx) + +find_package(fmt REQUIRED) + +target_link_libraries(example + PRIVATE + fmt::fmt) +``` + +And finally, to configure and build: + +```sh +$ cd example +$ cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystem/vcpkg.cmake +... configuring and installing... +$ cmake --build build +``` + +and we're done! `fmt` will get installed into +`example/build/vcpkg_installed`, and we can run our executable with: + +```sh +$ build/example +Hello, world! +``` + +## Definitions + +* ``: A `string` which: + * Is entirely ASCII + * Contains only lowercase alphabetic characters, digits, and hyphen-minus + * Does not have multiple consecutive hyphens + * Does not begin nor end with a hyphen + * Is not a Windows filesystem reserved name + * Is not a vcpkg reserved name: "default" or "core". + * In other words, it must follow the regex `[a-z0-9]+(-[a-z0-9]+)*`, and must not be any of: + * `{ prn, aux, nul, con, lpt[1-9], com[1-9], core, default }` +* ``: A `string` consisting of a non-zero number of ``s, separated by `.`. + * `a.b.c` is valid + * `a` is valid + * `a/b` is not valid + * `Boost.Beast` is not valid, but `boost.beast` is +* ``: Either a ``, or an object: + * A dependency always contains the following: + * `"name"`: A `` + * Optionally, `"features"`: an array of ``s corresponding to features in the package. + * Optionally, `"default-features"`: a `boolean`. If this is false, then don't use the default features of the package; equivalent to core in existing CONTROL files. If this is true, do the default thing of including the default features. + * Optionally, `"platform"`: a `` + * ``: No extra fields are required. +* ``: An SPDX license expression at version 3.9. +* ``: A specification of a set of platforms; used in platform-specific dependencies and supports fields. A string that is parsed as follows: + * ``: + * `` + * `` + * `` + * ``: + * `( )` + * `` + * ``: + * regex: `/^[a-z0-9]+$/` + * ``: + * `` + * `! ` + * `` + * `` + * ` & ` + * `` + * `` + * ` | ` +* ``: An object containing the following: + * `"name"`: An ``, the name of the feature + * `"description"`: A `string` or array of `string`s, the description of the feature + * Optionally, `"dependencies"`: An array of ``s, the dependencies used by this feature diff --git a/docs/specifications/prefab.md b/docs/specifications/prefab.md index bb0479c4c5c6df..4574e01ee8779a 100644 --- a/docs/specifications/prefab.md +++ b/docs/specifications/prefab.md @@ -1,64 +1,89 @@ -## Exporting to Android Archives (AAR files) +# Vcpkg: export Android prefab Archives (AAR files) -Vcpkg current supports exporting to android archive files([AAR files](https://developer.android.com/studio/projects/android-library)). Once the archive is created it can imported in Android Studio as a native dependent. The archive is automatically consumed using [android studio's prefab tool](https://github.com/google/prefab). For more information on Prefab checkout the following article ["Native Dependencies in Android Studio 4.0"](https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html) and the documentation on how to use prefab on [https://google.github.io/prefab/](https://google.github.io/prefab). +Vcpkg can export android archives ([AAR files](https://developer.android.com/studio/projects/android-library)). Once an archive is created, it can imported in Android Studio as a native dependent. The archive is automatically consumed using [android studio's prefab tool](https://github.com/google/prefab). -#### To support export to android the following tools should be available; +For more information on Prefab, refer to: +* The [official prefab documentation](https://google.github.io/prefab). +* a blog post from Android developers blog: [Native Dependencies in Android Studio 4.0](https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html) -- `maven ` -- `ndk ` -- `7zip ` or `zip ` +_Note for Android Studio users: prefab packages are supported on Android Studio 4+_ -**Android triplets that support the following architectures arm64-v8a, armeabi-v7a, x86_64 x86 must be present** +## Requirements -#### An example of a triplet configuration targeting android would be +1. `ndk ` -```cmake -set(VCPKG_TARGET_ARCHITECTURE arm64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_CMAKE_SYSTEM_NAME Android) -``` +Set environment variable `ANDROID_NDK_HOME` to your android ndk installation. For example: + +```` +export ANDROID_NDK_HOME=/home/your-account/Android/Sdk/ndk-bundle +```` + +2. `7zip ` or `zip ` + +3. `maven ` + +4. Android triplets + +See [android.md](../users/android.md) for instructions on how to install the triplets. + +*Please note that in order to use "prefab" (see below), the four architectures are required. If any is missing the export will fail* -The following table outlines the mapping from vcpkg architectures to android architectures -|vcpkg architecture | android architecture | -|-------------------|----------------------| -|arm64 | arm64-v8a | -|arm | armeabi-v7a | -|x64 | x86_64 | -|x86 | x86 | +## Example exporting [jsoncpp] -**Please note the four architectures are required. If any is missing the export will fail** -**To export the following environment `ANDROID_NDK_HOME` variable is required for exporting** +First "vcpkg install" the 4 android architectures (it is mandatory to export all 4 of them) + +```` +./vcpkg install jsoncpp:arm-android jsoncpp:arm64-android jsoncpp:x64-android jsoncpp:x86-android +```` + + +Then, export the prefab: + +Note: +* The `--prefab-maven` flag is optional. Call it if you maven is installed. +* The `--prefab-debug` flag will output instructions on how to use the prefab archive via gradle. -#### Example exporting [jsoncpp] -The `--prefab-maven` flag is option. Only call it when you have maven installed ``` -./vcpkg export --triplet x64-android jsoncpp --prefab --prefab-maven +./vcpkg export --triplet x64-android jsoncpp --prefab --prefab-maven --prefab-debug ``` +You will see an ouput like this: ``` The following packages are already built and will be exported: - jsoncpp:x86-android + jsoncpp:arm64-android + Exporting package jsoncpp... +[DEBUG] Found 4 triplets + arm64-android + x64-android + x86-android + arm-android + +... +... Lots of output... +... + [INFO] Scanning for projects... -[INFO] -[INFO] ------------------< org.apache.maven:standalone-pom >------------------- -[INFO] Building Maven Stub Project (No POM) 1 -[INFO] --------------------------------[ pom ]--------------------------------- -[INFO] -[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- -[INFO] Installing/prefab/jsoncpp/jsoncpp-1.9.2.aar to /.m2/repository/com/vcpkg/ndk/support/jsoncpp/1.9.2/jsoncpp-1.9.2.aar -[INFO] Installing /prefab/jsoncpp/pom.xml to /.m2/repository/com/vcpkg/ndk/support/jsoncpp/1.9.2/jsoncpp-1.9.2.pom -[INFO] ------------------------------------------------------------------------ +Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom + +... +... Lots of output... +... + [INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 0.301 s -[INFO] Finished at: 2020-03-01T10:18:15Z -[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 2.207 s +[INFO] Finished at: 2020-05-10T14:42:28+02:00 + + +... +... Lots of output... +... + +[DEBUG] Configuration properties in Android Studio In app/build.gradle - com.vcpkg.ndk.support:jsoncpp:1.9.2 + com.vcpkg.ndk.support:jsoncpp:1.9.2 And cmake flags @@ -75,50 +100,59 @@ In gradle.properties android.enableParallelJsonGen=false android.prefabVersion=${prefab.version} -Successfuly exported jsoncpp. Checkout /prefab/jsoncpp/aar +Successfuly exported jsoncpp. Checkout .../vcpkg/prefab + ``` #### The output directory after export -``` + +```` prefab -└── jsoncpp - ├── aar +└── jsoncpp/ + ├── aar/ │   ├── AndroidManifest.xml - │   ├── META-INF - │   │   └── LICENCE - │   └── prefab - │   ├── modules - │   │   └── jsoncpp - │   │   ├── include - │   │   │   └── json - │   │   │   ├── allocator.h - │   │   │   ├── assertions.h - │   │   │   ├── autolink.h - │   │   │   ├── config.h - │   │   │   ├── forwards.h - │   │   │   ├── json.h - │   │   │   ├── json_features.h - │   │   │   ├── reader.h - │   │   │   ├── value.h - │   │   │   ├── version.h - │   │   │   └── writer.h - │   │   ├── libs - │   │   │   ├── android.arm64-v8a + │   ├── META-INF/ + │   │   └── LICENSE + │   └── prefab/ + │   ├── modules/ + │   │   └── jsoncpp/ + │   │   ├── libs/ + │   │   │   ├── android.arm64-v8a/ │   │   │   │   ├── abi.json + │   │   │   │   ├── include/ + │   │   │   │   │   └── json/ + │   │   │   │   │   ├── json.h + │   │   │   │   │   └── .... │   │   │   │   └── libjsoncpp.so - │   │   │   ├── android.armeabi-v7a + │   │   │   ├── android.armeabi-v7a/ │   │   │   │   ├── abi.json + │   │   │   │   ├── include/ + │   │   │   │   │   └── json/ + │   │   │   │   │   ├── json.h + │   │   │   │   │   └── .... │   │   │   │   └── libjsoncpp.so - │   │   │   ├── android.x86 + │   │   │   ├── android.x86/ │   │   │   │   ├── abi.json + │   │   │   │   ├── include/ + │   │   │   │   │   └── json/ + │   │   │   │   │   ├── json.h + │   │   │   │   │   └── .... │   │   │   │   └── libjsoncpp.so - │   │   │   └── android.x86_64 + │   │   │   └── android.x86_64/ │   │   │   ├── abi.json + │   │   │   ├── include/ + │   │   │   │   └── json/ + │   │   │   │   │   ├── json.h + │   │   │   │   │   └── .... │   │   │   └── libjsoncpp.so │   │   └── module.json │   └── prefab.json ├── jsoncpp-1.9.2.aar └── pom.xml +```` -13 directories, 25 files -``` +## Example consuming [jsoncpp] via vcpkg and prefab + +See the example repo here: + +https://github.com/atkawa7/prefab-vpkg-integration-sample diff --git a/docs/tool-maintainers/testing.md b/docs/tool-maintainers/testing.md index 0284a2650ae7d1..a9e866d9e8e235 100644 --- a/docs/tool-maintainers/testing.md +++ b/docs/tool-maintainers/testing.md @@ -77,7 +77,7 @@ First, we should create a file, `example.cpp`, in `toolsrc/src/vcpkg-test`: ```cpp // vcpkg-test/example.cpp -#include +#include ``` This is the minimum file needed for tests; let's rebuild! diff --git a/docs/users/android.md b/docs/users/android.md new file mode 100644 index 00000000000000..6ff1d05d15bef7 --- /dev/null +++ b/docs/users/android.md @@ -0,0 +1,168 @@ +# Vcpkg and Android + +Android is not officialy supported, and there are no official android triplets at the moment. + +However, some packages can compile to Android, and the situation is improving: see the list of [PR related to Android](https://github.com/Microsoft/vcpkg/pulls?q=+android+). + + +## Android build requirements + +1. Download the [android ndk](https://developer.android.com/ndk/downloads/) + +2. Set environment variable `ANDROID_NDK_HOME` to your android ndk installation. + For example: + +````bash +export ANDROID_NDK_HOME=/home/your-account/Android/Sdk/ndk-bundle +```` + +Or: +````bash +export ANDROID_NDK_HOME=/home/your-account/Android/android-ndk-r21b +```` + +3. Install [vcpkg](https://github.com/microsoft/vcpkg) + +4. Set environment variable `VCPKG_ROOT` to your vcpkg installation. +````bash +export VCPKG_ROOT=/path/to/vcpkg +```` + +## Create the android triplets + + +### Android ABI and corresponding vcpkg triplets + +There are four different Android ABI, each of which maps to +a vcpkg triplet. The following table outlines the mapping from vcpkg architectures to android architectures + +|VCPKG_TARGET_TRIPLET | ANDROID_ABI | +|---------------------------|----------------------| +|arm64-android | arm64-v8a | +|arm-android | armeabi-v7a | +|x64-android | x86_64 | +|x86-android | x86 | + +### Create the android triplets +You can copy-paste the script below to populate them, and adjust them to your needs if required. + +````bash +cd $VCPKG_ROOT + +echo " +set(VCPKG_TARGET_ARCHITECTURE arm) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +" > triplets/community/arm-android.cmake + +echo " +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +" > triplets/community/arm64-android.cmake + +echo " +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +" > triplets/community/x86-android.cmake + +echo " +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +" > triplets/community/x64-android.cmake +```` + +## Install libraries for Android using vcpkg + +Example for jsoncpp: + +````bash +cd $VCPKG_ROOT + +# specify the triplet like this +./vcpkg install jsoncpp --triplet arm-android +# or like this +./vcpkg install jsoncpp:arm64-android +./vcpkg install jsoncpp:x86-android +./vcpkg install jsoncpp:x64-android +```` + +## Consume libraries using vpckg, cmake and the android toolchain + +1. Combine vcpkg and Android toolchains + +vcpkg and android both provide dedicated toolchains: +````bash +vcpkg_toolchain_file=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake +android_toolchain_file=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake +```` + +When using vcpkg, the vcpkg toolchain shall be specified first. + +However, vcpkg provides a way to preload and additional toolchain, with the VCPKG_CHAINLOAD_TOOLCHAIN_FILE option. + +````bash +cmake \ + -DCMAKE_TOOLCHAIN_FILE=$vcpkg_toolchain_file \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$android_toolchain_file \ + ... +```` + +2. Specifiy the android abi and vcpkg triplet + +When compiling for android, you need to select a matching "android abi" / "vcpkg triplet" pair. + +For example: + +````bash +android_abi=armeabi-v7a +vcpkg_target_triplet=arm-android + +cmake + ... + -DVCPKG_TARGET_TRIPLET=$vcpkg_target_triplet \ + -DANDROID_ABI=$android_abi +```` + +### Test on an example + +The folder [docs/examples/vcpkg_android_example_cmake](../examples/vcpkg_android_example_cmake) provides a working example, with an android library that consumes the jsoncpp library: + +*Details* + +* The [CMakeLists](../examples/vcpkg_android_example_cmake/CMakeLists.txt) simply uses `find_package` and `target_link_library` + +* The [compile.sh](../examples/vcpkg_android_example_cmake/compile.sh) script enables you to select any matching pair of "android abi" / "vcpkg triplet" and to test the compilation + +* The dummy [my_lib.cpp](../examples/vcpkg_android_example_cmake/my_lib.cpp) file uses the jsoncpp library + +*Note*: this example only compiles an Android library, as the compilation of a full fledged Android App is beyond the scope of this document. + +### Test on an example, using [vcpkg_android.cmake](../examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake) + +The folder [docs/examples/vcpkg_android_example_cmake_script](../examples/vcpkg_android_example_cmake_script) provides the same example, and uses a cmake script in order to simplify the usage. + +*Details* + +* The main [CMakeLists](../examples/vcpkg_android_example_cmake_script/CMakeLists.txt) loads [vcpkg_android.cmake](../examples/vcpkg_android_example_cmake_script/cmake/vcpkg_android.cmake) if the flag `VCPKG_TARGET_ANDROID` is set: +````cmake +if (VCPKG_TARGET_ANDROID) + include("cmake/vcpkg_android.cmake") +endif() +```` +*Important: place these lines before calling project() !* + +* The [compile.sh](../examples/vcpkg_android_example_cmake_script/compile.sh) script shows that it is then possible to compile for android using a simple cmake invocation, for example: +````bash +cmake .. -DVCPKG_TARGET_ANDROID=ON -DANDROID_ABI=armeabi-v7a +```` + +## Consume libraries using vpckg, and Android prefab Archives (AAR files) + +See [prefab.md](../specifications/prefab.md) \ No newline at end of file diff --git a/docs/users/config-environment.md b/docs/users/config-environment.md index bffa072780710b..22f7ff84a2d3e1 100644 --- a/docs/users/config-environment.md +++ b/docs/users/config-environment.md @@ -15,6 +15,7 @@ subject to change without notice and should be considered highly unstable. Non-exhaustive list of off-by-default features: - `binarycaching` +- `manifest` #### EDITOR @@ -37,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 cd5f61e9debb22..e9a9c42cda0ac0 100644 --- a/docs/users/integration.md +++ b/docs/users/integration.md @@ -17,7 +17,7 @@ These link your project(s) to a specific copy of Vcpkg on your machine so any up ```no-highlight vcpkg integrate install ``` -This will implicitly add Include Directories, Link Directories, and Link Libraries for all packages installed with Vcpkg to all VS2015 and VS2017 MSBuild projects. We also add a post-build action for executable projects that will analyze and copy any DLLs you need to the output folder, enabling a seamless F5 experience. +This will implicitly add Include Directories, Link Directories, and Link Libraries for all packages installed with Vcpkg to all VS2015, VS2017 and VS2019 MSBuild projects. We also add a post-build action for executable projects that will analyze and copy any DLLs you need to the output folder, enabling a seamless F5 experience. 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. diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 30fd66eea8608e..10ac31fd5736e4 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -29,7 +29,7 @@ Community Triplets are enabled by default, when using a community triplet a mess ### VCPKG_TARGET_ARCHITECTURE Specifies the target machine architecture. -Valid options are `x86`, `x64`, `arm`, and `arm64`. +Valid options are `x86`, `x64`, `arm`, `arm64` and `wasm32`. ### VCPKG_CRT_LINKAGE Specifies the desired CRT linkage (for MSVC). @@ -47,8 +47,11 @@ Specifies the target platform. Valid options include any CMake system name, such as: - Empty (Windows Desktop for legacy reasons) - `WindowsStore` (Universal Windows Platform) +- `MinGW` (Minimalist GNU for Windows) - `Darwin` (Mac OSX) +- `iOS` (iOS) - `Linux` (Linux) +- `Emscripten` (WebAssembly) ### VCPKG_CMAKE_SYSTEM_VERSION Specifies the target platform system version. @@ -126,7 +129,7 @@ Valid settings: * The Visual Studio 2015 platform toolset is `v140`. ### VCPKG_LOAD_VCVARS_ENV -If `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` is used, VCPKG will not setup the Visual Studio environment. +If `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` is used, VCPKG will not setup the Visual Studio environment. Setting `VCPKG_LOAD_VCVARS_ENV` to (true|1|on) changes this behavior so that the Visual Studio environment is setup following the same rules as if `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` was not set. ## MacOS Variables @@ -166,3 +169,6 @@ The default triplet when running any vcpkg command is `%VCPKG_DEFAULT_TRIPLET%` - OSX: `x64-osx` We recommend using a systematic naming scheme when creating new triplets. The Android toolchain naming scheme is a good source of inspiration: https://developer.android.com/ndk/guides/standalone_toolchain.html. + +## Android triplets +See [android.md](android.md) diff --git a/ports/3fd/CONTROL b/ports/3fd/CONTROL deleted file mode 100644 index 75eecaa31fbab6..00000000000000 --- a/ports/3fd/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: 3fd -Version: 2.6.2-3 -Description: C++ Framework For Fast Development -Build-Depends: boost-lockfree (windows), boost-regex (windows), poco (windows), sqlite3, rapidxml diff --git a/ports/3fd/vcpkg.json b/ports/3fd/vcpkg.json new file mode 100644 index 00000000000000..92c53d327f5a79 --- /dev/null +++ b/ports/3fd/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "3fd", + "version-string": "2.6.2", + "port-version": 3, + "description": "C++ Framework For Fast Development", + "dependencies": [ + { + "name": "boost-lockfree", + "platform": "windows" + }, + { + "name": "boost-regex", + "platform": "windows" + }, + { + "name": "poco", + "platform": "windows" + }, + "rapidxml", + "sqlite3" + ] +} diff --git a/ports/abseil/CONTROL b/ports/abseil/CONTROL deleted file mode 100644 index bcde132e82ecfc..00000000000000 --- a/ports/abseil/CONTROL +++ /dev/null @@ -1,10 +0,0 @@ -Source: abseil -Version: 2020-03-03-2 -Homepage: https://github.com/abseil/abseil-cpp -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. - -Feature: cxx17 -Description: Enable compiler C++17. diff --git a/ports/abseil/fix-MSVCbuildfail.patch b/ports/abseil/fix-MSVCbuildfail.patch new file mode 100644 index 00000000000000..7c041c27bb9187 --- /dev/null +++ b/ports/abseil/fix-MSVCbuildfail.patch @@ -0,0 +1,65 @@ +diff --git a/absl/container/internal/compressed_tuple.h b/absl/container/internal/compressed_tuple.h +index 4bfe92f..02bfd03 100644 +--- a/absl/container/internal/compressed_tuple.h ++++ b/absl/container/internal/compressed_tuple.h +@@ -169,9 +169,33 @@ constexpr bool ShouldAnyUseBase() { + } + + template +-using TupleMoveConstructible = typename std::conditional< +- std::is_reference::value, std::is_convertible, +- std::is_constructible>::type; ++using TupleElementMoveConstructible = ++ typename std::conditional::value, ++ std::is_convertible, ++ std::is_constructible>::type; ++ ++template ++struct TupleMoveConstructible : std::false_type {}; ++ ++template ++struct TupleMoveConstructible, Vs...> ++ : std::integral_constant< ++ bool, absl::conjunction< ++ TupleElementMoveConstructible...>::value> {}; ++ ++template ++struct compressed_tuple_size; ++ ++template ++struct compressed_tuple_size> ++ : public std::integral_constant {}; ++ ++template ++struct TupleItemsMoveConstructible ++ : std::integral_constant< ++ bool, TupleMoveConstructible::value == ++ sizeof...(Vs), ++ T, Vs...>::value> {}; + + } // namespace internal_compressed_tuple + +@@ -217,17 +241,18 @@ class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple + explicit constexpr CompressedTuple(const Ts&... base) + : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {} + +- template ...)>>, +- internal_compressed_tuple::TupleMoveConstructible< +- Ts, Vs&&>...>::value, ++ void(absl::decay_t)>>, ++ internal_compressed_tuple::TupleItemsMoveConstructible< ++ CompressedTuple, First, Vs...>>::value, + bool> = true> +- explicit constexpr CompressedTuple(Vs&&... base) ++ explicit constexpr CompressedTuple(First&& first, Vs&&... base) + : CompressedTuple::CompressedTupleImpl(absl::in_place, ++ absl::forward(first), + absl::forward(base)...) {} + + template diff --git a/ports/abseil/fix-arm-build.patch b/ports/abseil/fix-arm-build.patch new file mode 100644 index 00000000000000..bf3347ef4d3c7b --- /dev/null +++ b/ports/abseil/fix-arm-build.patch @@ -0,0 +1,23 @@ +diff --git a/absl/time/internal/cctz/src/zone_info_source.cc b/absl/time/internal/cctz/src/zone_info_source.cc +index 98ea161..3f75d56 100644 +--- a/absl/time/internal/cctz/src/zone_info_source.cc ++++ b/absl/time/internal/cctz/src/zone_info_source.cc +@@ -65,7 +65,7 @@ ZoneInfoSourceFactory zone_info_source_factory __attribute__((weak)) = + extern ZoneInfoSourceFactory zone_info_source_factory; + extern ZoneInfoSourceFactory default_factory; + ZoneInfoSourceFactory default_factory = DefaultFactory; +-#if defined(_M_IX86) ++#if defined(_M_IX86) || ((defined(_M_ARM) || defined(_M_ARM64)) && defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)) + #pragma comment( \ + linker, \ + "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ +@@ -83,7 +83,8 @@ ZoneInfoSourceFactory default_factory = DefaultFactory; + "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ + "@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ + "@@ZA") +-#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64) ++#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM) || \ ++ defined(_M_ARM64) + #pragma comment( \ + linker, \ + "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ 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/fix-use-cxx17-stdlib-types.patch b/ports/abseil/fix-use-cxx17-stdlib-types.patch new file mode 100644 index 00000000000000..86715824d4b632 --- /dev/null +++ b/ports/abseil/fix-use-cxx17-stdlib-types.patch @@ -0,0 +1,40 @@ +diff --git a/absl/base/options.h b/absl/base/options.h +index 234137c..1fb77e4 100644 +--- a/absl/base/options.h ++++ b/absl/base/options.h +@@ -100,7 +100,7 @@ + // User code should not inspect this macro. To check in the preprocessor if + // absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. + +-#define ABSL_OPTION_USE_STD_ANY 2 ++#define ABSL_OPTION_USE_STD_ANY 1 + + + // ABSL_OPTION_USE_STD_OPTIONAL +@@ -127,7 +127,7 @@ + // absl::optional is a typedef of std::optional, use the feature macro + // ABSL_USES_STD_OPTIONAL. + +-#define ABSL_OPTION_USE_STD_OPTIONAL 2 ++#define ABSL_OPTION_USE_STD_OPTIONAL 1 + + + // ABSL_OPTION_USE_STD_STRING_VIEW +@@ -154,7 +154,7 @@ + // absl::string_view is a typedef of std::string_view, use the feature macro + // ABSL_USES_STD_STRING_VIEW. + +-#define ABSL_OPTION_USE_STD_STRING_VIEW 2 ++#define ABSL_OPTION_USE_STD_STRING_VIEW 1 + + // ABSL_OPTION_USE_STD_VARIANT + // +@@ -180,7 +180,7 @@ + // absl::variant is a typedef of std::variant, use the feature macro + // ABSL_USES_STD_VARIANT. + +-#define ABSL_OPTION_USE_STD_VARIANT 2 ++#define ABSL_OPTION_USE_STD_VARIANT 1 + + + // ABSL_OPTION_USE_INLINE_NAMESPACE diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 4c9196207691f6..0b62c6c2e25407 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -1,17 +1,41 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +if (NOT VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +set(ABSEIL_PATCHES + fix-uwp-build.patch + + # 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) + # in C++17 mode, use std::any, std::optional, std::string_view, std::variant + # instead of the library replacement types + list(APPEND ABSEIL_PATCHES fix-use-cxx17-stdlib-types.patch) +else() + # fore use of library replacement types, otherwise the automatic + # detection can cause ABI issues depending on which compiler options + # are enabled for consuming user code + list(APPEND ABSEIL_PATCHES fix-lnk2019-error.patch) +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO abseil/abseil-cpp - REF 06f0e767d13d4d68071c4fc51e25724e0fc8bc74 #commit 2020-03-03 + REF 06f0e767d13d4d68071c4fc51e25724e0fc8bc74 #commit 2020-03-03 SHA512 f6e2302676ddae39d84d8ec92dbd13520ae214013b43455f14ced3ae6938b94cedb06cfc40eb1781dac48f02cd35ed80673ed2d871541ef4438c282a9a4133b9 HEAD_REF master - PATCHES - fix-lnk2019-error.patch - fix-uwp-build.patch + PATCHES ${ABSEIL_PATCHES} ) -set(CMAKE_CXX_STANDARD ) +set(CMAKE_CXX_STANDARD 11) if("cxx17" IN_LIST FEATURES) set(CMAKE_CXX_STANDARD 17) endif() @@ -31,6 +55,19 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/absl/copts ${CURRENT_PACKAGES_DIR}/include/absl/strings/testdata - ${CURRENT_PACKAGES_DIR}/include/absl/time/internal/cctz/testdata) + ${CURRENT_PACKAGES_DIR}/include/absl/time/internal/cctz/testdata +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/absl/base/config.h + "#elif defined(ABSL_CONSUME_DLL)" "#elif 1" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/absl/base/internal/thread_identity.h + "&& !defined(ABSL_CONSUME_DLL)" "&& 0" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/absl/container/internal/hashtablez_sampler.h + "!defined(ABSL_CONSUME_DLL)" "0" + ) +endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/abseil/vcpkg.json b/ports/abseil/vcpkg.json new file mode 100644 index 00000000000000..79e6c308b5d097 --- /dev/null +++ b/ports/abseil/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "abseil", + "version-string": "2020-03-03", + "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", + "description": "Enable compiler C++17." + } + ] +} diff --git a/ports/absent/CONTROL b/ports/absent/CONTROL new file mode 100644 index 00000000000000..6d689b04a3f8c2 --- /dev/null +++ b/ports/absent/CONTROL @@ -0,0 +1,4 @@ +Source: absent +Version: 0.3.1 +Homepage: https://github.com/rvarago/absent +Description: A small C++17 library meant to simplify the composition of nullable types in a generic, type-safe, and declarative way diff --git a/ports/absent/portfile.cmake b/ports/absent/portfile.cmake new file mode 100644 index 00000000000000..1c8436aa8b7915 --- /dev/null +++ b/ports/absent/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rvarago/absent + REF 0.3.1 + SHA512 c7b7d29422ef8afc48e3093496e1dd055cfe9969ae037c2b06ea70fe4283e7a7e9129171efaa257e909c535e24df5861b992b24b00ec03f965730e6a22e13015 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTS=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets( + CONFIG_PATH lib/cmake/${PORT} +) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug + ${CURRENT_PACKAGES_DIR}/lib +) + +file(INSTALL + ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} +) + +file(INSTALL + ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright +) + diff --git a/ports/ace/CONTROL b/ports/ace/CONTROL index 7bbba73589253f..6190d4a1f412bc 100644 --- a/ports/ace/CONTROL +++ b/ports/ace/CONTROL @@ -1,8 +1,7 @@ Source: ace -Version: 6.5.8 +Version: 6.5.10 Homepage: https://www.dre.vanderbilt.edu/~schmidt/ACE.html Description: The ADAPTIVE Communication Environment -Supports: !uwp Feature: wchar Description: Enable extra wide char functions in ACE @@ -13,3 +12,10 @@ Build-Depends: openssl Feature: xml Description: Enable XML features in ACE + +Feature: zlib +Build-Depends: zlib +Description: Enable zlib support + +Feature: tao +Description: The ACE ORB diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index ee0a0e082fead6..f06b2c468ff610 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -1,22 +1,41 @@ -vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") - # 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. -if(VCPKG_TARGET_IS_WINDOWS) - # Don't change to vcpkg_from_github! This points to a release and not an archive - vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-6_5_8/ACE-src-6.5.8.zip" - FILENAME ACE-src-6.5.8.zip - SHA512 e0fd30de81f0d6e629394fc9cb814ecb786c67fccd7e975a3d64cf0859d5a03ba5a5ae4bb0a6ce5e6d16395a48ffa28f5a1a92758e08a3fd7d55582680f94d82 - ) -else(VCPKG_TARGET_IS_WINDOWS) - # VCPKG_TARGET_IS_LINUX - vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-6_5_8/ACE-src-6.5.8.tar.gz" - FILENAME ACE-src-6.5.8.tar.gz - SHA512 45ee6cf4302892ac9de305f8454109fa17a8b703187cc76555ce3641b621909e0cfedf3cc4a7fe1a8f01454637279cc9c4afe9d67466d5253e0ba1f34431d97f - ) +set(ACE_VERSION 6.5.10) +string(REPLACE "." "_" ACE_VERSION_DIRECTORY ${ACE_VERSION}) + +if("tao" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_WINDOWS) + # Don't change to vcpkg_from_github! This points to a release and not an archive + 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 + ) + 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 + ) + endif() +else() + if(VCPKG_TARGET_IS_WINDOWS) + # Don't change to vcpkg_from_github! This points to a release and not an archive + 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 + ) + 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 + ) + endif() endif() vcpkg_extract_source_archive_ex( @@ -27,27 +46,32 @@ vcpkg_extract_source_archive_ex( set(ACE_ROOT ${SOURCE_PATH}) set(ENV{ACE_ROOT} ${ACE_ROOT}) set(ACE_SOURCE_PATH ${ACE_ROOT}/ace) - +if("tao" IN_LIST FEATURES) + set(TAO_ROOT ${SOURCE_PATH}/TAO) + set(ENV{TAO_ROOT} ${TAO_ROOT}) + set(WORKSPACE ${TAO_ROOT}/TAO_ACE) +else() + set(WORKSPACE ${ACE_ROOT}/ace/ace) +endif() if("wchar" IN_LIST FEATURES) list(APPEND ACE_FEATURE_LIST "uses_wchar=1") endif() if("zlib" IN_LIST FEATURES) list(APPEND ACE_FEATURE_LIST "zlib=1") + set(ENV{ZLIB_ROOT} ${CURRENT_INSTALLED_DIR}) else() list(APPEND ACE_FEATURE_LIST "zlib=0") endif() if("ssl" IN_LIST FEATURES) list(APPEND ACE_FEATURE_LIST "ssl=1") list(APPEND ACE_FEATURE_LIST "openssl11=1") + set(ENV{SSL_ROOT} ${CURRENT_INSTALLED_DIR}) else() list(APPEND ACE_FEATURE_LIST "ssl=0") endif() list(JOIN ACE_FEATURE_LIST "," ACE_FEATURES) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - if(NOT VCPKG_CMAKE_SYSTEM_NAME) - set(DLL_DECORATOR s) - endif() set(MPC_STATIC_FLAG -static) endif() @@ -65,8 +89,6 @@ endif() # Add ace/config.h file # see https://htmlpreview.github.io/?https://github.com/DOCGroup/ACE_TAO/blob/master/ACE/ACE-INSTALL.html if(VCPKG_TARGET_IS_WINDOWS) - set(LIB_RELEASE_SUFFIX .lib) - set(LIB_DEBUG_SUFFIX d.lib) if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") set(SOLUTION_TYPE vs2019) elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") @@ -75,28 +97,33 @@ if(VCPKG_TARGET_IS_WINDOWS) set(SOLUTION_TYPE vc14) endif() file(WRITE ${ACE_SOURCE_PATH}/config.h "#include \"ace/config-windows.h\"") -endif() - -if(VCPKG_TARGET_IS_LINUX) - set(DLL_DECORATOR) - set(LIB_RELEASE_SUFFIX .a) - set(LIB_DEBUG_SUFFIX .a) - set(LIB_PREFIX lib) +elseif(VCPKG_TARGET_IS_LINUX) set(SOLUTION_TYPE gnuace) file(WRITE ${ACE_SOURCE_PATH}/config.h "#include \"ace/config-linux.h\"") file(WRITE ${ACE_ROOT}/include/makeinclude/platform_macros.GNU "include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU") +elseif(VCPKG_TARGET_IS_OSX) + set(SOLUTION_TYPE gnuace) + file(WRITE ${ACE_SOURCE_PATH}/config.h "#include \"ace/config-macosx.h\"") + file(WRITE ${ACE_ROOT}/include/makeinclude/platform_macros.GNU "include $(ACE_ROOT)/include/makeinclude/platform_macosx.GNU") +endif() + +if(VCPKG_TARGET_IS_UWP) + set(MPC_VALUE_TEMPLATE -value_template link_options+=/APPCONTAINER) endif() # Invoke mwc.pl to generate the necessary solution and project files vcpkg_execute_build_process( - COMMAND ${PERL} ${ACE_ROOT}/bin/mwc.pl -type ${SOLUTION_TYPE} -features "${ACE_FEATURES}" ace ${MPC_STATIC_FLAG} + COMMAND ${PERL} ${ACE_ROOT}/bin/mwc.pl -type ${SOLUTION_TYPE} -features "${ACE_FEATURES}" ${WORKSPACE}.mwc ${MPC_STATIC_FLAG} ${MPC_VALUE_TEMPLATE} WORKING_DIRECTORY ${ACE_ROOT} LOGNAME mwc-${TARGET_TRIPLET} ) if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_build_msbuild( - PROJECT_PATH ${ACE_SOURCE_PATH}/ace.sln + file(RELATIVE_PATH PROJECT_SUBPATH ${SOURCE_PATH} ${WORKSPACE}.sln) + vcpkg_install_msbuild( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH ${PROJECT_SUBPATH} + LICENSE_SUBPATH COPYING PLATFORM ${MSBUILD_PLATFORM} USE_VCPKG_INTEGRATION ) @@ -104,141 +131,210 @@ if(VCPKG_TARGET_IS_WINDOWS) # ACE itself does not define an install target, so it is not clear which # headers are public and which not. For the moment we install everything # that is in the source path and ends in .h, .inl - function(install_ace_headers_subdirectory ORIGINAL_PATH RELATIVE_PATH) - file(GLOB HEADER_FILES ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.h ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.inl) - file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/${RELATIVE_PATH}) + function(install_includes ORIGINAL_PATH RELATIVE_PATHS) + foreach(RELATIVE_PATH ${RELATIVE_PATHS}) + file( + GLOB + HEADER_FILES + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.h + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.hpp + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.inl + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.cpp + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.idl + ${ORIGINAL_PATH}/${RELATIVE_PATH}/*.pidl) + file(INSTALL ${HEADER_FILES} + DESTINATION ${CURRENT_PACKAGES_DIR}/include/${RELATIVE_PATH}) + endforeach() endfunction() - # We manually install header found in the ace directory because in that case - # we are supposed to install also *cpp files, see ACE_wrappers\debian\libace-dev.install file - file(GLOB HEADER_FILES ${ACE_SOURCE_PATH}/*.h ${ACE_SOURCE_PATH}/*.inl ${ACE_SOURCE_PATH}/*.cpp) - file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/) - # Install headers in subdirectory - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "Compression") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "Compression/rle") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "ETCL") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "QoS") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "Monitor_Control") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "os_include") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "os_include/arpa") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "os_include/net") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "os_include/netinet") - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "os_include/sys") + set(ACE_INCLUDE_FOLDERS + "ace" + "ace/Compression" + "ace/Compression/rle" + "ace/ETCL" + "ace/QoS" + "ace/Monitor_Control" + "ace/os_include" + "ace/os_include/arpa" + "ace/os_include/net" + "ace/os_include/netinet" + "ace/os_include/sys") + install_includes(${ACE_ROOT} "${ACE_INCLUDE_FOLDERS}") + if("ssl" IN_LIST FEATURES) - install_ace_headers_subdirectory(${ACE_SOURCE_PATH} "SSL") + install_includes(${ACE_ROOT} "ace/SSL") endif() - # Install the libraries - function(install_ace_library ORIGINAL_PATH ACE_LIBRARY) - set(LIB_PATH ${ORIGINAL_PATH}/lib/) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - # Install the DLL files - file(INSTALL - ${LIB_PATH}/${ACE_LIBRARY}d.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin - ) - file(INSTALL - ${LIB_PATH}/${ACE_LIBRARY}.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin - ) - endif() + if("tao" IN_LIST FEATURES) + set(ACEXML_INCLUDE_FOLDERS "ACEXML/apps/svcconf" "ACEXML/common" + "ACEXML/parser/parser") + install_includes(${ACE_ROOT} "${ACEXML_INCLUDE_FOLDERS}") - # Install the lib files - file(INSTALL - ${LIB_PATH}/${LIB_PREFIX}${ACE_LIBRARY}${DLL_DECORATOR}${LIB_DEBUG_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - ) + set(ACE_PROTOCOLS_INCLUDE_FOLDERS "ace/HTBP" "ace/INet" "ace/RMCast" + "ace/TMCast") + install_includes(${ACE_ROOT}/protocols "${ACE_PROTOCOLS_INCLUDE_FOLDERS}") - file(INSTALL - ${LIB_PATH}/${LIB_PREFIX}${ACE_LIBRARY}${DLL_DECORATOR}${LIB_RELEASE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - ) - endfunction() + install_includes(${ACE_ROOT} "Kokyu") - install_ace_library(${ACE_ROOT} "ACE") - install_ace_library(${ACE_ROOT} "ACE_Compression") - install_ace_library(${ACE_ROOT} "ACE_ETCL") - install_ace_library(${ACE_ROOT} "ACE_ETCL_Parser") - install_ace_library(${ACE_ROOT} "ACE_Monitor_Control") - if(NOT VCPKG_CMAKE_SYSTEM_NAME) - install_ace_library(${ACE_ROOT} "ACE_QoS") - endif() - install_ace_library(${ACE_ROOT} "ACE_RLECompression") - if("ssl" IN_LIST FEATURES) - install_ace_library(${ACE_ROOT} "ACE_SSL") - endif() + set(TAO_ORBSVCS_INCLUDE_FOLDERS + "orbsvcs" + "orbsvcs/AV" + "orbsvcs/Concurrency" + "orbsvcs/CosEvent" + "orbsvcs/Event" + "orbsvcs/FaultTolerance" + "orbsvcs/FtRtEvent/ClientORB" + "orbsvcs/FtRtEvent/EventChannel" + "orbsvcs/FtRtEvent/Utils" + "orbsvcs/HTIOP" + "orbsvcs/IFRService" + "orbsvcs/LifeCycle" + "orbsvcs/LoadBalancing" + "orbsvcs/Log" + "orbsvcs/Naming" + "orbsvcs/Naming/FaultTolerant" + "orbsvcs/Notify" + "orbsvcs/Notify/Any" + "orbsvcs/Notify/MonitorControl" + "orbsvcs/Notify/MonitorControlExt" + "orbsvcs/Notify/Sequence" + "orbsvcs/Notify/Structured" + "orbsvcs/PortableGroup" + "orbsvcs/Property" + "orbsvcs/Sched" + "orbsvcs/Security" + "orbsvcs/Time" + "orbsvcs/Trader") + if("ssl" IN_LIST FEATURES) + list(APPEND TAO_ORBSVCS_INCLUDE_FOLDERS "orbsvcs/SSLIOP") + endif() + install_includes(${TAO_ROOT}/orbsvcs "${TAO_ORBSVCS_INCLUDE_FOLDERS}") - vcpkg_copy_pdbs() + set(TAO_ROOT_ORBSVCS_INCLUDE_FOLDERS "orbsvcs/FT_ReplicationManager" + "orbsvcs/Notify_Service") + install_includes(${TAO_ROOT} "${TAO_ROOT_ORBSVCS_INCLUDE_FOLDERS}") - # Handle copyright - file(COPY ${ACE_ROOT}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ace) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/ace/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) -else(VCPKG_TARGET_IS_WINDOWS) - # VCPKG_TARGTE_IS_LINUX + set(TAO_INCLUDE_FOLDERS + "tao" + "tao/AnyTypeCode" + "tao/BiDir_GIOP" + "tao/CSD_Framework" + "tao/CSD_ThreadPool" + "tao/CodecFactory" + "tao/Codeset" + "tao/Compression" + "tao/Compression/rle" + "tao/DiffServPolicy" + "tao/DynamicAny" + "tao/DynamicInterface" + "tao/Dynamic_TP" + "tao/ETCL" + "tao/EndpointPolicy" + "tao/IFR_Client" + "tao/IORInterceptor" + "tao/IORManipulation" + "tao/IORTable" + "tao/ImR_Client" + "tao/Messaging" + "tao/Monitor" + "tao/ObjRefTemplate" + "tao/PI" + "tao/PI_Server" + "tao/PortableServer" + "tao/RTCORBA" + "tao/RTPortableServer" + "tao/RTScheduling" + "tao/SmartProxies" + "tao/Strategies" + "tao/TransportCurrent" + "tao/TypeCodeFactory" + "tao/Utils" + "tao/Valuetype" + "tao/ZIOP") + if("zlib" IN_LIST FEATURES) + list(APPEND TAO_INCLUDE_FOLDERS "tao/Compression/zlib") + endif() + install_includes(${TAO_ROOT} "${TAO_INCLUDE_FOLDERS}") + endif() + + # Remove dlls without any export + if("tao" IN_LIST FEATURES) + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/ACEXML_XML_Svc_Conf_Parser.dll + ${CURRENT_PACKAGES_DIR}/bin/ACEXML_XML_Svc_Conf_Parser.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/ACEXML_XML_Svc_Conf_Parserd.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/ACEXML_XML_Svc_Conf_Parserd_dll.pdb) + endif() + endif() +elseif(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) FIND_PROGRAM(MAKE make) IF (NOT MAKE) MESSAGE(FATAL_ERROR "MAKE not found") ENDIF () - list(APPEND _pkg_components ACE_ETCL_Parser ACE_ETCL ACE) if("ssl" IN_LIST FEATURES) list(APPEND _ace_makefile_macros "ssl=1") - set(ENV{SSL_ROOT} ${CURRENT_INSTALLED_DIR}) - list(APPEND _pkg_components ACE_SSL) endif() + set(ENV{INSTALL_PREFIX} ${CURRENT_PACKAGES_DIR}) # Set `PWD` environment variable since ACE's `install` make target calculates install dir using this env. set(_prev_env $ENV{PWD}) - set(ENV{PWD} ${ACE_ROOT}/ace) + get_filename_component(WORKING_DIR ${WORKSPACE} DIRECTORY) + set(ENV{PWD} ${WORKING_DIR}) message(STATUS "Building ${TARGET_TRIPLET}-dbg") vcpkg_execute_build_process( - COMMAND make ${_ace_makefile_macros} "debug=1" "-j${VCPKG_CONCURRENCY}" - WORKING_DIRECTORY ${ACE_ROOT}/ace + COMMAND make ${_ace_makefile_macros} "debug=1" "optimize=0" "-j${VCPKG_CONCURRENCY}" + WORKING_DIRECTORY ${WORKING_DIR} LOGNAME make-${TARGET_TRIPLET}-dbg ) message(STATUS "Building ${TARGET_TRIPLET}-dbg done") message(STATUS "Packaging ${TARGET_TRIPLET}-dbg") vcpkg_execute_build_process( COMMAND make ${_ace_makefile_macros} install - WORKING_DIRECTORY ${ACE_ROOT}/ace + WORKING_DIRECTORY ${WORKING_DIR} LOGNAME install-${TARGET_TRIPLET}-dbg ) + file(COPY ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) - # TODO: check if we really need to remove those directories - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share) + + file(GLOB _pkg_components ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc) foreach(_pkg_comp ${_pkg_components}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_pkg_comp}.pc _content) + file(READ ${_pkg_comp} _content) string(REPLACE "libdir=${CURRENT_PACKAGES_DIR}/lib" "libdir=${CURRENT_PACKAGES_DIR}/debug/lib" _content ${_content}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_pkg_comp}.pc ${_content}) + file(WRITE ${_pkg_comp} ${_content}) endforeach() message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") vcpkg_execute_build_process( COMMAND make ${_ace_makefile_macros} realclean - WORKING_DIRECTORY ${ACE_ROOT}/ace + WORKING_DIRECTORY ${WORKING_DIR} LOGNAME realclean-${TARGET_TRIPLET}-dbg ) message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_build_process( COMMAND make ${_ace_makefile_macros} "-j${VCPKG_CONCURRENCY}" - WORKING_DIRECTORY ${ACE_ROOT}/ace + WORKING_DIRECTORY ${WORKING_DIR} LOGNAME make-${TARGET_TRIPLET}-rel ) message(STATUS "Building ${TARGET_TRIPLET}-rel done") message(STATUS "Packaging ${TARGET_TRIPLET}-rel") vcpkg_execute_build_process( COMMAND make ${_ace_makefile_macros} install - WORKING_DIRECTORY ${ACE_ROOT}/ace + WORKING_DIRECTORY ${WORKING_DIR} LOGNAME install-${TARGET_TRIPLET}-rel ) + if("tao" IN_LIST FEATURES) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + endif() message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") # Restore `PWD` environment variable set($ENV{PWD} _prev_env) # Handle copyright - file(RENAME ${CURRENT_PACKAGES_DIR}/share/ace/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) + file(INSTALL ${ACE_ROOT}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endif() diff --git a/ports/activemq-cpp/CONTROL b/ports/activemq-cpp/CONTROL index 891c51ee7e2ec7..3d06d97151d1e0 100644 --- a/ports/activemq-cpp/CONTROL +++ b/ports/activemq-cpp/CONTROL @@ -1,5 +1,5 @@ Source: activemq-cpp -Version: 3.9.5-1 +Version: 3.9.5-3 Build-Depends: apr Description: Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server. -Supports: !uwp \ No newline at end of file +Supports: !(uwp|linux|osx) diff --git a/ports/activemq-cpp/fix-crt-linkage.patch b/ports/activemq-cpp/fix-crt-linkage.patch new file mode 100644 index 00000000000000..fcb74fda7abc5e --- /dev/null +++ b/ports/activemq-cpp/fix-crt-linkage.patch @@ -0,0 +1,36 @@ +diff --git a/vs2010-build/activemq-cpp.vcxproj b/vs2010-build/activemq-cpp.vcxproj +index 54b4822..6b35511 100644 +--- a/vs2010-build/activemq-cpp.vcxproj ++++ b/vs2010-build/activemq-cpp.vcxproj +@@ -2578,6 +2578,7 @@ + Default + true + false ++ MultiThreadedDebug + true + + +@@ -2687,6 +2688,7 @@ + true + false + true ++ MultiThreadedDebug + + + +@@ -2794,6 +2796,7 @@ + ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories) + false + true ++ MultiThreaded + + + +@@ -2906,6 +2909,7 @@ + ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories) + false + true ++ MultiThreaded + + + diff --git a/ports/activemq-cpp/portfile.cmake b/ports/activemq-cpp/portfile.cmake index 5353e5dd4eaed1..6afa95b7914c74 100644 --- a/ports/activemq-cpp/portfile.cmake +++ b/ports/activemq-cpp/portfile.cmake @@ -1,8 +1,4 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() +vcpkg_fail_port_install( ON_TARGET "uwp" "linux" "osx") set(VERSION 3.9.5) @@ -15,11 +11,30 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/FunctionLevelLinkingOn.diff + PATCHES + FunctionLevelLinkingOn.diff + fix-crt-linkage.patch ) -set(RELEASE_CONF "ReleaseDLL") -set(DEBUG_CONF "DebugDLL") +set(ACTIVEMQCPP_MSVC_PROJ ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ACTIVEMQCPP_SHARED_LIB) + +if (ACTIVEMQCPP_SHARED_LIB) + set(RELEASE_CONF "ReleaseDLL") + set(DEBUG_CONF "DebugDLL") + + set(ACTIVEMQCPP_LIB_PREFFIX ) + set(ACTIVEMQCPP_LIB_SUFFIX d) + vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";apr-1.lib" ";libapr-1.lib") +else() + set(RELEASE_CONF "Release") + set(DEBUG_CONF "Debug") + + set(ACTIVEMQCPP_LIB_PREFFIX lib) + set(ACTIVEMQCPP_LIB_SUFFIX ) + vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";libapr-1.lib" ";apr-1.lib") +endif() if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(BUILD_ARCH "Win32") @@ -31,9 +46,8 @@ else() message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() - vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj + PROJECT_PATH ${ACTIVEMQCPP_MSVC_PROJ} RELEASE_CONFIGURATION ${RELEASE_CONF} DEBUG_CONFIGURATION ${DEBUG_CONF} PLATFORM ${BUILD_ARCH} @@ -42,42 +56,44 @@ vcpkg_build_msbuild( vcpkg_copy_pdbs() -# Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/activemq-cpp) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/activemq-cpp/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/activemq-cpp/copyright) - +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + + if (ACTIVEMQCPP_SHARED_LIB) + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + endif() +endif() -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file( - COPY - ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + + if (ACTIVEMQCPP_SHARED_LIB) + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + file(COPY + ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + endif() +endif() file(COPY ${SOURCE_PATH}/src/main/activemq DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h) file(COPY ${SOURCE_PATH}/src/main/cms DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h) file(COPY ${SOURCE_PATH}/src/main/decaf DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h) + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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 c55df2df956292..9c2b40ff63460b 100644 --- a/ports/alembic/CONTROL +++ b/ports/alembic/CONTROL @@ -1,5 +1,5 @@ Source: alembic -Version: 1.7.12 +Version: 1.7.13 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/ 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 370e058b6828f7..58ad015dba5085 100644 --- a/ports/alembic/portfile.cmake +++ b/ports/alembic/portfile.cmake @@ -5,19 +5,32 @@ 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 + list(APPEND GXX_DEBUG_FLAGS + -DCMAKE_CXX_FLAGS_DEBUG=-Wno-deprecated + -DCMAKE_CXX_FLAGS_DEBUG=-Wno-error=implicit-fallthrough + ) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DUSE_HDF5=ON + -DUSE_HDF5=ON + OPTIONS_DEBUG + ${GXX_DEBUG_FLAGS} ) vcpkg_install_cmake() @@ -28,23 +41,30 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe) -file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) -file(REMOVE ${EXE}) -file(REMOVE ${DEBUG_EXE}) -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) -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(READ ${CURRENT_PACKAGES_DIR}/share/Alembic/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}") - -# Put the license file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/Alembic/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/Alembic/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/Alembic/copyright) + +if(VCPKG_TARGET_IS_WINDOWS) + file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe) + file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) + file(REMOVE ${EXE}) + file(REMOVE ${DEBUG_EXE}) + + 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/${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/${PORT}/AlembicTargets-debug.cmake "${DEBUG_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/${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/${PORT}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/allegro5/CONTROL b/ports/allegro5/CONTROL index defd1b481b44ae..1672e4f640214a 100644 --- a/ports/allegro5/CONTROL +++ b/ports/allegro5/CONTROL @@ -1,5 +1,5 @@ Source: allegro5 -Version: 5.2.5.0 +Version: 5.2.6.0 Homepage: https://github.com/liballeg/allegro5 Description: Allegro is a cross-platform library mainly aimed at video game and multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc. and generally abstracting away the underlying platform. However, Allegro is not a game engine: you are free to design and structure your program as you like. Build-Depends: opengl, zlib, freetype, libogg, libvorbis, libflac, openal-soft, libpng, bzip2, physfs, libtheora, opus, opusfile diff --git a/ports/allegro5/portfile.cmake b/ports/allegro5/portfile.cmake index 37eea075621d75..2ae7b487b39ab9 100644 --- a/ports/allegro5/portfile.cmake +++ b/ports/allegro5/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO liballeg/allegro5 - REF 5.2.5.0 - SHA512 9b97a46f0fd146c3958a5f8333822665ae06b984b3dbedc1356afdac8fe3248203347cb08b30ebda049a7320948c7844e9d00dc055c317836c2557b5bfc2ab04 + REF 5.2.6.0 + SHA512 d590c1a00d1b314c6946e0f6ad3e3a8b6e6309bada2ec38857186f817147ac99dae8a1c4412abe701af88da5dca3dd8f989a1da66630192643d3c08c0146b603 HEAD_REF master PATCHES fix-pdb-install.patch diff --git a/ports/amqpcpp/CONTROL b/ports/amqpcpp/CONTROL index 4e8799805d14d9..910b53e1523513 100644 --- a/ports/amqpcpp/CONTROL +++ b/ports/amqpcpp/CONTROL @@ -1,4 +1,6 @@ Source: amqpcpp -Version: 4.1.5 +Version: 4.1.7 +Homepage: https://github.com/CopernicaMarketingSoftware/AMQP-CPP Description: AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker Build-Depends: openssl (linux) +Supports: !uwp \ No newline at end of file diff --git a/ports/amqpcpp/portfile.cmake b/ports/amqpcpp/portfile.cmake index 7f4847903e5aad..3b160e697c6870 100644 --- a/ports/amqpcpp/portfile.cmake +++ b/ports/amqpcpp/portfile.cmake @@ -1,12 +1,12 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CopernicaMarketingSoftware/AMQP-CPP - REF v4.1.5 - SHA512 71c54ddf43230fb3e9726257b073d117a329030052f768f985c2e9ebde5a320f0042d2ef67604b87940bfa1ed61339c334af0362238d10f30845521dff8ce43c + REF e7f76bc75d7855012450763a638092925d52f417 #v4.1.7 + SHA512 ce105622d09014b51876911e95c4523b786d670bbd0bafa47874c6d52dca63f610dbb52561107bd1941c1fda79a4e200331779a79f9394c1ea437e0e1a4695bf HEAD_REF master PATCHES find-openssl.patch @@ -29,6 +29,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/amqpcpp RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/angle/001-fix-uwp.patch b/ports/angle/001-fix-uwp.patch index badf1596d7ee64..cba68d69be7503 100644 --- a/ports/angle/001-fix-uwp.patch +++ b/ports/angle/001-fix-uwp.patch @@ -1,28 +1,3 @@ -diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp -index 0c9698450..3e37ad0ab 100644 ---- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp -+++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp -@@ -2364,6 +2364,11 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps, - bool isIvyBridge = false; - bool isAMD = IsAMD(adapterDesc.VendorId); - bool isFeatureLevel9_3 = (deviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3); -+#if defined(ANGLE_ENABLE_WINDOWS_UWP) -+ bool isWin10 = true; -+#else -+ bool isWin10 = IsWindows10OrGreater(); -+#endif - IntelDriverVersion capsVersion = IntelDriverVersion(0); - if (isIntel) - { -@@ -2448,7 +2453,7 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps, - // Don't translate uniform block to StructuredBuffer on Windows 7 and earlier. This is targeted - // to work around a bug that fails to allocate ShaderResourceView for StructuredBuffer. - ANGLE_FEATURE_CONDITION(features, dontTranslateUniformBlockToStructuredBuffer, -- !IsWindows10OrGreater()); -+ !isWin10); - - // Call platform hooks for testing overrides. - auto *platform = ANGLEPlatformCurrent(); diff --git a/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp index 7d3f078d6..fac057dd6 100644 --- a/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp @@ -53,25 +28,3 @@ index 7d3f078d6..fac057dd6 100644 } } -diff --git a/src/libGLESv2/global_state.cpp b/src/libGLESv2/global_state.cpp -index 8c2c61f53..7725106a4 100644 ---- a/src/libGLESv2/global_state.cpp -+++ b/src/libGLESv2/global_state.cpp -@@ -214,7 +214,7 @@ namespace - { - // The following WaitForDebugger code is based on SwiftShader. See: - // https://cs.chromium.org/chromium/src/third_party/swiftshader/src/Vulkan/main.cpp --# if defined(ANGLE_ENABLE_ASSERTS) -+# if defined(ANGLE_ENABLE_ASSERTS) && !defined(ANGLE_ENABLE_WINDOWS_UWP) - INT_PTR CALLBACK DebuggerWaitDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) - { - RECT rect; -@@ -259,7 +259,7 @@ void WaitForDebugger(HINSTANCE instance) - } - # else - void WaitForDebugger(HINSTANCE instance) {} --# endif // defined(ANGLE_ENABLE_ASSERTS) -+# endif // defined(ANGLE_ENABLE_ASSERTS) && !defined(ANGLE_ENABLE_WINDOWS_UWP) - } // namespace - - extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID) diff --git a/ports/angle/CMakeLists.txt b/ports/angle/CMakeLists.txt index a9b8f07b9d42df..b5c662f5ce19c5 100644 --- a/ports/angle/CMakeLists.txt +++ b/ports/angle/CMakeLists.txt @@ -51,7 +51,7 @@ include_directories("$" "$ +Date: Wed, 29 Apr 2020 13:01:31 -0700 +Subject: [PATCH] Don't install 'LICENSE' or 'README.md' directly to the + installation directory. + +This change unconditionally uses GNUInstallDirs which will correctly 'namespace' these files with the 'argh' project name. + +========= + +The names 'LICENSE' and 'README.md' are extremely common and likely to be taken by other ports. This happened in a recent full vcpkg catalog rebuild: + +Starting package 757/1254: qt-advanced-docking-system:x86-windows +Building package qt-advanced-docking-system[core]:x86-windows... +Could not locate cached archive: C:\agent\_work\1\s\archives\a1\a1507296ead5788137561997571557204aaac78f.zip +-- Downloading https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/661d0c4356ab61d155b53718aa1bf6bab86dad13.tar.gz... +-- Extracting source C:/agent/_work/1/s/downloads/githubuser0xFFFF-Qt-Advanced-Docking-System-661d0c4356ab61d155b53718aa1bf6bab86dad13.tar.gz +-- Applying patch config_changes.patch +-- Using source at C:/agent/_work/1/s/buildtrees/qt-advanced-docking-system/src/bab86dad13-3088149a9b +-- Configuring x86-windows +-- Building x86-windows-dbg +-- Building x86-windows-rel +-- Installing: C:/agent/_work/1/s/packages/qt-advanced-docking-system_x86-windows/share/qt-advanced-docking-system/copyright +-- Performing post-build validation +-- Performing post-build validation done +Stored binary cache: C:\agent\_work\1\s\archives\a1\a1507296ead5788137561997571557204aaac78f.zip +Building package qt-advanced-docking-system[core]:x86-windows... done +Installing package qt-advanced-docking-system[core]:x86-windows... +The following files are already installed in C:/agent/_work/1/s/installed/x86-windows and are in conflict with qt-advanced-docking-system:x86-windows + +Installed by argh:x86-windows + license/LICENSE + +Elapsed time for package qt-advanced-docking-system:x86-windows: 11.09 s +--- + CMakeLists.txt | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 13bc879..f6264f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,19 +36,17 @@ endif() + + install(TARGETS argh EXPORT arghTargets) + ++include(GNUInstallDirs) ++install(FILES "${CMAKE_CURRENT_LIST_DIR}/argh.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install(FILES "${CMAKE_CURRENT_LIST_DIR}/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR}) ++install(FILES "${CMAKE_CURRENT_LIST_DIR}/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR}) ++ + if(CMAKE_SYSTEM_NAME STREQUAL Linux) + # this might be a bit too restrictive, since for other (BSD, ...) this might apply also + # but this can be fixed later in extra pull requests from people on the platform +- include(GNUInstallDirs) +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/argh.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(FILES argh-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/argh) + install(EXPORT arghTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/argh) + else() +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/argh.h" DESTINATION include) +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/LICENSE" DESTINATION license) +- install(FILES "${CMAKE_CURRENT_LIST_DIR}/README.md" DESTINATION .) + install(FILES argh-config.cmake DESTINATION CMake) + install(EXPORT arghTargets DESTINATION CMake) + endif() diff --git a/ports/argparse/CONTROL b/ports/argparse/CONTROL deleted file mode 100644 index cfb3e8eedb9040..00000000000000 --- a/ports/argparse/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: argparse -Version: 2.1 -Description: Argument parser for modern C++ -Homepage: https://github.com/p-ranav/argparse diff --git a/ports/argparse/vcpkg.json b/ports/argparse/vcpkg.json new file mode 100644 index 00000000000000..438522292049c3 --- /dev/null +++ b/ports/argparse/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "argparse", + "version-string": "2.1", + "description": "Argument parser for modern C++", + "homepage": "https://github.com/p-ranav/argparse", + "license": "MIT" +} diff --git a/ports/argtable2/CONTROL b/ports/argtable2/CONTROL index 69ddd4bc3b9ad7..6cdb294cfabde3 100644 --- a/ports/argtable2/CONTROL +++ b/ports/argtable2/CONTROL @@ -1,3 +1,4 @@ Source: argtable2 -Version: 2.13-4 +Version: 2.13-7 +Homepage: http://argtable.sourceforge.net Description: Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss. diff --git a/ports/argtable2/portfile.cmake b/ports/argtable2/portfile.cmake index c98dfcfb52bb02..05f3f015ce4814 100644 --- a/ports/argtable2/portfile.cmake +++ b/ports/argtable2/portfile.cmake @@ -1,18 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz" - FILENAME "argtable-2.13.zip" - SHA512 3d8303f3ba529e3241d918c0127a16402ece951efb964d14a06a3a7d29a252812ad3c44e96da28798871e9923e73a2cfe7ebc84139c1397817d632cae25c4585 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - fix-install-dirs.patch + REPO argtable/argtable + REF argtable-2.13 + FILENAME "argtable2-13.tar.gz" + SHA512 3d8303f3ba529e3241d918c0127a16402ece951efb964d14a06a3a7d29a252812ad3c44e96da28798871e9923e73a2cfe7ebc84139c1397817d632cae25c4585 + PATCHES fix-install-dirs.patch ) vcpkg_configure_cmake( 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 41b52bea73ed39..c266b9112f2711 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -1,4 +1,5 @@ Source: armadillo -Version: 2019-04-16-6 +Version: 2019-04-16 +Port-Version: 9 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 (!osx), lapack diff --git a/ports/armadillo/add-disable-find-package.patch b/ports/armadillo/add-disable-find-package.patch new file mode 100644 index 00000000000000..65197e2025b9d5 --- /dev/null +++ b/ports/armadillo/add-disable-find-package.patch @@ -0,0 +1,92 @@ +diff --git a/cmake_aux/Modules/ARMA_FindACML.cmake b/cmake_aux/Modules/ARMA_FindACML.cmake +index 7d0655e..fa435ff 100644 +--- a/cmake_aux/Modules/ARMA_FindACML.cmake ++++ b/cmake_aux/Modules/ARMA_FindACML.cmake +@@ -5,6 +5,11 @@ + # also defined, but not for general use are + # ACML_LIBRARY, where to find the ACML library. + ++if(CMAKE_DISABLE_FIND_PACKAGE_ACML) ++ set(ACML_FOUND "NO") ++ return() ++endif() ++ + SET(ACML_NAMES ${ACML_NAMES} acml) + FIND_LIBRARY(ACML_LIBRARY + NAMES ${ACML_NAMES} +diff --git a/cmake_aux/Modules/ARMA_FindACMLMP.cmake b/cmake_aux/Modules/ARMA_FindACMLMP.cmake +index 3390179..ead7b1e 100644 +--- a/cmake_aux/Modules/ARMA_FindACMLMP.cmake ++++ b/cmake_aux/Modules/ARMA_FindACMLMP.cmake +@@ -5,6 +5,11 @@ + # also defined, but not for general use are + # ACMLMP_LIBRARY, where to find the ACMLMP library. + ++if(CMAKE_DISABLE_FIND_PACKAGE_ACMLMP) ++ set(ACMLMP_FOUND NO) ++ return() ++endif() ++ + SET(ACMLMP_NAMES ${ACMLMP_NAMES} acml_mp) + FIND_LIBRARY(ACMLMP_LIBRARY + NAMES ${ACMLMP_NAMES} +diff --git a/cmake_aux/Modules/ARMA_FindARPACK.cmake b/cmake_aux/Modules/ARMA_FindARPACK.cmake +index 1a709ad..3029c25 100644 +--- a/cmake_aux/Modules/ARMA_FindARPACK.cmake ++++ b/cmake_aux/Modules/ARMA_FindARPACK.cmake +@@ -4,6 +4,10 @@ + # ARPACK_FOUND - system has ARPACK + # ARPACK_LIBRARY - Link this to use ARPACK + ++if(CMAKE_DISABLE_FIND_PACKAGE_ARPACK) ++ set(ARPACK_FOUND NO) ++ return() ++endif() + + find_library(ARPACK_LIBRARY + NAMES arpack +diff --git a/cmake_aux/Modules/ARMA_FindATLAS.cmake b/cmake_aux/Modules/ARMA_FindATLAS.cmake +index 491a361..e40a0ff 100644 +--- a/cmake_aux/Modules/ARMA_FindATLAS.cmake ++++ b/cmake_aux/Modules/ARMA_FindATLAS.cmake +@@ -1,3 +1,8 @@ ++if(CMAKE_DISABLE_FIND_PACKAGE_ATLAS) ++ set(ATLAS_FOUND NO) ++ return() ++endif() ++ + find_path(ATLAS_CBLAS_INCLUDE_DIR + NAMES cblas.h + PATHS /usr/include/atlas/ /usr/include/ /usr/local/include/atlas/ /usr/local/include/ +diff --git a/cmake_aux/Modules/ARMA_FindMKL.cmake b/cmake_aux/Modules/ARMA_FindMKL.cmake +index 0fd5b06..d6bcd49 100644 +--- a/cmake_aux/Modules/ARMA_FindMKL.cmake ++++ b/cmake_aux/Modules/ARMA_FindMKL.cmake +@@ -6,6 +6,11 @@ + ## the link below explains why we're linking only with mkl_rt + ## https://software.intel.com/en-us/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103 + ++if(CMAKE_DISABLE_FIND_PACKAGE_MKL) ++ set(MKL_FOUND NO) ++ return() ++endif() ++ + set(MKL_NAMES ${MKL_NAMES} mkl_rt) + #set(MKL_NAMES ${MKL_NAMES} mkl_lapack) + #set(MKL_NAMES ${MKL_NAMES} mkl_intel_thread) +diff --git a/cmake_aux/Modules/ARMA_FindSuperLU5.cmake b/cmake_aux/Modules/ARMA_FindSuperLU5.cmake +index abf046d..e496cb0 100644 +--- a/cmake_aux/Modules/ARMA_FindSuperLU5.cmake ++++ b/cmake_aux/Modules/ARMA_FindSuperLU5.cmake +@@ -5,6 +5,11 @@ + # SuperLU_LIBRARY - Link this to use SuperLU + # SuperLU_INCLUDE_DIR - directory of SuperLU headers + ++if(CMAKE_DISABLE_FIND_PACKAGE_SuperLU) ++ set(SuperLU_FOUND OFF) ++ return() ++endif() ++ + find_path(SuperLU_INCLUDE_DIR slu_ddefs.h + /usr/include/superlu/ + /usr/include/SuperLU/ diff --git a/ports/armadillo/portfile.cmake b/ports/armadillo/portfile.cmake index 512aa813e61fb5..58686449587d37 100644 --- a/ports/armadillo/portfile.cmake +++ b/ports/armadillo/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_gitlab( @@ -11,7 +9,8 @@ vcpkg_from_gitlab( HEAD_REF 9.400.x PATCHES remove_custom_modules.patch - fix-CMakePath.patch + fix-CMakePath.patch + add-disable-find-package.patch ) file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindBLAS.cmake) @@ -24,6 +23,12 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DDETECT_HDF5=false + -DCMAKE_DISABLE_FIND_PACKAGE_SuperLU=ON + -DCMAKE_DISABLE_FIND_PACKAGE_ACML=ON + -DCMAKE_DISABLE_FIND_PACKAGE_ACMLMP=ON + -DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON + -DCMAKE_DISABLE_FIND_PACKAGE_ATLAS=ON + -DCMAKE_DISABLE_FIND_PACKAGE_MKL=ON ) vcpkg_install_cmake() diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index 5e2b86981583b4..dc7ea8c81e3bd8 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -1,6 +1,19 @@ Source: arrow -Version: 0.16.0 -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.0 +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 \ No newline at end of file +Supports: x64 +Default-Features: csv, json, parquet, filesystem + +Feature: csv +Description: CSV file support + +Feature: json +Description: JSON file support + +Feature: parquet +Description: Parquet file support + +Feature: filesystem +Description: Local filesystem support diff --git a/ports/arrow/all.patch b/ports/arrow/all.patch index 3b2bdad2fb0962..a566e2a0503b3f 100644 --- a/ports/arrow/all.patch +++ b/ports/arrow/all.patch @@ -1,8 +1,8 @@ diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake -index f5f0ad7..3dca82e 100644 +index e4e13cb70..58ca626da 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake -@@ -305,7 +305,7 @@ function(ADD_ARROW_LIB LIB_NAME) +@@ -335,7 +335,7 @@ function(ADD_ARROW_LIB LIB_NAME) target_include_directories(${LIB_NAME}_static PRIVATE ${ARG_PRIVATE_INCLUDES}) endif() @@ -11,8 +11,22 @@ index f5f0ad7..3dca82e 100644 set(LIB_NAME_STATIC ${LIB_NAME}_static) else() set(LIB_NAME_STATIC ${LIB_NAME}) +diff --git a/cpp/cmake_modules/FindBrotli.cmake b/cpp/cmake_modules/FindBrotli.cmake +index bf47915c4..053e605a0 100644 +--- a/cpp/cmake_modules/FindBrotli.cmake ++++ b/cpp/cmake_modules/FindBrotli.cmake +@@ -64,8 +64,7 @@ if(BROTLI_ROOT) + PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES} + NO_DEFAULT_PATH) + else() +- pkg_check_modules(BROTLI_PC libbrotlicommon libbrotlienc libbrotlidec) +- if(BROTLI_PC_FOUND) ++ if(0) # Find via pkg_check_modules disabled as incompatible with vcpkg + set(BROTLI_INCLUDE_DIR "${BROTLI_PC_libbrotlicommon_INCLUDEDIR}") + + # 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 8410916..a196b25 100644 +index 841091643..a196b251d 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) @@ -53,10 +67,10 @@ index 8410916..a196b25 100644 PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) find_path(LZ4_INCLUDE_DIR NAMES lz4.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake -index f9d6296..82b8d22 100644 +index bb3eb5608..0b03d37d3 100644 --- a/cpp/cmake_modules/FindThrift.cmake +++ b/cpp/cmake_modules/FindThrift.cmake -@@ -54,6 +54,10 @@ if(MSVC AND NOT THRIFT_MSVC_STATIC_LIB_SUFFIX) +@@ -43,6 +43,10 @@ if(MSVC AND NOT THRIFT_MSVC_STATIC_LIB_SUFFIX) set(THRIFT_MSVC_STATIC_LIB_SUFFIX md) endif() @@ -67,7 +81,7 @@ index f9d6296..82b8d22 100644 if(Thrift_ROOT) find_library(THRIFT_STATIC_LIB thrift${THRIFT_MSVC_STATIC_LIB_SUFFIX} PATHS ${Thrift_ROOT} -@@ -74,16 +78,14 @@ else() +@@ -61,16 +65,14 @@ else() list(APPEND THRIFT_PC_LIBRARY_DIRS "${THRIFT_PC_LIBDIR}") @@ -88,90 +102,105 @@ index f9d6296..82b8d22 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 8e47086..d7ce559 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} -@@ -44,14 +48,14 @@ else() +@@ -49,8 +49,8 @@ if(ZSTD_ROOT) + + else() + # Second, find via pkg_check_modules +- pkg_check_modules(ZSTD_PC libzstd) +- if(ZSTD_PC_FOUND) ++ #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 75b33c2..80cac9a 100644 ---- a/cpp/cmake_modules/SetupCxxFlags.cmake -+++ b/cpp/cmake_modules/SetupCxxFlags.cmake -@@ -128,7 +128,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/src/arrow/stl.h b/cpp/src/arrow/stl.h -index 7ae9eaf..b9efdcb 100644 ---- a/cpp/src/arrow/stl.h -+++ b/cpp/src/arrow/stl.h -@@ -518,6 +518,9 @@ class allocator { +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) - private: - MemoryPool* pool_; ++ define_option(ARROW_UTF8PROC_USE_SHARED ++ "Rely on utf8proc shared libraries where relevant" ON) + -+ template -+ friend class allocator; - }; + define_option(ARROW_ZSTD_USE_SHARED "Rely on zstd shared libraries where relevant" ON) - /// \brief A MemoryPool implementation delegating allocations to a STL allocator -diff --git a/cpp/src/parquet/schema.h b/cpp/src/parquet/schema.h -index 87db4de..095ef9a 100644 ---- a/cpp/src/parquet/schema.h -+++ b/cpp/src/parquet/schema.h -@@ -460,7 +460,11 @@ class PARQUET_EXPORT SchemaDescriptor { - // -- -- b | - // -- -- -- c | - // -- -- -- -- d -- std::unordered_map leaf_to_base_; -+#if _MSC_VER >= 1900 -+ std::unordered_map leaf_to_base_; -+#else -+ std::unordered_map leaf_to_base_; -+#endif + 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. - // Mapping between ColumnPath DotString to the leaf index - std::unordered_multimap leaf_to_idx_; ++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 c67e61230d51be..dcb1d966492cfa 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -1,14 +1,10 @@ -include(vcpkg_common_functions) - -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - message(FATAL_ERROR "Apache Arrow only supports x64") -endif() +vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/arrow - REF apache-arrow-0.16.0 - SHA512 c8d693e927218c65526b48f18c4f00f9530d1a8731575b051b017a5350e68114c16dcd41ff578b4c0cc29cc79096621809658b8eac250934ecf0fcaabadf2cf6 + REF apache-arrow-1.0.0 + SHA512 cfbe22a7987658cce15f83c3be50435567f2b8156fa50007ae103418b969c6075dbf2858c25787a40feb391e84075905dd045300beb7fcedf4344823f8c4be20 HEAD_REF master PATCHES all.patch @@ -17,18 +13,28 @@ vcpkg_from_github( string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_BUILD_SHARED) string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" ARROW_BUILD_STATIC) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "csv" ARROW_CSV + "json" ARROW_JSON + "parquet" ARROW_PARQUET + "filesystem" ARROW_FILESYSTEM +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/cpp PREFER_NINJA OPTIONS -DARROW_DEPENDENCY_SOURCE=SYSTEM -Duriparser_SOURCE=SYSTEM - -DARROW_BUILD_TESTS=off - -DARROW_PARQUET=ON + -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 @@ -36,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 ) @@ -52,7 +59,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/arrow) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/arrow RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) 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 082633b76c86ac..d4b46b6a5c4007 100644 --- a/ports/asmjit/CONTROL +++ b/ports/asmjit/CONTROL @@ -1,4 +1,5 @@ Source: asmjit -Version: 2020-02-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 346ce69116bcb8..812083b6d919ca 100644 --- a/ports/asmjit/portfile.cmake +++ b/ports/asmjit/portfile.cmake @@ -1,25 +1,25 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") +vcpkg_fail_port_install(ON_ARCH "arm") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO asmjit/asmjit - REF 761130b1d8f32b5d3d612d285664fcfef5258149 - SHA512 a86fd58ba0c8bc81ec575e86a9acdf4a11f2acc9c2facd2a0a8512cffa9ee6fc0bd877a1f33fb52f8f510eff1de654b45cd4f5f5a18c5252ecae22a92db6e93e + 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/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 new file mode 100644 index 00000000000000..d18d548a060cec --- /dev/null +++ b/ports/avisynthplus/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" "arm" "arm64") + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO AviSynth/AviSynthPlus + REF v3.6.0 + SHA512 040e9f2c99973eb96b0f1ba373627c3c43ff17ed8339ea850aebc2306228384175cb37c418a139f865c396c70c2d254cd8a40838f577f184a4c161b258328dd5 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DENABLE_PLUGINS=OFF +) + +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) diff --git a/ports/avisynthplus/vcpkg.json b/ports/avisynthplus/vcpkg.json new file mode 100644 index 00000000000000..c8a8d77b0de7ed --- /dev/null +++ b/ports/avisynthplus/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "avisynthplus", + "version-string": "3.6.0", + "description": "An improved version of the AviSynth frameserver, with improved features and developer friendliness", + "homepage": "http://avs-plus.net/", + "supports": "!(uwp | arm | static)" +} diff --git a/ports/avro-c/CONTROL b/ports/avro-c/CONTROL index 10cef30fae30a8..e7554a30b6763e 100644 --- a/ports/avro-c/CONTROL +++ b/ports/avro-c/CONTROL @@ -1,6 +1,6 @@ Source: avro-c -Version: 1.9.2 -Supports: !(uwp|linux|osx) +Version: 1.9.2-1 +Supports: !(uwp|osx) Homepage: https://github.com/apache/avro Description: Apache Avro is a data serialization system Build-Depends: jansson, liblzma, zlib, snappy diff --git a/ports/avro-c/avro.patch b/ports/avro-c/avro.patch index ffaa93624e05dc..4f8ae13766e461 100644 --- a/ports/avro-c/avro.patch +++ b/ports/avro-c/avro.patch @@ -1,46 +1,71 @@ diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt -index 11cbf018..1bef3ba2 100644 +index 11cbf01..620490d 100644 --- a/lang/c/CMakeLists.txt +++ b/lang/c/CMakeLists.txt -@@ -161,27 +161,27 @@ else (SNAPPY_FOUND AND ZLIB_FOUND) +@@ -149,7 +149,10 @@ else (ZLIB_FOUND) + message("Disabled deflate codec. zlib not found.") + endif (ZLIB_FOUND) + +-find_package(Snappy) ++find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy PATH_SUFFIXES lib) ++find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd PATH_SUFFIXES debug/lib) ++find_path(SNAPPY_INCLUDE_DIR snappy-c.h) ++select_library_configurations(SNAPPY) + if (SNAPPY_FOUND AND ZLIB_FOUND) # Snappy borrows crc32 from zlib + set(SNAPPY_PKG libsnappy) + add_definitions(-DSNAPPY_CODEC) +@@ -161,32 +164,36 @@ else (SNAPPY_FOUND AND ZLIB_FOUND) message("Disabled snappy codec. libsnappy not found or zlib not found.") endif (SNAPPY_FOUND AND ZLIB_FOUND) -find_package(PkgConfig) -pkg_check_modules(LZMA liblzma) -if (LZMA_FOUND) -+find_package(LIBLZMA) -+if (LIBLZMA_FOUND) ++find_package(LibLZMA) ++if (LibLZMA_FOUND) ++ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ set(SNAPPY_LIBRARIES ${SNAPPY_LIBRARIES} -lstdc++) ++ endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(LZMA_PKG liblzma) add_definitions(-DLZMA_CODEC) - include_directories(${LZMA_INCLUDE_DIRS}) - link_directories(${LZMA_LIBRARY_DIRS}) -+ include_directories(${LIBLZMA_INCLUDE_DIRS}) -+ link_directories(${LIBLZMA_LIBRARY_DIRS}) ++ include_directories(${LibLZMA_INCLUDE_DIRS}) ++ link_directories(${LibLZMA_LIBRARY_DIRS}) message("Enabled lzma codec") -else (LZMA_FOUND) -+else (LIBLZMA_FOUND) ++else (LibLZMA_FOUND) set(LZMA_PKG "") - set(LZMA_LIBRARIES "") +- set(LZMA_LIBRARIES "") ++ set(LibLZMA_LIBRARIES "") message("Disabled lzma codec. liblzma not found.") -endif (LZMA_FOUND) +endif (LIBLZMA_FOUND) -set(CODEC_LIBRARIES ${ZLIB_LIBRARIES} ${LZMA_LIBRARIES} ${SNAPPY_LIBRARIES}) -+set(CODEC_LIBRARIES ${ZLIB_LIBRARIES} ${LIBLZMA_LIBRARIES} ${SNAPPY_LIBRARIES}) ++set(CODEC_LIBRARIES ${ZLIB_LIBRARIES} ${LibLZMA_LIBRARIES} ${SNAPPY_LIBRARIES}) set(CODEC_PKG "@ZLIB_PKG@ @LZMA_PKG@ @SNAPPY_PKG@") # Jansson JSON library -pkg_check_modules(JANSSON jansson>=2.3) -+find_package(JANSSON REQUIRED) - if (JANSSON_FOUND) +-if (JANSSON_FOUND) ++find_path(JANSSON_INCLUDE_DIR NAMES jansson.h) ++find_library(JANSSON_LIBRARY NAMES jansson) ++if (JANSSON_LIBRARY) set(JANSSON_PKG libjansson) -+ set(JANSSON_LIBRARIES jansson::jansson) ++ set(JANSSON_LIBRARIES ${JANSSON_LIBRARY}) include_directories(${JANSSON_INCLUDE_DIRS}) link_directories(${JANSSON_LIBRARY_DIRS}) - else (JANSSON_FOUND) +-else (JANSSON_FOUND) ++else (JANSSON_LIBRARY) + message(FATAL_ERROR "libjansson >=2.3 not found") +-endif (JANSSON_FOUND) ++endif (JANSSON_LIBRARY) + + + add_subdirectory(src) diff --git a/lang/c/examples/quickstop.c b/lang/c/examples/quickstop.c -index f18225b7..78e2b1b8 100644 +index f18225b..78e2b1b 100644 --- a/lang/c/examples/quickstop.c +++ b/lang/c/examples/quickstop.c @@ -16,6 +16,7 @@ @@ -61,7 +86,7 @@ index f18225b7..78e2b1b8 100644 if (avro_record_get(person, "First", &first_datum) == 0) { avro_string_get(first_datum, &p); diff --git a/lang/c/src/avro/msinttypes.h b/lang/c/src/avro/msinttypes.h -index 29be14b9..7efc7026 100644 +index 29be14b..7efc702 100644 --- a/lang/c/src/avro/msinttypes.h +++ b/lang/c/src/avro/msinttypes.h @@ -54,6 +54,10 @@ @@ -83,7 +108,7 @@ index 29be14b9..7efc7026 100644 #endif // _MSC_INTTYPES_H_ ] diff --git a/lang/c/src/avro/msstdint.h b/lang/c/src/avro/msstdint.h -index d02608a5..54e8972c 100644 +index d02608a..54e8972 100644 --- a/lang/c/src/avro/msstdint.h +++ b/lang/c/src/avro/msstdint.h @@ -42,6 +42,10 @@ @@ -105,7 +130,7 @@ index d02608a5..54e8972c 100644 #endif // _MSC_STDINT_H_ ] diff --git a/lang/c/src/avro/platform.h b/lang/c/src/avro/platform.h -index 92930550..edfe1e05 100644 +index 9293055..edfe1e0 100644 --- a/lang/c/src/avro/platform.h +++ b/lang/c/src/avro/platform.h @@ -35,8 +35,10 @@ extern "C" { @@ -120,7 +145,7 @@ index 92930550..edfe1e05 100644 #define PRIsz "zu" #endif diff --git a/lang/c/src/avro_private.h b/lang/c/src/avro_private.h -index f97ef6b5..6b291048 100644 +index f97ef6b..6b29104 100644 --- a/lang/c/src/avro_private.h +++ b/lang/c/src/avro_private.h @@ -34,7 +34,7 @@ extern "C" { @@ -133,7 +158,7 @@ index f97ef6b5..6b291048 100644 /* Note that AVRO_PLATFORM_IS_BIG_ENDIAN is *always* defined. It is diff --git a/lang/c/src/avroappend.c b/lang/c/src/avroappend.c -index 7243c600..39656ff4 100644 +index 7243c60..39656ff 100644 --- a/lang/c/src/avroappend.c +++ b/lang/c/src/avroappend.c @@ -20,7 +20,7 @@ @@ -146,7 +171,7 @@ index 7243c600..39656ff4 100644 #include "avro.h" diff --git a/lang/c/src/codec.c b/lang/c/src/codec.c -index 5b55b351..49789f2b 100644 +index 5b55b35..49789f2 100644 --- a/lang/c/src/codec.c +++ b/lang/c/src/codec.c @@ -269,7 +269,7 @@ static int encode_deflate(avro_codec_t c, void * data, int64_t len) @@ -201,7 +226,7 @@ index 5b55b351..49789f2b 100644 codec->used_size = write_pos; diff --git a/lang/c/src/schema.c b/lang/c/src/schema.c -index 7b389002..50fa0db6 100644 +index 7b38900..50fa0db 100644 --- a/lang/c/src/schema.c +++ b/lang/c/src/schema.c @@ -74,7 +74,7 @@ static int is_avro_id(const char *name) @@ -360,10 +385,21 @@ index 7b389002..50fa0db6 100644 } check(rval, avro_write_str(out, avro_schema_name(link->to))); diff --git a/lang/c/tests/test_avro_data.c b/lang/c/tests/test_avro_data.c -index 1da09e6d..7ef26013 100644 +index 1da09e6..714d5d8 100644 --- a/lang/c/tests/test_avro_data.c +++ b/lang/c/tests/test_avro_data.c -@@ -112,7 +112,7 @@ write_read_check(avro_schema_t writers_schema, avro_datum_t datum, +@@ -28,6 +28,10 @@ avro_writer_t writer; + + typedef int (*avro_test) (void); + ++#ifdef _WIN32 ++# define strcasecmp stricmp ++#endif ++ + /* + * Use a custom allocator that verifies that the size that we use to + * free an object matches the size that we use to allocate it. +@@ -112,7 +116,7 @@ write_read_check(avro_schema_t writers_schema, avro_datum_t datum, if (size != avro_writer_tell(writer)) { fprintf(stderr, "Unable to calculate size %s validate=%d " @@ -372,12 +408,3 @@ index 1da09e6d..7ef26013 100644 type, validate, size, avro_writer_tell(writer), avro_strerror()); exit(EXIT_FAILURE); -@@ -142,7 +142,7 @@ static void test_json(avro_datum_t datum, const char *expected) - { - char *json = NULL; - avro_datum_to_json(datum, 1, &json); -- if (strcasecmp(json, expected) != 0) { -+ if (stricmp(json, expected) != 0) { - fprintf(stderr, "Unexpected JSON encoding: %s\n", json); - exit(EXIT_FAILURE); - } diff --git a/ports/avro-c/portfile.cmake b/ports/avro-c/portfile.cmake index 8d8d81c6ac0021..195d85543cae46 100644 --- a/ports/avro-c/portfile.cmake +++ b/ports/avro-c/portfile.cmake @@ -1,5 +1,5 @@ vcpkg_buildpath_length_warning(37) -vcpkg_fail_port_install(ON_TARGET "uwp" "linux" "osx") +vcpkg_fail_port_install(ON_TARGET "uwp" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH 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/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index ae5ae5cb1b3736..987b7304502e63 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,5 +1,5 @@ Source: aws-sdk-cpp -Version: 1.7.270 +Version: 1.8.4 Homepage: https://github.com/aws/aws-sdk-cpp Description: AWS SDK for C++ Build-Depends: openssl (!uwp&!windows), curl (!uwp&!windows), aws-c-event-stream diff --git a/ports/aws-sdk-cpp/CONTROL.in b/ports/aws-sdk-cpp/CONTROL.in index 501e0e839eb12b..63cce2b75ced37 100644 --- a/ports/aws-sdk-cpp/CONTROL.in +++ b/ports/aws-sdk-cpp/CONTROL.in @@ -1,5 +1,5 @@ Source: aws-sdk-cpp -Version: 1.7.38 +Version: 1.8.4 Description: AWS SDK for C++ Build-Depends: openssl (!uwp&!windows), curl (!uwp&!windows), aws-c-event-stream Default-Features: dynamodb, s3, kinesis diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 6bb84c41486473..be9f6190cde0e6 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO aws/aws-sdk-cpp - REF ad6c51d8c9e52eb74418d40b0a78021e890ef27f # 1.7.270 - SHA512 a636c60bc07a58860dfd53a786edbc47b7974084c5b65dd1fca663f9521a92871e4830c71880498583e6e372ee141a6550cd88fd9649ab1017dd712e4c8ccb23 + REF 819b17b3915b1e6a9b704998efcaa51711dd1357 # 1.8.4 + SHA512 73647ca3426226236c476533d31038ebc8763d3f604b36089b10e645296c5012041cbc2c5bb8cec5d9ae593fe266edbef7bf278c924746f25186d3e6fc183158 HEAD_REF master ) diff --git a/ports/azure-c-shared-utility/CONTROL b/ports/azure-c-shared-utility/CONTROL index 9fbf83a72de99c..6546575b1f0f68 100644 --- a/ports/azure-c-shared-utility/CONTROL +++ b/ports/azure-c-shared-utility/CONTROL @@ -1,8 +1,10 @@ Source: azure-c-shared-utility -Version: 2020-02-04.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 +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 2e0e779be5fdd5..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 48f7a556865731f0e96c47eb5e9537361f24647c - SHA512 c20074707e8601e090ee8daac1d96fdfb4f60ac60fd9c824dad81aa4c2f22b04733c82c01c1ae92110c26871b81674e8771d9ed65081f1c0c197a362275a28f1 + REF 65c27eb4ab9a8bbe36b4d7c5a0e9ad305becb8b4 + SHA512 48c65111b12e895f9c2087964d7291e6d1629242194fed9b33ead8ca438f16c803786cd55761eabdd12d47c9920542cff0e510bf16f16cac1d60049ba205df0e HEAD_REF master PATCHES fix-utilityFunctions-conditions.patch @@ -40,8 +40,8 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/azure_c_shared_uti file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/configs/azure_iot_build_rules.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-c-shared-utility) +file(COPY ${SOURCE_PATH}/configs/azure_iot_build_rules.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-c-shared-utility/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/azure-iot-sdk-c/CONTROL b/ports/azure-iot-sdk-c/CONTROL index 06fff28af8d62e..6344bdeabad213 100644 --- a/ports/azure-iot-sdk-c/CONTROL +++ b/ports/azure-iot-sdk-c/CONTROL @@ -1,11 +1,13 @@ Source: azure-iot-sdk-c -Version: 2020-02-04.1 +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 +Description: A C99 SDK for connecting devices to Microsoft Azure IoT services +Homepage: https://github.com/Azure/azure-iot-sdk-c Feature: public-preview Description: A version of the azure-iot-sdk-c containing public-preview features. Build-Depends: azure-uamqp-c[public-preview], azure-umqtt-c[public-preview], azure-c-shared-utility[public-preview], azure-uhttp-c[public-preview], azure-macro-utils-c[public-preview], umock-c[public-preview] -Feature: use_prov_client -Description: Enables device provisioning client for DPS \ No newline at end of file +Feature: use-prov-client +Description: Enables device provisioning client for DPS diff --git a/ports/azure-iot-sdk-c/fix-cmake.patch b/ports/azure-iot-sdk-c/fix-cmake.patch new file mode 100644 index 00000000000000..b75b4ca7c86e35 --- /dev/null +++ b/ports/azure-iot-sdk-c/fix-cmake.patch @@ -0,0 +1,40 @@ +diff --git a/provisioning_client/CMakeLists.txt b/provisioning_client/CMakeLists.txt +index c39188dca..d4ef43cb3 100644 +--- a/provisioning_client/CMakeLists.txt ++++ b/provisioning_client/CMakeLists.txt +@@ -359,7 +359,7 @@ if(${use_installed_dependencies}) + set(CMAKE_INSTALL_LIBDIR "lib") + endif() + +- install(TARGETS ${provisioning_libs} EXPORT azure_prov_sdksTargets ++ install(TARGETS ${provisioning_libs} EXPORT azure_iot_sdksTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/../bin +@@ -374,26 +374,6 @@ if(${use_installed_dependencies}) + VERSION ${PROV_SDK_VERSION} + COMPATIBILITY SameMajorVersion + ) +- +- configure_file("../configs/${PROJECT_NAME}Config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" +- COPYONLY +- ) +- +- install(EXPORT azure_prov_sdksTargets +- FILE +- "${PROJECT_NAME}Targets.cmake" +- DESTINATION +- ${package_location} +- ) +- +- install( +- FILES +- "../configs/${PROJECT_NAME}Config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" +- DESTINATION +- ${package_location} +- ) + else() + # Install Provisioning libs + if(NOT DEFINED CMAKE_INSTALL_LIBDIR) diff --git a/ports/azure-iot-sdk-c/portfile.cmake b/ports/azure-iot-sdk-c/portfile.cmake index d15188aa0bc439..db460aaecf7547 100644 --- a/ports/azure-iot-sdk-c/portfile.cmake +++ b/ports/azure-iot-sdk-c/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) if("public-preview" IN_LIST FEATURES) @@ -9,26 +7,27 @@ if("public-preview" IN_LIST FEATURES) REF cb2e8d390df56ffa31d08ca0a79ab58ff96160cc SHA512 6798b17d6768b3ccbd0eb66719b50f364cd951736eb71110e2dc9deca054a1566ff88b9e8c5e9b52536e4308cad6cd3cbebff3282c123083e3afaee5535e724b HEAD_REF public-preview - PATCHES improve-external-deps.patch + PATCHES + improve-external-deps.patch + fix-cmake.patch ) else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-iot-sdk-c - REF c8b6a108fd7e01c1d89d9150b5d209f17e54fc4e - SHA512 43d7bb9696c9f5d64ec38b017b3b9fcbf86a8a3e8f21b129546b822fe00640f775ca362ec124a8cc37c4c9634de50d88d38952f04a7f4cfc08ad7c25463770ef + REF f464326f10cbba497b71c4aa263b6a22e1b375fe + SHA512 32dfb2ac697755af3646b07259298fc2f27007ab1a0a27da0be4f597c82dd2f8bbad6f07b4ed01dfbb62d86649d4be913c59e1e76b33efec112beaaba550d375 HEAD_REF master - PATCHES improve-external-deps.patch + PATCHES + improve-external-deps.patch + fix-cmake.patch ) endif() -if("use_prov_client" IN_LIST FEATURES) - message(STATUS "use prov_client") - set(USE_PROV_CLIENT 1) -else() - message(STATUS "NO prov_client") - set(USE_PROV_CLIENT 0) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + use-prov-client hsm_type_symm_key + use-prov-client use_prov_client +) file(COPY ${CURRENT_INSTALLED_DIR}/share/azure-c-shared-utility/azure_iot_build_rules.cmake DESTINATION ${SOURCE_PATH}/deps/azure-c-shared-utility/configs/) file(COPY ${SOURCE_PATH}/configs/azure_iot_sdksFunctions.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/cmake/azure_iot_sdks/) @@ -36,14 +35,12 @@ file(COPY ${SOURCE_PATH}/configs/azure_iot_sdksFunctions.cmake DESTINATION ${CUR vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -Dskip_samples=ON -Duse_installed_dependencies=ON -Duse_default_uuid=ON -Dbuild_as_dynamic=OFF -Duse_edge_modules=ON - -Duse_prov_client=${USE_PROV_CLIENT} - -Dhsm_type_symm_key=${USE_PROV_CLIENT} ) vcpkg_install_cmake() @@ -52,7 +49,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/azure_iot_sdks) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-iot-sdk-c/copyright COPYONLY) - -vcpkg_copy_pdbs() +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/azure-kinect-sensor-sdk/CONTROL b/ports/azure-kinect-sensor-sdk/CONTROL index 11bbb08bb40643..f0e78a1a2bd2be 100644 --- a/ports/azure-kinect-sensor-sdk/CONTROL +++ b/ports/azure-kinect-sensor-sdk/CONTROL @@ -1,5 +1,5 @@ Source: azure-kinect-sensor-sdk -Version: 1.4.0-alpha.0-2 +Version: 1.4.0-alpha.0-5 Homepage: https://github.com/microsoft/Azure-Kinect-Sensor-SDK Description: Azure Kinect SDK is a cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device. Build-Depends: azure-c-shared-utility, glfw3, gtest, imgui, libusb, spdlog, cjson, ebml, libjpeg-turbo, matroska, libsoundio, libyuv @@ -9,4 +9,4 @@ Description: Build K4A doxygen documentation. Feature: tool Description: Build tools. -Build-Depends: gl3w, imgui[example] \ No newline at end of file +Build-Depends: gl3w, glew, imgui[bindings] \ No newline at end of file diff --git a/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch b/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch new file mode 100644 index 00000000000000..f997e71b5d8176 --- /dev/null +++ b/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch @@ -0,0 +1,45 @@ +diff --git a/tools/k4aviewer/CMakeLists.txt b/tools/k4aviewer/CMakeLists.txt +index 6ab38d9..e0c5bad 100644 +--- a/tools/k4aviewer/CMakeLists.txt ++++ b/tools/k4aviewer/CMakeLists.txt +@@ -35,6 +35,8 @@ set(SOURCE_FILES + k4awindowset.cpp + perfcounter.cpp + ${CMAKE_CURRENT_BINARY_DIR}/version.rc ++ ${IMGUI_EXTERNAL_PATH}/imgui_impl_glfw.cpp ++ ${IMGUI_EXTERNAL_PATH}/imgui_impl_opengl3.cpp + ) + + # Include ${CMAKE_CURRENT_BINARY_DIR}/version.rc in the target's sources +@@ -54,6 +56,8 @@ include_directories( + ${CMAKE_CURRENT_LIST_DIR} + ) + ++find_package(GLEW REQUIRED) ++ + set(EXTERNAL_LIBRARIES + k4a::k4a + k4a::k4arecord +@@ -65,6 +69,7 @@ set(EXTERNAL_LIBRARIES + glfw + ${OPENGL_LIBRARIES} + unofficial::gl3w::gl3w ++ GLEW::GLEW + ) + + # On Windows, we need to call into setupapi to get USB container ID information +diff --git a/tools/k4aviewer/k4aimgui_all.h b/tools/k4aviewer/k4aimgui_all.h +index e40ccfb..756fb09 100644 +--- a/tools/k4aviewer/k4aimgui_all.h ++++ b/tools/k4aviewer/k4aimgui_all.h +@@ -34,8 +34,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + // For disabling buttons, which has not yet been promoted to the public API + // diff --git a/ports/azure-kinect-sensor-sdk/k4adeploy.ps1 b/ports/azure-kinect-sensor-sdk/k4adeploy.ps1 new file mode 100644 index 00000000000000..d6feb3b3285903 --- /dev/null +++ b/ports/azure-kinect-sensor-sdk/k4adeploy.ps1 @@ -0,0 +1,10 @@ +# Note: This function signature and behavior is depended upon by applocal.ps1 + +function deployAzureKinectSensorSDK([string]$targetBinaryDir, [string]$installedDir, [string]$targetBinaryName) { + if ($targetBinaryName -like "k4a.dll") { + if(Test-Path "$installedDir\tools\azure-kinect-sensor-sdk\depthengine_2_0.dll") { + Write-Verbose " Deploying Azure Kinect Sensor SDK Initialization" + deployBinary "$targetBinaryDir" "$installedDir\tools\azure-kinect-sensor-sdk\" "depthengine_2_0.dll" + } + } +} diff --git a/ports/azure-kinect-sensor-sdk/portfile.cmake b/ports/azure-kinect-sensor-sdk/portfile.cmake index 1fb30271a7ddf2..a7604a7ba698a9 100644 --- a/ports/azure-kinect-sensor-sdk/portfile.cmake +++ b/ports/azure-kinect-sensor-sdk/portfile.cmake @@ -1,12 +1,14 @@ +set(VERSION 1.4.0-alpha.0) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/Azure-Kinect-Sensor-SDK - REF 17b644560ce7b4ee7dd921dfff0ae811aa54ede6 #v1.4.0-alpha.0 - SHA512 2746eebe5ef66c4b9d2215b6883723fca66dab77d405c662cc2af9364dc7fcd76aade396d23427db5797e0a534764eb2398890930ff3c792d0df8a681ce31462 + REF v${VERSION} + SHA512 bf09ff92dc1b8621a941d838aef9c804bb5635f7984b7f86f01a38441d44935db764b69483d598e1f2c0aafb5c7ec196ef9c722967d92e6d075cb67ce781fea9 HEAD_REF master PATCHES fix-builds.patch disable-c4275.patch + fix-dependency-imgui.patch ) vcpkg_find_acquire_program(PYTHON3) @@ -21,11 +23,13 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS # .rc file needs windows.h, so do not use PREFER_NINJA here vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + DISABLE_PARALLEL_CONFIGURE OPTIONS ${FEATURE_OPTIONS} -DK4A_SOURCE_LINK=OFF -DK4A_MTE_VERSION=ON -DBUILD_EXAMPLES=OFF -DWITH_TEST=OFF + -DIMGUI_EXTERNAL_PATH=${CURRENT_INSTALLED_DIR}/include/bindings ) vcpkg_install_cmake() @@ -40,9 +44,47 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +if ("tool" IN_LIST FEATURES) + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + file(COPY ${AZURE_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(REMOVE ${AZURE_TOOLS}) + endif() + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + file(REMOVE ${AZURE_TOOLS}) + endif() +endif() + if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() +# Install Depth Engine +vcpkg_download_distfile(ARCHIVE + URLS "https://www.nuget.org/api/v2/package/Microsoft.Azure.Kinect.Sensor/${VERSION}" + FILENAME "azure-kinect-sensor-sdk.zip" + SHA512 6c15975e7c834672de723b0c474fa4cd58f41c5bee6511dcbdbc22f1a58daa906c4f01a7e941af0e7d09f763ff886015c1f6b1e29b6bdfb333f10857edfec2ca +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH PACKAGE_PATH + ARCHIVE ${ARCHIVE} + NO_REMOVE_ONE_LEVEL +) + +if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(ARCHITECTURE "x86") +elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(ARCHITECTURE "amd64") +else () + message(FATAL_ERROR "this architecture is not supported.") +endif () + +file(COPY ${PACKAGE_PATH}/lib/native/${ARCHITECTURE}/release/depthengine_2_0.dll DESTINATION ${CURRENT_PACKAGES_DIR}/tools/azure-kinect-sensor-sdk) +file(COPY ${PACKAGE_PATH}/lib/native/${ARCHITECTURE}/release/depthengine_2_0.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/azure-kinect-sensor-sdk) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/k4adeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/azure-kinect-sensor-sdk) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/k4adeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/azure-kinect-sensor-sdk) + # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/azure-macro-utils-c/CONTROL b/ports/azure-macro-utils-c/CONTROL index 3079862d5d66d0..702b9b9f632e68 100644 --- a/ports/azure-macro-utils-c/CONTROL +++ b/ports/azure-macro-utils-c/CONTROL @@ -1,7 +1,6 @@ Source: azure-macro-utils-c -Version: 2020-02-04.1 +Version: 2020-06-17-1 Description: A library of macros for the Azure IoT SDK Suite -Build-Depends: Feature: public-preview Description: A library of macros for the Azure IoT SDK Suite (public-preview) diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index fbd712e0dbc455..08c09f0296399a 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,7 +1,7 @@ Source: azure-storage-cpp -Version: 7.3.0 +Version: 7.5.0 Build-Depends: cpprestsdk[core], atlmfc (windows), boost-log (!windows&!uwp), boost-locale (!windows&!uwp), libxml2 (!windows&!uwp), libuuid (!windows&!uwp&!osx), gettext (osx) Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Homepage: https://blogs.msdn.com/b/windowsazurestorage/ -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index 8f83cd0ee7f9b6..2b23123b26ebc7 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-storage-cpp - REF v7.3.0 - SHA512 4297fa9e70fc4f4dde63f78f21714c2f9f6a9a63529cc3595f61e08659ea86a3590dbf9e99ee67572099c6bb7cc5b376bba6f29fbf59c5a1b705d841bb9a32e4 + REF v7.5.0 + SHA512 83eabcaf2114c8af1cabbc96b6ef2b57c934a06f68e7a870adf336feaa19edd57aedaf8507d5c40500e46d4e77f5059f9286e319fe7cadeb9ffc8fa018fb030c HEAD_REF master ) @@ -25,7 +25,7 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/LICENSE.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-storage-cpp RENAME copyright) + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/azure-uamqp-c/CONTROL b/ports/azure-uamqp-c/CONTROL index 1db26a7b1e5729..ddd6fe2da1bb8e 100644 --- a/ports/azure-uamqp-c/CONTROL +++ b/ports/azure-uamqp-c/CONTROL @@ -1,7 +1,8 @@ Source: azure-uamqp-c -Version: 2020-02-04.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 Feature: public-preview Description: AMQP library for C (public preview) diff --git a/ports/azure-uamqp-c/portfile.cmake b/ports/azure-uamqp-c/portfile.cmake index b8ce4b0bbd2372..e154414fc2d6b6 100644 --- a/ports/azure-uamqp-c/portfile.cmake +++ b/ports/azure-uamqp-c/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) if("public-preview" IN_LIST FEATURES) @@ -14,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uamqp-c - REF 142cfab9d66c6f81ea0cceb635f31e00cfa51c77 - SHA512 80f95bc969c2e50124622561b5f939e981a8d317e3e9514e52ce020f0f20a125622bf914f16927edafc7ff3c878fb1d6a28f4f5e66bda52dcc8aa2dc34761f73 + REF 9e851bd6db08d6d2d08d1ef469d1e6fc4795382d + SHA512 efe0b9ed8a949af67e958b1516f499f57a0838a847e92d6c932058e931d2536038e7d49d63597e21de0a6f2af22bc179a6d99c8b8077451f906118b0b65e1417 HEAD_REF master ) endif() @@ -37,7 +35,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/uamqp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-uamqp-c/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/azure-uhttp-c/CONTROL b/ports/azure-uhttp-c/CONTROL index 6fe601dae1b0b4..b64573024fb0f7 100644 --- a/ports/azure-uhttp-c/CONTROL +++ b/ports/azure-uhttp-c/CONTROL @@ -1,7 +1,8 @@ Source: azure-uhttp-c -Version: 2020-02-04.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 Feature: public-preview Description: Azure HTTP Library written in C (public preview) diff --git a/ports/azure-uhttp-c/portfile.cmake b/ports/azure-uhttp-c/portfile.cmake index d943e811dcd95d..1e05b1cfa93c54 100644 --- a/ports/azure-uhttp-c/portfile.cmake +++ b/ports/azure-uhttp-c/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) if("public-preview" IN_LIST FEATURES) @@ -14,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uhttp-c - REF b67a6bfa0d018a8a23176ee214e46c208fc323c3 - SHA512 75fafe242324bb2fc72befdd06427350e6f99aec9496fdf38b9660e7965fad89276ee543f36c3ba3360fc99b8301e74e2c1723d17f39e8471beee3e32cacb348 + REF ef8ba1591b0f825315b78380331ff9290197db02 + SHA512 3e0434272de684a43189d491c16ab7e20ffcfd08f8addb01f64caa446211faa67e45aa51c403520df6a105cc9ac50b85de1b9e0954510fd4232c0f19d01fea9c HEAD_REF master ) endif() @@ -38,7 +36,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/uhttp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-uhttp-c/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/azure-umqtt-c/CONTROL b/ports/azure-umqtt-c/CONTROL index 8a0ed2aff3f9a8..755b0160e9bc3f 100644 --- a/ports/azure-umqtt-c/CONTROL +++ b/ports/azure-umqtt-c/CONTROL @@ -1,7 +1,8 @@ Source: azure-umqtt-c -Version: 2020-02-04.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 Feature: public-preview Description: General purpose library for communication over the mqtt protocol (public preview) diff --git a/ports/azure-umqtt-c/portfile.cmake b/ports/azure-umqtt-c/portfile.cmake index 0d070bf168f59a..84fba09b62871a 100644 --- a/ports/azure-umqtt-c/portfile.cmake +++ b/ports/azure-umqtt-c/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) if("public-preview" IN_LIST FEATURES) @@ -14,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-umqtt-c - REF 65cdd1013715fb9d208c42f957eb353fbe22bafb - SHA512 8cd33dcde966132e2aa0c6d931e75f9bcdc5734d57d8f6bb8a922711b0b63c2f0e58d379fe92371886387dfbb0b8c117b512873363eb76cf22fa985dbf11d52e + REF 165f6f52f8b2aec54a28ea5ede41736589726cd0 + SHA512 af56db89ddbae1a8067d3b1c7f85ecf085fb6bf529d01f74dd301e6994b20e6f1a821fd7d5116b53d1a8911ccc463149a53a5611e650c3aeb63893012206ffb8 HEAD_REF master ) endif() @@ -37,7 +35,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/umqtt) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-umqtt-c/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/basisu/CONTROL b/ports/basisu/CONTROL index 81e17c2de67842..a690f6dbdac128 100644 --- a/ports/basisu/CONTROL +++ b/ports/basisu/CONTROL @@ -1,5 +1,5 @@ Source: basisu -Version: 1.11-3 +Version: 1.11-4 Homepage: https://github.com/BinomialLLC/basis_universal Description: Basis Universal is a supercompressed GPU texture and video compression format that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats. Build-Depends: lodepng diff --git a/ports/basisu/fix-addostream.patch b/ports/basisu/fix-addostream.patch new file mode 100644 index 00000000000000..cd9308bf59549a --- /dev/null +++ b/ports/basisu/fix-addostream.patch @@ -0,0 +1,12 @@ +diff --git a/src/encoder/basisu_enc.h b/src/encoder/basisu_enc.h +index 05656da..468f43b 100644 +--- a/src/encoder/basisu_enc.h ++++ b/src/encoder/basisu_enc.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #ifndef _WIN32 + #include diff --git a/ports/basisu/portfile.cmake b/ports/basisu/portfile.cmake index c78b80188b9836..8873c52fc51344 100644 --- a/ports/basisu/portfile.cmake +++ b/ports/basisu/portfile.cmake @@ -4,6 +4,7 @@ vcpkg_from_github( REF 497875f756ed0e3eb62e0ff08d55c62242f4be74 SHA512 2293b78620a7ed510dbecf48bcae5f4b8524fe9020f864c8e79cf94ea9d95d51dddf83a5b4ea29cc95db19f87137bfef1cb68b7fbc6387e08bb42898d81c9303 HEAD_REF master + PATCHES fix-addostream.patch ) vcpkg_configure_cmake( diff --git a/ports/berkeleydb/CONTROL b/ports/berkeleydb/CONTROL index 75c856c084364f..07ab3e306774da 100644 --- a/ports/berkeleydb/CONTROL +++ b/ports/berkeleydb/CONTROL @@ -1,5 +1,5 @@ Source: berkeleydb -Version: 4.8.30-3 +Version: 4.8.30-4 Homepage: https://download.oracle.com/ Description: BDB - A high-performance embedded database for key/value data. -Supports: !uwp \ No newline at end of file +Supports: !(uwp|linux|osx) diff --git a/ports/berkeleydb/portfile.cmake b/ports/berkeleydb/portfile.cmake index f685279dd32ec9..5d47b7a6fab11e 100644 --- a/ports/berkeleydb/portfile.cmake +++ b/ports/berkeleydb/portfile.cmake @@ -1,8 +1,4 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() - -include(vcpkg_common_functions) +vcpkg_fail_port_install( ON_TARGET "uwp" "linux" "osx") vcpkg_download_distfile(ARCHIVE URLS "http://download.oracle.com/berkeley-db/db-4.8.30.NC.zip" @@ -25,5 +21,4 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/berkeleydb RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bitmagic/CONTROL b/ports/bitmagic/CONTROL new file mode 100644 index 00000000000000..0269eb1b4b2096 --- /dev/null +++ b/ports/bitmagic/CONTROL @@ -0,0 +1,4 @@ +Source: bitmagic +Version: 6.4.0 +Homepage: http://bitmagic.io +Description: Algorithms and tools for Algebra of Sets for information retrieval, indexing of databases, scientific algorithms, ranking, clustering, unsupervised machine learning and signal processing. diff --git a/ports/bitmagic/portfile.cmake b/ports/bitmagic/portfile.cmake new file mode 100644 index 00000000000000..f1cc0ed763987b --- /dev/null +++ b/ports/bitmagic/portfile.cmake @@ -0,0 +1,13 @@ +# Header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tlk00/BitMagic + REF v6.4.0 + SHA512 a7968aaed950e9174192635fe7ab560234bb2757519ea5a2db911e73457e5859f0e16499756865d1eeab286a93da0e87bd454cfa750c20093db3219c05204f96 + HEAD_REF master + +) + +file(GLOB HEADER_LIST "${SOURCE_PATH}/src/*.h") +file(INSTALL ${HEADER_LIST} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/bitserializer-cpprestjson/CONTROL b/ports/bitserializer-cpprestjson/CONTROL index f75cd41a2ddace..24c03ce9a853d2 100644 --- a/ports/bitserializer-cpprestjson/CONTROL +++ b/ports/bitserializer-cpprestjson/CONTROL @@ -1,4 +1,4 @@ Source: bitserializer-cpprestjson -Version: 0.8 -Build-Depends: bitserializer, cpprestsdk -Description: This is an implementation of the BitSerializer archive for serialization JSON (based on CppRestSDK library). +Version: alias +Build-Depends: bitserializer[cpprestjson-archive] +Description: Deprecated alias for bitserializer-cpprestjson diff --git a/ports/bitserializer-cpprestjson/portfile.cmake b/ports/bitserializer-cpprestjson/portfile.cmake index 28430d5908fc96..0015715fb66c72 100644 --- a/ports/bitserializer-cpprestjson/portfile.cmake +++ b/ports/bitserializer-cpprestjson/portfile.cmake @@ -1,13 +1 @@ -include(vcpkg_common_functions) -vcpkg_from_bitbucket( - OUT_SOURCE_PATH SOURCE_PATH - REPO Pavel_Kisliak/BitSerializer - REF 0.8 - SHA512 6df5b3f7a472a55ba0aace22c44cb2adaf178fbc7f920dcaf7d7015f81badde98d64911ddb620e99a708214140d7c29561775c1b0fe60fef6f24d465a4eac093 - HEAD_REF master -) - -file(INSTALL ${SOURCE_PATH}/archives/bitserializer_cpprest_json DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -# Handle copyright -file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bitserializer-cpprestjson RENAME copyright) +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/ports/bitserializer-pugixml/CONTROL b/ports/bitserializer-pugixml/CONTROL new file mode 100644 index 00000000000000..23ab329239ac3b --- /dev/null +++ b/ports/bitserializer-pugixml/CONTROL @@ -0,0 +1,4 @@ +Source: bitserializer-pugixml +Version: alias +Build-Depends: bitserializer[pugixml-archive] +Description: Deprecated alias for bitserializer-pugixml diff --git a/ports/bitserializer-pugixml/portfile.cmake b/ports/bitserializer-pugixml/portfile.cmake new file mode 100644 index 00000000000000..0015715fb66c72 --- /dev/null +++ b/ports/bitserializer-pugixml/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/ports/bitserializer-rapidjson/CONTROL b/ports/bitserializer-rapidjson/CONTROL index db65c52aefba6c..3cb55085bf3462 100644 --- a/ports/bitserializer-rapidjson/CONTROL +++ b/ports/bitserializer-rapidjson/CONTROL @@ -1,4 +1,4 @@ Source: bitserializer-rapidjson -Version: 0.8 -Build-Depends: bitserializer, rapidjson -Description: This is an implementation of the BitSerializer archive for serialization JSON (based on the RapidJson library). +Version: alias +Build-Depends: bitserializer[rapidjson-archive] +Description: Deprecated alias for bitserializer-rapidjson diff --git a/ports/bitserializer-rapidjson/portfile.cmake b/ports/bitserializer-rapidjson/portfile.cmake index 4050b73bc9a7b1..0015715fb66c72 100644 --- a/ports/bitserializer-rapidjson/portfile.cmake +++ b/ports/bitserializer-rapidjson/portfile.cmake @@ -1,13 +1 @@ -include(vcpkg_common_functions) -vcpkg_from_bitbucket( - OUT_SOURCE_PATH SOURCE_PATH - REPO Pavel_Kisliak/BitSerializer - REF 0.8 - SHA512 6df5b3f7a472a55ba0aace22c44cb2adaf178fbc7f920dcaf7d7015f81badde98d64911ddb620e99a708214140d7c29561775c1b0fe60fef6f24d465a4eac093 - HEAD_REF master -) - -file(INSTALL ${SOURCE_PATH}/archives/bitserializer_rapidjson DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -# Handle copyright -file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bitserializer-rapidjson RENAME copyright) +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/ports/bitserializer-rapidyaml/CONTROL b/ports/bitserializer-rapidyaml/CONTROL new file mode 100644 index 00000000000000..3d622fdf31aea2 --- /dev/null +++ b/ports/bitserializer-rapidyaml/CONTROL @@ -0,0 +1,5 @@ +Source: bitserializer-rapidyaml +Version: alias +Build-Depends: bitserializer[rapidyaml-archive] +Description: Deprecated alias for bitserializer-rapidyaml +Supports: !(arm|arm64|osx) diff --git a/ports/bitserializer-rapidyaml/portfile.cmake b/ports/bitserializer-rapidyaml/portfile.cmake new file mode 100644 index 00000000000000..0015715fb66c72 --- /dev/null +++ b/ports/bitserializer-rapidyaml/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/ports/bitserializer/CONTROL b/ports/bitserializer/CONTROL index 35e02fe030844c..63444a871ba59c 100644 --- a/ports/bitserializer/CONTROL +++ b/ports/bitserializer/CONTROL @@ -1,3 +1,21 @@ Source: bitserializer -Version: 0.8 -Description: The core part of library for serialization of arbitrary C++ types to various output formats. +Version: 0.10 +Description: Core part of C++ 17 library for serialization to JSON, XML, YAML +Homepage: https://bitbucket.org/Pavel_Kisliak/bitserializer +Default-Features: cpprestjson-archive, rapidjson-archive, pugixml-archive + +Feature: cpprestjson-archive +Build-Depends: cpprestsdk +Description: Module for support JSON (implementation based on the CppRestSDK library) + +Feature: rapidjson-archive +Build-Depends: rapidjson +Description: Module for support JSON (implementation based on the RapidJson library) + +Feature: pugixml-archive +Build-Depends: pugixml +Description: Module for support XML (implementation based on the PugiXml library) + +Feature: rapidyaml-archive +Build-Depends: ryml (!arm&!arm64&!osx) +Description: Module for support YAML (implementation based on the RapidYaml library) diff --git a/ports/bitserializer/portfile.cmake b/ports/bitserializer/portfile.cmake index 50eb93481b13fc..d4ae869792cf3c 100644 --- a/ports/bitserializer/portfile.cmake +++ b/ports/bitserializer/portfile.cmake @@ -1,13 +1,28 @@ -include(vcpkg_common_functions) vcpkg_from_bitbucket( OUT_SOURCE_PATH SOURCE_PATH REPO Pavel_Kisliak/BitSerializer - REF 0.8 - SHA512 6df5b3f7a472a55ba0aace22c44cb2adaf178fbc7f920dcaf7d7015f81badde98d64911ddb620e99a708214140d7c29561775c1b0fe60fef6f24d465a4eac093 + REF 0.10 + SHA512 a8a5acf4f9cc83d3090a3b06efbca682f4e022b5206bc7859ba6738e4d49a7678aa55f431f1721d50b28d8bde126b672396baae27cbaa79f62e3dc237ae678e1 HEAD_REF master ) -file(INSTALL ${SOURCE_PATH}/core/bitserializer DESTINATION ${CURRENT_PACKAGES_DIR}/include) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "cpprestjson-archive" BUILD_CPPRESTJSON_ARCHIVE + "rapidjson-archive" BUILD_RAPIDJSON_ARCHIVE + "pugixml-archive" BUILD_PUGIXML_ARCHIVE + "rapidyaml-archive" BUILD_RAPIDYAML_ARCHIVE +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/bitserializer) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug) # Handle copyright -file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bitserializer RENAME copyright) +file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bitsery/CONTROL b/ports/bitsery/CONTROL index 93b2313027e8c8..f219deb6eefb6b 100644 --- a/ports/bitsery/CONTROL +++ b/ports/bitsery/CONTROL @@ -1,3 +1,4 @@ Source: bitsery -Version: 5.0.3 +Version: 5.1.0 Description: Header only C++ binary serialization library +Homepage: https://github.com/fraillt/bitsery diff --git a/ports/bitsery/fix-install-paths.patch b/ports/bitsery/fix-install-paths.patch deleted file mode 100644 index aa9130d8c57826..00000000000000 --- a/ports/bitsery/fix-install-paths.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8125a28..8daee28 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -34,9 +34,9 @@ install(TARGETS bitsery - install(EXPORT bitseryTargets - FILE "BitseryConfig.cmake" - NAMESPACE Bitsery:: -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/bitsery) -+ DESTINATION share/bitsery) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/BitseryConfigVersion.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/bitsery) -+ DESTINATION share/bitsery) - install(DIRECTORY include/bitsery - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - diff --git a/ports/bitsery/portfile.cmake b/ports/bitsery/portfile.cmake index d780bfe015a43b..1069ed64c6072a 100644 --- a/ports/bitsery/portfile.cmake +++ b/ports/bitsery/portfile.cmake @@ -1,12 +1,9 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fraillt/bitsery - REF d24dfe14f5a756c0f8ad3d56ae6949ecc2c99b2e # v5.0.3 - SHA512 0bd4c80632640b74387587f85ca6e174aed2efd1dc1d83dd682e26e10aa9ef9a98b5477cfb78aa9cbb1a4112fc12468d7072b5c237f32f6738158ba21cf2ea39 + REF d7876808195834f05fd84619b8f6b266e5c1d5bd + SHA512 ac2c6e3907f8ee8cf51070b3c00aab9071586510d8cfe30f9660ed5aa9918cd996c806b1db2b46d464f1d933fc41472e5406e63ba4814bdc37d2b0f1ad6e1083 HEAD_REF master - PATCHES fix-install-paths.patch ) vcpkg_configure_cmake( @@ -16,7 +13,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -# Delete redundant and empty directories +vcpkg_fixup_cmake_targets( CONFIG_PATH lib/cmake/${PORT} ) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/blaze/CONTROL b/ports/blaze/CONTROL index d9198b970beb8b..5f613205c240bd 100644 --- a/ports/blaze/CONTROL +++ b/ports/blaze/CONTROL @@ -1,5 +1,6 @@ Source: blaze Version: 3.7 -Build-Depends: clapack (!osx), boost-exception +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/blend2d/CONTROL b/ports/blend2d/CONTROL deleted file mode 100644 index 999ab5061c36fd..00000000000000 --- a/ports/blend2d/CONTROL +++ /dev/null @@ -1,11 +0,0 @@ -Source: blend2d -Version: beta_2020-03-29 -Description: Beta 2D Vector Graphics Powered by a JIT Compiler -Default-Features: jit, logging -Supports: !(arm|uwp) - -Feature: jit -Description: Default feature. Enables jit pipeline compilation. Not supported for ARM and UWP. - -Feature: logging -Description: Default feature. Enables logging. diff --git a/ports/blend2d/portfile.cmake b/ports/blend2d/portfile.cmake index ddf330a4180379..0addc0e0ab056a 100644 --- a/ports/blend2d/portfile.cmake +++ b/ports/blend2d/portfile.cmake @@ -1,28 +1,28 @@ -vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") +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 95ab468e39e964f240b847bce0bcb585a260da4c - SHA512 b90cc290673f51560e5085b8db47c5424d092fcd767ad4633b6d37e762d0f1d62fd683b9003269697086ad4aa78672a5682f68c3fd4a478c03f6d5710df66e2f + REF ee5c52aa5fcaaf9910dd2ef566a741d998bdfb98 + SHA512 e33e9418be13d239feb2a88d52538e0a86b920b9bcb0473ac21b27fbd54f7c683e23c1f8a6dbcbcf24fdc85bfc1b5884ebea4a9a5e4ec1fcfbfaa006807e3d59 HEAD_REF master ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BLEND2D_STATIC) -if(NOT ("jit" IN_LIST FEATURES)) - set(BLEND2D_BUILD_NO_JIT TRUE) -endif() -if(NOT ("logging" IN_LIST FEATURES)) - set(BLEND2D_BUILD_NO_LOGGING TRUE) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + jit BLEND2D_NO_JIT + logging BLEND2D_NO_JIT_LOGGING + tls BLEND2D_NO_TLS +) if(NOT BLEND2D_BUILD_NO_JIT) vcpkg_from_github( OUT_SOURCE_PATH ASMJIT_SOURCE_PATH REPO asmjit/asmjit - REF 1491d5f2ea0b6b398a63f250e7456a032866320f - SHA512 1aba49a5b44737d9393cc6576ef79330a2282139a1d3c279851d79e76949cc4bc6b7160c584910e17199f7610fcd29d56362baffce367a84b5432f528782359c + REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 + SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 HEAD_REF master ) @@ -38,11 +38,9 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBLEND2D_STATIC=${BLEND2D_STATIC} - -DBLEND2D_BUILD_NO_JIT=${BLEND2D_BUILD_NO_JIT} - -DBLEND2D_BUILD_NO_LOGGING=${BLEND2D_BUILD_NO_LOGGING} + ${FEATURE_OPTIONS} ) - vcpkg_install_cmake() vcpkg_copy_pdbs() @@ -54,7 +52,6 @@ if(BLEND2D_STATIC) endif() - # Handle copyright configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/blend2d/vcpkg.json b/ports/blend2d/vcpkg.json new file mode 100644 index 00000000000000..163843a0a357c7 --- /dev/null +++ b/ports/blend2d/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "blend2d", + "version-string": "beta_2020-07-31", + "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", + "description": "Default feature. Enables jit pipeline compilation. Not supported for ARM and UWP." + }, + { + "name": "logging", + "description": "Default feature. Enables logging." + }, + { + "name": "tls", + "description": "Default feature. Enables use of thread_local feature. Disable for platforms where thread local storage is expensive or not supported." + } + ] +} diff --git a/ports/blosc/0002-export-blosc-config.patch b/ports/blosc/0002-export-blosc-config.patch new file mode 100644 index 00000000000000..31297f732d62c6 --- /dev/null +++ b/ports/blosc/0002-export-blosc-config.patch @@ -0,0 +1,66 @@ +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index f4e5c29..24641ad 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -122,14 +122,14 @@ endif (NOT DEACTIVATE_ZSTD) + + # targets + if (BUILD_SHARED) +- add_library(blosc_shared SHARED ${SOURCES}) +- set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc) +- set_target_properties(blosc_shared PROPERTIES ++ add_library(blosc SHARED ${SOURCES}) ++ #set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc) ++ set_target_properties(blosc PROPERTIES + VERSION ${version_string} + SOVERSION 1 # Change this when an ABI change happens + ) + set_property( +- TARGET blosc_shared ++ TARGET blosc + APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_SHARED_LIBRARY) + endif() + +@@ -192,8 +192,8 @@ if (BUILD_TESTS) + endif() + + if (BUILD_SHARED) +- target_link_libraries(blosc_shared ${LIBS}) +- target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS}) ++ target_link_libraries(blosc ${LIBS}) ++ target_include_directories(blosc PUBLIC $ $) + endif() + + if (BUILD_TESTS) +@@ -202,22 +202,24 @@ if (BUILD_TESTS) + endif() + + if(BUILD_STATIC) +- add_library(blosc_static STATIC ${SOURCES}) +- set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc) ++ add_library(blosc STATIC ${SOURCES}) ++ #set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc) + if (MSVC) +- set_target_properties(blosc_static PROPERTIES PREFIX lib) ++ #set_target_properties(blosc_static PROPERTIES PREFIX lib) + endif() +- target_link_libraries(blosc_static ${LIBS}) +- target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS}) ++ target_link_libraries(blosc ${LIBS}) ++ target_include_directories(blosc PUBLIC $ $) + endif(BUILD_STATIC) + + # install + if(BLOSC_INSTALL) + install(FILES blosc.h blosc-export.h DESTINATION include COMPONENT DEV) + if(BUILD_SHARED) +- install(TARGETS blosc_shared LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT LIB) ++ install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + endif(BUILD_SHARED) + if(BUILD_STATIC) +- install(TARGETS blosc_static LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT DEV) ++ install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + endif(BUILD_STATIC) + endif(BLOSC_INSTALL) ++ ++install(EXPORT blosc-config DESTINATION share/cmake/blosc) diff --git a/ports/blosc/CONTROL b/ports/blosc/CONTROL index 5284350007bd69..abda40db0f7cf6 100644 --- a/ports/blosc/CONTROL +++ b/ports/blosc/CONTROL @@ -1,5 +1,5 @@ Source: blosc -Version: 1.17.1 +Version: 1.18.1-1 Build-Depends: lz4, snappy, zlib, zstd Homepage: https://github.com/Blosc/c-blosc Description: A blocking, shuffling and loss-less compression library that can be faster than `memcpy()` diff --git a/ports/blosc/FindBlosc.cmake b/ports/blosc/FindBlosc.cmake deleted file mode 100644 index 11385d46d0458f..00000000000000 --- a/ports/blosc/FindBlosc.cmake +++ /dev/null @@ -1,33 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path( - BLOSC_INCLUDE_DIRS - blosc.h -) - -get_filename_component(_prefix_path ${BLOSC_INCLUDE_DIRS} PATH) - -find_library( - BLOSC_LIBRARY_DEBUG - NAMES blosc - PATHS ${_prefix_path}/debug/lib - NO_DEFAULT_PATH -) - -find_library( - SNAPPY_LIBRARY_RELEASE - NAMES blosc - PATHS ${_prefix_path}/lib - NO_DEFAULT_PATH -) - -unset(_prefix_path) - -include(SelectLibraryConfigurations) -select_library_configurations(blosc) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - blosc - REQUIRED_VARS BLOSC_LIBRARIES BLOSC_INCLUDE_DIRS -) diff --git a/ports/blosc/portfile.cmake b/ports/blosc/portfile.cmake index c99898216bdac4..041548b478ae76 100644 --- a/ports/blosc/portfile.cmake +++ b/ports/blosc/portfile.cmake @@ -1,13 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Blosc/c-blosc - REF 30c55d6544613c846368de1faee420e56e992ffe # v1.17.1 - SHA512 c4ed1492fd8733c6acabc973c58d6763e2a3a2bd7965fbf4d267169f5b03055eccdbe2723bc5d98636b039625a55609a092ed65de45d7a2b361347513cc83a98 + REF 9fae1c9acb659159321aca69aefcdbce663e2374 # v1.18.1 + SHA512 6cc77832100041aca8f320e44aa803adc0d3344b52742b995a3155b953e5d149534de65c8244d964448150b73715a81f54285d7d01f1b45d7b10fe07f5bdb141 HEAD_REF master PATCHES 0001-find-deps.patch + 0002-export-blosc-config.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -34,26 +33,11 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() - -if (BLOSC_SHARED) vcpkg_copy_pdbs() - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/blosc.dll") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/blosc.dll ${CURRENT_PACKAGES_DIR}/bin/blosc.dll) - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/blosc.dll") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/blosc.dll ${CURRENT_PACKAGES_DIR}/debug/bin/blosc.dll) - endif() -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/blosc) # cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSES/BLOSC.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/blosc RENAME copyright) - -file(COPY - "${CMAKE_CURRENT_LIST_DIR}/FindBlosc.cmake" - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index 9a6e00f6d7af39..94d5cd3f7a1284 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,5 +1,9 @@ -Source: bond -Version: 8.1.0-3 -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 +Source: bond +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 + +Feature: bond-over-grpc +Description: Bond-over-gRPC provides code generation from Bond IDL service definitions to send Bond objects via gRPC. +Build-Depends: grpc 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 f21d2e7f8dcadb..9a1485baca272b 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,26 +1,28 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +set(BOND_VER 9.0.2) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/bond - REF 8.1.0 - SHA512 287a2d299036b57e0576903b1f5372bf8071243ada57153c4bf231cdc660faab1e70c60ddde57ac759d941b74af4ba25d81a5d58e8dbf391032b7b226c4cd18c + REF ${BOND_VER} + SHA512 ece636bc06e7bac4208d373610e689f19b394cae4eaa869f32b098924a6e7034e4d804d4831d7f6fd2540a619daf77f4ab43c49aa442a9cd26161b0a8a2db000 HEAD_REF master - PATCHES fix-install-path.patch + PATCHES fix-install-path.patch skip-grpc-compilation.patch ) -if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if (VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile(GBC_ARCHIVE - URLS "https://github.com/microsoft/bond/releases/download/8.1.0/gbc-8.1.0-amd64.zip" - FILENAME "gbc-8.1.0-amd64.zip" - SHA512 896c9a78fc714e0ea44c37ed36400ec8e5f52d495a8d81aa80834ff6cd6303c7c94e06129f7b2269416a9e0ffb61423e87406db798fb5be7ff00f14981530089 + URLS "https://github.com/microsoft/bond/releases/download/${BOND_VER}/gbc-${BOND_VER}-amd64.zip" + FILENAME "gbc-${BOND_VER}-amd64.zip" + SHA512 661d63a82284d3ecbc7b50d5f4972dadeb607f96612108a4a0887c6684a418e8b265516354504ca3440a182d1e31f2eb5861531133b455d8b6c01aec45ade5d3 ) + # Clear the generator to prevent it from updating + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/tools/) # Extract the precompiled gbc vcpkg_extract_source_archive(${GBC_ARCHIVE} ${CURRENT_BUILDTREES_DIR}/tools/) - set(FETCHED_GBC_PATH ${CURRENT_BUILDTREES_DIR}/tools/gbc.exe) + set(FETCHED_GBC_PATH ${CURRENT_BUILDTREES_DIR}/tools/gbc-${BOND_VER}-amd64.exe) if (NOT EXISTS "${FETCHED_GBC_PATH}") message(FATAL_ERROR "Fetching GBC failed. Expected '${FETCHED_GBC_PATH}' to exists, but it doesn't.") @@ -34,6 +36,10 @@ else() endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + bond-over-grpc BOND_ENABLE_GRPC +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -42,21 +48,21 @@ vcpkg_configure_cmake( -DBOND_GBC_PATH=${FETCHED_GBC_PATH} -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_ENABLE_COMM=FALSE - -DBOND_ENABLE_GRPC=FALSE -DBOND_FIND_RAPIDJSON=TRUE + -DBOND_STACK_OPTIONS=--allow-different-user + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/bond TARGET_PATH share/bond) -# Put the license file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bond) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/bond/LICENSE ${CURRENT_PACKAGES_DIR}/share/bond/copyright) +vcpkg_copy_pdbs() # There's no way to supress installation of the headers in the debug build, # so we just delete them. file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_pdbs() +# Put the license file where vcpkg expects it +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bond/skip-grpc-compilation.patch b/ports/bond/skip-grpc-compilation.patch new file mode 100644 index 00000000000000..10906b13137b6b --- /dev/null +++ b/ports/bond/skip-grpc-compilation.patch @@ -0,0 +1,11 @@ +diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt +index f8c7bf3..e69de29 100644 +--- a/thirdparty/CMakeLists.txt ++++ b/thirdparty/CMakeLists.txt +@@ -1,6 +0,0 @@ +-include (Compiler) +- +-if (BOND_ENABLE_GRPC) +- cxx_add_compile_options (Clang -Wno-unused-value) +- add_subdirectory(grpc) +-endif() diff --git a/ports/boost-accumulators/CONTROL b/ports/boost-accumulators/CONTROL index 4ef0132e510440..7b101e55bc01b2 100644 --- a/ports/boost-accumulators/CONTROL +++ b/ports/boost-accumulators/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-accumulators -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-circular-buffer, boost-concept-check, boost-config, boost-core, boost-detail, boost-fusion, boost-interval, boost-iterator, boost-mpl, boost-numeric-conversion, boost-odeint, boost-parameter, boost-preprocessor, boost-range, boost-serialization, boost-static-assert, boost-throw-exception, boost-tuple, boost-typeof, boost-type-traits, boost-ublas, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/accumulators Description: Boost accumulators module diff --git a/ports/boost-accumulators/portfile.cmake b/ports/boost-accumulators/portfile.cmake index fb5c4175274070..2094b72bf2ee57 100644 --- a/ports/boost-accumulators/portfile.cmake +++ b/ports/boost-accumulators/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/accumulators - REF boost-1.72.0 - SHA512 3e232de2d32bffc5483edf201dd2cfbc8c6584c0be877c8234c2bd21eee118eaf9b96050b26bc8237ba552a2dca3f313ace8264d45ef7e9035732ce1ee74384d + REF boost-1.73.0 + SHA512 f13e85e464509987a58f955bdf4a167460fe1dbd87bf189c121a0bd7176cf37889a28b812a837770b0aff5f1e80ed0be45c7c8fd3a86672427cbb52e236e7071 HEAD_REF master ) diff --git a/ports/boost-algorithm/CONTROL b/ports/boost-algorithm/CONTROL index 701b405da8ac3e..09a190692aa1e1 100644 --- a/ports/boost-algorithm/CONTROL +++ b/ports/boost-algorithm/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-algorithm -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-bind, boost-concept-check, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-iterator, boost-mpl, boost-range, boost-regex, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/algorithm Description: Boost algorithm module diff --git a/ports/boost-algorithm/portfile.cmake b/ports/boost-algorithm/portfile.cmake index 9c2c241fc8084a..dd3fc82584cf8f 100644 --- a/ports/boost-algorithm/portfile.cmake +++ b/ports/boost-algorithm/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/algorithm - REF boost-1.72.0 - SHA512 503fb782faad0e68e58841b098162a32f08a5f125ceb1af46272096daf223056fbf5b3e1011773ad8ef1dc9dfd301feef82ce6ce870fe4741ee838ca5f5bc6f7 + REF boost-1.73.0 + SHA512 b8437e9a800ada66babc81fadce67ccffa9dd426e0ffe7c4b54fed73dd0bf19d00ae2c2911837b8b79225f0ed4e43c9810f3ba5a33b9afb2fbbb7dcb70a96efe HEAD_REF master ) diff --git a/ports/boost-align/CONTROL b/ports/boost-align/CONTROL index ba2c35a6732500..0e772f983ad39e 100644 --- a/ports/boost-align/CONTROL +++ b/ports/boost-align/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-align -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-static-assert, boost-vcpkg-helpers Homepage: https://github.com/boostorg/align Description: Boost align module diff --git a/ports/boost-align/portfile.cmake b/ports/boost-align/portfile.cmake index 5785a6997f9c24..2ffdd8d299c497 100644 --- a/ports/boost-align/portfile.cmake +++ b/ports/boost-align/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/align - REF boost-1.72.0 - SHA512 5044b1faeca09ed88aa529092805d359c3e82ddf1be8e227a020acf8d21a4c1a670381bbd7024271e86407da2702c6f9705d76dfd889cecdf301ccea5e0aaa09 + REF boost-1.73.0 + SHA512 16c3ca5cadbe3466903b6b1a93cdf5bc6b3fa4f92e3a933caadabf3fbb3f06ca114d811b177a771315ca1f5883d5bde57059f43fffd04e66ffef50487efe7b87 HEAD_REF master ) diff --git a/ports/boost-any/CONTROL b/ports/boost-any/CONTROL index 67e42ebeab6ad5..a26552ffe701a5 100644 --- a/ports/boost-any/CONTROL +++ b/ports/boost-any/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-any -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-static-assert, boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/any Description: Boost any module diff --git a/ports/boost-any/portfile.cmake b/ports/boost-any/portfile.cmake index 7c3accef0ecddc..a519cf317e642d 100644 --- a/ports/boost-any/portfile.cmake +++ b/ports/boost-any/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/any - REF boost-1.72.0 - SHA512 5b1f35356f1ec8f48ddf534a13fc99a0da5579c0ff7d08b444888d18961b2f16fbf0f12ed099c9c53653df92cd7ea3a9f98a9fc4bbf865df91deb7085294ca9e + REF boost-1.73.0 + SHA512 71a6f4b5862b2e2d989ad9c46c8ea24a689e5fc4e7de857e40dfb8b1e484a28631012d7e3df545a3bdb36f6bb9b4c0184e3506906c5e92b35d9aaad8f9830f21 HEAD_REF master ) diff --git a/ports/boost-array/CONTROL b/ports/boost-array/CONTROL index d2e38b11aa95e8..0a0192a4a391a4 100644 --- a/ports/boost-array/CONTROL +++ b/ports/boost-array/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-array -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-static-assert, boost-throw-exception, boost-vcpkg-helpers Homepage: https://github.com/boostorg/array Description: Boost array module diff --git a/ports/boost-array/portfile.cmake b/ports/boost-array/portfile.cmake index 66a3f639e3451f..69b13047fda15e 100644 --- a/ports/boost-array/portfile.cmake +++ b/ports/boost-array/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/array - REF boost-1.72.0 - SHA512 61252106866227256045d438a64a64083068ae258590ce1e16909b46106c73d0492624aaf477f04b1b6f787ded3527786ecc93af79b90b8356a8c1dcd9917908 + REF boost-1.73.0 + SHA512 020eabd6bd57988a773656f5c41c17457e4f03d90bc3aa34b1f875e8af91d77f2911db5baeaf295c57cdc9e4df2687b659c6cee2a175504ca6cdabc73c028694 HEAD_REF master ) diff --git a/ports/boost-asio/CONTROL b/ports/boost-asio/CONTROL index dd9cc6366d83ac..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.72.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 +Version: 1.73.0 +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-asio/portfile.cmake b/ports/boost-asio/portfile.cmake index b0bd10ed778edd..89c2093b627ac9 100644 --- a/ports/boost-asio/portfile.cmake +++ b/ports/boost-asio/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/asio - REF boost-1.72.0 - SHA512 5d3ae95cf0261fddd037beb6225c51b6a575779f10e8125c7e2f069642f54c0935f6b048187f55c10569874b7d4de488efae058d43d92caf5b8661e13dbcaae5 + REF boost-1.73.0 + SHA512 662e7ea329110492062cc4d5275df5984ff59e9cf3824c1199c46fc3e76b366235865bde9d36504277bd209ae2c1fccd3b9e0d51195a88129473a26d14c26baa HEAD_REF master PATCHES windows_alloca_header.patch ) diff --git a/ports/boost-assert/CONTROL b/ports/boost-assert/CONTROL index 234bf034ca0c33..33a4bfdd7e2f2d 100644 --- a/ports/boost-assert/CONTROL +++ b/ports/boost-assert/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-assert -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-vcpkg-helpers Homepage: https://github.com/boostorg/assert Description: Boost assert module diff --git a/ports/boost-assert/portfile.cmake b/ports/boost-assert/portfile.cmake index 5c07464218e78d..ab172fbdb31798 100644 --- a/ports/boost-assert/portfile.cmake +++ b/ports/boost-assert/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/assert - REF boost-1.72.0 - SHA512 ae83ce78bb247a521f06b3c22835456ebbca05eae89c78c4657010df58e5c923e65e00c772e89e16e2c9ce9eea8f5b5fb2e1700883bb3d5796f4108075634bdc + REF boost-1.73.0 + SHA512 8fb474210da9ebbc57fbb4c1df5e8eea25d9e4c4345fa86a4d28ce13e3cfaa6f49323d3fd5695bcc290c715f5a2c8f8890794550330a6312a3f77db5eacb9031 HEAD_REF master ) diff --git a/ports/boost-assign/CONTROL b/ports/boost-assign/CONTROL index c1544939ced23a..25f868bdce92d4 100644 --- a/ports/boost-assign/CONTROL +++ b/ports/boost-assign/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-assign -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-config, boost-detail, boost-move, boost-mpl, boost-preprocessor, boost-ptr-container, boost-range, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/assign Description: Boost assign module diff --git a/ports/boost-assign/portfile.cmake b/ports/boost-assign/portfile.cmake index 2d79c134389587..74c82131a554b5 100644 --- a/ports/boost-assign/portfile.cmake +++ b/ports/boost-assign/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/assign - REF boost-1.72.0 - SHA512 71913c0612e3b0a4204b0f23e9c9848a37a7bdc028965c040c4bf65cdb4e884f67d39304ef5b41045643664e1e29da4d56cddac3b1bde5af0f058faa3efa1e18 + REF boost-1.73.0 + SHA512 69e75e42176a40bea8a208f2bebb4701678f1410aacd647a19f4d55aa12c851f53ee359e895af93dbb67ba3ec25a47eac871c54a8d645017a615fc810bd60ba7 HEAD_REF master ) diff --git a/ports/boost-atomic/CONTROL b/ports/boost-atomic/CONTROL index 153477b74bf7e6..f0f138ad955a8e 100644 --- a/ports/boost-atomic/CONTROL +++ b/ports/boost-atomic/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-atomic -Version: 1.72.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-integer, boost-modular-build-helper, boost-type-traits, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-assert, boost-build, boost-config, boost-integer, boost-modular-build-helper, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/atomic Description: Boost atomic module diff --git a/ports/boost-atomic/portfile.cmake b/ports/boost-atomic/portfile.cmake index 4c5de55ee56a51..40037c721e7447 100644 --- a/ports/boost-atomic/portfile.cmake +++ b/ports/boost-atomic/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/atomic - REF boost-1.72.0 - SHA512 dc8f20520b91d9691318cdb09654294105522c4367e823b4a2c54fbd1ebf818bd59edd92f7cd37634bc09dc341cc0a6664ce8a240dd860674f115be162a6b30f + REF boost-1.73.0 + SHA512 2dc22e06364e8962a745b64f66f60235236ebba301ebfa4c0cac37b6581cb1df0fb85913e30a15437b587d858292e0a793588d8d898eeba641be753c4dc4899a HEAD_REF master ) diff --git a/ports/boost-beast/0002-beast-coroutines.patch b/ports/boost-beast/0002-beast-coroutines.patch new file mode 100644 index 00000000000000..1646a07f39da65 --- /dev/null +++ b/ports/boost-beast/0002-beast-coroutines.patch @@ -0,0 +1,1466 @@ +diff -aruN a/include/boost/beast/core/detail/impl/read.hpp b/include/boost/beast/core/detail/impl/read.hpp +--- a/include/boost/beast/core/detail/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/detail/impl/read.hpp 2020-05-02 13:50:11.141761700 -0400 +@@ -214,7 +214,7 @@ + class AsyncReadStream, + class DynamicBuffer, + class CompletionCondition, +- class ReadHandler, ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler, + class> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + async_read( +diff -aruN a/include/boost/beast/core/detail/is_invocable.hpp b/include/boost/beast/core/detail/is_invocable.hpp +--- a/include/boost/beast/core/detail/is_invocable.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/detail/is_invocable.hpp 2020-05-02 13:50:11.141761700 -0400 +@@ -10,6 +10,8 @@ + #ifndef BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP + #define BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP + ++#include ++#include + #include + #include + +@@ -51,6 +53,26 @@ + }; + /** @} */ + ++template ++struct is_completion_token_for : std::false_type ++{ ++}; ++ ++struct any_initiation ++{ ++ template ++ void operator()(AnyArgs&&...); ++}; ++ ++template ++struct is_completion_token_for< ++ CompletionToken, R(Args...), boost::void_t( ++ any_initiation(), std::declval()) ++ )>> : std::true_type ++{ ++}; ++ + } // detail + } // beast + } // boost +diff -aruN a/include/boost/beast/core/detail/read.hpp b/include/boost/beast/core/detail/read.hpp +--- a/include/boost/beast/core/detail/read.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/detail/read.hpp 2020-05-02 13:50:11.142761711 -0400 +@@ -219,7 +219,7 @@ + class AsyncReadStream, + class DynamicBuffer, + class CompletionCondition, +- class ReadHandler ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler + #if ! BOOST_BEAST_DOXYGEN + , class = typename std::enable_if< + is_async_read_stream::value && +diff -aruN a/include/boost/beast/core/detect_ssl.hpp b/include/boost/beast/core/detect_ssl.hpp +--- a/include/boost/beast/core/detect_ssl.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/detect_ssl.hpp 2020-05-02 13:50:11.143761722 -0400 +@@ -374,13 +374,13 @@ + void operator()( + DetectHandler&& h, + AsyncReadStream* s, // references are passed as pointers +- DynamicBuffer& b) ++ DynamicBuffer* b) + { + detect_ssl_op< + typename std::decay::type, + AsyncReadStream, + DynamicBuffer>( +- std::forward(h), *s, b); ++ std::forward(h), *s, *b); + } + }; + +@@ -439,7 +439,7 @@ + detail::run_detect_ssl_op{}, + token, + &stream, // pass the reference by pointer +- buffer); ++ &buffer); + } + + //] +diff -aruN a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp +--- a/include/boost/beast/core/impl/basic_stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/impl/basic_stream.hpp 2020-05-02 13:50:11.144761733 -0400 +@@ -776,7 +776,7 @@ + //------------------------------------------------------------------------------ + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(ConnectHandler) + basic_stream:: + async_connect( +@@ -795,7 +795,7 @@ + template + template< + class EndpointSequence, +- class RangeConnectHandler, ++ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler, + class> + BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void(error_code, typename Protocol::endpoint)) + basic_stream:: +@@ -817,7 +817,7 @@ + template< + class EndpointSequence, + class ConnectCondition, +- class RangeConnectHandler, ++ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler, + class> + BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint)) + basic_stream:: +@@ -839,7 +839,7 @@ + template + template< + class Iterator, +- class IteratorConnectHandler> ++ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler> + BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) + basic_stream:: + async_connect( +@@ -860,7 +860,7 @@ + template< + class Iterator, + class ConnectCondition, +- class IteratorConnectHandler> ++ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler> + BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) + basic_stream:: + async_connect( +@@ -881,7 +881,7 @@ + //------------------------------------------------------------------------------ + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + basic_stream:: + async_read_some( +@@ -901,7 +901,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + basic_stream:: + async_write_some( +diff -aruN a/include/boost/beast/core/impl/buffered_read_stream.hpp b/include/boost/beast/core/impl/buffered_read_stream.hpp +--- a/include/boost/beast/core/impl/buffered_read_stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/impl/buffered_read_stream.hpp 2020-05-02 13:50:11.144761733 -0400 +@@ -110,7 +110,7 @@ + operator()( + ReadHandler&& h, + buffered_read_stream* s, +- Buffers const& b) ++ Buffers const* b) + { + // If you get an error on the following line it means + // that your handler does not meet the documented type +@@ -124,7 +124,7 @@ + read_op< + Buffers, + typename std::decay::type>( +- std::forward(h), *s, b); ++ std::forward(h), *s, *b); + } + }; + +@@ -141,7 +141,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + buffered_read_stream:: + async_write_some( +@@ -153,7 +153,7 @@ + static_assert(net::is_const_buffer_sequence< + ConstBufferSequence>::value, + "ConstBufferSequence type requirements not met"); +- static_assert(detail::is_invocable::value, + "WriteHandler type requirements not met"); + return next_layer_.async_write_some(buffers, +@@ -212,7 +212,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + buffered_read_stream:: + async_read_some( +@@ -233,7 +233,7 @@ + typename ops::run_read_op{}, + handler, + this, +- buffers); ++ &buffers); + } + + } // beast +diff -aruN a/include/boost/beast/core/impl/flat_stream.hpp b/include/boost/beast/core/impl/flat_stream.hpp +--- a/include/boost/beast/core/impl/flat_stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/core/impl/flat_stream.hpp 2020-05-02 13:50:11.145761743 -0400 +@@ -144,7 +144,7 @@ + template + template< + class MutableBufferSequence, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + flat_stream:: + async_read_some( +@@ -225,7 +225,7 @@ + template + template< + class ConstBufferSequence, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + flat_stream:: + async_write_some( +diff -aruN a/include/boost/beast/_experimental/http/impl/icy_stream.hpp b/include/boost/beast/_experimental/http/impl/icy_stream.hpp +--- a/include/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-05-02 13:50:11.146761754 -0400 +@@ -259,7 +259,7 @@ + template + template< + class MutableBufferSequence, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + icy_stream:: + async_read_some( +@@ -311,7 +311,7 @@ + template + template< + class MutableBufferSequence, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + icy_stream:: + async_write_some( +diff -aruN a/include/boost/beast/_experimental/test/impl/stream.hpp b/include/boost/beast/_experimental/test/impl/stream.hpp +--- a/include/boost/beast/_experimental/test/impl/stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/_experimental/test/impl/stream.hpp 2020-05-02 13:50:11.147761765 -0400 +@@ -306,7 +306,7 @@ + return 0; + } + +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + stream:: + async_read_some( +@@ -386,7 +386,7 @@ + return n; + } + +-template ++template + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + stream:: + async_write_some( +diff -aruN a/include/boost/beast/http/field.hpp b/include/boost/beast/http/field.hpp +--- a/include/boost/beast/http/field.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/field.hpp 2020-05-02 13:50:11.149761786 -0400 +@@ -396,12 +396,9 @@ + string_to_field(string_view s); + + /// Write the text for a field name to an output stream. +-inline ++BOOST_BEAST_DECL + std::ostream& +-operator<<(std::ostream& os, field f) +-{ +- return os << to_string(f); +-} ++operator<<(std::ostream& os, field f); + + } // http + } // beast +diff -aruN a/include/boost/beast/http/impl/field.ipp b/include/boost/beast/http/impl/field.ipp +--- a/include/boost/beast/http/impl/field.ipp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/impl/field.ipp 2020-05-02 13:50:11.150761798 -0400 +@@ -11,10 +11,12 @@ + #define BOOST_BEAST_HTTP_IMPL_FIELD_IPP + + #include ++#include + #include + #include + #include +-#include ++#include ++ + + namespace boost { + namespace beast { +@@ -565,6 +567,12 @@ + return detail::get_field_table().string_to_field(s); + } + ++std::ostream& ++operator<<(std::ostream& os, field f) ++{ ++ return os << to_string(f); ++} ++ + } // http + } // beast + } // boost +diff -aruN a/include/boost/beast/http/impl/file_body_win32.hpp b/include/boost/beast/http/impl/file_body_win32.hpp +--- a/include/boost/beast/http/impl/file_body_win32.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/impl/file_body_win32.hpp 2020-05-02 13:50:11.150761798 -0400 +@@ -597,7 +597,7 @@ + template< + class Protocol, class Executor, + bool isRequest, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write_some( + net::basic_stream_socket< +diff -aruN a/include/boost/beast/http/impl/read.hpp b/include/boost/beast/http/impl/read.hpp +--- a/include/boost/beast/http/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/impl/read.hpp 2020-05-02 13:50:11.150761798 -0400 +@@ -304,7 +304,7 @@ + class AsyncReadStream, + class DynamicBuffer, + bool isRequest, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + async_read_some( + AsyncReadStream& stream, +@@ -373,7 +373,7 @@ + class AsyncReadStream, + class DynamicBuffer, + bool isRequest, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + async_read_header( + AsyncReadStream& stream, +@@ -443,7 +443,7 @@ + class AsyncReadStream, + class DynamicBuffer, + bool isRequest, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + async_read( + AsyncReadStream& stream, +@@ -531,7 +531,7 @@ + class AsyncReadStream, + class DynamicBuffer, + bool isRequest, class Body, class Allocator, +- class ReadHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler> + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + async_read( + AsyncReadStream& stream, +diff -aruN a/include/boost/beast/http/impl/write.hpp b/include/boost/beast/http/impl/write.hpp +--- a/include/boost/beast/http/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/impl/write.hpp 2020-05-02 13:50:11.150761798 -0400 +@@ -463,7 +463,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write_some_impl( + AsyncWriteStream& stream, +@@ -526,7 +526,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write_some( + AsyncWriteStream& stream, +@@ -608,7 +608,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write_header( + AsyncWriteStream& stream, +@@ -681,7 +681,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write( + AsyncWriteStream& stream, +@@ -801,7 +801,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write( + AsyncWriteStream& stream, +@@ -830,7 +830,7 @@ + template< + class AsyncWriteStream, + bool isRequest, class Body, class Fields, +- class WriteHandler> ++ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler> + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + async_write( + AsyncWriteStream& stream, +diff -aruN a/include/boost/beast/http/span_body.hpp b/include/boost/beast/http/span_body.hpp +--- a/include/boost/beast/http/span_body.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/http/span_body.hpp 2020-05-02 13:50:11.151761808 -0400 +@@ -36,8 +36,10 @@ + struct span_body + { + private: +- static_assert(std::is_pod::value, +- "POD requirements not met"); ++ static_assert( ++ std::is_trivial::value && ++ std::is_standard_layout::value, ++ "POD requirements not met"); + + public: + /** The type of container used for the body +diff -aruN a/include/boost/beast/ssl/ssl_stream.hpp b/include/boost/beast/ssl/ssl_stream.hpp +--- a/include/boost/beast/ssl/ssl_stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/ssl/ssl_stream.hpp 2020-05-02 13:50:11.151761808 -0400 +@@ -555,7 +555,7 @@ + need to ensure that all data is written before the asynchronous operation + completes. + */ +- template ++ template + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void(boost::system::error_code, std::size_t)) + async_write_some(ConstBufferSequence const& buffers, + BOOST_ASIO_MOVE_ARG(WriteHandler) handler) +@@ -636,7 +636,7 @@ + if you need to ensure that the requested amount of data is read before + the asynchronous operation completes. + */ +- template ++ template + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void(boost::system::error_code, std::size_t)) + async_read_some(MutableBufferSequence const& buffers, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler) +diff -aruN a/include/boost/beast/version.hpp b/include/boost/beast/version.hpp +--- a/include/boost/beast/version.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/version.hpp 2020-05-02 13:50:11.151761808 -0400 +@@ -20,7 +20,7 @@ + This is a simple integer that is incremented by one every + time a set of code changes is merged to the develop branch. + */ +-#define BOOST_BEAST_VERSION 290 ++#define BOOST_BEAST_VERSION 292 + + #define BOOST_BEAST_VERSION_STRING "Boost.Beast/" BOOST_STRINGIZE(BOOST_BEAST_VERSION) + +diff -aruN a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp +--- a/include/boost/beast/websocket/impl/accept.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/accept.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -542,7 +542,7 @@ + + template + template< +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept( +@@ -564,7 +564,7 @@ + template + template< + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept_ex( +@@ -590,7 +590,7 @@ + template + template< + class ConstBufferSequence, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept( +@@ -621,7 +621,7 @@ + template< + class ConstBufferSequence, + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept_ex( +@@ -654,7 +654,7 @@ + template + template< + class Body, class Allocator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept( +@@ -678,7 +678,7 @@ + template< + class Body, class Allocator, + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + stream:: + async_accept_ex( +diff -aruN a/include/boost/beast/websocket/impl/close.hpp b/include/boost/beast/websocket/impl/close.hpp +--- a/include/boost/beast/websocket/impl/close.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/close.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -382,7 +382,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(CloseHandler) + stream:: + async_close(close_reason const& cr, CloseHandler&& handler) +diff -aruN a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp +--- a/include/boost/beast/websocket/impl/handshake.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/handshake.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -268,7 +268,7 @@ + //------------------------------------------------------------------------------ + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) + stream:: + async_handshake( +@@ -293,7 +293,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) + stream:: + async_handshake( +diff -aruN a/include/boost/beast/websocket/impl/ping.hpp b/include/boost/beast/websocket/impl/ping.hpp +--- a/include/boost/beast/websocket/impl/ping.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/ping.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -288,7 +288,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(WriteHandler) + stream:: + async_ping(ping_data const& payload, WriteHandler&& handler) +@@ -306,7 +306,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT1(WriteHandler) + stream:: + async_pong(ping_data const& payload, WriteHandler&& handler) +diff -aruN a/include/boost/beast/websocket/impl/read.hpp b/include/boost/beast/websocket/impl/read.hpp +--- a/include/boost/beast/websocket/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/read.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -804,7 +804,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + stream:: + async_read(DynamicBuffer& buffer, ReadHandler&& handler) +@@ -878,7 +878,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + stream:: + async_read_some( +@@ -1263,7 +1263,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) + stream:: + async_read_some( +diff -aruN a/include/boost/beast/websocket/impl/write.hpp b/include/boost/beast/websocket/impl/write.hpp +--- a/include/boost/beast/websocket/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/impl/write.hpp 2020-05-02 13:50:11.153761830 -0400 +@@ -700,7 +700,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + stream:: + async_write_some(bool fin, +@@ -756,7 +756,7 @@ + } + + template +-template ++template + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) + stream:: + async_write( +diff -aruN a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp +--- a/include/boost/beast/websocket/stream.hpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/include/boost/beast/websocket/stream.hpp 2020-05-02 13:50:11.154761841 -0400 +@@ -2634,7 +2634,7 @@ + + template< + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + async_accept_ex( + ResponseDecorator const& decorator, +@@ -2643,7 +2643,7 @@ + template< + class ConstBufferSequence, + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + async_accept_ex( + ConstBufferSequence const& buffers, +@@ -2656,7 +2656,7 @@ + template< + class Body, class Allocator, + class ResponseDecorator, +- class AcceptHandler> ++ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler> + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) + async_accept_ex( + http::request ++ template + typename net::async_result::return_type + async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler) + { +diff -aruN a/test/beast/core/basic_stream.cpp b/test/beast/core/basic_stream.cpp +--- a/test/beast/core/basic_stream.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/core/basic_stream.cpp 2020-05-02 13:51:02.470315892 -0400 +@@ -30,6 +30,13 @@ + #include + #include + ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#include ++#include ++#endif ++ ++ + namespace boost { + namespace beast { + +@@ -258,7 +265,7 @@ + { + string_view s_; + net::ip::tcp::socket socket_; +- ++ + public: + session( + string_view s, +@@ -1297,6 +1304,52 @@ + + //-------------------------------------------------------------------------- + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompilation( ++ basic_stream& stream, ++ net::mutable_buffer outbuf, ++ net::const_buffer inbuf, ++ net::ip::tcp::resolver::results_type resolve_results) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_read_some(outbuf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_write_some(inbuf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_connect( ++ resolve_results.begin(), ++ resolve_results.end(), ++ net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_connect( ++ resolve_results, ++ net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_connect( ++ resolve_results.begin()->endpoint(), ++ net::use_awaitable))>); ++ ++ auto comparison_function = [](error_code&, net::ip::tcp::endpoint) { return true; }; ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_connect( ++ resolve_results.begin(), ++ resolve_results.end(), ++ comparison_function, ++ net::use_awaitable))>); ++ } ++#endif ++ + void + run() + { +@@ -1307,6 +1360,11 @@ + testMembers(); + testJavadocs(); + testIssue1589(); ++ ++#if BOOST_ASIO_HAS_CO_AWAIT ++ // test for compilation success only ++ boost::ignore_unused(&basic_stream_test::testAwaitableCompilation); ++#endif + } + }; + +diff -aruN a/test/beast/core/buffered_read_stream.cpp b/test/beast/core/buffered_read_stream.cpp +--- a/test/beast/core/buffered_read_stream.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/core/buffered_read_stream.cpp 2020-05-02 13:51:02.470315892 -0400 +@@ -21,6 +21,9 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -211,6 +214,22 @@ + } + }; + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ buffered_read_stream& stream, ++ net::mutable_buffer rxbuf, ++ net::const_buffer txbuf) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_read_some(rxbuf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_write_some(txbuf, net::use_awaitable))>); ++ } ++#endif ++ + void run() override + { + testSpecialMembers(); +@@ -221,6 +240,10 @@ + }); + + testAsyncLoop(); ++ ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&buffered_read_stream_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/core/detect_ssl.cpp b/test/beast/core/detect_ssl.cpp +--- a/test/beast/core/detect_ssl.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/core/detect_ssl.cpp 2020-05-02 13:51:02.470315892 -0400 +@@ -16,6 +16,11 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#include ++#include ++#endif + namespace boost { + namespace beast { + +@@ -166,12 +171,25 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles(test::stream& stream, flat_buffer& b) ++ { ++ static_assert( ++ std::is_same_v< ++ net::awaitable, decltype( ++ async_detect_ssl(stream, b, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { + testDetect(); + testRead(); + testAsyncRead(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&detect_ssl_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/core/flat_stream.cpp b/test/beast/core/flat_stream.cpp +--- a/test/beast/core/flat_stream.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/core/flat_stream.cpp 2020-05-02 13:51:02.471315902 -0400 +@@ -17,6 +17,9 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -208,11 +211,30 @@ + check({1,2,3,4}, 3, 3, true); + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ flat_stream& stream, ++ net::mutable_buffer rxbuf, ++ net::const_buffer txbuf) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_read_some(rxbuf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ stream.async_write_some(txbuf, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { + testMembers(); + testSplit(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&flat_stream_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/core/stream_traits.cpp b/test/beast/core/stream_traits.cpp +--- a/test/beast/core/stream_traits.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/core/stream_traits.cpp 2020-05-02 13:51:02.471315902 -0400 +@@ -214,14 +214,14 @@ + struct async_read_stream + { + net::io_context::executor_type get_executor() noexcept; +- template ++ template + void async_read_some(MutableBufferSequence const&, ReadHandler&&); + }; + + struct async_write_stream + { + net::io_context::executor_type get_executor() noexcept; +- template ++ template + void async_write_some(ConstBufferSequence const&, WriteHandler&&); + }; + +@@ -232,9 +232,9 @@ + struct async_stream : async_read_stream, async_write_stream + { + net::io_context::executor_type get_executor() noexcept; +- template ++ template + void async_read_some(MutableBufferSequence const&, ReadHandler&&); +- template ++ template + void async_write_some(ConstBufferSequence const&, WriteHandler&&); + }; + +diff -aruN a/test/beast/http/CMakeLists.txt b/test/beast/http/CMakeLists.txt +--- a/test/beast/http/CMakeLists.txt 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/http/CMakeLists.txt 2020-05-02 13:51:02.472315914 -0400 +@@ -26,6 +26,7 @@ + empty_body.cpp + error.cpp + field.cpp ++ field_compiles.cpp + fields.cpp + file_body.cpp + message.cpp +diff -aruN a/test/beast/http/field_compiles.cpp b/test/beast/http/field_compiles.cpp +--- a/test/beast/http/field_compiles.cpp 1969-12-31 19:00:00.000000000 -0500 ++++ b/test/beast/http/field_compiles.cpp 2020-05-02 13:51:02.473315924 -0400 +@@ -0,0 +1,11 @@ ++// ++// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) ++// ++// Distributed under the Boost Software License, Version 1.0. (See accompanying ++// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ++// ++// Official repository: https://github.com/boostorg/beast ++// ++ ++// Test that header file is self-contained. ++#include +diff -aruN a/test/beast/http/Jamfile b/test/beast/http/Jamfile +--- a/test/beast/http/Jamfile 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/http/Jamfile 2020-05-02 13:51:02.472315914 -0400 +@@ -16,6 +16,7 @@ + dynamic_body.cpp + error.cpp + field.cpp ++ field_compiles.cpp + fields.cpp + file_body.cpp + message.cpp +diff -aruN a/test/beast/http/read.cpp b/test/beast/http/read.cpp +--- a/test/beast/http/read.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/http/read.cpp 2020-05-02 13:51:02.472315914 -0400 +@@ -25,6 +25,9 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -529,6 +532,49 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ test::stream& stream, ++ flat_buffer& dynbuf, ++ parser& request_parser, ++ request& request, ++ parser& response_parser, ++ response& response) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read(stream, dynbuf, request, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read(stream, dynbuf, request_parser, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read(stream, dynbuf, response, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read(stream, dynbuf, response_parser, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read_some(stream, dynbuf, request_parser, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read_some(stream, dynbuf, response_parser, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read_header(stream, dynbuf, request_parser, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_read_header(stream, dynbuf, response_parser, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { +@@ -552,6 +598,9 @@ + testRegression430(); + testReadGrind(); + testAsioHandlerInvoke(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&read_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/http/write.cpp b/test/beast/http/write.cpp +--- a/test/beast/http/write.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/http/write.cpp 2020-05-02 13:51:02.473315924 -0400 +@@ -26,6 +26,9 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -994,6 +997,59 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ test::stream& stream, ++ serializer& request_serializer, ++ request& req, ++ request const& creq, ++ serializer& response_serializer, ++ response& resp, ++ response const& cresp) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, request_serializer, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, response_serializer, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, req, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, creq, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, resp, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write(stream, cresp, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write_some(stream, request_serializer, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write_some(stream, response_serializer, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write_header(stream, request_serializer, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ http::async_write_header(stream, response_serializer, net::use_awaitable))>); ++ } ++#endif ++ ++ + void + run() override + { +@@ -1017,6 +1073,9 @@ + }); + testAsioHandlerInvoke(); + testBodyWriters(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&write_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/accept.cpp b/test/beast/websocket/accept.cpp +--- a/test/beast/websocket/accept.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/accept.cpp 2020-05-02 13:51:02.473315924 -0400 +@@ -14,7 +14,9 @@ + #include + #include + #include "test.hpp" +- ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + namespace boost { + namespace beast { + namespace websocket { +@@ -810,6 +812,27 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ stream& s, ++ http::request& req, ++ net::mutable_buffer buf ++ ) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_accept(net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_accept(req, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_accept(buf, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { +@@ -820,6 +843,9 @@ + testInvalidInputs(); + testEndOfStream(); + testAsync(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&accept_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/close.cpp b/test/beast/websocket/close.cpp +--- a/test/beast/websocket/close.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/close.cpp 2020-05-02 13:51:02.473315924 -0400 +@@ -16,6 +16,9 @@ + + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -735,6 +738,15 @@ + } + }; + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles(stream& s, close_reason cr ) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_close(cr, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { +@@ -742,6 +754,9 @@ + testTimeout(); + testSuspend(); + testMoveOnly(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&close_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/handshake.cpp b/test/beast/websocket/handshake.cpp +--- a/test/beast/websocket/handshake.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/handshake.cpp 2020-05-02 13:51:02.473315924 -0400 +@@ -18,6 +18,9 @@ + #include + #include + #include ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif + + namespace boost { + namespace beast { +@@ -704,6 +707,23 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ stream& s, ++ std::string host, ++ std::string port, ++ response_type& resp) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_handshake(host, port, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_handshake(resp, host, port, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { +@@ -714,6 +734,9 @@ + testMoveOnly(); + testAsync(); + testIssue1460(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&handshake_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/ping.cpp b/test/beast/websocket/ping.cpp +--- a/test/beast/websocket/ping.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/ping.cpp 2020-05-02 13:51:02.474315935 -0400 +@@ -18,6 +18,10 @@ + #include + #include + ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif ++ + namespace boost { + namespace beast { + namespace websocket { +@@ -483,12 +487,30 @@ + } + }; + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ stream& s, ++ ping_data& pdat) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_ping(pdat, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_pong(pdat, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { + testPing(); + testSuspend(); + testMoveOnly(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&ping_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/read2.cpp b/test/beast/websocket/read2.cpp +--- a/test/beast/websocket/read2.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/read2.cpp 2020-05-02 13:51:02.474315935 -0400 +@@ -14,6 +14,10 @@ + + #include + ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif ++ + #include + #if BOOST_WORKAROUND(BOOST_GCC, < 80200) + #define BOOST_BEAST_SYMBOL_HIDDEN __attribute__ ((visibility("hidden"))) +@@ -673,10 +677,34 @@ + } + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ stream& s, ++ flat_buffer& dynbuf, ++ net::mutable_buffer buf, ++ std::size_t limit) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_read(dynbuf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_read_some(buf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_read_some(dynbuf, limit, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { + testRead(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&read2_test::testAwaitableCompiles); ++#endif + } + }; + +diff -aruN a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp +--- a/test/beast/websocket/write.cpp 2020-04-22 09:34:50.000000000 -0400 ++++ b/test/beast/websocket/write.cpp 2020-05-02 13:51:02.474315935 -0400 +@@ -13,6 +13,10 @@ + #include + #include + ++#if BOOST_ASIO_HAS_CO_AWAIT ++#include ++#endif ++ + #include "test.hpp" + + namespace boost { +@@ -716,6 +720,22 @@ + BEAST_EXPECT(n1 < n0 + s.size()); + } + ++#if BOOST_ASIO_HAS_CO_AWAIT ++ void testAwaitableCompiles( ++ stream& s, ++ net::mutable_buffer buf, ++ bool fin) ++ { ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_write(buf, net::use_awaitable))>); ++ ++ static_assert(std::is_same_v< ++ net::awaitable, decltype( ++ s.async_write_some(fin, buf, net::use_awaitable))>); ++ } ++#endif ++ + void + run() override + { +@@ -726,6 +746,9 @@ + testMoveOnly(); + testIssue300(); + testIssue1666(); ++#if BOOST_ASIO_HAS_CO_AWAIT ++ boost::ignore_unused(&write_test::testAwaitableCompiles); ++#endif + } + }; + diff --git a/ports/boost-beast/CONTROL b/ports/boost-beast/CONTROL index d5757961f7f497..800a13ce8e4ceb 100644 --- a/ports/boost-beast/CONTROL +++ b/ports/boost-beast/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-beast -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-asio, boost-assert, boost-bind, boost-config, boost-container, boost-core, boost-endian, boost-intrusive, boost-logic, boost-mp11, boost-optional, boost-smart-ptr, boost-static-assert, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/beast Description: Boost beast module diff --git a/ports/boost-beast/portfile.cmake b/ports/boost-beast/portfile.cmake index 1342d89f2227c8..231d96d363440e 100644 --- a/ports/boost-beast/portfile.cmake +++ b/ports/boost-beast/portfile.cmake @@ -1,13 +1,12 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/beast - REF boost-1.72.0 - SHA512 beffe921767466830089ce20cec4dfb27f6d2b7864fde990a682349d0944037d5fa517f2dfeb5d4c22d3f3410aa3803012fbf4220311367d95a0238d84a2f24c + REF boost-1.73.0 + SHA512 b1f0d2b1a8576d8bea953ce92aa9970590f91451f19d059818eb1c7a2b21c39fe384526c65b324c6c6142f4eac9bb649bdc6b2b9eff946c7f348f11332b9753c HEAD_REF master + PATCHES 0002-beast-coroutines.patch ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) diff --git a/ports/boost-bimap/CONTROL b/ports/boost-bimap/CONTROL index 5ac8a937f13b16..412dc84e466cb2 100644 --- a/ports/boost-bimap/CONTROL +++ b/ports/boost-bimap/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-bimap -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-concept-check, boost-config, boost-container-hash, boost-functional, boost-iterator, boost-lambda, boost-mpl, boost-multi-index, boost-preprocessor, boost-property-map, boost-serialization, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/bimap Description: Boost bimap module diff --git a/ports/boost-bimap/portfile.cmake b/ports/boost-bimap/portfile.cmake index 0c4eddf9ff4480..8c7c52db15c425 100644 --- a/ports/boost-bimap/portfile.cmake +++ b/ports/boost-bimap/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/bimap - REF boost-1.72.0 - SHA512 150b1abba1d2f17ddd4fc0c52b3e601ce80208437b8df4e4fe44b9a020838617cdb184947d63f8552e6c0d94436b52688dfa7b4c98f847aa954b626df704cf9a + REF boost-1.73.0 + SHA512 63b3fb5926ee7e1d86872f766213a6d31d146f0db349c676754cc0c4d5050f8690773ec694cc2e820b96f278907e63d0e32c3e588b74ea415359955f4ec3d9b8 HEAD_REF master ) diff --git a/ports/boost-bind/CONTROL b/ports/boost-bind/CONTROL index 36ba4da77c7f81..8db3ebf8df31c4 100644 --- a/ports/boost-bind/CONTROL +++ b/ports/boost-bind/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-bind -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-vcpkg-helpers Homepage: https://github.com/boostorg/bind Description: Boost bind module diff --git a/ports/boost-bind/portfile.cmake b/ports/boost-bind/portfile.cmake index 781ea5551dc756..6c9f472cd84b5f 100644 --- a/ports/boost-bind/portfile.cmake +++ b/ports/boost-bind/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/bind - REF boost-1.72.0 - SHA512 b09942be125de1fb07399414a48d3ea7694fe3eb51691d0dab0278ca973d1d80c31ea98f64f007d483d2953f0162db33e88578596619f284ac0c0cbf60977a3f + REF boost-1.73.0 + SHA512 5ec2535ac4452edbc10faf2d16e61ee09b12d6dc9d013015798c67bfdd5308e219e534aeae56549a5890aff70956573f5e4633a8261472e242de3314f027d563 HEAD_REF master ) diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index 4ccff7bc876e00..f6ab98cf82b77d 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,4 +1,5 @@ Source: boost-build -Version: 1.72.0 +Version: 1.73.0 +Port-Version: 2 Homepage: https://github.com/boostorg/build Description: Boost.Build diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index be076d422a16d3..9b06d0074eb18a 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -2,19 +2,19 @@ include(vcpkg_common_functions) set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") +if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") return() -elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +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") return() endif() -set(BOOST_VERSION 1.72.0) +set(BOOST_VERSION 1.73.0) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/build REF boost-${BOOST_VERSION} - SHA512 744816ba805013a49029373a4d2aa5b5f543275a1cdef2812c2120c868c55bf36a0bb0fb891cd955ad7319e582fd5212bd52ff071703a8654b345c478e810a19 + SHA512 68e132c480c3063f99ddae48177ff5a35369e49e7f497d51d758a9bf760c5b20c1c040cb212fad94b1f27fb140054b0ef14ac0b32c6d7d246e921787ff58a037 HEAD_REF master ) @@ -27,7 +27,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_download_distfile(BOOSTCPP_ARCHIVE URLS "https://raw.githubusercontent.com/boostorg/boost/boost-${BOOST_VERSION}/boostcpp.jam" FILENAME "boost-${BOOST_VERSION}-boostcpp.jam" - SHA512 7fac16c1f082821dd52cae39601f60bbdbd5ce043fbd19699da54c74fc5df1ed2ad6d3cefd3ae9a0a7697a2c34737f0c9e2b4bd3590c1f45364254875289cd17 + SHA512 8cf929fa4a602342c859a6bbd5f9dda783ac29431d951bcf6cae4cb14377c1b3aed90bacd902b0f7d1807591cf5e1a244cf8fc3c6cc6e0a4056db145b58f51df ) file(INSTALL ${ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build RENAME copyright) @@ -52,8 +52,13 @@ file(WRITE "${CURRENT_PACKAGES_DIR}/tools/boost-build/src/tools/msvc.jam" "${_co message(STATUS "Bootstrapping...") if(CMAKE_HOST_WIN32) + if(VCPKG_TARGET_IS_MINGW) + set(TOOLSET mingw) + else() + set(TOOLSET msvc) + endif() vcpkg_execute_required_process( - COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" msvc + COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" ${TOOLSET} WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boost-build LOGNAME bootstrap-${TARGET_TRIPLET} ) diff --git a/ports/boost-callable-traits/CONTROL b/ports/boost-callable-traits/CONTROL index af4a7664b86a9b..705a2eb72bb58a 100644 --- a/ports/boost-callable-traits/CONTROL +++ b/ports/boost-callable-traits/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-callable-traits -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/callable_traits Description: Boost callable_traits module diff --git a/ports/boost-callable-traits/portfile.cmake b/ports/boost-callable-traits/portfile.cmake index 7f0612fefaf0c3..c364f57b2211c0 100644 --- a/ports/boost-callable-traits/portfile.cmake +++ b/ports/boost-callable-traits/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/callable_traits - REF boost-1.72.0 - SHA512 ad32e155e0d2d1a0ed88d34bc5772e8756bb6a73335f4c207710ac22efb5fb77b1199b3df128c1f4164e87a7aafaa14c604864047d1a49ede3475eba169eb449 + REF boost-1.73.0 + SHA512 4d9d59b353fc4d7c6661ee71c53e9b279fc727d9e6d0767ef9e9c53e307deb8c4975347d84329c67b0ee93be8140946270a1617c4f49e2b20aabd4c37829eba1 HEAD_REF master ) diff --git a/ports/boost-chrono/CONTROL b/ports/boost-chrono/CONTROL index dcd35dbb48eced..c48184538d23a8 100644 --- a/ports/boost-chrono/CONTROL +++ b/ports/boost-chrono/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-chrono -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-modular-build-helper, boost-move, boost-mpl, boost-predef, boost-ratio, boost-static-assert, boost-system, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/chrono Description: Boost chrono module diff --git a/ports/boost-chrono/portfile.cmake b/ports/boost-chrono/portfile.cmake index 18908e8f6388ef..ea75c46b7aa533 100644 --- a/ports/boost-chrono/portfile.cmake +++ b/ports/boost-chrono/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/chrono - REF boost-1.72.0 - SHA512 7cd2596101767d9dde63ff6af527680211442272f9ac96b758712872dcc4e0d5d3be0e8cfab99601abe22caf3c3501a1b5385ba1fe69d8a2d3527bbaa5a36cc8 + REF boost-1.73.0 + SHA512 81c40845939172b8d33f05e7e16c6be9bd0e83eedb5ac8712090043a0309f5ddb377a8b9686ef79363c917fb74ac626268078ff5068998981ce043d006d1461a HEAD_REF master ) diff --git a/ports/boost-circular-buffer/CONTROL b/ports/boost-circular-buffer/CONTROL index 09fa7c06775236..6a7c387663e730 100644 --- a/ports/boost-circular-buffer/CONTROL +++ b/ports/boost-circular-buffer/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-circular-buffer -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-move, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/circular_buffer Description: Boost circular_buffer module diff --git a/ports/boost-circular-buffer/portfile.cmake b/ports/boost-circular-buffer/portfile.cmake index e1aca6ded68fe3..b60bfe3ba89af1 100644 --- a/ports/boost-circular-buffer/portfile.cmake +++ b/ports/boost-circular-buffer/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/circular_buffer - REF boost-1.72.0 - SHA512 bbd4927cc0cb065c62d9d310921894f0d62d088c0a246eae85eb27b9b24ce45f7b4816c6c1bf1049f0e6a3b188611569ee6386afef0d15e1b5df37202b7d992d + REF boost-1.73.0 + SHA512 602ab96a2b5189cc37a3cac85fc663fec497674f19ead202170ebe1fc416587b50d8deff5ad274579c75e2ef30f0c832366b3f9bf54733ea659247923cf7d8ad HEAD_REF master ) diff --git a/ports/boost-compatibility/CONTROL b/ports/boost-compatibility/CONTROL index 399a56dff7c657..fc08a189d12016 100644 --- a/ports/boost-compatibility/CONTROL +++ b/ports/boost-compatibility/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-compatibility -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/compatibility Description: Boost compatibility module diff --git a/ports/boost-compatibility/portfile.cmake b/ports/boost-compatibility/portfile.cmake index 69f0c0989f5aac..d842c499e96abf 100644 --- a/ports/boost-compatibility/portfile.cmake +++ b/ports/boost-compatibility/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/compatibility - REF boost-1.72.0 - SHA512 3fec934f448568c75bb9f40ce91650a949f07bd222c9bd3c0845c6b5748b8dddc4b0e3df19cbf9cbc6ffefe3ed9b26a145e531dd70e8e1305ed56d66d1f20fb6 + REF boost-1.73.0 + SHA512 ce2b5f908c878cc34694b024c1f4609098bf1e8801df90e067bcf535e267632142639653230588e92819c8b579c59d0703bb8d9ec06ec8a4fc3d103634673724 HEAD_REF master ) diff --git a/ports/boost-compute/CONTROL b/ports/boost-compute/CONTROL index dd888faab457da..8468ee6713d9d6 100644 --- a/ports/boost-compute/CONTROL +++ b/ports/boost-compute/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-compute -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-algorithm, boost-array, boost-assert, boost-chrono, boost-config, boost-core, boost-filesystem (!uwp), boost-function, boost-function-types, boost-fusion, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-preprocessor, boost-property-tree, boost-proto, boost-range, boost-smart-ptr, boost-static-assert, boost-thread, boost-throw-exception, boost-tuple, boost-typeof, boost-type-traits, boost-utility, boost-uuid, boost-vcpkg-helpers Homepage: https://github.com/boostorg/compute Description: Boost compute module diff --git a/ports/boost-compute/portfile.cmake b/ports/boost-compute/portfile.cmake index 6d029795d46304..d8c6e157c980e2 100644 --- a/ports/boost-compute/portfile.cmake +++ b/ports/boost-compute/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/compute - REF boost-1.72.0 - SHA512 549165f83cd184a4ac77dcd467b92d571d7754aafd011d7bad9cfbef9ef3b3bfad9e0f2fa9a2a419bc2cf58f5d2f27ce1cf829c18e460b8d5552a6a2ae6648a9 + REF boost-1.73.0 + SHA512 c6877630ce15dfa56f71d784e10264e24f0029ed28345ed6d1421b13e5c020511251129990f4a368dcaad9765936cab6d4364556e826335ac64788c3d87951dd HEAD_REF master ) diff --git a/ports/boost-concept-check/CONTROL b/ports/boost-concept-check/CONTROL index 9d5f520ed26771..df7e3be35e7ed2 100644 --- a/ports/boost-concept-check/CONTROL +++ b/ports/boost-concept-check/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-concept-check -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-preprocessor, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/concept_check Description: Boost concept_check module diff --git a/ports/boost-concept-check/portfile.cmake b/ports/boost-concept-check/portfile.cmake index d2ffd798beeccf..196d69175fc860 100644 --- a/ports/boost-concept-check/portfile.cmake +++ b/ports/boost-concept-check/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/concept_check - REF boost-1.72.0 - SHA512 8b3ebefa86eab167205a616dbde25fabf850c859b562f71b67b5ddabb15de6020a60440c3191e664bad3058f97476674467d4651e9fcd5412452bcc29a269e7e + REF boost-1.73.0 + SHA512 78612011a3f0f4ee0c055661e4a72745a9a6ef4734cd49600d37e5f3b04e13c96195150e4cf7f5a48c2b8f2af2c89e40de7d21ee3a4a7a12110a554f494f39ed HEAD_REF master ) diff --git a/ports/boost-config/CONTROL b/ports/boost-config/CONTROL index fce345db7d0dd7..efad3a663771c0 100644 --- a/ports/boost-config/CONTROL +++ b/ports/boost-config/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-config -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compatibility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/config Description: Boost config module diff --git a/ports/boost-config/portfile.cmake b/ports/boost-config/portfile.cmake index 592fd1e8be75b9..35c350f8d56633 100644 --- a/ports/boost-config/portfile.cmake +++ b/ports/boost-config/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/config - REF boost-1.72.0 - SHA512 918f8936ced087ab89b32648fdf7194e025043c799f7750623e387a0c5d4f17581614cb8318cac07c5b70ed0e5f14ab94eb69999870cf2cada7ef3bf2503dd40 + REF boost-1.73.0 + SHA512 39448c9371be8c7bc613c4f507d6cb65a684be2e4ea3cd218f6a8635d60e748db6008d2cd874dbadee183ea5d22b1296e0f66da5dc384a7dfc12ac2128f7bb64 HEAD_REF master ) diff --git a/ports/boost-container-hash/CONTROL b/ports/boost-container-hash/CONTROL index 7926d6c38ad30d..c81d3ef2d905cb 100644 --- a/ports/boost-container-hash/CONTROL +++ b/ports/boost-container-hash/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-container-hash -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-core, boost-detail, boost-integer, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/container_hash Description: Boost container_hash module diff --git a/ports/boost-container-hash/portfile.cmake b/ports/boost-container-hash/portfile.cmake index 14038a44eae74e..c0eff900064fd8 100644 --- a/ports/boost-container-hash/portfile.cmake +++ b/ports/boost-container-hash/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/container_hash - REF boost-1.72.0 - SHA512 8e739b2876488a081774a6b70c82430bb5949d5c6f4c6e2c05964adfcebf848f56da007d64fc13189a0e6ef6305d2e50d702f4d87d7908fb0e2c6feccba85c1b + REF boost-1.73.0 + SHA512 c5cd2d85eb79c7524c22e7be51241654f9dba16786cb83366164f4bbef2b8a24258401d88b79a9eb647c73eea2a379389c5075be743a27ca25eeb89e4bed01dc HEAD_REF master ) diff --git a/ports/boost-container/CONTROL b/ports/boost-container/CONTROL index 83c05201f957e2..ead3c29f132c40 100644 --- a/ports/boost-container/CONTROL +++ b/ports/boost-container/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-container -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-config, boost-container-hash, boost-core, boost-integer, boost-intrusive, boost-modular-build-helper, boost-move, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/container Description: Boost container module diff --git a/ports/boost-container/portfile.cmake b/ports/boost-container/portfile.cmake index 6962ac293e15af..ce65a7566c9ab0 100644 --- a/ports/boost-container/portfile.cmake +++ b/ports/boost-container/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/container - REF boost-1.72.0 - SHA512 1fccb1ccd017ebcffed60e646f9038e91c17b5ba3867062f245ae0702eef3fa86a8b73a5aebe47e81a24fe927da5c999d580c608d44109b14147a273d7b7e398 + REF boost-1.73.0 + SHA512 419a141138047baa649a3e1d0edcd55dfe5cf189b6ac9b9b0bc8da4d8e50971ff4619b5b811a3b1e17658c2573f32d926166d0ad260e036b736d8a615e4a1682 HEAD_REF master ) diff --git a/ports/boost-context/CONTROL b/ports/boost-context/CONTROL index f628c87693328b..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.72.0 +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-context/portfile.cmake b/ports/boost-context/portfile.cmake index a9b5d4f6387a65..66ed9f50fa769e 100644 --- a/ports/boost-context/portfile.cmake +++ b/ports/boost-context/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/context - REF boost-1.72.0 - SHA512 3009fddb29ab31caa40fd7d03b13b820ac0c638c026e1d9b510f719ffc66436dafba5bcf537418ac090c721d1e21022043a7ef4ef597b4bd853e693f3c0d3ded + REF boost-1.73.0 + SHA512 cb460e9d7f5b2782164e49820b097402f6a443718d689b2f793f5ab7030012a80418dfc51154f299c9f987d6864d87f7536476ffa97da1089bf6b70f2990ebea HEAD_REF master ) diff --git a/ports/boost-contract/CONTROL b/ports/boost-contract/CONTROL index 6f9f6131ebfca0..c384a47fbf2c12 100644 --- a/ports/boost-contract/CONTROL +++ b/ports/boost-contract/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-contract -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-any, boost-assert, boost-build, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-function-types, boost-modular-build-helper, boost-mpl, boost-optional, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-thread, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/contract Description: Boost contract module diff --git a/ports/boost-contract/portfile.cmake b/ports/boost-contract/portfile.cmake index abd7223c3ddad2..c27c4d8518cdd5 100644 --- a/ports/boost-contract/portfile.cmake +++ b/ports/boost-contract/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/contract - REF boost-1.72.0 - SHA512 f76871e3769f15cea97e2b60d2ca32a03f15b4a3492b24debe95536fdc1c98543bacf171f46f78a9f49410ec1e55e8baf15d0629d96aa94f8d64dfefae567643 + REF boost-1.73.0 + SHA512 670e7d9e64d838bda32ec8748213961b8b7ee96d2918f2e6b71005b488de22b5f69c113de01908c88ab9dcdba6f69a0a2f64b10a4b5d5d319a7e76de17be2d72 HEAD_REF master ) diff --git a/ports/boost-conversion/CONTROL b/ports/boost-conversion/CONTROL index 69bb57656a122b..e12a8974cd345d 100644 --- a/ports/boost-conversion/CONTROL +++ b/ports/boost-conversion/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-conversion -Version: 1.72.0 -Build-Depends: boost-assert, boost-config, boost-throw-exception, boost-typeof, boost-utility, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-assert, boost-config, boost-core, boost-smart-ptr, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/conversion Description: Boost conversion module diff --git a/ports/boost-conversion/portfile.cmake b/ports/boost-conversion/portfile.cmake index abdcafc9881e5d..e60f002c270296 100644 --- a/ports/boost-conversion/portfile.cmake +++ b/ports/boost-conversion/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/conversion - REF boost-1.72.0 - SHA512 bef4ca0c37f3f259bab9e280fea685898299c37fcd0bc198549c0524612be5d8100a0a5d7799fbd44ad68c4d82682c5970ce700b65294908fd78784e5f96e865 + REF boost-1.73.0 + SHA512 b452b75c97d183ce75e1923711de5338926a118ff947352753a9e2426a74bfb26b922b195d5fad52ff56ab1e1fd0e6a79bff3e672c67ab5f0bad7909369d3b38 HEAD_REF master ) diff --git a/ports/boost-convert/CONTROL b/ports/boost-convert/CONTROL index dbf7e94c506e51..7882746e5d39ed 100644 --- a/ports/boost-convert/CONTROL +++ b/ports/boost-convert/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-convert -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-function-types, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-parameter, boost-range, boost-spirit, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/convert Description: Boost convert module diff --git a/ports/boost-convert/portfile.cmake b/ports/boost-convert/portfile.cmake index b1cd31905d612c..056df7134960e2 100644 --- a/ports/boost-convert/portfile.cmake +++ b/ports/boost-convert/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/convert - REF boost-1.72.0 - SHA512 2c9632d58e11a3b086c2cf191b4ec2d34c0d331347926798222cb742eac0ff97afb62581d3b2347c64c70d86ccc866d3a91a291a5db7e0e2d41d11bdc4fb9032 + REF boost-1.73.0 + SHA512 e2237c6113fe1d81fda851ec82d16b1645f41cac32cfd09c1169517517dfa29b63e0dd85c1bd781718414ef80002c194db3fe6c71c8eda27d8161bbf8966badf HEAD_REF master ) diff --git a/ports/boost-core/CONTROL b/ports/boost-core/CONTROL index 2ca7782882b2db..c6673ecc8ef687 100644 --- a/ports/boost-core/CONTROL +++ b/ports/boost-core/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-core -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-vcpkg-helpers Homepage: https://github.com/boostorg/core Description: Boost core module diff --git a/ports/boost-core/portfile.cmake b/ports/boost-core/portfile.cmake index 25a329fe5d7763..86aa9ee95d09bf 100644 --- a/ports/boost-core/portfile.cmake +++ b/ports/boost-core/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/core - REF boost-1.72.0 - SHA512 6b691ef85c161e93382a30d3bfe7bf45bdff5c27ac5dcec9933cc27f78af1b6c09752f245002e3edcabfd0c67de738756b9027fbb996eba675c9ebd3f9212f01 + REF boost-1.73.0 + SHA512 a050d08d97c41c8685458eb8171ed45e36b756dfe090af66afca62a48718bde1ad7f08b579cfc3a891c499acc19897c45c2e9c7ce907af70f7894867fd8be0e7 HEAD_REF master ) diff --git a/ports/boost-coroutine/CONTROL b/ports/boost-coroutine/CONTROL index ef712c32aa5a2e..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.72.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-context (!uwp), boost-detail, boost-exception, boost-integer, boost-modular-build-helper, boost-move, boost-system, boost-thread, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers +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-coroutine/portfile.cmake b/ports/boost-coroutine/portfile.cmake index 2572446b1b8121..fc1e0409ea2c09 100644 --- a/ports/boost-coroutine/portfile.cmake +++ b/ports/boost-coroutine/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/coroutine - REF boost-1.72.0 - SHA512 efd234d24692a484b3bb4fdf9790d6e0014ba87ba628768dc2710c9999da14ea4ec6fef2e55a6283d8c3cb22894bd737cadb61f788d9f5e1408785e8c32892a0 + REF boost-1.73.0 + SHA512 0fd70f2225b45cf85a00f51ef039fc01a10144637699b2d55dd840216d70a62979b553b0225efee50b7155cfda5dc698ad5712cbcca3a07f00aa0601d9a53eae HEAD_REF master ) diff --git a/ports/boost-coroutine2/CONTROL b/ports/boost-coroutine2/CONTROL index 7869698a71336d..f5d21476217f75 100644 --- a/ports/boost-coroutine2/CONTROL +++ b/ports/boost-coroutine2/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-coroutine2 -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-context (!uwp), boost-detail, boost-vcpkg-helpers Homepage: https://github.com/boostorg/coroutine2 Description: Boost coroutine2 module diff --git a/ports/boost-coroutine2/portfile.cmake b/ports/boost-coroutine2/portfile.cmake index 404907bfaad041..18bd9be04ddaab 100644 --- a/ports/boost-coroutine2/portfile.cmake +++ b/ports/boost-coroutine2/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/coroutine2 - REF boost-1.72.0 - SHA512 00fbdfd6baa74ca444a45bef6cf0bf677bf0bd653c32e0688abc720720d758d2df5c8467a66daa2afa5c6b25982139fe0fc30a12798190c0f746a66d8f9b9bcc + REF boost-1.73.0 + SHA512 dcb81cfda941b65b8b376abe74dc559f02e47bdd5f744b073b2d769e95c1ecf6ef4998cd4d5a67f45069e3b137d2384d7f45a41c453584a3b237da1ff42a8efc HEAD_REF master ) diff --git a/ports/boost-crc/CONTROL b/ports/boost-crc/CONTROL index f5c71e2a8af0f6..05904cfaf1f82c 100644 --- a/ports/boost-crc/CONTROL +++ b/ports/boost-crc/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-crc -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-compatibility, boost-config, boost-integer, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/crc Description: Boost crc module diff --git a/ports/boost-crc/portfile.cmake b/ports/boost-crc/portfile.cmake index 29fc6f0fceb82a..7a58e1c2316f10 100644 --- a/ports/boost-crc/portfile.cmake +++ b/ports/boost-crc/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/crc - REF boost-1.72.0 - SHA512 f6fb2e5f14255e60f649389c5e9602d703a0a597499408b749a83e8c6740d1a49475583476c38f7f7810df1b332c31e4e07ce340d2519189b0f47e70792b0896 + REF boost-1.73.0 + SHA512 7928d1541d2a7e19bde89e0351d7b0bb952faa40de0a744856bfe867e8830799b5e835d3278b064356dcf3930f749880110935348aafd0a5248926991ceb4307 HEAD_REF master ) diff --git a/ports/boost-date-time/CONTROL b/ports/boost-date-time/CONTROL index 0d4a74fa223540..d7165ce6ab1447 100644 --- a/ports/boost-date-time/CONTROL +++ b/ports/boost-date-time/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-date-time -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-algorithm, boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-integer, boost-io, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-numeric-conversion, boost-range, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/date_time Description: Boost date_time module diff --git a/ports/boost-date-time/portfile.cmake b/ports/boost-date-time/portfile.cmake index a2bb8ef2d0f08e..42e6616595cecb 100644 --- a/ports/boost-date-time/portfile.cmake +++ b/ports/boost-date-time/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/date_time - REF boost-1.72.0 - SHA512 bfb0c18d05742a19eeeed353f52afca594b92854480f61fa7fd21283bafc45b3301d4693da7bbf4abb2ebcbeb8d02d537d7a755cea0d6dbc3d7f83784a696a04 + REF boost-1.73.0 + SHA512 bfc4ffe76e451249f7b4c5c80e41f6cd3900091b491c42b1c01719eb1db29e3f324fafedb5ae15bba6b171aabcddfca6fafa6c7940b672be57342b0fdf0aa995 HEAD_REF master ) diff --git a/ports/boost-detail/CONTROL b/ports/boost-detail/CONTROL index eb7f3cb0222d40..9d32473bdaeb5d 100644 --- a/ports/boost-detail/CONTROL +++ b/ports/boost-detail/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-detail -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compatibility, boost-config, boost-preprocessor, boost-vcpkg-helpers Homepage: https://github.com/boostorg/detail Description: Boost detail module diff --git a/ports/boost-detail/portfile.cmake b/ports/boost-detail/portfile.cmake index bab59aec53d7ec..8d3953f02e8067 100644 --- a/ports/boost-detail/portfile.cmake +++ b/ports/boost-detail/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/detail - REF boost-1.72.0 - SHA512 9c4541da0bb9eddad51a464dad76faf29a949657b5ae0ad003bffe4a936bf49c7fb9ee3266a51b7637343b64e446541d1359aa1d46734d07f14bd044021afcfa + REF boost-1.73.0 + SHA512 d6955323769c5ec647648dc13baa18880b34c2b24cd80b10b638b410fa552819902eabf72093d464ba9582f507b7a19268d15422e4401cc0e3ce3aa93129f15d HEAD_REF master ) diff --git a/ports/boost-disjoint-sets/CONTROL b/ports/boost-disjoint-sets/CONTROL deleted file mode 100644 index 14b666c47449e1..00000000000000 --- a/ports/boost-disjoint-sets/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -Source: boost-disjoint-sets -Version: 1.72.0 -Build-Depends: boost-graph, boost-vcpkg-helpers -Homepage: https://github.com/boostorg/disjoint_sets -Description: Boost disjoint_sets module diff --git a/ports/boost-dll/CONTROL b/ports/boost-dll/CONTROL index 877ea36c66c715..c49ca7d9ce580b 100644 --- a/ports/boost-dll/CONTROL +++ b/ports/boost-dll/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-dll -Version: 1.72.0 -Build-Depends: boost-assert, boost-config, boost-core, boost-filesystem (!uwp), boost-function, boost-integer, boost-move, boost-mpl, boost-predef, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-throw-exception, boost-type-index, boost-type-traits, boost-vcpkg-helpers, boost-winapi +Version: 1.73.0 +Build-Depends: boost-assert, boost-config, boost-core, boost-filesystem (!uwp), boost-function, boost-integer, boost-move, boost-predef, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-throw-exception, boost-type-index, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/dll Description: Boost dll module diff --git a/ports/boost-dll/portfile.cmake b/ports/boost-dll/portfile.cmake index 8542d818f53f76..65bb7017831433 100644 --- a/ports/boost-dll/portfile.cmake +++ b/ports/boost-dll/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/dll - REF boost-1.72.0 - SHA512 c724ead59194e2aea166ba4f07bf073950b03e66af61f5847f68d6d26f00a6c1f2507c49fc2757e21629e91adf0bbf78604d46b36c5f3c24727ef2a7a8b2d049 + REF boost-1.73.0 + SHA512 0775a5d9405efabafe23370df6bdca996bbfb27e492f4589e05608b603c029edf2c09bcee404a72174eca122a8229819b17fff184696f4961dc88fb0c5cfd435 HEAD_REF master ) diff --git a/ports/boost-dynamic-bitset/CONTROL b/ports/boost-dynamic-bitset/CONTROL index ce2a512ab508b0..97e0f2f7e6bf09 100644 --- a/ports/boost-dynamic-bitset/CONTROL +++ b/ports/boost-dynamic-bitset/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-dynamic-bitset -Version: 1.72.0 -Build-Depends: boost-serialization, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-core, boost-vcpkg-helpers Homepage: https://github.com/boostorg/dynamic_bitset Description: Boost dynamic_bitset module diff --git a/ports/boost-dynamic-bitset/portfile.cmake b/ports/boost-dynamic-bitset/portfile.cmake index b582e9a4264e26..52c8b3eed514b2 100644 --- a/ports/boost-dynamic-bitset/portfile.cmake +++ b/ports/boost-dynamic-bitset/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/dynamic_bitset - REF boost-1.72.0 - SHA512 b4c84d194e71fc73be9071840caf1c9ab3a1887ab1d9aa6af63e5121783d450749b435af2f0f2545ebac9c86057b15a537926172e55255805b256d0d992bf0b5 + REF boost-1.73.0 + SHA512 50c7d7899f9bd9ab885477a8ad809ef0a615f74589dffe58c757fa615594393281783b9647882ea445f915493dbfd19f64b7e57c05176c903309487d0828b080 HEAD_REF master ) diff --git a/ports/boost-endian/CONTROL b/ports/boost-endian/CONTROL index e69f92a132d352..cfe3591a0bdb3e 100644 --- a/ports/boost-endian/CONTROL +++ b/ports/boost-endian/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-endian -Version: 1.72.0 -Build-Depends: boost-config, boost-core, boost-integer, boost-predef, boost-static-assert, boost-type-traits, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-config, boost-core, boost-integer, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/endian Description: Boost endian module diff --git a/ports/boost-endian/portfile.cmake b/ports/boost-endian/portfile.cmake index 003314493dc047..fb6a82e6a7da3b 100644 --- a/ports/boost-endian/portfile.cmake +++ b/ports/boost-endian/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/endian - REF boost-1.72.0 - SHA512 bdcec1badfe7583143dc405c3eb2a3f55d5d2cc742f54265e8d6d5b156ef09523379fc49cf39eefacf22fa276c20b742b389b6dae3530fc377b5b8dc3686cf75 + REF boost-1.73.0 + SHA512 19b1b0076e6ac6dc6123a6e19103ac2117a25f90b93beac1101eb17c51bd209c4d1eac7d00eba982550216d24a6bc32f44228948795f7d11c8650cbddbc99268 HEAD_REF master ) diff --git a/ports/boost-exception/CONTROL b/ports/boost-exception/CONTROL index db4f1a68426813..e4467fa46a0795 100644 --- a/ports/boost-exception/CONTROL +++ b/ports/boost-exception/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-exception -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-modular-build-helper, boost-smart-ptr, boost-tuple, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/exception Description: Boost exception module diff --git a/ports/boost-exception/portfile.cmake b/ports/boost-exception/portfile.cmake index 0b5a5e8096fef7..758e22f5255e97 100644 --- a/ports/boost-exception/portfile.cmake +++ b/ports/boost-exception/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/exception - REF boost-1.72.0 - SHA512 506ee9bec68a169b60e438bf29ed673aa8be2f745ab64dc8381a6ad1b9ca7e674a1b3009a828893c7451fd34de302fdb41d75018e1986a64543fe27ea5c7903b + REF boost-1.73.0 + SHA512 6a04d8c7343775147becb40399f4ed9e717bf3c6e4f80e678f8df4c7fbfa78e53e60aa3eec32fe667816fc1d63bf3fa3ad79416ab953ebd7dc296f359691b115 HEAD_REF master ) diff --git a/ports/boost-fiber/CONTROL b/ports/boost-fiber/CONTROL index 94684b32c3a306..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.72.0 +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-fiber/portfile.cmake b/ports/boost-fiber/portfile.cmake index d190f8c33a528d..2da9696243cf0d 100644 --- a/ports/boost-fiber/portfile.cmake +++ b/ports/boost-fiber/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/fiber - REF boost-1.72.0 - SHA512 687b6f2961c76d0dbae63434fb98beaadc7a88b760e01ce222b73169733739617987d04f25f23cebdae9cbe08cb307ad8529a143e3a44429e09cfc27702fbe98 + REF boost-1.73.0 + SHA512 25d129e4228f3517abc641f6858572b3196c2d79945013aa45d61a544c094e83e0103c9aba04e54fc07e53d2e29379d60a0db9a1c995dcccaef2ba2b5cda94d9 HEAD_REF master ) diff --git a/ports/boost-filesystem/CONTROL b/ports/boost-filesystem/CONTROL index 26928fb46ccf48..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.72.0 +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-filesystem/portfile.cmake b/ports/boost-filesystem/portfile.cmake index 444c52459123d5..9ab662a3db4bea 100644 --- a/ports/boost-filesystem/portfile.cmake +++ b/ports/boost-filesystem/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/filesystem - REF boost-1.72.0 - SHA512 70bfed38f042982b4802228f612c4f66899466aca0e882c4202bd4574f0d4706c976caeca85ebdb9b4adcf0cb4b627790eea003376d5c1b35c534f794f0078cc + REF boost-1.73.0 + SHA512 29f31b06495a240f449138e4cfc8e5f5e3af7bafdeeb1d7178625313f3c42ce7de04a7e77d6699dee0dcf1827e3bb581c9ad907fa4575d2d6dd1ef318a2e8fe4 HEAD_REF master ) diff --git a/ports/boost-flyweight/CONTROL b/ports/boost-flyweight/CONTROL index 351ba1110308a9..c3b701d55d28ea 100644 --- a/ports/boost-flyweight/CONTROL +++ b/ports/boost-flyweight/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-flyweight -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-functional, boost-interprocess, boost-mpl, boost-multi-index, boost-parameter, boost-preprocessor, boost-serialization, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/flyweight Description: Boost flyweight module diff --git a/ports/boost-flyweight/portfile.cmake b/ports/boost-flyweight/portfile.cmake index bbb58008fd469c..c0851a09d48189 100644 --- a/ports/boost-flyweight/portfile.cmake +++ b/ports/boost-flyweight/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/flyweight - REF boost-1.72.0 - SHA512 86c09e92dbf046770d6683ae42b23bf6e37c8b9f39da69adc000d1ad36ddede40a846bd4ae5bcf08cc1ae20291b5dd33fa1fd9f882007f339e2587f1980178fb + REF boost-1.73.0 + SHA512 dc58f76e413cedda8291727abddc0fada46890b0e2399f11c875ea605a5dfd567ba5df19c4c8c54cdf220da7bdaeb4a63d3df47da2f062a3cb4a0aee87869bd0 HEAD_REF master ) diff --git a/ports/boost-foreach/CONTROL b/ports/boost-foreach/CONTROL index 6d907c9e6e3c76..8020ca2b0a02b6 100644 --- a/ports/boost-foreach/CONTROL +++ b/ports/boost-foreach/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-foreach -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-iterator, boost-mpl, boost-range, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/foreach Description: Boost foreach module diff --git a/ports/boost-foreach/portfile.cmake b/ports/boost-foreach/portfile.cmake index 593a3bd7076b61..fe1183524865d8 100644 --- a/ports/boost-foreach/portfile.cmake +++ b/ports/boost-foreach/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/foreach - REF boost-1.72.0 - SHA512 bc7018bb63678d53df08d909a3538ef1026c7d24610874b5d3ace894eab2258d308209e866b02b1670b5cd84c3a63cea141081057767a2e5927efaa7bedec2f3 + REF boost-1.73.0 + SHA512 9a04aa1e180a17ab5d2c685f282e79fce2464c9267aea2d43595f82b98b19e6f269ec9744192b386097155ca9b0ea75511d9f718b406178b5f0c2af46b1422d4 HEAD_REF master ) diff --git a/ports/boost-format/CONTROL b/ports/boost-format/CONTROL index 9e0c7d119cae9d..e41e308936c875 100644 --- a/ports/boost-format/CONTROL +++ b/ports/boost-format/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-format -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-core, boost-detail, boost-optional, boost-smart-ptr, boost-throw-exception, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/format Description: Boost format module diff --git a/ports/boost-format/portfile.cmake b/ports/boost-format/portfile.cmake index 89e7b76b7979dd..6ec97f8abd51d9 100644 --- a/ports/boost-format/portfile.cmake +++ b/ports/boost-format/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/format - REF boost-1.72.0 - SHA512 3f34504235e400714d2ca1c152f170d68903808f22970d9372c4221881c58cf4be1f188cf1a4b2ddcd52b79881cdecb0664b7ab66fa7057d529315feedaf0db3 + REF boost-1.73.0 + SHA512 fa6ba7ae064d7a9d8116554729ba75cc9c52bb51e6edf76df350e47854afc2d815f0e7a12b9f9240c5b2b51e055caa2510a917b637448d8f0801b32ed0aa7b42 HEAD_REF master ) diff --git a/ports/boost-function-types/CONTROL b/ports/boost-function-types/CONTROL index 9b8517284506c2..f0e1a8c7fa51a9 100644 --- a/ports/boost-function-types/CONTROL +++ b/ports/boost-function-types/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-function-types -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-mpl, boost-preprocessor, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/function_types Description: Boost function_types module diff --git a/ports/boost-function-types/portfile.cmake b/ports/boost-function-types/portfile.cmake index 75b0ffe146c655..964993a49a5e7a 100644 --- a/ports/boost-function-types/portfile.cmake +++ b/ports/boost-function-types/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/function_types - REF boost-1.72.0 - SHA512 d1299cd5ad3364c37c08c7432341cb12fa08d03ebe66a26308df326bf1b90114fb8509120d7c379779507a7ca7d06a93f48a0f5e9bed96c15334817afd209590 + REF boost-1.73.0 + SHA512 b4cd2febca5286e293fc4c8c9c234190b675a173b29eb200a745f358120b9fd26681f9f74a84a5b910a66f82834c078f718e242aa4b08753a701b2d622e47078 HEAD_REF master ) diff --git a/ports/boost-function/CONTROL b/ports/boost-function/CONTROL index a6cc79b663d0e7..b55155be6dbe9d 100644 --- a/ports/boost-function/CONTROL +++ b/ports/boost-function/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-function -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-config, boost-core, boost-integer, boost-preprocessor, boost-throw-exception, boost-type-index, boost-typeof, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/function Description: Boost function module diff --git a/ports/boost-function/portfile.cmake b/ports/boost-function/portfile.cmake index 99191e31503ba5..e70defff5faa54 100644 --- a/ports/boost-function/portfile.cmake +++ b/ports/boost-function/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/function - REF boost-1.72.0 - SHA512 bc2b78954c9a0a0ebbf9513132698c67aa39da903099faf922ae769e9f3a70e78c951fca9f35d3f3e9bfc14750ab47f2ae222f9c676a55a770edd6352e91e778 + REF boost-1.73.0 + SHA512 5445ee22193ba369394f9a66dd47c13d89c080c7286ce12fea15f1e09b77dc036f7e037fba971dcce46a24f48824031a93d9d91ab6c4ddf841c4105c168652ac HEAD_REF master ) diff --git a/ports/boost-functional/CONTROL b/ports/boost-functional/CONTROL index 4184c15397847b..0e1c10292bb227 100644 --- a/ports/boost-functional/CONTROL +++ b/ports/boost-functional/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-functional -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-mpl, boost-preprocessor, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/functional Description: Boost functional module diff --git a/ports/boost-functional/portfile.cmake b/ports/boost-functional/portfile.cmake index c4cb152e9235f1..e2ddaf9792298f 100644 --- a/ports/boost-functional/portfile.cmake +++ b/ports/boost-functional/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/functional - REF boost-1.72.0 - SHA512 930c4cbd930511157e28e6587208093b3af2cd61b0657f3e08dc2628502575d2753c0c8ce87eedc5382c880bdf394666abef36833f510784f91f9d60213f998d + REF boost-1.73.0 + SHA512 0f5655074e0a8fb93c52c9fa76d3ae4eb2071c9124112538bd94cce1af64059575c322f60cc92fa117b1ae17816578e7d0300d45e2000adc5ac090c44e8c2a28 HEAD_REF master ) diff --git a/ports/boost-fusion/CONTROL b/ports/boost-fusion/CONTROL index f1a878f5297370..1ad59f8ffcef4a 100644 --- a/ports/boost-fusion/CONTROL +++ b/ports/boost-fusion/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-fusion -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-container-hash, boost-core, boost-detail, boost-function-types, boost-mpl, boost-preprocessor, boost-static-assert, boost-tuple, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/fusion Description: Boost fusion module diff --git a/ports/boost-fusion/portfile.cmake b/ports/boost-fusion/portfile.cmake index f4fa102110caa8..9bc665dc5c07d2 100644 --- a/ports/boost-fusion/portfile.cmake +++ b/ports/boost-fusion/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/fusion - REF boost-1.72.0 - SHA512 09fea2ec1c698d776555b4aecf9cff4fcfe503bcc8639574070a2ea7b5ecea26358d005e1aa3b704af96b4086e64181ccbe07e7005b16b5c307bafb15aea4949 + REF boost-1.73.0 + SHA512 92df3bf4169b9aa7c1fead168285db44e5b5cfb61cfcdcaab51a1c3bc78c36697a68665ef56d17d60f31f93faa4327e384b43d28e9d5f5337ad7d65b2c42410c HEAD_REF master ) diff --git a/ports/boost-geometry/CONTROL b/ports/boost-geometry/CONTROL index 3bfa9f6a38bd44..e67e7d24986317 100644 --- a/ports/boost-geometry/CONTROL +++ b/ports/boost-geometry/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-geometry -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-algorithm, boost-array, boost-assert, boost-concept-check, boost-config, boost-container, boost-core, boost-detail, boost-function-types, boost-fusion, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-move, boost-mpl, boost-multiprecision, boost-numeric-conversion, boost-polygon, boost-qvm, boost-range, boost-rational, boost-serialization, boost-smart-ptr, boost-static-assert, boost-thread, boost-throw-exception, boost-tokenizer, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/geometry Description: Boost geometry module diff --git a/ports/boost-geometry/portfile.cmake b/ports/boost-geometry/portfile.cmake index f35cacccc66d39..81c5b9520f2923 100644 --- a/ports/boost-geometry/portfile.cmake +++ b/ports/boost-geometry/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/geometry - REF boost-1.72.0 - SHA512 027ebad1216d88689d3f400417f8c81600c82e18f68720fc25ee6c609a30b2e4f0810cdc08b5f72cb4e89a279970fd7523794325b6e9456e023d27cb76f35f51 + REF boost-1.73.0 + SHA512 0063650b1a262b6d4812aa995f7670d8ea16cce862cd9d332e5b92dce8131e629732f6a78a82eaac03d8e53c55b5a8540687a3f054557059ff8434467f77022a HEAD_REF master ) diff --git a/ports/boost-gil/CONTROL b/ports/boost-gil/CONTROL index b19f7905c46463..0f9972c695fedd 100644 --- a/ports/boost-gil/CONTROL +++ b/ports/boost-gil/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-gil -Version: 1.72.0 -Build-Depends: boost-assert, boost-concept-check, boost-config, boost-core, boost-filesystem (!uwp), boost-integer, boost-iterator, boost-mp11, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-utility, boost-variant, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-assert, boost-concept-check, boost-config, boost-core, boost-filesystem (!uwp), boost-integer, boost-iterator, boost-mp11, boost-numeric-conversion, boost-preprocessor, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/gil Description: Boost gil module diff --git a/ports/boost-gil/portfile.cmake b/ports/boost-gil/portfile.cmake index 09349c6436efb8..a88ba0948d5079 100644 --- a/ports/boost-gil/portfile.cmake +++ b/ports/boost-gil/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/gil - REF boost-1.72.0 - SHA512 b90e6b47372b40bbc813c187e94f8263a5879e872fe06d93d90fe98f57407acf5e3b63b6382eb11df2bd5608b16e0a627251186e45305bf033c13f5497374ce8 + REF boost-1.73.0 + SHA512 d7466e3d7b3dfad9545fbb659a4a8e4d95b42f06dcdfa2cc12f3839de04b003ae7ce27abc4089ec90870a8e2b2d7d350ea4c02da3d18eda111fc4abb32165ff3 HEAD_REF master ) diff --git a/ports/boost-graph-parallel/CONTROL b/ports/boost-graph-parallel/CONTROL index 192c59948d849f..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.72.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 +Version: 1.73.0 +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-graph-parallel/portfile.cmake b/ports/boost-graph-parallel/portfile.cmake index d76362bb7cf703..6da99a59124eaf 100644 --- a/ports/boost-graph-parallel/portfile.cmake +++ b/ports/boost-graph-parallel/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/graph_parallel - REF boost-1.72.0 - SHA512 8ef6e2df93a6df52f03cde0ea42cb028c97c4f0be668b8baaf7f3447eef577f8272824afd9c990c61338bc2816824cb01fc7568906f1f621a0b2bb4bfcb48d26 + REF boost-1.73.0 + SHA512 95c7bee7ad2317a0b673d1c6179c7245fcd7f3176ab781dabe53cb16c021ef44b438763b4e97fb5139329102f7f65fc9c4a08b4f4d6d5b795a7821ea96473597 HEAD_REF master ) diff --git a/ports/boost-graph/CONTROL b/ports/boost-graph/CONTROL index 672a188d7735a4..9431f99833fb46 100644 --- a/ports/boost-graph/CONTROL +++ b/ports/boost-graph/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-algorithm, boost-any, boost-array, boost-assert, boost-bimap, boost-bind, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-container-hash, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-move, boost-mpl, boost-multi-index, boost-optional, boost-parameter, boost-preprocessor, boost-property-map, boost-property-tree, boost-random, boost-range, boost-regex, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-test (!uwp), boost-throw-exception, boost-tti, boost-tuple, boost-typeof, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers, boost-xpressive Homepage: https://github.com/boostorg/graph Description: Boost graph module diff --git a/ports/boost-graph/portfile.cmake b/ports/boost-graph/portfile.cmake index db6b6ab40cf2c3..17d56c7493107c 100644 --- a/ports/boost-graph/portfile.cmake +++ b/ports/boost-graph/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/graph - REF boost-1.72.0 - SHA512 2ee57a6f418f3da68024dce4684f3b7541eed44b694d85f1fc71e784baee19e4c91234bfc198462937f8ce0625027fc5b51db956756dc07e17ec33b049d04c8f + REF boost-1.73.0 + SHA512 689b9243cf9d36946f48ba0f880d7a09c6ef6a1e3a84a5fb2ea40f06c48adcd6f76aaab2c65372f24a961ca67041750ca8a16416c55b5e2a9a3a56d6537a482f HEAD_REF master ) diff --git a/ports/boost-hana/CONTROL b/ports/boost-hana/CONTROL index d9240c29f3da06..757901ddd99e4a 100644 --- a/ports/boost-hana/CONTROL +++ b/ports/boost-hana/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-hana -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-fusion, boost-mpl, boost-tuple, boost-vcpkg-helpers Homepage: https://github.com/boostorg/hana Description: Boost hana module diff --git a/ports/boost-hana/portfile.cmake b/ports/boost-hana/portfile.cmake index db29d0bc4fc1cd..ddae23148bc856 100644 --- a/ports/boost-hana/portfile.cmake +++ b/ports/boost-hana/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/hana - REF boost-1.72.0 - SHA512 aeb76085f7f37cb9c862c0aadddef6710123abf263e1b1ea2911c93a8fe0b9541baac01b5dfdf6fb5b35a77f9f225b810feba6c59c02f49eb440fc906043e3ed + REF boost-1.73.0 + SHA512 24b34acaae623d23898041cc5350f47ae801601138c2380f8e36ca7f7527a83ffa7f62e5082ee1c60e461fd804d3cb7af5465a354d7aba393ad0be74cec4abf0 HEAD_REF master ) diff --git a/ports/boost-heap/CONTROL b/ports/boost-heap/CONTROL index f785322b8b02f5..743b92811932c9 100644 --- a/ports/boost-heap/CONTROL +++ b/ports/boost-heap/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-heap -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-bind, boost-concept-check, boost-integer, boost-intrusive, boost-iterator, boost-parameter, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/heap Description: Boost heap module diff --git a/ports/boost-heap/portfile.cmake b/ports/boost-heap/portfile.cmake index bde09f4c2a4532..d9c625608658b0 100644 --- a/ports/boost-heap/portfile.cmake +++ b/ports/boost-heap/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/heap - REF boost-1.72.0 - SHA512 97afd5a1081deace5cdfbabb58d0b1d3fda09c496e086aa38de29efcd6253ce491db21c64267b01c7f6d2c67ba508447dcdee0949c4ef8141010e0e2c97d66bb + REF boost-1.73.0 + SHA512 5607f3b9601f08e52fd03d04fe7b78604af96641d48d48ddd9b78443065f700f3317efcb0c0ff600e13a08ea6292938993f71964c2c6ec87589c1f27bac5c0d7 HEAD_REF master ) diff --git a/ports/boost-histogram/CONTROL b/ports/boost-histogram/CONTROL index 439a50983dd38c..047b90eac0fe7d 100644 --- a/ports/boost-histogram/CONTROL +++ b/ports/boost-histogram/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-histogram -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-mp11, boost-serialization, boost-throw-exception, boost-variant2, boost-vcpkg-helpers Homepage: https://github.com/boostorg/histogram Description: Boost histogram module diff --git a/ports/boost-histogram/portfile.cmake b/ports/boost-histogram/portfile.cmake index 4ed3dc97eb2c24..07961a17cc756f 100644 --- a/ports/boost-histogram/portfile.cmake +++ b/ports/boost-histogram/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/histogram - REF boost-1.72.0 - SHA512 b33a8728012eaa98d9b7da9cfb20baecbdc53f08dad150a669ba3c94a13d08f3b5ffab803dd961124e7ed2c9d6c4de8ae3c71ef317fa97eb8a7383f76cf06d6a + REF boost-1.73.0 + SHA512 b070f0fcbf5e285fda47861db903bc11f60122415dfb212c81b8eaafcf346364dfaf201ab2c759fb5547a5c34825ec528c8b19b88a7840fe51cc28b10f8f1d92 HEAD_REF master ) diff --git a/ports/boost-hof/CONTROL b/ports/boost-hof/CONTROL index 67555de6967da1..dd09c384f21e3a 100644 --- a/ports/boost-hof/CONTROL +++ b/ports/boost-hof/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-hof -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/hof Description: Boost hof module diff --git a/ports/boost-hof/portfile.cmake b/ports/boost-hof/portfile.cmake index 5076a57a5d166a..0734676d769f14 100644 --- a/ports/boost-hof/portfile.cmake +++ b/ports/boost-hof/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/hof - REF boost-1.72.0 - SHA512 69395b84e8deecb636b81654c6957f159d22505c50a2e96510e412bc0e4bfee2bb14c030b292d4dc8902740e6e5a5ee63ea3b018598ceb77d012fa0ff29ef795 + REF boost-1.73.0 + SHA512 20284cf8f887a28842244955bf2d8cc4fa4b519f27ef7bed93308c5bddd8a3f19a58627cdc0d4f6e6c7798be64491604f961bef05329dedd79a689316a2e93e2 HEAD_REF master ) diff --git a/ports/boost-icl/CONTROL b/ports/boost-icl/CONTROL index 10bd520c16f962..29947c371b9299 100644 --- a/ports/boost-icl/CONTROL +++ b/ports/boost-icl/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-icl -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-concept-check, boost-config, boost-container, boost-date-time, boost-detail, boost-iterator, boost-move, boost-mpl, boost-range, boost-rational, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/icl Description: Boost icl module diff --git a/ports/boost-icl/portfile.cmake b/ports/boost-icl/portfile.cmake index e75c57a76a565b..58ba3409ad4b44 100644 --- a/ports/boost-icl/portfile.cmake +++ b/ports/boost-icl/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/icl - REF boost-1.72.0 - SHA512 dd5666d04a3c849a5f59eccba767e2b733673a39851b67cab0e6cfb708be5f6fc1fdda6f9e1d29def1ca267533586ed0fdc2ece47048fb601556edfa1357131b + REF boost-1.73.0 + SHA512 806caed377cf0bb70fd65fe1d9524f5cac834094cbfbec8f874ec1f742887837033c53ddd4036bd733d5758e67ffc0a9f5d389dfc0fa3dc06fda6ab82f21e750 HEAD_REF master ) diff --git a/ports/boost-integer/CONTROL b/ports/boost-integer/CONTROL index 4b21567f332390..bb7400c9bf65f9 100644 --- a/ports/boost-integer/CONTROL +++ b/ports/boost-integer/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-integer -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-core, boost-detail, boost-static-assert, boost-throw-exception, boost-vcpkg-helpers Homepage: https://github.com/boostorg/integer Description: Boost integer module diff --git a/ports/boost-integer/portfile.cmake b/ports/boost-integer/portfile.cmake index 246ac0e116a465..276c6c044951b2 100644 --- a/ports/boost-integer/portfile.cmake +++ b/ports/boost-integer/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/integer - REF boost-1.72.0 - SHA512 942d0b402ae206908c8fa0a5b0705196acf5c9d1068d3e5aba92a11257afbe5fd4d95aaf6c50353bdde6346c6cf5e336db461b81faa3ff81f12b729c4af1fff6 + REF boost-1.73.0 + SHA512 053d900e23ab58496cbfa3d05dd41f46f3ba3ab0e50719166c2cb239cbdfc0ad6966f67c0e8b688cffaec29b674451d1f99f211107a8cab92cb10d8ac99c478f HEAD_REF master ) diff --git a/ports/boost-interprocess/CONTROL b/ports/boost-interprocess/CONTROL index 8f336d69c10a9e..313b7dcf835769 100644 --- a/ports/boost-interprocess/CONTROL +++ b/ports/boost-interprocess/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-interprocess -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-integer, boost-intrusive, boost-move, boost-static-assert, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/interprocess Description: Boost interprocess module diff --git a/ports/boost-interprocess/portfile.cmake b/ports/boost-interprocess/portfile.cmake index e394de9a55372b..554fe2587df555 100644 --- a/ports/boost-interprocess/portfile.cmake +++ b/ports/boost-interprocess/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/interprocess - REF boost-1.72.0 - SHA512 8fddddfe852d8ee34be5d604c18f6922ca3f80cff97437cbc07250e976825876b491d1f3567d83ababa590fcb749e51876a7712ba3431237d5dda980feea8f40 + REF boost-1.73.0 + SHA512 7f95cea60be57e9019028a994aae785313b9cc480ab89eda68d7312ec7bef18c06597fa1f24bb007a40cc3d9f091f5cf17a0c9144b37f3a9d7d15bb78e36c15f HEAD_REF master ) diff --git a/ports/boost-interval/CONTROL b/ports/boost-interval/CONTROL index 0f2de0c453ac78..6379c231923543 100644 --- a/ports/boost-interval/CONTROL +++ b/ports/boost-interval/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-interval -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compatibility, boost-config, boost-logic, boost-vcpkg-helpers Homepage: https://github.com/boostorg/interval Description: Boost interval module diff --git a/ports/boost-interval/portfile.cmake b/ports/boost-interval/portfile.cmake index 363dcbb44d7e47..5f873f57f439ac 100644 --- a/ports/boost-interval/portfile.cmake +++ b/ports/boost-interval/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/interval - REF boost-1.72.0 - SHA512 f23960679409b1a23feb80eaba02a22902dcb1296317730b43a000c6cf94b2738b2a1e5323f9d1ec3ecc8f64d09ce646b40b529cebe7d733a22d3548c0f80589 + REF boost-1.73.0 + SHA512 f9bf091cbd81c6a3d30873207c2596b960487df6cdd9048535d37b9bbbaf60799298fc49feaf8553f04b7c8d19dd9cdb537df2f2300accb85862451d60e492da HEAD_REF master ) diff --git a/ports/boost-intrusive/CONTROL b/ports/boost-intrusive/CONTROL index 50952bba149d8b..6148aa65e00bda 100644 --- a/ports/boost-intrusive/CONTROL +++ b/ports/boost-intrusive/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-intrusive -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-container-hash, boost-core, boost-integer, boost-move, boost-static-assert, boost-vcpkg-helpers Homepage: https://github.com/boostorg/intrusive Description: Boost intrusive module diff --git a/ports/boost-intrusive/portfile.cmake b/ports/boost-intrusive/portfile.cmake index 3d135898705931..aa53f02816be79 100644 --- a/ports/boost-intrusive/portfile.cmake +++ b/ports/boost-intrusive/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/intrusive - REF boost-1.72.0 - SHA512 f9c944cb189674ab8841def895c6b2213d6d500e9e366abe3a8ff91245561f3752411ff1ba29ad8bc0db37807ebc7fea4feccc6ad6ea04ebe43b928d384340ff + REF boost-1.73.0 + SHA512 cbcb7238aee3609b2838d427fe2436915bc39f363320099592908765a1e143469e02383e0fb51c1f05f7f935fadd3738130c362bb6ba1da74a74f74daaee4d02 HEAD_REF master ) diff --git a/ports/boost-io/CONTROL b/ports/boost-io/CONTROL index 67c9ac834748a8..246a29dba856c8 100644 --- a/ports/boost-io/CONTROL +++ b/ports/boost-io/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-io -Version: 1.72.0 -Build-Depends: boost-detail, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-config, boost-vcpkg-helpers Homepage: https://github.com/boostorg/io Description: Boost io module diff --git a/ports/boost-io/portfile.cmake b/ports/boost-io/portfile.cmake index ac0d93d7996372..f293e66d583953 100644 --- a/ports/boost-io/portfile.cmake +++ b/ports/boost-io/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/io - REF boost-1.72.0 - SHA512 256549487e7cff387005eca8b654bc23664921800c94f71555119506b6dd10ba947d73c01171d9acc6cb867f6feb0e4b9c9e3c43371fa8ec82e321a40a5949b3 + REF boost-1.73.0 + SHA512 4217a043ef961e31c329b85ccf6c8fd48dfa44692d8f4c4b76e380580cc977d65b4f94a3efaaf880078c98d77056d76a8cd63f35fd95e6d9eb75865694c50740 HEAD_REF master ) diff --git a/ports/boost-iostreams/CONTROL b/ports/boost-iostreams/CONTROL index eea49e6f026f7b..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.72.0-1 +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-iostreams/portfile.cmake b/ports/boost-iostreams/portfile.cmake index 634a8e2d82980f..b82b5fc144a337 100644 --- a/ports/boost-iostreams/portfile.cmake +++ b/ports/boost-iostreams/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/iostreams - REF boost-1.72.0 - SHA512 a1a57e7cd985f5962a96fc93d286a64065611dea1a17fdfe696455556f176b9429e4aaf2a5035808a40d0fb7e8dfb874ac6f2ddc33ecc44c25a8089034960403 + REF boost-1.73.0 + SHA512 0bfafdf0bd202a958b353c2b575957061427cd0e6c66ab7e826c2a7958ed57d89dc8a49b0e01e63689703404f335f964f390241fdc1982f374f10c4583fd89a2 HEAD_REF master PATCHES Removeseekpos.patch ) diff --git a/ports/boost-iterator/CONTROL b/ports/boost-iterator/CONTROL index ced432dae8b4dc..2bfefd0f967e11 100644 --- a/ports/boost-iterator/CONTROL +++ b/ports/boost-iterator/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-iterator -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-conversion, boost-core, boost-detail, boost-function-types, boost-fusion, boost-mpl, boost-optional, boost-smart-ptr, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/iterator Description: Boost iterator module diff --git a/ports/boost-iterator/portfile.cmake b/ports/boost-iterator/portfile.cmake index 2412c3312fb8f6..32cef07336cf76 100644 --- a/ports/boost-iterator/portfile.cmake +++ b/ports/boost-iterator/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/iterator - REF boost-1.72.0 - SHA512 67f703777a0995263855af69a80ded81e151700a18daf141bea86243c0f9443c3a0110248c3c95c0bd0b575004eac618faff4f8a66820aac42d83ac03a152e3a + REF boost-1.73.0 + SHA512 1f778d7bf3938756f2e31b062dd1dc4053714de2efc341f076c387ce60c2d03f76a19af38bc035fb41cdea93bc9355e3a4dc052b87004214bc3ac4d777125da1 HEAD_REF master ) diff --git a/ports/boost-lambda/CONTROL b/ports/boost-lambda/CONTROL index 28546252316d4d..7401048ebb51a8 100644 --- a/ports/boost-lambda/CONTROL +++ b/ports/boost-lambda/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-lambda -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-bind, boost-config, boost-detail, boost-mpl, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/lambda Description: Boost lambda module diff --git a/ports/boost-lambda/portfile.cmake b/ports/boost-lambda/portfile.cmake index 0275fb93c1899a..7a5329c6c3aabe 100644 --- a/ports/boost-lambda/portfile.cmake +++ b/ports/boost-lambda/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/lambda - REF boost-1.72.0 - SHA512 b3b8cdc06742e17a53bef0c778c826803654052151c53cc22364078ed8fc12a2054bdf76f9926367b0017e1caca1058c6502260796a9a91124531bd8b506ca45 + REF boost-1.73.0 + SHA512 db3ccbdcd8763110c52be6c83ed80dd13dfe2fe6b24c615e334e0f9b2b282b6cb507794911922b275802530042e7a5ff1b536ae98c4454051c362682e3a8e229 HEAD_REF master ) diff --git a/ports/boost-lexical-cast/CONTROL b/ports/boost-lexical-cast/CONTROL index 0a38532ba8cdb5..7dba808a0e0bad 100644 --- a/ports/boost-lexical-cast/CONTROL +++ b/ports/boost-lexical-cast/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-lexical-cast -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-compatibility, boost-config, boost-container, boost-core, boost-detail, boost-integer, boost-numeric-conversion, boost-range, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/lexical_cast Description: Boost lexical_cast module diff --git a/ports/boost-lexical-cast/portfile.cmake b/ports/boost-lexical-cast/portfile.cmake index 067954b96e3d88..9aa4e994bb348a 100644 --- a/ports/boost-lexical-cast/portfile.cmake +++ b/ports/boost-lexical-cast/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/lexical_cast - REF boost-1.72.0 - SHA512 6bd9006eaf146f727017560ce570468c41456752687d4fc2067985828113c56fdcd8e73eb26418dac30f992def99fa042f42cfadcd992f45d4c802909c6f53f6 + REF boost-1.73.0 + SHA512 ea6e8f58f38b8e45171f85b7983257ae920bdc2d77a9e9f5c12fcc1e899ecefcaf98278183233262540704cdb4f036b1d4f1cff73c40c38e16a8498117e97b31 HEAD_REF master ) diff --git a/ports/boost-local-function/CONTROL b/ports/boost-local-function/CONTROL index 9ea917c5e4e606..419c59dfd59f0a 100644 --- a/ports/boost-local-function/CONTROL +++ b/ports/boost-local-function/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-local-function -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-mpl, boost-preprocessor, boost-scope-exit, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/local_function Description: Boost local_function module diff --git a/ports/boost-local-function/portfile.cmake b/ports/boost-local-function/portfile.cmake index 7104038ad828b5..42ed612d17ef39 100644 --- a/ports/boost-local-function/portfile.cmake +++ b/ports/boost-local-function/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/local_function - REF boost-1.72.0 - SHA512 548e0be8f20e9920a5a7868224e723885a251ba3685759630a1f4025682ac1df54a3d6641192fc03a3b48a89039bef8dab4812957fd9ed5873b9124edb589b97 + REF boost-1.73.0 + SHA512 1d86cd356f91b295b011e15fc88118b452556ee27f33f16deb8b636c535ef1b4024533f5430ac43dab44ca6322a29accfe1d875ac4443af26832bab297dc0024 HEAD_REF master ) diff --git a/ports/boost-locale/0001-Fix-boost-ICU-support.patch b/ports/boost-locale/0001-Fix-boost-ICU-support.patch new file mode 100644 index 00000000000000..cd02f742e93bfc --- /dev/null +++ b/ports/boost-locale/0001-Fix-boost-ICU-support.patch @@ -0,0 +1,100 @@ +--- + libs/locale/build/Jamfile.v2 | 63 ++++++-------------------------------- + libs/locale/build/has_icu_test.cpp | 4 --- + libs/regex/build/Jamfile.v2 | 47 +++++++--------------------- + 3 files changed, 20 insertions(+), 94 deletions(-) + +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 578e722..5f25917 100644 +--- a/build/Jamfile.v2 ++++ b/build/Jamfile.v2 +@@ -70,62 +70,17 @@ if $(ICU_LINK) + } + else + { +- searched-lib icuuc : : icuuc +- $(ICU_PATH)/lib +- shared +- shared ; +- +- searched-lib icuuc : : msvc +- debug +- icuucd +- $(ICU_PATH)/lib +- shared +- shared ; +- +- searched-lib icuuc : : this_is_an_invalid_library_name ; +- +- searched-lib icudt : : $(ICU_PATH)/lib +- icudata +- shared +- shared ; +- +- searched-lib icudt : : $(ICU_PATH)/lib +- icudt +- msvc +- shared +- shared ; +- +- searched-lib icudt : : this_is_an_invalid_library_name ; +- +- searched-lib icuin : : $(ICU_PATH)/lib +- icui18n +- shared +- shared ; +- +- searched-lib icuin : : msvc +- debug +- icuind +- $(ICU_PATH)/lib +- shared +- shared ; +- +- searched-lib icuin : : msvc +- release +- icuin +- $(ICU_PATH)/lib +- shared +- shared ; +- +- searched-lib icuin : : this_is_an_invalid_library_name ; +- +- explicit icuuc icudt icuin ; ++ alias icuuc : /user-config//icuuc ; ++ alias icuin : /user-config//icuin ; ++ alias icudt : /user-config//icudt ; ++ ++ explicit icuuc icuin icudt ; + + ICU_OPTS = $(ICU_PATH)/include +- icuuc/shared/shared +- icudt/shared/shared +- icuin/shared/shared +- $(ICU_PATH)/bin +- shared ; ++ icuuc ++ icuin ++ icudt ++ $(ICU_PATH)/bin ; + + + +diff --git a/libs/locale/build/has_icu_test.cpp b/libs/locale/build/has_icu_test.cpp +index 9419b30..ed9be05 100644 +--- a/build/has_icu_test.cpp ++++ b/build/has_icu_test.cpp +@@ -15,10 +15,6 @@ + #include + #include + +-#if defined(_MSC_VER) && !defined(_DLL) +-#error "Mixing ICU with a static runtime doesn't work" +-#endif +- + int main() + { + icu::Locale loc; +-- +2.12.2.windows.2 + diff --git a/ports/boost-locale/CONTROL b/ports/boost-locale/CONTROL index bd20f128336a12..5260cea4c5aacd 100644 --- a/ports/boost-locale/CONTROL +++ b/ports/boost-locale/CONTROL @@ -1,10 +1,12 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-locale -Version: 1.72.0 +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 -Description: ICU backend for Boost.Locale Build-Depends: icu +Description: ICU backend for Boost.Locale diff --git a/ports/boost-locale/b2-options.cmake b/ports/boost-locale/b2-options.cmake new file mode 100644 index 00000000000000..0a7deddca0a411 --- /dev/null +++ b/ports/boost-locale/b2-options.cmake @@ -0,0 +1,25 @@ +if(VCPKG_TARGET_IS_WINDOWS) + if("icu" IN_LIST FEATURES) + set(BOOST_LOCALE_ICU on) + else() + set(BOOST_LOCALE_ICU off) + endif() + + list(APPEND B2_OPTIONS + boost.locale.iconv=off + boost.locale.posix=off + /boost/locale//boost_locale + boost.locale.icu=${BOOST_LOCALE_ICU} + ) +else() + find_library(LIBICONV_LIBRARY iconv) + get_filename_component(LIBICONV_DIR "${LIBICONV_LIBRARY}" DIRECTORY) + + list(APPEND B2_OPTIONS + boost.locale.iconv=on + boost.locale.posix=on + /boost/locale//boost_locale + boost.locale.icu=off + -sICONV_PATH=${LIBICONV_DIR} + ) +endif() \ No newline at end of file diff --git a/ports/boost-locale/cmake-fragment.cmake b/ports/boost-locale/cmake-fragment.cmake deleted file mode 100644 index 11d3ed70ed7420..00000000000000 --- a/ports/boost-locale/cmake-fragment.cmake +++ /dev/null @@ -1,10 +0,0 @@ -find_library(LIBICONV_LIBRARY iconv) -get_filename_component(LIBICONV_DIR "${LIBICONV_LIBRARY}" DIRECTORY) - -list(APPEND B2_OPTIONS - boost.locale.iconv=on - boost.locale.posix=on - /boost/locale//boost_locale - boost.locale.icu=off - -sICONV_PATH=${LIBICONV_LIBRARY} -) diff --git a/ports/boost-locale/portfile.cmake b/ports/boost-locale/portfile.cmake index 569e0acdf09c15..65df1f7c91eb94 100644 --- a/ports/boost-locale/portfile.cmake +++ b/ports/boost-locale/portfile.cmake @@ -1,30 +1,18 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/locale - REF boost-1.72.0 - SHA512 a32a92b4d393f31ca6ba35ceb3d8802b4764e8aa9c8ff5417f3a0f0c886f473b635d613af743764d244459dccb4e285ac6fa50a9eed8d10183fa9954c131b85d + REF boost-1.73.0 + SHA512 0af88d8db7b18395a2b3668bcb51a5f32cd0de9acb9633572c2fb7edcdf06f354802392606394cf75ec4fd4d9cfe5c96351db766e55f8ef30f746b0a7017ad1f HEAD_REF master + PATCHES 0001-Fix-boost-ICU-support.patch ) -if("icu" IN_LIST FEATURES) - set(BOOST_LOCALE_ICU on) -else() - set(BOOST_LOCALE_ICU off) -endif() - include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) boost_modular_build( SOURCE_PATH ${SOURCE_PATH} - BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/cmake-fragment.cmake" - OPTIONS - boost.locale.iconv=off - boost.locale.posix=off - /boost/locale//boost_locale - boost.locale.icu=${BOOST_LOCALE_ICU} + BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/boost-lockfree/CONTROL b/ports/boost-lockfree/CONTROL index c98dd8e1682fc2..1902d7fbcfba5c 100644 --- a/ports/boost-lockfree/CONTROL +++ b/ports/boost-lockfree/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-lockfree -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-align, boost-array, boost-assert, boost-atomic, boost-config, boost-core, boost-integer, boost-mpl, boost-parameter, boost-predef, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/lockfree Description: Boost lockfree module diff --git a/ports/boost-lockfree/portfile.cmake b/ports/boost-lockfree/portfile.cmake index 73b225a1194229..d772790bc8ce04 100644 --- a/ports/boost-lockfree/portfile.cmake +++ b/ports/boost-lockfree/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/lockfree - REF boost-1.72.0 - SHA512 c77d8e8f4aa78b06ba67992352cbdc49203ea8ec56adcf535ce9b17f1126c08baf903b07cbf3023c7ce49ebb6d8ded094a30b74a6418fe1588c8feb972f22c01 + REF boost-1.73.0 + SHA512 3e32b3b56d505a1afa88abcca0cd17b7be5d63e9eb8953dbd26e503d20c6b4930bfb22392a6523add733a6ebabc3932b24344d700444c58bc625e5ee614759f8 HEAD_REF master ) diff --git a/ports/boost-log/CONTROL b/ports/boost-log/CONTROL index f04a5309c34881..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.72.0 +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-log/portfile.cmake b/ports/boost-log/portfile.cmake index f6b1208abc8ad8..e4eb85f815c065 100644 --- a/ports/boost-log/portfile.cmake +++ b/ports/boost-log/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/log - REF boost-1.72.0 - SHA512 e6f0d5cdad916e8afc07129ab92b8d0b4e3290708e019fce242d0efa1cbc6a2390d58e19fc01a4044ea5317d5f896d8286bf6a83a99151bc1faf6c162755f44b + REF boost-1.73.0 + SHA512 150013753d5060618c431ed9a819e3ec666bdba42cf3d463335ca49d66b8d6e800d5419332011f5ce05f19bc9c67a1cebc547279bf2931258ff7753a67796f2f HEAD_REF master ) diff --git a/ports/boost-logic/CONTROL b/ports/boost-logic/CONTROL index d9c55e9d9ebdd5..78b62f1e34b234 100644 --- a/ports/boost-logic/CONTROL +++ b/ports/boost-logic/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-logic -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-vcpkg-helpers Homepage: https://github.com/boostorg/logic Description: Boost logic module diff --git a/ports/boost-logic/portfile.cmake b/ports/boost-logic/portfile.cmake index 83dd01e4a24a38..cff0379f8bdf0e 100644 --- a/ports/boost-logic/portfile.cmake +++ b/ports/boost-logic/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/logic - REF boost-1.72.0 - SHA512 33ab03b3f6dd040ba79001040e4580d5fb1844c6dd42200103de2866f3a4074926b59df48763adb3333f7479f0f4f6e833e8908ae2a756dcd5ddfc7c8ddf93bc + REF boost-1.73.0 + SHA512 2ef43bbd47f105d1eb6542838777fd66925d82a98475da2b10c967779cc621cbe75f1432cab55fd713e99b7c01ce3dfe483b97f1b91b016e4d491a3f094ff6ae HEAD_REF master ) diff --git a/ports/boost-math/CONTROL b/ports/boost-math/CONTROL index bd2e5d2300d94a..b36f020e33b4ea 100644 --- a/ports/boost-math/CONTROL +++ b/ports/boost-math/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-math -Version: 1.72.0 -Build-Depends: boost-array, boost-assert, boost-atomic, boost-build, boost-chrono, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-fusion, boost-integer, boost-lambda, boost-lexical-cast, boost-modular-build-helper, boost-mp11, boost-mpl, boost-predef, boost-range, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-array, boost-assert, boost-atomic, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-fusion, boost-integer, boost-lambda, boost-lexical-cast, boost-modular-build-helper, boost-mp11, boost-mpl, boost-predef, boost-range, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/math Description: Boost math module diff --git a/ports/boost-math/portfile.cmake b/ports/boost-math/portfile.cmake index 946dc10aa23bf8..5d76c0007c0f53 100644 --- a/ports/boost-math/portfile.cmake +++ b/ports/boost-math/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/math - REF boost-1.72.0 - SHA512 8d3372675d8943fa08b4fb5461947e8c909917307dad674edd6e695dd17b249fa18b1653346fe31d1c54445fa23a6658c5967008f6bd3e6ff831c03b08b1545d + REF boost-1.73.0 + SHA512 9f264988efaa55865fed57e36243212fc0dbda42d00b42d712fc2eaa9581f9fee5af2f3c3ae645ff03fffcb626dbf96ea53c9dbffead755e758b90eb292420b3 HEAD_REF master ) diff --git a/ports/boost-metaparse/CONTROL b/ports/boost-metaparse/CONTROL index 0f42ea9c1b6d40..f926b8e5e9f1bb 100644 --- a/ports/boost-metaparse/CONTROL +++ b/ports/boost-metaparse/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-metaparse -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-mpl, boost-predef, boost-preprocessor, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/metaparse Description: Boost metaparse module diff --git a/ports/boost-metaparse/portfile.cmake b/ports/boost-metaparse/portfile.cmake index e86e54f6c7b8a1..4005234d93a2bb 100644 --- a/ports/boost-metaparse/portfile.cmake +++ b/ports/boost-metaparse/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/metaparse - REF boost-1.72.0 - SHA512 a52d7587f5988e14cad52d1720a7d380db4cf4253e0fb3f5b049a512f46a49c52536d7a5b56be7b48548c8bbbad80e74db64c07e8377399667221212af7aa27a + REF boost-1.73.0 + SHA512 1f6ffc3bee835fa3b52309647d1253cb8a75cc6bbbe1a832928b0571d88dede0f28bd9364e84415d0a9146698a07cac41c51b69f449d56e15a2e6732a0411258 HEAD_REF master ) diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index 8c91184a4b832e..629e01f6d372d0 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -10,6 +10,7 @@ set(VCPKG_PLATFORM_TOOLSET external) set(B2_OPTIONS) if(DEFINED BOOST_CMAKE_FRAGMENT) + message(STATUS "Including ${BOOST_CMAKE_FRAGMENT}") include(${BOOST_CMAKE_FRAGMENT}) endif() @@ -34,6 +35,12 @@ else() list(APPEND B2_OPTIONS address-model=32) endif() +if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + list(APPEND B2_OPTIONS architecture=s390x) +else() + list(APPEND B2_OPTIONS architecture=x86) +endif() + if(APPLE) list(APPEND B2_OPTIONS target-os=darwin toolset=clang) elseif(WIN32) @@ -82,11 +89,19 @@ if(NOT LDLAGS STREQUAL "") endif() #set(CXXFLAGS "${CXXFLAGS} -Wno-error=unused-command-line-argument") -if(CMAKE_CXX_COMPILER_TARGET) - set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET} ${CMAKE_CXX_COMPILER_TARGET}") +if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET}${CMAKE_CXX_COMPILER_TARGET}") + else() + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET} ${CMAKE_CXX_COMPILER_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}") @@ -153,7 +168,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 94ce34b891ce7b..f1794db5d17cb4 100644 --- a/ports/boost-modular-build-helper/CONTROL +++ b/ports/boost-modular-build-helper/CONTROL @@ -1,2 +1,3 @@ Source: boost-modular-build-helper -Version: 1.72.0-1 +Version: 1.73.0 +Port-Version: 3 diff --git a/ports/boost-modular-build-helper/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam index 688303b197db21..884284b499510b 100644 --- a/ports/boost-modular-build-helper/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam @@ -1,5 +1,5 @@ -constant BOOST_VERSION : 1.72.0 ; -constant BOOST_VERSION_ABI_TAG : 1_72 ; +constant BOOST_VERSION : 1.73.0 ; +constant BOOST_VERSION_ABI_TAG : 1_73 ; constant BOOST_JAMROOT_MODULE : $(__name__) ; import boostcpp ; @@ -11,7 +11,7 @@ project boost : requirements include&&"@CURRENT_INSTALLED_DIR@/include" BOOST_ALL_NO_LIB=1 @$(__name__).tag - @REQUIREMENTS@ + @B2_REQUIREMENTS@ ; rule boost-install ( libraries * ) diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index f254cb5a399569..a9716d48c10957 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -1,21 +1,38 @@ function(boost_modular_build) - cmake_parse_arguments(_bm "" "SOURCE_PATH;REQUIREMENTS;BOOST_CMAKE_FRAGMENT" "OPTIONS" ${ARGN}) + cmake_parse_arguments(_bm "" "SOURCE_PATH;BOOST_CMAKE_FRAGMENT" "" ${ARGN}) 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) + set(B2_OPTIONS_REL) + set(B2_REQUIREMENTS) # this variable is used in the Jamroot.jam + + if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) + message(STATUS "Including ${_bm_BOOST_CMAKE_FRAGMENT}") + include(${_bm_BOOST_CMAKE_FRAGMENT}) + endif() + # Todo: this serves too similar a purpose as vcpkg_find_acquire_program() - if(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + 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") + 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") endif() if(NOT EXISTS "${BOOST_BUILD_PATH}") - 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 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`.") + 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() if(EXISTS "${BOOST_BUILD_PATH}/b2.exe") @@ -27,13 +44,11 @@ function(boost_modular_build) endif() if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - list(APPEND _bm_OPTIONS windows-api=store) + list(APPEND B2_OPTIONS windows-api=store) endif() set(_bm_DIR ${CURRENT_INSTALLED_DIR}/share/boost-build) - set(REQUIREMENTS ${_bm_REQUIREMENTS}) - 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) @@ -79,26 +94,12 @@ function(boost_modular_build) if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) list(APPEND configure_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}") endif() - if(DEFINED VCPKG_PYTHON_EXECUTABLE) - list(APPEND configure_option "-DVCPKG_PYTHON_EXECUTABLE=${VCPKG_PYTHON_EXECUTABLE}") - endif() - if(DEFINED VCPKG_PYTHON_INCLUDE) - list(APPEND configure_option "-DVCPKG_PYTHON_INCLUDE=${VCPKG_PYTHON_INCLUDE}") - endif() - if(DEFINED VCPKG_PYTHON_LIBS_RELEASE) - list(APPEND configure_option "-DVCPKG_PYTHON_LIBS_RELEASE=${VCPKG_PYTHON_LIBS_RELEASE}") - endif() - if(DEFINED VCPKG_PYTHON_LIBS_DEBUG) - list(APPEND configure_option "-DVCPKG_PYTHON_LIBS_DEBUG=${VCPKG_PYTHON_LIBS_DEBUG}") - endif() - if(DEFINED VCPKG_PYTHON_VERSION) - list(APPEND configure_option "-DVCPKG_PYTHON_VERSION=${VCPKG_PYTHON_VERSION}") - endif() vcpkg_configure_cmake( SOURCE_PATH ${CURRENT_INSTALLED_DIR}/share/boost-build PREFER_NINJA OPTIONS "-DPORT=${PORT}" + "-DFEATURES=${FEATURES}" "-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}" "-DB2_EXE=${B2_EXE}" "-DSOURCE_PATH=${_bm_SOURCE_PATH}" @@ -153,7 +154,7 @@ function(boost_modular_build) ###################### # Generate configuration ###################### - list(APPEND _bm_OPTIONS + list(APPEND B2_OPTIONS -j${NUMBER_OF_PROCESSORS} --debug-configuration --debug-building @@ -169,11 +170,11 @@ function(boost_modular_build) threading=multi ) if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - list(APPEND _bm_OPTIONS threadapi=win32) + list(APPEND B2_OPTIONS threadapi=win32) else() - list(APPEND _bm_OPTIONS threadapi=pthread) + list(APPEND B2_OPTIONS threadapi=pthread) endif() - set(_bm_OPTIONS_DBG + set(B2_OPTIONS_DBG -sZLIB_BINARY=zlibd "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib" -sBZIP2_BINARY=bz2d @@ -183,8 +184,8 @@ function(boost_modular_build) -sZSTD_BINARY=zstdd "-sZSTD_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib" ) - - set(_bm_OPTIONS_REL + + set(B2_OPTIONS_REL -sZLIB_BINARY=zlib "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/lib" -sBZIP2_BINARY=bz2 @@ -197,62 +198,64 @@ function(boost_modular_build) # Properly handle compiler and linker flags passed by VCPKG if(VCPKG_CXX_FLAGS) - list(APPEND _bm_OPTIONS "cxxflags=${VCPKG_CXX_FLAGS}") + list(APPEND B2_OPTIONS "cxxflags=${VCPKG_CXX_FLAGS}") endif() if(VCPKG_CXX_FLAGS_RELEASE) - list(APPEND _bm_OPTIONS_REL "cxxflags=${VCPKG_CXX_FLAGS_RELEASE}") + list(APPEND B2_OPTIONS_REL "cxxflags=${VCPKG_CXX_FLAGS_RELEASE}") endif() if(VCPKG_CXX_FLAGS_DEBUG) - list(APPEND _bm_OPTIONS_DBG "cxxflags=${VCPKG_CXX_FLAGS_DEBUG}") + list(APPEND B2_OPTIONS_DBG "cxxflags=${VCPKG_CXX_FLAGS_DEBUG}") endif() if(VCPKG_C_FLAGS) - list(APPEND _bm_OPTIONS "cflags=${VCPKG_C_FLAGS}") + list(APPEND B2_OPTIONS "cflags=${VCPKG_C_FLAGS}") endif() if(VCPKG_C_FLAGS_RELEASE) - list(APPEND _bm_OPTIONS_REL "cflags=${VCPKG_C_FLAGS_RELEASE}") + list(APPEND B2_OPTIONS_REL "cflags=${VCPKG_C_FLAGS_RELEASE}") endif() if(VCPKG_C_FLAGS_DEBUG) - list(APPEND _bm_OPTIONS_DBG "cflags=${VCPKG_C_FLAGS_DEBUG}") + list(APPEND B2_OPTIONS_DBG "cflags=${VCPKG_C_FLAGS_DEBUG}") endif() if(VCPKG_LINKER_FLAGS) - list(APPEND _bm_OPTIONS "linkflags=${VCPKG_LINKER_FLAGS}") + list(APPEND B2_OPTIONS "linkflags=${VCPKG_LINKER_FLAGS}") endif() if(VCPKG_LINKER_FLAGS_RELEASE) - list(APPEND _bm_OPTIONS_REL "linkflags=${VCPKG_LINKER_FLAGS_RELEASE}") + list(APPEND B2_OPTIONS_REL "linkflags=${VCPKG_LINKER_FLAGS_RELEASE}") endif() if(VCPKG_LINKER_FLAGS_DEBUG) - list(APPEND _bm_OPTIONS_DBG "linkflags=${VCPKG_LINKER_FLAGS_DEBUG}") + list(APPEND B2_OPTIONS_DBG "linkflags=${VCPKG_LINKER_FLAGS_DEBUG}") endif() # Add build type specific options if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") - list(APPEND _bm_OPTIONS runtime-link=shared) + list(APPEND B2_OPTIONS runtime-link=shared) else() - list(APPEND _bm_OPTIONS runtime-link=static) + list(APPEND B2_OPTIONS runtime-link=static) endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - list(APPEND _bm_OPTIONS link=shared) + list(APPEND B2_OPTIONS link=shared) else() - list(APPEND _bm_OPTIONS link=static) + list(APPEND B2_OPTIONS link=static) endif() if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64") - list(APPEND _bm_OPTIONS address-model=64 architecture=x86) + list(APPEND B2_OPTIONS address-model=64 architecture=x86) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - list(APPEND _bm_OPTIONS address-model=32 architecture=arm) + list(APPEND B2_OPTIONS address-model=32 architecture=arm) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - list(APPEND _bm_OPTIONS address-model=64 architecture=arm) + 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 _bm_OPTIONS address-model=32 architecture=x86) + list(APPEND B2_OPTIONS address-model=32 architecture=x86) endif() file(TO_CMAKE_PATH "${_bm_DIR}/nothing.bat" NOTHING_BAT) @@ -280,9 +283,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 _bm_OPTIONS toolset=msvc) + list(APPEND B2_OPTIONS toolset=msvc) elseif(VCPKG_PLATFORM_TOOLSET MATCHES "external") - list(APPEND _bm_OPTIONS toolset=gcc) + list(APPEND B2_OPTIONS toolset=gcc) else() message(FATAL_ERROR "Unsupported value for VCPKG_PLATFORM_TOOLSET: '${VCPKG_PLATFORM_TOOLSET}'") endif() @@ -298,8 +301,8 @@ function(boost_modular_build) --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel --user-config=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/user-config.jam - ${_bm_OPTIONS} - ${_bm_OPTIONS_REL} + ${B2_OPTIONS} + ${B2_OPTIONS_REL} variant=release debug-symbols=on WORKING_DIRECTORY ${_bm_SOURCE_PATH}/build @@ -316,8 +319,8 @@ function(boost_modular_build) --stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage --build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg --user-config=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/user-config.jam - ${_bm_OPTIONS} - ${_bm_OPTIONS_DBG} + ${B2_OPTIONS} + ${B2_OPTIONS_DBG} variant=debug WORKING_DIRECTORY ${_bm_SOURCE_PATH}/build LOGNAME build-${TARGET_TRIPLET}-dbg @@ -375,7 +378,7 @@ function(boost_modular_build) string(REPLACE "-x64-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries string(REPLACE "-a32-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries string(REPLACE "-a64-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries - string(REPLACE "-1_72" "" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake > 3.10 to locate the binaries + string(REPLACE "-1_73" "" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake > 3.10 to locate the binaries if("${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}" STREQUAL "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}") # nothing to do elseif(EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) @@ -385,5 +388,13 @@ function(boost_modular_build) endif() endforeach() + # boost-regex[icu] and boost-locale[icu] generate has_icu.lib + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/has_icu.lib") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/has_icu.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/has_icu.lib") + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/has_icu.lib") + endif() + vcpkg_copy_pdbs() endfunction() diff --git a/ports/boost-modular-build-helper/portfile.cmake b/ports/boost-modular-build-helper/portfile.cmake index 6ed367434eda63..5f63ce5d8291ea 100644 --- a/ports/boost-modular-build-helper/portfile.cmake +++ b/ports/boost-modular-build-helper/portfile.cmake @@ -9,4 +9,4 @@ file( ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build -) +) \ No newline at end of file diff --git a/ports/boost-modular-build-helper/user-config.jam b/ports/boost-modular-build-helper/user-config.jam index 9f485fee202b9b..685c26c4ed1cb7 100644 --- a/ports/boost-modular-build-helper/user-config.jam +++ b/ports/boost-modular-build-helper/user-config.jam @@ -24,8 +24,10 @@ else if "@PORT@" = "boost-python" { - using python : @VCPKG_PYTHON_VERSION@ : "@VCPKG_PYTHON_EXECUTABLE@" : "@VCPKG_PYTHON_INCLUDE@" : "@VCPKG_PYTHON_LIBS_RELEASE@" ; - using python : @VCPKG_PYTHON_VERSION@ : "@VCPKG_PYTHON_EXECUTABLE@" : "@VCPKG_PYTHON_INCLUDE@" : "@VCPKG_PYTHON_LIBS_DEBUG@" : on ; + using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_RELEASE@" ; + using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_DEBUG@" : on ; + using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_RELEASE@" ; + using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_DEBUG@" : on ; } if "@PORT@" = "boost-mpi" diff --git a/ports/boost-move/CONTROL b/ports/boost-move/CONTROL index 0c05fa96299bd2..062cb2802364ee 100644 --- a/ports/boost-move/CONTROL +++ b/ports/boost-move/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-move -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-integer, boost-static-assert, boost-vcpkg-helpers Homepage: https://github.com/boostorg/move Description: Boost move module diff --git a/ports/boost-move/portfile.cmake b/ports/boost-move/portfile.cmake index ab131e299d4ae0..1ac77aa7d8380c 100644 --- a/ports/boost-move/portfile.cmake +++ b/ports/boost-move/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/move - REF boost-1.72.0 - SHA512 91bef5ad3b3d99ca90915a443e9fe2e8a21a8bed13446b3a9c57a3d9518f75a366cea171e727bdeee974dba5d7753aa1a42a4ec49de92a72c67d1a09acccd339 + REF boost-1.73.0 + SHA512 e8f096ab8fcde8905db80727f3f7405d64d3e03f6f865e0860943cb425bf3754baa9885854e40ff08b299dbff8bc1b7b605649bfd4073ec3d51b4cc4dddbe848 HEAD_REF master ) diff --git a/ports/boost-mp11/CONTROL b/ports/boost-mp11/CONTROL index a9dd74d580db44..61c956236f1cc8 100644 --- a/ports/boost-mp11/CONTROL +++ b/ports/boost-mp11/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mp11 -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/mp11 Description: Boost mp11 module diff --git a/ports/boost-mp11/portfile.cmake b/ports/boost-mp11/portfile.cmake index 0824889fd12da7..855da9c5fecd31 100644 --- a/ports/boost-mp11/portfile.cmake +++ b/ports/boost-mp11/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/mp11 - REF boost-1.72.0 - SHA512 289ad059add62f7f52a4de2602072d1162202646a4d634b450874fd6484342e8f7dd9e4d239f217c0c90852a2b57a0b6bc119ac811ec9837068ffebdcacc5ad3 + REF boost-1.73.0 + SHA512 04b2e3efbb75c29be19716fa985b90f47ecad9055a4ae24b18e49018317ec9d850322cc402f13f29a6187fc98943f41409dd39be3286dc61e2ee7a4e2f357547 HEAD_REF master ) diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index 85928419353a4d..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.72.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 +Version: 1.73.0 +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-mpi/portfile.cmake b/ports/boost-mpi/portfile.cmake index 7738b9d238a9b9..cd368ca5d53f88 100644 --- a/ports/boost-mpi/portfile.cmake +++ b/ports/boost-mpi/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/mpi - REF boost-1.72.0 - SHA512 84cbf590478a205379a9bd5b77c352265937297ff34a07926f279ebc39b779d4ac0cdfb87a069ccae7255f0ed2128a0d03e67b60058af61633bd45ca7b39e033 + REF boost-1.73.0 + SHA512 e731e0d6b4f047bf899cf8e88a9bd8da660cee54330a23c882d01f51e02e9e103f681fc6d067e4d125e17789b20821d09710a93598fd6c0792427ab709144b6f HEAD_REF master ) diff --git a/ports/boost-mpl/CONTROL b/ports/boost-mpl/CONTROL index 2e3e701f94f8bf..a8ace29ef3f95b 100644 --- a/ports/boost-mpl/CONTROL +++ b/ports/boost-mpl/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpl -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-predef, boost-preprocessor, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/mpl Description: Boost mpl module diff --git a/ports/boost-mpl/portfile.cmake b/ports/boost-mpl/portfile.cmake index 54541a8db981a2..1387c9082b1822 100644 --- a/ports/boost-mpl/portfile.cmake +++ b/ports/boost-mpl/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/mpl - REF boost-1.72.0 - SHA512 3baa17bbdeb8774ab583b4b3f42d7cd147eaef0f9188c45b6d18361b4cf10dcba679553b61dd2cbeae997ee77f94f0080a859516541121bcda16517983046296 + REF boost-1.73.0 + SHA512 1d3a131d589e8c2bea4637c5bb3d42beee60289201ee946435a797b4953cae6338b739b8c0abb0d8b1fb1ffacbdc6c609139424090e433a4f5aa98f6158a5c8d HEAD_REF master ) diff --git a/ports/boost-msm/CONTROL b/ports/boost-msm/CONTROL index ef2ca0f2837419..93ca01a2714ff4 100644 --- a/ports/boost-msm/CONTROL +++ b/ports/boost-msm/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-msm -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-any, boost-assert, boost-bind, boost-circular-buffer, boost-config, boost-core, boost-detail, boost-function, boost-fusion, boost-mpl, boost-parameter, boost-phoenix, boost-preprocessor, boost-proto, boost-serialization, boost-tuple, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/msm Description: Boost msm module diff --git a/ports/boost-msm/portfile.cmake b/ports/boost-msm/portfile.cmake index bf0a612f2726ae..a019b49fa09354 100644 --- a/ports/boost-msm/portfile.cmake +++ b/ports/boost-msm/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/msm - REF boost-1.72.0 - SHA512 24ed94cb47810286595acd53b139528db155c9044c85e4c886dd001afd98fd03ef261cca497e6c94b9c92fc695f3f82d87960ba09866bc2813cdb5dbe3f7dacf + REF boost-1.73.0 + SHA512 b91810bf79cc22c1a3fb8a4554192b416099ea091bd5b55bc303d4baea86cceddd8e2a65515897920cf5b6975030ddf057a1f3540e6291e7a14729996c6060c2 HEAD_REF master ) diff --git a/ports/boost-multi-array/CONTROL b/ports/boost-multi-array/CONTROL index 7421325ccdd041..87a0f59920c12f 100644 --- a/ports/boost-multi-array/CONTROL +++ b/ports/boost-multi-array/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-multi-array -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compatibility, boost-config, boost-vcpkg-helpers Homepage: https://github.com/boostorg/multi_array Description: Boost multi_array module diff --git a/ports/boost-multi-array/portfile.cmake b/ports/boost-multi-array/portfile.cmake index 1596e67b20aea5..63fcd9ad77998f 100644 --- a/ports/boost-multi-array/portfile.cmake +++ b/ports/boost-multi-array/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/multi_array - REF boost-1.72.0 - SHA512 478fd78df7862ddfae4d0a05b465766f3fda228a06ad9ef9e57bd8a1a5dc363599a92b5252d0eb1bf5bc1c4e3da234b78a07661bae6289344d1733d0411f4835 + REF boost-1.73.0 + SHA512 72e200ed03eaa25e354461f8f4bcddb0a216902e3198d5d653ce4f1dfe6aa637f4f81608e98e2e736ecfd42466dd62ffd10907b908daa4735dadef23bb5950b4 HEAD_REF master ) diff --git a/ports/boost-multi-index/CONTROL b/ports/boost-multi-index/CONTROL index 80bb1c1299580e..e1e212f817b3bc 100644 --- a/ports/boost-multi-index/CONTROL +++ b/ports/boost-multi-index/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-multi-index -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-compatibility, boost-config, boost-container-hash, boost-core, boost-detail, boost-foreach, boost-functional, boost-integer, boost-iterator, boost-move, boost-mpl, boost-preprocessor, boost-serialization, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/multi_index Description: Boost multi_index module diff --git a/ports/boost-multi-index/portfile.cmake b/ports/boost-multi-index/portfile.cmake index 7adc679785ae3d..d9f72eeb9e3e0a 100644 --- a/ports/boost-multi-index/portfile.cmake +++ b/ports/boost-multi-index/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/multi_index - REF boost-1.72.0 - SHA512 bcab9d525948feb864b803eada609dd4d9483700d81d6f20b6beef4e7206c366b46ccc956cd399a9f6f3e3a3a44e693b94778e638050beeb74e8af832af2ec08 + REF boost-1.73.0 + SHA512 c0e7fa0a0970eaa285836218c4c283cfbb250dfaf5b88c487aa4913921bc9703982a73594c5b6c7b6f66790276219fa65c6522503286790522319c0b78656418 HEAD_REF master ) diff --git a/ports/boost-multiprecision/CONTROL b/ports/boost-multiprecision/CONTROL index c6d64221f859ef..f79abdf7373b2d 100644 --- a/ports/boost-multiprecision/CONTROL +++ b/ports/boost-multiprecision/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-multiprecision -Version: 1.72.0 -Build-Depends: boost-array, boost-assert, boost-config, boost-container-hash, boost-core, boost-functional, boost-integer, boost-lexical-cast, boost-mpl, boost-predef, boost-rational, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-array, boost-assert, boost-atomic, boost-config, boost-container-hash, boost-core, boost-functional, boost-integer, boost-lexical-cast, boost-mpl, boost-predef, boost-rational, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/multiprecision Description: Boost multiprecision module diff --git a/ports/boost-multiprecision/portfile.cmake b/ports/boost-multiprecision/portfile.cmake index 41f3cb00a2cc5f..73afe33e9899cd 100644 --- a/ports/boost-multiprecision/portfile.cmake +++ b/ports/boost-multiprecision/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/multiprecision - REF boost-1.72.0 - SHA512 c9ad9eab980d32c6676950352716eb5efadd621e208c856195a3ef4849cbf87fcc531f6f5a6e1c7d0d0cc9a00db455a0d25e2b1382408e8c5db163064ed52833 + REF boost-1.73.0 + SHA512 d6fffa67b9d00bdda81d52aee897274cb05fff45cd4238e4a58ab6de0342962415e022eed1c3c7164806cade2a218cdedde7a5062808d385b055ea24f3cc7658 HEAD_REF master ) diff --git a/ports/boost-nowide/CONTROL b/ports/boost-nowide/CONTROL new file mode 100644 index 00000000000000..6408fa8a9b1212 --- /dev/null +++ b/ports/boost-nowide/CONTROL @@ -0,0 +1,6 @@ +# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 +Source: boost-nowide +Version: 1.73.0 +Build-Depends: boost-build, boost-config, boost-filesystem (!uwp), boost-integer, boost-modular-build-helper, boost-smart-ptr, boost-static-assert, boost-vcpkg-helpers +Homepage: https://github.com/boostorg/nowide +Description: Boost nowide module diff --git a/ports/boost-nowide/portfile.cmake b/ports/boost-nowide/portfile.cmake new file mode 100644 index 00000000000000..e3a10d862604ee --- /dev/null +++ b/ports/boost-nowide/portfile.cmake @@ -0,0 +1,14 @@ +# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO boostorg/nowide + REF boost-1.73.0 + SHA512 2ef89ee386dbce7c88d78dba15b8301601cd83660acf1f5841e2297df92fd6b3d83999c7ae6d1d19cc06bc6ad721df1d206f7473b70c3ba6dc26aa1507ca5b5a + HEAD_REF master +) + +include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) +boost_modular_build(SOURCE_PATH ${SOURCE_PATH}) +include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) +boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/boost-numeric-conversion/CONTROL b/ports/boost-numeric-conversion/CONTROL index 8a7df86c82dfad..2854c6364ae7ae 100644 --- a/ports/boost-numeric-conversion/CONTROL +++ b/ports/boost-numeric-conversion/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-numeric-conversion -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-integer, boost-preprocessor, boost-throw-exception, boost-vcpkg-helpers Homepage: https://github.com/boostorg/numeric_conversion Description: Boost numeric_conversion module diff --git a/ports/boost-numeric-conversion/portfile.cmake b/ports/boost-numeric-conversion/portfile.cmake index 485b4d781ff3fc..e00c81011b8f4c 100644 --- a/ports/boost-numeric-conversion/portfile.cmake +++ b/ports/boost-numeric-conversion/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/numeric_conversion - REF boost-1.72.0 - SHA512 23a6c380cf19e8509972a41d5ad2cddfcb4d65e50f1ba4832d80664ea0fb190cdaf7ef52bb625ee9f801989cc061f3e878ceeda59650072377e333d47f0be9e3 + REF boost-1.73.0 + SHA512 1486a47eeef33e9db44215e0d6bde6ce409bffdaa7d5384b223bb30c2d6f8902bbe08a1b0f4a619527846875637c6fb0c80a57c2988cb8df63c54d5a3adf4a3c HEAD_REF master ) diff --git a/ports/boost-odeint/CONTROL b/ports/boost-odeint/CONTROL index 1a3c5e080ef611..a9855888bb8761 100644 --- a/ports/boost-odeint/CONTROL +++ b/ports/boost-odeint/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-odeint -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-bind, boost-compute, boost-config, boost-core, boost-function, boost-fusion, boost-iterator, boost-math, boost-mpl, boost-multi-array, boost-preprocessor, boost-range, boost-static-assert, boost-throw-exception, boost-type-traits, boost-units, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/odeint Description: Boost odeint module diff --git a/ports/boost-odeint/portfile.cmake b/ports/boost-odeint/portfile.cmake index 021a0ec58177dd..e3e797fd93eb8f 100644 --- a/ports/boost-odeint/portfile.cmake +++ b/ports/boost-odeint/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/odeint - REF boost-1.72.0 - SHA512 452a20edfe70dcc4db3409d97e1d6ff28a9dda8cb63b41a883a6d2a7c9e0b05069f7dfe2bddf9583e3df30508c397a187ec578ae117a556d2b4ae945f4dd1a32 + REF boost-1.73.0 + SHA512 b433d5693da30677ecae28ce529a2a4d53076a6ad46a7b0f6e523f17b2e3e713c7a1fe5dad426950a25465893a78c33cbced4463eb64b86499d2521950a7b436 HEAD_REF master ) diff --git a/ports/boost-optional/CONTROL b/ports/boost-optional/CONTROL index c1d04babb7e9d9..f81cfdca0ccd97 100644 --- a/ports/boost-optional/CONTROL +++ b/ports/boost-optional/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-optional -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-move, boost-predef, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/optional Description: Boost optional module diff --git a/ports/boost-optional/portfile.cmake b/ports/boost-optional/portfile.cmake index bb076cb618752f..8ea05d2a90ede6 100644 --- a/ports/boost-optional/portfile.cmake +++ b/ports/boost-optional/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/optional - REF boost-1.72.0 - SHA512 fa43a4458b8a08191be8bf6e9cd7e389b89ec74fb14fa1b66b0c444a1f552e41129224561ed834eedb63f2aa114340fdb9a3e59c49fe3b25f329bb26df80303b + REF boost-1.73.0 + SHA512 07b4df2e20a5d4d9048786458b97bf59de414b46efc7dec89119064ca215cc4b755b950e0dc1212eacce79e78f95342caeb2a8e9fd067157f5f3d0be9f82f019 HEAD_REF master ) diff --git a/ports/boost-outcome/0001-outcome-assert.patch b/ports/boost-outcome/0001-outcome-assert.patch new file mode 100644 index 00000000000000..68ea5a50abbae8 --- /dev/null +++ b/ports/boost-outcome/0001-outcome-assert.patch @@ -0,0 +1,11 @@ +--- a/include/boost/outcome/experimental/status-code/status_code_ptr.hpp 2020-04-28 09:23:14.792565200 +0100 ++++ b/include/boost/outcome/experimental/status-code/status_code_ptr.hpp 2020-04-28 09:24:34.311741000 +0100 +@@ -103,7 +103,7 @@ + #endif + virtual void _do_erased_copy(status_code &dst, const status_code &src, size_t /*unused*/) const override // NOLINT + { +- assert(dst.domain() == *this); ++ // Note that dst will not have its domain set + assert(src.domain() == *this); + auto &d = static_cast<_mycode &>(dst); // NOLINT + const auto &_s = static_cast(src); // NOLINT diff --git a/ports/boost-outcome/CONTROL b/ports/boost-outcome/CONTROL index 2a04d14df179bc..e0e798af4930fc 100644 --- a/ports/boost-outcome/CONTROL +++ b/ports/boost-outcome/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-outcome -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-throw-exception, boost-vcpkg-helpers Homepage: https://github.com/boostorg/outcome Description: Boost outcome module diff --git a/ports/boost-outcome/portfile.cmake b/ports/boost-outcome/portfile.cmake index b9e0d52d2e3628..8a6a94a7c754d6 100644 --- a/ports/boost-outcome/portfile.cmake +++ b/ports/boost-outcome/portfile.cmake @@ -1,13 +1,12 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/outcome - REF boost-1.72.0 - SHA512 3de487dfcdb07cbf3184cf7a75c4ce476ea905ee24bfb967dff30ec8b1b29e57f1d52858ec9ef3ed4f865696a2ce768aedea406bdf4e6147c631138ffa5d3858 + REF boost-1.73.0 + SHA512 992518afaea71cdf0531675f2c3bc5329c2ebd79b65998c1f774bd913d5135ccf48f2f831c3d9481e33375f7df3c637da45a3bd75298e1d6637d517793c8cb86 HEAD_REF master + PATCHES 0001-outcome-assert.patch ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) diff --git a/ports/boost-parameter-python/CONTROL b/ports/boost-parameter-python/CONTROL index b516fd555393f4..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.72.0 -Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python, boost-vcpkg-helpers +Version: 1.73.0 +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-parameter-python/portfile.cmake b/ports/boost-parameter-python/portfile.cmake index cdcf69fdccfeb0..f570f638852075 100644 --- a/ports/boost-parameter-python/portfile.cmake +++ b/ports/boost-parameter-python/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/parameter_python - REF boost-1.72.0 - SHA512 3d230ca500169fffb6c18b491bf94bf8091b56458621149710157e0386c2c6e01571c52170e4226bf6e86f2c8bf7f587da51b7e79f69a7653e0846e8dfdcc2fe + REF boost-1.73.0 + SHA512 a2c05d5840465ed042dc2144d18b917cd68d1f89d0f616203663abbdf0d28c075b5bd2615384202e2584a4fbb663aa7fdee05d534a04c5c08f9a98fd901affbf HEAD_REF master ) diff --git a/ports/boost-parameter/CONTROL b/ports/boost-parameter/CONTROL index 1479473ce82060..14300e50547675 100644 --- a/ports/boost-parameter/CONTROL +++ b/ports/boost-parameter/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-parameter -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-function, boost-fusion, boost-mp11, boost-mpl, boost-optional, boost-preprocessor, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/parameter Description: Boost parameter module diff --git a/ports/boost-parameter/portfile.cmake b/ports/boost-parameter/portfile.cmake index 19f676f7f6bb58..fd833d03c9f236 100644 --- a/ports/boost-parameter/portfile.cmake +++ b/ports/boost-parameter/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/parameter - REF boost-1.72.0 - SHA512 3f04d8f5b41aed4bc22a17cfa39ce75605d8a8d65fa6403dd16ee45bd960632869145ed5afce2af73b2cc12fa708fc6765d0fe6d9a11bda2efea07259007b558 + REF boost-1.73.0 + SHA512 63da1ec9dae999dac3542344a67b58e40928c453f87d7cd71fda858eeb2df48ff0056fe3eee550dff9912602d0595e0c90939dc2fad7851c90285abb72f57087 HEAD_REF master ) diff --git a/ports/boost-phoenix/CONTROL b/ports/boost-phoenix/CONTROL index 4afb397d6840c7..f1c3495ce12a3e 100644 --- a/ports/boost-phoenix/CONTROL +++ b/ports/boost-phoenix/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-phoenix -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-config, boost-core, boost-detail, boost-function, boost-fusion, boost-mpl, boost-predef, boost-preprocessor, boost-proto, boost-range, boost-smart-ptr, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/phoenix Description: Boost phoenix module diff --git a/ports/boost-phoenix/portfile.cmake b/ports/boost-phoenix/portfile.cmake index 83cea091f8b461..45209d5a5912a4 100644 --- a/ports/boost-phoenix/portfile.cmake +++ b/ports/boost-phoenix/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/phoenix - REF boost-1.72.0 - SHA512 b35e523a4a0c6d42a12344c47131b6eb6f9f568a5bc06db826d5bb3bc64561856080a99c5e45b51d3fe7816153558936c5e9234771a5bbca852678341457eb8d + REF boost-1.73.0 + SHA512 6919ea20e6bafac0a10024f3823badd23147cf4923ff0e2678bea6951cafc66ce08d12569bb273d6cd1cc15d104fabff6115e64033f446dc5ccb29d095ac6627 HEAD_REF master ) diff --git a/ports/boost-poly-collection/CONTROL b/ports/boost-poly-collection/CONTROL index 92a600327385ba..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.72.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 +Version: 1.73.0 +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-poly-collection/portfile.cmake b/ports/boost-poly-collection/portfile.cmake index 58f2e07db29dfe..246f1fd7938098 100644 --- a/ports/boost-poly-collection/portfile.cmake +++ b/ports/boost-poly-collection/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/poly_collection - REF boost-1.72.0 - SHA512 4dda6cedc15f2f1ca1eb83735adcb275a91430e8c617513ecce121f4bfbf2d99d02206a3b45cbab80c34f3befa89615cb4b4cdb10234f58ab70e5fbe0d2ae134 + REF boost-1.73.0 + SHA512 6d04153c03634748ebe35509359c882a766dc8ed5a880cd927bfc3488d3364229140e87da6ada157fd7d4ade86a9d1f5d503a098eb2aa3773949722dea6f3ad6 HEAD_REF master ) diff --git a/ports/boost-polygon/CONTROL b/ports/boost-polygon/CONTROL index 242ccecffc695f..8bcf26dd8f800e 100644 --- a/ports/boost-polygon/CONTROL +++ b/ports/boost-polygon/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-polygon -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-integer, boost-vcpkg-helpers Homepage: https://github.com/boostorg/polygon Description: Boost polygon module diff --git a/ports/boost-polygon/portfile.cmake b/ports/boost-polygon/portfile.cmake index e37865d85c693e..fd574030346f16 100644 --- a/ports/boost-polygon/portfile.cmake +++ b/ports/boost-polygon/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/polygon - REF boost-1.72.0 - SHA512 a553975eacb0863f15540dc65e6ea34961aeab44e55ec2813cc03986d4bffeb8d726f6947ae410eea67ec4bf9e225f4763b0c0bf202077100dbeb857eafacd67 + REF boost-1.73.0 + SHA512 22e61f411a011ff5f77fc358b415dee57c2eb0297f9810de8fb8fd4c07a5a89ce03d51b827e3efe52a226d231a4ec85bdd6fc50fc0286c28116653926b525130 HEAD_REF master ) diff --git a/ports/boost-pool/CONTROL b/ports/boost-pool/CONTROL index b966a3607b7c6c..bf069b92c43768 100644 --- a/ports/boost-pool/CONTROL +++ b/ports/boost-pool/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-pool -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-detail, boost-integer, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/pool Description: Boost pool module diff --git a/ports/boost-pool/portfile.cmake b/ports/boost-pool/portfile.cmake index 48ed69bb1b800d..0549c721a2ce8e 100644 --- a/ports/boost-pool/portfile.cmake +++ b/ports/boost-pool/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/pool - REF boost-1.72.0 - SHA512 87202bc193ee4d2de443b266f7bd786b6869691a164a8ec48949ce99a6101668153cc66d5cf407c4b55043d327fbc71b6c003ecdeb8965a976f8b4fb51610b0b + REF boost-1.73.0 + SHA512 922c1caddc06cccd82b7137cc50e1ea2e5b02b227c3d568f06096c4237138a1345101e96d0450b5d2ff3ba55f89ae9a45200433e8e811efb3b3ae9c579f8466b HEAD_REF master ) diff --git a/ports/boost-predef/CONTROL b/ports/boost-predef/CONTROL index cc9742439e1162..3a7c4700d432ad 100644 --- a/ports/boost-predef/CONTROL +++ b/ports/boost-predef/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-predef -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/predef Description: Boost predef module diff --git a/ports/boost-predef/portfile.cmake b/ports/boost-predef/portfile.cmake index 9e3ac2b7e1d312..981b4580e802d2 100644 --- a/ports/boost-predef/portfile.cmake +++ b/ports/boost-predef/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/predef - REF boost-1.72.0 - SHA512 794aac881b6ddc1605025b038dcd403d154c3919fe0c2fe1598775ef2ac58de7a1d7598ed552769818701e204586065adf5cb4d40d71072212e2f77e2fe86af7 + REF boost-1.73.0 + SHA512 f08b712296bfa7045208e094bbef80880368a334fef0ea6aa05c75a2312bc1543c0e95f045fa087e3d9e35fb006e0b07070ce5a21d274cbdc2e2bba55eec0a21 HEAD_REF master ) diff --git a/ports/boost-preprocessor/CONTROL b/ports/boost-preprocessor/CONTROL index a14caf68ef2b39..418bf295537ca0 100644 --- a/ports/boost-preprocessor/CONTROL +++ b/ports/boost-preprocessor/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-preprocessor -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-vcpkg-helpers Homepage: https://github.com/boostorg/preprocessor Description: Boost preprocessor module diff --git a/ports/boost-preprocessor/portfile.cmake b/ports/boost-preprocessor/portfile.cmake index de531bd78115b1..ececbba3229f84 100644 --- a/ports/boost-preprocessor/portfile.cmake +++ b/ports/boost-preprocessor/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/preprocessor - REF boost-1.72.0 - SHA512 d7c96596edae7ab6282ce2bc53a1a7316fd60423a328904419cbd6836e4d86e0cf4d5948a1b2268b87de00b9c338f0435df12ddb540552d39ffa3b6c030d465c + REF boost-1.73.0 + SHA512 80341ca2dd62b0fda2f89609f062d9a93b6865c25d86f8f30c8f49848d8ce563b92c2d424e5181994b32603111a06869367a801fca29dea3f5bc6c6ed2fedf2b HEAD_REF master ) diff --git a/ports/boost-process/CONTROL b/ports/boost-process/CONTROL index fd36ac08794148..e67c76f9336ecb 100644 --- a/ports/boost-process/CONTROL +++ b/ports/boost-process/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-process -Version: 1.72.0-1 +Version: 1.73.0 Build-Depends: boost-algorithm, boost-asio, boost-config, boost-core, boost-filesystem (!uwp), boost-fusion, boost-iterator, boost-move, boost-optional, boost-system, boost-tokenizer, boost-type-index, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/process Description: Boost process module diff --git a/ports/boost-process/async_pipe_header.patch b/ports/boost-process/async_pipe_header.patch deleted file mode 100644 index 7308f4b9daf56a..00000000000000 --- a/ports/boost-process/async_pipe_header.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/include/boost/process/async_pipe.hpp b/include/boost/process/async_pipe.hpp -index 101fe1d59..a562432c0 100644 ---- a/include/boost/process/async_pipe.hpp -+++ b/include/boost/process/async_pipe.hpp -@@ -47,6 +47,8 @@ class async_pipe - */ - typedef platform_specific handle_type; - -+ typedef typename handle_type::executor_type executor_type; -+ - /** Construct a new async_pipe, does automatically open the pipe. - * Initializes source and sink with the same io_context. - * @note Windows creates a named pipe here, where the name is automatically generated. -diff --git a/include/boost/process/detail/posix/async_pipe.hpp b/include/boost/process/detail/posix/async_pipe.hpp -index 725a07890..a82c057b9 100644 ---- a/include/boost/process/detail/posix/async_pipe.hpp -+++ b/include/boost/process/detail/posix/async_pipe.hpp -@@ -23,6 +23,7 @@ class async_pipe - public: - typedef int native_handle_type; - typedef ::boost::asio::posix::stream_descriptor handle_type; -+ typedef typename handle_type::executor_type executor_type; - - inline async_pipe(boost::asio::io_context & ios) : async_pipe(ios, ios) {} - -diff --git a/include/boost/process/detail/windows/async_pipe.hpp b/include/boost/process/detail/windows/async_pipe.hpp -index 06d5f2d85..0b447f9b8 100644 ---- a/include/boost/process/detail/windows/async_pipe.hpp -+++ b/include/boost/process/detail/windows/async_pipe.hpp -@@ -48,6 +48,7 @@ class async_pipe - public: - typedef ::boost::winapi::HANDLE_ native_handle_type; - typedef ::boost::asio::windows::stream_handle handle_type; -+ typedef typename handle_type::executor_type executor_type; - - async_pipe(boost::asio::io_context & ios) : async_pipe(ios, ios, make_pipe_name(), true) {} - async_pipe(boost::asio::io_context & ios_source, boost::asio::io_context & ios_sink) diff --git a/ports/boost-process/portfile.cmake b/ports/boost-process/portfile.cmake index e07c778e86a058..ae80396e7d01da 100644 --- a/ports/boost-process/portfile.cmake +++ b/ports/boost-process/portfile.cmake @@ -1,14 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/process - REF boost-1.72.0 - SHA512 bc881bcfa817e848151d90a0837683b9833395a7f7b76de76c40c96615bb1da7d10c0dae84f6b70b47fdf762a62869cb1700730a74fe123901803128f9194a52 + REF boost-1.73.0 + SHA512 6f03f492ebe7b4ceb6ee15f50767c43200f0d0a9237df53d9f893964eed9d28d5784b591b348425d4972d47742fcc78049753ac28a79afd0ca13e2824b2f4690 HEAD_REF master - PATCHES async_pipe_header.patch ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) diff --git a/ports/boost-program-options/CONTROL b/ports/boost-program-options/CONTROL index ea4ca76ee48f25..aed8ed80a5e09e 100644 --- a/ports/boost-program-options/CONTROL +++ b/ports/boost-program-options/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-program-options -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-any, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/program_options Description: Boost program_options module diff --git a/ports/boost-program-options/portfile.cmake b/ports/boost-program-options/portfile.cmake index f86c70c25810a5..8a173ea331afcc 100644 --- a/ports/boost-program-options/portfile.cmake +++ b/ports/boost-program-options/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/program_options - REF boost-1.72.0 - SHA512 7bb2f7e81618ac815c1a53e5804b069fd7adfa448fbbf58d488691d38a84ffa59e6187313f7b24cb9bf954626c4e62a901c0c4f5452d9f156b0f6058a941cf66 + REF boost-1.73.0 + SHA512 d89963d46dd2bb65de1b15b2a1d707b5824724faad34afb649393fb4a80dbc227ee80918c1b8747f8e1ede5e80bcf908a39baea2590d879b9e776354755293b8 HEAD_REF master ) diff --git a/ports/boost-property-map/CONTROL b/ports/boost-property-map/CONTROL index f7b8266188c558..58c59141e97fb8 100644 --- a/ports/boost-property-map/CONTROL +++ b/ports/boost-property-map/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-property-map -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-any, boost-assert, boost-bind, boost-concept-check, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-multi-index, boost-optional, boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/property_map Description: Boost property_map module diff --git a/ports/boost-property-map/portfile.cmake b/ports/boost-property-map/portfile.cmake index a545697e59d7a0..17800f14b230b5 100644 --- a/ports/boost-property-map/portfile.cmake +++ b/ports/boost-property-map/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/property_map - REF boost-1.72.0 - SHA512 7e9433810073a78be7e6e1b41ec5b605747ae582c76b1d2f8a9dde005b8ca175a01a9f6e9075bc85647b163a81a97fe2ee5537e0554bd82a393e73a3ecdb2202 + REF boost-1.73.0 + SHA512 e79ec94f850ebfcbb85c29536d552299c8d81e328b22a2690dbef1665ac2b4c2e2c33cf2577fd0800a04fc94fbf4b9b8aeafb3646736abf7739373d0760d4e91 HEAD_REF master ) diff --git a/ports/boost-property-tree/CONTROL b/ports/boost-property-tree/CONTROL index 0b9036d7e9e357..ed7e3a47a9dba8 100644 --- a/ports/boost-property-tree/CONTROL +++ b/ports/boost-property-tree/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-property-tree -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-any, boost-assert, boost-bind, boost-compatibility, boost-config, boost-core, boost-format, boost-iterator, boost-mpl, boost-multi-index, boost-optional, boost-range, boost-serialization, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/property_tree Description: Boost property_tree module diff --git a/ports/boost-property-tree/portfile.cmake b/ports/boost-property-tree/portfile.cmake index a4ed45847381f9..21a61697471948 100644 --- a/ports/boost-property-tree/portfile.cmake +++ b/ports/boost-property-tree/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/property_tree - REF boost-1.72.0 - SHA512 dfe8cb719c0f14515dfcc017b25081dc61b140e82b3733c1f4485725405ac58bb29f068a9e1e601c60270d591af16d28c033f04b819efae9cf2f329041595985 + REF boost-1.73.0 + SHA512 67cdc239ea2535b4f2d364342b7cc4bac212ec2e97d4fcb624518b32cd9d014cf3f8c5d0f21d15f97c118b55c5c2a157e794f6a4c5698ac7e52ee2fc1fdaa4ac HEAD_REF master ) diff --git a/ports/boost-proto/CONTROL b/ports/boost-proto/CONTROL index a54095148aaba9..f1ab493789c5c8 100644 --- a/ports/boost-proto/CONTROL +++ b/ports/boost-proto/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-proto -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-detail, boost-fusion, boost-mpl, boost-preprocessor, boost-range, boost-static-assert, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/proto Description: Boost proto module diff --git a/ports/boost-proto/portfile.cmake b/ports/boost-proto/portfile.cmake index 4753f89482a00e..3187f0c255aacb 100644 --- a/ports/boost-proto/portfile.cmake +++ b/ports/boost-proto/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/proto - REF boost-1.72.0 - SHA512 a725ad97f837758bc9ea2b7523f34074144c95d548eae330cd8eaa8f6b9eaa4c0107f65849f5af050f3005cc0ab1ea529c87b443c471b040ef9318e8597674bd + REF boost-1.73.0 + SHA512 e5faf783ed1f8830f641e42265ed50f5eb634ff6f0f3783268add5278889145e9c1554838b653d45770b5dfdfaa577f37567f40ab6c0f615d3d811229e18794a HEAD_REF master ) diff --git a/ports/boost-ptr-container/CONTROL b/ports/boost-ptr-container/CONTROL index 3e747d138ac9b4..248a3318b75328 100644 --- a/ports/boost-ptr-container/CONTROL +++ b/ports/boost-ptr-container/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-ptr-container -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-circular-buffer, boost-config, boost-core, boost-iterator, boost-mpl, boost-range, boost-serialization, boost-smart-ptr, boost-static-assert, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/ptr_container Description: Boost ptr_container module diff --git a/ports/boost-ptr-container/portfile.cmake b/ports/boost-ptr-container/portfile.cmake index 8e08e5406afc3f..dc0861d0380aa9 100644 --- a/ports/boost-ptr-container/portfile.cmake +++ b/ports/boost-ptr-container/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/ptr_container - REF boost-1.72.0 - SHA512 6b46f3a7f8a1291fb7fbc52915a34d33c411a0c2408a657658554bac73c8f1f538496d205ca34ef5f1919061676b8c3d43c06d63dfe71f34f72c1c6f1aa11f7d + REF boost-1.73.0 + SHA512 342c9067dbeddc0a2b20b8493cd21ea9f65836260643a0e36fc6bff5ff3cb9c452382a2e4101fe8f472518dd49fffc915423bad7bc3edb5ebc915a917edb5d61 HEAD_REF master ) diff --git a/ports/boost-python/CONTROL b/ports/boost-python/CONTROL index b1e0cba236ac9a..a8698deaaf6bca 100644 --- a/ports/boost-python/CONTROL +++ b/ports/boost-python/CONTROL @@ -1,6 +1,12 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-python -Version: 1.72.0-1 +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) +Description: Build with Python2 support diff --git a/ports/boost-python/b2-options.cmake b/ports/boost-python/b2-options.cmake new file mode 100644 index 00000000000000..5cc0a8da01be14 --- /dev/null +++ b/ports/boost-python/b2-options.cmake @@ -0,0 +1,23 @@ +set(BUILD_PYTHON_VERSIONS) + +if("python2" IN_LIST FEATURES) + # Find Python2 libraries. Can't use find_package here, but we already know where everything is + file(GLOB VCPKG_PYTHON2_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python2.*") + set(VCPKG_PYTHON2_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") + set(VCPKG_PYTHON2_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") + string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON2_VERSION "${VCPKG_PYTHON2_INCLUDE}") + list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON2_VERSION}") +endif() + +# Find Python3 libraries. Can't use find_package here, but we already know where everything is +file(GLOB VCPKG_PYTHON3_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*") +set(VCPKG_PYTHON3_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") +set(VCPKG_PYTHON3_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") +string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON3_VERSION "${VCPKG_PYTHON3_INCLUDE}") +list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON3_VERSION}") + +string(REPLACE ";" "," BUILD_PYTHON_VERSIONS "${BUILD_PYTHON_VERSIONS}") + +list(APPEND B2_OPTIONS + python=${BUILD_PYTHON_VERSIONS} +) diff --git a/ports/boost-python/portfile.cmake b/ports/boost-python/portfile.cmake index d81d6889cde202..ee7885d5e78259 100644 --- a/ports/boost-python/portfile.cmake +++ b/ports/boost-python/portfile.cmake @@ -1,24 +1,17 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/python - REF boost-1.72.0 - SHA512 9e2214f45b6b7e269caeba3decf2b79df9d1addc711aa65b75273e5fef9ff7423d400e4f11a904f932759b32a5c7e699441961494e061c8dd9c966da1f5b8fef + REF boost-1.73.0 + SHA512 de3523e39814ab6d1bfd69e77983e31f43be16e57c2ad2fe0ff5b67bfcc03ed35ee90a0365acd62c05640e25de223e2885401d03fce62cde47ba3329ada6f495 HEAD_REF master ) -# Find Python3 executable -vcpkg_find_acquire_program(PYTHON3) -set(VCPKG_PYTHON_EXECUTABLE "${PYTHON3}") -# Find Python3 libraries. Can't use find_package here, but we already know where everything is -file(GLOB VCPKG_PYTHON_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*") -set(VCPKG_PYTHON_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") -set(VCPKG_PYTHON_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") -string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON_VERSION "${VCPKG_PYTHON_INCLUDE}") include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) -boost_modular_build(SOURCE_PATH ${SOURCE_PATH}) +boost_modular_build( + SOURCE_PATH ${SOURCE_PATH} + BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" +) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/boost-qvm/CONTROL b/ports/boost-qvm/CONTROL index 3cd1cc43f56af4..e9ab139c8710cb 100644 --- a/ports/boost-qvm/CONTROL +++ b/ports/boost-qvm/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-qvm -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-exception, boost-static-assert, boost-throw-exception, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/qvm Description: Boost qvm module diff --git a/ports/boost-qvm/portfile.cmake b/ports/boost-qvm/portfile.cmake index 478fda446e6eb9..575c8f80c1ca2c 100644 --- a/ports/boost-qvm/portfile.cmake +++ b/ports/boost-qvm/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/qvm - REF boost-1.72.0 - SHA512 8609b636d27934c6bc9eb7fc1123a3f231f60055348fbfe542ce6507c29e511364b1ea3b5a21cb2a57576e489f724221663ecdcdf09e0a9e6c739d80d83aaed7 + REF boost-1.73.0 + SHA512 c604bbabaae2edbc3a7a4fd86b7ae3698d3a69252d3e50c6c9f883e07e3639b0679a3c1ec6af07aaa34ae8e1d7ec2da3cac02a01ec9ba9b36b11e1738a149f45 HEAD_REF master ) diff --git a/ports/boost-random/CONTROL b/ports/boost-random/CONTROL index a6c202b48be776..f0d942eaf32da0 100644 --- a/ports/boost-random/CONTROL +++ b/ports/boost-random/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-random -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-dynamic-bitset, boost-integer, boost-io, boost-math, boost-modular-build-helper, boost-mpl, boost-multiprecision, boost-range, boost-static-assert, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/random Description: Boost random module diff --git a/ports/boost-random/portfile.cmake b/ports/boost-random/portfile.cmake index 68b52d0a33b3f7..eb7faf16490f5c 100644 --- a/ports/boost-random/portfile.cmake +++ b/ports/boost-random/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/random - REF boost-1.72.0 - SHA512 825f74d302fb5aa6b1380cc767857c489c3f758c9553d5adecfdac399ec672f69a01de7071f138ef7ac0ae1aeeef7adbbded73e3def12f960ef248118bebf10f + REF boost-1.73.0 + SHA512 ec6a1ea0bbc989f646f59b41286f578554b9c8c02489b3eca8af8affb3882ce4649a64403cef876f7b74b1b7cc3c64e57692634e0c75eb3c2a2a2811986d2bf8 HEAD_REF master ) diff --git a/ports/boost-range/CONTROL b/ports/boost-range/CONTROL index a62de18fa368a9..e422cf76333c78 100644 --- a/ports/boost-range/CONTROL +++ b/ports/boost-range/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-range -Version: 1.72.0 -Build-Depends: boost-array, boost-assert, boost-concept-check, boost-config, boost-container-hash, boost-core, boost-detail, boost-integer, boost-iterator, boost-mpl, boost-optional, boost-preprocessor, boost-regex, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-array, boost-assert, boost-concept-check, boost-config, boost-container-hash, boost-conversion, boost-core, boost-detail, boost-integer, boost-iterator, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-regex, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/range Description: Boost range module diff --git a/ports/boost-range/portfile.cmake b/ports/boost-range/portfile.cmake index cd3af2323c3efb..b75b6193c4abe2 100644 --- a/ports/boost-range/portfile.cmake +++ b/ports/boost-range/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/range - REF boost-1.72.0 - SHA512 6f815133807bca94c57b3013060bd7d5a23a7f06255fcc1dec4a11dc3b9611c9962aae80029583c2b0ff0aa31a2e195ce8c781d956d8d1a16db2320a60edefa6 + REF boost-1.73.0 + SHA512 39f5358b50f65df6e8fe69e940bf22e149e1ad1810d9b982918f812f73568e4dd001f3ce04ce248f2c472801efe5cf667f6342b01e01f64c726107ee1a143c7e HEAD_REF master ) diff --git a/ports/boost-ratio/CONTROL b/ports/boost-ratio/CONTROL index 32b39a37a0a8e2..944b8ad2e81a5c 100644 --- a/ports/boost-ratio/CONTROL +++ b/ports/boost-ratio/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-ratio -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-integer, boost-mpl, boost-rational, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/ratio Description: Boost ratio module diff --git a/ports/boost-ratio/portfile.cmake b/ports/boost-ratio/portfile.cmake index 39941a2f152403..448611029d0bbb 100644 --- a/ports/boost-ratio/portfile.cmake +++ b/ports/boost-ratio/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/ratio - REF boost-1.72.0 - SHA512 2f2b288c6288801f59a3c966fbcd7cd9c300566eb96d1a536ba4986fc570c8e5c98396948a8dbfc2efaba7f55840bf70809d0d5ef5fed424076c6427d6d95965 + REF boost-1.73.0 + SHA512 8e3b203d120447c346b25272da821e8579e39427f5f6d66442ed10d0741c3fa80c4fc9b97a96cf15a22261d43a66ccc9700c390e34bda2ed3ae880c2ea7d04e3 HEAD_REF master ) diff --git a/ports/boost-rational/CONTROL b/ports/boost-rational/CONTROL index 6240c08ea507e7..ea951f57707b3b 100644 --- a/ports/boost-rational/CONTROL +++ b/ports/boost-rational/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-rational -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-integer, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/rational Description: Boost rational module diff --git a/ports/boost-rational/portfile.cmake b/ports/boost-rational/portfile.cmake index 3ae45c25cc2716..5b8b093cfc9cd2 100644 --- a/ports/boost-rational/portfile.cmake +++ b/ports/boost-rational/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/rational - REF boost-1.72.0 - SHA512 971c52ccc78e21f7fcbc87e7eb5f4097dfe855aebb09c940aae5997dc7b420a652166374980d8218ad9daa8e81ffb81102968ea0281e80b5a65ae9d86c1087db + REF boost-1.73.0 + SHA512 4682947e78f2812346a299c561e36582540c8920801b120656883cc9f2d31654efdebe8698ce38c00637a38db761e85015806c0d6e6b1dad51419b047de5157b HEAD_REF master ) diff --git a/ports/boost-regex/CONTROL b/ports/boost-regex/CONTROL index d3acd2daa875f2..16d9feafcd234a 100644 --- a/ports/boost-regex/CONTROL +++ b/ports/boost-regex/CONTROL @@ -1,10 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-regex -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-container-hash, boost-core, boost-detail, boost-integer, boost-iterator, boost-modular-build-helper, boost-mpl, boost-predef, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/regex Description: Boost regex module Feature: icu -Description: ICU backend for Boost.Regex Build-Depends: icu +Description: ICU backend for Boost.Regex diff --git a/ports/boost-regex/b2-options.cmake b/ports/boost-regex/b2-options.cmake new file mode 100644 index 00000000000000..2ab54b7d946b56 --- /dev/null +++ b/ports/boost-regex/b2-options.cmake @@ -0,0 +1,3 @@ +if("icu" IN_LIST FEATURES) + set(B2_REQUIREMENTS "/user-config//icuuc /user-config//icudt /user-config//icuin BOOST_HAS_ICU=1") +endif() diff --git a/ports/boost-regex/portfile.cmake b/ports/boost-regex/portfile.cmake index adb7f05b510616..7ef90f0f03ec15 100644 --- a/ports/boost-regex/portfile.cmake +++ b/ports/boost-regex/portfile.cmake @@ -1,22 +1,17 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/regex - REF boost-1.72.0 - SHA512 a5026e5c992698d6a41baee9e64ee3751eafc6aeba9aa79b90b62e5806185d0c230a08aaceaa89929c8fd0c3f36c1f1c54a9b9734eff3c11a34a4c9d1684a193 + REF boost-1.73.0 + SHA512 4ff9559b925a4901bc98762ed0fa21fe19f27bdf3c49932285bac830d52ddcb0d3e3d3197581b655bc0ed720916d9d2242ace4567cc4d457d0eafdd822114418 HEAD_REF master ) -if("icu" IN_LIST FEATURES) - set(REQUIREMENTS "/user-config//icuuc /user-config//icudt /user-config//icuin BOOST_HAS_ICU=1") -else() - set(REQUIREMENTS) -endif() - include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) -boost_modular_build(SOURCE_PATH ${SOURCE_PATH} REQUIREMENTS "${REQUIREMENTS}") +boost_modular_build( + SOURCE_PATH ${SOURCE_PATH} + BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" +) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/boost-safe-numerics/CONTROL b/ports/boost-safe-numerics/CONTROL index 0ebda1fe915ac4..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.72.0 -Build-Depends: boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers +Version: 1.73.0 +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-safe-numerics/portfile.cmake b/ports/boost-safe-numerics/portfile.cmake index e55a7f44f294b1..79138569fd7881 100644 --- a/ports/boost-safe-numerics/portfile.cmake +++ b/ports/boost-safe-numerics/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/safe_numerics - REF boost-1.72.0 - SHA512 db76e87bbde2333e1c42181ce03f226013f2ee5a732d974a07ff364fc402956962dc6bfec2a67f5d2748fe057c00c19231d34a0e576042d572c501e2af284c6e + REF boost-1.73.0 + SHA512 1046d8f8a69137d260dc57dc183c1761dbfcf89479ef4e7112d91de82ff858e57f919db35729a648f972d946bfeaa3d8a9f80f85a9544d1a4b144f8c888a2ef8 HEAD_REF master ) diff --git a/ports/boost-scope-exit/CONTROL b/ports/boost-scope-exit/CONTROL index ed06dded0a8b0a..3ce5556848b18f 100644 --- a/ports/boost-scope-exit/CONTROL +++ b/ports/boost-scope-exit/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-scope-exit -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-detail, boost-function, boost-preprocessor, boost-typeof, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/scope_exit Description: Boost scope_exit module diff --git a/ports/boost-scope-exit/portfile.cmake b/ports/boost-scope-exit/portfile.cmake index f6bc41000c24f4..6939227ba393bc 100644 --- a/ports/boost-scope-exit/portfile.cmake +++ b/ports/boost-scope-exit/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/scope_exit - REF boost-1.72.0 - SHA512 8837579911066863209efe739019993335f2ab1d40da42215016c63fe82aabdb9247d525633508f33e9547977807a388e0ff613210fb463bb8cd3fc9fc6132a5 + REF boost-1.73.0 + SHA512 ede97c68a1132fb20d410fa1700c8e7bf32b1a3821d24cc6829886fa2523ec5cc32ea4287902d9a3dda5aae34acf87030341a228677d558837dd864dd0f4dcc3 HEAD_REF master ) diff --git a/ports/boost-serialization/CONTROL b/ports/boost-serialization/CONTROL index 8fcca872327806..98643d815a173c 100644 --- a/ports/boost-serialization/CONTROL +++ b/ports/boost-serialization/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-serialization -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-array, boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-move, boost-mpl, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-spirit, boost-static-assert, boost-type-traits, boost-unordered, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/serialization Description: Boost serialization module diff --git a/ports/boost-serialization/portfile.cmake b/ports/boost-serialization/portfile.cmake index c2ad392348c4ef..c25fc4fc9b9da5 100644 --- a/ports/boost-serialization/portfile.cmake +++ b/ports/boost-serialization/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/serialization - REF boost-1.72.0 - SHA512 669297c64481721a16e679783cda319a375d18df9fb922fcb324060f08bdaa25a0713416005bfc6012d01a0f9523989732a3f213037a094c9626352a2ce40b6d + REF boost-1.73.0 + SHA512 eb190ec91cfaa0de8a1060bf45f6dc6480e8a3844d59123722f1e8900cfda3080c919a542d3c4322ed4a6147acd5240d789e6d38f653507af61fedd77000c10f HEAD_REF master ) diff --git a/ports/boost-signals2/CONTROL b/ports/boost-signals2/CONTROL index 167851591a0a27..0b14606f5fe74f 100644 --- a/ports/boost-signals2/CONTROL +++ b/ports/boost-signals2/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-signals2 -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-config, boost-core, boost-detail, boost-function, boost-iterator, boost-mpl, boost-optional, boost-parameter, boost-predef, boost-preprocessor, boost-smart-ptr, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/signals2 Description: Boost signals2 module diff --git a/ports/boost-signals2/portfile.cmake b/ports/boost-signals2/portfile.cmake index bbfb5440558cc2..cc6d34b0b551a6 100644 --- a/ports/boost-signals2/portfile.cmake +++ b/ports/boost-signals2/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/signals2 - REF boost-1.72.0 - SHA512 11305c225d184f1b3da1530c06493c2a65362f26c35938cbc3f6685500e7ee9c1abfcab4f5de161b33900e3bc102300d1fb80c2e68dac69b10fdcd25b3742124 + REF boost-1.73.0 + SHA512 a725caf89733b9180360d3d04747f8ef7fd68e5862814545a49f2bf1f2b262df77c4fa64b2434a876cb333be13916c8d2ec4e3a01bf877f0220240801fd87543 HEAD_REF master ) diff --git a/ports/boost-smart-ptr/CONTROL b/ports/boost-smart-ptr/CONTROL index d62deedc5c1f1d..9432dbd8d18a16 100644 --- a/ports/boost-smart-ptr/CONTROL +++ b/ports/boost-smart-ptr/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-smart-ptr -Version: 1.72.0 -Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-integer, boost-move, boost-predef, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-assert, boost-config, boost-core, boost-integer, boost-move, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/smart_ptr Description: Boost smart_ptr module diff --git a/ports/boost-smart-ptr/portfile.cmake b/ports/boost-smart-ptr/portfile.cmake index 11c8c0df8b03c3..4403d246c3fb73 100644 --- a/ports/boost-smart-ptr/portfile.cmake +++ b/ports/boost-smart-ptr/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/smart_ptr - REF boost-1.72.0 - SHA512 c42b9179c596fe063be2416c7f0617cc2bfaf9719215d826de501f36f61a754a79898a0af7d1ce5286364a4f3ab153a85b8ada134f9feda959c7281d21ee4e09 + REF boost-1.73.0 + SHA512 af5c90fc24e92055afd47b35d5ea30712f76347843eeafd934801fc06a0563feddefc3989b086d86d9935e02c33f2ad00af84d726b2c91f70d5f170642c589cf HEAD_REF master ) diff --git a/ports/boost-sort/CONTROL b/ports/boost-sort/CONTROL index 6f9121c853e5f3..e03f5a2e2f8063 100644 --- a/ports/boost-sort/CONTROL +++ b/ports/boost-sort/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-sort -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-integer, boost-range, boost-serialization, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/sort Description: Boost sort module diff --git a/ports/boost-sort/portfile.cmake b/ports/boost-sort/portfile.cmake index 4a74f3cdb9089c..7deff366b41cec 100644 --- a/ports/boost-sort/portfile.cmake +++ b/ports/boost-sort/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/sort - REF boost-1.72.0 - SHA512 79b26b004c01fd10443f07692913d13a3e38fb70f7efa46ba2d1f41e11ea474a4abeb4c0c5d0df70fa15a4f2f028b8b7e2a33e0c331b3bcbf11f7bf1a4a808d0 + REF boost-1.73.0 + SHA512 7a771fc0f49815b7df4213a92ed2a0ca6897523ebe28a5d00608949c94839ce167e9c8220f227b3dbbd04f300d915cc53a1501fcfb0f7ca9c7dc7fd2f3b26b1e HEAD_REF master ) diff --git a/ports/boost-spirit/CONTROL b/ports/boost-spirit/CONTROL index 5322241abf826e..b7fef0c183166d 100644 --- a/ports/boost-spirit/CONTROL +++ b/ports/boost-spirit/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-spirit -Version: 1.72.0 -Build-Depends: boost-algorithm, boost-array, boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-endian, boost-filesystem (!uwp), boost-foreach, boost-function, boost-function-types, boost-fusion, boost-integer, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lexical-cast, boost-locale (!uwp), boost-math, boost-move, boost-mpl, boost-optional, boost-phoenix, boost-pool, boost-predef, boost-preprocessor, boost-proto, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-thread, boost-throw-exception, boost-tti, boost-typeof, boost-type-traits, boost-unordered, boost-utility, boost-variant, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-array, boost-assert, boost-compatibility, boost-config, boost-core, boost-detail, boost-endian, boost-filesystem (!uwp), boost-foreach, boost-function, boost-function-types, boost-fusion, boost-integer, boost-io, boost-iostreams (!uwp), boost-iterator, boost-locale (!uwp), boost-math, boost-move, boost-mpl, boost-optional, boost-phoenix, boost-pool, boost-preprocessor, boost-proto, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-thread, boost-throw-exception, boost-typeof, boost-type-traits, boost-unordered, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/spirit Description: Boost spirit module diff --git a/ports/boost-spirit/portfile.cmake b/ports/boost-spirit/portfile.cmake index 2a6e9c1a8833f2..587cef8dc5b226 100644 --- a/ports/boost-spirit/portfile.cmake +++ b/ports/boost-spirit/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/spirit - REF boost-1.72.0 - SHA512 1454a5e11426af7fb8ab25fc7ae65ff05bd4d4e2aa58fe126666fcbd0dd9ad48b1a23a8530f46bd2d2fba35424d0817f4e00cde96018880479f4093a7a26c866 + REF boost-1.73.0 + SHA512 8080ebc70e590b98ffda162dcb36c45e2d0b654455f389ccb92643e9410915ec1a36c1c24fbd903d28832f965f3df22a08c56566d4a4023bb9feca1c9d548227 HEAD_REF master ) diff --git a/ports/boost-stacktrace/CONTROL b/ports/boost-stacktrace/CONTROL index 4c4e64d2f436c4..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.72.0 +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-stacktrace/portfile.cmake b/ports/boost-stacktrace/portfile.cmake index 0d10f00f2f2a3e..6d55d293f65d6c 100644 --- a/ports/boost-stacktrace/portfile.cmake +++ b/ports/boost-stacktrace/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/stacktrace - REF boost-1.72.0 - SHA512 91659618fbe49b1706b6adda865bcd733cfedae0b70849ca2c436412644b369a76b60df46160b5e7092a5f086c0c051459d8f9ca104e64469711b536805b4a0e + REF boost-1.73.0 + SHA512 9d42d9aa57ed12b8f2004d576a77f63ebf8b8f620c2ca319a77d75a55376a4fbbc360413ae25bbfeb63071abcaeabb3fc58031ca1103acce212de4cc35d1652d HEAD_REF master ) diff --git a/ports/boost-statechart/CONTROL b/ports/boost-statechart/CONTROL index 9368b6b9e1ec14..7a670909eacaab 100644 --- a/ports/boost-statechart/CONTROL +++ b/ports/boost-statechart/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-statechart -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-config, boost-conversion, boost-core, boost-detail, boost-function, boost-mpl, boost-smart-ptr, boost-static-assert, boost-thread, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/statechart Description: Boost statechart module diff --git a/ports/boost-statechart/portfile.cmake b/ports/boost-statechart/portfile.cmake index 711058d634fefd..ed0753f213e78f 100644 --- a/ports/boost-statechart/portfile.cmake +++ b/ports/boost-statechart/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/statechart - REF boost-1.72.0 - SHA512 a0ad4bb97f23df477ba7852927a3bbc5a1877f6adcb784fc384c9c0d816cdd87eecc9dad4a7cf16433c81df8914858eb6eaae9456f69c763876e9cfc8700b609 + REF boost-1.73.0 + SHA512 911a4fc91281506b8d002bc965e547a2a7a2e2ecbcb9241cad2eee7aa59b35738061c68d82e0dc7f9ee0a44941f2c3ac264582769068a7804a3b9b00745b9255 HEAD_REF master ) diff --git a/ports/boost-static-assert/CONTROL b/ports/boost-static-assert/CONTROL index 5d726a3f362e44..94b4db7db8ad54 100644 --- a/ports/boost-static-assert/CONTROL +++ b/ports/boost-static-assert/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-static-assert -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-detail, boost-vcpkg-helpers Homepage: https://github.com/boostorg/static_assert Description: Boost static_assert module diff --git a/ports/boost-static-assert/portfile.cmake b/ports/boost-static-assert/portfile.cmake index f99310d63c80b0..8df72cb32c81b7 100644 --- a/ports/boost-static-assert/portfile.cmake +++ b/ports/boost-static-assert/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/static_assert - REF boost-1.72.0 - SHA512 7d1b70b6dcf34f661987180a2b4ae2662729f503761c4897e1f1b2869da7042f9102acfc8a95a8351dff0ebad5b1aea69be049f168aea3525db8cfab442fcdfa + REF boost-1.73.0 + SHA512 5087a93e277c4b40c61182add7daa9891adab992a3b06f3e587772565f4a59b9b0a0163d11278d10f8e58e7b73340386644e91fd86522e0d7dc14ee295801978 HEAD_REF master ) diff --git a/ports/boost-static-string/CONTROL b/ports/boost-static-string/CONTROL new file mode 100644 index 00000000000000..189847e5278c04 --- /dev/null +++ b/ports/boost-static-string/CONTROL @@ -0,0 +1,6 @@ +# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 +Source: boost-static-string +Version: 1.73.0 +Build-Depends: boost-assert, boost-container-hash, boost-static-assert, boost-throw-exception, boost-utility, boost-vcpkg-helpers +Homepage: https://github.com/boostorg/static_string +Description: Boost static_string module diff --git a/ports/boost-disjoint-sets/portfile.cmake b/ports/boost-static-string/portfile.cmake similarity index 53% rename from ports/boost-disjoint-sets/portfile.cmake rename to ports/boost-static-string/portfile.cmake index a87d37e9a288cb..9582647c36f31e 100644 --- a/ports/boost-disjoint-sets/portfile.cmake +++ b/ports/boost-static-string/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO boostorg/disjoint_sets - REF boost-1.72.0 - SHA512 aa48fed3cd909fbe9362e8173639c9ad9f3a0cce1809a7db12f8eaafaddb5bb1c295aa74ea0dc87d1fff1576587d7cfd3ddf7c8c7e475182d88397a56608df6a + REPO boostorg/static_string + REF boost-1.73.0 + SHA512 b929dcbacebe9e754acb12a823078f79c5969636e208d7f050f8f80783f6fa86e57ae5591c0d424cd72438d26453d1f9337fbb3d5805185f244f17235ef36016 HEAD_REF master ) diff --git a/ports/boost-system/CONTROL b/ports/boost-system/CONTROL index 7be055962d99c9..65ab14b2a44271 100644 --- a/ports/boost-system/CONTROL +++ b/ports/boost-system/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-system -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-build, boost-config, boost-integer, boost-modular-build-helper, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/system Description: Boost system module diff --git a/ports/boost-system/portfile.cmake b/ports/boost-system/portfile.cmake index 03f739a7a77fbe..de154b860b6419 100644 --- a/ports/boost-system/portfile.cmake +++ b/ports/boost-system/portfile.cmake @@ -1,14 +1,12 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/system - REF boost-1.72.0 - SHA512 b406d6f618feca96c098a053765b9f9b26fa4361e57bb6069eff9b379a758361be8010b479e8fdc21cbbad70f5918991ff07ffb730443c1e993c122a86107766 + REF boost-1.73.0 + SHA512 dd295f0388991b4957187e899d28bfa49a867b0887a3941784bf22fa01cb2028fbf453e341f1641260f6d360500f324ff8b43b92a0e15d876f45c28b415fdd86 HEAD_REF master ) diff --git a/ports/boost-test/CONTROL b/ports/boost-test/CONTROL index e15fdb300d7234..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.72.0 +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-test/portfile.cmake b/ports/boost-test/portfile.cmake index 2864d8ffb7dfcd..2a15e57f2fad1f 100644 --- a/ports/boost-test/portfile.cmake +++ b/ports/boost-test/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/test - REF boost-1.72.0 - SHA512 3718942ae0e6e2a490723cfbd80b9d471f9798b8acb27b91b6581c6eada507b7f48c4725d1cfa693a101d80063dcf36cf7d007f631f1bf0033e69d15edc3c4eb + REF boost-1.73.0 + SHA512 153c58b1f94e85efd2c0c0561f9701ff69006936659eb8f2f416399c57ab6b7eca6ea70ba74c7837789eef13dccdfeb6dab641d65f1af94effd6ff831b31c53c HEAD_REF master ) diff --git a/ports/boost-thread/CONTROL b/ports/boost-thread/CONTROL index 0f85b5c7fee801..634ab045d69270 100644 --- a/ports/boost-thread/CONTROL +++ b/ports/boost-thread/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-thread -Version: 1.72.0 -Build-Depends: boost-algorithm, boost-assert, boost-atomic, boost-bind, boost-build, boost-chrono, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-core, boost-date-time, boost-detail, boost-exception, boost-function, boost-integer, boost-intrusive, boost-io, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-move, boost-mpl, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-system, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi +Version: 1.73.0 +Build-Depends: boost-algorithm, boost-assert, boost-atomic, boost-bind, boost-build, boost-chrono, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-core, boost-date-time, boost-detail, boost-exception, boost-function, boost-integer, boost-intrusive, boost-io, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-move, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-system, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/thread Description: Boost thread module diff --git a/ports/boost-thread/b2-options.cmake b/ports/boost-thread/b2-options.cmake index 07acc10b5c1f0e..198b23084e16ce 100644 --- a/ports/boost-thread/b2-options.cmake +++ b/ports/boost-thread/b2-options.cmake @@ -1 +1,2 @@ +set(B2_REQUIREMENTS "/boost/date_time//boost_date_time") list(APPEND B2_OPTIONS /boost/thread//boost_thread) diff --git a/ports/boost-thread/portfile.cmake b/ports/boost-thread/portfile.cmake index 34c523bb7698ff..de74f48d6d6005 100644 --- a/ports/boost-thread/portfile.cmake +++ b/ports/boost-thread/portfile.cmake @@ -1,21 +1,17 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/thread - REF boost-1.72.0 - SHA512 2a149952bea4bf58b571de69fd81f9b0fbded75c762883f8611e9478ac853d9ba229f8fbb2168b8194f897465e77fd06bdcf75b140ad5d64defdadaccf56ce5a + REF boost-1.73.0 + SHA512 732bf64b0c5ea8db327a429ba470e620ec0a8771e3fdaba9baf7080d0f4eb93f718813b7062881d3971bdf2b9254b460f82175d3f9fbd453a29153f87caa6c58 HEAD_REF master ) include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) boost_modular_build( SOURCE_PATH ${SOURCE_PATH} - REQUIREMENTS "/boost/date_time//boost_date_time" - OPTIONS /boost/thread//boost_thread - BOOST_CMAKE_FRAGMENT ${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake + BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/boost-throw-exception/CONTROL b/ports/boost-throw-exception/CONTROL index 7ece73b1e2b09d..3f4d632c7ac300 100644 --- a/ports/boost-throw-exception/CONTROL +++ b/ports/boost-throw-exception/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-throw-exception -Version: 1.72.0 -Build-Depends: boost-config, boost-detail, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-assert, boost-config, boost-vcpkg-helpers Homepage: https://github.com/boostorg/throw_exception Description: Boost throw_exception module diff --git a/ports/boost-throw-exception/portfile.cmake b/ports/boost-throw-exception/portfile.cmake index 86a553943aaab9..51f819711d3a65 100644 --- a/ports/boost-throw-exception/portfile.cmake +++ b/ports/boost-throw-exception/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/throw_exception - REF boost-1.72.0 - SHA512 89df12b58fe10ec042ac91de21568f99463107291eed8e52810f5e220972b5ad5f7b4e9937455f8dfd60b0f68bae9e3e55c2213ba0586085b32642fa9dc02694 + REF boost-1.73.0 + SHA512 3188f7ce95a14aa791ce75914d5c03efb09f2138b694de93ce42eb54492c9f4b2fb8f98d8fe9944a60902f67949de5da741f7b3979617ad7e26d5f505d96274d HEAD_REF master ) diff --git a/ports/boost-timer/CONTROL b/ports/boost-timer/CONTROL index bfaa7f1c4ef164..063f50f1e16dd1 100644 --- a/ports/boost-timer/CONTROL +++ b/ports/boost-timer/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-timer -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-build, boost-chrono, boost-compatibility, boost-config, boost-core, boost-integer, boost-io, boost-modular-build-helper, boost-predef, boost-system, boost-throw-exception, boost-vcpkg-helpers Homepage: https://github.com/boostorg/timer Description: Boost timer module diff --git a/ports/boost-timer/portfile.cmake b/ports/boost-timer/portfile.cmake index afe2e23e2d10eb..ee109b9aa2027d 100644 --- a/ports/boost-timer/portfile.cmake +++ b/ports/boost-timer/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/timer - REF boost-1.72.0 - SHA512 e1ea0df4be43d68ed830a5ab9148af834328bd65457d40bb6449eab03768e7db165faa891f7e19d83ca330fc5160f21ab8299665056d46ab6cc8c8b017288919 + REF boost-1.73.0 + SHA512 4449b93cb45e861348e071b90fec68e08ec9abe2628709db494904a52ac33f5bdc02306cc501f5ac8b7c561de3a656979002ba5c0c4b862e393f1fc77ebc5f28 HEAD_REF master ) diff --git a/ports/boost-tokenizer/CONTROL b/ports/boost-tokenizer/CONTROL index 694267680603ef..e487b3d05cc9ee 100644 --- a/ports/boost-tokenizer/CONTROL +++ b/ports/boost-tokenizer/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-tokenizer -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-detail, boost-iterator, boost-mpl, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/tokenizer Description: Boost tokenizer module diff --git a/ports/boost-tokenizer/portfile.cmake b/ports/boost-tokenizer/portfile.cmake index 60f834d0a9ca6d..505c613bf52f1e 100644 --- a/ports/boost-tokenizer/portfile.cmake +++ b/ports/boost-tokenizer/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/tokenizer - REF boost-1.72.0 - SHA512 863c9a6382dd256f44060ff6b477b2a2c003f943b127961be3c24a05d18cf1c797a22649f478604b402009813606be7f1a9b25259ac1704cdd2d3ffeeb20237a + REF boost-1.73.0 + SHA512 cef77b4fb338dfefac3dc0f7eeef99acc07dc7ae66795697f10b8ad595bec93ad5f3f0fe0c802651415ae2620856f6e3bbf1b0ed28dac9baa7685c2a98d581e4 HEAD_REF master ) diff --git a/ports/boost-tti/CONTROL b/ports/boost-tti/CONTROL index b3d0ea4334c43e..9bdc4671ae9a1c 100644 --- a/ports/boost-tti/CONTROL +++ b/ports/boost-tti/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-tti -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-detail, boost-function-types, boost-mpl, boost-preprocessor, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/tti Description: Boost tti module diff --git a/ports/boost-tti/portfile.cmake b/ports/boost-tti/portfile.cmake index 0dee17ad64a450..4e0a8c1ae5d4bf 100644 --- a/ports/boost-tti/portfile.cmake +++ b/ports/boost-tti/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/tti - REF boost-1.72.0 - SHA512 ee68bc34266f44f597fcefb4485732f2790b81a7fe93a35fb5ad9c4bc23b1801503f8985508b3c3ddeaa64099ed046ea89f12c150e093e5925d72f78b001bb25 + REF boost-1.73.0 + SHA512 3f478dfa89102fcaa316fca0ad1d514a0dcc9408c48e4182d788949b13f318b237de53d41f1ba843c892522023d5d8efda8ae446672389d84f27d5d150a98ef7 HEAD_REF master ) diff --git a/ports/boost-tuple/CONTROL b/ports/boost-tuple/CONTROL index fd3afd27fad53f..840cbe2c145831 100644 --- a/ports/boost-tuple/CONTROL +++ b/ports/boost-tuple/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-tuple -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-core, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/tuple Description: Boost tuple module diff --git a/ports/boost-tuple/portfile.cmake b/ports/boost-tuple/portfile.cmake index 3a42dd724e8e44..965b17245107b9 100644 --- a/ports/boost-tuple/portfile.cmake +++ b/ports/boost-tuple/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/tuple - REF boost-1.72.0 - SHA512 fd330e0796021bc4f358ab57cacf9feb47a729d15bb4ca86e97b87d6ba605ff118f56d53ae1ed1c230045dd1b04110be6705ea969ca94cd956947282ed199131 + REF boost-1.73.0 + SHA512 2c49dacacc6b59a3cf4d35987700901f33f705e0bff323ae86a1b629a7d2d9cb366adfc08cc3c7eafd28b819938bc14cc4887e7b60c1448c369ecfe795ed1600 HEAD_REF master ) diff --git a/ports/boost-type-erasure/CONTROL b/ports/boost-type-erasure/CONTROL index b1a918ffb2ae00..40a10f2422a65e 100644 --- a/ports/boost-type-erasure/CONTROL +++ b/ports/boost-type-erasure/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-type-erasure -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-fusion, boost-iterator, boost-modular-build-helper, boost-mp11, boost-mpl, boost-preprocessor, boost-smart-ptr, boost-thread, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-vmd Homepage: https://github.com/boostorg/type_erasure Description: Boost type_erasure module diff --git a/ports/boost-type-erasure/portfile.cmake b/ports/boost-type-erasure/portfile.cmake index 7f997408014052..3e427b1112399e 100644 --- a/ports/boost-type-erasure/portfile.cmake +++ b/ports/boost-type-erasure/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/type_erasure - REF boost-1.72.0 - SHA512 cf1a239a53265eb028beccf625b6917fb7918324cfa92ddffa460e246eb99df61be5ef3fc3f5303d013acd971efe4b28c504661d79f2bcd564c2470a715dae52 + REF boost-1.73.0 + SHA512 69026dc42bbbf64378a3ca51e5493978dfc596fda21c7e246424ca9b914c3cb61cd49bbe85bbb04b32cd4bc8826052b212c267f2882195ecf22bb2dc1ea77be7 HEAD_REF master ) diff --git a/ports/boost-type-index/CONTROL b/ports/boost-type-index/CONTROL index 0d3c2fd38152a6..4b819a5411d04c 100644 --- a/ports/boost-type-index/CONTROL +++ b/ports/boost-type-index/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-type-index -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-container-hash, boost-core, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/type_index Description: Boost type_index module diff --git a/ports/boost-type-index/portfile.cmake b/ports/boost-type-index/portfile.cmake index b84119cbfda938..0d5f780b54d0cd 100644 --- a/ports/boost-type-index/portfile.cmake +++ b/ports/boost-type-index/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/type_index - REF boost-1.72.0 - SHA512 f7c3a78d5114fb4f8752a11b798f6826fda79345fad679b945240a0552358659cd83fb2182d5fbb6892bf971c2125bb4b7f527d05e3f6a17cb5521b1bfb280b7 + REF boost-1.73.0 + SHA512 154336bc6c6c3161e5aeda10eb5bdf33dd543ba80c890cbad58ba9957c36766d7721c9c9f56b705806e2212687ed95ec8fdfe7b9585239d08916f80ab895b696 HEAD_REF master ) diff --git a/ports/boost-type-traits/CONTROL b/ports/boost-type-traits/CONTROL index 74c0f636c57de1..fcfe066d77510d 100644 --- a/ports/boost-type-traits/CONTROL +++ b/ports/boost-type-traits/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-type-traits -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-detail, boost-static-assert, boost-vcpkg-helpers Homepage: https://github.com/boostorg/type_traits Description: Boost type_traits module diff --git a/ports/boost-type-traits/portfile.cmake b/ports/boost-type-traits/portfile.cmake index 0dd03588c364ec..198906601e0913 100644 --- a/ports/boost-type-traits/portfile.cmake +++ b/ports/boost-type-traits/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/type_traits - REF boost-1.72.0 - SHA512 6f9959b53b2cc60539f065256e7efd78c8dad89d73803cea17bec82559f1045d069a6762a0665b5813ef397d3cf516b8897e2ea7be6177c5828f6d867869f367 + REF boost-1.73.0 + SHA512 30a2c147c24f2fb94fafde5b359f0b71636a3b33067791f303bd51acb844c81787899ee177e68dffab23af89b578ba0b8dc778faff257075aafc72ca7e2b07c1 HEAD_REF master ) diff --git a/ports/boost-typeof/CONTROL b/ports/boost-typeof/CONTROL index 39c32cae11041c..e19994067390a7 100644 --- a/ports/boost-typeof/CONTROL +++ b/ports/boost-typeof/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-typeof -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-preprocessor, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/typeof Description: Boost typeof module diff --git a/ports/boost-typeof/portfile.cmake b/ports/boost-typeof/portfile.cmake index b0e9a723acba3a..ddb292ac910223 100644 --- a/ports/boost-typeof/portfile.cmake +++ b/ports/boost-typeof/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/typeof - REF boost-1.72.0 - SHA512 21001375757411fdab8bde9abbdc96895db51746cba3f50b9c65f5142f248f90d8b93d9df3c734030c03469cbfb871f6f1a54ee354168034ee58ea5c39d31f41 + REF boost-1.73.0 + SHA512 c5f113eeadf779f496870bb99d379d6659b3b0a89d184dc4711063686909391ce85bd96b87c5c05f7e60d05a73853318204851d37f5ea05d339a0ab9a7a6910f HEAD_REF master ) diff --git a/ports/boost-ublas/CONTROL b/ports/boost-ublas/CONTROL index c34374843c3f2f..8d8d071b8f8ac8 100644 --- a/ports/boost-ublas/CONTROL +++ b/ports/boost-ublas/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-ublas -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-compute, boost-concept-check, boost-config, boost-core, boost-iterator, boost-mpl, boost-range, boost-serialization, boost-smart-ptr, boost-static-assert, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/ublas Description: Boost ublas module diff --git a/ports/boost-ublas/portfile.cmake b/ports/boost-ublas/portfile.cmake index 403d6fd69be20c..81afb95eece754 100644 --- a/ports/boost-ublas/portfile.cmake +++ b/ports/boost-ublas/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/ublas - REF boost-1.72.0 - SHA512 08419b9e3c0ee29a59080a0c901fcc80265c6bd5c1f2bebd2f2c54609e276fe0da2429fa1dc3b5f42bead8ab55cea1e41fd86b74f05b7ce4ee12fa507e5e6240 + REF boost-1.73.0 + SHA512 5d007facbdf6188e9e712bf016955792fff7d528fc68e9708574d1d4c9818e250aecbc1bd42eced85c2a580f29d9d87bd35cbed4d9cfe50d18cd1377b723db29 HEAD_REF master ) diff --git a/ports/boost-units/CONTROL b/ports/boost-units/CONTROL index 4a8061a36e7b2b..6ef9d9685421e4 100644 --- a/ports/boost-units/CONTROL +++ b/ports/boost-units/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-units -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-config, boost-core, boost-integer, boost-io, boost-lambda, boost-math, boost-mpl, boost-preprocessor, boost-serialization, boost-static-assert, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/units Description: Boost units module diff --git a/ports/boost-units/portfile.cmake b/ports/boost-units/portfile.cmake index 802b8df8ee2c1f..ee16b7fb5c0b76 100644 --- a/ports/boost-units/portfile.cmake +++ b/ports/boost-units/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/units - REF boost-1.72.0 - SHA512 c8cc0df4e71f31e8491a771db42d7ba236e27185a9de511d43be9e490c6a0b9b91e19c9dca256f11071f60ebee3e6cb7ffa12af019c449cde5bbced86673ff0a + REF boost-1.73.0 + SHA512 8137a82f4fdc3b204cc2879b2fc929b5c6937235bc3cdcda6419e84cc0b69ac523e6d18024c00bbff643a1f8561db4a46c00d3247314ad229c2b30f16676bc82 HEAD_REF master ) diff --git a/ports/boost-unordered/CONTROL b/ports/boost-unordered/CONTROL index 41402f9a6c1aac..18a671b10cf730 100644 --- a/ports/boost-unordered/CONTROL +++ b/ports/boost-unordered/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-unordered -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container, boost-container-hash, boost-core, boost-detail, boost-functional, boost-move, boost-predef, boost-preprocessor, boost-smart-ptr, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/unordered Description: Boost unordered module diff --git a/ports/boost-unordered/portfile.cmake b/ports/boost-unordered/portfile.cmake index 64424e0bab00b6..f1feb4663e018b 100644 --- a/ports/boost-unordered/portfile.cmake +++ b/ports/boost-unordered/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/unordered - REF boost-1.72.0 - SHA512 ad41c43e5eb82a57b3d2b21aa794a84c6241c7e3078eb6cd331910c6402eca1ddb46d687aefe80d67cde72711853516e7367ebe61d7af7d903d158c9c57ad891 + REF boost-1.73.0 + SHA512 81bc6f4bfcdf6d75ac59e3bb726789281c022a3d306d59e086cbeb84eec2b0f264df7127a5c65dd19ca872bae635ba2219f9914b2d7056373779f1c00a8313df HEAD_REF master ) diff --git a/ports/boost-utility/CONTROL b/ports/boost-utility/CONTROL index 7d6892457787fe..ea7aed66bcbd15 100644 --- a/ports/boost-utility/CONTROL +++ b/ports/boost-utility/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-utility -Version: 1.72.0 -Build-Depends: boost-config, boost-container-hash, boost-core, boost-detail, boost-integer, boost-preprocessor, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-config, boost-container-hash, boost-core, boost-detail, boost-integer, boost-io, boost-preprocessor, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/utility Description: Boost utility module diff --git a/ports/boost-utility/portfile.cmake b/ports/boost-utility/portfile.cmake index a5f39765662a78..33ee50f4c3d30e 100644 --- a/ports/boost-utility/portfile.cmake +++ b/ports/boost-utility/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/utility - REF boost-1.72.0 - SHA512 4630263d13239d5ce548821038277138268dcbc82a161196147e91147efbab289f71679449a35eb242c540be22ad5595fc0cd88b4dafb2e9b9e651bf398ed8b6 + REF boost-1.73.0 + SHA512 0f125259b1a23473b14dc45ad459d9bce1188b97747cbb0dec05bbea55babbf46fa7767a99f9e4eafce777edc11af5d8d5be408832c79dbcfa6568eab2596ce7 HEAD_REF master ) diff --git a/ports/boost-uuid/CONTROL b/ports/boost-uuid/CONTROL index 853b9466e2d477..439db78a319a9a 100644 --- a/ports/boost-uuid/CONTROL +++ b/ports/boost-uuid/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-uuid -Version: 1.72.0 -Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container-hash, boost-core, boost-integer, boost-io, boost-move, boost-numeric-conversion, boost-predef, boost-random, boost-serialization, boost-static-assert, boost-throw-exception, boost-tti, boost-type-traits, boost-vcpkg-helpers, boost-winapi +Version: 1.73.0 +Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container-hash, boost-conversion, boost-core, boost-integer, boost-io, boost-move, boost-numeric-conversion, boost-predef, boost-random, boost-serialization, boost-static-assert, boost-throw-exception, boost-tti, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/uuid Description: Boost uuid module diff --git a/ports/boost-uuid/portfile.cmake b/ports/boost-uuid/portfile.cmake index 5fd18f09b3a441..384c3d65ac3205 100644 --- a/ports/boost-uuid/portfile.cmake +++ b/ports/boost-uuid/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/uuid - REF boost-1.72.0 - SHA512 f2f614841b562620507d3b758e3c760b68af22812559caa181743bdc03c152d46680c6c7d4be9b217ae127686083d0110a81d9c03ff4ecffce4119a6fd8d0b1a + REF boost-1.73.0 + SHA512 68e4cb97d3e4080a6f1e72c91b823f423c9f4119bd2570086dcd14b723ea8500a8a2872d6ba4adf7a8a1119c6ac1f15dabd35795c00ba736cfb13933df75bd0a HEAD_REF master ) diff --git a/ports/boost-variant/CONTROL b/ports/boost-variant/CONTROL index 174995e8b2484d..a86a2889a3e8a6 100644 --- a/ports/boost-variant/CONTROL +++ b/ports/boost-variant/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-variant -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-bind, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-move, boost-mpl, boost-preprocessor, boost-static-assert, boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/variant Description: Boost variant module diff --git a/ports/boost-variant/portfile.cmake b/ports/boost-variant/portfile.cmake index e57e830649359e..8f7164dc03b7df 100644 --- a/ports/boost-variant/portfile.cmake +++ b/ports/boost-variant/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/variant - REF boost-1.72.0 - SHA512 8313dcff4d227c5e8ccdc25dd0831c126846d9c3a55acfa1316a20884894613ce55d3784c090cc115f628d3c0cce1b35e65a7547cd10ce168f5dc0b970d62f10 + REF boost-1.73.0 + SHA512 008e8bbefd30a4dfe33d43b549cbd8897e434080816ceb7e74aee801b05e2ba2e3931c5533a06b56033ebc6b21b47f2c1f77379b82c0f1a5211f07301c0ab73b HEAD_REF master ) diff --git a/ports/boost-variant2/CONTROL b/ports/boost-variant2/CONTROL index 4cbe58af0c2216..4dd1a19285e07b 100644 --- a/ports/boost-variant2/CONTROL +++ b/ports/boost-variant2/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-variant2 -Version: 1.72.0 -Build-Depends: boost-config, boost-detail, boost-mp11, boost-vcpkg-helpers +Version: 1.73.0 +Build-Depends: boost-config, boost-detail, boost-integer, boost-mp11, boost-vcpkg-helpers Homepage: https://github.com/boostorg/variant2 Description: Boost variant2 module diff --git a/ports/boost-variant2/portfile.cmake b/ports/boost-variant2/portfile.cmake index 75f9a153fdcd00..7fa405d721dd46 100644 --- a/ports/boost-variant2/portfile.cmake +++ b/ports/boost-variant2/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/variant2 - REF boost-1.72.0 - SHA512 88ce9129a4fe9d6e8273936483fa3d102a44ffdfc6a5385f5ffdb744a4ca13f0a552830b53f1aca3869fded703890d6921cc15658cc7cfe1dc6283f106e8fad4 + REF boost-1.73.0 + SHA512 5f5195ebcfc8f9a266541e9556332bb61a1a99c5636e59c9e4fd42525c9f06856cd64bd0aa975cc77321e181c3490b2cef7dc55c5eb43666ca3ca0c606a27ec5 HEAD_REF master ) diff --git a/ports/boost-vcpkg-helpers/boost-modular-headers.cmake b/ports/boost-vcpkg-helpers/boost-modular-headers.cmake index 140e432153b92b..bb29615bce7452 100644 --- a/ports/boost-vcpkg-helpers/boost-modular-headers.cmake +++ b/ports/boost-vcpkg-helpers/boost-modular-headers.cmake @@ -15,7 +15,7 @@ function(boost_modular_headers) message(STATUS "Packaging headers done") vcpkg_download_distfile(ARCHIVE - URLS "https://raw.githubusercontent.com/boostorg/boost/boost-1.72.0/LICENSE_1_0.txt" + URLS "https://raw.githubusercontent.com/boostorg/boost/boost-1.73.0/LICENSE_1_0.txt" FILENAME "boost_LICENSE_1_0.txt" SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 ) diff --git a/ports/boost-vmd/CONTROL b/ports/boost-vmd/CONTROL index 017e5563e8dccf..6dc0ae4bcd745d 100644 --- a/ports/boost-vmd/CONTROL +++ b/ports/boost-vmd/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-vmd -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-preprocessor, boost-vcpkg-helpers Homepage: https://github.com/boostorg/vmd Description: Boost vmd module diff --git a/ports/boost-vmd/portfile.cmake b/ports/boost-vmd/portfile.cmake index 2dd2a0a915c5cf..e36dca113f4534 100644 --- a/ports/boost-vmd/portfile.cmake +++ b/ports/boost-vmd/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/vmd - REF boost-1.72.0 - SHA512 1bc8122889dc80aece871021530c626de480bf2854eb1f7582520d345cd31ea4d068b84e4c43c47f018796fbaa5ed49746a3b1806cdcb3957fe40b5d79abbb04 + REF boost-1.73.0 + SHA512 84c693988230f1f0e77d098157ed3d47b7c196a26515f4d0a7f8884affa206a5f9baee46a8e1c611dc34d1b6b2675cadd5aa25f97c11421404d1ea6e4473ba09 HEAD_REF master ) diff --git a/ports/boost-wave/CONTROL b/ports/boost-wave/CONTROL index fe2e5e67f4ebf8..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.72.0 +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-wave/portfile.cmake b/ports/boost-wave/portfile.cmake index 8cb09191df210b..0f78bcdeb035a4 100644 --- a/ports/boost-wave/portfile.cmake +++ b/ports/boost-wave/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/wave - REF boost-1.72.0 - SHA512 cfbef392d37b15c1c8b5c6629ac307bddceafc986ae59561c64fbb06f4b5e48d6faf7092dbebdabdbf5c28bb483693669024b1c1677e17ea820fe504e7e8d993 + REF boost-1.73.0 + SHA512 e3afd44ae4a15456592660f87c0f2cbe8b23a3084efeacbb33efa039766eaa7e197f4f8ac64477d9667b6be81a4cf97ac85e8eaac7ba369900dce3ad3436b6e4 HEAD_REF master ) diff --git a/ports/boost-winapi/CONTROL b/ports/boost-winapi/CONTROL index 6e47e2ef415cf9..808385e4d2b7d9 100644 --- a/ports/boost-winapi/CONTROL +++ b/ports/boost-winapi/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-winapi -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-config, boost-predef, boost-vcpkg-helpers Homepage: https://github.com/boostorg/winapi Description: Boost winapi module diff --git a/ports/boost-winapi/portfile.cmake b/ports/boost-winapi/portfile.cmake index 9575702cc387a6..ec133df477e5de 100644 --- a/ports/boost-winapi/portfile.cmake +++ b/ports/boost-winapi/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/winapi - REF boost-1.72.0 - SHA512 de9292bd10d393ed68066c77af335d7799c205761942d567391f2099a089f7ff77c65681156aa4c568d1ec39f1e1556b6816e903a945a81ebb43971840eb3c53 + REF boost-1.73.0 + SHA512 468c6f3403f1535dad26c122b8c405597eb0c1d58cbc39b646367110b07cc925a6e992ed92976874c2df0f8c1b848d82c3f4252124ed122e9513f9502ec5dfef HEAD_REF master ) diff --git a/ports/boost-xpressive/CONTROL b/ports/boost-xpressive/CONTROL index 4deb788fa2cfc0..9c660df62030df 100644 --- a/ports/boost-xpressive/CONTROL +++ b/ports/boost-xpressive/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-xpressive -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-assert, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-exception, boost-fusion, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-proto, boost-range, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/xpressive Description: Boost xpressive module diff --git a/ports/boost-xpressive/portfile.cmake b/ports/boost-xpressive/portfile.cmake index 435fee2cd9af15..7e9e3e915aa8ba 100644 --- a/ports/boost-xpressive/portfile.cmake +++ b/ports/boost-xpressive/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/xpressive - REF boost-1.72.0 - SHA512 214ab38c493a53b97c2f153d2c45b71ddf9b06995af781f51e814c0b03526a9be402aeb5bcbcf69baaea49df760fa79b6d8abc5b91744afb4bc2e6be7a04a1a3 + REF boost-1.73.0 + SHA512 1d2cab3db72502d7d926861bc468a1266eb9031a64816a88b61f669bfe370237a4836962af6afe565d51435e924809ca41f46fecfc99464e88053699eec9a4b6 HEAD_REF master ) diff --git a/ports/boost-yap/CONTROL b/ports/boost-yap/CONTROL index 6b36f549637752..e10364287c5372 100644 --- a/ports/boost-yap/CONTROL +++ b/ports/boost-yap/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-yap -Version: 1.72.0 +Version: 1.73.0 Build-Depends: boost-hana, boost-preprocessor, boost-type-index, boost-vcpkg-helpers Homepage: https://github.com/boostorg/yap Description: Boost yap module diff --git a/ports/boost-yap/portfile.cmake b/ports/boost-yap/portfile.cmake index 6dd22817813204..f2fbaecd1c7cec 100644 --- a/ports/boost-yap/portfile.cmake +++ b/ports/boost-yap/portfile.cmake @@ -1,12 +1,10 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/yap - REF boost-1.72.0 - SHA512 682ae560b2fc31e8173914a8f59e263b2a64b9064faa2a15b5692926a28f5940d261368b7cc061dd696bfc76a36e74a153310951fd24a4e81346cca2b9f936bd + REF boost-1.73.0 + SHA512 f228ba3255f91cdd503a8fdf9f881dc608f1730bda685aca0e1638cd96add9194a250da154b4ce1ae3438ba92c88572f666eda2893ac9d53e6a4b1827d55a06b HEAD_REF master ) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 1584cb90917485..fda7b12ced9b32 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.72.0 +Version: 1.73.0 +Port-Version: 1 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-disjoint-sets, 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-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-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/breakpad/CMakeLists.txt b/ports/breakpad/CMakeLists.txt index 01c949251ee86d..113002943f4352 100644 --- a/ports/breakpad/CMakeLists.txt +++ b/ports/breakpad/CMakeLists.txt @@ -77,15 +77,16 @@ if(INSTALL_HEADERS) if(WIN32) set(HEADER_EXCLUDE_REGEX "/apple|/ios|/linux|/mac|/solaris|/android|/dwarf|/tests|/testdata|/unittests") elseif(APPLE) - set(HEADER_EXCLUDE_REGEX "/apple|/ios|/linux|/windows|/solaris|/android|/dwarf|/tests|/testdata|/unittests") + set(HEADER_EXCLUDE_REGEX "/apple|/ios|/linux|/windows|/solaris|/android|/dwarf|/tests|/testdata|/unittests|/*proj|/gcov") else() set(HEADER_EXCLUDE_REGEX "/apple|/ios|/client/linux/data|/client/linux/sender|/windows|/mac|/solaris|/android|/dwarf|/tests|/testdata|/unittests") endif() install( DIRECTORY src/client src/common src/google_breakpad DESTINATION include/ - FILES_MATCHING PATTERN "*.h" - REGEX "${HEADER_EXCLUDE_REGEX}" EXCLUDE + FILES_MATCHING + PATTERN "*.h" + REGEX ${HEADER_EXCLUDE_REGEX} EXCLUDE ) endif() diff --git a/ports/breakpad/CONTROL b/ports/breakpad/CONTROL index b701aa69f600b8..a50eab6979c156 100644 --- a/ports/breakpad/CONTROL +++ b/ports/breakpad/CONTROL @@ -1,5 +1,5 @@ Source: breakpad -Version: 2019-07-11-1 +Version: 2019-07-11-2 Build-Depends: libdisasm Homepage: https://github.com/google/breakpad Description: a set of client and server components which implement a crash-reporting system. diff --git a/ports/breakpad/portfile.cmake b/ports/breakpad/portfile.cmake index a5c3022f93e933..29f027e401546c 100644 --- a/ports/breakpad/portfile.cmake +++ b/ports/breakpad/portfile.cmake @@ -1,15 +1,13 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/breakpad - REF c46151db0ffd1a8dae914e45f1212ef427f61ed3 + REF c46151db0ffd1a8dae914e45f1212ef427f61ed3 SHA512 bd9f247851a3caa6f36574c8a243c2a01cb1cf23c2266b6f6786b85c7418dba5937363c00184e26cda24225f96bb7aaeb08efd13d6a269a3b78c357c2eda7e14 HEAD_REF master - PATCHES - fix-unique_ptr.patch + PATCHES + fix-unique_ptr.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -25,4 +23,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-breakpad TARGET_PATH shar vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/breakpad RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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 index 695925c073b7c5..4734c417155908 100644 --- a/ports/bzip2/CONTROL +++ b/ports/bzip2/CONTROL @@ -1,4 +1,4 @@ Source: bzip2 -Version: 1.0.6-5 +Version: 1.0.6-6 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/portfile.cmake b/ports/bzip2/portfile.cmake index 0462d53eb6f809..571c84948f04cc 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) -set(BZIP2_VERSION 1.0.6) -vcpkg_download_distfile(ARCHIVE +set(BZIP2_VERSION 1.0.6) # TODO: Update to 1.0.8 +vcpkg_download_distfile(ARCHIVE # TODO: switch to vcpkg_from_git with https://sourceware.org/git/?p=bzip2.git;a=summary 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) @@ -14,7 +14,7 @@ vcpkg_extract_source_archive_ex( fix-windows-include.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -27,17 +27,25 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -file(READ ${CURRENT_PACKAGES_DIR}/include/bzlib.h BZLIB_H) +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(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 "${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}) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) + +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) +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) +vcpkg_fixup_pkgconfig() \ No newline at end of file diff --git a/ports/c4core/CONTROL b/ports/c4core/CONTROL new file mode 100644 index 00000000000000..62eed51ddd71df --- /dev/null +++ b/ports/c4core/CONTROL @@ -0,0 +1,5 @@ +Source: c4core +Version: 2020-04-12 +Homepage: https://github.com/biojppm/c4core +Description: Library of low-level C++ utilities +Supports: !(arm|arm64|osx) \ No newline at end of file diff --git a/ports/c4core/portfile.cmake b/ports/c4core/portfile.cmake new file mode 100644 index 00000000000000..2b764af9d5c6c6 --- /dev/null +++ b/ports/c4core/portfile.cmake @@ -0,0 +1,79 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_fail_port_install( + ON_ARCH "arm" "arm64" + ON_TARGET "OSX" +) + +# Get c4core src +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO biojppm/c4core + REF bc4de0291bb96ae509ee99a54f139563cf14638e + SHA512 2c0c4511cb43f34492b6d0d8dfef90623dfacb6ae43f6a6173fbf9efa63f7a018235ec9dcd9a211a3cd393c2114adb39a4276df94e2d23f9c354d644a36e51a0 + HEAD_REF master +) + +set(COMMIT_HASH a0f0c17bfc9a9a91cc72891539b513c129c6d122) + +# Get cmake scripts for c4core +vcpkg_download_distfile(CMAKE_ARCHIVE + URLS "https://github.com/biojppm/cmake/archive/${COMMIT_HASH}.zip" + FILENAME "cmake-${COMMIT_HASH}.zip" + SHA512 4fbc711f3120501fa40733c3b66e34cd6a7e1b598b1378fbb59d1a87c88290a03d021f5176634089da41682fd918d7e27c6c146052dec54d7e956be15f12744f +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH_CMAKE + ARCHIVE ${CMAKE_ARCHIVE} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/deps" +) + +file(REMOVE_RECURSE "${SOURCE_PATH}/cmake") +file(RENAME ${SOURCE_PATH_CMAKE} "${SOURCE_PATH}/cmake") + +set(COMMIT_HASH 78e525c6e74df6d62d782864a52c0d279dcee24f) + +vcpkg_download_distfile(DEBUGBREAK_ARCHIVE + URLS "https://github.com/biojppm/debugbreak/archive/${COMMIT_HASH}.zip" + FILENAME "debugbreak-${COMMIT_HASH}.zip" + SHA512 25f3d45b09ce362f736fac0f6d6a6c7f2053fec4975b32b0565288893e4658fd0648a7988c3a5fe0e373e92705d7a3970eaa7cfc053f375ffb75e80772d0df64 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH_DEBUGBREAK + ARCHIVE ${DEBUGBREAK_ARCHIVE} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/deps" +) + +file(REMOVE_RECURSE "${SOURCE_PATH}/ext/debugbreak") +file(RENAME ${SOURCE_PATH_DEBUGBREAK} "${SOURCE_PATH}/ext/debugbreak") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/c4core) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/c4core) +endif() + +# Fix paths in config file +file(READ "${CURRENT_PACKAGES_DIR}/share/c4core/c4coreConfig.cmake" _contents) +string(REGEX REPLACE [[[ \t\r\n]*"\${PACKAGE_PREFIX_DIR}[\./\\]*"]] [["${PACKAGE_PREFIX_DIR}/../.."]] _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/share/c4core/c4coreConfig.cmake" "${_contents}") + +# Fix path to header +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/c4/error.hpp" "" "\"extern/debugbreak/debugbreak.h\"") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL + "${SOURCE_PATH}/LICENSE.txt" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/c4core" RENAME copyright) diff --git a/ports/caf/CONTROL b/ports/caf/CONTROL index 256737e1164d33..69e9c1ae450d6a 100644 --- a/ports/caf/CONTROL +++ b/ports/caf/CONTROL @@ -1,4 +1,5 @@ Source: caf -Version: 0.17.2 +Version: 0.17.3 +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/portfile.cmake b/ports/caf/portfile.cmake index de6840664883fe..c8ead37b41589f 100644 --- a/ports/caf/portfile.cmake +++ b/ports/caf/portfile.cmake @@ -18,8 +18,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO actor-framework/actor-framework - REF 4da751ab7a79bcdc6e9dd2157b9b5c5c6814e26d # 0.17.2 - SHA512 4bd739c553fcbd6aa3b61372b42ad2ab40099c18959892553b9bc232b95740ba563d967d73e0695f0ce3d31409ae704eb578b6590431039f18291c896f535a36 + REF b05a4b7b2a6f59b0508db84ea68e5ada2224f904 # 0.17.3 + SHA512 02b1598f5090674bc2ce4fdbcd70a4669c8c0710e98d910dbd77338c088cc87db4e0eeb3dd89100772ff4f74bdf09a7f70b8975d79c816e422dc34a356f8ba4e HEAD_REF master PATCHES openssl-version-override.patch diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index 27638912bcc6b5..e333f304d23ce6 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -3,10 +3,28 @@ project(cairo C) # Add include directories include_directories(".") -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") +if(WIN32) include_directories("./win32") endif() +set(CAIRO_HEADERS + cairo.h + cairo-deprecated.h + cairo-features.h + cairo-pdf.h + cairo-ps.h + cairo-script.h + cairo-svg.h + ../cairo-version.h + cairo-win32.h + ../util/cairo-gobject/cairo-gobject.h + cairo-ft.h +) + +set(CAIRO_X11_HEADERS + cairo-xlib.h +) + file(GLOB SOURCES "cairo-analysis-surface.c" "cairo-arc.c" @@ -154,7 +172,7 @@ file(GLOB PLATFORM_SOURCES_WIN32 "win32/cairo-win32-font.c" ) -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") +if(WIN32) list(APPEND SOURCES ${PLATFORM_SOURCES_WIN32}) endif() @@ -164,7 +182,6 @@ find_package(Threads REQUIRED) find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) find_package(Freetype REQUIRED) -find_package(unofficial-glib CONFIG REQUIRED) find_package(unofficial-fontconfig CONFIG REQUIRED) find_package(unofficial-pixman CONFIG REQUIRED) @@ -177,7 +194,7 @@ add_definitions( -DHAVE_FT_GET_X11_FONT_FORMAT=1) # additional features for macOS -if((CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR (CMAKE_SYSTEM_NAME STREQUAL "Linux")) +if(UNIX OR APPLE) add_definitions( -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 @@ -193,10 +210,10 @@ 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(CMAKE_SYSTEM_NAME STREQUAL "Windows") +if(WIN32) target_link_libraries(cairo PRIVATE gdi32 msimg32 user32) endif() @@ -207,45 +224,67 @@ set(CAIRO_GOBJECT_SOURCES "../util/cairo-gobject/cairo-gobject-structs.c") # GObject support sources do not include header with export macro -if(BUILD_SHARED_LIBS) - if(MSVC) - set_source_files_properties( - "../util/cairo-gobject/cairo-gobject-enums.c" - "../util/cairo-gobject/cairo-gobject-structs.c" - PROPERTIES COMPILE_DEFINITIONS "cairo_public=__declspec(dllexport)") - else() - set_source_files_properties( - "../util/cairo-gobject/cairo-gobject-enums.c" - "../util/cairo-gobject/cairo-gobject-structs.c" - PROPERTIES COMPILE_DEFINITIONS "cairo_public=__attribute__((visibility(\"default\")))") +if(WITH_GOBJECT) + if(BUILD_SHARED_LIBS) + if(MSVC) + set_source_files_properties( + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c" + PROPERTIES COMPILE_DEFINITIONS "cairo_public=__declspec(dllexport)") + else() + set_source_files_properties( + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c" + PROPERTIES COMPILE_DEFINITIONS "cairo_public=__attribute__((visibility(\"default\")))") + endif() endif() + + find_package(unofficial-glib CONFIG REQUIRED) + add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES}) + target_link_libraries(cairo-gobject PRIVATE cairo unofficial::glib::gobject unofficial::glib::glib) endif() -add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES}) -target_link_libraries(cairo-gobject PRIVATE cairo unofficial::glib::gobject unofficial::glib::glib) - if(MSVC) # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files # NOTE: options only available to MSVC, clang in macOS doesn't understand these flags target_compile_options(cairo PRIVATE "/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101" ) - target_compile_options(cairo-gobject PRIVATE - "/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101" - ) + if(WITH_GOBJECT) + target_compile_options(cairo-gobject PRIVATE + "/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101" + ) + endif() endif() if (CAIRO_HAS_XLIB_SURFACE) file(INSTALL cairo-xlib.h DESTINATION include) endif() -install(TARGETS cairo cairo-gobject +install(FILES ${CAIRO_HEADERS} DESTINATION include) +install(FILES ${CAIRO_HEADERS} DESTINATION include/cairo) + +if (WITH_X11) + install(FILES ${CAIRO_X11_HEADERS} DESTINATION include) + install(FILES ${CAIRO_X11_HEADERS} DESTINATION include/cairo) +endif() + +install(TARGETS cairo EXPORT cairo-targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) +if(WITH_GOBJECT) + install(TARGETS cairo-gobject + EXPORT cairo-targets + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +endif() + install( EXPORT cairo-targets NAMESPACE unofficial::cairo:: @@ -258,9 +297,11 @@ include(CMakeFindDependencyMacro) find_dependency(ZLIB) find_dependency(PNG) find_dependency(Freetype) -find_dependency(unofficial-glib CONFIG) find_dependency(unofficial-fontconfig CONFIG) find_dependency(unofficial-pixman CONFIG) +if(WITH_GOBJECT) + find_dependency(unofficial-glib CONFIG) +endif() include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-cairo-targets.cmake) ") diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index ef366ca83d6d77..6c26c77a250d5f 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,8 +1,13 @@ Source: cairo -Version: 1.16.0-3 +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, glib, freetype, fontconfig +Build-Depends: zlib, libpng, pixman, freetype, fontconfig Feature: x11 -Description: build with x11 support \ No newline at end of file +Description: build with x11 support + +Feature: gobject +Description: build gobject module +Build-Depends: glib \ No newline at end of file diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake index f5b1f35f8e7fd3..2dab7e4c2e04b2 100644 --- a/ports/cairo/portfile.cmake +++ b/ports/cairo/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) set(CAIRO_VERSION 1.16.0) vcpkg_download_distfile(ARCHIVE @@ -25,8 +24,15 @@ if ("x11" IN_LIST FEATURES) message(WARNING "You will need to install Xorg dependencies to use feature x11:\napt install libx11-dev libxft-dev\n") endif() +if("gobject" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + message(FATAL_ERROR "Feature gobject currently only supports dynamic build.") + endif() +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS x11 WITH_X11 + gobject WITH_GOBJECT ) vcpkg_configure_cmake( @@ -39,22 +45,7 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cairo TARGET_PATH share/unofficial-cairo) -# Copy the appropriate header files. -foreach(FILE -"${SOURCE_PATH}/src/cairo.h" -"${SOURCE_PATH}/src/cairo-deprecated.h" -"${SOURCE_PATH}/src/cairo-features.h" -"${SOURCE_PATH}/src/cairo-pdf.h" -"${SOURCE_PATH}/src/cairo-ps.h" -"${SOURCE_PATH}/src/cairo-script.h" -"${SOURCE_PATH}/src/cairo-svg.h" -"${SOURCE_PATH}/cairo-version.h" -"${SOURCE_PATH}/src/cairo-win32.h" -"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h" -"${SOURCE_PATH}/src/cairo-ft.h") - file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cairo) -endforeach() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") foreach(FILE "${CURRENT_PACKAGES_DIR}/include/cairo.h" "${CURRENT_PACKAGES_DIR}/include/cairo/cairo.h") file(READ ${FILE} CAIRO_H) @@ -67,9 +58,8 @@ foreach(FILE "${CURRENT_PACKAGES_DIR}/include/cairo.h" "${CURRENT_PACKAGES_DIR}/ endforeach() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cairo) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/cairo/COPYING ${CURRENT_PACKAGES_DIR}/share/cairo/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() -vcpkg_test_cmake(PACKAGE_NAME unofficial-cairo) +#vcpkg_test_cmake(PACKAGE_NAME unofficial-cairo) \ No newline at end of file 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/capstone/CONTROL b/ports/capstone/CONTROL index d7d422d2578d11..60e2a2a535a936 100644 --- a/ports/capstone/CONTROL +++ b/ports/capstone/CONTROL @@ -1,5 +1,6 @@ Source: capstone -Version: 4.0.1-120373dc +Version: 4.0.2 +Port-Version: 1 Homepage: https://github.com/aquynh/capstone Description: Multi-architecture disassembly framework @@ -36,8 +37,9 @@ Description: Capstone disassembly support for TMS320C64X Feature: x86 Description: Capstone disassembly support for x86 -Feature: x86_reduce +Feature: x86-reduce Description: Capstone disassembly support for x86 without support for less used instructions +Build-Depends: capstone[x86] Feature: xcore Description: Capstone disassembly support for XCore diff --git a/ports/capstone/portfile.cmake b/ports/capstone/portfile.cmake index bd435110992939..3e01523dfacd38 100644 --- a/ports/capstone/portfile.cmake +++ b/ports/capstone/portfile.cmake @@ -1,44 +1,31 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REF 120373dc9789875ccbc968397219a86598a4351e + REF 4.0.2 REPO "aquynh/capstone" - SHA512 90961176ab68110b0fea08f11a5ed6997dcd92ceeec568978003bfd01e2170479256f137e4f91be5e22a9bdebbe1f436c2849bde1d4e0bbd0b781f8562b58059 + SHA512 7f93534517307b737422a8825b66b2a1f3e1cca2049465d60ab12595940154aaf843ba40ed348fce58de58b990c19a0caef289060eb72898cb008a88c470970e HEAD_REF v4 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CS_BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CS_BUILD_SHARED) - -function(check_feature name var) - set(${var} OFF PARENT_SCOPE) - if (${name} IN_LIST FEATURES) - set(${var} ON PARENT_SCOPE) - endif () -endfunction () - - -check_feature("arm" WITH_ARM_SUPPORT) -check_feature("arm64" WITH_ARM64_SUPPORT) -check_feature("evm" WITH_EVM_SUPPORT) -check_feature("m680x" WITH_M680X_SUPPORT) -check_feature("m68k" WITH_M68K_SUPPORT) -check_feature("mips" WITH_MIPS_SUPPORT) -check_feature("osxkernel" WITH_OSXKERNEL_SUPPORT) -check_feature("ppc" WITH_PPC_SUPPORT) -check_feature("sparc" WITH_SPARC_SUPPORT) -check_feature("sysz" WITH_SYSZ_SUPPORT) -check_feature("tms320c64x" WITH_C64X_SUPPORT) -check_feature("x86" WITH_X86_SUPPORT) -check_feature("x86_reduce" WITH_X86_REDUCE) -check_feature("xcore" WITH_XCORE_SUPPORT) - -check_feature("diet" CS_BUILD_DIET) - -if (WITH_X86_REDUCE AND NOT WITH_X86_SUPPORT) - set(WITH_X86_SUPPORT ON) -endif () +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "arm" CAPSTONE_ARM_SUPPORT + "arm64" CAPSTONE_ARM64_SUPPORT + "evm" CAPSTONE_EVM_SUPPORT + "m680x" CAPSTONE_M680X_SUPPORT + "m68k" CAPSTONE_M68K_SUPPORT + "mips" CAPSTONE_MIPS_SUPPORT + "osxkernel" CAPSTONE_OSXKERNEL_SUPPORT + "ppc" CAPSTONE_PPC_SUPPORT + "sparc" CAPSTONE_SPARC_SUPPORT + "sysz" CAPSTONE_SYSZ_SUPPORT + "tms320c64x" CAPSTONE_TMS320C64X_SUPPORT + "x86" CAPSTONE_X86_SUPPORT + "x86-reduce" CAPSTONE_X86_REDUCE + "xcore" CAPSTONE_XCORE_SUPPORT + "diet" CAPSTONE_BUILD_DIET +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -46,27 +33,11 @@ vcpkg_configure_cmake( OPTIONS -DCAPSTONE_BUILD_STATIC=${CS_BUILD_STATIC} -DCAPSTONE_BUILD_SHARED=${CS_BUILD_SHARED} - -DCAPSTONE_BUILD_DIET=${CS_BUILD_DIET} -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -DCAPSTONE_BUILD_STATIC_RUNTIME=OFF - - -DCAPSTONE_ARM_SUPPORT=${WITH_ARM_SUPPORT} - -DCAPSTONE_ARM64_SUPPORT=${WITH_ARM64_SUPPORT} - -DCAPSTONE_EVM_SUPPORT=${WITH_EVM_SUPPORT} - -DCAPSTONE_M680X_SUPPORT=${WITH_M680X_SUPPORT} - -DCAPSTONE_M68K_SUPPORT=${WITH_M68K_SUPPORT} - -DCAPSTONE_MIPS_SUPPORT=${WITH_MIPS_SUPPORT} - -DCAPSTONE_OSXKERNEL_SUPPORT=${WITH_OSXKERNEL_SUPPORT} - -DCAPSTONE_PPC_SUPPORT=${WITH_PPC_SUPPORT} - -DCAPSTONE_SPARC_SUPPORT=${WITH_SPARC_SUPPORT} - -DCAPSTONE_SYSZ_SUPPORT=${WITH_SYSZ_SUPPORT} - -DCAPSTONE_TMS320C64X_SUPPORT=${WITH_C64X_SUPPORT} - -DCAPSTONE_X86_SUPPORT=${WITH_X86_SUPPORT} - -DCAPSTONE_XCORE_SUPPORT=${WITH_XCORE_SUPPORT} - - -DCAPSTONE_X86_REDUCE=${WITH_X86_REDUCE} -DCAPSTONE_X86_ONLY=OFF + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -81,7 +52,4 @@ 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.TXT - DESTINATION ${CURRENT_PACKAGES_DIR}/share/capstone - RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/catch2/CONTROL b/ports/catch2/CONTROL index 4a8e3ced35e9a2..3c33a7eef2f9e5 100644 --- a/ports/catch2/CONTROL +++ b/ports/catch2/CONTROL @@ -1,4 +1,4 @@ Source: catch2 -Version: 2.11.3 +Version: 2.12.1 Description: A modern, header-only test framework for unit testing. Homepage: https://github.com/catchorg/Catch2 diff --git a/ports/catch2/portfile.cmake b/ports/catch2/portfile.cmake index 76a5e61bb987d5..4728b6d16f92ab 100644 --- a/ports/catch2/portfile.cmake +++ b/ports/catch2/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO catchorg/Catch2 - REF 255aa5f2afe1a622c97422f65ace6ca915be0d8d # v2.11.3 - SHA512 e46d14105928fb43cd041bd4d797d255233d302d87f06823f7ae49f95b1e9a2fae321de4812f6e9ce3028a904cbd668cdf0ad3e6673bc5297f29d1fb1c46f130 + REF 2e61d38c7c3078e600c331257b5bebfb81aaa685 # v2.12.1 + SHA512 533867c538bb4e50eb143254a347c6619b64d738aadfe93ff92f698f0971c85a070006df8eae2610999b3326890eb65441b1d66a8b2a237d13635059e8183200 HEAD_REF master ) diff --git a/ports/ccd/CONTROL b/ports/ccd/CONTROL index ded728779edcc1..5a5f59e28d82d3 100644 --- a/ports/ccd/CONTROL +++ b/ports/ccd/CONTROL @@ -1,4 +1,4 @@ Source: ccd -Version: 2.1-3 +Version: 2.1-4 Homepage: https://github.com/danfis/libccd Description: Library for collision detection between two convex shapes diff --git a/ports/ccd/portfile.cmake b/ports/ccd/portfile.cmake index 424732917aa354..29f0f9efa5e059 100644 --- a/ports/ccd/portfile.cmake +++ b/ports/ccd/portfile.cmake @@ -1,16 +1,18 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danfis/libccd REF v2.1 SHA512 ff037d9c4df50f09600cf9b3514b259b2850ff43f74817853f5665d22812891168f70bd3cc3969b2c9e3c706f6254991a65421476349607fbd04d894b217456d HEAD_REF master + # Backport https://github.com/danfis/libccd/pull/70 to support Emscripten + PATCHES "support-emscripten.patch" ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() diff --git a/ports/ccd/support-emscripten.patch b/ports/ccd/support-emscripten.patch new file mode 100644 index 00000000000000..2fe689a7988316 --- /dev/null +++ b/ports/ccd/support-emscripten.patch @@ -0,0 +1,25 @@ +From c3616f28d33019047e8e71df8abeb0493159539e Mon Sep 17 00:00:00 2001 +From: Silvio Traversaro +Date: Sun, 17 May 2020 11:42:24 +0200 +Subject: [PATCH] Fix configuration with Emscripten + +In Emscripten there is no separate libm library, so there is no need to explicitly link it, +and in particular the find_library call would fail as there is not libm to find. +See https://stackoverflow.com/questions/24663915/how-can-i-link-libm-to-my-emscripten-port +--- + src/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 1407080..357ed76 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -48,7 +48,7 @@ target_include_directories(ccd PUBLIC + $ + $) + +-if(NOT WIN32) ++if(NOT WIN32 AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")) + find_library(LIBM_LIBRARY NAMES m) + if(NOT LIBM_LIBRARY) + message(FATAL_ERROR "Could NOT find required library LibM") diff --git a/ports/ccfits/CONTROL b/ports/ccfits/CONTROL index f2603b80e62b0d..02234c94e97bdc 100644 --- a/ports/ccfits/CONTROL +++ b/ports/ccfits/CONTROL @@ -1,5 +1,5 @@ Source: ccfits -Version: 2.5-4 +Version: 2.5-5 Homepage: https://heasarc.gsfc.nasa.gov/fitsio/ccfits Description: CCfits is an object oriented interface to the cfitsio library. It is designed to make the capabilities of cfitsio available to programmers working in C++. Build-Depends: cfitsio diff --git a/ports/ccfits/portfile.cmake b/ports/ccfits/portfile.cmake index e5f280944dfb1d..6c33b383bed0ca 100644 --- a/ports/ccfits/portfile.cmake +++ b/ports/ccfits/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://heasarc.gsfc.nasa.gov/fitsio/ccfits/CCfits-2.5.tar.gz" FILENAME "CCfits-2.5.tar.gz" @@ -40,4 +38,4 @@ foreach(HEADER IN LISTS HEADERS) endforeach() # Handle copyright -file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ccfits RENAME copyright) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index 5cc41013e8b44b..071ad0ad1fb591 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -1,8 +1,8 @@ diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in -index d0380de..bf4c2eb 100644 +index d0380de..55760a8 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in -@@ -237,85 +237,8 @@ endif (EIGEN_FOUND) +@@ -237,85 +237,13 @@ endif (EIGEN_FOUND) list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) # Glog. @@ -40,7 +40,9 @@ index d0380de..bf4c2eb 100644 - get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) - list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR}) - endif() -- ++include (CMakeFindDependencyMacro) ++find_dependency (glog NO_MODULE) + - # Search quietly s/t we control the timing of the error message if not found. - find_package(Glog QUIET) - if (GLOG_FOUND) @@ -85,8 +87,10 @@ index d0380de..bf4c2eb 100644 - list(APPEND CERES_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIR_HINTS}) - endif() -endif (CERES_USES_MINIGLOG) -+include (CMakeFindDependencyMacro) -+find_dependency (glog NO_MODULE) ++#SuiteSparse ++if (@SUITESPARSE@) ++ find_dependency(suitesparse CONFIG REQUIRED) ++endif() # Import exported Ceres targets, if they have not already been imported. if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR) diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index 850da31a627ebf..ecd8f1de63bc79 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,11 +1,12 @@ Source: ceres -Version: 1.14.0-6 +Version: 1.14.0 +Port-Version: 8 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 66481fc0934f22..d2d781b594341b 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(MSVC_USE_STATIC_CRT_VALUE OFF) if(VCPKG_CRT_LINKAGE STREQUAL "static") if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -31,44 +29,25 @@ file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake) #file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake) -set(SUITESPARSE OFF) -if("suitesparse" IN_LIST FEATURES) - set(SUITESPARSE ON) -endif() - -set(CXSPARSE OFF) -if("cxsparse" IN_LIST FEATURES) - set(CXSPARSE ON) -endif() - -set(LAPACK OFF) -if("lapack" IN_LIST FEATURES) - set(LAPACK ON) -endif() - -set(EIGENSPARSE OFF) -if("eigensparse" IN_LIST FEATURES) - set(EIGENSPARSE ON) -endif() -set(GFLAGS OFF) -if("tools" IN_LIST FEATURES) - set(GFLAGS ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "suitesparse" SUITESPARSE + "cxsparse" CXSPARSE + "lapack" LAPACK + "eigensparse" EIGENSPARSE + "tools" GFLAGS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DEXPORT_BUILD_DIR=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DGFLAGS=${GFLAGS} - -DCXSPARSE=${CXSPARSE} - -DEIGENSPARSE=${EIGENSPARSE} - -DLAPACK=${LAPACK} - -DSUITESPARSE=${SUITESPARSE} -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} + -DLIB_SUFFIX=${LIB_SUFFIX} ) vcpkg_install_cmake() diff --git a/ports/cgal/CONTROL b/ports/cgal/CONTROL index 7d951496298765..1cb5e38bc9854d 100644 --- a/ports/cgal/CONTROL +++ b/ports/cgal/CONTROL @@ -1,9 +1,9 @@ Source: cgal -Version: 5.0.2 -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 +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. Feature: qt -Build-Depends: qt5-base, qt5-3d, qt5-svg, qt5-xmlpatterns, qt5-script, eigen3 +Build-Depends: qt5-base[core], qt5-3d, qt5-svg, qt5-xmlpatterns, qt5-script, eigen3 Description: Qt GUI support for CGAL 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/cgns/CONTROL b/ports/cgns/CONTROL new file mode 100644 index 00000000000000..3398bad14fdf49 --- /dev/null +++ b/ports/cgns/CONTROL @@ -0,0 +1,32 @@ +Source: cgns +Version: 3.4.0-1 +Homepage: http://cgns.org/ +Description: The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. +Default-Features: hdf5, lfsselector + +Feature: mpi +Description: Compile with support for the message passage interface (MPI) +Build-Depends: hdf5[core,parallel] + +Feature: fortran +Description: Enable fortran support (not yet implemented) + +Feature: tests +Description: Build tests + +Feature: tools +Description: Build tools + +Feature: hdf5 +Description: Enable hdf5 support +Build-Depends: hdf5[core,tools] + +Feature: lfsselector +Description: Selector for LFS +Build-Depends: cgns[core,lfs] (!osx) + +Feature: lfs +Description: Enable LFS support + +Feature: legacy +Description: Enable legacy support diff --git a/ports/cgns/cgnsconfig.h b/ports/cgns/cgnsconfig.h new file mode 100644 index 00000000000000..7ebe18ac5ee9c8 --- /dev/null +++ b/ports/cgns/cgnsconfig.h @@ -0,0 +1,6 @@ +#ifndef CGNSCONFIG_H +#define CGNSCONFIG_H + +#include "cgnstypes.h" + +#endif \ No newline at end of file diff --git a/ports/cgns/defines.patch b/ports/cgns/defines.patch new file mode 100644 index 00000000000000..e17d488287a6a6 --- /dev/null +++ b/ports/cgns/defines.patch @@ -0,0 +1,16 @@ +diff --git a/src/cgnstypes.h.in b/src/cgnstypes.h.in +index 98c4e7fdc..8c6bcea62 100644 +--- a/src/cgnstypes.h.in ++++ b/src/cgnstypes.h.in +@@ -29,6 +29,11 @@ + #ifndef CGNSTYPES_H + #define CGNSTYPES_H + ++#define CG_BUILD_HDF5 @BUILDHDF5@ ++#define CG_BUILD_FORTRAN @BUILDFORTRAN@ ++#define CG_BUILD_PARALLEL @BUILDPARALLEL@ ++#define CG_BUILD_BASESCOPE @BUILDBASESCOPE@ ++ + #define CG_BUILD_LEGACY @BUILDLEGACY@ + #define CG_BUILD_64BIT @BUILD64BIT@ + #define CG_BUILD_SCOPE @BUILDSCOPE@ diff --git a/ports/cgns/hdf5.patch b/ports/cgns/hdf5.patch new file mode 100644 index 00000000000000..4de9ee35ba031a --- /dev/null +++ b/ports/cgns/hdf5.patch @@ -0,0 +1,108 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 58f078fe7..46446da8a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -194,71 +194,17 @@ endif (CGNS_ENABLE_FORTRAN AND HAS_FORTRAN) + option(CGNS_ENABLE_HDF5 "Enable or disable HDF5 interface" "OFF") + if (CGNS_ENABLE_HDF5) + +- if (CGNS_BUILD_SHARED) +- set (FIND_HDF_COMPONENTS C shared) +- else (CGNS_BUILD_SHARED) +- set (FIND_HDF_COMPONENTS C static) +- endif (CGNS_BUILD_SHARED) +- message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}") +- +- #set (SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) +- set (SEARCH_PACKAGE_NAME "hdf5") +- +- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) +- message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}") +- if (HDF5_FOUND) +- add_executable (h5dump IMPORTED) +- if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) +- set (FIND_HDF_COMPONENTS C) +- +- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) +- message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_FOUND}") +- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) +- if (HDF5_BUILD_SHARED_LIBS) +- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) +- else (HDF5_BUILD_SHARED_LIBS) +- add_definitions (-DH5_BUILT_AS_STATIC_LIB) +- endif (HDF5_BUILD_SHARED_LIBS) +- if (BUILD_SHARED_LIBS AND WIN32) +- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dumpdll") +- else (BUILD_SHARED_LIBS AND WIN32) +- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") +- endif (BUILD_SHARED_LIBS AND WIN32) +- else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) +- if (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND) +- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY}) +- else (HDF5_static_C_FOUND) +- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY}) +- endif (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND) +- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") +- endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) ++ find_package(HDF5 CONFIG REQUIRED) ++ if(TARGET hdf5::hdf5-shared) ++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared) ++ #add_executable(h5dump ALIAS hdf5::h5dump-shared) ++ set (HDF5_DUMP_EXECUTABLE $) ++ else() ++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static) ++ #add_executable(h5dump ALIAS hdf5::h5dump) + set (HDF5_DUMP_EXECUTABLE $) +- +- set (HDF5_HAVE_H5PUBCONF_H 1) +- set (HDF5_HAVE_HDF5 1) +- set (HDF5_HDF5_HEADER "h5pubconf.h") +- set (HDF5_INCLUDE_DIR_GEN ${HDF5_INCLUDE_DIR}) +- message (STATUS "HDF5-${HDF5_VERSION_STRING} found: INC=${HDF5_INCLUDE_DIR} TOOLS=${HDF5_TOOLS_DIR}") +- else (HDF5_FOUND) +- find_package (HDF5) # Legacy find +-#Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here +- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY_DIRS}/../bin) +-#Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here +- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY_DIRS}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") +- set (HDF5_BUILD_SHARED_LIBS 1) +- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) +- else () +- set (HDF5_BUILD_SHARED_LIBS 0) +- add_definitions (-DH5_BUILT_AS_STATIC_LIB) +- endif () +- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) +- +- add_executable (h5dump IMPORTED) +- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") +- set (HDF5_DUMP_EXECUTABLE $) +- endif (HDF5_FOUND) +- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME}) +- ++ endif() ++ + if (HDF5_FOUND) + set (HDF5_HAVE_H5PUBCONF_H 1) + set (HDF5_HAVE_HDF5 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 66b547ed1..4051f07d4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -12,13 +12,14 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) + if (CGNS_ENABLE_HDF5) + add_definitions(-DBUILD_HDF5) + if (WIN32) +- if (HDF5_LIBRARY) ++ add_definitions(-DWIN32) ++ if (HDF5_BUILD_SHARED_LIBS) + # file(STRINGS ${HDF5_LIBRARY} HDF5isDLL REGEX "__imp__H5close") + # if (HDF5isDLL) + # this is only needed when using hdf5 dll libs +- add_definitions(-DWIN32 -D_HDF5USEDLL_) ++ add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) + # endif (HDF5isDLL) +- endif (HDF5_LIBRARY) ++ endif (HDF5_BUILD_SHARED_LIBS) + endif (WIN32) + if(HDF5_NEED_MPI AND MPI_INC) + include_directories(${MPI_INC}) diff --git a/ports/cgns/linux_lfs.patch b/ports/cgns/linux_lfs.patch new file mode 100644 index 00000000000000..3ccda64e27a304 --- /dev/null +++ b/ports/cgns/linux_lfs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46446da8a..a3d8cd98f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,6 +82,7 @@ if (CGNS_ENABLE_LFS) + else (WIN32) + check_symbol_exists(open64 "sys/types.h;sys/stat.h;unistd.h" HAVE_OPEN64) + check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64) ++ add_definitions(-D_FILE_OFFSET_BITS=64 -D__LARGEFILE64_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + endif (WIN32) + if (HAVE_OPEN64) + add_definitions(-DHAVE_OPEN64) diff --git a/ports/cgns/portfile.cmake b/ports/cgns/portfile.cmake new file mode 100644 index 00000000000000..39b65d55f26fc2 --- /dev/null +++ b/ports/cgns/portfile.cmake @@ -0,0 +1,88 @@ + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO CGNS/CGNS + REF 3420e23febf0eb38c1b05af3c157d614d8476557 # v3.4.0 + SHA512 3fec1c32f1514cd9bc327f12f3f9db6a229df05f514193bd9e913d06b8ae6465664410a3c77a30b0c29f3e999e5efcb1ebed3a8b80e14be92035940c10b1d6d7 + HEAD_REF develop + PATCHES + hdf5.patch + linux_lfs.patch + zlib_szip_mpi.patch + defines.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + mpi HDF5_NEEDS_MPI + fortran CGNS_ENABLE_FORTRAN + tests CGNS_ENABLE_TESTS + hdf5 CGNS_ENABLE_HDF5 + lfs CGNS_ENABLE_LFS + legacy CGNS_ENABLE_LEGACY +) + +if(VCPKG_TARGET_ARCHITECTURE MATCHES "64") + list(APPEND CGNS_BUILD_OPTS "-DCGNS_ENABLE_64BIT=ON") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=ON;-DCGNS_USE_SHARED=ON") +else() + list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=OFF;-DCGNS_USE_SHARED=OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + ${FEATURE_OPTIONS} + ${CGNS_BUILD_OPTS} +) + +vcpkg_install_cmake() + +file(INSTALL ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h) + +file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # we patched the config and the include is all that is needed + +set(TOOLS cgnscheck cgnscompress cgnsconvert cgnsdiff cgnslist cgnsnames) + +foreach(tool ${TOOLS}) + set(suffix ${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}") + file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}" + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}") + endif() +endforeach() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +IF(EXISTS ${CURRENT_PACKAGES_DIR}/debug) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/debug/include/cgnsconfig.h) +endif() + +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h) +file(GLOB_RECURSE BATCH_FILES ${CURRENT_PACKAGES_DIR}/bin/*.bat) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +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) +endif() + +# # Moves all .cmake files from /debug/share/cgns/ to /share/cgns/ +# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details +# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/cgns) + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# # Post-build test for cmake libraries +# vcpkg_test_cmake(PACKAGE_NAME cgns) diff --git a/ports/cgns/zlib_szip_mpi.patch b/ports/cgns/zlib_szip_mpi.patch new file mode 100644 index 00000000000000..4f6608cf4d1641 --- /dev/null +++ b/ports/cgns/zlib_szip_mpi.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46446da8a..cd05cf51a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -219,20 +221,10 @@ if (CGNS_ENABLE_HDF5) + endif (HDF5_FOUND) + + set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") +- if(HDF5_NEED_ZLIB) +- find_library(ZLIB_LIBRARY z) +- mark_as_advanced(CLEAR ZLIB_LIBRARY) +- else (HDF5_NEED_ZLIB) +- mark_as_advanced(FORCE ZLIB_LIBRARY) +- endif(HDF5_NEED_ZLIB) ++ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE) + + set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") +- if (HDF5_NEED_SZIP) +- find_library(SZIP_LIBRARY szip) +- mark_as_advanced(CLEAR SZIP_LIBRARY) +- else (HDF5_NEED_SZIP) +- mark_as_advanced(FORCE SZIP_LIBRARY) +- endif (HDF5_NEED_SZIP) ++ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE) + + # Check if HDF5 version is 1.8 or greater + if (HDF5_VERSION VERSION_LESS "1.8.0") +@@ -240,6 +231,7 @@ if (CGNS_ENABLE_HDF5) + endif (HDF5_VERSION VERSION_LESS "1.8.0") + + set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)") ++ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE) + set(MPI_INC) + set(MPI_LIBS) + if (HDF5_NEED_MPI) diff --git a/ports/civetweb/CONTROL b/ports/civetweb/CONTROL index eb9ee3ed027a94..eb9ef7fd645d2f 100644 --- a/ports/civetweb/CONTROL +++ b/ports/civetweb/CONTROL @@ -1,5 +1,6 @@ Source: civetweb -Version: 2019-07-05-1 +Version: 1.12 +Homepage: https://github.com/civetweb/civetweb Description: Easy to use, powerful, C/C++ embeddable web server. Supports: !uwp diff --git a/ports/civetweb/portfile.cmake b/ports/civetweb/portfile.cmake index 39c63309b4b6b8..ee39432b0e9ff1 100644 --- a/ports/civetweb/portfile.cmake +++ b/ports/civetweb/portfile.cmake @@ -1,16 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() +vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP" ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO civetweb/civetweb - REF 2c1caa6e690bfe3b435a10c372ab2dcd14b872e8 - SHA512 bfd37906f85c10649108f83e755f28f058c0c27b0d597e6eb82f097db7fa043f6014984f1735c904d0e01c8a5e0dc45f1c57c1fb45b08bce78f42539e19160d6 + REF 4b440a339979852d5a51fb11a822952712231c23 # v1.12 + SHA512 02b77cb7140eaab9c7d34461ec2e5ea3354601e369be424a48f4734acbd4f77a450b969ed7a0c0940fcac1900c3d78bae26e29dd6a396189862075781917f428 HEAD_REF master ) @@ -39,6 +35,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/civetweb) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/civetweb/copyright COPYONLY) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/cjson/CONTROL b/ports/cjson/CONTROL index 51557451ebb892..27474316a4f6ed 100644 --- a/ports/cjson/CONTROL +++ b/ports/cjson/CONTROL @@ -1,5 +1,5 @@ Source: cjson -Version: 2019-11-30 +Version: 2019-11-30-1 Description: Ultralightweight JSON parser in ANSI C Homepage: https://github.com/DaveGamble/cJSON diff --git a/ports/cjson/portfile.cmake b/ports/cjson/portfile.cmake index eefb66659987d1..8332562f0500b6 100644 --- a/ports/cjson/portfile.cmake +++ b/ports/cjson/portfile.cmake @@ -15,8 +15,10 @@ vcpkg_check_features( if(CMAKE_HOST_WIN32) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_PUBLIC_SYMBOLS) + string(COMPARE NOTEQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" DENABLE_HIDDEN_SYMBOLS) else() set(ENABLE_PUBLIC_SYMBOLS OFF) + set(DENABLE_HIDDEN_SYMBOLS OFF) endif() vcpkg_configure_cmake( @@ -26,6 +28,7 @@ vcpkg_configure_cmake( -DBUILD_SHARED_AND_STATIC_LIBS=OFF -DCJSON_OVERRIDE_BUILD_SHARED_LIBS=OFF -DENABLE_PUBLIC_SYMBOLS=${ENABLE_PUBLIC_SYMBOLS} + -DENABLE_HIDDEN_SYMBOLS=${DENABLE_HIDDEN_SYMBOLS} -DENABLE_TARGET_EXPORT=ON # Export CMake config files -DENABLE_CJSON_TEST=OFF -DENABLE_FUZZING=OFF diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index a45da331a73d5c..76e53e29fa4b5e 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,5 +1,6 @@ Source: clapack -Version: 3.2.1-12 +Version: 3.2.1 +Port-Version: 13 Homepage: https://www.netlib.org/clapack Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 5524f62d54a735..1de30b1093869a 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_download_distfile(ARCHIVE @@ -15,13 +13,22 @@ vcpkg_extract_source_archive_ex( remove_internal_blas.patch fix-ConfigFile.patch fix-install.patch + support-uwp.patch ) +if (VCPKG_TARGET_IS_UWP) + if (NOT EXISTS ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/arithchk.exe) + message(FATAL_ERROR "Please install ${PORT}:x86-windows first.") + endif() + set(ARITHCHK_PATH ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/arithchk.exe) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DCMAKE_DEBUG_POSTFIX=d + -DARITHCHK_PATH=${ARITHCHK_PATH} ) vcpkg_install_cmake() @@ -37,4 +44,4 @@ file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PA file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/clapack/support-uwp.patch b/ports/clapack/support-uwp.patch new file mode 100644 index 00000000000000..3cbb750be2d9a3 --- /dev/null +++ b/ports/clapack/support-uwp.patch @@ -0,0 +1,95 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index db58b4e..0fb61a0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,6 +15,9 @@ if(NOT USE_BLAS_WRAP) + # _zrotg_ seems to be missing in the wrap header + add_definitions(-DNO_BLAS_WRAP) + endif() ++if (ARITHCHK_PATH) ++ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) ++endif() + include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE) + add_subdirectory(F2CLIBS) + add_subdirectory(SRC) +diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt +index 094614a..e5b40ab 100644 +--- a/F2CLIBS/libf2c/CMakeLists.txt ++++ b/F2CLIBS/libf2c/CMakeLists.txt +@@ -44,12 +44,19 @@ if(UNIX) + endif() + set_target_properties(arithchk PROPERTIES COMPILE_DEFINITIONS + "NO_FPINIT;NO_LONG_LONG") ++ ++if (ARITHCHK_PATH) ++ADD_CUSTOM_COMMAND( ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/arith.h ++ COMMAND ${ARITHCHK_PATH} > ${CMAKE_CURRENT_BINARY_DIR}/arith.h ++ ) ++else() + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/arith.h + COMMAND arithchk > ${CMAKE_CURRENT_BINARY_DIR}/arith.h + DEPENDS arithchk + ) +- ++endif() + + set(OFILES ${MISC} ${POW} ${CX} ${DCX} ${REAL} ${DBL} ${INT} + ${HALF} ${CMP} ${EFL} ${CHAR} ${I77} ${TIME}) +@@ -69,3 +76,6 @@ install(TARGETS f2c EXPORT clapack-targets + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include) + ++install(TARGETS arithchk ++ RUNTIME DESTINATION tools ++) +\ No newline at end of file +diff --git a/F2CLIBS/libf2c/inquire.c b/F2CLIBS/libf2c/inquire.c +index 5936a67..4846d41 100644 +--- a/F2CLIBS/libf2c/inquire.c ++++ b/F2CLIBS/libf2c/inquire.c +@@ -32,7 +32,7 @@ integer f_inqu(inlist *a) + { byfile=1; + g_char(a->infile,a->infilen,buf); + #ifdef NON_UNIX_STDIO +- x = access(buf,0) ? -1 : 0; ++ x = _access(buf,0) ? -1 : 0; + for(i=0,p=NULL;inext) + if (nl == y->nl) + return y; +@@ -308,7 +308,7 @@ x_rsne(cilist *a) + char buf[64]; + hashtab *ht; + Vardesc *v; +- dimen *dn, *dn0, *dn1; ++ dimen *dn = NULL, *dn0 = NULL, *dn1; + ftnlen *dims, *dims1; + ftnlen b, b0, b1, ex, no, nomax, size, span; + ftnint no1, no2, type; diff --git a/ports/cli/CONTROL b/ports/cli/CONTROL index 65fba35217e7c6..b84813e2ff34c6 100644 --- a/ports/cli/CONTROL +++ b/ports/cli/CONTROL @@ -1,5 +1,5 @@ Source: cli -Version: 1.1.1 +Version: 1.2.0 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 54ae21ba05069e..77813db666b97b 100644 --- a/ports/cli/portfile.cmake +++ b/ports/cli/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO daniele77/cli - REF v1.1.1 - SHA512 c5046450af8818e23fc5187e66a963cfa981042a99b66c52bfe6119bf126348cd38c50472bc267197e4175ee056f8cf639b09846675450d67c06c1c64f64acba + REF v1.2.0 + SHA512 ff548cbc1a77ded32f67d0ff4740d2abb31226cb6f0d9d431e1a35dcdfcaf68a2b9e16e926fc88f19aa17f5c6f5f8e2aead83ff65d7557c192bdd7d4ce2a2d3e HEAD_REF master ) diff --git a/ports/cmocka/CONTROL b/ports/cmocka/CONTROL index 042cf23a7ed885..090b8ca799a435 100644 --- a/ports/cmocka/CONTROL +++ b/ports/cmocka/CONTROL @@ -1,3 +1,4 @@ Source: cmocka -Version: 1.1.5-1 +Version: 1.1.5 +Port-Version: 3 Description: An elegant unit testing framework for C with support for mock objects diff --git a/ports/coin/CONTROL b/ports/coin/CONTROL new file mode 100644 index 00000000000000..9f6ae24eded677 --- /dev/null +++ b/ports/coin/CONTROL @@ -0,0 +1,31 @@ +Source: coin +Version: 4.0.0 +Description: A high-level 3D visualization library with Open Inventor 2.1 API +Build-Depends: boost-assert, boost-config, boost-lexical-cast, boost-math, boost-smart-ptr, boost-static-assert +Homepage: https://github.com/coin3d/coin +Default-Features: simage, zlib +Supports: !(arm|arm64|uwp) + +Feature: bzip2 +Build-Depends: bzip2, freetype[bzip2] +Description: Support bzip2 compressed fonts + +Feature: fontconfig +Build-Depends: fontconfig +Description: Use fontconfig for font support + +Feature: freetype +Build-Depends: freetype +Description: Use freetype for font support + +Feature: openal +Build-Depends: openal-soft +Description: Use OpenAL for sound support in VRML97 + +Feature: simage +Build-Depends: simage +Description: Use simage for loading images (textures), audio, and animations + +Feature: zlib +Build-Depends: zlib +Description: Use zlib for reading/writing compressed files diff --git a/ports/coin/disable-cpackd.patch b/ports/coin/disable-cpackd.patch new file mode 100644 index 00000000000000..81afeb668d26d2 --- /dev/null +++ b/ports/coin/disable-cpackd.patch @@ -0,0 +1,10 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f32f6ffe3..639fc4109 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -815,4 +815,4 @@ endif() + + # ############################################################################ + # New CPACK section, please see the README file inside cpack.d directory. +-add_subdirectory(cpack.d) ++#add_subdirectory(cpack.d) diff --git a/ports/coin/portfile.cmake b/ports/coin/portfile.cmake new file mode 100644 index 00000000000000..8039845d842e35 --- /dev/null +++ b/ports/coin/portfile.cmake @@ -0,0 +1,43 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm" "arm64") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Coin3D/coin + REF Coin-4.0.0 + SHA512 8a0289cab3e02a7417022fe659ec30a2dd705b9bacb254e0269ada9155c76c6aea0285c475cd6e663f5d7f2b49e60244b16baac7188d57e3d7f8ab08d228f21f + HEAD_REF master + PATCHES + disable-cpackd.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(COIN_BUILD_MSVC_STATIC_RUNTIME ON) + set(COIN_BUILD_SHARED_LIBS OFF) +else() + set(COIN_BUILD_MSVC_STATIC_RUNTIME OFF) + set(COIN_BUILD_SHARED_LIBS ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCOIN_BUILD_DOCUMENTATION=OFF + -DCOIN_BUILD_MSVC_STATIC_RUNTIME=${COIN_BUILD_MSVC_STATIC_RUNTIME} + -DCOIN_BUILD_SHARED_LIBS=${COIN_BUILD_SHARED_LIBS} + -DCOIN_BUILD_TESTS=OFF +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Coin-4.0.0) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +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(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/Coin/profiler) 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/coolprop/CONTROL b/ports/coolprop/CONTROL index 4f5390ca1eb72f..ab6b355c704bd8 100644 --- a/ports/coolprop/CONTROL +++ b/ports/coolprop/CONTROL @@ -1,5 +1,5 @@ Source: coolprop -Version: 6.1.0-4 +Version: 6.1.0-5 Homepage: https://github.com/CoolProp/CoolProp Description: Thermophysical properties for the masses Build-Depends: catch, eigen3, pybind11, if97, fmt, rapidjson, msgpack, refprop-headers diff --git a/ports/coolprop/fix-builderror.patch b/ports/coolprop/fix-builderror.patch new file mode 100644 index 00000000000000..a0d4a9b61c2b6c --- /dev/null +++ b/ports/coolprop/fix-builderror.patch @@ -0,0 +1,13 @@ +diff --git a/src/ODEIntegrators.cpp b/src/ODEIntegrators.cpp +index ce86cf6..681db13 100644 +--- a/src/ODEIntegrators.cpp ++++ b/src/ODEIntegrators.cpp +@@ -4,6 +4,8 @@ + #include "CPstrings.h" + #include "Exceptions.h" + #include ++#undef max ++#undef min + + bool ODEIntegrators::AdaptiveRK54(AbstractODEIntegrator &ode, double tstart, double tend, double hmin, double hmax, double eps_allowed, double step_relax) + { diff --git a/ports/coolprop/portfile.cmake b/ports/coolprop/portfile.cmake index 2406ea819f2d16..b560531e22040f 100644 --- a/ports/coolprop/portfile.cmake +++ b/ports/coolprop/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) set(PORT_VERSION 6.1.0) vcpkg_from_github( @@ -8,12 +7,13 @@ vcpkg_from_github( SHA512 a44eafc84f2b88259d7bcf6cfa81daeb81ea9d55bd356e59b3ef77b6f68ea405961c7cb54ba899e3896bb2a02d3e01119a4a51f72899126c8da6081fa2ece948 HEAD_REF master PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fmt-fix.patch + fmt-fix.patch + fix-builderror.patch ) vcpkg_find_acquire_program(PYTHON2) get_filename_component(PYTHON2_DIR ${PYTHON2} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}") +vcpkg_add_to_path(${PYTHON2_DIR}) file(REMOVE_RECURSE ${SOURCE_PATH}/externals) @@ -118,6 +118,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/${TARGET_FOLDER} ${CURRENT_PAC # Handle copyright file( INSTALL ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/coolprop + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright ) diff --git a/ports/coroutine/CONTROL b/ports/coroutine/CONTROL deleted file mode 100644 index c716f258591be4..00000000000000 --- a/ports/coroutine/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: coroutine -Version: 2020-01-13 -Build-Depends: ms-gsl -Description: C++ coroutine helper/example library -Supports: !x86 \ No newline at end of file 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 a38911f3c477a2..3c5f27b72caaab 100644 --- a/ports/coroutine/portfile.cmake +++ b/ports/coroutine/portfile.cmake @@ -1,38 +1,32 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") -if(${VCPKG_TARGET_ARCHITECTURE} MATCHES x86) - message(FATAL_ERROR "This library doesn't support x86 arch. Please use x64 instead. If it is critical, create an issue at the repo: github.com/luncliff/coroutine") +if(VCPKG_TARGET_IS_LINUX) + message("Warning: `coroutine` requires libc++ and Clang or GCC 10+ on Linux") endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO luncliff/coroutine - REF fcd970807e9a47c250c1a4e06c7dc6d93079b684 - SHA512 517f1c1726e4adc36cd34379c545324c99861d7cb5ebd3cebe0b7132fe5b61969a00e405bc106bb8f089f37d3a7ca9b1bcdc665a5cd6dfcaaf6856be37bec5b0 + REF 1.5.0 + SHA512 61b91fdc641b6905b884e99c5bf193ec2cf6962144ab3baafdb9432115757d96f3797f116b30356f0d21417b23082bc908f75042721caeab3329c4910b654594 HEAD_REF master + PATCHES fix-errorC7651.patch ) -# package: 'ms-gsl' -set(GSL_INCLUDE_DIR ${CURRENT_INSTALLED_DIR}/include - CACHE PATH "path to include C++ core guideline support library" FORCE) -message(STATUS "Using ms-gsl at ${GSL_INCLUDE_DIR}") - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DGSL_INCLUDE_DIR=${GSL_INCLUDE_DIR} - -DTEST_DISABLED=True + -DGSL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include + -DBUILD_TESTING=False ) - vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() -file( - INSTALL ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/coroutine - RENAME copyright +file(INSTALL ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright ) +vcpkg_copy_pdbs() -# removed duplicates in debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) 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/corrade/CONTROL b/ports/corrade/CONTROL index 091144941de857..d59fa6f0a43777 100644 --- a/ports/corrade/CONTROL +++ b/ports/corrade/CONTROL @@ -1,5 +1,5 @@ Source: corrade -Version: 2019.10-1 +Version: 2020.06 Description: C++11/C++14 multiplatform utility library Homepage: https://magnum.graphics/corrade/ Default-Features: interconnect, pluginmanager, testsuite, utility diff --git a/ports/corrade/portfile.cmake b/ports/corrade/portfile.cmake index 3c82bd94ba8616..78c7a2a04ec2b8 100644 --- a/ports/corrade/portfile.cmake +++ b/ports/corrade/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/corrade - REF v2019.10 - SHA512 5d161f78844b06e1a9979c7e244968a691012e7212e05df3ee3572f5df9aa69e86309f426a89f356f483f6de3871366a8e11b1701a578f865ea738cc8eee515b + REF v2020.06 + SHA512 94cc8959b0ee43ecd8d13a25307e7829d53dc6601628d97c32288d1704e2c0835b755bffc06b2105e6aa5a612f119a60e83cb475860b51e6a35999215c100227 HEAD_REF master ) @@ -31,7 +31,6 @@ vcpkg_configure_cmake( OPTIONS -DUTILITY_USE_ANSI_COLORS=ON -DBUILD_STATIC=${BUILD_STATIC} - ${_CUSTOM_BUILD_FLAGS} ${_COMPONENT_FLAGS} ) @@ -43,21 +42,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Install tools if("utility" IN_LIST FEATURES) - file(GLOB EXES - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe - ) - # Drop a copy of tools - file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade) - - # Tools require dlls - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade) - - file(GLOB TO_REMOVE - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc* - ${CURRENT_PACKAGES_DIR}/debug/bin/corrade-rc*) - file(REMOVE ${TO_REMOVE}) + vcpkg_copy_tools(TOOL_NAMES "corrade-rc" AUTO_CLEAN) endif() # Ensure no empty folders are left behind @@ -78,10 +64,9 @@ elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING - DESTINATION ${CURRENT_PACKAGES_DIR}/share/corrade) -file(RENAME - ${CURRENT_PACKAGES_DIR}/share/corrade/COPYING - ${CURRENT_PACKAGES_DIR}/share/corrade/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + vcpkg_copy_pdbs() diff --git a/ports/cpp-httplib/CONTROL b/ports/cpp-httplib/CONTROL index 0cec8643aac32e..4f794d11a08522 100644 --- a/ports/cpp-httplib/CONTROL +++ b/ports/cpp-httplib/CONTROL @@ -1,4 +1,4 @@ Source: cpp-httplib -Version: 0.5.1 +Version: 0.7.0 Homepage: https://github.com/yhirose/cpp-httplib Description: A single file C++11 header-only HTTP/HTTPS server and client library diff --git a/ports/cpp-httplib/portfile.cmake b/ports/cpp-httplib/portfile.cmake index bbf7daf8822a1c..c23cd61af3517f 100644 --- a/ports/cpp-httplib/portfile.cmake +++ b/ports/cpp-httplib/portfile.cmake @@ -1,8 +1,9 @@ +# Header-only library vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO yhirose/cpp-httplib - REF v0.5.1 - SHA512 808ad4a9b4d2a6d25eb342985a9d2407c252b6cdf85da2372b7426338c59ccaf49b2a04a4aa1cb0c97487ab8ec6ab5c098e1785edcccd94296488539af6ba1ef + REF v0.7.0 + SHA512 4ffbeb6672dec5f3704d6c3da09acf0e1984b5c7c68455f7fb030a7457bc64983665498015f2372d8a85da02be1750bab03dae956653297ac8efef67ff682854 HEAD_REF master ) @@ -12,4 +13,4 @@ file( ) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpp-httplib RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cpp-taskflow/CONTROL b/ports/cpp-taskflow/CONTROL index 69b58ea81d8c1f..ee3e33ed041cb1 100644 --- a/ports/cpp-taskflow/CONTROL +++ b/ports/cpp-taskflow/CONTROL @@ -1,3 +1,4 @@ Source: cpp-taskflow -Version: 2.2.0 +Version: 2.2.0-1 Description: Fast Parallel Tasking Programming Library using Modern C++. +Homepage: https://github.com/taskflow/taskflow diff --git a/ports/cpp-taskflow/portfile.cmake b/ports/cpp-taskflow/portfile.cmake index 5160d02a260a31..8e2964337e79a9 100644 --- a/ports/cpp-taskflow/portfile.cmake +++ b/ports/cpp-taskflow/portfile.cmake @@ -1,12 +1,9 @@ # header-only library - -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO cpp-taskflow/cpp-taskflow + REPO taskflow/taskflow REF v2.2.0 - SHA512 c075f1b7e4dd6ed6d9561b860b660ee4b28eddb321d8aa8746fbec45b1039ab686700156e4273da5a4ac7af0707975331befd9bf3e51f18925ea3a9a60083549 + SHA512 1aa4e9d7324f56eb33cd4986d721035f0abf12e022da956bafc0b16cf6cb82d152334ae58edc4581ab2f6d44989ca21cdd590ad560d6f1a4f905710fe08d0091 HEAD_REF master ) @@ -26,4 +23,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/cpp-taskflow/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file 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/cppcms/CONTROL b/ports/cppcms/CONTROL index 35296edc15eac1..2acc51fdf590ce 100644 --- a/ports/cppcms/CONTROL +++ b/ports/cppcms/CONTROL @@ -1,5 +1,6 @@ Source: cppcms -Version: 1.2.1 +Version: 1.2.1-1 Homepage: https://github.com/artyom-beilis/cppcms Description: CppCMS is a Free High Performance Web Development Framework (not a CMS) aimed at Rapid Web Application Development Build-Depends: icu, pcre, openssl, zlib +Supports: !(linux|osx) diff --git a/ports/cppcms/portfile.cmake b/ports/cppcms/portfile.cmake index e6c6cfa2a68131..383022fab97eaa 100644 --- a/ports/cppcms/portfile.cmake +++ b/ports/cppcms/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install( ON_TARGET "linux" "osx") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) @@ -6,7 +6,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO artyom-beilis/cppcms REF b72b19915794d1af63c9a9e9bea58e20a4ad93d4 - SHA512 e99d34d14fbde22be725ac2c0bec069fb584e45c66767af75efaf454ca61a7a5e57434bf86109f910884c72202b8cf98fe16505e7d3d30d9218abd4d8b27d5df + SHA512 e99d34d14fbde22be725ac2c0bec069fb584e45c66767af75efaf454ca61a7a5e57434bf86109f910884c72202b8cf98fe16505e7d3d30d9218abd4d8b27d5df ) vcpkg_find_acquire_program(PYTHON2) @@ -15,7 +15,7 @@ get_filename_component(PYTHON2_DIR ${PYTHON2} DIRECTORY) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DCMAKE_PROGRAM_PATH=${PYTHON2_DIR} -DUSE_WINDOWS6_API=ON + OPTIONS -DCMAKE_PROGRAM_PATH=${PYTHON2_DIR} -DUSE_WINDOWS6_API=ON ) vcpkg_install_cmake() @@ -26,6 +26,4 @@ file(REMOVE ${EXE_DEBUG_FILES}) file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(REMOVE ${EXE_FILES}) -# Handle copyright -file(COPY ${SOURCE_PATH}/MIT.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppcms) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/cppcms/MIT.TXT ${CURRENT_PACKAGES_DIR}/share/cppcms/copyright) +file(INSTALL ${SOURCE_PATH}/MIT.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cppcoro/CMakeLists.txt b/ports/cppcoro/CMakeLists.txt new file mode 100644 index 00000000000000..975dae4f26dd6c --- /dev/null +++ b/ports/cppcoro/CMakeLists.txt @@ -0,0 +1,202 @@ +cmake_minimum_required(VERSION 3.8) +project(cppcoro VERSION 2020.2 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) + +add_library(cppcoro + lib/async_mutex.cpp + lib/lightweight_manual_reset_event.cpp + lib/async_auto_reset_event.cpp + lib/async_manual_reset_event.cpp + lib/auto_reset_event.cpp + lib/auto_reset_event.hpp + lib/cancellation_registration.cpp + lib/cancellation_source.cpp + lib/cancellation_state.cpp + lib/cancellation_state.hpp + lib/cancellation_token.cpp + lib/spin_mutex.cpp + lib/spin_mutex.hpp + lib/spin_wait.cpp + lib/spin_wait.hpp + lib/static_thread_pool.cpp + lib/ip_address.cpp + lib/ip_endpoint.cpp + lib/ipv4_address.cpp + lib/ipv4_endpoint.cpp + lib/ipv6_address.cpp + lib/ipv6_endpoint.cpp +) + +if(APPLE) + message(STATUS "using sysroot: ${CMAKE_OSX_SYSROOT}") +elseif(WIN32) + message(STATUS "using platform: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") + # for now, build in single target + target_sources(cppcoro + PRIVATE + lib/win32.cpp + lib/file.cpp + lib/file_read_operation.cpp + lib/file_write_operation.cpp + lib/read_only_file.cpp + lib/read_write_file.cpp + lib/readable_file.cpp + lib/writable_file.cpp + lib/write_only_file.cpp + lib/socket.cpp + lib/socket_accept_operation.cpp + lib/socket_connect_operation.cpp + lib/socket_send_operation.cpp + lib/socket_send_to_operation.cpp + lib/socket_disconnect_operation.cpp + lib/socket_helpers.cpp + lib/socket_helpers.hpp + lib/socket_recv_from_operation.cpp + lib/socket_recv_operation.cpp + lib/io_service.cpp + ) +elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") + message(STATUS "using system: ${CMAKE_HOST_SYSTEM_VERSION}") +endif() + +target_include_directories(cppcoro +PUBLIC + $ + $ +) + +if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + if(WIN32) + message(FATAL_ERROR " doesn't support clang-cl compiler") + else() + target_compile_options(cppcoro + PUBLIC + -std=c++1z -fcoroutines-ts + -stdlib=libc++ + ) + target_link_libraries(cppcoro + PUBLIC + c++ pthread + ) + endif() + +elseif(MSVC) + target_compile_options(cppcoro + PUBLIC + /await + PRIVATE + "/analyze:max_paths 512" + -D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING=1 + ) + if(CMAKE_GENERATOR_PLATFORM STREQUAL x64) + target_compile_options(cppcoro + PUBLIC + /await:heapelide + ) + endif() + +endif() + +if(WIN32) + target_link_libraries(cppcoro + PUBLIC + kernel32 synchronization ws2_32 mswsock + # msvcrt[d] msvcprt[d] vcruntime ucrt + ) +elseif(APPLE) + +elseif(CMAKE_SYSTEM_NAME MATCHES Linux) + target_link_libraries(cppcoro + PUBLIC + c++ # stdc++ # expect libc++ instead of libstdc++ + ) +endif() + +install(DIRECTORY include/cppcoro + DESTINATION include +) + +install(TARGETS cppcoro + EXPORT ${PROJECT_NAME}-config + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +install(EXPORT ${PROJECT_NAME}-config + DESTINATION share/${PROJECT_NAME} +) + +include(CMakePackageConfigHelpers) +set(VERSION_FILE_PATH ${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}-config-version.cmake) +write_basic_package_version_file(${VERSION_FILE_PATH} + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion +) + +install(FILES ${VERSION_FILE_PATH} + DESTINATION share/${PROJECT_NAME} +) + +if(NOT BUILD_TESTING) + return() +endif() +enable_testing() +find_package(Threads REQUIRED) + +add_executable(cppcoro_test + test/main.cpp test/counted.cpp + test/generator_tests.cpp + # test/recursive_generator_tests.cpp # clang crash + test/async_generator_tests.cpp + test/async_auto_reset_event_tests.cpp + test/async_manual_reset_event_tests.cpp + test/async_mutex_tests.cpp + test/async_latch_tests.cpp + test/cancellation_token_tests.cpp + test/task_tests.cpp + test/sequence_barrier_tests.cpp + test/shared_task_tests.cpp + test/sync_wait_tests.cpp + test/single_consumer_async_auto_reset_event_tests.cpp + test/single_producer_sequencer_tests.cpp + test/multi_producer_sequencer_tests.cpp + test/when_all_tests.cpp + test/when_all_ready_tests.cpp + test/ip_address_tests.cpp + test/ip_endpoint_tests.cpp + test/ipv4_address_tests.cpp + test/ipv4_endpoint_tests.cpp + test/ipv6_address_tests.cpp + test/ipv6_endpoint_tests.cpp + test/static_thread_pool_tests.cpp +) + +target_link_libraries(cppcoro_test +PRIVATE + cppcoro + Threads::Threads +) + +find_package(doctest CONFIG REQUIRED) +get_target_property(DOCTEST_INCLUDE_DIR doctest::doctest + INTERFACE_INCLUDE_DIRECTORIES +) +message(STATUS "using doctest: ${DOCTEST_INCLUDE_DIR}") +target_link_libraries(cppcoro_test +PRIVATE + doctest::doctest +) + +if(WIN32) + target_sources(cppcoro_test + PRIVATE + test/scheduling_operator_tests.cpp + test/io_service_tests.cpp + test/file_tests.cpp + test/socket_tests.cpp + ) +endif() + +add_test(NAME test_all COMMAND cppcoro_test --duration=true ) \ No newline at end of file diff --git a/ports/cppcoro/CONTROL b/ports/cppcoro/CONTROL new file mode 100644 index 00000000000000..ea3a391fa12d6e --- /dev/null +++ b/ports/cppcoro/CONTROL @@ -0,0 +1,5 @@ +Source: cppcoro +Homepage: https://github.com/lewissbaker/cppcoro +Version: 2020-2-28-1 +Description: A library of C++ coroutine abstractions for the Coroutines TS +Supports: !uwp diff --git a/ports/cppcoro/portfile.cmake b/ports/cppcoro/portfile.cmake new file mode 100644 index 00000000000000..7938a65ba067c3 --- /dev/null +++ b/ports/cppcoro/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +if(VCPKG_TARGET_IS_LINUX) + message("Warning: cppcoro requires libc++ and Clang on Linux. See https://github.com/microsoft/vcpkg/pull/10693#issuecomment-610394650.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lewissbaker/cppcoro + REF 92892f31d0c41b8e34e6292d7c9d99228da5c501 + SHA512 d1997b7449f1c5c0790575d0755ffbb5f9eef13a7610f3ec666a585bdbb93bb1553f79214c1023a1ef23aaeef64078ca6ee3784107645d7a75c7bba943c10b84 + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt + DESTINATION ${SOURCE_PATH} +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=False +) +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/cppgraphqlgen/CONTROL b/ports/cppgraphqlgen/CONTROL index e75e4407720961..659b914403bc28 100644 --- a/ports/cppgraphqlgen/CONTROL +++ b/ports/cppgraphqlgen/CONTROL @@ -1,5 +1,5 @@ Source: cppgraphqlgen -Version: 3.2.0 +Version: 3.2.2 Build-Depends: boost-filesystem (!uwp&!windows), boost-program-options, pegtl, rapidjson Description: C++ GraphQL schema service generator Homepage: https://github.com/microsoft/cppgraphqlgen diff --git a/ports/cppgraphqlgen/portfile.cmake b/ports/cppgraphqlgen/portfile.cmake index c89e6d4acfbe42..ab6c74d389a9f2 100644 --- a/ports/cppgraphqlgen/portfile.cmake +++ b/ports/cppgraphqlgen/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/cppgraphqlgen - REF 82763064a0551be86fa63f320206e863beef47c0 # v3.2.0 - SHA512 7c88cf95c0aa09eed18c8a807e4ee3ae7a74958e0bb95714f6e725d54bf4fadbce5438150e653d142aadcbeb2f167d5faad94b90728fd13c3fe54730fec559f0 + REF v3.2.2 + SHA512 69d29800935e36402b81fc2e379b7e6c2edb9ff5bf22cccb4a42cd2497576e5ca4a6e1b6179b8f3c188a0416d882fbc0e0ba72b5e78ee667a2f6847f5b806bf0 HEAD_REF master ) diff --git a/ports/cppitertools/CONTROL b/ports/cppitertools/CONTROL index 579a85a693cbe5..f74188303ca936 100644 --- a/ports/cppitertools/CONTROL +++ b/ports/cppitertools/CONTROL @@ -1,4 +1,5 @@ Source: cppitertools -Version: 2019-04-14-3 +Version: 2.0 +Homepage: https://github.com/ryanhaining/cppitertools Description: Range-based for loop add-ons inspired by the Python builtins and itertools library Build-Depends: boost-optional diff --git a/ports/cppitertools/fix-cmake-install-dir.patch b/ports/cppitertools/fix-cmake-install-dir.patch new file mode 100644 index 00000000000000..e3591f9baa01d6 --- /dev/null +++ b/ports/cppitertools/fix-cmake-install-dir.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3caa411..775ce02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ add_library(cppitertools::cppitertools ALIAS cppitertools) + + target_include_directories(cppitertools INTERFACE + $ +- $ ++ $ + ) + + +@@ -37,5 +37,5 @@ install(EXPORT cppitertools-targets + DESTINATION ${cppitertools_INSTALL_CMAKE_DIR}/cppitertools + ) + +-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppitertools-config-version.cmake DESTINATION ${cppitertools_INSTALL_CMAKE_DIR}) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppitertools-config-version.cmake DESTINATION ${cppitertools_INSTALL_CMAKE_DIR}/cppitertools) + install(DIRECTORY . DESTINATION ${cppitertools_INSTALL_INCLUDE_DIR}/cppitertools) diff --git a/ports/cppitertools/portfile.cmake b/ports/cppitertools/portfile.cmake index 26b6ee93b84a73..81ba94742ed6e8 100644 --- a/ports/cppitertools/portfile.cmake +++ b/ports/cppitertools/portfile.cmake @@ -1,16 +1,25 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO ryanhaining/cppitertools - REF 97bfd33cdc268426b20f189c13d3ed88f5e1f4c2 - SHA512 7b8926cf00b5be17fa89a1d1aea883e60848187bb00d637c40a20f6e11811add4785f2f461e530a6cd557d3be16490799ffcd7ea90bd7b58fdca549c3df03e8c - HEAD_REF master -) - -file(GLOB INCLUDE_FILES ${SOURCE_PATH}/*.hpp) -file(GLOB INCLUDE_INTERNAL_FILES ${SOURCE_PATH}/internal/*.hpp) - -file(COPY ${INCLUDE_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cppitertools) -file(COPY ${INCLUDE_INTERNAL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cppitertools/internal) - -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ryanhaining/cppitertools + REF d716cf6c8281ab6383d1fbecb456e0b9d808694c + SHA512 47bc490d798b445e965169a754dc977d5add217f133130671301dee6294744fa4b3f7a3b146cbd002c31325e5bc7c2206d57560a6db58693ca13ca972ca09d39 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -Dcppitertools_INSTALL_CMAKE_DIR=share +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug + ${CURRENT_PACKAGES_DIR}/share/cppitertools-config-version.cmake) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.md + DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppitertools + RENAME copyright) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index 6e4b6d5a1f226d..30f24ed6b641eb 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk -Version: 2.10.15-1 +Version: 2.10.16-3 Build-Depends: openssl (!uwp&!windows), boost-system (!uwp&!windows), boost-date-time (!uwp&!windows), boost-regex (!uwp&!windows), boost-thread (!uwp&!windows), boost-filesystem (!uwp&!windows), boost-random (!uwp&!windows), boost-chrono (!uwp&!windows), diff --git a/ports/cpprestsdk/fix-find-openssl.patch b/ports/cpprestsdk/fix-find-openssl.patch new file mode 100644 index 00000000000000..ec420e6771a060 --- /dev/null +++ b/ports/cpprestsdk/fix-find-openssl.patch @@ -0,0 +1,18 @@ +diff --git a/Release/cmake/cpprest_find_openssl.cmake b/Release/cmake/cpprest_find_openssl.cmake +index 9333663..c1df089 100644 +--- a/Release/cmake/cpprest_find_openssl.cmake ++++ b/Release/cmake/cpprest_find_openssl.cmake +@@ -36,8 +36,11 @@ function(cpprest_find_openssl) + # Prefer a homebrew version of OpenSSL over the one in /usr/lib + file(GLOB OPENSSL_ROOT_DIR /usr/local/Cellar/openssl*/*) + # Prefer the latest (make the latest one first) +- list(REVERSE OPENSSL_ROOT_DIR) +- list(GET OPENSSL_ROOT_DIR 0 OPENSSL_ROOT_DIR) ++ if(OPENSSL_ROOT_DIR) ++ # Prefer the latest (make the latest one first) ++ list(REVERSE OPENSSL_ROOT_DIR) ++ list(GET OPENSSL_ROOT_DIR 0 OPENSSL_ROOT_DIR) ++ endif() + endif() + # This should prevent linking against the system provided 0.9.8y + message(STATUS "OPENSSL_ROOT_DIR = ${OPENSSL_ROOT_DIR}") diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index 8c76683c522091..a9f1ce3f29f510 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -1,59 +1,53 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/cpprestsdk - REF v2.10.15 - SHA512 ef8884c9f7fde2b6a25357ef0e7ee87b473a2e3140af2c5af0e3be7776ac2e8c0da431a356892020a3c37c84e30396350e2083cd4e1192a41fd3e099e74179f7 + REF v2.10.16 + SHA512 d850b26051439dd10edcecd006075c64c61c565193cd76870af175bd343a72ecc59485deb0f907807071a57dd256b67139ad5d016f19cb38f7142357f430be1c HEAD_REF master + PATCHES fix-find-openssl.patch ) set(OPTIONS) -if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(NOT VCPKG_TARGET_IS_UWP) SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp") list(APPEND OPTIONS -DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH} -DWEBSOCKETPP_CONFIG_VERSION=${WEBSOCKETPP_PATH}) endif() -set(CPPREST_EXCLUDE_BROTLI ON) -if ("brotli" IN_LIST FEATURES) - set(CPPREST_EXCLUDE_BROTLI OFF) -endif() - -set(CPPREST_EXCLUDE_COMPRESSION ON) -if ("compression" IN_LIST FEATURES) - set(CPPREST_EXCLUDE_COMPRESSION OFF) -endif() - -set(CPPREST_EXCLUDE_WEBSOCKETS ON) -if("websockets" IN_LIST FEATURES) - set(CPPREST_EXCLUDE_WEBSOCKETS OFF) -endif() +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + brotli CPPREST_EXCLUDE_BROTLI + compression CPPREST_EXCLUDE_COMPRESSION + websockets CPPREST_EXCLUDE_WEBSOCKETS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/Release PREFER_NINJA OPTIONS ${OPTIONS} + ${FEATURE_OPTIONS} -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF - -DCPPREST_EXCLUDE_BROTLI=${CPPREST_EXCLUDE_BROTLI} - -DCPPREST_EXCLUDE_COMPRESSION=${CPPREST_EXCLUDE_COMPRESSION} - -DCPPREST_EXCLUDE_WEBSOCKETS=${CPPREST_EXCLUDE_WEBSOCKETS} -DCPPREST_EXPORT_DIR=share/cpprestsdk -DWERROR=OFF + -DPKG_CONFIG_EXECUTABLE=FALSE OPTIONS_DEBUG -DCPPREST_INSTALL_HEADERS=OFF ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/share/cpprestsdk) +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/share/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/share ${CURRENT_PACKAGES_DIR}/lib/share) -file(INSTALL - ${SOURCE_PATH}/license.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/cpprest/details/cpprest_compat.h + "#ifdef _NO_ASYNCRTIMP" "#if 1") +endif() -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cpputest/CONTROL b/ports/cpputest/CONTROL index cecf6e22181f42..7d08408292aef4 100644 --- a/ports/cpputest/CONTROL +++ b/ports/cpputest/CONTROL @@ -1,4 +1,4 @@ Source: cpputest -Version: 2019-9-16 +Version: 2019-9-16-1 Homepage: https://github.com/cpputest/cpputest Description: CppUTest unit testing and mocking framework for C/C++. \ No newline at end of file diff --git a/ports/cpputest/portfile.cmake b/ports/cpputest/portfile.cmake index 904f1d0b12dea5..4745ea469588aa 100644 --- a/ports/cpputest/portfile.cmake +++ b/ports/cpputest/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -8,7 +6,8 @@ vcpkg_from_github( REF 4699da9942a1bdcc33e2a8c8a48e863b0f18188e SHA512 6f588691f1b4092b3be8167ab09f3a4a64c34715ac9397210724121d161024a43b12a88198b02b0cc8da7d72406670daaf375bb64cc4cf92c8bd2479e7a881bc HEAD_REF master - PATCHES fix-arm-build-error.patch + PATCHES + fix-arm-build-error.patch ) vcpkg_configure_cmake( @@ -27,6 +26,32 @@ if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest) endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(GLOB CPPUTEST_LIBS ${CURRENT_PACKAGES_DIR}/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) + file(COPY ${CPPUTEST_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(REMOVE ${CPPUTEST_LIBS}) + + file(READ ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-release.cmake RELEASE_CONFIG) + # Replace CppUTestExt first + string(REPLACE "\${_IMPORT_PREFIX}/lib/" + "\${_IMPORT_PREFIX}/lib/manual-link/" RELEASE_CONFIG "${RELEASE_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-release.cmake "${RELEASE_CONFIG}") +endif() + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(GLOB CPPUTEST_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) + file(COPY ${CPPUTEST_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(REMOVE ${CPPUTEST_LIBS}) + + file(READ ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-debug.cmake DEBUG_CONFIG) + # Replace CppUTestExt first + string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/" + "\${_IMPORT_PREFIX}/debug/lib/manual-link/" DEBUG_CONFIG "${DEBUG_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/CppUTest/CppUTestTargets-debug.cmake "${DEBUG_CONFIG}") +endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) diff --git a/ports/cpuid/CONTROL b/ports/cpuid/CONTROL index 84209185fea674..8445533af5d9d4 100644 --- a/ports/cpuid/CONTROL +++ b/ports/cpuid/CONTROL @@ -1,5 +1,5 @@ Source: cpuid -Version: 0.4.1 +Version: 0.4.1-1 Homepage: https://github.com/anrieff/libcpuid Description: Provides CPU identification for the x86 (and x86_64) Supports: x86 | x64 diff --git a/ports/cpuid/fix-install-headers.patch b/ports/cpuid/fix-install-headers.patch new file mode 100644 index 00000000000000..d5c9c8641d30e2 --- /dev/null +++ b/ports/cpuid/fix-install-headers.patch @@ -0,0 +1,13 @@ +diff --git a/libcpuid/CMakeLists.txt b/libcpuid/CMakeLists.txt +index 96533ac..d71953f 100644 +--- a/libcpuid/CMakeLists.txt ++++ b/libcpuid/CMakeLists.txt +@@ -75,7 +75,7 @@ install(TARGETS cpuid + LIBRARY DESTINATION "lib" + ARCHIVE DESTINATION "lib" + RUNTIME DESTINATION "bin" +- INCLUDES DESTINATION "include") ++ PUBLIC_HEADER DESTINATION "include") + + install(FILES "${project_config}" "${version_config}" + DESTINATION "${config_install_dir}" diff --git a/ports/cpuid/portfile.cmake b/ports/cpuid/portfile.cmake index 70f80d70f67d71..48849dc0f07825 100644 --- a/ports/cpuid/portfile.cmake +++ b/ports/cpuid/portfile.cmake @@ -2,11 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm" "arm64") vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO anrieff/libcpuid - REF f2ab8b7ef2c286f619d96c3ce8902cb76b801bf0 - SHA512 fcd2d35994554eed80c04315f1cf3bc91f272a5051dde040fe2266d71af902b60ecfd74b6f9dc8284a22f222208c6789bfb94cc12d61de17d605265d3cd2c43d - HEAD_REF master + OUT_SOURCE_PATH SOURCE_PATH + REPO anrieff/libcpuid + REF f2ab8b7ef2c286f619d96c3ce8902cb76b801bf0 + SHA512 fcd2d35994554eed80c04315f1cf3bc91f272a5051dde040fe2266d71af902b60ecfd74b6f9dc8284a22f222208c6789bfb94cc12d61de17d605265d3cd2c43d + HEAD_REF master + PATCHES fix-install-headers.patch ) vcpkg_configure_cmake( diff --git a/ports/cpuinfo/CONTROL b/ports/cpuinfo/CONTROL index 180b2604319242..0c349078ed0f41 100644 --- a/ports/cpuinfo/CONTROL +++ b/ports/cpuinfo/CONTROL @@ -1,5 +1,5 @@ Source: cpuinfo -Version: 2019-07-28 +Version: 2019-07-28-1 Description: CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS) Homepage: https://github.com/pytorch/cpuinfo diff --git a/ports/cpuinfo/portfile.cmake b/ports/cpuinfo/portfile.cmake index b5279e30dcfb65..9b3db8e45b5fe6 100644 --- a/ports/cpuinfo/portfile.cmake +++ b/ports/cpuinfo/portfile.cmake @@ -47,19 +47,10 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(tools IN_LIST FEATURES) - foreach(cpuinfo_tool cache-info cpuid-dump cpu-info isa-info) - file(COPY - ${CURRENT_PACKAGES_DIR}/bin/${cpuinfo_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT} - ) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - endforeach() - - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - else() - # TODO: Fix it once this lib supports dynamic building. - endif() + vcpkg_copy_tools( + TOOL_NAMES cache-info cpuid-dump cpu-info isa-info + AUTO_CLEAN + ) endif() # Handle copyright diff --git a/ports/cr/CONTROL b/ports/cr/CONTROL new file mode 100644 index 00000000000000..864d23f639be79 --- /dev/null +++ b/ports/cr/CONTROL @@ -0,0 +1,4 @@ +Source: cr +Version: 2020-04-26 +Homepage: https://fungos.github.io/cr-simple-c-hot-reload/ +Description: cr.h: A Simple C Hot Reload Header-only Library diff --git a/ports/cr/portfile.cmake b/ports/cr/portfile.cmake new file mode 100644 index 00000000000000..d6d536759df7a2 --- /dev/null +++ b/ports/cr/portfile.cmake @@ -0,0 +1,15 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO fungos/cr + REF 66b76e24611c3b87566e5365e8c422387bc85916 + SHA512 002162461ecf131d717f7567cf13ee1345b7b359bb17c0801f4246c472c1b180f4f8937e9a3f4c186d95c41c20ffcc5ba5e953f197f344fb1000f51d8c4ee473 + HEAD_REF master +) + +file( + COPY ${SOURCE_PATH}/cr.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/crashpad/CONTROL b/ports/crashpad/CONTROL new file mode 100644 index 00000000000000..dab2671f67193e --- /dev/null +++ b/ports/crashpad/CONTROL @@ -0,0 +1,7 @@ +Source: crashpad +Version: 2020-03-18 +Homepage: https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md +Description: Crashpad is a crash-reporting system. + Crashpad is a library for capturing, storing and transmitting postmortem crash reports from a client to an upstream collection server. Crashpad aims to make it possible for clients to capture process state at the time of crash with the best possible fidelity and coverage, with the minimum of fuss. +Build-Depends: zlib +Supports: x64 & (osx|windows) diff --git a/ports/crashpad/crashpadConfig.cmake.in b/ports/crashpad/crashpadConfig.cmake.in new file mode 100644 index 00000000000000..1c95bf1b77eef7 --- /dev/null +++ b/ports/crashpad/crashpadConfig.cmake.in @@ -0,0 +1,31 @@ +# 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(crashpad INTERFACE) +add_library(crashpad::crashpad ALIAS crashpad) + +set(CRASHPAD_LIBRARIES client util base) + +if(WIN32) + target_compile_definitions(crashpad INTERFACE NOMINMAX) +elseif(APPLE) + list(APPEND CRASHPAD_LIBRARIES ApplicationServices + CoreFoundation Foundation IOKit Security bsm) +endif() + +foreach(LIB_NAME ${CRASHPAD_LIBRARIES}) + find_library(_LIB ${LIB_NAME}) + target_link_libraries(crashpad INTERFACE ${_LIB}) + unset(_LIB CACHE) +endforeach() + +find_package(ZLIB REQUIRED) +target_link_libraries(crashpad INTERFACE ZLIB::ZLIB) + +target_include_directories(crashpad + INTERFACE ${_IMPORT_PREFIX}/include/crashpad) diff --git a/ports/crashpad/portfile.cmake b/ports/crashpad/portfile.cmake new file mode 100644 index 00000000000000..30026d5c151a0a --- /dev/null +++ b/ports/crashpad/portfile.cmake @@ -0,0 +1,129 @@ +vcpkg_fail_port_install( + ON_ARCH "x86" "arm" "arm64" + ON_TARGET "UWP" "LINUX") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://chromium.googlesource.com/crashpad/crashpad + REF 9a31d3f8e9815774026a753a1ff6155347cd549f +) + +function(checkout_in_path PATH URL REF) + if(EXISTS "${PATH}") + return() + endif() + + vcpkg_from_git( + OUT_SOURCE_PATH DEP_SOURCE_PATH + URL "${URL}" + REF "${REF}" + ) + file(RENAME "${DEP_SOURCE_PATH}" "${PATH}") + file(REMOVE_RECURSE "${DEP_SOURCE_PATH}") +endfunction() + +# mini_chromium contains the toolchains and build configuration +checkout_in_path( + "${SOURCE_PATH}/third_party/mini_chromium/mini_chromium" + "https://chromium.googlesource.com/chromium/mini_chromium" + "c426ff98e1d9e9d59777fe8b883a5c0ceeca9ca3" +) + +function(replace_gn_dependency INPUT_FILE OUTPUT_FILE LIBRARY_NAMES) + unset(_LIBRARY_DEB CACHE) + find_library(_LIBRARY_DEB NAMES ${LIBRARY_NAMES} + PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" + NO_DEFAULT_PATH) + + if(_LIBRARY_DEB MATCHES "-NOTFOUND") + message(FATAL_ERROR "Could not find debug library with names: ${LIBRARY_NAMES}") + endif() + + unset(_LIBRARY_REL CACHE) + find_library(_LIBRARY_REL NAMES ${LIBRARY_NAMES} + PATHS "${CURRENT_INSTALLED_DIR}/lib" + NO_DEFAULT_PATH) + + if(_LIBRARY_REL MATCHES "-NOTFOUND") + message(FATAL_ERROR "Could not find library with names: ${LIBRARY_NAMES}") + endif() + + set(_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include") + + file(REMOVE "${OUTPUT_FILE}") + configure_file("${INPUT_FILE}" "${OUTPUT_FILE}" @ONLY) +endfunction() + +replace_gn_dependency( + "${CMAKE_CURRENT_LIST_DIR}/zlib.gn" + "${SOURCE_PATH}/third_party/zlib/BUILD.gn" + "z;zlib;zlibd" +) + +set(OPTIONS_DBG "is_debug=true") +set(OPTIONS_REL "") + +if(CMAKE_HOST_WIN32) + # Load toolchains + if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") + endif() + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + + foreach(_VAR CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS + CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE) + string(STRIP "${${_VAR}}" ${_VAR}) + endforeach() + + set(OPTIONS_DBG "${OPTIONS_DBG} \ + extra_cflags_c=\"${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}\" \ + extra_cflags_cc=\"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}\"") + + set(OPTIONS_REL "${OPTIONS_REL} \ + extra_cflags_c=\"${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}\" \ + extra_cflags_cc=\"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}\"") + + set(DISABLE_WHOLE_PROGRAM_OPTIMIZATION "\ + extra_cflags=\"/GL-\" \ + extra_ldflags=\"/LTCG:OFF\" \ + extra_arflags=\"/LTCG:OFF\"") + + set(OPTIONS_DBG "${OPTIONS_DBG} ${DISABLE_WHOLE_PROGRAM_OPTIMIZATION}") + set(OPTIONS_REL "${OPTIONS_REL} ${DISABLE_WHOLE_PROGRAM_OPTIMIZATION}") +endif() + +vcpkg_configure_gn( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG "${OPTIONS_DBG}" + OPTIONS_RELEASE "${OPTIONS_REL}" +) + +vcpkg_install_gn( + SOURCE_PATH "${SOURCE_PATH}" + TARGETS client util third_party/mini_chromium/mini_chromium/base handler:crashpad_handler +) + +message(STATUS "Installing headers...") +set(PACKAGES_INCLUDE_DIR "${CURRENT_PACKAGES_DIR}/include/${PORT}") +function(install_headers DIR) + file(COPY "${DIR}" DESTINATION "${PACKAGES_INCLUDE_DIR}" FILES_MATCHING PATTERN "*.h") +endfunction() +install_headers("${SOURCE_PATH}/client") +install_headers("${SOURCE_PATH}/util") +install_headers("${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/base") +install_headers("${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/build") + +# remove empty directories +file(REMOVE_RECURSE + "${PACKAGES_INCLUDE_DIR}/util/net/testdata" + "${PACKAGES_INCLUDE_DIR}/build/ios") + +configure_file("${CMAKE_CURRENT_LIST_DIR}/crashpadConfig.cmake.in" + "${CURRENT_PACKAGES_DIR}/share/${PORT}/crashpadConfig.cmake" @ONLY) + +vcpkg_copy_pdbs() +file(INSTALL "${SOURCE_PATH}/LICENSE" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright) diff --git a/ports/crashpad/zlib.gn b/ports/crashpad/zlib.gn new file mode 100644 index 00000000000000..5b551a30ac9d30 --- /dev/null +++ b/ports/crashpad/zlib.gn @@ -0,0 +1,15 @@ +import("../../build/crashpad_buildconfig.gni") + +config("zlib_config") { + defines = [ "CRASHPAD_ZLIB_SOURCE_EXTERNAL" ] + include_dirs = [ "@_INCLUDE_DIR@" ] +} + +source_set("zlib") { + public_configs = [ ":zlib_config" ] + if(is_debug) { + libs = [ "@_LIBRARY_DEB@" ] + } else { + libs = [ "@_LIBRARY_REL@" ] + } +} \ No newline at end of file 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/cryptopp/CONTROL b/ports/cryptopp/CONTROL index 9c11e190644f4f..c70415dd101285 100644 --- a/ports/cryptopp/CONTROL +++ b/ports/cryptopp/CONTROL @@ -1,4 +1,7 @@ Source: cryptopp -Version: 8.2.0-1 +Version: 8.2.0-2 Homepage: https://github.com/weidai11/cryptopp Description: Crypto++ is a free C++ class library of cryptographic schemes. + +Feature: pem-pack +Description: Crypto++ with PEM pack diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake index 36c74788485981..b88f2e321fbba9 100644 --- a/ports/cryptopp/portfile.cmake +++ b/ports/cryptopp/portfile.cmake @@ -24,6 +24,22 @@ vcpkg_from_github( file(COPY ${CMAKE_SOURCE_PATH}/cryptopp-config.cmake DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +if("pem-pack" IN_LIST FEATURES) + vcpkg_from_github( + OUT_SOURCE_PATH PEM_PACK_SOURCE_PATH + REPO noloader/cryptopp-pem + REF 095f08ff2ef9bca7b81036a59f2395e4f08ce2e8 + SHA512 49912758a635faca1f49665ac9552b20576b46e0283aaabc19bb012bdc80586106452018e5088b9b46967717982ca6022ca968edc4cac96a7506d2b1a3e4bf13 + HEAD_REF master + ) + + file(GLOB PEM_PACK_FILES + ${PEM_PACK_SOURCE_PATH}/*.h + ${PEM_PACK_SOURCE_PATH}/*.cpp + ) + file(COPY ${PEM_PACK_FILES} DESTINATION ${SOURCE_PATH}) +endif() + # disable assembly on OSX and ARM Windows to fix broken build if (VCPKG_TARGET_IS_OSX) set(CRYPTOPP_DISABLE_ASM "ON") diff --git a/ports/ctp/CONTROL b/ports/ctp/CONTROL new file mode 100644 index 00000000000000..86eeff004dee86 --- /dev/null +++ b/ports/ctp/CONTROL @@ -0,0 +1,7 @@ +Source: ctp +Version: 6.3.15_20190220_se +Homepage: http://www.sfit.com.cn/index.htm +Description: The Comprehensive Transaction Platform (CTP) is a future brokerage management system developed specially for futures companies. CTP API client library allows users to connect to CTP gateway for algorithmic trading. + +Feature: datacollect +Description: Data collect support of CTP diff --git a/ports/ctp/portfile.cmake b/ports/ctp/portfile.cmake new file mode 100644 index 00000000000000..f8efa19255c2a6 --- /dev/null +++ b/ports/ctp/portfile.cmake @@ -0,0 +1,70 @@ +message(STATUS "Note: the downloading server may only be avilable from 8:00AM-5:00PM (UTC+8), Mon-Fri (except public holidays in China)") + +vcpkg_fail_port_install(ON_TARGET "OSX" "UWP" ON_ARCH "arm") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www.sfit.com.cn/DocumentDown/api_3/5_2_2/6.3.15_20190220.zip" + FILENAME "6.3.15_20190220.zip" + SHA512 e17bb9d7fdda85f944b241d7ecd6a3b6f7e145f1a9d39ad48b36aa015e7e8a1b599e0289c8c38ce0a84cc8426a374fd620b07815dc9b6083c562389867138577 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH UNPACK_PATH + ARCHIVE ${ARCHIVE} + NO_REMOVE_ONE_LEVEL +) + +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(ARCH_ARCHIVE "6.3.15_20190220_tradeapi_se_windows.zip") + set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll_windows.zip") +elseif(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_ARCHIVE "6.3.15_20190220_tradeapi64_se_windows.zip") + set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll64_windows.zip") +elseif(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_ARCHIVE "v6.3.15_20190220_api_clientdatacollectdll_linux64.tar") + set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll_windows.zip") +else() + message(FATAL_ERROR "${TARGET_TRIPLET} is not a supported platform" ) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${UNPACK_PATH}/${ARCH_ARCHIVE}" +) + +file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h") + +if(VCPKG_TARGET_IS_WINDOWS) + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.lib") + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/bin FILES_MATCHING PATTERN "*.dll") +elseif(VCPKG_TARGET_IS_LINUX) + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.so") + file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.so") +endif() + +file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/share FILES_MATCHING PATTERN "*.xml") +file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/share FILES_MATCHING PATTERN "*.dtd") + +if("datacollect" IN_LIST FEATURES) + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH_DATACOLLECT + ARCHIVE "${UNPACK_PATH}/${ARCH_ARCHIVE_DATACOLLECT}" + ) + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h") + + if(VCPKG_TARGET_IS_WINDOWS) + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.lib") + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/bin FILES_MATCHING PATTERN "*.dll") + elseif(VCPKG_TARGET_IS_LINUX) + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.so") + file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.so") + endif() + +endif() + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "Copyright By Shanghai Futures Information Technology Co.,Ltd") diff --git a/ports/cuda/CONTROL b/ports/cuda/CONTROL index ba5208c2fbadd8..00b422df8595b6 100644 --- a/ports/cuda/CONTROL +++ b/ports/cuda/CONTROL @@ -1,3 +1,5 @@ Source: cuda Version: 10.1 +Port-Version: 2 Description: A parallel computing platform and programming model +Homepage: https://developer.nvidia.com/cuda-toolkit diff --git a/ports/cuda/portfile.cmake b/ports/cuda/portfile.cmake index 63e3f9cee25feb..0dd768e29d228c 100644 --- a/ports/cuda/portfile.cmake +++ b/ports/cuda/portfile.cmake @@ -2,14 +2,55 @@ # Other packages can depend on this package to declare a dependency on CUDA. # If this package is installed, we assume that CUDA is properly installed. -find_program(NVCC - NAMES nvcc nvcc.exe - PATHS - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - DOC "Toolkit location." - NO_DEFAULT_PATH) +#note: this port must be kept in sync with CUDNN port: every time one is upgraded, the other must be too +set(CUDA_REQUIRED_VERSION "10.1.0") + +set(CUDA_PATHS + ENV CUDA_PATH + ENV CUDA_BIN_PATH + ENV CUDA_PATH_V11_0 + ENV CUDA_PATH_V10_2 + ENV CUDA_PATH_V10_1) + +if (VCPKG_TARGET_IS_WINDOWS) + find_program(NVCC + NAMES nvcc.exe + PATHS + ${CUDA_PATHS} + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) +else() + if (VCPKG_TARGET_IS_LINUX) + set(platform_base "/usr/local/cuda-") + else() + set(platform_base "/Developer/NVIDIA/CUDA-") + endif() + + file(GLOB possible_paths "${platform_base}*") + set(FOUND_PATH ) + foreach (p ${possible_paths}) + # Extract version number from end of string + string(REGEX MATCH "[0-9][0-9]?\\.[0-9]$" p_version ${p}) + if (IS_DIRECTORY ${p} AND p_version) + if (p_version VERSION_GREATER_EQUAL CUDA_REQUIRED_VERSION) + set(FOUND_PATH ${p}) + break() + endif() + endif() + endforeach() + + find_program(NVCC + NAMES nvcc + PATHS + ${CUDA_PATHS} + PATHS ${FOUND_PATH} + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) +endif() set(error_code 1) if (NVCC) @@ -19,11 +60,10 @@ if (NVCC) RESULT_VARIABLE error_code) endif() -#note: this port must be kept in sync with CUDNN port: every time one is upgraded, the other must be too -set(CUDA_REQUIRED_VERSION "V10.1.0") if (error_code) - message(FATAL_ERROR "Could not find CUDA. Before continuing, please download and install CUDA (${CUDA_REQUIRED_VERSION} or higher) from:" + message(STATUS "Executing ${NVCC} --version resulted in error: ${error_code}") + message(FATAL_ERROR "Could not find CUDA. Before continuing, please download and install CUDA (v${CUDA_REQUIRED_VERSION} or higher) from:" "\n https://developer.nvidia.com/cuda-downloads\n") endif() @@ -39,7 +79,7 @@ set(CUDA_VERSION_MINOR ${CMAKE_MATCH_2}) set(CUDA_VERSION_PATCH ${CMAKE_MATCH_3}) if (CUDA_VERSION_MAJOR LESS 10 AND CUDA_VERSION_MINOR LESS 1) - message(FATAL_ERROR "CUDA ${CUDA_VERSION} found, but ${CUDA_REQUIRED_VERSION} is required. Please download and install a more recent version of CUDA from:" + message(FATAL_ERROR "CUDA ${CUDA_VERSION} found, but v${CUDA_REQUIRED_VERSION} is required. Please download and install a more recent version of CUDA from:" "\n https://developer.nvidia.com/cuda-downloads\n") endif() 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/cunit/CONTROL b/ports/cunit/CONTROL index b1c5bd30ce76a1..c5725875f3a100 100644 --- a/ports/cunit/CONTROL +++ b/ports/cunit/CONTROL @@ -1,4 +1,4 @@ Source: cunit -Version: 2.1.3-3 +Version: 2.1.3-6 Homepage: https://sourceforge.net/projects/cunit/ Description: CUnit is a lightweight system for writing, administering, and running unit tests in C. It provides C programmers a basic testing functionality with a flexible variety of user interfaces diff --git a/ports/cunit/portfile.cmake b/ports/cunit/portfile.cmake index d841d8bc365a26..88b9be6b5bac40 100644 --- a/ports/cunit/portfile.cmake +++ b/ports/cunit/portfile.cmake @@ -1,14 +1,9 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2" - FILENAME "CUnit-2.1-3.tar.bz2" - SHA512 547b417109332446dfab8fda17bf4ccd2da841dc93f824dc90a20635bcf1fb80fb2176500d8a0906940f3f3d3e2f77b2d70a71090c9ab84ad9af43f3582bc487 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO cunit/CUnit + REF 2.1-3 + FILENAME "CUnit-2.1-3.tar.bz2" + SHA512 547b417109332446dfab8fda17bf4ccd2da841dc93f824dc90a20635bcf1fb80fb2176500d8a0906940f3f3d3e2f77b2d70a71090c9ab84ad9af43f3582bc487 ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -21,6 +16,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cunit RENAME copyright) - vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/curl/0001_cmake.patch b/ports/curl/0001_cmake.patch deleted file mode 100644 index 33ede7b909f93a..00000000000000 --- a/ports/curl/0001_cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMake/FindLibSSH2.cmake b/CMake/FindLibSSH2.cmake -index 84822db..0d62194 100644 ---- a/CMake/FindLibSSH2.cmake -+++ b/CMake/FindLibSSH2.cmake -@@ -12,7 +12,7 @@ endif() - find_path(LIBSSH2_INCLUDE_DIR libssh2.h - ) - --find_library(LIBSSH2_LIBRARY NAMES ssh2 -+find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2 - ) - - if(LIBSSH2_INCLUDE_DIR) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index b69dd4cb95a3fb..ae36158755b964 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,79 +1,15 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38b7b7d..5b3d33e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -897,7 +897,9 @@ check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT) - check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 62b7b33..9b0e2e1 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -107,7 +107,9 @@ endif() + + target_link_libraries(${LIB_NAME} ${CURL_LIBS}) - # symbol exists in win32, but function does not. -if(WIN32) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -+ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS) ++ add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) +elseif(WIN32) - if(ENABLE_INET_PTON) - check_function_exists(inet_pton HAVE_INET_PTON) - # _WIN32_WINNT_VISTA (0x0600) -diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c -index 8337c72..41867b2 100644 ---- a/lib/curl_gethostname.c -+++ b/lib/curl_gethostname.c -@@ -21,6 +21,7 @@ - ***************************************************************************/ - - #include "curl_setup.h" -+#include "curl/curl.h" - - #include "curl_gethostname.h" - -@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) - #ifdef DEBUGBUILD - - /* Override host name when environment variable CURL_GETHOSTNAME is set */ -- const char *force_hostname = getenv("CURL_GETHOSTNAME"); -+ char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); - if(force_hostname) { - strncpy(name, force_hostname, namelen); -+ free(force_hostname); - err = 0; - } - else { -diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index e7060eb..9cd76f7 100644 ---- a/lib/curl_ntlm_core.c -+++ b/lib/curl_ntlm_core.c -@@ -726,10 +726,11 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, - - /* Calculate the timestamp */ - #ifdef DEBUGBUILD -- char *force_timestamp = getenv("CURL_FORCETIME"); -- if(force_timestamp) -+ char *force_timestamp = curl_getenv("CURL_FORCETIME"); -+ if(force_timestamp) { - tw = CURL_OFF_T_C(11644473600) * 10000000; -- else -+ free(force_timestamp); -+ } - #endif - tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000; - -diff --git a/lib/rand.c b/lib/rand.c -index 6ee45fe..b2d712d 100644 ---- a/lib/rand.c -+++ b/lib/rand.c -@@ -44,7 +44,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) - static bool seeded = FALSE; + add_definitions(-D_USRDLL) + endif() - #ifdef CURLDEBUG -- char *force_entropy = getenv("CURL_ENTROPY"); -+ char *force_entropy = curl_getenv("CURL_ENTROPY"); - if(force_entropy) { - if(!seeded) { - unsigned int seed = 0; -@@ -58,6 +58,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) - else - randseed++; - *rnd = randseed; -+ free(force_entropy); - return CURLE_OK; - } - #endif diff --git a/ports/curl/0003_fix_libraries.patch b/ports/curl/0003_fix_libraries.patch deleted file mode 100644 index a06e7b544aa034..00000000000000 --- a/ports/curl/0003_fix_libraries.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 490cc19ef8..23fe34f614 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -330,7 +330,7 @@ if(CMAKE_USE_WINSSL) - set(SSL_ENABLED ON) - set(USE_SCHANNEL ON) # Windows native SSL/TLS support - set(USE_WINDOWS_SSPI ON) # CMAKE_USE_WINSSL implies CURL_WINDOWS_SSPI -- list(APPEND CURL_LIBS "crypt32") -+ list(APPEND CURL_LIBS "crypt32" "advapi32") - endif() - if(CURL_WINDOWS_SSPI) - set(USE_WINDOWS_SSPI ON) diff --git a/ports/curl/0004_nghttp2_staticlib.patch b/ports/curl/0004_nghttp2_staticlib.patch index 69c1854f965a93..4bd6e4afdd77f0 100644 --- a/ports/curl/0004_nghttp2_staticlib.patch +++ b/ports/curl/0004_nghttp2_staticlib.patch @@ -1,14 +1,14 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 490cc19..51c0a92 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -388,6 +388,9 @@ if(USE_NGHTTP2) - find_package(NGHTTP2 REQUIRED) - include_directories(${NGHTTP2_INCLUDE_DIRS}) - list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) -+ if(NOT BUILD_SHARED_LIBS) -+ add_definitions(-DNGHTTP2_STATICLIB) -+ endif() - endif() - - if(NOT CURL_DISABLE_LDAP) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a13333..2dd274c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -431,6 +431,9 @@ if(USE_NGHTTP2) + find_package(NGHTTP2 REQUIRED) + include_directories(${NGHTTP2_INCLUDE_DIRS}) + list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) ++ if(NOT BUILD_SHARED_LIBS) ++ add_definitions(-DNGHTTP2_STATICLIB) ++ endif() + endif() + + function(CheckQuicSupportInOpenSSL) diff --git a/ports/curl/0005_remove_imp_suffix.patch b/ports/curl/0005_remove_imp_suffix.patch index 356af2d52987b8..c83a196520a56c 100644 --- a/ports/curl/0005_remove_imp_suffix.patch +++ b/ports/curl/0005_remove_imp_suffix.patch @@ -1,10 +1,10 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index eca9a8a..6f72955 100644 +index 1d71e14..62b7b33 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -97,7 +97,7 @@ endif() - set_target_properties(${LIB_NAME} PROPERTIES PREFIX "") - set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "") +@@ -128,7 +128,7 @@ if(CURL_HAS_LTO) + INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) + endif() -if(WIN32) +if(WIN32 AND 0) diff --git a/ports/curl/0006_fix_tool_depends.patch b/ports/curl/0006_fix_tool_depends.patch index 67fd62d926e3a7..a918b08e2d752c 100644 --- a/ports/curl/0006_fix_tool_depends.patch +++ b/ports/curl/0006_fix_tool_depends.patch @@ -1,22 +1,22 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 63e2b94..b376cd1 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -40,6 +40,8 @@ if(MSVC) - list(APPEND CURL_FILES curl.rc) - endif() - -+find_package(ZLIB REQUIRED) -+ - # CURL_FILES comes from Makefile.inc - add_executable( - ${EXE_NAME} -@@ -59,7 +61,7 @@ include_directories( - ) - - #Build curl executable --target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS}) -+target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) - - ################################################################################ - +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 26e3cfe..74d00dd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -61,6 +61,8 @@ if(MSVC) + list(APPEND CURL_FILES curl.rc) + endif() + ++find_package(ZLIB REQUIRED) ++ + # CURL_FILES comes from Makefile.inc + add_executable( + ${EXE_NAME} +@@ -91,7 +93,7 @@ include_directories( + ) + + #Build curl executable +-target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS}) ++target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) + + ################################################################################ + diff --git a/ports/curl/0007_disable_tool_export_curl_target.patch b/ports/curl/0007_disable_tool_export_curl_target.patch index 3361f1b3abde21..689104a938cc18 100644 --- a/ports/curl/0007_disable_tool_export_curl_target.patch +++ b/ports/curl/0007_disable_tool_export_curl_target.patch @@ -1,18 +1,18 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b376cd1..baffe7e 100644 +index 74d00dd..5838805 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -71,8 +71,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) +@@ -103,8 +103,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) #INCLUDE(ModuleInstall OPTIONAL) -install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -export(TARGETS ${EXE_NAME} - APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake -- NAMESPACE CURL:: +- NAMESPACE ${PROJECT_NAME}:: -) +install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) +#export(TARGETS ${EXE_NAME} +# APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake -+# NAMESPACE CURL:: ++# NAMESPACE ${PROJECT_NAME}:: +#) diff --git a/ports/curl/0008_fix_tools_path.patch b/ports/curl/0008_fix_tools_path.patch deleted file mode 100644 index cac2688647c3d4..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 0e567e7..697dfea 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -71,7 +71,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 CURL:: diff --git a/ports/curl/0009_fix_openssl_config.patch b/ports/curl/0009_fix_openssl_config.patch index 0e89ba178cfd6e..d7fc216435ca37 100644 --- a/ports/curl/0009_fix_openssl_config.patch +++ b/ports/curl/0009_fix_openssl_config.patch @@ -1,12 +1,12 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 42e490a..ec9e4d1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -348,6 +348,7 @@ if(CMAKE_USE_SECTRANSP) - list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}") - endif() - -+set(USE_OPENSSL OFF) - if(CMAKE_USE_OPENSSL) - find_package(OpenSSL REQUIRED) - set(SSL_ENABLED ON) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a13333..5a7ece0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -361,6 +361,7 @@ if(CMAKE_USE_SECTRANSP) + list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}") + endif() + ++set(USE_OPENSSL OFF) + if(CMAKE_USE_OPENSSL) + find_package(OpenSSL REQUIRED) + set(SSL_ENABLED ON) diff --git a/ports/curl/0010_fix_othertests_cmake.patch b/ports/curl/0010_fix_othertests_cmake.patch new file mode 100644 index 00000000000000..e54d33333e3179 --- /dev/null +++ b/ports/curl/0010_fix_othertests_cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake +index 7cec6da..c836fc9 100644 +--- a/CMake/OtherTests.cmake ++++ b/CMake/OtherTests.cmake +@@ -212,6 +212,7 @@ if(HAVE_SIGNAL_H) + set(CMAKE_REQUIRED_FLAGS "-DHAVE_SIGNAL_H") + set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") + endif() ++unset(CMAKE_TRY_COMPILE_TARGET_TYPE) + check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T) + if(HAVE_SIZEOF_SIG_ATOMIC_T) + check_c_source_compiles(" diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 05efb2174cb000..ef5881da0cd110 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,5 +1,6 @@ Source: curl -Version: 7.68.0-2 +Version: 7.71.1 +Port-Version: 1 Build-Depends: zlib Homepage: https://github.com/curl/curl Description: A library for transferring data with URLs diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 3aa78a5cd0f16c..db1367370fbf30 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,19 +1,17 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF curl-7_68_0 - SHA512 d75ed39b121a5a04d5a4ba89779967a49e196a93325747b51399adf1afb5f5c13355d6dbe798b259d19245c83bb55f0b621b24b25d8f3ddb1914df30067b8737 + REF 5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 #curl-7_71_1 + SHA512 a58d2f23c4fb82610b8d68181fd29a4007983f88950b3eb3362170f3187d86116628151c5e09c713f047aca77cad7b9900bb58e368bbddca31599b4fde0dfa22 HEAD_REF master PATCHES - 0001_cmake.patch 0002_fix_uwp.patch - 0003_fix_libraries.patch 0004_nghttp2_staticlib.patch 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 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) @@ -79,7 +77,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) @@ -97,13 +95,17 @@ else() file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/curl-config "${CURL_CONFIG}") endif() -file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "#ifdef CURL_STATICLIB" "#if 1" CURL_H "${CURL_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/curl/curl.h + "#ifdef CURL_STATICLIB" + "#if 1" + ) else() - string(REPLACE "#ifdef CURL_STATICLIB" "#if 0" CURL_H "${CURL_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/curl/curl.h + "#ifdef CURL_STATICLIB" + "#if 0" + ) endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/curl/curl.h "${CURL_H}") 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) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/curlpp/CONTROL b/ports/curlpp/CONTROL index 3978c383c13459..cac6a6048d66ef 100644 --- a/ports/curlpp/CONTROL +++ b/ports/curlpp/CONTROL @@ -1,4 +1,4 @@ Source: curlpp -Version: 2018-06-15-2 +Version: 2018-06-15-3 Description: C++ wrapper around libcURL Build-Depends: curl diff --git a/ports/curlpp/fix-findzliberror.patch b/ports/curlpp/fix-findzliberror.patch new file mode 100644 index 00000000000000..4876d0f25c0519 --- /dev/null +++ b/ports/curlpp/fix-findzliberror.patch @@ -0,0 +1,9 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c42943c..12d402c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,3 +1,4 @@ ++cmake_minimum_required(VERSION 2.8) + project(curlpp) + + diff --git a/ports/curlpp/portfile.cmake b/ports/curlpp/portfile.cmake index fdc6d7f4570052..c80c3c180aa593 100644 --- a/ports/curlpp/portfile.cmake +++ b/ports/curlpp/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-cmake.patch + fix-findzliberror.patch ) vcpkg_configure_cmake( diff --git a/ports/cutelyst2/CONTROL b/ports/cutelyst2/CONTROL index 9211d2eee586a9..16f848eef65c6d 100644 --- a/ports/cutelyst2/CONTROL +++ b/ports/cutelyst2/CONTROL @@ -1,4 +1,4 @@ Source: cutelyst2 -Version: 2.9.0 +Version: 2.9.0-1 Description: A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/czmq/CONTROL b/ports/czmq/CONTROL index 4d68f15b17fa0a..2d190c3940697c 100644 --- a/ports/czmq/CONTROL +++ b/ports/czmq/CONTROL @@ -1,5 +1,5 @@ Source: czmq -Version: 2019-06-10-3 +Version: 2019-06-10-4 Build-Depends: zeromq Description: High-level C binding for ZeroMQ Homepage: https://github.com/zeromq/czmq diff --git a/ports/czmq/portfile.cmake b/ports/czmq/portfile.cmake index 2545feea52407d..a30449329d5bbd 100644 --- a/ports/czmq/portfile.cmake +++ b/ports/czmq/portfile.cmake @@ -29,7 +29,6 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS draft ENABLE_DRAFTS - tool BUILD_TOOLS curl CZMQ_WITH_LIBCURL httpd CZMQ_WITH_LIBMICROHTTPD lz4 CZMQ_WITH_LZ4 @@ -63,18 +62,12 @@ file(COPY DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) -if(CMAKE_HOST_WIN32) - set(EXECUTABLE_SUFFIX ".exe") -else() - set(EXECUTABLE_SUFFIX "") -endif() - if ("tool" IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/zmakecert${EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tools(TOOL_NAMES zmakecert) endif() +vcpkg_clean_executables_in_bin(FILE_NAMES zmakecert) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -84,16 +77,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) ) endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) -else() - file(REMOVE - ${CURRENT_PACKAGES_DIR}/debug/bin/zmakecert${EXECUTABLE_SUFFIX} - ${CURRENT_PACKAGES_DIR}/bin/zmakecert${EXECUTABLE_SUFFIX}) -endif() - # Handle copyright configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/darknet/CONTROL b/ports/darknet/CONTROL index b68d214c8f94b8..ea0b5ce26b5c88 100644 --- a/ports/darknet/CONTROL +++ b/ports/darknet/CONTROL @@ -1,5 +1,5 @@ Source: darknet -Version: 2020-03-02 +Version: 2020-06-29 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 @@ -19,6 +19,14 @@ Feature: opencv-cuda Build-Depends: opencv[ffmpeg], opencv[cuda] Description: Build darknet with support for a CUDA-enabled OpenCV +Feature: opencv2-base +Build-Depends: opencv2[ffmpeg] +Description: Build darknet with support for OpenCV3 + +Feature: opencv2-cuda +Build-Depends: opencv2[ffmpeg], opencv2[cuda] +Description: Build darknet with support for a CUDA-enabled OpenCV3 + Feature: opencv3-base Build-Depends: opencv3[ffmpeg] Description: Build darknet with support for OpenCV3 diff --git a/ports/darknet/fix_shared_static.patch b/ports/darknet/fix_shared_static.patch new file mode 100644 index 00000000000000..5b9670f4174f5d --- /dev/null +++ b/ports/darknet/fix_shared_static.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.12) ++cmake_minimum_required(VERSION 3.17) + + set(Darknet_MAJOR_VERSION 0) + set(Darknet_MINOR_VERSION 2) +@@ -77,6 +77,11 @@ if(CMAKE_CUDA_COMPILER AND ENABLE_CUDA) + else() + message(STATUS "Your setup supports half precision (it requires CC >= 7.0)") + endif() ++ endif() ++ if(BUILD_SHARED_LIBS) ++ set(CMAKE_CUDA_RUNTIME_LIBRARY "Shared") ++ else() ++ set(CMAKE_CUDA_RUNTIME_LIBRARY "Static") + endif() + else() + set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA support" FORCE) diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake index 51cb9f376e635c..ed8a41a720d436 100644 --- a/ports/darknet/portfile.cmake +++ b/ports/darknet/portfile.cmake @@ -1,9 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO AlexeyAB/darknet - REF 81290b07376c5abb4988a492dda70913bb90133d - SHA512 094197cde851dfdd1e102a3ffaed34d67a789dd75dc288bde611144dc9aa484ca0b9e3468abc297d075d3753553f7f09a214be279af9e58ccb642aa757909f79 + REF 320e6fd8d29f6f7825ef668f15f955f90131f782 + SHA512 f95ac04c1c4e1b3f28aa835a64d969ffee064a3681a7966b255981722d562aa1eb91c30a378cad2f1bccd4581b74d8c2ec641c57763bc0fa97bfce8b1c222480 HEAD_REF master + PATCHES + fix_shared_static.patch ) # enable CUDA inside DARKNET @@ -17,6 +19,9 @@ set(ENABLE_OPENCV OFF) if("opencv-base" IN_LIST FEATURES) set(ENABLE_OPENCV ON) endif() +if("opencv2-base" IN_LIST FEATURES) + set(ENABLE_OPENCV ON) +endif() if("opencv3-base" IN_LIST FEATURES) set(ENABLE_OPENCV ON) endif() @@ -27,6 +32,9 @@ endif() if("opencv-cuda" IN_LIST FEATURES) set(ENABLE_OPENCV ON) endif() +if("opencv2-cuda" IN_LIST FEATURES) + set(ENABLE_OPENCV ON) +endif() if("opencv3-cuda" IN_LIST FEATURES) set(ENABLE_OPENCV ON) endif() @@ -45,11 +53,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" @@ -68,12 +96,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 @@ -127,6 +165,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}) @@ -134,6 +176,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/0002-fix-cmake-3.14.patch b/ports/date/0002-fix-cmake-3.14.patch index de5ec1bd3cc88b..9d117231ca3503 100644 --- a/ports/date/0002-fix-cmake-3.14.patch +++ b/ports/date/0002-fix-cmake-3.14.patch @@ -1,24 +1,25 @@ -diff --git i/CMakeLists.txt w/CMakeLists.txt -index 885e424..b9e0b43 100644 ---- i/CMakeLists.txt -+++ w/CMakeLists.txt -@@ -72,7 +72,6 @@ target_sources( date INTERFACE +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad74900..42d55af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,7 +72,7 @@ target_sources( date INTERFACE + $ $ ) - # public headers will get installed: --set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h ) - target_compile_definitions( date INTERFACE - #To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388 - ONLY_C_LOCALE=$,1,0> -@@ -112,7 +111,6 @@ if( BUILD_TZ_LIB ) +-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) ++if (0) + # public headers will get installed: + set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h ) + endif () +@@ -115,7 +115,6 @@ if( BUILD_TZ_LIB ) endif( ) - set_target_properties( tz PROPERTIES + set_target_properties( date-tz PROPERTIES POSITION_INDEPENDENT_CODE ON - PUBLIC_HEADER "${TZ_HEADERS}" VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION}" ) if( NOT MSVC ) -@@ -136,8 +134,8 @@ write_basic_package_version_file( "${version_config}" +@@ -140,8 +139,8 @@ write_basic_package_version_file( "${version_config}" COMPATIBILITY SameMajorVersion ) install( TARGETS date @@ -26,6 +27,6 @@ index 885e424..b9e0b43 100644 - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date ) + EXPORT dateConfig ) +install( FILES include/date/date.h ${TZ_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date ) - export( TARGETS date NAMESPACE date:: FILE dateConfig.cmake ) - - if( BUILD_TZ_LIB ) + export( TARGETS date NAMESPACE date:: FILE dateTargets.cmake ) + if (CMAKE_VERSION VERSION_LESS 3.15) + install( 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 7aaa8a8237617b..b44b024cdb7d8c 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,5 +1,6 @@ Source: date -Version: 2019-11-08 +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 28c723a5f73e22..4dd5a40eb470db 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -1,6 +1,4 @@ -include(vcpkg_common_functions) - -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) message(WARNING "You will need to also install https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml into your install location.\n" "See https://howardhinnant.github.io/date/tz.html" @@ -10,25 +8,25 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO HowardHinnant/date - REF 3e376be2e9b4d32c946bd83c22601e4b7a1ce421 - SHA512 9dad181f8544bfcff8c42200552b6673e537c53b34fbad11663d6435d4e5fd5a3ac6cabbb76312481c9784b237151d9ccd161bb1b8c54c563fa75073896f3cff + REF cac99da8dc88be719a728dc1b597b0ac307c1800 #3.0.0 + SHA512 07bac40c9d92ed92f05ab71b07c203fc341cd35999f1eab16d584bf77ff69e2cdc106931b2faf0dcfc5a311ee55e8445a81fd97c62f4672957b6aac1b24a08fd HEAD_REF master PATCHES - "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp.patch" - "${CMAKE_CURRENT_LIST_DIR}/0002-fix-cmake-3.14.patch" + 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 + remote-api USE_SYSTEM_TZ_DB ) - -set(DATE_USE_SYSTEM_TZ_DB 1) -if("remote-api" IN_LIST FEATURES) - set(DATE_USE_SYSTEM_TZ_DB 0) -endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DBUILD_TZ_LIB=ON - -DUSE_SYSTEM_TZ_DB=${DATE_USE_SYSTEM_TZ_DB} ) vcpkg_install_cmake() @@ -42,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 696022ea3f7b48..55e8360d8eee3f 100644 --- a/ports/directxmesh/CONTROL +++ b/ports/directxmesh/CONTROL @@ -1,4 +1,4 @@ Source: directxmesh -Version: dec2019 +Version: jul2020 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 7e43ad07f7c02d..ceece913af81f8 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -1,16 +1,10 @@ -include(vcpkg_common_functions) - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic") - message(FATAL_ERROR "DirectXMesh only supports dynamic CRT linkage") -endif() +vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXMesh - REF dec2019 - SHA512 b48b144172574d56775f7607d7ee7370b427fd95ab4e3089cdaf79b6cbd7fc4bbc15264d9a6703840b763bc2f4a5974594afa39f113960df34e07adfd74561d6 + REF jul2020 + SHA512 27618f56fbce39d908417a44ea42ef0040254888fbb92108ecb06f6d70e06c1b168c0366c01f65c6b3d2c9915e445d1da85a48e11c23980cb4ab4b41e0b2904a HEAD_REF master ) @@ -37,12 +31,22 @@ else() set(SLN_NAME "Desktop_${VS_VERSION}_Win10") else() set(SLN_NAME "Desktop_${VS_VERSION}") + + # fix solution file to include DirectX 12 in build + file(READ ${SOURCE_PATH}/DirectXMesh/DirectXMesh_${SLN_NAME}.vcxproj _contents) + string(REPLACE "_WIN32_WINNT=0x0601" "_WIN32_WINNT=0x0A00" _contents "${_contents}") + file(WRITE ${SOURCE_PATH}/DirectXMesh/DirectXMesh_${SLN_NAME}.vcxproj "${_contents}") + + # fix solution file to include DirectX 12 in build + file(READ ${SOURCE_PATH}/Meshconvert/Meshconvert_${SLN_NAME}.vcxproj _contents) + string(REPLACE "_WIN32_WINNT=0x0601" "_WIN32_WINNT=0x0A00" _contents "${_contents}") + file(WRITE ${SOURCE_PATH}/Meshconvert/Meshconvert_${SLN_NAME}.vcxproj "${_contents}") endif() endif() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_${SLN_NAME}.sln - PLATFORM ${BUILD_ARCH} + PLATFORM ${TRIPLET_SYSTEM_ARCH} ) file(INSTALL diff --git a/ports/directxtex/CONTROL b/ports/directxtex/CONTROL index 63459b38ea2e49..c4bcd2b9d3f6a2 100644 --- a/ports/directxtex/CONTROL +++ b/ports/directxtex/CONTROL @@ -1,4 +1,4 @@ -Source: directxtex -Version: dec2019 -Homepage: https://walbourn.github.io/directxtex +Source: directxtex +Version: jul2020 +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 0b19ded36ad5ca..79d4466aa847a6 100644 --- a/ports/directxtex/portfile.cmake +++ b/ports/directxtex/portfile.cmake @@ -1,76 +1,70 @@ -include(vcpkg_common_functions) - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic") - message(FATAL_ERROR "DirectXTex only supports dynamic CRT linkage") -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO Microsoft/DirectXTex - REF dec2019 - SHA512 b0c7fdeb2f035186eddeb543cd16813c6807b9646367cd309082bd164ab484001dee912249d5570e3ddf5abb90cb3e7c0355a3c18c2e2bd2a051292b65a293f6 - HEAD_REF master -) - -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) -ENDIF() - -if (VCPKG_PLATFORM_TOOLSET STREQUAL "v140") - set(VS_VERSION "2015") -elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v141") - set(VS_VERSION "2017") -elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - set(VS_VERSION "2019") -else() - message(FATAL_ERROR "Unsupported platform toolset.") -endif() - -if(VCPKG_TARGET_IS_UWP) - set(SLN_NAME "Windows10_${VS_VERSION}") -else() - if(TRIPLET_SYSTEM_ARCH STREQUAL "arm64") - set(SLN_NAME "Desktop_${VS_VERSION}_Win10") - else() - set(SLN_NAME "Desktop_${VS_VERSION}") - endif() -endif() - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/DirectXTex_${SLN_NAME}.sln - PLATFORM ${BUILD_ARCH} -) - -file(INSTALL - ${SOURCE_PATH}/DirectXTex/DirectXTex.h - ${SOURCE_PATH}/DirectXTex/DirectXTex.inl - DESTINATION ${CURRENT_PACKAGES_DIR}/include -) -file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTex.lib - ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTex.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTex.lib - ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTex.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - -if(NOT VCPKG_TARGET_IS_UWP AND NOT TRIPLET_SYSTEM_ARCH STREQUAL "arm64") - set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtex) - file(MAKE_DIRECTORY ${TOOL_PATH}) - file(INSTALL - ${SOURCE_PATH}/Texdiag/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/texdiag.exe - DESTINATION ${TOOL_PATH}) - file(INSTALL - ${SOURCE_PATH}/Texconv/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/Texconv.exe - DESTINATION ${TOOL_PATH}) - file(INSTALL - ${SOURCE_PATH}/Texassemble/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/Texassemble.exe - DESTINATION ${TOOL_PATH}) -endif() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Microsoft/DirectXTex + REF jul2020 + SHA512 5e0c8b181527eb613a830f2228cf66633591c43fd4424dde9efae08d366c7957fdee02ad716a26a7b40b106b1a17f22a0728c2b57d12e12e1dc55ed297f7825c + HEAD_REF master +) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +if (VCPKG_PLATFORM_TOOLSET STREQUAL "v140") + set(VS_VERSION "2015") +elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + set(VS_VERSION "2017") +elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(VS_VERSION "2019") +else() + message(FATAL_ERROR "Unsupported platform toolset.") +endif() + +if(VCPKG_TARGET_IS_UWP) + set(SLN_NAME "Windows10_${VS_VERSION}") +else() + if(TRIPLET_SYSTEM_ARCH STREQUAL "arm64") + set(SLN_NAME "Desktop_${VS_VERSION}_Win10") + else() + set(SLN_NAME "Desktop_${VS_VERSION}") + endif() +endif() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXTex_${SLN_NAME}.sln + PLATFORM ${TRIPLET_SYSTEM_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/DirectXTex/DirectXTex.h + ${SOURCE_PATH}/DirectXTex/DirectXTex.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTex.lib + ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTex.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTex.lib + ${SOURCE_PATH}/DirectXTex/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTex.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +if(NOT VCPKG_TARGET_IS_UWP AND NOT TRIPLET_SYSTEM_ARCH STREQUAL "arm64") + set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtex) + file(MAKE_DIRECTORY ${TOOL_PATH}) + file(INSTALL + ${SOURCE_PATH}/Texdiag/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/texdiag.exe + DESTINATION ${TOOL_PATH}) + file(INSTALL + ${SOURCE_PATH}/Texconv/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/Texconv.exe + DESTINATION ${TOOL_PATH}) + file(INSTALL + ${SOURCE_PATH}/Texassemble/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/Texassemble.exe + DESTINATION ${TOOL_PATH}) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index 6508ceaf7ea9c2..0f627f6c848af3 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,4 +1,4 @@ Source: directxtk -Version: 2019-12-31 +Version: jul2020 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 5c7fa37885cab7..b309add34fde73 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -1,14 +1,10 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic") - message(FATAL_ERROR "DirectXTK only supports dynamic CRT linkage") -endif() +vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXTK - REF 9cac24555395925e3c1039bcbbae306da09742ed - SHA512 0cea14919cce3c31ec94826fbf65069fcd1a4654cbbf50caa9e44bad6087437e6bec4538627db18b1c5704ea27b056899040da4a7355abfbf35219b4552c07f2 + REF jul2020 + SHA512 e1e77795c12e82d12f491b19b43353b0f7e9cce6343a648728d083e63ae369404029344168b84d6a5162b74c1db4ee5160cd5e01aef26c7fad2ee890e26f41c0 HEAD_REF master ) @@ -40,6 +36,7 @@ endif() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXTK_${SLN_NAME}.sln + PLATFORM ${TRIPLET_SYSTEM_ARCH} ) file(INSTALL diff --git a/ports/directxtk12/CONTROL b/ports/directxtk12/CONTROL index cd3f00b7b6b14f..2eb9266b852c98 100644 --- a/ports/directxtk12/CONTROL +++ b/ports/directxtk12/CONTROL @@ -1,4 +1,4 @@ -Source: directxtk12 -Version: dec2019 -Homepage: https://walbourn.github.io/directx-tool-kit-for-directx-12 -Description: A collection of helper classes for writing DirectX 12 code in C++. +Source: directxtk12 +Version: jul2020 +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 52f8897a6476ce..c3b7eca990ae8e 100644 --- a/ports/directxtk12/portfile.cmake +++ b/ports/directxtk12/portfile.cmake @@ -1,16 +1,10 @@ -include(vcpkg_common_functions) - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic") - message(FATAL_ERROR "DirectXTK12 only supports dynamic CRT linkage") -endif() +vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectXTK12 - REF dec2019 - SHA512 2144c7a51ea73efea5ad4db3b0b92bfc5a2ca57c38e7f6702ce82a09049266a3aaad4500856a964c4069aa711973d3a10cb3b133397ec93bda3a4a0328b9d81c + REF jul2020 + SHA512 e658797029140fdfa6313f958367caba656b47637c5973ce1fa05cb777491d2523d2a8f592babd15f1eb839dc8371db9a47a47620a14fe632d0058d93d53e886 HEAD_REF master ) @@ -38,6 +32,7 @@ endif() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXTK_${SLN_NAME}.sln + PLATFORM ${TRIPLET_SYSTEM_ARCH} ) file(INSTALL diff --git a/ports/discord-game-sdk/CMakeLists.txt b/ports/discord-game-sdk/CMakeLists.txt new file mode 100644 index 00000000000000..f5a1d5136b5f87 --- /dev/null +++ b/ports/discord-game-sdk/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.5) + +project(discord_game_sdk_cpp) + +find_library(SDK_LIB + "discord_game_sdk" + PATHS "${SDK_LIB_FOLDER}" + NO_DEFAULT_PATH +) + +file(GLOB SRC_FILES "${PROJECT_SOURCE_DIR}/cpp/*.cpp") +file(GLOB_RECURSE HDR_FILES "${PROJECT_SOURCE_DIR}/*.h") + +add_library(discord_game_sdk_cpp STATIC ${SRC_FILES}) +target_link_libraries(discord_game_sdk_cpp PUBLIC ${SDK_LIB}) +set_property(TARGET discord_game_sdk_cpp PROPERTY CXX_STANDARD 11) + +install(TARGETS discord_game_sdk_cpp ARCHIVE) +install(FILES ${HDR_FILES} DESTINATION "include/discord-game-sdk") \ No newline at end of file diff --git a/ports/discord-game-sdk/CONTROL b/ports/discord-game-sdk/CONTROL new file mode 100644 index 00000000000000..a164d53f08402f --- /dev/null +++ b/ports/discord-game-sdk/CONTROL @@ -0,0 +1,5 @@ +Source: discord-game-sdk +Version: 2.5.6-1 +Homepage: https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide +Description: The Discord GameSDK is an easy drop-in SDK to help you manage all the hard things that come with making a game. +Supports: ((x64 && (windows || osx || linux)) || (x86 && windows)) && !uwp && !static \ No newline at end of file diff --git a/ports/discord-game-sdk/copyright b/ports/discord-game-sdk/copyright new file mode 100644 index 00000000000000..6e0e2e9140ad61 --- /dev/null +++ b/ports/discord-game-sdk/copyright @@ -0,0 +1 @@ +Your use of the GameSDK is bound by the Discord Developer Terms of Service, whose text is available online at https://discordapp.com/developers/docs/legal. diff --git a/ports/discord-game-sdk/include-cstdint.patch b/ports/discord-game-sdk/include-cstdint.patch new file mode 100644 index 00000000000000..6e61c4c252d915 --- /dev/null +++ b/ports/discord-game-sdk/include-cstdint.patch @@ -0,0 +1,25 @@ +From 91fab7c4b8f7da3182f07f5392ebe9388f979157 Mon Sep 17 00:00:00 2001 +From: Maki +Date: Wed, 3 Jun 2020 01:40:58 +0100 +Subject: [PATCH] Include cstdint + +--- + cpp/types.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cpp/types.h b/cpp/types.h +index 8c7cc2b..122dc71 100644 +--- a/cpp/types.h ++++ b/cpp/types.h +@@ -3,6 +3,8 @@ + #include "ffi.h" + #include "event.h" + ++#include ++ + namespace discord { + + enum class Result { +-- +2.26.2 + diff --git a/ports/discord-game-sdk/portfile.cmake b/ports/discord-game-sdk/portfile.cmake new file mode 100644 index 00000000000000..ab85a7d72b7aa4 --- /dev/null +++ b/ports/discord-game-sdk/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "android" "uwp") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_IS_WINDOWS) + vcpkg_fail_port_install(MESSAGE "The GameSDK only supports x86 on Windows." ALWAYS) +endif() + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_download_distfile(ARCHIVE + URLS https://dl-game-sdk.discordapp.net/2.5.6/discord_game_sdk.zip + FILENAME discord_game_sdk.zip + SHA512 4c8f72c7bdf92bc969fb86b96ea0d835e01b9bab1a2cc27ae00bdac1b9733a1303ceadfe138c24a7609b76d61d49999a335dd596cf3f335d894702e2aa23406f +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + NO_REMOVE_ONE_LEVEL + PATCHES + include-cstdint.patch # allows compiling on newer versions of GCC +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION ${SOURCE_PATH}) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(ARCH_FOLDER "x86") +else(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_FOLDER "x86_64") +endif() + +if(VCPKG_TARGET_IS_WINDOWS) + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "discord_game_sdk.lib") + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "discord_game_sdk.lib") +elseif(VCPKG_TARGET_IS_OSX) + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dylib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "libdiscord_game_sdk.dylib") + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.dylib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "libdiscord_game_sdk.dylib") +elseif(VCPKG_TARGET_IS_LINUX) + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.so" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "libdiscord_game_sdk.so") + file(INSTALL "${SOURCE_PATH}/lib/${ARCH_FOLDER}/discord_game_sdk.so" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "libdiscord_game_sdk.so") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + "-DSDK_LIB_FOLDER=${CURRENT_PACKAGES_DIR}/lib" +) +vcpkg_install_cmake() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/discord-game-sdk/usage b/ports/discord-game-sdk/usage new file mode 100644 index 00000000000000..11faa0c98492de --- /dev/null +++ b/ports/discord-game-sdk/usage @@ -0,0 +1,12 @@ +The package discord-game-sdk does not provides CMake integration: + + find_library(GAME_SDK discord_game_sdk) + target_link_libraries( PRIVATE ${GAME_SDK}) + + find_path(GAME_SDK_INCLUDE discord-game-sdk/discord.h) + target_include_directories( PRIVATE ${GAME_SDK_INCLUDE}) + +The C++ SDK source code is compiled in a static library: + + find_library(CPP_GAME_SDK discord_game_sdk_cpp) + target_link_libraries( PRIVATE ${CPP_GAME_SDK}) diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 2342c57379c662..61df74294412f1 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,9 +1,19 @@ Source: dlib -Version: 19.17-1 -Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas (!osx), clapack (!osx) +Version: 19.19 +Port-Version: 2 +Build-Depends: libjpeg-turbo, libpng, openblas (!osx), 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 Feature: cuda Build-Depends: cuda Description: CUDA support for dlib + +Feature: fftw3 +Build-Depends: fftw3 +Description: fftw3 support for dlib + +Feature: sqlite3 +Build-Depends: sqlite3 +Description: sqlite3 support for dlib diff --git a/ports/dlib/fix-mac-jpeg.patch b/ports/dlib/fix-mac-jpeg.patch deleted file mode 100644 index 5f961264bf648e..00000000000000 --- a/ports/dlib/fix-mac-jpeg.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt ---- a/dlib/CMakeLists.txt -+++ b/dlib/CMakeLists.txt -@@ -480,7 +480,7 @@ - set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY}) - CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD) - endif() -- if (JPEG_FOUND AND LIBJPEG_IS_GOOD AND NOT APPLE) -+ if (JPEG_FOUND AND LIBJPEG_IS_GOOD) - include_directories(${JPEG_INCLUDE_DIR}) - set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY}) - else() diff --git a/ports/dlib/force_finding_packages.patch b/ports/dlib/force_finding_packages.patch index cd8be16073294c..558b75f1fe881d 100644 --- a/ports/dlib/force_finding_packages.patch +++ b/ports/dlib/force_finding_packages.patch @@ -1,147 +1,44 @@ ---- a/dlib/CMakeLists.txt -+++ b/dlib/CMakeLists.txt -@@ -430,70 +430,9 @@ - endif() +diff --git a/dlib/cmake_utils/find_libjpeg.cmake b/dlib/cmake_utils/find_libjpeg.cmake +index 3b9e656..d741f31 100644 +--- a/dlib/cmake_utils/find_libjpeg.cmake ++++ b/dlib/cmake_utils/find_libjpeg.cmake +@@ -14,7 +14,7 @@ if (DEFINED JPEG_FOUND) + return() + endif() - if (DLIB_PNG_SUPPORT) -- # try to find libpng -- find_package(PNG QUIET) -- # Make sure there isn't something wrong with the version of LIBPNG -- # installed on this system. Also never link to anything from anaconda -- # since it's probably broken. -- if (PNG_FOUND AND NOT ("${PNG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)") AND NOT BUILDING_PYTHON_IN_MSVC) -- set(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARIES}) -- CHECK_FUNCTION_EXISTS(png_create_read_struct LIBPNG_IS_GOOD) -- endif() -- if (PNG_FOUND AND LIBPNG_IS_GOOD) -- include_directories(${PNG_INCLUDE_DIR}) -- set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES}) -- set(REQUIRES_LIBS " libpng") -- else() -- # If we can't find libpng then statically compile it in. -- include_directories(external/libpng external/zlib) -- set(source_files ${source_files} -- external/libpng/arm/arm_init.c -- external/libpng/arm/filter_neon_intrinsics.c -- external/libpng/png.c -- external/libpng/pngerror.c -- external/libpng/pngget.c -- external/libpng/pngmem.c -- external/libpng/pngpread.c -- external/libpng/pngread.c -- external/libpng/pngrio.c -- external/libpng/pngrtran.c -- external/libpng/pngrutil.c -- external/libpng/pngset.c -- external/libpng/pngtrans.c -- external/libpng/pngwio.c -- external/libpng/pngwrite.c -- external/libpng/pngwtran.c -- external/libpng/pngwutil.c -- external/zlib/adler32.c -- external/zlib/compress.c -- external/zlib/crc32.c -- external/zlib/deflate.c -- external/zlib/gzclose.c -- external/zlib/gzlib.c -- external/zlib/gzread.c -- external/zlib/gzwrite.c -- external/zlib/infback.c -- external/zlib/inffast.c -- external/zlib/inflate.c -- external/zlib/inftrees.c -- external/zlib/trees.c -- external/zlib/uncompr.c -- external/zlib/zutil.c -- ) -- -- include(cmake_utils/check_if_neon_available.cmake) -- if (ARM_NEON_IS_AVAILABLE) -- message (STATUS "NEON instructions will be used for libpng.") -- enable_language(ASM) -- set(source_files ${source_files} -- external/libpng/arm/arm_init.c -- external/libpng/arm/filter_neon_intrinsics.c -- external/libpng/arm/filter_neon.S -- ) -- set_source_files_properties(external/libpng/arm/filter_neon.S PROPERTIES COMPILE_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_CXX_FLAGS} -x assembler-with-cpp") -- endif() -- set(REQUIRES_LIBS "") -- endif() -+ find_package(PNG REQUIRED) -+ include_directories(${PNG_INCLUDE_DIR}) -+ set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES}) - set(source_files ${source_files} - image_loader/png_loader.cpp - image_saver/save_png.cpp -@@ -501,68 +440,8 @@ - endif() +-find_package(JPEG QUIET) ++find_package(JPEG REQUIRED) + + if(JPEG_FOUND) + set(JPEG_TEST_CMAKE_FLAGS +@@ -31,7 +31,7 @@ if(JPEG_FOUND) + message (STATUS "Found system copy of libjpeg: ${JPEG_LIBRARY}") + if(NOT test_for_libjpeg_worked) + set(JPEG_FOUND 0) +- message (STATUS "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.") ++ message (FATAL_ERROR "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.") + endif() + endif() + +diff --git a/dlib/cmake_utils/find_libpng.cmake b/dlib/cmake_utils/find_libpng.cmake +index 1b35604..489a4c8 100644 +--- a/dlib/cmake_utils/find_libpng.cmake ++++ b/dlib/cmake_utils/find_libpng.cmake +@@ -14,7 +14,7 @@ if (DEFINED PNG_FOUND) + return() + endif() + +-find_package(PNG QUIET) ++find_package(PNG REQUIRED) + + if(PNG_FOUND) + set(PNG_TEST_CMAKE_FLAGS +@@ -31,7 +31,7 @@ if(PNG_FOUND) + message (STATUS "Found system copy of libpng: ${PNG_LIBRARIES}") + if(NOT test_for_libpng_worked) + set(PNG_FOUND 0) +- message (STATUS "System copy of libpng is broken. Will build our own libpng and use that instead.") ++ message (FATAL_ERROR "System copy of libpng is broken. Will build our own libpng and use that instead.") + endif() + endif() - if (DLIB_JPEG_SUPPORT) -- # try to find libjpeg -- find_package(JPEG QUIET) -- # Make sure there isn't something wrong with the version of libjpeg -- # installed on this system. Also don't use the installed libjpeg -- # if this is an APPLE system because apparently it's broken (as of 2015/01/01). -- if (JPEG_FOUND AND NOT ("${JPEG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)") AND NOT BUILDING_PYTHON_IN_MSVC) -- set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY}) -- CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD) -- endif() -- if (JPEG_FOUND AND LIBJPEG_IS_GOOD) -- include_directories(${JPEG_INCLUDE_DIR}) -- set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY}) -- else() -- # If we can't find libjpeg then statically compile it in. -- add_definitions(-DDLIB_JPEG_STATIC) -- set(source_files ${source_files} -- external/libjpeg/jcomapi.cpp -- external/libjpeg/jdapimin.cpp -- external/libjpeg/jdapistd.cpp -- external/libjpeg/jdatasrc.cpp -- external/libjpeg/jdcoefct.cpp -- external/libjpeg/jdcolor.cpp -- external/libjpeg/jddctmgr.cpp -- external/libjpeg/jdhuff.cpp -- external/libjpeg/jdinput.cpp -- external/libjpeg/jdmainct.cpp -- external/libjpeg/jdmarker.cpp -- external/libjpeg/jdmaster.cpp -- external/libjpeg/jdmerge.cpp -- external/libjpeg/jdphuff.cpp -- external/libjpeg/jdpostct.cpp -- external/libjpeg/jdsample.cpp -- external/libjpeg/jerror.cpp -- external/libjpeg/jidctflt.cpp -- external/libjpeg/jidctfst.cpp -- external/libjpeg/jidctint.cpp -- external/libjpeg/jidctred.cpp -- external/libjpeg/jmemmgr.cpp -- external/libjpeg/jmemnobs.cpp -- external/libjpeg/jquant1.cpp -- external/libjpeg/jquant2.cpp -- external/libjpeg/jutils.cpp -- external/libjpeg/jcapimin.cpp -- external/libjpeg/jdatadst.cpp -- external/libjpeg/jcparam.cpp -- external/libjpeg/jcapistd.cpp -- external/libjpeg/jcmarker.cpp -- external/libjpeg/jcinit.cpp -- external/libjpeg/jcmaster.cpp -- external/libjpeg/jcdctmgr.cpp -- external/libjpeg/jccoefct.cpp -- external/libjpeg/jccolor.cpp -- external/libjpeg/jchuff.cpp -- external/libjpeg/jcmainct.cpp -- external/libjpeg/jcphuff.cpp -- external/libjpeg/jcprepct.cpp -- external/libjpeg/jcsample.cpp -- external/libjpeg/jfdctint.cpp -- external/libjpeg/jfdctflt.cpp -- external/libjpeg/jfdctfst.cpp -- ) -- endif() -+ find_package(JPEG REQUIRED) -+ include_directories(${JPEG_INCLUDE_DIR}) - set(source_files ${source_files} - image_loader/jpeg_loader.cpp - image_saver/save_jpeg.cpp diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake index 114c9b9346f6bf..13d0ee1758d317 100644 --- a/ports/dlib/portfile.cmake +++ b/ports/dlib/portfile.cmake @@ -1,15 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO davisking/dlib - REF v19.17 - SHA512 8574f48d0cc55685d494b3933079c16526fc7cfa3df85a76d51a1f13bebeccf3b6d7247981b53bd1c9e6e664e42245e518cefadf3420be1ab25b5dd6b8d55441 + REF v19.19 + SHA512 013f0c37fa98b0b93824ef94f2c50cb7b41461906ddec1df3021b489e8a02d299b20802416e9dcd6483fd55197e3792119e7b7774ca8dd9c307e8be68a39fe6b HEAD_REF master PATCHES - fix-mac-jpeg.patch fix-sqlite3-fftw-linkage.patch force_finding_packages.patch find_blas.patch @@ -24,22 +21,21 @@ file(READ "${SOURCE_PATH}/dlib/CMakeLists.txt" DLIB_CMAKE) string(REPLACE "PNG_LIBRARY" "PNG_LIBRARIES" DLIB_CMAKE "${DLIB_CMAKE}") file(WRITE "${SOURCE_PATH}/dlib/CMakeLists.txt" "${DLIB_CMAKE}") -set(WITH_CUDA OFF) -if("cuda" IN_LIST FEATURES) - set(WITH_CUDA ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "sqlite3" DLIB_LINK_WITH_SQLITE3 + "fftw3" DLIB_USE_FFTW + "cuda" DLIB_USE_CUDA +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DDLIB_LINK_WITH_SQLITE3=ON - -DDLIB_USE_FFTW=ON + ${FEATURE_OPTIONS} -DDLIB_PNG_SUPPORT=ON -DDLIB_JPEG_SUPPORT=ON -DDLIB_USE_BLAS=ON -DDLIB_USE_LAPACK=ON - -DDLIB_USE_CUDA=${WITH_CUDA} -DDLIB_GIF_SUPPORT=OFF -DDLIB_USE_MKL_FFT=OFF -DCMAKE_DEBUG_POSTFIX=d @@ -67,6 +63,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cu file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cpp11) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_avx) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_sse4) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libjpeg) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libpng) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm) # Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead. @@ -76,6 +74,5 @@ string(REPLACE "#define DLIB_DISABLE_ASSERTS" "#if !defined(_DEBUG)\n#define DLI file(WRITE ${CURRENT_PACKAGES_DIR}/include/dlib/config.h "${_contents}") # Handle copyright -file(COPY ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlib/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/dlib/copyright) +file(INSTALL ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) diff --git a/ports/dmlc/CONTROL b/ports/dmlc/CONTROL index 673862144c165f..8bf079c7f2c4d4 100644 --- a/ports/dmlc/CONTROL +++ b/ports/dmlc/CONTROL @@ -1,5 +1,5 @@ Source: dmlc -Version: 2019-08-12-1 +Version: 2019-08-12-4 Homepage: https://github.com/dmlc/dmlc-core Description: DMLC-Core is the backbone library to support all DMLC projects, offers the bricks to build efficient and scalable distributed machine learning libraries. Default-Features: openmp diff --git a/ports/dmlc/portfile.cmake b/ports/dmlc/portfile.cmake index 903e89882c06d0..fd339627a3f26e 100644 --- a/ports/dmlc/portfile.cmake +++ b/ports/dmlc/portfile.cmake @@ -1,10 +1,6 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} currently doesn't supports UWP.") -endif() +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -27,7 +23,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - NO_PARALLEL_CONFIGURE + DISABLE_PARALLEL_CONFIGURE OPTIONS -DDMLC_FORCE_SHARED_CRT=${DMLC_FORCE_SHARED_CRT} -DUSE_OPENMP=${ENABLE_OPENMP} @@ -40,5 +36,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/dmlc) # Handle copyright -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) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/doctest/CONTROL b/ports/doctest/CONTROL index 6704aba82c795c..e7c29c102e6fca 100644 --- a/ports/doctest/CONTROL +++ b/ports/doctest/CONTROL @@ -1,4 +1,4 @@ Source: doctest -Version: 2.3.7 +Version: 2.4.0 Homepage: https://github.com/onqtam/doctest Description: The fastest feature-rich C++ single-header testing framework for unit tests and TDD diff --git a/ports/doctest/portfile.cmake b/ports/doctest/portfile.cmake index 20fa192bb1c090..fdd9cc79ff3a87 100644 --- a/ports/doctest/portfile.cmake +++ b/ports/doctest/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO onqtam/doctest - REF 7d42bd0fab6c44010c8aed9338bd02bea5feba41 #version 2.3.7 - SHA512 4e71c8dd49a97ee2324207e063d47ce56cfb0371c0e855dd26ce4f169299f1710e4f30a9c5f16a078690c983e6ce7b6d5bb4fe9e0ec6be017905b2381a85b5a6 + REF 1c8da00c978c19e00a434b2b1f854fcffc9fba35 #version 2.4.0 + SHA512 aa0d10a0fbd6d3b9f89c3d909bce332804610390a310c3f6ac89c44c76a07f00a8770d30d6481627572bdbd9dabccfe6c6f9f7b5fb6b323bf5120ec623dd358f HEAD_REF master ) diff --git a/ports/drogon/CONTROL b/ports/drogon/CONTROL new file mode 100644 index 00000000000000..7b859565b57559 --- /dev/null +++ b/ports/drogon/CONTROL @@ -0,0 +1,5 @@ +Source: drogon +Version: v1.0.0-beta18 +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 diff --git a/ports/drogon/drogon_ctl_install.patch b/ports/drogon/drogon_ctl_install.patch new file mode 100644 index 00000000000000..71643248ee399c --- /dev/null +++ b/ports/drogon/drogon_ctl_install.patch @@ -0,0 +1,20 @@ +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/portfile.cmake b/ports/drogon/portfile.cmake new file mode 100644 index 00000000000000..31d8e662a65cc1 --- /dev/null +++ b/ports/drogon/portfile.cmake @@ -0,0 +1,33 @@ +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 diff --git a/ports/drogon/vcpkg.patch b/ports/drogon/vcpkg.patch new file mode 100644 index 00000000000000..92b9aea869ff64 --- /dev/null +++ b/ports/drogon/vcpkg.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aab915d..4daeb87 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,9 +64,9 @@ if(WIN32) + PRIVATE $) + endif(WIN32) + +-add_subdirectory(trantor) ++find_package(Trantor CONFIG REQUIRED) + +-target_link_libraries(${PROJECT_NAME} PUBLIC trantor) ++target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) + + if(NOT WIN32) + target_link_libraries(${PROJECT_NAME} PRIVATE dl) diff --git a/ports/eabase/CONTROL b/ports/eabase/CONTROL index 42fe968037d395..2855f5f2fd3cf5 100644 --- a/ports/eabase/CONTROL +++ b/ports/eabase/CONTROL @@ -1,4 +1,4 @@ Source: eabase -Version: 2.09.12 +Version: 2.09.12-1 Homepage: https://github.com/electronicarts/EABase Description: Electronic Arts Base. EABase is a small set of header files that define platform-independent data types and macros. diff --git a/ports/eabase/portfile.cmake b/ports/eabase/portfile.cmake index 8a5e57dac53dd8..8ebb2ab1498f72 100644 --- a/ports/eabase/portfile.cmake +++ b/ports/eabase/portfile.cmake @@ -27,4 +27,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) vcpkg_copy_pdbs() # Handle copyright -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/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/efsw/CONTROL b/ports/efsw/CONTROL new file mode 100644 index 00000000000000..37a6919fd6816f --- /dev/null +++ b/ports/efsw/CONTROL @@ -0,0 +1,5 @@ +Source: efsw +Version: 2020-06-08 +Homepage: https://github.com/SpartanJ/efsw +Description: efsw is a C++ cross-platform file system watcher and notifier. +Supports: !uwp diff --git a/ports/efsw/portfile.cmake b/ports/efsw/portfile.cmake new file mode 100644 index 00000000000000..542e79560643b0 --- /dev/null +++ b/ports/efsw/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO SpartanJ/efsw + REF b62d04829bb0a6f3cacc7859e0b046a3c053bc50 + SHA512 fc16ef6ad330941dc0a1112ce645b57bd126d353556d50f45fadf150f25edd42c1d4946bc54d629d94c208d67d4ce17dbf5d1079cbeed51f0f6b1ccbe2199132 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DVERBOSE=OFF + -DBUILD_TEST_APP=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/egl-registry/CONTROL b/ports/egl-registry/CONTROL index dad0d9d20c11eb..74cdf16b170748 100644 --- a/ports/egl-registry/CONTROL +++ b/ports/egl-registry/CONTROL @@ -1,3 +1,4 @@ Source: egl-registry -Version: 2020-02-03 +Version: 2020-02-20 +Homepage: https://github.com/KhronosGroup/EGL-Registry Description: the EGL API and Extension Registry diff --git a/ports/egl-registry/portfile.cmake b/ports/egl-registry/portfile.cmake index 68f6a2ee8f2e7d..bfdca5b71d7535 100644 --- a/ports/egl-registry/portfile.cmake +++ b/ports/egl-registry/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/EGL-Registry - REF aa9b63f3ab18aee92c95786a2478156430f809e4 - SHA512 5ee7143c2cb46defbe1b2ecb0fabfb52fac2d9529b98c638dd4c04a312a62e7f7b3aee27d9749c92174ab967d533136b5881ce37ae9f2bee6685f52ffa8c8db6 + REF 11478904448bbdf5757b798c856a525aa2b351b1 + SHA512 f1e54810cb2948e9d8798d65507069bba4ee6534d719e792db11e36d600ef37e59a34262809d8b1e41160ae1e45a283fa322cd9d9a647985c48a6d7d6d1706ee HEAD_REF master ) @@ -18,11 +16,11 @@ file( file( COPY ${SOURCE_PATH}/api/egl.xml - DESTINATION ${CURRENT_PACKAGES_DIR}/share/egl-registry + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) file( INSTALL ${SOURCE_PATH}/sdk/docs/man/copyright.xml - DESTINATION ${CURRENT_PACKAGES_DIR}/share/egl-registry + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright ) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index b612dc881c4b47..9a60167d29af70 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,4 +1,5 @@ Source: eigen3 -Version: 3.3.7-4 +Version: 3.3.7 +Port-Version: 6 Homepage: http://eigen.tuxfamily.org Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/fix-cuda-error.patch b/ports/eigen3/fix-cuda-error.patch new file mode 100644 index 00000000000000..9123806df07563 --- /dev/null +++ b/ports/eigen3/fix-cuda-error.patch @@ -0,0 +1,30 @@ +diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h +index 755e620..85e445b 100644 +--- a/Eigen/src/Core/arch/CUDA/Half.h ++++ b/Eigen/src/Core/arch/CUDA/Half.h +@@ -209,7 +209,11 @@ namespace half_impl { + // conversion steps back and forth. + + EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) { ++#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000 ++ return __hadd(::__half(a), ::__half(b)); ++#else + return __hadd(a, b); ++#endif + } + EIGEN_STRONG_INLINE __device__ half operator * (const half& a, const half& b) { + return __hmul(a, b); +@@ -218,9 +222,13 @@ EIGEN_STRONG_INLINE __device__ half operator - (const half& a, const half& b) { + return __hsub(a, b); + } + EIGEN_STRONG_INLINE __device__ half operator / (const half& a, const half& b) { ++#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000 ++ return __hdiv(a, b); ++#else + float num = __half2float(a); + float denom = __half2float(b); + return __float2half(num / denom); ++#endif + } + EIGEN_STRONG_INLINE __device__ half operator - (const half& a) { + return __hneg(a); diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index ad8779e75c8c3a..dedfd026b7fbcb 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_buildpath_length_warning(37) vcpkg_from_gitlab( @@ -9,6 +7,7 @@ vcpkg_from_gitlab( REF 3.3.7 SHA512 4cc3717b9cbe78335e05f724919497214edd482d4812aeb1a9fd6da5b3f6d1b194bb93ed0dab9e734b4334a5b88e8f8c339c43c1b2044332286ef5e758f9ecf4 HEAD_REF master + PATCHES fix-cuda-error.patch # issue https://gitlab.com/libeigen/eigen/-/issues/1526 ) vcpkg_configure_cmake( @@ -16,24 +15,26 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBUILD_TESTING=OFF + -DEIGEN_BUILD_PKGCONFIG=ON OPTIONS_RELEASE -DCMAKEPACKAGE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/eigen3 + -DPKGCONFIG_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/lib/pkgconfig OPTIONS_DEBUG -DCMAKEPACKAGE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/share/eigen3 + -DPKGCONFIG_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +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) #" +) -file(READ "${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake" EIGEN_TARGETS) -string(REPLACE "set(_IMPORT_PREFIX " "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}/../..\" ABSOLUTE) #" EIGEN_TARGETS "${EIGEN_TARGETS}") -file(WRITE "${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake" "${EIGEN_TARGETS}") +vcpkg_fixup_pkgconfig() file(GLOB INCLUDES ${CURRENT_PACKAGES_DIR}/include/eigen3/*) -# Copy the eigen header files to conventional location for user-wide MSBuild integration file(COPY ${INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -# Put the licence file where vcpkg expects it -file(COPY ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/eigen3) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/eigen3/COPYING.README ${CURRENT_PACKAGES_DIR}/share/eigen3/copyright) +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..824e892e6c1ef6 --- a/ports/embree3/CONTROL +++ b/ports/embree3/CONTROL @@ -1,5 +1,5 @@ Source: embree3 -Version: 3.8.0 +Version: 3.11.0 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/portfile.cmake b/ports/embree3/portfile.cmake old mode 100644 new mode 100755 index af320ffc1480b9..6832847ddc35e8 --- a/ports/embree3/portfile.cmake +++ b/ports/embree3/portfile.cmake @@ -1,64 +1,40 @@ -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 ) -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(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) 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/enet/CONTROL b/ports/enet/CONTROL index d28284306111fc..3b9dbb38ea92f3 100644 --- a/ports/enet/CONTROL +++ b/ports/enet/CONTROL @@ -1,5 +1,4 @@ Source: enet -Version: 1.3.13-1 +Version: 1.3.15 Homepage: https://github.com/lsalzman/enet Description: Reliable UDP networking library - diff --git a/ports/enet/portfile.cmake b/ports/enet/portfile.cmake index 11c56137cbcd45..2f661af7fd35cd 100644 --- a/ports/enet/portfile.cmake +++ b/ports/enet/portfile.cmake @@ -1,9 +1,8 @@ -include(vcpkg_common_functions) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH REPO "lsalzman/enet" - REF f7c46f03fd8d883ac2811948aa71c7623069d070 + REF 224f31101fc60939c02f6bbe8e8fc810a7db306b HEAD_REF master - SHA512 2d5593ea56473b38479921fd0849318bf3ecb233f92fa487ba395a0bb7e6a3997109287867a67c66721f761a30cceab4ba4709080a93ed977b7650b10cab1936 + SHA512 6f820b5ce9df1cc94793dfced87d5039bdbe4e3fee44951d293158d37c79f2bd16d788a89f67f54ba4ee8570b46db28831f2becc4fe56659ea47f118e4f3f30c ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/ensmallen/CONTROL b/ports/ensmallen/CONTROL index 2a93222c607da1..bf13812e416277 100644 --- a/ports/ensmallen/CONTROL +++ b/ports/ensmallen/CONTROL @@ -1,6 +1,7 @@ Source: ensmallen Version: 2.11.2 +Port-Version: 1 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 (!osx), lapack, armadillo diff --git a/ports/entt/CONTROL b/ports/entt/CONTROL index 26905be972ca6f..5bcd721ef14c1d 100644 --- a/ports/entt/CONTROL +++ b/ports/entt/CONTROL @@ -1,4 +1,4 @@ Source: entt -Version: 3.3.0 +Version: 3.4.0 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 98225cd038f235..7be4e0527d10ed 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.3.0 - SHA512 98ce01a3a7b1d1fe4f9b3f2db6505944b811c63e968dded9c31c8ba18f00dbae701ccc387e38a4f65ee6d4e581a3686009adbd2286b6014a017a93fa43803cdf + REF v3.4.0 + SHA512 0094d2bff106754a3d8500152ea3206d2e0e0a8043ab54794faf6b5caa02dd2f0675011dafdd6e33de105c464204034b2a7d9380fe77a4d8b67f07f05e7f0152 HEAD_REF master ) @@ -19,10 +19,10 @@ vcpkg_install_cmake() if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake) vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) else() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/entt) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/EnTT/cmake) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/entt RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/epsilon/0003-Fix-build-error.patch b/ports/epsilon/0003-Fix-build-error.patch new file mode 100644 index 00000000000000..73309b74785e28 --- /dev/null +++ b/ports/epsilon/0003-Fix-build-error.patch @@ -0,0 +1,52 @@ +diff --git a/makefile.vc b/makefile.vc +index cd0fc5a..7ce6861 100644 +--- a/makefile.vc ++++ b/makefile.vc +@@ -32,6 +32,12 @@ epsilon.lib: $(LIBOBJ) + + $(EPSILON_DLL): epsilon_i.lib + ++!IFNDEF DEBUG ++POPTLIB=$(LIBPATH)popt.lib ++!ELSE ++POPTLIB=$(LIBPATH)poptd.lib ++!ENDIF ++ + epsilon_i.lib: $(LIBOBJ) + link /debug /dll /def:libepsilon.def /out:$(EPSILON_DLL) \ + /implib:epsilon_i.lib $(LIBOBJ) +@@ -48,8 +54,8 @@ $(EPSILON_EXE): $(EPSILON_DLL) src\epsilon.obj \ + src\cmd_truncate_file.obj src\cmd_decode_file.obj \ + src\cmd_encode_file.obj src\misc.obj \ + src\psi.obj src\pbm.obj \ +- ..\popt\lib\libpopt.lib +- /Fe$(EPSILON_EXE) ++ $(POPTLIB) \ ++ /Fe"$(EPSILON_EXE)" + if exist $(EPSILON_EXE).manifest mt -manifest \ + $(EPSILON_EXE).manifest -outputresource:$(EPSILON_EXE);1 + +@@ -71,8 +77,9 @@ install: all + -mkdir $(INSTDIR)\bin + -mkdir $(INSTDIR)\lib + -mkdir $(INSTDIR)\include ++ -mkdir $(INSTDIR)\tools + copy *.dll $(INSTDIR)\bin + copy *.lib $(INSTDIR)\lib +- copy *.exe $(INSTDIR)\bin ++ copy *.exe $(INSTDIR)\tools + copy lib\epsilon.h $(INSTDIR)\include + +diff --git a/src/misc.h b/src/misc.h +index 9023dce..d8ce602 100644 +--- a/src/misc.h ++++ b/src/misc.h +@@ -30,7 +30,7 @@ extern "C" { + #endif + + /* Use _snprintf instead of snprintf under MSVC compiler */ +-#if defined(_WIN32) && !defined(__MINGW32__) ++#if 0 + #define snprintf _snprintf + #endif + diff --git a/ports/epsilon/CONTROL b/ports/epsilon/CONTROL index be2f7856264831..1547a9967837a5 100644 --- a/ports/epsilon/CONTROL +++ b/ports/epsilon/CONTROL @@ -1,4 +1,5 @@ Source: epsilon -Version: 0.9.2-1 +Version: 0.9.2-4 Homepage: https://sourceforge.net/projects/epsilon-project/ -Description: EPSILON is an Open Source wavelet image compressor, that is aimed on parallel and robust image processing. \ No newline at end of file +Description: EPSILON is an Open Source wavelet image compressor, that is aimed on parallel and robust image processing. +Build-Depends: libpopt \ No newline at end of file diff --git a/ports/epsilon/portfile.cmake b/ports/epsilon/portfile.cmake index e21cc3d3a70ccd..525974ab575546 100644 --- a/ports/epsilon/portfile.cmake +++ b/ports/epsilon/portfile.cmake @@ -1,26 +1,17 @@ -include(vcpkg_common_functions) +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/epsilon-project/epsilon/0.9.2/epsilon-0.9.2.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fepsilon-project%2Ffiles%2Fepsilon%2F0.9.2%2Fepsilon-0.9.2.tar.gz%2Fdownload%3Fuse_mirror%3Dayera" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO epsilon-project/epsilon + REF 0.9.2 FILENAME "epsilon-0.9.2.tar.gz" - SHA512 95f427c68a4a4eb784f7d484d87fc573133983510f6b030663f88955e2446490a07b1343ae4668251b466f67cf9a79bd834b933c57c5ed12327f32174f20ac0f) - -# Extract source into archictecture specific directory, because GDALs' nmake based build currently does not -# support out of source builds. -set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/epsilon-0.9.2) -set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/epsilon-0.9.2) -file(REMOVE_RECURSE ${SOURCE_PATH_DEBUG} ${SOURCE_PATH_RELEASE}) # to be sure that the patches can be properly applied, we always clean the buildtrees folder -foreach(BUILD_TYPE debug release) - vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}) - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}/epsilon-0.9.2 - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-VS2015-provides-snprintf.patch - ${CMAKE_CURRENT_LIST_DIR}/0002-Add-CFLAGS-for-CRT-selection-and-warning-supression.patch - ) -endforeach() + SHA512 95f427c68a4a4eb784f7d484d87fc573133983510f6b030663f88955e2446490a07b1343ae4668251b466f67cf9a79bd834b933c57c5ed12327f32174f20ac0f + PATCHES + 0001-VS2015-provides-snprintf.patch + 0002-Add-CFLAGS-for-CRT-selection-and-warning-supression.patch + 0003-Fix-build-error.patch +) -find_program(NMAKE nmake REQUIRED) if (VCPKG_CRT_LINKAGE STREQUAL static) set(CL_FLAGS_REL "/MT /Ox /fp:precise") set(CL_FLAGS_DBG "/MTd /Zi") @@ -31,68 +22,27 @@ else() set(TARGET_LIB epsilon_i.lib) endif() -################ -# Release build -################ -message(STATUS "Building ${TARGET_TRIPLET}-rel") -file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL) -vcpkg_execute_required_process( - COMMAND ${NMAKE} -f makefile.vc - "INSTDIR=\"${INST_DIR_REL}\"" - MSVC_VER=1900 - CRT_FLAGS=${CL_FLAGS_REL} - INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} - ${TARGET_LIB} - WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} - LOGNAME nmake-build-${TARGET_TRIPLET}-release -) -message(STATUS "Building ${TARGET_TRIPLET}-rel done") - -################ -# Debug build -################ -message(STATUS "Building ${TARGET_TRIPLET}-dbg") -file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG) -vcpkg_execute_required_process( - COMMAND ${NMAKE} /G -f makefile.vc - "INSTDIR=\"${INST_DIR_DBG}\"" +vcpkg_install_nmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" + OPTIONS_DEBUG + INSTDIR="${CURRENT_PACKAGES_DIR}/debug" MSVC_VER=1900 CRT_FLAGS=${CL_FLAGS_DBG} DEBUG=1 - INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} ${TARGET_LIB} - WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} - LOGNAME nmake-build-${TARGET_TRIPLET}-debug + LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib/" + OPTIONS_RELEASE + INSTDIR="${CURRENT_PACKAGES_DIR}" + MSVC_VER=1900 + CRT_FLAGS=${CL_FLAGS_REL} + ${TARGET_LIB} + LIBPATH="${CURRENT_INSTALLED_DIR}/lib/" ) -message(STATUS "Building ${TARGET_TRIPLET}-dbg done") -message(STATUS "Packaging ${TARGET_TRIPLET}") -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/epsilon/filters) -if (VCPKG_CRT_LINKAGE STREQUAL dynamic) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${SOURCE_PATH_RELEASE}/epsilon.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/bin/) - file(INSTALL ${SOURCE_PATH_DEBUG}/epsilon.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) - file(INSTALL ${SOURCE_PATH_RELEASE}/epsilon_i.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH_DEBUG}/epsilon_i.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) -else() - file(INSTALL ${SOURCE_PATH_RELEASE}/epsilon.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH_DEBUG}/epsilon.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) -endif() -file(COPY ${SOURCE_PATH_RELEASE}/lib/epsilon.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include/) -file(GLOB FILTERS ${SOURCE_PATH_RELEASE}/filters/*.filter) -file(INSTALL ${FILTERS} - DESTINATION ${CURRENT_PACKAGES_DIR}/share/epsilon/filters/) vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH_RELEASE}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/epsilon/ RENAME copyright) -message(STATUS "Packaging ${TARGET_TRIPLET} done") + +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/evpp/CONTROL b/ports/evpp/CONTROL index 5f367929a188c1..047c77a4404031 100644 --- a/ports/evpp/CONTROL +++ b/ports/evpp/CONTROL @@ -1,5 +1,6 @@ Source: evpp -Version: 0.7.0-2 +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/evpp/fix-osx-build.patch b/ports/evpp/fix-osx-build.patch new file mode 100644 index 00000000000000..47c758fdeee635 --- /dev/null +++ b/ports/evpp/fix-osx-build.patch @@ -0,0 +1,45 @@ +diff --git a/evpp/server_status.h b/evpp/server_status.h +index 3a83725..f28f833 100644 +--- a/evpp/server_status.h ++++ b/evpp/server_status.h +@@ -25,7 +25,7 @@ public: + }; + + std::string StatusToString() const { +- H_CASE_STRING_BIGIN(status_); ++ H_CASE_STRING_BIGIN(+status_); + H_CASE_STRING(kNull); + H_CASE_STRING(kInitialized); + H_CASE_STRING(kRunning); +diff --git a/evpp/sockets.cc b/evpp/sockets.cc +index 333c05c..c547d88 100644 +--- a/evpp/sockets.cc ++++ b/evpp/sockets.cc +@@ -22,6 +22,14 @@ std::string strerror(int e) { + } + + return empty_string; ++#elif defined(__APPLE__) ++ char buf[2048] = {}; ++ strerror_r(e, buf, sizeof(buf) - 1); ++ const char* s = buf; ++ if (s) { ++ return std::string(s); ++ } ++ return std::string(); + #else + char buf[2048] = {}; + const char* s = strerror_r(e, buf, sizeof(buf) - 1); +diff --git a/evpp/tcp_conn.cc b/evpp/tcp_conn.cc +index b7678d0..527b2b9 100644 +--- a/evpp/tcp_conn.cc ++++ b/evpp/tcp_conn.cc +@@ -309,7 +309,7 @@ void TCPConn::SetTCPNoDelay(bool on) { + } + + std::string TCPConn::StatusToString() const { +- H_CASE_STRING_BIGIN(status_); ++ H_CASE_STRING_BIGIN(+status_); + H_CASE_STRING(kDisconnected); + H_CASE_STRING(kConnecting); + H_CASE_STRING(kConnected); diff --git a/ports/evpp/portfile.cmake b/ports/evpp/portfile.cmake index ed75772de20236..b3edaf3aadf9cc 100644 --- a/ports/evpp/portfile.cmake +++ b/ports/evpp/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(EVPP_VERSION 0.7.0) vcpkg_from_github( @@ -11,13 +9,16 @@ vcpkg_from_github( PATCHES fix-rapidjson-1-1.patch fix-linux-build.patch + fix-osx-build.patch ) + file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/rapidjson ${SOURCE_PATH}/3rdparty/concurrentqueue) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DEVPP_VCPKG_BUILD=ON + OPTIONS + -DEVPP_VCPKG_BUILD=ON ) vcpkg_install_cmake() diff --git a/ports/exiv2/1059-Add-missing-library-link-on-Windows.patch b/ports/exiv2/1059-Add-missing-library-link-on-Windows.patch deleted file mode 100644 index 2a61c10f179171..00000000000000 --- a/ports/exiv2/1059-Add-missing-library-link-on-Windows.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcb98ca23..3cbd68e7e 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -182,12 +182,12 @@ if (NOT MSVC) - endif() - - if (CYGWIN OR MINGW OR MSYS) -- target_link_libraries( exiv2lib PRIVATE psapi ws2_32 ) -+ target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 ) - endif() - - target_link_libraries( exiv2lib PRIVATE Threads::Threads) - else() -- target_link_libraries( exiv2lib PRIVATE psapi ws2_32 ) -+ target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 ) - endif() - - if( EXIV2_ENABLE_PNG ) diff --git a/ports/exiv2/CONTROL b/ports/exiv2/CONTROL index ed3fabcc6022b5..35af4ff70ce241 100644 --- a/ports/exiv2/CONTROL +++ b/ports/exiv2/CONTROL @@ -1,5 +1,5 @@ Source: exiv2 -Version: 0.27.2-1 +Version: 0.27.3 Build-Depends: zlib, expat, libiconv, gettext Description: Image metadata library and tools Homepage: https://www.exiv2.org diff --git a/ports/exiv2/iconv.patch b/ports/exiv2/iconv.patch deleted file mode 100644 index 406298aec8d463..00000000000000 --- a/ports/exiv2/iconv.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake -index a458a0c..9caffcf 100644 ---- a/cmake/findDependencies.cmake -+++ b/cmake/findDependencies.cmake -@@ -40,7 +40,7 @@ else() - endif() - - if (EXIV2_ENABLE_NLS) -- find_package(Intl REQUIRED) -+ find_package(unofficial-gettext CONFIG) - endif( ) - - find_package(Iconv) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 76eaabc..68d29de 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -214,16 +214,15 @@ if( EXIV2_ENABLE_PNG ) - endif() - - if( EXIV2_ENABLE_NLS ) -- target_link_libraries(exiv2lib PRIVATE ${Intl_LIBRARIES}) -- target_include_directories(exiv2lib PRIVATE ${Intl_INCLUDE_DIRS}) -- target_include_directories(exiv2lib_int PRIVATE ${Intl_INCLUDE_DIRS}) -+ target_link_libraries(exiv2lib PRIVATE unofficial::gettext::libintl) - # Definition needed for translations - target_compile_definitions(exiv2lib PUBLIC EXV_LOCALEDIR="/../${CMAKE_INSTALL_LOCALEDIR}") - endif() - --if( ICONV_FOUND ) -- target_link_libraries( exiv2lib PRIVATE Iconv::Iconv ) -+if(NOT TARGET unofficial::iconv::libiconv) -+ find_package(unofficial-iconv CONFIG) - endif() -+target_link_libraries( exiv2lib PRIVATE unofficial::iconv::libiconv ) - - write_basic_package_version_file(exiv2ConfigVersion.cmake COMPATIBILITY ExactVersion) - diff --git a/ports/exiv2/portfile.cmake b/ports/exiv2/portfile.cmake index 86c495f4f227c2..966c9eff81c392 100644 --- a/ports/exiv2/portfile.cmake +++ b/ports/exiv2/portfile.cmake @@ -1,14 +1,9 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Exiv2/exiv2 - REF v0.27.2 - SHA512 349063fd8ef6c44b5b2f3f68aad839271a9cb8ff206af237d28d9e9d05dcdf43b61f3232d4566780b2898d62c20134e8ea65d588a19a664c0224750e4ea1340d + REF 194bb65ac568a5435874c9d9d73b1c8a68e4edec #v0.27.3 + SHA512 35a5a41e0a6cfe04d1ed005c8116ad4430516402b925db3d4f719e2385e2cfb09359eb7ab51853bc560138f221900778cd2e2d39f108c513b3e7d22dbb9bf503 HEAD_REF master - PATCHES - iconv.patch - 1059-Add-missing-library-link-on-Windows.patch # https://github.com/Exiv2/exiv2/pull/1059 ) if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND ("unicode" IN_LIST FEATURES)) diff --git a/ports/faad2/CONTROL b/ports/faad2/CONTROL index 3b258ef1bfbbc3..65b02f103f6e3c 100644 --- a/ports/faad2/CONTROL +++ b/ports/faad2/CONTROL @@ -1,7 +1,8 @@ Source: faad2 -Version: 2.9.1-1 +Version: 2.9.1 +Port-Version: 2 Homepage: https://sourceforge.net/projects/faac/ Description: Freeware Advanced Audio (AAC) Decoder -Feature: build_decoder +Feature: build-decoder Description: Build the embedded decoder executable diff --git a/ports/faad2/portfile.cmake b/ports/faad2/portfile.cmake index 2cbec1ba7102d9..9daa8d49268f11 100644 --- a/ports/faad2/portfile.cmake +++ b/ports/faad2/portfile.cmake @@ -15,7 +15,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - build_decoder FAAD_BUILD_BINARIES + build-decoder FAAD_BUILD_BINARIES ) vcpkg_configure_cmake( @@ -26,7 +26,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/faad2 RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/farmhash/CONTROL b/ports/farmhash/CONTROL index 79cb6849a31141..f27140fbd01d5a 100644 --- a/ports/farmhash/CONTROL +++ b/ports/farmhash/CONTROL @@ -1,4 +1,5 @@ Source: farmhash -Version: 1.1 +Version: 1.1-1 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 42aa80ceb1d828..d9bcc924063610 100644 --- a/ports/farmhash/portfile.cmake +++ b/ports/farmhash/portfile.cmake @@ -1,5 +1,5 @@ -vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "Windows") -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +#Requires a compiler which understands '__builtin_unreachable': +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -9,12 +9,12 @@ vcpkg_from_github( HEAD_REF master ) -set(FLAGS "-g -mavx -maes -O3") +if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This should be a compiler check + set(ENV{CXXFLAGS} "-maes -msse4.2") +endif() +file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG - OPTIONS - CXXFLAGS=${FLAGS} ) vcpkg_install_make() diff --git a/ports/fastrtps/CONTROL b/ports/fastrtps/CONTROL index c80f7638c70b26..f97ba46c76983b 100644 --- a/ports/fastrtps/CONTROL +++ b/ports/fastrtps/CONTROL @@ -1,4 +1,4 @@ Source: fastrtps -Version: 1.5.0-2 +Version: 1.5.0-3 Description: Eprosima Fast RTPS is a C++ implementation of the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. Build-Depends: openssl, asio, tinyxml2 \ No newline at end of file diff --git a/ports/fastrtps/portfile.cmake b/ports/fastrtps/portfile.cmake index 9aed75f5bffa87..3dfbe87c9c9e59 100644 --- a/ports/fastrtps/portfile.cmake +++ b/ports/fastrtps/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO eProsima/Fast-RTPS + REPO eProsima/Fast-DDS REF b1779b608c7b5b2dcb101728f4213c58bdde74ee # waiting for next release - SHA512 9ec4a1e41296df1c0bc00926d925e0947602fabb68e9b28311e92739b0e1909a2993b15fc05eb31aeb9842ed50127f8d56571d09e57dd64ac6f37d0fed6cea73 + SHA512 f316a71784cdac5379b1cf59cee4bf57304aa59a73563fcbdd141b0d1297302048ca73817adca68baf18472e74f200af9490d2d6fa6124863ec260546fb373e4 HEAD_REF master PATCHES fix-install.patch @@ -28,4 +26,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/examples) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/fastrtps) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/fastrtps) -file(RENAME ${CURRENT_PACKAGES_DIR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/fastrtps/copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) diff --git a/ports/fcl/CONTROL b/ports/fcl/CONTROL index efd311474e2289..0de5cc8581220d 100644 --- a/ports/fcl/CONTROL +++ b/ports/fcl/CONTROL @@ -1,5 +1,5 @@ Source: fcl -Version: 0.6.0 +Version: 0.6.0-1 Homepage: https://github.com/flexible-collision-library/fcl Description: a library for performing three types of proximity queries on a pair of geometric models composed of triangles Build-Depends: ccd, octomap, eigen3 diff --git a/ports/fcl/portfile.cmake b/ports/fcl/portfile.cmake index cc5d87f14544c2..f5585ec6e179bb 100644 --- a/ports/fcl/portfile.cmake +++ b/ports/fcl/portfile.cmake @@ -14,12 +14,19 @@ else() set(FCL_STATIC_LIBRARY OFF) endif() +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(FCL_USE_X64_SSE ON) +else() + set(FCL_USE_X64_SSE OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DFCL_STATIC_LIBRARY=${FCL_STATIC_LIBRARY} -DFCL_BUILD_TESTS=OFF + -DFCL_USE_X64_SSE=${FCL_USE_X64_SSE} ) vcpkg_install_cmake() diff --git a/ports/ffmpeg/0002-detect-openssl.patch b/ports/ffmpeg/0002-detect-openssl.patch deleted file mode 100644 index a095af6b14c922..00000000000000 --- a/ports/ffmpeg/0002-detect-openssl.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/configure b/configure -index 1c8008a..bd2de34 100755 ---- a/configure -+++ b/configure -@@ -6360,7 +6360,8 @@ 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 || -- die "ERROR: openssl not found"; } -+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 || -+ 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 && - require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create && diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch new file mode 100644 index 00000000000000..9fffd9d7e51ae4 --- /dev/null +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -0,0 +1,20 @@ +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" + 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|| + 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 + 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 || ++ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32|| + 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 && diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index dce1531688537d..c318866af6b084 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,5 +1,6 @@ Source: ffmpeg -Version: 4.2-7 +Version: 4.2 +Port-Version: 17 Build-Depends: zlib 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. @@ -56,4 +57,8 @@ Description: Libav audio resampling library support in ffmpeg Feature: nvcodec Build-Depends: ffnvcodec, cuda -Description: Hardware accelerated codecs \ No newline at end of file +Description: Hardware accelerated codecs + +Feature: avisynthplus +Build-Depends: avisynthplus, ffmpeg[gpl] +Description: avisynthplus support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index cd61ffcc85604b..7333e60831bcf9 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,7 +33,11 @@ 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@) @@ -131,7 +135,9 @@ 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) +if(@ENABLE_AVRESAMPLE@) + FFMPEG_FIND(libavresample avresample avresample.h) +endif() FFMPEG_FIND(libavutil avutil avutil.h) FFMPEG_FIND(libswresample swresample swresample.h) FFMPEG_FIND(libswscale swscale swscale.h) @@ -160,7 +166,7 @@ if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_ ${FFMPEG_libavcodec_LIBRARY} ${FFMPEG_libswresample_LIBRARY} ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} + ${FFMPEG_libavutil_LIBRARY} ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index a87ea6a0197a97..6fd6bc988135c5 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -6,10 +6,10 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-create-lib-libraries.patch - 0002-detect-openssl.patch 0003-fix-windowsinclude.patch 0004-fix-debug-build.patch 0005-fix-libvpx-linking.patch + 0006-fix-StaticFeatures.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -127,8 +127,10 @@ else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() +set(ENABLE_AVRESAMPLE OFF) if("avresample" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-avresample") + set(ENABLE_AVRESAMPLE ON) #necessary for configuring FFMPEG CMake Module endif() if (VCPKG_TARGET_IS_OSX) @@ -141,6 +143,12 @@ else() set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") endif() +if("avisynthplus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avisynth") +else() + set(OPTIONS "${OPTIONS} --disable-avisynth") +endif() + set(OPTIONS_CROSS "") if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") @@ -267,10 +275,12 @@ if (VCPKG_TARGET_IS_WINDOWS) if(FILES_TO_REMOVE) if (EXE_FILES_REL) - file(INSTALL ${EXE_FILES_REL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(INSTALL ${EXE_FILES_REL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() if (EXE_FILES_DBG) - file(INSTALL ${EXE_FILES_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools) + file(INSTALL ${EXE_FILES_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) endif() file(REMOVE ${FILES_TO_REMOVE}) endif() 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 5779ec9e3dd385..4a2ce6d71c70d8 100644 --- a/ports/ffnvcodec/CONTROL +++ b/ports/ffnvcodec/CONTROL @@ -1,4 +1,4 @@ Source: ffnvcodec -Version: 9.1.23.1 +Version: 9.1.23.1-1 Homepage: https://github.com/FFmpeg/nv-codec-headers Description: FFmpeg version of Nvidia Codec SDK headers. diff --git a/ports/fftw3/CONTROL b/ports/fftw3/CONTROL index 4d378d8c390757..95c6936319029c 100644 --- a/ports/fftw3/CONTROL +++ b/ports/fftw3/CONTROL @@ -1,5 +1,5 @@ Source: fftw3 -Version: 3.3.8-6 +Version: 3.3.8-7 Homepage: https://www.fftw.org/ Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake index 5132c9574873aa..161cff768ec9ec 100644 --- a/ports/fftw3/portfile.cmake +++ b/ports/fftw3/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "http://www.fftw.org/fftw-3.3.8.tar.gz" FILENAME "fftw-3.3.8.tar.gz" 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 c65ac02c5e1f01..d16bd4cb4839de 100644 --- a/ports/field3d/CONTROL +++ b/ports/field3d/CONTROL @@ -1,6 +1,7 @@ Source: field3d -Version: 1.7.2 +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, 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 +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/portfile.cmake b/ports/field3d/portfile.cmake index 5170e97a3b8270..a23e042494b94a 100644 --- a/ports/field3d/portfile.cmake +++ b/ports/field3d/portfile.cmake @@ -1,26 +1,28 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") -if (VCPKG_TARGET_IS_WINDOWS) - message(FATAL_ERROR "Windows is currently not supported.") -elseif (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.2 - SHA512 e4ea51310105980f759dce48830db8ae3592ce32a02b246214d8aed9df7a7f5c500314f2daf92196b7a76d648f2909b18112df4c5c3c8949c0676d710dfbf1f2 + REF 0cf75ad982917e0919f59e5cb3d483517d06d7da + SHA512 e6f137013dd7b64b51b2ec3cc3ed8f4dbfadb85858946f08393653d78136cf8f93ae124716db11358e325c5e64ba04802afd4b89ca36ad65a14dd3db17f3072c HEAD_REF master PATCHES - fix-build_error.patch + 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 + OPTIONS + "-DINSTALL_DOCS:BOOL=OFF" ) vcpkg_install_cmake() @@ -30,6 +32,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -file(COPY ${SOURCE_PATH}/COPYING ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/field3d) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/field3d/COPYING ${CURRENT_PACKAGES_DIR}/share/field3d/copyright) +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/flatbuffers/CONTROL b/ports/flatbuffers/CONTROL index 3baf26b02f97fc..5433a059877214 100644 --- a/ports/flatbuffers/CONTROL +++ b/ports/flatbuffers/CONTROL @@ -1,5 +1,5 @@ Source: flatbuffers -Version: 1.11.0-1 +Version: 1.12.0 Description: Memory Efficient Serialization Library FlatBuffers is an efficient cross platform serialization library for games and other memory constrained apps. It allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility. Homepage: https://google.github.io/flatbuffers/ diff --git a/ports/flatbuffers/fix-uwp-build.patch b/ports/flatbuffers/fix-uwp-build.patch index 7d8fe93a340663..5716f8a2f01f0d 100644 --- a/ports/flatbuffers/fix-uwp-build.patch +++ b/ports/flatbuffers/fix-uwp-build.patch @@ -2,11 +2,11 @@ diff --git a/src/util.cpp b/src/util.cpp index c1bb197..658e116 100644 --- a/src/util.cpp +++ b/src/util.cpp -@@ -239,9 +239,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) { - #ifdef _MSC_VER - __pragma(warning(disable : 4996)); // _CRT_SECURE_NO_WARNINGS - #endif -+#if _WIN32_WINNT < 0x0A00 +@@ -245,9 +245,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) { + #ifdef _MSC_VER + __pragma(warning(disable : 4996)); // _CRT_SECURE_NO_WARNINGS + #endif ++#if _WIN32_WINNT < 0x0A00 auto env_str = std::getenv(var_name); if (!env_str) return false; if (_value) *_value = std::string(env_str); diff --git a/ports/flatbuffers/portfile.cmake b/ports/flatbuffers/portfile.cmake index c619ac9ee5c7ef..1c3cf665bcd1a9 100644 --- a/ports/flatbuffers/portfile.cmake +++ b/ports/flatbuffers/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/flatbuffers - REF v1.11.0 - SHA512 cbb2e1e6885255cc950e2fa8248b56a8bc2c6e52f6fc7ed9066e6ae5a1d53f1263594b83f4b944a672cf9d0e1e800e51ce7fa423eff45abf5056269879c286fe + REF v1.12.0 + SHA512 8a0b88d739fa4694a69d3630140fe89fdd70d50bba4dadd1758d9aa2920cda16700bcafb8d89fe2a09ac907d3f378240c3cb4abc7106318136799836aba4b063 HEAD_REF master PATCHES ignore_use_of_cmake_toolchain_file.patch @@ -15,7 +13,7 @@ vcpkg_from_github( ) set(OPTIONS) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_UWP) list(APPEND OPTIONS -DFLATBUFFERS_BUILD_FLATC=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF) endif() @@ -47,5 +45,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flatbuffers) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/flatbuffers/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/flatbuffers/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/fmt/CONTROL b/ports/fmt/CONTROL index 48f758b108d829..8a5c423eb729ad 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,4 +1,4 @@ Source: fmt -Version: 6.1.2 +Version: 7.0.3 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/fix-warning4189.patch b/ports/fmt/fix-warning4189.patch index 5c25379540989d..0efab0f1c98985 100644 --- a/ports/fmt/fix-warning4189.patch +++ b/ports/fmt/fix-warning4189.patch @@ -1,11 +1,11 @@ diff --git a/include/fmt/format.h b/include/fmt/format.h -index 01f41f5c..208a58d0 100644 +index 4e96539..0f1d179 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h -@@ -35,6 +35,7 @@ - - #include "core.h" - +@@ -33,6 +33,7 @@ + #ifndef FMT_FORMAT_H_ + #define FMT_FORMAT_H_ + +#pragma warning(disable:4189) #include #include diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index bc21d97a3bf5a9..f6126cd2634ce4 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 6.1.2 - SHA512 8770bf4bd2bb6d938e75e0cf1e665c41930dbd9d2a6825274a5a43cd1d85b9c9ca621bb040ed099429f0e16bddbc3399361c453eb1bf3fc01376e6ad9dd875b7 + REF cd4af11efc9c622896a3e4cb599fa28668ca3d05#version 7.0.3 + SHA512 24b42288be97849533dc82282fc08833d74642ad2afeb511e65c6389d88c709cf25345dec5b550c18af3705f4c0847fa0d4066308b51cd41ccfdda1a2c3babd0 HEAD_REF master PATCHES fix-warning4189.patch ) @@ -16,9 +16,9 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/fmt RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) + if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -33,25 +33,28 @@ 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) vcpkg_fixup_cmake_targets() +vcpkg_fixup_pkgconfig() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) +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-debug.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 b4c11a45bc6fff..c0714c3fe93dd9 100644 --- a/ports/folly/CONTROL +++ b/ports/folly/CONTROL @@ -1,5 +1,6 @@ Source: folly -Version: 2019.10.21.00-1 +Version: 2019.10.21.00 +Port-Version: 3 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/fix-addbit.patch b/ports/folly/fix-addbit.patch new file mode 100644 index 00000000000000..6ac47aa06f6570 --- /dev/null +++ b/ports/folly/fix-addbit.patch @@ -0,0 +1,15 @@ +diff --git a/folly/lang/Bits.h b/folly/lang/Bits.h +index f0beb5b..f86a1a3 100644 +--- a/folly/lang/Bits.h ++++ b/folly/lang/Bits.h +@@ -64,6 +64,10 @@ + #include + #include + ++#if __has_include() ++#include ++#endif ++ + namespace folly { + + #if __cpp_lib_bit_cast diff --git a/ports/folly/folly_c3861.patch b/ports/folly/folly_c3861.patch new file mode 100644 index 00000000000000..52aefcb8e272c5 --- /dev/null +++ b/ports/folly/folly_c3861.patch @@ -0,0 +1,50 @@ +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 971cb88..7894333 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -41,7 +41,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -93,7 +93,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -119,15 +119,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + #endif + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #if !defined(_MSC_VER) || (_MSC_VER < 1923) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -138,7 +138,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) ++// #endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake index 52645357a4a224..b9a2c05f2f3e58 100644 --- a/ports/folly/portfile.cmake +++ b/ports/folly/portfile.cmake @@ -20,6 +20,8 @@ vcpkg_from_github( reorder-glog-gflags.patch disable-non-underscore-posix-names.patch boost-1.70.patch + fix-addbit.patch + folly_c3861.patch ) file(COPY diff --git a/ports/font-chef/CONTROL b/ports/font-chef/CONTROL new file mode 100644 index 00000000000000..4b097acb90b563 --- /dev/null +++ b/ports/font-chef/CONTROL @@ -0,0 +1,4 @@ +Source: font-chef +Version: 1.0.1 +Description: A font cooking library +Homepage: https://github.com/mobius3/font-chef diff --git a/ports/font-chef/portfile.cmake b/ports/font-chef/portfile.cmake new file mode 100644 index 00000000000000..2ae280bdcf67f1 --- /dev/null +++ b/ports/font-chef/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mobius3/font-chef + REF v1.0.1 + SHA512 0d73d095a2f6346cde5fc58a07be7cbe2c180ab5c83a4af21f765a6be1e9dcc5a403fa1d4c64f71dad5609eb72c8b05df8606b4035fceadca74fe6a87bb8efef + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${PORT}") + +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") +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/fontconfig/CMakeLists.txt b/ports/fontconfig/CMakeLists.txt index 1692e7856a724f..a556e705932c7b 100644 --- a/ports/fontconfig/CMakeLists.txt +++ b/ports/fontconfig/CMakeLists.txt @@ -74,8 +74,8 @@ if(NOT FC_SKIP_TOOLS) set(FC_CACHEDIR WINDOWSTEMPDIR_FONTCONFIG_CACHE) set(CONFIGDIR ./fonts/conf.d) configure_file(fonts.conf.in ${CMAKE_SOURCE_DIR}/fonts.conf @ONLY) - install(FILES fonts.conf DESTINATION tools/fontconfig/fonts) - install(DIRECTORY conf.d DESTINATION tools/fontconfig/fonts FILES_MATCHING PATTERN "*.conf") + install(FILES fonts.conf DESTINATION tools/fontconfig) + install(DIRECTORY conf.d DESTINATION tools/fontconfig FILES_MATCHING PATTERN "*.conf") endif() install( diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index d350c7fc4a25b2..e1deedec930b18 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -1,5 +1,6 @@ Source: fontconfig -Version: 2.12.4-10 +Version: 2.12.4 +Port-Version: 11 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. Build-Depends: freetype, expat, libiconv, dirent diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index db7692779ab379..360c449a600640 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -1,6 +1,3 @@ - -include(vcpkg_common_functions) - set(FONTCONFIG_VERSION 2.12.4) vcpkg_download_distfile(ARCHIVE URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" @@ -45,7 +42,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endforeach() endif() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig) +#vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig) diff --git a/ports/freeglut/CONTROL b/ports/freeglut/CONTROL index 05cd80860a78f8..452615768f0887 100644 --- a/ports/freeglut/CONTROL +++ b/ports/freeglut/CONTROL @@ -1,4 +1,4 @@ Source: freeglut -Version: 3.0.0-9 +Version: 3.2.1-4 Homepage: https://sourceforge.net/projects/freeglut/ Description: Open source implementation of GLUT with source and binary backwards compatibility. diff --git a/ports/freeglut/fix-debug-macro.patch b/ports/freeglut/fix-debug-macro.patch new file mode 100644 index 00000000000000..69f9e82bcea802 --- /dev/null +++ b/ports/freeglut/fix-debug-macro.patch @@ -0,0 +1,35 @@ +diff --git a/include/GL/freeglut_std.h b/include/GL/freeglut_std.h +index a658c7c..a5efb3b 100644 +--- a/include/GL/freeglut_std.h ++++ b/include/GL/freeglut_std.h +@@ -70,7 +70,7 @@ + + /* Link with Win32 static freeglut lib */ + # if FREEGLUT_LIB_PRAGMAS +-# ifdef NDEBUG ++# if defined(NDEBUG) || !defined(_DEBUG) + # pragma comment (lib, "freeglut_static.lib") + # else + # pragma comment (lib, "freeglut_staticd.lib") +@@ -88,7 +88,7 @@ + + /* Link with Win32 shared freeglut lib */ + # if FREEGLUT_LIB_PRAGMAS +-# ifdef NDEBUG ++# if defined(NDEBUG) || !defined(_DEBUG) + # pragma comment (lib, "freeglut.lib") + # else + # pragma comment (lib, "freeglutd.lib") +diff --git a/src/blackberry/fg_main_blackberry.c b/src/blackberry/fg_main_blackberry.c +index a1b9cbb..a20c53d 100644 +--- a/src/blackberry/fg_main_blackberry.c ++++ b/src/blackberry/fg_main_blackberry.c +@@ -31,7 +31,7 @@ + #include "fg_internal.h" + #include "egl/fg_window_egl.h" + +-#ifdef NDEBUG ++#if defined(NDEBUG) || !defined(_DEBUG) + #define LOGI(...) + #endif + diff --git a/ports/freeglut/gcc10.patch b/ports/freeglut/gcc10.patch new file mode 100644 index 00000000000000..dc5193b6ac090f --- /dev/null +++ b/ports/freeglut/gcc10.patch @@ -0,0 +1,31 @@ +diff --git a/src/fg_gl2.h b/src/fg_gl2.h +index ab8ba5c..a1a52da 100644 +--- a/src/fg_gl2.h ++++ b/src/fg_gl2.h +@@ -67,13 +67,19 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); + typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); + typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +-FGH_PFNGLGENBUFFERSPROC fghGenBuffers; +-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; +-FGH_PFNGLBINDBUFFERPROC fghBindBuffer; +-FGH_PFNGLBUFFERDATAPROC fghBufferData; +-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; +-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; +-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; ++#if __GNUC__ > 9 ++#define FG_ATTRIBUTE_COMMON __attribute__((__common__)) ++#else ++#define FG_ATTRIBUTE_COMMON ++#endif ++ ++FGH_PFNGLGENBUFFERSPROC FG_ATTRIBUTE_COMMON fghGenBuffers; ++FGH_PFNGLDELETEBUFFERSPROC FG_ATTRIBUTE_COMMON fghDeleteBuffers; ++FGH_PFNGLBINDBUFFERPROC FG_ATTRIBUTE_COMMON fghBindBuffer; ++FGH_PFNGLBUFFERDATAPROC FG_ATTRIBUTE_COMMON fghBufferData; ++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC FG_ATTRIBUTE_COMMON fghEnableVertexAttribArray; ++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC FG_ATTRIBUTE_COMMON fghDisableVertexAttribArray; ++FGH_PFNGLVERTEXATTRIBPOINTERPROC FG_ATTRIBUTE_COMMON fghVertexAttribPointer; + + # endif + diff --git a/ports/freeglut/macOS_Xquartz.patch b/ports/freeglut/macOS_Xquartz.patch index 423b3b90180719..c154dceb554bab 100644 --- a/ports/freeglut/macOS_Xquartz.patch +++ b/ports/freeglut/macOS_Xquartz.patch @@ -1,11 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f68b27f..4339858 100644 +index 6f403af..ce6f9f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -220,6 +220,16 @@ ENDIF() +@@ -258,6 +258,16 @@ ENDIF() IF(FREEGLUT_GLES) - ADD_DEFINITIONS(-DFREEGLUT_GLES) - LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) + LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) +ELSEIF(APPLE) + # on OSX FindOpenGL uses framework version of OpenGL, but we need X11 version + FIND_PATH(GLX_INCLUDE_DIR GL/glx.h diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index eec5b309640d5a..4ec2382ae87a97 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -1,20 +1,17 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz" - FILENAME "freeglut-3.0.0.tar.gz" - SHA512 9c45d5b203b26a7ff92331b3e080a48e806c92fbbe7c65d9262dd18c39cd6efdad8a795a80f499a2d23df84b4909dbd7c1bab20d7dd3555d3d88782ce9dd15b0 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - use_targets_to_export_x11_dependency.patch - macOS_Xquartz.patch +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO freeglut/freeglut + REF 3.2.1 + FILENAME "freeglut-3.2.1.tar.gz" + SHA512 aced4bbcd36269ce6f4ee1982e0f9e3fffbf18c94f785d3215ac9f4809b992e166c7ada496ed6174e13d77c0f7ef3ca4c57d8a282e96cbbe6ff086339ade3b08 + PATCHES + use_targets_to_export_x11_dependency.patch + macOS_Xquartz.patch + gcc10.patch + fix-debug-macro.patch ) -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(NOT VCPKG_TARGET_IS_WINDOWS) message("Freeglut currently requires the following libraries from the system package manager:\n opengl\n glu\n libx11\n xrandr\n xi\n xxf86vm\n\nThese can be installed on Ubuntu systems via apt-get install libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev\nOn macOS Xquartz is required.") endif() @@ -45,6 +42,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/FreeGLUT) # Rename static lib (otherwise it's incompatible with FindGLUT.cmake) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -68,8 +66,7 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeglut) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeglut/COPYING ${CURRENT_PACKAGES_DIR}/share/freeglut/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/freeglut/use_targets_to_export_x11_dependency.patch b/ports/freeglut/use_targets_to_export_x11_dependency.patch index 9933efd44e4305..2f9e6b1bf29f52 100644 --- a/ports/freeglut/use_targets_to_export_x11_dependency.patch +++ b/ports/freeglut/use_targets_to_export_x11_dependency.patch @@ -1,29 +1,23 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0d3260b..edf034a 100644 +index 6f403af..4ced28a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -257,8 +257,6 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) +@@ -72,7 +72,7 @@ SET(FREEGLUT_HEADERS + include/GL/freeglut_ext.h + include/GL/freeglut_std.h + ) +-IF(FREEGLUT_REPLACE_GLUT) ++IF(TRUE) + LIST(APPEND FREEGLUT_HEADERS + include/GL/glut.h + ) +@@ -312,8 +312,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) INCLUDE(CheckIncludeFiles) - IF(UNIX AND NOT(ANDROID OR BLACKBERRY)) + IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND)) FIND_PACKAGE(X11 REQUIRED) -- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) -- LIST(APPEND LIBS ${X11_LIBRARIES}) +- INCLUDE_DIRECTORIES(${X11_X11_INCLUDE_PATH}) +- LIST(APPEND LIBS ${X11_X11_LIB}) ++ LIST(APPEND LIBS X11::X11) IF(X11_Xrandr_FOUND) SET(HAVE_X11_EXTENSIONS_XRANDR_H TRUE) LIST(APPEND LIBS ${X11_Xrandr_LIB}) -@@ -339,9 +337,15 @@ ENDIF() - - IF(FREEGLUT_BUILD_SHARED_LIBS) - ADD_LIBRARY(freeglut SHARED ${FREEGLUT_SRCS}) -+ IF(UNIX AND NOT(ANDROID OR BLACKBERRY)) -+ TARGET_LINK_LIBRARIES(freeglut PRIVATE X11::X11) -+ ENDIF() - ENDIF() - IF(FREEGLUT_BUILD_STATIC_LIBS) - ADD_LIBRARY(freeglut_static STATIC ${FREEGLUT_SRCS}) -+ IF(UNIX AND NOT(ANDROID OR BLACKBERRY)) -+ TARGET_LINK_LIBRARIES(freeglut_static PRIVATE X11::X11) -+ ENDIF() - ENDIF() - - 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 438960011382e3..643c7b39877548 100644 --- a/ports/freeimage/CONTROL +++ b/ports/freeimage/CONTROL @@ -1,5 +1,6 @@ Source: freeimage -Version: 3.18.0-9 +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/freeimage/portfile.cmake b/ports/freeimage/portfile.cmake index 1fcbbb11091a1f..37552202d1dc8d 100644 --- a/ports/freeimage/portfile.cmake +++ b/ports/freeimage/portfile.cmake @@ -1,27 +1,22 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/freeimage/FreeImage3180.zip" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO freeimage/Source%20Distribution + REF 3.18.0 FILENAME "FreeImage3180.zip" SHA512 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - "${CMAKE_CURRENT_LIST_DIR}/disable-plugins-depending-on-internal-third-party-libraries.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-jpeg.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-jxrlib.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-libtiff.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-openjpeg.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-png-zlib.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-rawlib.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-external-openexr.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch" - "${CMAKE_CURRENT_LIST_DIR}/fix-function-overload.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-typedef-as-already-declared.patch" + PATCHES + disable-plugins-depending-on-internal-third-party-libraries.patch + use-external-jpeg.patch + use-external-jxrlib.patch + use-external-libtiff.patch + use-external-openjpeg.patch + use-external-png-zlib.patch + use-external-rawlib.patch + use-external-webp.patch + use-external-openexr.patch + use-freeimage-config-include.patch + fix-function-overload.patch + use-typedef-as-already-declared.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/freeopcua/CONTROL b/ports/freeopcua/CONTROL index 9ff43924137cc8..29a273f009d3a7 100644 --- a/ports/freeopcua/CONTROL +++ b/ports/freeopcua/CONTROL @@ -1,4 +1,4 @@ Source: freeopcua -Version: 20190125-2 +Version: 20190125-3 Description: OPC-UA server and client library written in C++ and with a lot of code auto-generated from xml specification using python. Build-Depends: boost-asio,boost-system,boost-program-options,boost-filesystem,boost-thread,boost-format,boost-foreach,boost-property-tree,boost-date-time diff --git a/ports/freeopcua/fix-std-headers.patch b/ports/freeopcua/fix-std-headers.patch new file mode 100644 index 00000000000000..d846a6176cdee0 --- /dev/null +++ b/ports/freeopcua/fix-std-headers.patch @@ -0,0 +1,24 @@ +diff --git a/include/opc/ua/protocol/utils.h b/include/opc/ua/protocol/utils.h +index e23bffe..5c8c2ad 100644 +--- a/include/opc/ua/protocol/utils.h ++++ b/include/opc/ua/protocol/utils.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + namespace OpcUa + { +diff --git a/src/core/model_impl.h b/src/core/model_impl.h +index 0f548c5..c29626b 100644 +--- a/src/core/model_impl.h ++++ b/src/core/model_impl.h +@@ -20,6 +20,7 @@ + #pragma once + + #include ++#include + + namespace OpcUa + { diff --git a/ports/freeopcua/portfile.cmake b/ports/freeopcua/portfile.cmake index 57ca771ce282f6..76e9508370b729 100644 --- a/ports/freeopcua/portfile.cmake +++ b/ports/freeopcua/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO FreeOpcUa/freeopcua @@ -14,6 +12,7 @@ vcpkg_from_github( serverObj.patch include_asio_first.patch boost-1.70.patch + fix-std-headers.patch ) vcpkg_configure_cmake( diff --git a/ports/freerdp/CONTROL b/ports/freerdp/CONTROL index 86dd627a0273b9..3eb885b9115dac 100644 --- a/ports/freerdp/CONTROL +++ b/ports/freerdp/CONTROL @@ -1,5 +1,10 @@ Source: freerdp -Version: 2.0.0-rc4-7 +Version: 2.1.1-1 Homepage: https://github.com/FreeRDP/FreeRDP Description: A free implementation of the Remote Desktop Protocol (RDP) Build-Depends: openssl, glib (!windows) +Supports: !(arm|uwp) + +Feature: urbdrc +Description: USB redirection channel support +Build-Depends: libusb diff --git a/ports/freerdp/fix-libusb.patch b/ports/freerdp/fix-libusb.patch new file mode 100644 index 00000000000000..98debdd214a3fd --- /dev/null +++ b/ports/freerdp/fix-libusb.patch @@ -0,0 +1,44 @@ +diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c +index 94117bc..218a56f 100644 +--- a/channels/urbdrc/client/libusb/libusb_udevice.c ++++ b/channels/urbdrc/client/libusb/libusb_udevice.c +@@ -168,7 +168,7 @@ static void async_transfer_user_data_free(ASYNC_TRANSFER_USER_DATA* user_data) + } + } + +-static void func_iso_callback(struct libusb_transfer* transfer) ++static void LIBUSB_CALL func_iso_callback(struct libusb_transfer* transfer) + { + ASYNC_TRANSFER_USER_DATA* user_data = (ASYNC_TRANSFER_USER_DATA*)transfer->user_data; + #if defined(HAVE_STREAM_ID_API) +@@ -269,7 +269,7 @@ static const LIBUSB_ENDPOINT_DESCEIPTOR* func_get_ep_desc(LIBUSB_CONFIG_DESCRIPT + return NULL; + } + +-static void func_bulk_transfer_cb(struct libusb_transfer* transfer) ++static void LIBUSB_CALL func_bulk_transfer_cb(struct libusb_transfer* transfer) + { + ASYNC_TRANSFER_USER_DATA* user_data; + uint32_t streamID; +diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c +index 973d9c1..1d1548b 100644 +--- a/channels/urbdrc/client/libusb/libusb_udevman.c ++++ b/channels/urbdrc/client/libusb/libusb_udevman.c +@@ -550,7 +550,7 @@ static BOOL device_is_filtered(struct libusb_device* dev, + return filtered; + } + +-static int hotplug_callback(struct libusb_context* ctx, struct libusb_device* dev, ++static int LIBUSB_CALL hotplug_callback(struct libusb_context* ctx, struct libusb_device* dev, + libusb_hotplug_event event, void* user_data) + { + VID_PID_PAIR pair; +@@ -828,7 +828,7 @@ static BOOL poll_libusb_events(UDEVMAN* udevman) + return rc > 0; + } + +-static DWORD poll_thread(LPVOID lpThreadParameter) ++static DWORD __stdcall poll_thread(LPVOID lpThreadParameter) + { + libusb_hotplug_callback_handle handle; + UDEVMAN* udevman = (UDEVMAN*)lpThreadParameter; diff --git a/ports/freerdp/openssl_threads.patch b/ports/freerdp/openssl_threads.patch index a506b580bf3e45..43ebe03e7f54b4 100644 --- a/ports/freerdp/openssl_threads.patch +++ b/ports/freerdp/openssl_threads.patch @@ -1,12 +1,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 019926901..9db9ed29b 100644 +index fc068fc84..1bc0f342c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -945,6 +945,7 @@ endif() - if(OPENSSL_FOUND) +@@ -930,6 +930,7 @@ if(OPENSSL_FOUND) add_definitions("-DWITH_OPENSSL") message(STATUS "Using OpenSSL Version: ${OPENSSL_VERSION}") -+ list(APPEND OPENSSL_LIBRARIES Threads::Threads) + include_directories(${OPENSSL_INCLUDE_DIR}) ++ list(APPEND OPENSSL_LIBRARIES Threads::Threads) endif() if(MBEDTLS_FOUND) diff --git a/ports/freerdp/portfile.cmake b/ports/freerdp/portfile.cmake index 0d15187c957c7f..0510f5961f3951 100644 --- a/ports/freerdp/portfile.cmake +++ b/ports/freerdp/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO FreeRDP/FreeRDP - REF 2.0.0-rc4 - SHA512 b4a4d4a58d09010bc45fb90cca148dc4421a4cf0cd5caf288aa702212ef081f14fc418b91f1b79ec8631f582c9ebcdd3031d3333b6a892adb29c402492abb649 + REF 1923e63516c1182bd5e917aeac563431e8c5381a #2.1.1 + SHA512 9745959e0960cd02ef4c890139eb5b69932bca19eab8311f21ba1eae6d5f2e1d6d05a36275053e5111805bd4206ab93ad4e0b8f1fb10e74360297c51cfefbc96 HEAD_REF master PATCHES DontInstallSystemRuntimeLibs.patch @@ -10,11 +10,15 @@ vcpkg_from_github( openssl_threads.patch fix-include-install-path.patch fix-include-path.patch + fix-libusb.patch ) if (NOT VCPKG_TARGET_IS_WINDOWS) message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n libxfixes-dev\n") endif() +if (VCPKG_TARGET_IS_OSX) + set(FREERDP_WITH_CLIENT -DWITH_CLIENT=OFF) +endif() if(VCPKG_CRT_LINKAGE STREQUAL "static") set(FREERDP_CRT_LINKAGE -DMSVC_RUNTIME=static) @@ -25,11 +29,17 @@ file(WRITE "${SOURCE_PATH}/.source_version" "${SOURCE_VERSION}-vcpkg") file(REMOVE ${SOURCE_PATH}/cmake/FindOpenSSL.cmake) # Remove outdated Module +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + urbdrc CHANNEL_URBDRC +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FREERDP_CRT_LINKAGE} + ${FREERDP_WITH_CLIENT} + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -52,13 +62,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(COPY ${FREERDP_DLL} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE ${FREERDP_DLL}) endforeach() - + file(GLOB_RECURSE FREERDP_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") foreach(FREERDP_DLL ${FREERDP_DLLS}) file(COPY ${FREERDP_DLL} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${FREERDP_DLL}) endforeach() -else() +else() file(GLOB_RECURSE FREERDP_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") foreach(FREERDP_TOOL ${FREERDP_TOOLS}) file(COPY ${FREERDP_TOOL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -111,9 +121,16 @@ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/FreeRDP-Client/FreeRDP-Client "bin/freerdp-client2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" ) +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(GLOB OBJS ${CURRENT_PACKAGES_DIR}/debug/*.lib) + file(REMOVE ${OBJS}) + file(GLOB OBJS ${CURRENT_PACKAGES_DIR}/*.lib) + file(REMOVE ${OBJS}) +endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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 65f9631ca10c66..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 a418c44..db48e9f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -156,6 +156,8 @@ option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF) - option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) - option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType 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}") -@@ -488,7 +490,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/0005-Fix-DLL-EXPORTS.patch b/ports/freetype/0005-Fix-DLL-EXPORTS.patch deleted file mode 100644 index 7ea02bbedc7d3f..00000000000000 --- a/ports/freetype/0005-Fix-DLL-EXPORTS.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ede5daf..46c1e55 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -151,6 +151,9 @@ set(LIBRARY_SOVERSION "6") - # optionally found anyway. Use `-DCMAKE_DISABLE_FIND_PACKAGE_x=TRUE` to disable - # searching for a packge entirely (x is the CMake package name, so "BZip2" - # instead of "BZIP2"). -+if (ENABLE_DLL_EXPORT) -+ ADD_DEFINITIONS(-DDLL_EXPORT) -+endif() - option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF) - option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF) - option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 01c32bbbeb6fcd..dcec495d7b07c6 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,6 +1,7 @@ Source: freetype -Version: 2.10.1-5 -Build-Depends: zlib +Version: 2.10.2 +Port-Version: 2 +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..0e15648920ab7f --- /dev/null +++ b/ports/freetype/brotli-static.patch @@ -0,0 +1,21 @@ +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,14 @@ 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}) + + + 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 ad06263f99084d..f62f34728ffc9a 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,8 +1,8 @@ -set(FT_VERSION 2.10.1) +set(FT_VERSION 2.10.2) vcpkg_download_distfile(ARCHIVE URLS "https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FT_VERSION}.tar.xz" "https://downloads.sourceforge.net/project/freetype/freetype2/${FT_VERSION}/freetype-${FT_VERSION}.tar.xz" FILENAME "freetype-${FT_VERSION}.tar.xz" - SHA512 c7a565b0ab3dce81927008a6965d5c7540f0dc973fcefdc1677c2e65add8668b4701c2958d25593cb41f706f4488765365d40b93da71dbfa72907394f28b2650 + SHA512 cf45089bd8893d7de2cdcb59d91bbb300e13dd0f0a9ef80ed697464ba7aeaf46a5a81b82b59638e6b21691754d8f300f23e1f0d11683604541d77f0f581affaa ) vcpkg_extract_source_archive_ex( @@ -11,9 +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 - 0005-Fix-DLL-EXPORTS.patch + pkgconfig.patch + brotli-static.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -25,57 +25,50 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS png CMAKE_DISABLE_FIND_PACKAGE_PNG ) -if(NOT ${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic") - set(ENABLE_DLL_EXPORT OFF) -else() - set(ENABLE_DLL_EXPORT ON) -endif() - -set(OPTIONS) -if (NOT VCPKG_TARGET_IS_WINDOWS) - list(APPEND OPTIONS -DFT_DISABLE_FIND_PACKAGE_Harfbuzz=TRUE) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCONFIG_INSTALL_PATH=share/freetype -DFT_WITH_ZLIB=ON # Force system zlib. + -DFT_WITH_BROTLI=ON + -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON ${FEATURE_OPTIONS} - -DENABLE_DLL_EXPORT=${ENABLE_DLL_EXPORT} - ${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/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() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY 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 23f6b346813ba0..68d0d291fc6b88 100644 --- a/ports/freexl/CONTROL +++ b/ports/freexl/CONTROL @@ -1,5 +1,5 @@ Source: freexl -Version: 1.0.4-8 +Version: 1.0.4-9 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 8253788371e95e..3c4629dce5137f 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) set(FREEXL_VERSION_STR "1.0.4") vcpkg_download_distfile(ARCHIVE @@ -36,8 +35,7 @@ if (VCPKG_TARGET_IS_WINDOWS) INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" INST_DIR="${CURRENT_PACKAGES_DIR}" "LINK_FLAGS=" - "LIBS_ALL=${LIBS_ALL_REL}" - + "LIBS_ALL=${LIBS_ALL_REL}" ) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright) @@ -64,7 +62,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX ARCHIVE ${ARCHIVE} OUT_SOURCE_PATH SOURCE_PATH ) - + file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} OPTIONS_DEBUG @@ -80,6 +78,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX ) vcpkg_install_make() + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright) diff --git a/ports/fribidi/CONTROL b/ports/fribidi/CONTROL index 6db23d6f996668..edfb9c77707406 100644 --- a/ports/fribidi/CONTROL +++ b/ports/fribidi/CONTROL @@ -1,4 +1,4 @@ -Source: fribidi -Version: 2019-02-04-3 -Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) -Build-Depends: tool-meson +Source: fribidi +Version: 1.0.9-1 +Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) +Build-Depends: tool-meson diff --git a/ports/fribidi/portfile.cmake b/ports/fribidi/portfile.cmake index 79edb65c40f5a2..342b4d3c5786c6 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 58c6cb390a9a18c98b2cbaac555d8ea9352a9e4f - SHA512 1ec9c19faa87886786ce1589e2c66cab173b48e34d0e43487becc8606001f21f6ed17d0abd1c322fbbcaeb96a47ed882cad228be2e9beb019020ca2a475fc298 + REF abea9f626732a9b10499d76c1cd69ce5457950cc # v1.0.9 + SHA512 5cb28f9e35d0df205c9fb88a56776d371fdd8bca12c211cec282334cfbf12a05e3324cd14a3ae71bcc06e15ce07b06cbe97eaafe1c7368e517a4ce5a4c3a2bcc HEAD_REF master PATCHES fix-win-static-suffix.patch ) @@ -30,4 +30,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/frozen/CONTROL b/ports/frozen/CONTROL new file mode 100644 index 00000000000000..36b29085c98d3d --- /dev/null +++ b/ports/frozen/CONTROL @@ -0,0 +1,4 @@ +Source: frozen +Version: 1.0.0 +Description: Header-only library that provides 0 cost initialization for immutable containers and various algorithms. Frozen provides:immutable (a.k.a. frozen), constexpr-compatible versions of std::set, std::unordered_set, std::map and std::unordered_map and 0-cost initialization version of std::search for frozen needles using Boyer-Moore or Knuth-Morris-Pratt algorithms. +Homepage: https://github.com/serge-sans-paille/frozen diff --git a/ports/frozen/portfile.cmake b/ports/frozen/portfile.cmake new file mode 100644 index 00000000000000..7225ae8153090d --- /dev/null +++ b/ports/frozen/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO serge-sans-paille/frozen + REF b5735474fdaa28753c1dae515df5a4fdb45d94dd + SHA512 b175a03b4a0263937e176675558e2df0bd4174799e2c5d7138842235fa24be57bccd8b96fddb5791e055b9de44211063f195142de73acf9d4f52a9a37f7055cc + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + -Dfrozen.tests=OFF +) +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/frozen TARGET_PATH share/frozen) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/gainput/CONTROL b/ports/gainput/CONTROL index 834f5d6fcbef67..70ec0210f8f5e0 100644 --- a/ports/gainput/CONTROL +++ b/ports/gainput/CONTROL @@ -1,4 +1,4 @@ Source: gainput -Version: 1.0.0-2 +Version: 1.0.0-3 Homepage: https://github.com/jkuhlmann/gainput Description: Gainput is a multiplatform C++ input library, supporting mouse, keyboard and controllers diff --git a/ports/gainput/install_as_cmake_package.patch b/ports/gainput/install_as_cmake_package.patch new file mode 100644 index 00000000000000..aaee43a2f9d9b7 --- /dev/null +++ b/ports/gainput/install_as_cmake_package.patch @@ -0,0 +1,69 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 14d5e85..cb7232f 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -30,19 +30,27 @@ if (GAINPUT_BUILD_SHARED) + endif (GAINPUT_BUILD_SHARED) + + if (GAINPUT_BUILD_STATIC) +- message(STATUS "..Building shared libraries (-DGAINPUT_BUILD_STATIC=OFF to disable)") ++ message(STATUS "..Building static libraries (-DGAINPUT_BUILD_STATIC=OFF to disable)") + add_library(gainputstatic STATIC ${sources} ${mmsources}) + set_target_properties(gainputstatic PROPERTIES DEBUG_POSTFIX -d FOLDER gainput) + set(install_libs ${install_libs} gainputstatic) + endif (GAINPUT_BUILD_STATIC) + + if(WIN32) +- target_link_libraries(gainput ${XINPUT} ws2_32) +- target_link_libraries(gainputstatic ${XINPUT} ws2_32) ++ if (GAINPUT_BUILD_SHARED) ++ target_link_libraries(gainput ${XINPUT} ws2_32) ++ endif(GAINPUT_BUILD_SHARED) ++ if(GAINPUT_BUILD_STATIC) ++ target_link_libraries(gainputstatic ${XINPUT} ws2_32) ++ endif(GAINPUT_BUILD_STATIC) + add_definitions(-DGAINPUT_LIB_DYNAMIC=1) + elseif(ANDROID) +- target_link_libraries(gainputstatic native_app_glue log android) +- target_link_libraries(gainput native_app_glue log android) ++ if (GAINPUT_BUILD_SHARED) ++ target_link_libraries(gainput native_app_glue log android) ++ endif(GAINPUT_BUILD_SHARED) ++ if(GAINPUT_BUILD_STATIC) ++ target_link_libraries(gainputstatic native_app_glue log android) ++ endif(GAINPUT_BUILD_STATIC) + elseif(APPLE) + find_library(FOUNDATION Foundation) + find_library(IOKIT IOKit) +@@ -65,6 +73,14 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + ++foreach(t ${install_libs}) ++ target_include_directories( ++ ${t} ++ INTERFACE $ ++ $ ++ ) ++endforeach() ++ + install( + DIRECTORY "include/gainput" + DESTINATION "include" +@@ -73,7 +89,15 @@ install( + + install( + TARGETS ${install_libs} ++ EXPORT unofficial-${PROJECT_NAME}-Targets + LIBRARY DESTINATION "${libdir}" + ARCHIVE DESTINATION "${libdir}" + RUNTIME DESTINATION "bin" + ) ++ ++install( ++ EXPORT unofficial-${PROJECT_NAME}-Targets ++ FILE unofficial-${PROJECT_NAME}Config.cmake ++ NAMESPACE unofficial::${PROJECT_NAME}:: ++ DESTINATION share/unofficial-${PROJECT_NAME} ++) +\ No newline at end of file diff --git a/ports/gainput/portfile.cmake b/ports/gainput/portfile.cmake index b84ed79dc71c32..4c568f171a0d8b 100644 --- a/ports/gainput/portfile.cmake +++ b/ports/gainput/portfile.cmake @@ -6,26 +6,34 @@ vcpkg_from_github( REF v1.0.0 SHA512 56fdc4c0613d7260861885b270ebe9e624e940175f41e3ac82516e2eb0d6d229e405fbcc2e54608e7d6751c1d8658b5b5e186153193badc6487274cb284a8cd6 HEAD_REF master + PATCHES + "install_as_cmake_package.patch" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(GAINPUT_BUILD_SHARED OFF) + set(GAINPUT_BUILD_STATIC ON) +else() + set(GAINPUT_BUILD_SHARED ON) + set(GAINPUT_BUILD_STATIC OFF) +endif() +if(APPLE) + set(GAINPUT_BUILD_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DGAINPUT_BUILD_SHARED=${GAINPUT_BUILD_SHARED} + -DGAINPUT_BUILD_STATIC=${GAINPUT_BUILD_STATIC} -DGAINPUT_TESTS=OFF -DGAINPUT_SAMPLES=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-gainput TARGET_PATH share/unofficial-gainput) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/gainputstatic.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gainputstatic.lib ${CURRENT_PACKAGES_DIR}/lib/gainput.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gainputstaticd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gainputd.lib) - endif() -endif() - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file 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/gasol/CONTROL b/ports/gasol/CONTROL new file mode 100644 index 00000000000000..2ae5ce2d3fba7b --- /dev/null +++ b/ports/gasol/CONTROL @@ -0,0 +1,4 @@ +Source: gasol +Version: 2018-01-04 +Homepage: https://github.com/PytLab/GASol +Description: A general Genetic Algorithm Solver in C++ diff --git a/ports/gasol/fix-install.patch b/ports/gasol/fix-install.patch new file mode 100644 index 00000000000000..5d2be99d7923df --- /dev/null +++ b/ports/gasol/fix-install.patch @@ -0,0 +1,19 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0cba691..51e47a3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,3 +1,13 @@ + file(GLOB GASol_SRC *.cpp) + add_library(GASol STATIC ${GASol_SRC}) + ++file(GLOB GASol_INCLUDES *.h) ++ ++install(FILES ${GASol_INCLUDES} DESTINATION include) ++ ++install( ++ TARGETS GASol ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) +\ No newline at end of file diff --git a/ports/gasol/gasol.patch b/ports/gasol/gasol.patch new file mode 100644 index 00000000000000..92d484e2a3f1e1 --- /dev/null +++ b/ports/gasol/gasol.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a21f65..a4cede0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,11 +15,15 @@ set(CMAKE_CXX_EXTENSIONS OFF) + # Find OpenMP. + find_package(OpenMP) + if (OPENMP_FOUND) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -fPIC -Wall -Wextra -Werror -pedantic") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -fPIC -pedantic") + else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wextra -Werror -pedantic") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pedantic") + endif() + ++if(CMAKE_COMPILER_IS_GNUCXX) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") ++endif(CMAKE_COMPILER_IS_GNUCXX) ++ + if (COV) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + endif() +@@ -39,7 +43,7 @@ endif() + add_subdirectory(src) + + # GASol test dir. +-add_subdirectory(unittest) ++# add_subdirectory(unittest) + + # GASol run dir. + add_subdirectory(example) diff --git a/ports/gasol/portfile.cmake b/ports/gasol/portfile.cmake new file mode 100644 index 00000000000000..5d3ed6b59665ec --- /dev/null +++ b/ports/gasol/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm" "arm64") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PytLab/GASol + REF 05af009bca2903c1cc491c9a6eed01bc3c936637 + SHA512 a8546bf565a389b919dd1dd5b88b4985c1803cbb09fab0715d1b0abfda92a6bf3adea7e4b3329ad82a6f6892f1747a73a632687fd79fb77c937e7ba07c62268a + HEAD_REF master + PATCHES + gasol.patch + fix-install.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +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/gdcm/CONTROL b/ports/gdcm/CONTROL index 56625fceb12e79..85f634cd680c13 100644 --- a/ports/gdcm/CONTROL +++ b/ports/gdcm/CONTROL @@ -1,4 +1,5 @@ Source: gdcm -Version: 3.0.4 +Version: 3.0.5 +Homepage: https://github.com/malaterre/GDCM Description: Grassroots DICOM library Build-Depends: zlib, expat, openjpeg diff --git a/ports/gdcm/portfile.cmake b/ports/gdcm/portfile.cmake index 83367ae222e271..5626e812b26a21 100644 --- a/ports/gdcm/portfile.cmake +++ b/ports/gdcm/portfile.cmake @@ -1,17 +1,15 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO malaterre/GDCM - REF 511c0ff28500ea0a0eda510dcd36a378ac4d8647 # v3.0.4 - SHA512 f9b1442bb0714a958ff477219cb8ad8e1686ffb4b92ad4e2a3b48d7d16e1d340d4d9b150e9fa5c6a55d98512698192d5e3e81b865c0acabb975fc4e5193c37c0 + REF f46fc26fa1c85e803f77496255a4de308828ac7f # v3.0.5 + SHA512 b5a85f4e752056cd40e06d557e17f8b56fc49c30ae8aaa3c7f483ae4851cb60c18edb227e8bf8ec8133de2a442a38f7a82dac99bce9d9afb74397778564bae4f HEAD_REF master PATCHES use-openjpeg-config.patch fix-share-path.patch - Fix-Cmake_DIR.patch + Fix-Cmake_DIR.patch ) file(REMOVE ${SOURCE_PATH}/CMake/FindOpenJPEG.cmake) @@ -54,4 +52,4 @@ 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/gdcm RENAME copyright) +file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/gdk-pixbuf/CMakeLists.txt b/ports/gdk-pixbuf/CMakeLists.txt index b370a191740bae..cdc5c3fb80b5e2 100644 --- a/ports/gdk-pixbuf/CMakeLists.txt +++ b/ports/gdk-pixbuf/CMakeLists.txt @@ -12,9 +12,10 @@ find_package(PNG REQUIRED) find_package(unofficial-glib CONFIG REQUIRED) find_path(GLIB_INCLUDE_DIR glib.h) +find_package(unofficial-gettext CONFIG REQUIRED) +find_path(LIBINTL_INCLUDE_DIR libintl.h) + if(WIN32) - find_package(unofficial-gettext CONFIG REQUIRED) - find_path(LIBINTL_INCLUDE_DIR libintl.h) configure_file(${CMAKE_SOURCE_DIR}/config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) else() configure_file(${CMAKE_SOURCE_DIR}/config.h.linux ${CMAKE_SOURCE_DIR}/config.h COPYONLY) @@ -68,12 +69,12 @@ target_include_directories(gdk-pixbuf PRIVATE ${LIBINTL_INCLUDE_DIR}) set(LIBS - unofficial::glib::gio unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject + unofficial::glib::gio unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject unofficial::gettext::libintl ${ZLIB_LIBRARIES} ${PNG_LIBRARIES} ) if(WIN32) - list(APPEND LIBS Gdiplus ole32 unofficial::gettext::libintl) + list(APPEND LIBS Gdiplus ole32) else() list(APPEND LIBS m) endif() diff --git a/ports/gdk-pixbuf/CONTROL b/ports/gdk-pixbuf/CONTROL index 369cd0d50d4b79..229973bc88a66d 100644 --- a/ports/gdk-pixbuf/CONTROL +++ b/ports/gdk-pixbuf/CONTROL @@ -1,5 +1,5 @@ Source: gdk-pixbuf -Version: 2.36.9-4 +Version: 2.36.9-5 Homepage: https://developer.gnome.org/gdk-pixbuf/ Description: Image loading library. Build-Depends: gettext, zlib, libpng, glib diff --git a/ports/geogram/CONTROL b/ports/geogram/CONTROL index 4eb40eee04619b..8125ce2805cef3 100644 --- a/ports/geogram/CONTROL +++ b/ports/geogram/CONTROL @@ -1,8 +1,9 @@ Source: geogram -Version: 1.6.9-7 +Version: 1.6.9 +Port-Version: 8 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 (!osx), lapack Feature: graphics Description: Build viewers and geogram_gfx library. diff --git a/ports/geographiclib/CONTROL b/ports/geographiclib/CONTROL deleted file mode 100644 index 2738c3d74258be..00000000000000 --- a/ports/geographiclib/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: geographiclib -Version: 1.47-patch1-10 -Homepage: https://sourceforge.net/projects/geographiclib/ -Description: a small set of C++ classes for performing conversions between geographic, UTM, UPS, MGRS, geocentric, and local cartesian coordinates, for gravity (e.g., EGM2008), geoid height, and geomagnetic field (e.g., WMM2010) calculations, and for solving geodesic problems. diff --git a/ports/geographiclib/cxx-library-only.patch b/ports/geographiclib/cxx-library-only.patch new file mode 100644 index 00000000000000..88ffc812527b38 --- /dev/null +++ b/ports/geographiclib/cxx-library-only.patch @@ -0,0 +1,130 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 30875ddb..34aa6515 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -464,12 +464,12 @@ endif () + # documentation files into the source tree. Skip Apple here because + # man/makeusage.sh uses "head --lines -4" to drop the last 4 lines of a + # file and there's no simple equivalent for MacOSX +-if (NOT WIN32 AND NOT APPLE) ++if (NOT WIN32 AND NOT APPLE AND FALSE) + find_program (HAVE_POD2MAN pod2man) + find_program (HAVE_POD2HTML pod2html) + find_program (HAVE_COL col) + endif () +-if (HAVE_POD2MAN AND HAVE_POD2HTML AND HAVE_COL) ++if (HAVE_POD2MAN AND HAVE_POD2HTML AND HAVE_COL AND FALSE) + set (MAINTAINER ON) + else () + set (MAINTAINER OFF) +@@ -496,25 +496,34 @@ if (WIN32) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + endif () + ++if (SKIP_TOOLS) ++ set (TOOLS) ++ set (SCRIPTS) ++else () + # The list of tools (to be installed into, e.g., /usr/local/bin) + set (TOOLS CartConvert ConicProj GeodesicProj GeoConvert GeodSolve + GeoidEval Gravity MagneticField Planimeter RhumbSolve TransverseMercatorProj) + # The list of scripts (to be installed into, e.g., /usr/local/sbin) + set (SCRIPTS geographiclib-get-geoids geographiclib-get-gravity + geographiclib-get-magnetic) ++endif () + + set_property (GLOBAL PROPERTY USE_FOLDERS ON) + + # The list of subdirectories to process + add_subdirectory (src) + add_subdirectory (include/GeographicLib) ++if (NOT SKIP_TOOLS) + add_subdirectory (tools) ++endif () ++if (FALSE) + add_subdirectory (man) + add_subdirectory (doc) + add_subdirectory (js) + add_subdirectory (matlab) + add_subdirectory (python/geographiclib) + add_subdirectory (examples) ++endif () + if (MSVC AND BUILD_NETGEOGRAPHICLIB) + if (GEOGRAPHICLIB_PRECISION EQUAL 2) + set (NETGEOGRAPHICLIB_LIBRARIES NETGeographicLib) +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 90e773ba..c9a303b0 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -33,10 +33,10 @@ configure_file (project-config.cmake.in + configure_file (project-config-version.cmake.in + "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY) + export (TARGETS +- ${PROJECT_ALL_LIBRARIES} ${TOOLS} ++ ${PROJECT_ALL_LIBRARIES} + FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-targets.cmake") + export (TARGETS +- ${PROJECT_ALL_LIBRARIES} ${TOOLS} ++ ${PROJECT_ALL_LIBRARIES} + NAMESPACE ${PROJECT_NAME}:: + FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-namespace-targets.cmake") + +@@ -44,15 +44,9 @@ export (TARGETS + # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative + # path to the root from there. (Note that the whole install tree can + # be relocated.) +-if (COMMON_INSTALL_PATH) +- # Install under lib${LIB_SUFFIX} so that 32-bit and 64-bit packages +- # can be installed on a single machine. +- set (INSTALL_CMAKE_DIR "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}") +- set (PROJECT_ROOT_DIR "../../..") +-else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") +-endif () ++ set (INSTALL_CMAKE_DIR "share/${PROJECT_NAME_LOWER}") ++ set (PROJECT_ROOT_DIR "../..") ++ + # @PROJECT_INCLUDE_DIRS@ is not used in the install tree; reset + # it to prevent the source and build paths appearing in the installed + # config files +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index b8c028c7..26e4ba14 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -1,7 +1,7 @@ + # Build the tools... + + # Where to find the *.usage files for the --help option. +-include_directories (${PROJECT_BINARY_DIR}/man) ++include_directories (${PROJECT_SOURCE_DIR}/man) + # Only needed if target_compile_definitions is not supported + add_definitions (${PROJECT_DEFINITIONS}) + +@@ -16,7 +16,7 @@ foreach (TOOL ${TOOLS}) + add_dependencies (tools ${TOOL}) + + set_source_files_properties (${TOOL}.cpp PROPERTIES +- OBJECT_DEPENDS ${PROJECT_BINARY_DIR}/man/${TOOL}.usage) ++ OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/man/${TOOL}.usage) + + target_link_libraries (${TOOL} ${PROJECT_LIBRARIES} ${HIGHPREC_LIBRARIES}) + +@@ -35,7 +35,7 @@ if (APPLE) + endif () + + # Specify where the tools are installed, adding them to the export targets +-install (TARGETS ${TOOLS} EXPORT targets DESTINATION bin) ++install (TARGETS ${TOOLS} DESTINATION tools) + + if (MSVC AND PACKAGE_DEBUG_LIBS) + # Possibly don't EXPORT the debug versions of the tools and then this +@@ -55,7 +55,7 @@ set_property (TARGET tools ${TOOLS} PROPERTY FOLDER tools) + # systems. This needs to substitute ${GEOGRAPHICLIB_DATA} as the + # default data directory. These are installed under sbin, because it is + # expected to be run with write access to /usr/local. +-if (NOT WIN32) ++if (NOT WIN32 AND FALSE) + foreach (SCRIPT ${SCRIPTS}) + configure_file (${SCRIPT}.sh scripts/${SCRIPT} @ONLY) + add_custom_command (OUTPUT ${SCRIPT} diff --git a/ports/geographiclib/fix-usage.patch b/ports/geographiclib/fix-usage.patch deleted file mode 100644 index 9b558edf03b640..00000000000000 --- a/ports/geographiclib/fix-usage.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/cmake/project-config-version.cmake.in b/cmake/project-config-version.cmake.in -index 1f207b8..d469658 100644 ---- a/cmake/project-config-version.cmake.in -+++ b/cmake/project-config-version.cmake.in -@@ -22,9 +22,9 @@ elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR - # Reject if there's a mismatch in MSVC compiler versions - # set (REASON "_MSC_VER = @MSVC_VERSION@") - # set (PACKAGE_VERSION_UNSUITABLE TRUE) --elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@") -+elseif (NOT CMAKE_CROSSCOMPILING STREQUAL FALSE) - # Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING} -- set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@") -+ set (REASON "cross-compiling = FALSE") - set (PACKAGE_VERSION_UNSUITABLE TRUE) - elseif (CMAKE_CROSSCOMPILING AND - NOT (CMAKE_SYSTEM_NAME STREQUAL "@CMAKE_SYSTEM_NAME@" AND diff --git a/ports/geographiclib/portfile.cmake b/ports/geographiclib/portfile.cmake index e4fe5ad7ae9f95..988aef10b58290 100644 --- a/ports/geographiclib/portfile.cmake +++ b/ports/geographiclib/portfile.cmake @@ -1,50 +1,59 @@ -include(vcpkg_common_functions) +vcpkg_from_sourceforge ( + OUT_SOURCE_PATH SOURCE_PATH + REPO geographiclib + REF distrib + FILENAME "GeographicLib-1.50.1.tar.gz" + SHA512 1db874f30957a0edb8a1df3eee6db73cc993629e3005fe912e317a4ba908e7d7580ce483bb0054c4b46370b8edaec989609fb7e4eb6ba00c80182db43db436f1 + PATCHES cxx-library-only.patch +) -vcpkg_download_distfile(ARCHIVE - URLS "https://jaist.dl.sourceforge.net/project/geographiclib/distrib/archive/GeographicLib-1.47-patch1.zip" - FILENAME "geographiclib-1.47-patch1.zip" - SHA512 d8fdfd7ae093057ec1a4ab922457fe71a3fb9975df5b673c276d62a0e9c4f212dc63652830b9d89e3890bc96aafd335992943cf6a1bce8260acf932d1eb7abfd +vcpkg_check_features ( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + "tools" SKIP_TOOLS ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - remove-tools-and-fix-version.patch - fix-usage.patch + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set (LIB_TYPE "SHARED") +else () + set (LIB_TYPE "STATIC") +endif () + +if (tools IN_LIST FEATURES) + vcpkg_fail_port_install ( + MESSAGE "Cannot build GeographicLib tools for UWP" + ON_TARGET uwp + ) +endif () + +vcpkg_configure_cmake ( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + "-DGEOGRAPHICLIB_LIB_TYPE=${LIB_TYPE}" + ${FEATURE_OPTIONS} + PREFER_NINJA # Disable this option if project cannot be built with Ninja ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DGEOGRAPHICLIB_LIB_TYPE=SHARED - PREFER_NINJA # Disable this option if project cannot be built with Ninja - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 - ) -else() - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DGEOGRAPHICLIB_LIB_TYPE=STATIC - PREFER_NINJA # Disable this option if project cannot be built with Ninja - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 - ) -endif() - -vcpkg_install_cmake() - -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GeographicLib) -endif() -vcpkg_copy_pdbs() - -file(COPY ${CURRENT_PACKAGES_DIR}/lib/pkgconfig DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_install_cmake () +vcpkg_fixup_cmake_targets (CONFIG_PATH share/geographiclib) +vcpkg_copy_pdbs () + +file (GLOB TOOL_LIST LIST_DIRECTORIES false + ${CURRENT_PACKAGES_DIR}/tools/*) +if (TOOL_LIST) + file (INSTALL ${TOOL_LIST} + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + vcpkg_copy_tool_dependencies (${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file (REMOVE ${TOOL_LIST}) +endif () + +file (REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file (REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file (REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) +file (INSTALL ${SOURCE_PATH}/LICENSE.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + +# Install usage +configure_file (${CMAKE_CURRENT_LIST_DIR}/usage + ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) diff --git a/ports/geographiclib/remove-tools-and-fix-version.patch b/ports/geographiclib/remove-tools-and-fix-version.patch deleted file mode 100644 index d4f94e02c000b9..00000000000000 --- a/ports/geographiclib/remove-tools-and-fix-version.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e79923b..3448362 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -437,13 +437,13 @@ set_property (GLOBAL PROPERTY USE_FOLDERS ON) - # The list of subdirectories to process - add_subdirectory (src) - add_subdirectory (include/GeographicLib) --add_subdirectory (tools) --add_subdirectory (man) --add_subdirectory (doc) --add_subdirectory (js) --add_subdirectory (matlab) --add_subdirectory (python/geographiclib) --add_subdirectory (examples) -+# add_subdirectory (tools) -+# add_subdirectory (man) -+# add_subdirectory (doc) -+# add_subdirectory (js) -+# add_subdirectory (matlab) -+# add_subdirectory (python/geographiclib) -+# add_subdirectory (examples) - if (MSVC AND BUILD_NETGEOGRAPHICLIB) - if (GEOGRAPHICLIB_PRECISION EQUAL 2) - set (NETGEOGRAPHICLIB_LIBRARIES NETGeographicLib) -diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 0c8ad64..7dc4096 100644 ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -14,10 +14,10 @@ configure_file (project-config.cmake.in - configure_file (project-config-version.cmake.in - "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY) - export (TARGETS -- ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} ${TOOLS} -+ ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} - FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-targets.cmake") - export (TARGETS -- ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} ${TOOLS} -+ ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} - NAMESPACE ${PROJECT_NAME}:: - FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-namespace-targets.cmake") - -diff --git a/cmake/project-config-version.cmake.in b/cmake/project-config-version.cmake.in -index 3b3b9e8..bc2ce19 100644 ---- a/cmake/project-config-version.cmake.in -+++ b/cmake/project-config-version.cmake.in -@@ -18,10 +18,10 @@ elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR - # since a multi-architecture library is built for that platform). - set (REASON "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@") - set (PACKAGE_VERSION_UNSUITABLE TRUE) --elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@") -+#elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@") - # Reject if there's a mismatch in MSVC compiler versions -- set (REASON "_MSC_VER = @MSVC_VERSION@") -- set (PACKAGE_VERSION_UNSUITABLE TRUE) -+# set (REASON "_MSC_VER = @MSVC_VERSION@") -+# set (PACKAGE_VERSION_UNSUITABLE TRUE) - elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@") - # Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING} - set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@") diff --git a/ports/geographiclib/usage b/ports/geographiclib/usage index 7ba01a433dd809..b4834435d5954b 100644 --- a/ports/geographiclib/usage +++ b/ports/geographiclib/usage @@ -1,8 +1,4 @@ -The package geographiclib:x64-linux provides CMake targets: - - find_package(GeographicLib CONFIG REQUIRED) - #dynamic - target_link_libraries(main PRIVATE GeographicLib GeographicLib::GeographicLib) - #static - target_link_libraries(main PRIVATE GeographicLib_STATIC GeographicLib::GeographicLib_STATIC) - \ No newline at end of file +The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: + + find_package (GeographicLib CONFIG REQUIRED) + target_link_libraries (main PRIVATE ${GeographicLib_LIBRARIES}) diff --git a/ports/geographiclib/vcpkg.json b/ports/geographiclib/vcpkg.json new file mode 100644 index 00000000000000..8ec469c9025971 --- /dev/null +++ b/ports/geographiclib/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "geographiclib", + "version-string": "1.50.1", + "description": "GeographicLib, a C++ library for performing geographic conversions", + "homepage": "https://geographiclib.sourceforge.io", + "features": [ + { + "name": "tools", + "description": "The GeographicLib tools" + } + ] +} diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL index 3366b6a5e6368d..356c93269d1d9b 100644 --- a/ports/geos/CONTROL +++ b/ports/geos/CONTROL @@ -1,4 +1,4 @@ Source: geos -Version: 3.6.3-3 +Version: 3.6.4 Homepage: https://www.osgeo.org/projects/geos/ Description: Geometry Engine Open Source diff --git a/ports/geos/geos_c-static-support.patch b/ports/geos/geos_c-static-support.patch index 148e63057faa3f..8cc49520c4fcfd 100644 --- a/ports/geos/geos_c-static-support.patch +++ b/ports/geos/geos_c-static-support.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 927a0fe..8e6c3ea 100644 +index e7d2451..f8cc1ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,11 +66,7 @@ if(NOT MSVC) @@ -16,14 +16,17 @@ index 927a0fe..8e6c3ea 100644 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 859722b..b6e44b6 100644 +index 0607b16..877d611 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt -@@ -23,15 +23,23 @@ file(GLOB geos_capi_HEADERS ${CMAKE_BINARY_DIR}/capi/*.h) # fix source_group iss +@@ -21,17 +21,25 @@ set(geos_c_SOURCES - if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK) - # if building OS X framework, CAPI built into C++ library -- add_library(geos_c SHARED ${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) @@ -49,19 +52,19 @@ index 859722b..b6e44b6 100644 set_target_properties(geos_c PROPERTIES diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4a1e688..a33b5f6 100644 +index 3894a56..f86d823 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -23,7 +23,7 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK) - ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_c.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_ts_c.cpp) +@@ -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 -@@ -61,37 +61,27 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK) + math(EXPR CVERSION "${VERSION_MAJOR} + 1") + # VERSION = current version, SOVERSION = compatibility version +@@ -62,38 +62,27 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK) else() @@ -83,7 +86,8 @@ index 4a1e688..a33b5f6 100644 - endif() - - if(GEOS_BUILD_STATIC) -- add_library(geos-static STATIC ${geos_SOURCES} ${geos_ALL_HEADERS}) +- 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() diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index 673b159f85572c..82a4e627624a53 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -1,11 +1,9 @@ -include(vcpkg_common_functions) - -set(GEOS_VERSION 3.6.3) +set(GEOS_VERSION 3.6.4) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2" FILENAME "geos-${GEOS_VERSION}.tar.bz2" - SHA512 f88adcf363433e247a51fb1a2c0b53f39b71aba8a6c01dd08aa416c2e980fe274a195e6edcb5bb5ff8ea81b889da14a1a8fb2849e04669aeba3b6d55754dc96a + SHA512 860513d86ee1294814ff3b3240373ee3a9ce88be9508b45f61ccc982bb698d0a1916e9458c37853ce8d69a977db6f12483745859f86617d704a688cfeb83b1e9 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH diff --git a/ports/getdns/CONTROL b/ports/getdns/CONTROL new file mode 100644 index 00000000000000..d7f45b30140907 --- /dev/null +++ b/ports/getdns/CONTROL @@ -0,0 +1,14 @@ +Source: getdns +Version: 1.6.0 +Build-Depends: libidn2, openssl +Description: GetDNS is a modern asynchronous DNS API +Homepage: https://getdnsapi.net/ +Supports: !uwp + +Feature: libevent +Description: libevent event loop integration +Build-Depends: libevent + +Feature: libuv +Description: libuv event loop integration +Build-Depends: libuv diff --git a/ports/getdns/ignore_copying.patch b/ports/getdns/ignore_copying.patch new file mode 100644 index 00000000000000..87dc5c6d5047cc --- /dev/null +++ b/ports/getdns/ignore_copying.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 10d10b99..fda6fa3c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1087,6 +1087,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/getdns DESTINATION include) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3 DESTINATION share/man) + + set(docdir share/doc/getdns) +-install(FILES AUTHORS ChangeLog COPYING LICENSE NEWS README.md DESTINATION ${docdir}) ++install(FILES AUTHORS ChangeLog LICENSE NEWS README.md DESTINATION ${docdir}) + install(FILES spec/index.html DESTINATION ${docdir}/spec) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/getdns.pc DESTINATION lib/pkgconfig) diff --git a/ports/getdns/install_dlls.patch b/ports/getdns/install_dlls.patch new file mode 100644 index 00000000000000..8c3024b2516430 --- /dev/null +++ b/ports/getdns/install_dlls.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 10d10b99..35761647 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1065,15 +1065,15 @@ if (ENABLE_STATIC) + endif () + endif () + if (ENABLE_SHARED) +- install(TARGETS getdns_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + if (USE_LIBEV) +- install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + endif () + if (USE_LIBEVENT2) +- install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + endif () + if (USE_LIBUV) +- install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + endif () + endif () + if (BUILD_GETDNS_QUERY) diff --git a/ports/getdns/openssl_depend_libs.patch b/ports/getdns/openssl_depend_libs.patch new file mode 100644 index 00000000000000..6969b431966fca --- /dev/null +++ b/ports/getdns/openssl_depend_libs.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d22d3ca..7784ab58 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -335,7 +335,7 @@ check_include_file(openssl/rand.h HAVE_OPENSSL_RAND_H) + check_include_file(openssl/conf.h HAVE_OPENSSL_CONF_H) + check_include_file(openssl/engine.h HAVE_OPENSSL_ENGINE_H) + +-set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) ++set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} ${getdns_system_libs}) + check_function_exists(DSA_SIG_set0 HAVE_DSA_SIG_SET0) + check_function_exists(DSA_set0_pqg HAVE_DSA_SET0_PQG) + check_function_exists(DSA_set0_key HAVE_DSA_SET0_KEY) diff --git a/ports/getdns/portfile.cmake b/ports/getdns/portfile.cmake new file mode 100644 index 00000000000000..6c9a85e56e96ac --- /dev/null +++ b/ports/getdns/portfile.cmake @@ -0,0 +1,45 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + +set(GETDNS_VERSION 1.6.0) +set(GETDNS_HASH 4d3a67cd76e7ce53a31c9b92607d7768381a1f916e7950fe4e69368fa585d38dbfc04975630fbe8d8bd14f4bebf83a3516e063b5b54e0922548edc0952ee7b4e) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" GETDNS_ENABLE_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" GETDNS_ENABLE_SHARED) + +vcpkg_download_distfile(ARCHIVE + URLS "https://getdnsapi.net/dist/getdns-${GETDNS_VERSION}.tar.gz" + FILENAME "getdns-${GETDNS_VERSION}.tar.gz" + SHA512 ${GETDNS_HASH} +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${GETDNS_VERSION} + PATCHES + "openssl_depend_libs.patch" + "ignore_copying.patch" + "install_dlls.patch" +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + libevent BUILD_LIBEVENT2 + libuv BUILD_LIBUV +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_GETDNS_QUERY=OFF + -DBUILD_GETDNS_SERVER_MON=OFF + -DENABLE_STATIC=${GETDNS_ENABLE_STATIC} + -DENABLE_SHARED=${GETDNS_ENABLE_SHARED} + ${FEATURE_OPTIONS} +) +vcpkg_install_cmake() +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_copy_pdbs() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/giflib/CONTROL b/ports/giflib/CONTROL index 4de8f8e224a9d3..5361fc185a7be5 100644 --- a/ports/giflib/CONTROL +++ b/ports/giflib/CONTROL @@ -1,4 +1,4 @@ Source: giflib -Version: 5.1.4-3 +Version: 5.1.4-6 Homepage: https://sourceforge.net/projects/giflib/ Description: A library for reading and writing gif images. diff --git a/ports/giflib/portfile.cmake b/ports/giflib/portfile.cmake index 7ca1478f7f9207..dfca62d512733d 100644 --- a/ports/giflib/portfile.cmake +++ b/ports/giflib/portfile.cmake @@ -1,22 +1,16 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) set(GIFLIB_VERSION 5.1.4) -vcpkg_download_distfile(ARCHIVE - URLS "https://nchc.dl.sourceforge.net/project/giflib/giflib-${GIFLIB_VERSION}.tar.bz2" - FILENAME "giflib-${GIFLIB_VERSION}.tar.bz2" - SHA512 32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d -) -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) +if (VCPKG_TARGET_IS_WINDOWS) set(ADDITIONAL_PATCH "fix-compile-error.patch") endif() -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${GIFLIB_VERSION} + REPO "giflib" + FILENAME "giflib-${GIFLIB_VERSION}.tar.bz2" + SHA512 32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d PATCHES msvc-guard-unistd-h.patch ${ADDITIONAL_PATCH} diff --git a/ports/glad/portfile.cmake b/ports/glad/portfile.cmake index 1c14ca77fbfd0c..f94037d26d7bba 100644 --- a/ports/glad/portfile.cmake +++ b/ports/glad/portfile.cmake @@ -10,8 +10,6 @@ vcpkg_from_github( ) vcpkg_find_acquire_program(PYTHON3) -get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) -vcpkg_add_to_path("${PYTHON3_DIR}") file(COPY ${CURRENT_INSTALLED_DIR}/include/KHR/khrplatform.h @@ -32,6 +30,7 @@ vcpkg_configure_cmake( -DGLAD_REPRODUCIBLE=ON -DGLAD_SPEC="gl" # {gl,egl,glx,wgl} -DGLAD_PROFILE="compatibility" # {core,compatibility} + -DPYTHON_EXECUTABLE=${PYTHON3} OPTIONS_DEBUG -DGLAD_GENERATOR="c-debug" ) 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/gli/CONTROL b/ports/gli/CONTROL index 6ba55d18d8d464..ffd0ea80449d21 100644 --- a/ports/gli/CONTROL +++ b/ports/gli/CONTROL @@ -1,5 +1,5 @@ Source: gli -Version: dd17acf +Version: dd17acf-1 Build-Depends: glm Description: OpenGL Image (GLI) -Homepage: https://gli.g-truc.net +Homepage: https://gli.g-truc.net \ No newline at end of file diff --git a/ports/gli/disable-test.patch b/ports/gli/disable-test.patch new file mode 100644 index 00000000000000..d6bf0d7ce4a6e8 --- /dev/null +++ b/ports/gli/disable-test.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6eb1a68..610c0bc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -71,7 +71,7 @@ endmacro(addExternalPackageGTC) + # Add subdirectory + + add_subdirectory(gli) +-add_subdirectory(test) ++#add_subdirectory(test) + #add_subdirectory(doc) + + ################################ diff --git a/ports/gli/portfile.cmake b/ports/gli/portfile.cmake index beae5e530deb0c..c958eb95ba6dc9 100644 --- a/ports/gli/portfile.cmake +++ b/ports/gli/portfile.cmake @@ -1,5 +1,4 @@ #header-only library -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -7,13 +6,23 @@ vcpkg_from_github( REF dd17acf9cc7fc6e6abe9f9ec69949eeeee1ccd82 SHA512 9e3a4ab9ee73d5c271b8346cf81339cd3cd0c20d20991524b816313b6a99e8d3a01863316a38cf1a52ef9c5b31d689ecccf6248b12d1d270460c048bf904650b HEAD_REF master + PATCHES + disable-test.patch ) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/gli TARGET_PATH share/gli) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/include/gli/CMakeLists.txt) + # Put the license file where vcpkg expects it # manual.md contains the "licenses" section for the project -file(COPY ${SOURCE_PATH}/manual.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/gli/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/gli/manual.md ${CURRENT_PACKAGES_DIR}/share/gli/copyright) - -# Copy the glm header files -file(GLOB HEADER_FILES "${SOURCE_PATH}/gli/*.hpp" "${SOURCE_PATH}/gli/core") -file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/gli) +file(INSTALL ${SOURCE_PATH}/manual.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 4da1a80a134ad8..2315420738622c 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -73,7 +73,7 @@ else() set(ENV{PCRE_CFLAGS} "-I${PCRE_INCLUDE_DIR}") set(ENV{MSGFMT} "/bin/echo") set(ENV{GMSGFMT} "/bin/echo") - string(TOUPPER UPPER_CONFIG "${CMAKE_BUILD_TYPE}") + string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_CONFIG) set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}") set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}") if(BUILD_SHARED_LIBS) @@ -360,3 +360,35 @@ message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${CHARSET_LIBRARY}) message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY}) + +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${CMAKE_INSTALL_PREFIX}/lib) +set(includedir ${CMAKE_INSTALL_PREFIX}/include) + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/glib-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gobject-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gobject-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-export-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-export-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-no-export-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-no-export-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gthread-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gthread-2.0.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-2.0.pc" @ONLY) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gobject-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gmodule-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gmodule-export-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gmodule-no-export-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gthread-2.0.pc" + "${CMAKE_CURRENT_BINARY_DIR}/gio-2.0.pc" + DESTINATION lib/pkgconfig) + +if(WIN32) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-windows-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-windows-2.0.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-windows-2.0.pc" DESTINATION lib/pkgconfig) +endif() + +if(UNIX) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-unix-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-unix-2.0.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-unix-2.0.pc" DESTINATION lib/pkgconfig) +endif() diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 871f98d862b7a8..14c896e59454cf 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,5 +1,5 @@ Source: glib -Version: 2.52.3-14-5 +Version: 2.52.3-14-7 Homepage: https://developer.gnome.org/glib/ Description: Portable, general-purpose utility library. Build-Depends: zlib, pcre, libffi, gettext, libiconv diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index 7823debc9e15f3..dac83ab904c4f5 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -22,7 +22,7 @@ vcpkg_extract_source_archive_ex( fix-arm-builds.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) file(WRITE ${SOURCE_PATH}/glib/pcre/Makefile.in) @@ -50,9 +50,10 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-glib TARGET_PATH share/unofficial-glib) vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) +vcpkg_fixup_pkgconfig() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/glm/CONTROL b/ports/glm/CONTROL index f58bbb0d7a937d..3ba2f552d7b2dc 100644 --- a/ports/glm/CONTROL +++ b/ports/glm/CONTROL @@ -1,4 +1,4 @@ Source: glm -Version: 0.9.9.7 +Version: 0.9.9.8 Description: OpenGL Mathematics (GLM) Homepage: https://glm.g-truc.net diff --git a/ports/glm/portfile.cmake b/ports/glm/portfile.cmake index 4d20a0ed6bb91d..40d5115acece90 100644 --- a/ports/glm/portfile.cmake +++ b/ports/glm/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO g-truc/glm - REF 0.9.9.7 - SHA512 9c557788d6382777317c94f8b30bc3df7e533877705514fa5d384f97b076d6bc750e841acbecdec8113e21af07bd8850159f5f1e079aaa2cde25540b480f983b + REF bf71a834948186f4097caa076cd2663c69a10e1e #v0.9.9.8 + SHA512 226266c02af616a96fb19ee32cf3f98347daa43a4fde5d618d36b38709dce1280de126c542524d40725ecf70359edcc5b60660554c65ce246514501fb4c9c87c HEAD_REF master ) diff --git a/ports/glog/CONTROL b/ports/glog/CONTROL index ec6c47c84f1ee6..649381e3812c29 100644 --- a/ports/glog/CONTROL +++ b/ports/glog/CONTROL @@ -1,5 +1,5 @@ Source: glog -Version: 0.4.0-2 +Version: 0.4.0-3 Homepage: https://github.com/google/glog Description: C++ implementation of the Google logging module Build-Depends: gflags diff --git a/ports/glog/portfile.cmake b/ports/glog/portfile.cmake index 0417b8676fafe8..8487cc19219055 100644 --- a/ports/glog/portfile.cmake +++ b/ports/glog/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/glog @@ -13,6 +11,8 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake new file mode 100644 index 00000000000000..b8a289628dfc9f --- /dev/null +++ b/ports/gmp/portfile.cmake @@ -0,0 +1,110 @@ +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 + REPO ShiftMediaProject/gmp + REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 + SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 + HEAD_REF master + PATCHES + vs.build.patch + runtime.patch + prefix.patch + ) + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_DIR "${YASM}" DIRECTORY) + vcpkg_add_to_path("${YASM_DIR}") + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CONFIGURATION_RELEASE ReleaseDLL) + set(CONFIGURATION_DEBUG DebugDLL) + else() + set(CONFIGURATION_RELEASE Release) + set(CONFIGURATION_DEBUG Debug) + endif() + + if(VCPKG_TARGET_IS_UWP) + string(APPEND CONFIGURATION_RELEASE WinRT) + string(APPEND CONFIGURATION_DEBUG WinRT) + endif() + + #Setup YASM integration + set(_file "${SOURCE_PATH}/SMP/libgmp.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + + vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH SMP/libgmp.sln + PLATFORM ${TRIPLET_SYSTEM_ARCH} + LICENSE_SUBPATH COPYING.LESSERv3 + TARGET Rebuild + RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} + DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} + SKIP_CLEAN + OPTIONS /p:UseEnv=True + ) + get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME) + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include") + set(PACKAGE_VERSION 6.2.0) + set(PACKAGE_NAME gmp) + set(prefix "${CURRENT_INSTALLED_DIR}") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/include") + set(LIBS -lgmp) + configure_file("${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmp.pc" @ONLY) + configure_file("${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmpxx.pc" @ONLY) + set(prefix "${CURRENT_INSTALLED_DIR}/debug") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/../include") + set(LIBS -lgmpd) + configure_file("${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmp.pc" @ONLY) + configure_file("${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmpxx.pc" @ONLY) + vcpkg_fixup_pkgconfig() +else() + vcpkg_download_distfile( + ARCHIVE + URLS https://gmplib.org/download/gmp/gmp-6.2.0.tar.xz + FILENAME gmp-6.2.0.tar.xz + SHA512 a066f0456f0314a1359f553c49fc2587e484ff8ac390ff88537266a146ea373f97a1c0ba24608bf6756f4eab11c9056f103c8deb99e5b57741b4f7f0ec44b90c) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF gmp-6.2.0 + ) + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + OPTIONS ${OPTIONS} + ) + + vcpkg_install_make() + vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + + # # Handle copyright + file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +endif() \ No newline at end of file diff --git a/ports/gmp/prefix.patch b/ports/gmp/prefix.patch new file mode 100644 index 00000000000000..611c73763f4cb0 --- /dev/null +++ b/ports/gmp/prefix.patch @@ -0,0 +1,38 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index 2c5b8cdc6..157215394 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1574,14 +1574,14 @@ + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + $(ProjectDir)..\msvc\ + Clean + MSB8012 +@@ -1630,14 +1630,14 @@ + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + $(ProjectDir)..\msvc\ + Clean + MSB8012 diff --git a/ports/gmp/runtime.patch b/ports/gmp/runtime.patch new file mode 100644 index 00000000000000..b2f15d26052d3b --- /dev/null +++ b/ports/gmp/runtime.patch @@ -0,0 +1,68 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index 3c774be11..e8919240b 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1846,6 +1846,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1929,6 +1930,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2190,6 +2192,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2278,6 +2281,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2549,6 +2553,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2638,6 +2643,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2916,6 +2922,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3011,6 +3018,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDLL + + + true 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/gmp/vs.build.patch b/ports/gmp/vs.build.patch new file mode 100644 index 00000000000000..69aba99398f9d9 --- /dev/null +++ b/ports/gmp/vs.build.patch @@ -0,0 +1,165 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index b4e06ae42..442d82c51 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1559,114 +1559,114 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd_winrt ++ gmpd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + libgmpd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ libgmpd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmpd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmpd_winrt ++ gmpd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmpd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmpd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ gmpd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp_winrt ++ gmp + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + libgmp +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp_winrt +- $(ProjectDir)..\..\..\msvc\ ++ libgmp ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmp + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmp_winrt ++ gmp + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmp +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmp_winrt +- $(ProjectDir)..\..\..\msvc\ ++ gmp ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +diff --git a/gmp.pc.in b/gmp.pc.in +index bf1c799ad..d0c81be91 100644 +--- a/gmp.pc.in ++++ b/gmp.pc.in +@@ -8,4 +8,4 @@ Description: GNU Multiple Precision Arithmetic Library + URL: https://gmplib.org + Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} +-Libs: -L${libdir} -lgmp ++Libs: -L${libdir} @LIBS@ +diff --git a/gmpxx.pc.in b/gmpxx.pc.in +index 181cc70c6..2b697ceab 100644 +--- a/gmpxx.pc.in ++++ b/gmpxx.pc.in +@@ -9,4 +9,4 @@ URL: https://gmplib.org + Version: @PACKAGE_VERSION@ + Requires: gmp + Cflags: -I${includedir} +-Libs: -L${libdir} -lgmpxx ++Libs: -L${libdir} @LIBS@ diff --git a/ports/google-cloud-cpp-common/CONTROL b/ports/google-cloud-cpp-common/CONTROL index 6408941b2e43fe..481343c97e6509 100644 --- a/ports/google-cloud-cpp-common/CONTROL +++ b/ports/google-cloud-cpp-common/CONTROL @@ -1,9 +1,4 @@ Source: google-cloud-cpp-common -Version: 0.25.0 -Build-Depends: grpc, googleapis -Description: Base C++ Libraries for Google Cloud Platform APIs -Homepage: https://github.com/googleapis/google-cloud-cpp-common - -Feature: test -Description: Build test -Build-Depends: gtest +Version: alias +Build-Depends: google-cloud-cpp +Description: Deprecated, use google-cloud-cpp instead diff --git a/ports/google-cloud-cpp-common/portfile.cmake b/ports/google-cloud-cpp-common/portfile.cmake index e4ba4fa7261604..065116c276adcf 100644 --- a/ports/google-cloud-cpp-common/portfile.cmake +++ b/ports/google-cloud-cpp-common/portfile.cmake @@ -1,30 +1 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO googleapis/google-cloud-cpp-common - REF v0.25.0 - SHA512 074294e8b824d7f2b9d6d4051f4fbb28ca83166aad98ff000348abb238488b1c957726d901dae041bf50aa23ab368da5cf1d23ad42454f9ad07153976c0a29fe - HEAD_REF master) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - test BUILD_TESTING -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS - ${FEATURE_OPTIONS} - -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF) - -vcpkg_install_cmake(ADD_BIN_TO_PATH) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_copy_pdbs() +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/google-cloud-cpp-spanner/CONTROL b/ports/google-cloud-cpp-spanner/CONTROL index 82d7ea0a63858d..69cc736359ac2b 100644 --- a/ports/google-cloud-cpp-spanner/CONTROL +++ b/ports/google-cloud-cpp-spanner/CONTROL @@ -1,5 +1,4 @@ Source: google-cloud-cpp-spanner -Version: 1.1.0 -Build-Depends: grpc, googleapis, google-cloud-cpp-common -Description: C++ Client Library for Google Cloud Spanner. -Homepage: https://github.com/googleapis/google-cloud-cpp-spanner +Version: alias +Build-Depends: google-cloud-cpp +Description: Deprecated, use google-cloud-cpp instead diff --git a/ports/google-cloud-cpp-spanner/portfile.cmake b/ports/google-cloud-cpp-spanner/portfile.cmake index ffbae18dfc7490..065116c276adcf 100644 --- a/ports/google-cloud-cpp-spanner/portfile.cmake +++ b/ports/google-cloud-cpp-spanner/portfile.cmake @@ -1,29 +1 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO googleapis/google-cloud-cpp-spanner - REF v1.1.0 - SHA512 00141418a01ff55cf2228e3f59a49e49bc35e28da958a7817964976196bb6019e5f04e2d9ceacc758d649c8cc91d35df14aec23f9e8fa4044cfaa67115dc6e69 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS - -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake(ADD_BIN_TO_PATH) - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_copy_pdbs() +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/google-cloud-cpp/0001-fix-x86-build.patch b/ports/google-cloud-cpp/0001-fix-x86-build.patch deleted file mode 100644 index ec3674cb75178d..00000000000000 --- a/ports/google-cloud-cpp/0001-fix-x86-build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/google/cloud/storage/parallel_upload.h b/google/cloud/storage/parallel_upload.h -index 44f542d..4fd97bd 100644 ---- a/google/cloud/storage/parallel_upload.h -+++ b/google/cloud/storage/parallel_upload.h -@@ -515,7 +515,7 @@ StatusOr> CreateUploadShards( - - std::size_t const wanted_num_streams = - (std::max)(1, -- (std::min)(max_streams, -+ (std::min)(max_streams, - div_ceil(file_size, min_stream_size))); - - std::uintmax_t const stream_size = diff --git a/ports/google-cloud-cpp/CONTROL b/ports/google-cloud-cpp/CONTROL index ba320d8f2e6858..3591680d6a5d04 100644 --- a/ports/google-cloud-cpp/CONTROL +++ b/ports/google-cloud-cpp/CONTROL @@ -1,5 +1,6 @@ Source: google-cloud-cpp -Version: 0.21.0 -Build-Depends: grpc, curl[ssl], crc32c, googleapis, google-cloud-cpp-common +Version: 1.16.0 +Build-Depends: abseil, grpc, curl[ssl], crc32c 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 0bb7ef74237c34..065fe3706ad1ed 100644 --- a/ports/google-cloud-cpp/portfile.cmake +++ b/ports/google-cloud-cpp/portfile.cmake @@ -3,11 +3,9 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp - REF v0.21.0 - SHA512 744c7a14c31966df1f1383ad5804428807babf53079ed96514367f145eb38b4b90be3e0f9c6f16deb9269c754fd5a44e898e5afb77f6f749ba968605d79b8397 + REF v1.16.0 + SHA512 0e8b427d0131dfcb12d741ebd22e37e2a572ea10f3500d288c611f60f9ace8896ceb2a80213f741510d331c250bff59a38232bf967d3669c3310719ce6b0c05f HEAD_REF master - PATCHES - 0001-fix-x86-build.patch ) vcpkg_configure_cmake( @@ -15,8 +13,8 @@ vcpkg_configure_cmake( PREFER_NINJA DISABLE_PARALLEL_CONFIGURE OPTIONS - -DGOOGLE_CLOUD_CPP_DEPENDENCY_PROVIDER=package -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF + -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF -DBUILD_TESTING=OFF ) diff --git a/ports/googleapis/CONTROL b/ports/googleapis/CONTROL index 12617fc36d9a3f..08a9ee1130d99e 100644 --- a/ports/googleapis/CONTROL +++ b/ports/googleapis/CONTROL @@ -1,6 +1,4 @@ Source: googleapis -Version: 0.7.0 -Build-Depends: grpc, protobuf -Description: C++ Proto Libraries for Google APIs. -Homepage: https://github.com/googleapis/cpp-cmakefiles -Supports: !uwp +Version: alias +Build-Depends: google-cloud-cpp +Description: Deprecated, use google-cloud-cpp instead. diff --git a/ports/googleapis/portfile.cmake b/ports/googleapis/portfile.cmake index 55eab05b98cdde..065116c276adcf 100644 --- a/ports/googleapis/portfile.cmake +++ b/ports/googleapis/portfile.cmake @@ -1,28 +1 @@ -vcpkg_fail_port_install(ON_TARGET "uwp") - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO googleapis/cpp-cmakefiles - REF v0.7.0 - SHA512 45a9c8934c82a3e8c5c91e24c9879cbe9d928f5276b1e20d1fa51fde6a7e6711212ac7d298b4f07942e3538e2b99e8101906f509697c9aad26b8fba09c292a13 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake(ADD_BIN_TO_PATH) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_copy_pdbs() - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/gperftools/CMakeLists.txt b/ports/gperftools/CMakeLists.txt new file mode 100644 index 00000000000000..a4bf860af362df --- /dev/null +++ b/ports/gperftools/CMakeLists.txt @@ -0,0 +1,211 @@ +cmake_minimum_required(VERSION 3.5) + +project(gperftools LANGUAGES C CXX) + +include(GNUInstallDirs) + +option(GPERFTOOLS_BUILD_TOOLS "Build tools" ON) + +if(WIN32) # TODO: MINGW, MSYS + option(GPERFTOOLS_WIN32_OVERRIDE "Override allocators" OFF) +endif() + +set(deprecated_public_headers + src/google/heap-checker.h + src/google/heap-profiler.h + src/google/malloc_extension.h + src/google/malloc_extension_c.h + src/google/malloc_hook.h + src/google/malloc_hook_c.h + src/google/profiler.h + src/google/stacktrace.h +) + +set(gperftools_public_headers + src/gperftools/heap-checker.h + src/gperftools/heap-profiler.h + src/gperftools/malloc_extension.h + src/gperftools/malloc_extension_c.h + src/gperftools/malloc_hook.h + src/gperftools/malloc_hook_c.h + src/gperftools/nallocx.h + src/gperftools/profiler.h + src/gperftools/stacktrace.h +) + +if(WIN32) # TODO: MINGW, MSYS + list(APPEND deprecated_public_headers + src/windows/google/tcmalloc.h + ) + + list(APPEND gperftools_public_headers + src/windows/gperftools/tcmalloc.h + ) + + set(libtcmalloc_minimal_headers + src/addressmap-inl.h + src/base/arm_instruction_set_select.h + src/base/atomicops-internals-arm-generic.h + src/base/atomicops-internals-arm-v6plus.h + src/base/atomicops-internals-gcc.h + src/base/atomicops-internals-linuxppc.h + src/base/atomicops-internals-macosx.h + src/base/atomicops-internals-mips.h + src/base/atomicops-internals-windows.h + src/base/atomicops-internals-x86.h + src/base/atomicops.h + src/base/basictypes.h + src/base/commandlineflags.h + src/base/googleinit.h + src/base/logging.h + src/base/low_level_alloc.h + src/base/spinlock.h + src/base/spinlock_internal.h + src/base/spinlock_linux-inl.h + src/base/spinlock_posix-inl.h + src/base/spinlock_win32-inl.h + src/base/stl_allocator.h + src/base/sysinfo.h + src/base/thread_annotations.h + src/central_freelist.h + src/common.h + src/gperftools/heap-checker.h + src/gperftools/heap-profiler.h + src/gperftools/malloc_extension.h + src/gperftools/malloc_hook.h + src/gperftools/profiler.h + src/gperftools/stacktrace.h + src/heap-profile-table.h + src/internal_logging.h + src/malloc_hook-inl.h + src/memory_region_map.h + src/packed-cache-inl.h + src/pagemap.h + src/page_heap.h + src/page_heap_allocator.h + src/raw_printer.h + src/sampler.h + src/span.h + src/stacktrace_win32-inl.h + src/stack_trace_table.h + src/static_vars.h + src/symbolize.h + src/system-alloc.h + src/tcmalloc.h + src/thread_cache.h + src/windows/config.h + src/windows/mini_disassembler.h + src/windows/mini_disassembler_types.h + src/windows/port.h + src/windows/preamble_patcher.h + ) + + set(libtcmalloc_minimal_sources + src/base/dynamic_annotations.c + src/base/logging.cc + src/base/low_level_alloc.cc + src/base/spinlock.cc + src/base/spinlock_internal.cc + src/base/sysinfo.cc + src/central_freelist.cc + src/common.cc + src/fake_stacktrace_scope.cc + src/heap-profile-table.cc + src/internal_logging.cc + src/malloc_extension.cc + src/malloc_hook.cc + src/memory_region_map.cc + src/page_heap.cc + src/raw_printer.cc + src/sampler.cc + src/span.cc + src/stacktrace.cc + src/stack_trace_table.cc + src/static_vars.cc + src/symbolize.cc + src/thread_cache.cc + src/windows/ia32_modrm_map.cc + src/windows/ia32_opcode_map.cc + src/windows/mini_disassembler.cc + src/windows/port.cc + src/windows/preamble_patcher.cc + src/windows/preamble_patcher_with_stub.cc + src/windows/system-alloc.cc + ) + + if(GPERFTOOLS_WIN32_OVERRIDE) + list(APPEND libtcmalloc_minimal_sources src/windows/override_functions.cc) + else() + list(APPEND libtcmalloc_minimal_sources src/windows/patch_functions.cc) + endif() + + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + source_group("Header Files" FILES ${libtcmalloc_minimal_headers}) + source_group("Source Files" FILES ${libtcmalloc_minimal_sources}) + + if(GPERFTOOLS_WIN32_OVERRIDE) + add_library(libtcmalloc_minimal + STATIC + ${libtcmalloc_minimal_headers} + ${libtcmalloc_minimal_sources} + ) + else() + add_library(libtcmalloc_minimal + ${libtcmalloc_minimal_headers} + ${libtcmalloc_minimal_sources} + ) + endif() + + target_compile_definitions( + libtcmalloc_minimal + PRIVATE + $<$: + WIN32_OVERRIDE_ALLOCATORS + PERFTOOLS_DLL_DECL= + > + ) + + target_compile_options( + libtcmalloc_minimal + PRIVATE + $<$: + /wd4141 + /wd4251 + > + ) + + target_include_directories( + libtcmalloc_minimal + PUBLIC + $ + ) + + install(FILES ${deprecated_public_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/google + ) + + install(FILES ${gperftools_public_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gperftools + ) + + install(TARGETS libtcmalloc_minimal + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + if(GPERFTOOLS_BUILD_TOOLS) + add_executable(addr2line-pdb src/windows/addr2line-pdb.c) + target_link_libraries(addr2line-pdb PRIVATE DbgHelp) + + add_executable(nm-pdb src/windows/nm-pdb.c) + target_link_libraries(nm-pdb PRIVATE DbgHelp) + + install(TARGETS addr2line-pdb nm-pdb DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() +else() +endif() diff --git a/ports/gperftools/CONTROL b/ports/gperftools/CONTROL new file mode 100644 index 00000000000000..0d7e536b754a91 --- /dev/null +++ b/ports/gperftools/CONTROL @@ -0,0 +1,11 @@ +Source: gperftools +Version: 2019-09-02 +Description: A set of tools for performance profiling and memory checking +Supports: !(arm|arm64|uwp) +Homepage: https://github.com/gperftools/gperftools + +Feature: override +Description: Override allocators + +Feature: tools +Description: Build gperftools CLI tools diff --git a/ports/gperftools/portfile.cmake b/ports/gperftools/portfile.cmake new file mode 100644 index 00000000000000..01ee219ff6877c --- /dev/null +++ b/ports/gperftools/portfile.cmake @@ -0,0 +1,83 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO gperftools/gperftools + REF fe62a0baab87ba3abca12f4a621532bf67c9a7d2 + SHA512 fc0fb2c56d38046ac7bc2d36863dabf073b7aede7ce18916228d7b9f64cf33ae754708bff028353ada52bf4b79a7cd3e3334c1558a9ba64b06326b1537faf690 + HEAD_REF master +) + +if(VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + + if(override IN_LIST FEATURES) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(STATUS "${PORT}[override] only supports static library linkage. Building static library.") + vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_STATIC_CRT) + endif() + endif() + + vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + override GPERFTOOLS_WIN32_OVERRIDE + tools GPERFTOOLS_BUILD_TOOLS + ) + + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + ${FEATURE_OPTIONS} + ) + + vcpkg_install_cmake() + + vcpkg_copy_pdbs() + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(GLOB gperf_public_headers ${CURRENT_PACKAGES_DIR}/include/gperftools/*.h) + + foreach(gperf_header ${gperf_public_headers}) + vcpkg_replace_string(${gperf_header} "__declspec(dllimport)" "") + endforeach() + endif() + + if(tools IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES addr2line-pdb nm-pdb AUTO_CLEAN) + endif() +else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_OPTS --enable-shared --disable-static) + else() + set(BUILD_OPTS --enable-static --disable-shared) + endif() + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + OPTIONS + ${BUILD_OPTS} + ) + + vcpkg_install_make() + + if(tools IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES pprof pprof-symbolize AUTO_CLEAN) + endif() + + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ) + + # https://github.com/microsoft/vcpkg/pull/8750#issuecomment-625590773 + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") + endif() +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/gppanel/CONTROL b/ports/gppanel/CONTROL index 580f233d2f6009..f081193dfcfc57 100644 --- a/ports/gppanel/CONTROL +++ b/ports/gppanel/CONTROL @@ -1,5 +1,5 @@ Source: gppanel -Version: 2018-04-06 +Version: 2020-05-20 Build-Depends: wxwidgets Homepage: https://github.com/woollybah/gppanel Description: gpPanel is chart libary for wxWidget. It inheritance from wxPanel and use modified wxMathPlot library at chart engine. diff --git a/ports/gppanel/portfile.cmake b/ports/gppanel/portfile.cmake index 04ef9be56a67d0..d86ac09ed592d6 100644 --- a/ports/gppanel/portfile.cmake +++ b/ports/gppanel/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO woollybah/gppanel - REF 5ef9674d893bbf5e17da66841cbc6aeeef051b25 - SHA512 a52eb5c4d9065e29d84374e9c484bae14cf7ff9a80fe6b025be108942a6c4683dd7f64830f78f0f7d45971f930df68f58dadf7c3915178e8908dd220d06a1e2c + REF f58a9028f7c9a8e9b4324ff2165951f558365f90 + SHA512 4ec5fbef4c487d351c60f48b0c0e41c5d077989ab96f827b9fd5ef01c167d50f39a313bd82db1b5df19d14025983e83db4d19cc4048c1c50fc8ef9128de15575 HEAD_REF master PATCHES 00001-fix-build.patch ) diff --git a/ports/graphicsmagick/CMakeLists.txt b/ports/graphicsmagick/CMakeLists.txt index 15bc3cddc8a467..4dcf2d6611e974 100644 --- a/ports/graphicsmagick/CMakeLists.txt +++ b/ports/graphicsmagick/CMakeLists.txt @@ -248,7 +248,7 @@ if (INSTALL_HEADERS) install(FILES magick/widget.h DESTINATION include/magick) install(FILES magick/xwindow.h DESTINATION include/magick) - install(FILES Magick++/lib/Magick++.h DESTINATION include/Magick++) + install(FILES Magick++/lib/Magick++.h DESTINATION include) install(FILES Magick++/lib/Magick++/Blob.h DESTINATION include/Magick++) install(FILES Magick++/lib/Magick++/BlobRef.h DESTINATION include/Magick++) diff --git a/ports/graphicsmagick/CONTROL b/ports/graphicsmagick/CONTROL index e968e3adffb02a..01040319a7edd5 100644 --- a/ports/graphicsmagick/CONTROL +++ b/ports/graphicsmagick/CONTROL @@ -1,5 +1,5 @@ Source: graphicsmagick -Version: 1.3.35 +Version: 1.3.35-2 Build-Depends: zlib, bzip2, freetype, libjpeg-turbo, libpng, tiff Homepage: https://sourceforge.net/projects/graphicsmagick/ Description: Image processing library diff --git a/ports/graphicsmagick/portfile.cmake b/ports/graphicsmagick/portfile.cmake index 2d1d0a258805d7..c17215ea735cec 100644 --- a/ports/graphicsmagick/portfile.cmake +++ b/ports/graphicsmagick/portfile.cmake @@ -1,15 +1,11 @@ set(GM_VERSION 1.3.35) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/${GM_VERSION}/GraphicsMagick-${GM_VERSION}-windows-source.7z" - FILENAME "GraphicsMagick-${GM_VERSION}-windows-source.7z" - SHA512 bf3ade807de54f366e49df5b754d8321978d8e1ed4275364fb7e861ff04f0780a698fcb4e0a110a45213209ff846034f2add00a3443ed31db2c842530199bd1f -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF "${GM_VERSION}" + REPO graphicsmagick/graphicsmagick + REF ${GM_VERSION} + FILENAME "GraphicsMagick-${GM_VERSION}-windows-source.7z" + SHA512 bf3ade807de54f366e49df5b754d8321978d8e1ed4275364fb7e861ff04f0780a698fcb4e0a110a45213209ff846034f2add00a3443ed31db2c842530199bd1f PATCHES # GM always requires a dynamic BZIP2. This patch makes this dependent if _DLL is defined dynamic_bzip2.patch diff --git a/ports/grpc/00001-fix-uwp.patch b/ports/grpc/00001-fix-uwp.patch index 79025276b467ad..eee4f14d195b1d 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 3f9d19e..25d96ab 100644 +index 8561c67..84de29f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -144,6 +144,9 @@ if(UNIX) +@@ -150,6 +150,9 @@ if(UNIX) endif() if(WIN32) set(_gRPC_PLATFORM_WINDOWS ON) @@ -11,8 +11,8 @@ index 3f9d19e..25d96ab 100644 + endif() endif() - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) -@@ -160,6 +163,9 @@ if(MSVC) + # Use C99 standard +@@ -174,6 +177,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") @@ -22,7 +22,7 @@ index 3f9d19e..25d96ab 100644 endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}") -@@ -228,6 +234,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) +@@ -237,6 +243,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) # ``.proto`` files # function(protobuf_generate_grpc_cpp) @@ -33,7 +33,7 @@ index 3f9d19e..25d96ab 100644 if(NOT ARGN) message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") return() -@@ -300,6 +310,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) +@@ -309,6 +319,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin) endif () @@ -41,7 +41,7 @@ index 3f9d19e..25d96ab 100644 add_custom_target(plugins DEPENDS ${_gRPC_PLUGIN_LIST} ) -@@ -321,6 +332,7 @@ add_custom_target(tools_cxx +@@ -327,6 +338,7 @@ add_custom_target(tools_cxx add_custom_target(tools DEPENDS tools_c tools_cxx) diff --git a/ports/grpc/00002-static-linking-in-linux.patch b/ports/grpc/00002-static-linking-in-linux.patch index d496e54c4ef5eb..371873888b7caa 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 25d96ab..c4057b3 100644 +index 84de29f..0c6dc0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -152,6 +152,11 @@ endif() - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") +@@ -165,6 +165,11 @@ set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + 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/00005-fix-uwp-error.patch b/ports/grpc/00005-fix-uwp-error.patch index 37748b09f0785b..93ac05d1b2a0b7 100644 --- a/ports/grpc/00005-fix-uwp-error.patch +++ b/ports/grpc/00005-fix-uwp-error.patch @@ -10,3 +10,16 @@ index c0e2164..331e54c 100644 if (len <= sizeof(slice.data.inlined.bytes)) { slice.refcount = nullptr; slice.data.inlined.length = len; +diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc +index 998eb6d..a6e26d3 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, + 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; diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index 41a2d9ab6ba7cc..de6f07f5d09a93 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,136 +1,139 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index a6a0f23..1c170da 100644 +index 5ec669e..f71a212 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1281,7 +1281,7 @@ target_link_libraries(alts_test_util +@@ -81,6 +81,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") + ++set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library") ++set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package") ++ + 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 ${_gRPC_ALLTARGETS_LIBRARIES} + gpr + address_sorting +- upb + absl::optional + absl::strings + absl::inlined_vector +@@ -1844,7 +1846,6 @@ target_link_libraries(grpc_csharp_ext grpc gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) - foreach(_hdr -@@ -1917,7 +1917,7 @@ target_link_libraries(grpc - ${_gRPC_UPB_LIBRARIES} + +@@ -2351,7 +2352,6 @@ target_link_libraries(grpc_unsecure ${_gRPC_ALLTARGETS_LIBRARIES} gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc "-framework CoreFoundation") -@@ -2328,7 +2328,7 @@ target_link_libraries(grpc_cronet - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} + absl::optional + absl::strings + absl::inlined_vector +@@ -2545,7 +2545,6 @@ target_link_libraries(grpc++ + grpc gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_cronet "-framework CoreFoundation") -@@ -2670,7 +2670,7 @@ target_link_libraries(grpc_test_util - ${_gRPC_ALLTARGETS_LIBRARIES} - gpr + + foreach(_hdr +@@ -2821,7 +2820,6 @@ target_link_libraries(grpc++_alts grpc -- upb -+ ${_gRPC_UPB_LIBRARIES} - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_test_util "-framework CoreFoundation") -@@ -3013,7 +3013,7 @@ target_link_libraries(grpc_test_util_unsecure - ${_gRPC_ALLTARGETS_LIBRARIES} gpr - grpc_unsecure + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_test_util_unsecure "-framework CoreFoundation") -@@ -3404,7 +3404,7 @@ target_link_libraries(grpc_unsecure - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} + + foreach(_hdr +@@ -2889,7 +2887,6 @@ target_link_libraries(grpc++_error_details + grpc gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_unsecure "-framework CoreFoundation") -@@ -3743,7 +3743,7 @@ target_link_libraries(grpc++ - ${_gRPC_ALLTARGETS_LIBRARIES} + + foreach(_hdr +@@ -2962,7 +2959,6 @@ target_link_libraries(grpc++_reflection grpc gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) foreach(_hdr -@@ -4070,7 +4070,7 @@ target_link_libraries(grpc++_alts - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ +@@ -3239,7 +3235,6 @@ target_link_libraries(grpc++_unsecure + grpc_unsecure gpr + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) foreach(_hdr -@@ -4876,7 +4876,7 @@ target_link_libraries(grpc++_unsecure - ${_gRPC_ALLTARGETS_LIBRARIES} +@@ -3586,7 +3581,6 @@ target_link_libraries(grpcpp_channelz + grpc gpr - grpc_unsecure + address_sorting - upb -+ ${_gRPC_UPB_LIBRARIES} ) foreach(_hdr -@@ -5898,7 +5898,7 @@ target_link_libraries(grpc_csharp_ext - +@@ -3613,6 +3607,7 @@ endif() endif() -- -+if(0) + ++if (gRPC_UPB_PROVIDER STREQUAL "module") add_library(upb third_party/upb/upb/decode.c third_party/upb/upb/encode.c -@@ -5938,10 +5938,10 @@ target_include_directories(upb - target_link_libraries(upb - ${_gRPC_ALLTARGETS_LIBRARIES} - ) +@@ -3662,7 +3657,7 @@ if(gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() +- +endif() -- --if(gRPC_INSTALL) -+if(gRPC_INSTALL AND 0) - install(TARGETS upb EXPORT gRPCTargets - RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} - LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} + add_executable(check_epollexclusive diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 5bfa73c..8a867df 100644 +index 5bfa73c..db0865e 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@ @_gRPC_FIND_CARES@ @_gRPC_FIND_ABSL@ -+find_package(upb CONFIG) ++@_gRPC_FIND_UPB@ # Targets include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index 2c0ab84..746e067 100644 +index 2c0ab84..07dd613 100644 --- a/cmake/upb.cmake +++ b/cmake/upb.cmake -@@ -12,9 +12,9 @@ +@@ -12,9 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. --set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) -+find_package(upb REQUIRED) -+set(_gRPC_UPB_INCLUDE_DIR) ++set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated") ++if (gRPC_UPB_PROVIDER STREQUAL "module") + set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) --set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") - set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated") + set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") +-set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated") --set(_gRPC_UPB_LIBRARIES upb) -+set(_gRPC_UPB_LIBRARIES upb::upb) + set(_gRPC_UPB_LIBRARIES upb) ++ ++elseif(gRPC_UPB_PROVIDER STREQUAL "package") ++ find_package(upb CONFIG REQUIRED) ++ set(_gRPC_UPB_LIBRARIES upb::upb) ++ set(_gRPC_UPB_INCLUDE_DIR) ++ set(upb ${_gRPC_UPB_LIBRARIES}) ++ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") ++endif() diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch new file mode 100644 index 00000000000000..8fb59a60e8eade --- /dev/null +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f71a212..77cf3de 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1771,6 +1771,8 @@ target_link_libraries(grpc + absl::optional + absl::strings + absl::inlined_vector ++ absl::time ++ absl::synchronization + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) + target_link_libraries(grpc "-framework CoreFoundation") +@@ -2355,6 +2357,8 @@ target_link_libraries(grpc_unsecure + absl::optional + absl::strings + absl::inlined_vector ++ absl::time ++ absl::synchronization + ) + 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 +--- a/cmake/abseil-cpp.cmake ++++ b/cmake/abseil-cpp.cmake +@@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") + # Use "CONFIG" as there is no built-in cmake module for absl. + find_package(absl REQUIRED CONFIG) + set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()") ++ if (gRPC_ABSL_SYNC_ENABLE) ++ add_definitions(-DGPR_ABSEIL_SYNC=1) ++ endif() + endif() diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch new file mode 100644 index 00000000000000..c2d1771131a87c --- /dev/null +++ b/ports/grpc/00011-fix-csharp_plugin.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 77cf3de..8bceae6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1812,10 +1812,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} +@@ -1829,6 +1833,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 24e6bd04a9cb17..f62df066c6d239 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,5 +1,9 @@ Source: grpc -Version: 1.27.3 +Version: 1.29.1 +Port-Version: 1 Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil Homepage: https://github.com/grpc/grpc Description: An RPC library and framework + +Feature: absl-sync +Description: Use abseil synchronization module \ No newline at end of file diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 96d56097a27b44..cc8fe92bec68bb 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 v1.27.3 - SHA512 0338eedcce40cd7359cc1b216eb3eeaaeb1f2b065d1bb03e72322978a7e40ef8ecc1ad39808bec8c0fd5bcaa91e91bbd6037e5a6611a979c9ab413eb159bb38b + REF 7d89dbb311f049b43bda7bbf6f7d7bf1b4c24419 #v1.29.1 + SHA512 403fa5e3f012786bb17ca32c760b6dfb22c5a5cfb473ba7fad657e26ab3986eb0203f7cbb501a8647fd5ef2571e5f4ee08c2c97d1dfda18ec5ab6a92c9fc3263 HEAD_REF master PATCHES 00001-fix-uwp.patch @@ -15,6 +15,8 @@ vcpkg_from_github( 00004-link-gdi32-on-windows.patch 00005-fix-uwp-error.patch 00009-use-system-upb.patch + 00010-add-feature-absl-sync.patch + 00011-fix-csharp_plugin.patch snprintf.patch ) @@ -33,10 +35,14 @@ else() set(cares_CARES_PROVIDER "package") endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + absl-sync gRPC_ABSL_SYNC_ENABLE +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING} @@ -45,6 +51,7 @@ vcpkg_configure_cmake( -DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ABSL_PROVIDER=package + -DgRPC_UPB_PROVIDER=package -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} -DgRPC_GFLAGS_PROVIDER=none @@ -53,13 +60,13 @@ vcpkg_configure_cmake( -DgRPC_INSTALL_BINDIR:STRING=tools/grpc -DgRPC_INSTALL_LIBDIR:STRING=lib -DgRPC_INSTALL_INCLUDEDIR:STRING=include - -DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc + -DgRPC_INSTALL_CMAKEDIR:STRING=share/gRPC -DgRPC_BUILD_CODEGEN=${gRPC_BUILD_CODEGEN} ) vcpkg_install_cmake(ADD_BIN_TO_PATH) -vcpkg_fixup_cmake_targets() +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) diff --git a/ports/gsl-lite/CONTROL b/ports/gsl-lite/CONTROL index d575f9bc5fe48f..65c6fb37c6db21 100644 --- a/ports/gsl-lite/CONTROL +++ b/ports/gsl-lite/CONTROL @@ -1,4 +1,4 @@ Source: gsl-lite -Version: 0.36.0 +Version: 0.37.0 Description: A single-file header-only implementation of ISO C++ Guidelines Support Library (GSL) for C++98, C++11 and later. Homepage: https://github.com/gsl-lite/gsl-lite/ diff --git a/ports/gsl-lite/portfile.cmake b/ports/gsl-lite/portfile.cmake index 03280d024657ed..5239c71092ac84 100644 --- a/ports/gsl-lite/portfile.cmake +++ b/ports/gsl-lite/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gsl-lite/gsl-lite - REF 0190c0e40ca65e7d30dab51bee512ccd29f48bc1 - SHA512 7ae9bb37bcbc83be3667b504271c209fea97e235fe50b754c3d420a7e97bbe2dd1df17a164dca536fb1455a19c26162d0bc27055d7c1ac495fb77956ec0f4e6d + REF 4b796627ad0fa42640f5fdb96f23c4a0d9ee084f + SHA512 c0943824149b17c66947160bd83f3b14b821ba14bba02247546bd98d2b2809fae611e7841000fbe3be8f675cd076585f12ede05366fd1f9ba96a1067ac63ef43 HEAD_REF master ) diff --git a/ports/gsl/CMakeLists.txt b/ports/gsl/CMakeLists.txt index 0027fe29166ef2..2d37f37e98bd98 100644 --- a/ports/gsl/CMakeLists.txt +++ b/ports/gsl/CMakeLists.txt @@ -9,7 +9,8 @@ function(extract_from_makefile PATTERN RETURN FILEPATH) string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}") set(CONTENTS ${CMAKE_MATCH_1}) # Split string into list - string(REGEX REPLACE "[ \t]+" ";" CONTENTS "${CONTENTS}") + string(REGEX REPLACE "([\t ]+(\\\\\n)?)+" ";" CONTENTS "${CONTENTS}") + string(REGEX REPLACE "[\t ]*\\\\\n[\t ]*;" "" CONTENTS "${CONTENTS}") if("${CONTENTS}" STREQUAL "") message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}") endif() @@ -19,8 +20,8 @@ endfunction(extract_from_makefile) # Function to extract C sources from makefile function(extract_sources SUBFOLDER ALLSOURCES) - extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*([^\n]*)" SOURCEFILES "${SUBFOLDER}/Makefile.am") - # Add the folder in front of the file names + extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*(((\\\\\n)?[^\n])*)" SOURCEFILES "${SUBFOLDER}/Makefile.am") + # Add the folder in front of the file names string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}") # Return set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE) @@ -28,7 +29,7 @@ endfunction(extract_sources) set(SOURCES) set(CBLAS_SOURCES) -extract_from_makefile("SUBDIRS = ([^\n]*)" FOLDERS "./Makefile.am") +extract_from_makefile("SUBDIRS = (((\\\\\n)?[^\n])*)" FOLDERS "./Makefile.am") extract_sources("." SOURCES) foreach(DIR IN LISTS FOLDERS) if("${DIR}" STREQUAL "cblas") diff --git a/ports/gsl/CONTROL b/ports/gsl/CONTROL index 0ec3fc2e908eb6..62c5efb26bef25 100644 --- a/ports/gsl/CONTROL +++ b/ports/gsl/CONTROL @@ -1,4 +1,4 @@ Source: gsl -Version: 2.4-5 +Version: 2.6 Homepage: https://www.gnu.org/software/gsl/ Description: The GNU Scientific Library is a numerical library for C and C++ programmers diff --git a/ports/gsl/portfile.cmake b/ports/gsl/portfile.cmake index 8e692e70fec26e..3069c44b2a4d10 100644 --- a/ports/gsl/portfile.cmake +++ b/ports/gsl/portfile.cmake @@ -1,9 +1,9 @@ -set(GSL_VERSION 2.4) +set(GSL_VERSION 2.6) vcpkg_download_distfile(ARCHIVE URLS "https://ftp.gnu.org/gnu/gsl/gsl-${GSL_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gsl/gsl-${GSL_VERSION}.tar.gz" FILENAME "gsl-${GSL_VERSION}.tar.gz" - SHA512 12442b023dd959e8b22a9c486646b5cedec7fdba0daf2604cda365cf96d10d99aefdec2b42e59c536cc071da1525373454e5ed6f4b15293b305ca9b1dc6db130 + SHA512 0be8240715f0b86aba2c63d9f12da4dba4719d4e350e9308d279e0dd3b2f0519ea26fd2e38a17f3e8cf43aacbaa2455207a7ca0d6c305f3b8725e8ece2250a74 ) vcpkg_extract_source_archive_ex( diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL index 174bd57c8ea4c0..ff4434872abc2b 100644 --- a/ports/gsoap/CONTROL +++ b/ports/gsoap/CONTROL @@ -1,5 +1,6 @@ Source: gsoap -Version: 2.8.93-2 +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. \ No newline at end of file +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: !(linux|osx|arm|uwp) diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index 3208614dccf95d..1a4e75adbb63dc 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -1,24 +1,15 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "arm" "arm64") -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/gsoap2/gsoap-2.8/gsoap_2.8.93.zip" - FILENAME "gsoap_2.8.93.zip" - SHA512 45965d04e1c46e06803467887f62d9bea5909fa2d4c4d9ffc935f9fced014efed9169a0171a555067c89ef47b2def9983b277eecee18eb9e70d7198bc72b1ece -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - "${CMAKE_CURRENT_LIST_DIR}/fix-build-in-windows.patch" + REPO gsoap2 + REF gsoap-2.8 + FILENAME "gsoap_2.8.105.zip" + SHA512 3b7b66ef738e9ba78f0c9d5ec141faab102dc2ed7c528e84358d530ec8cb913c559438bb86ae0f22e0736c4cd9be9e74f364a44257189ccaa1e6d001317f99de + PATCHES fix-build-in-windows.patch ) -if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(BUILD_ARCH "Win32") -else() - message("gsoap only supported Win32") - set(BUILD_ARCH "Win32") -endif() +set(BUILD_ARCH "Win32") # Handle binary files and includes file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/gsoap ${CURRENT_PACKAGES_DIR}/debug/tools) @@ -50,15 +41,20 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOURCE_PATH}/gsoap/stdsoap2.cpp ${SOURCE_PATH}/gsoap/dom.c ${SOURCE_PATH}/gsoap/dom.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) # Handle import files -file(COPY ${SOURCE_PATH}/gsoap/import DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsoap) +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/gsoap) +file(COPY ${SOURCE_PATH}/gsoap/plugin DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +# Cleanup surplus empty directory +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/gsoap/plugin/.deps") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt ${SOURCE_PATH}/INSTALL.txt ${SOURCE_PATH}/README.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsoap) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/copyright) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/INSTALL.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/install) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/README.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/readme) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/INSTALL.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME install) +file(INSTALL ${SOURCE_PATH}/README.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME readme) vcpkg_copy_pdbs() diff --git a/ports/gtest/CONTROL b/ports/gtest/CONTROL index 69f20c11d88912..9d3934072f8244 100644 --- a/ports/gtest/CONTROL +++ b/ports/gtest/CONTROL @@ -1,4 +1,4 @@ Source: gtest -Version: 2019-10-09-1 +Version: 1.10.0 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 5dd3bd5062d692..585f380c49841b 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -5,8 +5,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/googletest - REF cd17fa2abda2a2e4111cdabd62a87aea16835014 #version 1.10.0 commit on 2019.10.09 - SHA512 0899ebc21821e1978e8831ac89698fc88bf98ec7e22b9dd4f9eea0459396f6834ef35f6ee2afd1b8ca9432722e561c30905f8d87614d012bb711d295ebc1d833 + REF release-1.10.0 + SHA512 bd52abe938c3722adc2347afad52ea3a17ecc76730d8d16b065e165bc7477d762bce0997a427131866a89f1001e3f3315198204ffa5d643a9355f1f4d0d7b1a9 HEAD_REF master PATCHES 0002-Fix-z7-override.patch diff --git a/ports/gtk/CONTROL b/ports/gtk/CONTROL index 56e660c5cbeee3..037d87efddd3d2 100644 --- a/ports/gtk/CONTROL +++ b/ports/gtk/CONTROL @@ -1,5 +1,5 @@ Source: gtk -Version: 3.22.19-3 +Version: 3.22.19-4 Homepage: https://www.gtk.org/ Description: Portable library for creating graphical user interfaces. Build-Depends: glib, atk, gdk-pixbuf, pango, cairo, libepoxy, gettext diff --git a/ports/gtk/portfile.cmake b/ports/gtk/portfile.cmake index ad729ba0139ed6..d77bee0589f9f0 100644 --- a/ports/gtk/portfile.cmake +++ b/ports/gtk/portfile.cmake @@ -30,6 +30,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE OPTIONS -DGTK_VERSION=${GTK_VERSION} OPTIONS_DEBUG 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/gts/CONTROL b/ports/gts/CONTROL index 917d66bf86e43b..7d9db739126a56 100644 --- a/ports/gts/CONTROL +++ b/ports/gts/CONTROL @@ -1,5 +1,5 @@ Source: gts -Version: 0.7.6-1 +Version: 0.7.6-3 Homepage: https://github.com/finetjul/gts Description: A Library intended to provide a set of useful functions to deal with 3D surfaces meshed with interconnected triangles Build-Depends: glib diff --git a/ports/gts/fix-M_PI-in-windows.patch b/ports/gts/fix-M_PI-in-windows.patch new file mode 100644 index 00000000000000..d573ef080ff918 --- /dev/null +++ b/ports/gts/fix-M_PI-in-windows.patch @@ -0,0 +1,28 @@ +diff --git a/src/curvature.c b/src/curvature.c +index 70f6af2..a5c0187 100644 +--- a/src/curvature.c ++++ b/src/curvature.c +@@ -17,6 +17,9 @@ + * Boston, MA 02111-1307, USA. + */ + ++#ifdef _WIN32 ++#define _USE_MATH_DEFINES ++#endif + #include + #include "gts.h" + +diff --git a/src/triangle.c b/src/triangle.c +index 1d82869..47170c6 100644 +--- a/src/triangle.c ++++ b/src/triangle.c +@@ -17,6 +17,9 @@ + * Boston, MA 02111-1307, USA. + */ + ++#ifdef _WIN32 ++#define _USE_MATH_DEFINES ++#endif + #include + #include "gts.h" + diff --git a/ports/gts/fix-pkgconfig.patch b/ports/gts/fix-pkgconfig.patch new file mode 100644 index 00000000000000..59deeca22fd57b --- /dev/null +++ b/ports/gts/fix-pkgconfig.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f458c35..8035507 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,3 +124,11 @@ INSTALL(FILES + src/gtsconfig.h + DESTINATION include COMPONENT Development + ) ++ ++set(prefix ${CMAKE_INSTALL_PREFIX}) ++set(exec_prefix ${CMAKE_INSTALL_PREFIX}) ++set(libdir ${CMAKE_INSTALL_PREFIX}/lib) ++set(includedir ${CMAKE_INSTALL_PREFIX}/include) ++ ++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gts.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gts.pc" @ONLY) ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gts.pc" DESTINATION lib/pkgconfig) +\ No newline at end of file +diff --git a/gts.pc.in b/gts.pc.in +index 39626d7..bcd4014 100644 +--- a/gts.pc.in ++++ b/gts.pc.in +@@ -7,5 +7,5 @@ Name: GTS + Description: GNU Triangulated Surface Library + Version: @VERSION@ + Requires: glib-2.0,gthread-2.0,gmodule-2.0 +-Libs: -L${libdir} @LIBS@ -lgts -lm ++Libs: -L${libdir} @LIBS@ -lgts + Cflags: -I${includedir} diff --git a/ports/gts/portfile.cmake b/ports/gts/portfile.cmake index 71a62e756a2eae..da7ed6183c0a77 100644 --- a/ports/gts/portfile.cmake +++ b/ports/gts/portfile.cmake @@ -1,25 +1,26 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO finetjul/gts - REF c4da61ae075f355d9ecc9f2d4767acf777f54c2b + REF c4da61ae075f355d9ecc9f2d4767acf777f54c2b #0.7.6 SHA512 e53d11213c26cbda08ae62e6388aee0a14d2884de72268ad25d10a23e77baa53a2b1151c5cc7643b059ded82b8edf0da79144c3108949fdc515168cac13ffca9 HEAD_REF master + PATCHES + fix-M_PI-in-windows.patch + support-unix.patch + fix-pkgconfig.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA ) vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gts RENAME copyright) - +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/gts/support-unix.patch b/ports/gts/support-unix.patch new file mode 100644 index 00000000000000..597b4f54520004 --- /dev/null +++ b/ports/gts/support-unix.patch @@ -0,0 +1,190 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c35100c..f458c35 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1) + add_executable(predicates_init src/predicates_init.c) + + execute_process( +- COMMAND predicates_init.exe ++ COMMAND predicates_init + OUTPUT_FILE predicates_init.h + OUTPUT_VARIABLE OUTVAR) + +@@ -12,6 +12,31 @@ MESSAGE("${OUTVAR}") + set(kit gts) + project(${kit}) + ++if (NOT WIN32) ++ set(CPP_HAS_WARNING 1) ++ set(HAVE_DLFCN_H 1) ++ set(HAVE_FLOATINGPOINT_H 1) ++ set(HAVE_FPU_CONTROL_H 1) ++ set(HAVE_GETOPT_H 1) ++ set(HAVE_GETOPT_LONG 1) ++ set(HAVE_INTTYPES_H 1) ++ set(HAVE_MEMORY_H 1) ++ set(HAVE_STDINT_H 1) ++ set(HAVE_STDLIB_H 1) ++ set(HAVE_STRINGS_H 1) ++ set(HAVE_STRING_H 1) ++ set(HAVE_SYS_STAT_H 1) ++ set(HAVE_SYS_TYPES_H 1) ++ set(HAVE_UNISTD_H 1) ++ set(PACKAGE_BUGREPORT 0) ++ set(PACKAGE_NAME "gts") ++ set(PACKAGE_STRING "0.7.6") ++ set(PACKAGE_TARNAME "gts") ++ set(PACKAGE_URL "") ++ set(PACKAGE_VERSION "0.7.6") ++ set(STDC_HEADERS) ++endif() ++ + set(srcs + src/bbtree.c + src/boolean.c +@@ -49,7 +74,11 @@ set(srcs + src/vopt.c + ) + ++if (WIN32) + configure_file(src/config.h.win32 config.h) ++else() ++configure_file(config.h.in config.h @ONLY) ++endif() + + SET(CMAKE_INCLUDE_CURRENT_DIR ON) + include_directories( +@@ -74,7 +103,9 @@ find_path(glib_CONFIG_H NAMES glibconfig.h + get_filename_component(glibconfig_INCLUDE_DIR ${glib_CONFIG_H} DIRECTORY) + include_directories(${glib_INCLUDE_DIR} ${glib_CONFIG_H}) + ++if (NOT WIN32 AND BUILD_SHARED_LIBS) + add_definitions(/DGTS_COMPILATION) ++endif() + + add_library(${kit} SHARED ${srcs}) + target_link_libraries(${kit} ${glib_LIBRARY}) +diff --git a/config.h.in b/config.h.in +index ad95945..fe6c945 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -1,89 +1,89 @@ + /* config.h.in. Generated from configure.ac by autoheader. */ + + /* Define if C preprocessor supports warning directive. */ +-#undef CPP_HAS_WARNING ++#cmakedefine CPP_HAS_WARNING @CPP_HAS_WARNING@ + + /* Binary age */ +-#undef GTS_BINARY_AGE ++#define GTS_BINARY_AGE 0 + + /* Interface age */ +-#undef GTS_INTERFACE_AGE ++#define GTS_INTERFACE_AGE 0 + + /* Major version */ +-#undef GTS_MAJOR_VERSION ++#define GTS_MAJOR_VERSION 0 + + /* Micro version */ +-#undef GTS_MICRO_VERSION ++#define GTS_MICRO_VERSION 0 + + /* Minor version */ +-#undef GTS_MINOR_VERSION ++#define GTS_MINOR_VERSION 6 + + /* Define to 1 if you have the header file. */ +-#undef HAVE_DLFCN_H ++#cmakedefine HAVE_DLFCN_H @HAVE_DLFCN_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_FLOATINGPOINT_H ++#cmakedefine HAVE_FLOATINGPOINT_H @HAVE_FLOATINGPOINT_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_FPU_CONTROL_H ++#cmakedefine HAVE_FPU_CONTROL_H @HAVE_FPU_CONTROL_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_GETOPT_H ++#cmakedefine HAVE_GETOPT_H @HAVE_GETOPT_H@ + + /* Define to 1 if you have the `getopt_long' function. */ +-#undef HAVE_GETOPT_LONG ++#cmakedefine HAVE_GETOPT_LONG @HAVE_GETOPT_LONG@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_INTTYPES_H ++#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_MEMORY_H ++#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STDINT_H ++#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STDLIB_H ++#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STRINGS_H ++#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STRING_H ++#cmakedefine HAVE_STRING_H @HAVE_STRING_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_SYS_STAT_H ++#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_SYS_TYPES_H ++#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ + + /* Define to 1 if you have the header file. */ +-#undef HAVE_UNISTD_H ++#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ + + /* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +-#undef LT_OBJDIR ++#cmakedefine LT_OBJDIR @LT_OBJDIR@ + + /* Define if netpbm include files are in netpbm/. */ +-#undef NETPBM_INCLUDE ++#cmakedefine NETPBM_INCLUDE @NETPBM_INCLUDE@ + + /* Define to the address where bug reports for this package should be sent. */ +-#undef PACKAGE_BUGREPORT ++#cmakedefine PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@ + + /* Define to the full name of this package. */ +-#undef PACKAGE_NAME ++#cmakedefine PACKAGE_NAME @PACKAGE_NAME@ + + /* Define to the full name and version of this package. */ +-#undef PACKAGE_STRING ++#cmakedefine PACKAGE_STRING @PACKAGE_STRING@ + + /* Define to the one symbol short name of this package. */ +-#undef PACKAGE_TARNAME ++#cmakedefine PACKAGE_TARNAME @PACKAGE_TARNAME@ + + /* Define to the home page for this package. */ +-#undef PACKAGE_URL ++#cmakedefine PACKAGE_URL @PACKAGE_URL@ + + /* Define to the version of this package. */ +-#undef PACKAGE_VERSION ++#cmakedefine PACKAGE_VERSION @PACKAGE_VERSION@ + + /* Define to 1 if you have the ANSI C header files. */ +-#undef STDC_HEADERS ++#cmakedefine STDC_HEADERS @STDC_HEADERS@ diff --git a/ports/gzip-hpp/CONTROL b/ports/gzip-hpp/CONTROL new file mode 100644 index 00000000000000..86eba1394ef3f2 --- /dev/null +++ b/ports/gzip-hpp/CONTROL @@ -0,0 +1,5 @@ +Source: gzip-hpp +Version: 0.1.0 +Homepage: https://github.com/mapbox/gzip-hpp/ +Description: Gzip header-only C++ library +Build-Depends: zlib \ No newline at end of file diff --git a/ports/gzip-hpp/portfile.cmake b/ports/gzip-hpp/portfile.cmake new file mode 100644 index 00000000000000..c490c726e58d80 --- /dev/null +++ b/ports/gzip-hpp/portfile.cmake @@ -0,0 +1,14 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mapbox/gzip-hpp + REF v0.1.0 + SHA512 4f332f08e842583b421932f14ee736a64d090ac22fd4e4654e5d84667c2fd6dcd73206b27b7c0c4f364104af7f4a5ad765c38125574bc239fa93b0b0ec4dad56 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/include/gzip DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch b/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch new file mode 100644 index 00000000000000..12f89845fc1528 --- /dev/null +++ b/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch @@ -0,0 +1,16 @@ +diff --git a/lzf/lzf_filter.c b/lzf/lzf_filter.c +index 951b1e4c..b2fbffc1 100644 +--- a/lzf/lzf_filter.c ++++ b/lzf/lzf_filter.c +@@ -93,9 +93,9 @@ static const H5Z_class_t filter_class = { + + #include "H5PLextern.h" + +-H5PL_type_t H5PLget_plugin_type(void){ return H5PL_TYPE_FILTER; } ++//H5PL_type_t H5PLget_plugin_type(void){ return H5PL_TYPE_FILTER; } + +-const void *H5PLget_plugin_info(void){ return &filter_class; } ++//const void *H5PLget_plugin_info(void){ return &filter_class; } + + #endif + #endif diff --git a/ports/h5py-lzf/CMakeLists.txt b/ports/h5py-lzf/CMakeLists.txt new file mode 100644 index 00000000000000..3ef3950c7239e5 --- /dev/null +++ b/ports/h5py-lzf/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.13) +project(h5py-lzf) + +find_package(hdf5 CONFIG REQUIRED) + +add_library(h5py-lzf STATIC lzf_filter.c lzf/lzf_c.c lzf/lzf_d.c) +target_include_directories(h5py-lzf PUBLIC $) +target_link_libraries(h5py-lzf PRIVATE libzstd $) +install(TARGETS h5py-lzf EXPORT h5py-lzf-config ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +install(EXPORT h5py-lzf-config DESTINATION share/cmake/h5py-lzf) +install(FILES lzf_filter.h lzf/lzf.h DESTINATION include) diff --git a/ports/h5py-lzf/CONTROL b/ports/h5py-lzf/CONTROL new file mode 100644 index 00000000000000..3ef62f85a31f5e --- /dev/null +++ b/ports/h5py-lzf/CONTROL @@ -0,0 +1,5 @@ +Source: h5py-lzf +Version: 2019-12-04 +Build-Depends: hdf5 +Homepage: https://github.com/h5py/h5py/tree/master/lzf +Description: The LZF filter is an alternative DEFLATE-style compressor for HDF5 datasets, using the free LZF library by Marc Alexander Lehmann. diff --git a/ports/h5py-lzf/portfile.cmake b/ports/h5py-lzf/portfile.cmake new file mode 100644 index 00000000000000..71b4709b8627ff --- /dev/null +++ b/ports/h5py-lzf/portfile.cmake @@ -0,0 +1,34 @@ +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(link_hdf5_SHARED 0) +else() + set(link_hdf5_SHARED 1) +endif() + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO h5py/h5py + REF 81ba118ee66b97a94678e8f5675c4114649dfda4 + SHA512 c789abdc563f8d2535f0a2ef5e233eb862281559a9cdc3ec560dd69b4d403b6f923f5390390da54851e1bfef1be8de7f80999c25a7f3ac4962ee0620179c6420 + HEAD_REF master + PATCHES + 0001-disable-H5PLget_plugin-api.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/lzf) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/lzf + PREFER_NINJA + OPTIONS + -Dlink_hdf5_SHARED=${link_hdf5_SHARED} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/lzf/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/halide/CONTROL b/ports/halide/CONTROL index 5120d819047368..fe1f94474b5f06 100644 --- a/ports/halide/CONTROL +++ b/ports/halide/CONTROL @@ -1,5 +1,5 @@ Source: halide -Version: release_2019_08_27-2 +Version: master_2020_03_07 Homepage: https://github.com/halide/Halide Description: Halide is a programming language designed to make it easier to write high-performance image processing code on modern machines. Build-Depends: llvm[tools], openblas diff --git a/ports/halide/fix-install-path.patch b/ports/halide/fix-install-path.patch index 46ca4bd4516d8d..5fb24ea459c501 100644 --- a/ports/halide/fix-install-path.patch +++ b/ports/halide/fix-install-path.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4ba3843..6697118 100644 +index 577b61ed2..7c6dd8ac4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -450,7 +450,7 @@ install(FILES +@@ -432,7 +432,7 @@ install(FILES DESTINATION include) install(DIRECTORY tutorial @@ -11,22 +11,20 @@ index 4ba3843..6697118 100644 FILES_MATCHING PATTERN "*.cpp" PATTERN "*.h" -@@ -478,12 +478,12 @@ endforeach() - # ---- README - file(GLOB FILES "${HALIDE_BASE_DIR}/*.md") - install(FILES ${FILES} +@@ -463,10 +463,10 @@ install(FILES + README.md + README_rungen.md + README_webassembly.md - DESTINATION .) + DESTINATION share/halide) # ---- halide.cmake - file(GLOB FILES "${HALIDE_BASE_DIR}/*.cmake") - install(FILES ${FILES} -- DESTINATION .) -+ DESTINATION share/halide) +-install(FILES halide.cmake DESTINATION .) ++install(FILES halide.cmake DESTINATION share/halide) # ---- halide_config - file(GLOB FILES "${HALIDE_BASE_DIR}/tools/halide_config.*.tpl") -@@ -492,7 +492,7 @@ foreach(F ${FILES}) + file(GLOB FILES "${Halide_SOURCE_DIR}/tools/halide_config.*.tpl") +@@ -475,7 +475,7 @@ foreach(F ${FILES}) string(REGEX REPLACE "\\.tpl$" "" FNAME "${FNAME}") # Strip .tpl extension configure_file("${F}" "${CMAKE_BINARY_DIR}/${FNAME}" @ONLY) install(FILES "${CMAKE_BINARY_DIR}/${FNAME}" diff --git a/ports/halide/portfile.cmake b/ports/halide/portfile.cmake index 058610ad50a97a..4a6a04f72b6a75 100644 --- a/ports/halide/portfile.cmake +++ b/ports/halide/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO halide/Halide - REF 65c26cba6a3eca2d08a0bccf113ca28746012cc3 #release_2019_08_27 - SHA512 f95b31ec08a6c4e618a5c03b6ae9e0b41888035a268e82ee73abde8ea34dff325db270f1ff10387ef03de27e274ad27c7ccbc873c0b75bb6c1a8112cf3765c5d + REF f43293be3725bb959941e38c1b1fa9ae925f7389 + SHA512 f223185e208acf6c5b73353a6b5be815db5f2598f568596e800c35ea40b0babe4630da44229e14a5607e9d5e78298d07e7b36a9cbc7b71bf3e665bc12caff68e HEAD_REF master PATCHES fix-install-path.patch diff --git a/ports/harfbuzz/0001-fix-cmake-export.patch b/ports/harfbuzz/0001-fix-cmake-export.patch index c3264dfd532c62..31f4896f445567 100644 --- a/ports/harfbuzz/0001-fix-cmake-export.patch +++ b/ports/harfbuzz/0001-fix-cmake-export.patch @@ -1,13 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 019e205..8a464a5 100644 +index 71830b6f5..a25cb09dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -795,7 +795,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) +@@ -712,7 +712,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) ) install(EXPORT harfbuzzConfig NAMESPACE harfbuzz:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/harfbuzz + DESTINATION share/harfbuzz ) - if (HB_BUILD_UTILS) - if (WIN32 AND BUILD_SHARED_LIBS) + if (HB_HAVE_ICU) + install(TARGETS harfbuzz-icu diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 8952d04d4b903f..4dbeebf7c25b1a 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,9 +1,8 @@ Source: harfbuzz -Version: 2.5.3 +Version: 2.6.6 Description: HarfBuzz OpenType text shaping engine Homepage: https://github.com/behdad/harfbuzz -Build-Depends: freetype, ragel, gettext (osx) -Default-Features: ucdn +Build-Depends: freetype[core], ragel, gettext (osx) Feature: graphite2 Build-Depends: graphite2 @@ -13,9 +12,6 @@ Feature: icu Build-Depends: icu Description: icu support for harfbuzz -Feature: ucdn -Description: Builtin (UCDN) Unicode callbacks support - Feature: glib Build-Depends: glib Description: Glib Unicode callbacks support diff --git a/ports/harfbuzz/glib-cmake.patch b/ports/harfbuzz/glib-cmake.patch index ddbc9671237820..519627ac710318 100644 --- a/ports/harfbuzz/glib-cmake.patch +++ b/ports/harfbuzz/glib-cmake.patch @@ -1,11 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2d6e77e8..36e4b4e6 100644 +index 9b21bef2c..ae741ef63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -306,22 +306,14 @@ endif () +@@ -213,21 +213,13 @@ endif () if (HB_HAVE_GLIB) add_definitions(-DHAVE_GLIB) - + - # https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGLIB.cmake - find_package(PkgConfig) - pkg_check_modules(PC_GLIB QUIET glib-2.0) @@ -18,14 +18,13 @@ index 2d6e77e8..36e4b4e6 100644 + find_package(Threads REQUIRED) + find_package(unofficial-iconv REQUIRED) + find_package(unofficial-glib CONFIG REQUIRED) - - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-glib.cc) + list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-glib.h) - + - list(APPEND THIRD_PARTY_LIBS ${GLIB_LIBRARIES}) - - mark_as_advanced(GLIB_LIBRARIES GLIBCONFIG_INCLUDE_DIR GLIB_INCLUDE_DIR) + list(APPEND THIRD_PARTY_LIBS unofficial::glib::glib) endif () - + if (HB_HAVE_ICU) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 98e6b15af8d7eb..8e82f9d6e65800 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO harfbuzz/harfbuzz - REF 2.5.3 - SHA512 d541463b3647fc2c7ddaa29aedcea1c3bde5e26e0d529384d66d630af3aaf2a4befb3c4d47c93833f099339a0f951fb132011a02c57fc00ba543bd1b17026ffa + REF 2.6.6 + SHA512 3ddf3e6eccf28ca1441544f0b67e243c6a85a32122bfc0f8092b3cc465b20a25aa3cb72404070d2627b9e204f86412c3bfb9aaca272c5492d8448facc1971a7d HEAD_REF master PATCHES 0001-fix-cmake-export.patch @@ -26,44 +24,17 @@ if("${_contents}" MATCHES "find_library\\(GLIB_LIBRARIES") message(FATAL_ERROR "Harfbuzz's cmake must not directly find_library() glib.") endif() -SET(HB_HAVE_ICU "OFF") -if("icu" IN_LIST FEATURES) - SET(HB_HAVE_ICU "ON") -endif() - -SET(HB_HAVE_GRAPHITE2 "OFF") -if("graphite2" IN_LIST FEATURES) - SET(HB_HAVE_GRAPHITE2 "ON") -endif() - -## Unicode callbacks - -# Builtin (UCDN) -set(BUILTIN_UCDN OFF) -if("ucdn" IN_LIST FEATURES) - set(BUILTIN_UCDN ON) -endif() - -# Glib -set(HAVE_GLIB OFF) -if("glib" IN_LIST FEATURES) - set(HAVE_GLIB ON) -endif() - -# At least one Unicode callback must be specified, or harfbuzz compilation fails -if(NOT (BUILTIN_UCDN OR HAVE_GLIB)) - message(FATAL_ERROR "Error: At least one Unicode callback must be specified (ucdn, glib).") -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + icu HB_HAVE_ICU + graphite2 HB_HAVE_GRAPHITE2 + glib HB_HAVE_GLIB +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DHB_HAVE_FREETYPE=ON - -DHB_BUILTIN_UCDN=${BUILTIN_UCDN} - -DHB_HAVE_ICU=${HB_HAVE_ICU} - -DHB_HAVE_GLIB=${HAVE_GLIB} - -DHB_HAVE_GRAPHITE2=${HB_HAVE_GRAPHITE2} -DHB_BUILD_TESTS=OFF OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON @@ -74,7 +45,7 @@ vcpkg_fixup_cmake_targets() vcpkg_copy_pdbs() -if (HAVE_GLIB) +if ("glib" IN_LIST FEATURES) # Propagate dependency on glib downstream file(READ "${CURRENT_PACKAGES_DIR}/share/harfbuzz/harfbuzzConfig.cmake" _contents) file(WRITE "${CURRENT_PACKAGES_DIR}/share/harfbuzz/harfbuzzConfig.cmake" " @@ -86,6 +57,4 @@ ${_contents} endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz RENAME copyright) - -vcpkg_test_cmake(PACKAGE_NAME harfbuzz) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index 15819912629587..a9a4865ee9a720 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -1,5 +1,5 @@ Source: hdf5 -Version: 1.10.5-12 +Version: 1.12.0 Homepage: https://www.hdfgroup.org/downloads/hdf5/ Description: HDF5 is a data model, library, and file format for storing and managing data Default-Features: szip, zlib diff --git a/ports/hdf5/export-private.patch b/ports/hdf5/export-private.patch deleted file mode 100644 index 9dd877846ab30b..00000000000000 --- a/ports/hdf5/export-private.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/hdf5-1.10.5/hl/src/H5LDprivate.h b/hdf5-1.10.5/hl/src/H5LDprivate.h -index b52928b53..5f02ea781 100644 ---- a/hdf5-1.10.5/hl/src/H5LDprivate.h -+++ b/hdf5-1.10.5/hl/src/H5LDprivate.h -@@ -40,8 +40,8 @@ typedef struct H5LD_memb_t { - * #2: these two routines are too specific to be made as public routines - * Decide to do #3 at this point of time after some discussion. - */ --void H5LD_clean_vector(H5LD_memb_t *listv[]); --int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid); -+H5_HLDLL void H5LD_clean_vector(H5LD_memb_t *listv[]); -+H5_HLDLL int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid); - - #endif /* end _H5LDprivate_H */ - diff --git a/ports/hdf5/fix-generate.patch b/ports/hdf5/fix-generate.patch deleted file mode 100644 index 9696f6a0d3b9dd..00000000000000 --- a/ports/hdf5/fix-generate.patch +++ /dev/null @@ -1,1749 +0,0 @@ -diff --git a/hdf5-1.10.5/CMakeFilters.cmake b/hdf5-1.10.5/CMakeFilters.cmake -index 5a89564..3b636b9 100644 ---- a/hdf5-1.10.5/CMakeFilters.cmake -+++ b/hdf5-1.10.5/CMakeFilters.cmake -@@ -51,8 +51,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) - if (NOT ZLIB_USE_EXTERNAL) - find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) - if (NOT ZLIB_FOUND) -- find_package (ZLIB) # Legacy find -+ find_package (ZLIB REQUIRED) # Legacy find - if (ZLIB_FOUND) -+ set (ZLIB_LIBRARIES ZLIB::ZLIB) - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) - endif () -@@ -86,9 +87,10 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) - set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - endif () - if (BUILD_SHARED_LIBS) -- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) -- endif () -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) -+ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) -+ else () -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) -+ endif() - INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - message (STATUS "Filter ZLIB is ON") - endif () -@@ -100,7 +102,17 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) - if (HDF5_ENABLE_SZIP_SUPPORT) - option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) - if (NOT SZIP_USE_EXTERNAL) -- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) -+ find_package (szip CONFIG REQUIRED) -+ set(SZIP_FOUND ${szip_FOUND}) -+ if (TARGET szip-shared) -+ set(SZIP_LIBRARIES szip-shared) -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) -+ elseif (TARGET szip-static) -+ set(SZIP_LIBRARIES szip-static) -+ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) -+ else() -+ message(FATAL_ERROR "Could not found szip target!") -+ endif() - if (NOT SZIP_FOUND) - find_package (SZIP) # Legacy find - if (SZIP_FOUND) -@@ -128,8 +140,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) - endif () - if (BUILD_SHARED_LIBS) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) -- endif () -+ else () - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) -+ endif() - INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) - message (STATUS "Filter SZIP is ON") - if (H5_HAVE_FILTER_SZIP) -diff --git a/hdf5-1.10.5/CMakeLists.txt b/hdf5-1.10.5/CMakeLists.txt -index 8e93231..a1fed03 100644 ---- a/hdf5-1.10.5/CMakeLists.txt -+++ b/hdf5-1.10.5/CMakeLists.txt -@@ -424,10 +424,12 @@ endif () - #----------------------------------------------------------------------------- - option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) - set (H5_ENABLE_SHARED_LIB NO) -+set (H5_ENABLE_STATIC_LIB NO) - if (BUILD_SHARED_LIBS) - set (H5_ENABLE_SHARED_LIB YES) --endif () -+else() - set (H5_ENABLE_STATIC_LIB YES) -+endif() - set (CMAKE_POSITION_INDEPENDENT_CODE ON) - - #----------------------------------------------------------------------------- -@@ -725,14 +727,16 @@ add_subdirectory (src) - - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) -+ if (NOT BUILD_SHARED_LIBS) - add_dependencies (${HDF5_LIB_TARGET} ZLIB) -- if (BUILD_SHARED_LIBS) -+ else() - add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) - endif () - endif () - if (SZIP_FOUND AND SZIP_USE_EXTERNAL) -+ if (NOT BUILD_SHARED_LIBS) - add_dependencies (${HDF5_LIB_TARGET} SZIP) -- if (BUILD_SHARED_LIBS) -+ else() - add_dependencies (${HDF5_LIBSH_TARGET} SZIP) - endif () - endif () -diff --git a/hdf5-1.10.5/c++/src/CMakeLists.txt b/hdf5-1.10.5/c++/src/CMakeLists.txt -index 945b352..8741e61 100644 ---- a/hdf5-1.10.5/c++/src/CMakeLists.txt -+++ b/hdf5-1.10.5/c++/src/CMakeLists.txt -@@ -84,6 +84,7 @@ set (CPP_HDRS - ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) - target_include_directories(${HDF5_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -99,7 +100,7 @@ H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) - set (install_targets ${HDF5_CPP_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) - target_include_directories(${HDF5_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -135,9 +136,10 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -@@ -163,8 +165,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") - - set (_PKG_CONFIG_LIBS_PRIVATE) - -+if (NOT BUILD_SHARED_LIBS) - set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}") --if (BUILD_SHARED_LIBS) -+else() - set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}") - endif () - -diff --git a/hdf5-1.10.5/config/cmake_ext_mod/HDFLibMacros.cmake b/hdf5-1.10.5/config/cmake_ext_mod/HDFLibMacros.cmake -index 2eda66c..e143672 100644 ---- a/hdf5-1.10.5/config/cmake_ext_mod/HDFLibMacros.cmake -+++ b/hdf5-1.10.5/config/cmake_ext_mod/HDFLibMacros.cmake -@@ -73,12 +73,13 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) - - ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) - # Create imported target jpeg-static -+ if (NOT BUILD_SHARED_LIBS) - add_library(jpeg-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") - add_dependencies (jpeg-static JPEG) - set (JPEG_STATIC_LIBRARY "jpeg-static") - set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) -- if (BUILD_SHARED_LIBS) -+ else() - # Create imported target jpeg-shared - add_library(jpeg-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") -@@ -169,12 +170,13 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) - - ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) - # Create imported target szip-static -+ if (NOT BUILD_SHARED_LIBS) - add_library(szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") - add_dependencies (szip-static SZIP) - set (SZIP_STATIC_LIBRARY "szip-static") - set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) -- if (BUILD_SHARED_LIBS) -+ else() - # Create imported target szip-shared - add_library(szip-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") -@@ -267,12 +269,13 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) - endif () - ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) - # Create imported target zlib-static -+ if (NOT BUILD_SHARED_LIBS) - add_library(zlib-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") - add_dependencies (zlib-static ZLIB) - set (ZLIB_STATIC_LIBRARY "zlib-static") - set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) -- if (BUILD_SHARED_LIBS) -+ else() - # Create imported target zlib-shared - add_library(zlib-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") -diff --git a/hdf5-1.10.5/config/cmake_ext_mod/HDFMacros.cmake b/hdf5-1.10.5/config/cmake_ext_mod/HDFMacros.cmake -index 2f4ce52..277a373 100644 ---- a/hdf5-1.10.5/config/cmake_ext_mod/HDFMacros.cmake -+++ b/hdf5-1.10.5/config/cmake_ext_mod/HDFMacros.cmake -@@ -295,7 +295,7 @@ macro (HDF_README_PROPERTIES target_fortran) - endif () - - if (BUILD_SHARED_LIBS) -- set (LIB_TYPE "Static and Shared") -+ set (LIB_TYPE "Shared") - else () - set (LIB_TYPE "Static") - endif () -diff --git a/hdf5-1.10.5/examples/CMakeLists.txt b/hdf5-1.10.5/examples/CMakeLists.txt -index 2239d64..d853cdb 100644 ---- a/hdf5-1.10.5/examples/CMakeLists.txt -+++ b/hdf5-1.10.5/examples/CMakeLists.txt -@@ -40,12 +40,13 @@ set (examples - ) - - foreach (example ${examples}) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories(${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${example} STATIC) - target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET}) - set_target_properties (${example} PROPERTIES FOLDER examples) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories(${example}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${example}-shared SHARED) -@@ -55,12 +56,13 @@ foreach (example ${examples}) - endforeach () - - if (H5_HAVE_PARALLEL) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - target_include_directories(ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (ph5example STATIC) - target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) - set_target_properties (ph5example PROPERTIES FOLDER examples) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - target_include_directories(ph5example-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (ph5example-shared SHARED) -diff --git a/hdf5-1.10.5/examples/CMakeTests.cmake b/hdf5-1.10.5/examples/CMakeTests.cmake -index cb47c78..dc635cd 100644 ---- a/hdf5-1.10.5/examples/CMakeTests.cmake -+++ b/hdf5-1.10.5/examples/CMakeTests.cmake -@@ -15,13 +15,15 @@ - ### T E S T I N G ### - ############################################################################## - ############################################################################## -+ if (NOT BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) -- if (BUILD_SHARED_LIBS) -+ else() - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared") - file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w) - endif () - - # Remove any output file left over from previous test run -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME EXAMPLES-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -97,7 +99,7 @@ - set (last_test "EXAMPLES-${example}") - endforeach () - -- if (BUILD_SHARED_LIBS) -+ else() - # Remove any output file left over from previous test run - add_test ( - NAME EXAMPLES-shared-clear-objects -@@ -180,6 +182,7 @@ - - ### Windows pops up a modal permission dialog on this test - if (H5_HAVE_PARALLEL AND NOT WIN32) -+ if (NOT BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - else () -@@ -198,7 +201,7 @@ - set_tests_properties (MPI_TEST_EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "MPI_TEST_EXAMPLES-ph5example") -- if (BUILD_SHARED_LIBS) -+ else() - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME MPI_TEST_EXAMPLES-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - else () -diff --git a/hdf5-1.10.5/fortran/examples/CMakeLists.txt b/hdf5-1.10.5/fortran/examples/CMakeLists.txt -index 0c570c6..4941021 100644 ---- a/hdf5-1.10.5/fortran/examples/CMakeLists.txt -+++ b/hdf5-1.10.5/fortran/examples/CMakeLists.txt -@@ -34,6 +34,7 @@ set (F2003_examples - ) - - foreach (example ${examples}) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_include_directories (f90_ex_${example} - PRIVATE -@@ -61,7 +62,7 @@ foreach (example ${examples}) - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_include_directories (f90_ex_${example}-shared - PRIVATE -@@ -93,6 +94,7 @@ foreach (example ${examples}) - endforeach () - - foreach (example ${F2003_examples}) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_include_directories (f03_ex_${example} - PRIVATE -@@ -120,7 +122,7 @@ foreach (example ${F2003_examples}) - FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_include_directories (f03_ex_${example}-shared - PRIVATE -@@ -152,6 +154,7 @@ foreach (example ${F2003_examples}) - endforeach () - - if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - target_include_directories (f90_ex_ph5example - PRIVATE -@@ -180,7 +183,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - target_include_directories (f90_ex_ph5example-shared - PRIVATE -diff --git a/hdf5-1.10.5/fortran/examples/CMakeTests.cmake b/hdf5-1.10.5/fortran/examples/CMakeTests.cmake -index face086..53ee619 100644 ---- a/hdf5-1.10.5/fortran/examples/CMakeTests.cmake -+++ b/hdf5-1.10.5/fortran/examples/CMakeTests.cmake -@@ -17,6 +17,7 @@ - ############################################################################## - - # Remove any output file left over from previous test run -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME f90_ex-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -41,7 +42,7 @@ - set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "f90_ex-clear-objects") -- if (BUILD_SHARED_LIBS) -+ else() - add_test ( - NAME f90_ex-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -69,6 +70,7 @@ - endif () - - foreach (example ${examples}) -+ if (NOT BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f90_ex_${example} COMMAND $) - else () -@@ -87,7 +89,7 @@ foreach (example ${examples}) - set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "f90_ex_${example}") -- if (BUILD_SHARED_LIBS) -+ else() - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f90_ex-shared_${example} COMMAND $) - else () -@@ -110,6 +112,7 @@ foreach (example ${examples}) - endforeach () - - foreach (example ${F2003_examples}) -+ if (NOT BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f03_ex_${example} COMMAND $) - else () -@@ -128,7 +131,7 @@ foreach (example ${F2003_examples}) - set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "f03_ex_${example}") -- if (BUILD_SHARED_LIBS) -+ else() - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f03_ex-shared_${example} COMMAND $) - else () -@@ -151,8 +154,9 @@ foreach (example ${F2003_examples}) - endforeach () - - if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -+ if (NOT BUILD_SHARED_LIBS) - add_test (NAME MPI_TEST_f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) -- if (BUILD_SHARED_LIBS) -+ else() - add_test (NAME MPI_TEST_f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - endif () - endif () -diff --git a/hdf5-1.10.5/fortran/src/CMakeLists.txt b/hdf5-1.10.5/fortran/src/CMakeLists.txt -index f71e820..873f36d 100644 ---- a/hdf5-1.10.5/fortran/src/CMakeLists.txt -+++ b/hdf5-1.10.5/fortran/src/CMakeLists.txt -@@ -68,16 +68,17 @@ set_target_properties (H5_buildiface PROPERTIES - if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) --endif () -+else () - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) -- -+endif() - #----------------------------------------------------------------------------- - add_executable (H5match_types - ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h - ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c - ) - target_include_directories(H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -+if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 -@@ -87,7 +88,7 @@ add_custom_command ( - ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) --if (BUILD_SHARED_LIBS) -+else() - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 -@@ -130,7 +131,7 @@ set (f90CStub_C_SHHDRS - # generated files - ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h - ) -- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) - target_include_directories(${HDF5_F90_C_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -146,7 +147,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES - ) - set (install_targets ${HDF5_F90_C_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) - target_include_directories(${HDF5_F90_C_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -174,6 +175,7 @@ set (f90_F_GEN_SOURCES - ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 - ) -+if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 - COMMAND $ -@@ -186,7 +188,7 @@ add_custom_target (H5gen ALL - ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) - --if (BUILD_SHARED_LIBS) -+else() - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - COMMAND $ -@@ -219,7 +221,7 @@ set (f90_F_BASE_SOURCES - ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.F90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 - ) -- -+if (NOT BUILD_SHARED_LIBS) - set (f90_F_SOURCES - # generated file - ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 -@@ -232,7 +234,7 @@ set (f90_F_SOURCES - # normal distribution - ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 - ) --if (BUILD_SHARED_LIBS) -+else() - set (f90_F_SOURCES_SHARED - # generated file - ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 -@@ -250,6 +252,7 @@ endif () - #----------------------------------------------------------------------------- - # Add Main fortran library - #----------------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES}) - target_include_directories (${HDF5_F90_LIB_TARGET} - PRIVATE -@@ -288,7 +291,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF - set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) - add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) - target_include_directories (${HDF5_F90_LIBSH_TARGET} - PRIVATE -@@ -350,7 +353,7 @@ install ( - COMPONENT - fortheaders - ) -- -+if (NOT BUILD_SHARED_LIBS) - set (mod_files - ${MOD_BUILD_DIR}/h5fortran_types.mod - ${MOD_BUILD_DIR}/hdf5.mod -@@ -381,7 +384,7 @@ install ( - fortheaders - ) - --if (BUILD_SHARED_LIBS) -+else() - set (modsh_files - ${MODSH_BUILD_DIR}/h5fortran_types.mod - ${MODSH_BUILD_DIR}/hdf5.mod -@@ -420,10 +423,11 @@ if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -diff --git a/hdf5-1.10.5/fortran/test/CMakeLists.txt b/hdf5-1.10.5/fortran/test/CMakeLists.txt -index b862fcd..6f557b7 100644 ---- a/hdf5-1.10.5/fortran/test/CMakeLists.txt -+++ b/hdf5-1.10.5/fortran/test/CMakeLists.txt -@@ -34,13 +34,14 @@ set_target_properties (H5_test_buildiface PROPERTIES - if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) --endif () -+else () - file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static") - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) -- -+endif() - #----------------------------------------------------------------------------- - # Add Test Lib - #----------------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) - set_source_files_properties (t.c PROPERTIES LANGUAGE C) - target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} -@@ -57,7 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES - FOLDER libraries/test/fortran - LINKER_LANGUAGE C - ) --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) - target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -77,7 +78,7 @@ if (BUILD_SHARED_LIBS) - LINKER_LANGUAGE C - ) - endif () -- -+if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 - COMMAND $ -@@ -90,7 +91,7 @@ add_custom_target (H5testgen ALL - ) - set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) - --if (BUILD_SHARED_LIBS) -+else() - add_custom_command ( - OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 - COMMAND $ -@@ -103,7 +104,7 @@ if (BUILD_SHARED_LIBS) - ) - set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) - endif () -- -+if (NOT BUILD_SHARED_LIBS) - set (HDF5_F90_TF_SOURCES - # generated files - ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 -@@ -112,7 +113,7 @@ set (HDF5_F90_TF_SOURCES - tf.F90 - ) - set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) --if (BUILD_SHARED_LIBS) -+else() - set (HDF5_F90_TF_SOURCES_SHARED - # generated file - ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 -@@ -122,7 +123,7 @@ if (BUILD_SHARED_LIBS) - ) - set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) - endif () -- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES}) - target_include_directories (${HDF5_F90_TEST_LIB_TARGET} - PRIVATE -@@ -156,7 +157,7 @@ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES - H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0) - add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED}) - target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET} - PRIVATE -@@ -201,6 +202,7 @@ endif () - #----------------------------------------------------------------------------- - - #-- Adding test for testhdf5_fortran -+if (NOT BUILD_SHARED_LIBS) - add_executable (testhdf5_fortran - fortranlib_test.F90 - tH5A.F90 -@@ -246,7 +248,7 @@ set_target_properties (testhdf5_fortran PROPERTIES - ) - add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (testhdf5_fortran-shared - fortranlib_test.F90 - tH5A.F90 -@@ -294,6 +296,7 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for testhdf5_fortran_1_8 -+if (NOT BUILD_SHARED_LIBS) - add_executable (testhdf5_fortran_1_8 - fortranlib_test_1_8.F90 - tH5O.F90 -@@ -330,7 +333,7 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES - ) - add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (testhdf5_fortran_1_8-shared - fortranlib_test_1_8.F90 - tH5O.F90 -@@ -369,6 +372,7 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for fortranlib_test_F03 -+if (NOT BUILD_SHARED_LIBS) - add_executable (fortranlib_test_F03 - fortranlib_test_F03.F90 - tH5E_F03.F90 -@@ -407,7 +411,7 @@ set_target_properties (fortranlib_test_F03 PROPERTIES - ) - add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (fortranlib_test_F03-shared - fortranlib_test_F03.F90 - tH5E_F03.F90 -@@ -448,6 +452,7 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for fflush1 -+if (NOT BUILD_SHARED_LIBS) - add_executable (fflush1 fflush1.F90) - target_include_directories (fflush1 - PRIVATE -@@ -477,7 +482,7 @@ set_target_properties (fflush1 PROPERTIES - ) - add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (fflush1-shared fflush1.F90) - target_include_directories (fflush1-shared - PRIVATE -@@ -509,6 +514,7 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for fflush2 -+if (NOT BUILD_SHARED_LIBS) - add_executable (fflush2 fflush2.F90) - target_include_directories (fflush2 - PRIVATE -@@ -538,7 +544,7 @@ set_target_properties (fflush2 PROPERTIES - ) - add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (fflush2-shared fflush2.F90) - target_include_directories (fflush2-shared - PRIVATE -diff --git a/hdf5-1.10.5/fortran/test/CMakeTests.cmake b/hdf5-1.10.5/fortran/test/CMakeTests.cmake -index 2824ef7..482345a 100644 ---- a/hdf5-1.10.5/fortran/test/CMakeTests.cmake -+++ b/hdf5-1.10.5/fortran/test/CMakeTests.cmake -@@ -20,6 +20,7 @@ if (BUILD_SHARED_LIBS) - endif () - - # Remove any output file left over from previous test run -+if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME FORTRAN_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -130,7 +131,7 @@ set_tests_properties (FORTRAN_fflush1 PROPERTIES DEPENDS FORTRAN_testhdf5-clear- - add_test (NAME FORTRAN_fflush2 COMMAND $) - set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) - --if (BUILD_SHARED_LIBS) -+else() - add_test ( - NAME FORTRAN_testhdf5-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -diff --git a/hdf5-1.10.5/hl/c++/src/CMakeLists.txt b/hdf5-1.10.5/hl/c++/src/CMakeLists.txt -index 77419c6..1556374 100644 ---- a/hdf5-1.10.5/hl/c++/src/CMakeLists.txt -+++ b/hdf5-1.10.5/hl/c++/src/CMakeLists.txt -@@ -7,7 +7,7 @@ project (HDF5_HL_CPP_SRC CXX) - - set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) - set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) - target_include_directories(${HDF5_HL_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -20,7 +20,7 @@ H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) - set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) - target_include_directories(${HDF5_HL_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -55,9 +55,10 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -@@ -83,8 +84,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") - - set (_PKG_CONFIG_LIBS_PRIVATE) - -+if (NOT BUILD_SHARED_LIBS) - set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") --if (BUILD_SHARED_LIBS) -+else() - set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") - endif () - -diff --git a/hdf5-1.10.5/hl/fortran/src/CMakeLists.txt b/hdf5-1.10.5/hl/fortran/src/CMakeLists.txt -index 7ec3b63..9f9693f 100644 ---- a/hdf5-1.10.5/hl/fortran/src/CMakeLists.txt -+++ b/hdf5-1.10.5/hl/fortran/src/CMakeLists.txt -@@ -36,10 +36,10 @@ set_target_properties (H5HL_buildiface PROPERTIES - if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) --endif () -+else () - file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static") - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) -- -+endif() - #----------------------------------------------------------------------------- - # hl_f90CStub lib - #----------------------------------------------------------------------------- -@@ -53,7 +53,7 @@ set (HDF5_HL_F90_C_SOURCES - set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) - - set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) -- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -69,7 +69,7 @@ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES - ) - set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -98,7 +98,7 @@ set (HDF5_HL_F90_F_BASE_SOURCES - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.F90 - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90 - ) -- -+if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 - COMMAND $ -@@ -114,7 +114,7 @@ set_source_files_properties ( - ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 - PROPERTIES GENERATED TRUE - ) --if (BUILD_SHARED_LIBS) -+else() - add_custom_command ( - OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 - COMMAND $ -@@ -131,7 +131,7 @@ if (BUILD_SHARED_LIBS) - PROPERTIES GENERATED TRUE - ) - endif () -- -+if (NOT BUILD_SHARED_LIBS) - set (HDF5_HL_F90_F_SOURCES - ${HDF5_HL_F90_F_BASE_SOURCES} - -@@ -141,7 +141,7 @@ set (HDF5_HL_F90_F_SOURCES - ) - set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) - --if (BUILD_SHARED_LIBS) -+else() - set (HDF5_HL_F90_F_SOURCES_SHARED - ${HDF5_HL_F90_F_BASE_SOURCES} - -@@ -152,6 +152,7 @@ if (BUILD_SHARED_LIBS) - set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) - endif () - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) - target_include_directories (${HDF5_HL_F90_LIB_TARGET} - PRIVATE -@@ -188,7 +189,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF - set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) - add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED}) - target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} - PRIVATE -@@ -239,7 +240,7 @@ endif () - # Add file(s) to CMake Install - #----------------------------------------------------------------------------- - -- -+if (NOT BUILD_SHARED_LIBS) - set (mod_files - ${MOD_BUILD_DIR}/h5ds.mod - ${MOD_BUILD_DIR}/h5tb.mod -@@ -258,7 +259,7 @@ install ( - fortheaders - ) - --if (BUILD_SHARED_LIBS) -+else() - set (modsh_files - ${MODSH_BUILD_DIR}/h5ds.mod - ${MODSH_BUILD_DIR}/h5tb.mod -@@ -284,10 +285,11 @@ if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -diff --git a/hdf5-1.10.5/hl/fortran/test/CMakeLists.txt b/hdf5-1.10.5/hl/fortran/test/CMakeLists.txt -index 923989d..74e7ae2 100644 ---- a/hdf5-1.10.5/hl/fortran/test/CMakeLists.txt -+++ b/hdf5-1.10.5/hl/fortran/test/CMakeLists.txt -@@ -12,6 +12,7 @@ set (H5_TESTS - ) - - macro (ADD_H5_FORTRAN_EXE file) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (hl_f90_${file} ${file}.F90) - target_include_directories (hl_f90_${file} - PRIVATE -@@ -39,7 +40,7 @@ macro (ADD_H5_FORTRAN_EXE file) - FOLDER test/hl/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (hl_f90_${file}-shared ${file}.F90) - target_include_directories (hl_f90_${file}-shared - PRIVATE -diff --git a/hdf5-1.10.5/hl/fortran/test/CMakeTests.cmake b/hdf5-1.10.5/hl/fortran/test/CMakeTests.cmake -index 04a49dc..9b4436c 100644 ---- a/hdf5-1.10.5/hl/fortran/test/CMakeTests.cmake -+++ b/hdf5-1.10.5/hl/fortran/test/CMakeTests.cmake -@@ -17,6 +17,7 @@ - ############################################################################## - - macro (ADD_H5_FORTRAN_TEST file) -+ if (NOT BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_${file} COMMAND $) - else () -@@ -32,7 +33,7 @@ macro (ADD_H5_FORTRAN_TEST file) - ) - endif () - set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -- if (BUILD_SHARED_LIBS) -+ else() - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND $) - else () -@@ -52,6 +53,7 @@ macro (ADD_H5_FORTRAN_TEST file) - endmacro () - - # Remove any output file left over from previous test run -+if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME HL_FORTRAN_test-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -67,7 +69,7 @@ add_test ( - tstds.h5 - ) - --if (BUILD_SHARED_LIBS) -+else() - add_test ( - NAME HL_FORTRAN_test-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -diff --git a/hdf5-1.10.5/hl/src/CMakeLists.txt b/hdf5-1.10.5/hl/src/CMakeLists.txt -index bf0f6ff..d4ad35e 100644 ---- a/hdf5-1.10.5/hl/src/CMakeLists.txt -+++ b/hdf5-1.10.5/hl/src/CMakeLists.txt -@@ -31,7 +31,7 @@ set (HL_HEADERS - set (HL_PRIVATE_HEADERS - ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h - ) -- -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) - target_include_directories(${HDF5_HL_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -44,7 +44,7 @@ set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) - set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") - set (install_targets ${HDF5_HL_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) - target_include_directories(${HDF5_HL_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -79,9 +79,10 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -@@ -107,8 +108,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") - - set (_PKG_CONFIG_LIBS_PRIVATE) - -+if (NOT BUILD_SHARED_LIBS) - set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_LIB_CORENAME}") --if (BUILD_SHARED_LIBS) -+else() - set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_LIB_CORENAME}") - endif () - -diff --git a/hdf5-1.10.5/src/CMakeLists.txt b/hdf5-1.10.5/src/CMakeLists.txt -index 01434ba..6445c22 100644 ---- a/hdf5-1.10.5/src/CMakeLists.txt -+++ b/hdf5-1.10.5/src/CMakeLists.txt -@@ -1060,6 +1060,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) - #----------------------------------------------------------------------------- - # Add H5Tinit source to build - generated by H5detect/CMake at configure time - #----------------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) - add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) - -@@ -1088,8 +1089,7 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) - add_dependencies (${HDF5_LIB_TARGET} gen_${HDF5_LIB_TARGET}) - - set (install_targets ${HDF5_LIB_TARGET}) -- --if (BUILD_SHARED_LIBS) -+else() - set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) - add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2) - -@@ -1144,9 +1144,10 @@ endif () - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -@@ -1174,8 +1175,9 @@ foreach (libs ${LINK_LIBS} ${LINK_COMP_LIBS}) - set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}") - endforeach () - -+if (NOT BUILD_SHARED_LIBS) - set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}") --if (BUILD_SHARED_LIBS) -+else() - set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_LIB_CORENAME}") - endif () - -diff --git a/hdf5-1.10.5/test/CMakeLists.txt b/hdf5-1.10.5/test/CMakeLists.txt -index fa303ed..784a86e 100644 ---- a/hdf5-1.10.5/test/CMakeLists.txt -+++ b/hdf5-1.10.5/test/CMakeLists.txt -@@ -23,6 +23,7 @@ set (TEST_LIB_HEADERS - ${HDF5_TEST_SOURCE_DIR}/swmr_common.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) - target_include_directories(${HDF5_TEST_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -38,7 +39,7 @@ if (MINGW) - endif () - H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) - target_include_directories(${HDF5_TEST_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -240,12 +241,13 @@ set (H5_TESTS - ) - - macro (ADD_H5_EXE file) -+ if (NOT BUILD_SHARED_LIBS) - add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - target_include_directories(${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${file} STATIC) - target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) - set_target_properties (${file} PROPERTIES FOLDER test) -- if (BUILD_SHARED_LIBS) -+ else() - add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - target_include_directories(${file}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${file}-shared SHARED) -@@ -272,12 +274,13 @@ endforeach () - ############################################################################## - ######### Also special handling of link libs ############# - #-- Adding test for direct_chunk -+if (NOT BUILD_SHARED_LIBS) - add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) - target_include_directories(direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (direct_chunk STATIC) - target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) - set_target_properties (direct_chunk PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (direct_chunk-shared ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) - target_include_directories(direct_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (direct_chunk-shared SHARED) -@@ -288,12 +291,13 @@ endif () - - ######### Special handling for multiple sources ############# - #-- Adding test for testhdf5 -+if (NOT BUILD_SHARED_LIBS) - add_executable (testhdf5 ${testhdf5_SOURCES}) - target_include_directories(testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (testhdf5 STATIC) - target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET}) - set_target_properties (testhdf5 PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (testhdf5-shared ${testhdf5_SOURCES}) - target_include_directories(testhdf5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (testhdf5-shared SHARED) -@@ -302,12 +306,13 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for cache_image -+if (NOT BUILD_SHARED_LIBS) - add_executable (cache_image ${cache_image_SOURCES}) - target_include_directories(cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (cache_image STATIC) - target_link_libraries (cache_image PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (cache_image PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (cache_image-shared ${cache_image_SOURCES}) - target_include_directories(cache_image-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (cache_image-shared SHARED) -@@ -316,12 +321,13 @@ if (BUILD_SHARED_LIBS) - endif () - - #-- Adding test for ttsafe -+if (NOT BUILD_SHARED_LIBS) - add_executable (ttsafe ${ttsafe_SOURCES}) - target_include_directories(ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (ttsafe STATIC) - target_link_libraries (ttsafe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (ttsafe PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (ttsafe-shared ${ttsafe_SOURCES}) - target_include_directories(ttsafe-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (ttsafe-shared SHARED) -@@ -403,8 +409,9 @@ target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_ - set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) - - #-- Set accum dependencies -+if (NOT BUILD_SHARED_LIBS) - set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) --if (BUILD_SHARED_LIBS) -+else() - set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) - endif () - -@@ -429,12 +436,13 @@ endif () - ### U S E C A S E S T E S T S - ############################################################################## - set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) -+if (NOT BUILD_SHARED_LIBS) - add_executable (use_append_chunk ${use_append_chunk_SOURCES}) - target_include_directories(use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_chunk STATIC) - target_link_libraries (use_append_chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (use_append_chunk PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) - target_include_directories(use_append_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_chunk-shared SHARED) -@@ -443,12 +451,13 @@ if (BUILD_SHARED_LIBS) - endif () - - set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) -+if (NOT BUILD_SHARED_LIBS) - add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) - target_include_directories(use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_mchunks STATIC) - target_link_libraries (use_append_mchunks PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (use_append_mchunks PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) - target_include_directories(use_append_mchunks-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED) -@@ -457,12 +466,13 @@ if (BUILD_SHARED_LIBS) - endif () - - set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) -+if (NOT BUILD_SHARED_LIBS) - add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) - target_include_directories(use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC) - target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) --if (BUILD_SHARED_LIBS) -+else() - add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) - target_include_directories(use_disable_mdc_flushes-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED) -diff --git a/hdf5-1.10.5/test/CMakeTests.cmake b/hdf5-1.10.5/test/CMakeTests.cmake -index a8dd647..2501ff4 100644 ---- a/hdf5-1.10.5/test/CMakeTests.cmake -+++ b/hdf5-1.10.5/test/CMakeTests.cmake -@@ -17,10 +17,11 @@ - ############################################################################## - - # make test dir -+if (NOT BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files") --if (BUILD_SHARED_LIBS) -+else() - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") -@@ -33,13 +34,14 @@ set (HDF5_TEST_FILES - tnullspace.h5 - ) - -+if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - TARGET accum_swmr_reader - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "$" "${PROJECT_BINARY_DIR}/H5TEST/accum_swmr_reader" - ) --if (BUILD_SHARED_LIBS) -+else() - add_custom_command ( - TARGET accum_swmr_reader - POST_BUILD -@@ -49,8 +51,9 @@ if (BUILD_SHARED_LIBS) - endif () - - foreach (h5_tfile ${HDF5_TEST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () -@@ -67,8 +70,9 @@ set (HDF5_REFERENCE_FILES - ) - - foreach (ref_file ${HDF5_REFERENCE_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () -@@ -128,9 +132,10 @@ set (HDF5_REFERENCE_PLIST_FILES - ) - - foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIB_files") - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIBSH_files") - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIBSH_files") - endif () -@@ -193,18 +198,21 @@ set (HDF5_REFERENCE_TEST_FILES - ) - - foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - -+if (NOT BUILD_SHARED_LIBS) - add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) --if (BUILD_SHARED_LIBS) -+else() - add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) - endif () - - # Remove any output file left over from previous test run -+if (NOT BUILD_SHARED_LIBS) - add_test (NAME H5TEST-clear-testhdf5-objects - COMMAND ${CMAKE_COMMAND} - -E remove -@@ -255,6 +263,7 @@ set_tests_properties (H5TEST-testhdf5-select PROPERTIES - ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) -+else() - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - if (BUILD_SHARED_LIBS) - add_test (NAME H5TEST-shared-clear-testhdf5-objects -@@ -528,6 +537,7 @@ set (test_CLEANFILES - ) - - # Remove any output file left over from previous test run -+if (NOT BUILD_SHARED_LIBS) - add_test (NAME H5TEST-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove -@@ -584,7 +594,7 @@ set_tests_properties (H5TEST-big PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) - set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) - set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) - --if (BUILD_SHARED_LIBS) -+else() - # Remove any output file left over from previous test run - add_test (NAME H5TEST-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -661,6 +671,7 @@ endif () - - if (TEST_CACHE_IMAGE) - #-- Adding test for cache_image -+if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME H5TEST-clear-cache_image-objects - COMMAND ${CMAKE_COMMAND} -@@ -678,7 +689,7 @@ set_tests_properties (H5TEST-cache_image PROPERTIES - ) - endif () - --if (BUILD_SHARED_LIBS) -+else() - #-- Adding test for cache - if (NOT CYGWIN AND NOT WIN32) - add_test (NAME H5TEST-shared-clear-cache-objects -@@ -845,6 +856,7 @@ set_tests_properties (H5TEST-del_many_dense_attrs PROPERTIES - ) - - #-- Adding test for err_compat -+if (NOT BUILD_SHARED_LIBS) - if (HDF5_ENABLE_DEPRECATED_SYMBOLS) - add_test (NAME H5TEST-clear-err_compat-objects - COMMAND ${CMAKE_COMMAND} -@@ -945,7 +957,7 @@ add_test (NAME H5TEST-testlibinfo - ${HDF5_TEST_BINARY_DIR}/H5TEST - ) - --if (BUILD_SHARED_LIBS) -+else() - #-- Adding test for err_compat - if (HDF5_ENABLE_DEPRECATED_SYMBOLS) - add_test (NAME H5TEST-shared-clear-err_compat-objects -@@ -1093,8 +1105,9 @@ if (ENABLE_EXTENDED_TESTS) - # add_test (NAME H5Test-swmr_check_compat_vfd COMMAND $) - - #-- Adding test for flushrefresh -+ if (NOT BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") -- if (BUILD_SHARED_LIBS) -+ else() - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/flushrefresh_test") - endif () - find_package (Perl) -diff --git a/hdf5-1.10.5/test/CMakeVFDTests.cmake b/hdf5-1.10.5/test/CMakeVFDTests.cmake -index 569f215..a445c1d 100644 ---- a/hdf5-1.10.5/test/CMakeVFDTests.cmake -+++ b/hdf5-1.10.5/test/CMakeVFDTests.cmake -@@ -31,10 +31,11 @@ if (DIRECT_VFD) - endif () - - foreach (vfdtest ${VFD_LIST}) -+ if (NOT BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files") -- if (BUILD_SHARED_LIBS) -+ else() - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files") -@@ -43,8 +44,9 @@ endforeach () - - foreach (vfdtest ${VFD_LIST}) - foreach (h5_tfile ${HDF5_TEST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_VFDTEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_VFDTEST_LIBSH_files") - endif () - endforeach () -@@ -52,8 +54,9 @@ endforeach () - - foreach (vfdtest ${VFD_LIST}) - foreach (ref_file ${HDF5_REFERENCE_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_VFDTEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_VFDTEST_LIBSH_files") - endif () - endforeach () -@@ -61,8 +64,9 @@ endforeach () - - foreach (vfdtest ${VFD_LIST}) - foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_VFDTEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_VFDTEST_LIBSH_files") - endif () - endforeach () -@@ -70,17 +74,19 @@ endforeach () - - foreach (vfdtest ${VFD_LIST}) - foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) -+ if (NOT BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIB_files") - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIB_files") -- if (BUILD_SHARED_LIBS) -+ else() - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIBSH_files") - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIBSH_files") - endif () - endforeach () - endforeach () - -+if (NOT BUILD_SHARED_LIBS) - add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list}) --if (BUILD_SHARED_LIBS) -+else() - add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list}) - endif () - -@@ -159,16 +165,18 @@ endif () - ) - endif () - else () -+ if (NOT BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" - ) - endif () - endif () - else () -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -191,7 +199,7 @@ endif () - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_test ( - NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -217,6 +225,7 @@ endif () - endif () - endif () - else () -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -239,7 +248,7 @@ endif () - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) -- if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache") -+ elseif (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache") - add_test ( - NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -267,6 +276,7 @@ endif () - endmacro () - - macro (DO_VFD_TEST vfdtest vfdname resultcode) -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME VFD-${vfdname}-${vfdtest}-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -289,7 +299,7 @@ endif () - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_test ( - NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -325,6 +335,7 @@ endif () - endif () - endif () - endforeach () -+ if (NOT BUILD_SHARED_LIBS) - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) - set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) -@@ -332,7 +343,7 @@ endif () - if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) - endif () -- if (BUILD_SHARED_LIBS) -+ else() - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) - set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) -@@ -342,6 +353,7 @@ endif () - endif () - endif () - if (HDF5_TEST_FHEAP_VFD) -+ if (NOT BUILD_SHARED_LIBS) - add_test ( - NAME VFD-${vfdname}-fheap-clear-objects - COMMAND ${CMAKE_COMMAND} -@@ -365,7 +377,7 @@ endif () - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) -- if (BUILD_SHARED_LIBS) -+ else() - add_test ( - NAME VFD-${vfdname}-fheap-shared-clear-objects - COMMAND ${CMAKE_COMMAND} -diff --git a/hdf5-1.10.5/tools/lib/CMakeLists.txt b/hdf5-1.10.5/tools/lib/CMakeLists.txt -index 1596ea7..ae5c2d2 100644 ---- a/hdf5-1.10.5/tools/lib/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/lib/CMakeLists.txt -@@ -32,6 +32,7 @@ set (H5_TOOLS_LIB_HDRS - ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) - target_include_directories(${HDF5_TOOLS_LIB_TARGET} - PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -48,7 +49,7 @@ H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) - set (install_targets ${HDF5_TOOLS_LIB_TARGET}) - --if (BUILD_SHARED_LIBS) -+else() - add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) - target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} - PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -81,9 +82,10 @@ endif () - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) -- -+ endif() -+ - install ( - TARGETS - ${install_targets} -diff --git a/hdf5-1.10.5/tools/src/h5copy/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5copy/CMakeLists.txt -index 10b3f3d..d801ffc 100644 ---- a/hdf5-1.10.5/tools/src/h5copy/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5copy/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_SRC_H5COPY C) - # -------------------------------------------------------------------- - # Add the h5copy and test executables - # -------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - target_include_directories(h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5copy STATIC) -@@ -13,7 +14,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy") - - set (H5_DEP_EXECUTABLES h5copy) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - target_include_directories(h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5copy-shared SHARED) -diff --git a/hdf5-1.10.5/tools/src/h5diff/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5diff/CMakeLists.txt -index 671e6b6..2ab5a3a 100644 ---- a/hdf5-1.10.5/tools/src/h5diff/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5diff/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_SRC_H5DIFF C) - # -------------------------------------------------------------------- - # Add the h5diff executables - # -------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5diff - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c -@@ -16,7 +17,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff") - - set (H5_DEP_EXECUTABLES h5diff) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5diff-shared - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c -diff --git a/hdf5-1.10.5/tools/src/h5dump/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5dump/CMakeLists.txt -index 25166c7..4038ecd 100644 ---- a/hdf5-1.10.5/tools/src/h5dump/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5dump/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_SRC_H5DUMP C) - # -------------------------------------------------------------------- - # Add the h5dump executables - # -------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5dump - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c -@@ -17,7 +18,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") - - set (H5_DEP_EXECUTABLES h5dump) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5dump-shared - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c -diff --git a/hdf5-1.10.5/tools/src/h5ls/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5ls/CMakeLists.txt -index 5b31b84..b9d7fc2 100644 ---- a/hdf5-1.10.5/tools/src/h5ls/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5ls/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_SRC_H5LS C) - #----------------------------------------------------------------------------- - # Add the h5ls executable - #----------------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - target_include_directories(h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5ls STATIC) -@@ -13,7 +14,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls") - - set (H5_DEP_EXECUTABLES h5ls) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - target_include_directories(h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5ls-shared SHARED) -diff --git a/hdf5-1.10.5/tools/src/h5repack/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5repack/CMakeLists.txt -index c0cd558..8106221 100644 ---- a/hdf5-1.10.5/tools/src/h5repack/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5repack/CMakeLists.txt -@@ -14,6 +14,7 @@ set (REPACK_COMMON_SOURCES - ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c - ) - -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - target_include_directories(h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5repack STATIC) -@@ -23,7 +24,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack") - - set (H5_DEP_EXECUTABLES h5repack) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - target_include_directories(h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5repack-shared SHARED) -diff --git a/hdf5-1.10.5/tools/src/h5stat/CMakeLists.txt b/hdf5-1.10.5/tools/src/h5stat/CMakeLists.txt -index 56c172c..f38b217 100644 ---- a/hdf5-1.10.5/tools/src/h5stat/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/src/h5stat/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_SRC_H5STAT C) - # -------------------------------------------------------------------- - # Add the h5stat executables - # -------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - target_include_directories(h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5stat STATIC) -@@ -13,7 +14,7 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat") - - set (H5_DEP_EXECUTABLES h5stat) - --if (BUILD_SHARED_LIBS) -+else() - add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - target_include_directories(h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5stat-shared SHARED) -diff --git a/hdf5-1.10.5/tools/test/h5copy/CMakeLists.txt b/hdf5-1.10.5/tools/test/h5copy/CMakeLists.txt -index a71a12a..26dc455 100644 ---- a/hdf5-1.10.5/tools/test/h5copy/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/test/h5copy/CMakeLists.txt -@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5COPY C) - # -------------------------------------------------------------------- - # Add the h5copy test executables - # -------------------------------------------------------------------- --if (HDF5_BUILD_GENERATORS) -+if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) - target_include_directories(h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5copygentest STATIC) -diff --git a/hdf5-1.10.5/tools/test/h5diff/CMakeLists.txt b/hdf5-1.10.5/tools/test/h5diff/CMakeLists.txt -index c0aac36..e4e8c4f 100644 ---- a/hdf5-1.10.5/tools/test/h5diff/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/test/h5diff/CMakeLists.txt -@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5DIFF C) - # -------------------------------------------------------------------- - # Add the h5diff and test executables - # -------------------------------------------------------------------- --if (HDF5_BUILD_GENERATORS) -+if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - target_include_directories(h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5diffgentest STATIC) -diff --git a/hdf5-1.10.5/tools/test/h5dump/CMakeLists.txt b/hdf5-1.10.5/tools/test/h5dump/CMakeLists.txt -index 51938ae..9ae9477 100644 ---- a/hdf5-1.10.5/tools/test/h5dump/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/test/h5dump/CMakeLists.txt -@@ -33,7 +33,7 @@ endif () - # -------------------------------------------------------------------- - # Add the h5dump test executable - # -------------------------------------------------------------------- --if (HDF5_BUILD_GENERATORS) -+if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - target_include_directories(h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5dumpgentest STATIC) -diff --git a/hdf5-1.10.5/tools/test/h5repack/CMakeLists.txt b/hdf5-1.10.5/tools/test/h5repack/CMakeLists.txt -index 890d5d2..3c25afe 100644 ---- a/hdf5-1.10.5/tools/test/h5repack/CMakeLists.txt -+++ b/hdf5-1.10.5/tools/test/h5repack/CMakeLists.txt -@@ -4,6 +4,7 @@ project (HDF5_TOOLS_TEST_H5REPACK C) - # -------------------------------------------------------------------- - # Add h5Repack test executables - # -------------------------------------------------------------------- -+if (NOT BUILD_SHARED_LIBS) - add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) - target_include_directories(testh5repack_detect_szip - PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -32,7 +33,7 @@ set_target_properties (h5repacktest PROPERTIES FOLDER tools) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- --if (BUILD_SHARED_LIBS) -+else() - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) diff --git a/ports/hdf5/hdf5_config.patch b/ports/hdf5/hdf5_config.patch index 2b44a5320ec5ab..553a02346abc6c 100644 --- a/ports/hdf5/hdf5_config.patch +++ b/ports/hdf5/hdf5_config.patch @@ -1,24 +1,31 @@ -diff --git a/hdf5-1.10.5/config/cmake/hdf5-config.cmake.in b/hdf5-1.10.5/config/cmake/hdf5-config.cmake.in -index 3bd9e1d..7f6699c 100644 ---- a/hdf5-1.10.5/config/cmake/hdf5-config.cmake.in -+++ b/hdf5-1.10.5/config/cmake/hdf5-config.cmake.in -@@ -108,11 +108,15 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) - # project which has already built hdf5 as a subproject - #----------------------------------------------------------------------------- - if (NOT TARGET "@HDF5_PACKAGE@") -- if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") -- include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) -+ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND NOT TARGET ZLIB::ZLIB) -+ find_package(ZLIB REQUIRED) - endif () -- if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") -- include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) -+ if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND NOT TARGET "szip") -+ if(${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) -+ include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) -+ else() -+ find_package(@SZIP_PACKAGE_NAME@ REQUIRED) -+ endif() - endif () - include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) - endif () +diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in +index b5a12a650..a8cbacb1c 100644 +--- a/config/cmake/hdf5-config.cmake.in ++++ b/config/cmake/hdf5-config.cmake.in +@@ -54,7 +54,10 @@ set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@") + #----------------------------------------------------------------------------- + # Dependencies + #----------------------------------------------------------------------------- ++include(CMakeFindDependencyMacro) ++ + if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL) ++ find_dependency(MPI) + set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_DIRS@") + set (${HDF5_PACKAGE_NAME}_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") + if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) +@@ -110,11 +113,11 @@ set (${HDF5_PACKAGE_NAME}_VERSION_MINOR @HDF5_VERSION_MINOR@) + # project which has already built hdf5 as a subproject + #----------------------------------------------------------------------------- + if (NOT TARGET "@HDF5_PACKAGE@") +- if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) +- include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) ++ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT) ++ find_dependency(ZLIB) + endif () +- if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) +- include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) ++ if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT) ++ find_dependency(szip) + endif () + include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + endif () diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index cf5270c1a70df9..d03fcc590efad7 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -1,20 +1,14 @@ vcpkg_fail_port_install(ON_TARGET "UWP") -vcpkg_download_distfile(ARCHIVE - URLS "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/CMake-hdf5-1.10.5.tar.gz" - FILENAME "CMake-hdf5-1.10.5.tar.gz" - SHA512 a25ea28d7a511f9184d97b5b8cd4c6d52dcdcad2bffd670e24a1c9a6f98b03108014a853553fa2b00d4be7523128b5fd6a4454545e3b17ff8c66fea16a09e962 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF hdf5 - PATCHES - hdf5_config.patch - fix-generate.patch # removes the build of static targets in shared builds - static-targets.patch # maps the internal static tagets to the shared targets if building as a dynamic library - export-private.patch # exports two additional functions in shared builds to make hl/tools/h5watch build in shared builds. + REPO HDFGroup/hdf5 + REF hdf5-1_12_0 + SHA512 d84df1ea72dc6fa038440a370e1b1ff523364474e7f214b967edc26d3191b2ef4fe1d9273c4a086a5945f1ad1ab6aa8dbcda495898e7967b2b73fd93dd5071e0 + HEAD_REF develop + PATCHES + hdf5_config.patch + szip.patch ) if ("parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES) @@ -42,11 +36,17 @@ if(FEATURES MATCHES "tools" AND VCPKG_CRT_LINKAGE STREQUAL "static") list(APPEND FEATURE_OPTIONS -DBUILD_STATIC_EXECS=ON) endif() +if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND FEATURE_OPTIONS + -DBUILD_STATIC_LIBS=OFF + -DONLY_SHARED_LIBS=ON) +endif() + find_library(SZIP_RELEASE NAMES libsz libszip szip sz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(SZIP_DEBUG NAMES libsz libszip szip sz libsz_D libszip_D szip_D sz_D szip_debug PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH}/hdf5-1.10.5 + SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE PREFER_NINJA OPTIONS @@ -55,8 +55,7 @@ vcpkg_configure_cmake( -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_INSTALL_DATA_DIR=share/hdf5/data -DHDF5_INSTALL_CMAKE_DIR=share - "-DSZIP_LIBRARY_DEBUG:PATH=${SZIP_DEBUG}" - "-DSZIP_LIBRARY_RELEASE:PATH=${SZIP_RELEASE}" + -DHDF_PACKAGE_NAMESPACE:STRING=hdf5:: ) vcpkg_install_cmake() diff --git a/ports/hdf5/static-targets.patch b/ports/hdf5/static-targets.patch deleted file mode 100644 index 3e3dfb181750c4..00000000000000 --- a/ports/hdf5/static-targets.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/hdf5-1.10.5/CMakeLists.txt b/hdf5-1.10.5/CMakeLists.txt -index 6ca2f5c54..f7a4db9e5 100644 ---- a/hdf5-1.10.5/CMakeLists.txt -+++ b/hdf5-1.10.5/CMakeLists.txt -@@ -150,6 +150,7 @@ set (HDF5_JAVA_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_TEST_LIB - #----------------------------------------------------------------------------- - # Set the target names of all the libraries - #----------------------------------------------------------------------------- -+if(NOT BUILD_SHARED_LIBS) - set (HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-static") - set (HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-static") - set (HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-static") -@@ -162,9 +163,24 @@ set (HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-static") - set (HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-static") - set (HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-static") - set (HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-static") -+else() -+set (HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-shared") -+set (HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-shared") -+set (HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-shared") -+set (HDF5_HL_LIB_TARGET "${HDF5_HL_LIB_CORENAME}-shared") -+set (HDF5_HL_CPP_LIB_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-shared") -+set (HDF5_TOOLS_LIB_TARGET "${HDF5_TOOLS_LIB_CORENAME}-shared") -+set (HDF5_F90_LIB_TARGET "${HDF5_F90_LIB_CORENAME}-shared") -+set (HDF5_F90_C_LIB_TARGET "${HDF5_F90_C_LIB_CORENAME}-shared") -+set (HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-shared") -+set (HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-shared") -+set (HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-shared") -+set (HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared") -+endif() - set (HDF5_JAVA_JNI_LIB_TARGET "${HDF5_JAVA_JNI_LIB_CORENAME}") - set (HDF5_JAVA_HDF5_LIB_TARGET "${HDF5_JAVA_HDF5_LIB_CORENAME}") - set (HDF5_JAVA_TEST_LIB_TARGET "${HDF5_JAVA_TEST_LIB_CORENAME}") -+ - set (HDF5_LIBSH_TARGET "${HDF5_LIB_CORENAME}-shared") - set (HDF5_TEST_LIBSH_TARGET "${HDF5_TEST_LIB_CORENAME}-shared") - set (HDF5_CPP_LIBSH_TARGET "${HDF5_CPP_LIB_CORENAME}-shared") diff --git a/ports/hdf5/szip.patch b/ports/hdf5/szip.patch new file mode 100644 index 00000000000000..df0618098e6ea0 --- /dev/null +++ b/ports/hdf5/szip.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake +index 5a8956456..997bb8e81 100644 +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -100,7 +100,7 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) + if (HDF5_ENABLE_SZIP_SUPPORT) + option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + if (NOT SZIP_USE_EXTERNAL) +- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) ++ find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}) + if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find + if (SZIP_FOUND) diff --git a/ports/healpix/CONTROL b/ports/healpix/CONTROL index f290513050ca85..629b095ee45004 100644 --- a/ports/healpix/CONTROL +++ b/ports/healpix/CONTROL @@ -1,5 +1,5 @@ Source: healpix -Version: 1.12.10 +Version: 1.12.10-5 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 5dbd9c3c290972..8b1a401517b07b 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -1,41 +1,42 @@ -vcpkg_fail_port_install(ON_TARGET "Windows" "OSX") - set(HEALPIX_VER 3.50) set(HEALPIX_PACK_NAME ${HEALPIX_VER}_2018Dec10) -vcpkg_download_distfile(ARCHIVE - URLS "https://phoenixnap.dl.sourceforge.net/project/healpix/Healpix_${HEALPIX_VER}/Healpix_${HEALPIX_PACK_NAME}.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO healpix + REF Healpix_${HEALPIX_VER} FILENAME "Healpix_${HEALPIX_PACK_NAME}.tar.gz" SHA512 29fe680d757bd94651bf029654257cb67286643aad510df4c2f0b06245174411376ec1beca64feebfac14a6fc0194525170635842916d79dcaddeddd9ac6f6c7 ) -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH -) - vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx - AUTOCONFIG - NO_DEBUG + COPY_SOURCE OPTIONS --with-libcfitsio-include=${CURRENT_INSTALLED_DIR}/include/cfitsio --with-libcfitsio-lib=${CURRENT_INSTALLED_DIR}/lib ) -vcpkg_build_make() +vcpkg_build_make(BUILD_TARGET compile_all) +#vcpkg_fixup_pkgconfig() -# Install manually -set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/src/cxx/auto) +# Install manually because healpix has no install target +set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/auto") file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*) -file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${HEALPIX_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib") file(GLOB_RECURSE HEALPIX_INCLUDES ${OBJ_DIR}/include/*) -file(INSTALL ${HEALPIX_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${HEALPIX_INCLUDES} DESTINATION "${CURRENT_PACKAGES_DIR}/include") file(GLOB_RECURSE HEALPIX_TOOLS ${OBJ_DIR}/bin/*) -file(INSTALL ${HEALPIX_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${HEALPIX_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + +if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/") + set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/auto") + file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*) + file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +endif() # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/hiredis/CONTROL b/ports/hiredis/CONTROL index 0bb9cb9d9e7d65..b16d54e5721406 100644 --- a/ports/hiredis/CONTROL +++ b/ports/hiredis/CONTROL @@ -1,5 +1,6 @@ Source: hiredis -Version: 2019-11-2-1 +Version: 2019-11-2 +Port-Version: 2 Homepage: https://github.com/redis/hiredis Description: Hiredis is a minimalistic C client library for the Redis database. @@ -9,4 +10,4 @@ Build-Depends: openssl Feature: example Description: Build example -Build-Depends: libevent, pthread \ No newline at end of file +Build-Depends: libevent, pthread, libuv \ No newline at end of file diff --git a/ports/hiredis/fix-feature-example.patch b/ports/hiredis/fix-feature-example.patch index a619001852e6d4..4f36087c6a7ed0 100644 --- a/ports/hiredis/fix-feature-example.patch +++ b/ports/hiredis/fix-feature-example.patch @@ -1,76 +1,107 @@ -diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt -index dd3a313..0df75d5 100644 ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -19,10 +19,17 @@ if (LIBEV) - TARGET_LINK_LIBRARIES(example-libev hiredis ev) - ENDIF() - --FIND_PATH(LIBEVENT event.h) --if (LIBEVENT) -+FIND_PACKAGE(Libevent CONFIG REQUIRED) -+FIND_PATH(LIBEVENT_INCLUDES evutil.h) -+if (BUILD_SHARED_LIBS) -+ set(LIBEVENT_LIBS ${LIBEVENT_SHARED_LIBRARIES}) -+else() -+ set(LIBEVENT_LIBS ${LIBEVENT_STATIC_LIBRARIES}) -+endif() -+if (UNIX) - ADD_EXECUTABLE(example-libevent example-libevent) -- TARGET_LINK_LIBRARIES(example-libevent hiredis event) -+ TARGET_LINK_LIBRARIES(example-libevent hiredis ${LIBEVENT_LIBS}) -+ TARGET_INCLUDE_DIRECTORIES(example-libevent PRIVATE ${LIBEVENT_INCLUDES}) - ENDIF() - - FIND_PATH(LIBUV uv.h) -@@ -38,9 +45,17 @@ IF (APPLE) - ENDIF() - - IF (ENABLE_SSL) -+ FIND_PACKAGE(OpenSSL REQUIRED) -+ IF (WIN32) -+ FIND_PACKAGE(pthreads REQUIRED) -+ SET(THREADS_LIBS PThreads4W::PThreads4W) -+ ELSE() -+ FIND_PACKAGE(Threads) -+ SET(THREADS_LIBS ${CMAKE_THREAD_LIBS_INIT}) -+ ENDIF() - ADD_EXECUTABLE(example-ssl example-ssl.c) -- TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl) -+ TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl OpenSSL::SSL OpenSSL::Crypto ${THREADS_LIBS}) - ENDIF() - - ADD_EXECUTABLE(example example.c) --TARGET_LINK_LIBRARIES(example hiredis) -+TARGET_LINK_LIBRARIES(example hiredis ${LIBEVENT_LIBS}) -\ No newline at end of file -diff --git a/examples/example-ssl.c b/examples/example-ssl.c -index 81f4648..9f42923 100644 ---- a/examples/example-ssl.c -+++ b/examples/example-ssl.c -@@ -1,6 +1,10 @@ - #include - #include - #include -+#ifdef _WIN32 -+#include -+#include -+#endif - - #include - #include -diff --git a/examples/example.c b/examples/example.c -index 0e93fc8..339e322 100644 ---- a/examples/example.c -+++ b/examples/example.c -@@ -1,6 +1,10 @@ - #include - #include - #include -+#ifdef _WIN32 -+#include -+#include -+#endif - - #include - +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index dd3a313..8c69d3a 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -19,16 +19,30 @@ if (LIBEV) + TARGET_LINK_LIBRARIES(example-libev hiredis ev) + ENDIF() + +-FIND_PATH(LIBEVENT event.h) +-if (LIBEVENT) ++FIND_PACKAGE(Libevent CONFIG REQUIRED) ++FIND_PATH(LIBEVENT_INCLUDES evutil.h) ++if (BUILD_SHARED_LIBS) ++ set(LIBEVENT_LIBS ${LIBEVENT_SHARED_LIBRARIES}) ++else() ++ set(LIBEVENT_LIBS ${LIBEVENT_STATIC_LIBRARIES}) ++endif() ++if (UNIX) + ADD_EXECUTABLE(example-libevent example-libevent) +- TARGET_LINK_LIBRARIES(example-libevent hiredis event) ++ TARGET_LINK_LIBRARIES(example-libevent hiredis ${LIBEVENT_LIBS}) ++ TARGET_INCLUDE_DIRECTORIES(example-libevent PRIVATE ${LIBEVENT_INCLUDES}) + ENDIF() + ++FIND_LIBRARY(UV_LIBRARY libuv) + FIND_PATH(LIBUV uv.h) + IF (LIBUV) + ADD_EXECUTABLE(example-libuv example-libuv.c) +- TARGET_LINK_LIBRARIES(example-libuv hiredis uv) ++ if(WIN32) ++ set(LIB_LISTS Iphlpapi.lib Psapi.lib Userenv.lib) ++ else() ++ set(LIB_LISTS) ++ endif() ++ TARGET_LINK_LIBRARIES(example-libuv hiredis ${UV_LIBRARY} ${LIB_LISTS}) ++ TARGET_INCLUDE_DIRECTORIES(example-libuv PRIVATE ${LIBUV}) + ENDIF() + + IF (APPLE) +@@ -38,9 +52,21 @@ IF (APPLE) + ENDIF() + + IF (ENABLE_SSL) ++ FIND_PACKAGE(OpenSSL REQUIRED) ++ IF (WIN32) ++ FIND_PACKAGE(pthreads REQUIRED) ++ SET(THREADS_LIBS PThreads4W::PThreads4W) ++ ELSE() ++ FIND_PACKAGE(Threads) ++ SET(THREADS_LIBS ${CMAKE_THREAD_LIBS_INIT}) ++ ENDIF() + ADD_EXECUTABLE(example-ssl example-ssl.c) +- TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl) ++ if(WIN32) ++ TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl OpenSSL::SSL OpenSSL::Crypto ${THREADS_LIBS} crypt32.lib) ++ else() ++ TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl OpenSSL::SSL OpenSSL::Crypto ${THREADS_LIBS}) ++ endif() + ENDIF() + + ADD_EXECUTABLE(example example.c) +-TARGET_LINK_LIBRARIES(example hiredis) ++TARGET_LINK_LIBRARIES(example hiredis ${LIBEVENT_LIBS}) +diff --git a/examples/example-libuv.c b/examples/example-libuv.c +index a5462d4..9b7ca3e 100644 +--- a/examples/example-libuv.c ++++ b/examples/example-libuv.c +@@ -33,7 +33,9 @@ void disconnectCallback(const redisAsyncContext *c, int status) { + } + + int main (int argc, char **argv) { ++#ifndef _WIN32 + signal(SIGPIPE, SIG_IGN); ++#endif + uv_loop_t* loop = uv_default_loop(); + + redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); +diff --git a/examples/example-ssl.c b/examples/example-ssl.c +index 81f4648..9f42923 100644 +--- a/examples/example-ssl.c ++++ b/examples/example-ssl.c +@@ -1,6 +1,10 @@ + #include + #include + #include ++#ifdef _WIN32 ++#include ++#include ++#endif + + #include + #include +diff --git a/examples/example.c b/examples/example.c +index 0e93fc8..339e322 100644 +--- a/examples/example.c ++++ b/examples/example.c +@@ -1,6 +1,10 @@ + #include + #include + #include ++#ifdef _WIN32 ++#include ++#include ++#endif + + #include + diff --git a/ports/hiredis/fix-pthread.h-not-found-on-windows.patch b/ports/hiredis/fix-pthread.h-not-found-on-windows.patch new file mode 100644 index 00000000000000..e927bc4314567a --- /dev/null +++ b/ports/hiredis/fix-pthread.h-not-found-on-windows.patch @@ -0,0 +1,16 @@ +diff --git a/ssl.c b/ssl.c +index 78ab9e4..768f304 100644 +--- a/ssl.c ++++ b/ssl.c +@@ -34,7 +34,11 @@ + #include "async.h" + + #include ++#ifdef _WIN32 ++#include ++#else + #include ++#endif + #include + #include + diff --git a/ports/hiredis/portfile.cmake b/ports/hiredis/portfile.cmake index 833d428ee11376..4d3a97c7e18395 100644 --- a/ports/hiredis/portfile.cmake +++ b/ports/hiredis/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( fix-feature-example.patch support-static-in-win.patch fix-timeval.patch + fix-pthread.h-not-found-on-windows.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -32,4 +33,4 @@ vcpkg_copy_pdbs() 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}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/hpx/CONTROL b/ports/hpx/CONTROL index f98540c70d455d..4bc7d7b6280a95 100644 --- a/ports/hpx/CONTROL +++ b/ports/hpx/CONTROL @@ -1,5 +1,5 @@ Source: hpx -Version: 1.4.1 +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 Homepage: https://github.com/STEllAR-GROUP/hpx Description: The C++ Standards Library for Concurrency and Parallelism diff --git a/ports/hpx/boost-1.73.patch b/ports/hpx/boost-1.73.patch new file mode 100644 index 00000000000000..d45e5cc7fedab4 --- /dev/null +++ b/ports/hpx/boost-1.73.patch @@ -0,0 +1,13 @@ +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 cabab3b8f671fd..6c369e0a2934f2 100644 --- a/ports/hpx/portfile.cmake +++ b/ports/hpx/portfile.cmake @@ -7,6 +7,8 @@ vcpkg_from_github( REF 1.4.1 SHA512 f110d5e5c10ec396f6e762568c9ecd5b767cb6efe91168b5caa8fe1e07bb5870cd13b3392fa4e008a2cc0e044b02084a35b0866e943d9b9c7435599c131f1582 HEAD_REF stable + PATCHES + boost-1.73.patch ) vcpkg_configure_cmake( diff --git a/ports/hwloc/CONTROL b/ports/hwloc/CONTROL index eeb7421f35c4a5..f2bf754b7df018 100644 --- a/ports/hwloc/CONTROL +++ b/ports/hwloc/CONTROL @@ -1,5 +1,5 @@ Source: hwloc -Version: 1.11.7-3 +Version: 1.11.7-4 Homepage: https://github.com/open-mpi/hwloc Description: Portable Hardware Locality (hwloc) The Portable Hardware Locality (hwloc) software package provides a portable abstraction (across OS, versions, architectures, ...) of the hierarchical topology of modern architectures, including NUMA memory nodes, sockets, shared caches, cores and simultaneous multithreading. It also gathers various system attributes such as cache and memory information as well as the locality of I/O devices such as network interfaces, InfiniBand HCAs or GPUs. diff --git a/ports/hwloc/portfile.cmake b/ports/hwloc/portfile.cmake index 64a18ddc733f99..540255222fd041 100644 --- a/ports/hwloc/portfile.cmake +++ b/ports/hwloc/portfile.cmake @@ -1,35 +1,51 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "UWP builds not supported") -endif() +vcpkg_fail_port_install(ON_TARGET "UWP") -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO open-mpi/hwloc REF hwloc-1.11.7 - SHA512 bc3a74c60bfbed1e860c2fe2b5b49956eca5cfd9c00a262f6cd3026a42ae8b5411fa296e471a95cba657d943b8853675442e796e648034398af3015e5f59476e) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + SHA512 bc3a74c60bfbed1e860c2fe2b5b49956eca5cfd9c00a262f6cd3026a42ae8b5411fa296e471a95cba657d943b8853675442e796e648034398af3015e5f59476e +) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS_DEBUG - -DHWLOC_SKIP_INCLUDES=ON) +if (VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + ) + + vcpkg_install_cmake() + + file(READ ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h PUBLIC_CONFIG_H) + string(REPLACE "defined( DECLSPEC_EXPORTS )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined( _USRDLL )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") + else() + string(REPLACE "defined( _USRDLL )" "1" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") + endif() + file(WRITE ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h "${PUBLIC_CONFIG_H}") + + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/tools) +else() + message(WARNING "${PORT} currently requires the following tool from the system package manager:\n libtool") -vcpkg_install_cmake() + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + ) + + vcpkg_install_make() + + file(GLOB HWLOC_EXEC ${CURRENT_PACKAGES_DIR}/bin) + message("HWLOC_EXEC: ${HWLOC_EXEC}") + if (HWLOC_EXEC) + file(COPY ${HWLOC_EXEC} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(READ ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h PUBLIC_CONFIG_H) -string(REPLACE "defined( DECLSPEC_EXPORTS )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined( _USRDLL )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") -else() - string(REPLACE "defined( _USRDLL )" "1" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}") endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h "${PUBLIC_CONFIG_H}") - -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/tools) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/hwloc) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/hwloc/COPYING ${CURRENT_PACKAGES_DIR}/share/hwloc/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/hyperscan/CONTROL b/ports/hyperscan/CONTROL index a060054ac462fa..a47318f5f8fdb9 100644 --- a/ports/hyperscan/CONTROL +++ b/ports/hyperscan/CONTROL @@ -1,5 +1,5 @@ Source: hyperscan -Version: 5.2.1 +Version: 5.2.1-1 Homepage: https://www.hyperscan.io Description: A regular expression library with O(length of input) match times that takes advantage of Intel hardware to provide blazing speed. -Build-Depends: boost-array, boost-chrono, boost-config, boost-core, boost-crc, boost-detail, boost-functional, boost-regex, boost-system, boost-thread, boost-type-traits, boost-unordered, boost-utility, boost-dynamic-bitset, boost-random, boost-graph, boost-multi-array, boost-icl, boost-ptr-container, python3, ragel +Build-Depends: boost-array, boost-chrono, boost-config, boost-core, boost-crc, boost-detail, boost-functional, boost-regex, boost-system, boost-thread, boost-type-traits, boost-unordered, boost-utility, boost-dynamic-bitset, boost-random, boost-graph, boost-multi-array, boost-icl, boost-ptr-container, pcre, python3, ragel diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index 9f57f9f5f4b8af..4ba1c8e96f774a 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,5 +1,5 @@ Source: icu -Version: 65.1-3 +Version: 67.1-2 Homepage: http://icu-project.org/apiref/icu4c/ Description: Mature and widely used Unicode and localization library. -Supports: !uwp +Supports: !(arm|uwp) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index eb690fb1311853..82fd00464d63c7 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -1,8 +1,6 @@ -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - message(FATAL_ERROR "Error: UWP builds are currently not supported.") -endif() +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") -set(ICU_VERSION_MAJOR 65) +set(ICU_VERSION_MAJOR 67) set(ICU_VERSION_MINOR 1) set(VERSION "${ICU_VERSION_MAJOR}.${ICU_VERSION_MINOR}") set(VERSION2 "${ICU_VERSION_MAJOR}_${ICU_VERSION_MINOR}") @@ -12,7 +10,7 @@ vcpkg_download_distfile( ARCHIVE URLS "https://github.com/unicode-org/icu/releases/download/release-${VERSION3}/icu4c-${VERSION2}-src.tgz" FILENAME "icu4c-${VERSION2}-src.tgz" - SHA512 8f1ef33e1f4abc9a8ee870331c59f01b473d6da1251a19ce403f822f3e3871096f0791855d39c8f20c612fc49cda2c62c06864aa32ddab2dbd186d2b21ce9139 + SHA512 4779f1ce1ca7976f6fad6768853ea8c540da54d11509e3b6cfd864a04b5f2db1c3d4b546387f91ad02fb90804525bc37d2543173f0d705d6ca11dc6f2b7640a8 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH @@ -24,6 +22,9 @@ vcpkg_extract_source_archive_ex( ${CMAKE_CURRENT_LIST_DIR}/fix-extra.patch ) +vcpkg_find_acquire_program(PYTHON3) +set(ENV{PYTHON} "${PYTHON3}") + set(CONFIGURE_OPTIONS "--disable-samples --disable-tests") if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -34,39 +35,41 @@ endif() set(CONFIGURE_OPTIONS_RELEASE "--disable-debug --enable-release --prefix=${CURRENT_PACKAGES_DIR}") set(CONFIGURE_OPTIONS_DEBUG "--enable-debug --disable-release --prefix=${CURRENT_PACKAGES_DIR}/debug") +set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel) +set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(NOT VCPKG_TARGET_IS_WINDOWS) set(BASH bash) set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -fPIC") set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -fPIC") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") # Configure release - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(STATUS "Configuring ${RELEASE_TRIPLET}") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) set(ENV{CFLAGS} "-O2 ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") set(ENV{CXXFLAGS} "-O2 ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELEASE}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - LOGNAME "configure-${TARGET_TRIPLET}-rel") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" + LOGNAME "configure-${RELEASE_TRIPLET}") + message(STATUS "Configuring ${RELEASE_TRIPLET} done") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") # Configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(STATUS "Configuring ${DEBUG_TRIPLET}") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) set(ENV{CFLAGS} "-O0 -g ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") set(ENV{CXXFLAGS} "-O0 -g ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" - LOGNAME "configure-${TARGET_TRIPLET}-dbg") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" + LOGNAME "configure-${DEBUG_TRIPLET}") + message(STATUS "Configuring ${DEBUG_TRIPLET} done") endif() else() @@ -93,34 +96,34 @@ else() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") # Configure release - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(STATUS "Configuring ${RELEASE_TRIPLET}") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) set(ENV{CFLAGS} "${ICU_RUNTIME} -O2 -Oi -Zi -FS ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") set(ENV{CXXFLAGS} "${ICU_RUNTIME} -O2 -Oi -Zi -FS ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") set(ENV{LDFLAGS} "-DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH}/source/runConfigureICU MSYS/MSVC ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELEASE}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - LOGNAME "configure-${TARGET_TRIPLET}-rel") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" + LOGNAME "configure-${RELEASE_TRIPLET}") + message(STATUS "Configuring ${RELEASE_TRIPLET} done") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") # Configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(STATUS "Configuring ${DEBUG_TRIPLET}") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) set(ENV{CFLAGS} "${ICU_RUNTIME}d -Od -Zi -FS -RTC1 ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") set(ENV{CXXFLAGS} "${ICU_RUNTIME}d -Od -Zi -FS -RTC1 ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") set(ENV{LDFLAGS} "-DEBUG") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH}/source/runConfigureICU MSYS/MSVC ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" - LOGNAME "configure-${TARGET_TRIPLET}-dbg") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" + LOGNAME "configure-${DEBUG_TRIPLET}") + message(STATUS "Configuring ${DEBUG_TRIPLET} done") endif() endif() @@ -130,34 +133,34 @@ unset(ENV{LDFLAGS}) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") # Build release - message(STATUS "Package ${TARGET_TRIPLET}-rel") + message(STATUS "Package ${RELEASE_TRIPLET}") vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - LOGNAME "make-build-${TARGET_TRIPLET}-rel") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" + LOGNAME "make-build-${RELEASE_TRIPLET}") vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "make install" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - LOGNAME "make-install-${TARGET_TRIPLET}-rel") - message(STATUS "Package ${TARGET_TRIPLET}-rel done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" + LOGNAME "make-install-${RELEASE_TRIPLET}") + message(STATUS "Package ${RELEASE_TRIPLET} done") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") # Build debug - message(STATUS "Package ${TARGET_TRIPLET}-dbg") + message(STATUS "Package ${DEBUG_TRIPLET}") vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" - LOGNAME "make-build-${TARGET_TRIPLET}-dbg") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" + LOGNAME "make-build-${DEBUG_TRIPLET}") vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "make install" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" - LOGNAME "make-install-${TARGET_TRIPLET}-dbg") - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" + LOGNAME "make-install-${DEBUG_TRIPLET}") + message(STATUS "Package ${DEBUG_TRIPLET} done") endif() file(REMOVE_RECURSE @@ -188,7 +191,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(COPY ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) endif() else() - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + if(VCPKG_TARGET_IS_WINDOWS) # rename static libraries to match import libs # see https://gitlab.kitware.com/cmake/cmake/issues/16617 foreach(MODULE dt in io tu uc) @@ -210,6 +213,10 @@ else() endforeach() endif() +# Install executables from ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin to /tools/icu +file(GLOB ICU_TOOLS ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(INSTALL ${ICU_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + # remove any remaining dlls in /lib file(GLOB DUMMY_DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) if(DUMMY_DLLS) @@ -221,5 +228,4 @@ endif() vcpkg_copy_pdbs() # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/icu) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/icu/LICENSE ${CURRENT_PACKAGES_DIR}/share/icu/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/idevicerestore/CONTROL b/ports/idevicerestore/CONTROL index ca6cabbd02ed19..a8db4e250c8a07 100644 --- a/ports/idevicerestore/CONTROL +++ b/ports/idevicerestore/CONTROL @@ -1,4 +1,5 @@ -Source: idevicerestore -Version: 1.0.12-3 -Description: Restore/upgrade firmware of iOS devices -Build-Depends: libimobiledevice, curl, libirecovery, libzip \ No newline at end of file +Source: idevicerestore +Version: 1.0.12-4 +Description: Restore/upgrade firmware of iOS devices +Build-Depends: libimobiledevice, curl, libirecovery, libzip +Supports: windows diff --git a/ports/idevicerestore/fix-libgen.h-cannot-be-found.patch b/ports/idevicerestore/fix-libgen.h-cannot-be-found.patch new file mode 100644 index 00000000000000..db7450eb23bcb5 --- /dev/null +++ b/ports/idevicerestore/fix-libgen.h-cannot-be-found.patch @@ -0,0 +1,32 @@ +diff --git a/src/common.c b/src/common.c +index afe1bc0..9219a8f 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -29,7 +29,9 @@ + #include + #include + #include ++#ifndef _MSC_VER + #include ++#endif + #include + + #include "common.h" +diff --git a/src/idevicerestore.c b/src/idevicerestore.c +index efa13c3..c17a2ba 100644 +--- a/src/idevicerestore.c ++++ b/src/idevicerestore.c +@@ -38,12 +38,12 @@ + #include + #ifndef _MSC_VER + #include ++#include + #endif + #include + #include + #include + #include +-#include + + #include + diff --git a/ports/idevicerestore/portfile.cmake b/ports/idevicerestore/portfile.cmake index 67aeb4c373ab04..5cd1acef983437 100644 --- a/ports/idevicerestore/portfile.cmake +++ b/ports/idevicerestore/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "linux" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -6,7 +6,9 @@ vcpkg_from_github( REF 1.0.12 SHA512 ba623be56c2f37853516d7d4c32e16f1ec72f33d512f18aa812ce6830af4b9e389f7af5321888dd0ddd168e282b652e379b60f90970680e213eabf489f406915 HEAD_REF msvc-master - PATCHES libcurl_d.patch + PATCHES + libcurl_d.patch + fix-libgen.h-cannot-be-found.patch ) vcpkg_install_msbuild( diff --git a/ports/ignition-cmake0/CONTROL b/ports/ignition-cmake0/CONTROL index f4eea840b73364..936683193a978d 100644 --- a/ports/ignition-cmake0/CONTROL +++ b/ports/ignition-cmake0/CONTROL @@ -1,5 +1,5 @@ Source: ignition-cmake0 -Version: 0.6.2-1 +Version: 0.6.2-2 Homepage: https://ignitionrobotics.org/libs/cmake Description: CMake helper functions for building robotic applications Build-Depends: ignition-modularscripts diff --git a/ports/ignition-cmake0/portfile.cmake b/ports/ignition-cmake0/portfile.cmake index c835238df7058e..795436f9598c26 100644 --- a/ports/ignition-cmake0/portfile.cmake +++ b/ports/ignition-cmake0/portfile.cmake @@ -7,7 +7,7 @@ set(PACKAGE_VERSION "0.6.1") ignition_modular_library(NAME cmake VERSION ${PACKAGE_VERSION} REF "ignition-cmake_${PACKAGE_VERSION}" - SHA512 fcd3ad6b5289697c4928c71b820e2adaa758c730f52cba3f8cc714e44ca0c9f04f432ae5b98b5f258c4851c4666740b58066a25c55ff3a6de975cd8a57991b6b + SHA512 bd57cd43dd944fef264353b67fbbbab989d4bb638b684f80868a8b61fe0b854e156e00852b967c7caa8598315bea60bd8b27ff000410e93c4f04185a13c90489 # Ensure that gtest is not compiled (backport of https://bitbucket.org/ignitionrobotics/ign-cmake/pull-requests/163) PATCHES do-not-compile-gtest.patch # Support for ARM64 (backport of https://bitbucket.org/ignitionrobotics/ign-cmake/pull-requests/168) diff --git a/ports/ignition-cmake2/CONTROL b/ports/ignition-cmake2/CONTROL index 455beb85f8e6c0..8a0ee541495b50 100644 --- a/ports/ignition-cmake2/CONTROL +++ b/ports/ignition-cmake2/CONTROL @@ -1,5 +1,5 @@ Source: ignition-cmake2 -Version: 2.1.1 +Version: 2.2.0-1 Homepage: https://ignitionrobotics.org/libs/cmake Description: CMake helper functions for building robotic applications Build-Depends: ignition-modularscripts diff --git a/ports/ignition-cmake2/portfile.cmake b/ports/ignition-cmake2/portfile.cmake index 5bc63eec1280e2..a9c895aac4e448 100644 --- a/ports/ignition-cmake2/portfile.cmake +++ b/ports/ignition-cmake2/portfile.cmake @@ -1,16 +1,10 @@ include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) -set(PACKAGE_VERSION "2.1.1") +set(PACKAGE_VERSION "2.2.0") ignition_modular_library(NAME cmake VERSION ${PACKAGE_VERSION} - SHA512 4d22a45ccc9582c7e4b370b884511782d1629fa3e257dd92300388b5050d22fa63dd4a6ef8942abb9ebbc300df4cd526d1d8a7088a92b0073e152c16c7b97e2b) - -# Permit empty include folder -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) - -# Remove unneccessary directory, as ignition-cmake is a pure CMake package -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug) + SHA512 079b6d0cc5e2de83cf01f5731dd4e2e55e18e46c7506b6267a19a230fbbaa7b89053be4b42ca21584cf7fdd64de1d6305c7bc16fa3e0c5751b098fd0e5b98149) # Install custom usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) diff --git a/ports/ignition-common1/CONTROL b/ports/ignition-common1/CONTROL index 4f4e0d56973e5f..810904d3e9b341 100644 --- a/ports/ignition-common1/CONTROL +++ b/ports/ignition-common1/CONTROL @@ -1,4 +1,4 @@ Source: ignition-common1 -Version: 1.1.1 +Version: 1.1.1-1 Build-Depends: dlfcn-win32 (windows|uwp), ffmpeg (!windows&!uwp), freeimage (!windows&!uwp), gts (!windows&!uwp), ignition-cmake0, ignition-math4, tinyxml2 (!windows&!uwp) Description: Common libraries for robotics applications diff --git a/ports/ignition-common1/portfile.cmake b/ports/ignition-common1/portfile.cmake index da65aa09af5dd6..28f40c4aabe752 100644 --- a/ports/ignition-common1/portfile.cmake +++ b/ports/ignition-common1/portfile.cmake @@ -5,4 +5,4 @@ include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_l ignition_modular_library(NAME common VERSION "1.1.1" REF ignition-common_1.1.1 - SHA512 8453e1cf2337898b81b313aeffd1a7b683fd03184edfae74c81aa861b28036f6b9094fcab36f7a0f68b4204956d7116bd03073c7bdf2e769e47dffcdaad454d6) + SHA512 e96e82dc401281cd31843f4b0ae2c1d23589170869621ea62eb6d6b31b11bd622c14da7046b1993c8fc67a1d39bae9a96b9f8efc8923e305823f963d864975f7) diff --git a/ports/ignition-fuel-tools1/CONTROL b/ports/ignition-fuel-tools1/CONTROL index 96f12a5af834f1..acabd13dfe4445 100644 --- a/ports/ignition-fuel-tools1/CONTROL +++ b/ports/ignition-fuel-tools1/CONTROL @@ -1,4 +1,4 @@ Source: ignition-fuel-tools1 -Version: 1.2.0 +Version: 1.2.0-2 Build-Depends: curl, ignition-cmake0, ignition-common1, libyaml, libzip, jsoncpp Description: Tools for using fuel API to download robot models diff --git a/ports/ignition-fuel-tools1/portfile.cmake b/ports/ignition-fuel-tools1/portfile.cmake index 3b809779f50ed0..c7c310294557cf 100644 --- a/ports/ignition-fuel-tools1/portfile.cmake +++ b/ports/ignition-fuel-tools1/portfile.cmake @@ -1,10 +1,11 @@ -include(vcpkg_common_functions) - include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) ignition_modular_library(NAME fuel-tools VERSION "1.2.0" CMAKE_PACKAGE_NAME ignition-fuel_tools1 - SHA512 5ed8d1429e1f5c0716e06840a4163f7e79a614cf7b6ff326adb69d35639e3ec5f1862edc41c6dc0bd21b16db6d13bee509831a66b10ca2ae3999649f1554a68e + SHA512 a656fed74fb2138b3bcf7d35b25ad06da95cfb9a3ad7ded2c9c54db385f55ea310fd1a72dcf6400b0a6199e376c1ba2d11ee2a08c66e3c2cc8b2ee1b25406986 # Ensure yaml is correctly linked (backport of https://bitbucket.org/ignitionrobotics/ign-fuel-tools/pull-requests/103/use-yaml_target-instead-of-yaml-yaml/diff) - PATCHES link-correct-yaml-target.patch) + PATCHES link-correct-yaml-target.patch + # This can be removed when the pc file of curl is fixed + DISABLE_PKGCONFIG_INSTALL + ) diff --git a/ports/ignition-math4/CONTROL b/ports/ignition-math4/CONTROL index 44aa0c01ad3623..f9e87feb3d73c0 100644 --- a/ports/ignition-math4/CONTROL +++ b/ports/ignition-math4/CONTROL @@ -1,5 +1,5 @@ Source: ignition-math4 -Version: 4.0.0 +Version: 4.0.0-1 Homepage: https://ignitionrobotics.org/libs/math Build-Depends: ignition-cmake0 Description: Math API for robotic applications diff --git a/ports/ignition-math4/portfile.cmake b/ports/ignition-math4/portfile.cmake index a6a00c84936505..69a50abdd526bb 100644 --- a/ports/ignition-math4/portfile.cmake +++ b/ports/ignition-math4/portfile.cmake @@ -4,4 +4,4 @@ include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_l ignition_modular_library(NAME math VERSION "4.0.0" - SHA512 09023b559e7e544e628131189f3a7f57a9b73868f66f81e5ce1a353092940949973e1753f18ead8f655ad88c0e1d1bf51bbf63163760694aab7a97a4c0f6d519) + SHA512 5996af60666a1166fc19b2db9715f7214341becb8eb6071c09315e1f71e759c6de4da99b44312829fc7b2bdef7e0f3671e4d2a92e0d2dd5d5fd782a6c46b012a) diff --git a/ports/ignition-math6/CONTROL b/ports/ignition-math6/CONTROL new file mode 100644 index 00000000000000..69d53eea18a914 --- /dev/null +++ b/ports/ignition-math6/CONTROL @@ -0,0 +1,5 @@ +Source: ignition-math6 +Version: 6.4.0 +Homepage: https://ignitionrobotics.org/libs/math +Build-Depends: eigen3, ignition-cmake2, ignition-modularscripts +Description: Math API for robotic applications diff --git a/ports/ignition-math6/portfile.cmake b/ports/ignition-math6/portfile.cmake new file mode 100644 index 00000000000000..ffb0062571f3c5 --- /dev/null +++ b/ports/ignition-math6/portfile.cmake @@ -0,0 +1,5 @@ +include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) + +ignition_modular_library(NAME math + VERSION "6.4.0" + SHA512 8a6e672ef6de591d25200f288deaaa16cc43e3c90804ee5ead0f06345036afbfa40acb531eb5b6a1fa80bd34c0c5964662cc0659d8bed2c811ad7c776d6f77cb) diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index 2ea04f67a2829d..e52ae90a5a50e4 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,3 +1,4 @@ Source: ignition-modularscripts -Version: 2020-02-10 +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 8ce00116b718a8..b294c097b6fcf1 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -1,5 +1,5 @@ -function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME) +function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME IML_DISABLE_PKGCONFIG_INSTALL) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -10,18 +10,41 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PAC # If necessary, move the CMake config files if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake") - vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${CMAKE_PACKAGE_NAME}" TARGET_PATH "share/${CMAKE_PACKAGE_NAME}") + # Some ignition libraries install library subcomponents, that are effectively additional cmake packages + # with name ${CMAKE_PACKAGE_NAME}-${COMPONENT_NAME}, so it is needed to call vcpkg_fixup_cmake_targets for them as well + file(GLOB COMPONENTS_CMAKE_PACKAGE_NAMES + LIST_DIRECTORIES TRUE + RELATIVE "${CURRENT_PACKAGES_DIR}/lib/cmake/" + "${CURRENT_PACKAGES_DIR}/lib/cmake/*") + + foreach(COMPONENT_CMAKE_PACKAGE_NAME IN LISTS COMPONENTS_CMAKE_PACKAGE_NAMES) + vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${COMPONENT_CMAKE_PACKAGE_NAME}" + TARGET_PATH "share/${COMPONENT_CMAKE_PACKAGE_NAME}" + DO_NOT_DELETE_PARENT_CONFIG_PATH) + endforeach() file(GLOB_RECURSE CMAKE_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/lib/cmake/${CMAKE_PACKAGE_NAME}/*") file(COPY ${CMAKE_RELEASE_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${CMAKE_PACKAGE_NAME}/") - - # Remove debug files - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/lib/cmake - ${CURRENT_PACKAGES_DIR}/debug/share) + endif() + + # Remove unused files files + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/share) + + # Make pkg-config files relocatable + if(NOT IML_DISABLE_PKGCONFIG_INSTALL) + 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) endif() # Find the relevant license file and install it @@ -44,7 +67,9 @@ endfunction() ## SHA512 ## [REF ] ## [HEAD_REF ] -## [PATCHES ]) +## [PATCHES ] +## [CMAKE_PACKAGE_NAME ] +## [DISABLE_PKGCONFIG_INSTALL]) ## ``` ## ## ## Parameters: @@ -55,23 +80,27 @@ endfunction() ## The complete version number. ## ## ### SHA512 -## The SHA512 hash that should match the downloaded archive. This is forwarded to the `vcpkg_from_bitbucket` command. +## The SHA512 hash that should match the downloaded archive. This is forwarded to the `vcpkg_from_github` command. ## ## ### REF -## Reference to the tag of the desired release. This is forwarded to the `vcpkg_from_bitbucket` command. +## Reference to the tag of the desired release. This is forwarded to the `vcpkg_from_github` command. ## If not specified, defaults to `ignition-${NAME}${MAJOR_VERSION}_${VERSION}`. ## ## ### HEAD_REF -## Reference (tag) to the desired release. This is forwarded to the `vcpkg_from_bitbucket` command. +## Reference (tag) to the desired release. This is forwarded to the `vcpkg_from_github` command. ## If not specified, defaults to `ign-${NAME}${MAJOR_VERSION}`. ## ## ### PATCHES ## A list of patches to be applied to the extracted sources. -## This is forwarded to the `vcpkg_from_bitbucket` command. +## This is forwarded to the `vcpkg_from_github` command. ## ## ### CMAKE_PACKAGE_NAME ## The name of the CMake package for the port. ## If not specified, defaults to `ignition-${NAME}${MAJOR_VERSION}`. +## +## ### DISABLE_PKGCONFIG_INSTALL +## If present, disable installation of .pc pkg-config configuration files. +## ## ## ## Examples: ## @@ -79,9 +108,10 @@ endfunction() ## * [ignition-math4](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-math4/portfile.cmake) ## * [ignition-fuel-tools1](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-fuel-tools1/portfile.cmake) function(ignition_modular_library) + set(options DISABLE_PKGCONFIG_INSTALL) set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME) set(multiValueArgs PATCHES) - cmake_parse_arguments(IML "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(IML "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE "." ";" IML_VERSION_LIST ${IML_VERSION}) list(GET IML_VERSION_LIST 0 IML_MAJOR_VERSION) @@ -101,9 +131,9 @@ function(ignition_modular_library) if(NOT DEFINED IML_CMAKE_PACKAGE_NAME) set(IML_CMAKE_PACKAGE_NAME ${DEFAULT_CMAKE_PACKAGE_NAME}) endif() - - # Download library from bitbucket, to support also the --head option - vcpkg_from_bitbucket( + + # Download library from github, to support also the --head option + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ignitionrobotics/ign-${IML_NAME} REF ${IML_REF} @@ -113,5 +143,5 @@ function(ignition_modular_library) ) # Build library - ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME}) + ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME} ${IML_DISABLE_PKGCONFIG_INSTALL}) endfunction() diff --git a/ports/ignition-msgs1/CONTROL b/ports/ignition-msgs1/CONTROL index 09ab2ff433b4aa..47665b0389eba2 100644 --- a/ports/ignition-msgs1/CONTROL +++ b/ports/ignition-msgs1/CONTROL @@ -1,4 +1,4 @@ Source: ignition-msgs1 -Version: 1.0.0 +Version: 1.0.0-1 Build-Depends: ignition-cmake0, ignition-math4, protobuf Description: Middleware protobuf messages for robotics diff --git a/ports/ignition-msgs1/portfile.cmake b/ports/ignition-msgs1/portfile.cmake index a3173d2bc081ad..d85be26068e25f 100644 --- a/ports/ignition-msgs1/portfile.cmake +++ b/ports/ignition-msgs1/portfile.cmake @@ -26,7 +26,7 @@ ignition_modular_library(NAME msgs VERSION "1.0.0" # See https://bitbucket.org/ignitionrobotics/ign-msgs/issues/33/the-ignition-msgs1_100-tag-does-not-match REF ignition-msgs_1.0.0 - SHA512 15261d9c82c05952b1b7dfc50346e73ab041bf6e2e5a63698e17bfa36b2d261aad2777f770f6dccd0d58eb9c90979fe89a7371dc2ec6050149bf63cafc4f6779 + SHA512 3a270f0ac988b947091d4626be48fe8cfed5ddfde5a37b9d0f08fddcbf278099ab231fca11e2dd2296ca54e0350ea14e3f685dc238f0827f18f10ab7b75039de # Fix linking order of protobuf libraries (backport of https://bitbucket.org/ignitionrobotics/ign-msgs/pull-requests/151) PATCHES fix-protobuf-static-link-order.patch) diff --git a/ports/ignition-msgs5/01-protobuf.patch b/ports/ignition-msgs5/01-protobuf.patch new file mode 100644 index 00000000000000..71ea936b17fe63 --- /dev/null +++ b/ports/ignition-msgs5/01-protobuf.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f68bf3d..d4d1372 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -135,6 +135,8 @@ if(MSVC) + # warning is not important since those members do not need to be interfaced + # with. + set_source_files_properties(${gen_sources} COMPILE_FLAGS "/wd4251 /wd4146") ++ # Fix for protobuf 3.12 - allow big object files ++ add_definitions(/bigobj) + endif() + + set_source_files_properties(${gen_headers} ${gen_sources} ${gen_ruby_scripts} diff --git a/ports/ignition-msgs5/CONTROL b/ports/ignition-msgs5/CONTROL new file mode 100644 index 00000000000000..690ded1b6a60f5 --- /dev/null +++ b/ports/ignition-msgs5/CONTROL @@ -0,0 +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 new file mode 100644 index 00000000000000..aec3a6cd75c385 --- /dev/null +++ b/ports/ignition-msgs5/portfile.cmake @@ -0,0 +1,20 @@ +# Explicitly disable cross-compilation until the upstream discussion +# https://github.com/ignitionrobotics/ign-msgs/issues/34 is solved +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "linux" "uwp") + +include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) + +# This port needs to generate protobuf messages with a custom plugin generator, +# so it needs to have in Windows the relative protobuf dll available in the PATH +set(path_backup $ENV{PATH}) +vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin) +vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin) + +ignition_modular_library(NAME msgs + VERSION "5.1.0" + SHA512 db485f737c465b310602342a1a751c561473e330eb18d1b322b32d13de246536fe6a7efdf245faaaa9be1c9bfce662b2d39d1bb7cffc37e52690893cb47cc2ee + PATCHES + "01-protobuf.patch") + +# Restore old path +set(ENV{PATH} "${path_backup}") diff --git a/ports/ignition-plugin1/CONTROL b/ports/ignition-plugin1/CONTROL new file mode 100644 index 00000000000000..ba3aa4c312188f --- /dev/null +++ b/ports/ignition-plugin1/CONTROL @@ -0,0 +1,5 @@ +Source: ignition-plugin1 +Version: 1.1.0 +Homepage: https://ignitionrobotics.org/libs/plugin +Build-Depends: dlfcn-win32 (windows|uwp), ignition-cmake2, ignition-modularscripts +Description: Library for registering plugin libraries and dynamically loading them at runtime diff --git a/ports/ignition-plugin1/portfile.cmake b/ports/ignition-plugin1/portfile.cmake new file mode 100644 index 00000000000000..daa626047409d1 --- /dev/null +++ b/ports/ignition-plugin1/portfile.cmake @@ -0,0 +1,7 @@ +include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) + +set(PACKAGE_VERSION "1.1.0") +ignition_modular_library(NAME plugin + VERSION ${PACKAGE_VERSION} + REF "ignition-plugin_${PACKAGE_VERSION}" + SHA512 0657c5816e67d02329a79364050b8a56957180e5b7481b01696c7369b063cbfedfc93793a8ad92d87d242d24e476283dc7847bd810a3de98d3ec5ae7d640568c) diff --git a/ports/ignition-transport4/CONTROL b/ports/ignition-transport4/CONTROL index e228ca5b433924..73f2eafd2f476d 100644 --- a/ports/ignition-transport4/CONTROL +++ b/ports/ignition-transport4/CONTROL @@ -1,4 +1,4 @@ Source: ignition-transport4 -Version: 4.0.0 -Build-Depends: cppzmq, ignition-cmake0, ignition-msgs1, libuuid (!windows&!uwp), protobuf, zeromq +Version: 4.0.0-2 +Build-Depends: cppzmq, ignition-cmake0, ignition-modularscripts, ignition-msgs1, libuuid (!windows&!uwp), protobuf, zeromq Description: Transport middleware for robotics diff --git a/ports/ignition-transport4/portfile.cmake b/ports/ignition-transport4/portfile.cmake index 2d65c0945ce6cd..cdab5c0a6b768d 100644 --- a/ports/ignition-transport4/portfile.cmake +++ b/ports/ignition-transport4/portfile.cmake @@ -1,7 +1,7 @@ -include(vcpkg_common_functions) - include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) ignition_modular_library(NAME transport VERSION "4.0.0" - SHA512 4f8d947e046653fafb27063de3cd97a66c169d53ef48ee5f06b0c0c3a40d7ad0f58028b615a0321aa46ed56aef2acbeeb46a48b2ff3a3d1050df89a3688877c6) + SHA512 d4125044c21fdd6754f3b8b06f372df3f858080d5d33e97ed7a8ef8f6fb9857d562082aad41c89ea9146a33b1c3814305d33c5c8f8bcde66a16477b4a01655b4 + # This can be removed when the pc file of libuuid on Windows is fixed + DISABLE_PKGCONFIG_INSTALL) diff --git a/ports/ignition-transport8/CONTROL b/ports/ignition-transport8/CONTROL new file mode 100644 index 00000000000000..19c9cc552f249a --- /dev/null +++ b/ports/ignition-transport8/CONTROL @@ -0,0 +1,4 @@ +Source: ignition-transport8 +Version: 8.0.0 +Build-Depends: cppzmq, ignition-cmake2, ignition-msgs5, libuuid (!windows&!uwp), protobuf, sqlite3, zeromq +Description: Transport middleware for robotics diff --git a/ports/ignition-transport8/portfile.cmake b/ports/ignition-transport8/portfile.cmake new file mode 100644 index 00000000000000..a8bd8de8ed5e49 --- /dev/null +++ b/ports/ignition-transport8/portfile.cmake @@ -0,0 +1,7 @@ +include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) + +ignition_modular_library(NAME transport + VERSION "8.0.0" + SHA512 ab1bae994a8676864ceb78b87f2258b8ed22036aed87e815fc22f830edd8b087d1ef0406dc0d053ea823d95b5fb765c4867d27ce5653f1d685001aab0cf0ec03 + # This can be removed when the pc file of libuuid on Windows is fixed + DISABLE_PKGCONFIG_INSTALL) diff --git a/ports/imgui-sfml/004-fix-find-sfml.patch b/ports/imgui-sfml/004-fix-find-sfml.patch new file mode 100644 index 00000000000000..51cc0634b50c41 --- /dev/null +++ b/ports/imgui-sfml/004-fix-find-sfml.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4d7a3fa..614564f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,9 +32,6 @@ set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + + if (IMGUI_SFML_FIND_SFML) +- if (NOT BUILD_SHARED_LIBS) +- set(SFML_STATIC_LIBRARIES ON) +- endif() + find_package(SFML COMPONENTS graphics system window) + + if(NOT SFML_FOUND) diff --git a/ports/imgui-sfml/CONTROL b/ports/imgui-sfml/CONTROL index 8db3a4ac6c51e2..ee43509de39647 100644 --- a/ports/imgui-sfml/CONTROL +++ b/ports/imgui-sfml/CONTROL @@ -1,5 +1,5 @@ Source: imgui-sfml -Version: 2.1 +Version: 2.1-1 Homepage: https://github.com/eliasdaler/imgui-sfml Description: ImGui binding for use with SFML Build-Depends: sfml, imgui diff --git a/ports/imgui-sfml/portfile.cmake b/ports/imgui-sfml/portfile.cmake index 47c25669e81001..d283a2624537d4 100644 --- a/ports/imgui-sfml/portfile.cmake +++ b/ports/imgui-sfml/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -10,15 +10,32 @@ vcpkg_from_github( 0001-fix_find_package.patch 0002-fix_imgui_config.patch 0003-fix_osx.patch + 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() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ImGui-SFML) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/imgui-sfml/copyright COPYONLY) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 4a2ce76280e8a5..795ce24a7c6b18 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -3,42 +3,212 @@ project(imgui CXX) set(CMAKE_DEBUG_POSTFIX d) -set(IMGUI_INCLUDES_PUBLIC - imgui.h - imconfig.h +add_library(${PROJECT_NAME} "") +add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +target_include_directories( + ${PROJECT_NAME} + PUBLIC + $ + $ ) -set(IMGUI_INCLUDES_PRIVATE - imgui_internal.h +target_sources( + ${PROJECT_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_widgets.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp ) -set(IMGUI_SOURCES - imgui.cpp - imgui_demo.cpp - imgui_draw.cpp - imgui_widgets.cpp -) +if(IMGUI_BUILD_ALLEGRO5_BINDING) + find_path(ALLEGRO5_INCLUDE_DIRS allegro5/allegro.h) + target_include_directories(${PROJECT_NAME} PRIVATE ${ALLEGRO5_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_allegro5.cpp) +endif() -add_library(${PROJECT_NAME} - ${IMGUI_INCLUDES_PUBLIC} - ${IMGUI_INCLUDES_PRIVATE} - ${IMGUI_SOURCES} -) +if(IMGUI_BUILD_DX9_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx9.cpp) +endif() -target_include_directories(${PROJECT_NAME} PUBLIC $) +if(IMGUI_BUILD_DX10_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx10.cpp) +endif() -install(TARGETS ${PROJECT_NAME} - EXPORT IMGUIExport - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) +if(IMGUI_BUILD_DX11_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx11.cpp) +endif() -install(EXPORT IMGUIExport FILE ${PROJECT_NAME}Config.cmake NAMESPACE ${PROJECT_NAME}:: DESTINATION share/${PROJECT_NAME}) +if(IMGUI_BUILD_DX12_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx12.cpp) +endif() + +if(IMGUI_BUILD_GLFW_BINDING) + find_package(glfw3 REQUIRED) + get_target_property(GLFW3_INCLUDE_DIRS glfw INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${PROJECT_NAME} PRIVATE ${GLFW3_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_glfw.cpp) +endif() + +if(IMGUI_BUILD_GLUT_BINDING) + find_path(GLUT_INCLUDE_DIRS GL/freeglut.h) + target_include_directories(${PROJECT_NAME} PRIVATE ${GLUT_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_glut.cpp) +endif() + +if(IMGUI_BUILD_METAL_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_metal.mm) +endif() + +if(IMGUI_BUILD_OPENGL2_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl2.cpp) +endif() + +if(IMGUI_BUILD_OPENGL3_GLEW_BINDING) + find_package(glew REQUIRED) + target_include_directories(${PROJECT_NAME} PRIVATE ${GLEW_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl3.cpp) +endif() + +if(IMGUI_BUILD_OPENGL3_GLAD_BINDING) + find_package(glad REQUIRED) + get_target_property(GLAD_INCLUDE_DIRS glad::glad INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${PROJECT_NAME} PRIVATE ${GLAD_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl3.cpp) +endif() + +if(IMGUI_BUILD_OPENGL3_GL3W_BINDING) + find_package(gl3w REQUIRED) + get_target_property(GL3W_INCLUDE_DIRS unofficial::gl3w::gl3w INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${PROJECT_NAME} PRIVATE ${GL3W_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl3.cpp) +endif() + +if(IMGUI_BUILD_OPENGL3_GLBINDING_BINDING) + find_package(glbinding REQUIRED) + get_target_property(GLBINDING_INCLUDE_DIRS glbinding::glbinding INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${PROJECT_NAME} PRIVATE ${GLBINDING_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl3.cpp) +endif() + +if(IMGUI_BUILD_OSX_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_osx.mm) +endif() + +if(IMGUI_BUILD_SDL2_BINDING) + find_package(SDL2 CONFIG REQUIRED) + find_path(SDL2_INCLUDE_DIRS SDL2/SDL.h) + target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}/SDL2) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_sdl.cpp) +endif() + +if(IMGUI_BUILD_VULKAN_BINDING) + find_package(Vulkan REQUIRED) + get_target_property(VULKAN_INCLUDE_DIRS Vulkan::Vulkan INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${PROJECT_NAME} PRIVATE ${VULKAN_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_vulkan.cpp) +endif() + +if(IMGUI_BUILD_WIN32_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_win32.cpp) +endif() + +if(IMGUI_FREETYPE) + find_package(Freetype REQUIRED) + target_include_directories(${PROJECT_NAME} PRIVATE ${FREETYPE_INCLUDE_DIRS}) + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.cpp) +endif() + +install( + TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_target + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) if(NOT IMGUI_SKIP_HEADERS) - install( - FILES ${IMGUI_INCLUDES_PUBLIC} + 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}/imstb_rectpack.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_truetype.h + ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h DESTINATION include ) + + if(IMGUI_BUILD_ALLEGRO5_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_allegro5.h DESTINATION include) + endif() + + if(IMGUI_BUILD_DX9_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx9.h DESTINATION include) + endif() + + if(IMGUI_BUILD_DX10_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx10.h DESTINATION include) + endif() + + if(IMGUI_BUILD_DX11_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx11.h DESTINATION include) + endif() + + if(IMGUI_BUILD_DX12_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_dx12.h DESTINATION include) + endif() + + if(IMGUI_BUILD_GLFW_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_glfw.h DESTINATION include) + endif() + + if(IMGUI_BUILD_GLUT_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_glut.h DESTINATION include) + endif() + + if(IMGUI_COPY_MARMALADE_BINDING) + 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() + + if(IMGUI_BUILD_OPENGL2_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl2.h DESTINATION include) + endif() + + if(IMGUI_BUILD_OPENGL3_GLEW_BINDING OR IMGUI_BUILD_OPENGL3_GLAD_BINDING OR IMGUI_BUILD_OPENGL3_GL3W_BINDING OR IMGUI_BUILD_OPENGL3_GLBINDING_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_opengl3.h DESTINATION include) + endif() + + if(IMGUI_BUILD_OSX_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_osx.h DESTINATION include) + endif() + + if(IMGUI_BUILD_SDL2_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_sdl.h DESTINATION include) + endif() + + if(IMGUI_BUILD_VULKAN_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_vulkan.h DESTINATION include) + endif() + + if(IMGUI_BUILD_WIN32_BINDING) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_win32.h DESTINATION include) + endif() + + if(IMGUI_FREETYPE) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.h DESTINATION include) + endif() endif() + +install( + EXPORT ${PROJECT_NAME}_target + NAMESPACE ${PROJECT_NAME}:: + FILE ${PROJECT_NAME}-config.cmake + DESTINATION share/${PROJECT_NAME} +) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index c1484ec8b1e6df..75a46c25c4fee8 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,8 +1,72 @@ Source: imgui -Version: 1.74 +Version: 1.77 +Port-Version: 2 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. -Feature: example -Description: build with examples -Build-Depends: glfw3, freeglut, opengl, sdl1 +Feature: allegro5-binding +Description: Make available Allegro5 binding +Build-Depends: allegro5 + +Feature: dx9-binding +Description: Make available DirectX9 binding + +Feature: dx10-binding +Description: Make available DirectX10 binding + +Feature: dx11-binding +Description: Make available DirectX11 binding + +Feature: dx12-binding +Description: Make available DirectX12 binding + +Feature: glfw-binding +Description: Make available GLFW binding +Build-Depends: glfw3 + +Feature: glut-binding +Description: Make available Glut binding +Build-Depends: freeglut + +Feature: marmalade-binding +Description: Make available Marmalade binding + +Feature: metal-binding +Description: Make available Metal binding + +Feature: opengl2-binding +Description: Make available OpenGL (legacy) binding + +Feature: opengl3-glew-binding +Description: Make available OpenGL3/ES/ES2 (modern) binding with GLEW +Build-Depends: glew + +Feature: opengl3-glad-binding +Description: Make available OpenGL3/ES/ES2 (modern) binding with glad +Build-Depends: glad + +Feature: opengl3-gl3w-binding +Description: Make available OpenGL3/ES/ES2 (modern) binding with gl3w +Build-Depends: gl3w + +Feature: opengl3-glbinding-binding +Description: Make available OpenGL3/ES/ES2 (modern) binding glbinding +Build-Depends: glbinding + +Feature: osx-binding +Description: Make available OSX binding + +Feature: sdl2-binding +Description: Make available SDL2 binding +Build-Depends: sdl2 + +Feature: vulkan-binding +Description: Make available Vulkan binding +Build-Depends: vulkan + +Feature: win32-binding +Description: Make available Win32 binding + +Feature: freetype +Description: Build font atlases using FreeType instead of stb_truetype +Build-Depends: freetype diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index b9cb4eda34274d..6ee33622b9c27b 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -1,45 +1,49 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ocornut/imgui - REF bdce8336364595d1a446957a6164c97363349a53 # v1.74 - SHA512 148c949a4d1a07832e97dbf4b3333b728f7207756a95db633daad83636790abe0a335797b2c5a27938453727de43f6abb9f5a5b41909f223ee735ddd1924eb3f + REF v1.77 + SHA512 d5ebf4bb5e1ce83b226f2e68b3afe0f0abaeb55245fedf754e5453afd8d1df4dac8b5c47fc284c2588b40d05a55fc191b5e55c7be279c5e5e23f7c5b70150546 HEAD_REF master ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + allegro5-binding IMGUI_BUILD_ALLEGRO5_BINDING + dx9-binding IMGUI_BUILD_DX9_BINDING + dx10-binding IMGUI_BUILD_DX10_BINDING + dx11-binding IMGUI_BUILD_DX11_BINDING + dx12-binding IMGUI_BUILD_DX12_BINDING + glfw-binding IMGUI_BUILD_GLFW_BINDING + glut-binding IMGUI_BUILD_GLUT_BINDING + marmalade-binding IMGUI_COPY_MARMALADE_BINDING + metal-binding IMGUI_BUILD_METAL_BINDING + opengl2-binding IMGUI_BUILD_OPENGL2_BINDING + opengl3-glew-binding IMGUI_BUILD_OPENGL3_GLEW_BINDING + opengl3-glad-binding IMGUI_BUILD_OPENGL3_GLAD_BINDING + opengl3-gl3w-binding IMGUI_BUILD_OPENGL3_GL3W_BINDING + opengl3-glbinding-binding IMGUI_BUILD_OPENGL3_GLBINDING_BINDING + osx-binding IMGUI_BUILD_OSX_BINDING + sdl2-binding IMGUI_BUILD_SDL2_BINDING + vulkan-binding IMGUI_BUILD_VULKAN_BINDING + win32-binding IMGUI_BUILD_WIN32_BINDING + freetype IMGUI_FREETYPE +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON ) vcpkg_install_cmake() -if ("example" IN_LIST FEATURES) - if (NOT VCPKG_TARGET_IS_WINDOWS) - message(FATAL_ERROR "Feature example only support windows.") - endif() - vcpkg_build_msbuild( - USE_VCPKG_INTEGRATION - PROJECT_PATH ${SOURCE_PATH}/examples/imgui_examples.sln - ) - - # Install headers - file(GLOB IMGUI_EXAMPLE_INCLUDES ${SOURCE_PATH}/examples/*.h) - file(INSTALL ${IMGUI_EXAMPLE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - - # Install tools - file(GLOB_RECURSE IMGUI_EXAMPLE_BINARIES ${SOURCE_PATH}/examples/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) - file(INSTALL ${IMGUI_EXAMPLE_BINARIES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -endif() - vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() -configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/imgui/copyright COPYONLY) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/implot/CMakeLists.txt b/ports/implot/CMakeLists.txt new file mode 100644 index 00000000000000..0033221cae0bdb --- /dev/null +++ b/ports/implot/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.8) +project(implot CXX) + +find_package(imgui CONFIG REQUIRED) +get_target_property(IMGUI_INCLUDE_DIRS imgui::imgui + INTERFACE_INCLUDE_DIRECTORIES +) + +set(CMAKE_DEBUG_POSTFIX d) + +add_library(${PROJECT_NAME} "") +add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +target_include_directories( + ${PROJECT_NAME} + PUBLIC + $ + $ + PRIVATE + ${IMGUI_INCLUDE_DIRS} +) + +target_sources( + ${PROJECT_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/implot.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/implot_demo.cpp +) + +install( + TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_target + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +if(NOT IMPLOT_SKIP_HEADERS) + install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/implot.h + DESTINATION include + ) +endif() + +install( + EXPORT ${PROJECT_NAME}_target + NAMESPACE ${PROJECT_NAME}:: + FILE ${PROJECT_NAME}-config.cmake + DESTINATION share/${PROJECT_NAME} +) diff --git a/ports/implot/CONTROL b/ports/implot/CONTROL new file mode 100644 index 00000000000000..f887c457940c89 --- /dev/null +++ b/ports/implot/CONTROL @@ -0,0 +1,5 @@ +Source: implot +Version: 0.3-1 +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 new file mode 100644 index 00000000000000..d9b59d430ce45b --- /dev/null +++ b/ports/implot/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO epezent/implot + REF v0.3 + SHA512 28d25a76b725879ad796249edc87910fec721fcd43b80171947e00c4983a945f82f2b555f1794882b79c96a4497da982dc45695fed5eedcf6009f87c05576817 + 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 + -DIMPLOT_SKIP_HEADERS=ON +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/indicators/CONTROL b/ports/indicators/CONTROL index ceda7065c75d03..49fb9f51d24e68 100644 --- a/ports/indicators/CONTROL +++ b/ports/indicators/CONTROL @@ -1,4 +1,4 @@ Source: indicators -Version: 1.5 +Version: 1.7 Description: Activity indicators for modern C++ Homepage: https://github.com/p-ranav/indicators diff --git a/ports/indicators/portfile.cmake b/ports/indicators/portfile.cmake index 46b5660a64d0df..e406e93cf70031 100644 --- a/ports/indicators/portfile.cmake +++ b/ports/indicators/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO p-ranav/indicators - REF e697a43fec7ae2198275022cea071236fcc7a52f - SHA512 7b06816e6e3fb78ade46906c51aec5dc8c3dae6d826871914c36373d0f55daf3839ba35630f74be11eec18766ad4084131b3c8fa411f371f253c71239e6861ea + REF ec1973607d5b360b3d1f9b07af851ce236ebd0ae + SHA512 9b9678129525f03ece91217eb71098b8e14f76f178f9abfd24aa0679bcf7ae27dd600bdba185987e9908dfd8fb5e837dc903a8be011fb08d8707216a3084522a HEAD_REF master ) @@ -12,14 +12,14 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DINDICA_BUILD_TESTS=OFF - -DSAMPLES=OFF - -DDEMO=OFF + -DINDICATORS_BUILD_TESTS=OFF + -DINDICATORS_SAMPLES=OFF + -DINDICATORS_DEMO=OFF ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/indica TARGET_PATH share/indica) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/indicators TARGET_PATH share/indicators) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) diff --git a/ports/infoware/CONTROL b/ports/infoware/CONTROL new file mode 100644 index 00000000000000..c0bec34efd3718 --- /dev/null +++ b/ports/infoware/CONTROL @@ -0,0 +1,19 @@ +Source: infoware +Homepage: https://github.com/ThePhD/infoware +Version: 0.5.4 +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! +Supports: !(arm|uwp) + +Feature: x11 +Description: Prefer usage of X11 to find graphical capabilities. + +Feature: d3d +Description: Prefer usage of Direct3D to find graphical capabilities (typically only works on Windows systems). + +Feature: opencl +Description: Prefer usage of OpenCL to find graphical capabilities of the system. + +Feature: opengl +Description: Prefer usage of OpenGL to find graphical capabilities (may require additional libraries to be available for linking depending on the system). diff --git a/ports/infoware/portfile.cmake b/ports/infoware/portfile.cmake new file mode 100644 index 00000000000000..7fbfe1fd8aeebf --- /dev/null +++ b/ports/infoware/portfile.cmake @@ -0,0 +1,38 @@ +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 + HEAD_REF master +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + x11 INFOWARE_USE_X11 + d3d INFOWARE_USE_D3D + opencl INFOWARE_USE_OPENCL + opengl INFOWARE_USE_OPENGL +) + +# git must be injected, because vcpkg isolates the build +# from the environment entirely to have reproducible builds +vcpkg_find_acquire_program(GIT) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DINFOWARE_EXAMPLES=OFF + -DINFOWARE_TESTS=OFF + -DGIT_EXECUTABLE=${GIT} + -DGIT_FOUND=true +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/iniparser/CMakeLists.txt b/ports/iniparser/CMakeLists.txt new file mode 100644 index 00000000000000..9c4f6edf7f6657 --- /dev/null +++ b/ports/iniparser/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.14) + +project(iniparser LANGUAGES C) + +include(GNUInstallDirs) + +set(CMAKE_DISABLE_SOURCE_CHANGES ON) +set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + +# iniparser.pc +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) +set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) +set(datarootdir ${prefix}/${CMAKE_INSTALL_DATAROOTDIR}) +set(datadir ${prefix}/${CMAKE_INSTALL_DATADIR}) + +configure_file(iniparser.pc ${CMAKE_CURRENT_BINARY_DIR}/iniparser.pc) + +set(iniparser_sources + src/dictionary.c + src/iniparser.c +) + +add_library(iniparser ${iniparser_sources}) + +target_include_directories(iniparser + PUBLIC + $ + $ +) + +target_compile_definitions(iniparser + PRIVATE + $<$:_CRT_SECURE_NO_WARNINGS> +) + +install(TARGETS iniparser EXPORT unofficial-iniparser-config) + +install( + EXPORT unofficial-iniparser-config + NAMESPACE unofficial::iniparser:: + DESTINATION share/unofficial-iniparser + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) + +install( + FILES src/dictionary.h src/iniparser.h + DESTINATION include +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/iniparser.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +) diff --git a/ports/iniparser/CONTROL b/ports/iniparser/CONTROL new file mode 100644 index 00000000000000..ee5f47c00d28ff --- /dev/null +++ b/ports/iniparser/CONTROL @@ -0,0 +1,4 @@ +Source: iniparser +Version: 2020-04-06 +Homepage: ndevilla.free.fr/iniparser +Description: C library for parsing INI-style files diff --git a/ports/iniparser/portfile.cmake b/ports/iniparser/portfile.cmake new file mode 100644 index 00000000000000..94eb59601ede04 --- /dev/null +++ b/ports/iniparser/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ndevilla/iniparser + REF f858275f7f307eecba84c2f5429483f9f28007f8 + SHA512 48c80b2163f86d8ca0f3253128d8528214e2f0680b4bceb686180c01b29cd2a0c3b9d6e7156a8e28649b14bc1d8a51b34c2d3d258013b35f69aaf6c3ded9ecdc + HEAD_REF master + PATCHES + win32_ssize_t.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/iniparser/win32_ssize_t.patch b/ports/iniparser/win32_ssize_t.patch new file mode 100644 index 00000000000000..3fefee6c8cb8ef --- /dev/null +++ b/ports/iniparser/win32_ssize_t.patch @@ -0,0 +1,29 @@ +diff --git a/src/dictionary.c b/src/dictionary.c +index cb7ccd4..7985ab3 100644 +--- a/src/dictionary.c ++++ b/src/dictionary.c +@@ -18,7 +18,6 @@ + #include + #include + #include +-#include + + /** Maximum value size for integers and doubles. */ + #define MAXVALSZ 1024 +diff --git a/src/dictionary.h b/src/dictionary.h +index d04b6ce..929ae17 100644 +--- a/src/dictionary.h ++++ b/src/dictionary.h +@@ -21,7 +21,12 @@ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#else + #include ++#endif + + #ifdef __cplusplus + extern "C" { diff --git a/ports/irrlicht/CMakeLists.txt b/ports/irrlicht/CMakeLists.txt index e17d718d822ada..d7e0c8f50ff405 100644 --- a/ports/irrlicht/CMakeLists.txt +++ b/ports/irrlicht/CMakeLists.txt @@ -16,7 +16,7 @@ set(IRR_TOOL_DIR "tools") # ------------------------------------------------------------------------------------------------- set(DXSDK "") if(DEFINED ENV{DXSDK_DIR}) - set(DXSDK "ENV{DXSDK_DIR}") + set(DXSDK "$ENV{DXSDK_DIR}") endif() set(IRR_UNICODE_PATH 0 CACHE BOOL "Whether to enable unicode path support on windows") diff --git a/ports/irrlicht/CONTROL b/ports/irrlicht/CONTROL index 5870178c2964cc..e8ff45bdd81fd5 100644 --- a/ports/irrlicht/CONTROL +++ b/ports/irrlicht/CONTROL @@ -1,8 +1,9 @@ Source: irrlicht -Version: 1.8.4-5 +Version: 1.8.4-10 Homepage: http://irrlicht.sourceforge.net Description: Irrlicht lightning fast 3d engine Build-Depends: zlib, libpng, bzip2, libjpeg-turbo +Supports: !(arm|uwp|osx) Feature: unicode Description: Support unicode path on windows diff --git a/ports/irrlicht/portfile.cmake b/ports/irrlicht/portfile.cmake index f10e80422f4169..cad4ca5a03f5ab 100644 --- a/ports/irrlicht/portfile.cmake +++ b/ports/irrlicht/portfile.cmake @@ -1,20 +1,15 @@ -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlicht-1.8.4.zip" - FILENAME "irrlicht-1.8.4.zip" - SHA512 de69ddd2c6bc80a1b27b9a620e3697b1baa552f24c7d624076d471f3aecd9b15f71dce3b640811e6ece20f49b57688d428e3503936a7926b3e3b0cc696af98d1 -) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "osx" "uwp") -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF "1.8.4" - PATCHES - "fix-encoding.patch" + REPO irrlicht/Irrlicht%20SDK + REF 1.8/1.8.4 + FILENAME "irrlicht-1.8.4.zip" + SHA512 de69ddd2c6bc80a1b27b9a620e3697b1baa552f24c7d624076d471f3aecd9b15f71dce3b640811e6ece20f49b57688d428e3503936a7926b3e3b0cc696af98d1 + PATCHES fix-encoding.patch ) -# Copy CMakeLists.txt to the source, because Irrlicht does not have one. -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${SOURCE_PATH}) +configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY) vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -24,10 +19,7 @@ vcpkg_check_features( tools IRR_BUILD_TOOLS ) -set(SHARED_LIB TRUE) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(SHARED_LIB FALSE) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED_LIB) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -52,7 +44,5 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/irrlicht) endif() -# Post-build test for cmake libraries -vcpkg_test_cmake(PACKAGE_NAME irrlicht) -file(INSTALL ${SOURCE_PATH}/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) \ No newline at end of file diff --git a/ports/ismrmrd/CONTROL b/ports/ismrmrd/CONTROL index d35ea2daee720c..a86ed84cc25245 100644 --- a/ports/ismrmrd/CONTROL +++ b/ports/ismrmrd/CONTROL @@ -1,4 +1,5 @@ Source: ismrmrd -Version: 1.4.1 +Version: 1.4.2 Description: ISMRM Raw Data Format Build-Depends: pugixml, hdf5, boost, fftw3 +Homepage: https://github.com/ismrmrd/ismrmrd \ No newline at end of file diff --git a/ports/ismrmrd/fix_static.patch b/ports/ismrmrd/fix_static.patch deleted file mode 100644 index e9bd5f360adfe7..00000000000000 --- a/ports/ismrmrd/fix_static.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/tests/test_main.cpp b/tests/test_main.cpp -index 4b1809d..7ec1414 100644 ---- a/tests/test_main.cpp -+++ b/tests/test_main.cpp -@@ -1,4 +1,3 @@ --#define BOOST_TEST_DYN_LINK - #define BOOST_TEST_MODULE "ISMRMRD Unit Tests" - #include - diff --git a/ports/ismrmrd/portfile.cmake b/ports/ismrmrd/portfile.cmake index 0182718fdd020e..d702d4f9cb2c7b 100644 --- a/ports/ismrmrd/portfile.cmake +++ b/ports/ismrmrd/portfile.cmake @@ -2,15 +2,13 @@ if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(WIN32_INCLUDE_STDDEF_PATCH "x86-windows-include-stddef.patch") endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(STATIC_PATCH "fix_static.patch") -endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ismrmrd/ismrmrd - REF 1066d90e5d87302ccd71ce58ee153b5c87783064 # v1.4.1 - SHA512 a830bd3b8a9580cf182f436066213441ee04c781e6e721b82287550f2ca552d58c5390d80b4b6a6b7bd8483fa3e45bf00858268706cedb99a4390ca047eb4d6c + REF v1.4.2.1 + SHA512 8d3f3efb9fc52464c626d8a4b4328f92f69ea6a709aa1b4d4312c9740a342094cadecd028ac169b6c89df92503037a3156172d7955abcd616630f0a309b9e0b5 HEAD_REF master PATCHES ${STATIC_PATCH} @@ -25,6 +23,9 @@ vcpkg_configure_cmake( -DUSE_SYSTEM_PUGIXML=ON -DUSE_HDF5_DATASET_SUPPORT=ON -DVCPKG_TARGET_TRIPLET=ON + -DBUILD_TESTS=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_UTILITIES=OFF ) vcpkg_install_cmake() @@ -66,18 +67,6 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) set(EXECUTABLE_SUFFIX ".exe") endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_c_example${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_c_example${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_generate_cartesian_shepp_logan${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_generate_cartesian_shepp_logan${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_info${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_info${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_read_timing_test${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_read_timing_test${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_recon_cartesian_2d${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_recon_cartesian_2d${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_test_xml${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_test_xml${EXECUTABLE_SUFFIX}) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) diff --git a/ports/itk/CONTROL b/ports/itk/CONTROL index 282ac4b3c6a647..d316675cb33cf0 100644 --- a/ports/itk/CONTROL +++ b/ports/itk/CONTROL @@ -1,9 +1,37 @@ Source: itk -Version: 5.0.1-2 +Version: 5.1.0 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/itpp/CONTROL b/ports/itpp/CONTROL index 95a49293b225b8..2d4fa89005dec7 100644 --- a/ports/itpp/CONTROL +++ b/ports/itpp/CONTROL @@ -1,3 +1,4 @@ -Source: itpp -Version: 4.3.1-1 +Source: itpp +Version: 4.3.1-5 +Homepage: http://itpp.sourceforge.net Description: IT++ is a C++ library of mathematical, signal processing and communication classes and functions. Its main use is in simulation of communication systems and for performing research in the area of communications. \ No newline at end of file diff --git a/ports/itpp/portfile.cmake b/ports/itpp/portfile.cmake index 84fc651e4332a1..730607b373397f 100644 --- a/ports/itpp/portfile.cmake +++ b/ports/itpp/portfile.cmake @@ -1,16 +1,11 @@ -include(vcpkg_common_functions) - set(ITPP_VERSION 4.3.1) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/itpp/files/itpp/${ITPP_VERSION}/itpp-${ITPP_VERSION}.tar.bz2" - FILENAME "itpp-${ITPP_VERSION}.tar.bz2" - SHA512 b46d048fa7f33e80d2291a5e38e205c159791ea200f92c70d69e8ad8447ac2f0c847fece566a99af739853a1643cb16e226b4200c8bf115417f324e6d38c66bd -) -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO itpp/itpp REF ${ITPP_VERSION} + FILENAME "itpp-${ITPP_VERSION}.tar.bz2" + SHA512 b46d048fa7f33e80d2291a5e38e205c159791ea200f92c70d69e8ad8447ac2f0c847fece566a99af739853a1643cb16e226b4200c8bf115417f324e6d38c66bd PATCHES msvc2013.patch fix-uwp.patch diff --git a/ports/ixwebsocket/CONTROL b/ports/ixwebsocket/CONTROL index 4acae5c3f0dcc6..dac666e368464d 100644 --- a/ports/ixwebsocket/CONTROL +++ b/ports/ixwebsocket/CONTROL @@ -1,5 +1,5 @@ Source: ixwebsocket -Version: 9.1.9 +Version: 9.6.2 Build-Depends: zlib Homepage: https://github.com/machinezone/IXWebSocket Description: Lightweight WebSocket Client and Server + HTTP Client and Server diff --git a/ports/ixwebsocket/portfile.cmake b/ports/ixwebsocket/portfile.cmake index 68e523a055bea2..23aa61cef4f01e 100644 --- a/ports/ixwebsocket/portfile.cmake +++ b/ports/ixwebsocket/portfile.cmake @@ -1,14 +1,27 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO machinezone/IXWebSocket - REF v9.1.9 - SHA512 f1fd731b5f6a9ce6d6d10bee22a5d9d9baaa8ea0564d6c4cd7eb91dcb88a45c49b2c7fdb75f8640a3589c1b30cee33ef5df8dcbb55920d013394d1e33ddd3c8e + REF v9.6.2 + SHA512 22a97f0c74d5789fd265627bbadfce02116a41fca888d684b756cbb1c070d626517855e265c484870d02db7084b6c1107d500acc1c13e327ede0c23228a54f7b ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + openssl USE_OPEN_SSL + mbedtls USE_MBED_TLS + sectransp USE_SECURE_TRANSPORT +) + +if("sectransp" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_OSX) + message(FATAL_ERROR "sectransp is not supported on non-Apple platforms") +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja - OPTIONS -DUSE_TLS=1 + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DUSE_TLS=1 ) vcpkg_install_cmake() @@ -17,6 +30,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME ixwebsocket) diff --git a/ports/jaeger-client-cpp/CONTROL b/ports/jaeger-client-cpp/CONTROL new file mode 100644 index 00000000000000..6d6d47032cb497 --- /dev/null +++ b/ports/jaeger-client-cpp/CONTROL @@ -0,0 +1,6 @@ +Source: jaeger-client-cpp +Version: 0.5.1-1 +Build-Depends: nlohmann-json,thrift,yaml-cpp,opentracing +Homepage: https://github.com/jaegertracing/jaeger-client-cpp +Description: C++ OpenTracing binding for Jaeger https://jaegertracing.io/ +Supports: !arm64 diff --git a/ports/jaeger-client-cpp/fix-CMakeLists.patch b/ports/jaeger-client-cpp/fix-CMakeLists.patch new file mode 100644 index 00000000000000..e0e1b6c5991f5f --- /dev/null +++ b/ports/jaeger-client-cpp/fix-CMakeLists.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5893f31..c8864fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + endif() + + hunter_add_package(thrift) +-find_package(thrift ${hunter_config} REQUIRED) ++find_package(Thrift CONFIG REQUIRED) + if(HUNTER_ENABLED) + list(APPEND LIBS thrift::thrift_static) + else() +@@ -268,6 +268,9 @@ if(JAEGERTRACING_PLUGIN) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/export.map + "{ global: OpenTracingMakeTracerFactory; local: *; };") + add_library(jaegertracing_plugin MODULE ${SRC}) ++ if (WIN32) ++ target_link_libraries(jaegertracing_plugin PUBLIC Iphlpapi Ws2_32) ++ endif() + add_lib_deps(jaegertracing_plugin) + target_link_libraries(jaegertracing_plugin PUBLIC + -static-libgcc +@@ -410,7 +413,7 @@ include(GNUInstallDirs) + # * /lib*/cmake/ + # * /lib*/ + # * /include/ +-set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") ++set(config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/jaeger-client-cpp") + + set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") + diff --git a/ports/jaeger-client-cpp/portfile.cmake b/ports/jaeger-client-cpp/portfile.cmake new file mode 100644 index 00000000000000..d56f5ec1cedee6 --- /dev/null +++ b/ports/jaeger-client-cpp/portfile.cmake @@ -0,0 +1,68 @@ +vcpkg_fail_port_install(ON_ARCH "arm64") + +# Get jaeger-idl from github +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jaegertracing/jaeger-idl + REF 378b83a64a4a822a4e7d2936bac5d787780555ad + SHA512 eceea3dc806600bea8a05b597e26035e97950db227bbefc582d8f20ad549e0be42ebfad92ef3927ebc4892233bac9bcf85a96a25c17ec71fbca0b1b1755f556f + HEAD_REF master +) + +# Create target directory for proxy/stub generation +file(MAKE_DIRECTORY ${SOURCE_PATH}/data) +# List of input files +set(THRIFT_SOURCE_FILES agent.thrift jaeger.thrift sampling.thrift zipkincore.thrift crossdock/tracetest.thrift baggage.thrift dependency.thrift aggregation_validator.thrift) + +# Generate proxy/stubs for the input files +foreach(THRIFT_SOURCE_FILE IN LISTS THRIFT_SOURCE_FILES) +vcpkg_execute_required_process( + COMMAND ${CURRENT_INSTALLED_DIR}/tools/thrift/thrift --gen cpp:no_skeleton -o "${SOURCE_PATH}/data" ${THRIFT_SOURCE_FILE} + WORKING_DIRECTORY ${SOURCE_PATH}/thrift + LOGNAME jaeger-idl-${TARGET_TRIPLET} +) +endforeach() + +# Save generated proxy/stub target directory +set(IDL_SOURCE_DIR "${SOURCE_PATH}/data/gen-cpp") + +# Get jaeger-client-cpp from github +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jaegertracing/jaeger-client-cpp + REF 47fbf19aae2e48d59dd8335b6f2a1e1a99abba7f + SHA512 a07e4d3e585c0f3e99aff6a662229f6beed8aef80fc6f7188629da38421bc49ab9effea479398e0d94e0a127bd931054ab332b38b73c2191bf75d4adfe5f6928 + HEAD_REF master + PATCHES + "fix-CMakeLists.patch" +) + +# Do not use hunter, not testtools and build opentracing plugin +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DHUNTER_ENABLED=0 + -DBUILD_TESTING=0 + -DJAEGERTRACING_PLUGIN=0 + -DJAEGERTRACING_BUILD_EXAMPLES=0 +) + +# Copy generated files over to jaeger-client-cpp +file(GLOB IDL_SOURCE_FILES LIST_DIRECTORIES false ${IDL_SOURCE_DIR}/*) +file(COPY ${IDL_SOURCE_FILES} DESTINATION ${SOURCE_PATH}/src/jaegertracing/thrift-gen) + +# Generate Jaeger client +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +# Cleanup unused Debug files +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) + +# Cleanup +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/jaegertracing/testutils) diff --git a/ports/josuttis-jthread/CONTROL b/ports/josuttis-jthread/CONTROL new file mode 100644 index 00000000000000..760fb6eb716f0e --- /dev/null +++ b/ports/josuttis-jthread/CONTROL @@ -0,0 +1,4 @@ +Source: josuttis-jthread +Version: 2020-07-21 +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..e01c165855d732 --- /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/json-schema-validator/CONTROL b/ports/json-schema-validator/CONTROL new file mode 100644 index 00000000000000..a602b1dec7e4d3 --- /dev/null +++ b/ports/json-schema-validator/CONTROL @@ -0,0 +1,5 @@ +Source: json-schema-validator +Version: 2.1.0 +Homepage: https://github.com/pboettch/json-schema-validator +Description: This is a C++ library for validating JSON documents based on a JSON Schema. This validator is based on nlohmann json library. +Build-Depends: nlohmann-json[core] diff --git a/ports/json-schema-validator/cmake-find-package.patch b/ports/json-schema-validator/cmake-find-package.patch new file mode 100644 index 00000000000000..995ae06b084c29 --- /dev/null +++ b/ports/json-schema-validator/cmake-find-package.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c4cc218..ff2b706 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 3.2) + option(BUILD_TESTS "Build tests" ON) + option(BUILD_EXAMPLES "Build examples" ON) + ++find_package(nlohmann_json CONFIG REQUIRED) ++ + # the library + add_library(nlohmann_json_schema_validator + src/json-schema-draft7.json.cpp +@@ -34,6 +36,13 @@ set_target_properties(nlohmann_json_schema_validator + # because of the dependency to nlohmann_json. + set(JSON_VALIDATOR_INSTALL ON) + ++target_link_libraries( ++ nlohmann_json_schema_validator ++ PUBLIC ++ nlohmann_json ++ nlohmann_json::nlohmann_json) ++ ++if(0) + # here we decice how nlohmann::json is found and used to build this project + + # first, check whether a nlohmann_json::nlohmann_json target exists already +@@ -92,7 +101,7 @@ else() + set(nlohmann_json_DIR ${JSON_HPP}) + endif() + endif() +- ++endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + target_compile_options(nlohmann_json_schema_validator diff --git a/ports/json-schema-validator/fix-ambiguous-assignment.patch b/ports/json-schema-validator/fix-ambiguous-assignment.patch new file mode 100644 index 00000000000000..3e655b485e6e15 --- /dev/null +++ b/ports/json-schema-validator/fix-ambiguous-assignment.patch @@ -0,0 +1,13 @@ +diff --git a/src/json-validator.cpp b/src/json-validator.cpp +index f16f3ef..1f7b615 100644 +--- a/src/json-validator.cpp ++++ b/src/json-validator.cpp +@@ -663,7 +663,7 @@ public: + #ifndef NO_STD_REGEX + attr = sch.find("pattern"); + if (attr != sch.end()) { +- patternString_ = attr.value(); ++ patternString_ = attr.value().get(); + pattern_ = {true, REGEX_NAMESPACE::regex(attr.value().get(), + REGEX_NAMESPACE::regex::ECMAScript)}; + sch.erase(attr); diff --git a/ports/json-schema-validator/forward-find-package.patch b/ports/json-schema-validator/forward-find-package.patch new file mode 100644 index 00000000000000..e5ddde525b9cd6 --- /dev/null +++ b/ports/json-schema-validator/forward-find-package.patch @@ -0,0 +1,14 @@ +diff --git a/nlohmann_json_schema_validatorConfig.cmake.in b/nlohmann_json_schema_validatorConfig.cmake.in +index 6ee0df2..e0315fa 100644 +--- a/nlohmann_json_schema_validatorConfig.cmake.in ++++ b/nlohmann_json_schema_validatorConfig.cmake.in +@@ -7,6 +7,9 @@ + get_filename_component(NLOHMANN_JSON_SCHEMA_VALIDATOR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + set(NLOHMANN_JSON_SCHEMA_VALIDATOR_INCLUDE_DIRS @CONF_INCLUDE_DIRS@) + ++include(CMakeFindDependencyMacro) ++find_dependency(nlohmann_json) ++ + # Our library dependencies (contains definitions for IMPORTED targets) + if(NOT TARGET json-schema-validator) + include("${NLOHMANN_JSON_SCHEMA_VALIDATOR_CMAKE_DIR}/nlohmann_json_schema_validatorTargets.cmake") diff --git a/ports/json-schema-validator/portfile.cmake b/ports/json-schema-validator/portfile.cmake new file mode 100644 index 00000000000000..941ec5372e2469 --- /dev/null +++ b/ports/json-schema-validator/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pboettch/json-schema-validator + REF 27fc1d094503623dfe39365ba82581507524545c + SHA512 4fd05087743f43871586a53d119acd1a19d0bdec8a5620f62b6eee7a926d285842e8439127eec52eeb11069c92b8d9af28558897d48e2422ecafca39d9f23cdb + HEAD_REF master + PATCHES + fix-ambiguous-assignment.patch + cmake-find-package.patch + forward-find-package.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTS=OFF + -DBUILD_EXAMPLES=OFF +) + +vcpkg_install_cmake() + +set(PKG_NAME "nlohmann_json_schema_validator") +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PKG_NAME} TARGET_PATH share/${PKG_NAME}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + diff --git a/ports/json-schema-validator/usage b/ports/json-schema-validator/usage new file mode 100644 index 00000000000000..3493d3808e8669 --- /dev/null +++ b/ports/json-schema-validator/usage @@ -0,0 +1,4 @@ +The package json-schema-validator provides CMake integration: + + find_package(nlohmann_json_schema_validator REQUIRED) + target_link_libraries(main PRIVATE nlohmann_json_schema_validator) diff --git a/ports/jsoncons/CONTROL b/ports/jsoncons/CONTROL index 320e9a4d7836be..8058bd386b8fff 100644 --- a/ports/jsoncons/CONTROL +++ b/ports/jsoncons/CONTROL @@ -1,4 +1,4 @@ Source: jsoncons -Version: 0.150.0 -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.154.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 14f25e01da4620..a75e97c3887e92 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 36c0fa7895da3adef6eab8aec1e9c2f5720fc110 # v0.150.0 - SHA512 ef1379c40c31f3974a707edd133c1fcff544535f91680caee1f8616f04b1bb56bfdd2aedb46e89b73b34572296511557158d66ea1002a0499d68cacd23143d29 + REF b51fdde4b51b048b4a86aa8d7f1b17fac1ca1c85 # v0.154.1 + SHA512 aa77bf2d9c6e8f21f0b04f4edcfb6bad486f5f1a7b7ed296101ca4d09da4e916b0425ce7d63408a7ebca238aeb695ac5248da7b94600eec3e7c42d7ddceffb1c HEAD_REF master ) diff --git a/ports/jwt-cpp/CONTROL b/ports/jwt-cpp/CONTROL index 7815f16408a72e..7cc3d449639ab3 100644 --- a/ports/jwt-cpp/CONTROL +++ b/ports/jwt-cpp/CONTROL @@ -1,3 +1,5 @@ Source: jwt-cpp -Version: 2019-05-07-1 +Version: 0.4.0 +Homepage: https://github.com/Thalhammer/jwt-cpp Description: A header only library for creating and validating json web tokens in c++ +Build-Depends: picojson \ No newline at end of file diff --git a/ports/jwt-cpp/fix-picojson.patch b/ports/jwt-cpp/fix-picojson.patch deleted file mode 100644 index 44c04fe58d46ef..00000000000000 --- a/ports/jwt-cpp/fix-picojson.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h -index ec56810..a26fd97 100644 ---- a/include/jwt-cpp/jwt.h -+++ b/include/jwt-cpp/jwt.h -@@ -1,6 +1,6 @@ - #pragma once - #define PICOJSON_USE_INT64 --#include "picojson.h" -+#include "picojson/picojson.h" - #include "base.h" - #include - #include diff --git a/ports/jwt-cpp/fix-warning.patch b/ports/jwt-cpp/fix-warning.patch index d013a7782b2445..4c2e166c3a9b3f 100644 --- a/ports/jwt-cpp/fix-warning.patch +++ b/ports/jwt-cpp/fix-warning.patch @@ -1,31 +1,31 @@ -diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h -index dfca7fc..4d05c0b 100644 ---- a/include/jwt-cpp/base.h -+++ b/include/jwt-cpp/base.h -@@ -2,6 +2,10 @@ - #include - #include - -+#ifdef _MSC_VER -+#pragma warning(disable : 4267) -+#endif -+ - namespace jwt { - namespace alphabet { - struct base64 { -diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h -index ec56810..313cef2 100644 ---- a/include/jwt-cpp/jwt.h -+++ b/include/jwt-cpp/jwt.h -@@ -12,6 +12,11 @@ - #include - #include - -+#ifdef _MSC_VER -+#pragma warning(disable : 4267) -+#pragma warning(disable : 4067) -+#endif -+ - //If openssl version less than 1.1 - #if OPENSSL_VERSION_NUMBER < 269484032 - #define OPENSSL10 +diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h +index 375e0eb..4023709 100644 +--- a/include/jwt-cpp/base.h ++++ b/include/jwt-cpp/base.h +@@ -2,6 +2,10 @@ + #include + #include + ++#ifdef _MSC_VER ++#pragma warning(disable : 4267) ++#endif ++ + #ifdef __has_cpp_attribute + #if __has_cpp_attribute(fallthrough) + #define JWT_FALLTHROUGH [[fallthrough]] +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +index 6e55729..4579310 100644 +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -12,6 +12,11 @@ + #include + #include + ++#ifdef _MSC_VER ++#pragma warning(disable : 4267) ++#pragma warning(disable : 4067) ++#endif ++ + //If openssl version less than 1.1 + #if OPENSSL_VERSION_NUMBER < 0x10100000L + #define OPENSSL10 diff --git a/ports/jwt-cpp/portfile.cmake b/ports/jwt-cpp/portfile.cmake index 3ac1a02a4f8899..00c4496c91de4b 100644 --- a/ports/jwt-cpp/portfile.cmake +++ b/ports/jwt-cpp/portfile.cmake @@ -1,13 +1,12 @@ -#header-only library -include(vcpkg_common_functions) - -vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH REPO Thalhammer/jwt-cpp - REF 1d2b1bac13e54f99df4f890cd674ec149c135762 - SHA512 a45f12104e38a8b05a0ea5b5f91034b65d85dd048664bbda4f2909df32688726d599161e3d6541fd6f36c784d21c24a4d2666f670c3281b9e9130bc8a96fce39 + REF 34bb0644ea613cfcbc09c148db9de8aa6c5612b5 # v0.4.0 + SHA512 773007fc7a73a831e292451d7a38feb9434f7c11c653d43b9f3679c564f64805a1cbd1baab6b13107c42cc06549ad7cd08aebd6658d8ee0022f5b8d601fa94cc HEAD_REF master - PATCHES fix-picojson.patch - fix-warning.patch) + PATCHES + fix-warning.patch +) # Copy the header files file(GLOB HEADER_FILES ${SOURCE_PATH}/include/jwt-cpp/*) @@ -15,7 +14,4 @@ file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/jwt-cpp REGEX "\.(gitattributes|gitignore|picojson.h)$" EXCLUDE) -# Put the licence file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/jwt-cpp) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/jwt-cpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/jwt-cpp/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/kd-soap/CONTROL b/ports/kd-soap/CONTROL index 2bc553cf5e0200..e9d922e0f39fcc 100644 --- a/ports/kd-soap/CONTROL +++ b/ports/kd-soap/CONTROL @@ -1,5 +1,5 @@ Source: kd-soap -Version: 1.8.0-1 +Version: 1.8.0-2 Description: A Qt-based client-side and server-side SOAP component Homepage: https://www.kdab.com/products/kd-soap -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/kf5archive/CONTROL b/ports/kf5archive/CONTROL index 29e641a8f70571..16592e34e80d1d 100644 --- a/ports/kf5archive/CONTROL +++ b/ports/kf5archive/CONTROL @@ -1,4 +1,5 @@ Source: kf5archive -Version: 5.64.0 +Version: 5.64.0-1 +Homepage: https://api.kde.org/frameworks/karchive/html/index.html Description: File compression -Build-Depends: ecm, qt5-base, zlib, bzip2 +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/kf5holidays/CONTROL b/ports/kf5holidays/CONTROL index 0221e7177d1fcc..c1545e97909190 100644 --- a/ports/kf5holidays/CONTROL +++ b/ports/kf5holidays/CONTROL @@ -1,4 +1,4 @@ Source: kf5holidays -Version: 5.64.0 +Version: 5.64.0-1 Description: Holiday calculation library -Build-Depends: ecm, qt5-base, qt5-tools +Build-Depends: ecm, qt5-base[core], qt5-tools diff --git a/ports/kf5i18n/CONTROL b/ports/kf5i18n/CONTROL new file mode 100644 index 00000000000000..4cb5ce4d594c39 --- /dev/null +++ b/ports/kf5i18n/CONTROL @@ -0,0 +1,5 @@ +Source: kf5i18n +Version: 5.64.0 +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..efa22a577c9f82 --- /dev/null +++ b/ports/kf5i18n/portfile.cmake @@ -0,0 +1,35 @@ +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 PACKAGES mingw-w64-i686-gettext) + 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/kf5plotting/CONTROL b/ports/kf5plotting/CONTROL index ede11f24cee25c..2eb191a7190076 100644 --- a/ports/kf5plotting/CONTROL +++ b/ports/kf5plotting/CONTROL @@ -1,5 +1,5 @@ Source: kf5plotting -Version: 5.64.0 +Version: 5.64.0-1 Homepage: https://api.kde.org/frameworks/kplotting/html/index.html Description: Lightweight plotting framework -Build-Depends: ecm, qt5-base, qt5-tools +Build-Depends: ecm, qt5-base[core], qt5-tools diff --git a/ports/kf5syntaxhighlighting/CONTROL b/ports/kf5syntaxhighlighting/CONTROL index 43fde5781f0a1d..52cca4b36fdbe6 100644 --- a/ports/kf5syntaxhighlighting/CONTROL +++ b/ports/kf5syntaxhighlighting/CONTROL @@ -1,5 +1,5 @@ Source: kf5syntaxhighlighting -Version: 5.64.0 +Version: 5.64.0-1 Homepage: https://github.com/KDE/syntax-highlighting Description: Syntax highlighting engine for Kate syntax definitions -Build-Depends: ecm, qt5-base, qt5-tools, qt5-xmlpatterns +Build-Depends: ecm, qt5-base[core], qt5-tools, qt5-xmlpatterns 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/kfr/CONTROL b/ports/kfr/CONTROL new file mode 100644 index 00000000000000..985ba86bf82575 --- /dev/null +++ b/ports/kfr/CONTROL @@ -0,0 +1,15 @@ +Source: kfr +Version: 2020-06-15 +Description: Fast, modern C++ DSP framework +Homepage: https://www.kfr.dev/ +Supports: !(arm|linux) + +Feature: capi +Description: Enable C API build +Build-Depends: kfr[dft] + +Feature: dft +Description: Enable DFT and related algorithms + +Feature: dft-np +Description: Enable Non-power of 2 DFT diff --git a/ports/kfr/portfile.cmake b/ports/kfr/portfile.cmake new file mode 100644 index 00000000000000..2cd702e2f90ae2 --- /dev/null +++ b/ports/kfr/portfile.cmake @@ -0,0 +1,34 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "Linux") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO kfrlib/kfr + REF 1f9706197abfcd4b4ec19ded3ce37b70ebd9a223 + SHA512 901c6984a46a7abcc28adf9397759156a9e8d173e028c236ab423568ed20b3a3efe207be9660c961539c73a2767afaedcd76133304f542d3299353942cf13f5e + HEAD_REF master +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + capi ENABLE_CAPI_BUILD + dft ENABLE_DFT + dft-np ENABLE_DFT_NP +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DENABLE_TESTS=OFF + -DENABLE_ASMTEST=OFF + -DREGENERATE_TESTS=OFF + -DKFR_EXTENDED_TESTS=OFF + -DSKIP_TESTS=ON + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +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/kissfft/CMakeLists.txt b/ports/kissfft/CMakeLists.txt new file mode 100644 index 00000000000000..8d522ecb9205b0 --- /dev/null +++ b/ports/kissfft/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 3.14) + +project(kissfft LANGUAGES C) + +include(GNUInstallDirs) + +option(KF_USE_SIMD "Use SIMD" OFF) +option(KF_INSTALL_HEADERS "Install header files" ON) + +if (KF_USE_SIMD) + set(KF_SCALAR_TYPE "__m128" CACHE STRING "Definition of kiss_fft_scalar") +else () + set(KF_SCALAR_TYPE "float" CACHE STRING "Definition of kiss_fft_scalar") +endif () + +# TODO: FIXED_POINT +# TODO: -msse + +set(kissfft_sources kiss_fft.c) + +if (WIN32 AND BUILD_SHARED_LIBS) + list(APPEND kissfft_sources exports.def) +endif () + +add_library(kissfft ${kissfft_sources}) + +if (BUILD_SHARED_LIBS) + set_property( + TARGET kissfft + PROPERTY POSITION_INDEPENDENT_CODE ON + ) +endif () + +target_include_directories( + kissfft + PUBLIC + $ +) + +target_compile_definitions( + kissfft + PUBLIC + $<$:USE_SIMD> + kiss_fft_scalar=${KF_SCALAR_TYPE} +) + +if (KF_INSTALL_HEADERS) + install( + FILES + _kiss_fft_guts.h + kiss_fft.h + kissfft.hh + kissfft_i32.hh + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) +endif () + +install(TARGETS kissfft EXPORT unofficial-kissfft-config) + +install( + EXPORT unofficial-kissfft-config + NAMESPACE unofficial::kissfft:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-kissfft + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) diff --git a/ports/kissfft/CONTROL b/ports/kissfft/CONTROL new file mode 100644 index 00000000000000..0c4f0f6a8b46e4 --- /dev/null +++ b/ports/kissfft/CONTROL @@ -0,0 +1,4 @@ +Source: kissfft +Version: 2020-03-30 +Homepage: https://github.com/mborgerding/kissfft +Description: A Fast Fourier Transform (FFT) library that tries to Keep it Simple, Stupid diff --git a/ports/kissfft/exports.def b/ports/kissfft/exports.def new file mode 100644 index 00000000000000..09897b9da58dbc --- /dev/null +++ b/ports/kissfft/exports.def @@ -0,0 +1,6 @@ +EXPORTS + kiss_fft_alloc + kiss_fft + kiss_fft_stride + kiss_fft_cleanup + kiss_fft_next_fast_size diff --git a/ports/kissfft/portfile.cmake b/ports/kissfft/portfile.cmake new file mode 100644 index 00000000000000..d5eea7889a5d6e --- /dev/null +++ b/ports/kissfft/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mborgerding/kissfft + REF 3f3fc6ab55da8610aba7fe89dcda09cf3a31f4e6 + SHA512 5d3781a82d067cebd0a20c6b35a2d806598ba66f3bbf282c49a2ac9a6d09e1307dca1f8bc5fcc4c5955dc2f66aa94ca4dcfe00e6b31ea4694aa9d507f194554e + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/exports.def DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DKF_INSTALL_HEADERS=OFF + OPTIONS_RELEASE + -DKF_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets( + CONFIG_PATH lib/cmake/unofficial-${PORT} + TARGET_PATH share/unofficial-${PORT} +) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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..0d7883a0ef2ec7 --- /dev/null +++ b/ports/lapack/CONTROL @@ -0,0 +1,4 @@ +Source: lapack +Version: 0 +Description: Metapackage for packages which provide LAPACK +Build-Depends: clapack (!osx) \ No newline at end of file diff --git a/ports/lapack/portfile.cmake b/ports/lapack/portfile.cmake new file mode 100644 index 00000000000000..cb7d75de956c15 --- /dev/null +++ b/ports/lapack/portfile.cmake @@ -0,0 +1,3 @@ +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) +# Make sure LAPACK can be found +vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR}) diff --git a/ports/lastools/CONTROL b/ports/lastools/CONTROL index 31113037314e32..dbeb69fc890b2b 100644 --- a/ports/lastools/CONTROL +++ b/ports/lastools/CONTROL @@ -1,5 +1,5 @@ Source: lastools -Version: 2019-07-10 +Version: 2020-05-09 Homepage: https://github.com/LAStools/LAStools Description: LAStools: award-winning software for efficient LiDAR processing (with LASzip) Supports: !uwp \ No newline at end of file diff --git a/ports/lastools/fix_install_paths_lastools.patch b/ports/lastools/fix_install_paths_lastools.patch new file mode 100644 index 00000000000000..10bb34070546f8 --- /dev/null +++ b/ports/lastools/fix_install_paths_lastools.patch @@ -0,0 +1,27 @@ +diff --git a/LASlib/src/CMakeLists.txt b/LASlib/src/CMakeLists.txt +index 1b170bf..b5c40cb 100644 +--- a/LASlib/src/CMakeLists.txt ++++ b/LASlib/src/CMakeLists.txt +@@ -99,17 +99,8 @@ if(MSVC) + ) + endif() + ++install(TARGETS LASlib EXPORT LASlib-targets ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${LAS_INCLUDES} DESTINATION include/LASlib) +- +-if (MSVC) +- foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) +- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib/${OUTPUTCONFIG} DESTINATION lib/LASlib) +- endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) +-else() +- install(TARGETS LASlib EXPORT laslib-targets +- ARCHIVE DESTINATION lib/LASlib +- LIBRARY DESTINATION lib/LASlib +- RUNTIME DESTINATION lib/LASlib) +- install(EXPORT laslib-targets DESTINATION lib/cmake/LASlib) +- install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION lib/cmake/LASlib) +-endif(MSVC) ++install(EXPORT LASlib-targets DESTINATION share/lastools/LASlib) ++install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION share/lastools/LASlib) +\ No newline at end of file diff --git a/ports/lastools/portfile.cmake b/ports/lastools/portfile.cmake index 5f6e40397f369a..c3b4eb24640b2c 100644 --- a/ports/lastools/portfile.cmake +++ b/ports/lastools/portfile.cmake @@ -9,9 +9,11 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO LAStools/LAStools - REF f15a702530e098b46c2eb3923f89a68ffa81e668 - SHA512 df5763b7c69721ba2a24fde2b4092e53136020b88ff4cc0d533279d709c55d7d16d8a4300f0b68829294d9311ed674af5b15306c4ded7a6310e55404737702e0 + REF 7c444a4bbae16fe43c676824a26419bb740a6ab8 + SHA512 4503b033a5319caee5570f25a05009c0d05a8c61a43ed78317899faaeba82fbc1f9a8c8433772bb36547c74e850a2e68d20a16f6f22b12b3004da7e1aa2f334b HEAD_REF master + PATCHES + "fix_install_paths_lastools.patch" ) vcpkg_configure_cmake( @@ -22,12 +24,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() 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) endif() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/libaaplus/CONTROL b/ports/libaaplus/CONTROL index eb5df3ff0fbc85..2d14f7e06d130a 100644 --- a/ports/libaaplus/CONTROL +++ b/ports/libaaplus/CONTROL @@ -1,5 +1,5 @@ Source: libaaplus -Version: 2.12 +Version: 2.12-1 Description: libaaplus is an astronomical computations library by naughter software Homepage: http://www.naughter.com/aa.html diff --git a/ports/libaaplus/portfile.cmake b/ports/libaaplus/portfile.cmake index d0b862655ddc56..358fdaba644cfb 100644 --- a/ports/libaaplus/portfile.cmake +++ b/ports/libaaplus/portfile.cmake @@ -2,16 +2,16 @@ set(VERSION 2.12) vcpkg_download_distfile( ARCHIVE_FILE - URLS "http://www.naughter.com/download/aaplus.zip" - FILENAME "aaplus.zip" + URLS "http://www.naughter.com/download/aaplus_v${VERSION}.zip" + FILENAME "aaplus_v${VERSION}.zip" SHA512 ec3a3d1346637fbed3ec5093ded821c6d80950a6432378d9826ed842571d8670cd5d2a1c9ff58a18f308e18669d786f72d24961e26bd8e070ee35674688a39e7 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE_FILE} - REF ${VERSION} - NO_REMOVE_ONE_LEVEL + REF ${VERSION} + NO_REMOVE_ONE_LEVEL ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libaiff/CONTROL b/ports/libaiff/CONTROL index 490e53a7c9e0ac..889511a5cf602e 100644 --- a/ports/libaiff/CONTROL +++ b/ports/libaiff/CONTROL @@ -1,4 +1,4 @@ Source: libaiff -Version: 5.0-2 +Version: 5.0-6 Homepage: https://sourceforge.net/projects/aifftools Description: LibAiff is an open-source library, providing C applications transparent read & write operations for Audio Interchange File Format (AIFF) files, with the goal of supporting all of its features diff --git a/ports/libaiff/portfile.cmake b/ports/libaiff/portfile.cmake index ad8e7b7db2b2b5..97d8673b6b4f97 100644 --- a/ports/libaiff/portfile.cmake +++ b/ports/libaiff/portfile.cmake @@ -1,19 +1,14 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/aifftools/files/libaiff/LibAiff%205.0/libaiff-5.0-release.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO aifftools/libaiff + REF LibAiff%205.0 FILENAME "libaiff-5.0-release.tar.gz" SHA512 7800f9a3fbd0c5a17b8cc6c9b60181131d159ab5f5fb8e7de54e8f88c151717a988231de664a635e61940267c854a9ce83d58b12e322dcdda3aa8080c7b15f66 -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH PATCHES - "${CMAKE_CURRENT_LIST_DIR}/allow_utf_16_filename.patch" - "${CMAKE_CURRENT_LIST_DIR}/buffer_uninitialized.patch" + allow_utf_16_filename.patch + buffer_uninitialized.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -22,7 +17,8 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}/libaiff) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() @@ -38,4 +34,4 @@ foreach(HEADER ${HEADERS}) endforeach() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libaiff RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index 6678faacccf536..0fd8a794802bc3 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,15 +1,20 @@ Source: libarchive Version: 3.4.1 +Port-Version: 5 Homepage: https://github.com/libarchive/libarchive Description: Library for reading and writing streaming archives Build-Depends: zlib -Default-Features: bzip2, libxml2, lz4, lzma, lzo, openssl +Default-Features: bzip2, libxml2, lz4, lzma, lzo, openssl, zstd Supports: !uwp Feature: bzip2 Build-Depends: bzip2 Description: BZip2 support +Feature: zstd +Build-Depends: zstd +Description: zstd support + Feature: libxml2 Build-Depends: libxml2 Description: Libxml2 support diff --git a/ports/libarchive/disable-c4061.patch b/ports/libarchive/disable-c4061.patch new file mode 100644 index 00000000000000..e09c9ca6ebf3ca --- /dev/null +++ b/ports/libarchive/disable-c4061.patch @@ -0,0 +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/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index fd475b199a6743..a9bb4955cf764c 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( fix-lz4.patch fix-zstd.patch fix-cpu-set.patch + disable-c4061.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -21,8 +22,29 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS lzma ENABLE_LZMA lzo ENABLE_LZO openssl ENABLE_OPENSSL + zstd ENABLE_ZSTD + # The below features should be added to CONTROL + #pcre ENABLE_PCREPOSIX + #nettle ENABLE_NETTLE + #expat ENABLE_EXPAT + #libgcc ENABLE_LibGCC + #cng ENABLE_CNG + #tar ENABLE_TAR # Tool build option? + #cpio ENABLE_CPIO # Tool build option? + #cat ENABLE_CAT # Tool build option? + #xattr ENABLE_XATTR # Tool support option? + #acl ENABLE_ACL # Tool support option? + #iconv ENABLE_ICONV # iconv support option? + #libb2 ENABLE_LIBB2 ) +if(FEATURES MATCHES "pcre") +else() + list(APPEND FEATURE_OPTIONS -DPOSIX_REGEX_LIB=NONE) +endif() + +list(APPEND FEATURE_OPTIONS -DENABLE_ZLIB=ON) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -38,15 +60,24 @@ vcpkg_configure_cmake( -DENABLE_CAT=OFF -DENABLE_XATTR=OFF -DENABLE_ACL=OFF - -DENABLE_TEST=OFF -DENABLE_ICONV=OFF - -DPOSIX_REGEX_LIB=NONE + -DENABLE_TEST=OFF -DENABLE_WERROR=OFF ) vcpkg_install_cmake() vcpkg_copy_pdbs() +foreach(_feature IN LISTS FEATURE_OPTIONS) + string(REPLACE "-D" "" _feature "${_feature}") + string(REPLACE "=" ";" _feature "${_feature}") + string(REPLACE "ON" "1" _feature "${_feature}") + string(REPLACE "OFF" "0" _feature "${_feature}") + list(GET _feature 0 _feature_name) + list(GET _feature 1 _feature_status) + set(${_feature_name} ${_feature_status}) +endforeach() +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) foreach(HEADER ${CURRENT_PACKAGES_DIR}/include/archive.h ${CURRENT_PACKAGES_DIR}/include/archive_entry.h) file(READ ${HEADER} CONTENTS) @@ -54,5 +85,4 @@ foreach(HEADER ${CURRENT_PACKAGES_DIR}/include/archive.h ${CURRENT_PACKAGES_DIR} file(WRITE ${HEADER} "${CONTENTS}") endforeach() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libarchive) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libarchive/COPYING ${CURRENT_PACKAGES_DIR}/share/libarchive/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libarchive/vcpkg-cmake-wrapper.cmake b/ports/libarchive/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..5e78381372ac37 --- /dev/null +++ b/ports/libarchive/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,112 @@ +_find_package(${ARGS}) + +if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + if(@ENABLE_ZLIB@) + find_package(ZLIB REQUIRED) + list(APPEND LibArchive_LIBRARIES ZLIB::ZLIB) + endif() + if(@ENABLE_BZip2@) + find_package(BZip2 REQUIRED) + list(APPEND LibArchive_LIBRARIES BZip2::BZip2) + endif() + if(@ENABLE_LIBXML2@) + find_package(LibXml2 REQUIRED) + list(APPEND LibArchive_LIBRARIES LibXml2::LibXml2) + endif() + if(@ENABLE_LZ4@) + find_package(lz4 REQUIRED) + list(APPEND LibArchive_LIBRARIES lz4::lz4) + endif() + if(@ENABLE_LZMA@) + find_package(LibLZMA REQUIRED) + list(APPEND LibArchive_LIBRARIES LibLZMA::LibLZMA) + endif() + if(@ENABLE_LZO@) + find_library(LZO_LIBRARY_DEBUG NAMES lzo2d lzo2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) + find_library(LZO_LIBRARY_RELEASE NAMES lzo2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) + if(LZO_LIBRARY_RELEASE) + list(APPEND LibArchive_LIBRARIES optimized ${LZO_LIBRARY_RELEASE}) + endif() + if(LZO_LIBRARY_DEBUG) + list(APPEND LibArchive_LIBRARIES debug ${LZO_LIBRARY_DEBUG}) + endif() + endif() + if(@ENABLE_ZSTD@) + find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) + find_library(ZSTD_LIBRARY_RELEASE NAMES zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) + if(ZSTD_LIBRARY_RELEASE) + list(APPEND LibArchive_LIBRARIES optimized ${ZSTD_LIBRARY_RELEASE}) + endif() + if(ZSTD_LIBRARY_DEBUG) + list(APPEND LibArchive_LIBRARIES debug ${ZSTD_LIBRARY_DEBUG}) + endif() + endif() + if(@ENABLE_OPENSSL@) + find_package(OpenSSL REQUIRED) + list(APPEND LibArchive_LIBRARIES OpenSSL::Crypto) + endif() + + if(TARGET LibArchive::LibArchive) + if(@ENABLE_BZip2@) + target_link_libraries(LibArchive::LibArchive INTERFACE BZip2::BZip2) + endif() + if(@ENABLE_ZLIB@) + target_link_libraries(LibArchive::LibArchive INTERFACE ZLIB::ZLIB) + endif() + if(@ENABLE_LIBXML2@) + target_link_libraries(LibArchive::LibArchive INTERFACE LibXml2::LibXml2) + endif() + if(@ENABLE_LZ4@) + target_link_libraries(LibArchive::LibArchive INTERFACE lz4::lz4) + endif() + if(@ENABLE_LZMA@) + target_link_libraries(LibArchive::LibArchive INTERFACE LibLZMA::LibLZMA) + endif() + if(@ENABLE_LZO@) + if(LZO_LIBRARY_RELEASE) + list(APPEND interface_lib \$<\$>:${LZO_LIBRARY_RELEASE}>) + endif() + if(LZO_LIBRARY_DEBUG) + list(APPEND interface_lib \$<\$:${LZO_LIBRARY_DEBUG}>) + endif() + set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${interface_lib}) + endif() + if(@ENABLE_ZSTD@) + if(ZSTD_LIBRARY_RELEASE) + list(APPEND interface_lib \$<\$>:${ZSTD_LIBRARY_RELEASE}>) + endif() + if(ZSTD_LIBRARY_DEBUG) + list(APPEND interface_lib \$<\$:${ZSTD_LIBRARY_DEBUG}>) + endif() + set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${interface_lib}) + endif() + if(@ENABLE_OPENSSL@) + target_link_libraries(LibArchive::LibArchive INTERFACE OpenSSL::Crypto) + endif() + endif() +endif() + + +# TODO in some future +# if(@ENABLE_PCREPOSIX@) +# endif() +# if(@ENABLE_NETTLE@) +# endif() +# if(@ENABLE_EXPAT@) +# endif() +# if(@ENABLE_LibGCC@) +# endif() +# if(@ENABLE_CNG@) +# endif() +# if(@ENABLE_TAR@) +# endif() +# if(@ENABLE_CPIO@) +# endif() +# if(@ENABLE_CAT@) +# endif() +# if(@ENABLE_XATTR@) +# endif() +# if(@ENABLE_ACL@) +# endif() +# if(@ENABLE_ICONV@) +# endif() 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/CONTROL b/ports/libb2/CONTROL deleted file mode 100644 index 0523b60d5d8367..00000000000000 --- a/ports/libb2/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: libb2 -Version: 0.98.1 -Homepage: https://github.com/BLAKE2/libb2 -Description: C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp \ No newline at end of file diff --git a/ports/libb2/portfile.cmake b/ports/libb2/portfile.cmake index 88007bdf0de485..2401cf0c1e2e62 100644 --- a/ports/libb2/portfile.cmake +++ b/ports/libb2/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX") +vcpkg_fail_port_install(ON_TARGET "WINDOWS") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -8,16 +8,21 @@ vcpkg_from_github( HEAD_REF master ) +set(OPTIONS) +if(CMAKE_HOST_WIN32) + set(OPTIONS --disable-native) # requires cpuid +endif() + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG + OPTIONS ${OPTIONS} ) - vcpkg_install_make() +vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() -# 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/libb2/vcpkg.json b/ports/libb2/vcpkg.json new file mode 100644 index 00000000000000..1d2f19db823e96 --- /dev/null +++ b/ports/libb2/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "libb2", + "version-string": "0.98.1", + "port-version": 3, + "description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp", + "homepage": "https://github.com/BLAKE2/libb2", + "supports": "!windows" +} diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL index ab99da6baa18cd..6c929c8830e620 100644 --- a/ports/libbson/CONTROL +++ b/ports/libbson/CONTROL @@ -1,4 +1,5 @@ Source: libbson -Version: 1.15.1-1 +Version: 1.16.1 +Port-Version: 1 Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. Homepage: https://github.com/mongodb/libbson diff --git a/ports/libbson/fix-static-cmake.patch b/ports/libbson/fix-static-cmake.patch new file mode 100644 index 00000000000000..11e11dcbadbb0c --- /dev/null +++ b/ports/libbson/fix-static-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in +index 92933fe..d98ebd3 100644 +--- a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in ++++ b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in +@@ -36,3 +36,7 @@ foreach (LIB @LIBBSON_LIBRARIES@) + endforeach () + + set (BSON_STATIC_DEFINITIONS BSON_STATIC) ++ ++set (BSON_LIBRARIES ${BSON_STATIC_LIBRARIES}) ++set (BSON_INCLUDE_DIRS ${BSON_STATIC_INCLUDE_DIRS}) ++set (BSON_DEFINITIONS BSON_STATIC) +\ No newline at end of file diff --git a/ports/libbson/fix-uwp.patch b/ports/libbson/fix-uwp.patch index 8a793aece30b70..9342e81bd0d95e 100644 --- a/ports/libbson/fix-uwp.patch +++ b/ports/libbson/fix-uwp.patch @@ -1,6 +1,8 @@ +diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt +index 7c479d8..d383424 100644 --- a/src/libbson/CMakeLists.txt +++ b/src/libbson/CMakeLists.txt -@@ -217,6 +217,9 @@ set (HEADERS_FORWARDING +@@ -226,6 +226,9 @@ set (HEADERS_FORWARDING ${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h ) @@ -9,8 +11,8 @@ +if (NOT ENABLE_STATIC MATCHES "ON|AUTO") add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) set (CMAKE_CXX_VISIBILITY_PRESET hidden) - set_target_properties (bson_shared PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;JSONSL_PARSE_NAN") -@@ -258,16 +261,21 @@ if (WIN32) + target_compile_definitions (bson_shared PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN) +@@ -268,9 +271,13 @@ if (WIN32) # must be handled specially since we can't resolve them set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) endif () @@ -19,12 +21,12 @@ if (ENABLE_STATIC MATCHES "ON|AUTO") add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) - set_target_properties (bson_static PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;BSON_STATIC;JSONSL_PARSE_NAN") - set_target_properties (bson_static PROPERTIES VERSION 0.0.0) - set_target_properties (bson_static PROPERTIES OUTPUT_NAME "bson-static-${BSON_API_VERSION}") + set(THREADS_PREFER_PTHREAD_FLAG 1) -+ find_package (Threads REQUIRED) - target_link_libraries (bson_static Threads::Threads) ++ find_package(Threads REQUIRED) + target_compile_definitions (bson_static + PUBLIC BSON_STATIC + PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN +@@ -284,6 +291,7 @@ if (ENABLE_STATIC MATCHES "ON|AUTO") if (RT_LIBRARY) target_link_libraries (bson_static ${RT_LIBRARY}) endif () @@ -32,7 +34,7 @@ if (M_LIBRARY) target_link_libraries (bson_static ${M_LIBRARY}) endif () -@@ -282,7 +290,7 @@ function (add_example bin src) +@@ -298,7 +306,7 @@ function (add_example bin src) add_executable (${bin} ${BSON_EXAMPLE_SOURCES}) # Link against the shared lib like normal apps @@ -41,73 +43,106 @@ set (EXAMPLES ${EXAMPLES} ${bin}) endfunction () -@@ -304,6 +312,7 @@ set (BSON_HEADER_INSTALL_DIR - "${CMAKE_INSTALL_INCLUDEDIR}/libbson-${BSON_API_VERSION}" +@@ -322,7 +330,7 @@ set (BSON_HEADER_INSTALL_DIR ) -+if (NOT ENABLE_STATIC MATCHES "ON|AUTO") - install ( - TARGETS bson_shared ${EXAMPLES} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -@@ -311,6 +320,7 @@ install ( - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} - ) -+endif () if (ENABLE_STATIC MATCHES "ON|AUTO") - install ( - TARGETS bson_static ${EXAMPLES} +- set (TARGETS_TO_INSTALL bson_shared bson_static) ++ set (TARGETS_TO_INSTALL bson_static) + else () + set (TARGETS_TO_INSTALL bson_shared) + endif () +@@ -337,6 +345,7 @@ install ( + ) + + if (MSVC) ++ if (NOT ENABLE_STATIC MATCHES "ON|AUTO") + add_custom_command ( + TARGET bson_shared + POST_BUILD +@@ -348,6 +357,7 @@ if (MSVC) + FILES $/lib$ + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) ++ else() + if (TARGET bson_static) + add_custom_command ( + TARGET bson_static +@@ -361,6 +371,7 @@ if (MSVC) + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif () ++ endif() + endif () + + install ( +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index 0f9e50c..85eb429 100644 --- a/src/libmongoc/CMakeLists.txt +++ b/src/libmongoc/CMakeLists.txt -@@ -609,6 +609,7 @@ if (WIN32) +@@ -694,6 +694,7 @@ if (WIN32) set (LIBRARIES ${LIBRARIES} ws2_32) endif () +if (NOT MONGOC_ENABLE_STATIC) add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) - target_link_libraries (mongoc_shared ${LIBRARIES} ${BSON_LIBRARIES}) -@@ -617,6 +618,7 @@ target_compile_definitions (mongoc_shared PUBLIC MONGOC_COMPILATION ${BSON_DEFIN + target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) +@@ -704,6 +705,7 @@ target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION) set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) - set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "mongoc-${MONGOC_API_VERSION}" PREFIX "lib") + set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}") +endif () if (MONGOC_ENABLE_STATIC) add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -639,7 +641,11 @@ if (ENABLE_APPLE_FRAMEWORK) +@@ -731,7 +733,11 @@ if (ENABLE_APPLE_FRAMEWORK) endif () add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) +if (MONGOC_ENABLE_STATIC) +target_link_libraries (mongoc-stat mongoc_static) +else () - target_link_libraries (mongoc-stat mongoc_shared) + target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) +endif () # mongoc-stat works if shared memory performance counters are enabled. if (ENABLE_SHM_COUNTERS STREQUAL "ON") -@@ -870,6 +876,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/json DESTINATION ${PROJECT_BINARY_DIR}/te - file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR}/tests) +@@ -977,7 +983,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) -+if (NOT MONGOC_ENABLE_STATIC) - install ( - TARGETS mongoc_shared ${EXAMPLES} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -@@ -877,10 +884,11 @@ install ( - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} + if (MONGOC_ENABLE_STATIC) +- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) ++ set (TARGETS_TO_INSTALL mongoc_static) + else () + set (TARGETS_TO_INSTALL mongoc_shared) + endif () +@@ -997,6 +1003,7 @@ install ( ) -+endif () - if (MONGOC_ENABLE_STATIC) - install ( -- TARGETS mongoc_shared mongoc_static ${EXAMPLES} -+ TARGETS mongoc_static ${EXAMPLES} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + if (MSVC) ++ if (NOT ENABLE_STATIC MATCHES "ON|AUTO") + add_custom_command ( + TARGET mongoc_shared + POST_BUILD +@@ -1008,6 +1015,7 @@ if (MSVC) + FILES $/lib$ + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) ++ else() + if (TARGET mongoc_static) + add_custom_command ( + TARGET mongoc_static +@@ -1021,6 +1029,7 @@ if (MSVC) + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif () ++ endif() + endif () + + install ( +diff --git a/src/libmongoc/src/mongoc/mongoc-gridfs-file.c b/src/libmongoc/src/mongoc/mongoc-gridfs-file.c +index 0690b86..98721df 100644 --- a/src/libmongoc/src/mongoc/mongoc-gridfs-file.c +++ b/src/libmongoc/src/mongoc/mongoc-gridfs-file.c @@ -765,7 +765,7 @@ _mongoc_gridfs_file_refresh_page (mongoc_gridfs_file_t *file) @@ -119,6 +154,8 @@ const char *key; bson_iter_t iter; int64_t existing_chunks; +diff --git a/src/libmongoc/src/mongoc/mongoc-handshake.c b/src/libmongoc/src/mongoc/mongoc-handshake.c +index 8374af2..5491595 100644 --- a/src/libmongoc/src/mongoc/mongoc-handshake.c +++ b/src/libmongoc/src/mongoc/mongoc-handshake.c @@ -286,7 +286,8 @@ _get_os_version (void) @@ -131,6 +168,8 @@ OSVERSIONINFO osvi; ZeroMemory (&osvi, sizeof (OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); +diff --git a/src/libmongoc/src/mongoc/mongoc-util.c b/src/libmongoc/src/mongoc/mongoc-util.c +index 99939ff..3c25e19 100644 --- a/src/libmongoc/src/mongoc/mongoc-util.c +++ b/src/libmongoc/src/mongoc/mongoc-util.c @@ -84,7 +84,11 @@ _mongoc_hex_md5 (const char *input) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index bec809e7e7541f..8430b3ef62c959 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,10 +1,13 @@ +# This port needs to be updated at the same time as mongo-c-driver vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mongodb/mongo-c-driver - REF 541086adcf1eecf88ac09fda47d9a8ec1598015d # debian/1.15.1-1 - SHA512 a57438dfae9d0993ae04b7a76677f79331699898f21e7645db5edd2c91014f33b738a0af67b58234d1ee03aab2ae3b58c183bbd043fc2bde5cc1a4e111755b70 + REF 99d422877c5b5ea52006c13ee3b48297251b2b2d # debian/1.16.1 + SHA512 e2f129439ff3697981774e0de35586a6afe98838acfc52d8a115bcb298350f2779b886dc6b27130e78b3b81f9b0a85b2bc6bcef246f9685c05f6789747c4739d HEAD_REF master - PATCHES fix-uwp.patch + PATCHES + fix-uwp.patch + fix-static-cmake.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -20,6 +23,7 @@ string(REGEX REPLACE ".+Version:[ ]*([\\.0-9]+).*" "\\1" BUILD_VERSION "${_conte vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE OPTIONS -DENABLE_MONGOC=OFF -DENABLE_BSON=ON @@ -30,10 +34,15 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +set(PORT_POSTFIX "1.0") + if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libbson-static-1.0) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libbson-static-${PORT_POSTFIX} TARGET_PATH share/bson-${PORT_POSTFIX}) else() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libbson-1.0) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libbson-${PORT_POSTFIX} TARGET_PATH share/bson-${PORT_POSTFIX}) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver) @@ -41,7 +50,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver) # This rename is needed because the official examples expect to use #include # See Microsoft/vcpkg#904 file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 + ${CURRENT_PACKAGES_DIR}/include/libbson-${PORT_POSTFIX} ${CURRENT_PACKAGES_DIR}/temp) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) @@ -49,47 +58,27 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/libbson-static-1.0.a - ${CURRENT_PACKAGES_DIR}/lib/libbson-1.0.a) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/libbson-static-1.0.a - ${CURRENT_PACKAGES_DIR}/debug/lib/libbson-1.0.a) - else() - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) - endif() - # drop the __declspec(dllimport) when building static - file(READ ${CURRENT_PACKAGES_DIR}/include/bson/bson-macros.h LIBBSON_MACROS_H) - string(REPLACE "define BSON_API __declspec(dllimport)" "define BSON_API" LIBBSON_MACROS_H "${LIBBSON_MACROS_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/bson/bson-macros.h "${LIBBSON_MACROS_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/bson/bson-macros.h + "define BSON_API __declspec(dllimport)" "define BSON_API") + + file(RENAME ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/libbson-static-${PORT_POSTFIX}-config.cmake + ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/bson-${PORT_POSTFIX}-config.cmake) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/libbson-static-${PORT_POSTFIX}-config-version.cmake + ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/bson-${PORT_POSTFIX}-config-version.cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) -endif() - -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/libbson/copyright COPYONLY) -file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(PORT_POSTFIX "static-1.0") else() - set(PORT_POSTFIX "1.0") + file(RENAME ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/libbson-${PORT_POSTFIX}-config.cmake + ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/bson-${PORT_POSTFIX}-config.cmake) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/libbson-${PORT_POSTFIX}-config-version.cmake + ${CURRENT_PACKAGES_DIR}/share/bson-${PORT_POSTFIX}/bson-${PORT_POSTFIX}-config-version.cmake) endif() -# Create cmake files for _both_ find_package(libbson) and find_package(libbson-static-1.0)/find_package(libbson-1.0) -file(READ ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake LIBBSON_CONFIG_CMAKE) -string(REPLACE "/include/libbson-1.0" "/include" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}") -string(REPLACE "bson-static-1.0" "bson-1.0" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake "${LIBBSON_CONFIG_CMAKE}") -file(COPY ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-${PORT_POSTFIX}) -file(COPY ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-${PORT_POSTFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config-version.cmake) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/bson-1.0/bson-1.0-config.cmake + "include/libbson-1.0" "include/") -vcpkg_copy_pdbs() +file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/libbson/usage b/ports/libbson/usage new file mode 100644 index 00000000000000..873243c81481cd --- /dev/null +++ b/ports/libbson/usage @@ -0,0 +1,6 @@ +The package libbson is compatible with built-in CMake targets: + + find_package(libbson-1.0 CONFIG REQUIRED) + target_include_directories(main PRIVATE ${BSON_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${BSON_LIBRARIES}) + target_compile_definitions(main PRIVATE ${BSON_DEFINITIONS}) diff --git a/ports/libcopp/CONTROL b/ports/libcopp/CONTROL index ab8db193db0035..8c91625400a562 100644 --- a/ports/libcopp/CONTROL +++ b/ports/libcopp/CONTROL @@ -1,3 +1,6 @@ Source: libcopp -Version: 1.2.1 +Version: 1.3.1 +Port-Version: 1 Description: A cross-platfrom coroutine library for C++ +Maintainer: owent +Homepage: https://libcopp.atframe.work/ diff --git a/ports/libcopp/portfile.cmake b/ports/libcopp/portfile.cmake index fa5de5d38084f2..5b6be64bb86d2c 100644 --- a/ports/libcopp/portfile.cmake +++ b/ports/libcopp/portfile.cmake @@ -1,31 +1,25 @@ -include(vcpkg_common_functions) - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO owt5008137/libcopp - REF 1.2.1 - SHA512 bd3525b7cafb261b395ab767d30654ee7c2920f2b8312ed7887b004e764b8dd8dece5f34a5f7724d16c4a56a281ea9eb3107eff54c947160fbf9f12b76b34485 + REF 1.3.1 + SHA512 0401f91a98b5e3961bcda45a6249fec72f03c88ae5155f4406ba8922f47ccf187f65d6f13dedb6dcd6934bb6cb742a34e84a2fd29ca9cc5b87ca19a517a64591 HEAD_REF v2 ) -# Use libcopp's own build process, skipping examples and tests vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE - # PREFER_NINJA # Disabled because Ninja does not invoke masm correctly for this project ) + vcpkg_install_cmake() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/libcopp) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/libcopp) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libcopp) -file(COPY ${SOURCE_PATH}/BOOST_LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/libcopp) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libcopp/copyright) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/BOOST_LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/libcopp/usage b/ports/libcopp/usage deleted file mode 100644 index 4593a42adf579a..00000000000000 --- a/ports/libcopp/usage +++ /dev/null @@ -1,5 +0,0 @@ -The package libcopp provides CMake integration: - - find_package(Libcopp CONFIG REQUIRED) - target_include_directories(main PRIVATE ${Libcopp_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${Libcotask_LIBRARIES} ${Libcopp_LIBRARIES}) diff --git a/ports/libcrafter/CONTROL b/ports/libcrafter/CONTROL index 76c3c1bc2837bc..b8ebac0bf72624 100644 --- a/ports/libcrafter/CONTROL +++ b/ports/libcrafter/CONTROL @@ -1,5 +1,5 @@ Source: libcrafter -Version: 0.3 +Version: 0.3-1 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 diff --git a/ports/libcrafter/portfile.cmake b/ports/libcrafter/portfile.cmake index 57427906b1e2d5..9965b7d3c9f0e9 100644 --- a/ports/libcrafter/portfile.cmake +++ b/ports/libcrafter/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platforms" ON_TARGET "Windows" "OSX") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pellegre/libcrafter @@ -11,10 +9,9 @@ vcpkg_from_github( vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG PROJECT_SUBPATH libcrafter OPTIONS - --with-libpcap=${CURRENT_INSTALLED_DIR} + "--with-libpcap=${CURRENT_INSTALLED_DIR}" ) vcpkg_install_make() 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/libdisasm/CONTROL b/ports/libdisasm/CONTROL index 32e725aa67cf33..1a09c870ea370c 100644 --- a/ports/libdisasm/CONTROL +++ b/ports/libdisasm/CONTROL @@ -1,4 +1,4 @@ Source: libdisasm -Version: 0.23-3 +Version: 0.23-7 Homepage: https://sourceforge.net/projects/bastard Description: x86 Disassembler Library. diff --git a/ports/libdisasm/portfile.cmake b/ports/libdisasm/portfile.cmake index 48b646652e5a2d..46ea1df735da75 100644 --- a/ports/libdisasm/portfile.cmake +++ b/ports/libdisasm/portfile.cmake @@ -1,18 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/bastard/files/libdisasm/0.23/libdisasm-0.23.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO bastard/libdisasm + REF 0.23 FILENAME "libdisasm-0.23.tar.gz" SHA512 29eecfbfd8168188242278a1a38f0c90770d0581a52d4600ae6343829dd0d6607b98329f12a3d7409d43dd56dca6a7d1eb25d58a001c2bfd3eb8474c0e7879e7 -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH - PATCHES - sizeofvoid.patch + PATCHES sizeofvoid.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index 2ff219a8fd2848..93d1aede793073 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,5 +1,6 @@ -Source: libepoxy -Version: 1.5.3-3 -Homepage: https://github.com/anholt/libepoxy -Description: Epoxy is a library for handling OpenGL function pointer management for you -Build-Depends: tool-meson +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/libepoxy-1.5.4_Add_call_convention_to_mock_function.patch b/ports/libepoxy/libepoxy-1.5.4_Add_call_convention_to_mock_function.patch new file mode 100644 index 00000000000000..d6ddd92e476d94 --- /dev/null +++ b/ports/libepoxy/libepoxy-1.5.4_Add_call_convention_to_mock_function.patch @@ -0,0 +1,22 @@ +From 81d758d025089d6b3b5309205ff4cb75789e6205 Mon Sep 17 00:00:00 2001 +From: crziter +Date: Tue, 25 Feb 2020 11:33:56 +0700 +Subject: [PATCH] Add call convention to mock function + +--- + test/gl_version.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/gl_version.c b/test/gl_version.c +index 9ab0080..9fe1bba 100644 +--- a/test/gl_version.c ++++ b/test/gl_version.c +@@ -29,7 +29,7 @@ GLenum mock_enum; + const char *mock_gl_version; + const char *mock_glsl_version; + +-static const GLubyte *override_glGetString(GLenum name) ++static const GLubyte * EPOXY_CALLSPEC override_glGetString(GLenum name) + { + switch (name) { + case GL_VERSION: diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index e578dd659b9674..caaa02ab200522 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -3,12 +3,15 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO anholt/libepoxy - REF 1.5.3 - SHA512 e831f4f918f08fd5f799501efc0e23b8d404478651634f5e7b35f8ebcc29d91abc447ab20da062dde5be75e18cb39ffea708688e6534f7ab257b949f9c53ddc8 - HEAD_REF master) + REF 1.5.4 + SHA512 c8b03f0a39df320fdd163a34c35f9ffbed51bc0174fd89a7dc4b3ab2439413087e1e1a2fe57418520074abd435051cbf03eb2a7bf8897da1712bbbc69cf27cc5 + HEAD_REF master + PATCHES + # https://github.com/anholt/libepoxy/pull/220 + 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 @@ -20,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") @@ -28,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 @@ -70,5 +73,4 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/pkgconfig) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig) -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/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/libexif/CONTROL b/ports/libexif/CONTROL index f3e4e41058107c..7bf6d64b6de8ed 100644 --- a/ports/libexif/CONTROL +++ b/ports/libexif/CONTROL @@ -1,5 +1,5 @@ Source: libexif -Version: 0.6.21-2 +Version: 0.6.22 Homepage: https://libexif.github.io/ Description: a library for parsing, editing, and saving EXIF data -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/ports/libexif/portfile.cmake b/ports/libexif/portfile.cmake index 11f7080d1e88f9..4869c40b5099fc 100644 --- a/ports/libexif/portfile.cmake +++ b/ports/libexif/portfile.cmake @@ -1,14 +1,10 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "libexif currently only supports being built for desktop") -endif() +vcpkg_fail_port_install(ON_TARGET uwp) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libexif/libexif - REF libexif-0_6_21-release - SHA512 aecba54eb9c8b4ce29d11985a547074b381d72027b563c7aef865852b661a6f18a258c748fca6b16198344f4a86568b658071ac95cc1d332f576c6160e1f257d + REF libexif-0_6_22-release + SHA512 6c63abe2734c9e83fb04adb00bdd77f687165007c0efd0279df26c101363b990604050c430c7dd73dfa8735dd2fd196334d321bdb114d4869998f21e7bed5b43 HEAD_REF master PATCHES add-missing-_stdint-h.patch ) @@ -27,4 +23,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libexif RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libfabric/CONTROL b/ports/libfabric/CONTROL index 5f49f2dff859b7..267fb717acaf7b 100644 --- a/ports/libfabric/CONTROL +++ b/ports/libfabric/CONTROL @@ -1,5 +1,6 @@ Source: libfabric -Version: 1.8.1 +Version: 1.8.1-1 Description: The OpenFabrics Interfaces Working Group (OFIWG) and the Libfabric open-source community are pleased to announce the release of version v1.6.2 of libfabric. See NEWS.md for the list of features and enhancements that have been added since the last release. Homepage: https://github.com/ofiwg/libfabric Build-Depends: networkdirect-sdk (windows) +Supports: windows&x64&(!static) \ No newline at end of file diff --git a/ports/libfabric/portfile.cmake b/ports/libfabric/portfile.cmake index 301807b4015c8e..a5bfffc661d267 100644 --- a/ports/libfabric/portfile.cmake +++ b/ports/libfabric/portfile.cmake @@ -1,9 +1,6 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "x86") -if (VCPKG_CMAKE_SYSTEM_NAME) - # The library supports Linux/Darwin/BSD, it is just not yet added here - message(FATAL_ERROR "vcpkg libfabric currently suports windows. Please consider a pull request to add additional support!") -endif() +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -15,10 +12,6 @@ vcpkg_from_github( add_additional_includes.patch ) -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - message(FATAL_ERROR "VCPKG BUILD ERROR: libfabric only supports x64") -endif() - set(LIBFABRIC_RELEASE_CONFIGURATION "Release-v141") set(LIBFABRIC_DEBUG_CONFIGURATION "Debug-v141") @@ -43,4 +36,4 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) file(RENAME ${CURRENT_PACKAGES_DIR}/includetemp ${CURRENT_PACKAGES_DIR}/include/libfabric) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libfabric RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt index b8b70db5da7c1e..d7c741859a1165 100644 --- a/ports/libffi/CMakeLists.txt +++ b/ports/libffi/CMakeLists.txt @@ -120,8 +120,13 @@ macro(add_assembly ASMFILE) COMMAND ${CMAKE_C_COMPILER} /nologo /EP /I. /Iinclude /I${CMAKE_CURRENT_SOURCE_DIR}/include "${ASMFILE_FULL}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE ${ARCH_ASM_NAME}.asm + RESULT_VARIABLE retcode ) + if(NOT ${retcode} STREQUAL "0") + message(FATAL_ERROR "Unable to assemble, exit code: '${retcode}'.") + endif() + # Produced *.asm file could be just added to sources. # It works in x64 mode, but for some strange reason MASM returns error code when in x86, # (even though it didn't report any errors and correctly generated object file) @@ -129,8 +134,13 @@ macro(add_assembly ASMFILE) execute_process( COMMAND ${ARCH_ASSEMBLER} ${ARCH_ASM_NAME}.asm WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE retcode ) + if(NOT ${retcode} STREQUAL "0") + message(FATAL_ERROR "Unable to compile assembly, exit code: '${retcode}'.") + endif() + list(APPEND FFI_SOURCES ${CMAKE_BINARY_DIR}/${ARCH_ASM_NAME}.obj) else() list(APPEND FFI_SOURCES ${ASMFILE}) @@ -176,8 +186,6 @@ include(CMakePackageConfigHelpers) configure_package_config_file(${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION share/${PROJECT_NAME}) -# Disable check for same 32/64bit-ness in libffiConfigVersion.cmake by setting CMAKE_SIZEOF_VOID_P -set (CMAKE_SIZEOF_VOID_P "") write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${VERSION} diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 70e108a73c2b25..a5d4c20941d852 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,4 +1,5 @@ Source: libffi -Version: 3.3-1 +Version: 3.3 +Port-Version: 4 Homepage: https://github.com/libffi/libffi -Description: Portable, high level programming interface to various calling conventions \ No newline at end of file +Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 7209ce8d609216..7748d1cb63ca2e 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -1,9 +1,14 @@ +set(VERSION 3.3) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libffi/libffi 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}) @@ -19,8 +24,30 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() + +# Create pkgconfig file +set(PACKAGE_VERSION ${VERSION}) +set(prefix "${CURRENT_INSTALLED_DIR}") +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/lib") +set(toolexeclibdir "\${libdir}") +set(includedir "\${prefix}/include") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" @ONLY) +endif() +# debug +set(prefix "${CURRENT_INSTALLED_DIR}/debug") +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/lib") +set(toolexeclibdir "\${libdir}") +set(includedir "\${prefix}/../include") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" @ONLY) +endif() + vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +vcpkg_fixup_pkgconfig() if (VCPKG_LIBRARY_LINKAGE STREQUAL static) vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ffi.h @@ -32,4 +59,4 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) ) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/CMakeLists.txt b/ports/libflac/CMakeLists.txt deleted file mode 100644 index d6f01399a34aab..00000000000000 --- a/ports/libflac/CMakeLists.txt +++ /dev/null @@ -1,90 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -cmake_policy(SET CMP0005 NEW) # do not escape preprocessor defines - -project(libflac) - -if(NOT DEFINED LIBFLAC_ARCHITECTURE) - message(FATAL_ERROR "Target architecture not specified") -endif() - -file(GLOB LIBFLAC_SOURCES src/libFLAC/*.c) - -if(WIN32) - list(APPEND LIBFLAC_SOURCES src/share/win_utf8_io/win_utf8_io.c) -else() - list(FILTER LIBFLAC_SOURCES EXCLUDE REGEX "windows[^/]*$") - - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.h "#include ") - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - add_definitions(-DHAVE_CONFIG_H) -endif() - -file(GLOB LIBFLACXX_SOURCES src/libFLAC++/*.cpp) - -include_directories(include) -include_directories(src/libFLAC/include) - -if(NOT LIBFLAC_ARCHITECTURE MATCHES arm) - add_definitions(-DFLAC__SSE_OS) - add_definitions(-DFLAC__HAS_X86INTRIN) -endif() - -if(LIBFLAC_ARCHITECTURE MATCHES x86) - add_definitions(-DFLAC__CPU_IA32) - add_definitions(-DFLAC__HAS_NASM) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/nasm) - foreach(ASM_SOURCE cpu_asm fixed_asm lpc_asm) - execute_process(COMMAND nasm "-i${PROJECT_SOURCE_DIR}/src/libFLAC/ia32/" -f win32 -d OBJ_FORMAT_win32 -f win32 - -o "${CMAKE_BINARY_DIR}/nasm/${ASM_SOURCE}.obj" "${PROJECT_SOURCE_DIR}/src/libFLAC/ia32/${ASM_SOURCE}.nasm" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - list(APPEND LIBFLAC_SOURCES ${CMAKE_BINARY_DIR}/nasm/${ASM_SOURCE}.obj) - endforeach() -elseif(LIBFLAC_ARCHITECTURE MATCHES x64) - add_definitions(-DFLAC__CPU_X86_64) - add_definitions(-DENABLE_64_BIT_WORDS) -endif() - -if(CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-DFLAC__OVERFLOW_DETECT) -endif() - -add_definitions(-DPACKAGE_VERSION="1.3.2") -add_definitions(-DFLAC__HAS_OGG) -add_definitions(-DFLAC__ALIGN_MALLOC_DATA) # 32 byte boundary -add_definitions(-DHAVE_LROUND) -add_definitions(-D_CRT_SECURE_NO_WARNINGS) -add_definitions(-D_CRT_NONSTDC_NO_WARNINGS) - -add_library(libFLAC ${LIBFLAC_SOURCES}) -add_library(libFLACXX ${LIBFLACXX_SOURCES}) - -set_target_properties(libFLAC PROPERTIES OUTPUT_NAME FLAC) -set_target_properties(libFLACXX PROPERTIES OUTPUT_NAME FLAC++) - -find_library(OGG_LIBRARY ogg) -find_path(OGG_INCLUDE_DIR ogg/ogg.h) - -include_directories(${OGG_INCLUDE_DIR}) -target_link_libraries(libFLAC ${OGG_LIBRARY}) -target_link_libraries(libFLACXX libFLAC) - -if(BUILD_SHARED_LIBS) - set_target_properties(libFLACXX PROPERTIES COMPILE_FLAGS -DFLACPP_API_EXPORTS) - set_target_properties(libFLAC PROPERTIES COMPILE_FLAGS -DFLAC_API_EXPORTS) -else() - add_definitions(-DFLAC__NO_DLL) -endif() - -install(TARGETS libFLAC libFLACXX - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib) - -if(NOT DEFINED LIBFLAC_SKIP_HEADERS) - install(DIRECTORY include/FLAC/ - DESTINATION include/FLAC - FILES_MATCHING PATTERN "*.h") - install(DIRECTORY include/FLAC++/ - DESTINATION include/FLAC++ - FILES_MATCHING PATTERN "*.h") -endif() diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 68011e0e7afa92..696e9fffb2ed5d 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,5 +1,6 @@ Source: libflac 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 0a895ad416905c..36f7b997ee7612 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -1,39 +1,69 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xiph/flac - REF 1.3.3 - SHA512 4644dc8fd45e775d0e6210de2b082996692675307a7b7d359827730cc4cede9c2e1df46f4386023d83da9bafa6b3218d24012bf532f459087e311f14863747ec + REF ce6dd6b5732e319ef60716d9cc9af6a836a4011a + SHA512 d0d3b5451f8d74aa0a0832fbe95cca55597ce9654765a95adaac98ecd0da9e803b98551a40a3fb3fd5b86bc5f40cd1a791127c03da5322e7f01e7fa761171a21 HEAD_REF master PATCHES "${CMAKE_CURRENT_LIST_DIR}/uwp-library-console.patch" "${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch" ) -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - vcpkg_find_acquire_program(NASM) - get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(BUILD_SHARED_LIBS ON) +else() + set(BUILD_SHARED_LIBS OFF) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +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 OPTIONS - -DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} - OPTIONS_DEBUG - -DLIBFLAC_SKIP_HEADERS=ON) + -DBUILD_PROGRAMS=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + -DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR}) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets( + CONFIG_PATH share/FLAC/cmake + TARGET_PATH share/FLAC +) vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n") - file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLACPP_API\n#define FLACPP_API\n") +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/libfort/portfile.cmake b/ports/libfort/portfile.cmake new file mode 100644 index 00000000000000..1ff01476526198 --- /dev/null +++ b/ports/libfort/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO seleznevae/libfort + REF ccb892f77dc30c2ebc42916a3f862a965e8c097f # v0.4.1 + SHA512 0397e52985b56b6740d22533c48039bf1d61fb90795e97a6153e9360702d1e89b5353ba74de92005bbc874822766d157de21d175387ffd00d0a5294e531d2d8b + HEAD_REF main +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DFORT_ENABLE_TESTING=OFF + -DFORT_ENABLE_ASTYLE=OFF +) + +vcpkg_install_cmake() + +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) diff --git a/ports/libfort/vcpkg.json b/ports/libfort/vcpkg.json new file mode 100644 index 00000000000000..613042cb635ce9 --- /dev/null +++ b/ports/libfort/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "libfort", + "version-string": "0.4.1", + "description": "A simple crossplatform library to create formatted text tables", + "homepage": "https://github.com/seleznevae/libfort", + "license": "MIT" +} 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/libgit2/CONTROL b/ports/libgit2/CONTROL index bbfedcd336a0c7..1c16caf88dfca1 100644 --- a/ports/libgit2/CONTROL +++ b/ports/libgit2/CONTROL @@ -1,5 +1,5 @@ Source: libgit2 -Version: 0.99.0-1 +Version: 1.0.1 Homepage: https://github.com/libgit2/libgit2 Build-Depends: zlib, openssl (!windows&&!uwp) Description: Git linkable library diff --git a/ports/libgit2/portfile.cmake b/ports/libgit2/portfile.cmake index fe5ef45ce435cd..c246525487510d 100644 --- a/ports/libgit2/portfile.cmake +++ b/ports/libgit2/portfile.cmake @@ -4,8 +4,8 @@ vcpkg_fail_port_install(ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libgit2/libgit2 - REF v0.99.0 - SHA512 e38e18da0e6ed1e5c8198c9eb2c362b21da2d0b9c8bc23309d2f70183549f4b9f23a6db8ce5f1f0f24b373e6427039c2a845b62dd74f91b02cfe8954f961a91b + REF 0ced29612dacb67eefe0c562a5c1d3aab21cce96#version 1.0.1 + SHA512 477e7309682d470965ef85c84f57b647526e1d2cd9ece1fd4f5f4e03e586280651ee40aafadb5b66940cfbd80816f205aa54886f457ca8fd795313137e015102 HEAD_REF master ) @@ -32,4 +32,4 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libgit2 RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libgo/CONTROL b/ports/libgo/CONTROL index 18b37915aee595..92d6f9f5a3792b 100644 --- a/ports/libgo/CONTROL +++ b/ports/libgo/CONTROL @@ -1,4 +1,5 @@ Source: libgo -Version: 2.8-2 -Build-Depends: boost-context +Version: 3.1-1 +Homepage: https://github.com/yyzybb537/libgo Description: The best stackful coroutine by c++11. +Supports: !(arm|uwp) diff --git a/ports/libgo/boost-168.patch b/ports/libgo/boost-168.patch deleted file mode 100644 index 48a90023fdc5a4..00000000000000 --- a/ports/libgo/boost-168.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/libgo/ctx_boost_context/context.h b/libgo/ctx_boost_context/context.h -index 2db71c0..2f321fb 100644 ---- a/libgo/ctx_boost_context/context.h -+++ b/libgo/ctx_boost_context/context.h -@@ -1,4 +1,4 @@ --#include -+#include - - #if BOOST_EXECUTION_CONTEXT == 2 // boost version >= 1.61 - # include "context_v2.h" -diff --git a/libgo/ctx_boost_context/context_v2.h b/libgo/ctx_boost_context/context_v2.h -index e415af4..59e2e29 100644 ---- a/libgo/ctx_boost_context/context_v2.h -+++ b/libgo/ctx_boost_context/context_v2.h -@@ -1,4 +1,4 @@ --#include -+#include - - namespace co - { diff --git a/ports/libgo/cmake.patch b/ports/libgo/cmake.patch index bed9cddaa1ad13..54a7e739f68366 100644 --- a/ports/libgo/cmake.patch +++ b/ports/libgo/cmake.patch @@ -1,34 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index dbbdd7d..29396a5 100644 +index dfa9b72..ff9827e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -137,7 +137,7 @@ if (UNIX) - set(CMAKE_CXX_FLAGS "-std=c++11 -fPIC -Wall -pthread ${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS_DEBUG "-g -pg ${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 ${CMAKE_CXX_FLAGS}") --else () -+elseif (NOT DISABLE_ADJUST_COMMAND_LINE_FLAGS) - if (NOT DISABLE_DYNAMIC_LIB) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") -@@ -159,7 +159,7 @@ set(STATIC_T "libgo_static") - add_library("${STATIC_T}" STATIC ${CO_SRC_LIST}) - set_target_properties("${STATIC_T}" PROPERTIES OUTPUT_NAME "${TARGET}") +@@ -152,6 +152,8 @@ if (UNIX) --if (UNIX) -+if (UNIX OR FORCE_UNIX_TARGETS) - add_subdirectory(${PROJECT_SOURCE_DIR}/libgo/main) + elseif (WIN32) + set_target_properties("${STATIC_T}" PROPERTIES COMPILE_FLAGS "/wd4819 /wd4267") ++ install(TARGETS ${STATIC_T} LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib") ++ install(DIRECTORY ${PROJECT_SOURCE_DIR}/libgo/ DESTINATION "include/libgo" FILES_MATCHING PATTERN "*.h") + endif() - if (NOT DISABLE_DYNAMIC_LIB) -@@ -180,7 +180,11 @@ if (UNIX) - PATTERN "ctx_boost_coroutine" EXCLUDE - PATTERN "ctx_ucontext" EXCLUDE - PATTERN "*.h") -+ if(UNIX) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/libgo/linux/ DESTINATION "include/libgo" FILES_MATCHING PATTERN "*.h") -+ else() -+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/libgo/windows/ DESTINATION "include/libgo" FILES_MATCHING PATTERN "*.h") -+ endif() - #file(WRITE ${PROJECT_SOURCE_DIR}/tools/libgo.conf "${CMAKE_INSTALL_PREFIX}/lib") - #install(FILES ${PROJECT_SOURCE_DIR}/tools/libgo.conf DESTINATION "/etc/ld.so.conf.d") - if (DEPEND_BOOST) + if (WIN32) diff --git a/ports/libgo/portfile.cmake b/ports/libgo/portfile.cmake index 75a5736f6b6c07..26339fc43b9ad2 100644 --- a/ports/libgo/portfile.cmake +++ b/ports/libgo/portfile.cmake @@ -1,16 +1,13 @@ -include(vcpkg_common_functions) - +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 yyzybb537/libgo - REF v2.8 - SHA512 44784de4aec36ea321195c11c99a73de4f6f51285febdf6980e8aaced1fdfc0a34c6b1a8acc8c6b424e747310a1d7fb1604f722084c28ab91f8ebee15667d59b + REF 5d4f36508e8eb2d5aa17cf37cd951dc91da23096 #v3.1 + SHA512 0f281f58116148ba1dd3904febbc391d47190f8e148b70bed7c4b7e6cb3efa5e41e2b7be4832ceeb805996e085f4c2d89fd0cf3b0651e037b32758d6a441411b HEAD_REF master - PATCHES - cmake.patch - boost-168.patch + PATCHES cmake.patch ) vcpkg_from_github( @@ -28,36 +25,22 @@ file(RENAME ${XHOOK_SOURCE_PATH} ${SOURCE_PATH}/third_party/xhook) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS - -DDISABLE_ADJUST_COMMAND_LINE_FLAGS=ON - -DDISABLE_DYNAMIC_LIB=ON - -DENABLE_BOOST_CONTEXT=ON - -DFORCE_UNIX_TARGETS=ON - -DDISABLE_SYSTEMWIDE=ON ) vcpkg_install_cmake() -# remove duplicated include files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libgo/disable_hook) - -file(GLOB REL_MAIN ${CURRENT_PACKAGES_DIR}/lib/libgo_main.lib ${CURRENT_PACKAGES_DIR}/lib/liblibgo_main.a) -if(REL_MAIN) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) - file(COPY ${REL_MAIN} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) - file(REMOVE ${REL_MAIN}) -endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libgo/netio/disable_hook) -file(GLOB DBG_MAIN ${CURRENT_PACKAGES_DIR}/debug/lib/libgo_main.lib ${CURRENT_PACKAGES_DIR}/debug/lib/liblibgo_main.a) -if(DBG_MAIN) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) - file(COPY ${DBG_MAIN} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) - file(REMOVE ${DBG_MAIN}) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libgo/netio/unix/static_hook) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libgo/netio/windows) +else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libgo/netio/unix) endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libgo RENAME copyright) -file(INSTALL ${CURRENT_PORT_DIR}/libgo-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libgo) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${CURRENT_PORT_DIR}/libgo-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) 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..be0476d4deb9b3 --- /dev/null +++ b/ports/libheif/CONTROL @@ -0,0 +1,5 @@ +Source: libheif +Version: 1.7.0 +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/portfile.cmake b/ports/libheif/portfile.cmake new file mode 100644 index 00000000000000..838734b2d76cd5 --- /dev/null +++ b/ports/libheif/portfile.cmake @@ -0,0 +1,20 @@ +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 +) + +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/libiconv/CMakeLists.txt b/ports/libiconv/CMakeLists.txt index 489b4750d3135f..43d55c0c39fa0a 100644 --- a/ports/libiconv/CMakeLists.txt +++ b/ports/libiconv/CMakeLists.txt @@ -15,6 +15,7 @@ if(WIN32) set(USE_MBSTATE_T "0 /*USE_MBSTATE_T*/") set(BROKEN_WCHAR_H "0 /*BROKEN_WCHAR_H*/") set(HAVE_VISIBILITY "0 /*HAVE_VISIBILITY*/") + set(ICONV_CONST "") configure_file(config.h.in config.h) file(READ "${CMAKE_CURRENT_BINARY_DIR}/config.h" _contents) @@ -22,7 +23,7 @@ if(WIN32) string(REPLACE "#undef HAVE_MBRTOWC" "#define HAVE_MBRTOWC 1" _contents "${_contents}") string(REPLACE "#undef HAVE_MBSINIT" "#define HAVE_MBSINIT 1" _contents "${_contents}") string(REPLACE "#undef HAVE_WCRTOMB" "#define HAVE_WCRTOMB 1" _contents "${_contents}") - string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" _contents "${_contents}") + string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST ${ICONV_CONST}" _contents "${_contents}") string(REPLACE "#undef EILSEQ" "" _contents "${_contents}") string(REPLACE "#undef WORDS_LITTLEENDIAN" "#define WORDS_LITTLEENDIAN 1" _contents "${_contents}") string(REPLACE "#undef ENABLE_RELOCATABLE" "#define ENABLE_RELOCATABLE 1" _contents "${_contents}") diff --git a/ports/libiconv/CONTROL b/ports/libiconv/CONTROL index 33bb805d808728..e95414202ecfbb 100644 --- a/ports/libiconv/CONTROL +++ b/ports/libiconv/CONTROL @@ -1,4 +1,5 @@ Source: libiconv -Version: 1.16-1 +Version: 1.16 +Port-Version: 5 Homepage: https://www.gnu.org/software/libiconv/ Description: GNU Unicode text conversion diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index 5f184079f36f14..b36c995b6df6ac 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -37,6 +37,8 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-iconv TARGET_PATH share/u vcpkg_copy_pdbs() +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/Iconv) + file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_test_cmake(PACKAGE_NAME unofficial-iconv) diff --git a/ports/libiconv/vcpkg-cmake-wrapper.cmake b/ports/libiconv/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..472dd8082db8af --- /dev/null +++ b/ports/libiconv/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,10 @@ +include(SelectLibraryConfigurations) + +_find_package(${ARGS}) +if(Iconv_FOUND) + find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) + find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) + find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib) + select_library_configurations(CHARSET) + list(APPEND Iconv_LIBRARIES ${CHARSET_LIBRARIES}) +endif() diff --git a/ports/libigl/CONTROL b/ports/libigl/CONTROL index 93041cc4d30b00..496f735700ffeb 100644 --- a/ports/libigl/CONTROL +++ b/ports/libigl/CONTROL @@ -1,8 +1,9 @@ Source: libigl -Version: 2.1.0-1 +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 @@ -18,20 +19,8 @@ Build-Depends: glfw3 Feature: imgui Description: Build with imgui -Build-Depends: imgui[example] - -Feature: png -Description: Build with libpng -Build-Depends: libpng, stb +Build-Depends: imgui[bindings] 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..e891e341efac4a 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,20 +143,26 @@ 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,10 +9,10 @@ #include "ImGuiMenu.h" #include "ImGuiHelpers.h" #include -#include +-#include +-#include +-#include +#include - #include - #include - #include ++#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 +174,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 +193,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/portfile.cmake b/ports/libigl/portfile.cmake index 6407ca812639eb..d3e342b5b6abf5 100644 --- a/ports/libigl/portfile.cmake +++ b/ports/libigl/portfile.cmake @@ -1,10 +1,12 @@ 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 ) @@ -14,10 +16,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 VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Remove this after add port libigl-imgui + message(FATAL_ERROR "Feature imgui does not support static build currentlly") endif() if ("test" IN_LIST FEATURES AND NOT EXISTS ${SOURCE_PATH}/tests/data) @@ -37,10 +38,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 +55,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 +72,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/liblas/CONTROL b/ports/liblas/CONTROL index a0840144819d92..f441925372aed0 100644 --- a/ports/liblas/CONTROL +++ b/ports/liblas/CONTROL @@ -1,5 +1,5 @@ Source: liblas -Version: 1.8.1-3 +Version: 1.8.1-4 Build-Depends: boost, boost-thread, boost-system, boost-iostreams, boost-filesystem, libgeotiff Description: A C/C++ library for reading and writing the very common LAS LiDAR format. diff --git a/ports/liblas/fix-boost-headers.patch b/ports/liblas/fix-boost-headers.patch new file mode 100644 index 00000000000000..4725a6ceb2e24a --- /dev/null +++ b/ports/liblas/fix-boost-headers.patch @@ -0,0 +1,55 @@ +diff --git a/include/liblas/detail/binary.hpp b/include/liblas/detail/binary.hpp +index d3116a1..ab20e06 100644 +--- a/include/liblas/detail/binary.hpp ++++ b/include/liblas/detail/binary.hpp +@@ -17,6 +17,8 @@ + #ifndef LIBLAS_DETAIL_BINARY_HPP_INCLUDED + #define LIBLAS_DETAIL_BINARY_HPP_INCLUDED + ++#include ++ + #include + #include + #include +@@ -25,7 +27,6 @@ + + #include + #include +-#include + #include + + #if CHAR_BIT != 8 +@@ -43,7 +44,7 @@ namespace detail { namespace binary { + struct big_endian_tag {}; + struct little_endian_tag {}; + +-#ifdef BOOST_BIG_ENDIAN ++#ifdef LIBLAS_BIG_ENDIAN + typedef big_endian_tag native_endian_tag; + #else + typedef little_endian_tag native_endian_tag; +diff --git a/src/c_api.cpp b/src/c_api.cpp +index a70fe74..e8be785 100644 +--- a/src/c_api.cpp ++++ b/src/c_api.cpp +@@ -96,6 +96,7 @@ using namespace liblas; + #endif + + #include ++#include + + bool IsReprojectionTransform(liblas::TransformPtr const& p) + { +diff --git a/src/header.cpp b/src/header.cpp +index 9987ce1..a5c8f7d 100644 +--- a/src/header.cpp ++++ b/src/header.cpp +@@ -54,7 +54,7 @@ + // boost + #include + #include +- ++#include + //std + #include + #include diff --git a/ports/liblas/portfile.cmake b/ports/liblas/portfile.cmake index 32fdd7c7eb69d0..f1416ec9323e49 100644 --- a/ports/liblas/portfile.cmake +++ b/ports/liblas/portfile.cmake @@ -3,31 +3,32 @@ include(vcpkg_common_functions) set(VERSION 1.8.1) vcpkg_download_distfile(ARCHIVE - URLS "http://download.osgeo.org/liblas/libLAS-${VERSION}.tar.bz2" - FILENAME "libLAS-${VERSION}-src.tar.bz2" + URLS "http://download.osgeo.org/liblas/libLAS-${VERSION}.tar.bz2" + FILENAME "libLAS-${VERSION}-src.tar.bz2" SHA512 1cb39c557af0006c54f1100d0d409977fcc1886abd155c1b144d806c47f8675a9f2125d3a9aca16bae65d2aabba84d5e5e322b42085e7db312f3d53f92342acf - HEAD_REF master + HEAD_REF master ) vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} OUT_SOURCE_PATH SOURCE_PATH - PATCHES fix-BuildError.patch + PATCHES + fix-BuildError.patch + fix-boost-headers.patch ) file(REMOVE ${SOURCE_PATH}/cmake/modules/FindPROJ4.cmake) file(REMOVE ${SOURCE_PATH}/cmake/modules/FindGeoTIFF.cmake) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - - -DBUILD_OSGEO4W=OFF # Disable osgeo4w - -DWITH_TESTS=OFF - -DWITH_UTILITIES=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=${CMAKE_DISABLE_FIND_PACKAGE_ZLIB} - -DCMAKE_DISABLE_FIND_PACKAGE_JPEG=${CMAKE_DISABLE_FIND_PACKAGE_JPEG} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_OSGEO4W=OFF # Disable osgeo4w + -DWITH_TESTS=OFF + -DWITH_UTILITIES=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=${CMAKE_DISABLE_FIND_PACKAGE_ZLIB} + -DCMAKE_DISABLE_FIND_PACKAGE_JPEG=${CMAKE_DISABLE_FIND_PACKAGE_JPEG} ) vcpkg_install_cmake() diff --git a/ports/liblzma/CMakeLists.txt b/ports/liblzma/CMakeLists.txt index 626655150d2339..c87b0b611f9bdf 100644 --- a/ports/liblzma/CMakeLists.txt +++ b/ports/liblzma/CMakeLists.txt @@ -130,8 +130,8 @@ add_library(LibLZMA src/liblzma/simple/x86.c ) -if(MSVC) - target_include_directories(LibLZMA PRIVATE $) +if(WIN32) + target_include_directories(LibLZMA PRIVATE $) else() target_compile_definitions(LibLZMA PRIVATE -DHAVE_VISIBILITY=1) endif() diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index 2c44c3d168eb16..dc9d0fda86c7e5 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,4 +1,5 @@ Source: liblzma -Version: 5.2.4-4 +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 20d2a59d6e492e..c29dbafedc367e 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xz-mirror/xz - REF v5.2.4 - SHA512 fce7dc65e77a9b89dbdd6192cb37efc39e3f2cf343f79b54d2dfcd845025dab0e1d5b0f59c264eab04e5cbaf914eeb4818d14cdaac3ae0c1c5de24418656a4b7 + REF v5.2.5 + SHA512 686f01cfe33e2194766a856c48668c661b25eee194a443524f87ce3f866e0eb54914075b4e00185921516c5211db8cd5d2658f4b91f4a3580508656f776f468e HEAD_REF master PATCHES enable-uwp-builds.patch @@ -70,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) @@ -80,6 +82,14 @@ else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/include/lzma.h" + "if !defined(LZMA_API_STATIC)" + "if 0" + ) +endif() + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libmad/CONTROL b/ports/libmad/CONTROL index 97e9e564aeb553..356ecc65f98fa6 100644 --- a/ports/libmad/CONTROL +++ b/ports/libmad/CONTROL @@ -1,3 +1,4 @@ Source: libmad -Version: 0.15.1-5 +Version: 0.15.1-8 +Homepage: http://www.mars.org/home/rob/proj/mpeg/ Description: high-quality MPEG audio decoder diff --git a/ports/libmad/portfile.cmake b/ports/libmad/portfile.cmake index c61df53decc3fa..ebf84de891d05f 100644 --- a/ports/libmad/portfile.cmake +++ b/ports/libmad/portfile.cmake @@ -1,18 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "http://download.sourceforge.net/mad/libmad-0.15.1b.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO mad/libmad + REF 0.15.1b FILENAME "libmad-0.15.1b.tar.gz" SHA512 2cad30347fb310dc605c46bacd9da117f447a5cabedd8fefdb24ab5de641429e5ec5ce8af7aefa6a75a3f545d3adfa255e3fa0a2d50971f76bc0c4fc0400cc45 -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH - PATCHES - 0001-Fix-MSVC-ARM.patch + PATCHES 0001-Fix-MSVC-ARM.patch ) #The archive only contains a Visual Studio 6.0 era DSP project file, so use a custom CMakeLists.txt diff --git a/ports/libmagic/CONTROL b/ports/libmagic/CONTROL index 3f0b777eb89c86..07fce2a682e2b0 100644 --- a/ports/libmagic/CONTROL +++ b/ports/libmagic/CONTROL @@ -1,4 +1,4 @@ Source: libmagic -Version: 5.37 +Version: 5.37-1 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 diff --git a/ports/libmagic/portfile.cmake b/ports/libmagic/portfile.cmake index 8eabf13b7ad270..65fe8d8ab6cbfe 100644 --- a/ports/libmagic/portfile.cmake +++ b/ports/libmagic/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platform" ON_TARGET "Windows") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO file/file @@ -10,11 +8,8 @@ vcpkg_from_github( vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG ) - vcpkg_install_make() - vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -23,7 +18,7 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man/man5) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/man5) # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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 new file mode 100644 index 00000000000000..e877ba23327877 --- /dev/null +++ b/ports/libmediainfo/CONTROL @@ -0,0 +1,5 @@ +Source: libmediainfo +Version: 20.03 +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 new file mode 100644 index 00000000000000..d6b00279714617 --- /dev/null +++ b/ports/libmediainfo/portfile.cmake @@ -0,0 +1,21 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO MediaArea/MediaInfoLib + REF v20.03 + SHA512 c5d3444c8694ca68ee08f97f387cef3aefd9fbb23623b643a6daf9ed7d247521f1291a8a13c9088b31be9a9d594ca772d3125d6eb3d3770bee1f7c50b3b23c07 + HEAD_REF master + PATCHES vcpkg_support_in_cmakelists.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/Project/CMake + PREFER_NINJA + OPTIONS -DBUILD_ZENLIB=0 -DBUILD_ZLIB=0 +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/mediainfolib TARGET_PATH share/mediainfolib) + +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/libmediainfo/vcpkg_support_in_cmakelists.patch b/ports/libmediainfo/vcpkg_support_in_cmakelists.patch new file mode 100644 index 00000000000000..d0f988d7b93cbd --- /dev/null +++ b/ports/libmediainfo/vcpkg_support_in_cmakelists.patch @@ -0,0 +1,64 @@ +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) + + # use system curl if is present +-find_package(CURL) ++find_package(CURL CONFIG REQUIRED) + + include_directories(${MediaInfoLib_SOURCES_PATH}) + include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/md5/) +@@ -398,13 +398,7 @@ endif() + target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) + + if(MSVC AND BUILD_SHARED_LIBS) +- get_target_property(LOCATION mediainfo LOCATION_DEBUG) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) +- +- get_target_property(LOCATION mediainfo LOCATION_RELWITHDEBINFO) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) ++ install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) + endif() + + if (APPLE) +diff --git a/Source/ThirdParty/aes-gladman/aesopt.h b/Source/ThirdParty/aes-gladman/aesopt.h +index 6ad9ca1e..a858396f 100644 +--- a/Source/ThirdParty/aes-gladman/aesopt.h ++++ b/Source/ThirdParty/aes-gladman/aesopt.h +@@ -183,6 +183,6 @@ Issue Date: 20/12/2007 + AES_REV_DKS must NOT be defined when such assembler files are + built + */ +-#if 1 && defined( _WIN64 ) && defined( _MSC_VER ) ++#if 1 && defined( _WIN64 ) && defined( _MSC_VER ) && defined( _M_AMD64 ) + # define INTEL_AES_POSSIBLE + #endif +diff --git a/Source/ThirdParty/aes-gladman/brg_endian.h b/Source/ThirdParty/aes-gladman/brg_endian.h +index 4c34f2b5..fae471b9 100644 +--- a/Source/ThirdParty/aes-gladman/brg_endian.h ++++ b/Source/ThirdParty/aes-gladman/brg_endian.h +@@ -110,7 +110,8 @@ Issue Date: 20/12/2007 + defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ + defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ + defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ +- defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) ++ defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) || \ ++ defined( _M_ARM64 ) || defined ( _M_ARM ) + # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN + + #elif 0 /* **** EDIT HERE IF NECESSARY **** */ diff --git a/ports/libmesh/CONTROL b/ports/libmesh/CONTROL index f0efea8fcf47b4..0350119c2867dd 100644 --- a/ports/libmesh/CONTROL +++ b/ports/libmesh/CONTROL @@ -1,4 +1,4 @@ Source: libmesh -Version: 1.5.0 +Version: 1.5.0-1 Homepage: https://github.com/libMesh/libmesh Description: The libMesh library provides a framework for the numerical simulation of partial differential equations using arbitrary unstructured discretizations on serial and parallel platforms. A major goal of the library is to provide support for adaptive mesh refinement (AMR) computations in parallel while allowing a research scientist to focus on the physics they are modeling. diff --git a/ports/libmesh/portfile.cmake b/ports/libmesh/portfile.cmake index 97a86436d0b770..9a16dbf98bf666 100644 --- a/ports/libmesh/portfile.cmake +++ b/ports/libmesh/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libMesh/libmesh @@ -8,9 +6,18 @@ vcpkg_from_github( HEAD_REF master ) +if(VCPKG_TARGET_IS_WINDOWS) + set(OPTIONS --disable-qhull ) +endif() +# There a lot of configure options in this port which are not yet correctly handled by VCPKG +# To only mention two: +# --enable-vtk-required Error if VTK is not detected by configure +# --enable-capnp-required Error if Cap'n Proto support is not detected by +# but there are a lot more which need to be checked/fixed +# So this port can only be considered a Work In Progress vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA + OPTIONS ${OPTIONS} ) vcpkg_install_make() diff --git a/ports/libmicrohttpd/CMakeLists.txt b/ports/libmicrohttpd/CMakeLists.txt deleted file mode 100644 index b54bb7b53fc5b6..00000000000000 --- a/ports/libmicrohttpd/CMakeLists.txt +++ /dev/null @@ -1,74 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(libmicrohttpd C) - -if(MSVC) - add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) -endif() - -set(MIN_SRC contrib/libmicrohttpd) - - -set(SRC - src/microhttpd/base64.c - src/microhttpd/basicauth.c - src/microhttpd/connection.c - src/microhttpd/daemon.c - src/microhttpd/digestauth.c - src/microhttpd/internal.c - src/microhttpd/md5.c - src/microhttpd/memorypool.c - src/microhttpd/mhd_mono_clock.c - src/microhttpd/postprocessor.c - src/microhttpd/reason_phrase.c - src/microhttpd/response.c - src/microhttpd/tsearch.c - src/microhttpd/sysfdsetsize.c - src/microhttpd/mhd_str.c - src/microhttpd/mhd_threads.c - src/microhttpd/mhd_sockets.c - src/microhttpd/mhd_itc.c - src/microhttpd/mhd_compat.c -) -set(HEADERS - src/microhttpd/base64.h - src/microhttpd/connection.h - src/microhttpd/internal.h - src/microhttpd/md5.h - src/microhttpd/memorypool.h - src/microhttpd/mhd_byteorder.h - src/microhttpd/mhd_limits.h - src/microhttpd/mhd_mono_clock.h - src/microhttpd/response.h - src/microhttpd/tsearch.h - src/microhttpd/sysfdsetsize.h - src/microhttpd/mhd_str.h - src/microhttpd/mhd_threads.h - src/microhttpd/mhd_locks.h - src/microhttpd/mhd_sockets.h - src/microhttpd/mhd_itc.h - src/microhttpd/mhd_itc_types.h - src/microhttpd/mhd_compat.h -) - -include_directories(${HEADERS} src/include w32/common) - -add_library(libmicrohttpd ${SRC}) - -if(BUILD_SHARED_LIBS) - target_compile_definitions(libmicrohttpd PRIVATE -DMHD_W32DLL) -else() - target_compile_definitions(libmicrohttpd PRIVATE -DMHD_W32LIB) -endif() - - target_link_libraries(libmicrohttpd ws2_32) - -install( - TARGETS libmicrohttpd - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -if(NOT DISABLE_INSTALL_HEADERS) - install(FILES src/include/microhttpd.h DESTINATION include) -endif() diff --git a/ports/libmicrohttpd/CONTROL b/ports/libmicrohttpd/CONTROL index 8636fe183a5d5c..c1a76d5f9f1223 100644 --- a/ports/libmicrohttpd/CONTROL +++ b/ports/libmicrohttpd/CONTROL @@ -1,4 +1,6 @@ Source: libmicrohttpd -Version: 0.9.63-2 +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/fix-msvc-project.patch b/ports/libmicrohttpd/fix-msvc-project.patch new file mode 100644 index 00000000000000..29071a2bee069c --- /dev/null +++ b/ports/libmicrohttpd/fix-msvc-project.patch @@ -0,0 +1,12 @@ +diff --git a/w32/common/libmicrohttpd-files.vcxproj b/w32/common/libmicrohttpd-files.vcxproj +index 6f1e03b..c0ddea8 100644 +--- a/w32/common/libmicrohttpd-files.vcxproj ++++ b/w32/common/libmicrohttpd-files.vcxproj +@@ -3,6 +3,7 @@ + + + ++ + + + diff --git a/ports/libmicrohttpd/portfile.cmake b/ports/libmicrohttpd/portfile.cmake index 52a7f225c0df16..e055a246a38fce 100644 --- a/ports/libmicrohttpd/portfile.cmake +++ b/ports/libmicrohttpd/portfile.cmake @@ -1,9 +1,11 @@ -set(MICROHTTPD_VERSION 0.9.63) +vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm") -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +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 ) @@ -11,18 +13,33 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} OUT_SOURCE_PATH SOURCE_PATH + PATCHES fix-msvc-project.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 -) - -vcpkg_install_cmake() - -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmicrohttpd RENAME copyright) +if (VCPKG_TARGET_IS_WINDOWS) + if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CFG_SUFFIX "dll") + else() + set(CFG_SUFFIX "static") + endif() + + vcpkg_install_msbuild( + SOURCE_PATH "${SOURCE_PATH}" + PROJECT_SUBPATH w32/VS2015/libmicrohttpd.vcxproj + RELEASE_CONFIGURATION "Release-${CFG_SUFFIX}" + DEBUG_CONFIGURATION "Debug-${CFG_SUFFIX}" + ) + + 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}" + ) + + 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/libmikmod/CONTROL b/ports/libmikmod/CONTROL index fbe8b790062a82..637052cb2637e7 100644 --- a/ports/libmikmod/CONTROL +++ b/ports/libmikmod/CONTROL @@ -1,5 +1,5 @@ Source: libmikmod -Version: 3.3.11.1-5 +Version: 3.3.11.1-8 Homepage: https://sourceforge.net/projects/mikmod/ Description: Mikmod is a module player and library supporting many formats, including mod, s3m, it, and xm. Build-Depends: openal-soft diff --git a/ports/libmikmod/portfile.cmake b/ports/libmikmod/portfile.cmake index 149e4429ad6852..55556e2055315c 100644 --- a/ports/libmikmod/portfile.cmake +++ b/ports/libmikmod/portfile.cmake @@ -1,14 +1,9 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/mikmod/libmikmod/3.3.11.1/libmikmod-3.3.11.1.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO mikmod/libmikmod + REF 3.3.11.1 FILENAME "libmikmod-3.3.11.1.tar.gz" SHA512 f2439e2b691613847cd0787dd4e050116683ce7b05c215b8afecde5c6add819ea6c18e678e258c0a80786bef463f406072de15127f64368f694287a5e8e1a9de -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH PATCHES fix-missing-dll.patch name_conflict.patch 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/libmpeg2/0001-Add-naive-MSVC-support-to-sources.patch b/ports/libmpeg2/0001-Add-naive-MSVC-support-to-sources.patch new file mode 100644 index 00000000000000..1bbebffc0c5dbc --- /dev/null +++ b/ports/libmpeg2/0001-Add-naive-MSVC-support-to-sources.patch @@ -0,0 +1,146 @@ +From ed3b6e4bca1fe5211e3d7ca06bbbf9b161c8bc19 Mon Sep 17 00:00:00 2001 +From: Michal Janiszewski +Date: Sat, 2 Nov 2019 14:50:53 -0700 +Subject: [PATCH] Add naive MSVC support to sources + +--- + libmpeg2/convert/rgb.c | 2 +- + libmpeg2/cpu_accel.c | 4 ++-- + libmpeg2/cpu_state.c | 4 ++-- + libmpeg2/idct.c | 2 +- + libmpeg2/motion_comp.c | 2 +- + libvo/video_out_dx.c | 6 +++--- + vc++/config.h | 2 ++ + 7 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/libmpeg2/convert/rgb.c b/libmpeg2/convert/rgb.c +index 8863b0b..db6f4e3 100644 +--- a/libmpeg2/convert/rgb.c ++++ b/libmpeg2/convert/rgb.c +@@ -499,7 +499,7 @@ static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp, + int convert420 = 0; + int rgb_stride_min = ((bpp + 7) >> 3) * seq->width; + +-#ifdef ARCH_X86 ++#if !defined(_MSC_VER) && defined(ARCH_X86) + if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) { + convert420 = 0; + copy = mpeg2convert_rgb_mmxext (order, bpp, seq); +diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c +index 9b24610..a922df1 100644 +--- a/libmpeg2/cpu_accel.c ++++ b/libmpeg2/cpu_accel.c +@@ -29,7 +29,7 @@ + #include "attributes.h" + #include "mpeg2_internal.h" + +-#if defined(ARCH_X86) || defined(ARCH_X86_64) ++#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) + static inline uint32_t arch_accel (uint32_t accel) + { + if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) +@@ -253,7 +253,7 @@ static inline uint32_t arch_accel (uint32_t accel) + + uint32_t mpeg2_detect_accel (uint32_t accel) + { +-#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) ++#if !defined(_MSC_VER) && (defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)) + accel = arch_accel (accel); + #endif + return accel; +diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c +index 2f2f64a..f4966c1 100644 +--- a/libmpeg2/cpu_state.c ++++ b/libmpeg2/cpu_state.c +@@ -36,7 +36,7 @@ + void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; + void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; + +-#if defined(ARCH_X86) || defined(ARCH_X86_64) ++#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) + static void state_restore_mmx (cpu_state_t * state) + { + emms (); +@@ -115,7 +115,7 @@ static void state_restore_altivec (cpu_state_t * state) + + void mpeg2_cpu_state_init (uint32_t accel) + { +-#if defined(ARCH_X86) || defined(ARCH_X86_64) ++#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) + if (accel & MPEG2_ACCEL_X86_MMX) { + mpeg2_cpu_state_restore = state_restore_mmx; + } +diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c +index 81c57e0..a057bf7 100644 +--- a/libmpeg2/idct.c ++++ b/libmpeg2/idct.c +@@ -235,7 +235,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block, + + void mpeg2_idct_init (uint32_t accel) + { +-#ifdef ARCH_X86 ++#if !defined(_MSC_VER) && defined(ARCH_X86) + if (accel & MPEG2_ACCEL_X86_SSE2) { + mpeg2_idct_copy = mpeg2_idct_copy_sse2; + mpeg2_idct_add = mpeg2_idct_add_sse2; +diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c +index 7aed113..b00a32d 100644 +--- a/libmpeg2/motion_comp.c ++++ b/libmpeg2/motion_comp.c +@@ -33,7 +33,7 @@ mpeg2_mc_t mpeg2_mc; + + void mpeg2_mc_init (uint32_t accel) + { +-#ifdef ARCH_X86 ++#if !defined(_MSC_VER) && defined(ARCH_X86) + if (accel & MPEG2_ACCEL_X86_MMXEXT) + mpeg2_mc = mpeg2_mc_mmxext; + else if (accel & MPEG2_ACCEL_X86_3DNOW) +diff --git a/libvo/video_out_dx.c b/libvo/video_out_dx.c +index 36de68a..0797cdc 100644 +--- a/libvo/video_out_dx.c ++++ b/libvo/video_out_dx.c +@@ -82,7 +82,7 @@ static void update_overlay (dx_instance_t * instance) + dwFlags, &ddofx); + } + +-static long FAR PASCAL event_procedure (HWND hwnd, UINT message, ++static LRESULT FAR PASCAL event_procedure (HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam) + { + RECT rect_window; +@@ -92,7 +92,7 @@ static long FAR PASCAL event_procedure (HWND hwnd, UINT message, + switch (message) { + + case WM_WINDOWPOSCHANGED: +- instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); ++ instance = (dx_instance_t *) GetWindowLongPtr (hwnd, GWLP_USERDATA); + + /* update the window position and size */ + point_window.x = 0; +@@ -173,7 +173,7 @@ static int create_window (dx_instance_t * instance) + /* store a directx_instance pointer into the window local storage + * (for later use in event_handler). + * We need to use SetWindowLongPtr when it is available in mingw */ +- SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); ++ SetWindowLongPtr (instance->window, GWLP_USERDATA, (LONG_PTR) instance); + + ShowWindow (instance->window, SW_SHOW); + +diff --git a/vc++/config.h b/vc++/config.h +index 93719f0..a03cce6 100644 +--- a/vc++/config.h ++++ b/vc++/config.h +@@ -16,7 +16,9 @@ + /* #undef ARCH_SPARC */ + + /* x86 architecture */ ++#if defined(_M_AMD64) || defined(_M_IX86) + #define ARCH_X86 ++#endif + + /* maximum supported data alignment */ + /* #undef ATTRIBUTE_ALIGNED_MAX */ +-- +2.25.0 + diff --git a/ports/libmpeg2/CMakeLists.txt b/ports/libmpeg2/CMakeLists.txt new file mode 100644 index 00000000000000..88c0c8712d112a --- /dev/null +++ b/ports/libmpeg2/CMakeLists.txt @@ -0,0 +1,108 @@ +cmake_minimum_required(VERSION 3.2) +project(libmpeg2) + +option(TOOLS "Build libmpeg2 tools" OFF) + +set(MPEG2_SOURCE_FILES + libmpeg2/alloc.c + libmpeg2/cpu_accel.c + libmpeg2/cpu_state.c + libmpeg2/decode.c + libmpeg2/header.c + libmpeg2/idct.c + libmpeg2/idct_alpha.c + libmpeg2/idct_altivec.c + #libmpeg2/idct_mmx.c + libmpeg2/motion_comp.c + libmpeg2/motion_comp_alpha.c + libmpeg2/motion_comp_altivec.c + libmpeg2/motion_comp_arm.c + #libmpeg2/motion_comp_mmx.c + libmpeg2/motion_comp_vis.c + libmpeg2/slice.c + ) +set(VO_SOURCE_FILES + libvo/video_out.c + libvo/video_out_dx.c + libvo/video_out_null.c + libvo/video_out_pgm.c + libvo/video_out_sdl.c + libvo/video_out_x11.c + ) +set(MPEG2_CONVERT_SOURCES + libmpeg2/convert/rgb.c + #libmpeg2/convert/rgb_mmx.c + libmpeg2/convert/rgb_vis.c + libmpeg2/convert/uyvy.c + ) +set(GETOPT_FILES + src/getopt.c + ) +set(HEADERS + include/mpeg2.h + include/mpeg2convert.h + ) + +add_library(mpeg2 ${MPEG2_SOURCE_FILES}) +add_library(mpeg2convert ${MPEG2_CONVERT_SOURCES}) +add_library(getopt STATIC ${GETOPT_FILES}) +add_library(vo STATIC ${VO_SOURCE_FILES}) + +target_include_directories(mpeg2convert PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + ) +target_include_directories(getopt PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + ) +target_include_directories(vo PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + ) +target_include_directories(mpeg2 PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + ) +target_include_directories(mpeg2 INTERFACE + "${CMAKE_SOURCE_DIR}/include" + ) + +target_compile_definitions(getopt PUBLIC HAVE_CONFIG_H) +target_link_libraries(vo mpeg2convert) + +if (TOOLS) + add_executable(mpeg2dec src/mpeg2dec.c src/dump_state.c src/gettimeofday.c) + add_executable(extract_mpeg2 src/extract_mpeg2.c) + add_executable(corrupt_mpeg2 src/corrupt_mpeg2.c) + + target_compile_definitions(extract_mpeg2 PUBLIC HAVE_CONFIG_H) + target_compile_definitions(corrupt_mpeg2 PUBLIC HAVE_CONFIG_H) + + target_link_libraries(mpeg2dec PRIVATE getopt vo mpeg2convert mpeg2 gdi32) + target_link_libraries(extract_mpeg2 PRIVATE getopt) + target_link_libraries(corrupt_mpeg2 PRIVATE getopt) + + target_include_directories(mpeg2dec PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/src" + ) + target_include_directories(extract_mpeg2 PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/src" + ) + target_include_directories(corrupt_mpeg2 PUBLIC + "${CMAKE_SOURCE_DIR}/vc++" + "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/src" + ) +endif (TOOLS) + +install(TARGETS mpeg2 + EXPORT libmpeg2 + LIBRARY DESTINATION lib +) + +install(FILES ${HEADERS} DESTINATION "include/mpeg2dec") diff --git a/ports/libmpeg2/CONTROL b/ports/libmpeg2/CONTROL new file mode 100644 index 00000000000000..380cc6493801d4 --- /dev/null +++ b/ports/libmpeg2/CONTROL @@ -0,0 +1,8 @@ +Source: libmpeg2 +Version: 0.5.1 +Homepage: http://libmpeg2.sourceforge.net/ +Description: a free MPEG-2 video stream decoder +Supports: !(linux|osx|uwp) + +Feature: tools +Description: Build tools provided with libmpeg2 diff --git a/ports/libmpeg2/portfile.cmake b/ports/libmpeg2/portfile.cmake new file mode 100644 index 00000000000000..3813e0d6e46bca --- /dev/null +++ b/ports/libmpeg2/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Windows Desktop platform." ON_TARGET "Linux" "OSX" "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +# There is archived version of releases available at https://github.com/janisozaur/libmpeg2 +vcpkg_download_distfile(ARCHIVE + URLS "http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz" + FILENAME "libmpeg2-0.5.1.tar.gz" + SHA512 3648a2b3d7e2056d5adb328acd2fb983a1fa9a05ccb6f9388cc686c819445421811f42e8439418a0491a13080977f074a0d8bf8fa6bc101ff245ddea65a46fbc +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + 0001-Add-naive-MSVC-support-to-sources.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools TOOLS +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmpeg2 RENAME copyright) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_copy_pdbs() diff --git a/ports/libmupdf/CMakeLists.txt b/ports/libmupdf/CMakeLists.txt index daafef74c50a79..6800bea9aeb39b 100644 --- a/ports/libmupdf/CMakeLists.txt +++ b/ports/libmupdf/CMakeLists.txt @@ -3,26 +3,39 @@ project(libmupdf C) set(CMAKE_DEBUG_POSTFIX d) -if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/mupdf/pdf/name-table.h") +if(WIN32) execute_process( COMMAND "cmd.exe" "/c" "platform\\win32\\generate.bat" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ) -endif() +else() + find_program(MAKE_EXE NAMES make REQUIRED) + execute_process( + COMMAND ${MAKE_EXE} "generate" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + ) +endif() + find_package(freetype NO_MODULE REQUIRED) find_package(JPEG REQUIRED) find_path(HARFBUZZ_INCLUDE hb.h PATH_SUFFIXES harfbuzz) find_library(HARFBUZZ_LIBRARIES harfbuzz) find_package(ZLIB REQUIRED) -find_package(openjpeg REQUIRED) +find_package(OpenJPEG CONFIG REQUIRED) find_library(JBIG2DEC_LIB NAMES jbig2decd jbig2dec) file(GLOB_RECURSE SOURCES "source/*.c" "generated/*.c") list(FILTER SOURCES EXCLUDE REGEX "source/tools/[a-z]*\\.c$") +list(FILTER SOURCES EXCLUDE REGEX "source/tests/.*.c$") + add_library(libmupdf ${SOURCES}) -target_compile_definitions(libmupdf PRIVATE -DSHARE_JPEG -DFZ_ENABLE_JS=0 -DFZ_ENABLE_ICC=0) +if(WIN32) + target_compile_definitions(libmupdf PRIVATE -DSHARE_JPEG -DFZ_ENABLE_JS=0 -DFZ_ENABLE_ICC=0) +else() + target_compile_definitions(libmupdf PRIVATE -DSHARE_JPEG -DFZ_ENABLE_JS=0 -DFZ_ENABLE_ICC=0 -DHAVE_PTHREAD=1) +endif() target_include_directories(libmupdf PUBLIC include diff --git a/ports/libmupdf/CONTROL b/ports/libmupdf/CONTROL index bf3348ced36af8..e18d96642ab47a 100644 --- a/ports/libmupdf/CONTROL +++ b/ports/libmupdf/CONTROL @@ -1,5 +1,6 @@ Source: libmupdf -Version: 1.16.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 +Supports: !osx 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 eafef522b7feac..0ecbeafff6e8b7 100644 --- a/ports/libmupdf/portfile.cmake +++ b/ports/libmupdf/portfile.cmake @@ -1,15 +1,13 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "osx") 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}) @@ -18,6 +16,8 @@ vcpkg_configure_cmake( SOURCE_PATH "${SOURCE_PATH}" DISABLE_PARALLEL_CONFIGURE PREFER_NINJA + OPTIONS + -DBUILD_EXAMPLES=OFF ) vcpkg_install_cmake() diff --git a/ports/libmysql/CONTROL b/ports/libmysql/CONTROL index f3791e9d56917e..3979b93449354c 100644 --- a/ports/libmysql/CONTROL +++ b/ports/libmysql/CONTROL @@ -1,6 +1,6 @@ Source: libmysql -Version: 8.0.4-6 +Version: 8.0.20 Homepage: https://github.com/mysql/mysql-server -Build-Depends: boost-algorithm, boost-geometry, boost-optional, boost-functional, boost-graph, openssl, icu, libevent, liblzma, lz4, zlib +Build-Depends: boost-algorithm, boost-geometry, boost-optional, boost-functional, boost-graph, openssl, icu, libevent, lz4, zlib Description: A MySQL client library for C development. Supports: !(windows&x86)&!uwp \ No newline at end of file diff --git a/ports/libmysql/ignore-boost-version.patch b/ports/libmysql/ignore-boost-version.patch index ea7111dedd811e..99cee245012ab5 100644 --- a/ports/libmysql/ignore-boost-version.patch +++ b/ports/libmysql/ignore-boost-version.patch @@ -1,13 +1,13 @@ diff --git a/cmake/boost.cmake b/cmake/boost.cmake -index 2851181..8788322 100644 +index 592a67f..202a770 100644 --- a/cmake/boost.cmake +++ b/cmake/boost.cmake -@@ -280,7 +280,7 @@ IF(NOT BOOST_MAJOR_VERSION EQUAL 10) +@@ -297,7 +297,7 @@ IF(NOT BOOST_MAJOR_VERSION EQUAL 10) COULD_NOT_FIND_BOOST() ENDIF() --IF(NOT BOOST_MINOR_VERSION EQUAL 65) -+IF(NOT BOOST_MINOR_VERSION EQUAL 65 AND NOT IGNORE_BOOST_VERSION) +-IF(NOT BOOST_MINOR_VERSION EQUAL 70) ++IF(NOT BOOST_MINOR_VERSION EQUAL 70 AND NOT IGNORE_BOOST_VERSION) MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} " - "we need 65" + "we need 70" ) diff --git a/ports/libmysql/linux_libmysql.patch b/ports/libmysql/linux_libmysql.patch deleted file mode 100644 index 42dfa73d8d5782..00000000000000 --- a/ports/libmysql/linux_libmysql.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/configure.cmake b/configure.cmake -index 1f3d8e2..9e45f48 100644 ---- a/configure.cmake -+++ b/configure.cmake -@@ -456,7 +456,11 @@ IF(NOT HAVE_FCNTL_NONBLOCK) - ENDIF() - - IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) -- STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor) -+ IF(${CMAKE_SYSTEM_PROCESSOR}) -+ STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor) -+ ELSE() -+ STRING(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} processor) -+ ENDIF() - IF(processor MATCHES "86" OR processor MATCHES "amd64" OR processor MATCHES "x64") - IF(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS") - # The loader in some Solaris versions has a bug due to which it refuses to - diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 791a9c5db58e83..b943805cf7e90b 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,33 +1,37 @@ vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "x86") if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h") - message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") + message(FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible.") endif() -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") - message(WARNING "libmysql needs ncurses on LINUX, please install ncurses first.\nOn Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.") +if (VCPKG_TARGET_IS_LINUX) + message(WARNING "${PORT} needs ncurses on LINUX, please install ncurses first.\nOn Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.") endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mysql/mysql-server - REF mysql-8.0.4 - SHA512 8d9129e7670e88df14238299052a5fe6d4f3e40bf27ef7a3ca8f4f91fb40507b13463e9bd24435b34e5d06c5d056dfb259fb04e77cc251b188eea734db5642be + REF 7d10c82196c8e45554f27c00681474a9fb86d137 # 8.0.20 + SHA512 9f5e8cc254ea2a4cf76313287c7bb6fc693400810464dd2901e67d51ecb27f8916009464fd8aed8365c3038314b845b3d517db6e82ae5c7908612f0b3b72335f HEAD_REF master PATCHES ignore-boost-version.patch system-libs.patch - linux_libmysql.patch - re2_add_compile_flags.patch + rename-version.patch ) -file(REMOVE_RECURSE ${SOURCE_PATH}/include/boost_1_65_0) +file(REMOVE_RECURSE ${SOURCE_PATH}/include/boost_1_70_0) set(STACK_DIRECTION) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(STACK_DIRECTION -DSTACK_DIRECTION=-1) endif() +#Skip the version check for Visual Studio +if(VCPKG_TARGET_IS_WINDOWS) + set(FORCE_UNSUPPORTED_COMPILER 1) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -36,16 +40,14 @@ vcpkg_configure_cmake( -DWITH_UNIT_TESTS=OFF -DENABLED_PROFILING=OFF -DWIX_DIR=OFF - -DHAVE_LLVM_LIBCPP_EXITCODE=1 ${STACK_DIRECTION} - -DWINDOWS_RUNTIME_MD=ON # Note: this disables _replacement_ of /MD with /MT. If /MT is specified, it will be preserved. -DIGNORE_BOOST_VERSION=ON -DWITH_SSL=system -DWITH_ICU=system -DWITH_LIBEVENT=system - -DWITH_LZMA=system -DWITH_LZ4=system -DWITH_ZLIB=system + -DFORCE_UNSUPPORTED_COMPILER=${FORCE_UNSUPPORTED_COMPILER} ) vcpkg_install_cmake(ADD_BIN_TO_PATH) @@ -70,18 +72,13 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/debug ${CURRENT_PACKAGES_DIR}/lib/plugin/debug) -# remove misc files +## remove misc files file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE ${CURRENT_PACKAGES_DIR}/README ${CURRENT_PACKAGES_DIR}/debug/LICENSE ${CURRENT_PACKAGES_DIR}/debug/README) -# remove not-related libs -file (REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmysql.lib diff --git a/ports/libmysql/re2_add_compile_flags.patch b/ports/libmysql/re2_add_compile_flags.patch deleted file mode 100644 index 4734e84f6f4543..00000000000000 --- a/ports/libmysql/re2_add_compile_flags.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/extra/re2/CMakeLists.txt b/extra/re2/CMakeLists.txt -index ca39db726..965f2c8dc 100644 ---- a/extra/re2/CMakeLists.txt -+++ b/extra/re2/CMakeLists.txt -@@ -71,6 +71,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - HAVE_TAUTOLOGICAL_UNDEFINED_COMPARE) - IF(HAVE_TAUTOLOGICAL_UNDEFINED_COMPARE) - # Boost source has unused local typedefs. -+ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) - ADD_COMPILE_FLAGS(${RE2_SOURCES} - COMPILE_FLAGS "-Wno-tautological-undefined-compare") - ENDIF() diff --git a/ports/libmysql/rename-version.patch b/ports/libmysql/rename-version.patch new file mode 100644 index 00000000000000..15598382570e36 --- /dev/null +++ b/ports/libmysql/rename-version.patch @@ -0,0 +1,26 @@ +diff --git a/VERSION b/VERSION.txt +similarity index 100% +rename from VERSION +rename to VERSION.txt +diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake +index bed6e9f02e2..a924ef09bac 100644 +--- a/cmake/mysql_version.cmake ++++ b/cmake/mysql_version.cmake +@@ -30,7 +30,7 @@ SET(PROTOCOL_VERSION "10") + + # Generate "something" to trigger cmake rerun when VERSION changes + CONFIGURE_FILE( +- ${CMAKE_SOURCE_DIR}/VERSION ++ ${CMAKE_SOURCE_DIR}/VERSION.txt + ${CMAKE_BINARY_DIR}/VERSION.dep + ) + +@@ -38,7 +38,7 @@ CONFIGURE_FILE( + + MACRO(MYSQL_GET_CONFIG_VALUE keyword var) + IF(NOT ${var}) +- FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=") ++ FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION.txt str REGEX "^[ ]*${keyword}=") + IF(str) + STRING(REPLACE "${keyword}=" "" str ${str}) + STRING(REGEX REPLACE "[ ].*" "" str "${str}") diff --git a/ports/libmysql/system-libs.patch b/ports/libmysql/system-libs.patch index 3fb4d35c87c351..2715823ea83deb 100644 --- a/ports/libmysql/system-libs.patch +++ b/ports/libmysql/system-libs.patch @@ -1,8 +1,8 @@ diff --git a/cmake/icu.cmake b/cmake/icu.cmake -index ce9cc67..64445c5 100644 +index fde3a75..9f694b9 100644 --- a/cmake/icu.cmake +++ b/cmake/icu.cmake -@@ -40,49 +40,10 @@ SET(DEFAULT_ICU "bundled") +@@ -38,49 +38,11 @@ # install_root is either 'system' or is assumed to be a path. # MACRO (FIND_ICU install_root) @@ -48,16 +48,16 @@ index ce9cc67..64445c5 100644 - - # Needed for version information. - SET(ICU_COMMON_DIR ${ICU_INCLUDE_DIR}) -- -+ find_package(ICU REQUIRED COMPONENTS uc io dt in) -+ set(ICU_SYSTEM_LIBRARIES ICU::uc ICU::io ICU::dt ICU::in) -+ set(ICU_COMMON_DIR ${ICU_INCLUDE_DIR}) -+ SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR}) + ++ find_package(ICU REQUIRED COMPONENTS uc io dt in) ++ set(ICU_SYSTEM_LIBRARIES ICU::uc ICU::io ICU::dt ICU::in) ++ set(ICU_COMMON_DIR ${ICU_INCLUDE_DIR}) ++ SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR}) ENDMACRO() MACRO (MYSQL_USE_BUNDLED_ICU) diff --git a/cmake/lz4.cmake b/cmake/lz4.cmake -index 6e576c3..60cb8ba 100644 +index 9aad130..68cbaba 100644 --- a/cmake/lz4.cmake +++ b/cmake/lz4.cmake @@ -25,7 +25,7 @@ @@ -69,69 +69,49 @@ index 6e576c3..60cb8ba 100644 IF (PATH_TO_LZ4 AND LZ4_SYSTEM_LIBRARY) SET(SYSTEM_LZ4_FOUND 1) INCLUDE_DIRECTORIES(SYSTEM ${PATH_TO_LZ4}) -diff --git a/cmake/lzma.cmake b/cmake/lzma.cmake -index ac8aaa7..78d8e8d 100644 ---- a/cmake/lzma.cmake -+++ b/cmake/lzma.cmake -@@ -24,15 +24,10 @@ - # bundled is the default - - MACRO (FIND_SYSTEM_LZMA) -- FIND_PATH(PATH_TO_LZMA NAMES lzma/lzma.h) -- FIND_LIBRARY(LZMA_SYSTEM_LIBRARY NAMES lzma) -- IF (PATH_TO_LZMA AND LZMA_SYSTEM_LIBRARY) -- SET(SYSTEM_LZMA_FOUND 1) -- SET(LZMA_INCLUDE_DIR ${PATH_TO_LZMA}) -- SET(LZMA_LIBRARY ${LZMA_SYSTEM_LIBRARY}) -- MESSAGE(STATUS "LZMA_INCLUDE_DIR ${LZMA_INCLUDE_DIR}") -- MESSAGE(STATUS "LZMA_LIBRARY ${LZMA_LIBRARY}") -- ENDIF() -+ find_package(LibLZMA REQUIRED) -+ set(LZMA_INCLUDE_DIR ${LZMA_INCLUDE_DIRS}) -+ set(LZMA_LIBRARY ${LZMA_LIBRARIES}) -+ set(SYSTEM_LZMA_FOUND 1) - ENDMACRO() - - MACRO (MYSQL_USE_BUNDLED_LZMA) diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake -index 8af9699..2bdfe14 100644 +index 52feade..4a0237a 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake -@@ -104,6 +104,17 @@ ENDMACRO() +@@ -93,7 +93,20 @@ ENDMACRO() # Provides the following configure options: - # WITH_SSL=[yes|bundled|system|] + # WITH_SSL=[yes|system|] MACRO (MYSQL_CHECK_SSL) + find_package(OpenSSL REQUIRED) -+ find_package(Threads REQUIRED) + set(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY} CACHE STRING "") + set(CRYPTO_LIBRARY ${OPENSSL_CRYPTO_LIBRARY} CACHE STRING "") + FIND_PROGRAM(OPENSSL_EXECUTABLE openssl + DOC "path to the openssl executable") + SET(SSL_DEFINES "-DHAVE_OPENSSL") -+ set(SSL_LIBRARIES ${OPENSSL_LIBRARIES} Threads::Threads) ++ set(SSL_LIBRARIES ${OPENSSL_LIBRARIES}) ++ if(NOT WIN32) ++ find_package(Threads REQUIRED) ++ list(APPEND SSL_LIBRARIES Threads::Threads) ++ endif() +ENDMACRO() -+ + +MACRO (MYSQL_CHECK_SSL_OLD) IF(NOT WITH_SSL) - IF(WIN32) - CHANGE_SSL_SETTINGS("bundled") + SET(WITH_SSL "system" CACHE STRING ${WITH_SSL_DOC_STRING} FORCE) + ENDIF() diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake -index e74b8c9..6695075 100644 +index 26c56fe..65bebb4 100644 --- a/cmake/zlib.cmake +++ b/cmake/zlib.cmake -@@ -51,27 +51,7 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS) +@@ -51,28 +51,7 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS) IF(WITH_ZLIB STREQUAL "bundled") MYSQL_USE_BUNDLED_ZLIB() ELSE() - SET(ZLIB_FIND_QUIETLY TRUE) - INCLUDE(FindZLIB) - IF(ZLIB_FOUND) -- INCLUDE(CheckFunctionExists) -- SET(CMAKE_REQUIRED_LIBRARIES z) +- INCLUDE(CheckFunctionExists) +- SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) +- SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} z) - CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32) - CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND) - CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND) -- SET(CMAKE_REQUIRED_LIBRARIES) +- SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) - IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND) - SET(ZLIB_LIBRARY ${ZLIB_LIBRARIES} CACHE INTERNAL "System zlib library") - SET(WITH_ZLIB "system" CACHE STRING @@ -145,7 +125,7 @@ index e74b8c9..6695075 100644 - IF(NOT ZLIB_FOUND) - MYSQL_USE_BUNDLED_ZLIB() - ENDIF() -+ find_package(ZLIB REQUIRED) -+ SET(ZLIB_LIBRARY ZLIB::ZLIB CACHE INTERNAL "System zlib library") ++ find_package(ZLIB REQUIRED) ++ SET(ZLIB_LIBRARY ZLIB::ZLIB CACHE INTERNAL "System zlib library") ENDIF() ENDMACRO() diff --git a/ports/libnice/CONTROL b/ports/libnice/CONTROL index 258ac274aa14d1..a2f87af5cba4db 100644 --- a/ports/libnice/CONTROL +++ b/ports/libnice/CONTROL @@ -1,5 +1,5 @@ Source: libnice -Version: 0.1.15-2 +Version: 0.1.15-4 Homepage: https://nice.freedesktop.org Description: Libnice is an implementation of the IETF's Interactive Connectivity Establishment (ICE) standard (RFC 5245) and the Session Traversal Utilities for NAT (STUN) standard (RFC 5389). Build-Depends: glib, openssl diff --git a/ports/libnice/portfile.cmake b/ports/libnice/portfile.cmake index 14fb0d646c52ad..ff09f48372294c 100644 --- a/ports/libnice/portfile.cmake +++ b/ports/libnice/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile( ARCHIVE URLS "https://nice.freedesktop.org/releases/libnice-0.1.15.tar.gz" @@ -24,7 +22,6 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) -file(COPY ${SOURCE_PATH}/COPYING.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) -file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libnice/COPYING ${CURRENT_PACKAGES_DIR}/share/libnice/copyright) +file(COPY ${SOURCE_PATH}/COPYING.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libodb-mysql/CONTROL b/ports/libodb-mysql/CONTROL index 53db9a2ffbfc59..e6a4e06890f0f2 100644 --- a/ports/libodb-mysql/CONTROL +++ b/ports/libodb-mysql/CONTROL @@ -1,5 +1,5 @@ Source: libodb-mysql -Version: 2.4.0-6 +Version: 2.4.0-7 Homepage: https://www.codesynthesis.com/products/odb/ Description: MySQL support for the ODB ORM library Build-Depends: libodb, libmysql diff --git a/ports/libodb-mysql/fix-redefinttion.patch b/ports/libodb-mysql/fix-redefinttion.patch new file mode 100644 index 00000000000000..ec6dab45991181 --- /dev/null +++ b/ports/libodb-mysql/fix-redefinttion.patch @@ -0,0 +1,32 @@ +diff --git a/odb/mysql/mysql-types.hxx b/odb/mysql/mysql-types.hxx +index 5396791..32a2a03 100644 +--- a/odb/mysql/mysql-types.hxx ++++ b/odb/mysql/mysql-types.hxx +@@ -7,13 +7,24 @@ + + #include + ++#include ++ + typedef bool my_bool; ++ ++#if !defined(LIBODB_MYSQL_MARIADB) && MYSQL_VERSION_ID >= 80011 ++struct MYSQL_BIND; ++#else + typedef struct st_mysql_bind MYSQL_BIND; ++#endif + +-#ifdef LIBODB_MYSQL_INCLUDE_SHORT +-# include ++#ifdef LIBODB_MYSQL_MARIADB ++# include + #else +-# include ++# ifdef LIBODB_MYSQL_INCLUDE_SHORT ++# include ++# else ++# include ++# endif + #endif + + #endif // ODB_MYSQL_MYSQL_TYPES_HXX diff --git a/ports/libodb-mysql/portfile.cmake b/ports/libodb-mysql/portfile.cmake index 7731c167a97ba4..a52f6fc0547e5f 100644 --- a/ports/libodb-mysql/portfile.cmake +++ b/ports/libodb-mysql/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://www.codesynthesis.com/download/odb/2.4/libodb-mysql-2.4.0.tar.gz" FILENAME "libodb-mysql-2.4.0.tar.gz" @@ -10,7 +8,8 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} OUT_SOURCE_PATH SOURCE_PATH PATCHES - ${CMAKE_CURRENT_LIST_DIR}/adapter_mysql_8.0.patch + adapter_mysql_8.0.patch + fix-redefinttion.patch ) file(COPY 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/libosip2/CONTROL b/ports/libosip2/CONTROL index 2fe1f8b1694fab..5d172511e31dcd 100644 --- a/ports/libosip2/CONTROL +++ b/ports/libosip2/CONTROL @@ -1,5 +1,6 @@ Source: libosip2 -Version: 5.1.0-3 +Version: 5.1.0-4 Homepage: https://www.gnu.org/software/osip/ Description: oSIP is an LGPL implementation of SIP. It's stable, portable, flexible and compliant! -may be more-! It is used mostly with eXosip2 stack (GPL) which provides simpler API for User-Agent implementation. -Supports: !(windows|uwp) \ No newline at end of file +Build-Depends: pthread +Supports: !(windows|uwp) diff --git a/ports/libosip2/portfile.cmake b/ports/libosip2/portfile.cmake index 60b5c4558f403b..28321ff454e93f 100644 --- a/ports/libosip2/portfile.cmake +++ b/ports/libosip2/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} only supports Unix currently." ON_TARGET "Windows") - set(LIBOSIP2_VER "5.1.0") vcpkg_download_distfile(ARCHIVE @@ -13,24 +11,18 @@ vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ) +if(VCPKG_TARGET_IS_WINDOWS) + set(OPTIONS --enable-mt=no) +endif() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - NO_DEBUG - AUTO_HOST - AUTO_DST - PRERUN_SHELL autogen.sh + OPTIONS ${OPTIONS} ) vcpkg_install_make() - +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(GLOB_RECURSE LIBOSIP2_BINARIES ${CURRENT_PACKAGES_DIR}/lib *.so) -foreach(LIBOSIP2_BINARY LIBOSIP2_BINARIES) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${LIBOSIP2_BINARY} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - endif() - file(REMOVE ${LIBOSIP2_BINARY}) -endforeach() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # 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/libosmium/CONTROL b/ports/libosmium/CONTROL new file mode 100644 index 00000000000000..42b97a70106664 --- /dev/null +++ b/ports/libosmium/CONTROL @@ -0,0 +1,5 @@ +Source: libosmium +Version: 2.15.5 +Homepage: https://osmcode.org/libosmium/ +Description: A fast and flexible C++ library for working with OpenStreetMap data +Build-Depends: utfcpp, expat, zlib, proj4, bzip2, protozero, boost diff --git a/ports/libosmium/portfile.cmake b/ports/libosmium/portfile.cmake new file mode 100644 index 00000000000000..9dd5c09e877744 --- /dev/null +++ b/ports/libosmium/portfile.cmake @@ -0,0 +1,21 @@ +# header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO osmcode/libosmium + REF v2.15.5 + SHA512 a4972901db8ed89302e6ba15fd104543b5e36a41bc83daf8f6f6fb29ce73b0dbd8596de801d099a33df413b26eec1b3a6f4f0d669936ecc6d25f88d783468a59 +) +set(BOOST_ROOT ${CURRENT_INSTALLED_DIR}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF +) + +vcpkg_install_cmake() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") diff --git a/ports/libpcap/0001-fix-package-name.patch b/ports/libpcap/0001-fix-package-name.patch new file mode 100644 index 00000000000000..cd1deeed267c00 --- /dev/null +++ b/ports/libpcap/0001-fix-package-name.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 55b93f1..f4f9d51 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2358,7 +2358,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include) + # On UN*X, and on Windows when not using MSVC, generate libpcap.pc and + # pcap-config and process man pages and arrange that they be installed. + if(NOT MSVC) +- set(PACKAGE_NAME ${LIBRARY_NAME}) + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") + set(includedir "\${prefix}/include") diff --git a/ports/libpcap/CONTROL b/ports/libpcap/CONTROL index 3c60fc8401c913..d96e55895d3af9 100644 --- a/ports/libpcap/CONTROL +++ b/ports/libpcap/CONTROL @@ -1,4 +1,5 @@ Source: libpcap -Version: 1.9.1 +Version: 1.9.1-2 Description: A portable C/C++ library for network traffic capture Homepage: https://www.tcpdump.org/ +Supports: !(arm64|uwp|osx) diff --git a/ports/libpcap/add-disable-packet-option.patch b/ports/libpcap/add-disable-packet-option.patch new file mode 100644 index 00000000000000..842176a559720f --- /dev/null +++ b/ports/libpcap/add-disable-packet-option.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3fe9979..23783d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -161,6 +161,7 @@ set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to dire + option(DISABLE_SNF "Disable Myricom SNF support" OFF) + + option(DISABLE_TC "Disable Riverbed TurboCap support" OFF) ++option(DISABLE_PACKET "Disable Packet support" OFF) + + # + # Debugging options. +@@ -220,19 +221,21 @@ if(WIN32) + include_directories(${CMAKE_HOME_DIRECTORY}/../../Common) + endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common) + +- find_package(Packet) +- if(PACKET_FOUND) +- set(HAVE_PACKET32 TRUE) +- include_directories(${PACKET_INCLUDE_DIRS}) +- # +- # Check whether we have the NPcap PacketIsLoopbackAdapter() +- # function. +- # +- cmake_push_check_state() +- set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES}) +- check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) +- cmake_pop_check_state() +- endif(PACKET_FOUND) ++ if(NOT DISABLE_PACKET) ++ find_package(Packet) ++ if(PACKET_FOUND) ++ set(HAVE_PACKET32 TRUE) ++ include_directories(${PACKET_INCLUDE_DIRS}) ++ # ++ # Check whether we have the NPcap PacketIsLoopbackAdapter() ++ # function. ++ # ++ cmake_push_check_state() ++ set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES}) ++ check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) ++ cmake_pop_check_state() ++ endif(PACKET_FOUND) ++ endif() + + message(STATUS "checking for Npcap's version.h") + check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSION_H) diff --git a/ports/libpcap/install-pc-on-msvc.patch b/ports/libpcap/install-pc-on-msvc.patch new file mode 100644 index 00000000000000..f2cd64b44ef1b3 --- /dev/null +++ b/ports/libpcap/install-pc-on-msvc.patch @@ -0,0 +1,97 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 55b93f1..3fe9979 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2355,48 +2355,54 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include) + +-# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and ++# Generate libpcap.pc ++if(BUILD_SHARED_LIBS) ++ set(PACKAGE_NAME ${LIBRARY_NAME}) ++else() ++ set(PACKAGE_NAME pcap) ++endif() ++set(prefix ${CMAKE_INSTALL_PREFIX}) ++set(exec_prefix "\${prefix}") ++set(includedir "\${prefix}/include") ++set(libdir "\${exec_prefix}/lib") ++if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR ++ CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR ++ CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR ++ CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR ++ CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ++ CMAKE_SYSTEM_NAME STREQUAL "OSF1") ++ # ++ # Platforms where the linker is the GNU linker ++ # or accepts command-line arguments like ++ # those the GNU linker accepts. ++ # ++ set(V_RPATH_OPT "-Wl,-rpath,") ++elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") ++ # ++ # SunOS 5.x. ++ # ++ # XXX - this assumes GCC is using the Sun linker, ++ # rather than the GNU linker. ++ # ++ set(V_RPATH_OPT "-Wl,-R,") ++else() ++ # ++ # No option needed to set the RPATH. ++ # ++ set(V_RPATH_OPT "") ++endif() ++set(LIBS "") ++foreach(LIB ${PCAP_LINK_LIBRARIES}) ++ set(LIBS "${LIBS} -l${LIB}") ++endforeach(LIB) ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) ++ ++# On UN*X, and on Windows when not using MSVC, generate + # pcap-config and process man pages and arrange that they be installed. + if(NOT MSVC) +- set(prefix ${CMAKE_INSTALL_PREFIX}) +- set(exec_prefix "\${prefix}") +- set(includedir "\${prefix}/include") +- set(libdir "\${exec_prefix}/lib") +- if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR +- CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR +- CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR +- CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR +- CMAKE_SYSTEM_NAME STREQUAL "Linux" OR +- CMAKE_SYSTEM_NAME STREQUAL "OSF1") +- # +- # Platforms where the linker is the GNU linker +- # or accepts command-line arguments like +- # those the GNU linker accepts. +- # +- set(V_RPATH_OPT "-Wl,-rpath,") +- elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") +- # +- # SunOS 5.x. +- # +- # XXX - this assumes GCC is using the Sun linker, +- # rather than the GNU linker. +- # +- set(V_RPATH_OPT "-Wl,-R,") +- else() +- # +- # No option needed to set the RPATH. +- # +- set(V_RPATH_OPT "") +- endif() +- set(LIBS "") +- foreach(LIB ${PCAP_LINK_LIBRARIES}) +- set(LIBS "${LIBS} -l${LIB}") +- endforeach(LIB) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) +- + # + # Man pages. + # diff --git a/ports/libpcap/portfile.cmake b/ports/libpcap/portfile.cmake index 74caa463174705..ab254048230b37 100644 --- a/ports/libpcap/portfile.cmake +++ b/ports/libpcap/portfile.cmake @@ -1,11 +1,19 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX") +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports x64-windows, x86-windows and Linux" ON_TARGET "UWP" "OSX" ON_ARCH "arm64") -message( +if(EXISTS "${CURRENT_INSTALLED_DIR}/share/winpcap") + message(FATAL_ERROR "FATAL ERROR: winpcap and libpcap are incompatible.") +endif() + +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + message( "libpcap currently requires the following libraries from the system package manager: flex libbison-dev These can be installed on Ubuntu systems via sudo apt install flex libbison-dev" -) + ) +endif() + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) vcpkg_download_distfile( SOURCE_ARCHIVE_PATH @@ -18,8 +26,24 @@ vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${SOURCE_ARCHIVE_PATH} REF 1.9.1 + PATCHES + 0001-fix-package-name.patch + install-pc-on-msvc.patch + add-disable-packet-option.patch ) +# Only dynamic builds are currently supported on Windows +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) +endif() + +vcpkg_find_acquire_program(BISON) +get_filename_component(BISON_PATH ${BISON} DIRECTORY) +vcpkg_add_to_path(${BISON_PATH}) +vcpkg_find_acquire_program(FLEX) +get_filename_component(FLEX_PATH ${FLEX} DIRECTORY) +vcpkg_add_to_path(${FLEX_PATH}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -29,21 +53,43 @@ vcpkg_configure_cmake( -DDISABLE_BLUETOOTH=ON -DDISABLE_DBUS=ON -DDISABLE_RDMA=ON + -DDISABLE_DAG=ON + -DDISABLE_SEPTEL=ON + -DDISABLE_SNF=ON + -DDISABLE_TC=ON + -DDISABLE_PACKET=ON + -DENABLE_REMOTE=OFF ) vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpcap RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# On Windows 64-bit, libpcap 1.9.1 installs the libraries in a amd64 subdirectory of the usual directories +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(libsubdir "amd64") + file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/${libsubdir}/*) + file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir}/*) + file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/bin/${libsubdir}/*) + file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}/*) + file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/${libsubdir} + ${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir} + ${CURRENT_PACKAGES_DIR}/bin/${libsubdir} + ${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}) +endif() + +# Even if compiled with BUILD_SHARED_LIBS=ON, pcap also install a pcap_static library +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/pcap_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pcap_static.lib) +endif() + +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES ws2_32) 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 ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/man) -file(READ ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcap.pc LIBPCAP_PC) -string(REGEX REPLACE \($|\n\)prefix=[^\n]+ \\1prefix=\"${CURRENT_INSTALLED_DIR}\" LIBPCAP_PC_FIXED "${LIBPCAP_PC}") -file(WRITE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcap.pc "${LIBPCAP_PC_FIXED}") - -file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcap.pc DEBUG_LIBPCAP_PC) -string(REGEX REPLACE \($|\n\)prefix=[^\n]+ \\1prefix=\"${CURRENT_INSTALLED_DIR}/debug\" DEBUG_LIBPCAP_PC_FIXED "${DEBUG_LIBPCAP_PC}") -file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcap.pc "${DEBUG_LIBPCAP_PC_FIXED}") diff --git a/ports/libpmemobj-cpp/CONTROL b/ports/libpmemobj-cpp/CONTROL index 0ac84681ae6e18..f282490937390b 100644 --- a/ports/libpmemobj-cpp/CONTROL +++ b/ports/libpmemobj-cpp/CONTROL @@ -1,3 +1,8 @@ Source: libpmemobj-cpp -Version: 1.8 -Description: C++ bindings for libpmemobj (https://github.com/pmem/pmdk). \ No newline at end of file +Version: 1.10 +Homepage: https://github.com/pmem/libpmemobj-cpp +Description: C++ bindings for libpmemobj (https://github.com/pmem/pmdk). + +Feature: benchmark +Build-Depends: pmdk +Description: build benchmarks diff --git a/ports/libpmemobj-cpp/fixlibpmemobj-cpp.patch b/ports/libpmemobj-cpp/fixlibpmemobj-cpp.patch new file mode 100644 index 00000000000000..e5221b13a8db0d --- /dev/null +++ b/ports/libpmemobj-cpp/fixlibpmemobj-cpp.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 55f068b..7123174 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -133,15 +133,17 @@ if(CLANG) + endif() + endif() + +-if(BUILD_TESTS OR BUILD_EXAMPLES) +- if(PKG_CONFIG_FOUND) +- pkg_check_modules(LIBPMEMOBJ REQUIRED libpmemobj>=${LIBPMEMOBJ_REQUIRED_VERSION}) +- pkg_check_modules(LIBPMEM REQUIRED libpmem>=${LIBPMEM_REQUIRED_VERSION}) +- else() +- find_package(LIBPMEMOBJ REQUIRED ${LIBPMEMOBJ_REQUIRED_VERSION}) +- find_package(LIBPMEM REQUIRED ${LIBPMEM_REQUIRED_VERSION}) +- endif() ++if (BUILD_BENCHMARKS OR BUILD_TESTS OR BUILD_EXAMPLES) ++if(PKG_CONFIG_FOUND) ++ pkg_check_modules(LIBPMEMOBJ REQUIRED libpmemobj>=${LIBPMEMOBJ_REQUIRED_VERSION}) ++ pkg_check_modules(LIBPMEM REQUIRED libpmem>=${LIBPMEM_REQUIRED_VERSION}) ++else() ++ find_package(LIBPMEMOBJ REQUIRED ${LIBPMEMOBJ_REQUIRED_VERSION}) ++ find_package(LIBPMEM REQUIRED ${LIBPMEM_REQUIRED_VERSION}) ++endif() ++endif() + ++if(BUILD_TESTS OR BUILD_EXAMPLES) + if (LIBPMEMOBJ_VERSION AND LIBPMEMOBJ_VERSION MATCHES "[0-9]+[.][0-9]+.*") + string(REGEX REPLACE "\\+git.*" "" LIBPMEMOBJ_VERSION_SHORT ${LIBPMEMOBJ_VERSION}) + string(REGEX REPLACE "-rc.*" "" LIBPMEMOBJ_VERSION_SHORT ${LIBPMEMOBJ_VERSION_SHORT}) +diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt +index a390731..e4764d3 100644 +--- a/benchmarks/CMakeLists.txt ++++ b/benchmarks/CMakeLists.txt +@@ -27,6 +27,12 @@ function(add_benchmark name) + prepend(srcs ${CMAKE_CURRENT_SOURCE_DIR} ${srcs}) + add_executable(benchmark-${name} ${srcs}) + target_link_libraries(benchmark-${name} ${LIBPMEMOBJ_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) ++ install( ++ TARGETS benchmark-${name} ++ RUNTIME DESTINATION tools ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) + endfunction() + + add_check_whitespace(benchmarks-cmake ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) diff --git a/ports/libpmemobj-cpp/portfile.cmake b/ports/libpmemobj-cpp/portfile.cmake index fb27eea2a4f7fc..172765f93ba0ae 100644 --- a/ports/libpmemobj-cpp/portfile.cmake +++ b/ports/libpmemobj-cpp/portfile.cmake @@ -1,22 +1,26 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pmem/libpmemobj-cpp - REF 1.8 - SHA512 275d5ec3081ccbc76c57205cc366e213386ff56e5c05fe39e8b980c507967e9f32a31e02d074f554e65cb68509a43c39d143f0443816a89da4a334bd6242ba85 + REF 8ff8c542a87a6ac9cb52c5c04def66d844c290cb #v1.10 + SHA512 09ee9a027fee74d6352ec92445fb5c688b7cc28bc30258d4a9efc250242a1c43f6c55c07f9e43e72d50e09f93dc8eeaffabec9e205f2af2899bde63b7fbdfca1 HEAD_REF master + PATCHES + fixlibpmemobj-cpp.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + benchmark BUILD_BENCHMARKS ) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") +vcpkg_add_to_path(${PERL_EXE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA DISABLE_PARALLEL_CONFIGURE - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF @@ -24,8 +28,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpmemobj++/cmake TARGET_PATH share/libpmemobj++) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib/libpmemobj++) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 173c3a0d39c652..f05692745ba359 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,5 @@ Source: libpng -Version: 1.6.37-7 +Version: 1.6.37-10 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..8deab06d2af6e0 --- /dev/null +++ b/ports/libpng/pkgconfig.2.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f85d17ef..8de0eb299 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -814,20 +814,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") ++ set(LIBS "-lz") ++ if(NOT APPLE) ++ string(APPEND LIBS " -lm") ++ endif() +- 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) ++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) ++ + # 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 cc3ee459cb62f8..d8c7f719351223 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(LIBPNG_VER 1.6.37) # Download the apng patch @@ -8,21 +6,21 @@ if ("apng" IN_LIST FEATURES) set(LIBPNG_APG_PATCH_NAME libpng-${LIBPNG_VER}-apng.patch) set(LIBPNG_APG_PATCH_PATH ${CURRENT_BUILDTREES_DIR}/src/${LIBPNG_APG_PATCH_NAME}) if (NOT EXISTS ${LIBPNG_APG_PATCH_PATH}) + if (NOT EXISTS ${CURRENT_BUILDTREES_DIR}/src) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src) + endif() vcpkg_download_distfile(LIBPNG_APNG_PATCH_ARCHIVE URLS "https://downloads.sourceforge.net/project/libpng-apng/libpng16/${LIBPNG_VER}/${LIBPNG_APG_PATCH_NAME}.gz" 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() @@ -36,6 +34,8 @@ vcpkg_from_github( PATCHES use_abort.patch cmake.patch + pkgconfig.patch + pkgconfig.2.patch ${APNG_EXTRA_PATCH} ) @@ -52,26 +52,70 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL iOS) set(LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_HARDWARE_OPTIMIZATIONS=OFF") endif() +set(LD_VERSION_SCRIPT_OPTION ) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Android) + set(LD_VERSION_SCRIPT_OPTION "-Dld-version-script=OFF") +endif() + 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} + -DPNG_ARM_NEON=on -DPNG_STATIC=${PNG_STATIC_LIBS} -DPNG_SHARED=${PNG_SHARED_LIBS} -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() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + 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() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + 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}") + 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}") + file(WRITE "${_file}" "${_contents}") + endif() +endif() +vcpkg_fixup_pkgconfig() 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/libpopt/CONTROL b/ports/libpopt/CONTROL index 03cd3e374d86c6..7dc75fcbcc17b7 100644 --- a/ports/libpopt/CONTROL +++ b/ports/libpopt/CONTROL @@ -1,3 +1,3 @@ Source: libpopt -Version: 1.16-12 +Version: 1.16-13 Description: Library for parsing command line parameters diff --git a/ports/libpopt/portfile.cmake b/ports/libpopt/portfile.cmake index 95970e78e7548f..a4ead066cc0ee0 100644 --- a/ports/libpopt/portfile.cmake +++ b/ports/libpopt/portfile.cmake @@ -1,11 +1,8 @@ -include(vcpkg_common_functions) - set(LIBPOPT_VERSION 1.16) set(LIBPOPT_HASH bae2dd4e5d682ef023fdc77ae60c4aad01a3a576d45af9d78d22490c11e410e60edda37ede171920746d4ae0d5de3c060d15cecfd41ba75b727a811be828d694) vcpkg_download_distfile(ARCHIVE URLS - "http://rpm5.org/files/popt/popt-${LIBPOPT_VERSION}.tar.gz" "https://ftp.openbsd.org/pub/OpenBSD/distfiles/popt-${LIBPOPT_VERSION}.tar.gz" FILENAME "popt-${LIBPOPT_VERSION}.tar.gz" SHA512 ${LIBPOPT_HASH} @@ -33,5 +30,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpopt) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpopt/COPYING ${CURRENT_PACKAGES_DIR}/share/libpopt/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index 8517fda64f0a4b..e42dd5f5e20c60 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,5 +1,6 @@ Source: libpq -Version: 12.0-1 +Version: 12.2 +Port-Version: 6 Build-Depends: libpq[bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ @@ -22,41 +23,21 @@ Feature: libedit Build-Depends: libedit Description: prefer libedit (--with-libedit-preferred) -Feature: perl -Build-Depends: perl -Description: build the server programming language PL/Perl (dynamic only?) (--with-perl) - Feature: python -Build-Depends: python +Build-Depends: python3, libpq[core,client] Description: build the PL/Python server programming language (dynamic only?) (--with-python) Feature: tcl -Build-Depends: tcl +Build-Depends: tcl, libpq[core,client] Description: build the PL/Tcl procedural language(dynamic only?) (--with-tcl) Feature: nls Build-Depends: gettext Description: Native Language Support (--enable-nls[=LANGUAGES]) -Feature: kerberos -Build-Depends: kerberos -Description: Kerberos Support (--with-gssapi) - Feature: systemd Description: Build with support for systemd service notifications. (--with-systemd) -Feature: ldap -Build-Depends: openldap (linux) -Description: LDAP Support (--with-ldap) - -Feature: bsd -Build-Depends: openbsd -Description: OpenBSD Support (--with-bsd-auth) - -Feature: pam -Build-Depends: pam -Description: Build with PAM (Pluggable Authentication Modules) support. (--with-pam) - Feature: llvm Build-Depends: llvm Description: Build with support for LLVM based JIT compilation (--with-llvm) @@ -80,4 +61,4 @@ Build-Depends: libxslt Description: Build with libxslt (--with-libxslt) Feature: client -Description: Build all client tools and libraries. +Description: Build all client tools and libraries. diff --git a/ports/libpq/patches/windows/MSBuildProject_fix_gendef_perl.patch b/ports/libpq/patches/windows/MSBuildProject_fix_gendef_perl.patch new file mode 100644 index 00000000000000..6c52713a9930fa --- /dev/null +++ b/ports/libpq/patches/windows/MSBuildProject_fix_gendef_perl.patch @@ -0,0 +1,13 @@ +diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm +index 823357c02..b93992f22 100644 +--- a/src/tools/msvc/MSBuildProject.pm ++++ b/src/tools/msvc/MSBuildProject.pm +@@ -381,7 +381,7 @@ EOF + print $f < + Generate DEF file +- perl src\\tools\\msvc\\gendef.pl $cfgname\\$self->{name} $self->{platform} ++ perl "src\\tools\\msvc\\gendef.pl" $cfgname\\$self->{name} $self->{platform} + + EOF + } diff --git a/ports/libpq/patches/windows/Solution_Debug.patch b/ports/libpq/patches/windows/Solution_Debug.patch index 646c0407fcc328..07e57497b6ae79 100644 --- a/ports/libpq/patches/windows/Solution_Debug.patch +++ b/ports/libpq/patches/windows/Solution_Debug.patch @@ -110,7 +110,7 @@ index 51711c2bf..d33fdc3b0 100644 { $proj->AddIncludeDir($self->{options}->{iconv} . '\include'); - $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); -+ $proj->AddLibrary($self->{options}->{iconv} . '\debug\lib\iconv.lib'); # This must be updated ++ $proj->AddLibrary($self->{options}->{iconv} . '\debug\lib\libiconv.lib'); # This must be updated } if ($self->{options}->{icu}) { diff --git a/ports/libpq/patches/windows/Solution_Release.patch b/ports/libpq/patches/windows/Solution_Release.patch index 442beb6c707a6c..e4b653c7aeadba 100644 --- a/ports/libpq/patches/windows/Solution_Release.patch +++ b/ports/libpq/patches/windows/Solution_Release.patch @@ -110,7 +110,7 @@ index 51711c2bf..d33fdc3b0 100644 { $proj->AddIncludeDir($self->{options}->{iconv} . '\include'); - $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); -+ $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); # This must be updated ++ $proj->AddLibrary($self->{options}->{iconv} . '\lib\libiconv.lib'); # This must be updated } if ($self->{options}->{icu}) { diff --git a/ports/libpq/patches/windows/host_skip_openssl.patch b/ports/libpq/patches/windows/host_skip_openssl.patch new file mode 100644 index 00000000000000..e18e178843f9bc --- /dev/null +++ b/ports/libpq/patches/windows/host_skip_openssl.patch @@ -0,0 +1,38 @@ +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 25a549015..9018270ab 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -132,21 +132,21 @@ sub GetOpenSSLVersion + # Attempt to get OpenSSL version and location. This assumes that + # openssl.exe is in the specified directory. + # Quote the .exe name in case it has spaces +- my $opensslcmd = +- qq("openssl.exe" version 2>&1); +- my $sslout = `$opensslcmd`; ++ #my $opensslcmd = ++ # qq("openssl.exe" version 2>&1); ++ #my $sslout = `$opensslcmd`; + +- $? >> 8 == 0 +- or croak +- "Unable to determine OpenSSL version: The openssl.exe command wasn't found."; ++ #$? >> 8 == 0 ++ # or croak ++ # "Unable to determine OpenSSL version: The openssl.exe command wasn't found."; + +- if ($sslout =~ /(\d+)\.(\d+)\.(\d+)(\D)/m) +- { +- return ($1, $2, $3); +- } ++ #if ($sslout =~ /(\d+)\.(\d+)\.(\d+)(\D)/m) ++ #{ ++ return (1, 1, 1); ++ #} + +- croak +- "Unable to determine OpenSSL version: The openssl.exe version could not be determined."; ++ #croak ++ # "Unable to determine OpenSSL version: The openssl.exe version could not be determined."; + } + + sub GenerateFiles diff --git a/ports/libpq/patches/windows/msgfmt.patch b/ports/libpq/patches/windows/msgfmt.patch new file mode 100644 index 00000000000000..352daed870ee9a --- /dev/null +++ b/ports/libpq/patches/windows/msgfmt.patch @@ -0,0 +1,13 @@ +diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm +index 66c0c3483..2154c6cf6 100644 +--- a/src/tools/msvc/Install.pm ++++ b/src/tools/msvc/Install.pm +@@ -728,7 +728,7 @@ sub GenerateNLSFiles + EnsureDirectories($target, "share/libpq/locale/$lang", + "share/libpq/locale/$lang/LC_MESSAGES"); + my @args = ( +- "$nlspath\\bin\\msgfmt", ++ "msgfmt.exe", + '-o', + "$target\\share\\libpq\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo", + $_); diff --git a/ports/libpq/patches/windows/openssl_exe_path.patch b/ports/libpq/patches/windows/openssl_exe_path.patch index cf2930f7f5966a..533f1c4fd7b8af 100644 --- a/ports/libpq/patches/windows/openssl_exe_path.patch +++ b/ports/libpq/patches/windows/openssl_exe_path.patch @@ -2,33 +2,12 @@ diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 51711c2bf..d33fdc3b0 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm -@@ -127,19 +127,19 @@ sub GetOpenSSLVersion - # openssl.exe is in the specified directory. - my $opensslcmd = - $self->{options}->{openssl} . "\\bin\\openssl.exe version 2>&1"; -- my $sslout = `$opensslcmd`; -+ #my $sslout = `$opensslcmd`; - -- $? >> 8 == 0 -- or croak -- "Unable to determine OpenSSL version: The openssl.exe command wasn't found."; -+ #$? >> 8 == 0 -+ # or croak -+ # "Unable to determine OpenSSL version: The openssl.exe command wasn't found."; - -- if ($sslout =~ /(\d+)\.(\d+)\.(\d+)(\D)/m) -- { -- return ($1, $2, $3); -- } -+ #if ($sslout =~ /(\d+)\.(\d+)\.(\d+)(\D)/m) -+ #{ -+ return (1, 1, 1); -+ #} - -- croak -- "Unable to determine OpenSSL version: The openssl.exe version could not be determined."; -+ #croak -+ # "Unable to determine OpenSSL version: The openssl.exe version could not be determined."; - } - - sub GenerateFiles +@@ -133,7 +133,7 @@ sub GetOpenSSLVersion + # openssl.exe is in the specified directory. + # Quote the .exe name in case it has spaces + my $opensslcmd = +- qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1); ++ qq("openssl.exe" version 2>&1); + my $sslout = `$opensslcmd`; + + $? >> 8 == 0 diff --git a/ports/libpq/patches/windows/python3_build_Debug.patch b/ports/libpq/patches/windows/python3_build_Debug.patch new file mode 100644 index 00000000000000..cbc722e0ca2462 --- /dev/null +++ b/ports/libpq/patches/windows/python3_build_Debug.patch @@ -0,0 +1,40 @@ +diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm +index 99f39caa5..21b5559d6 100644 +--- a/src/tools/msvc/Mkvcbuild.pm ++++ b/src/tools/msvc/Mkvcbuild.pm +@@ -494,14 +494,15 @@ sub mkvcbuild + + # Attempt to get python version and location. + # Assume python.exe in specified dir. +- my $pythonprog = "import sys;print(sys.prefix);" +- . "print(str(sys.version_info[0])+str(sys.version_info[1]))"; +- my $prefixcmd = +- $solution->{options}->{python} . "\\python -c \"$pythonprog\""; +- my $pyout = `$prefixcmd`; +- die "Could not query for python version!\n" if $?; +- my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); +- ++ #my $pythonprog = "import sys;print(sys.prefix);" ++ # . "print(str(sys.version_info[0])+str(sys.version_info[1]))"; ++ #my $prefixcmd = ++ # $solution->{options}->{python} . "\\python -c \"$pythonprog\""; ++ #my $pyout = `$prefixcmd`; ++ #die "Could not query for python version!\n" if $?; ++ #my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); ++ my $pyprefix = $solution->{options}->{python}; ++ my $pyver = 37; + # Sometimes (always?) if python is not present, the execution + # appears to work, but gives no data... + die "Failed to query python for version information\n" +@@ -510,8 +511,9 @@ sub mkvcbuild + my $pymajorver = substr($pyver, 0, 1); + my $plpython = $solution->AddProject('plpython' . $pymajorver, + 'dll', 'PLs', 'src/pl/plpython'); +- $plpython->AddIncludeDir($pyprefix . '/include'); +- $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib"); ++ $plpython->AddIncludeDir($pyprefix . '/include/python3.7'); ++ $plpython->AddDefine('_DEBUG'); # required for python autolink linking correctly! ++ $plpython->AddLibrary($pyprefix . "/debug/lib/python$pyver" . "_d.lib"); + $plpython->AddReference($postgres); + + # Add transform modules dependent on plpython diff --git a/ports/libpq/patches/windows/python3_build_Release.patch b/ports/libpq/patches/windows/python3_build_Release.patch new file mode 100644 index 00000000000000..5ac42cfc76f37f --- /dev/null +++ b/ports/libpq/patches/windows/python3_build_Release.patch @@ -0,0 +1,39 @@ +diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm +index 99f39caa5..21b5559d6 100644 +--- a/src/tools/msvc/Mkvcbuild.pm ++++ b/src/tools/msvc/Mkvcbuild.pm +@@ -494,14 +494,15 @@ sub mkvcbuild + + # Attempt to get python version and location. + # Assume python.exe in specified dir. +- my $pythonprog = "import sys;print(sys.prefix);" +- . "print(str(sys.version_info[0])+str(sys.version_info[1]))"; +- my $prefixcmd = +- $solution->{options}->{python} . "\\python -c \"$pythonprog\""; +- my $pyout = `$prefixcmd`; +- die "Could not query for python version!\n" if $?; +- my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); +- ++ #my $pythonprog = "import sys;print(sys.prefix);" ++ # . "print(str(sys.version_info[0])+str(sys.version_info[1]))"; ++ #my $prefixcmd = ++ # $solution->{options}->{python} . "\\python -c \"$pythonprog\""; ++ #my $pyout = `$prefixcmd`; ++ #die "Could not query for python version!\n" if $?; ++ #my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); ++ my $pyprefix = $solution->{options}->{python}; ++ my $pyver = 37; + # Sometimes (always?) if python is not present, the execution + # appears to work, but gives no data... + die "Failed to query python for version information\n" +@@ -510,8 +511,8 @@ sub mkvcbuild + my $pymajorver = substr($pyver, 0, 1); + my $plpython = $solution->AddProject('plpython' . $pymajorver, + 'dll', 'PLs', 'src/pl/plpython'); +- $plpython->AddIncludeDir($pyprefix . '/include'); +- $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib"); ++ $plpython->AddIncludeDir($pyprefix . '/include/python3.7'); ++ $plpython->AddLibrary($pyprefix . "/lib/python$pyver.lib"); + $plpython->AddReference($postgres); + + # Add transform modules dependent on plpython diff --git a/ports/libpq/patches/windows/python_lib.patch b/ports/libpq/patches/windows/python_lib.patch new file mode 100644 index 00000000000000..8b52e26c7c1a2a --- /dev/null +++ b/ports/libpq/patches/windows/python_lib.patch @@ -0,0 +1,17 @@ +diff --git a/src/pl/plpython/plpython.h b/src/pl/plpython/plpython.h +index 3a1f0d56d..6a8a09a20 100644 +--- a/src/pl/plpython/plpython.h ++++ b/src/pl/plpython/plpython.h +@@ -46,12 +46,10 @@ + #if defined(_MSC_VER) && defined(_DEBUG) + /* Python uses #pragma to bring in a non-default libpython on VC++ if + * _DEBUG is defined */ +-#undef _DEBUG + /* Also hide away errcode, since we load Python.h before postgres.h */ + #define errcode __msvc_errcode + #include + #undef errcode +-#define _DEBUG + #elif defined (_MSC_VER) + #define errcode __msvc_errcode + #include diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 39707c185f8fa5..3d147104e2d3f1 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -1,3 +1,5 @@ +set(PORT_VERSION 12.2) + macro(feature_unsupported) foreach(_feat ${ARGN}) if("${FEATURES}" MATCHES "${_feat}") @@ -16,20 +18,20 @@ endmacro() if(VCPKG_TARGET_IS_WINDOWS) # on windows libpq seems to only depend on openssl gss(kerberos) and ldap on the soruce site_name - # the configuration header depends on zlib, nls, ldap, uuid, xml, xlst,gss,openssl,icu - feature_unsupported(readline bonjour libedit kerberos bsd systemd llvm pam) - feature_not_implemented_yet(perl python tcl uuid) + # the configuration header depends on zlib, nls, uuid, xml, xlst,gss,openssl,icu + feature_unsupported(readline bonjour libedit systemd llvm) + feature_not_implemented_yet(uuid) elseif(VCPKG_TARGET_IS_OSX) - feature_not_implemented_yet(readline libedit kerberos bsd systemd llvm pam perl python tcl uuid) + feature_not_implemented_yet(readline libedit systemd llvm python tcl uuid) else() - feature_not_implemented_yet(readline bonjour libedit kerberos bsd systemd llvm pam perl python tcl uuid) + feature_not_implemented_yet(readline bonjour libedit systemd llvm python tcl uuid) endif() ## Download and extract sources vcpkg_download_distfile(ARCHIVE - URLS "https://ftp.postgresql.org/pub/source/v12.0/postgresql-12.0.tar.bz2" - FILENAME "postgresql-12.0.tar.bz2" - SHA512 231a0b5c181c33cb01c3f39de1802319b79eceec6997935ab8605dea1f4583a52d0d16e5a70fcdeea313462f062503361d543433ee03d858ba332c72a665f696 + URLS "https://ftp.postgresql.org/pub/source/v${PORT_VERSION}/postgresql-${PORT_VERSION}.tar.bz2" + FILENAME "postgresql-${PORT_VERSION}.tar.bz2" + SHA512 0e0ce8e21856e8f43e58b840c10c4e3ffae6d5207e0d778e9176e36f8e20e34633cbb06f0030a7c963c3491bb7e941456d91b55444c561cfc6f283fba76f33ee ) set(PATCHES @@ -37,6 +39,9 @@ set(PATCHES patches/windows/win_bison_flex.patch patches/windows/openssl_exe_path.patch patches/windows/Solution.patch + patches/windows/MSBuildProject_fix_gendef_perl.patch + patches/windows/msgfmt.patch + patches/windows/python_lib.patch patches/linux/configure.patch) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -48,6 +53,7 @@ if(VCPKG_CRT_LINKAGE STREQUAL static) endif() if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") list(APPEND PATCHES patches/windows/arm.patch) + list(APPEND PATCHES patches/windows/host_skip_openssl.patch) # Skip openssl.exe version check since it cannot be executed by the host endif() if(NOT "${FEATURES}" MATCHES "client") list(APPEND PATCHES patches/windows/minimize_install.patch) @@ -61,22 +67,26 @@ 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) vcpkg_add_to_path(PREPEND "${${program_name}_EXE_PATH}") - set(buildenv_contents "${buildenv_contents}\n\$ENV{PATH}=\$ENV{PATH} . ';${${program_name}_EXE_PATH}';") + set(buildenv_contents "${buildenv_contents}\n\$ENV{'PATH'}=\$ENV{'PATH'} . ';${${program_name}_EXE_PATH}';") endforeach() ## Setup build types - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE MATCHES "[Rr][Ee][Ll][Ee][Aa][Ss][Ee]") set(_buildtype RELEASE) set(_short rel) list(APPEND port_config_list ${_buildtype}) set(INSTALL_PATH_SUFFIX_${_buildtype} "") set(BUILDPATH_${_buildtype} "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${_short}") + file(REMOVE_RECURSE "${BUILDPATH_${_buildtype}}") #Clean old builds set(PACKAGE_DIR_${_buildtype} ${CURRENT_PACKAGES_DIR}) unset(_short) unset(_buildtype) @@ -87,6 +97,7 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg list(APPEND port_config_list ${_buildtype}) set(INSTALL_PATH_SUFFIX_${_buildtype} "/debug") set(BUILDPATH_${_buildtype} "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${_short}") + file(REMOVE_RECURSE "${BUILDPATH_${_buildtype}}") #Clean old builds set(PACKAGE_DIR_${_buildtype} ${CURRENT_PACKAGES_DIR}${INSTALL_PATH_SUFFIX_${_buildtype}}) unset(_short) unset(_buildtype) @@ -104,52 +115,66 @@ if(VCPKG_TARGET_IS_WINDOWS) file(COPY ${SOURCE_FILE} DESTINATION "${BUILDPATH_${_buildtype}}") endforeach() message(STATUS "Copying libpq source files... done") - + vcpkg_apply_patches( SOURCE_PATH "${BUILDPATH_${_buildtype}}" PATCHES patches/windows/Solution_${_buildtype}.patch + patches/windows/python3_build_${_buildtype}.patch ) message(STATUS "Patches applied!") file(COPY "${CURRENT_PORT_DIR}/config.pl" DESTINATION "${BUILDPATH_${_buildtype}}/src/tools/msvc") + + set(MSPROJ_PERL "${BUILDPATH_${_buildtype}}/src/tools/msvc/MSBuildProject.pm") + file(READ "${MSPROJ_PERL}" _contents) + string(REPLACE "perl" "\"${PERL}\"" _contents "${_contents}") + file(WRITE "${MSPROJ_PERL}" "${_contents}") + set(CONFIG_FILE "${BUILDPATH_${_buildtype}}/src/tools/msvc/config.pl") file(READ "${CONFIG_FILE}" _contents) - - ## ldap => undef, # --with-ldap ##done + + ## ldap => undef, # --with-ldap ## extraver => undef, # --with-extra-version= ## gss => undef, # --with-gssapi= ## icu => undef, # --with-icu= ##done ## nls => undef, # --enable-nls= ##done ## tap_tests => undef, # --enable-tap-tests - ## tcl => undef, # --with-tcl= + ## tcl => undef, # --with-tcl= #done ## perl => undef, # --with-perl - ## python => undef, # --with-python= + ## python => undef, # --with-python= ##done ## openssl => undef, # --with-openssl= ##done ## uuid => undef, # --with-ossp-uuid ## xml => undef, # --with-libxml= ##done ## xslt => undef, # --with-libxslt= ##done ## iconv => undef, # (not in configure, path to iconv) ##done (needed by xml) ## zlib => undef # --with-zlib= ##done - + ## Setup external dependencies - ##"-DFEATURES=core;openssl;zlib" "-DALL_FEATURES=openssl;zlib;readline;libedit;perl;python;tcl;nls;kerberos;systemd;ldap;bsd;pam;llvm;icu;bonjour;uuid;xml;xslt;" - if("${FEATURES}" MATCHES "ldap") - string(REPLACE "ldap => undef" "ldap => 1" _contents "${_contents}") - endif() + ##"-DFEATURES=core;openssl;zlib" "-DALL_FEATURES=openssl;zlib;readline;libedit;python;tcl;nls;systemd;llvm;icu;bonjour;uuid;xml;xslt;" if("${FEATURES}" MATCHES "icu") - string(REPLACE "icu => undef" "icu => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + string(REPLACE "icu => undef" "icu => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() if("${FEATURES}" MATCHES "nls") - string(REPLACE "nls => undef" "nls => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + string(REPLACE "nls => undef" "nls => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + vcpkg_acquire_msys(MSYS_ROOT PACKAGES gettext) + vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") endif() if("${FEATURES}" MATCHES "openssl") - set(buildenv_contents "${buildenv_contents}\n\$ENV{PATH}=\$ENV{PATH} . ';${CURRENT_INSTALLED_DIR}/tools/openssl';") + set(buildenv_contents "${buildenv_contents}\n\$ENV{'PATH'}=\$ENV{'PATH'} . ';${CURRENT_INSTALLED_DIR}/tools/openssl';") #set(_contents "${_contents}\n\$ENV{PATH}=\$ENV{PATH} . ';${CURRENT_INSTALLED_DIR}/tools/openssl';") string(REPLACE "openssl => undef" "openssl => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() - + if("${FEATURES}" MATCHES "python") + #vcpkg_find_acquire_program(PYTHON3) + #get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) + #vcpkg_add_to_path("${PYTHON3_EXE_PATH}") + string(REPLACE "python => undef" "python => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + endif() + if("${FEATURES}" MATCHES "tcl") + string(REPLACE "tcl => undef" "tcl => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + endif() if("${FEATURES}" MATCHES "xml") - string(REPLACE "xml => undef" "xml => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") - string(REPLACE "iconv => undef" "iconv => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + string(REPLACE "xml => undef" "xml => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + string(REPLACE "iconv => undef" "iconv => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() if("${FEATURES}" MATCHES "xslt") @@ -159,7 +184,7 @@ if(VCPKG_TARGET_IS_WINDOWS) if("${FEATURES}" MATCHES "zlib") string(REPLACE "zlib => undef" "zlib => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() - + file(WRITE "${CONFIG_FILE}" "${_contents}") file(WRITE "${BUILDPATH_${_buildtype}}/src/tools/msvc/buildenv.pl" "${buildenv_contents}") vcpkg_get_windows_sdk(VCPKG_TARGET_PLATFORM_VERSION) @@ -169,7 +194,8 @@ if(VCPKG_TARGET_IS_WINDOWS) /p:WindowsTargetPlatformVersion=${VCPKG_TARGET_PLATFORM_VERSION} /m /p:ForceImportBeforeCppTargets=\"${SCRIPTS}/buildsystems/msbuild/vcpkg.targets\" - /p:VcpkgTriplet=${TARGET_TRIPLET}" + /p:VcpkgTriplet=${TARGET_TRIPLET} + /p:VcpkgCurrentInstalledDir=\"${CURRENT_INSTALLED_DIR}\"" ) if(HAS_TOOLS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) @@ -217,14 +243,13 @@ if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() - + if(NOT HAS_TOOLS) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) else() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() - #file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/) - #vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done") else() if("${FEATURES}" MATCHES "openssl") @@ -238,21 +263,19 @@ else() endif() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} + COPY_SOURCE OPTIONS ${BUILD_OPTS} --with-includes=${CURRENT_INSTALLED_DIR}/include OPTIONS_RELEASE - --exec-prefix=${CURRENT_PACKAGES_DIR}/tools/${PORT} - --datarootdir=${CURRENT_PACKAGES_DIR}/share/${PORT} --with-libraries=${CURRENT_INSTALLED_DIR}/lib OPTIONS_DEBUG - --exec-prefix=${CURRENT_PACKAGES_DIR}/debug/tools/${PORT} - --datarootdir=${CURRENT_PACKAGES_DIR}/debug/share/${PORT} --with-libraries=${CURRENT_INSTALLED_DIR}/debug/lib --enable-debug ) vcpkg_install_make() + # instead? # make -C src/include install # make -C src/interfaces install @@ -269,7 +292,7 @@ endif() #vcpkg_copy_pdbs() #if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.lib") - #RENAME debug library due to CMake. In general that is a bad idea but it will have consquences for the generated cmake targets + #RENAME debug library due to CMake. In general that is a bad idea but it will have consquences for the generated cmake targets # of other ports if not renamed. Maybe a vcpkg_cmake_wrapper is required here to correct the target information if the rename is removed? # file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libpqd.lib") #endif() diff --git a/ports/libpq/vcpkg-cmake-wrapper.cmake b/ports/libpq/vcpkg-cmake-wrapper.cmake index 4ce0f857983341..5fd40d26ca8065 100644 --- a/ports/libpq/vcpkg-cmake-wrapper.cmake +++ b/ports/libpq/vcpkg-cmake-wrapper.cmake @@ -5,4 +5,13 @@ PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH ) -_find_package(${ARGS}) \ No newline at end of file +_find_package(${ARGS}) +if(PostgreSQL_FOUND) + find_library(PostgreSQL_DL_LIBRARY NAMES dl) + if(PostgreSQL_DL_LIBRARY) + list(APPEND PostgreSQL_LIBRARIES "dl") + if(TARGET PostgreSQL::PostgreSQL) + set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl") + endif() + endif() +endif() diff --git a/ports/libpqxx/CMakeLists.txt b/ports/libpqxx/CMakeLists.txt index a3e6ae3f484790..00575c4afaeb1c 100644 --- a/ports/libpqxx/CMakeLists.txt +++ b/ports/libpqxx/CMakeLists.txt @@ -34,7 +34,9 @@ file(GLOB SRCS "${PROJECT_SOURCE_DIR}/src/*.cxx") if(BUILD_SHARED_LIBS) set(TARGET libpqxx) set(SHARED_DEFINITION -DPQXX_SHARED) - list(APPEND SRCS "${PROJECT_SOURCE_DIR}/win32/libpqxx.cxx") + if(MSVC) + list(APPEND SRCS "${PROJECT_SOURCE_DIR}/win32/libpqxx.cxx") + endif() else() set(TARGET libpqxx_static) set(SHARED_DEFINITION "") diff --git a/ports/libpqxx/CONTROL b/ports/libpqxx/CONTROL index 9acdf81465528c..f118a488b8b390 100644 --- a/ports/libpqxx/CONTROL +++ b/ports/libpqxx/CONTROL @@ -1,5 +1,5 @@ Source: libpqxx -Version: 6.4.5-2 +Version: 6.4.5-3 Homepage: https://github.com/jtv/libpqxx Description: The official C++ client API for PostgreSQL Build-Depends: libpq[core] 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/libqcow/CMakeLists.txt b/ports/libqcow/CMakeLists.txt new file mode 100644 index 00000000000000..ac199f48fe9ccf --- /dev/null +++ b/ports/libqcow/CMakeLists.txt @@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.12) + +project(libqcow C) + +find_package(OpenSSL) +find_package(ZLIB REQUIRED) + +if(MSVC) + add_compile_definitions(_CRT_SECURE_NO_DEPRECATE) + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) +endif() + +add_compile_definitions(HAVE_LOCAL_LIBCAES) +add_compile_definitions(HAVE_LOCAL_LIBCERROR) +add_compile_definitions(HAVE_LOCAL_LIBCTHREADS) +add_compile_definitions(HAVE_LOCAL_LIBCDATA) +add_compile_definitions(HAVE_LOCAL_LIBCLOCALE) +add_compile_definitions(HAVE_LOCAL_LIBCNOTIFY) +add_compile_definitions(HAVE_LOCAL_LIBCSPLIT) +add_compile_definitions(HAVE_LOCAL_LIBCFILE) +add_compile_definitions(HAVE_LOCAL_LIBCPATH) +add_compile_definitions(HAVE_LOCAL_LIBUNA) +add_compile_definitions(HAVE_LOCAL_LIBBFIO) +add_compile_definitions(HAVE_LOCAL_LIBFCACHE) +add_compile_definitions(HAVE_LOCAL_LIBFDATA) +add_compile_definitions(ZLIB_DLL) + +if(UNIX) + configure_file(common/config.h.in common/config.h) + add_compile_definitions(HAVE_CONFIG_H) + add_compile_definitions(LOCALEDIR="/usr/share/locale") +endif() + +if(MSVC) + add_compile_definitions(LIBQCOW_DLL_EXPORT) + set(LIB_RC libqcow/libqcow.rc) +endif() + + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +# Add CMake find_package() integration +set(PROJECT_TARGET_NAME "${PROJECT_NAME}") +set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +set(PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_TARGET_NAME}Config.cmake") +set(TARGETS_EXPORT_NAME "${PROJECT_TARGET_NAME}Targets") +set(NAMESPACE "libqcow::") + +# Source files +file(GLOB LIB_SRC lib*/*.c) + +# Headers +file(GLOB LIB_INST_HEADERS include/libqcow/*.h) + +add_library(${PROJECT_NAME} ${LIB_SRC} ${LIB_RC}) + +target_include_directories(${PROJECT_NAME} PRIVATE ./include ./common) +target_include_directories(${PROJECT_NAME} PRIVATE ./libbfio ./libcaes ./libcdata ./libcerror ./libcfile ./libclocale) +target_include_directories(${PROJECT_NAME} PRIVATE ./libcnotify ./libcpath ./libcsplit ./libcthreads) +target_include_directories(${PROJECT_NAME} PRIVATE ./libfcache ./libfdata ./libuna) + +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB OpenSSL::Crypto) + +install(TARGETS ${PROJECT_NAME} + EXPORT ${TARGETS_EXPORT_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include) + +install(FILES ${LIB_INST_HEADERS} DESTINATION include/libqcow) +install(FILES include/libqcow.h DESTINATION include) + + +# Generate and install libqcowConfig.cmake +configure_package_config_file("Config.cmake.in" "${PROJECT_CONFIG}" INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}") +install(FILES "${PROJECT_CONFIG}" DESTINATION "${CONFIG_INSTALL_DIR}") + +# Generate and install libqcowTargets*.cmake +install(EXPORT ${TARGETS_EXPORT_NAME} + NAMESPACE ${NAMESPACE} + DESTINATION "${CONFIG_INSTALL_DIR}") diff --git a/ports/libqcow/CONTROL b/ports/libqcow/CONTROL new file mode 100644 index 00000000000000..2cc7dad91315de --- /dev/null +++ b/ports/libqcow/CONTROL @@ -0,0 +1,6 @@ +Source: libqcow +Version: 20191221-1 +Homepage: https://github.com/libyal/libqcow +Build-Depends: gettext,openssl,zlib +Description: Library and tools to access the QEMU Copy-On-Write (QCOW) image format. +Supports: !uwp diff --git a/ports/libqcow/Config.cmake.in b/ports/libqcow/Config.cmake.in new file mode 100644 index 00000000000000..bd6bd4532b6282 --- /dev/null +++ b/ports/libqcow/Config.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/ports/libqcow/macos_fixes.patch b/ports/libqcow/macos_fixes.patch new file mode 100644 index 00000000000000..0bff952af1d4a9 --- /dev/null +++ b/ports/libqcow/macos_fixes.patch @@ -0,0 +1,38 @@ +diff --git a/libcfile/libcfile_file.c b/libcfile/libcfile_file.c +index 13eab02..690cc04 100644 +--- a/libcfile/libcfile_file.c ++++ b/libcfile/libcfile_file.c +@@ -56,7 +56,7 @@ + #elif defined( HAVE_CYGWIN_FS_H ) + #include + +-#elif defined( HAVE_LINUX_FS_H ) ++#elif defined( __linux__ ) && defined( HAVE_LINUX_FS_H ) + /* Required for Linux platforms that use a sizeof( u64 ) + * in linux/fs.h but have no typedef of it + */ +@@ -4603,6 +4603,11 @@ ssize_t libcfile_file_io_control_read_with_error_code( + #error Missing file IO control with data function + #endif + ++// Force disable on Darwin, it can be erroneously defined ++#if defined ( __APPLE__ ) ++#undef HAVE_POSIX_FADVISE ++#endif ++ + /* On some versions of Linux the FADVISE definions seem to be missing from fcntl.h + */ + #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) +diff --git a/libqcow/libqcow_i18n.c b/libqcow/libqcow_i18n.c +index f8a3164..d09ec79 100644 +--- a/libqcow/libqcow_i18n.c ++++ b/libqcow/libqcow_i18n.c +@@ -40,7 +40,7 @@ int libqcow_i18n_initialize( + + if( libqcow_i18n_initialized == 0 ) + { +-#if defined( HAVE_BINDTEXTDOMAIN ) ++#if !defined( __APPLE__ ) && defined( HAVE_BINDTEXTDOMAIN ) + if( bindtextdomain( + "libqcow", + LOCALEDIR ) == NULL ) diff --git a/ports/libqcow/portfile.cmake b/ports/libqcow/portfile.cmake new file mode 100644 index 00000000000000..0b80fec047e98d --- /dev/null +++ b/ports/libqcow/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +set(LIB_VERSION 20191221) +set(LIB_FILENAME libqcow-alpha-${LIB_VERSION}.tar.gz) + +# Release distribution file contains configured sources, while the source code in the repository does not. +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libyal/libqcow/releases/download/${LIB_VERSION}/${LIB_FILENAME}" + FILENAME "${LIB_FILENAME}" + SHA512 de0c5cfad84bbccc9a4144b108c7e022a98d130e829385e69ff00a8750709c9de814410eebfa1c0fc89051cf8f596d87b9bbc8228d99efd8be1c3efdc2b52730 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${LIB_VERSION} + PATCHES macos_fixes.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" DESTINATION "${SOURCE_PATH}") + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA +) +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libqcow" TARGET_PATH "share/libqcow") + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# License and man +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libqglviewer/CONTROL b/ports/libqglviewer/CONTROL index aca80eac2fc28c..b5adc19131c69d 100644 --- a/ports/libqglviewer/CONTROL +++ b/ports/libqglviewer/CONTROL @@ -1,4 +1,4 @@ Source: libqglviewer -Version: 2.7.2-2 +Version: 2.7.2-3 Description: libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers. -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/librabbitmq/CONTROL b/ports/librabbitmq/CONTROL index fc4e37c6dcc2cb..ae06b8b2be3b1f 100644 --- a/ports/librabbitmq/CONTROL +++ b/ports/librabbitmq/CONTROL @@ -1,5 +1,5 @@ Source: librabbitmq -Version: 0.10.0 +Version: 2020-06-03 Build-Depends: openssl Homepage: https://github.com/alanxz/rabbitmq-c Description: A C-language AMQP client library for use with v2.0+ of the RabbitMQ broker. diff --git a/ports/librabbitmq/portfile.cmake b/ports/librabbitmq/portfile.cmake index 886f0f9a567a7f..7957cfbfd7b0f5 100644 --- a/ports/librabbitmq/portfile.cmake +++ b/ports/librabbitmq/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO alanxz/rabbitmq-c - REF ffe918a5fcef72038a88054dca3c56762b1953d4 # v0.10.0 - SHA512 05756176feffc3ccff9bf4f8416191c382c9e5b51d7dd72664cea0407c847d50cb4048b8669415d879396c0c7e8c1c38c65a66a98701e55de09afed893abc5a0 + REF d416b8b16d196085106cfe137a0ff6919a9f6752 + SHA512 3fc137893fc18509a3e583cc8d40a8e91f219063237b9fd018a65cf14da188914ddba3a031c4bc033a886fed19fc6291d1b28b55458b9163eb6d20425b0474dc HEAD_REF master PATCHES fix-uwpwarning.patch @@ -24,7 +22,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/rabbitmq-c TARGET_PATH share/rabbitmq-c) + vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) -file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/librabbitmq RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/librsvg/CMakeLists.txt b/ports/librsvg/CMakeLists.txt index 749d3132bbdb80..b3b3ca892e4763 100644 --- a/ports/librsvg/CMakeLists.txt +++ b/ports/librsvg/CMakeLists.txt @@ -5,11 +5,19 @@ find_package(unofficial-cairo CONFIG REQUIRED) find_package(unofficial-libcroco CONFIG REQUIRED) find_package(unofficial-glib CONFIG REQUIRED) find_package(LibXml2 REQUIRED) -find_library(PANGO_LIB pango-1.0) -find_library(PANGO_CAIRO_LIB pangocairo-1.0) if(CMAKE_SYSTEM_NAME MATCHES "Windows") + find_library(PANGO_LIB pango-1.0) + find_library(PANGO_CAIRO_LIB pangocairo-1.0) find_library(GDK_PIXBUF_LIB gdk_pixbuf-2.0) +elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") + find_library(PANGO_LIB pango-1.0) + find_library(PANGO_CAIRO_LIB pangocairo-1.0) + find_library(GDK_PIXBUF_LIB gdk_pixbuf-2) else() + find_library(PANGO_LIB pango-1) + find_library(PANGO_CAIRO_LIB pangocairo-1) + find_library(PANGO_FT2_LIB pangoft2-1) + find_library(FONTCONFIG_LIB fontconfig) find_library(GDK_PIXBUF_LIB gdk_pixbuf-2) endif() @@ -112,6 +120,8 @@ target_link_libraries(rsvg-2.40 PRIVATE ${PANGO_LIB} ${PANGO_CAIRO_LIB} ${GDK_PIXBUF_LIB} + ${PANGO_FT2_LIB} + ${FONTCONFIG_LIB} ) target_link_libraries(pixbufloader-svg PRIVATE rsvg-2.40 diff --git a/ports/librsvg/CONTROL b/ports/librsvg/CONTROL index 3a250b8d4cf256..380186c6eccec0 100644 --- a/ports/librsvg/CONTROL +++ b/ports/librsvg/CONTROL @@ -1,4 +1,5 @@ Source: librsvg -Version: 2.40.20 +Version: 2.40.20-2 +Homepage: https://gitlab.gnome.org/GNOME/librsvg Description: A small library to render Scalable Vector Graphics (SVG) Build-Depends: cairo, pango, gdk-pixbuf, libcroco \ No newline at end of file diff --git a/ports/librsvg/portfile.cmake b/ports/librsvg/portfile.cmake index c3765f0a3d4394..4c7633066b6c8e 100644 --- a/ports/librsvg/portfile.cmake +++ b/ports/librsvg/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://download.gnome.org/sources/librsvg/2.40/librsvg-2.40.20.tar.xz" FILENAME "librsvg-2.40.20.tar.xz" @@ -8,7 +6,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE ${ARCHIVE} ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -21,12 +19,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-librsvg TARGET_PATH share/unofficial-librsvg) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/librsvg RENAME copyright) - -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -vcpkg_test_cmake(PACKAGE_NAME unofficial-librsvg) +#vcpkg_test_cmake(PACKAGE_NAME unofficial-librsvg) diff --git a/ports/libsndfile/CONTROL b/ports/libsndfile/CONTROL index 2547637a8c4c6d..913af809d22801 100644 --- a/ports/libsndfile/CONTROL +++ b/ports/libsndfile/CONTROL @@ -1,5 +1,6 @@ Source: libsndfile -Version: 1.0.29-8 +Version: 1.0.29 +Port-Version: 10 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 diff --git a/ports/libsquish/CONTROL b/ports/libsquish/CONTROL index 91b89650b1bbd7..2e3500478e4472 100644 --- a/ports/libsquish/CONTROL +++ b/ports/libsquish/CONTROL @@ -1,4 +1,4 @@ Source: libsquish -Version: 1.15-2 +Version: 1.15-7 Homepage: https://sourceforge.net/projects/libsquish Description: Open source DXT compression library. diff --git a/ports/libsquish/fix-export-symbols.patch b/ports/libsquish/fix-export-symbols.patch index febf2eb51425e4..a777eea234cda9 100644 --- a/ports/libsquish/fix-export-symbols.patch +++ b/ports/libsquish/fix-export-symbols.patch @@ -44,6 +44,13 @@ index 14c9bb5..aaffbb2 100644 + //! All squish API functions live in this namespace. namespace squish { + +@@ -115,5 +117,5 @@ + */ +-void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 ); ++SQUISH_EXPORT void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 ); + + // ----------------------------------------------------------------------------- @@ -176,7 +178,7 @@ inline void Compress( u8 const* rgba, void* block, int flags, float* metric = 0 however, DXT1 will be used by default if none is specified. All other flags diff --git a/ports/libsquish/portfile.cmake b/ports/libsquish/portfile.cmake index 600e89d59091bb..a7ff15594387b6 100644 --- a/ports/libsquish/portfile.cmake +++ b/ports/libsquish/portfile.cmake @@ -1,18 +1,10 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/libsquish/libsquish-1.15.tgz" - FILENAME "libsquish-1.15.tgz" - SHA512 5b569b7023874c7a43063107e2e428ea19e6eb00de045a4a13fafe852ed5402093db4b65d540b5971ec2be0d21cb97dfad9161ebfe6cf6e5376174ff6c6c3e7a -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO libsquish + FILENAME "libsquish-1.15.tgz" NO_REMOVE_ONE_LEVEL - REF v1.15 - PATCHES - fix-export-symbols.patch + SHA512 5b569b7023874c7a43063107e2e428ea19e6eb00de045a4a13fafe852ed5402093db4b65d540b5971ec2be0d21cb97dfad9161ebfe6cf6e5376174ff6c6c3e7a + PATCHES fix-export-symbols.patch ) vcpkg_configure_cmake( diff --git a/ports/libssh/CONTROL b/ports/libssh/CONTROL index ada47ad871ef63..fa65eac6dbe788 100644 --- a/ports/libssh/CONTROL +++ b/ports/libssh/CONTROL @@ -1,5 +1,5 @@ Source: libssh -Version: 0.9.3-1 +Version: 0.9.3-2 Homepage: https://www.libssh.org/ Description: libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side Default-Features: crypto diff --git a/ports/libsvm/CONTROL b/ports/libsvm/CONTROL index 342536cce33bb9..4a9af6018f4673 100644 --- a/ports/libsvm/CONTROL +++ b/ports/libsvm/CONTROL @@ -1,5 +1,5 @@ Source: libsvm -Version: 323 +Version: 323-1 Description: A library for Support Vector Machines Homepage: https://www.csie.ntu.edu.tw/~cjlin/libsvm/ diff --git a/ports/libsvm/portfile.cmake b/ports/libsvm/portfile.cmake index f4f7c69603c7f4..e473fd3c356f13 100644 --- a/ports/libsvm/portfile.cmake +++ b/ports/libsvm/portfile.cmake @@ -30,29 +30,8 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) -# Install tools if ("tools" IN_LIST FEATURES) - if(VCPKG_TARGET_IS_WINDOWS) - set(EXECUTABLE_SUFFIX ".exe") - else() - set(EXECUTABLE_SUFFIX "") - endif() - - foreach (libsvm_tool svm-predict svm-scale svm-toy svm-train) - if (EXISTS ${CURRENT_PACKAGES_DIR}/bin/${libsvm_tool}${EXECUTABLE_SUFFIX}) - file( - COPY ${CURRENT_PACKAGES_DIR}/bin/${libsvm_tool}${EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT} - ) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/${libsvm_tool}${EXECUTABLE_SUFFIX}) - endif () - - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - endforeach () - - if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - endif () + vcpkg_copy_tools(TOOL_NAMES svm-predict svm-scale svm-toy svm-train AUTO_CLEAN) endif () file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/libtomcrypt/CONTROL b/ports/libtomcrypt/CONTROL new file mode 100644 index 00000000000000..c5f79aa3281385 --- /dev/null +++ b/ports/libtomcrypt/CONTROL @@ -0,0 +1,5 @@ +Source: libtomcrypt +Version: 1.18.2-1 +Description: LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. +Homepage: https://www.libtom.net/LibTomCrypt/ +Build-Depends: libtommath \ No newline at end of file diff --git a/ports/libtomcrypt/portfile.cmake b/ports/libtomcrypt/portfile.cmake new file mode 100644 index 00000000000000..e547d837595a6e --- /dev/null +++ b/ports/libtomcrypt/portfile.cmake @@ -0,0 +1,95 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO libtom/libtomcrypt + REF v1.18.2 + SHA512 53accb4f92077ff1c52102bece270e77c497e599c392aa0bf4dbc173b6789e7e4f1012d8b5f257c438764197cb7bac8ba409a9d4e3a70e69bec5863b9495329e + HEAD_REF develop +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + + if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + set(CRTFLAG "/MD") + else() + set(CRTFLAG "/MT") + endif() + + # Make sure we start from a clean slate + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc clean + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME clean-${TARGET_TRIPLET}-dbg + ) + + #Debug Build + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc "CFLAGS=${CRTFLAG}d /DUSE_LTM /DLTM_DESC \"/I${CURRENT_INSTALLED_DIR}/include\"" + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + + file(INSTALL + ${SOURCE_PATH}/tomcrypt.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + + # Clean up necessary to rebuild without debug symbols + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc clean + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME clean-${TARGET_TRIPLET}-rel + ) + + #Release Build + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc "CFLAGS=${CRTFLAG} /Ox /DNDEBUG /DUSE_LTM /DLTM_DESC \"/I${CURRENT_INSTALLED_DIR}/include\"" + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + + file(INSTALL + ${SOURCE_PATH}/tomcrypt.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + + file(INSTALL + ${SOURCE_PATH}/src/headers/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) +else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(MAKE_FILE "makefile.shared") + else() + set(MAKE_FILE "makefile") + endif() + + set(ENV{CFLAGS} "-fPIC -DUSE_LTM -DLTM_DESC -I${CURRENT_INSTALLED_DIR}/include") + + vcpkg_execute_build_process( + COMMAND make -f ${MAKE_FILE} clean + WORKING_DIRECTORY ${SOURCE_PATH} + ) + vcpkg_execute_build_process( + COMMAND make -j${VCPKG_CONCURRENCY} -f ${MAKE_FILE} PREFIX=${CURRENT_PACKAGES_DIR}/debug LTC_DEBUG=1 install + WORKING_DIRECTORY ${SOURCE_PATH} + ) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + + vcpkg_execute_build_process( + COMMAND make -f ${MAKE_FILE} clean + WORKING_DIRECTORY ${SOURCE_PATH} + ) + vcpkg_execute_build_process( + COMMAND make -j${VCPKG_CONCURRENCY} -f ${MAKE_FILE} PREFIX=${CURRENT_PACKAGES_DIR} install + WORKING_DIRECTORY ${SOURCE_PATH} + ) + +endif() + +#Copy license +file( + INSTALL + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright +) \ No newline at end of file diff --git a/ports/libtommath/CONTROL b/ports/libtommath/CONTROL new file mode 100644 index 00000000000000..dd6359bed5b18a --- /dev/null +++ b/ports/libtommath/CONTROL @@ -0,0 +1,4 @@ +Source: libtommath +Version: 1.2.0-1 +Description: LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C. +Homepage: https://www.libtom.net/LibTomMath/ diff --git a/ports/libtommath/portfile.cmake b/ports/libtommath/portfile.cmake new file mode 100644 index 00000000000000..746ead44943f1a --- /dev/null +++ b/ports/libtommath/portfile.cmake @@ -0,0 +1,91 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO libtom/libtommath + REF v1.2.0 + SHA512 500bce4467d6cdb0b014e6c66d3b994a8d63b51475db6c3cd77c15c8368fbab4e3b5c458fcd5b35838b74c457a33c15b42d2356964f5ef2a0bd31fd544735c9a + HEAD_REF develop +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + + if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + set(CRTFLAG "/MD") + else() + set(CRTFLAG "/MT") + endif() + + # Make sure we start from a clean slate + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc clean + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME clean-${TARGET_TRIPLET}-dbg + ) + + #Debug Build + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc CFLAGS="${CRTFLAG}d" + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + + file(INSTALL + ${SOURCE_PATH}/tommath.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + + # Clean up necessary to rebuild without debug symbols + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc clean + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME clean-${TARGET_TRIPLET}-rel + ) + + vcpkg_execute_build_process( + COMMAND nmake -f ${SOURCE_PATH}/makefile.msvc CFLAGS="${CRTFLAG}" + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + + file(INSTALL + ${SOURCE_PATH}/tommath.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + + file(INSTALL + ${SOURCE_PATH}/tommath.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) +else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(MAKE_FILE "makefile.shared") + else() + set(MAKE_FILE "makefile") + endif() + + vcpkg_execute_build_process( + COMMAND make -f ${MAKE_FILE} clean + WORKING_DIRECTORY ${SOURCE_PATH} + ) + + vcpkg_execute_build_process( + COMMAND make -j${VCPKG_CONCURRENCY} -f ${MAKE_FILE} PREFIX=${CURRENT_PACKAGES_DIR}/debug COMPILE_DEBUG=1 install + WORKING_DIRECTORY ${SOURCE_PATH} + ) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + + vcpkg_execute_build_process( + COMMAND make -f ${MAKE_FILE} clean + WORKING_DIRECTORY ${SOURCE_PATH} + ) + + vcpkg_execute_build_process( + COMMAND make -j${VCPKG_CONCURRENCY} -f ${MAKE_FILE} PREFIX=${CURRENT_PACKAGES_DIR} install + WORKING_DIRECTORY ${SOURCE_PATH} + ) +endif() + +file(INSTALL + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright +) \ No newline at end of file diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index 08964ba96bc2ce..48505d85a58978 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,5 +1,27 @@ Source: libtorrent -Version: 1.2.2-1 +Version: 1.2.8 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 +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&!(windows&arm) + +Feature: deprfun +Description: build with deprecated functions enabled + +Feature: examples +Description: build the examples in the examples directory + +Feature: iconv +Build-Depends: libiconv (windows) +Description: build with libiconv on Windows + +Feature: python +Build-Depends: boost-python, libtorrent[deprfun] +Description: build the python bindings in bindings/python directory + +Feature: test +Build-Depends: libtorrent[deprfun] +Description: build the libtorrent tests + +Feature: tools +Description: build the tools in the tools directory diff --git a/ports/libtorrent/add-datetime-to-boost-libs.patch b/ports/libtorrent/add-datetime-to-boost-libs.patch index 1ec65a8f5f92ff..1ef09021a8d6d0 100644 --- a/ports/libtorrent/add-datetime-to-boost-libs.patch +++ b/ports/libtorrent/add-datetime-to-boost-libs.patch @@ -1,16 +1,16 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 944602b..9d95446 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -678,9 +678,9 @@ else() - endif() - - # Boost --find_public_dependency(Boost REQUIRED COMPONENTS system) -+find_public_dependency(Boost REQUIRED COMPONENTS system date_time) - target_include_directories(torrent-rasterbar PUBLIC ${Boost_INCLUDE_DIRS}) --target_link_libraries(torrent-rasterbar PUBLIC ${Boost_SYSTEM_LIBRARY}) -+target_link_libraries(torrent-rasterbar PUBLIC ${Boost_LIBRARIES}) - - if (exceptions) - if (MSVC) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4f329339f..36f033b92 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -672,9 +672,9 @@ else() + endif() + + # Boost +-find_public_dependency(Boost REQUIRED COMPONENTS system) ++find_public_dependency(Boost REQUIRED COMPONENTS system date_time) + target_include_directories(torrent-rasterbar PUBLIC ${Boost_INCLUDE_DIRS}) +-target_link_libraries(torrent-rasterbar PUBLIC ${Boost_SYSTEM_LIBRARY}) ++target_link_libraries(torrent-rasterbar PUBLIC ${Boost_LIBRARIES}) + + if (exceptions) + if (MSVC) diff --git a/ports/libtorrent/add-executor_type.patch b/ports/libtorrent/add-executor_type.patch deleted file mode 100644 index 2d2a36c4913b9c..00000000000000 --- a/ports/libtorrent/add-executor_type.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/include/libtorrent/aux_/socket_type.hpp b/include/libtorrent/aux_/socket_type.hpp -index 1342d39ad..364ec1e8f 100644 ---- a/include/libtorrent/aux_/socket_type.hpp -+++ b/include/libtorrent/aux_/socket_type.hpp -@@ -184,6 +184,9 @@ namespace aux { - using receive_buffer_size = tcp::socket::receive_buffer_size; - using send_buffer_size = tcp::socket::send_buffer_size; - -+#if BOOST_VERSION >= 106600 -+ using executor_type = tcp::socket::executor_type; -+#endif - explicit socket_type(io_service& ios): m_io_service(ios), m_type(0) {} - ~socket_type(); - diff --git a/ports/libtorrent/fix_find_iconv.patch b/ports/libtorrent/fix_find_iconv.patch new file mode 100644 index 00000000000000..cf30ef18f17f55 --- /dev/null +++ b/ports/libtorrent/fix_find_iconv.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 303f905e4..6bdbc5ac4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -603,24 +603,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) + +-find_public_dependency(Iconv) +-if(MSVC) +- set(iconv_package_type OPTIONAL) +-else() +- set(iconv_package_type RECOMMENDED) +-endif() ++find_public_dependency(unofficial-iconv REQUIRED) + +-set_package_properties(Iconv ++set_package_properties(unofficial-iconv + PROPERTIES + URL "https://www.gnu.org/software/libiconv/" +- DESCRIPTION "GNU encoding conversion library" +- TYPE ${iconv_package_type} ++ DESCRIPTION "GNU encoding conversion library (unofficial vcpkg CMake port)" ++ TYPE REQUIRED + PURPOSE "Convert strings between various encodings" + ) + +-if(Iconv_FOUND) ++if(unofficial-iconv_FOUND) + target_compile_definitions(torrent-rasterbar PUBLIC TORRENT_USE_ICONV) +- target_link_libraries(torrent-rasterbar PRIVATE Iconv::Iconv) ++ target_link_libraries(torrent-rasterbar PRIVATE unofficial::iconv::libiconv unofficial::iconv::libcharset) + endif() + + find_public_dependency(OpenSSL) diff --git a/ports/libtorrent/fix_python_cmake.patch b/ports/libtorrent/fix_python_cmake.patch new file mode 100644 index 00000000000000..942b8e3b8a563a --- /dev/null +++ b/ports/libtorrent/fix_python_cmake.patch @@ -0,0 +1,130 @@ +diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt +index 0b9b3ebe7..74e608901 100644 +--- a/bindings/python/CMakeLists.txt ++++ b/bindings/python/CMakeLists.txt +@@ -1,7 +1,6 @@ + # To build python bindings we need a python executable and boost python module. Unfortunately, + # their names might not be interlinked and we can not implement a general solution. +-# The code below assumes default boost installation, when the module for python 2 is named +-# 'python' and the module for python 3 is named 'python3'. ++# The code below assumes default boost installation, when the module for python 3 is named 'python3'. + # To customize that one can provide a name for the Boost::python module via + # 'boost-python-module-name' variable when invoking cmake. + # E.g. on Gentoo with python 3.6 and Boost::python library name 'libboost_python-3.6.so' +@@ -15,12 +14,9 @@ + # Sets _ret to a list of python versions (major.minor) that use the same MSVC runtime as this build does + # assumes MSVC was detected already + # See https://en.wikipedia.org/wiki/Microsoft_Visual_C++#Internal_version_numbering ++# See https://devguide.python.org/#status-of-python-branches for supported python versions + function(_get_compatible_python_versions _ret) +- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) +- list(APPEND _tmp 2.6 2.7 3.0 3.1 3.2) +- elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17) +- list(APPEND _tmp 3.3 3.4) +- elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20) ++ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20) + 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) + _get_compatible_python_versions(Python_ADDITIONAL_VERSIONS) + endif() + +-find_package(PythonInterp REQUIRED) ++find_package(Python3 COMPONENTS Interpreter Development REQUIRED) + if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT skip-python-runtime-test) +- message(STATUS "Testing found python version. Requested: ${Python_ADDITIONAL_VERSIONS}, found: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") +- if (NOT "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" IN_LIST Python_ADDITIONAL_VERSIONS) +- message(FATAL_ERROR "Incompatible Python and C runtime: MSVC ${CMAKE_CXX_COMPILER_VERSION} and Python ${PYTHON_VERSION_STRING}") ++ message(STATUS "Testing found python version. Requested: ${Python_ADDITIONAL_VERSIONS}, found: ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") ++ if (NOT "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" IN_LIST Python_ADDITIONAL_VERSIONS) ++ message(FATAL_ERROR "Incompatible Python and C runtime: MSVC ${CMAKE_CXX_COMPILER_VERSION} and Python ${Python3_VERSION}") + endif() + endif() + +-set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") +-find_package(PythonLibs REQUIRED) ++set(Python_ADDITIONAL_VERSIONS "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") + + 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() +- set(_boost-python-module-name "python") # to overwrite possible value from a previous run +- endif() ++ set(_boost-python-module-name "python${Python3_VERSION_MAJOR}") + endif() + + set(boost-python-module-name ${_boost-python-module-name} CACHE STRING "Boost:python module name, e.g. 'pythom-3.6'") + + find_package(Boost REQUIRED COMPONENTS ${boost-python-module-name}) + +-python_add_module(python-libtorrent ++Python3_add_library(python-libtorrent STATIC + src/module.cpp + src/sha1_hash.cpp + src/converters.cpp +@@ -80,12 +71,12 @@ python_add_module(python-libtorrent + + set_target_properties(python-libtorrent + PROPERTIES +- OUTPUT_NAME libtorrent ++ OUTPUT_NAME torrent + ) + + target_include_directories(python-libtorrent + PRIVATE +- ${PYTHON_INCLUDE_DIRS} ++ ${Python3_INCLUDE_DIRS} + ) + + string(TOUPPER "${boost-python-module-name}" boost_python_module_name_uppercase) +@@ -96,7 +87,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). +- ${PYTHON_LIBRARIES} ++ ${Python3_LIBRARIES} + ) + + # Bindings module uses deprecated libtorrent features, thus we disable these warnings +@@ -108,7 +99,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + endif() + + execute_process(COMMAND +- ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; ++ ${Python3_EXECUTABLE} -c "import distutils.sysconfig; + 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) + list(GET _python_sysconfig_vars 1 PYTHON_EXT_SUFFIX) + + message(STATUS "Python site packages: ${PYTHON_SITE_PACKAGES}") +-# python 2 does not provide the 'EXT_SUFFIX' sysconfig variable, so we use cmake default then +-if (NOT "${PYTHON_EXT_SUFFIX}" STREQUAL "None") +- message(STATUS "Python extension suffix: ${PYTHON_EXT_SUFFIX}") +- # we mimic the name, created by setuptools +- # example: libtorrent.cpython-36m-x86_64-linux-gnu.so +- set_target_properties(python-libtorrent PROPERTIES SUFFIX ${PYTHON_EXT_SUFFIX}) +-endif() ++ ++message(STATUS "Python extension suffix: ${PYTHON_EXT_SUFFIX}") ++# we mimic the name, created by setuptools ++# example: libtorrent.cpython-36m-x86_64-linux-gnu.so ++set_target_properties(python-libtorrent PROPERTIES SUFFIX ${PYTHON_EXT_SUFFIX}) + + 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}") + configure_file(${SETUP_PY_IN} ${SETUP_PY} @ONLY) + + add_custom_command(OUTPUT ${OUTPUT} +- COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} build -b "${CMAKE_CURRENT_SOURCE_DIR}" +- COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} egg_info -b "${CMAKE_CURRENT_SOURCE_DIR}" ++ COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b "${CMAKE_CURRENT_SOURCE_DIR}" ++ COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} egg_info -b "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} + DEPENDS ${DEPS}) + diff --git a/ports/libtorrent/no_use_iconv.patch b/ports/libtorrent/no_use_iconv.patch new file mode 100644 index 00000000000000..8e62a950c8ce91 --- /dev/null +++ b/ports/libtorrent/no_use_iconv.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 303f905e4..1810c23c6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -603,26 +603,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) + +-find_public_dependency(Iconv) +-if(MSVC) +- set(iconv_package_type OPTIONAL) +-else() +- set(iconv_package_type RECOMMENDED) +-endif() +- +-set_package_properties(Iconv +- PROPERTIES +- URL "https://www.gnu.org/software/libiconv/" +- DESCRIPTION "GNU encoding conversion library" +- TYPE ${iconv_package_type} +- PURPOSE "Convert strings between various encodings" +-) +- +-if(Iconv_FOUND) +- target_compile_definitions(torrent-rasterbar PUBLIC TORRENT_USE_ICONV) +- target_link_libraries(torrent-rasterbar PRIVATE Iconv::Iconv) +-endif() +- + find_public_dependency(OpenSSL) + set_package_properties(OpenSSL + PROPERTIES diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index 3dbf7750e3c32b..e88ddf7cc2ce85 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -1,39 +1,69 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") + +if(VCPKG_TARGET_IS_WINDOWS) + # Building python bindings is currently broken on Windows + if("python" IN_LIST FEATURES) + message(FATAL_ERROR "The python feature is currently broken on Windows") + endif() + + if("iconv" IN_LIST FEATURES) + set(ICONV_PATCH "fix_find_iconv.patch") + else() + # prevent picking up libiconv if it happens to already be installed + set(ICONV_PATCH "no_use_iconv.patch") + endif() + + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(_static_runtime ON) + endif() +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + deprfun deprecated-functions + examples build_examples + python python-bindings + test build_tests + tools build_tools +) + +# Note: the python feature currently requires `python3-dev` and `python3-setuptools` installed on the system +if("python" IN_LIST FEATURES) + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY) + vcpkg_add_to_path(${PYTHON3_PATH}) + + file(GLOB BOOST_PYTHON_LIB "${CURRENT_INSTALLED_DIR}/lib/*boost_python*") + string(REGEX REPLACE ".*(python)([0-9])([0-9]+).*" "\\1\\2\\3" _boost-python-module-name "${BOOST_PYTHON_LIB}") +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO arvidn/libtorrent - REF libtorrent-1_2_2 - SHA512 34dcf5421dfccbba78bdd30890b9c18b92fdee1a2e1693ada9b55b79a167730093862017581b9251a654b5517011dbe4c46b520b03b78aa86a909457f7edcf2c - HEAD_REF master + REF libtorrent-1.2.8 + SHA512 2a36412fb399f066de9768f4afd87ddbfc10fcd2a0b3a8be0a43bec6914497e71d9d4ffe4ff8ccc5544a048f799ccba6ce086ab6199f4dee66d1341f02d73f9a + HEAD_REF RC_1_2 PATCHES add-datetime-to-boost-libs.patch - add-executor_type.patch + fix_python_cmake.patch + ${ICONV_PATCH} ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS - -Ddeprecated-functions=off + ${FEATURE_OPTIONS} + -Dboost-python-module-name=${_boost-python-module-name} + -Dstatic_runtime=${_static_runtime} + -DPython3_USE_STATIC_LIBS=ON ) vcpkg_install_cmake() -file(READ ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp EXPORT_H) -string(REPLACE "defined TORRENT_BUILDING_SHARED" "0" EXPORT_H "${EXPORT_H}") -if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - string(REPLACE "defined TORRENT_LINKING_SHARED" "1" EXPORT_H "${EXPORT_H}") -else() - string(REPLACE "defined TORRENT_LINKING_SHARED" "0" EXPORT_H "${EXPORT_H}") -endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp "${EXPORT_H}") - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/libtorrentrasterbar) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/LibtorrentRasterbar) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libtorrent) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libtorrent/LICENSE ${CURRENT_PACKAGES_DIR}/share/libtorrent/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) # Do not duplicate include files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/cmake) 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/libudns/CONTROL b/ports/libudns/CONTROL index a78adfdf361b16..d9bb84f9e91908 100644 --- a/ports/libudns/CONTROL +++ b/ports/libudns/CONTROL @@ -1,4 +1,4 @@ Source: libudns -Version: 0.4-1 +Version: 0.4-2 Homepage: https://github.com/ortclib/udns Description: The DNS library, udns, implements thread-safe stub DNS resolver functionality, which may be used both traditional, syncronous way and asyncronously, with application-supplied event loop. diff --git a/ports/libudns/ignore_unknown_options.patch b/ports/libudns/ignore_unknown_options.patch new file mode 100644 index 00000000000000..4adbcf28cc07db --- /dev/null +++ b/ports/libudns/ignore_unknown_options.patch @@ -0,0 +1,26 @@ +diff --git a/configure b/configure +index dda98b3ab..6f5f8a3c8 100644 +--- a/configure ++++ b/configure +@@ -25,10 +25,9 @@ fi + enable() { + opt=`echo "$1" | sed 's/^--[^-]*-//'` + case "$opt" in +- ipv6) ;; +- *) echo "configure: unrecognized option \`$1'" >&2; exit 1;; ++ ipv6) eval enable_$opt=$2 ;; ++ *) echo "configure: unrecognized option \`$1'" >&2;; + esac +- eval enable_$opt=$2 + } + + while [ $# -gt 0 ]; do +@@ -50,7 +49,7 @@ Optional features (all enabled by default if system supports a feature): + EOF + exit 0 + ;; +- *) echo "configure: unknown option \`$1'" >&2; exit 1 ;; ++ *) echo "configure: unknown option \`$1'" >&2;; + esac + shift + done diff --git a/ports/libudns/portfile.cmake b/ports/libudns/portfile.cmake index 142dc32949f636..826c4c6c3cddc0 100644 --- a/ports/libudns/portfile.cmake +++ b/ports/libudns/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX") +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -6,15 +6,16 @@ vcpkg_from_github( REF udns_0_4 SHA512 4df8def718c75872536d42a757237d6c8e0afce8a53aedd7fea73814dc5cf8b5d6c9ae8f01a8cfc76864aa8293c172f08953a6750a66749ba19a3721bb4cf2ec HEAD_REF master + PATCHES ignore_unknown_options.patch ) vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - DISABLE_AUTO_DST + COPY_SOURCE ) vcpkg_build_make() - +vcpkg_fixup_pkgconfig() # Install if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/libudns.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) diff --git a/ports/libusb-win32/CONTROL b/ports/libusb-win32/CONTROL index bea5b909293882..24dd02c85fdb9d 100644 --- a/ports/libusb-win32/CONTROL +++ b/ports/libusb-win32/CONTROL @@ -1,5 +1,5 @@ Source: libusb-win32 -Version: 1.2.6.0-3 +Version: 1.2.6.0-6 Homepage: https://sourceforge.net/projects/libusb-win32 Description: Allows user space applications to access many USB device on Windows. Supports: windows \ No newline at end of file diff --git a/ports/libusb-win32/portfile.cmake b/ports/libusb-win32/portfile.cmake index 1164939fb680bf..1cca3bedb627b0 100644 --- a/ports/libusb-win32/portfile.cmake +++ b/ports/libusb-win32/portfile.cmake @@ -1,21 +1,14 @@ -include(vcpkg_common_functions) - -if (VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "Error: only Windows Desktop builds are currently supported.") -endif() +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX") set(LIBUSB_VERSION 1.2.6.0) set(LIBUSB_HASH 972438b7465a22882bc91a1238291240ee3cdb09f374454a027d003b150656d4c262553104f74418bb49b4a7ca2f1a4f72d20e689fa3a7728881bafc876267f4) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/${LIBUSB_VERSION}/libusb-win32-src-${LIBUSB_VERSION}.zip/download" - FILENAME "libusb-win32-${LIBUSB_VERSION}.zip" - SHA512 ${LIBUSB_HASH} -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO libusb-win32/libusb-win32-releases + REF ${LIBUSB_VERSION} + FILENAME "libusb-win32-src-${LIBUSB_VERSION}.zip" + SHA512 ${LIBUSB_HASH} ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL index 8e351613262ec8..accbf3d0e0aa39 100644 --- a/ports/libusb/CONTROL +++ b/ports/libusb/CONTROL @@ -1,4 +1,6 @@ Source: libusb Version: 1.0.23 +Port-Version: 2 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..74a592f41f2706 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,22 @@ 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 -) - file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libusbmuxd/CONTROL b/ports/libusbmuxd/CONTROL index 2c0bf3dd974f73..615147f46858d6 100644 --- a/ports/libusbmuxd/CONTROL +++ b/ports/libusbmuxd/CONTROL @@ -1,4 +1,5 @@ Source: libusbmuxd -Version: 1.2.185 +Version: 1.2.185-1 Description: A client library to multiplex connections from and to iOS devices Build-Depends: libplist +Supports: !(uwp|linux|osx) diff --git a/ports/libusbmuxd/portfile.cmake b/ports/libusbmuxd/portfile.cmake index f7a4d3a4b4ed81..26518b2170a1d2 100644 --- a/ports/libusbmuxd/portfile.cmake +++ b/ports/libusbmuxd/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install( ON_TARGET "uwp" "linux" "osx") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libimobiledevice-win32/libusbmuxd diff --git a/ports/libuuid/CONTROL b/ports/libuuid/CONTROL index 2d46a830767a3c..5c11b9cac4f773 100644 --- a/ports/libuuid/CONTROL +++ b/ports/libuuid/CONTROL @@ -1,4 +1,5 @@ Source: libuuid -Version: 1.0.3-3 +Version: 1.0.3-7 +Homepage: https://sourceforge.net/projects/libuuid Description: Universally unique id library Supports: linux|osx \ No newline at end of file diff --git a/ports/libuuid/portfile.cmake b/ports/libuuid/portfile.cmake index 719478e24d5974..bb03f31f35ebf1 100644 --- a/ports/libuuid/portfile.cmake +++ b/ports/libuuid/portfile.cmake @@ -1,18 +1,12 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports unix platform" ON_TARGET "Windows") -if (NOT ((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin"))) - message(FATAL_ERROR "libuuid currently only supports unix platforms.") -endif() +set(LIBUUID_VERSION 1.0.3) -vcpkg_download_distfile(ARCHIVE - URLS "http://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz" - FILENAME libuuid-1.0.3.tar.gz - SHA512 77488caccc66503f6f2ded7bdfc4d3bc2c20b24a8dc95b2051633c695e99ec27876ffbafe38269b939826e1fdb06eea328f07b796c9e0aaca12331a787175507 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO libuuid + FILENAME "libuuid-${LIBUUID_VERSION}.tar.gz" + SHA512 77488caccc66503f6f2ded7bdfc4d3bc2c20b24a8dc95b2051633c695e99ec27876ffbafe38269b939826e1fdb06eea328f07b796c9e0aaca12331a787175507 ) file(COPY @@ -28,8 +22,17 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +set(prefix ${CURRENT_INSTALLED_DIR}) +set(exec_prefix \$\{prefix\}) +set(libdir \$\{exec_prefix\}/lib) +set(includedir \$\{prefix\}/include) +configure_file(${SOURCE_PATH}/uuid.pc.in ${SOURCE_PATH}/uuid.pc @ONLY) +file(INSTALL ${SOURCE_PATH}/uuid.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +file(INSTALL ${SOURCE_PATH}/uuid.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +vcpkg_fixup_pkgconfig() + file(INSTALL ${SOURCE_PATH}/COPYING - DESTINATION ${CURRENT_PACKAGES_DIR}/share/libuuid RENAME copyright) + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/libuv/CONTROL b/ports/libuv/CONTROL index 7d9d1b1f31f8c0..efae9098fe097d 100644 --- a/ports/libuv/CONTROL +++ b/ports/libuv/CONTROL @@ -1,4 +1,4 @@ Source: libuv -Version: 1.34.2 +Version: 1.34.2-1 Homepage: https://github.com/libuv/libuv Description: libuv is a multi-platform support library with a focus on asynchronous I/O. diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 697e1e551b7ecc..4cc164c3195c58 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libuv/libuv @@ -32,8 +30,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") string(REPLACE "defined(USING_UV_SHARED)" "1" UV_H "${UV_H}") else() string(REPLACE "defined(USING_UV_SHARED)" "0" UV_H "${UV_H}") + configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/uv.h "${UV_H}") -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libuv) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libuv/LICENSE ${CURRENT_PACKAGES_DIR}/share/libuv/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + diff --git a/ports/libuv/vcpkg-cmake-wrapper.cmake b/ports/libuv/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..10b6e649838a58 --- /dev/null +++ b/ports/libuv/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,16 @@ +_find_package(${ARGS}) + +if(WIN32) + list(APPEND LibUV_LIBRARIES iphlpapi psapi shell32 userenv ws2_32) + if(TARGET LibUV::LibUV) + target_link_libraries(LibUV::LibUV INTERFACE iphlpapi psapi shell32 userenv ws2_32) + endif() +endif() +include(CMakeFindDependencyMacro) +find_dependency(Threads) +list(APPEND LibUV_LIBRARIES Threads::Threads) +if(TARGET LibUV::LibUV) + target_link_libraries(LibUV::LibUV INTERFACE Threads::Threads) +endif() + + diff --git a/ports/libvmdk/CMakeLists.txt b/ports/libvmdk/CMakeLists.txt new file mode 100644 index 00000000000000..1fb043d905fbdd --- /dev/null +++ b/ports/libvmdk/CMakeLists.txt @@ -0,0 +1,84 @@ +cmake_minimum_required(VERSION 3.12) + +project(libvmdk C) + +find_package(ZLIB REQUIRED) + +if(MSVC) + add_compile_definitions(_CRT_SECURE_NO_DEPRECATE) + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) +endif() + +add_compile_definitions(HAVE_LOCAL_LIBCAES) +add_compile_definitions(HAVE_LOCAL_LIBCERROR) +add_compile_definitions(HAVE_LOCAL_LIBCTHREADS) +add_compile_definitions(HAVE_LOCAL_LIBCDATA) +add_compile_definitions(HAVE_LOCAL_LIBCLOCALE) +add_compile_definitions(HAVE_LOCAL_LIBCNOTIFY) +add_compile_definitions(HAVE_LOCAL_LIBCSPLIT) +add_compile_definitions(HAVE_LOCAL_LIBCFILE) +add_compile_definitions(HAVE_LOCAL_LIBCPATH) +add_compile_definitions(HAVE_LOCAL_LIBUNA) +add_compile_definitions(HAVE_LOCAL_LIBBFIO) +add_compile_definitions(HAVE_LOCAL_LIBFCACHE) +add_compile_definitions(HAVE_LOCAL_LIBFDATA) +add_compile_definitions(HAVE_LOCAL_LIBFVALUE) +add_compile_definitions(ZLIB_DLL) + +if(UNIX) + configure_file(common/config.h.in common/config.h) + add_compile_definitions(HAVE_CONFIG_H) + add_compile_definitions(LOCALEDIR="/usr/share/locale") +endif() + +if(MSVC) + add_compile_definitions(LIBVMDK_DLL_EXPORT) + set(LIB_RC libvmdk/libvmdk.rc) +endif() + + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +# Add CMake find_package() integration +set(PROJECT_TARGET_NAME "${PROJECT_NAME}") +set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +set(PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_TARGET_NAME}Config.cmake") +set(TARGETS_EXPORT_NAME "${PROJECT_TARGET_NAME}Targets") +set(NAMESPACE "libvmdk::") + +# Source files +file(GLOB LIB_SRC lib*/*.c) + +# Headers +file(GLOB LIB_INST_HEADERS include/libvmdk/*.h) + +add_library(${PROJECT_NAME} ${LIB_SRC} ${LIB_RC}) + +target_include_directories(${PROJECT_NAME} PRIVATE ./include ./common) +target_include_directories(${PROJECT_NAME} PRIVATE ./libbfio ./libcdata ./libcerror ./libcfile ./libclocale) +target_include_directories(${PROJECT_NAME} PRIVATE ./libcnotify ./libcpath ./libcsplit ./libcthreads) +target_include_directories(${PROJECT_NAME} PRIVATE ./libfcache ./libfdata ./libfvalue ./libuna) + +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) + +install(TARGETS ${PROJECT_NAME} + EXPORT ${TARGETS_EXPORT_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include) + +install(FILES ${LIB_INST_HEADERS} DESTINATION include/libvmdk) +install(FILES include/libvmdk.h DESTINATION include) + + +# Generate and install libvmdkConfig.cmake +configure_package_config_file("Config.cmake.in" "${PROJECT_CONFIG}" INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}") +install(FILES "${PROJECT_CONFIG}" DESTINATION "${CONFIG_INSTALL_DIR}") + +# Generate and install libvmdkTargets*.cmake +install(EXPORT ${TARGETS_EXPORT_NAME} + NAMESPACE ${NAMESPACE} + DESTINATION "${CONFIG_INSTALL_DIR}") + diff --git a/ports/libvmdk/CONTROL b/ports/libvmdk/CONTROL new file mode 100644 index 00000000000000..8eeff87d062922 --- /dev/null +++ b/ports/libvmdk/CONTROL @@ -0,0 +1,6 @@ +Source: libvmdk +Version: 2019-12-21 +Homepage: https://github.com/libyal/libvmdk +Description: Library and tools to access the VMware Virtual Disk (VMDK) format +Build-Depends: gettext,zlib +Supports: !uwp diff --git a/ports/libvmdk/Config.cmake.in b/ports/libvmdk/Config.cmake.in new file mode 100644 index 00000000000000..bd6bd4532b6282 --- /dev/null +++ b/ports/libvmdk/Config.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/ports/libvmdk/no_fs_and_fadvise_on_macos.patch b/ports/libvmdk/no_fs_and_fadvise_on_macos.patch new file mode 100644 index 00000000000000..3e95869fe78a97 --- /dev/null +++ b/ports/libvmdk/no_fs_and_fadvise_on_macos.patch @@ -0,0 +1,25 @@ +diff --git a/libcfile/libcfile_file.c b/libcfile/libcfile_file.c +index 13eab02..690cc04 100644 +--- a/libcfile/libcfile_file.c ++++ b/libcfile/libcfile_file.c +@@ -56,7 +56,7 @@ + #elif defined( HAVE_CYGWIN_FS_H ) + #include + +-#elif defined( HAVE_LINUX_FS_H ) ++#elif defined( __linux__ ) && defined( HAVE_LINUX_FS_H ) + /* Required for Linux platforms that use a sizeof( u64 ) + * in linux/fs.h but have no typedef of it + */ +@@ -4603,6 +4603,11 @@ ssize_t libcfile_file_io_control_read_with_error_code( + #error Missing file IO control with data function + #endif + ++// Force disable on Darwin, it can be erroneously defined ++#if defined ( __APPLE__ ) ++#undef HAVE_POSIX_FADVISE ++#endif ++ + /* On some versions of Linux the FADVISE definions seem to be missing from fcntl.h + */ + #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) diff --git a/ports/libvmdk/portfile.cmake b/ports/libvmdk/portfile.cmake new file mode 100644 index 00000000000000..7fc06f802384b7 --- /dev/null +++ b/ports/libvmdk/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + +set(LIB_VERSION 20191221) +set(LIB_FILENAME libvmdk-alpha-${LIB_VERSION}.tar.gz) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libyal/libvmdk/releases/download/${LIB_VERSION}/${LIB_FILENAME}" + FILENAME "${LIB_FILENAME}" + SHA512 fd14760034ada2b01599f6c812b1a94592067bc224495aaae736d81d08629b1904935f43516513ba726d2d04589aa816c17b72a6f9ae035ee0030dba93dce865 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${LIB_VERSION} + PATCHES no_fs_and_fadvise_on_macos.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" DESTINATION "${SOURCE_PATH}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libvmdk" TARGET_PATH "share/libvmdk") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +vcpkg_copy_pdbs() diff --git a/ports/libvorbis/0002-Allow-deprecated-functions.patch b/ports/libvorbis/0002-Allow-deprecated-functions.patch deleted file mode 100644 index ea1d07e3998672..00000000000000 --- a/ports/libvorbis/0002-Allow-deprecated-functions.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 2043294..e273393 100644 ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -61,6 +61,9 @@ if(MSVC) - list(APPEND VORBIS_SOURCES ../win32/vorbis.def) - list(APPEND VORBISENC_SOURCES ../win32/vorbisenc.def) - list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def) -+ add_definitions(-D_CRT_SECURE_NO_WARNINGS) -+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE) -+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) - endif() - - include_directories(../include) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 33a30095753f8a..8ea6bbc44886dd 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,5 +1,5 @@ Source: libvorbis -Version: 1.3.6-9eadecc-3 +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/ogg.patch b/ports/libvorbis/ogg.patch deleted file mode 100644 index 323e2c7e2d3bd9..00000000000000 --- a/ports/libvorbis/ogg.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bbc045ba..a23630f5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -57,10 +57,10 @@ if(NOT OGG_ROOT) - find_package(PkgConfig QUIET) - pkg_check_modules(PC_OGG QUIET ogg) - find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${PC_OGG_INCLUDE_DIRS} PATH_SUFFIXES ogg) -- find_library(OGG_LIBRARIES NAMES ogg HINTS ${PC_OGG_LIBRARY_DIRS}) -+ find_library(OGG_LIBRARIES NAMES ogg libogg HINTS ${PC_OGG_LIBRARY_DIRS}) - else() - find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${OGG_ROOT}/include PATH_SUFFIXES ogg) -- find_library(OGG_LIBRARIES NAMES ogg HINTS ${OGG_ROOT}/lib ${OGG_ROOT}/lib64) -+ find_library(OGG_LIBRARIES NAMES ogg libogg HINTS ${OGG_ROOT}/lib ${OGG_ROOT}/lib64) - endif() - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(OGG DEFAULT_MSG OGG_INCLUDE_DIRS OGG_LIBRARIES) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 0e1ef5d421095a..cf6b86a5cb7671 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -1,14 +1,11 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xiph/vorbis - REF 9eadeccdc4247127d91ac70555074239f5ce3529 - SHA512 26d6826eba57fd47ebf426ba5a0c961c87ff62e2bb4185190e4985de9ac49aa493f77a1bd01d3d0757eb89a8494ba7de3a506f76bf5c8942ac1de3f75746a301 + REF 4d963fe0b4ba3bdb45233de4b959ce2f36963f7a + SHA512 c739cebf1a7ff4739447e899d3373e2fa7a0f3a87affd59c9c0c65d69e7611ceadcdcd1592c279e65123d7d2e1c9f8f8e7dee93def8753bcdd6d115677232d83 HEAD_REF master PATCHES 0001-Dont-export-vorbisenc-functions.patch - 0002-Allow-deprecated-functions.patch - ogg.patch ) vcpkg_configure_cmake( @@ -17,10 +14,14 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets( + CONFIG_PATH lib/cmake/Vorbis + TARGET_PATH share/Vorbis +) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/libvorbis/copyright COPYONLY) +configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index 52727e62251d53..82eec705c923c4 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -1,4 +1,6 @@ Source: libvpx -Version: 1.8.1-1 +Version: 1.8.1 +Port-Version: 9 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 5725b53586d3fc..7a899c9cb70ea1 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) set(LIBVPX_VERSION 1.8.1) @@ -18,94 +16,217 @@ vcpkg_extract_source_archive_ex( vcpkg_find_acquire_program(YASM) vcpkg_find_acquire_program(PERL) -vcpkg_acquire_msys(MSYS_ROOT PACKAGES make) -vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils) + get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -message(STATUS "PERL_EXE_PATH ; ${PERL_EXE_PATH}") -set(ENV{PATH} "${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH};${PERL_EXE_PATH}") -set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) - -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(LIBVPX_CRT_LINKAGE --enable-static-msvcrt) - set(LIBVPX_CRT_SUFFIX mt) +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() - set(LIBVPX_CRT_SUFFIX md) + set(BASH /bin/bash) + set(ENV{PATH} "${YASM_EXE_PATH}:${MSYS_ROOT}/usr/bin:$ENV{PATH}:${PERL_EXE_PATH}") endif() -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(LIBVPX_TARGET_ARCH "x86-win32") - set(LIBVPX_ARCH_DIR "Win32") -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(LIBVPX_TARGET_ARCH "x86_64-win64") - set(LIBVPX_ARCH_DIR "x64") -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(LIBVPX_TARGET_ARCH "armv7-win32") - set(LIBVPX_ARCH_DIR "ARM") -endif() +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) -set(LIBVPX_TARGET_VS "vs15") - -message(STATUS "Generating makefile") -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) -vcpkg_execute_required_process( - COMMAND - ${BASH} --noprofile --norc - "${SOURCE_PATH}/configure" - --target=${LIBVPX_TARGET_ARCH}-${LIBVPX_TARGET_VS} - ${LIBVPX_CRT_LINKAGE} - --disable-examples - --disable-tools - --disable-docs - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}" - LOGNAME configure-${TARGET_TRIPLET}) - -message(STATUS "Generating MSBuild projects") -vcpkg_execute_required_process( - COMMAND - ${BASH} --noprofile --norc -c "make dist" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}" - LOGNAME generate-${TARGET_TRIPLET}) - -vcpkg_build_msbuild( - PROJECT_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx.vcxproj" -) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) -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") + if(VCPKG_CRT_LINKAGE STREQUAL static) + set(LIBVPX_CRT_LINKAGE --enable-static-msvcrt) + set(LIBVPX_CRT_SUFFIX mt) 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") + set(LIBVPX_CRT_SUFFIX md) 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") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(LIBVPX_TARGET_ARCH "x86-win32") + set(LIBVPX_ARCH_DIR "Win32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(LIBVPX_TARGET_ARCH "x86_64-win64") + set(LIBVPX_ARCH_DIR "x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) + set(LIBVPX_TARGET_ARCH "arm64-win64") + set(LIBVPX_ARCH_DIR "ARM64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) + set(LIBVPX_TARGET_ARCH "armv7-win32") + set(LIBVPX_ARCH_DIR "ARM") + endif() + + set(LIBVPX_TARGET_VS "vs15") + + message(STATUS "Generating makefile") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc + "${SOURCE_PATH}/configure" + --target=${LIBVPX_TARGET_ARCH}-${LIBVPX_TARGET_VS} + ${LIBVPX_CRT_LINKAGE} + --disable-examples + --disable-tools + --disable-docs + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}" + LOGNAME configure-${TARGET_TRIPLET}) + + message(STATUS "Generating MSBuild projects") + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc -c "make dist" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}" + LOGNAME generate-${TARGET_TRIPLET}) + + vcpkg_build_msbuild( + PROJECT_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx.vcxproj" + 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") + 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") + 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") + 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") + endif() + endif() + + if (VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) + set(LIBVPX_INCLUDE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx-vp8-vp9-nopost-nodocs-${LIBVPX_TARGET_ARCH}${LIBVPX_CRT_SUFFIX}-${LIBVPX_TARGET_VS}-v${LIBVPX_VERSION}/include/vpx") + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL arm) + set(LIBVPX_INCLUDE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx-vp8-vp9-nopost-nomt-nodocs-${LIBVPX_TARGET_ARCH}${LIBVPX_CRT_SUFFIX}-${LIBVPX_TARGET_VS}-v${LIBVPX_VERSION}/include/vpx") + else() + set(LIBVPX_INCLUDE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx-vp8-vp9-nodocs-${LIBVPX_TARGET_ARCH}${LIBVPX_CRT_SUFFIX}-${LIBVPX_TARGET_VS}-v${LIBVPX_VERSION}/include/vpx") + endif() + file( + INSTALL + ${LIBVPX_INCLUDE_DIR} + DESTINATION + "${CURRENT_PACKAGES_DIR}/include" + RENAME + "vpx") + +else() + + set(OPTIONS "--disable-examples --disable-tools --disable-docs --disable-unit-tests") + + set(OPTIONS_DEBUG "--enable-debug-libs --enable-debug --prefix=${CURRENT_PACKAGES_DIR}/debug") + set(OPTIONS_RELEASE "--prefix=${CURRENT_PACKAGES_DIR}") + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(OPTIONS "${OPTIONS} --disable-static --enable-shared") + else() + set(OPTIONS "${OPTIONS} --enable-static --disable-shared") + endif() + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(LIBVPX_TARGET_ARCH "x86") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(LIBVPX_TARGET_ARCH "x86_64") + else() + message(FATAL_ERROR "libvpx does not support architecture ${VCPKG_TARGET_ARCHITECTURE}") + endif() + + if(VCPKG_TARGET_IS_MINGW) + if(LIBVPX_TARGET_ARCH STREQUAL "x86") + set(LIBVPX_TARGET "x86-win32-gcc") + else() + set(LIBVPX_TARGET "x86_64-win64-gcc") + endif() + elseif(VCPKG_TARGET_IS_LINUX) + set(LIBVPX_TARGET "${LIBVPX_TARGET_ARCH}-linux-gcc") + elseif(VCPKG_TARGET_IS_OSX) + set(LIBVPX_TARGET "${LIBVPX_TARGET_ARCH}-darwin17-gcc") # enable latest CPU instructions for best performance and less CPU usage on MacOS 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") + set(LIBVPX_TARGET "generic-gnu") # use default target + endif() + + message(STATUS "Build info. Target: ${LIBVPX_TARGET}; Options: ${OPTIONS}") + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring libvpx for Release") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc + "${SOURCE_PATH}/configure" + --target=${LIBVPX_TARGET} + ${OPTIONS} + ${OPTIONS_RELEASE} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + LOGNAME configure-${TARGET_TRIPLET}-rel) + + message(STATUS "Building libvpx for Release") + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc -c "make -j8" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + LOGNAME build-${TARGET_TRIPLET}-rel + ) + + message(STATUS "Installing libvpx for Release") + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc -c "make install" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + LOGNAME install-${TARGET_TRIPLET}-rel + ) + endif() + + # --- --- --- + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring libvpx for Debug") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc + "${SOURCE_PATH}/configure" + --target=${LIBVPX_TARGET} + ${OPTIONS} + ${OPTIONS_DEBUG} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + LOGNAME configure-${TARGET_TRIPLET}-dbg) + + message(STATUS "Building libvpx for Debug") + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc -c "make -j8" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + + message(STATUS "Installing libvpx for Debug") + vcpkg_execute_required_process( + COMMAND + ${BASH} --noprofile --norc -c "make install" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + LOGNAME install-${TARGET_TRIPLET}-dbg + ) + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) endif() endif() -if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(LIBVPX_INCLUDE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx-vp8-vp9-nopost-nomt-nodocs-${LIBVPX_TARGET_ARCH}${LIBVPX_CRT_SUFFIX}-${LIBVPX_TARGET_VS}-v${LIBVPX_VERSION}/include/vpx") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(LIBVPX_CONFIG_DEBUG ON) else() - set(LIBVPX_INCLUDE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/vpx-vp8-vp9-nodocs-${LIBVPX_TARGET_ARCH}${LIBVPX_CRT_SUFFIX}-${LIBVPX_TARGET_VS}-v${LIBVPX_VERSION}/include/vpx") + set(LIBVPX_CONFIG_DEBUG OFF) endif() -file( - INSTALL - ${LIBVPX_INCLUDE_DIR} - DESTINATION - "${CURRENT_PACKAGES_DIR}/include" - RENAME - "vpx") - -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libvpx) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libvpx/LICENSE ${CURRENT_PACKAGES_DIR}/share/libvpx/copyright) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/unofficial-libvpx-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/unofficial-libvpx/unofficial-libvpx-config.cmake @ONLY) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libvpx/unofficial-libvpx-config.cmake.in b/ports/libvpx/unofficial-libvpx-config.cmake.in new file mode 100644 index 00000000000000..6e8fced361a753 --- /dev/null +++ b/ports/libvpx/unofficial-libvpx-config.cmake.in @@ -0,0 +1,49 @@ +if(NOT TARGET unofficial::libvpx::libvpx) + # 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) + + # Add library target (note: vpx always has a static build in vcpkg). + add_library(unofficial::libvpx::libvpx STATIC IMPORTED) + + # Add interface include directories and link interface languages (applies to all configurations). + set_target_properties(unofficial::libvpx::libvpx PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + list(APPEND _IMPORT_CHECK_FILES "${_IMPORT_PREFIX}/include/vpx/vpx_codec.h") + + # Add release configuration properties. + find_library(_LIBFILE_RELEASE NAMES vpx@LIBVPX_CRT_SUFFIX@ PATHS "${_IMPORT_PREFIX}/lib/" NO_DEFAULT_PATH) + set_property(TARGET unofficial::libvpx::libvpx + APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(unofficial::libvpx::libvpx PROPERTIES + IMPORTED_LOCATION_RELEASE ${_LIBFILE_RELEASE}) + list(APPEND _IMPORT_CHECK_FILES ${_LIBFILE_RELEASE}) + unset(_LIBFILE_RELEASE CACHE) + + # Add debug configuration properties. + if(@LIBVPX_CONFIG_DEBUG@) + find_library(_LIBFILE_DEBUG NAMES vpx@LIBVPX_CRT_SUFFIX@d PATHS "${_IMPORT_PREFIX}/debug/lib/" NO_DEFAULT_PATH) + set_property(TARGET unofficial::libvpx::libvpx + APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(unofficial::libvpx::libvpx PROPERTIES + IMPORTED_LOCATION_DEBUG ${_LIBFILE_DEBUG}) + list(APPEND _IMPORT_CHECK_FILES ${_LIBFILE_DEBUG}) + unset(_LIBFILE_DEBUG CACHE) + endif() + + # Check header and library files are present. + foreach(file ${_IMPORT_CHECK_FILES} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "unofficial::libvpx::libvpx references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES) +endif() diff --git a/ports/libwandio/CONTROL b/ports/libwandio/CONTROL index f41bf35ff7e84d..5fc36ba357f7f2 100644 --- a/ports/libwandio/CONTROL +++ b/ports/libwandio/CONTROL @@ -1,4 +1,5 @@ Source: libwandio -Version: 4.2.1 +Version: 4.2.1-2 Homepage: https://github.com/wanduow/wandio -Description: C library for simple and efficient file IO. \ No newline at end of file +Description: C library for simple and efficient file IO. +Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2 \ No newline at end of file diff --git a/ports/libwandio/configure.lib.patch b/ports/libwandio/configure.lib.patch new file mode 100644 index 00000000000000..57719581ea09ac --- /dev/null +++ b/ports/libwandio/configure.lib.patch @@ -0,0 +1,140 @@ +diff --git a/configure.ac b/configure.ac +index 4579fbb3d..f6be008c8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -112,10 +112,11 @@ AC_HEADER_STDC + AC_CHECK_HEADERS(stddef.h inttypes.h sys/prctl.h) + + # Checks for various "optional" libraries +-AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0) ++# AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0) ++AC_SEARCH_LIBS(pthread_create, [pthreadGC pthreadVC pthread], have_pthread=1, have_pthread=0) + + if test "$have_pthread" = 1; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lpthread" ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_pthread_create" + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported]) + fi + +@@ -128,12 +129,13 @@ AC_ARG_WITH([bzip2], + + AS_IF([test "x$with_bzip2" != "xno"], + [ +- AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no) ++ AC_SEARCH_LIBS(BZ2_bzDecompressInit, [bz2 bz2d bzip2 bzip2d], have_bzip=yes, have_bzip=no) ++ # AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no) + ], [have_bzip=no]) + + AS_IF([test "x$have_bzip" = "xyes"], [ +- if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lbz2" ++ if test "$ac_cv_search_BZ2_bzDecompressInit" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_BZ2_bzDecompressInit" + fi + with_bzip2=yes + AC_DEFINE(HAVE_LIBBZ2, 1, "Compiled with bzip2 support")], +@@ -149,12 +151,13 @@ AC_ARG_WITH([zlib], + + AS_IF([test "x$with_zlib" != "xno"], + [ +- AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no) ++ AC_SEARCH_LIBS(deflate, [z zlib zlibd zd], have_zlib=yes, have_zlib=no) ++ # AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no) + ], [have_zlib=no]) + + AS_IF([test "x$have_zlib" = "xyes"], [ +- if test "$ac_cv_lib_z_deflate" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lz" ++ if test "$ac_cv_search_deflate" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_deflate" + fi + AC_DEFINE(HAVE_LIBZ, 1, "Compiled with zlib support") + with_zlib=yes], +@@ -193,12 +196,13 @@ AC_ARG_WITH([lzma], + + AS_IF([test "x$with_lzma" != "xno"], + [ +- AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no) ++ # AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no) ++ AC_SEARCH_LIBS(lzma_free, [lzma lzmad], have_lzma=yes, have_lzma=no) + ], [have_lzma=no]) + + AS_IF([test "x$have_lzma" = "xyes"], [ +- if test "$ac_cv_lib_lzma_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzma" ++ if test "$ac_cv_search_lzma_free" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_lzma_free" + fi + AC_DEFINE(HAVE_LIBLZMA, 1, "Compiled with lzma support") + with_lzma=yes], +@@ -215,12 +219,13 @@ AC_ARG_WITH([zstd], + + AS_IF([test "x$with_zstd" != "xno"], + [ +- AC_CHECK_LIB(zstd, ZSTD_createDStream, have_zstd=yes, have_zstd=no) ++ AC_SEARCH_LIBS(ZSTD_createDStream, [zstd zstdd], have_zstd=yes, have_zstd=no) ++ # AC_CHECK_LIB(zstd, ZSTD_createDStream, have_zstd=yes, have_zstd=no) + ], [have_zstd=no]) + + AS_IF([test "x$have_zstd" = "xyes"], [ +- if test "$ac_cv_lib_zstd_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lzstd" ++ if test "$ac_cv_search_ZSTD_createDStream" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_ZSTD_createDStream" + fi + AC_DEFINE(HAVE_LIBZSTD, 1, "Compiled with zstd support") + with_zstd=yes], +@@ -259,25 +264,28 @@ AC_ARG_WITH([lz4], + + AS_IF([test "x$with_lz4" != "xno"], + [ +- AC_CHECK_LIB(lz4, LZ4F_createDecompressionContext, have_lz4f=yes, have_lz4f=no) ++ AC_SEARCH_LIBS(LZ4F_createDecompressionContext, [lz4 lz4d], have_lz4f=yes, have_lz4f=no) ++ # AC_CHECK_LIB(lz4, LZ4F_createDecompressionContext, have_lz4f=yes, have_lz4f=no) + ], [have_zstd=no]) + + AS_IF([test "x$have_lz4f" = "xyes"], [ +- if test "$ac_cv_lib_lz4_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4" ++ if test "$ac_cv_search_LZ4F_createDecompressionContext" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4F_createDecompressionContext" + fi + AC_DEFINE(HAVE_LIBLZ4F, 1, "Compiled with lz4 frame support") +- AC_CHECK_LIB(lz4, LZ4F_getVersion, have_lz4_173=yes, have_lz4_173=no) ++ AC_SEARCH_LIBS(LZ4F_getVersion, [lz4 lz4d], have_lz4_173=yes, have_lz4_173=no) ++ # AC_CHECK_LIB(lz4, LZ4F_getVersion, have_lz4_173=yes, have_lz4_173=no) + if test "x$have_lz4_173" = "xyes"; then + AC_DEFINE(HAVE_LIBLZ4_MOVABLE, 1, "If defined then liblz4 does NOT have the ERROR_srcPtr_wrong bug") + fi + with_lz4=frameapi], + [ + AC_DEFINE(HAVE_LIBLZ4F, 0, "Compiled with lz4 frame support") +- AC_CHECK_LIB(lz4, LZ4_decompress_safe_continue, have_lz4s=yes, have_lz4s=no) ++ AC_SEARCH_LIBS(LZ4_decompress_safe_continue, [lz4 lz4d], have_lz4s=yes, have_lz4s=no) ++ # AC_CHECK_LIB(lz4, LZ4_decompress_safe_continue, have_lz4s=yes, have_lz4s=no) + AS_IF([test "x$have_lz4s" = "xyes"], [ +- if test "$ac_cv_lib_lz4_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4" ++ if test "$ac_cv_search_LZ4_decompress_safe_continue" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4_decompress_safe_continue" + 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/portfile.cmake b/ports/libwandio/portfile.cmake index 20ccce13dbaeb7..c9be34be64f4ae 100644 --- a/ports/libwandio/portfile.cmake +++ b/ports/libwandio/portfile.cmake @@ -1,18 +1,16 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platform" ON_TARGET "Windows") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wanduow/wandio REF 012b646e7ba7ab191a5a2206488adfac493fcdc6 SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d HEAD_REF master + PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed. ) vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG + COPY_SOURCE ) - vcpkg_install_make() if(VCPKG_LIBRARY_LINKAGE STREQUAL static) diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL index b96114f0503133..a96f6c40c36448 100644 --- a/ports/libwebp/CONTROL +++ b/ports/libwebp/CONTROL @@ -1,5 +1,6 @@ Source: libwebp Version: 1.1.0 +Port-Version: 1 Homepage: https://github.com/webmproject/libwebp Description: WebP codec: library to encode and decode images in WebP format Default-Features: simd, nearlossless @@ -21,7 +22,7 @@ Feature: vwebp Description: Build the vwebp viewer tool. Build-Depends: opengl, freeglut (!osx) -Feature: vwebp_sdl +Feature: vwebp-sdl Description: Build the vwebp viewer tool. Build-Depends: libwebp[vwebp], sdl1 (windows) @@ -55,4 +56,4 @@ Description: Enable byte swap for 16 bit colorspaces. Feature: all Description: enable all features except for swap16bitcsp -Build-Depends: libwebp[anim, gif2webp, img2webp, info, mux, nearlossless, simd, cwebp, dwebp], libwebp[vwebp_sdl] (!osx), libwebp[extras] (!osx) +Build-Depends: libwebp[anim, gif2webp, img2webp, info, mux, nearlossless, simd, cwebp, dwebp], libwebp[vwebp-sdl] (!osx), libwebp[extras] (!osx) diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index 81040ad0570db9..9bea70aecde745 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -16,11 +16,12 @@ vcpkg_from_github( ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used + FEATURES anim WEBP_BUILD_ANIM_UTILS gif2webp WEBP_BUILD_GIF2WEBP img2webp WEBP_BUILD_IMG2WEBP vwebp WEBP_BUILD_VWEBP + vwebp-sdl WEBP_HAVE_SDL info WEBP_BUILD_WEBPINFO mux WEBP_BUILD_WEBPMUX extras WEBP_BUILD_EXTRAS @@ -85,4 +86,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libwebp" RENAME copyright) +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 6cb5eda15e2bbe..b5cf188290885a 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,5 +1,5 @@ Source: libwebsockets -Version: 4.0.1 +Version: 4.0.1-1 Build-Depends: zlib, openssl, libuv Homepage: https://github.com/warmcat/libwebsockets Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. diff --git a/ports/libxdiff/CONTROL b/ports/libxdiff/CONTROL new file mode 100644 index 00000000000000..81db30fc840d1a --- /dev/null +++ b/ports/libxdiff/CONTROL @@ -0,0 +1,5 @@ +Source: libxdiff +Version: 0.23 +Homepage: https://github.com/Drako/libxdiff +Description: The LibXDiff library implements basic and yet complete functionalities to create file differences/patches to both binary and text files. The library uses memory files as file abstraction to achieve both performance and portability. +Supports: !uwp \ No newline at end of file diff --git a/ports/libxdiff/portfile.cmake b/ports/libxdiff/portfile.cmake new file mode 100644 index 00000000000000..05b7ade351ac97 --- /dev/null +++ b/ports/libxdiff/portfile.cmake @@ -0,0 +1,45 @@ +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports being built for desktop" ON_TARGET "UWP") + +set(LIBXDIFF_REF 77e30f3190685efd87cce2c9c5d688cbaa1b0134) +set(LIBXDIFF_SHA512 c559b575e6d6f06f3b3064f3e077a15d8f57422340199215a4cbd7beab527bc250347c8779a8d6f8c4e41799a032431e83c7336f86569527ab754444455b8c87) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" KEYSTONE_BUILD_SHARED) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Drako/libxdiff + REF ${LIBXDIFF_REF} + SHA512 ${LIBXDIFF_SHA512} + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DBUILD_SHARED=${KEYSTONE_BUILD_SHARED} +) + +vcpkg_install_cmake() + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/xdiff.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/xdiff.dll") + endif() +endif() + + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/xdiff.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/xdiff.dll") + endif() +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/XDiff TARGET_PATH share/XDiff) diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL index ccf2a9c60feae2..3c19f8738019d4 100644 --- a/ports/libxml2/CONTROL +++ b/ports/libxml2/CONTROL @@ -1,5 +1,6 @@ Source: libxml2 -Version: 2.9.9-5 +Version: 2.9.9 +Port-Version: 8 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/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake index 50eca4d6163f44..94ef458031f311 100644 --- a/ports/libxml2/vcpkg-cmake-wrapper.cmake +++ b/ports/libxml2/vcpkg-cmake-wrapper.cmake @@ -2,24 +2,25 @@ _find_package(${ARGS}) if(LibXml2_FOUND) find_package(LibLZMA) find_package(ZLIB) - + include(SelectLibraryConfigurations) + find_library(ICONV_LIBRARY_DEBUG NAMES iconvd libiconvd iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH) + find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) + find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib) + find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) + find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) + find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib) + select_library_configurations(ICONV) + select_library_configurations(CHARSET) list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES}) - - if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - list(APPEND LIBXML2_LIBRARIES - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib - ws2_32) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND LIBXML2_LIBRARIES m) + else() + list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES}) if(TARGET LibXml2::LibXml2) - target_link_libraries(LibXml2::LibXml2 INTERFACE - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib) + target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES}) endif() - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND LIBXML2_LIBRARIES m) + endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + list(APPEND LIBXML2_LIBRARIES ws2_32) endif() endif() diff --git a/ports/libxmp-lite/CONTROL b/ports/libxmp-lite/CONTROL index 8ca5cbd41f33e5..fd791aa29012a7 100644 --- a/ports/libxmp-lite/CONTROL +++ b/ports/libxmp-lite/CONTROL @@ -1,4 +1,4 @@ Source: libxmp-lite -Version: 4.4.1-2 +Version: 4.4.1-6 Homepage: https://sourceforge.net/projects/xmp/ Description: Lightweight version of libxmp that supports MOD, S3M, XM and IT modules. diff --git a/ports/libxmp-lite/portfile.cmake b/ports/libxmp-lite/portfile.cmake index e77290095e6743..4f3ce633990655 100644 --- a/ports/libxmp-lite/portfile.cmake +++ b/ports/libxmp-lite/portfile.cmake @@ -1,21 +1,15 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "http://sourceforge.net/projects/xmp/files/libxmp/4.4.1/libxmp-lite-4.4.1.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO xmp/libxmp + REF 4.4.1 FILENAME "libxmp-lite-4.4.1.tar.gz" SHA512 f27e3f9fb79ff15ce90b51fb29641c01cadf7455150da57cde6860c2ba075ed497650eb44ec9143bdd3538288228c609f7db6d862c9d73f007f686eccb05543e -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} PATCHES 0001-msvc-buildfix.patch 0002-fix-symbols.patch ) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( diff --git a/ports/libxslt/CONTROL b/ports/libxslt/CONTROL index 1320ee2cdeefdd..38eea5f1a7f521 100644 --- a/ports/libxslt/CONTROL +++ b/ports/libxslt/CONTROL @@ -1,5 +1,5 @@ Source: libxslt -Version: 1.1.33-6 +Version: 1.1.33-7 Homepage: https://github.com/GNOME/libxslt Description: Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT Build-Depends: libxml2, liblzma diff --git a/ports/libxslt/portfile.cmake b/ports/libxslt/portfile.cmake index 5ab963bff92680..c3296f0fe681d0 100644 --- a/ports/libxslt/portfile.cmake +++ b/ports/libxslt/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GNOME/libxslt @@ -105,6 +103,7 @@ else() ) vcpkg_install_make() + #vcpkg_fixup_pkgconfig()? if (EXISTS ${CURRENT_PACKAGES_DIR}/bin/xslt-config) file(COPY ${CURRENT_PACKAGES_DIR}/bin/xslt-config DESTINATION ${CURRENT_PACKAGES_DIR}/tools) diff --git a/ports/libyaml/CONTROL b/ports/libyaml/CONTROL index 6dbff7ff3143b4..b5084150b0ef64 100644 --- a/ports/libyaml/CONTROL +++ b/ports/libyaml/CONTROL @@ -1,3 +1,3 @@ Source: libyaml -Version: 0.2.2-2 +Version: 0.2.2-3 Description: A C library for parsing and emitting YAML. diff --git a/ports/libyaml/portfile.cmake b/ports/libyaml/portfile.cmake index 3d7f12d7e56a8c..716f69181b1ce1 100644 --- a/ports/libyaml/portfile.cmake +++ b/ports/libyaml/portfile.cmake @@ -1,4 +1,6 @@ -include(vcpkg_common_functions) +if (WIN32) + set(PATCHES fix-POSIX_name.patch) +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -6,8 +8,7 @@ vcpkg_from_github( REF 0.2.2 SHA512 455494591014a97c4371a1f372ad09f0d6e487e4f1d3419c98e9cd2f16d43a0cf9a0787d7250bebee8b8d400df4626f5acd81e90139e54fa574a66ec84964c06 HEAD_REF master - PATCHES - fix-POSIX_name.patch + PATCHES ${PATCHES} ) vcpkg_configure_cmake( @@ -25,4 +26,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/yaml TARGET_PATH share/yaml) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/config.h ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/libyaml/copyright COPYONLY) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/libyuv/CONTROL b/ports/libyuv/CONTROL index 63dfda401331a3..bd998bd9521c00 100644 --- a/ports/libyuv/CONTROL +++ b/ports/libyuv/CONTROL @@ -1,4 +1,6 @@ Source: libyuv -Version: fec9121-1 +Version: fec9121 +Port-Version: 3 +Homepage: https://chromium.googlesource.com/libyuv/libyuv Build-Depends: libjpeg-turbo Description: libyuv is an open source project that includes YUV scaling and conversion functionality. diff --git a/ports/libyuv/fix-build-type.patch b/ports/libyuv/fix-build-type.patch index 984a1253f0b530..179a7f7ea0b174 100644 --- a/ports/libyuv/fix-build-type.patch +++ b/ports/libyuv/fix-build-type.patch @@ -1,53 +1,62 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 097434b..8f8864f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -28,21 +28,25 @@ LIST ( SORT ly_unittest_sources ) - INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) - - # this creates the static library (.a) -+if (NOT BUILD_SHARED_LIBS) - ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) - SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h ) -- -+else() - # this creates the shared library (.so) - ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) - SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) - SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) -- -+endif() - # this creates the conversion tool - ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) --TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) -- -+if (BUILD_SHARED_LIBS) -+ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} ) -+else() -+ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) -+endif() - - INCLUDE ( FindJPEG ) --if (JPEG_FOUND) -+if (JPEG_FOUND AND BUILD_SHARED_LIBS) - include_directories( ${JPEG_INCLUDE_DIR} ) - target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} ) - target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) -@@ -88,11 +92,13 @@ endif() - - - # install the conversion tool, .so, .a, and all the header files --INSTALL ( TARGETS yuvconvert DESTINATION bin ) -+INSTALL ( TARGETS yuvconvert DESTINATION tools ) - INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) --INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-export DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) --INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-export LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) -- -+if (NOT BUILD_SHARED_LIBS) -+ INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-export DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) -+else() -+ INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-export LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) -+endif() - INSTALL( EXPORT libyuv-export FILE libyuv-config.cmake DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) - - # create the .deb and .rpm packages using cpack +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 50442cd..fdc82f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,24 +28,32 @@ LIST ( SORT ly_unittest_sources ) + INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) + + # this creates the static library (.a) ++if (NOT BUILD_SHARED_LIBS) + ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) + SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h ) +- ++else() + # this creates the shared library (.so) + ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) + SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) + SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) +- ++endif() + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) +-TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) +- ++if (BUILD_SHARED_LIBS) ++ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} ) ++else() ++ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) ++endif() + + INCLUDE ( FindJPEG ) + if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} ) +- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) ++ include_directories( ${JPEG_INCLUDE_DIR}) ++ if( BUILD_SHARED_LIBS) ++ target_link_libraries(${ly_lib_shared} PUBLIC ${JPEG_LIBRARY}) ++ else() ++ target_link_libraries(${ly_lib_static} PUBLIC ${JPEG_LIBRARY}) ++ endif() ++ target_link_libraries(yuvconvert ${JPEG_LIBRARY}) + add_definitions( -DHAVE_JPEG ) + endif() + +@@ -88,11 +96,13 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( TARGETS yuvconvert DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert DESTINATION tools ) + INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) +-INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) +-INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) +- ++if (NOT BUILD_SHARED_LIBS) ++ INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) ++else() ++ INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++endif() + INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) + + # create the .deb and .rpm packages using cpack diff --git a/ports/libyuv/fix_cmakelists.patch b/ports/libyuv/fix_cmakelists.patch index bebfe7155c1b75..00cc50599a32ce 100644 --- a/ports/libyuv/fix_cmakelists.patch +++ b/ports/libyuv/fix_cmakelists.patch @@ -1,61 +1,61 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ed4948f0..9f48ebde 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,10 +2,14 @@ - # Originally created for "roxlu build system" to compile libyuv on windows - # Run with -DTEST=ON to build unit tests - --PROJECT ( YUV C CXX ) # "C" is required even for C++ projects - CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) -+CMAKE_POLICY( SET CMP0022 NEW ) -+ -+PROJECT ( YUV C CXX ) # "C" is required even for C++ projects - OPTION( TEST "Built unit tests" OFF ) - -+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON ) -+ - SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) - SET ( ly_src_dir ${ly_base_dir}/source ) - SET ( ly_inc_dir ${ly_base_dir}/include ) -@@ -14,6 +18,7 @@ SET ( ly_lib_name yuv ) - SET ( ly_lib_static ${ly_lib_name} ) - SET ( ly_lib_shared ${ly_lib_name}_shared ) - -+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h ) - FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) - LIST ( SORT ly_source_files ) - -@@ -24,6 +29,7 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) - - # this creates the static library (.a) - ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) -+SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h ) - - # this creates the shared library (.so) - ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) -@@ -38,6 +44,7 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) - INCLUDE ( FindJPEG ) - if (JPEG_FOUND) - include_directories( ${JPEG_INCLUDE_DIR} ) -+ target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} ) - target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) - add_definitions( -DHAVE_JPEG ) - endif() -@@ -81,10 +88,12 @@ endif() - - - # install the conversion tool, .so, .a, and all the header files --INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) --INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) --INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) --INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) -+INSTALL ( TARGETS yuvconvert DESTINATION bin ) -+INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) -+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-export DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) -+INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-export LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) -+ -+INSTALL( EXPORT libyuv-export FILE libyuv-config.cmake DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) - - # create the .deb and .rpm packages using cpack - INCLUDE ( CM_linux_packages.cmake ) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed4948f..5b4e112 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,10 +2,14 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + +-PROJECT ( YUV C CXX ) # "C" is required even for C++ projects + CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) ++CMAKE_POLICY( SET CMP0022 NEW ) ++ ++PROJECT ( YUV C CXX ) # "C" is required even for C++ projects + OPTION( TEST "Built unit tests" OFF ) + ++SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON ) ++ + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) + SET ( ly_src_dir ${ly_base_dir}/source ) + SET ( ly_inc_dir ${ly_base_dir}/include ) +@@ -14,6 +18,7 @@ SET ( ly_lib_name yuv ) + SET ( ly_lib_static ${ly_lib_name} ) + SET ( ly_lib_shared ${ly_lib_name}_shared ) + ++FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h ) + FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) + LIST ( SORT ly_source_files ) + +@@ -24,6 +29,7 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) + + # this creates the static library (.a) + ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h ) + + # this creates the shared library (.so) + ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +@@ -38,6 +44,7 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + INCLUDE ( FindJPEG ) + if (JPEG_FOUND) + include_directories( ${JPEG_INCLUDE_DIR} ) ++ target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} ) + target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) + add_definitions( -DHAVE_JPEG ) + endif() +@@ -81,10 +88,12 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) +-INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) ++INSTALL ( TARGETS yuvconvert DESTINATION bin ) ++INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) ++INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) ++INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++ ++INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) + + # create the .deb and .rpm packages using cpack + INCLUDE ( CM_linux_packages.cmake ) diff --git a/ports/libyuv/libyuv-config.cmake b/ports/libyuv/libyuv-config.cmake new file mode 100644 index 00000000000000..7031eddcaba301 --- /dev/null +++ b/ports/libyuv/libyuv-config.cmake @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) +find_dependency(JPEG) + +set(libyuv_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include") +include("${CMAKE_CURRENT_LIST_DIR}/libyuv-targets.cmake") diff --git a/ports/libyuv/portfile.cmake b/ports/libyuv/portfile.cmake index 1e955c18553644..590f72b95d3d3f 100644 --- a/ports/libyuv/portfile.cmake +++ b/ports/libyuv/portfile.cmake @@ -23,5 +23,10 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/libyuv) 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/libyuv RENAME copyright) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libyuv/convert.h "#ifdef HAVE_JPEG" "#if 1") +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libyuv/convert_argb.h "#ifdef HAVE_JPEG" "#if 1") + +configure_file(${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake ${CURRENT_PACKAGES_DIR}/share/libyuv COPYONLY) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libzen/CONTROL b/ports/libzen/CONTROL index aca3ff287daf83..7470be2bd22a5a 100644 --- a/ports/libzen/CONTROL +++ b/ports/libzen/CONTROL @@ -1,3 +1,3 @@ Source: libzen -Version: 0.4.37 +Version: 0.4.38 Description: ZenLib is a C++ utility library for easiest cross-platform development diff --git a/ports/libzen/portfile.cmake b/ports/libzen/portfile.cmake index 52ad55ef60a942..1a9bf9b2a45814 100644 --- a/ports/libzen/portfile.cmake +++ b/ports/libzen/portfile.cmake @@ -7,11 +7,9 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO MediaArea/ZenLib - REF v0.4.37 - SHA512 857091422d6425aeae59bf5a9dfedd72f5c9b4a18f29acf88842d812f2b470fc8b1b03a245af6b7d08d616dd5596a8905cc138daecee23dadea39ae4215f77d4 + REF v0.4.38 + SHA512 92c3fc3994bd7110021adbfa3ce48ed6e80f162946b912e9e06ed58edc224600e56e3aab3203ad3fa8759dab9790cb5536475f070f0c060b00585911a6cc0661 HEAD_REF master - - PATCHES vcpkg_support_in_cmakelists.patch ) vcpkg_configure_cmake( diff --git a/ports/libzen/vcpkg_support_in_cmakelists.patch b/ports/libzen/vcpkg_support_in_cmakelists.patch deleted file mode 100644 index fb2ce81f700a78..00000000000000 --- a/ports/libzen/vcpkg_support_in_cmakelists.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/Project/CMake/CMakeLists.txt b/Project/CMake/CMakeLists.txt -index cb96dc8..8b05a25 100644 ---- a/Project/CMake/CMakeLists.txt -+++ b/Project/CMake/CMakeLists.txt -@@ -33,10 +33,12 @@ set(BIN_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE STRING "Directory where - set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE STRING "Directory where library will install") - set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}" CACHE PATH "The directory the headers are installed in") - --if(NOT MSVC) -- set(ZenLib_CONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/zenlib") -+if(VCPKG_TARGET_TRIPLET) -+ set(ZenLib_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/zenlib") -+elseif(MSVC) -+ set(ZenLib_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake") - else() -- set(ZenLib_CONFIG_INSTALL_DIR "cmake") -+ set(ZenLib_CONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/zenlib") - endif() - - set(ZenLib_HDRS -@@ -136,10 +138,6 @@ set_target_properties(zen PROPERTIES - PUBLIC_HEADER "${ZenLib_HDRS}" - ) - --if(MSVC) -- install(FILES $ DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS "Debug;RelWithDebInfo" OPTIONAL) --endif() -- - install(TARGETS zen EXPORT zen-export - PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/ZenLib - RUNTIME DESTINATION ${BIN_INSTALL_DIR} diff --git a/ports/libzip/CONTROL b/ports/libzip/CONTROL index a01feac85ee5a6..8a3d1513724495 100644 --- a/ports/libzip/CONTROL +++ b/ports/libzip/CONTROL @@ -1,14 +1,33 @@ Source: libzip -Version: rel-1-5-2--1 +Version: 1.7.1 +Port-Version: 1 Homepage: https://github.com/nih-at/libzip Build-Depends: zlib -Default-Features: openssl, bzip2 -Description: A library for reading, creating, and modifying zip archives. +Default-Features: bzip2,default-aes +Description: A library for reading, creating, and modifying zip archives Feature: bzip2 Build-Depends: bzip2 Description: Support bzip2-compressed zip archives +Feature: liblzma +Build-Depends: liblzma +Description: Support XZ compressed zip archives using liblzma + +Feature: default-aes +Build-Depends: libzip[core,openssl](!(windows|osx)),libzip[core,wincrypto](windows),libzip[core,commoncrypto](osx) +Description: Use default AES + Feature: openssl Build-Depends: openssl Description: AES (encryption) support using OpenSSL + +Feature: wincrypto +Description: AES (encryption) support using Windows Crypto API + +Feature: commoncrypto +Description: AES( encryption) support using Apple's Common Crypto API + +Feature: mbedtls +Build-Depends: mbedtls +Description: AES (encryption) support using mbedtls \ No newline at end of file diff --git a/ports/libzip/avoid_computation_on_void_pointer.patch b/ports/libzip/avoid_computation_on_void_pointer.patch deleted file mode 100644 index a655063f4520c8..00000000000000 --- a/ports/libzip/avoid_computation_on_void_pointer.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/zip_source_winzip_aes_encode.c b/lib/zip_source_winzip_aes_encode.c -index c428c9a..4e5f753 100644 ---- a/lib/zip_source_winzip_aes_encode.c -+++ b/lib/zip_source_winzip_aes_encode.c -@@ -163,7 +163,7 @@ winzip_aes_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, - /* TODO: return partial read? */ - return -1; - } -- buffer_n += _zip_buffer_read(ctx->buffer, data + ret, length - (zip_uint64_t)ret); -+ buffer_n += _zip_buffer_read(ctx->buffer, (zip_uint8_t *)data + ret, length - (zip_uint64_t)ret); - } - - return (zip_int64_t)(buffer_n + (zip_uint64_t)ret); 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 7478937f403f6e..131c3ccfcaf006 100644 --- a/ports/libzip/portfile.cmake +++ b/ports/libzip/portfile.cmake @@ -1,39 +1,40 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nih-at/libzip - REF rel-1-5-2 - SHA512 5ba765c5d4ab47dff24bfa5e73b798046126fcc88b29d5d9ce9d77d035499ae91d90cc526f1f73bbefa07b7b68ff6cf77e912e5793859f801caaf2061cb20aee + REF dcd9a0bfe1ac2893d7f62bafb19f0a4d7b08c0f7 #v1.7.1 + SHA512 33ad594398f79544636464d6ae0892553a212dc833b508820f81f10823c3a5c4016288d05953176fb8d52919414edd28f26da6037b93129a58826abdcb501d18 HEAD_REF master - PATCHES avoid_computation_on_void_pointer.patch + PATCHES fix-findpackage.patch ) -# AES encryption -set(USE_OPENSSL OFF) -if("openssl" IN_LIST FEATURES) - set(USE_OPENSSL ON) -endif() - -set(USE_BZIP2 OFF) -if("bzip2" IN_LIST FEATURES) - set(USE_BZIP2 ON) -endif() +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + bzip2 ENABLE_BZIP2 + liblzma ENABLE_LZMA + openssl ENABLE_OPENSSL + wincrypto ENABLE_WINDOWS_CRYPTO + commoncrypto ENABLE_COMMONCRYPTO + mbedtls ENABLE_MBEDTLS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DBUILD_DOC=OFF -DBUILD_EXAMPLES=OFF -DBUILD_REGRESS=OFF -DBUILD_TOOLS=OFF - # see https://github.com/nih-at/libzip/blob/rel-1-5-2/INSTALL.md - -DENABLE_OPENSSL=${USE_OPENSSL} - -DENABLE_BZIP2=${USE_BZIP2} + -DENABLE_GNUTLS=OFF ) vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libzip) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + # Remove include directories from lib file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/libzip ${CURRENT_PACKAGES_DIR}/debug/lib/libzip) diff --git a/ports/libzippp/CONTROL b/ports/libzippp/CONTROL index f2a6b24d6f9ab9..7b1c6c6444f7e9 100644 --- a/ports/libzippp/CONTROL +++ b/ports/libzippp/CONTROL @@ -1,4 +1,5 @@ Source: libzippp -Version: 2019-07-22 +Version: 3.1-1.6.1 +Homepage: https://github.com/ctabin/libzippp Description: Simple basic C++ wrapper around the libzip library. It is meant to be a portable and easy-to-use library for ZIP handling Build-Depends: zlib, libzip[bzip2] diff --git a/ports/libzippp/portfile.cmake b/ports/libzippp/portfile.cmake index 3c3a22ffacdd41..4c480b090e196f 100644 --- a/ports/libzippp/portfile.cmake +++ b/ports/libzippp/portfile.cmake @@ -1,25 +1,28 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ctabin/libzippp - REF be75a3413b648a3264e94a2c1921c83081dec1e0 - SHA512 86c6040bbaea0817486218e96c4d230a328e3560ada41861fbd18d78faa085b158199318d633085e616509084082bf29d6f97afdd2d2dfbc6b843dfbf6a20c85 - HEAD_REF master + REF fb07ca80ebda0576366619b87364b4b3a94426df + SHA512 c75518d0dba43ca5ae617569c0e3105af4f903a1226bdae100ee0770b4745ce4c889d29788bd2d75e7c8b556a5c339c0610170a620081d67a86cf6639e9e7fb2 + HEAD_REF libzippp-v3.1-1.6.1 ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DBUILD_TESTS=OFF + -DLIBZIPPP_BUILD_TESTS=OFF OPTIONS_DEBUG - -DINSTALL_HEADERS=OFF + -DLIBZIPPP_INSTALL_HEADERS=OFF ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH "share/libzippp") +if(WIN32) + vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake/libzippp") +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH "share/libzippp") +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/licensepp/CONTROL b/ports/licensepp/CONTROL new file mode 100644 index 00000000000000..c21d13b4adda6c --- /dev/null +++ b/ports/licensepp/CONTROL @@ -0,0 +1,6 @@ +Source: licensepp +Version: 2020-05-19 +Description: Cross platform software licensing library +Build-Depends: cryptopp[pem-pack] +Supports: !uwp +Homepage: https://github.com/zuhd-org/licensepp diff --git a/ports/licensepp/FindCryptoPP.cmake b/ports/licensepp/FindCryptoPP.cmake new file mode 100644 index 00000000000000..c7e0f709c098b6 --- /dev/null +++ b/ports/licensepp/FindCryptoPP.cmake @@ -0,0 +1,27 @@ +find_path(CRYPTOPP_INCLUDE_DIRS NAMES cryptopp/cryptlib.h) + +get_filename_component(_prefix_path ${CRYPTOPP_INCLUDE_DIRS} PATH) + +find_library( + CRYPTOPP_LIBRARY_DEBUG + NAMES cryptopp-static cryptopp + PATHS ${_prefix_path}/debug/lib + NO_DEFAULT_PATH +) +find_library( + CRYPTOPP_LIBRARY_RELEASE + NAMES cryptopp-static cryptopp + PATHS ${_prefix_path}/lib + NO_DEFAULT_PATH +) + +unset(_prefix_path) + +include(SelectLibraryConfigurations) +select_library_configurations(CRYPTOPP) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + CryptoPP + REQUIRED_VARS CRYPTOPP_LIBRARIES CRYPTOPP_INCLUDE_DIRS +) diff --git a/ports/licensepp/fix-cmake.patch b/ports/licensepp/fix-cmake.patch new file mode 100644 index 00000000000000..f421b6d922bb6a --- /dev/null +++ b/ports/licensepp/fix-cmake.patch @@ -0,0 +1,25 @@ +diff --git "a/CMakeLists.txt" "b/CMakeLists.txt" +index b2c39d1..24a6866 100644 +--- "a/CMakeLists.txt" ++++ "b/CMakeLists.txt" +@@ -35,10 +35,8 @@ if (APPLE) + endif() + endif() + +-if(MSVC) +- list (APPEND CMAKE_CXX_FLAGS " -std=c++11 -O3 ") +-else() +- list (APPEND CMAKE_CXX_FLAGS " -std=c++11 -O3 -Wall -Werror ") ++if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -Werror") + endif() + + # Check for cryptopp (static) +@@ -73,6 +71,7 @@ endif() + set_target_properties (licensepp-lib PROPERTIES + VERSION ${LICENSEPP_SOVERSION} + ) ++target_include_directories (licensepp-lib PUBLIC $) + target_link_libraries (licensepp-lib + ${CRYPTOPP_LIBRARIES} + ) diff --git a/ports/licensepp/portfile.cmake b/ports/licensepp/portfile.cmake new file mode 100644 index 00000000000000..171b26fcc3f587 --- /dev/null +++ b/ports/licensepp/portfile.cmake @@ -0,0 +1,39 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO amrayn/licensepp + REF 0b6d669c0b323be004f73d8c811d38158ce8c0c7 + SHA512 2161575815d8ff49110d7c2823662ba30d9f1ca2eb6be6dad1ee0807fb3fa9f28483839a133c9d380035254df7c452f8d6fa7f17fd4f29acd8b9bfbbda059291 + HEAD_REF master + PATCHES + # TODO: + # In this commit, https://github.com/noloader/cryptopp-pem/commit/0cfa60820ec1d5e8ac4d77a0a8786ee43e9a2400 + # the parameter orders have been changed. + # But we can not update pem-pack to this version or newer because it + # won't compile with the current version of cryptopp in `vcpkg`. + # Remove this patch in the future. + use-old-pem-pack.patch + # TODO: Remove this patch if https://github.com/amrayn/licensepp/pull/33 was merged. + fix-cmake.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCryptoPP.cmake DESTINATION ${SOURCE_PATH}/cmake) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -Dtest=OFF + -Dtravis=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT}/cmake) + +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/licensepp/use-old-pem-pack.patch b/ports/licensepp/use-old-pem-pack.patch new file mode 100644 index 00000000000000..d7c05edaeb9d94 --- /dev/null +++ b/ports/licensepp/use-old-pem-pack.patch @@ -0,0 +1,13 @@ +diff --git a/src/external/Ripe.cc b/src/external/Ripe.cc +index 6ff9561..a1d1eec 100644 +--- a/src/external/Ripe.cc ++++ b/src/external/Ripe.cc +@@ -227,7 +227,7 @@ Ripe::KeyPair Ripe::generateRSAKeyPair(unsigned int length, const std::string& s + if (secret.empty()) { + PEM_Save(snk, privateKey); + } else { +- PEM_Save(snk, privateKey, rng, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size()); ++ PEM_Save(snk, rng, privateKey, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size()); + } + snk.MessageEnd(); + } diff --git a/ports/llvm/0001-allow-to-use-commas.patch b/ports/llvm/0001-allow-to-use-commas.patch new file mode 100644 index 00000000000000..8276efa53476d8 --- /dev/null +++ b/ports/llvm/0001-allow-to-use-commas.patch @@ -0,0 +1,30 @@ +diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt +index a02c2a5a23f..bdbf0b1303c 100644 +--- a/llvm/CMakeLists.txt ++++ b/llvm/CMakeLists.txt +@@ -70,6 +70,12 @@ if( LLVM_ENABLE_PROJECTS STREQUAL "all" ) + set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS}) + endif() + ++# Allow to use commas in LLVM_ENABLE_PROJECTS ("llvm,clang,...") ++string(REPLACE "," ";" fixed_LLVM_ENABLE_PROJECTS "${LLVM_ENABLE_PROJECTS}") ++if(NOT fixed_LLVM_ENABLE_PROJECTS STREQUAL LLVM_ENABLE_PROJECTS) ++ set(LLVM_ENABLE_PROJECTS "${fixed_LLVM_ENABLE_PROJECTS}" CACHE STRING "" FORCE) ++endif() ++ + # LLVM_ENABLE_PROJECTS_USED is `ON` if the user has ever used the + # `LLVM_ENABLE_PROJECTS` CMake cache variable. This exists for + # several reasons: +@@ -383,6 +389,12 @@ set(LLVM_TARGETS_TO_BUILD + ${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}) + list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD) + ++# Allow to use commas in the LLVM_TARGETS_TO_BUILD ("X86,AArch64,...") ++string(REPLACE "," ";" fixed_LLVM_TARGETS_TO_BUILD "${LLVM_TARGETS_TO_BUILD}") ++if(NOT fixed_LLVM_TARGETS_TO_BUILD STREQUAL LLVM_TARGETS_TO_BUILD) ++ set(LLVM_TARGETS_TO_BUILD "${fixed_LLVM_TARGETS_TO_BUILD}" CACHE STRING "" FORCE) ++endif() ++ + option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON) + option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) + option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF) diff --git a/ports/llvm/0002-fix-install-paths.patch b/ports/llvm/0002-fix-install-paths.patch new file mode 100644 index 00000000000000..5e63424a44d8de --- /dev/null +++ b/ports/llvm/0002-fix-install-paths.patch @@ -0,0 +1,42 @@ +diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt +index d233f552f01..26f502ad2d2 100644 +--- a/clang/cmake/modules/CMakeLists.txt ++++ b/clang/cmake/modules/CMakeLists.txt +@@ -1,11 +1,11 @@ + # Generate a list of CMake library targets so that other CMake projects can + # link against them. LLVM calls its version of this file LLVMExports.cmake, but + # the usual CMake convention seems to be ${Project}Targets.cmake. +-set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang) ++set(CLANG_INSTALL_PACKAGE_DIR share/clang) + set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}") + + # Keep this in sync with llvm/cmake/CMakeLists.txt! +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR share/llvm) + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) +diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt +index 9cf22b436fa..8eeb27d1794 100644 +--- a/llvm/cmake/modules/CMakeLists.txt ++++ b/llvm/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR share/llvm) + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt +index 211f9551271..2abe3803f91 100644 +--- a/polly/cmake/CMakeLists.txt ++++ b/polly/cmake/CMakeLists.txt +@@ -1,7 +1,7 @@ + # Keep this in sync with llvm/cmake/CMakeLists.txt! + +-set(LLVM_INSTALL_PACKAGE_DIR "lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") +-set(POLLY_INSTALL_PACKAGE_DIR "lib${LLVM_LIBDIR_SUFFIX}/cmake/polly") ++set(LLVM_INSTALL_PACKAGE_DIR share/llvm) ++set(POLLY_INSTALL_PACKAGE_DIR share/polly) + if (CMAKE_CONFIGURATION_TYPES) + set(POLLY_EXPORTS_FILE_NAME "PollyExports-$>.cmake") + else() diff --git a/ports/llvm/0003-fix-vs2019-v16.6.patch b/ports/llvm/0003-fix-vs2019-v16.6.patch new file mode 100644 index 00000000000000..0c89eb5c21484e --- /dev/null +++ b/ports/llvm/0003-fix-vs2019-v16.6.patch @@ -0,0 +1,15 @@ +diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h +index bbd0d04ed..f2b41422f 100644 +--- a/llvm/include/llvm/Support/ManagedStatic.h ++++ b/llvm/include/llvm/Support/ManagedStatic.h +@@ -40,8 +40,8 @@ template struct object_deleter { + // constexpr, a dynamic initializer may be emitted depending on optimization + // settings. For the affected versions of MSVC, use the old linker + // initialization pattern of not providing a constructor and leaving the fields +-// uninitialized. +-#if !defined(_MSC_VER) || defined(__clang__) ++// uninitialized. See http://llvm.org/PR41367 for details. ++#if !defined(_MSC_VER) || (_MSC_VER >= 1925) || defined(__clang__) + #define LLVM_USE_CONSTEXPR_CTOR + #endif + diff --git a/ports/llvm/CONTROL b/ports/llvm/CONTROL index 64b4aebd4968a3..3c25713791f621 100644 --- a/ports/llvm/CONTROL +++ b/ports/llvm/CONTROL @@ -1,19 +1,102 @@ Source: llvm -Version: 8.0.0-5 +Version: 10.0.0-4 Homepage: https://llvm.org/ Description: The LLVM Compiler Infrastructure -Build-Depends: atlmfc (windows) Supports: !uwp -Default-Features: utils +Default-Features: tools, enable-rtti, disable-assertions, disable-abi-breaking-checks, clang, disable-clang-static-analyzer, lld Feature: tools -Description: Generate build targets for the LLVM tools. +Description: Build LLVM tools. Feature: utils -Description: Generate build targets for the LLVM utils. +Description: Build LLVM utils. -Feature: example -Description: Generate build targets for the LLVM examples +Feature: target-all +Description: Build with all backends. -Feature: test -Description: Generate build targets for the LLVM unit tests. +Feature: target-aarch64 +Description: Build with AArch64 backend. + +Feature: target-amdgpu +Description: Build with AMDGPU backend. + +Feature: target-arm +Description: Build with ARM backend. + +Feature: target-bpf +Description: Build with BPF backend. + +Feature: target-hexagon +Description: Build with Hexagon backend. + +Feature: target-lanai +Description: Build with Lanai backend. + +Feature: target-mips +Description: Build with Mips backend. + +Feature: target-msp430 +Description: Build with MSP430 backend. + +Feature: target-nvptx +Description: Build with NVPTX backend. + +Feature: target-powerpc +Description: Build with PowerPC backend. + +Feature: target-riscv +Description: Build with RISCV backend. + +Feature: target-sparc +Description: Build with Sparc backend. + +Feature: target-systemz +Description: Build with SystemZ backend. + +Feature: target-webassembly +Description: Build with WebAssembly backend. + +Feature: target-x86 +Description: Build with X86 backend. + +Feature: target-xcore +Description: Build with XCore backend. + +Feature: enable-rtti +Description: Build LLVM with run-time type information. + +Feature: enable-assertions +Description: Build LLVM with assertions. + +Feature: disable-assertions +Description: Build LLVM without assertions. + +Feature: enable-abi-breaking-checks +Description: Build LLVM with LLVM_ABI_BREAKING_CHECKS=FORCE_ON. + +Feature: disable-abi-breaking-checks +Description: Build LLVM with LLVM_ABI_BREAKING_CHECKS=FORCE_OFF. + +Feature: clang +Description: Build C Language Family Front-end. + +Feature: disable-clang-static-analyzer +Description: Build without static analyzer. + +Feature: clang-tools-extra +Description: Build Clang tools. + +Feature: compiler-rt +Description: Build compiler's runtime libraries. + +Feature: lld +Description: Build LLVM linker. + +Feature: openmp +Description: Build LLVM OpenMP libraries. + +Feature: lldb +Description: Build LLDB debugger. + +Feature: polly +Description: Build polyhedral optimizations for LLVM. diff --git a/ports/llvm/fix-build-error.patch b/ports/llvm/fix-build-error.patch deleted file mode 100644 index f48df44ac1f4db..00000000000000 --- a/ports/llvm/fix-build-error.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -56,10 +56,7 @@ if (TARGET clangTidyPlugin) - endif() - endif () - --find_library(DL_LIBRARY_PATH dl) --if (DL_LIBRARY_PATH) -- list(APPEND LIBS dl) --endif() -+list(APPEND LIBS "${DL_LIBRARY_PATH}") - - option(LIBCLANG_BUILD_STATIC - "Build libclang as a static library (in addition to a shared one)" OFF) diff --git a/ports/llvm/fix-linux-build.patch b/ports/llvm/fix-linux-build.patch deleted file mode 100644 index 780ea6535d9b28..00000000000000 --- a/ports/llvm/fix-linux-build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake -index 900c35e..78fd3cd 100644 ---- a/cmake/config-ix.cmake -+++ b/cmake/config-ix.cmake -@@ -154,7 +154,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - else() - include_directories(${LIBXML2_INCLUDE_DIR}) - endif() -- set(LIBXML2_LIBS "xml2") -+ set(LIBXML2_LIBS ${LIBXML2_LIBRARIES}) - endif() - endif() - endif() diff --git a/ports/llvm/install-clang-modules-to-share.patch b/ports/llvm/install-clang-modules-to-share.patch deleted file mode 100644 index fa5eed84bb9455..00000000000000 --- a/ports/llvm/install-clang-modules-to-share.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index be6d1d72..4749f64b 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -1,11 +1,11 @@ - # Generate a list of CMake library targets so that other CMake projects can - # link against them. LLVM calls its version of this file LLVMExports.cmake, but - # the usual CMake convention seems to be ${Project}Targets.cmake. --set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang) -+set(CLANG_INSTALL_PACKAGE_DIR share/clang) - set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}") - - # Keep this in sync with llvm/cmake/CMakeLists.txt! --set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) -+set(LLVM_INSTALL_PACKAGE_DIR share/llvm) - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") - - get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) diff --git a/ports/llvm/install-llvm-modules-to-share.patch b/ports/llvm/install-llvm-modules-to-share.patch deleted file mode 100644 index 802cf183e1be04..00000000000000 --- a/ports/llvm/install-llvm-modules-to-share.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index f5cc0006..1d9c52ac 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -1,4 +1,4 @@ --set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) -+set(LLVM_INSTALL_PACKAGE_DIR share/llvm) - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") - - # First for users who use an installed LLVM, create the LLVMExports.cmake file. diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake index 85ffb48e428ec7..9351047e65799b 100644 --- a/ports/llvm/portfile.cmake +++ b/ports/llvm/portfile.cmake @@ -1,139 +1,261 @@ -include(vcpkg_common_functions) +set(VERSION "10.0.0") -# LLVM documentation recommends always using static library linkage when -# building with Microsoft toolchain; it's also the default on other platforms vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "llvm cannot currently be built for UWP") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "http://releases.llvm.org/8.0.0/llvm-8.0.0.src.tar.xz" - FILENAME "llvm-8.0.0.src.tar.xz" - SHA512 1602343b451b964f5d8c2d6b0654d89384c80d45883498c5f0e2f4196168dd4a1ed2a4dadb752076020243df42ffe46cb31d82ffc145d8e5874163cbb9686a1f -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO llvm/llvm-project + REF llvmorg-10.0.0 + SHA512 baa182d62fef1851836013ae8a1a00861ea89769778d67fb97b407a9de664e6c85da2af9c5b3f75d2bf34ff6b00004e531ca7e4b3115a26c0e61c575cf2303a0 + HEAD_REF master PATCHES - install-llvm-modules-to-share.patch - fix-linux-build.patch + 0001-allow-to-use-commas.patch + 0002-fix-install-paths.patch + 0003-fix-vs2019-v16.6.patch ) -vcpkg_download_distfile(CLANG_ARCHIVE - URLS "http://releases.llvm.org/8.0.0/cfe-8.0.0.src.tar.xz" - FILENAME "cfe-8.0.0.src.tar.xz" - SHA512 98e540222719716985e5d8439116e47469cb01201ea91d1da7e46cb6633da099688d9352c3b65e5c5f660cbbae353b3d79bb803fc66b3be663f2b04b1feed1c3 +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tools LLVM_BUILD_TOOLS + tools LLVM_INCLUDE_TOOLS + utils LLVM_BUILD_UTILS + utils LLVM_INCLUDE_UTILS + enable-rtti LLVM_ENABLE_RTTI ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH CLANG_SOURCE_PATH - ARCHIVE ${CLANG_ARCHIVE} - PATCHES - fix-build-error.patch - install-clang-modules-to-share.patch -) +# By default assertions are enabled for Debug configuration only. +if("enable-assertions" IN_LIST FEATURES) + # Force enable assertions for all configurations. + list(APPEND FEATURE_OPTIONS + -DLLVM_ENABLE_ASSERTIONS=ON + ) +elseif("disable-assertions" IN_LIST FEATURES) + # Force disable assertions for all configurations. + list(APPEND FEATURE_OPTIONS + -DLLVM_ENABLE_ASSERTIONS=OFF + ) +endif() -if(NOT EXISTS ${SOURCE_PATH}/tools/clang) - file(RENAME ${CLANG_SOURCE_PATH} ${SOURCE_PATH}/tools/clang) +# LLVM_ABI_BREAKING_CHECKS can be WITH_ASSERTS (default), FORCE_ON or FORCE_OFF. +# By default abi-breaking checks are enabled if assertions are enabled. +if("enable-abi-breaking-checks" IN_LIST FEATURES) + # Force enable abi-breaking checks. + list(APPEND FEATURE_OPTIONS + -DLLVM_ABI_BREAKING_CHECKS=FORCE_ON + ) +elseif("disable-abi-breaking-checks" IN_LIST FEATURES) + # Force disable abi-breaking checks. + list(APPEND FEATURE_OPTIONS + -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF + ) endif() -vcpkg_find_acquire_program(PYTHON3) -get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PYTHON3_DIR}") +set(LLVM_ENABLE_PROJECTS) +if("clang" IN_LIST FEATURES OR "clang-tools-extra" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "clang") + if("disable-clang-static-analyzer" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS + # Disable ARCMT + -DCLANG_ENABLE_ARCMT=OFF + # Disable static analyzer + -DCLANG_ENABLE_STATIC_ANALYZER=OFF + ) + endif() + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND FEATURE_OPTIONS + # Disable dl library on Windows + -DDL_LIBRARY_PATH:FILEPATH= + ) + endif() +endif() +if("clang-tools-extra" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "clang-tools-extra") +endif() +if("compiler-rt" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "compiler-rt") +endif() +if("lld" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "lld") +endif() +if("openmp" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "openmp") + # Perl is required for the OpenMP run-time + vcpkg_find_acquire_program(PERL) + list(APPEND FEATURE_OPTIONS + -DPERL_EXECUTABLE=${PERL} + ) +endif() +if("lldb" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "lldb") +endif() +if("polly" IN_LIST FEATURES) + list(APPEND LLVM_ENABLE_PROJECTS "polly") +endif() -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - tools LLVM_INCLUDE_TOOLS - utils LLVM_INCLUDE_UTILS - example LLVM_INCLUDE_EXAMPLES - test LLVM_INCLUDE_TESTS -) +set(LLVM_TARGETS_TO_BUILD) +if("target-all" IN_LIST FEATURES) + set(LLVM_TARGETS_TO_BUILD "all") +else() + if("target-aarch64" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "AArch64") + endif() + if("target-amdgpu" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "AMDGPU") + endif() + if("target-arm" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "ARM") + endif() + if("target-bpf" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "BPF") + endif() + if("target-hexagon" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "Hexagon") + endif() + if("target-lanai" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "Lanai") + endif() + if("target-mips" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "Mips") + endif() + if("target-msp430" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "MSP430") + endif() + if("target-nvptx" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "NVPTX") + endif() + if("target-powerpc" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "PowerPC") + endif() + if("target-riscv" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "RISCV") + endif() + if("target-sparc" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "Sparc") + endif() + if("target-systemz" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "SystemZ") + endif() + if("target-webassembly" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "WebAssembly") + endif() + if("target-x86" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "X86") + endif() + if("target-xcore" IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "XCore") + endif() +endif() + +# Detect target to build if not specified +if("${LLVM_TARGETS_TO_BUILD}" STREQUAL "") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(LLVM_TARGETS_TO_BUILD "X86") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(LLVM_TARGETS_TO_BUILD "ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(LLVM_TARGETS_TO_BUILD "AArch64") + else() + set(LLVM_TARGETS_TO_BUILD "all") + endif() +endif() + +# Use comma-separated string instead of semicolon-separated string. +# See https://github.com/microsoft/vcpkg/issues/4320 +string(REPLACE ";" "," LLVM_ENABLE_PROJECTS "${LLVM_ENABLE_PROJECTS}") +string(REPLACE ";" "," LLVM_TARGETS_TO_BUILD "${LLVM_TARGETS_TO_BUILD}") + +vcpkg_find_acquire_program(PYTHON3) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH}/llvm PREFER_NINJA - OPTIONS ${FEATURE_OPTIONS} - -DLLVM_TARGETS_TO_BUILD=X86 - -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF - -DLLVM_TOOLS_INSTALL_DIR=tools/llvm + OPTIONS + ${FEATURE_OPTIONS} + -DLLVM_INCLUDE_EXAMPLES=OFF + -DLLVM_BUILD_EXAMPLES=OFF + -DLLVM_INCLUDE_TESTS=OFF + -DLLVM_BUILD_TESTS=OFF + # Disable optional dependencies to libxml2 and zlib + -DLLVM_ENABLE_LIBXML2=OFF + -DLLVM_ENABLE_ZLIB=OFF + # Force TableGen to be built with optimization. This will significantly improve build time. + -DLLVM_OPTIMIZED_TABLEGEN=ON + # LLVM generates CMake error due to Visual Studio version 16.4 is known to miscompile part of LLVM. + # LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON disables this error. + # See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON + -DLLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS} + -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD} + -DPACKAGE_VERSION=${VERSION} + -DPYTHON_EXECUTABLE=${PYTHON3} + # Limit the maximum number of concurrent link jobs to 1. This should fix low amount of memory issue for link. -DLLVM_PARALLEL_LINK_JOBS=1 + # Disable build LLVM-C.dll (Windows only) due to doesn't compile with CMAKE_DEBUG_POSTFIX + -DLLVM_BUILD_LLVM_C_DYLIB=OFF + -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() - -if((NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") AND "tools" IN_LIST FEATURES) - file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*) - file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/llvm) - file(REMOVE ${EXE}) -endif() - -if((NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") AND "tools" IN_LIST FEATURES) - file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*) - file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/llvm) - file(REMOVE ${DEBUG_EXE}) -endif() - -if ("tools" IN_LIST FEATURES) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT}) +if("clang" IN_LIST FEATURES) vcpkg_fixup_cmake_targets(CONFIG_PATH share/clang TARGET_PATH share/clang) - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/clang/ClangTargets-release.cmake RELEASE_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/tools/llvm" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/clang/ClangTargets-release.cmake "${RELEASE_MODULE}") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/share/clang/ClangTargets-debug.cmake DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/debug/bin" "\${_IMPORT_PREFIX}/tools/llvm" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/clang/ClangTargets-debug.cmake "${DEBUG_MODULE}") - endif() endif() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/llvm) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/llvm) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMExports-release.cmake RELEASE_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/tools/llvm" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMExports-release.cmake "${RELEASE_MODULE}") + file(GLOB_RECURSE _llvm_release_targets + "${CURRENT_PACKAGES_DIR}/share/llvm/*-release.cmake" + ) + set(_clang_release_targets) + if("clang" IN_LIST FEATURES) + file(GLOB_RECURSE _clang_release_targets + "${CURRENT_PACKAGES_DIR}/share/clang/*-release.cmake" + ) + endif() + foreach(_target IN LISTS _llvm_release_targets _clang_release_targets) + file(READ ${_target} _contents) + # LLVM tools should be located in the bin folder because llvm-config expects to be inside a bin dir. + # Rename `/tools/${PORT}` to `/bin` back because there is no way to avoid this in vcpkg_fixup_cmake_targets. + string(REPLACE "{_IMPORT_PREFIX}/tools/${PORT}" "{_IMPORT_PREFIX}/bin" _contents "${_contents}") + file(WRITE ${_target} "${_contents}") + endforeach() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMExports-debug.cmake DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/debug/bin" "\${_IMPORT_PREFIX}/tools/llvm" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMExports-debug.cmake "${DEBUG_MODULE}") -endif() - -if (EXISTS ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMConfig.cmake) - file(READ ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMConfig.cmake LLVM_TOOLS_MODULE) - string(REPLACE "\${LLVM_INSTALL_PREFIX}/bin" "\${LLVM_INSTALL_PREFIX}/tools/llvm" LLVM_TOOLS_MODULE "${LLVM_TOOLS_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/llvm/LLVMConfig.cmake "${LLVM_TOOLS_MODULE}") -endif() + file(GLOB_RECURSE _llvm_debug_targets + "${CURRENT_PACKAGES_DIR}/share/llvm/*-debug.cmake" + ) + set(_clang_debug_targets) + if("clang" IN_LIST FEATURES) + file(GLOB_RECURSE _clang_debug_targets + "${CURRENT_PACKAGES_DIR}/share/clang/*-debug.cmake" + ) + endif() + foreach(_target IN LISTS _llvm_debug_targets _clang_debug_targets) + file(READ ${_target} _contents) + # LLVM tools should be located in the bin folder because llvm-config expects to be inside a bin dir. + # Rename `/tools/${PORT}` to `/bin` back because there is no way to avoid this in vcpkg_fixup_cmake_targets. + string(REPLACE "{_IMPORT_PREFIX}/tools/${PORT}" "{_IMPORT_PREFIX}/bin" _contents "${_contents}") + # Debug shared libraries should have `d` suffix and should be installed in the `/bin` directory. + # Rename `/debug/bin/` to `/bin` + string(REPLACE "{_IMPORT_PREFIX}/debug/bin/" "{_IMPORT_PREFIX}/bin/" _contents "${_contents}") + file(WRITE ${_target} "${_contents}") + endforeach() -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/tools - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/debug/bin - ${CURRENT_PACKAGES_DIR}/debug/msbuild-bin - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/msbuild-bin - ${CURRENT_PACKAGES_DIR}/tools/msbuild-bin - ${CURRENT_PACKAGES_DIR}/include/llvm/BinaryFormat/WasmRelocs -) + # Install debug shared libraries in the `/bin` directory + file(GLOB _debug_shared_libs ${CURRENT_PACKAGES_DIR}/debug/bin/*${CMAKE_SHARED_LIBRARY_SUFFIX}) + file(INSTALL ${_debug_shared_libs} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -# Remove two empty include subdirectorys if they are indeed empty -file(GLOB MCANALYSISFILES ${CURRENT_PACKAGES_DIR}/include/llvm/MC/MCAnalysis/*) -if(NOT MCANALYSISFILES) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/llvm/MC/MCAnalysis) + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ) endif() -file(GLOB MACHOFILES ${CURRENT_PACKAGES_DIR}/include/llvm/TextAPI/MachO/*) -if(NOT MACHOFILES) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/llvm/TextAPI/MachO) +# Handle copyright +file(INSTALL ${SOURCE_PATH}/llvm/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +if("clang" IN_LIST FEATURES) + file(INSTALL ${SOURCE_PATH}/clang/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/clang RENAME copyright) endif() -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +# Don't fail if the bin folder exists. +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) 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/log4cxx/001_msvc.patch b/ports/log4cxx/001_msvc.patch new file mode 100644 index 00000000000000..be8742c9b2d97d --- /dev/null +++ b/ports/log4cxx/001_msvc.patch @@ -0,0 +1,337 @@ +diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp +index e76ea29c..edcc05f5 100644 +--- a/src/main/cpp/locationinfo.cpp ++++ b/src/main/cpp/locationinfo.cpp +@@ -148,7 +148,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const { + if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) { + os.writeNull(p); + } else { +- char prolog[] = { ++ uint8_t prolog[] = { + 0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E, + 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C, + 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, +@@ -161,7 +161,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const { + 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, + 0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, + 0x78, 0x70 }; +- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p); ++ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, (char *)prolog, sizeof(prolog), p); + char* line = p.itoa(lineNumber); + // + // construct Java-like fullInfo (replace "::" with ".") +diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp +index 1c0d4be7..ba662147 100644 +--- a/src/main/cpp/loggingevent.cpp ++++ b/src/main/cpp/loggingevent.cpp +@@ -236,7 +236,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value) + + + void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) { +- char classDesc[] = { ++ uint8_t classDesc[] = { + 0x72, 0x00, 0x21, + 0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63, + 0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A, +@@ -292,7 +292,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) { + 0x3B, 0x78, 0x70 }; + + os.writeProlog("org.apache.log4j.spi.LoggingEvent", +- 8, classDesc, sizeof(classDesc), p); ++ 8, (char *)classDesc, sizeof(classDesc), p); + } + + void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const { +diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp +index 7cd696b8..f80261d9 100644 +--- a/src/main/cpp/objectoutputstream.cpp ++++ b/src/main/cpp/objectoutputstream.cpp +@@ -36,8 +36,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p) + objectHandle(0x7E0000), + classDescriptions(new ClassDescriptionMap()) + { +- char start[] = { 0xAC, 0xED, 0x00, 0x05 }; +- ByteBuffer buf(start, sizeof(start)); ++ uint8_t start[] = { 0xAC, 0xED, 0x00, 0x05 }; ++ ByteBuffer buf((char *)start, sizeof(start)); + os->write(buf, p); + } + +@@ -81,7 +81,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) { + // + // TC_OBJECT and the classDesc for java.util.Hashtable + // +- char prolog[] = { ++ uint8_t prolog[] = { + 0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61, + 0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61, + 0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13, +@@ -90,12 +90,12 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) { + 0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49, + 0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6F, 0x6C, 0x64, 0x78, 0x70 }; +- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p); ++ writeProlog("java.util.Hashtable", 1, (char *)prolog, sizeof(prolog), p); + // + // loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7 +- char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, ++ uint8_t data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, + TC_BLOCKDATA, 0x08, 0x00, 0x00, 0x00, 0x07 }; +- ByteBuffer dataBuf(data, sizeof(data)); ++ ByteBuffer dataBuf((char *)data, sizeof(data)); + os->write(dataBuf, p); + char size[4]; + size_t sz = val.size(); +diff --git a/src/main/cpp/simpledateformat.cpp b/src/main/cpp/simpledateformat.cpp +index f18dfc75..cbce2db9 100644 +--- a/src/main/cpp/simpledateformat.cpp ++++ b/src/main/cpp/simpledateformat.cpp +@@ -126,7 +126,7 @@ namespace log4cxx + size_t start = 0; + std::basic_ostringstream os; + for(; valueIter != values.end(); valueIter++) { +- PUT_FACET(facet, os, &time, (wchar_t) wspec); ++ PUT_FACET(facet, os, &time, wspec); + Transcoder::decode(os.str().substr(start), *valueIter); + start = os.str().length(); + (*inc)(time, aprtime); +diff --git a/src/main/cpp/stringhelper.cpp b/src/main/cpp/stringhelper.cpp +index ca4b1ace..b89dc65d 100644 +--- a/src/main/cpp/stringhelper.cpp ++++ b/src/main/cpp/stringhelper.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #if !defined(LOG4CXX) +diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h +index cbe9b3c7..86a7371c 100644 +--- a/src/main/include/log4cxx/asyncappender.h ++++ b/src/main/include/log4cxx/asyncappender.h +@@ -35,6 +35,7 @@ + + namespace log4cxx + { ++ LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr); + + /** + The AsyncAppender lets users log events asynchronously. It uses a +@@ -194,7 +195,6 @@ namespace log4cxx + /** + * Event buffer. + */ +- LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr); + LoggingEventList buffer; + + /** +diff --git a/src/main/include/log4cxx/helpers/bytearrayinputstream.h b/src/main/include/log4cxx/helpers/bytearrayinputstream.h +index 92bcb595..11d33def 100755 +--- a/src/main/include/log4cxx/helpers/bytearrayinputstream.h ++++ b/src/main/include/log4cxx/helpers/bytearrayinputstream.h +@@ -32,6 +32,7 @@ namespace log4cxx + { + + namespace helpers { ++ LOG4CXX_LIST_DEF(ByteList, unsigned char); + + /** + * InputStream implemented on top of a byte array. +@@ -39,7 +40,6 @@ namespace log4cxx + class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream + { + private: +- LOG4CXX_LIST_DEF(ByteList, unsigned char); + ByteList buf; + size_t pos; + +diff --git a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h +index 34e3d095..1f4233da 100644 +--- a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h ++++ b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h +@@ -34,6 +34,7 @@ namespace log4cxx + + namespace helpers { + class Pool; ++ LOG4CXX_LIST_DEF(ByteList, unsigned char); + + /** + * OutputStream implemented on top of std::vector +@@ -41,7 +42,6 @@ namespace log4cxx + class LOG4CXX_EXPORT ByteArrayOutputStream : public OutputStream + { + private: +- LOG4CXX_LIST_DEF(ByteList, unsigned char); + ByteList array; + + public: +diff --git a/src/main/include/log4cxx/helpers/simpledateformat.h b/src/main/include/log4cxx/helpers/simpledateformat.h +index 9c27f685..0b4dc5fd 100644 +--- a/src/main/include/log4cxx/helpers/simpledateformat.h ++++ b/src/main/include/log4cxx/helpers/simpledateformat.h +@@ -39,6 +39,8 @@ namespace log4cxx + class PatternToken; + } + ++ LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*); ++ + /** + * Concrete class for formatting and parsing dates in a + * locale-sensitive manner. +@@ -75,8 +77,6 @@ namespace log4cxx + /** + * List of tokens. + */ +- LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*); +- + PatternTokenList pattern; + + static void addToken(const logchar spec, const int repeat, const std::locale* locale, PatternTokenList& pattern); +diff --git a/src/main/include/log4cxx/helpers/socketoutputstream.h b/src/main/include/log4cxx/helpers/socketoutputstream.h +index 6bca1733..0c6fbb4f 100644 +--- a/src/main/include/log4cxx/helpers/socketoutputstream.h ++++ b/src/main/include/log4cxx/helpers/socketoutputstream.h +@@ -32,6 +32,7 @@ namespace log4cxx + { + namespace helpers + { ++ LOG4CXX_LIST_DEF(ByteList, unsigned char); + + class LOG4CXX_EXPORT SocketOutputStream : public OutputStream + { +@@ -50,7 +51,6 @@ namespace log4cxx + virtual void write(ByteBuffer& buf, Pool& p); + + private: +- LOG4CXX_LIST_DEF(ByteList, unsigned char); + ByteList array; + SocketPtr socket; + // +diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h +index 89948334..b4269943 100644 +--- a/src/main/include/log4cxx/net/sockethubappender.h ++++ b/src/main/include/log4cxx/net/sockethubappender.h +@@ -38,6 +38,8 @@ namespace log4cxx + } + namespace net + { ++ LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr); ++ + /** + Sends {@link log4cxx::spi::LoggingEvent LoggingEvent} objects to a set of remote log + servers, usually a SocketNode. +@@ -112,7 +114,6 @@ namespace log4cxx + static int DEFAULT_PORT; + + int port; +- LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr); + ObjectOutputStreamList streams; + bool locationInfo; + +diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h +index 5cbe2b0b..17678d86 100644 +--- a/src/main/include/log4cxx/net/telnetappender.h ++++ b/src/main/include/log4cxx/net/telnetappender.h +@@ -39,6 +39,8 @@ namespace log4cxx + } + namespace net + { ++ typedef log4cxx::helpers::SocketPtr Connection; ++ LOG4CXX_LIST_DEF(ConnectionList, Connection); + /** +

The TelnetAppender is a log4cxx appender that specializes in + writing to a read-only socket. The output is provided in a +@@ -131,9 +133,6 @@ servlet. + TelnetAppender(const TelnetAppender&); + TelnetAppender& operator=(const TelnetAppender&); + +- typedef log4cxx::helpers::SocketPtr Connection; +- LOG4CXX_LIST_DEF(ConnectionList, Connection); +- + void write(log4cxx::helpers::ByteBuffer&); + void writeStatus(const log4cxx::helpers::SocketPtr& socket, const LogString& msg, log4cxx::helpers::Pool& p); + ConnectionList connections; +diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h +index 55d6eb5b..d084b6cb 100644 +--- a/src/main/include/log4cxx/patternlayout.h ++++ b/src/main/include/log4cxx/patternlayout.h +@@ -32,6 +32,8 @@ + + namespace log4cxx + { ++ LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr); ++ LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr); + + /** + +@@ -334,13 +336,11 @@ namespace log4cxx + /** + * Pattern converters. + */ +- LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr); + LoggingEventPatternConverterList patternConverters; + + /** + * Field widths and alignment corresponding to pattern converters. + */ +- LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr); + FormattingInfoList patternFields; + + +diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h +index 154b17d9..ab8dad70 100755 +--- a/src/main/include/log4cxx/rolling/rollingpolicybase.h ++++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h +@@ -34,6 +34,8 @@ + + namespace log4cxx { + namespace rolling { ++ LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr); ++ LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr); + + /** + * Implements methods common to most, it not all, rolling +@@ -57,13 +59,11 @@ namespace log4cxx { + /** + * File name pattern converters. + */ +- LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr); + PatternConverterList patternConverters; + + /** + * File name field specifiers. + */ +- LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr); + FormattingInfoList patternFields; + + /** +diff --git a/src/main/include/log4cxx/spi/loggingevent.h b/src/main/include/log4cxx/spi/loggingevent.h +index 25f5c0dd..102bea21 100644 +--- a/src/main/include/log4cxx/spi/loggingevent.h ++++ b/src/main/include/log4cxx/spi/loggingevent.h +@@ -43,6 +43,7 @@ namespace log4cxx + + namespace spi + { ++ LOG4CXX_LIST_DEF(KeySet, LogString); + + /** + The internal representation of logging events. When an affirmative +@@ -152,7 +153,6 @@ namespace log4cxx + */ + bool getMDC(const LogString& key, LogString& dest) const; + +- LOG4CXX_LIST_DEF(KeySet, LogString); + /** + * Returns the set of of the key values in the MDC for the event. + * The returned set is unmodifiable by the caller. +@@ -160,6 +160,7 @@ namespace log4cxx + * @return Set an unmodifiable set of the MDC keys. + * + */ ++ typedef spi::KeySet KeySet; + KeySet getMDCKeySet() const; + + /** diff --git a/ports/log4cxx/CMakeLists.txt b/ports/log4cxx/CMakeLists.txt new file mode 100644 index 00000000000000..713be57391cc13 --- /dev/null +++ b/ports/log4cxx/CMakeLists.txt @@ -0,0 +1,75 @@ +cmake_minimum_required(VERSION 2.8.9) +project (log4cxx) + +find_path(APR_INCLUDE_DIR + NAMES apr.h +) +if(APR_INCLUDE_DIR-NOTFOUND) + message(FATAL_ERROR "Cannot locate apr.h") +endif() + +find_library(APR_LIBRARIES + NAMES libapr-1 +) +if(APR_LIBRARIES-NOTFOUND) + message(FATAL_ERROR "Cannot locate the library of `libapr-1`") +endif() + +find_path(APRUTIL_INCLUDE_DIR + NAMES apu.h +) +if(APRUTIL_INCLUDE_DIR-NOTFOUND) + message(FATAL_ERROR "Cannot locate apu.h") +endif() + +find_library(APRUTIL_LIBRARIES + NAMES libaprutil-1 +) +if(APRUTIL_LIBRARIES-NOTFOUND) + message(FATAL_ERROR "Cannot locate the library of `libaprutil-1`") +endif() + +add_compile_options( + /wd4101 + /wd4275 + /wd4251 + /wd4250 +) + +configure_file(src/main/include/log4cxx/log4cxx.hw + ${PROJECT_BINARY_DIR}/include/log4cxx/log4cxx.h COPYONLY) + +configure_file(src/main/include/log4cxx/private/log4cxx_private.hw + ${PROJECT_BINARY_DIR}/include/log4cxx/private/log4cxx_private.h COPYONLY) + +set(LOG4CXX_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR}/include + src/main/include + ${APR_INCLUDE_DIR} + ${APRUTIL_INCLUDE_DIR} + ) + +file(GLOB_RECURSE LOG4CXX_SRC + "${PROJECT_SOURCE_DIR}/src/main/cpp/*.cpp" +) + +add_library(log4cxx SHARED ${LOG4CXX_SRC}) +target_include_directories(log4cxx PUBLIC ${LOG4CXX_INCLUDE_DIRECTORIES}) +SET_TARGET_PROPERTIES(log4cxx PROPERTIES COMPILE_DEFINITIONS "_USRDLL;DLL_EXPORTS;LOG4CXX;WIN32") + +target_link_libraries(log4cxx + ${APRUTIL_LIBRARIES} + ${APR_LIBRARIES} + odbc32 + ) + +install(TARGETS log4cxx + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +INSTALL(DIRECTORY src/main/include/ DESTINATION include + FILES_MATCHING PATTERN "*.h") +INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION include + FILES_MATCHING PATTERN "*.h") diff --git a/ports/log4cxx/CONTROL b/ports/log4cxx/CONTROL new file mode 100644 index 00000000000000..30c531eb9d8c76 --- /dev/null +++ b/ports/log4cxx/CONTROL @@ -0,0 +1,6 @@ +Source: log4cxx +Version: 0.10.0-2 +Homepage: https://logging.apache.org/log4cxx/ +Description: Apache log4cxx is a logging framework for C++ patterned after Apache log4j, which uses Apache Portable Runtime for most platform-specific code and should be usable on any platform supported by APR. Apache log4cxx is licensed under the Apache License, an open source license certified by the Open Source Initiative. +Build-Depends: apr, apr-util +Supports: windows&!(uwp|arm|static) diff --git a/ports/log4cxx/portfile.cmake b/ports/log4cxx/portfile.cmake new file mode 100644 index 00000000000000..16869c04e096c0 --- /dev/null +++ b/ports/log4cxx/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" "arm" "arm64") + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +set(LOG4CXX_VERSION 0.10.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://archive.apache.org/dist/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz" + FILENAME "apache-log4cxx-0.10.0.tar.gz" + SHA512 1c34d80983db5648bc4582ddcf6b4fdefdc6594c2769f95235f5441cd6d03cf279cc8f365e9a687085b113f79ebac9d7d33a54b6aa3b3b808c0e1a56a15ffa37 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${LOG4CXX_VERSION} + PATCHES + 001_msvc.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +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/lpeg/CMakeLists.txt b/ports/lpeg/CMakeLists.txt index f5a72fad4ee0c1..993e570d73c56d 100644 --- a/ports/lpeg/CMakeLists.txt +++ b/ports/lpeg/CMakeLists.txt @@ -1,28 +1,24 @@ -cmake_minimum_required(VERSION 3.0) -project(lpeg) - -if(NOT WIN32) - message(FATAL_ERROR "Written for windows only") -endif() - -find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) -find_library(LUA_LIBRARY lua) -set(LPEG_INCLUDES ${LUA_INCLUDE_DIR}) -set(LPEG_LIBRARIES ${LUA_LIBRARY}) - -add_library(lpeg - lpvm.c - lptree.c - lpprint.c - lpcap.c - lpcode.c - lpeg.def) - -target_include_directories(lpeg PRIVATE ${LPEG_INCLUDES}) -target_link_libraries(lpeg PRIVATE ${LPEG_LIBRARIES}) - -install(TARGETS lpeg - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -install(FILES re.lua DESTINATION share/lua) +cmake_minimum_required(VERSION 3.0) +project(lpeg) + +find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) +find_library(LUA_LIBRARY lua) +set(LPEG_INCLUDES ${LUA_INCLUDE_DIR}) +set(LPEG_LIBRARIES ${LUA_LIBRARY}) + +add_library(lpeg + lpvm.c + lptree.c + lpprint.c + lpcap.c + lpcode.c + lpeg.def) + +target_include_directories(lpeg PRIVATE ${LPEG_INCLUDES}) +target_link_libraries(lpeg PRIVATE ${LPEG_LIBRARIES}) + +install(TARGETS lpeg + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +install(FILES re.lua DESTINATION share/lua) diff --git a/ports/lpeg/CONTROL b/ports/lpeg/CONTROL index d3abb132cb6de8..c88fdada21c73f 100644 --- a/ports/lpeg/CONTROL +++ b/ports/lpeg/CONTROL @@ -1,5 +1,5 @@ Source: lpeg -Version: 1.0.1-4 +Version: 1.0.2-1 Homepage: https://www.inf.puc-rio.br/~roberto/lpeg Description: LPeg is a pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). Build-Depends: lua diff --git a/ports/lpeg/portfile.cmake b/ports/lpeg/portfile.cmake index f37a350c320b97..24d77f00b1c57a 100644 --- a/ports/lpeg/portfile.cmake +++ b/ports/lpeg/portfile.cmake @@ -1,12 +1,9 @@ -#cmake-only scripts -include(vcpkg_common_functions) - -set(LPEG_VER 1.0.1) +set(LPEG_VER 1.0.2) vcpkg_download_distfile(ARCHIVE URLS "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-${LPEG_VER}.tar.gz" FILENAME "lpeg-${LPEG_VER}.tar.gz" - SHA512 7b43fbee7eff443000986684bc56bba6d2796a31cf860740746c70e155bdea1b62a46b93f97e2747e3ef0f63e965148778ac2985d0f2d83e1e37ec4ebbabf4aa + SHA512 110527ddf9f8e5e8a80ef0ae8847c8ba8cd2597dba3bfe2865cba9af60daafbb885f21e74231952f5ab793d021e050b482066a821c6954d52090a5eae77e9814 ) vcpkg_extract_source_archive_ex( @@ -28,7 +25,7 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(INSTALL ${SOURCE_PATH}/lpeg.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/lpeg RENAME copyright) +file(INSTALL ${SOURCE_PATH}/lpeg.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) # Allow empty include directory set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index dd0a1de3590043..fd04503f1d1c55 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -52,6 +52,7 @@ ENDIF () #DLL ADD_LIBRARY ( lua ${SRC_LIBLUA} ) +SET_PROPERTY (TARGET lua PROPERTY POSITION_INDEPENDENT_CODE ON) IF (COMPILE_AS_CPP) SET_TARGET_PROPERTIES(lua PROPERTIES OUTPUT_NAME "lua-c++") ENDIF() diff --git a/ports/lua/CONTROL b/ports/lua/CONTROL index 9e22f3ea207bf9..72839f9728efee 100644 --- a/ports/lua/CONTROL +++ b/ports/lua/CONTROL @@ -1,5 +1,5 @@ Source: lua -Version: 5.3.5-3 +Version: 5.3.5-5 Homepage: https://www.lua.org Description: a powerful, fast, lightweight, embeddable scripting language diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake index 42dea0b98f99ef..823bd65552fdbc 100644 --- a/ports/lua/portfile.cmake +++ b/ports/lua/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://www.lua.org/ftp/lua-5.3.5.tar.gz" FILENAME "lua-5.3.5.tar.gz" @@ -25,7 +23,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +set(ENABLE_LUA_CPP 0) if("cpp" IN_LIST FEATURES) + set(ENABLE_LUA_CPP 1) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -39,6 +39,10 @@ if("cpp" IN_LIST FEATURES) vcpkg_install_cmake() endif() +vcpkg_copy_pdbs() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lua) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) file(READ ${CURRENT_PACKAGES_DIR}/include/luaconf.h LUA_CONF_H) @@ -47,10 +51,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lua) +# Handle post-build CMake instructions +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) # Handle copyright -file(COPY ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lua/copyright) -# Handle post-build CMake instructions -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/lua) -vcpkg_copy_pdbs() +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/lua/vcpkg-cmake-wrapper.cmake.in b/ports/lua/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 00000000000000..3b974043a4e082 --- /dev/null +++ b/ports/lua/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,6 @@ +_find_package(${ARGS}) + +if (@ENABLE_LUA_CPP@) + find_library(lua_cpp NAMES lua-c++ liblua-c++ REQUIRED) + set(LUA_LIBRARIES ${LUA_LIBRARIES} ${lua_cpp}) +endif() \ No newline at end of file diff --git a/ports/luafilesystem/CMakeLists.txt b/ports/luafilesystem/CMakeLists.txt index 85fb5eb86affeb..79dd424f422bd9 100644 --- a/ports/luafilesystem/CMakeLists.txt +++ b/ports/luafilesystem/CMakeLists.txt @@ -1,21 +1,17 @@ -cmake_minimum_required(VERSION 3.0) -project(luafilesystem) - -if(NOT WIN32) - message(FATAL_ERROR "Written for windows only") -endif() - -find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) -find_library(LUA_LIBRARY lua) -set(LFS_INCLUDES ${LUA_INCLUDE_DIR}) -set(LFS_LIBRARIES ${LUA_LIBRARY}) - -add_library( lfs src/lfs.h src/lfs.c src/lfs.def) - -target_include_directories(lfs PRIVATE ${LFS_INCLUDES}) -target_link_libraries(lfs PRIVATE ${LFS_LIBRARIES}) - -install(TARGETS lfs - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) +cmake_minimum_required(VERSION 3.0) +project(luafilesystem) + +find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) +find_library(LUA_LIBRARY lua) +set(LFS_INCLUDES ${LUA_INCLUDE_DIR}) +set(LFS_LIBRARIES ${LUA_LIBRARY}) + +add_library( lfs src/lfs.h src/lfs.c src/lfs.def) + +target_include_directories(lfs PRIVATE ${LFS_INCLUDES}) +target_link_libraries(lfs PRIVATE ${LFS_LIBRARIES}) + +install(TARGETS lfs + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) diff --git a/ports/luafilesystem/CONTROL b/ports/luafilesystem/CONTROL index e05ed6df380c7e..021620ec10a7bd 100644 --- a/ports/luafilesystem/CONTROL +++ b/ports/luafilesystem/CONTROL @@ -1,5 +1,5 @@ Source: luafilesystem -Version: 1.7.0.2-1 +Version: 1.8.0-1 Homepage: https://github.com/keplerproject/luafilesystem Description: LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution. Build-Depends: lua diff --git a/ports/luafilesystem/lfs-def-fix.patch b/ports/luafilesystem/lfs-def-fix.patch deleted file mode 100644 index 34923427fd1f8f..00000000000000 --- a/ports/luafilesystem/lfs-def-fix.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 92527d96199912f79b8046ddb32ff83a16771cb4 Mon Sep 17 00:00:00 2001 -From: "Stephen E. Baker" -Date: Fri, 15 Sep 2017 21:18:58 -0400 -Subject: [PATCH] Update version in lfs.def - -Version number of current release is 1.7 ---- - src/lfs.def | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lfs.def b/src/lfs.def -index 8a36d41..4055ff0 100644 ---- a/src/lfs.def -+++ b/src/lfs.def -@@ -1,4 +1,4 @@ - LIBRARY lfs.dll --VERSION 1.6 -+VERSION 1.7 - EXPORTS - luaopen_lfs diff --git a/ports/luafilesystem/portfile.cmake b/ports/luafilesystem/portfile.cmake index da13d7e5517c69..bd6f1ebd4e1f44 100644 --- a/ports/luafilesystem/portfile.cmake +++ b/ports/luafilesystem/portfile.cmake @@ -1,8 +1,6 @@ -include(vcpkg_common_functions) - -set(LUAFILESYSTEM_VERSION 1.7.0.2) -set(LUAFILESYSTEM_REVISION v1_7_0_2) -set(LUAFILESYSTEM_HASH a1d4d077776e57cd878dbcd21656da141ea3686c587b5420a2b039aeaf086b7e7d05d531ee1cc2bbd7d06660d1315b09593e52143f6711f033ce8eecdc550511) +set(LUAFILESYSTEM_VERSION 1.8.0) +set(LUAFILESYSTEM_REVISION v1_8_0) +set(LUAFILESYSTEM_HASH 79d964f13ae43716281dc8521d2f128b22f2261234c443e242b857cfdf621e208bdf4512f8ba710baa113e9b3b71e2544609de65e2c483f569c243a5cf058247) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -10,8 +8,6 @@ vcpkg_from_github( REF ${LUAFILESYSTEM_REVISION} SHA512 ${LUAFILESYSTEM_HASH} HEAD_REF master - PATCHES - lfs-def-fix.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -25,8 +21,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/luafilesystem) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/luafilesystem/LICENSE ${CURRENT_PACKAGES_DIR}/share/luafilesystem/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) # Allow empty include directory set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/lz4/CMakeLists.txt b/ports/lz4/CMakeLists.txt index b36a3574e6cc12..1e272dd4563911 100644 --- a/ports/lz4/CMakeLists.txt +++ b/ports/lz4/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(lz4 C) -if(BUILD_SHARED_LIBS) +if(MSVC AND BUILD_SHARED_LIBS) add_definitions(-DLZ4_DLL_EXPORT) endif() add_definitions(-DXXH_NAMESPACE=LZ4_) @@ -40,7 +40,7 @@ list(REMOVE_ITEM lz4h "${CMAKE_CURRENT_LIST_DIR}/lib/xxhash.h") INSTALL(FILES ${lz4h} DESTINATION "${INSTALL_INCLUDE_DIR}") install(EXPORT lz4Config - FILE lz4Config.cmake + FILE lz4-config.cmake NAMESPACE lz4:: DESTINATION "${INSTALL_CMAKE_DIR}" ) diff --git a/ports/lz4/CONTROL b/ports/lz4/CONTROL index a00b8845481c85..280ec3cdad2703 100644 --- a/ports/lz4/CONTROL +++ b/ports/lz4/CONTROL @@ -1,5 +1,5 @@ Source: lz4 -Version: 1.9.2 +Version: 1.9.2-2 Homepage: https://github.com/lz4/lz4 Description: Lossless compression algorithm, providing compression speed at 400 MB/s per core. -Build-Depends: xxhash \ No newline at end of file +Build-Depends: xxhash diff --git a/ports/lz4/portfile.cmake b/ports/lz4/portfile.cmake index 3468236bf2bc3c..003f0591dfefd6 100644 --- a/ports/lz4/portfile.cmake +++ b/ports/lz4/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lz4/lz4 @@ -23,7 +21,7 @@ vcpkg_copy_pdbs() foreach(FILE lz4.h lz4frame.h) file(READ ${CURRENT_PACKAGES_DIR}/include/${FILE} LZ4_HEADER) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - string(REPLACE "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" "1" LZ4_HEADER "${LZ4_HEADER}") + string(REPLACE "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" "1 && defined(_MSC_VER)" LZ4_HEADER "${LZ4_HEADER}") else() string(REPLACE "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" "0" LZ4_HEADER "${LZ4_HEADER}") endif() @@ -34,6 +32,4 @@ vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/lib/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/lz4) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/lz4/LICENSE ${CURRENT_PACKAGES_DIR}/share/lz4/copyright) - +file(INSTALL ${SOURCE_PATH}/lib/LICENSE 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/magic-enum/CONTROL b/ports/magic-enum/CONTROL index dbd3abe5089ada..f6ff3833ee94e1 100644 --- a/ports/magic-enum/CONTROL +++ b/ports/magic-enum/CONTROL @@ -1,4 +1,4 @@ Source: magic-enum -Version: 0.6.4 +Version: 0.6.6 Description: Header-only C++17 library provides static reflection for enums, work with any enum type without any macro or boilerplate code. Homepage: https://github.com/Neargye/magic_enum diff --git a/ports/magic-enum/portfile.cmake b/ports/magic-enum/portfile.cmake index 86d6bb7bb3b7c4..30d8f96bae9fee 100644 --- a/ports/magic-enum/portfile.cmake +++ b/ports/magic-enum/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Neargye/magic_enum - REF v0.6.4 - SHA512 9d7e45c5a9abfe28b8b1926805f7e5d9a94118f6330737b2c2d95c49cd8f04fdc540eb264d68bd7c697abaffba3a178499f90bc86fb54a62f7d2cc61be22599b + REF v0.6.6 + SHA512 aeab69a87d0bcac93a987489a7bce9bd5971b7df1a5f83bfe9c58292dec736aa3b60a238c38d04080608199ea45c946da50b13934fb320e5f63e38b9185b526f HEAD_REF master ) diff --git a/ports/magic-get/CONTROL b/ports/magic-get/CONTROL index c59f8b85c46243..c614761f5e4a66 100644 --- a/ports/magic-get/CONTROL +++ b/ports/magic-get/CONTROL @@ -1,4 +1,4 @@ Source: magic-get -Version: 2019-09-02 +Version: 2019-09-02-1 Homepage: https://github.com/apolukhin/magic_get -Description: This C++14 library is meant for accessing structure elements by index and providing other std::tuple like methods for user defined types without any macro or boilerplate code. \ No newline at end of file +Description: This C++14 library is meant for accessing structure elements by index and providing other std::tuple like methods for user defined types without any macro or boilerplate code. diff --git a/ports/magic-get/portfile.cmake b/ports/magic-get/portfile.cmake index f66b4310cfca30..1546bbe992dde5 100644 --- a/ports/magic-get/portfile.cmake +++ b/ports/magic-get/portfile.cmake @@ -1,9 +1,7 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apolukhin/magic_get - REF abb467c0e22a83bf75a46a9e6610370fabfc39af #Branch develop, Commits on Sep 2, 2019 + REF abb467c0e22a83bf75a46a9e6610370fabfc39af #Branch develop, Commits on Sep 2, 2019 SHA512 1feb5d105d13a20aec8ab2c748dbd79ecc5d2267c8c0ee7db93a3d0c6b7186ea0c475fdc14712e78502ea839788f6dfb0b359e3fedbec59d331dafe137326fa4 HEAD_REF develop ) @@ -13,9 +11,9 @@ vcpkg_download_distfile(OCV_DOWNLOAD FILENAME "boost_license_1_0.txt" SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 ) - -file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) + +file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) # Handle copyright # On Homepage README.md, License Distributed under the Boost Software License, Version 1.0. https://www.boost.org/LICENSE_1_0.txt -file(INSTALL ${VCPKG_ROOT_DIR}/downloads/boost_license_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${OCV_DOWNLOAD} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/magnum-extras/CONTROL b/ports/magnum-extras/CONTROL index d1d889d20bfd20..b9583b5f18ead0 100644 --- a/ports/magnum-extras/CONTROL +++ b/ports/magnum-extras/CONTROL @@ -1,5 +1,5 @@ Source: magnum-extras -Version: 2019.10 +Version: 2020.06 Build-Depends: magnum[core] Description: Extras for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-extras/portfile.cmake b/ports/magnum-extras/portfile.cmake index f5075fdaa06395..d2a0af3d4ef988 100644 --- a/ports/magnum-extras/portfile.cmake +++ b/ports/magnum-extras/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-extras - REF v2019.10 - SHA512 75335a75f1662e6223d2be7bc2f3cdb12af0e13ed11f3551dbd68a9488ab2e37ba9cd7ee786cc13e545689ed213558b305bfaffbaf8fa7d3be61eb21eeeeba4a + REF v2020.06 + SHA512 7419af84a6de72f666a9bd12a325c4b40f9e2a25fec3d0b22c348faab0a402b62fa782231b9b12180d84f4ab2508b02df25a97713948bdd2f21c9e8cb831fa25 HEAD_REF master ) @@ -66,7 +66,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-extras) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-extras/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-extras/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + vcpkg_copy_pdbs() diff --git a/ports/magnum-integration/CONTROL b/ports/magnum-integration/CONTROL index 05fce1f61070fa..893ce966f1331a 100644 --- a/ports/magnum-integration/CONTROL +++ b/ports/magnum-integration/CONTROL @@ -1,5 +1,5 @@ Source: magnum-integration -Version: 2019.10 +Version: 2020.06 Build-Depends: magnum[core] Description: Integrations for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-integration/portfile.cmake b/ports/magnum-integration/portfile.cmake index c079ee445043ca..9bb8a64de8cf52 100644 --- a/ports/magnum-integration/portfile.cmake +++ b/ports/magnum-integration/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-integration - REF v2019.10 - SHA512 be8b21da07b9720ad19263d6ee0a234ff97ee4a1d5770e3ab33047bc54711689532945b099431c24f6ae863bb55a0883b3ba34a48d7d17768082b26651a9621e + REF v2020.06 + SHA512 0b615acdb49ed55bd678a5fb019b1a8ccf522084f3114b2b8dd7e121c27d39ae2aab2879a2e2fa8b083163be711a86f64202fcf380413dec0c705fffd7d649c5 HEAD_REF master ) @@ -59,7 +59,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-integration) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-integration/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-integration/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) vcpkg_copy_pdbs() 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 39d0d10167c9ba..dee9a32de315dd 100644 --- a/ports/magnum-plugins/CONTROL +++ b/ports/magnum-plugins/CONTROL @@ -1,9 +1,10 @@ Source: magnum-plugins -Version: 2019.10-2 +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/ -Default-Features: ddsimporter, miniexrimageconverter, opengeximporter, stanfordimporter, stbimageconverter, stbimageimporter +Default-Features: ddsimporter, icoimporter, miniexrimageconverter, opengeximporter, stanfordimporter, stanfordsceneconverter, stbimageconverter, stbimageimporter, stlimporter Feature: assimpimporter Description: AssimpImporter plugin @@ -14,11 +15,11 @@ Description: OpenDdl library Feature: basisimageconverter Description: BasisImageConverter plugin -Build-Depends: magnum[trade], basisu +Build-Depends: magnum[trade] Feature: basisimporter Description: BasisImporter plugin -Build-Depends: magnum[trade], basisu +Build-Depends: magnum[trade] Feature: ddsimporter Description: DdsImporter plugin @@ -51,6 +52,10 @@ Feature: harfbuzzfont Description: HarfBuzzFont plugin Build-Depends: harfbuzz, magnum-plugins[freetypefont] +Feature: icoimporter +Description: IcoImporter plugin +Build-Depends: magnum[trade] + Feature: jpegimporter Description: JpegImporter plugin Build-Depends: libjpeg-turbo, magnum[trade] @@ -59,6 +64,10 @@ Feature: jpegimageconverter Description: JpegImageConverter plugin Build-Depends: libjpeg-turbo, magnum[trade] +Feature: meshoptimizersceneconverter +Description: MeshOptimizerSceneConverter plugin +Build-Depends: magnum[trade], meshoptimizer + Feature: miniexrimageconverter Description: MiniExrImageConverter plugin Build-Depends: magnum[trade] @@ -79,6 +88,10 @@ Feature: stanfordimporter Description: StanfordImporter plugin Build-Depends: magnum[trade] +Feature: stanfordsceneconverter +Description: StanfordSceneConverter plugin +Build-Depends: magnum[trade] + Feature: stbimageconverter Description: StbImageConverter plugin Build-Depends: magnum[trade] @@ -95,6 +108,10 @@ Feature: stbvorbisaudioimporter Description: StbVorbisAudioImporter plugin Build-Depends: magnum[audio] +Feature: stlimporter +Description: StlImporter plugin +Build-Depends: magnum[trade] + Feature: tinygltfimporter Description: TinyGltfImporter plugin Build-Depends: magnum[anyimageimporter], magnum-plugins[stbimageimporter], magnum[trade] diff --git a/ports/magnum-plugins/portfile.cmake b/ports/magnum-plugins/portfile.cmake index 1fc50e20354194..766d91cfc3db42 100644 --- a/ports/magnum-plugins/portfile.cmake +++ b/ports/magnum-plugins/portfile.cmake @@ -1,51 +1,69 @@ -set(_RELEASE_ONLY_PATCHES) -if(NOT VCPKG_USE_HEAD_VERSION) - vcpkg_download_distfile( - _RELEASE_ONLY_PATCHES - URLS "https://github.com/mosra/magnum-plugins/commit/c2a05465fa43befbb628b424378e328fa42923b7.diff" - FILENAME "c2a05465fa43befbb628b424378e328fa42923b7.diff" - SHA512 e03953ff7319b3b8e3644b8e25c006a856dd6a85cec6e4c033f9b2059af7ae39ed84b76c11c93c41ea6a681d7f34dd5980806f49f760d1c26778047c90cc76df - ) -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-plugins - REF v2019.10 - SHA512 702c43b0d323dc5b903ffee3dd9aaecf2de3b6bb00e7b243880e433df12efe337e512aac75a6f38adce02eb94f3065770ff6a03b7241198f27b5c46de63e5750 + REF v2020.06 + SHA512 3c11c2928bfc9d04c1ad64f72b6ffac6cf80a1ef3aacc5d0486b9ad955cf4f6ea6d5dcb3846dc5d73f64ec522a015eafb997f62c79ad7ff91169702341f23af0 HEAD_REF master PATCHES 001-tools-path.patch - ${_RELEASE_ONLY_PATCHES} + 002-fix-stb-conflict.patch ) +if("basisimporter" IN_LIST FEATURES OR "basisimageconverter" IN_LIST FEATURES) + # Bundle Basis Universal, a commit that's before the UASTC support (which + # is not implemented yet). The repo has big unrequired files in its + # history, so we're downloading just a snapshot instead of a git clone. + vcpkg_download_distfile( + _BASIS_UNIVERSAL_PATCHES + URLS "https://github.com/BinomialLLC/basis_universal/commit/e9c55faac7745ebf38d08cd3b4f71aaf542f8191.diff" + FILENAME "e9c55faac7745ebf38d08cd3b4f71aaf542f8191.patch" + SHA512 e5dda11de2ba8cfd39728e69c74a7656bb522e509786fe5673c94b26be9bd4bee897510096479ee6323f5276d34cba1c44c60804a515c0b35ff7b6ac9d625b88 + ) + set(_BASIS_VERSION "8565af680d1bd2ad56ab227ca7d96c56dfbe93ed") + vcpkg_download_distfile( + _BASIS_UNIVERSAL_ARCHIVE + URLS "https://github.com/BinomialLLC/basis_universal/archive/${_BASIS_VERSION}.tar.gz" + FILENAME "basis-universal-${_BASIS_VERSION}.tar.gz" + SHA512 65062ab3ba675c46760f56475a7528189ed4097fb9bab8316e25d9e23ffec2a9560eb9a6897468baf2a6ab2bd698b5907283e96deaeaef178085a47f9d371bb2 + ) + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH _BASIS_UNIVERSAL_SOURCE + ARCHIVE ${_BASIS_UNIVERSAL_ARCHIVE} + WORKING_DIRECTORY "${SOURCE_PATH}/src/external" + PATCHES + ${_BASIS_UNIVERSAL_PATCHES}) + # Remove potentially cached directory which would cause renaming to fail + file(REMOVE_RECURSE "${SOURCE_PATH}/src/external/basis-universal") + # Rename the output folder so that magnum auto-detects it + file(RENAME ${_BASIS_UNIVERSAL_SOURCE} "${SOURCE_PATH}/src/external/basis-universal") +endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(BUILD_PLUGINS_STATIC 1) else() set(BUILD_PLUGINS_STATIC 0) endif() -# Handle features -set(_COMPONENT_FLAGS "") +set(_COMPONENTS "") +# Generate cmake parameters from feature names foreach(_feature IN LISTS ALL_FEATURES) # Uppercase the feature name and replace "-" with "_" string(TOUPPER "${_feature}" _FEATURE) string(REPLACE "-" "_" _FEATURE "${_FEATURE}") - # Turn "-DWITH_*=" ON or OFF depending on whether the feature - # is in the list. - if(_feature IN_LIST FEATURES) - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=ON") - else() - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=OFF") + # Final feature is empty, ignore it + if(_feature) + list(APPEND _COMPONENTS ${_feature} WITH_${_FEATURE}) endif() endforeach() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS ${_COMPONENTS}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS - ${_COMPONENT_FLAGS} + ${FEATURE_OPTIONS} -DBUILD_STATIC=${BUILD_PLUGINS_STATIC} -DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC} -DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d @@ -86,7 +104,8 @@ else() endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-plugins) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/magnum/002-sdl-includes-head.patch b/ports/magnum/002-sdl-includes-head.patch deleted file mode 100644 index fb2ffed8db2b4a..00000000000000 --- a/ports/magnum/002-sdl-includes-head.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp -index 276c7ee55..90c52f3cb 100644 ---- a/src/Magnum/Platform/Sdl2Application.cpp -+++ b/src/Magnum/Platform/Sdl2Application.cpp -@@ -34,7 +34,7 @@ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif --#include -+#include - #ifdef CORRADE_TARGET_CLANG_CL - #pragma clang diagnostic pop - #endif -diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h -index b2426d513..176729fdb 100644 ---- a/src/Magnum/Platform/Sdl2Application.h -+++ b/src/Magnum/Platform/Sdl2Application.h -@@ -57,11 +57,11 @@ - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif - /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ --#include --#include --#include /* huh, why is this not pulled in implicitly?! */ --#include --#include -+#include -+#include -+#include /* huh, why is this not pulled in implicitly?! */ -+#include -+#include - - #ifdef CORRADE_TARGET_IOS - /* Including SDL_main.h unconditionally would mean it'd override Corrade::Main -@@ -74,7 +74,7 @@ - #endif - - #ifdef CORRADE_TARGET_WINDOWS_RT --#include /* For SDL_WinRTRunApp */ -+#include /* For SDL_WinRTRunApp */ - #include /* For the WinMain entrypoint */ - #endif - #ifdef CORRADE_TARGET_CLANG_CL diff --git a/ports/magnum/002-sdl-includes.patch b/ports/magnum/002-sdl-includes.patch index b7ae6a44614941..fb2ffed8db2b4a 100644 --- a/ports/magnum/002-sdl-includes.patch +++ b/ports/magnum/002-sdl-includes.patch @@ -1,36 +1,43 @@ diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp -index 46ade2d00..24d8eabe7 100644 +index 276c7ee55..90c52f3cb 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp -@@ -26,7 +26,7 @@ - #include "Sdl2Application.h" - - #include +@@ -34,7 +34,7 @@ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif -#include +#include - #ifndef CORRADE_TARGET_EMSCRIPTEN - #include - #else + #ifdef CORRADE_TARGET_CLANG_CL + #pragma clang diagnostic pop + #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h -index 1a50b1c72..45e88edf5 100644 +index b2426d513..176729fdb 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h -@@ -46,13 +46,13 @@ - #define SDL_MAIN_HANDLED +@@ -57,11 +57,11 @@ + #pragma clang diagnostic ignored "-Wpragma-pack" #endif /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ -#include -#include +-#include /* huh, why is this not pulled in implicitly?! */ -#include -#include +#include +#include ++#include /* huh, why is this not pulled in implicitly?! */ +#include +#include - + + #ifdef CORRADE_TARGET_IOS + /* Including SDL_main.h unconditionally would mean it'd override Corrade::Main +@@ -74,7 +74,7 @@ + #endif + #ifdef CORRADE_TARGET_WINDOWS_RT -#include /* For SDL_WinRTRunApp */ +#include /* For SDL_WinRTRunApp */ #include /* For the WinMain entrypoint */ #endif - + #ifdef CORRADE_TARGET_CLANG_CL diff --git a/ports/magnum/CONTROL b/ports/magnum/CONTROL index 2d7d69455157ab..8bea92fbf2a09c 100644 --- a/ports/magnum/CONTROL +++ b/ports/magnum/CONTROL @@ -1,9 +1,9 @@ Source: magnum -Version: 2019.10-1 +Version: 2020.06 Build-Depends: corrade[utility] Description: C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ -Default-Features: anyimageimporter, anyaudioimporter, anyimageconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, text, texturetools, trade, sdl2application +Default-Features: anyaudioimporter, anyimageimporter, anyimageconverter, anysceneconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, text, texturetools, trade, sdl2application Feature: al-info Description: magnum-al-info utility @@ -21,6 +21,10 @@ Feature: anyimageconverter Description: AnyImageConverter plugin Build-Depends: magnum[trade] +Feature: anysceneconverter +Description: AnySceneConverter plugin +Build-Depends: magnum[trade] + Feature: anysceneimporter Description: AnySceneImporter plugin Build-Depends: magnum[trade] @@ -90,6 +94,10 @@ Build-Depends: sdl2 Feature: scenegraph Description: SceneGraph library +Feature: sceneconverter +Description: magnum-sceneconverter utility +Build-Depends: magnum[anysceneconverter] + Feature: shaders Description: Shaders library Build-Depends: magnum[gl] @@ -113,20 +121,16 @@ Feature: wavaudioimporter Description: WavAudioImporter plugin Build-Depends: magnum[audio] -Feature: windowlesswglapplication -Description: WindowlessWglApplication library -Build-Depends: magnum[gl] - -Feature: eglcontext -Description: EglContext library +Feature: windowlesscglapplication +Description: WindowlessCglApplication library Build-Depends: magnum[gl] Feature: cglcontext Description: CglContext library Build-Depends: magnum[gl] -Feature: glxcontext -Description: GlxContext library +Feature: windowlesswglapplication +Description: WindowlessWglApplication library Build-Depends: magnum[gl] Feature: wglcontext diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index 7a13baccc919df..cbdb34cd57cf90 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -1,23 +1,12 @@ -# Patches that are independent of --head flag -set(_PATCHES 001-tools-path.patch) - -# Patches that are only applied to --head builds -if(VCPKG_USE_HEAD_VERSION) - list(APPEND _PATCHES 002-sdl-includes-head.patch) - -# Patches that are only applied to release builds -else() - list(APPEND _PATCHES 002-sdl-includes.patch) -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum - REF v2019.10 - SHA512 b1c991199fa9b09b780ea822de4b2251c70fcc95e7f28bb14a6184861d92fcd4c6e6fe43ad21acfbfd191cd46e79bf58b867240ad6f706b07cd1fbe145b8eaff + REF v2020.06 + SHA512 65b0c8a4520d1d282420c30ecd7c8525525d4dbb6e562e1e2e93d110f4eb686af43f098bf02460727fab1e1f9446dd00a99051e150c05ea40b1486a44fea1042 HEAD_REF master PATCHES - ${_PATCHES} + 001-tools-path.patch + 002-sdl-includes.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -28,27 +17,58 @@ else() set(BUILD_PLUGINS_STATIC 0) endif() -# Handle features -set(_COMPONENT_FLAGS "") -foreach(_feature IN LISTS ALL_FEATURES) +# Remove platform-specific feature that are not available +# on current target platform from all features. + +# For documentation on VCPKG_CMAKE_SYSTEM_NAME see +# https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#vcpkg_cmake_system_name + +set(ALL_SUPPORTED_FEATURES ${ALL_FEATURES}) +# Windows Desktop +if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "") + list(REMOVE_ITEM ALL_SUPPORTED_FEATURES wglcontext windowlesswglapplication) +endif() + +# Universal Windows Platform +if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") + # No UWP specific features +endif() + +# Mac OSX +if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + list(REMOVE_ITEM ALL_SUPPORTED_FEATURES cglcontext windowlesscglapplication) +endif() + +# Linux +if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + list(REMOVE_ITEM ALL_SUPPORTED_FEATURES glxcontext windowlessglxapplication) +endif() + +# WebAssembly / Linux +if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" MATCHES "(Emscripten|Linux)") + list(REMOVE_ITEM ALL_SUPPORTED_FEATURES eglcontext windowlesseglapplication) +endif() + +set(_COMPONENTS "") +# Generate cmake parameters from feature names +foreach(_feature IN LISTS ALL_SUPPORTED_FEATURES) # Uppercase the feature name and replace "-" with "_" string(TOUPPER "${_feature}" _FEATURE) string(REPLACE "-" "_" _FEATURE "${_FEATURE}") - # Turn "-DWITH_*=" ON or OFF depending on whether the feature - # is in the list. - if(_feature IN_LIST FEATURES) - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=ON") - else() - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=OFF") + # Final feature is empty, ignore it + if(_feature) + list(APPEND _COMPONENTS ${_feature} WITH_${_FEATURE}) endif() endforeach() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS ${_COMPONENTS}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS - ${_COMPONENT_FLAGS} + ${FEATURE_OPTIONS} -DBUILD_STATIC=${BUILD_STATIC} -DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC} -DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d @@ -57,6 +77,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + # Drop a copy of tools if(NOT VCPKG_CMAKE_SYSTEM_NAME) set(EXE_SUFFIX .exe) @@ -64,27 +86,23 @@ else() set(EXE_SUFFIX) endif() -if(distancefieldconverter IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-distancefieldconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(fontconverter IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-fontconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(al-info IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-al-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(magnuminfo IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() - -# Tools require dlls -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/magnum) - -file(GLOB_RECURSE TO_REMOVE - ${CURRENT_PACKAGES_DIR}/bin/*${EXE_SUFFIX} - ${CURRENT_PACKAGES_DIR}/debug/bin/*${EXE_SUFFIX}) -if(TO_REMOVE) - file(REMOVE ${TO_REMOVE}) +# Copy tools into vcpkg's tools directory +set(_TOOL_EXEC_NAMES "") +set(_TOOLS + al-info + distancefieldconverter + fontconverter + gl-info + imageconverter + sceneconverter) +foreach(_tool IN LISTS _TOOLS) + if("${_tool}" IN_LIST FEATURES) + list(APPEND _TOOL_EXEC_NAMES magnum-${_tool}) + endif() +endforeach() +message(STATUS ${_TOOL_EXEC_NAMES}) +if(_TOOL_EXEC_NAMES) + vcpkg_copy_tools(TOOL_NAMES "${_TOOL_EXEC_NAMES}" AUTO_CLEAN) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -105,8 +123,6 @@ else() file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/magnum-d) endif() -# Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum/copyright) - -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) 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/marl/CONTROL b/ports/marl/CONTROL deleted file mode 100644 index 16f464135d30dd..00000000000000 --- a/ports/marl/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: marl -Version: 2019-09-13 -Description: A hybrid thread/fiber task scheduler written in C++ 11 -Homepage: https://github.com/google/marl -Supports: !uwp \ No newline at end of file diff --git a/ports/marl/portfile.cmake b/ports/marl/portfile.cmake index 225aa93aa0d823..40d5102ee55787 100644 --- a/ports/marl/portfile.cmake +++ b/ports/marl/portfile.cmake @@ -1,34 +1,37 @@ -include(vcpkg_common_functions) - -if(VCPKG_TARGET_IS_UWP) - message(FATAL_ERROR "This port doesn't support UWP currently!") -endif() - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/marl - REF bf3e23083979c3bd3de1c77346b655eec423b3bc - SHA512 8c85b9a2b7e3cb397fc11c4bf32c5f62d4113ab6af92861c93472299f1b9296edef4dd8d1eb24db242fe55b52f33d2e058a4ce91fbaa793ffa4d5f4c8e336251 - HEAD_REF master + REF 45be9b248306e6ec3136efdd256d769c23b581d1 + SHA512 24efe143718adbf4894e21e715ef5ed2585085b7b3729d9e21d3b0951c7c939e16c9f531eb52ec489cb539d1f70a2dcde025b7bbcbb2165ddf1a5b8278f9b806 + HEAD_REF main ) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MARL_BUILD_SHARED) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DMARL_BUILD_SHARED=${MARL_BUILD_SHARED} -DMARL_INSTALL=ON ) vcpkg_install_cmake() +if(MARL_BUILD_SHARED) + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/include/marl/export.h" + "#ifdef MARL_DLL" + "#if 1 // #ifdef MARL_DLL" + ) +endif() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +vcpkg_copy_pdbs() -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME ${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/marl/vcpkg.json b/ports/marl/vcpkg.json new file mode 100644 index 00000000000000..7bf0f8ef69e280 --- /dev/null +++ b/ports/marl/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "marl", + "version-string": "2020-06-30", + "description": "A hybrid thread/fiber task scheduler written in modern C++", + "homepage": "https://github.com/google/marl", + "license": "Apache-2.0", + "supports": "!uwp" +} diff --git a/ports/mathgl/CONTROL b/ports/mathgl/CONTROL index a600207e36cc14..7dc82d3f97d770 100644 --- a/ports/mathgl/CONTROL +++ b/ports/mathgl/CONTROL @@ -1,5 +1,5 @@ Source: mathgl -Version: 2.4.3-3 +Version: 2.4.3-6 Description: MathGL is a free library of fast C++ routines for the plotting of the data varied in one or more dimensions Default-Features: opengl, jpeg, png, zlib diff --git a/ports/mathgl/portfile.cmake b/ports/mathgl/portfile.cmake index 3556b917ca7126..af6a6914084754 100644 --- a/ports/mathgl/portfile.cmake +++ b/ports/mathgl/portfile.cmake @@ -1,19 +1,14 @@ -include(vcpkg_common_functions) - set(MATHGL_VERSION "2.4.3") -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/mathgl/mathgl/mathgl%20${MATHGL_VERSION}/mathgl-${MATHGL_VERSION}.tar.gz" - FILENAME "mathgl-${MATHGL_VERSION}.tar.gz" - SHA512 e47fc8171ce80c8b33a8f03d9375bc036455dae539b47cf4ee922f8fa36f5afcf8b3f0666997764e453eb698c0e8c03da36dd0ac2bf71c158e95309b247d27de -) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${MATHGL_VERSION} - PATCHES - type_fix.patch - fix_cmakelists_and_cpp.patch +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO mathgl/mathgl + REF mathgl%20${MATHGL_VERSION} + FILENAME "mathgl-${MATHGL_VERSION}.tar.gz" + SHA512 e47fc8171ce80c8b33a8f03d9375bc036455dae539b47cf4ee922f8fa36f5afcf8b3f0666997764e453eb698c0e8c03da36dd0ac2bf71c158e95309b247d27de + PATCHES + type_fix.patch + fix_cmakelists_and_cpp.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/meshoptimizer/CONTROL b/ports/meshoptimizer/CONTROL new file mode 100644 index 00000000000000..320908e70c22e9 --- /dev/null +++ b/ports/meshoptimizer/CONTROL @@ -0,0 +1,5 @@ +Source: meshoptimizer +Version: 0.14 +Port-Version: 1 +Homepage: https://github.com/zeux/meshoptimizer +Description: Mesh optimization library that makes meshes smaller and faster to render diff --git a/ports/meshoptimizer/portfile.cmake b/ports/meshoptimizer/portfile.cmake new file mode 100644 index 00000000000000..e46b174601a5c0 --- /dev/null +++ b/ports/meshoptimizer/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO zeux/meshoptimizer + REF v0.14 + SHA512 303b3bf1bed7cba8f89bce1c2782e3718fc8f4ec01f7ffd64f5ca23406130097f07d234b142916b16fe586db97c7deaa0ae9135b4e558543cc1664e7db85de67 + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DMESHOPT_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/meshoptimizer) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.md + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + +vcpkg_copy_pdbs() diff --git a/ports/metrohash/CMakeLists.txt b/ports/metrohash/CMakeLists.txt index 04a667c5cb6b3b..41e1a74b353da5 100644 --- a/ports/metrohash/CMakeLists.txt +++ b/ports/metrohash/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(MetroHash LANGUAGES CXX) +project(metrohash LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) add_library(metrohash @@ -8,8 +8,7 @@ add_library(metrohash src/metrohash128crc.cpp ) target_compile_options(metrohash PRIVATE -march=native) -target_include_directories(metrohash SYSTEM PUBLIC $/src/) -set (metro_headers src/metrohash64.h src/metrohash128.h src/metrohash128crc.h) +set(metro_headers src/metrohash.h src/metrohash64.h src/metrohash128.h src/metrohash128crc.h) set_target_properties(metrohash PROPERTIES PUBLIC_HEADER "${metro_headers}" ) @@ -22,10 +21,6 @@ set(config_install_dir "lib/cmake/${PROJECT_NAME}") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(namespace "${PROJECT_NAME}::") -# Configure 'Config.cmake' -# Use variables: -# * TARGETS_EXPORT_NAME -# * PROJECT_NAME configure_package_config_file( "${CMAKE_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @@ -36,8 +31,12 @@ install(TARGETS metrohash EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib" - INCLUDES DESTINATION "include") + PUBLIC_HEADER DESTINATION "include") +install( + FILES "${project_config}" + DESTINATION "${config_install_dir}" +) install(EXPORT "${TARGETS_EXPORT_NAME}" NAMESPACE "${namespace}" DESTINATION "${config_install_dir}" diff --git a/ports/metrohash/CONTROL b/ports/metrohash/CONTROL index 276c530e0c7696..85a795a3c21eb1 100644 --- a/ports/metrohash/CONTROL +++ b/ports/metrohash/CONTROL @@ -1,5 +1,5 @@ Source: metrohash -Version: 1.1.3 +Version: 1.1.3-1 Homepage: https://github.com/jandrewrogers/MetroHash Description: MetroHash is a set of state-of-the-art hash functions for non-cryptographic use cases. Supports: !(uwp|arm|x86) diff --git a/ports/metrohash/portfile.cmake b/ports/metrohash/portfile.cmake index ad26b8b6dd1c6d..1c272c818cbced 100644 --- a/ports/metrohash/portfile.cmake +++ b/ports/metrohash/portfile.cmake @@ -18,7 +18,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/microsoft-signalr/CONTROL b/ports/microsoft-signalr/CONTROL new file mode 100644 index 00000000000000..0cec60bf9f9bfa --- /dev/null +++ b/ports/microsoft-signalr/CONTROL @@ -0,0 +1,13 @@ +Source: microsoft-signalr +Version: 0.1.0-alpha1-1 +Description: C++ Client for ASP.NET Core SignalR. +Default-Features: default-features +Homepage: https://github.com/aspnet/SignalR-Client-Cpp + +Feature: default-features +Build-Depends: microsoft-signalr[cpprestsdk] (!uwp) +Description: Features installed by default + +Feature: cpprestsdk +Description: Add default Http and WebSocket implementations using CppRestSDK +Build-Depends: cpprestsdk[default-features,websockets] \ No newline at end of file diff --git a/ports/microsoft-signalr/portfile.cmake b/ports/microsoft-signalr/portfile.cmake new file mode 100644 index 00000000000000..e566f594e49a3b --- /dev/null +++ b/ports/microsoft-signalr/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO aspnet/SignalR-Client-Cpp + REF v0.1.0-alpha1 + SHA512 d37eea194b0352a08dd89ac7622bdd6224312ad48a31d8ab36627a8aaff5e795e3513ad010eed516703f6da842a95119c1a4a290b145a43e91ff80a37fff8676 + HEAD_REF master +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + cpprestsdk USE_CPPRESTSDK +) + +if("cpprestsdk" IN_LIST FEATURES AND VCPKG_TARGET_IS_UWP) + message(FATAL_ERROR "microsoft-signalr[cpprestsdk] is not supported on UWP, use microsoft-signalr[core] instead") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + ${FEATURE_OPTIONS} + -DWALL=OFF +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/third-party-notices.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/microsoft-signalr) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/mimalloc/CONTROL b/ports/mimalloc/CONTROL index 7070cf192955f6..95fec2b75c803e 100644 --- a/ports/mimalloc/CONTROL +++ b/ports/mimalloc/CONTROL @@ -1,5 +1,5 @@ Source: mimalloc -Version: 1.6.1 +Version: 1.6.1-1 Description: Compact general purpose allocator with excellent performance Homepage: https://github.com/microsoft/mimalloc diff --git a/ports/mimalloc/fix-cmake.patch b/ports/mimalloc/fix-cmake.patch index e7db5265497044..d751a21c4ba945 100644 --- a/ports/mimalloc/fix-cmake.patch +++ b/ports/mimalloc/fix-cmake.patch @@ -1,62 +1,70 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e16830a..c68ae65 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -166,6 +166,7 @@ message(STATUS "") - # Main targets - # ----------------------------------------------------------------------------- - -+if(BUILD_SHARED_LIBS) - # shared library - add_library(mimalloc SHARED ${mi_sources}) - set_target_properties(mimalloc PROPERTIES VERSION ${mi_version} OUTPUT_NAME ${mi_basename} ) -@@ -178,12 +179,19 @@ target_include_directories(mimalloc PUBLIC - ) - if(WIN32) - # On windows copy the mimalloc redirection dll too. -- target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.lib) -- add_custom_command(TARGET mimalloc POST_BUILD -+ if(CMAKE_SIZEOF_VOID_P EQUAL 8) -+ target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.lib) -+ add_custom_command(TARGET mimalloc POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.dll" $ - COMMENT "Copy mimalloc-redirect.dll to output directory") -+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) -+ target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.lib) -+ add_custom_command(TARGET mimalloc POST_BUILD -+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.dll" $ -+ COMMENT "Copy mimalloc-redirect32.dll to output directory") -+ endif() - endif() -- -+else() - # static library - add_library(mimalloc-static STATIC ${mi_sources}) - target_compile_definitions(mimalloc-static PRIVATE ${mi_defines} MI_STATIC_LIB) -@@ -201,10 +209,13 @@ if(WIN32) - else() - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() -- -+endif() - # install static and shared library, and the include files --install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_dir} LIBRARY) --install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_dir}) -+if(BUILD_SHARED_LIBS) -+install(TARGETS mimalloc EXPORT mimalloc ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib NAMELINK_SKIP) -+else() -+install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION lib) -+endif() - install(FILES include/mimalloc.h DESTINATION ${mi_install_dir}/include) - install(FILES include/mimalloc-override.h DESTINATION ${mi_install_dir}/include) - install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_dir}/include) -@@ -234,9 +245,6 @@ target_include_directories(mimalloc-obj PUBLIC - - # the FILES expression can also be: $ - # but that fails cmake versions less than 3.10 so we leave it as is for now --install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/mimalloc-obj.dir/src/static.c${CMAKE_C_OUTPUT_EXTENSION} -- DESTINATION ${mi_install_dir} -- RENAME ${mi_basename}${CMAKE_C_OUTPUT_EXTENSION} ) - - # ----------------------------------------------------------------------------- - # API surface testing +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e16830a..3c7c8da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -166,6 +166,7 @@ message(STATUS "") + # Main targets + # ----------------------------------------------------------------------------- + ++if(BUILD_SHARED_LIBS) + # shared library + add_library(mimalloc SHARED ${mi_sources}) + set_target_properties(mimalloc PROPERTIES VERSION ${mi_version} OUTPUT_NAME ${mi_basename} ) +@@ -178,12 +179,27 @@ target_include_directories(mimalloc PUBLIC + ) + if(WIN32) + # On windows copy the mimalloc redirection dll too. +- target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.lib) +- add_custom_command(TARGET mimalloc POST_BUILD ++ if(CMAKE_SIZEOF_VOID_P EQUAL 8) ++ target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.lib) ++ add_custom_command(TARGET mimalloc POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.dll" $ + COMMENT "Copy mimalloc-redirect.dll to output directory") ++ install ( ++ FILES $/mimalloc-redirect.dll ++ DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ) ++ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) ++ target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.lib) ++ add_custom_command(TARGET mimalloc POST_BUILD ++ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.dll" $ ++ COMMENT "Copy mimalloc-redirect32.dll to output directory") ++ install ( ++ FILES $/mimalloc-redirect32.dll ++ DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ) ++ endif() + endif() +- ++else() + # static library + add_library(mimalloc-static STATIC ${mi_sources}) + target_compile_definitions(mimalloc-static PRIVATE ${mi_defines} MI_STATIC_LIB) +@@ -201,10 +217,13 @@ if(WIN32) + else() + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() +- ++endif() + # install static and shared library, and the include files +-install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_dir} LIBRARY) +-install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_dir}) ++if(BUILD_SHARED_LIBS) ++install(TARGETS mimalloc EXPORT mimalloc ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib NAMELINK_SKIP) ++else() ++install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION lib) ++endif() + install(FILES include/mimalloc.h DESTINATION ${mi_install_dir}/include) + install(FILES include/mimalloc-override.h DESTINATION ${mi_install_dir}/include) + install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_dir}/include) +@@ -234,9 +253,6 @@ target_include_directories(mimalloc-obj PUBLIC + + # the FILES expression can also be: $ + # but that fails cmake versions less than 3.10 so we leave it as is for now +-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/mimalloc-obj.dir/src/static.c${CMAKE_C_OUTPUT_EXTENSION} +- DESTINATION ${mi_install_dir} +- RENAME ${mi_basename}${CMAKE_C_OUTPUT_EXTENSION} ) + + # ----------------------------------------------------------------------------- + # API surface testing diff --git a/ports/mimalloc/portfile.cmake b/ports/mimalloc/portfile.cmake index 3db43aa017af82..e22aa461963acd 100644 --- a/ports/mimalloc/portfile.cmake +++ b/ports/mimalloc/portfile.cmake @@ -66,4 +66,3 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - 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/minhook/CONTROL b/ports/minhook/CONTROL index 0daab0e4c954be..1c475bd174af3b 100644 --- a/ports/minhook/CONTROL +++ b/ports/minhook/CONTROL @@ -1,4 +1,5 @@ Source: minhook Version: 1.3.3 +Port-Version: 1 Description: The Minimalistic x86/x64 API Hooking Library for Windows. Supports: !uwp \ No newline at end of file diff --git a/ports/minhook/fix-usage.patch b/ports/minhook/fix-usage.patch new file mode 100644 index 00000000000000..198b8795df02cf --- /dev/null +++ b/ports/minhook/fix-usage.patch @@ -0,0 +1,10 @@ +diff --git a/cmake/minhook-config.cmake.in b/cmake/minhook-config.cmake.in +index 14e6463..28fa17c 100644 +--- a/cmake/minhook-config.cmake.in ++++ b/cmake/minhook-config.cmake.in +@@ -36,4 +36,4 @@ set(MINHOOK_FOUND ON) + set_and_check(MINHOOK_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/") + set_and_check(MINHOOK_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/lib") + +-include("${PACKAGE_PREFIX_DIR}/lib/minhook/minhook-targets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/minhook-targets.cmake") diff --git a/ports/minhook/install-destination.patch b/ports/minhook/install-destination.patch deleted file mode 100644 index 13f3dc3799634c..00000000000000 --- a/ports/minhook/install-destination.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index df947af..6a894d8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -113,7 +113,7 @@ install( - "${CMAKE_CURRENT_BINARY_DIR}/minhook-config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/minhook-config-version.cmake" - DESTINATION -- "lib/minhook" -+ share/minhook - ) - - ################### -@@ -133,7 +133,7 @@ install( - NAMESPACE - minhook:: - DESTINATION -- "lib/minhook" -+ share/minhook - ) - - install( diff --git a/ports/minhook/portfile.cmake b/ports/minhook/portfile.cmake index 13779a3388ced2..bd022d5bcbcfb0 100644 --- a/ports/minhook/portfile.cmake +++ b/ports/minhook/portfile.cmake @@ -1,8 +1,4 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() - -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(BUILD_ARCH "Win32") @@ -30,20 +26,18 @@ vcpkg_from_github( HEAD_REF master PATCHES "${CMAKE_SUPPORT_PATCH}" - install-destination.patch + fix-usage.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/minhook) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/minhook-targets-debug.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/miniz/CONTROL b/ports/miniz/CONTROL index 88eacdb8559ca1..519eee29c37ebc 100644 --- a/ports/miniz/CONTROL +++ b/ports/miniz/CONTROL @@ -1,3 +1,4 @@ Source: miniz -Version: 2.1.0 +Version: 2.1.0-1 +Homepage: https://github.com/richgel999/miniz Description: Single C source file zlib-replacement library diff --git a/ports/miniz/portfile.cmake b/ports/miniz/portfile.cmake index 4de2dc3f3e7be6..b932b69f24541b 100644 --- a/ports/miniz/portfile.cmake +++ b/ports/miniz/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO richgel999/miniz @@ -18,8 +16,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() 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/miniz RENAME copyright) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT}) -vcpkg_test_cmake(PACKAGE_NAME miniz) +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/mlpack/CONTROL b/ports/mlpack/CONTROL index 6d6a897020fc0d..a56987c3b7e84c 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -1,8 +1,9 @@ Source: mlpack -Version: 3.2.2-1 +Version: 3.2.2 +Port-Version: 4 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 +Build-Depends: openblas (!osx), lapack, boost, armadillo, ensmallen, stb Feature: tools Description: Build command-line executables. diff --git a/ports/mlpack/portfile.cmake b/ports/mlpack/portfile.cmake index 21149bcfa1c309..a7d73b2e310ae7 100644 --- a/ports/mlpack/portfile.cmake +++ b/ports/mlpack/portfile.cmake @@ -28,13 +28,15 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBUILD_TESTS=OFF + -DDOWNLOAD_STB_IMAGE=OFF + -DDOWNLOAD_ENSMALLEN=OFF + -DBUILD_PYTHON_BINDINGS=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON ${FEATURE_OPTIONS} ) vcpkg_install_cmake() vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/COPYRIGHT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - if("tools" IN_LIST FEATURES) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) file(GLOB MLPACK_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) @@ -45,3 +47,5 @@ if("tools" IN_LIST FEATURES) 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 diff --git a/ports/mmloader/CONTROL b/ports/mmloader/CONTROL new file mode 100644 index 00000000000000..e575560629f0cd --- /dev/null +++ b/ports/mmloader/CONTROL @@ -0,0 +1,8 @@ +Source: mmloader +Version: 2020-05-15 +Description: A library for loading dll module bypassing windows PE loader from memory (x86/x64) +Homepage: http://tishion.github.io/mmLoader/ +Supports: (x86|x64)&windows&static + +Feature: shellcode +Description: Generate mmLoader shell code headers diff --git a/ports/mmloader/portfile.cmake b/ports/mmloader/portfile.cmake new file mode 100644 index 00000000000000..2a3411ce34faec --- /dev/null +++ b/ports/mmloader/portfile.cmake @@ -0,0 +1,42 @@ + +# fail early for unsupported triplets +vcpkg_fail_port_install( + MESSAGE "mmLoader supports only x86/x64-windows-static triplets" + ON_TARGET "UWP" "LINUX" "OSX" "ANDROID" "FREEBSD" + ON_ARCH "arm" "arm64" + ON_CRT_LINKAGE "dynamic" + ON_LIBRARY_LINKAGE "dynamic" +) + +# source +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tishion/mmLoader + REF 1.0.0 + SHA512 ceb2ab4b60d74209fa46d198cde6fd87a97d911abb875ac35383288a67828d0420bb38ff8d2f17dd4a3f46ba3abf554152d1246eeb05215258e8af64ac4a39de + HEAD_REF master +) + +# feature +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + shellcode BUILD_SHELLCODE_GEN +) + +# config +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${FEATURE_OPTIONS} +) + +# pre-clean +file(REMOVE_RECURSE ${SOURCE_PATH}/output) + +# build and install +vcpkg_install_cmake(DISABLE_PARALLEL) + +# remove the debug/include directory +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# collect license files +file(INSTALL ${SOURCE_PATH}/License DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index 643b2ec5f5a2bf..17df29f60de1f4 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,5 +1,5 @@ Source: mongo-c-driver -Version: 1.15.1-1 +Version: 1.16.1-1 Build-Depends: libbson, openssl (!windows), zlib Description: Client library written in C for MongoDB. Homepage: https://github.com/mongodb/mongo-c-driver diff --git a/ports/mongo-c-driver/disable-static-when-dynamic-build.patch b/ports/mongo-c-driver/disable-static-when-dynamic-build.patch new file mode 100644 index 00000000000000..5652d7bd7ea732 --- /dev/null +++ b/ports/mongo-c-driver/disable-static-when-dynamic-build.patch @@ -0,0 +1,61 @@ +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index 797aaec..91d97dc 100644 +--- a/src/libmongoc/CMakeLists.txt ++++ b/src/libmongoc/CMakeLists.txt +@@ -694,6 +694,7 @@ if (WIN32) + set (LIBRARIES ${LIBRARIES} ws2_32) + endif () + ++if (NOT MONGOC_ENABLE_STATIC) + add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) + target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) +@@ -706,7 +707,7 @@ target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION) + set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) + set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}") + +-if (MONGOC_ENABLE_STATIC) ++else () + add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + target_link_libraries (mongoc_static ${STATIC_LIBRARIES} ${BSON_LIBRARIES}) + target_include_directories (mongoc_static BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS}) +@@ -733,8 +734,13 @@ if (ENABLE_APPLE_FRAMEWORK) + endif () + + add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) ++if (NOT MONGOC_ENABLE_STATIC) + target_include_directories (mongoc-stat PRIVATE ${BSON_INCLUDE_DIRS}) + target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) ++else() ++target_include_directories (mongoc-stat PRIVATE ${BSON_INCLUDE_DIRS}) ++target_link_libraries (mongoc-stat mongoc_static ${LIBRARIES}) ++endif() + + # mongoc-stat works if shared memory performance counters are enabled. + if (ENABLE_SHM_COUNTERS STREQUAL "ON") +@@ -980,7 +986,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} + file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) + + if (MONGOC_ENABLE_STATIC) +- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) ++ set (TARGETS_TO_INSTALL mongoc_static) + else () + set (TARGETS_TO_INSTALL mongoc_shared) + endif () +@@ -1000,6 +1006,7 @@ install ( + ) + + if (MSVC) ++ if (NOT MONGOC_ENABLE_STATIC) + add_custom_command ( + TARGET mongoc_shared + POST_BUILD +@@ -1011,7 +1018,7 @@ if (MSVC) + FILES $/lib$ + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +- if (TARGET mongoc_static) ++ else () + add_custom_command ( + TARGET mongoc_static + POST_BUILD diff --git a/ports/mongo-c-driver/fix-arm-build.patch b/ports/mongo-c-driver/fix-arm-build.patch index 06d042b15318f1..8d61b745eff2af 100644 --- a/ports/mongo-c-driver/fix-arm-build.patch +++ b/ports/mongo-c-driver/fix-arm-build.patch @@ -1,24 +1,24 @@ diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt -index c8a4f02..78f69f2 100644 +index 91d97dc..ccebc2a 100644 --- a/src/libmongoc/CMakeLists.txt +++ b/src/libmongoc/CMakeLists.txt -@@ -645,6 +645,9 @@ endif () +@@ -698,6 +698,9 @@ if (NOT MONGOC_ENABLE_STATIC) add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) - target_link_libraries (mongoc_shared ${LIBRARIES} ${BSON_LIBRARIES}) + target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) +if (WIN32) -+ target_link_libraries (mongoc_shared Advapi32) ++ target_link_libraries (mongoc_shared PRIVATE Advapi32) +endif() - target_include_directories (mongoc_shared BEFORE PUBLIC ${BSON_INCLUDE_DIRS} ${MONGOC_INTERNAL_INCLUDE_DIRS}) - target_compile_definitions (mongoc_shared PUBLIC MONGOC_COMPILATION ${BSON_DEFINITIONS}) - -@@ -654,6 +657,9 @@ set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "mongoc-${MONGOC_API - if (MONGOC_ENABLE_STATIC) + target_include_directories (mongoc_shared BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS}) + target_include_directories (mongoc_shared PRIVATE ${PRIVATE_ZLIB_INCLUDES}) + target_include_directories (mongoc_shared PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES}) +@@ -710,6 +713,9 @@ set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BAS + else () add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) - target_link_libraries (mongoc_static ${LIBRARIES} ${BSON_STATIC_LIBRARIES}) -+ if (WIN32) + target_link_libraries (mongoc_static ${STATIC_LIBRARIES} ${BSON_LIBRARIES}) ++ if (WIN32) + target_link_libraries (mongoc_static Advapi32) + endif() - target_include_directories (mongoc_static BEFORE PUBLIC ${BSON_STATIC_INCLUDE_DIRS} ${MONGOC_INTERNAL_INCLUDE_DIRS}) - target_compile_definitions (mongoc_static PUBLIC MONGOC_COMPILATION MONGOC_STATIC ${BSON_STATIC_DEFINITIONS}) - set_target_properties (mongoc_static PROPERTIES VERSION 0.0.0) + target_include_directories (mongoc_static BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS}) + target_include_directories (mongoc_static PRIVATE ${PRIVATE_ZLIB_INCLUDES}) + target_include_directories (mongoc_static PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES}) diff --git a/ports/mongo-c-driver/fix-dependency-libbson.patch b/ports/mongo-c-driver/fix-dependency-libbson.patch new file mode 100644 index 00000000000000..68e7b2b9b7c99d --- /dev/null +++ b/ports/mongo-c-driver/fix-dependency-libbson.patch @@ -0,0 +1,87 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1a2b7ba..7c939d6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -169,14 +169,6 @@ if (ENABLE_BSON STREQUAL SYSTEM) + endif () + + set (USING_SYSTEM_BSON TRUE) +- if (NOT TARGET mongo::bson_shared) +- message (FATAL_ERROR "System libbson built without shared library target") +- endif () +- set (BSON_LIBRARIES mongo::bson_shared) +- if (NOT TARGET mongo::bson_static) +- message (FATAL_ERROR "System libbson built without static library target") +- endif () +- set (BSON_STATIC_LIBRARIES mongo::bson_static) + endif () + + unset (dist_generated CACHE) +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index 0f9e50c..797aaec 100644 +--- a/src/libmongoc/CMakeLists.txt ++++ b/src/libmongoc/CMakeLists.txt +@@ -700,6 +700,7 @@ target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIE + target_include_directories (mongoc_shared BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS}) + target_include_directories (mongoc_shared PRIVATE ${PRIVATE_ZLIB_INCLUDES}) + target_include_directories (mongoc_shared PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES}) ++target_include_directories (mongoc_shared PRIVATE ${BSON_INCLUDE_DIRS}) + target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION) + + set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) +@@ -707,10 +708,11 @@ set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BAS + + if (MONGOC_ENABLE_STATIC) + add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) +- target_link_libraries (mongoc_static ${STATIC_LIBRARIES} ${BSON_STATIC_LIBRARIES}) ++ target_link_libraries (mongoc_static ${STATIC_LIBRARIES} ${BSON_LIBRARIES}) + target_include_directories (mongoc_static BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS}) + target_include_directories (mongoc_static PRIVATE ${PRIVATE_ZLIB_INCLUDES}) + target_include_directories (mongoc_static PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES}) ++ target_include_directories (mongoc_static PRIVATE ${BSON_INCLUDE_DIRS}) + target_compile_definitions (mongoc_static + PUBLIC MONGOC_STATIC ${BSON_STATIC_PUBLIC_DEFINITIONS} + PRIVATE MONGOC_COMPILATION +@@ -731,6 +733,7 @@ if (ENABLE_APPLE_FRAMEWORK) + endif () + + add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) ++target_include_directories (mongoc-stat PRIVATE ${BSON_INCLUDE_DIRS}) + target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) + + # mongoc-stat works if shared memory performance counters are enabled. +diff --git a/src/libmongoc/build/cmake/libmongoc-1.0-config.cmake.in b/src/libmongoc/build/cmake/libmongoc-1.0-config.cmake.in +index feeca02..62aa21a 100644 +--- a/src/libmongoc/build/cmake/libmongoc-1.0-config.cmake.in ++++ b/src/libmongoc/build/cmake/libmongoc-1.0-config.cmake.in +@@ -19,7 +19,7 @@ set (MONGOC_MINOR_VERSION @MONGOC_MINOR_VERSION@) + set (MONGOC_MICRO_VERSION @MONGOC_MICRO_VERSION@) + set (MONGOC_VERSION @MONGOC_VERSION@) + +-find_package (libbson-1.0 "@MONGOC_MAJOR_VERSION@.@MONGOC_MINOR_VERSION@" REQUIRED) ++find_package (bson-1.0 "@MONGOC_MAJOR_VERSION@.@MONGOC_MINOR_VERSION@" REQUIRED) + + @PACKAGE_INIT@ + +diff --git a/src/libmongoc/build/cmake/libmongoc-static-1.0-config.cmake.in b/src/libmongoc/build/cmake/libmongoc-static-1.0-config.cmake.in +index 6f05b0c..113804e 100644 +--- a/src/libmongoc/build/cmake/libmongoc-static-1.0-config.cmake.in ++++ b/src/libmongoc/build/cmake/libmongoc-static-1.0-config.cmake.in +@@ -19,7 +19,7 @@ set (MONGOC_STATIC_MINOR_VERSION @MONGOC_MINOR_VERSION@) + set (MONGOC_STATIC_MICRO_VERSION @MONGOC_MICRO_VERSION@) + set (MONGOC_STATIC_VERSION @MONGOC_VERSION@) + +-find_package (libbson-static-1.0 "@MONGOC_MAJOR_VERSION@.@MONGOC_MINOR_VERSION@" REQUIRED) ++find_package (bson-1.0 "@MONGOC_MAJOR_VERSION@.@MONGOC_MINOR_VERSION@" REQUIRED) + + @PACKAGE_INIT@ + +@@ -57,3 +57,7 @@ foreach (LIB @SASL_LIBRARIES@ @SSL_LIBRARIES@ @SHM_LIBRARIES@ @ZLIB_LIBRARIES@ + endforeach () + + set (MONGOC_STATIC_DEFINITIONS MONGOC_STATIC ${BSON_STATIC_DEFINITIONS}) ++ ++set (MONGOC_INCLUDE_DIRS ${MONGOC_STATIC_INCLUDE_DIRS}) ++set (MONGOC_LIBRARIES ${MONGOC_STATIC_LIBRARIES}) ++set (MONGOC_DEFINITIONS ${MONGOC_STATIC_DEFINITIONS}) +\ No newline at end of file diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 0c737a0f4659d0..3516886b128622 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,142 +1,136 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO mongodb/mongo-c-driver - REF 541086adcf1eecf88ac09fda47d9a8ec1598015d # debian/1.15.1-1 - SHA512 a57438dfae9d0993ae04b7a76677f79331699898f21e7645db5edd2c91014f33b738a0af67b58234d1ee03aab2ae3b58c183bbd043fc2bde5cc1a4e111755b70 - HEAD_REF master - PATCHES fix-arm-build.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "snappy" ENABLE_SNAPPY - "icu" ENABLE_ICU -) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(ENABLE_STATIC ON) -else() - set(ENABLE_STATIC OFF) -endif() - -if(VCPKG_TARGET_IS_WINDOWS) - set(ENABLE_SSL "WINDOWS") -else() - set(ENABLE_SSL "OPENSSL") -endif() - -file(READ ${CMAKE_CURRENT_LIST_DIR}/CONTROL _contents) -string(REGEX MATCH "\nVersion:[ ]*[^ \n]+" _contents "${_contents}") -string(REGEX REPLACE ".+Version:[ ]*([\\.0-9]+).*" "\\1" BUILD_VERSION "${_contents}") - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DENABLE_MONGOC=ON - -DENABLE_BSON=ON - -DENABLE_TESTS=OFF - -DENABLE_EXAMPLES=OFF - -DENABLE_SSL=${ENABLE_SSL} - -DENABLE_ZLIB=SYSTEM - -DENABLE_STATIC=${ENABLE_STATIC} - -DBUILD_VERSION=${BUILD_VERSION} - ${FEATURE_OPTIONS} -) - -vcpkg_install_cmake() - -if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libmongoc-static-1.0) -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libmongoc-1.0) -endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -# This rename is needed because the official examples expect to use #include -# See Microsoft/vcpkg#904 -file(RENAME - ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 - ${CURRENT_PACKAGES_DIR}/temp) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_TARGET_IS_UWP) - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/libmongoc-static-1.0.a - ${CURRENT_PACKAGES_DIR}/lib/libmongoc-1.0.a) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/libmongoc-static-1.0.a - ${CURRENT_PACKAGES_DIR}/debug/lib/libmongoc-1.0.a) - else() - file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) - file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) - endif() - - # drop the __declspec(dllimport) when building static - file(READ ${CURRENT_PACKAGES_DIR}/include/mongoc/mongoc-macros.h MONGOC_MACROS_H) - string(REPLACE "define MONGOC_API __declspec(dllimport)" "define MONGOC_API" MONGOC_MACROS_H "${MONGOC_MACROS_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/mongoc/mongoc-macros.h "${MONGOC_MACROS_H}") - - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) -endif() - -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/copyright COPYONLY) -file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(PORT_POSTFIX "static-1.0") -else() - set(PORT_POSTFIX "1.0") -endif() - -# Create cmake files for _both_ find_package(mongo-c-driver) and find_package(libmongoc-static-1.0)/find_package(libmongoc-1.0) -file(READ ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config.cmake LIBMONGOC_CONFIG_CMAKE) - -# Patch: Set _IMPORT_PREFIX and replace PACKAGE_PREFIX_DIR -string(REPLACE -[[ -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) -]] -[[ -# VCPKG PATCH SET IMPORT_PREFIX -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() -]] - LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") -string(REPLACE [[PACKAGE_PREFIX_DIR]] [[_IMPORT_PREFIX]] LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") - -string(REPLACE "/include/libmongoc-1.0" "/include" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") -string(REPLACE "mongoc-static-1.0" "mongoc-1.0" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") -#Something similar is probably required for windows too! -string(REPLACE "/lib/libssl.a" "\$<\$:/debug>/lib/libssl.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") -string(REPLACE "/lib/libcrypto.a" "\$<\$:/debug>/lib/libcrypto.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") -string(REPLACE "/lib/libz.a" "\$<\$:/debug>/lib/libz.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") - -file(WRITE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config.cmake "${LIBMONGOC_CONFIG_CMAKE}") -file(COPY ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}) -file(COPY ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config.cmake ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config-version.cmake) - -vcpkg_copy_pdbs() - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libbson-1.0.pc ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libbson-1.0.pc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libbson-static-1.0.pc ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libbson-static-1.0.pc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/libbson-1.0.dll ${CURRENT_PACKAGES_DIR}/bin/libbson-1.0.dll) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/libbson-1.0.pdb ${CURRENT_PACKAGES_DIR}/bin/libbson-1.0.pdb) +# This port needs to be updated at the same time as libbson +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mongodb/mongo-c-driver + REF 99d422877c5b5ea52006c13ee3b48297251b2b2d # debian/1.16.1 + SHA512 e2f129439ff3697981774e0de35586a6afe98838acfc52d8a115bcb298350f2779b886dc6b27130e78b3b81f9b0a85b2bc6bcef246f9685c05f6789747c4739d + HEAD_REF master + PATCHES + fix-dependency-libbson.patch + disable-static-when-dynamic-build.patch + fix-arm-build.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "snappy" ENABLE_SNAPPY + "icu" ENABLE_ICU +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(ENABLE_STATIC ON) +else() + set(ENABLE_STATIC OFF) +endif() + +if(VCPKG_TARGET_IS_WINDOWS) + set(ENABLE_SSL "WINDOWS") +else() + set(ENABLE_SSL "OPENSSL") +endif() + +file(READ ${CMAKE_CURRENT_LIST_DIR}/CONTROL _contents) +string(REGEX MATCH "\nVersion:[ ]*[^ \n]+" _contents "${_contents}") +string(REGEX REPLACE ".+Version:[ ]*([\\.0-9]+).*" "\\1" BUILD_VERSION "${_contents}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DENABLE_MONGOC=ON + -DENABLE_BSON=SYSTEM + -DENABLE_TESTS=OFF + -DENABLE_EXAMPLES=OFF + -DENABLE_SSL=${ENABLE_SSL} + -DENABLE_ZLIB=SYSTEM + -DENABLE_STATIC=${ENABLE_STATIC} + -DBUILD_VERSION=${BUILD_VERSION} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +set(PORT_POSTFIX "1.0") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libmongoc-static-${PORT_POSTFIX} TARGET_PATH share/libmongoc-${PORT_POSTFIX}) +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libmongoc-${PORT_POSTFIX} TARGET_PATH share/libmongoc-${PORT_POSTFIX}) +endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# This rename is needed because the official examples expect to use #include +# See Microsoft/vcpkg#904 +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libmongoc-${PORT_POSTFIX} + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_TARGET_IS_UWP) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/libmongoc-static-1.0.a + ${CURRENT_PACKAGES_DIR}/lib/libmongoc-1.0.a) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongoc-static-1.0.a + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongoc-1.0.a) + else() + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + endif() + + # drop the __declspec(dllimport) when building static + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/mongoc/mongoc-macros.h + "define MONGOC_API __declspec(dllimport)" "define MONGOC_API") + + file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-static-${PORT_POSTFIX}-config.cmake + ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-${PORT_POSTFIX}-config.cmake) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-static-${PORT_POSTFIX}-config-version.cmake + ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-${PORT_POSTFIX}-config-version.cmake) + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) +endif() + +# Create cmake files for _both_ find_package(mongo-c-driver) and find_package(libmongoc-static-1.0)/find_package(libmongoc-1.0) +file(READ ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-${PORT_POSTFIX}-config.cmake LIBMONGOC_CONFIG_CMAKE) + +# Patch: Set _IMPORT_PREFIX and replace PACKAGE_PREFIX_DIR +string(REPLACE +[[ +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) +]] +[[ +# VCPKG PATCH SET IMPORT_PREFIX +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() +]] + LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") +string(REPLACE [[PACKAGE_PREFIX_DIR]] [[_IMPORT_PREFIX]] LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") + +string(REPLACE "/include/libmongoc-1.0" "/include" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") +string(REPLACE "mongoc-static-1.0" "mongoc-1.0" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") +#Something similar is probably required for windows too! +if (NOT VCPKG_TARGET_IS_WINDOWS) + string(REPLACE "/lib/libssl.a" "\$<\$:/debug>/lib/libssl.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") + string(REPLACE "/lib/libcrypto.a" "\$<\$:/debug>/lib/libcrypto.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") + string(REPLACE "/lib/libz.a" "\$<\$:/debug>/lib/libz.a" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}") +endif() + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/libmongoc-${PORT_POSTFIX}/libmongoc-${PORT_POSTFIX}-config.cmake "${LIBMONGOC_CONFIG_CMAKE}") + +file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYING 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/mongo-c-driver/usage b/ports/mongo-c-driver/usage index 80595cd07b822d..d3347960ed38c0 100644 --- a/ports/mongo-c-driver/usage +++ b/ports/mongo-c-driver/usage @@ -1,9 +1,7 @@ The package mongo-c-driver is compatible with built-in CMake targets: - find_package(mongo-c-driver CONFIG REQUIRED) - target_include_directories(${project} PRIVATE ${MONGOC_INCLUDE_DIRS}) + find_package(libmongoc-1.0 CONFIG REQUIRED) -For use dynamic library: - target_link_libraries(${project} PRIVATE ${MONGOC_LIBRARIES}) -For use static library: - target_link_libraries(${project} PRIVATE ${MONGOC_STATIC_LIBRARY}) + target_include_directories(main PRIVATE ${MONGOC_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${MONGOC_LIBRARIES}) + target_compile_definitions(main PRIVATE ${MONGOC_DEFINITIONS}) diff --git a/ports/mongo-cxx-driver/CONTROL b/ports/mongo-cxx-driver/CONTROL index 72ca6d72ff85cc..ecd41b43cbc9de 100644 --- a/ports/mongo-cxx-driver/CONTROL +++ b/ports/mongo-cxx-driver/CONTROL @@ -1,5 +1,5 @@ Source: mongo-cxx-driver -Version: 3.4.0-4 +Version: 3.4.0-5 Build-Depends: libbson, mongo-c-driver, boost-smart-ptr, boost-optional, boost-utility Homepage: https://github.com/mongodb/mongo-cxx-driver Description: MongoDB C++ Driver. diff --git a/ports/mongo-cxx-driver/fix-dependency-libbson.patch b/ports/mongo-cxx-driver/fix-dependency-libbson.patch new file mode 100644 index 00000000000000..405919c635176a --- /dev/null +++ b/ports/mongo-cxx-driver/fix-dependency-libbson.patch @@ -0,0 +1,25 @@ +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index 69b53b3..655b33a 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -78,15 +78,15 @@ set(LIBBSON_REQUIRED_VERSION 1.13.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) + + if (BUILD_SHARED_LIBS) +- find_package(libbson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} REQUIRED) ++ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} CONFIG REQUIRED) + set(libbson_libraries ${BSON_LIBRARIES}) + set(libbson_include_directories ${BSON_INCLUDE_DIRS}) + set(libbson_definitions ${BSON_DEFINITIONS}) + else() +- find_package(libbson-static-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} REQUIRED) +- set(libbson_libraries ${BSON_STATIC_LIBRARIES}) +- set(libbson_include_directories ${BSON_STATIC_INCLUDE_DIRS}) +- set(libbson_definitions ${BSON_STATIC_DEFINITIONS}) ++ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} CONFIG REQUIRED) ++ set(libbson_libraries ${BSON_LIBRARIES}) ++ set(libbson_include_directories ${BSON_INCLUDE_DIRS}) ++ set(libbson_definitions ${BSON_DEFINITIONS}) + endif() + + add_subdirectory(third_party) diff --git a/ports/mongo-cxx-driver/fix-dependency-mongocdriver.patch b/ports/mongo-cxx-driver/fix-dependency-mongocdriver.patch new file mode 100644 index 00000000000000..99a6a8efc2cddd --- /dev/null +++ b/ports/mongo-cxx-driver/fix-dependency-mongocdriver.patch @@ -0,0 +1,19 @@ +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 64ff936..e4d4e14 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -39,10 +39,10 @@ if (BUILD_SHARED_LIBS) + set(libmongoc_include_directories ${MONGOC_INCLUDE_DIRS}) + set(libmongoc_definitions ${MONGOC_DEFINITIONS}) + else() +- find_package(libmongoc-static-${LIBMONGOC_REQUIRED_ABI_VERSION} ${LIBMONGOC_REQUIRED_VERSION} REQUIRED) +- set(libmongoc_libraries ${MONGOC_STATIC_LIBRARIES}) +- set(libmongoc_include_directories ${MONGOC_STATIC_INCLUDE_DIRS}) +- set(libmongoc_definitions ${MONGOC_STATIC_DEFINITIONS}) ++ find_package(libmongoc-${LIBMONGOC_REQUIRED_ABI_VERSION} ${LIBMONGOC_REQUIRED_VERSION} REQUIRED) ++ set(libmongoc_libraries ${MONGOC_LIBRARIES}) ++ set(libmongoc_include_directories ${MONGOC_INCLUDE_DIRS}) ++ set(libmongoc_definitions ${MONGOC_DEFINITIONS}) + endif() + + add_subdirectory(config) diff --git a/ports/mongo-cxx-driver/github-654.patch b/ports/mongo-cxx-driver/github-654.patch new file mode 100644 index 00000000000000..f0eda2923b85aa --- /dev/null +++ b/ports/mongo-cxx-driver/github-654.patch @@ -0,0 +1,30 @@ +From e1a92d8bf8f07abc89350a956819b78df05bc4fe Mon Sep 17 00:00:00 2001 +From: Billy Robert O'Neal III +Date: Mon, 25 May 2020 20:47:58 -0700 +Subject: [PATCH] Disable trivially_constructible test for atomic on MSVC++. + +MSVC++ implements P0883 unconditionally, which changes the rules for std::atomic. It removes atomic's trivial constructor, and makes the default constructor value initialize the T. + +Note that Mongo was not following the C++11 rules, because it used the atomic before calling atomic_init first. MSVC++ never implemented the C++11 rules and previously default initialized the T. + +All versions of MSVC++ will provide constant initialization of the guarded value "current_instance". In old versions, atomic didn't implement P0883 due to bugs in the constexpr evaluator; in current versions the constexpr evaluator was fixed and atomic value initializes unconditionally. Therefore, this PR disables the check whenever MSVC++'s standard library is detected. + +See https://github.com/microsoft/STL/issues/661 for further discussion. +--- + src/mongocxx/instance.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/mongocxx/instance.cpp b/src/mongocxx/instance.cpp +index e67d41ec7..6eb456c65 100644 +--- a/src/mongocxx/instance.cpp ++++ b/src/mongocxx/instance.cpp +@@ -75,7 +75,8 @@ typename std::aligned_storage::type sentine + std::atomic current_instance{nullptr}; + static_assert(std::is_standard_layout::value, + "Must be standard layout"); +-#if (!defined(__GNUC__) || (defined(__clang__) && !defined(__GLIBCXX__))) || (__GNUC__ >= 5) ++#if (!defined(_MSVC_STL_VERSION)) \ ++ && ((!defined(__GNUC__) || (defined(__clang__) && !defined(__GLIBCXX__))) || (__GNUC__ >= 5)) + static_assert(std::is_trivially_constructible::value, + "Must be trivially constructible"); + #endif diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index c50d2ef1721bd4..695843e288c453 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -13,11 +13,18 @@ vcpkg_from_github( fix-uwp.patch disable-c2338-mongo-cxx-driver.patch disable_test_and_example.patch + fix-dependency-libbson.patch + fix-dependency-mongocdriver.patch + github-654.patch ) if ("mnmlstc" IN_LIST FEATURES) + if (VCPKG_TARGET_IS_WINDOWS) + message(FATAL_ERROR "Feature mnmlstc only support UNIX") + endif() set(BSONCXX_POLY MNMLSTC) elseif ("system-mnmlstc" IN_LIST FEATURES) + message("Please make sure you have mnmlstc installed via the package manager") set(BSONCXX_POLY SYSTEM_MNMLSTC) elseif ("boost" IN_LIST FEATURES) set(BSONCXX_POLY BOOST) diff --git a/ports/monkeys-audio/CONTROL b/ports/monkeys-audio/CONTROL index 59ff09a739977d..388299f8c7e25f 100644 --- a/ports/monkeys-audio/CONTROL +++ b/ports/monkeys-audio/CONTROL @@ -1,9 +1,9 @@ Source: monkeys-audio -Version: 5.24 +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 ends with .ape extension. -Supports: !uwp + Audio files compressed with it end with .ape extension. +Supports: !(uwp|osx|linux) Feature: tools Description: Build monkeys-audio tools diff --git a/ports/monkeys-audio/fix-project-config.patch b/ports/monkeys-audio/fix-project-config.patch new file mode 100644 index 00000000000000..08351e178b9af5 --- /dev/null +++ b/ports/monkeys-audio/fix-project-config.patch @@ -0,0 +1,16 @@ +diff --git a/Source/Projects/VS2019/MACDll/MACDll.vcxproj b/Source/Projects/VS2019/MACDll/MACDll.vcxproj +index 4e84b52..79882b0 100644 +--- a/Source/Projects/VS2019/MACDll/MACDll.vcxproj ++++ b/Source/Projects/VS2019/MACDll/MACDll.vcxproj +@@ -75,10 +75,9 @@ + <_ProjectFileVersion>11.0.50727.1 + + +- C:\Applications\Winamp\plugins\ ++ $(Configuration)\ + $(Configuration)\ + true +- in_ape.dll + + + $(Configuration)\ diff --git a/ports/monkeys-audio/portfile.cmake b/ports/monkeys-audio/portfile.cmake index 984fce5991b907..f0edaaf32e0c77 100644 --- a/ports/monkeys-audio/portfile.cmake +++ b/ports/monkeys-audio/portfile.cmake @@ -2,18 +2,19 @@ vcpkg_fail_port_install(ON_TARGET "UWP" "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) -set(MA_VERSION 524) +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 799035463f16dc94439e14c6b4a3755fbcf67e924d1c4925e26bb8172ff77122cf3e347f84d7e470dbddde79430f590dbeb1f69d6419cd36633cc8c616ea04f8 + SHA512 036c75f4cc8dc54837b2f9f822d260ebdbed918dff9ac744746e2786d13a33364d0cd7f380f015e89eaf5ebedd7180df979dfd15cb8f0160e339fafebc93f4ba ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} NO_REMOVE_ONE_LEVEL + PATCHES fix-project-config.patch ) file(REMOVE_RECURSE @@ -66,4 +67,4 @@ file(COPY ${SOURCE_PATH}/Shared/ FILES_MATCHING PATTERN "*.h") file(REMOVE ${CURRENT_PACKAGES_DIR}/include/monkeys-audio/MACDll.h) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/license DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/license DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL deleted file mode 100644 index 3b06305c52d9c2..00000000000000 --- a/ports/mosquitto/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: mosquitto -Version: 1.6.8 -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 2a5d7274e2e2ed..8c83401c94e366 100644 --- a/ports/mosquitto/portfile.cmake +++ b/ports/mosquitto/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) # This is a lie. mosquitto can be build staticlly it just must be implemented by vcpkg - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eclipse/mosquitto @@ -10,6 +8,7 @@ vcpkg_from_github( archive-dest.patch win64-cmake.patch libwebsockets.patch + support-static-build.patch ) vcpkg_configure_cmake( @@ -43,11 +42,11 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_rr${VCPKG_TARGET_EXECUTABLE_SU file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX}) file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX}) -#if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - endif() -#endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +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) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mosquitto/support-static-build.patch b/ports/mosquitto/support-static-build.patch new file mode 100644 index 00000000000000..28d7d779aacb14 --- /dev/null +++ b/ports/mosquitto/support-static-build.patch @@ -0,0 +1,38 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index bd60b75..cc01a2a 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -60,7 +60,7 @@ if (UNIX AND NOT APPLE) + endif (UNIX AND NOT APPLE) + + if (WIN32) +- set (LIBRARIES ${LIBRARIES} ws2_32) ++ set (LIBRARIES ${LIBRARIES} ws2_32 crypt32) + endif (WIN32) + + if (WITH_SRV) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7898ff5..23b3fe8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -158,7 +158,7 @@ if (UNIX) + endif (UNIX) + + if (WIN32) +- set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32) ++ set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32 crypt32) + endif (WIN32) + + if (WITH_WEBSOCKETS) +@@ -189,6 +189,10 @@ install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL + + if (WITH_TLS) + add_executable(mosquitto_passwd mosquitto_passwd.c) +- target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) ++ if(WIN32) ++ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES} ws2_32 crypt32) ++ else() ++ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) ++ endif() + install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif (WITH_TLS) 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 2f786a1c21c7db..998e5eacfe4b3f 100644 --- a/ports/mozjpeg/CONTROL +++ b/ports/mozjpeg/CONTROL @@ -1,4 +1,5 @@ Source: mozjpeg -Version: 3.2-3 +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 677ce9337d0056..0d0a283652a6c2 100644 --- a/ports/mozjpeg/fix-install-error.patch +++ b/ports/mozjpeg/fix-install-error.patch @@ -1,87 +1,33 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ac0ebdb..483bf0f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -875,43 +875,51 @@ add_custom_target(installer - cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND} - SOURCES mozjpeg.nsi) - -+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 lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin) -+ ARCHIVE DESTINATION lib/mozjpeg -+ LIBRARY DESTINATION lib/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) - endif() - if(ENABLE_STATIC) -- install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) -+ install(TARGETS turbojpeg-static -+ LIBRARY DESTINATION lib/mozjpeg -+ ARCHIVE DESTINATION lib/mozjpeg) - if(NOT ENABLE_SHARED) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe -- DESTINATION bin RENAME tjbench.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/tjbench-static.exe -+ DESTINATION tools/mozjpeg RENAME tjbench.exe) - endif() - endif() -- install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) -+ install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include/mozjpeg) - endif() - - if(ENABLE_STATIC) -- install(TARGETS jpeg-static ARCHIVE DESTINATION lib) -+ install(TARGETS jpeg-static ARCHIVE DESTINATION lib/mozjpeg) - if(NOT ENABLE_SHARED) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe -- DESTINATION bin RENAME cjpeg.exe) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe -- DESTINATION bin RENAME djpeg.exe) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe -- DESTINATION bin RENAME jpegtran.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/cjpeg-static.exe -+ DESTINATION tools/mozjpeg RENAME cjpeg.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/djpeg-static.exe -+ DESTINATION tools/mozjpeg RENAME djpeg.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/jpegtran-static.exe -+ DESTINATION tools/mozjpeg RENAME jpegtran.exe) - endif() - endif() - --install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) -+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) - - install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README-mozilla.txt - ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt - ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt - ${CMAKE_SOURCE_DIR}/wizard.txt -- DESTINATION doc) -+ DESTINATION share/mozjpeg) - - install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h - ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h -- DESTINATION include) -+ DESTINATION include/mozjpeg) -diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt -index 268cc14..d067d2a 100644 ---- a/sharedlib/CMakeLists.txt -+++ b/sharedlib/CMakeLists.txt -@@ -68,6 +68,6 @@ add_executable(jcstest ../jcstest.c) - target_link_libraries(jcstest jpeg) - - install(TARGETS jpeg cjpeg djpeg jpegtran -- ARCHIVE DESTINATION lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin) -+ ARCHIVE DESTINATION lib/mozjpeg -+ LIBRARY DESTINATION lib/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1369,13 +1369,13 @@ + ############################################################################### + + set(EXE ${CMAKE_EXECUTABLE_SUFFIX}) + + if(WITH_TURBOJPEG) + if(ENABLE_SHARED) +- 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 "$" +@@ -1413,13 +1413,13 @@ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) + install(PROGRAMS ${DIR}/jpegtran-static${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 ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt + ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c + ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt + ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt diff --git a/ports/mozjpeg/portfile.cmake b/ports/mozjpeg/portfile.cmake index d771fd20534b76..9c756e778d11e8 100644 --- a/ports/mozjpeg/portfile.cmake +++ b/ports/mozjpeg/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mozilla/mozjpeg - REF v3.2 - SHA512 d14789827a9f4f78139a3945d3169d37eb891758b5ab40ef19e99ebebb2fb6d7c3a05495de245bba54cfd913b153af352159aa9fc0218127f97819137e0f1ab8 + REF 6d95c51adf0c314017f541b6cb07e13cc1bce754 + SHA512 a21c8b3a561b387933a27befaa1d05a8c63b0e203d72d73071a4c9b57c6b7d57b44836f211c4dcb80eee4b01876f0a0fb4c91a60c3ae867e906e5e4e27165627 HEAD_REF master PATCHES fix-install-error.patch @@ -12,41 +10,48 @@ vcpkg_from_github( vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) -set(ENV{PATH} "$ENV{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() +vcpkg_add_to_path(${NASM_EXE_PATH}) +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_tool_dependencies(${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) endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/mozjpeg RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/mp3lame/CONTROL b/ports/mp3lame/CONTROL index 1702751d90e22f..5cf9000651de60 100644 --- a/ports/mp3lame/CONTROL +++ b/ports/mp3lame/CONTROL @@ -1,4 +1,4 @@ Source: mp3lame -Version: 3.100 +Version: 3.100-3 Homepage: http://lame.sourceforge.net/ Description: LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL. diff --git a/ports/mp3lame/portfile.cmake b/ports/mp3lame/portfile.cmake index a9b9e17e4ea739..7abe9010f55101 100644 --- a/ports/mp3lame/portfile.cmake +++ b/ports/mp3lame/portfile.cmake @@ -1,17 +1,11 @@ -include(vcpkg_common_functions) - set(VERSION 3.100) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://downloads.sourceforge.net/project/lame/lame/${VERSION}/lame-${VERSION}.tar.gz" - FILENAME "lame-3.100.tar.gz" - SHA512 0844b9eadb4aacf8000444621451277de365041cc1d97b7f7a589da0b7a23899310afd4e4d81114b9912aa97832621d20588034715573d417b2923948c08634b -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE_FILE} + REPO lame/lame REF ${VERSION} + FILENAME "lame-${VERSION}.tar.gz" + SHA512 0844b9eadb4aacf8000444621451277de365041cc1d97b7f7a589da0b7a23899310afd4e4d81114b9912aa97832621d20588034715573d417b2923948c08634b PATCHES 00001-msvc-upgrade-solution-up-to-vc11.patch ) diff --git a/ports/mpg123/0004-add-arm64-uwp-config.patch b/ports/mpg123/0004-add-arm64-uwp-config.patch new file mode 100644 index 00000000000000..be18b6a822ab26 --- /dev/null +++ b/ports/mpg123/0004-add-arm64-uwp-config.patch @@ -0,0 +1,181 @@ +diff --git a/ports/MSVC++/2015/uwp/libmpg123.sln b/ports/MSVC++/2015/uwp/libmpg123.sln +index 6e4eaee..ecedd3d 100644 +--- a/ports/MSVC++/2015/uwp/libmpg123.sln ++++ b/ports/MSVC++/2015/uwp/libmpg123.sln +@@ -8,21 +8,27 @@ EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM ++ Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM ++ Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM.ActiveCfg = Debug|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM.Build.0 = Debug|ARM ++ {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM64.ActiveCfg = Debug|ARM64 ++ {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM64.Build.0 = Debug|ARM64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x64.ActiveCfg = Debug|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x64.Build.0 = Debug|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x86.ActiveCfg = Debug|Win32 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x86.Build.0 = Debug|Win32 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM.ActiveCfg = Release|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM.Build.0 = Release|ARM ++ {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM64.ActiveCfg = Release|ARM64 ++ {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM64.Build.0 = Release|ARM64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x64.ActiveCfg = Release|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x64.Build.0 = Release|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x86.ActiveCfg = Release|Win32 +diff --git a/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj +index 0e54f92..91f40db 100644 +--- a/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj ++++ b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj +@@ -5,6 +5,10 @@ + Debug + ARM + ++ ++ Debug ++ ARM64 ++ + + Debug + Win32 +@@ -17,6 +21,10 @@ + Release + ARM + ++ ++ Release ++ ARM64 ++ + + Release + Win32 +@@ -76,6 +84,8 @@ + true + true + true ++ true ++ true + + + +@@ -105,6 +115,8 @@ + true + true + true ++ true ++ true + + + +@@ -206,6 +218,11 @@ + true + v140 + ++ ++ DynamicLibrary ++ true ++ v140 ++ + + DynamicLibrary + true +@@ -221,6 +238,11 @@ + false + v140 + ++ ++ DynamicLibrary ++ false ++ v140 ++ + + DynamicLibrary + false +@@ -240,9 +262,15 @@ + + + ++ ++ ++ + + + ++ ++ ++ + + + +@@ -273,6 +301,15 @@ + false + false + ++ ++ false ++ false ++ ++ ++ false ++ false ++ false ++ + + false + false +@@ -497,6 +534,48 @@ yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_ + + + ++ ++ ++ NotUsing ++ false ++ $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) ++ WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;%(PreprocessorDefinitions) ++ CompileAsC ++ 4996;%(DisableSpecificWarnings) ++ ++ ++ Console ++ false ++ false ++ $(OutDir) ++ Default ++ ++ ++ ++ ++ ++ ++ ++ ++ NotUsing ++ false ++ $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) ++ WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;%(PreprocessorDefinitions) ++ CompileAsC ++ 4996;%(DisableSpecificWarnings) ++ MultiThreadedDLL ++ ++ ++ Console ++ false ++ false ++ $(OutDir) ++ ++ ++ ++ ++ ++ + + + NotUsing diff --git a/ports/mpg123/CONTROL b/ports/mpg123/CONTROL index 47692364eaf74c..3e7705ab08f280 100644 --- a/ports/mpg123/CONTROL +++ b/ports/mpg123/CONTROL @@ -1,4 +1,5 @@ Source: mpg123 -Version: 1.25.8-6 +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). \ No newline at end of file +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 0d216b9428bc0d..9438c58115e5fa 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(MPG123_VERSION 1.25.8) set(MPG123_HASH f226317dddb07841a13753603fa13c0a867605a5a051626cb30d45cfba266d3d4296f5b8254f65b403bb5eef6addce1784ae8829b671a746854785cda1bad203) @@ -25,28 +23,58 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(MPG123_CONFIGURATION_SUFFIX _Dll) endif() -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/project/mpg123/mpg123/${MPG123_VERSION}/mpg123-${MPG123_VERSION}.tar.bz2" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO mpg123/mpg123 + REF ${MPG123_VERSION} FILENAME "mpg123-${MPG123_VERSION}.tar.bz2" SHA512 ${MPG123_HASH} -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH PATCHES 0001-fix-crt-linking.patch 0002-fix-x86-build.patch 0003-add-arm-configs.patch + 0004-add-arm64-uwp-config.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") -if(VCPKG_TARGET_IS_WINDOWS) +if(VCPKG_TARGET_IS_UWP) + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj + OPTIONS /p:UseEnv=True + ) + + message(STATUS "Installing") + file(INSTALL + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Debug/libmpg123/libmpg123.dll + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Debug/libmpg123/libmpg123.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + file(INSTALL + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Debug/libmpg123/libmpg123.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Release/libmpg123/libmpg123.dll + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Release/libmpg123/libmpg123.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(INSTALL + ${SOURCE_PATH}/ports/MSVC++/2015/uwp/libmpg123/${MPG123_ARCH}/Release/libmpg123/libmpg123.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + file(INSTALL + ${SOURCE_PATH}/ports/MSVC++/mpg123.h + ${SOURCE_PATH}/src/libmpg123/fmt123.h + ${SOURCE_PATH}/src/libmpg123/mpg123.h.in + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) +elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj + OPTIONS /p:UseEnv=True RELEASE_CONFIGURATION Release${MPG123_CONFIGURATION}${MPG123_CONFIGURATION_SUFFIX} DEBUG_CONFIGURATION Debug${MPG123_CONFIGURATION}${MPG123_CONFIGURATION_SUFFIX} ) @@ -88,79 +116,40 @@ if(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 +elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX) + set(MPG123_OPTIONS + --disable-dependency-tracking ) - 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 - ) + # Find cross-compiler prefix + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + endif() + if(CMAKE_C_COMPILER) + vcpkg_execute_required_process( + COMMAND ${CMAKE_C_COMPILER} -dumpmachine + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME dumpmachine-${TARGET_TRIPLET} + ) + 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() - file( - INSTALL - "${SOURCE_PATH}/build/debug/lib/libmpg123.a" - "${SOURCE_PATH}/build/debug/lib/libout123.a" - DESTINATION - ${CURRENT_INSTALLED_DIR}/debug/lib + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${MPG123_OPTIONS} ) + vcpkg_install_make() - file( - INSTALL - "${SOURCE_PATH}/build/release/lib/libmpg123.a" - "${SOURCE_PATH}/build/release/lib/libout123.a" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib - ) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpg123 RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) message(STATUS "Installing done") diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL deleted file mode 100644 index 79238cbb55c429..00000000000000 --- a/ports/mpir/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: mpir -Version: 3.0.0-7 -Homepage: https://github.com/wbhart/mpir -Description: Multiple Precision Integers and Rationals. -Supports: !uwp \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 42dd34c942e34f..856e4e273d4b55 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,16 +1,16 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "MPIR currently can only be built for desktop") +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 "MPIR currently can only be built using the dynamic CRT when building DLLs") + message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs") endif() set(MPIR_VERSION 3.0.0) -if(VCPKG_CMAKE_SYSTEM_NAME) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) vcpkg_download_distfile( ARCHIVE URLS "http://mpir.org/mpir-${MPIR_VERSION}.tar.bz2" @@ -34,45 +34,30 @@ if(VCPKG_CMAKE_SYSTEM_NAME) 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) - configure_file(${SOURCE_PATH}/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/mpir/copyright COPYONLY) -else() +elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wbhart/mpir @@ -110,27 +95,59 @@ else() OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" ) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_build_msbuild( + PROJECT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/build.vc${MSVC_VERSION}/${DLL_OR_LIB}_mpir_cxx/${DLL_OR_LIB}_mpir_cxx.vcxproj + OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" + OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" + ) + 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(COPY ${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) - - file(COPY ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(COPY ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(COPY ${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) + + 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() - configure_file(${SOURCE_PATH}/COPYING.lib ${CURRENT_PACKAGES_DIR}/share/mpir/copyright COPYONLY) + file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/ms-angle/001-fix-uwp.patch b/ports/ms-angle/001-fix-uwp.patch deleted file mode 100644 index 0e83f07fae87b0..00000000000000 --- a/ports/ms-angle/001-fix-uwp.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp -index 7c769e147..08e7a663f 100644 ---- a/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp -+++ b/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp -@@ -209,12 +209,12 @@ HRESULT GetCoreWindowSizeInPixels(const ComPtr displayProperties; -+ ComPtr displayInformation; - -- if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf()))) -+ if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayInformation).Get(), displayInformation.GetAddressOf()))) - { - float dpi = 96.0f; -- if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi))) -+ if (SUCCEEDED(displayInformation->get_LogicalDpi(&dpi))) - { - return dpi; - } -diff --git a/src/common/mathutil.h b/src/common/mathutil.h -index dcb7d8d62..774b80506 100644 ---- a/src/common/mathutil.h -+++ b/src/common/mathutil.h -@@ -150,7 +150,7 @@ inline bool supportsSSE2() - return supports; - } - --#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM) -+#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM) && !defined(_M_ARM64) - { - int info[4]; - __cpuid(info, 0); -@@ -884,7 +884,7 @@ inline uint32_t BitfieldReverse(uint32_t value) - - // Count the 1 bits. - #if defined(ANGLE_PLATFORM_WINDOWS) --#if defined(_M_ARM) -+#if defined(_M_ARM) || defined(_M_ARM64) - inline int BitCount(uint32_t bits) - { - bits = bits - ((bits >> 1) & 0x55555555); -diff --git a/src/common/platform.h b/src/common/platform.h -index 8287f5b2e..6de52b500 100644 ---- a/src/common/platform.h -+++ b/src/common/platform.h -@@ -84,7 +84,7 @@ - # undef far - #endif - --#if defined(_MSC_VER) && !defined(_M_ARM) -+#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64) - #include - #define ANGLE_USE_SSE - #elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) - \ No newline at end of file diff --git a/ports/ms-angle/CMakeLists.txt b/ports/ms-angle/CMakeLists.txt deleted file mode 100644 index a0ec171d365d3b..00000000000000 --- a/ports/ms-angle/CMakeLists.txt +++ /dev/null @@ -1,221 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(angle CXX) - -if(WIN32 AND NOT WINDOWS_STORE) - set(WINDOWS_DESKTOP 1) -else() - set(WINDOWS_DESKTOP 0) -endif() - -add_compile_options(/d2guard4 /Wv:18) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /guard:cf") - -add_definitions( - -D_CRT_SECURE_NO_DEPRECATE - -D_SCL_SECURE_NO_WARNINGS - -D_HAS_EXCEPTIONS=0 - -DNOMINMAX - -DANGLE_STANDALONE_BUILD - -DANGLE_ENABLE_DEBUG_ANNOTATIONS -) - -configure_file(src/commit.h include/id/commit.h COPYONLY) -include_directories(include src ${CMAKE_CURRENT_BINARY_DIR}/include) - -########## -# angle::common -file(GLOB ANGLE_COMMON_SOURCES - "src/common/*.h" - "src/common/*.inl" - "src/common/*.cpp" - "src/common/third_party/base/*.h" - "src/common/third_party/base/anglebase/*.cc" - "src/common/third_party/base/anglebase/*.h" - "src/common/third_party/smhasher/src/*.h" - "src/common/third_party/smhasher/src/*.cpp") -list(FILTER ANGLE_COMMON_SOURCES EXCLUDE REGEX "_unittest|event_tracer|_linux|_mac") -add_library(angle_common STATIC ${ANGLE_COMMON_SOURCES}) -target_include_directories(angle_common PUBLIC src/common/third_party/base) -add_library(angle::common ALIAS angle_common) - -########## -# angle::image_util -file(GLOB ANGLE_IMAGE_UTIL_SOURCES "src/image_util/*.h" "src/image_util/*.inl" "src/image_util/*.cpp") -add_library(angle_image_util STATIC ${ANGLE_IMAGE_UTIL_SOURCES}) -target_link_libraries(angle_image_util PRIVATE angle::common) -add_library(angle::image_util ALIAS angle_image_util) - -########## -# angle::translator -file(GLOB TRANSLATOR_SOURCES - "src/compiler/translator/glslang.l" - "src/compiler/translator/glslang.y" - "src/compiler/translator/*.h" - "src/compiler/translator/*.cpp" - "src/third_party/compiler/ArrayBoundsClamper.cpp" -) -add_library(angle_translator STATIC ${TRANSLATOR_SOURCES}) -target_compile_definitions(angle_translator PUBLIC - -DANGLE_ENABLE_ESSL - -DANGLE_ENABLE_GLSL - -DANGLE_ENABLE_HLSL -) -target_link_libraries(angle_translator PRIVATE angle::common) -add_library(angle::translator ALIAS angle_translator) - -########## -# angle::preprocessor -file(GLOB PREPROCESSOR_SOURCES - "src/compiler/preprocessor/*.h" - "src/compiler/preprocessor/*.cpp" -) -add_library(angle_preprocessor STATIC ${PREPROCESSOR_SOURCES}) -target_link_libraries(angle_preprocessor PRIVATE angle::common) -add_library(angle::preprocessor ALIAS angle_preprocessor) - -########## -# libANGLE - -## OpenGL Renderer -if(WINDOWS_DESKTOP) - file(GLOB LIBANGLE_GL_SOURCES - "src/libANGLE/renderer/gl/*.cpp" - "src/libANGLE/renderer/gl/*.inl" - "src/libANGLE/renderer/gl/*.h" - - "src/libANGLE/renderer/gl/wgl/*.cpp" - "src/libANGLE/renderer/gl/wgl/*.inl" - "src/libANGLE/renderer/gl/wgl/*.h" - ) - list(FILTER LIBANGLE_GL_SOURCES EXCLUDE REGEX "_unittest") - add_library(angle_renderer_opengl INTERFACE) - target_sources(angle_renderer_opengl INTERFACE ${LIBANGLE_GL_SOURCES}) - target_compile_definitions(angle_renderer_opengl INTERFACE -DANGLE_ENABLE_OPENGL) - add_library(angle::renderer::opengl ALIAS angle_renderer_opengl) -endif() - -## All D3D Sources -file(GLOB_RECURSE LIBANGLE_D3D_SOURCES - "src/libANGLE/renderer/d3d/*.cpp" - "src/libANGLE/renderer/d3d/*.inl" - "src/libANGLE/renderer/d3d/*.h" -) -list(FILTER LIBANGLE_D3D_SOURCES EXCLUDE REGEX "_unittest") - -## WinRT D3D Renderer -if(WINDOWS_STORE) - set(LIBANGLE_D3D_WINRT_SOURCES ${LIBANGLE_D3D_SOURCES}) - list(FILTER LIBANGLE_D3D_WINRT_SOURCES INCLUDE REGEX "winrt") - add_library(angle_renderer_winrt INTERFACE) - target_sources(angle_renderer_winrt INTERFACE ${LIBANGLE_D3D_WINRT_SOURCES}) - add_library(angle::renderer::winrt ALIAS angle_renderer_winrt) -endif() - -## Win32/d3d9 D3D Renderer -if(WINDOWS_DESKTOP) - set(LIBANGLE_D3D_DESKTOP_SOURCES ${LIBANGLE_D3D_SOURCES}) - list(FILTER LIBANGLE_D3D_DESKTOP_SOURCES INCLUDE REGEX "d3d9|win32") - find_library(D3D9_LIB NAMES d3d9) - add_library(angle_renderer_win32 INTERFACE) - target_sources(angle_renderer_win32 INTERFACE ${LIBANGLE_D3D_DESKTOP_SOURCES}) - target_compile_definitions(angle_renderer_win32 INTERFACE -DANGLE_ENABLE_D3D9) - target_link_libraries(angle_renderer_win32 INTERFACE ${D3D9_LIB}) - add_library(angle::renderer::win32 ALIAS angle_renderer_win32) -endif() - -## D3D11 Base renderer -list(FILTER LIBANGLE_D3D_SOURCES EXCLUDE REGEX "winrt|d3d9|win32") -find_library(DXGUID_LIB NAMES dxguid) -find_library(D3D11_LIB NAMES d3d11) -add_library(angle_renderer_d3d INTERFACE) -target_sources(angle_renderer_d3d INTERFACE ${LIBANGLE_D3D_SOURCES}) -target_compile_definitions(angle_renderer_d3d INTERFACE - -DANGLE_ENABLE_D3D11 - "-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" -) -target_link_libraries(angle_renderer_d3d INTERFACE ${D3D11_LIB} ${DXGUID_LIB}) -add_library(angle::renderer::d3d ALIAS angle_renderer_d3d) - -## Core libANGLE library -file(GLOB LIBANGLE_SOURCES - "src/third_party/systeminfo/SystemInfo.cpp" - "src/common/third_party/murmurhash/MurmurHash3.cpp" - "src/common/event_tracer.cpp" - - "src/libANGLE/*.cpp" - "src/libANGLE/*.inl" - "src/libANGLE/*.h" - - "src/libANGLE/renderer/*.cpp" - "src/libANGLE/renderer/*.inl" - "src/libANGLE/renderer/*.h" - - "src/libANGLE/renderer/null/*.cpp" - "src/libANGLE/renderer/null/*.inl" - "src/libANGLE/renderer/null/*.h" -) -list(FILTER LIBANGLE_SOURCES EXCLUDE REGEX "_unittest") - -add_library(libANGLE STATIC ${LIBANGLE_SOURCES}) -target_link_libraries(libANGLE PRIVATE - angle::common - angle::image_util - angle::translator - angle::preprocessor - angle::renderer::d3d - $<$:angle::renderer::winrt> - $<$:angle::renderer::win32> - $<$:angle::renderer::opengl> - $<$:gdi32> -) -target_include_directories(libANGLE PRIVATE "src/third_party/khronos") -target_compile_definitions(libANGLE - PRIVATE -DANGLE_ENABLE_NULL - PUBLIC -DLIBANGLE_IMPLEMENTATION -) -add_library(angle::libANGLE ALIAS libANGLE) - -########## -# libGLESv2 -file(GLOB LIBGLESV2_SOURCES "src/libGLESv2/*.h" "src/libGLESv2/*.cpp" "src/libGLESv2/libGLESv2.def") -add_library(libGLESv2 ${LIBGLESV2_SOURCES}) -target_link_libraries(libGLESv2 PRIVATE angle::common angle::libANGLE) -target_compile_definitions(libGLESv2 - PRIVATE -DLIBGLESV2_IMPLEMENTATION - PUBLIC - -DGL_GLEXT_PROTOTYPES - -DGL_APICALL= - -DEGLAPI= -) -target_include_directories(libGLESv2 PUBLIC "$") - -########## -# libEGL -add_library(libEGL - "src/libEGL/libEGL.def" - "src/libEGL/libEGL.cpp" - "src/libEGL/libEGL.rc" - "src/libEGL/resource.h" -) -target_link_libraries(libEGL PRIVATE angle::common angle::libANGLE libGLESv2) -target_include_directories(libEGL PUBLIC "$") - -install(TARGETS libEGL libGLESv2 EXPORT ANGLEExport - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -install(EXPORT ANGLEExport FILE ms-angle-config.cmake NAMESPACE ms-angle:: DESTINATION share/ms-angle) - -if(NOT DISABLE_INSTALL_HEADERS) - install( - DIRECTORY include/ - DESTINATION include - FILES_MATCHING PATTERN "*.h" - PATTERN "GLSLANG" EXCLUDE - PATTERN "export.h" EXCLUDE - ) -endif() diff --git a/ports/ms-angle/CONTROL b/ports/ms-angle/CONTROL index 4ba09505088e13..003ab3f3bcfd21 100644 --- a/ports/ms-angle/CONTROL +++ b/ports/ms-angle/CONTROL @@ -1,5 +1,4 @@ Source: ms-angle -Version: 2018-04-18-2 -Description: The UWP version of a conformant OpenGL ES implementation for Windows, Mac and Linux. - The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available for that platform. ANGLE currently provides translation from OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11. Support for translation from OpenGL ES to Vulkan is underway, and future plans include compute shader support (ES 3.1) and MacOS support. -Supports: windows|uwp \ No newline at end of file +Version: alias +Description: Deprecated alias for ms-angle +Build-Depends: angle \ No newline at end of file diff --git a/ports/ms-angle/portfile.cmake b/ports/ms-angle/portfile.cmake index 0e10fa1cc597fd..0015715fb66c72 100644 --- a/ports/ms-angle/portfile.cmake +++ b/ports/ms-angle/portfile.cmake @@ -1,31 +1 @@ -include(vcpkg_common_functions) - -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - message(FATAL_ERROR "This portfile does not support Linux or OSX") -endif() - -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO microsoft/angle - REF ms-master - SHA512 eecdb7012c0630b24fde540fb6a558f4ee5326fc1218773b779953d0fe0ef02da68ceb2577822cfc0374392a88b871201bfe291e3b85c3dd005edc83f84fec1f - PATCHES - PATCHES - 001-fix-uwp.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=1 -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ms-angle RENAME copyright) +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/ports/ms-gsl/CONTROL b/ports/ms-gsl/CONTROL index 23baa58ce6bc7b..697fe9647382e5 100644 --- a/ports/ms-gsl/CONTROL +++ b/ports/ms-gsl/CONTROL @@ -1,4 +1,4 @@ Source: ms-gsl -Version: 2.1.0 +Version: 3.0.1 Homepage: https://github.com/Microsoft/GSL Description: Microsoft implementation of the Guidelines Support Library diff --git a/ports/ms-gsl/portfile.cmake b/ports/ms-gsl/portfile.cmake index fbcf66fb3f7a16..c9ab86f0f5ca6c 100644 --- a/ports/ms-gsl/portfile.cmake +++ b/ports/ms-gsl/portfile.cmake @@ -1,13 +1,27 @@ -#header-only library +#header-only library with an install target vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/GSL - REF 7e99e76c9761d0d0b0848b91f8648830670ee872 - SHA512 9a5ea7d22497a56918a83c248d9f707e98544dce90835cf9bf877213df8751cdb350b6343d0205e7b17fc27e234a17906876aff99c177d5f2b96df96d15a215c + REF 1999b48a519196711f0d03af3b7eedd49fcc6db3 + SHA512 4daa5cefdd910391c97428c6de4d7f93a8e112c59f296a9dec448ff409dae0d94f99b1389897f4ec34598dd33f82c21eb47463a394f5ea8a8c00a9cca366a1ea HEAD_REF master ) -file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DGSL_TEST=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets( + CONFIG_PATH share/cmake/Microsoft.GSL + TARGET_PATH share/Microsoft.GSL +) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ms-gsl RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/msgpack11/CONTROL b/ports/msgpack11/CONTROL index 8312187bb11561..3fde8f39ca5d5f 100644 --- a/ports/msgpack11/CONTROL +++ b/ports/msgpack11/CONTROL @@ -1,5 +1,5 @@ Source: msgpack11 -Version: 0.0.10 +Version: 0.0.10-1 Homepage: https://msgpack.org Build-Depends: gtest Description: msgpack11 is a tiny MsgPack library for C++11, providing MsgPack parsing and serialization.This library is inspired by json11.The API of msgpack11 is designed to be similar with json11. diff --git a/ports/msgpack11/fix-additerator.patch b/ports/msgpack11/fix-additerator.patch new file mode 100644 index 00000000000000..5a6b23227f1380 --- /dev/null +++ b/ports/msgpack11/fix-additerator.patch @@ -0,0 +1,12 @@ +diff --git a/msgpack11.cpp b/msgpack11.cpp +index fa572fa..640ba9a 100644 +--- a/msgpack11.cpp ++++ b/msgpack11.cpp +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + namespace msgpack11 { + diff --git a/ports/msgpack11/portfile.cmake b/ports/msgpack11/portfile.cmake index 6bd662ae54103f..cf828f6b12017d 100644 --- a/ports/msgpack11/portfile.cmake +++ b/ports/msgpack11/portfile.cmake @@ -6,7 +6,8 @@ vcpkg_from_github( SHA512 7b90893f9cdec529789f6e75703f5945c6fc5c946b8708a7a2cb295faf4af111c8cc61265b636f385641031b85181929205be9c5d155f405909445dce85b4ce8 HEAD_REF master PATCHES - msvc.patch + msvc.patch + fix-additerator.patch ) vcpkg_configure_cmake( diff --git a/ports/msix/CONTROL b/ports/msix/CONTROL index fb6e632a1d09a0..ec246a87784bda 100644 --- a/ports/msix/CONTROL +++ b/ports/msix/CONTROL @@ -1,5 +1,6 @@ Source: msix -Version: 1.7 +Version: 1.7-2 Build-Depends: xerces-c, zlib, openssl (!uwp&!windows), catch2 +Homepage: https://github.com/microsoft/msix-packaging Description: The MSIX Packaging SDK project is an effort to enable developers on a variety of platforms to pack and unpack packages for the purposes of distribution from either the Microsoft Store, or their own content distribution networks. The MSIX Packaging APIs that a client app would use to interact with .msix/.appx packages are a subset of those documented here. See sample/ExtractContentsSample/ExtractContentsSample.cpp for additional details. diff --git a/ports/msix/portfile.cmake b/ports/msix/portfile.cmake index 53734796f0f337..249d6fd8fb82ed 100644 --- a/ports/msix/portfile.cmake +++ b/ports/msix/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO Microsoft/msix-packaging + REPO microsoft/msix-packaging REF ab322965d64baf1448548cbe18139e8872d686f2 # v1.7 SHA512 d64767c84d5933bf3d1e0e62e9dc21fa13e02b8cf31776ccbe2e7066e514798d8ff758dc2b6fd64f6eabcf3deb83ef0eaa03e1a7d407307f347a045e8a75d3dd HEAD_REF master @@ -43,7 +43,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/msmpi/CONTROL b/ports/msmpi/CONTROL index baa44b8fe85aad..9640f564b459bf 100644 --- a/ports/msmpi/CONTROL +++ b/ports/msmpi/CONTROL @@ -1,4 +1,5 @@ Source: msmpi -Version: 10.0-2 +Version: 10.1 +Homepage: https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi Description: Microsoft MPI -Supports: windows \ No newline at end of file +Supports: windows diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 10482cb0a026e9..58c3661c79d04d 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -1,23 +1,21 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP") -if(VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "This port is only for building msmpi on Windows Desktop") -endif() - -set(MSMPI_VERSION "10.0.12498") +set(MSMPI_VERSION "10.1.12498") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-${MSMPI_VERSION}) vcpkg_download_distfile(SDK_ARCHIVE - URLS "https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisdk.msi" + URLS "https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisdk.msi" FILENAME "msmpisdk-${MSMPI_VERSION}.msi" - SHA512 36a31b2516f45fbc26167b31d2d6419f1928aef1591033f0430d36570159205e1a3134557a4ac0462f2d879add1fc6fee87a6997032e4438b528cd42a8bbe6b1 + SHA512 330fad53c1979dfae786abed228d82c82207f0d61148e2efc1f37c8931838b806eb50554e7f006a56962f748a21f7017c540bd70444b7a93a72c313a64e9254c ) + +#to enable CI, you should modify the following URL also in ${VCPKG_ROOT}/scripts/azure-pipelines/windows/provision-image.ps1 macro(download_msmpi_redistributable_package) vcpkg_download_distfile(REDIST_ARCHIVE - URLS "https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/msmpisetup.exe" + URLS "https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe" FILENAME "msmpisetup-${MSMPI_VERSION}.exe" - SHA512 c272dc842eb1e693f25eb580e1caf0c1fdb385611a12c20cdc6a40cf592ccbdba434a1c16edb63eef14b1a2ac6e678ac1cd561ec5fd003a5d17191a0fad281ae + SHA512 1ee463e7dfc3e55a7ac048fdfde13fef09a5eea4b74d8fd7c22a7aad667a025b467ce939e5de308e25bbc186c3fe66e0e24ac03a3741656fc7558f2af2fa132a ) endmacro() diff --git a/ports/mstch/CONTROL b/ports/mstch/CONTROL new file mode 100644 index 00000000000000..eef64a578d6886 --- /dev/null +++ b/ports/mstch/CONTROL @@ -0,0 +1,5 @@ +Source: mstch +Version: 1.0.2-2 +Homepage: https://github.com/no1msd/mstch +Description: Mstch is a complete implementation of {{mustache}} templates using modern C++ +Build-Depends: boost-variant diff --git a/ports/mstch/do-not-force-release.patch b/ports/mstch/do-not-force-release.patch new file mode 100644 index 00000000000000..63916f5f42496a --- /dev/null +++ b/ports/mstch/do-not-force-release.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d8e0c7..4304ad7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,17 +5,17 @@ option(WITH_UNIT_TESTS "enable building unit test executable" OFF) + option(WITH_BENCHMARK "enable building benchmark executable" OFF) + + set(CMAKE_INCLUDE_CURRENT_DIR ON) +-set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +-set(CMAKE_BUILD_TYPE Release) + + set(mstch_VERSION 1.0.1) + + if(NOT MSVC) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -O3") ++ set(CMAKE_CXX_STANDARD 11) + endif() + + add_subdirectory(src) + ++target_include_directories(mstch PUBLIC $) ++ + if(WITH_UNIT_TESTS) + enable_testing() + add_subdirectory(vendor/headerize) diff --git a/ports/mstch/portfile.cmake b/ports/mstch/portfile.cmake new file mode 100644 index 00000000000000..e742273affbc43 --- /dev/null +++ b/ports/mstch/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO no1msd/mstch + REF ff459067bd02e80dc399006bb610238223d41c50 #1.0.2 + SHA512 b01f4c3e39a40fc9a6accc81ecbfac4b8a9ce1c2ec3df441a16039f4bf126dfeef83f87d3a5e9ec03dc133a1c5f54f5bc931479915e8a92bbfc8ebbc87c8e4dd + HEAD_REF master + PATCHES do-not-force-release.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/mstch) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/munit/CONTROL b/ports/munit/CONTROL new file mode 100644 index 00000000000000..8e1bb2e23cef14 --- /dev/null +++ b/ports/munit/CONTROL @@ -0,0 +1,5 @@ +Source: munit +Version: 2019-04-06 +Description: A small but full-featured unit testing framework for C +Supports: !(arm|arm64|uwp) +Homepage: https://github.com/nemequ/munit diff --git a/ports/munit/fix-install.patch b/ports/munit/fix-install.patch new file mode 100644 index 00000000000000..6ba7461adabc9d --- /dev/null +++ b/ports/munit/fix-install.patch @@ -0,0 +1,13 @@ +diff --git a/meson.build b/meson.build +index c15b405..44ee737 100644 +--- a/meson.build ++++ b/meson.build +@@ -11,7 +11,7 @@ root_include = include_directories('.') + + munit = library('munit', + ['munit.c'], +- install: meson.is_subproject()) ++ install: not meson.is_subproject()) + + if meson.is_subproject() + munit_dep = declare_dependency( diff --git a/ports/munit/portfile.cmake b/ports/munit/portfile.cmake new file mode 100644 index 00000000000000..bd45959308e02f --- /dev/null +++ b/ports/munit/portfile.cmake @@ -0,0 +1,25 @@ +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 nemequ/munit + REF da8f73412998e4f1adf1100dc187533a51af77fd + SHA512 cd08c1291a73487f15fdba7bf8675fea9177f0ec9766900f65efb5f00c662532a16499447e9087d304de34ff9138f47d04ebf18713f5aa8aacede22c5e23b98b + HEAD_REF master + PATCHES + fix-install.patch +) + +vcpkg_configure_meson( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + --backend=ninja +) + +vcpkg_install_meson() + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/murmurhash/CMakeLists.txt b/ports/murmurhash/CMakeLists.txt index 681f9592c45cd2..83ffe8154117bd 100644 --- a/ports/murmurhash/CMakeLists.txt +++ b/ports/murmurhash/CMakeLists.txt @@ -9,7 +9,6 @@ add_library(murmurhash src/MurmurHash2.cpp src/MurmurHash3.cpp ) -target_include_directories(murmurhash SYSTEM PUBLIC $/src) set(MURMUR_HEADERS src/MurmurHash2.h @@ -29,17 +28,10 @@ set(namespace "${PROJECT_NAME}::") include(CMakePackageConfigHelpers) -# Configure 'ConfigVersion.cmake' -# Use: -# * PROJECT_VERSION write_basic_package_version_file( "${version_config}" COMPATIBILITY SameMajorVersion ) -# Configure 'Config.cmake' -# Use variables: -# * TARGETS_EXPORT_NAME -# * PROJECT_NAME configure_package_config_file( "${CMAKE_SOURCE_DIR}/Config.cmake.in" "${project_config}" @@ -50,7 +42,7 @@ install(TARGETS murmurhash EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib" - INCLUDES DESTINATION "include") + PUBLIC_HEADER DESTINATION "include") install(FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}" diff --git a/ports/murmurhash/CONTROL b/ports/murmurhash/CONTROL index 9c12b4a76901a9..c83cb984dbb29e 100644 --- a/ports/murmurhash/CONTROL +++ b/ports/murmurhash/CONTROL @@ -1,4 +1,4 @@ Source: murmurhash -Version: 2016-01-09 +Version: 2016-01-09-3 Homepage: https://github.com/aappleby/smhasher Description: MurmurHash a family of hash functions. diff --git a/ports/murmurhash/portfile.cmake b/ports/murmurhash/portfile.cmake index 83e1fd1fad65ad..380570b2f21f18 100644 --- a/ports/murmurhash/portfile.cmake +++ b/ports/murmurhash/portfile.cmake @@ -18,7 +18,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/mygui/CONTROL b/ports/mygui/CONTROL new file mode 100644 index 00000000000000..934ee31ab11d83 --- /dev/null +++ b/ports/mygui/CONTROL @@ -0,0 +1,9 @@ +Source: mygui +Version: 2020-06-17 +Build-Depends: freetype, sdl2-image +Homepage: http://mygui.info +Description: Fast, flexible and simple GUI + +Feature: opengl +Description: Use OpenGL render system. +Build-Depends: opengl diff --git a/ports/mygui/fix-generation.patch b/ports/mygui/fix-generation.patch new file mode 100644 index 00000000000000..9e517318a45ec9 --- /dev/null +++ b/ports/mygui/fix-generation.patch @@ -0,0 +1,55 @@ +diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt +index b0fc12a82..6e545edea 100644 +--- a/CMake/CMakeLists.txt ++++ b/CMake/CMakeLists.txt +@@ -5,7 +5,7 @@ + ############################################################# + + if(WIN32) +- set(MYGUI_CMAKE_DIR "CMake") ++ set(MYGUI_CMAKE_DIR "share") + else(WIN32) + set(MYGUI_CMAKE_DIR "lib/MYGUI/cmake") + endif(WIN32) +diff --git a/CMake/Utils/MyGUIConfigTargets.cmake b/CMake/Utils/MyGUIConfigTargets.cmake +index d1dbd016d..25c8bbac6 100644 +--- a/CMake/Utils/MyGUIConfigTargets.cmake ++++ b/CMake/Utils/MyGUIConfigTargets.cmake +@@ -6,10 +6,10 @@ if (WIN32) + set(MYGUI_RELWDBG_PATH "/RelWithDebInfo") + set(MYGUI_MINSIZE_PATH "/MinSizeRel") + set(MYGUI_DEBUG_PATH "/Debug") +- set(MYGUI_LIB_RELEASE_PATH "/Release") ++ set(MYGUI_LIB_RELEASE_PATH "") + set(MYGUI_LIB_RELWDBG_PATH "/RelWithDebInfo") + set(MYGUI_LIB_MINSIZE_PATH "/MinSizeRel") +- set(MYGUI_LIB_DEBUG_PATH "/Debug") ++ set(MYGUI_LIB_DEBUG_PATH "") + set(MYGUI_PLUGIN_PATH "/opt") + elseif (UNIX) + set(MYGUI_RELEASE_PATH "") +diff --git a/CMake/Utils/PrecompiledHeader.cmake b/CMake/Utils/PrecompiledHeader.cmake +index a8bf3ce49..104703282 100644 +--- a/CMake/Utils/PrecompiledHeader.cmake ++++ b/CMake/Utils/PrecompiledHeader.cmake +@@ -16,7 +16,7 @@ + macro(use_precompiled_header TARGET HEADER_FILE SRC_FILE) + get_filename_component(HEADER ${HEADER_FILE} NAME) + +- if (MSVC AND NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++ if (FALSE) + add_definitions(/Yu"${HEADER}") + set_source_files_properties(${SRC_FILE} + PROPERTIES COMPILE_FLAGS /Yc"${HEADER}" +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fea0bff8b..5831dfa8a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 2.6) + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) + cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0011 NEW) ++cmake_policy(SET CMP0021 OLD) + + project(MYGUI) + diff --git a/ports/mygui/portfile.cmake b/ports/mygui/portfile.cmake new file mode 100644 index 00000000000000..3f3bd9016f3139 --- /dev/null +++ b/ports/mygui/portfile.cmake @@ -0,0 +1,44 @@ +# MyGUI supports compiling itself as a DLL, +# but it seems platform-related stuff doesn't support dynamic linkage +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO MyGUI/mygui + REF 26109822f36a4f7d72d5d8ecd41659897f085a40 + SHA512 4d1f001e8c04d08ad911bc0345a2287b5e17e21284728cf23d7a930e8befb2f85902053e3c90283444bf9e32c7dada2f37c498e735d6314732b297d97ed339e4 + HEAD_REF master + PATCHES + fix-generation.patch +) + +if("opengl" IN_LIST FEATURES) + set(MYGUI_RENDERSYSTEM 4) +else() + set(MYGUI_RENDERSYSTEM 1) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DMYGUI_STATIC=TRUE + -DMYGUI_BUILD_DEMOS=FALSE + -DMYGUI_BUILD_PLUGINS=TRUE + -DMYGUI_BUILD_TOOLS=FALSE + -DMYGUI_BUILD_UNITTESTS=FALSE + -DMYGUI_BUILD_TEST_APP=FALSE + -DMYGUI_BUILD_WRAPPER=FALSE + -DMYGUI_BUILD_DOCS=FALSE + -DMYGUI_RENDERSYSTEM=${MYGUI_RENDERSYSTEM} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING.MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nameof/CONTROL b/ports/nameof/CONTROL index 296b39f1dbe43f..f004d4f8f14de4 100644 --- a/ports/nameof/CONTROL +++ b/ports/nameof/CONTROL @@ -1,4 +1,4 @@ Source: nameof -Version: 0.9.3 +Version: 0.9.4 Description: Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum. Homepage: https://github.com/Neargye/nameof diff --git a/ports/nameof/portfile.cmake b/ports/nameof/portfile.cmake index 5372879dd6bf31..ed893a39bb47ac 100644 --- a/ports/nameof/portfile.cmake +++ b/ports/nameof/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Neargye/nameof - REF v0.9.3 - SHA512 be644edfa30b2f6b0461585910bccf1ee6b1828d7fc013c01a50bed85ed9a7e3630a67a8362c8f5c8b5e3b372537d726c7c002f86b3c08d5fc73d99d10197f56 + REF v0.9.4 + SHA512 658abf7da2bbc831648aca017815e6368163335840d59f4538ecc0d8438dc3843ad6efc9c2ca8ec1f6ad2208349eee880106fc60cda44bd7b19c73a1f23d067f HEAD_REF master ) 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 5510511405de15..d6c94949850503 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,5 +1,6 @@ -Source: nana -Version: 1.7.2-1 -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) +Source: nana +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/nana/config.cmake.in b/ports/nana/config.cmake.in index 8a18bbdf476fa6..43b21dcc4c19d8 100644 --- a/ports/nana/config.cmake.in +++ b/ports/nana/config.cmake.in @@ -7,11 +7,14 @@ if(UNIX) find_library(FONTCONFIG_LIB NAMES fontconfig) endif() -if(@NANA_ENABLE_PNG@) +option(NANA_ENABLE_PNG "Enable PNG support" @NANA_ENABLE_PNG@) +option(NANA_ENABLE_JPEG "Enable JPEG support" @NANA_ENABLE_JPEG@) + +if(NANA_ENABLE_PNG) find_package(PNG REQUIRED) endif() -if(@NANA_ENABLE_JPEG@) +if(NANA_ENABLE_JPEG) find_package(JPEG REQUIRED) endif() @@ -21,6 +24,6 @@ if(UNIX) target_link_libraries(unofficial::nana::nana INTERFACE ${FONTCONFIG_LIB} ${X11_LIBRARIES} ${X11_Xft_LIB}) endif() -if(@NANA_ENABLE_JPEG@) +if(NANA_ENABLE_JPEG) target_link_libraries(unofficial::nana::nana INTERFACE ${JPEG_LIBRARIES}) endif() diff --git a/ports/nana/fix-addstdexcept.patch b/ports/nana/fix-addstdexcept.patch new file mode 100644 index 00000000000000..3b8773f5fef57d --- /dev/null +++ b/ports/nana/fix-addstdexcept.patch @@ -0,0 +1,12 @@ +diff --git a/source/datetime.cpp b/source/datetime.cpp +index e6e8fa5..c3ae852 100644 +--- a/source/datetime.cpp ++++ b/source/datetime.cpp +@@ -15,6 +15,7 @@ + #include + #endif + #include ++#include + + namespace { + std::tm localtime() diff --git a/ports/nana/portfile.cmake b/ports/nana/portfile.cmake index d038242e1ae1dd..7c1693c9250ed4 100644 --- a/ports/nana/portfile.cmake +++ b/ports/nana/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( HEAD_REF develop PATCHES fix-build-error.patch + fix-addstdexcept.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/nanobench/CONTROL b/ports/nanobench/CONTROL new file mode 100644 index 00000000000000..f8366a089e4fb7 --- /dev/null +++ b/ports/nanobench/CONTROL @@ -0,0 +1,4 @@ +Source: nanobench +Version: 4.0.0 +Homepage: https://nanobench.ankerl.com +Description: Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20 diff --git a/ports/nanobench/portfile.cmake b/ports/nanobench/portfile.cmake new file mode 100644 index 00000000000000..272306f264a76e --- /dev/null +++ b/ports/nanobench/portfile.cmake @@ -0,0 +1,16 @@ +# Header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO martinus/nanobench + REF c534992696b9341274c6714931d0064d74239fcb #v4.0.0 + SHA512 09078f1100c6f843e7646b8aaab687c32e71ba2dc05a2a5b282c72ab064ceffbf4aeb5ad14c4a2bdbe2ea66dca9cd207dee5eade44f77844cddfa490b4c09c32 + HEAD_REF master +) + +file( + COPY ${SOURCE_PATH}/src/include/nanobench.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nanodbc/CONTROL b/ports/nanodbc/CONTROL index 1dd7cfef27c67d..1e7a640933d3f1 100644 --- a/ports/nanodbc/CONTROL +++ b/ports/nanodbc/CONTROL @@ -1,4 +1,6 @@ Source: nanodbc -Version: 2.12.4-5 +Version: 2.12.4 +Port-Version: 9 Homepage: https://github.com/lexicalunit/nanodbc Description: A small C++ wrapper for the native C ODBC API. +Build-Depends: unixodbc(!windows) diff --git a/ports/nanomsg/CONTROL b/ports/nanomsg/CONTROL index 8693cfef3514c0..8f6d45e8bc660a 100644 --- a/ports/nanomsg/CONTROL +++ b/ports/nanomsg/CONTROL @@ -1,5 +1,5 @@ Source: nanomsg -Version: 1.1.5-1 +Version: 1.1.5-2 Description: a simple high-performance implementation of several "scalability protocols". These scalability protocols are light-weight messaging protocols which can be used to solve a number of very common messaging patterns, such as request/reply, publish/subscribe, surveyor/respondent, and so forth. These protocols can run over a variety of transports such as TCP, UNIX sockets, and even WebSocket. diff --git a/ports/nanomsg/portfile.cmake b/ports/nanomsg/portfile.cmake index d07685f6099939..a4125434d5ceb5 100644 --- a/ports/nanomsg/portfile.cmake +++ b/ports/nanomsg/portfile.cmake @@ -41,30 +41,12 @@ vcpkg_replace_string( ) if(NN_ENABLE_NANOCAT) - if(CMAKE_HOST_WIN32) - set(EXECUTABLE_SUFFIX ".exe") - else() - set(EXECUTABLE_SUFFIX "") - endif() - - file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/nanocat${EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - - file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/nanocat${EXECUTABLE_SUFFIX} - ${CURRENT_PACKAGES_DIR}/debug/bin/nanocat${EXECUTABLE_SUFFIX} - ) + vcpkg_copy_tools(TOOL_NAMES nanocat AUTO_CLEAN) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin - ) - vcpkg_replace_string( ${CURRENT_PACKAGES_DIR}/include/nanomsg/nn.h "defined(NN_STATIC_LIB)" diff --git a/ports/nanoprintf/CONTROL b/ports/nanoprintf/CONTROL new file mode 100644 index 00000000000000..f3518b9006b1a8 --- /dev/null +++ b/ports/nanoprintf/CONTROL @@ -0,0 +1,4 @@ +Source: nanoprintf +Version: 2020-05-27 +Description: A tiny embeddable printf replacement written in C99 +Homepage: https://github.com/charlesnicholson/nanoprintf diff --git a/ports/nanoprintf/portfile.cmake b/ports/nanoprintf/portfile.cmake new file mode 100644 index 00000000000000..7587949e19a0ca --- /dev/null +++ b/ports/nanoprintf/portfile.cmake @@ -0,0 +1,12 @@ +# header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO charlesnicholson/nanoprintf + REF b210b50a2b8608e2f0226b47a8f82c3476177a4f + SHA512 8340bf3785a8609568188e28e3fb905007d6da052f860df02fe0b8b2fdef3ca1ac87b91f7ac203fbd7235bcd50c8a63f33b2fca2854cad1351899c59cd8d7646 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/nanoprintf.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE 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..18010cb52df27d 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,5 +1,6 @@ Source: netcdf-c -Version: 4.7.3-1 -Build-Depends: hdf5, curl +Version: 4.7.3 +Port-Version: 3 +Build-Depends: hdf5, curl, embree3(linux|osx) 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/nettle/CONTROL b/ports/nettle/CONTROL new file mode 100644 index 00000000000000..c6e3e37353b7cc --- /dev/null +++ b/ports/nettle/CONTROL @@ -0,0 +1,5 @@ +Source: nettle +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/nettle/gmp.patch b/ports/nettle/gmp.patch new file mode 100644 index 00000000000000..b732e0360def8e --- /dev/null +++ b/ports/nettle/gmp.patch @@ -0,0 +1,273 @@ +diff --git a/SMP/config.h b/SMP/config.h +index 5e59a1daa..c5a658954 100644 +--- a/SMP/config.h ++++ b/SMP/config.h +@@ -101,7 +101,7 @@ + #define HAVE_SYS_TYPES_H 1 + + /* Define to 1 if you have the header file. */ +-#define HAVE_UNISTD_H 1 ++//#define HAVE_UNISTD_H 1 + + /* Define to 1 if you have the header file. */ + /* #undef HAVE_VALGRIND_MEMCHECK_H */ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index cdf309639..9d37146a4 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -1325,7 +1325,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1457,7 +1457,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1585,7 +1585,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1715,7 +1715,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2368,7 +2368,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2641,7 +2641,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2915,7 +2915,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3186,7 +3186,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 9ea0d8ea7..56583e10f 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -968,7 +968,7 @@ + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1091,7 +1091,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmpd_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1212,7 +1212,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1335,7 +1335,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmpd_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1463,7 +1463,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1595,7 +1595,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1721,7 +1721,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1851,7 +1851,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1979,7 +1979,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2108,7 +2108,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2235,7 +2235,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2364,7 +2364,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2498,7 +2498,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2632,7 +2632,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2770,7 +2770,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2908,7 +2908,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3041,7 +3041,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3174,7 +3174,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3311,7 +3311,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3448,7 +3448,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) + + + mkdir "$(OutDir)"\include diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch new file mode 100644 index 00000000000000..753aaff5af7314 --- /dev/null +++ b/ports/nettle/name.dir.patch @@ -0,0 +1,567 @@ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index 9f741e240..5bb05b359 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -670,142 +670,142 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd ++ hogweedd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd_winrt ++ hogweedd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweedd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweedd_winrt ++ hogweedd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweedd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweedd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed ++ hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed_winrt ++ hogweed + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt ++ hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt ++ hogweed + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +@@ -826,7 +826,7 @@ + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettled.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -950,7 +950,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettled_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1072,7 +1072,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettled.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1196,7 +1196,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettled_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1325,7 +1325,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1457,7 +1457,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1585,7 +1585,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1715,7 +1715,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1845,7 +1845,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1975,7 +1975,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2103,7 +2103,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2233,7 +2233,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2368,7 +2368,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2503,7 +2503,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2641,7 +2641,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2780,7 +2780,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2915,7 +2915,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3049,7 +3049,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3186,7 +3186,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -3324,7 +3324,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 56583e10f..665e8ef4e 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -812,142 +812,142 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled ++ nettled + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled_winrt ++ nettled + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettled + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettled_winrt ++ nettled + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettled +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettled_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle ++ nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle_winrt ++ nettle + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt ++ nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt ++ nettle + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +diff --git a/hogweed.pc.in b/hogweed.pc.in +index 97fb9d46a..ce977c02e 100644 +--- a/hogweed.pc.in ++++ b/hogweed.pc.in +@@ -13,7 +13,7 @@ URL: http://www.lysator.liu.se/~nisse/nettle + Version: @PACKAGE_VERSION@ + Requires: @IF_NOT_SHARED@ nettle + Requires.private: @IF_SHARED@ nettle +-Libs: -L${libdir} -lhogweed @IF_NOT_SHARED@ @LIBS@ ++Libs: -L${libdir} @HOGWEED@ @IF_NOT_SHARED@ @LIBS@ + Libs.private: @IF_SHARED@ @LIBS@ + Cflags: -I${includedir} + +diff --git a/nettle.pc.in b/nettle.pc.in +index eb0020caa..6e3ed1e4f 100644 +--- a/nettle.pc.in ++++ b/nettle.pc.in +@@ -7,5 +7,6 @@ Name: Nettle + Description: Nettle low-level cryptographic library (symmetric algorithms) + URL: http://www.lysator.liu.se/~nisse/nettle + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lnettle ++Requires.private: gmp ++Libs: -L${libdir} @LIBS@ + Cflags: -I${includedir} diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake new file mode 100644 index 00000000000000..cd50ea19ca1b26 --- /dev/null +++ b/ports/nettle/portfile.cmake @@ -0,0 +1,133 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ShiftMediaProject/nettle + REF 1d0a6e64e01458fdf37eaf5d90975deb52c3da41 #v3.5.1 + SHA512 6124fbd223e6519d88290c3f4e3b8cc399e038c9c77cfec38e6ab17b075846e662fd0360d62c132c882536489c8a865795f64059e2d2b21467f65d90320e5c39 + HEAD_REF master + PATCHES gmp.patch + name.dir.patch + runtime.nettle.patch + runtime.hogweed.patch + ) + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_DIR "${YASM}" DIRECTORY) + vcpkg_add_to_path("${YASM_DIR}") + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CONFIGURATION_RELEASE ReleaseDLL) + set(CONFIGURATION_DEBUG DebugDLL) + else() + set(CONFIGURATION_RELEASE Release) + set(CONFIGURATION_DEBUG Debug) + endif() + + if(VCPKG_TARGET_IS_UWP) + string(APPEND CONFIGURATION_RELEASE WinRT) + string(APPEND CONFIGURATION_DEBUG WinRT) + endif() + + #Setup YASM integration + set(_file "${SOURCE_PATH}/SMP/libnettle.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + set(_file "${SOURCE_PATH}/SMP/libhogweed.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + + vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH SMP/libnettle.sln + PLATFORM ${TRIPLET_SYSTEM_ARCH} + LICENSE_SUBPATH COPYING.LESSERv3 + TARGET Rebuild + RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} + DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} + SKIP_CLEAN + OPTIONS /p:UseEnv=True + ) + + get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME) + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include") + set(PACKAGE_VERSION 3.5.1) + set(prefix "${CURRENT_INSTALLED_DIR}") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/include") + set(LIBS -lnettle -lgmp) + configure_file("${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/nettle.pc" @ONLY) + set(HOGWEED -lhogweed) + set(LIBS -lnettle) + configure_file("${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libhogweed.pc" @ONLY) + set(prefix "${CURRENT_INSTALLED_DIR}/debug") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/../include") + set(LIBS -lnettled -lgmpd) + configure_file("${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/nettle.pc" @ONLY) + set(LIBS -lnettled) + set(HOGWEED -lhogweedd) + configure_file("${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libhogweed.pc" @ONLY) + vcpkg_fixup_pkgconfig() +else() + vcpkg_from_gitlab( + GITLAB_URL https://git.lysator.liu.se/ + OUT_SOURCE_PATH SOURCE_PATH + REPO nettle/nettle + REF ee5d62898cf070f08beedc410a8d7c418588bd95 #v3.5.1 + SHA512 881912548f4abb21460f44334de11439749c8a055830849a8beb4332071d11d9196d9eecaeba5bf822819d242356083fba91eb8719a64f90e41766826e6d75e1 + HEAD_REF master # branch name + #PATCHES example.patch #patch name + ) + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + OPTIONS + --disable-documentation + ${OPTIONS} + ) + + vcpkg_install_make() + vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + + # # Handle copyright + file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") + endif() +endif() + + diff --git a/ports/nettle/runtime.hogweed.patch b/ports/nettle/runtime.hogweed.patch new file mode 100644 index 00000000000000..a096b77b7b6d19 --- /dev/null +++ b/ports/nettle/runtime.hogweed.patch @@ -0,0 +1,84 @@ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index 3f400af81..e5758ea27 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -1066,6 +1066,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1190,6 +1191,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1574,6 +1576,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -1703,6 +1706,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2097,6 +2101,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2227,6 +2232,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2902,6 +2908,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3036,6 +3043,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3172,6 +3180,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3310,6 +3319,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true diff --git a/ports/nettle/runtime.nettle.patch b/ports/nettle/runtime.nettle.patch new file mode 100644 index 00000000000000..33d147ededee2e --- /dev/null +++ b/ports/nettle/runtime.nettle.patch @@ -0,0 +1,84 @@ +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 54f686af6..05b903ab9 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -1206,6 +1206,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1329,6 +1330,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1710,6 +1712,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -1838,6 +1841,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2229,6 +2233,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2358,6 +2363,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -3028,6 +3034,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3161,6 +3168,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + true +@@ -3296,6 +3304,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3433,6 +3442,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + true diff --git a/ports/nghttp2/CONTROL b/ports/nghttp2/CONTROL index 0f0fa247505714..6afd6f83b1a254 100644 --- a/ports/nghttp2/CONTROL +++ b/ports/nghttp2/CONTROL @@ -1,4 +1,4 @@ Source: nghttp2 -Version: 1.39.2-1 +Version: 1.39.2-2 Homepage: https://github.com/nghttp2/nghttp2 Description: Implementation of the Hypertext Transfer Protocol version 2 in C diff --git a/ports/nghttp2/portfile.cmake b/ports/nghttp2/portfile.cmake index e9292531254437..c7b5a5388d6bf0 100644 --- a/ports/nghttp2/portfile.cmake +++ b/ports/nghttp2/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(LIB_NAME nghttp2) set(LIB_VERSION 1.39.2) @@ -13,12 +11,22 @@ vcpkg_from_github( HEAD_REF master ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(ENABLE_STATIC_LIB ON) + set(ENABLE_SHARED_LIB OFF) +else() + set(ENABLE_STATIC_LIB OFF) + set(ENABLE_SHARED_LIB ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DENABLE_LIB_ONLY=ON -DENABLE_ASIO_LIB=OFF + -DENABLE_STATIC_LIB=${ENABLE_STATIC_LIB} + -DENABLE_SHARED_LIB=${ENABLE_SHARED_LIB} ) vcpkg_install_cmake() @@ -32,6 +40,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${LIB_NAME} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() 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-fifo-map/CMakeLists.txt b/ports/nlohmann-fifo-map/CMakeLists.txt index 5ec3e95324339e..3450e5100c0645 100644 --- a/ports/nlohmann-fifo-map/CMakeLists.txt +++ b/ports/nlohmann-fifo-map/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.1) -project(nlohmann_fifo_map LANGUAGES CXX) +project(nlohmann-fifo-map LANGUAGES CXX) include(GNUInstallDirs) set(NLOHMANN_FIFO_MAP_TARGET_NAME ${PROJECT_NAME}) set(NLOHMANN_FIFO_MAP_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/nlohmann") set(NLOHMANN_FIFO_MAP_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/nlohmann-fifo-map") -set(NLOHMANN_FIFO_MAP_CONFIG_EXPORT_NAME "${PROJECT_NAME}_config") +set(NLOHMANN_FIFO_MAP_CONFIG_EXPORT_NAME "${PROJECT_NAME}-config") set(NLOHMANN_FIFO_MAP_INCLUDE_BUILD_DIR "${CMAKE_SOURCE_DIR}/src/") add_library(${NLOHMANN_FIFO_MAP_TARGET_NAME} INTERFACE) diff --git a/ports/nlohmann-fifo-map/CONTROL b/ports/nlohmann-fifo-map/CONTROL index 9a8ec6de2bcd67..22b81c51f5f06d 100644 --- a/ports/nlohmann-fifo-map/CONTROL +++ b/ports/nlohmann-fifo-map/CONTROL @@ -1,3 +1,4 @@ Source: nlohmann-fifo-map -Version: 2018.05.07 +Version: 2018.05.07-1 +Homepage: https://github.com/nlohmann/fifo_map Description: a FIFO-ordered associative container for C++ diff --git a/ports/nlohmann-fifo-map/portfile.cmake b/ports/nlohmann-fifo-map/portfile.cmake index e2b12dc1d06b1a..3079e964e3da9a 100644 --- a/ports/nlohmann-fifo-map/portfile.cmake +++ b/ports/nlohmann-fifo-map/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nlohmann/fifo_map diff --git a/ports/nlohmann-json/CONTROL b/ports/nlohmann-json/CONTROL index 5ad907cb6a817a..f474ce9067e82e 100644 --- a/ports/nlohmann-json/CONTROL +++ b/ports/nlohmann-json/CONTROL @@ -1,4 +1,4 @@ Source: nlohmann-json -Version: 3.7.3 +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 88c33350770d3f..448ca04b399c1d 100644 --- a/ports/nlohmann-json/portfile.cmake +++ b/ports/nlohmann-json/portfile.cmake @@ -1,28 +1,45 @@ -set(SOURCE_VERSION 3.7.3) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nlohmann-json-v${SOURCE_VERSION}) +set(SOURCE_VERSION 3.9.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${PORT}-v${SOURCE_VERSION}) file(MAKE_DIRECTORY ${SOURCE_PATH}) function(download_src SUBPATH SHA512) vcpkg_download_distfile(FILE URLS "https://github.com/nlohmann/json/raw/v${SOURCE_VERSION}/${SUBPATH}" - FILENAME "nlohmann-json-v${SOURCE_VERSION}/${SUBPATH}" + FILENAME "${PORT}-v${SOURCE_VERSION}/${SUBPATH}" SHA512 ${SHA512} ) get_filename_component(SUBPATH_DIR "${SOURCE_PATH}/${SUBPATH}" DIRECTORY) file(COPY ${FILE} DESTINATION ${SUBPATH_DIR}) endfunction() -download_src(CMakeLists.txt 11ba0b69282e636e496ab854334addd9a13537bddf644d551d67e71a9f5ca2f1fda640c175bed77c279348d72a42dbe00358f16d90defaf33e4a740c850f7d7d) -download_src(LICENSE.MIT 44e6d9510dd66195211aa8ce3e6eef55be524e82c5864f3bfb85f2ac1215529c8ca370c8746de61ad5739e5af1633a5985085dacd1ffe220cd21d06433936801) +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(single_include/nlohmann/json.hpp 4ecbbdd2c5e88c897096670cfdaa7ec00483ac9ed6e8ac33be23b05f4da70f213e10c4b381f5e8799619a24a58f417f04dd442d1d59a2e0bfca3385007e620d5) +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 24984da33c5bf80eb276712d4bdc698c2724e72dc0f4c70e87527fb6b16e21f535f5a022d52c7ed2f59dcfe4a4e5b61a56101b61def09b31c827689f6c7ec673 +) +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH OUT_PATH + ARCHIVE ${ARCHIVE} + REF ${SOURCE_VERSION} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + NO_REMOVE_ONE_LEVEL +) +file(COPY "${OUT_PATH}/include" DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DJSON_BuildTests=0 + OPTIONS + -DJSON_BuildTests=0 + -DJSON_MultipleHeaders=ON ) vcpkg_install_cmake() @@ -48,4 +65,4 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis) endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/nlohmann-json RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nlopt/0001-suppress-MS-compiler-complaint-about-negating-unsign.patch b/ports/nlopt/0001-suppress-MS-compiler-complaint-about-negating-unsign.patch new file mode 100644 index 00000000000000..cd5fed49a760cb --- /dev/null +++ b/ports/nlopt/0001-suppress-MS-compiler-complaint-about-negating-unsign.patch @@ -0,0 +1,31 @@ +From 004f415c5d04dd1f616a953eb8ad078a20b72c58 Mon Sep 17 00:00:00 2001 +From: "Steven G. Johnson" +Date: Sat, 9 May 2020 13:56:40 -0400 +Subject: [PATCH] suppress MS compiler complaint about negating unsigned + (closes #330) + +--- + src/util/sobolseq.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/util/sobolseq.c b/src/util/sobolseq.c +index 6626f51..848ff68 100644 +--- a/src/util/sobolseq.c ++++ b/src/util/sobolseq.c +@@ -93,7 +93,12 @@ static unsigned rightzero32(uint32_t n) + const uint32_t a = 0x05f66a47; /* magic number, found by brute force */ + static const unsigned decode[32] = { 0, 1, 2, 26, 23, 3, 15, 27, 24, 21, 19, 4, 12, 16, 28, 6, 31, 25, 22, 14, 20, 18, 11, 5, 30, 13, 17, 10, 29, 9, 8, 7 }; + n = ~n; /* change to rightmost-one problem */ +- n = a * (n & (-n)); /* store in n to make sure mult. is 32 bits */ ++#ifdef _MSC_VER ++#pragma warning(suppress:4146) ++ n = a * (n & (-n)); /* same as below, but suppress spurious warning/error with MS compiler about negating unsigned int */ ++#else ++ n = a * (n & (-n)); /* store in n to make sure mult. is 32 bits */ ++#endif + return decode[n >> 27]; + #endif + } +-- +2.26.2.windows.1 + diff --git a/ports/nlopt/CONTROL b/ports/nlopt/CONTROL index 0cc7666bbe19a4..8d1344934f8920 100644 --- a/ports/nlopt/CONTROL +++ b/ports/nlopt/CONTROL @@ -1,4 +1,4 @@ Source: nlopt -Version: 2.6.1-1 +Version: 2.6.2-1 Homepage: https://github.com/stevengj/nlopt -Description: a library for nonlinear local and global optimization, for functions with and without gradient information. \ No newline at end of file +Description: a library for nonlinear local and global optimization, for functions with and without gradient information. diff --git a/ports/nlopt/portfile.cmake b/ports/nlopt/portfile.cmake index 5fb068145af10d..157a3ccac4235c 100644 --- a/ports/nlopt/portfile.cmake +++ b/ports/nlopt/portfile.cmake @@ -1,13 +1,11 @@ -include(vcpkg_common_functions) - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stevengj/nlopt - REF v2.6.1 - SHA512 e9b8ee75536a568e75150dc0a169d951b670d54ca9d2797f9db6f2751811d9d21be367fa6794a0bc76370715caf5356b368c9c12ad416f3cfb74ae8fa8eabd5c + REF v2.6.2 + SHA512 61e5c01140a57c0ad2a0acd82ad50dce1b5679dc281e55cbbc332e876b19a689013100617545a42b721d8c487df37d6ccd67859171243433fe29468f259b556b HEAD_REF master + PATCHES + 0001-suppress-MS-compiler-complaint-about-negating-unsign.patch ) vcpkg_configure_cmake( diff --git a/ports/nng/CONTROL b/ports/nng/CONTROL index 322ec241c558d9..56efe9edc890d0 100644 --- a/ports/nng/CONTROL +++ b/ports/nng/CONTROL @@ -1,5 +1,5 @@ Source: nng -Version: 1.2.5 +Version: 1.3.0 Description: NNG, like its predecessors nanomsg (and to some extent ZeroMQ), is a lightweight, broker-less library, offering a simple API to solve common recurring messaging problems, such as publish/subscribe, RPC-style request/reply, or service discovery. Homepage: https://github.com/nanomsg/nng diff --git a/ports/nng/portfile.cmake b/ports/nng/portfile.cmake index b628651691ea1d..e6adad95ddd9c2 100644 --- a/ports/nng/portfile.cmake +++ b/ports/nng/portfile.cmake @@ -1,28 +1,25 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nanomsg/nng - REF 53ae1a5ab37fdfc9ad5c236df3eaf4dd63f0fee9 - SHA512 f5532c0b0287df52ddae173dc92eff06d1f4b2b42a2f7afaf28a7736bf70618ae29ccd51fb9743795a8004918a2a2f55233e6ced58829561c745eafa6118b762 + REF 6ec4107907552db927be8601aed97b5a4b83d33d#version 1.3.0 + SHA512 28b99d822d7be0348d4e367c2d92cd2bd4a5563806454388ad3c7d9817ef91fa7b4408d15ce4c77ac6a8ad2dd7db173899fdaf7881585282bf57f4c487909be6 HEAD_REF master ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" NNG_STATIC_LIB) -if("mbedtls" IN_LIST FEATURES) - set(NNG_ENABLE_TLS ON) -else() - set(NNG_ENABLE_TLS OFF) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + mbedtls NNG_ENABLE_TLS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE -DNNG_STATIC_LIB=${NNG_STATIC_LIB} -DNNG_TESTS=OFF -DNNG_ENABLE_NNGCAT=OFF - -DNNG_ENABLE_TLS=${NNG_ENABLE_TLS} ) vcpkg_install_cmake() diff --git a/ports/nngpp/CONTROL b/ports/nngpp/CONTROL index 8d9a011e0b0de4..9c52b24b4ef154 100644 --- a/ports/nngpp/CONTROL +++ b/ports/nngpp/CONTROL @@ -1,5 +1,5 @@ Source: nngpp -Version: 1.2.4 +Version: 1.3.0 Homepage: https://github.com/cwzx/nngpp Description: C++ wrapper around the nanomsg NNG API. Build-Depends: nng diff --git a/ports/nngpp/portfile.cmake b/ports/nngpp/portfile.cmake index aebee156bfe420..5da246e5533e5e 100644 --- a/ports/nngpp/portfile.cmake +++ b/ports/nngpp/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO cwzx/nngpp - REF 85294eda3f584281439649a074f46e2d3516b2a1 - SHA512 8f794c323a4cefe67b525652480154bbd6b8ca205f37de04ee1a14fc56b794a754972931c85dc5a1969b6fc626ef6b7f1a2682ac9cd627c86b2e811a5c077c0e + REF cc5d2641babab165d8a9943817c46d36c6dc17c2 #v1.3.0 + SHA512 76b78f5b39b24fae3820924abb5c2f8f51f1683c08211366668745196b184ee4b4c9b1fd2fc68e8f234a56b802a4a79249d173d1562af46046d19a4498222405 HEAD_REF master ) diff --git a/ports/nowide/CONTROL b/ports/nowide/CONTROL new file mode 100644 index 00000000000000..a7c69dc4952615 --- /dev/null +++ b/ports/nowide/CONTROL @@ -0,0 +1,4 @@ +Source: nowide +Version: 11.0.0 +Homepage: https://github.com/boostorg/nowide +Description: Boost nowide module (standalone) diff --git a/ports/nowide/portfile.cmake b/ports/nowide/portfile.cmake new file mode 100644 index 00000000000000..6ad39c0bb00035 --- /dev/null +++ b/ports/nowide/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/boostorg/nowide/releases/download/v11.0.0/nowide_standalone_v11.0.0.tar.gz" + FILENAME "nowide_standalone_v11.0.0.tar.gz" + SHA512 315b56e2e6cfe26459e71bc664953b6e5b81351e409dd8f63d6848a49fd5d5834e39f1ed4de28ce0ed288332d71b63a5ddac9894531d42181f23eaf627d077ac +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/nowide TARGET_PATH share/${PORT}) + +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/nrf-ble-driver/CONTROL b/ports/nrf-ble-driver/CONTROL index b148716a9c3cdc..fa530b0440343e 100644 --- a/ports/nrf-ble-driver/CONTROL +++ b/ports/nrf-ble-driver/CONTROL @@ -1,4 +1,4 @@ Source: nrf-ble-driver -Version: 4.1.1-2 +Version: 4.1.2 Description: BLE driver is a library for Bluetooth Low Energy communication using Nordic Semiconductor development kits. -Build-Depends: asio, catch2 +Build-Depends: spdlog, catch2, cli11, asio diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index 3594b7c3aadc80..447f9065cce546 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -11,8 +11,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO NordicSemiconductor/pc-ble-driver - REF v4.1.1 - SHA512 bb1853993b3f37836a8f7402e5c0452e8423c3a1c6e651cf353025022a32e16c72f06e2266e283c72fa7ddb0da7cf8cecb875a7a7762565599f2908c4858ce8e + REF v4.1.2 + SHA512 625a52151f2c78421e48e90ff60292c6106e8504b55a26c7df716df75e051a40d2ee4a26c57b5daaa370e53a79002fe965aee8a0d8749f7dce380e8e4a617c95 HEAD_REF master PATCHES 001-arm64-support.patch @@ -28,13 +28,20 @@ set(ENV{PATH} "$ENV{PATH};${GIT_EXE_DIRPATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DDISABLE_EXAMPLES= -DDISABLE_TESTS= -DNRF_BLE_DRIVER_VERSION=4.1.1 -DCONNECTIVITY_VERSION=4.1.1 + OPTIONS -DDISABLE_EXAMPLES= -DDISABLE_TESTS= -DNRF_BLE_DRIVER_VERSION=4.1.2 -DCONNECTIVITY_VERSION=4.1.2 ) vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +# Copy hex files into shared folder for package +foreach(HEX_DIR IN ITEMS "sd_api_v2" "sd_api_v3" "sd_api_v5" "sd_api_v6") + set(TARGET_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}/hex/${HEX_DIR}") + file(MAKE_DIRECTORY ${TARGET_DIRECTORY}) + file(INSTALL "${SOURCE_PATH}/hex/${HEX_DIR}" DESTINATION ${TARGET_DIRECTORY}/..) +endforeach() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) diff --git a/ports/nuspell/CONTROL b/ports/nuspell/CONTROL index 011370649b9f88..0ca6240fa10429 100644 --- a/ports/nuspell/CONTROL +++ b/ports/nuspell/CONTROL @@ -1,7 +1,7 @@ Source: nuspell -Version: 3.0.0 -Description: Nuspell is a free and open source spell checker library and - command-line program designed for languages with rich morphology and complex - word compounding. +Version: 3.1.1 +Description: Nuspell is a fast and safe spelling checker software program. + It is designed for languages with rich morphology and complex word compounding. + Nuspell is written in modern C++ and it supports Hunspell dictionaries. Homepage: https://nuspell.github.io/ Build-Depends: icu, boost-locale, boost-container, boost-range diff --git a/ports/nuspell/cmake-disable-cli-and-docs.patch b/ports/nuspell/cmake-disable-cli-and-docs.patch index 8b2caa51c4ac8e..fd6f82fac03772 100644 --- a/ports/nuspell/cmake-disable-cli-and-docs.patch +++ b/ports/nuspell/cmake-disable-cli-and-docs.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ca0212..8c14d24 100644 +index a498118..161f0f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,6 @@ if (subproject) @@ -8,9 +8,9 @@ index 6ca0212..8c14d24 100644 -add_subdirectory(docs) - - option(BUILD_TESTING "Build the testing tree." ON) - if (BUILD_TESTING) - enable_testing() + function(find_catch2_from_source) + set(Catch2_FOUND Catch2-NOTFOUND PARENT_SCOPE) + set(catch_cmake_lists ${PROJECT_SOURCE_DIR}/external/Catch2/CMakeLists.txt) diff --git a/src/nuspell/CMakeLists.txt b/src/nuspell/CMakeLists.txt index 22894f6..d58ad43 100644 --- a/src/nuspell/CMakeLists.txt diff --git a/ports/nuspell/portfile.cmake b/ports/nuspell/portfile.cmake index b0645864c5ba1d..a34c9cce3ddae9 100644 --- a/ports/nuspell/portfile.cmake +++ b/ports/nuspell/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nuspell/nuspell - REF v3.0.0 - SHA512 d9cd7dd276e2bca43dec3abaf11c5206695949b9fda8c9b86f2772cc7e8fa95bf17c685a2ef9ca87fe3c4f0b55f2fcb435bc21c187355f5e3fa35dcafab2c8c2 + REF v3.1.1 + SHA512 239855051d9f49ba16913283090c4214a8f6a6cc290d359ab54014ff76fc297c131b67c6748bd1d4cdcec43c00dccc7f0c1bf8b07e06c9c648bff52ff193e096 HEAD_REF master PATCHES cmake-disable-cli-and-docs.patch diff --git a/ports/oatpp-consul/CONTROL b/ports/oatpp-consul/CONTROL new file mode 100644 index 00000000000000..d6722dcbe3f044 --- /dev/null +++ b/ports/oatpp-consul/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-consul +Version: 1.0.0 +Description: OAT++ Modern web framework consul module +Build-Depends: oatpp diff --git a/ports/oatpp-consul/portfile.cmake b/ports/oatpp-consul/portfile.cmake new file mode 100644 index 00000000000000..f7568990c04bee --- /dev/null +++ b/ports/oatpp-consul/portfile.cmake @@ -0,0 +1,32 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-consul + REF 4fb420fdf9286f0e0f8d2a1dbd30a56024f10529 # 1.0.0 + SHA512 fa26ed7b12ed1cc6bf0a969628b4e70a911bfba76562a6c7406a13875dae88f5125349107e3278362441b518d556ac75c926994b21f93e02e2decc80883e3bfa + HEAD_REF master +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-consul-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp-curl/CONTROL b/ports/oatpp-curl/CONTROL new file mode 100644 index 00000000000000..1b80b3883ef339 --- /dev/null +++ b/ports/oatpp-curl/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-curl +Version: 1.0.0 +Description: Oat++ Modern web framework curl module to use libcurl as a RequestExecutor on the oatpp's ApiClient +Build-Depends: curl,oatpp diff --git a/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch b/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch new file mode 100644 index 00000000000000..75fe7af369cdea --- /dev/null +++ b/ports/oatpp-curl/curl-submodule-no-pkg-config-in-vcpkg.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 477064a..5da99e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,8 +95,26 @@ message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n") + ############################## + ## Find libcurl dependency + +-include(FindPkgConfig) +-pkg_check_modules(PKG_CURL REQUIRED libcurl) ++if (VCPKG_TOOLCHAIN) ++ find_package(CURL REQUIRED) ++ if (CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$") ++ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_DEBUG} NAME) ++ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_DEBUG} DIRECTORY) ++ else() ++ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_RELEASE} NAME) ++ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_RELEASE} DIRECTORY) ++ endif() ++ if (PKG_CURL_LIBRARIES MATCHES [[^.*\.a$]]) ++ string(LENGTH ${PKG_CURL_LIBRARIES} _LEN) ++ math(EXPR _LEN "${_LEN} - 5") ++ string(SUBSTRING ${PKG_CURL_LIBRARIES} 3 ${_LEN} PKG_CURL_LIBRARIES) ++ endif() ++ set(PKG_CURL_VERSION ${CURL_VERSION}) ++ set(PKG_CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS}) ++else() ++ include(FindPkgConfig) ++ pkg_check_modules(PKG_CURL REQUIRED libcurl) ++endif() + + message("[libcurl] libcurl found:") + message("[libcurl] LIBRARIES=${PKG_CURL_LIBRARIES}") diff --git a/ports/oatpp-curl/portfile.cmake b/ports/oatpp-curl/portfile.cmake new file mode 100644 index 00000000000000..0e2388fa2f9a9d --- /dev/null +++ b/ports/oatpp-curl/portfile.cmake @@ -0,0 +1,33 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-curl + REF 03a3f336be70c71d0547489aa0ed50206f46dcf8 # 1.0.0 + SHA512 799cbddeb6e9d90eb43911845dd33ee272c4e86c86a07bb710ceb8c0e1722cda15412fdca10c4228a77f38e3b9e3d5d5248c8cd4366cbb9c369db4a830e29496 + HEAD_REF master + PATCHES "curl-submodule-no-pkg-config-in-vcpkg.patch" +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-curl-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp-libressl/CONTROL b/ports/oatpp-libressl/CONTROL new file mode 100644 index 00000000000000..dd867ff361ff34 --- /dev/null +++ b/ports/oatpp-libressl/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-libressl +Version: 1.0.0 +Build-Depends: libressl, oatpp +Description: Oat++ libressl module providing secure server and client connection providers diff --git a/ports/oatpp-libressl/libress-submodule-downgrade-required-libressl-version.patch b/ports/oatpp-libressl/libress-submodule-downgrade-required-libressl-version.patch new file mode 100644 index 00000000000000..62644beda76015 --- /dev/null +++ b/ports/oatpp-libressl/libress-submodule-downgrade-required-libressl-version.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4663a65..b91077a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,19 +95,25 @@ message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n") + ############################## + ## Find Libressl dependency + +-include(FindPkgConfig) +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/module") +- +-find_package(LibreSSL 3.0.0 REQUIRED) +- +-message("LIBRESSL_INCLUDE_DIR=${LIBRESSL_INCLUDE_DIR}") +-message("LIBRESSL_TLS_LIBRARY=${LIBRESSL_TLS_LIBRARY}") +-message("LIBRESSL_SSL_LIBRARY=${LIBRESSL_SSL_LIBRARY}") +-message("LIBRESSL_CRYPTO_LIBRARY=${LIBRESSL_CRYPTO_LIBRARY}") +-message("LIBRESSL_LIBRARIES=${LIBRESSL_LIBRARIES}") +-message("LIBRESSL_VERSION=${LIBRESSL_VERSION}") +- +-message("\n############################################################################\n") ++find_file(LIBRESSL_INCLUDE_DIR tls.h) ++if (NOT LIBRESSL_INCLUDE_DIR) ++ find_file(_OPENSSL_SSL_INCLUDE_FILE openssl/ssl.h) ++ if (NOT _OPENSSL_SSL_INCLUDE_FILE) ++ message(FATAL_ERROR "LibreSSL and OpenSSL not found. LibreSSL must be installed.") ++ else() ++ message(FATAL_ERROR "OpenSSL installed instead of LibreSSL. oatpp-libressl requires LibreSSL.") ++ endif() ++endif() ++get_filename_component(LIBRESSL_INCLUDE_DIR ${LIBRESSL_INCLUDE_DIR} DIRECTORY) ++find_library(LIBRESSL_TLS_LIBRARY NAMES tls tls-21 tls-20 tls-19) ++find_library(LIBRESSL_SSL_LIBRARY NAMES ssl ssl-49 ssl-48 ssl-47) ++find_library(LIBRESSL_CRYPTO_LIBRARY NAMES crypto crypto-47 crypto-46 crypto-45) ++find_library(LIBRESSL_LIBRARIES "${LIBRESSL_CRYPTO_LIBRARY};${LIBRESSL_SSL_LIBRARY};${LIBRESSL_TLS_LIBRARY}") ++message(STATUS "LIBRESSL_INCLUDE_DIR=${LIBRESSL_INCLUDE_DIR}") ++message(STATUS "LIBRESSL_TLS_LIBRARY=${LIBRESSL_TLS_LIBRARY}") ++message(STATUS "LIBRESSL_SSL_LIBRARY=${LIBRESSL_SSL_LIBRARY}") ++message(STATUS "LIBRESSL_CRYPTO_LIBRARY=${LIBRESSL_CRYPTO_LIBRARY}") ++message(STATUS "LIBRESSL_LIBRARIES=${LIBRESSL_LIBRARIES}") + + ################################################################################################### + ## define targets +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ace3b13..489fbb1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -30,10 +30,12 @@ target_include_directories(${OATPP_THIS_MODULE_NAME} + PUBLIC $ + ) + ++target_include_directories(${OATPP_THIS_MODULE_NAME} ++ SYSTEM PRIVATE "${LIBRESSL_INCLUDE_DIR}" ++) ++ + target_link_libraries(${OATPP_THIS_MODULE_NAME} +- PUBLIC LibreSSL::TLS +- PUBLIC LibreSSL::SSL +- PUBLIC LibreSSL::Crypto ++ PUBLIC "${LIBRESSL_TLS_LIBRARY}" "${LIBRESSL_SSL_LIBRARY}" "${LIBRESSL_CRYPTO_LIBRARY}" + ) + + ####################################################################################################### diff --git a/ports/oatpp-libressl/portfile.cmake b/ports/oatpp-libressl/portfile.cmake new file mode 100644 index 00000000000000..14bb9f5e27508a --- /dev/null +++ b/ports/oatpp-libressl/portfile.cmake @@ -0,0 +1,36 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +# get the source +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-libressl + REF 2cf02b6fd08bb9be29bdbe5188f35f2155c0c843 # 1.0.0 + SHA512 053d017690d318edeeda63f782ee4845280b0f405e02249b18c30ac3d88cbfb1d3090bb6b60c0c8742f73357d60fa1695c369bef56a5ab7985d9773ea1fd52a2 + HEAD_REF master + PATCHES "libress-submodule-downgrade-required-libressl-version.patch" +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS" + "-DLIBRESSL_ROOT_DIR=${CURRENT_INSTALLED_DIR}" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-libressl-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp-mbedtls/CONTROL b/ports/oatpp-mbedtls/CONTROL new file mode 100644 index 00000000000000..c4edffd72004d5 --- /dev/null +++ b/ports/oatpp-mbedtls/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-mbedtls +Version: 1.0.0 +Build-Depends: mbedtls, oatpp +Description: Oat++ Mbed TLS submodule providing secure server and client connection providers diff --git a/ports/oatpp-mbedtls/portfile.cmake b/ports/oatpp-mbedtls/portfile.cmake new file mode 100644 index 00000000000000..18538fcf58f5f1 --- /dev/null +++ b/ports/oatpp-mbedtls/portfile.cmake @@ -0,0 +1,31 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-mbedtls + REF f4223fe43c3db3d5a8638f5682ab19ce9f2c8342 # 1.0.0 + SHA512 ff36d74d295f4351b2b10df585c76704f9f63a65fa91856c32f65d914e1cae8bcdd866310d8a2d6ac6f1b4af1ebc610b607327669be6d13b1773dd5117707c25 + HEAD_REF master +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-mbedtls-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp-swagger/CONTROL b/ports/oatpp-swagger/CONTROL new file mode 100644 index 00000000000000..bb320bc2f61ddd --- /dev/null +++ b/ports/oatpp-swagger/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-swagger +Version: 1.0.0 +Description: Oat++ OpenApi (Swagger) UI submodule +Build-Depends: oatpp diff --git a/ports/oatpp-swagger/portfile.cmake b/ports/oatpp-swagger/portfile.cmake new file mode 100644 index 00000000000000..a39b11a8ed7613 --- /dev/null +++ b/ports/oatpp-swagger/portfile.cmake @@ -0,0 +1,33 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-swagger + REF 8e4a5d32f82ff71ad645fbfb7e5257a6b611ecfd # 1.0.0 + SHA512 9ae31686689862667871531e92625239fd8b54a6ed77b54ab85ecb09633afae0d450be5bcee6e266d01b2edc602bae6c0ab59dd12f926d689f7183373a39bb21 + HEAD_REF master +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-swagger-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp-websocket/CONTROL b/ports/oatpp-websocket/CONTROL new file mode 100644 index 00000000000000..75d9104ae286fc --- /dev/null +++ b/ports/oatpp-websocket/CONTROL @@ -0,0 +1,4 @@ +Source: oatpp-websocket +Version: 1.0.0 +Description: Oat++ websocket module +Build-Depends: oatpp diff --git a/ports/oatpp-websocket/portfile.cmake b/ports/oatpp-websocket/portfile.cmake new file mode 100644 index 00000000000000..ed871ab22f5341 --- /dev/null +++ b/ports/oatpp-websocket/portfile.cmake @@ -0,0 +1,32 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp-websocket + REF d047321db5ca9194b0035eea481623983a59c82c # 1.0.0 + SHA512 76e411557a790fccbd346241826a89a01f707ecb6bf3295fd4c7af706d376d5cb21070ee375b45ce1aa14ad8d79db753c1adbc2b503b79c8b8e5ae59a044b03b + HEAD_REF master +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-websocket-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/oatpp/CONTROL b/ports/oatpp/CONTROL new file mode 100644 index 00000000000000..fa72f6939bca39 --- /dev/null +++ b/ports/oatpp/CONTROL @@ -0,0 +1,3 @@ +Source: oatpp +Version: 1.0.0 +Description: Modern web framework diff --git a/ports/oatpp/portfile.cmake b/ports/oatpp/portfile.cmake new file mode 100644 index 00000000000000..2be9bc0c596d49 --- /dev/null +++ b/ports/oatpp/portfile.cmake @@ -0,0 +1,33 @@ +set(OATPP_VERSION "1.0.0") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO oatpp/oatpp + REF 5a9f042a78e7a47d1788407c99f6257fc7b40fa9 # 1.0.0 + SHA512 133f69e43608b3b5eda929952c8fb49f08bbc114d75b326293a7ddf5f40b7b94ffcff7df2d999c91195ba9939166143ad173b27a962f4fb661f731f63a44116e + HEAD_REF master +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "ON") +else() + set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS + "-DOATPP_BUILD_TESTS:BOOL=OFF" + "-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS" + "-DBUILD_SHARED_LIBS:BOOL=${OATPP_BUILD_SHARED_LIBRARIES_OPTION}" +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-${OATPP_VERSION}) +vcpkg_copy_pdbs() + +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/ocilib/CONTROL b/ports/ocilib/CONTROL new file mode 100644 index 00000000000000..c5d4fbb3742c95 --- /dev/null +++ b/ports/ocilib/CONTROL @@ -0,0 +1,5 @@ +Source: ocilib +Version: 4.6.4-1 +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/out_of_source_build_version_file_configure.patch b/ports/ocilib/out_of_source_build_version_file_configure.patch new file mode 100644 index 00000000000000..0359e2323a9ead --- /dev/null +++ b/ports/ocilib/out_of_source_build_version_file_configure.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 6a87f9c..89ca6db 100755 +--- a/configure ++++ b/configure +@@ -12628,7 +12628,7 @@ $as_echo "$OCILIB_PREFIX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCILIB version" >&5 + $as_echo_n "checking for OCILIB version... " >&6; } + +- OCILIB_VER=`cat VERSION` ++ OCILIB_VER=`cat ${srcdir}/VERSION` + + LT_MAJOR=`echo $OCILIB_VER | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + LT_AGE=`echo $OCILIB_VER | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` diff --git a/ports/ocilib/portfile.cmake b/ports/ocilib/portfile.cmake new file mode 100644 index 00000000000000..84912c10f6c5d5 --- /dev/null +++ b/ports/ocilib/portfile.cmake @@ -0,0 +1,62 @@ +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 +) + +if(VCPKG_TARGET_IS_WINDOWS) + 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") + set(SOLUTION_TYPE vs2017) + set(OCILIB_ARCH_X86 Win32) + set(OCILIB_ARCH_X64 Win64) + else() + set(SOLUTION_TYPE vs2015) + set(OCILIB_ARCH_X86 Win32) + set(OCILIB_ARCH_X64 Win64) + 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) + + 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_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) +endif() diff --git a/ports/octomap/CONTROL b/ports/octomap/CONTROL index afac685c6d291a..41a21a2762db56 100644 --- a/ports/octomap/CONTROL +++ b/ports/octomap/CONTROL @@ -1,3 +1,4 @@ Source: octomap -Version: 2017-03-11-7 +Version: 2017-03-11-8 +Homepage: https://octomap.github.io/ Description: An Efficient Probabilistic 3D Mapping Framework Based on Octrees diff --git a/ports/octomap/portfile.cmake b/ports/octomap/portfile.cmake index 203adce4df93e5..0481b4d7d3c42e 100644 --- a/ports/octomap/portfile.cmake +++ b/ports/octomap/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -17,6 +15,7 @@ vcpkg_configure_cmake( PREFER_NINJA DISABLE_PARALLEL_CONFIGURE OPTIONS + -DBUILD_TESTING=OFF -DBUILD_OCTOVIS_SUBPROJECT=OFF -DBUILD_DYNAMICETD3D_SUBPROJECT=OFF ) @@ -25,29 +24,9 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/octomap) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/binvox2bt.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/binvox2bt.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/bt2vrml.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/bt2vrml.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/compare_octrees.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/compare_octrees.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/convert_octree.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/convert_octree.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/edit_octree.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/edit_octree.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/eval_octree_accuracy.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/eval_octree_accuracy.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/graph2tree.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/graph2tree.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/log2graph.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/log2graph.exe) - - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/binvox2bt.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/bt2vrml.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/compare_octrees.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/convert_octree.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/edit_octree.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/eval_octree_accuracy.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/graph2tree.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/log2graph.exe) -else() - file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/octomap) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() +vcpkg_copy_tools( + TOOL_NAMES binvox2bt bt2vrml compare_octrees convert_octree edit_octree eval_octree_accuracy graph2tree log2graph + AUTO_CLEAN) vcpkg_fixup_cmake_targets() @@ -60,8 +39,6 @@ endif() file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/octomap") # Handle copyright -file(COPY ${SOURCE_PATH}/octomap/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/octomap) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/octomap/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/octomap/copyright) +file(INSTALL ${SOURCE_PATH}/octomap/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/octomap) diff --git a/ports/ode/CONTROL b/ports/ode/CONTROL index 5658a5a7afa839..4c01578be7b6fa 100644 --- a/ports/ode/CONTROL +++ b/ports/ode/CONTROL @@ -1,4 +1,4 @@ Source: ode -Version: 0.16 +Version: 0.16.1 Homepage: https://bitbucket.org/odedevs/ode/src/default/ Description: Open Dynamics Engine diff --git a/ports/ode/portfile.cmake b/ports/ode/portfile.cmake index a45777fb6a59a5..cb10fc9c0369f4 100644 --- a/ports/ode/portfile.cmake +++ b/ports/ode/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_bitbucket( OUT_SOURCE_PATH SOURCE_PATH REPO odedevs/ode - REF 0.16 - SHA512 6a98882aa3e6267423f745ec48f2472d330f94fa395c459e116174093ef1d479368efc0514ef04eff4e62eb7c3520a7a544fc3ed66ff2f1bd06bc13df4110581 + REF 0.16.1 + SHA512 04429cae1b8fc703e53880c5de78293cee46fe4855c96ca7006bd5848255a0df004b75716a6b30ff5176df004e2bec29b2a31d4af8e7ac59da18f0af2eed8396 HEAD_REF master ) @@ -15,7 +13,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ode-0.16.0) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ode-0.16.1) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/offscale-libetcd-cpp/CONTROL b/ports/offscale-libetcd-cpp/CONTROL index ec080142cec1be..e164c928ecbfc7 100644 --- a/ports/offscale-libetcd-cpp/CONTROL +++ b/ports/offscale-libetcd-cpp/CONTROL @@ -1,5 +1,5 @@ Source: offscale-libetcd-cpp -Version: 2019-07-10 +Version: 2019-07-10-1 Homepage: https://github.com/offscale/libetcd-cpp Description: A C++ client library for etcd. etcd is a distributed, reliable key-value store. Build-Depends: grpc, protobuf diff --git a/ports/offscale-libetcd-cpp/fix-dependency-grpc.patch b/ports/offscale-libetcd-cpp/fix-dependency-grpc.patch new file mode 100644 index 00000000000000..652720333edafd --- /dev/null +++ b/ports/offscale-libetcd-cpp/fix-dependency-grpc.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d9aad9..d68c5f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,7 +70,7 @@ endif() + target_include_directories(etcdcpp PRIVATE "generated/") + target_include_directories(etcdcpp INTERFACE "${CMAKE_INSTALL_PREFIX}/include") + +-target_link_libraries(etcdcpp PRIVATE gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc_cronet) ++target_link_libraries(etcdcpp PRIVATE gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc++_alts) + target_link_libraries(etcdcpp PRIVATE protobuf::libprotoc protobuf::libprotobuf) + + install(TARGETS etcdcpp EXPORT etcdcpp DESTINATION lib) diff --git a/ports/offscale-libetcd-cpp/portfile.cmake b/ports/offscale-libetcd-cpp/portfile.cmake index ffe4519f8926d0..e6857aa3d437e6 100644 --- a/ports/offscale-libetcd-cpp/portfile.cmake +++ b/ports/offscale-libetcd-cpp/portfile.cmake @@ -1,11 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO offscale/libetcd-cpp REF 8607d8d7080c6eb447bc41b799a24bfdb87cf638 SHA512 9bf4bf14fd52f4f6bbf8cf68de61e6a19eeffbdc501f05c8f614b5f13f206410884afd7fe226a077448e58e02990c65a6b27ee895ed34ba5ee701abe0500b875 HEAD_REF master + PATCHES fix-dependency-grpc.patch ) vcpkg_configure_cmake( @@ -14,6 +13,6 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/offscale-libetcd-cpp RENAME copyright) - vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/ogre-next/CONTROL b/ports/ogre-next/CONTROL index 0ac635f0cc2c5d..f2ebbddafa8bf1 100644 --- a/ports/ogre-next/CONTROL +++ b/ports/ogre-next/CONTROL @@ -1,5 +1,5 @@ Source: ogre-next -Version: 2019-10-20 +Version: 2019-10-20-1 Build-Depends: zlib, freeimage, freetype, rapidjson, openvr, boost-thread, boost-date-time, poco, tbb, sdl2, tinyxml, zziplib Homepage: https://github.com/OGRECave/ogre-next Description: Ogre 2.1 & 2.2 - scene-oriented, flexible 3D engine written in C++ diff --git a/ports/ogre-next/portfile.cmake b/ports/ogre-next/portfile.cmake index ade55bcc2faf85..02f147ab85b963 100644 --- a/ports/ogre-next/portfile.cmake +++ b/ports/ogre-next/portfile.cmake @@ -1,6 +1,8 @@ # This portfile is based (shamelessly copied and adapted a bit) on 'ogre' portfile. -include(vcpkg_common_functions) +if (EXISTS "${CURRENT_INSTALLED_DIR}/Media/HLMS/Blendfunctions_piece_fs.glslt") + message(FATAL_ERROR "FATAL ERROR: ogre-next and ogre are incompatible.") +endif() if(NOT VCPKG_TARGET_IS_WINDOWS) message("${PORT} currently requires the following library from the system package manager:\n Xaw\n\nIt can be installed on Ubuntu systems via apt-get install libxaw7-dev") @@ -87,7 +89,7 @@ endif() #Remove OgreMain*.lib from lib/ folder, because autolink would complain, since it defines a main symbol #manual-link subfolder is here to the rescue! -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -114,6 +116,6 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre-next RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL deleted file mode 100644 index 3522ff8c5e890b..00000000000000 --- a/ports/ogre/CONTROL +++ /dev/null @@ -1,18 +0,0 @@ -Source: ogre -Version: 1.12.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 898077c1e35af0..408ce416bf6544 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -1,17 +1,21 @@ -include(vcpkg_common_functions) +if (EXISTS "${CURRENT_INSTALLED_DIR}/Media/HLMS/Blendfunctions_piece_fs.glslt") + message(FATAL_ERROR "FATAL ERROR: ogre-next and ogre are incompatible.") +endif() -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(NOT VCPKG_TARGET_IS_WINDOWS) message("${PORT} currently requires the following library from the system package manager:\n Xaw\n\nIt can be installed on Ubuntu systems via apt-get install libxaw7-dev") 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") @@ -24,29 +28,12 @@ endif() # Configure features -if("d3d9" IN_LIST FEATURES) - set(WITH_D3D9 ON) -else() - set(WITH_D3D9 OFF) -endif() - -if("java" IN_LIST FEATURES) - set(WITH_JAVA ON) -else() - set(WITH_JAVA OFF) -endif() - -if("python" IN_LIST FEATURES) - set(WITH_PYTHON ON) -else() - set(WITH_PYTHON OFF) -endif() - -if("csharp" IN_LIST FEATURES) - set(WITH_CSHARP ON) -else() - set(WITH_CSHARP OFF) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + d3d9 OGRE_BUILD_RENDERSYSTEM_D3D9 + java OGRE_BUILD_COMPONENT_JAVA + python OGRE_BUILD_COMPONENT_PYTHON + csharp OGRE_BUILD_COMPONENT_CSHARP +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -73,10 +60,7 @@ vcpkg_configure_cmake( -DOGRE_BUILD_RENDERSYSTEM_GLES=OFF -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF # Optional stuff - -DOGRE_BUILD_COMPONENT_JAVA=${WITH_JAVA} - -DOGRE_BUILD_COMPONENT_PYTHON=${WITH_PYTHON} - -DOGRE_BUILD_COMPONENT_CSHARP=${WITH_CSHARP} - -DOGRE_BUILD_RENDERSYSTEM_D3D9=${WITH_D3D9} + ${FEATURE_OPTIONS} # vcpkg specific stuff -DOGRE_CMAKE_DIR=share/ogre ) @@ -105,7 +89,7 @@ endif() #Remove OgreMain*.lib from lib/ folder, because autolink would complain, since it defines a main symbol #manual-link subfolder is here to the rescue! -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -132,6 +116,6 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() 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/ois/CONTROL b/ports/ois/CONTROL index 2759167a70dc52..b43ed59dd9ecaf 100644 --- a/ports/ois/CONTROL +++ b/ports/ois/CONTROL @@ -1,4 +1,4 @@ Source: ois -Version: 1.5 +Version: 1.5-1 Description: Cross Platform Object Oriented Input Lib System. Meant to be very robust and compatiable with many systems and operating systems. Homepage: https://wgois.github.io/OIS/ \ No newline at end of file diff --git a/ports/ois/portfile.cmake b/ports/ois/portfile.cmake index 526cdb6b82c61d..f35d3d5378139d 100644 --- a/ports/ois/portfile.cmake +++ b/ports/ois/portfile.cmake @@ -26,6 +26,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# CMake integration test -# vcpkg_test_cmake(PACKAGE_NAME ${PORT}) diff --git a/ports/ompl/CONTROL b/ports/ompl/CONTROL index 221507c056880c..292ad71b66ee57 100644 --- a/ports/ompl/CONTROL +++ b/ports/ompl/CONTROL @@ -1,7 +1,9 @@ Source: ompl -Version: 1.4.2-2 +Version: 1.4.2 +Port-Version: 5 +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-disjoint-sets, boost-dynamic-bitset, boost-filesystem, boost-graph, boost-odeint, boost-program-options, boost-serialization, boost-system, boost-test, boost-ublas, boost-timer, eigen3 +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 Feature: app Description: Add support for reading meshes and performing collision checking diff --git a/ports/ompl/portfile.cmake b/ports/ompl/portfile.cmake index f6eaab8089d5da..a3c1244e931a22 100644 --- a/ports/ompl/portfile.cmake +++ b/ports/ompl/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_buildpath_length_warning(37) set(OMPL_VERSION 1.4.2) @@ -22,9 +20,16 @@ vcpkg_extract_source_archive_ex( 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. +file(READ ${SOURCE_PATH}/CMakeLists.txt _contents) +string(REPLACE "find_package(Eigen3 REQUIRED)" "find_package(Eigen3 CONFIG REQUIRED)" _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 @@ -58,8 +63,9 @@ if ("app" IN_LIST FEATURES) ) endif() -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ompl RENAME copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() -# Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME ompl) +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/open62541/CONTROL b/ports/open62541/CONTROL index 217a805b3532e3..7fe4dfe462d90a 100644 --- a/ports/open62541/CONTROL +++ b/ports/open62541/CONTROL @@ -1,4 +1,14 @@ Source: open62541 -Version: 1.0.1 +Version: 1.1 Homepage: https://open62541.org Description: open62541 is an open source C (C99) implementation of OPC UA licensed under the Mozilla Public License v2.0. +Supports: !uwp +Default-Features: openssl + +Feature: openssl +Description: Enable encryption support (uses OpenSSL) +Build-Depends: openssl + +Feature: mbedtls +Description: Enable encryption support (uses MbedTLS) +Build-Depends: mbedtls diff --git a/ports/open62541/fix-install-bindir.patch b/ports/open62541/fix-install-bindir.patch deleted file mode 100644 index 40eb3579de6e99..00000000000000 --- a/ports/open62541/fix-install-bindir.patch +++ /dev/null @@ -1,16 +0,0 @@ - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..09589b6e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1151,7 +1151,7 @@ install(TARGETS open62541 - EXPORT open62541Targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION include) - - if(UA_ENABLE_AMALGAMATION) diff --git a/ports/open62541/portfile.cmake b/ports/open62541/portfile.cmake index 55a6496084827f..99f12e79c68bd2 100644 --- a/ports/open62541/portfile.cmake +++ b/ports/open62541/portfile.cmake @@ -1,14 +1,16 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") - -set(VERSION v1.0.1) +set(VERSION v1.1) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO open62541/open62541 - REF e4309754fc2f6ea6508b59ca82e08c27b0118d74 # v1.0.1 - SHA512 bfff9e722c5ee70b93abc54fe0b3267c531bbe039d3344376069175b5d5d95324cd9471ad45674c50393fb0259faacfa94eac1814de11dde4538d76f3e74b2bb + REF a524accc338c9611a5ec60bf595c1a587243b457 # v1.1 + SHA512 ee60e6b58f31bb7d4a8875c4390cf54edee83d242b39b1730ee39af0e13c29d4aeb8788294c3da00039d60020a9a2e1e241e1fb389ffe36598116c58a7ffdaba HEAD_REF master - PATCHES fix-install-bindir.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + openssl UA_ENABLE_ENCRYPTION_OPENSSL + mbedtls UA_ENABLE_ENCRYPTION_MBEDTLS ) vcpkg_find_acquire_program(PYTHON3) @@ -19,6 +21,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DOPEN62541_VERSION=${VERSION} OPTIONS_DEBUG -DCMAKE_DEBUG_POSTFIX=d diff --git a/ports/openal-soft/CONTROL b/ports/openal-soft/CONTROL index cba75db9a9d234..a139fb9e8085a8 100644 --- a/ports/openal-soft/CONTROL +++ b/ports/openal-soft/CONTROL @@ -1,5 +1,6 @@ Source: openal-soft -Version: 1.20.1-1 +Version: 1.20.1 +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 38923de187e7b8..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") @@ -57,6 +58,7 @@ vcpkg_configure_cmake( -DALSOFT_REQUIRE_DSOUND=${ALSOFT_REQUIRE_WINDOWS} -DALSOFT_REQUIRE_MMDEVAPI=${ALSOFT_REQUIRE_WINDOWS} -DALSOFT_CPUEXT_NEON=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_WindowsSDK=ON ) vcpkg_install_cmake() diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL index 1b1cc5741a96f7..3c2b0b7ebe68d7 100644 --- a/ports/openblas/CONTROL +++ b/ports/openblas/CONTROL @@ -1,5 +1,5 @@ Source: openblas -Version: 0.3.7 +Version: 0.3.9-1 Homepage: https://github.com/xianyi/OpenBLAS Build-Depends: pthread (linux) Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/ports/openblas/github_2481.patch b/ports/openblas/github_2481.patch new file mode 100644 index 00000000000000..bedffc36cd8ee3 --- /dev/null +++ b/ports/openblas/github_2481.patch @@ -0,0 +1,23 @@ +From 21f6c4b5a972683f7228e5ad446bc940947c2d2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= + =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= +Date: Mon, 2 Mar 2020 17:22:28 +0100 +Subject: [PATCH] fixes #2480 + +--- + cmake/cc.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/cc.cmake b/cmake/cc.cmake +index 22217575c..d5551147c 100644 +--- a/cmake/cc.cmake ++++ b/cmake/cc.cmake +@@ -99,7 +99,7 @@ endif () + if (${CORE} STREQUAL "SKYLAKEX") + if (NOT DYNAMIC_ARCH) + if (NOT NO_AVX512) +- set (CCOMMON_OPT = "${CCOMMON_OPT} -march=skylake-avx512") ++ set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512") + endif () + endif () + endif () diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index 17112279ed7b80..2decb588380674 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -3,13 +3,14 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xianyi/OpenBLAS - REF 5f36f18148603facb6c3540e673610d6b24cbfbb # v0.3.7 - SHA512 c1abcfd6fbf6ae3efa28053523ffb3d72aefaa279594347bfd9910c40f25778421b8d1d2d4dc6c934c9def40642942bb74fe76e06c2d96b1898ea61204a95540 + REF v0.3.9 + SHA512 e34da25b3aaf959ec12826ac68c81e739e453d44f2dba28b15e57d7a827edc4d5f42988e9b6d98ac07999940be7b5876246cb3a980e590ae87f77f4c2f12f40a HEAD_REF develop PATCHES uwp.patch fix-space-path.patch fix-redefinition-function.patch + github_2481.patch ) find_program(GIT NAMES git git.cmd) diff --git a/ports/opencc/CONTROL b/ports/opencc/CONTROL new file mode 100644 index 00000000000000..ab49052f045bb0 --- /dev/null +++ b/ports/opencc/CONTROL @@ -0,0 +1,9 @@ +Source: opencc +Version: 2020-04-26 +Port-Version: 7 +Description: A project for conversion between Traditional and Simplified Chinese +Homepage: https://github.com/BYVoid/OpenCC +Supports: !(arm|arm64|uwp) + +Feature: tools +Description: Build OpenCC command-line tools diff --git a/ports/opencc/portfile.cmake b/ports/opencc/portfile.cmake new file mode 100644 index 00000000000000..c67b2d33fc0e9e --- /dev/null +++ b/ports/opencc/portfile.cmake @@ -0,0 +1,52 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO BYVoid/OpenCC + REF e8ec6d59f264a4a42e310148a9534a8cc0123928 + SHA512 e6b3f6d681223b299795c324a48e82609abd1f411d3cbd5f9d8607284ec04717fa9878953d037c25a931a0857f50a5c0e883e0d44ddbea18c50830ad49514c59 + HEAD_REF master +) + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY) +vcpkg_add_to_path(${PYTHON3_DIR}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_DOCUMENTATION=OFF + -DENABLE_GTEST=OFF +) + +vcpkg_install_cmake( + DISABLE_PARALLEL +) + +vcpkg_copy_pdbs() + +if(tools IN_LIST FEATURES) + foreach(opencc_tool opencc opencc_dict opencc_phrase_extract) + file(COPY + ${CURRENT_PACKAGES_DIR}/bin/${opencc_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX} + DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT} + ) + endforeach() + + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + foreach(opencc_tool opencc opencc_dict opencc_phrase_extract) + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/${opencc_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX} + ${CURRENT_PACKAGES_DIR}/debug/bin/${opencc_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX} + ) + endforeach() +endif() + +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) \ No newline at end of file diff --git a/ports/opencl/CONTROL b/ports/opencl/CONTROL index 9ddd88dd4f666c..41069be8225e56 100644 --- a/ports/opencl/CONTROL +++ b/ports/opencl/CONTROL @@ -1,5 +1,6 @@ Source: opencl -Version: 2.2-2 +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/portfile.cmake b/ports/opencl/portfile.cmake index 00683d1a7a8204..9fc56a9bef57fc 100644 --- a/ports/opencl/portfile.cmake +++ b/ports/opencl/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - if("wdk" IN_LIST FEATURES) if(NOT VCPKG_TARGET_IS_WINDOWS) message(FATAL_ERROR "Windows Driver Kit support is only available builds targeting Windows") @@ -71,24 +69,40 @@ vcpkg_configure_cmake( vcpkg_build_cmake(TARGET OpenCL) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + endif() + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + endif() else() if(VCPKG_TARGET_IS_WINDOWS) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + endif() + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() elseif(VCPKG_TARGET_IS_LINUX) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1.2" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1.2" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1.2" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + endif() + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.1.2" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + endif() elseif(VCPKG_TARGET_IS_OSX) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + endif() + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}OpenCL${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + endif() endif() endif() 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/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/0002-install-options.patch b/ports/opencv2/0002-install-options.patch new file mode 100644 index 00000000000000..206fb287554ea4 --- /dev/null +++ b/ports/opencv2/0002-install-options.patch @@ -0,0 +1,359 @@ +diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt +index b0e076f..3f7ade1 100644 +--- a/3rdparty/libtiff/CMakeLists.txt ++++ b/3rdparty/libtiff/CMakeLists.txt +@@ -102,7 +102,7 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)) + endif() + + add_library(${TIFF_LIBRARY} STATIC ${lib_srcs}) +-target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES}) ++target_link_libraries(${TIFF_LIBRARY} ZLIB::ZLIB) + + set_target_properties(${TIFF_LIBRARY} + PROPERTIES +diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt +index 9387616..54ecc1a 100644 +--- a/3rdparty/openexr/CMakeLists.txt ++++ b/3rdparty/openexr/CMakeLists.txt +@@ -55,7 +55,7 @@ if(MSVC AND CV_ICC) + endif() + + add_library(IlmImf STATIC ${lib_hdrs} ${lib_srcs}) +-target_link_libraries(IlmImf ${ZLIB_LIBRARIES}) ++target_link_libraries(IlmImf ZLIB::ZLIB) + + set_target_properties(IlmImf + PROPERTIES +diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt +index fd8ef32..fe571a2 100644 +--- a/3rdparty/tbb/CMakeLists.txt ++++ b/3rdparty/tbb/CMakeLists.txt +@@ -116,7 +116,7 @@ endif() + + if(NOT EXISTS "${tbb_tarball}") + message(STATUS "Downloading ${tbb_ver}_src.tgz") +- file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar) ++ 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 \"${tbb_url}\"\n FILENAME \"${tbb_tarball}\"\n SHA512 0\n )") + if(NOT __statvar EQUAL 0) + message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}") + endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 90e16c2..6601820 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -275,23 +275,10 @@ if (ANDROID) + endif() + + if(NOT DEFINED OPENCV_DOC_INSTALL_PATH) +- if(ANDROID OR WIN32) +- set(OPENCV_DOC_INSTALL_PATH doc) +- elseif(INSTALL_TO_MANGLED_PATHS) +- set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc) +- else() +- set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) +- endif() ++ set(OPENCV_DOC_INSTALL_PATH share/opencv/doc) + endif() + +-if(WIN32) +- if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH) +- set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/") +- else() +- message(STATUS "Can't detect runtime and/or arch") +- set(OpenCV_INSTALL_BINARIES_PREFIX "") +- endif() +-elseif(ANDROID) ++if(ANDROID) + set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/") + else() + set(OpenCV_INSTALL_BINARIES_PREFIX "") +@@ -322,29 +309,13 @@ if(ANDROID) + set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include) + set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) + else() +- set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib") +- set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}") +- if(WIN32) +- if(OpenCV_STATIC) +- set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") +- else() +- set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") +- endif() +- set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") +- set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) +- else() +- set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX}) +- set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}) +- set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples) +- endif() +- set(OPENCV_INCLUDE_INSTALL_PATH "include") +- +- math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}") +- if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX) +- set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv) +- else() +- set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV) +- endif() ++ set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib") ++ set(3P_LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}") ++ set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib") ++ set(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}") ++ set(OPENCV_SAMPLES_SRC_INSTALL_PATH "share/opencv/samples") ++ set(OPENCV_INCLUDE_INSTALL_PATH "include") ++ set(OPENCV_CONFIG_INSTALL_PATH "share/opencv") + endif() + + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}") +@@ -356,7 +327,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: +@@ -397,8 +368,6 @@ if(CMAKE_HOST_WIN32) + endif() + endif() + +-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client") +-mark_as_advanced(GIT_EXECUTABLE) + + if(GIT_EXECUTABLE) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*" +@@ -501,7 +470,6 @@ if(BUILD_DOCS) + endif(BUILD_DOCS) + + # --- Python Support --- +-include(cmake/OpenCVDetectPython.cmake) + + # --- Java Support --- + include(cmake/OpenCVDetectApacheAnt.cmake) +@@ -885,11 +853,7 @@ if(ANDROID) + endif() + + if(DEFINED WITH_FFMPEG OR HAVE_FFMPEG) +- if(WIN32) +- status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO) +- else() + status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO) +- endif() + status(" avcodec:" FFMPEG_libavcodec_FOUND THEN "YES (ver ${FFMPEG_libavcodec_VERSION})" ELSE NO) + status(" avformat:" FFMPEG_libavformat_FOUND THEN "YES (ver ${FFMPEG_libavformat_VERSION})" ELSE NO) + status(" avutil:" FFMPEG_libavutil_FOUND THEN "YES (ver ${FFMPEG_libavutil_VERSION})" ELSE NO) +diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake +index e61059a..ec6f34f 100644 +--- a/cmake/OpenCVCompilerOptions.cmake ++++ b/cmake/OpenCVCompilerOptions.cmake +@@ -269,7 +269,6 @@ if(MSVC) + set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /bigobj") + endif() + if(BUILD_WITH_DEBUG_INFO) +- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") + endif() + + if(ENABLE_SSE4_1 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:") +diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake +index 146043f..1202225 100644 +--- a/cmake/OpenCVFindLibsVideo.cmake ++++ b/cmake/OpenCVFindLibsVideo.cmake +@@ -185,12 +185,8 @@ endif(WITH_XIMEA) + # --- FFMPEG --- + ocv_clear_vars(HAVE_FFMPEG) + if(WITH_FFMPEG) +- if(WIN32 AND NOT ARM) +- include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake") ++ find_package(FFMPEG REQUIRED) + set(HAVE_FFMPEG TRUE) +- elseif(PKG_CONFIG_FOUND) +- ocv_check_modules(FFMPEG libavcodec libavformat libavutil libswscale) +- ocv_check_modules(FFMPEG_libavresample libavresample) + if(FFMPEG_libavresample_FOUND) + ocv_append_build_options(FFMPEG FFMPEG_libavresample) + endif() +@@ -211,9 +207,6 @@ if(WITH_FFMPEG) + ocv_append_build_options(HIGHGUI FFMPEG) + endif() + endif() +- else() +- message(STATUS "Can't find ffmpeg - 'pkg-config' utility is missing") +- endif() + endif(WITH_FFMPEG) + + # --- VideoInput/DirectShow --- +diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake +index dacfbb1..3760866 100644 +--- a/cmake/OpenCVGenConfig.cmake ++++ b/cmake/OpenCVGenConfig.cmake +@@ -101,7 +101,7 @@ endif() + configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY) + configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY) + +-if(UNIX) # ANDROID configuration is created here also ++if(1) # ANDROID configuration is created here also + #http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference + # For a command "find_package( [major[.minor]] [EXACT] [REQUIRED|QUIET])" + # cmake will look in the following dir on unix: +@@ -126,7 +126,7 @@ endif() + # -------------------------------------------------------------------------------------------- + # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages + # -------------------------------------------------------------------------------------------- +-if(WIN32) ++if(0) + set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/include\" \"\${OpenCV_CONFIG_PATH}/include/opencv\"") + set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"") + +diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake +index 6f9fb0b..56f8879 100644 +--- a/cmake/OpenCVModule.cmake ++++ b/cmake/OpenCVModule.cmake +@@ -86,10 +86,10 @@ macro(ocv_add_dependencies full_modname) + endforeach() + unset(__depsvar) + +- ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS) +- ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS) +- ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS) +- ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS) ++ #ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS) ++ #ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS) ++ #ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS) ++ #ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS) + + set(OPENCV_MODULE_${full_modname}_REQ_DEPS ${OPENCV_MODULE_${full_modname}_REQ_DEPS} + CACHE INTERNAL "Required dependencies of ${full_modname} module") +@@ -277,7 +277,7 @@ endfunction() + + # sort modules by dependencies + function(__ocv_sort_modules_by_deps __lst) +- ocv_list_sort(${__lst}) ++ #ocv_list_sort(${__lst}) + set(${__lst}_ORDERED ${${__lst}} CACHE INTERNAL "") + set(__result "") + foreach (m ${${__lst}}) +@@ -382,7 +382,7 @@ function(__ocv_resolve_dependencies) + endforeach() + endforeach() + +- ocv_list_sort(OPENCV_MODULES_BUILD) ++ #ocv_list_sort(OPENCV_MODULES_BUILD) + + foreach(m ${OPENCV_MODULES_BUILD}) + # message(STATUS "FULL deps of ${m}: ${deps_${m}}") +@@ -397,7 +397,7 @@ function(__ocv_resolve_dependencies) + # reorder dependencies + foreach(m ${OPENCV_MODULES_BUILD}) + __ocv_sort_modules_by_deps(OPENCV_MODULE_${m}_DEPS) +- ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT) ++ #ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT) + + set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module") + set(OPENCV_MODULE_${m}_DEPS_EXT ${OPENCV_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module") +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index e3177bd..f902b2b 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -5,8 +5,6 @@ if(ANDROID) + install(FILES ${HAAR_CASCADES} DESTINATION sdk/etc/haarcascades COMPONENT libs) + install(FILES ${LBP_CASCADES} DESTINATION sdk/etc/lbpcascades COMPONENT libs) + else() +- install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs) +- install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs) + endif() + + if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) +@@ -51,4 +49,4 @@ if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) + install(FILES ${DATAFILES_CASCADES} DESTINATION share/OpenCV/testdata/data/haarcascades COMPONENT tests) + endif() + endif() +-endif() +\ No newline at end of file ++endif() +diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt +index d9de52d..be604dc 100644 +--- a/modules/core/CMakeLists.txt ++++ b/modules/core/CMakeLists.txt +@@ -1,9 +1,9 @@ + set(the_description "The Core Functionality") + + if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA) +- ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES}) ++ ocv_add_module(core PRIVATE_REQUIRED ZLIB::ZLIB) + else() +- ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) ++ ocv_add_module(core PRIVATE_REQUIRED ZLIB::ZLIB ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) + endif() + + ocv_module_include_directories("${OpenCV_SOURCE_DIR}/modules/dynamicuda/include/" ${ZLIB_INCLUDE_DIR}) +diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt +index d59e95a..ce7f87b 100644 +--- a/modules/highgui/CMakeLists.txt ++++ b/modules/highgui/CMakeLists.txt +@@ -15,23 +15,23 @@ endif() + + if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR) + ocv_include_directories(${ZLIB_INCLUDE_DIR}) +- list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES}) ++ list(APPEND GRFMT_LIBS ZLIB::ZLIB) + endif() + + if(HAVE_JPEG) + ocv_include_directories(${JPEG_INCLUDE_DIR}) +- list(APPEND GRFMT_LIBS ${JPEG_LIBRARIES}) ++ list(APPEND GRFMT_LIBS JPEG::JPEG) + endif() + + if(HAVE_PNG) + add_definitions(${PNG_DEFINITIONS}) + ocv_include_directories(${PNG_INCLUDE_DIR}) +- list(APPEND GRFMT_LIBS ${PNG_LIBRARIES}) ++ list(APPEND GRFMT_LIBS PNG::PNG) + endif() + + if(HAVE_TIFF) + ocv_include_directories(${TIFF_INCLUDE_DIR}) +- list(APPEND GRFMT_LIBS ${TIFF_LIBRARIES}) ++ list(APPEND GRFMT_LIBS TIFF::TIFF) + endif() + + if(HAVE_JASPER) +@@ -296,38 +296,5 @@ endif() + ocv_add_precompiled_headers(${the_module}) + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations -Wno-clobbered) + +-if(WIN32 AND WITH_FFMPEG) +- #copy ffmpeg dll to the output folder +- if(MSVC64 OR MINGW64) +- set(FFMPEG_SUFFIX _64) +- endif() +- +- set(ffmpeg_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll") +- set(ffmpeg_bare_name_ver "opencv_ffmpeg${OPENCV_DLLVERSION}${FFMPEG_SUFFIX}.dll") +- set(ffmpeg_path "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/${ffmpeg_bare_name}") +- +- #if(MSVC AND CMAKE_VERSION VERSION_GREATER "2.8.2") +- # add_custom_command(TARGET ${the_module} POST_BUILD +- # COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/$/${ffmpeg_bare_name_ver}" +- # COMMENT "Copying ${ffmpeg_path} to the output directory") +- #else +- if(MSVC_IDE) +- add_custom_command(TARGET ${the_module} POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Release/${ffmpeg_bare_name_ver}" +- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Debug/${ffmpeg_bare_name_ver}" +- COMMENT "Copying ${ffmpeg_path} to the output directory") +- elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual")) +- add_custom_command(TARGET ${the_module} POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${ffmpeg_bare_name_ver}" +- COMMENT "Copying ${ffmpeg_path} to the output directory") +- else() +- add_custom_command(TARGET ${the_module} POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name_ver}" +- COMMENT "Copying ${ffmpeg_path} to the output directory") +- endif() +- +- install(FILES "${ffmpeg_path}" DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs RENAME "${ffmpeg_bare_name_ver}") +-endif() +- + ocv_add_accuracy_tests() + ocv_add_perf_tests() diff --git a/ports/opencv2/0003-force-package-requirements.patch b/ports/opencv2/0003-force-package-requirements.patch new file mode 100644 index 00000000000000..aea8936516aed2 --- /dev/null +++ b/ports/opencv2/0003-force-package-requirements.patch @@ -0,0 +1,58 @@ +diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake +index 43c3b16..9b43066 100644 +--- a/cmake/OpenCVFindLibsGrfmt.cmake ++++ b/cmake/OpenCVFindLibsGrfmt.cmake +@@ -6,7 +6,7 @@ + if(BUILD_ZLIB) + ocv_clear_vars(ZLIB_FOUND) + else() +- include(FindZLIB) ++ find_package(ZLIB REQUIRED) + if(ZLIB_FOUND AND ANDROID) + if(ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so" OR + ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib64/libz.so") +@@ -32,7 +32,7 @@ if(WITH_TIFF) + if(BUILD_TIFF) + ocv_clear_vars(TIFF_FOUND) + else() +- include(FindTIFF) ++ find_package(TIFF REQUIRED) + if(TIFF_FOUND) + ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION) + endif() +@@ -74,7 +74,7 @@ if(WITH_JPEG) + if(BUILD_JPEG) + ocv_clear_vars(JPEG_FOUND) + else() +- include(FindJPEG) ++ find_package(JPEG REQUIRED) + endif() + + if(NOT JPEG_FOUND) +@@ -95,7 +95,7 @@ if(WITH_JASPER) + if(BUILD_JASPER) + ocv_clear_vars(JASPER_FOUND) + else() +- include(FindJasper) ++ find_package(Jasper REQUIRED) + endif() + + if(NOT JASPER_FOUND) +@@ -119,7 +119,7 @@ if(WITH_PNG) + if(BUILD_PNG) + ocv_clear_vars(PNG_FOUND) + else() +- include(FindPNG) ++ find_package(PNG REQUIRED) + if(PNG_FOUND) + include(CheckIncludeFile) + check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H) +@@ -151,7 +151,7 @@ if(WITH_OPENEXR) + if(BUILD_OPENEXR) + ocv_clear_vars(OPENEXR_FOUND) + else() +- include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake") ++ find_package(OpenEXR REQUIRED) + endif() + + if(NOT OPENEXR_FOUND) diff --git a/ports/opencv2/0004-add-ffmpeg-missing-defines.patch b/ports/opencv2/0004-add-ffmpeg-missing-defines.patch new file mode 100644 index 00000000000000..638581d01c66f5 --- /dev/null +++ b/ports/opencv2/0004-add-ffmpeg-missing-defines.patch @@ -0,0 +1,12 @@ +--- a/modules/highgui/src/cap_ffmpeg_impl.hpp ++++ b/modules/highgui/src/cap_ffmpeg_impl.hpp +@@ -42,6 +42,9 @@ + + #define HAVE_FFMPEG_SWSCALE + #define HAVE_GENTOO_FFMPEG ++#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) ++#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER ++#define AVFMT_RAWPICTURE 0x0020 + + #include "cap_ffmpeg_api.hpp" + #include diff --git a/ports/opencv2/0005-fix-cuda.patch b/ports/opencv2/0005-fix-cuda.patch new file mode 100644 index 00000000000000..c5e21401a96c8e --- /dev/null +++ b/ports/opencv2/0005-fix-cuda.patch @@ -0,0 +1,138 @@ +--- a/cmake/OpenCVDetectCUDA.cmake ++++ b/cmake/OpenCVDetectCUDA.cmake +@@ -51,7 +51,7 @@ if(CUDA_FOUND) + + message(STATUS "CUDA detected: " ${CUDA_VERSION}) + +- set(_generations "Fermi" "Kepler") ++ set(_generations "Kepler" "Maxwell") + if(NOT CMAKE_CROSSCOMPILING) + list(APPEND _generations "Auto") + endif() +@@ -70,14 +70,10 @@ if(CUDA_FOUND) + endif() + + set(__cuda_arch_ptx "") +- if(CUDA_GENERATION STREQUAL "Fermi") +- set(__cuda_arch_bin "2.0 2.1(2.0)") +- elseif(CUDA_GENERATION STREQUAL "Kepler") +- if(${CUDA_VERSION} VERSION_LESS "5.0") +- set(__cuda_arch_bin "3.0") +- else() +- set(__cuda_arch_bin "3.0 3.5") +- endif() ++ if(CUDA_GENERATION STREQUAL "Kepler") ++ set(__cuda_arch_bin "3.0 3.5 3.7") ++ elseif(CUDA_GENERATION STREQUAL "Maxwell") ++ set(__cuda_arch_bin "5.0 5.2") + elseif(CUDA_GENERATION STREQUAL "Auto") + execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" +@@ -87,7 +83,6 @@ if(CUDA_FOUND) + message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.") + else() + set(__cuda_arch_bin "${_nvcc_out}") +- string(REPLACE "2.1" "2.1(2.0)" __cuda_arch_bin "${__cuda_arch_bin}") + endif() + endif() + +@@ -102,11 +97,11 @@ if(CUDA_FOUND) + endif() + else() + if(${CUDA_VERSION} VERSION_LESS "5.0") +- set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0") ++ set(__cuda_arch_bin "3.0") + elseif(${CUDA_VERSION} VERSION_GREATER "6.5") +- set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5") ++ set(__cuda_arch_bin "3.0 3.5") + else() +- set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5") ++ set(__cuda_arch_bin "3.0 3.5") + endif() + set(__cuda_arch_ptx "3.0") + endif() +diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in +index fe85571..0f9d2f5 100644 +--- a/cmake/templates/OpenCVConfig.cmake.in ++++ b/cmake/templates/OpenCVConfig.cmake.in +@@ -256,7 +256,7 @@ if(OpenCV_CUDA_VERSION) + + set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES}) + +- if(${CUDA_VERSION} VERSION_LESS "5.5") ++ if(CUDA_VERSION VERSION_LESS "5.5") + list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY}) + else() + find_cuda_helper_libs(nppc) +@@ -281,14 +281,16 @@ if(OpenCV_CUDA_VERSION) + list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES}) + endif() + ++ set(OpenCV_CUDA_LIBS_RELPATH "") + foreach(l ${OpenCV_CUDA_LIBS_ABSPATH}) +- get_filename_component(_tmp "${l}" NAME_WE) +- string(REGEX REPLACE "^lib" "" _tmp "${_tmp}") +- if(NOT TARGET "opencv_dep_${_tmp}") # protect against repeated inclusions +- add_library("opencv_dep_${_tmp}" UNKNOWN IMPORTED) +- set_target_properties("opencv_dep_${_tmp}" PROPERTIES IMPORTED_LOCATION "${l}") ++ get_filename_component(_tmp ${l} PATH) ++ if(NOT ${_tmp} MATCHES "-Wl.*") ++ list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp}) + endif() + endforeach() ++ ++ list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH) ++ link_directories(${OpenCV_CUDA_LIBS_RELPATH}) + endif() + + # ============================================================== +diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake +index 30b5093..50dcdc9 100644 +--- a/cmake/OpenCVDetectCUDA.cmake ++++ b/cmake/OpenCVDetectCUDA.cmake +@@ -229,18 +229,40 @@ else() + endif() + + if(HAVE_CUDA) ++ set(CUDA_LIBS_PATH "") ++ foreach(p ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) ++ get_filename_component(_tmp ${p} PATH) ++ list(APPEND CUDA_LIBS_PATH ${_tmp}) ++ endforeach() ++ ++ if(HAVE_CUBLAS) ++ foreach(p ${CUDA_cublas_LIBRARY}) ++ get_filename_component(_tmp ${p} PATH) ++ list(APPEND CUDA_LIBS_PATH ${_tmp}) ++ endforeach() ++ endif() ++ ++ if(HAVE_CUFFT) ++ foreach(p ${CUDA_cufft_LIBRARY}) ++ get_filename_component(_tmp ${p} PATH) ++ list(APPEND CUDA_LIBS_PATH ${_tmp}) ++ endforeach() ++ endif() ++ ++ list(REMOVE_DUPLICATES CUDA_LIBS_PATH) ++ link_directories(${CUDA_LIBS_PATH}) ++ + set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES}) +- ocv_create_imported_targets(CUDA_LIBRARIES ${CUDA_LIBRARIES}) ++ ocv_convert_to_lib_name(CUDA_LIBRARIES ${CUDA_LIBRARIES}) + set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY}) +- ocv_create_imported_targets(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY}) +- ++ ocv_convert_to_lib_name(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY}) + if(HAVE_CUBLAS) + set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY}) +- ocv_create_imported_targets(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY}) ++ ocv_convert_to_lib_name(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY}) + endif() + + if(HAVE_CUFFT) + set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY}) +- ocv_create_imported_targets(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY}) ++ ocv_convert_to_lib_name(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY}) + endif() + endif() diff --git a/ports/opencv2/CONTROL b/ports/opencv2/CONTROL new file mode 100644 index 00000000000000..d2cff4b6a612b5 --- /dev/null +++ b/ports/opencv2/CONTROL @@ -0,0 +1,53 @@ +Source: opencv2 +Version: 2.4.13.7 +Port-Version: 2 +Build-Depends: zlib +Description: computer vision library, version 2 +Default-Features: eigen, jpeg, opengl, png, tiff + +Feature: cuda +Build-Depends: cuda +Description: CUDA support for opencv + +Feature: eigen +Build-Depends: eigen3 +Description: Eigen support for opencv + +Feature: ffmpeg +Build-Depends: ffmpeg +Description: ffmpeg support for opencv + +Feature: jasper +Build-Depends: jasper +Description: JPEG 2000 support for opencv + +Feature: jpeg +Build-Depends: libjpeg-turbo +Description: JPEG support for opencv + +Feature: openexr +Build-Depends: openexr +Description: OpenEXR support for opencv + +Feature: opengl +Build-Depends: opengl +Description: opengl support for opencv + +Feature: png +Build-Depends: libpng +Description: PNG support for opencv + +Feature: qt +Build-Depends: qt5-base[core] +Description: Qt GUI support for opencv + +Feature: tiff +Build-Depends: tiff +Description: TIFF support for opencv + +Feature: vtk +Build-Depends: vtk +Description: vtk support for opencv + +Feature: world +Description: Compile to a single package support for opencv 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 new file mode 100644 index 00000000000000..e901c77a9eb874 --- /dev/null +++ b/ports/opencv2/portfile.cmake @@ -0,0 +1,139 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3") + message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3") +endif() + +if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4") + message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4") +endif() + +if (VCPKG_TARGET_IS_UWP) + # - opengl feature is broken on UWP + # - jasper and openexr are not available on UWP due to missing dependencies + # - opencv2 code itself fails even if previous conditions are avoided + message(FATAL_ERROR "${PORT} doesn't support UWP") +endif() + +set(OPENCV_VERSION "2.4.13.7") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO opencv/opencv + REF ${OPENCV_VERSION} + SHA512 de7d24ac7ed78ac14673011cbecc477cae688b74222a972e553c95a557b5cb8e5913f97db525421d6a72af30998ca300112fa0b285daed65f65832eb2cf7241a + HEAD_REF master + PATCHES + 0002-install-options.patch + 0003-force-package-requirements.patch + 0004-add-ffmpeg-missing-defines.patch + 0005-fix-cuda.patch +) + +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 + "eigen" WITH_EIGEN + "ffmpeg" WITH_FFMPEG + "jasper" WITH_JASPER + "jpeg" WITH_JPEG + "openexr" WITH_OPENEXR + "opengl" WITH_OPENGL + "png" WITH_PNG + "qt" WITH_QT + "tiff" WITH_TIFF + "world" BUILD_opencv_world +) + +set(WITH_VTK OFF) +if("vtk" IN_LIST FEATURES) + set(WITH_VTK ON) +endif() + +set(WITH_MSMF ON) +if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + set(WITH_MSMF OFF) +endif() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + if (WITH_VTK) + message(WARNING "VTK is currently unsupported in this build configuration, turning it off") + set(WITH_VTK OFF) + endif() +endif() + +if("ffmpeg" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_UWP) + set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}") + set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}") + endif() +endif() + +vcpkg_configure_cmake( + PREFER_NINJA + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ###### ocv_options + -DCMAKE_DEBUG_POSTFIX=d + # Do not build docs/examples + -DBUILD_DOCS=OFF + -DBUILD_EXAMPLES=OFF + ###### Disable build 3rd party libs + -DBUILD_JASPER=OFF + -DBUILD_JPEG=OFF + -DBUILD_OPENEXR=OFF + -DBUILD_PNG=OFF + -DBUILD_TIFF=OFF + -DBUILD_TBB=OFF + -DBUILD_ZLIB=OFF + ###### OpenCV Build components + -DBUILD_opencv_apps=OFF + -DBUILD_PACKAGE=OFF + -DBUILD_PERF_TESTS=OFF + -DBUILD_TESTS=OFF + -DBUILD_WITH_DEBUG_INFO=ON + # CMAKE + -DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON + ###### customized properties + ## Options from vcpkg_check_features() + ${FEATURE_OPTIONS} + -DWITH_1394=OFF + -DWITH_IPP=OFF + -DWITH_LAPACK=OFF + -DWITH_MSMF=${WITH_MSMF} + -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() +vcpkg_fixup_cmake_targets(CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv") +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(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}") + + 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(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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 a59ea896bd6972..623eb99218e3af 100644 --- a/ports/opencv3/CONTROL +++ b/ports/opencv3/CONTROL @@ -1,5 +1,5 @@ Source: opencv3 -Version: 3.4.7-2 +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 @@ -63,7 +67,7 @@ Build-Depends: libpng Description: PNG support for opencv Feature: qt -Build-Depends: qt5 +Build-Depends: qt5-base[core] Description: Qt GUI support for opencv Feature: sfm @@ -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 8f2f633d330fb3..f190376c28e96e 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -1,16 +1,18 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv2") + message(FATAL_ERROR "OpenCV 2 is installed, please uninstall and try again:\n vcpkg remove opencv2") +endif() + 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 @@ -19,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 @@ -44,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) @@ -90,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" @@ -140,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") @@ -151,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") @@ -168,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") @@ -234,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 @@ -253,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 @@ -260,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 @@ -280,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 @@ -322,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) @@ -332,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) @@ -341,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 fc09aaecc7b144..fa6388e66f49d8 100644 --- a/ports/opencv4/CONTROL +++ b/ports/opencv4/CONTROL @@ -1,5 +1,5 @@ Source: opencv4 -Version: 4.1.1-3 +Version: 4.3.0 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -13,11 +13,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[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, opencv4[core], opencv4[dnn] +Description: Halide support for opencv + Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -66,7 +70,7 @@ Build-Depends: libpng Description: PNG support for opencv Feature: qt -Build-Depends: qt5 +Build-Depends: qt5-base[core] Description: Qt GUI support for opencv Feature: sfm @@ -89,9 +93,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 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 fdd75dcf10e7e3..522623c45f0945 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -1,16 +1,18 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv2") + message(FATAL_ERROR "OpenCV 2 is installed, please uninstall and try again:\n vcpkg remove opencv2") +endif() + 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 @@ -20,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") @@ -29,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 @@ -39,7 +45,6 @@ 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 @@ -48,13 +53,31 @@ 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", "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) @@ -102,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") @@ -173,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") @@ -184,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") @@ -201,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") @@ -258,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 @@ -314,17 +346,24 @@ vcpkg_configure_cmake( ## Options from vcpkg_check_features() ${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} ) @@ -353,6 +392,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) @@ -363,15 +404,25 @@ 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("openmp" IN_LIST FEATURES) + 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) @@ -379,9 +430,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/opengl-registry/CONTROL b/ports/opengl-registry/CONTROL index 940158beda9d18..fece53105d2469 100644 --- a/ports/opengl-registry/CONTROL +++ b/ports/opengl-registry/CONTROL @@ -1,4 +1,5 @@ Source: opengl-registry -Version: 2020-02-03 +Version: 2020-03-25 +Homepage: https://github.com/KhronosGroup/OpenGL-Registry Build-Depends: egl-registry Description: the API and Extension registries for the OpenGL family APIs diff --git a/ports/opengl-registry/portfile.cmake b/ports/opengl-registry/portfile.cmake index a9e3be246ec78d..13f9386d759016 100644 --- a/ports/opengl-registry/portfile.cmake +++ b/ports/opengl-registry/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/OpenGL-Registry - REF 2223f5bebde4aa6b170fb32cdaaf580703fddb67 - SHA512 4e9b570f242942bd45a6601a6b0fcf1dc265c6ba03acaf782a639e7399842dd7350c2d4876236df80a070b2bd9ce7cee88cf2d85f2c50cfba7878d1f9379bbe9 + REF 4594c03239fb76580bc5d5a13acb2a8f563f0158 + SHA512 c005a4eb7e5c17002647e7762ae1a7ecba0d0780a62d66f1afd3b7f45c1ca49bd5a069ab0fabb94de3ec971604586457932941fa8eb924cf5ac3a959d8f5f146 HEAD_REF master ) @@ -16,12 +16,12 @@ file(COPY ${SOURCE_PATH}/xml/gl.xml ${SOURCE_PATH}/xml/glx.xml ${SOURCE_PATH}/xml/wgl.xml - DESTINATION ${CURRENT_PACKAGES_DIR}/share/opengl-registry + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) # Using the Makefile because it is the smallest file with a complete copy of the license text file( INSTALL ${SOURCE_PATH}/xml/Makefile - DESTINATION ${CURRENT_PACKAGES_DIR}/share/opengl-registry + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright ) diff --git a/ports/opengl/CONTROL b/ports/opengl/CONTROL index 365b908cfbd1e5..74eff9302d1946 100644 --- a/ports/opengl/CONTROL +++ b/ports/opengl/CONTROL @@ -1,3 +1,3 @@ Source: opengl -Version: 0.0-5 +Version: 0.0-7 Description: Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. diff --git a/ports/opengl/portfile.cmake b/ports/opengl/portfile.cmake index 80df4ae74623db..6d27810cbafda9 100644 --- a/ports/opengl/portfile.cmake +++ b/ports/opengl/portfile.cmake @@ -1,17 +1,14 @@ -include(vcpkg_common_functions) - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) vcpkg_get_windows_sdk(WINDOWS_SDK) if (WINDOWS_SDK MATCHES "10.") - set(LIBGLFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") - set(LIBGLUFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\GlU32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") + set(LIBGLFILEPATH "$ENV{WindowsSdkDir}Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") + set(LIBGLUFILEPATH "$ENV{WindowsSdkDir}Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\GlU32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\${WINDOWS_SDK}\\um") elseif(WINDOWS_SDK MATCHES "8.") - set(LIBGLFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") - set(LIBGLUFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\GlU32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Include\\um") + set(LIBGLFILEPATH "$ENV{WindowsSdkDir}Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") + set(LIBGLUFILEPATH "$ENV{WindowsSdkDir}Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\GlU32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\um") else() message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") endif() @@ -26,20 +23,32 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include/gl - ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/debug/lib ${CURRENT_PACKAGES_DIR}/share/opengl ) + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/lib + ) + endif() + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/debug/lib + ) + endif() file(COPY "${HEADERSPATH}\\gl\\GL.h" "${HEADERSPATH}\\gl\\GLU.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/gl ) - file(COPY ${LIBGLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${LIBGLUFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${LIBGLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(COPY ${LIBGLUFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(COPY ${LIBGLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${LIBGLUFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + endif() + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(COPY ${LIBGLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY ${LIBGLUFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + endif() if (WINDOWS_SDK MATCHES "10.") file(WRITE ${CURRENT_PACKAGES_DIR}/share/opengl/copyright "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license") diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index 728f22a6ba5fe1..1a7e6feacd836c 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -1,8 +1,9 @@ Source: openimageio -Version: 2.1.9.0 +Version: 2.1.16.0 +Port-Version: 2 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 +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 Feature: libraw Build-Depends: libraw diff --git a/ports/openimageio/fix-config-cmake.patch b/ports/openimageio/fix-config-cmake.patch index f61afccbd8ba6b..e943d1c1eb19bb 100644 --- a/ports/openimageio/fix-config-cmake.patch +++ b/ports/openimageio/fix-config-cmake.patch @@ -1,12 +1,12 @@ diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in -index c6e1a13..3d784f3 100644 +index c578a1b..298362a 100644 --- a/src/cmake/Config.cmake.in +++ b/src/cmake/Config.cmake.in -@@ -6,5 +6,5 @@ include(CMakeFindDependencyMacro) - # e.g. if switching to Boost::Boost instead of using ${Boost_LIBRARY_DIRS} the add: - # find_dependency(Boost @Boost_VERSION@) +@@ -14,6 +14,6 @@ set (@PROJECT_NAME@_PLUGIN_SEARCH_PATH "@PLUGIN_SEARCH_PATH_NATIVE@") + #...logic to determine installedPrefix from the own location... + #set (@PROJECT_NAME@_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@") --include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") +-include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/OpenImageIOTargets.cmake") - check_required_components("@PROJECT_NAME@") -\ No newline at end of file + + check_required_components ("@PROJECT_NAME@") diff --git a/ports/openimageio/fix-dependfmt.patch b/ports/openimageio/fix-dependfmt.patch new file mode 100644 index 00000000000000..f0791f85ed1751 --- /dev/null +++ b/ports/openimageio/fix-dependfmt.patch @@ -0,0 +1,13 @@ +diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +index 4f1dfaf..1a17d1e 100644 +--- a/src/cmake/externalpackages.cmake ++++ b/src/cmake/externalpackages.cmake +@@ -385,5 +385,7 @@ macro (find_or_download_fmt) + checked_find_package (fmt REQUIRED) + endmacro() + +-find_or_download_fmt() ++find_package(fmt CONFIG REQUIRED) ++get_property(FMT_INCLUDES TARGET fmt::fmt PROPERTY INTERFACE_INCLUDE_DIRECTORIES) ++checked_find_package (fmt CONFIG REQUIRED) + include_directories (${FMT_INCLUDES}) diff --git a/ports/openimageio/fix_static_build.patch b/ports/openimageio/fix_static_build.patch index 825026dc8bf604..a5ebb467a5d521 100644 --- a/ports/openimageio/fix_static_build.patch +++ b/ports/openimageio/fix_static_build.patch @@ -1,12 +1,12 @@ diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake -index 4f4f31c..a18895e 100644 +index 1468be3..ed4167a 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake -@@ -451,7 +451,7 @@ set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when bu +@@ -482,7 +482,7 @@ set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when bu # option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON) if (NOT BUILD_SHARED_LIBS) -- add_definitions (-D${PROJECT_NAME}_STATIC_DEFINE=1) +- add_definitions (-D${PROJ_NAME}_STATIC_DEFINE=1) + add_definitions (-DOIIO_STATIC_DEFINE=1) endif () diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 7e6a6aae30fd61..f549457afbb5c6 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -1,14 +1,15 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OpenImageIO/oiio - REF fdd982a9922ff508b8b22e5d024356b582572f46 #2.1.9.0 - SHA512 1d076cb035b1b2cb603343465ed810ca47223211870d58f48c177d40d71a9cf82e53548b0c70127daf5dbd06f1b24772919e49e55110d914a542bcb62b99f6e8 + REF e028a5264bd229e128b37a4362f7eb9c73ea82cc #2.1.16.0 + SHA512 be5741e139c3c1d2fe62d6706833e9b158b6b00e1a57d141626f28cd3653f63e587b76de676b6b45d1a2330a0e71ebb2f1d00c108b68509cc418b6026424cfda HEAD_REF master PATCHES fix-dependency.patch fix_static_build.patch fix-tools-path.patch fix-config-cmake.patch + fix-dependfmt.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") @@ -65,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) @@ -77,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/openmesh/CONTROL b/ports/openmesh/CONTROL index d8a61f1f6d79a5..08bb7199822ecc 100644 --- a/ports/openmesh/CONTROL +++ b/ports/openmesh/CONTROL @@ -1,3 +1,3 @@ Source: openmesh -Version: 8.0 +Version: 8.1 Description: A generic and efficient polygon mesh data structure diff --git a/ports/openmesh/portfile.cmake b/ports/openmesh/portfile.cmake index 04e624a033b2b6..7ff6cf13a31841 100644 --- a/ports/openmesh/portfile.cmake +++ b/ports/openmesh/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - -set(VERSION 8.0) +set(VERSION 8.1) # Note: upstream GitLab instance at https://graphics.rwth-aachen.de:9000 often goes down vcpkg_download_distfile(ARCHIVE URLS "https://www.openmesh.org/media/Releases/${VERSION}/OpenMesh-${VERSION}.tar.gz" FILENAME "OpenMesh-${VERSION}.tar.gz" - SHA512 6c9cb323d83d48daca7ddefe51df67f611befd657655d8013c2c620ad53e0b8521e6b8e25ebf3f5321f94182252ae0c75795875ff7ac11585e4ffa79e16f8008 + SHA512 c146e6b21d709a31772621a6a913def93a51460c4abb950c2eb64eea4528c7efd4c86166ba56ae0bc8090cc5878dd9328b570e094e61c1b64d6d298de05aca61 ) vcpkg_extract_source_archive_ex( @@ -15,21 +13,38 @@ vcpkg_extract_source_archive_ex( REF "${VERSION}" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(OPENMESH_BUILD_SHARED ON) +else() + set(OPENMESH_BUILD_SHARED OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja - OPTIONS -DBUILD_APPS=OFF - # [TODO]: add apps as feature, requires qt5 and freeglut - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 + PREFER_NINJA + OPTIONS + -DBUILD_APPS=OFF + -DOPENMESH_BUILD_SHARED=${OPENMESH_BUILD_SHARED} + # [TODO]: add apps as feature, requires qt5 and freeglut ) vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/OpenMesh/cmake TARGET_PATH share/OpenMesh/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/OpenMesh/Tools/VDPM/xpm) +# Only move dynamic libraries to bin on Windows +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/OpenMeshCore.dll ${CURRENT_PACKAGES_DIR}/bin/OpenMeshCore.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/OpenMeshTools.dll ${CURRENT_PACKAGES_DIR}/bin/OpenMeshTools.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/OpenMeshCored.dll ${CURRENT_PACKAGES_DIR}/debug/bin/OpenMeshCored.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/OpenMeshToolsd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/OpenMeshToolsd.dll) +endif() +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}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmesh RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openmesh/usage b/ports/openmesh/usage new file mode 100644 index 00000000000000..1bfc821f505db2 --- /dev/null +++ b/ports/openmesh/usage @@ -0,0 +1,5 @@ +The package openmesh provides CMake targets: + + find_package(openmesh REQUIRED) + target_include_directories(main PRIVATE ${OPENMESH_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${OPENMESH_LIBRARIES}) diff --git a/ports/openmesh/vcpkg-cmake-wrapper.cmake b/ports/openmesh/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..ee59349e2e5209 --- /dev/null +++ b/ports/openmesh/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,18 @@ +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(OPENMESHCORE_INCLUDE_DIR EigenVectorT.hh PATH_SUFFIXES OpenMesh/Core/Geometry) +get_filename_component(OPENMESHCORE_INCLUDE_DIR ${OPENMESHCORE_INCLUDE_DIR} DIRECTORY) +get_filename_component(OPENMESHCORE_INCLUDE_DIR ${OPENMESHCORE_INCLUDE_DIR} DIRECTORY) +get_filename_component(OPENMESHCORE_INCLUDE_DIR ${OPENMESHCORE_INCLUDE_DIR} DIRECTORY) + +find_library(OPENMESHCORE_LIBRARY_DEBUG NAMES OpenMeshCored libOpenMeshCored NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(OPENMESHCORE_LIBRARY_RELEASE NAMES OpenMeshCore libOpenMeshCore NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) +find_library(OPENMESHTOOLS_LIBRARY_DEBUG NAMES OpenMeshToolsd libOpenMeshToolsd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(OPENMESHTOOLS_LIBRARY_RELEASE NAMES OpenMeshTools libOpenMeshTools NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(OPENMESHCORE) +select_library_configurations(OPENMESHTOOLS) + +set(OPENMESH_INCLUDE_DIRS ${OPENMESHCORE_INCLUDE_DIR}) +set(OPENMESH_LIBRARIES ${OPENMESHCORE_LIBRARY} ${OPENMESHTOOLS_LIBRARY}) \ No newline at end of file diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL index 86af5ffd5c5d85..4da1df53ed4e66 100644 --- a/ports/openmpi/CONTROL +++ b/ports/openmpi/CONTROL @@ -1,5 +1,5 @@ Source: openmpi -Version: 4.0.1 +Version: 4.0.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) \ No newline at end of file +Supports: !(windows|uwp) diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake index 9f69f9f9bfe621..6dbb01127c78ae 100644 --- a/ports/openmpi/portfile.cmake +++ b/ports/openmpi/portfile.cmake @@ -1,100 +1,37 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "This port is only for openmpi on Unix-like systems") -endif() +vcpkg_fail_port_install(ON_TARGET "Windows" "UWP") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -set(OpenMPI_FULL_VERSION "4.0.1") +set(OpenMPI_FULL_VERSION "4.0.3") set(OpenMPI_SHORT_VERSION "4.0") vcpkg_download_distfile(ARCHIVE URLS "https://download.open-mpi.org/release/open-mpi/v${OpenMPI_SHORT_VERSION}/openmpi-${OpenMPI_FULL_VERSION}.tar.gz" FILENAME "openmpi-${OpenMPI_FULL_VERSION}.tar.gz" - SHA512 760716974cb6b25ad820184622e1ee7926bc6fda87db6b574f76792bc1ca99522e52195866c14b7cb2df5a4981efdaf9f71d2c5533cc0e8e45c2c4b3b74cbacc + SHA512 23a9dfb7f4a63589b82f4e073a825550d3bc7e6b34770898325323ef4a28ed90b47576acaae6be427eb2007b37a88e18c1ea44d929b8ca083fe576ef1111fef6 ) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - list(APPEND BUILD_TYPES "release") -endif() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - list(APPEND BUILD_TYPES "debug") -endif() - -set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/openmpi-${OpenMPI_FULL_VERSION}) -set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/openmpi-${OpenMPI_FULL_VERSION}) -set(OUT_PATH_DEBUG ${SOURCE_PATH_RELEASE}/../../make-build-${TARGET_TRIPLET}-debug) -set(OUT_PATH_RELEASE ${SOURCE_PATH_RELEASE}/../../make-build-${TARGET_TRIPLET}-release) -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/) -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/) -file(MAKE_DIRECTORY ${OUT_PATH_DEBUG}) -file(MAKE_DIRECTORY ${OUT_PATH_RELEASE}) - -foreach(BUILD_TYPE IN LISTS BUILD_TYPES) - vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}) - #vcpkg_apply_patches(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}/openmpi-${OpenMPI_FULL_VERSION} PATCHES patch.file) -endforeach() +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_PATH ${PERL} DIRECTORY) vcpkg_add_to_path(${PERL_PATH}) -set(BASH bash) +vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + --with-hwloc=internal + --with-libevent=internal + OPTIONS_DEBUG + --enable-debug +) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH_DEBUG}/configure --prefix=${OUT_PATH_DEBUG} --enable-debug" - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - LOGNAME "config-${TARGET_TRIPLET}-dbg" - ) - message(STATUS "Building ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" - NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - LOGNAME "make-build-${TARGET_TRIPLET}-dbg" - ) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "make install" - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - LOGNAME "make-install-${TARGET_TRIPLET}-dbg" - ) - file(COPY ${OUT_PATH_DEBUG}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg done") -endif() +vcpkg_install_make() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH_RELEASE}/configure --prefix=${OUT_PATH_RELEASE}" - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - LOGNAME "config-${TARGET_TRIPLET}-rel" - ) - message(STATUS "Building ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" - NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - LOGNAME "make-build-${TARGET_TRIPLET}-rel" - ) - message(STATUS "Installing ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "make install" - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - LOGNAME "make-install-${TARGET_TRIPLET}-rel" - ) - file(COPY ${OUT_PATH_RELEASE}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) - file(COPY ${OUT_PATH_RELEASE}/include DESTINATION ${CURRENT_PACKAGES_DIR}) - file(COPY ${OUT_PATH_RELEASE}/share DESTINATION ${CURRENT_PACKAGES_DIR}) - file(COPY ${OUT_PATH_RELEASE}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) - message(STATUS "Installing ${TARGET_TRIPLET}-rel done") -endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(INSTALL ${SOURCE_PATH_DEBUG}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmpi RENAME copyright) -else() - file(INSTALL ${SOURCE_PATH_RELEASE}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmpi RENAME copyright) -endif() +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 98020c8cf357ea..c7d7cc32ab8c17 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -5,9 +5,7 @@ if(NOT SOURCE_PATH) message(FATAL_ERROR "Requires SOURCE_PATH") endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Android") - set(PLATFORM android) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") set(PLATFORM linux-x86_64) else() @@ -17,6 +15,12 @@ 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() @@ -69,24 +73,24 @@ endif() get_filename_component(MSYS_BIN_DIR "${MAKE}" DIRECTORY) - -file(READ "${BUILDDIR}/Configure" _contents) -string(REPLACE "-mandroid" "" _contents "${_contents}") -file(WRITE "${BUILDDIR}/Configure" "${_contents}") - if(BUILD_SHARED_LIBS) set(SHARED shared) - file(STRINGS "${BUILDDIR}/crypto/opensslv.h" SHLIB_VERSION + file(STRINGS "${BUILDDIR}/include/openssl/opensslv.h" SHLIB_VERSION 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") 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) @@ -96,6 +100,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) @@ -125,6 +137,7 @@ add_custom_command( no-cast no-seed no-md2 + no-tests ${PLATFORM} "--prefix=${CMAKE_INSTALL_PREFIX}" "--openssldir=/etc/ssl" @@ -148,3 +161,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 ad275dd3432606..01fa5f3f6e8711 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,4 +1,5 @@ Source: openssl-unix -Version: 1.1.1d-2 +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|uwp) \ No newline at end of file +Supports: !(windows|uwp) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index 1c1bbae0c242db..5dd28a6f2c77fd 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -1,7 +1,5 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "This port is only for openssl on Unix-like systems") +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") @@ -13,12 +11,12 @@ endif() vcpkg_find_acquire_program(PERL) -set(OPENSSL_VERSION 1.1.1d) +set(OPENSSL_VERSION 1.1.1g) vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" - SHA512 2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7 + SHA512 01e3d0b1bceeed8fb066f542ef5480862001556e0f612e017442330bbd7e5faee228b2de3513d7fc347446b7f217e27de1003dc9d7214d5833b97593f3ec25ab ) vcpkg_extract_source_archive_ex( @@ -28,9 +26,10 @@ vcpkg_extract_source_archive_ex( ) if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES make) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES make perl) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(MAKE ${MSYS_ROOT}/usr/bin/make.exe) + set(PERL ${MSYS_ROOT}/usr/bin/perl.exe) else() find_program(MAKE make) if(NOT MAKE) @@ -59,10 +58,8 @@ foreach(HEADER ${HEADERS}) endforeach() file(INSTALL ${RESOLVED_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include/openssl) -file(INSTALL ${MASTER_COPY_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl-unix RENAME copyright) +file(INSTALL ${MASTER_COPY_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl) endif() - -vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE) diff --git a/ports/openssl-uwp/CONTROL b/ports/openssl-uwp/CONTROL index 7e7650fc22f04d..ccb3fb1e9dcd42 100644 --- a/ports/openssl-uwp/CONTROL +++ b/ports/openssl-uwp/CONTROL @@ -1,4 +1,4 @@ Source: openssl-uwp -Version: 1.1.1d-1 +Version: 1.1.1g 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 \ No newline at end of file +Supports: uwp diff --git a/ports/openssl-uwp/EnableUWPSupport.patch b/ports/openssl-uwp/EnableUWPSupport.patch index 8ec26a6de21fdc..d534b9b4a67e02 100644 --- a/ports/openssl-uwp/EnableUWPSupport.patch +++ b/ports/openssl-uwp/EnableUWPSupport.patch @@ -26,10 +26,10 @@ index 3c4299d264..99fcb1f713 100644 inherit_from => [ "VC-noCE-common", asm("x86_asm"), - sub { $disabled{shared} ? () : "uplink_common" } ], + sub { $disabled{uplink} ? () : "uplink_common" } ], - CFLAGS => add("/WX"), AS => sub { vc_win32_info()->{AS} }, ASFLAGS => sub { vc_win32_info()->{ASFLAGS} }, -@@ -1375,7 +1375,7 @@ my %targets = ( + asoutflag => sub { vc_win32_info()->{asoutflag} }, +@@ -1374,7 +1374,7 @@ my %targets = ( #### MinGW "mingw" => { inherit_from => [ "BASE_unix", asm("x86_asm"), @@ -139,7 +139,7 @@ index 5a699836f3..de45f1e299 100755 #! /usr/bin/env perl +#! /usr/bin/env perl # -*- mode: perl; -*- - # Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. + # Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. # @@ -407,6 +408,7 @@ my @disablables = ( "ubsan", @@ -149,12 +149,13 @@ index 5a699836f3..de45f1e299 100755 "whirlpool", "weak-ssl-ciphers", "zlib", -@@ -479,7 +481,7 @@ my @disable_cascades = ( +@@ -491,8 +493,8 @@ my @disable_cascades = ( # Without position independent code, there can be no shared libraries or DSOs "pic" => [ "shared" ], - "shared" => [ "dynamic-engine" ], + "shared" => [ "dynamic-engine", "uplink" ], + "dso" => [ "dynamic-engine" ], "engine" => [ "afalgeng", "devcryptoeng" ], # no-autoalginit is only useful when building non-shared diff --git a/ports/openssl-uwp/portfile.cmake b/ports/openssl-uwp/portfile.cmake index 8e97a6bf7c1df9..d8e2301de9f0b5 100644 --- a/ports/openssl-uwp/portfile.cmake +++ b/ports/openssl-uwp/portfile.cmake @@ -1,6 +1,4 @@ -if (NOT VCPKG_TARGET_IS_UWP) - message(FATAL_ERROR "${PORT} only supports UWP") -endif() +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") @@ -10,30 +8,19 @@ endif() vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(UWP_PLATFORM "arm") -elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(UWP_PLATFORM "arm64") -elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(UWP_PLATFORM "x64") -elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(UWP_PLATFORM "Win32") -else () - message(FATAL_ERROR "Unsupported architecture") -endif() - vcpkg_find_acquire_program(PERL) vcpkg_find_acquire_program(JOM) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${JOM_EXE_PATH}") +vcpkg_add_to_path("${PERL_EXE_PATH}") +vcpkg_add_to_path("${JOM_EXE_PATH}") -set(OPENSSL_VERSION 1.1.1d) +set(OPENSSL_VERSION 1.1.1g) vcpkg_download_distfile(ARCHIVE URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" - SHA512 2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7 + SHA512 01e3d0b1bceeed8fb066f542ef5480862001556e0f612e017442330bbd7e5faee228b2de3513d7fc347446b7f217e27de1003dc9d7214d5833b97593f3ec25ab ) vcpkg_extract_source_archive_ex( @@ -45,7 +32,7 @@ vcpkg_extract_source_archive_ex( vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) -set(ENV{PATH} "${NASM_EXE_PATH};$ENV{PATH}") +vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") vcpkg_find_acquire_program(JOM) @@ -56,6 +43,7 @@ set(CONFIGURE_COMMAND ${PERL} Configure no-ssl2 no-asm no-uplink + no-tests -utf-8 shared ) @@ -189,5 +177,3 @@ vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE) diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL index 561977fe0f7eda..e9ea27a427846b 100644 --- a/ports/openssl-windows/CONTROL +++ b/ports/openssl-windows/CONTROL @@ -1,4 +1,4 @@ Source: openssl-windows -Version: 1.1.1d-1 +Version: 1.1.1g 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 \ No newline at end of file +Supports: windows diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index 1413d158c26b61..a802c84c509a8c 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -8,15 +8,15 @@ endif() vcpkg_find_acquire_program(PERL) -set(OPENSSL_VERSION 1.1.1d) +set(OPENSSL_VERSION 1.1.1g) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") +vcpkg_add_to_path("${PERL_EXE_PATH}") vcpkg_download_distfile(ARCHIVE URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" - SHA512 2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7 + SHA512 01e3d0b1bceeed8fb066f542ef5480862001556e0f612e017442330bbd7e5faee228b2de3513d7fc347446b7f217e27de1003dc9d7214d5833b97593f3ec25ab ) vcpkg_extract_source_archive_ex( @@ -26,7 +26,7 @@ vcpkg_extract_source_archive_ex( vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) -set(ENV{PATH} "${NASM_EXE_PATH};$ENV{PATH}") +vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") vcpkg_find_acquire_program(JOM) @@ -39,6 +39,7 @@ set(CONFIGURE_COMMAND ${PERL} Configure enable-static-engine enable-capieng no-ssl2 + no-tests -utf-8 ${OPENSSL_SHARED} ) @@ -92,7 +93,7 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log ) vcpkg_execute_required_process( - COMMAND nmake -f ${OPENSSL_MAKEFILE} install + COMMAND nmake -f ${OPENSSL_MAKEFILE} install_sw install_ssldirs WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} LOGNAME build-${TARGET_TRIPLET}-rel-1) @@ -129,7 +130,7 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log ) vcpkg_execute_required_process( - COMMAND nmake -f ${OPENSSL_MAKEFILE} install + COMMAND nmake -f ${OPENSSL_MAKEFILE} install_sw install_ssldirs WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} LOGNAME build-${TARGET_TRIPLET}-dbg-1) @@ -181,5 +182,3 @@ vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index 7c62094b679f9c..4591141bf8f5ac 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,5 +1,5 @@ Source: openssl -Version: 1.1.1d +Version: 1.1.1g 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) \ No newline at end of file +Build-Depends: openssl-windows (!uwp&windows), openssl-uwp (uwp), openssl-unix (!uwp&!windows) diff --git a/ports/openvr/CONTROL b/ports/openvr/CONTROL index ada8687b5f8b82..bf99e3907e77db 100644 --- a/ports/openvr/CONTROL +++ b/ports/openvr/CONTROL @@ -1,5 +1,5 @@ Source: openvr -Version: 1.10.30 +Version: 1.12.5 Homepage: https://github.com/ValveSoftware/openvr Description: an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting. Supports: !(arm|uwp|osx|android) \ No newline at end of file diff --git a/ports/openvr/portfile.cmake b/ports/openvr/portfile.cmake index 0fb02dde1e2270..207bd0f0144a25 100644 --- a/ports/openvr/portfile.cmake +++ b/ports/openvr/portfile.cmake @@ -1,15 +1,14 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp" "osx") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ValveSoftware/openvr - REF 26fa19eb86ab3c589af2bdbc77449d61a8ff799b # v1.10.30 - SHA512 821e113c6a847a244cd138869b5c8192c67054e6b8d39c0764d4e88f7a839146e9d9ec1f189cd5566f8954ad07ee0c86cbf8d353806c9bceb0f0a45def1a0ca2 + REF 3a010f0f668d8de59fcba75b14e08a6a08ec68a0 # v1.12.5 + SHA512 a96b8d4bceb23cea64b8f276a4ec70a5ac2a09ec317da37561bf55527bbf3dda2423b4f7323ed93301384c387061498f6089ae1ef50ad6ff77f46f0af662ccd3 HEAD_REF master ) -set(VCPKG_LIBRARY_LINKAGE dynamic) - if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(ARCH_PATH "win64") @@ -38,4 +37,4 @@ file(COPY ${SOURCE_PATH}/bin/${ARCH_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/d file(INSTALL ${SOURCE_PATH}/headers DESTINATION ${CURRENT_PACKAGES_DIR} RENAME include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opus/CONTROL b/ports/opus/CONTROL index f4ed522c38d90d..cf2fdfa0152b89 100644 --- a/ports/opus/CONTROL +++ b/ports/opus/CONTROL @@ -1,5 +1,5 @@ Source: opus -Version: 1.3.1-2 +Version: 1.3.1-3 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 a770da51f67f02..24be07b6f0a22d 100644 --- a/ports/opus/portfile.cmake +++ b/ports/opus/portfile.cmake @@ -4,9 +4,9 @@ vcpkg_from_github( REPO xiph/opus REF - e85ed7726db5d677c9c0677298ea0cb9c65bdd23 + 5c94ec3205c30171ffd01056f5b4622b7c0ab54c SHA512 - a8c7e5bf383c06f1fdffd44d9b5f658f31eb4800cb59d12da95ddaeb5646f7a7b03025f4663362b888b1374d4cc69154f006ba07b5840ec61ddc1a1af01d6c54 + 2423b1fc86d5b46c32d8e3bde5fc2b410a5c25c001995ce234a94a3a6c7a8b1446fdf19eafe9d6a8a7356fe0857697053db5eb8380d18f8111818aa770b4c4ea HEAD_REF master) 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-qt/CONTROL b/ports/osg-qt/CONTROL index 5d9506f19caa65..da3776a046a5a5 100644 --- a/ports/osg-qt/CONTROL +++ b/ports/osg-qt/CONTROL @@ -1,4 +1,4 @@ Source: osg-qt -Version: Qt4-1 +Version: Qt4-2 Description: osgQt - Qt project for making use of OpenSceneGraph(OSG) -Build-Depends: osg, protobuf, qt5-base \ No newline at end of file +Build-Depends: osg, protobuf, qt5-base[core] \ No newline at end of file diff --git a/ports/osg-qt/portfile.cmake b/ports/osg-qt/portfile.cmake index b97405db432194..7d002fc010d1b6 100644 --- a/ports/osg-qt/portfile.cmake +++ b/ports/osg-qt/portfile.cmake @@ -1,4 +1,3 @@ - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openscenegraph/osgQt @@ -14,9 +13,18 @@ if(VCPKG_TARGET_IS_OSX) string(APPEND VCPKG_C_FLAGS "") # both must be set endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPTIONS -DDYNAMIC_OPENSCENEGRAPH=ON) +else() + set(OPTIONS -DDYNAMIC_OPENSCENEGRAPH=OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${OPTIONS} + -DBUILD_OSG_EXAMPLES=OFF + -DOSG_BUILD_APPLICATION_BUNDLES=OFF ) vcpkg_install_cmake() diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index b958ad0923e70f..598ec59b1cd107 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -1,9 +1,27 @@ Source: osg -Version: 3.6.4-1 +Version: 3.6.4-3 Homepage: https://github.com/openscenegraph/OpenSceneGraph Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. -Build-Depends: freetype, jasper, openexr, zlib, gdal, giflib, libjpeg-turbo, libpng, tiff, fontconfig, sdl2, boost-asio (!windows), libxml2 (windows), giflib (windows), freeglut (windows), expat (windows), libiconv (windows) +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) Feature: collada Description: Support for Collada (.dae) files Build-Depends: collada-dom + +Feature: tools +Description: Enable to build OSG Applications (e.g. osgviewer) +Build-Depends: freetype, sdl1, curl, libjpeg-turbo, libpng, libiconv (windows) + +Feature: examples +Description: Enable to build OSG Examples +Build-Depends: freetype, sdl1, sdl2, libiconv (windows) + +Feature: plugins +Description: Build OSG Plugins - Disable for compile testing examples on a time limit +Build-Depends: freetype, sdl1, curl, openexr, ilmbase, gdal, giflib (windows), jasper, libjpeg-turbo, libpng, tiff, libxml2 (windows), libiconv (windows), libgta, liblas, nvtt + +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 diff --git a/ports/osg/fix-liblas.patch b/ports/osg/fix-liblas.patch new file mode 100644 index 00000000000000..c36396e97bfbb2 --- /dev/null +++ b/ports/osg/fix-liblas.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b84fa06..a991670 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -765,7 +765,10 @@ ELSE() + ENDIF() + FIND_PACKAGE(ZeroConf) + +- FIND_PACKAGE(LIBLAS) ++ FIND_PACKAGE(liblas CONFIG) ++ set(LIBLAS_FOUND ${liblas_FOUND}) ++ set(LIBLAS_LIBRARY liblas) ++ set(LIBLASC_LIBRARY liblas_c) + + IF (NOT(OSG_USE_LOCAL_LUA_SOURCE)) + FIND_PACKAGE(Lua52) diff --git a/ports/osg/fix-nvtt.patch b/ports/osg/fix-nvtt.patch new file mode 100644 index 00000000000000..3cc1c4d5883701 --- /dev/null +++ b/ports/osg/fix-nvtt.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a991670..5b530c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -759,7 +759,9 @@ ELSE() + FIND_PACKAGE(RSVG) + FIND_PACKAGE(GtkGl) + FIND_PACKAGE(DirectInput) ++ if (ENABLE_NVTT) + FIND_PACKAGE(NVTT) ++ endif() + IF (NOT WIN32) + FIND_PACKAGE(Asio) + ENDIF() diff --git a/ports/osg/fix-sdl.patch b/ports/osg/fix-sdl.patch index fa092c7848daf2..e97d86476f3cbd 100644 --- a/ports/osg/fix-sdl.patch +++ b/ports/osg/fix-sdl.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81328ea..2566b48 100644 +index 81328ea..c735419 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -755,8 +755,6 @@ ELSE() @@ -11,15 +11,14 @@ index 81328ea..2566b48 100644 FIND_PACKAGE(Poppler-glib) FIND_PACKAGE(RSVG) FIND_PACKAGE(GtkGl) -@@ -775,6 +773,11 @@ ELSE() +@@ -775,6 +773,10 @@ ELSE() FIND_PACKAGE(Lua51) ENDIF() ENDIF() + + find_package(SDL) -+ if (NOT SDL_FOUND) -+ find_package(SDL2) -+ endif() ++ find_package(SDL2 CONFIG) ++ set(SDL2_LIBRARY SDL2::SDL2 SDL2::SDL2main) # V8 and Python plugins are tests for linking against these libraries but aren't functionality beyond this. # FIND_PACKAGE(V8) diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index a4e3d7b73964e1..d8c8a846532ac3 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -14,6 +14,9 @@ vcpkg_from_github( disable-present3d-staticview-in-linux.patch #Due to some link error we cannot solve yet, disable them in linux. fix-curl.patch remove-prefix.patch # Remove this patch when cmake fix Findosg_functions.cmake + fix-liblas.patch + fix-nvtt.patch + use-boost-asio.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -42,16 +45,32 @@ list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_GLIB=ON) list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_SDL=ON) list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_LIBLAS=ON) +# Due to nvtt CRT linkage error, we can only enable static builds here +set(ENABLE_NVTT ON) +if (VCPKG_TARGET_IS_WINDOWS AND OSG_DYNAMIC) + set(ENABLE_NVTT OFF) +endif() +list(APPEND OPTIONS -DENABLE_NVTT=${ENABLE_NVTT}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tools BUILD_OSG_APPLICATIONS + examples BUILD_OSG_EXAMPLES + plugins BUILD_OSG_PLUGINS + packages BUILD_OSG_PACKAGES + docs BUILD_DOCUMENTATION + docs BUILD_REF_DOCS_SEARCHENGINE + docs BUILD_REF_DOCS_TAGFILE +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DOSG_USE_UTF8_FILENAME=${OSG_USE_UTF8_FILENAME} -DDYNAMIC_OPENSCENEGRAPH=${OSG_DYNAMIC} -DDYNAMIC_OPENTHREADS=${OSG_DYNAMIC} - -DBUILD_OSG_PLUGINS=ON # it should always be ON due to osgerath need this - -DBUILD_OSG_EXAMPLES=ON - -DBUILD_OSG_APPLICATIONS=ON + -DBUILD_DASHBOARD_REPORTS=OFF -DCMAKE_CXX_STANDARD=11 + ${OPTIONS} ) vcpkg_install_cmake() @@ -62,31 +81,53 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) set(OSG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) file(GLOB OSG_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) -file(COPY ${OSG_TOOLS} DESTINATION ${OSG_TOOL_PATH}) -file(REMOVE_RECURSE ${OSG_TOOLS}) -file(GLOB OSG_TOOLS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${OSG_TOOLS_DBG}) +if (OSG_TOOLS) + file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) + file(COPY ${OSG_TOOLS} DESTINATION ${OSG_TOOL_PATH}) + file(REMOVE_RECURSE ${OSG_TOOLS}) + file(GLOB OSG_TOOLS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + file(REMOVE_RECURSE ${OSG_TOOLS_DBG}) +endif() +file(GLOB OSG_TOOLS ${CURRENT_PACKAGES_DIR}/share/OpenSceneGraph/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) +if (OSG_TOOLS) + file(COPY ${OSG_TOOLS} DESTINATION ${OSG_TOOL_PATH}) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/OpenSceneGraph) +endif() + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/*${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}) - file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) - file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/*${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}) - file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) + file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/*) + if (OSG_PLUGINS_DBG) + file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) + endif() + file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/*) + if (OSG_PLUGINS_REL) + if (NOT EXISTS ${OSG_TOOL_PATH}) + file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) + endif() + file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) + endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/ ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/) endif() -file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/osgPlugins-${OSG_VER}/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) -file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) -file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/lib/osgPlugins-${OSG_VER}/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) -file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/osgPlugins-${OSG_VER}/ ${CURRENT_PACKAGES_DIR}/debug/lib/osgPlugins-${OSG_VER}/) +file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/*) +if (OSG_PLUGINS_DBG) + file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) +endif() + +file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/*) +if (OSG_PLUGINS_REL) + if (NOT EXISTS ${OSG_TOOL_PATH}) + file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) + endif() + file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) +endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/ ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/) #Cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -94,4 +135,4 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/) # 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/osg/use-boost-asio.patch b/ports/osg/use-boost-asio.patch new file mode 100644 index 00000000000000..4d804973c0b45a --- /dev/null +++ b/ports/osg/use-boost-asio.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeModules/FindAsio.cmake b/CMakeModules/FindAsio.cmake +index 433d5c7..04a0edf 100644 +--- a/CMakeModules/FindAsio.cmake ++++ b/CMakeModules/FindAsio.cmake +@@ -1,22 +1,7 @@ + # Locate ASIO-headers (http://think-async.com/Asio) +-# This module defines +-# ASIO_FOUND, if false, do not try to link to gdal +-# ASIO_INCLUDE_DIR, where to find the headers +-# + # Created by Stephan Maximilian Huber + +-FIND_PATH(ASIO_INCLUDE_DIR +- NAMES +- asio.hpp +- PATHS +- /usr/include +- /usr/local/include +-) +- +-SET(ASIO_FOUND "NO") +-IF(ASIO_INCLUDE_DIR) +- FIND_PACKAGE( Boost 1.37 ) +- IF(Boost_FOUND) +- SET(ASIO_FOUND "YES") +- ENDIF() ++FIND_PACKAGE( Boost 1.37 COMPONENTS asio ) ++IF(Boost_FOUND) ++ SET(ASIO_FOUND "YES") + ENDIF() +diff --git a/src/osgPlugins/RestHttpDevice/CMakeLists.txt b/src/osgPlugins/RestHttpDevice/CMakeLists.txt +index 8464b9d..073e8ed 100644 +--- a/src/osgPlugins/RestHttpDevice/CMakeLists.txt ++++ b/src/osgPlugins/RestHttpDevice/CMakeLists.txt +@@ -1,5 +1,4 @@ + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +-INCLUDE_DIRECTORIES(${ASIO_INCLUDE_DIR}) + + SET(TARGET_SRC + connection.cpp +diff --git a/src/osgPlugins/RestHttpDevice/connection.hpp b/src/osgPlugins/RestHttpDevice/connection.hpp +index 99f3a93..b205759 100644 +--- a/src/osgPlugins/RestHttpDevice/connection.hpp ++++ b/src/osgPlugins/RestHttpDevice/connection.hpp +@@ -11,7 +11,7 @@ + #ifndef HTTP_SERVER_CONNECTION_HPP + #define HTTP_SERVER_CONNECTION_HPP + +-#include ++#include + #include + #include + #include +diff --git a/src/osgPlugins/RestHttpDevice/io_service_pool.hpp b/src/osgPlugins/RestHttpDevice/io_service_pool.hpp +index 1d363a8..b6e7195 100644 +--- a/src/osgPlugins/RestHttpDevice/io_service_pool.hpp ++++ b/src/osgPlugins/RestHttpDevice/io_service_pool.hpp +@@ -11,7 +11,7 @@ + #ifndef HTTP_SERVER_IO_SERVICE_POOL_HPP + #define HTTP_SERVER_IO_SERVICE_POOL_HPP + +-#include ++#include + #include + #include + #include +diff --git a/src/osgPlugins/RestHttpDevice/reply.hpp b/src/osgPlugins/RestHttpDevice/reply.hpp +index 89f264a..b63d0b9 100644 +--- a/src/osgPlugins/RestHttpDevice/reply.hpp ++++ b/src/osgPlugins/RestHttpDevice/reply.hpp +@@ -13,7 +13,7 @@ + + #include + #include +-#include ++#include + #include "header.hpp" + + namespace http { +diff --git a/src/osgPlugins/RestHttpDevice/server.hpp b/src/osgPlugins/RestHttpDevice/server.hpp +index a14f263..91c4b62 100644 +--- a/src/osgPlugins/RestHttpDevice/server.hpp ++++ b/src/osgPlugins/RestHttpDevice/server.hpp +@@ -11,7 +11,7 @@ + #ifndef HTTP_SERVER_SERVER_HPP + #define HTTP_SERVER_SERVER_HPP + +-#include ++#include + #include + #include + #include diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index d54992b827fec4..3585c467e3f041 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,4 +1,5 @@ Source: osgearth -Version: 2.10.2 +Version: 3.0 +Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. -Build-Depends: osg +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/otl/CONTROL b/ports/otl/CONTROL index a3b23e71867172..6b6bfe5e51f95f 100644 --- a/ports/otl/CONTROL +++ b/ports/otl/CONTROL @@ -1,4 +1,4 @@ Source: otl -Version: 4.0.451 +Version: 4.0.455 Description: Oracle, Odbc and DB2-CLI Template Library Homepage: http://otl.sourceforge.net/ diff --git a/ports/otl/portfile.cmake b/ports/otl/portfile.cmake index c01c60f9d3c821..82a289a9927e83 100644 --- a/ports/otl/portfile.cmake +++ b/ports/otl/portfile.cmake @@ -1,9 +1,9 @@ -set(OTL_VERSION 40451) +set(OTL_VERSION 40455) vcpkg_download_distfile(ARCHIVE URLS "http://otl.sourceforge.net/otlv4_${OTL_VERSION}.zip" FILENAME "otlv4_${OTL_VERSION}.zip" - SHA512 add1e54fae20175461d5f09cbe324e98b6f6a3839356136811109cf3251ca96541c101816870c6cc15d7611ad6bf9d576ac8dfce4274419b30866955c5892d15 + SHA512 2d5c52af3eafdd93bf7c651de218607b8985acc1fce279d48d9bf58ecf8a012332c8d0b9a33223a6449f343134211e2d7c5412b71efb36ba484bda754e1afc45 ) vcpkg_extract_source_archive_ex( 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/p-ranav-csv/CONTROL b/ports/p-ranav-csv/CONTROL index 958341f9ed7e24..6ab672e3d1013d 100644 --- a/ports/p-ranav-csv/CONTROL +++ b/ports/p-ranav-csv/CONTROL @@ -1,4 +1,4 @@ Source: p-ranav-csv Version: 2019-07-11 -Description: CSV for modern C++ +Description: [deprecated] CSV for modern C++ Homepage: https://github.com/p-ranav/csv diff --git a/ports/p-ranav-csv2/CONTROL b/ports/p-ranav-csv2/CONTROL new file mode 100644 index 00000000000000..349d7df53e5128 --- /dev/null +++ b/ports/p-ranav-csv2/CONTROL @@ -0,0 +1,4 @@ +Source: p-ranav-csv2 +Version: 2020-06-02 +Homepage: https://github.com/p-ranav/csv2 +Description: CSV for modern C++ diff --git a/ports/p-ranav-csv2/portfile.cmake b/ports/p-ranav-csv2/portfile.cmake new file mode 100644 index 00000000000000..32942c90e222ca --- /dev/null +++ b/ports/p-ranav-csv2/portfile.cmake @@ -0,0 +1,25 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO p-ranav/csv2 + REF d659f90b637bb0de6c32246583fc4bb7caade215 + SHA512 d00b1356907a7e22529e3ac4a7b979c6868311e8a98e4fd8b0a8b1f0d94b2425854242649a80a933084202834f5cee1fe17b51476fcc17e87b00e1e3cb8ed0e9 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCSV2_BUILD_TESTS=OFF + -DCSV2_SAMPLES=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/licenses) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.mio DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/paho-mqttpp3/CONTROL b/ports/paho-mqttpp3/CONTROL index 988f916c8bcded..601358fcf90858 100644 --- a/ports/paho-mqttpp3/CONTROL +++ b/ports/paho-mqttpp3/CONTROL @@ -1,5 +1,6 @@ Source: paho-mqttpp3 -Version: 1.0.1-3 +Version: 1.1 +Homepage: https://github.com/eclipse/paho.mqtt.cpp Description: Paho project provides open-source C++ wrapper for Paho C library Build-Depends: paho-mqtt Default-Features: ssl diff --git a/ports/paho-mqttpp3/fix-dependency.patch b/ports/paho-mqttpp3/fix-dependency.patch index a0dbf445a62540..a19644d861d63b 100644 --- a/ports/paho-mqttpp3/fix-dependency.patch +++ b/ports/paho-mqttpp3/fix-dependency.patch @@ -10,10 +10,11 @@ index a9f8908..5c98f3f 100644 "${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake" DESTINATION lib/cmake/${package_name}) diff --git a/cmake/PahoMqttCppConfig.cmake.in b/cmake/PahoMqttCppConfig.cmake.in -index e06dc68..df1cfa6 100644 +index aff9472..275655c 100644 --- a/cmake/PahoMqttCppConfig.cmake.in +++ b/cmake/PahoMqttCppConfig.cmake.in -@@ -1,6 +1,6 @@ +@@ -5,7 +5,7 @@ set(PAHO_WITH_SSL @PAHO_WITH_SSL@) + include(CMakeFindDependencyMacro) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -find_dependency(PahoMqttC REQUIRED) @@ -22,7 +23,7 @@ index e06dc68..df1cfa6 100644 include("${CMAKE_CURRENT_LIST_DIR}/@package_name@Targets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index bfcf6bb..089e35a 100644 +index 4e9b7c4..bd1e0a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ @@ -34,21 +35,52 @@ index bfcf6bb..089e35a 100644 # --- The headers --- -@@ -91,7 +91,7 @@ if(PAHO_BUILD_SHARED) +@@ -76,17 +76,23 @@ target_include_directories(paho-cpp-objs + src + ) + +- + ## --- Build the shared library, if requested --- + + if(PAHO_BUILD_SHARED) ++ ## set PAHO_C_LIB ++ if(PAHO_WITH_SSL) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs) ++ else() ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c) ++ endif() ++ + ## create the shared library + add_library(paho-mqttpp3 SHARED $) + ## add dependencies to the shared library target_link_libraries(paho-mqttpp3 PRIVATE ${LIBS_SYSTEM} -- PUBLIC PahoMqttC::PahoMqttC) -+ PUBLIC eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs) +- PUBLIC PahoMqttC::PahoMqttC Threads::Threads) ++ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads) # It would be nice to exort the include paths from the obj lib, but we # get an export error. Perhaps in a future version? -@@ -129,7 +129,7 @@ if(PAHO_BUILD_STATIC) +@@ -118,13 +124,21 @@ endif() + ## --- Build static version of the library, if requested --- + + if(PAHO_BUILD_STATIC) ++ ++ ## set PAHO_C_LIB ++ if(PAHO_WITH_SSL) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static) ++ else() ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static) ++ endif() ++ + ## create the static library + add_library(paho-mqttpp3-static STATIC $) + ## add dependencies to the shared library target_link_libraries(paho-mqttpp3-static PRIVATE ${LIBS_SYSTEM} -- PUBLIC PahoMqttC::PahoMqttC) -+ PUBLIC eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static) +- PUBLIC PahoMqttC::PahoMqttC Threads::Threads) ++ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads) target_include_directories(paho-mqttpp3-static PUBLIC $ diff --git a/ports/paho-mqttpp3/fix-include-path.patch b/ports/paho-mqttpp3/fix-include-path.patch index 5b7297dd2804cc..bb9800ca4c2545 100644 --- a/ports/paho-mqttpp3/fix-include-path.patch +++ b/ports/paho-mqttpp3/fix-include-path.patch @@ -1,8 +1,8 @@ diff --git a/src/mqtt/async_client.h b/src/mqtt/async_client.h -index 2754690..019c81b 100644 +index 4bbd95c..9db5746 100644 --- a/src/mqtt/async_client.h +++ b/src/mqtt/async_client.h -@@ -24,7 +24,7 @@ +@@ -25,7 +25,7 @@ #ifndef __mqtt_async_client_h #define __mqtt_async_client_h @@ -12,7 +12,7 @@ index 2754690..019c81b 100644 #include "mqtt/token.h" #include "mqtt/string_collection.h" diff --git a/src/mqtt/callback.h b/src/mqtt/callback.h -index 6cac442..13585de 100644 +index 434b979..2d2ee1f 100644 --- a/src/mqtt/callback.h +++ b/src/mqtt/callback.h @@ -24,7 +24,7 @@ @@ -25,7 +25,7 @@ index 6cac442..13585de 100644 #include "mqtt/types.h" #include diff --git a/src/mqtt/connect_options.h b/src/mqtt/connect_options.h -index a7cdf56..adb52fb 100644 +index 891bd01..2046b93 100644 --- a/src/mqtt/connect_options.h +++ b/src/mqtt/connect_options.h @@ -24,7 +24,7 @@ @@ -38,7 +38,7 @@ index a7cdf56..adb52fb 100644 #include "mqtt/message.h" #include "mqtt/topic.h" diff --git a/src/mqtt/delivery_token.h b/src/mqtt/delivery_token.h -index 3ecf70b..16c47bb 100644 +index b70d582..ee1b306 100644 --- a/src/mqtt/delivery_token.h +++ b/src/mqtt/delivery_token.h @@ -24,7 +24,7 @@ @@ -51,7 +51,7 @@ index 3ecf70b..16c47bb 100644 #include "mqtt/message.h" #include diff --git a/src/mqtt/disconnect_options.h b/src/mqtt/disconnect_options.h -index 81b74ad..2f8c824 100644 +index d2ebdbf..6eb3e9a 100644 --- a/src/mqtt/disconnect_options.h +++ b/src/mqtt/disconnect_options.h @@ -23,7 +23,7 @@ @@ -60,11 +60,11 @@ index 81b74ad..2f8c824 100644 -#include "MQTTAsync.h" +#include "paho-mqtt/MQTTAsync.h" + #include "mqtt/types.h" #include "mqtt/token.h" - #include - + #include "mqtt/properties.h" diff --git a/src/mqtt/exception.h b/src/mqtt/exception.h -index 775589f..77f4821 100644 +index cdcd2fc..11ddc7d 100644 --- a/src/mqtt/exception.h +++ b/src/mqtt/exception.h @@ -24,7 +24,7 @@ @@ -103,20 +103,33 @@ index 852ec8e..aa721bc 100644 #include "mqtt/buffer_view.h" #include "mqtt/string_collection.h" diff --git a/src/mqtt/message.h b/src/mqtt/message.h -index feb3b97..bdab5d8 100644 +index 5d64e8d..9f7096a 100644 --- a/src/mqtt/message.h +++ b/src/mqtt/message.h -@@ -24,7 +24,7 @@ +@@ -25,7 +25,7 @@ #ifndef __mqtt_message_h #define __mqtt_message_h -#include "MQTTAsync.h" +#include "paho-mqtt/MQTTAsync.h" #include "mqtt/buffer_ref.h" + #include "mqtt/properties.h" #include "mqtt/exception.h" - #include +diff --git a/src/mqtt/properties.h b/src/mqtt/properties.h +index bbe977c..fa55560 100644 +--- a/src/mqtt/properties.h ++++ b/src/mqtt/properties.h +@@ -25,7 +25,7 @@ + #define __mqtt_properties_h + + extern "C" { +- #include "MQTTProperties.h" ++ #include "paho-mqtt/MQTTProperties.h" + } + + #include "mqtt/types.h" diff --git a/src/mqtt/response_options.h b/src/mqtt/response_options.h -index 6fc727f..dca2013 100644 +index 48f7831..7ec94e4 100644 --- a/src/mqtt/response_options.h +++ b/src/mqtt/response_options.h @@ -7,7 +7,7 @@ @@ -127,12 +140,25 @@ index 6fc727f..dca2013 100644 +#include "paho-mqtt/MQTTAsync.h" #include "mqtt/token.h" #include "mqtt/delivery_token.h" + #include "subscribe_options.h" +diff --git a/src/mqtt/server_response.h b/src/mqtt/server_response.h +index 7f0fe72..4d0fb2c 100644 +--- a/src/mqtt/server_response.h ++++ b/src/mqtt/server_response.h +@@ -24,7 +24,7 @@ + #ifndef __mqtt_server_response_h + #define __mqtt_server_response_h + +-#include "MQTTAsync.h" ++#include "paho-mqtt/MQTTAsync.h" + #include "mqtt/types.h" + #include "mqtt/properties.h" diff --git a/src/mqtt/ssl_options.h b/src/mqtt/ssl_options.h -index ca2f847..64a3afc 100644 +index f44607c..cdd2cdc 100644 --- a/src/mqtt/ssl_options.h +++ b/src/mqtt/ssl_options.h -@@ -25,7 +25,7 @@ +@@ -27,7 +27,7 @@ #ifndef __mqtt_ssl_options_h #define __mqtt_ssl_options_h @@ -141,11 +167,26 @@ index ca2f847..64a3afc 100644 #include "mqtt/message.h" #include "mqtt/topic.h" #include "mqtt/types.h" +diff --git a/src/mqtt/subscribe_options.h b/src/mqtt/subscribe_options.h +index 753c811..5f0d86c 100644 +--- a/src/mqtt/subscribe_options.h ++++ b/src/mqtt/subscribe_options.h +@@ -24,8 +24,8 @@ + #ifndef __mqtt_subscribe_options_h + #define __mqtt_subscribe_options_h + +-#include "MQTTAsync.h" +-#include "MQTTSubscribeOpts.h" ++#include "paho-mqtt/MQTTAsync.h" ++#include "paho-mqtt/MQTTSubscribeOpts.h" + #include "mqtt/types.h" + + namespace mqtt { diff --git a/src/mqtt/token.h b/src/mqtt/token.h -index 0db8196..e4fe10e 100644 +index efb1659..d0b2dee 100644 --- a/src/mqtt/token.h +++ b/src/mqtt/token.h -@@ -24,7 +24,7 @@ +@@ -25,7 +25,7 @@ #ifndef __mqtt_token_h #define __mqtt_token_h @@ -155,7 +196,7 @@ index 0db8196..e4fe10e 100644 #include "mqtt/exception.h" #include "mqtt/types.h" diff --git a/src/mqtt/topic.h b/src/mqtt/topic.h -index f68005a..61e53f0 100644 +index 618eb85..555de60 100644 --- a/src/mqtt/topic.h +++ b/src/mqtt/topic.h @@ -24,7 +24,7 @@ @@ -165,13 +206,13 @@ index f68005a..61e53f0 100644 -#include "MQTTAsync.h" +#include "paho-mqtt/MQTTAsync.h" #include "mqtt/delivery_token.h" + #include "mqtt/subscribe_options.h" #include "mqtt/message.h" - #include "mqtt/types.h" diff --git a/src/mqtt/will_options.h b/src/mqtt/will_options.h -index bffb9e0..d7eca10 100644 +index a685a96..7bfc46e 100644 --- a/src/mqtt/will_options.h +++ b/src/mqtt/will_options.h -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ #ifndef __mqtt_will_options_h #define __mqtt_will_options_h diff --git a/ports/paho-mqttpp3/portfile.cmake b/ports/paho-mqttpp3/portfile.cmake index ea6d57bc1abd34..16e9acab07ffb4 100644 --- a/ports/paho-mqttpp3/portfile.cmake +++ b/ports/paho-mqttpp3/portfile.cmake @@ -1,11 +1,9 @@ -include(vcpkg_common_functions) - # Download from Github vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eclipse/paho.mqtt.cpp - REF v1.0.1 - SHA512 be612197fae387b9f1d8f10944d451ec9e7ebec6045beed365e642089c0a5fde882ed5c734f2b46a5008f98b8445a51114492f0f36fdc684b8a8fe4b71fe31a4 + REF f3a2a52259b5463ab50eee6d1c033cba18d6e84b + SHA512 9b12259e3aab347c7a362aa56d66e720532a09a44bff8671215b98c7f54bcc282a10545b529b5425eebf65e007113659364cf0e41b9c99cc938b00c1b37434d9 HEAD_REF master PATCHES fix-include-path.patch 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 72b2aaa1070830..cea8f146423d8e 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -1,5 +1,6 @@ Source: pango -Version: 1.40.11-6 +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, fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) +Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/pango/portfile.cmake b/ports/pango/portfile.cmake index 699343fdcdeeb2..475d49f01038ec 100644 --- a/ports/pango/portfile.cmake +++ b/ports/pango/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(PANGO_VERSION 1.40.11) vcpkg_download_distfile(ARCHIVE URLS "http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-${PANGO_VERSION}.tar.xz" @@ -25,5 +23,4 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pango) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/pango/COPYING ${CURRENT_PACKAGES_DIR}/share/pango/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/pangolin/CONTROL b/ports/pangolin/CONTROL index 8963cc26bbe352..a8c3a60e8fee4c 100644 --- a/ports/pangolin/CONTROL +++ b/ports/pangolin/CONTROL @@ -1,5 +1,7 @@ Source: pangolin -Version: 0.5-7 +Version: 0.5 +Port-Version: 8 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..82b1ea83ea5596 --- /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..b6567a2 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) ++ 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/parallel-hashmap/CONTROL b/ports/parallel-hashmap/CONTROL index 0796d22586fe30..1732e09fa7f07d 100644 --- a/ports/parallel-hashmap/CONTROL +++ b/ports/parallel-hashmap/CONTROL @@ -1,3 +1,3 @@ Source: parallel-hashmap -Version: 1.30 +Version: 1.32 Description: A header-only, very fast and memory-friendly family of C++ hash maps. diff --git a/ports/parallel-hashmap/portfile.cmake b/ports/parallel-hashmap/portfile.cmake index 0c06b3a22560e9..01a7e1b2dacaf1 100644 --- a/ports/parallel-hashmap/portfile.cmake +++ b/ports/parallel-hashmap/portfile.cmake @@ -1,11 +1,10 @@ #header-only library -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO greg7mdp/parallel-hashmap - REF 1.30 - SHA512 5c2f4d1f50a6dc17bd763243412786056d5ecc4ec801ac5fe5bacbf0e6abe30e17347f3e4a22c12dc293e74843920cbc9b19ec3f1a048f8a3f58626457cba32a + REF 1.32 + SHA512 838358bf5899876a53accea8a10e051d35189b4105b6bc01dfe4f3ff01fdbe68986efb36341cc3082bc58419be33735e76350a2fd9501c2cace153f9d4321f24 HEAD_REF master ) @@ -22,5 +21,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug ${ file(COPY ${SOURCE_PATH}/phmap.natvis DESTINATION ${CURRENT_PACKAGES_DIR}/include) # Put the licence file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/parallel-hashmap) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/parallel-hashmap/LICENSE ${CURRENT_PACKAGES_DIR}/share/parallel-hashmap/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/parallelstl/CONTROL b/ports/parallelstl/CONTROL index de0c81a0431447..4b7b0549a8ac7b 100644 --- a/ports/parallelstl/CONTROL +++ b/ports/parallelstl/CONTROL @@ -1,5 +1,5 @@ Source: parallelstl -Version: 20191218 +Version: 20200330 Homepage: https://github.com/intel/parallelstl Description: Parallel STL is an implementation of the C++ standard library algorithms with support for execution policies, as specified in ISO/IEC 14882:2017 standard, commonly called C++17. Build-Depends: tbb \ No newline at end of file diff --git a/ports/parallelstl/portfile.cmake b/ports/parallelstl/portfile.cmake index 8d0558d492d09b..a082b8b2b32708 100644 --- a/ports/parallelstl/portfile.cmake +++ b/ports/parallelstl/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO intel/parallelstl #20191218 - REF 37761e15f62c03b7eb179db64ef930a69f33dfac - SHA512 dc8c875f692043b6f10ce7faf034e07536978537ea2a3d545be499cfa047f0c362c5109eb744a41dc0c92bd0fc56d98505183444bd376aeb257c9204480e6668 + REPO intel/parallelstl + REF 0241743d73bb405b16d9c4a24b693e4533dc34a7 # 20200330 + SHA512 cd2f1b60639e9da35a722bdef0bc6420ddca064e3bff979d8a6ea591fb43865b7614c811bced642fd5ff1fab659da1dfaa248dc2b321db7f27d0e74544a2f21e HEAD_REF master PATCHES fix-cmakelist.patch @@ -25,4 +25,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) # 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/paraview/CONTROL b/ports/paraview/CONTROL new file mode 100644 index 00000000000000..d40b55adc6282a --- /dev/null +++ b/ports/paraview/CONTROL @@ -0,0 +1,29 @@ +Source: paraview +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 + +Feature: vtkm +Description: enables vtkm for the build of paraview +Build-Depends: vtk[core,vtkm] + +Feature: python +Description: enables the build of python wrappers +Build-Depends: vtk[core,python] + +Feature: cuda +Description: enables cuda within paraview +Build-Depends: cuda, vtk[core, cuda] + +Feature: mpi +Description: enables cuda within paraview +Build-Depends: hdf5[core,parallel], vtk[core, mpi] + +Feature: tools +Description: Build paraview tools + +Feature: all_modules +Description: enables the build of all paraview modules +Build-Depends: gdal, pdal, ffmpeg, laszip diff --git a/ports/paraview/VisIt_Build.patch b/ports/paraview/VisIt_Build.patch new file mode 100644 index 00000000000000..fb676a737b7699 --- /dev/null +++ b/ports/paraview/VisIt_Build.patch @@ -0,0 +1,107 @@ +diff --git a/databases/readers/CEAucd/vtkCEAucdReader.C b/databases/readers/CEAucd/vtkCEAucdReader.C +index 0ad9a828a..cf37beb86 100644 +--- a/databases/readers/CEAucd/vtkCEAucdReader.C ++++ b/databases/readers/CEAucd/vtkCEAucdReader.C +@@ -172,7 +172,7 @@ const char *vtkCEAucdReader::GetByteOrderAsString() + } + } + +-void vtkCEAucdReader::SetFileStream( ifstream* istr ) ++void vtkCEAucdReader::SetFileStream( std::ifstream* istr ) + { + if( istr == this->FileStream ) return; + +@@ -311,9 +311,9 @@ int vtkCEAucdReader::RequestInformation( + { + vtkDebugMacro(<<"Open file "<FileName<<"\n"); + #ifdef _WIN32 +- this->FileStream = new ifstream(this->FileName, ios::in | ios::binary); ++ this->FileStream = new std::ifstream(this->FileName, std::ios::in | std::ios::binary); + #else +- this->FileStream = new ifstream(this->FileName, ios::in); ++ this->FileStream = new std::ifstream(this->FileName, std::ios::in); + #endif + } + +@@ -340,7 +340,7 @@ int vtkCEAucdReader::RequestInformation( + vtkDebugMacro(<<"Re-open file "<FileName<<" in ASCII mode"); + delete this->FileStream; // close file to reopen it later + this->FileStream = NULL; +- this->FileStream = new ifstream(this->FileName, ios::in); ++ this->FileStream = new std::ifstream(this->FileName, std::ios::in); + } + + char c='\0', buf[100]; +diff --git a/databases/readers/CEAucd/vtkCEAucdReader.h b/databases/readers/CEAucd/vtkCEAucdReader.h +index c3a86c16b..434556488 100644 +--- a/databases/readers/CEAucd/vtkCEAucdReader.h ++++ b/databases/readers/CEAucd/vtkCEAucdReader.h +@@ -49,7 +49,7 @@ class vtkCEAucdReader : public vtkUnstructuredGridAlgorithm + public: + static vtkCEAucdReader *New(); + vtkTypeMacro(vtkCEAucdReader,vtkUnstructuredGridAlgorithm); +- void PrintSelf(ostream& os, vtkIndent indent) override; ++ void PrintSelf(std::ostream& os, vtkIndent indent) override; + + // Description: + // Specify file name of CEA UCD datafile to read +@@ -120,7 +120,7 @@ class vtkCEAucdReader : public vtkUnstructuredGridAlgorithm + vtkSetStringMacro(ActivePointArray); + vtkGetStringMacro(ActivePointArray); + +- void SetFileStream( ifstream* istr ); ++ void SetFileStream( std::ifstream* istr ); + + // Description: + // The following methods allow selective reading of solutions fields. by +@@ -173,7 +173,7 @@ class vtkCEAucdReader : public vtkUnstructuredGridAlgorithm + vtkIdType * PointsInMaterial; + vtkIdType * CellIndexInMaterial; + +- ifstream *FileStream; ++ std::ifstream *FileStream; + long GlobalOffset; + long FileSize; + bool OwnStream; +diff --git a/databases/readers/Image/vtkStimulateReader.C b/databases/readers/Image/vtkStimulateReader.C +index be91dc91e..aeec88891 100644 +--- a/databases/readers/Image/vtkStimulateReader.C ++++ b/databases/readers/Image/vtkStimulateReader.C +@@ -104,7 +104,6 @@ int vtkStimulateReader::OpenFile(void) + // Close file from any previous image + if (this->File) + { +- this->File->close(); + delete this->File; + this->File = NULL; + } +@@ -122,9 +121,9 @@ int vtkStimulateReader::OpenFile(void) + if ( !FileFunctions::VisItStat( sdt_name, &fs) ) + { + #ifdef _WIN32 +- this->File = new ifstream(sdt_name, ios::in | ios::binary); ++ this->File = new std::ifstream(sdt_name, std::ios::in | std::ios::binary); + #else +- this->File = new ifstream(sdt_name, ios::in); ++ this->File = new std::ifstream(sdt_name, std::ios::in); + #endif + } + if (! this->File || this->File->fail()) +@@ -246,7 +245,7 @@ int vtkStimulateReader::CanReadFile(const char* fname) + return 0; + } + +- ifstream sdt_file(sdt_name); ++ std::ifstream sdt_file(sdt_name); + if (sdt_file.fail()) + { + vtkErrorMacro(<<"Cannot read file: invalid sdt_file " << sdt_name); +@@ -266,7 +265,7 @@ bool vtkStimulateReader::ReadSPRFile(const char *spr_name) + haveReadSPRFile = true; + validSPRFile = false; + +- ifstream spr_file(spr_name); ++ std::ifstream spr_file(spr_name); + if (spr_file.fail()) + { + vtkErrorMacro(<<"Unable to read SPR file " << spr_name << ": file " diff --git a/ports/paraview/add-tools-option.patch b/ports/paraview/add-tools-option.patch new file mode 100644 index 00000000000000..86ba2c5a675694 --- /dev/null +++ b/ports/paraview/add-tools-option.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8b33b25..10cadda 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -730,7 +730,10 @@ if (PARAVIEW_ENABLE_WEB) + @ONLY) + endif () + ++option(PARAVIEW_BUILD_TOOLS "Build paraview tools" OFF) ++if (PARAVIEW_BUILD_TOOLS) + add_subdirectory(Clients) ++endif() + + if (PARAVIEW_USE_PYTHON) + add_subdirectory(Wrapping/Python) diff --git a/ports/paraview/cgns.patch b/ports/paraview/cgns.patch new file mode 100644 index 00000000000000..2ebb05e1bd2ec2 --- /dev/null +++ b/ports/paraview/cgns.patch @@ -0,0 +1,29 @@ +diff --git a/CMake/FindCGNS.cmake b/CMake/FindCGNS.cmake +index 005f1afd9..a45103a9f 100644 +--- a/CMake/FindCGNS.cmake ++++ b/CMake/FindCGNS.cmake +@@ -16,7 +16,7 @@ mark_as_advanced(CGNS_INCLUDE_DIR) + + find_library(CGNS_LIBRARY + NAMES +- cgns ++ cgnsdll cgns + DOC "CGNS library") + mark_as_advanced(CGNS_LIBRARY) + +@@ -45,4 +45,15 @@ if (CGNS_FOUND) + IMPORTED_LOCATION "${CGNS_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CGNS_INCLUDE_DIR}") + endif () ++ include(CMakeFindDependencyMacro) ++ find_dependency(hdf5 CONFIG) ++ if(TARGET hdf5::hdf5-shared) ++ set_property(TARGET CGNS::CGNS APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES "hdf5::hdf5-shared") ++ elseif(TARGET hdf5::hdf5-static) ++ set_property(TARGET CGNS::CGNS APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES "hdf5::hdf5-static") ++ else() ++ message(FATAL_ERROR "No HDF5 target to link cgns against") ++ endif() + endif () diff --git a/ports/paraview/paraview_build.patch b/ports/paraview/paraview_build.patch new file mode 100644 index 00000000000000..042bbe6b591a0c --- /dev/null +++ b/ports/paraview/paraview_build.patch @@ -0,0 +1,745 @@ +diff --git a/CMake/ParaViewClient.cmake b/CMake/ParaViewClient.cmake +index 7dadad937..dd271739d 100644 +--- a/CMake/ParaViewClient.cmake ++++ b/CMake/ParaViewClient.cmake +@@ -516,6 +516,7 @@ function (paraview_client_documentation) + NAMES xmlpatterns-qt5 xmlpatterns + HINTS "${Qt5_DIR}/../../../bin" + "${Qt5_DIR}/../../../libexec/qt5/bin" ++ "${Qt5_DIR}/../../../tools/qt5/bin" + DOC "Path to xmlpatterns") + mark_as_advanced(qt_xmlpatterns_executable) + +diff --git a/CMake/ParaViewOptions.cmake b/CMake/ParaViewOptions.cmake +index 5e402e9fc..ccb553e8f 100644 +--- a/CMake/ParaViewOptions.cmake ++++ b/CMake/ParaViewOptions.cmake +@@ -88,7 +88,7 @@ endif() + #======================================================================== + + # XXX(VTK): External VTK is not yet actually supported. +-if (FALSE) ++if (TRUE) + option(PARAVIEW_USE_EXTERNAL_VTK "Use an external VTK." OFF) + mark_as_advanced(PARAVIEW_USE_EXTERNAL_VTK) + else () +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d7e8f1dfe..8b0e7a8c6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -73,7 +73,9 @@ if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) + endif () + + set(paraview_cmake_dir "${CMAKE_CURRENT_SOURCE_DIR}/CMake") +-set(vtk_cmake_dir "${CMAKE_CURRENT_SOURCE_DIR}/VTK/CMake") ++set(vtk_cmake_dir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/vtk") ++string(REPLACE "/debug" "" vtk_cmake_dir "${vtk_cmake_dir}") ++message(STATUS "vtk_cmake_dir:${vtk_cmake_dir}") + list(APPEND CMAKE_MODULE_PATH + "${paraview_cmake_dir}" + "${vtk_cmake_dir}") +@@ -214,6 +216,7 @@ if (NOT WIN32) + endif () + endif () + ++message(STATUS "PARAVIEW_USE_EXTERNAL_VTK:${PARAVIEW_USE_EXTERNAL_VTK}") + if (PARAVIEW_USE_EXTERNAL_VTK) + find_package(VTK REQUIRED) + else () +@@ -369,9 +372,73 @@ endif () + + if (PARAVIEW_USE_EXTERNAL_VTK) + if (paraview_required_modules OR paraview_unrecognized_modules) +- message(FATAL_ERROR +- "The following modules were requested or required, but not found: " +- "${paraview_required_modules};${paraview_unrecognized_modules}.") ++ message(STATUS "REQUIRED:${paraview_required_modules}") ++ foreach(mod ${paraview_required_modules}) ++ if(NOT TARGET ${mod}) ++ message(STATUS "REQUIRED TARGET not defined: ${mod}") ++ list(APPEND modules_notarget ${mod}) ++ endif() ++ if(${mod} MATCHES "VTK::") # For better debugging ++ message(STATUS "VTK TARGET found: ${mod}") ++ list(APPEND vtk_modules ${mod}) ++ endif() ++ endforeach() ++ foreach(mod ${paraview_unrecognized_modules}) ++ if(NOT TARGET ${mod}) ++ message(STATUS "UNREC TARGET not defined: ${mod}") ++ list(FIND paraview_rejected_modules ${mod} _found_mod) ++ if(_found_mod GREATER_EQUAL 0) ++ message(STATUS "MODULE ${mod} not necessary; Removing from unrecognized") ++ list(APPEND _to_remove ${mod}) ++ endif() ++ else() ++ list(APPEND _to_remove ${mod}) ++ #list(APPEND vtk_modules ${mod}) #probably do not need to add unrecognized_modules to the wrapper ++ endif() ++ endforeach() ++ message(STATUS "UNRECOGNIZED:${paraview_unrecognized_modules}") ++ list(REMOVE_ITEM paraview_unrecognized_modules ${_to_remove}) ++ message(STATUS "REJECTED MODULES: ${paraview_rejected_modules}") ++ message(STATUS "UNRECOGNIZED WITHOUT REJECTED AND KNOWN TARGETS: ${paraview_unrecognized_modules}") ++ message(STATUS "ALL PROVIDED MODULES: ${paraview_modules}") ++ set(_unnecessary_moduls ${paraview_modules}) ++ list(REMOVE_ITEM _unnecessary_moduls ${paraview_required_modules}) ++ message(STATUS "Unnecessary MODULES: ${_unnecessary_moduls}") ++ if(modules_notarget) ++ message(FATAL_ERROR ++ "The following modules were requested or required, but not found: " ++ "${modules_notarget}") ++ endif() ++ list(REMOVE_DUPLICATES vtk_modules) ++ macro(search_dependent_targets) ++ set(vtk_mod_dep_list) ++ foreach(vtk_targ ${ARGN}) ++ get_target_property(vtk_mod_dep ${vtk_targ} "INTERFACE_vtk_module_depends") ++ if(vtk_mod_dep) ++ list(APPEND vtk_mod_dep_list ${vtk_mod_dep}) ++ endif() ++ get_target_property(vtk_mod_pdep ${vtk_targ} "INTERFACE_vtk_module_private_depends") ++ if(vtk_mod_pdep) ++ list(APPEND vtk_mod_dep_list ${vtk_mod_pdep}) ++ endif() ++ get_target_property(vtk_mod_odep ${vtk_targ} "INTERFACE_vtk_module_opional_depends") ++ if(vtk_mod_odep) ++ list(APPEND vtk_mod_dep_list ${vtk_mod_odep}) ++ endif() ++ if(vtk_mod_dep_list) ++ message(STATUS "Target ${vtk_targ} depends on ${vtk_mod_dep_list}") ++ list(REMOVE_ITEM vtk_mod_dep_list ${vtk_modules}) ++ if(vtk_mod_dep_list) ++ message(STATUS "Newly discovered modules: ${vtk_mod_dep_list}") ++ list(APPEND vtk_modules ${vtk_mod_dep_list}) ++ search_dependent_targets(${vtk_mod_dep_list}) ++ else() ++ message(STATUS "No new modules discovered!") ++ endif() ++ endif() ++ endforeach() ++ endmacro() ++ search_dependent_targets(${vtk_modules}) + endif () + + if (PARAVIEW_USE_PYTHON) +@@ -498,7 +565,7 @@ else () + TEST_INPUT_DATA_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/VTK/Testing" + TEST_OUTPUT_DATA_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ExternalData/VTK/Testing") + +- if (NOT PARAVIEW_USE_EXTERNAL_VTK AND PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++ if (PARAVIEW_INSTALL_DEVELOPMENT_FILES) + set(vtk_cmake_dir + "${CMAKE_CURRENT_SOURCE_DIR}/VTK/CMake") + set(vtk_cmake_destination +@@ -543,9 +610,11 @@ vtk_module_build( + TEST_OUTPUT_DATA_DIRECTORY "${paraview_test_data_directory_output}") + + include(vtkModuleJson) +-vtk_module_json( +- MODULES "${vtk_modules}" +- OUTPUT "vtk-modules.json") ++if(NOT PARAVIEW_USE_EXTERNAL_VTK) ++ vtk_module_json( ++ MODULES "${vtk_modules}" ++ OUTPUT "vtk-modules.json") ++endif() + vtk_module_json( + MODULES "${paraview_modules}" + OUTPUT "paraview-modules.json") +diff --git a/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkAnalyzeReader.cxx b/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkAnalyzeReader.cxx +index be318d6d4..80187dd69 100644 +--- a/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkAnalyzeReader.cxx ++++ b/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkAnalyzeReader.cxx +@@ -1381,8 +1381,8 @@ int vtkAnalyzeReader::CanReadFile(const char* fname) + return false; + } + +- ifstream local_InputStream; +- local_InputStream.open(HeaderFileName.c_str(), ios::in | ios::binary); ++ std::ifstream local_InputStream; ++ local_InputStream.open(HeaderFileName.c_str(), std::ios::in | std::ios::binary); + if (local_InputStream.fail()) + { + return false; +diff --git a/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkNIfTIReader.cxx b/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkNIfTIReader.cxx +index e7df3dacc..1bae5ae22 100644 +--- a/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkNIfTIReader.cxx ++++ b/Plugins/AnalyzeNIfTIReaderWriter/NIfTIIO/vtkNIfTIReader.cxx +@@ -1277,8 +1277,8 @@ int vtkNIfTIReader::CanReadFile(const char* fname) + return false; + } + +- ifstream local_InputStream; +- local_InputStream.open(HeaderFileName.c_str(), ios::in | ios::binary); ++ std::ifstream local_InputStream; ++ local_InputStream.open(HeaderFileName.c_str(), std::ios::in | std::ios::binary); + if (local_InputStream.fail()) + { + return false; +diff --git a/Qt/Components/pqCustomFilterManager.cxx b/Qt/Components/pqCustomFilterManager.cxx +index 4c6911ac8..b04828168 100644 +--- a/Qt/Components/pqCustomFilterManager.cxx ++++ b/Qt/Components/pqCustomFilterManager.cxx +@@ -214,7 +214,7 @@ void pqCustomFilterManager::exportSelected(const QStringList& files) + QStringList::ConstIterator jter = files.begin(); + for (; jter != files.end(); ++jter) + { +- ofstream os((*jter).toLocal8Bit().data(), ios::out); ++ std::ofstream os((*jter).toLocal8Bit().data(), std::ios::out); + root->PrintXML(os, vtkIndent()); + } + +diff --git a/Qt/Components/pqPresetDialog.cxx b/Qt/Components/pqPresetDialog.cxx +index 411480e3e..af0195763 100644 +--- a/Qt/Components/pqPresetDialog.cxx ++++ b/Qt/Components/pqPresetDialog.cxx +@@ -952,7 +952,7 @@ void pqPresetDialog::exportPresets() + } + assert(presetCollection.size() > 0); + +- ofstream outfs; ++ std::ofstream outfs; + outfs.open(filename.toStdString().c_str()); + if (!outfs.is_open()) + { +diff --git a/Qt/Core/pqCoreTestUtility.cxx b/Qt/Core/pqCoreTestUtility.cxx +index 95c7df5b6..00f61e2f8 100644 +--- a/Qt/Core/pqCoreTestUtility.cxx ++++ b/Qt/Core/pqCoreTestUtility.cxx +@@ -45,7 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "QtTestingConfigure.h" + + #include "QVTKOpenGLNativeWidget.h" +-#include "QVTKOpenGLWidget.h" ++#include "QVTKOpenGLStereoWidget.h" + #include "pqApplicationCore.h" + #include "pqCollaborationEventPlayer.h" + #include "pqColorButtonEventPlayer.h" +@@ -309,13 +309,13 @@ bool pqCoreTestUtility::CompareImage(QWidget* widget, const QString& referenceIm + } + + // try to recover the render window directly +- QVTKOpenGLWidget* glWidget = qobject_cast(widget); ++ QVTKOpenGLStereoWidget* glWidget = qobject_cast(widget); + if (glWidget) + { + vtkRenderWindow* rw = glWidget->renderWindow(); + if (rw) + { +- cout << "Using QVTKOpenGLWidget RenderWindow API for capture" << endl; ++ cout << "Using QVTKOpenGLStereoWidget RenderWindow API for capture" << endl; + return pqCoreTestUtility::CompareImage( + rw, referenceImage, threshold, std::cerr, tempDirectory, size); + } +diff --git a/Qt/Core/pqQVTKWidgetBase.h b/Qt/Core/pqQVTKWidgetBase.h +index 5f11871de..c6b7dbcbb 100644 +--- a/Qt/Core/pqQVTKWidgetBase.h ++++ b/Qt/Core/pqQVTKWidgetBase.h +@@ -43,8 +43,8 @@ using pqQVTKWidgetBase = QVTKOpenGLNativeWidget; + #define PARAVIEW_USING_QVTKOPENGLNATIVEWIDGET 1 + #define PARAVIEW_USING_QVTKOPENGLWIDGET 0 + #else +-#include "QVTKOpenGLWidget.h" +-using pqQVTKWidgetBase = QVTKOpenGLWidget; ++#include "QVTKOpenGLStereoWidget.h" ++using pqQVTKWidgetBase = QVTKOpenGLStereoWidget; + #define PARAVIEW_USING_QVTKOPENGLNATIVEWIDGET 0 + #define PARAVIEW_USING_QVTKOPENGLWIDGET 1 + #endif +diff --git a/Qt/Core/pqQVTKWidgetEventPlayer.cxx b/Qt/Core/pqQVTKWidgetEventPlayer.cxx +index 105796d8a..63c0bde5f 100644 +--- a/Qt/Core/pqQVTKWidgetEventPlayer.cxx ++++ b/Qt/Core/pqQVTKWidgetEventPlayer.cxx +@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + + #include "QVTKOpenGLNativeWidget.h" +-#include "QVTKOpenGLWidget.h" ++#include "QVTKOpenGLStereoWidget.h" + #include "QVTKOpenGLWindow.h" + #include "pqEventDispatcher.h" + +@@ -49,7 +49,7 @@ pqQVTKWidgetEventPlayer::pqQVTKWidgetEventPlayer(QObject* p) + bool pqQVTKWidgetEventPlayer::playEvent( + QObject* Object, const QString& Command, const QString& Arguments, bool& Error) + { +- QVTKOpenGLWidget* qvtkWidget = qobject_cast(Object); ++ QVTKOpenGLStereoWidget* qvtkWidget = qobject_cast(Object); + QVTKOpenGLNativeWidget* qvtkNativeWidget = qobject_cast(Object); + if (qvtkWidget || qvtkNativeWidget) + { +@@ -92,7 +92,7 @@ bool pqQVTKWidgetEventPlayer::playEvent( + + if (qvtkWidget != nullptr) + { +- // Due to QTBUG-61836 (see QVTKOpenGLWidget::testingEvent()), events should ++ // Due to QTBUG-61836 (see QVTKOpenGLStereoWidget::testingEvent()), events should + // be propagated back to the internal QVTKOpenGLWindow when being fired + // explicitly on the widget instance. We have to use a custom event + // callback in this case to ensure that events are passed to the window. +diff --git a/Qt/Core/pqQVTKWidgetEventTranslator.cxx b/Qt/Core/pqQVTKWidgetEventTranslator.cxx +index f79d5c4e5..77950a0d1 100644 +--- a/Qt/Core/pqQVTKWidgetEventTranslator.cxx ++++ b/Qt/Core/pqQVTKWidgetEventTranslator.cxx +@@ -44,7 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + + #include "QVTKOpenGLNativeWidget.h" +-#include "QVTKOpenGLWidget.h" ++#include "QVTKOpenGLStereoWidget.h" + #include "QVTKOpenGLWindow.h" + + pqQVTKWidgetEventTranslator::pqQVTKWidgetEventTranslator(QObject* p) +@@ -70,7 +70,7 @@ bool pqQVTKWidgetEventTranslator::translateEvent( + // Look for a render window in the possible widget types. + vtkRenderWindow* rw = nullptr; + +- if (QVTKOpenGLWidget* const qvtkWidget = qobject_cast(Object)) ++ if (QVTKOpenGLStereoWidget* const qvtkWidget = qobject_cast(Object)) + { + rw = qvtkWidget->embeddedOpenGLWindow() ? qvtkWidget->renderWindow() : nullptr; + } +diff --git a/Remoting/ClientServerStream/vtkClientServerInterpreter.cxx b/Remoting/ClientServerStream/vtkClientServerInterpreter.cxx +index 487b5ad60..c6c24d81d 100644 +--- a/Remoting/ClientServerStream/vtkClientServerInterpreter.cxx ++++ b/Remoting/ClientServerStream/vtkClientServerInterpreter.cxx +@@ -184,7 +184,7 @@ void vtkClientServerInterpreter::SetLogFile(const char* name) + // If a non-empty name was given, open a new log file. + if (name && name[0]) + { +- this->LogFileStream = new ofstream(name); ++ this->LogFileStream = new std::ofstream(name); + if (this->LogFileStream && *this->LogFileStream) + { + this->LogStream = this->LogFileStream; +diff --git a/Remoting/ClientServerStream/vtkClientServerInterpreter.h b/Remoting/ClientServerStream/vtkClientServerInterpreter.h +index 1eafb27f3..1371ef727 100644 +--- a/Remoting/ClientServerStream/vtkClientServerInterpreter.h ++++ b/Remoting/ClientServerStream/vtkClientServerInterpreter.h +@@ -195,8 +195,8 @@ protected: + ~vtkClientServerInterpreter() override; + + // A stream to which a log is written. +- ostream* LogStream; +- ofstream* LogFileStream; ++ std::ostream* LogStream; ++ std::ofstream* LogFileStream; + + // Internal message processing functions. + int ProcessCommandNew(const vtkClientServerStream& css, int midx); +diff --git a/Remoting/Core/vtkPVPluginLoader.cxx b/Remoting/Core/vtkPVPluginLoader.cxx +index 5b04b2f00..447d9d63a 100644 +--- a/Remoting/Core/vtkPVPluginLoader.cxx ++++ b/Remoting/Core/vtkPVPluginLoader.cxx +@@ -73,12 +73,12 @@ public: + vtkPVXMLOnlyPlugin* instance = new vtkPVXMLOnlyPlugin(); + instance->PluginName = vtksys::SystemTools::GetFilenameWithoutExtension(xmlfile); + +- ifstream is; +- is.open(xmlfile, ios::binary); ++ std::ifstream is; ++ is.open(xmlfile, std::ios::binary); + // get length of file: +- is.seekg(0, ios::end); ++ is.seekg(0, std::ios::end); + size_t length = is.tellg(); +- is.seekg(0, ios::beg); ++ is.seekg(0, std::ios::beg); + + // allocate memory: + char* buffer = new char[length + 1]; +diff --git a/Remoting/ServerManager/vtkPVSessionCore.cxx b/Remoting/ServerManager/vtkPVSessionCore.cxx +index 8d36fad37..6ff043967 100644 +--- a/Remoting/ServerManager/vtkPVSessionCore.cxx ++++ b/Remoting/ServerManager/vtkPVSessionCore.cxx +@@ -293,7 +293,7 @@ vtkPVSessionCore::vtkPVSessionCore() + { + filename << this->ParallelController->GetLocalProcessId(); + } +- this->LogStream = new ofstream(filename.str().c_str()); ++ this->LogStream = new std::ofstream(filename.str().c_str()); + LOG("Log for " << options->GetArgv0() << " (" << this->ParallelController->GetLocalProcessId() + << ")"); + } +diff --git a/Remoting/ServerManager/vtkSMSessionProxyManager.cxx b/Remoting/ServerManager/vtkSMSessionProxyManager.cxx +index 8525457e5..05bdfd723 100644 +--- a/Remoting/ServerManager/vtkSMSessionProxyManager.cxx ++++ b/Remoting/ServerManager/vtkSMSessionProxyManager.cxx +@@ -1261,7 +1261,7 @@ void vtkSMSessionProxyManager::LoadXMLState( + bool vtkSMSessionProxyManager::SaveXMLState(const char* filename) + { + vtkPVXMLElement* rootElement = this->SaveXMLState(); +- ofstream os(filename, ios::out); ++ std::ofstream os(filename, std::ios::out); + if (!os.is_open()) + { + return false; +diff --git a/Remoting/Views/vtkPVRenderView.cxx b/Remoting/Views/vtkPVRenderView.cxx +index de9c50ab3..d7f739192 100644 +--- a/Remoting/Views/vtkPVRenderView.cxx ++++ b/Remoting/Views/vtkPVRenderView.cxx +@@ -2514,11 +2514,11 @@ void vtkPVRenderView::UpdateSkybox() + this->CubeMap->SetInputTexture(vtkOpenGLTexture::SafeDownCast(texture)); + this->CubeMap->InterpolateOn(); + this->GetRenderer()->AddActor(this->Skybox); +- this->GetRenderer()->SetEnvironmentCubeMap(this->CubeMap, true); ++ this->GetRenderer()->SetEnvironmentTexture(this->CubeMap, true); + } + else + { +- this->GetRenderer()->SetEnvironmentCubeMap(nullptr); ++ this->GetRenderer()->SetEnvironmentTexture(nullptr); + } + } + +diff --git a/Remoting/Views/vtkSMTransferFunctionPresets.cxx b/Remoting/Views/vtkSMTransferFunctionPresets.cxx +index 1151ce58f..21e5a28b7 100644 +--- a/Remoting/Views/vtkSMTransferFunctionPresets.cxx ++++ b/Remoting/Views/vtkSMTransferFunctionPresets.cxx +@@ -142,7 +142,7 @@ public: + Json::CharReaderBuilder builder; + builder["collectComments"] = false; + Json::Value root; +- ifstream file; ++ std::ifstream file; + file.open(filename); + if (!file) + { +@@ -456,7 +456,7 @@ bool vtkSMTransferFunctionPresets::ImportPresets(const char* filename) + if (vtksys::SystemTools::LowerCase(vtksys::SystemTools::GetFilenameLastExtension(filename)) == + ".xml") + { +- ifstream in(filename); ++ std::ifstream in(filename); + if (in) + { + std::ostringstream contents; +diff --git a/Remoting/Views/vtkSMTransferFunctionProxy.cxx b/Remoting/Views/vtkSMTransferFunctionProxy.cxx +index efa8e9341..2023ca41b 100644 +--- a/Remoting/Views/vtkSMTransferFunctionProxy.cxx ++++ b/Remoting/Views/vtkSMTransferFunctionProxy.cxx +@@ -273,7 +273,7 @@ bool vtkSMTransferFunctionProxy::ExportTransferFunction( + + exportCollection.append(transferFunction); + +- ofstream outfs; ++ std::ofstream outfs; + outfs.open(filename); + if (!outfs.is_open()) + { +@@ -1370,7 +1370,7 @@ bool vtkSMTransferFunctionProxy::ConvertLegacyColorMapsToJSON( + return false; + } + +- ofstream file; ++ std::ofstream file; + file.open(outjsonfile); + if (file) + { +diff --git a/ThirdParty/protobuf/CMakeLists.txt b/ThirdParty/protobuf/CMakeLists.txt +index 0502ca2d9..25b2e778f 100644 +--- a/ThirdParty/protobuf/CMakeLists.txt ++++ b/ThirdParty/protobuf/CMakeLists.txt +@@ -42,7 +42,8 @@ vtk_module_third_party( + PACKAGE Protobuf + VERSION "3.4" + TARGETS protobuf::libprotobuf +- STANDARD_INCLUDE_DIRS) ++ STANDARD_INCLUDE_DIRS ++ CONFIG_MODE) + + if (VTK_MODULE_USE_EXTERNAL_ParaView_protobuf) + # promote protobuf::protoc to GLOBAL to allow to call protobuf_generate from other directories +diff --git a/VTKExtensions/CGNSReader/vtkFileSeriesHelper.cxx b/VTKExtensions/CGNSReader/vtkFileSeriesHelper.cxx +index 66a7d6972..9d314b8ce 100644 +--- a/VTKExtensions/CGNSReader/vtkFileSeriesHelper.cxx ++++ b/VTKExtensions/CGNSReader/vtkFileSeriesHelper.cxx +@@ -211,7 +211,7 @@ bool vtkFileSeriesHelper::ReadMetaFile(const char* metafilename) + } + + // Open the metafile. +- ifstream metafile(metafilename); ++ std::ifstream metafile(metafilename); + if (metafile.bad()) + { + // vtkErrorMacro("Failed to open meta-file: " << metafilename); +diff --git a/VTKExtensions/IOCore/vtkCSVWriter.cxx b/VTKExtensions/IOCore/vtkCSVWriter.cxx +index 11f777c1a..a1773600c 100644 +--- a/VTKExtensions/IOCore/vtkCSVWriter.cxx ++++ b/VTKExtensions/IOCore/vtkCSVWriter.cxx +@@ -97,7 +97,7 @@ namespace + //----------------------------------------------------------------------------- + template + void vtkCSVWriterGetDataString( +- iterT* iter, vtkIdType tupleIndex, ofstream& stream, vtkCSVWriter* writer, bool* first) ++ iterT* iter, vtkIdType tupleIndex, std::ofstream& stream, vtkCSVWriter* writer, bool* first) + { + int numComps = iter->GetNumberOfComponents(); + vtkIdType index = tupleIndex * numComps; +@@ -118,7 +118,7 @@ void vtkCSVWriterGetDataString( + //----------------------------------------------------------------------------- + template <> + void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vtkIdType tupleIndex, +- ofstream& stream, vtkCSVWriter* writer, bool* first) ++ std::ofstream& stream, vtkCSVWriter* writer, bool* first) + { + int numComps = iter->GetNumberOfComponents(); + vtkIdType index = tupleIndex * numComps; +@@ -139,7 +139,7 @@ void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vtk + //----------------------------------------------------------------------------- + template <> + void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vtkIdType tupleIndex, +- ofstream& stream, vtkCSVWriter* writer, bool* first) ++ std::ofstream& stream, vtkCSVWriter* writer, bool* first) + { + int numComps = iter->GetNumberOfComponents(); + vtkIdType index = tupleIndex * numComps; +@@ -160,7 +160,7 @@ void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vtkIdType t + //----------------------------------------------------------------------------- + template <> + void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vtkIdType tupleIndex, +- ofstream& stream, vtkCSVWriter* writer, bool* first) ++ std::ofstream& stream, vtkCSVWriter* writer, bool* first) + { + int numComps = iter->GetNumberOfComponents(); + vtkIdType index = tupleIndex * numComps; +@@ -190,7 +190,7 @@ void vtkCSVWriterGetDataString(vtkArrayIteratorTemplate* iter, vt + + class vtkCSVWriter::CSVFile + { +- ofstream Stream; ++ std::ofstream Stream; + std::vector > ColumnInfo; + double Time = vtkMath::Nan(); + +diff --git a/VTKExtensions/IOCore/vtkFileSeriesReader.cxx b/VTKExtensions/IOCore/vtkFileSeriesReader.cxx +index f2448f2b8..7d84bc1ab 100644 +--- a/VTKExtensions/IOCore/vtkFileSeriesReader.cxx ++++ b/VTKExtensions/IOCore/vtkFileSeriesReader.cxx +@@ -783,7 +783,7 @@ int vtkFileSeriesReader::ReadMetaDataFile(const char* metafilename, vtkStringArr + std::vector& timeValues, int maxFilesToRead /*= VTK_INT_MAX*/) + { + // Open the metafile. +- ifstream metafile(metafilename); ++ std::ifstream metafile(metafilename); + if (metafile.bad()) + { + return 0; +diff --git a/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.cxx b/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.cxx +index 8370e21e3..ff90a0421 100644 +--- a/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.cxx ++++ b/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.cxx +@@ -50,7 +50,6 @@ vtkPEnSightGoldBinaryReader::~vtkPEnSightGoldBinaryReader() + { + if (this->IFile) + { +- this->IFile->close(); + delete this->IFile; + this->IFile = NULL; + } +@@ -72,7 +71,6 @@ int vtkPEnSightGoldBinaryReader::OpenFile(const char* filename) + // Close file from any previous image + if (this->IFile) + { +- this->IFile->close(); + delete this->IFile; + this->IFile = NULL; + } +@@ -86,9 +84,9 @@ int vtkPEnSightGoldBinaryReader::OpenFile(const char* filename) + this->FileSize = (long)(fs.st_size); + + #ifdef _WIN32 +- this->IFile = new ifstream(filename, ios::in | ios::binary); ++ this->IFile = new std::ifstream(filename, std::ios::in | std::ios::binary); + #else +- this->IFile = new ifstream(filename, ios::in); ++ this->IFile = new std::ifstream(filename, std::ios::in); + #endif + } + else +diff --git a/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.h b/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.h +index c5a5551d5..9c871e4a1 100644 +--- a/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.h ++++ b/VTKExtensions/IOEnSight/vtkPEnSightGoldBinaryReader.h +@@ -204,7 +204,7 @@ protected: + int ElementIdsListed; + int Fortran; + +- ifstream* IFile; ++ std::ifstream* IFile; + // The size of the file could be used to choose byte order. + long FileSize; + +diff --git a/VTKExtensions/IOEnSight/vtkPEnSightGoldReader.cxx b/VTKExtensions/IOEnSight/vtkPEnSightGoldReader.cxx +index b433bc57a..b5cdc2672 100644 +--- a/VTKExtensions/IOEnSight/vtkPEnSightGoldReader.cxx ++++ b/VTKExtensions/IOEnSight/vtkPEnSightGoldReader.cxx +@@ -91,7 +91,7 @@ int vtkPEnSightGoldReader::ReadGeometryFile( + + // Opening the text file as binary. If not, the reader fails to read + // files with Unix line endings on Windows machines. +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -291,7 +291,7 @@ int vtkPEnSightGoldReader::ReadMeasuredGeometryFile( + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -455,7 +455,7 @@ int vtkPEnSightGoldReader::ReadScalarsPerNode(const char* fileName, const char* + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -675,7 +675,7 @@ int vtkPEnSightGoldReader::ReadVectorsPerNode(const char* fileName, const char* + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -854,7 +854,7 @@ int vtkPEnSightGoldReader::ReadTensorsPerNode(const char* fileName, const char* + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -980,7 +980,7 @@ int vtkPEnSightGoldReader::ReadScalarsPerElement(const char* fileName, const cha + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -1187,7 +1187,7 @@ int vtkPEnSightGoldReader::ReadVectorsPerElement(const char* fileName, const cha + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | std::ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +@@ -1356,7 +1356,7 @@ int vtkPEnSightGoldReader::ReadTensorsPerElement(const char* fileName, const cha + sfilename = fileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in | ios::binary); ++ this->IS = new std::ifstream(sfilename.c_str(), std::ios::in | ios::binary); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +diff --git a/VTKExtensions/IOEnSight/vtkPEnSightReader.cxx b/VTKExtensions/IOEnSight/vtkPEnSightReader.cxx +index 4f4840f5c..dd515e5ca 100644 +--- a/VTKExtensions/IOEnSight/vtkPEnSightReader.cxx ++++ b/VTKExtensions/IOEnSight/vtkPEnSightReader.cxx +@@ -1319,7 +1319,7 @@ int vtkPEnSightReader::ReadCaseFile() + sfilename = this->CaseFileName; + } + +- this->IS = new ifstream(sfilename.c_str(), ios::in); ++ this->IS = new std::ifstream(sfilename.c_str(), ios::in); + if (this->IS->fail()) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +diff --git a/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader.cxx b/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader.cxx +index 5768eb32f..8bbc582ae 100644 +--- a/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader.cxx ++++ b/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader.cxx +@@ -429,7 +429,7 @@ int vtkPVEnSightMasterServerReader::ParseMasterServerFile() + } + + // Open the file for reading. +- ifstream fin(sfilename.c_str(), ios::in); ++ std::ifstream fin(sfilename.c_str(), std::ios::in); + if (!fin) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +diff --git a/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader2.cxx b/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader2.cxx +index e7701d458..a358b9df0 100644 +--- a/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader2.cxx ++++ b/VTKExtensions/IOEnSight/vtkPVEnSightMasterServerReader2.cxx +@@ -512,7 +512,7 @@ int vtkPVEnSightMasterServerReader2::ParseMasterServerFile() + } + + // Open the file for reading. +- ifstream fin(sfilename.c_str(), ios::in); ++ std::ifstream fin(sfilename.c_str(), std::ios::in); + if (!fin) + { + vtkErrorMacro("Unable to open file: " << sfilename.c_str()); +diff --git a/VTKExtensions/IOSPCTH/vtkSpyPlotReader.cxx b/VTKExtensions/IOSPCTH/vtkSpyPlotReader.cxx +index 1af09a68e..4aba88655 100644 +--- a/VTKExtensions/IOSPCTH/vtkSpyPlotReader.cxx ++++ b/VTKExtensions/IOSPCTH/vtkSpyPlotReader.cxx +@@ -1289,7 +1289,7 @@ int vtkSpyPlotReader::MergeVectors(vtkDataSetAttributes* da, vtkDataArray* a1, v + //----------------------------------------------------------------------------- + int vtkSpyPlotReader::CanReadFile(const char* fname) + { +- ifstream ifs(fname, ios::binary | ios::in); ++ std::ifstream ifs(fname, std::ios::binary | std::ios::in); + if (!ifs) + { + return 0; +diff --git a/VTKExtensions/IOSPCTH/vtkSpyPlotReaderMap.cxx b/VTKExtensions/IOSPCTH/vtkSpyPlotReaderMap.cxx +index c7e1bac87..157768255 100644 +--- a/VTKExtensions/IOSPCTH/vtkSpyPlotReaderMap.cxx ++++ b/VTKExtensions/IOSPCTH/vtkSpyPlotReaderMap.cxx +@@ -83,7 +83,7 @@ bool vtkSpyPlotReaderMap::Initialize(const char* filename) + { + this->Clean(NULL); + +- ifstream ifs(filename); ++ std::ifstream ifs(filename); + if (!ifs) + { + vtkGenericWarningMacro("Error opening file " << filename); +@@ -238,7 +238,7 @@ bool vtkSpyPlotReaderMap::InitializeFromSpyFile(const char* filename) + bool vtkSpyPlotReaderMap::InitializeFromCaseFile(const char* filename) + { + // Setup the filemap and spcth structures +- ifstream ifs(filename); ++ std::ifstream ifs(filename); + if (!ifs) + { + vtkGenericWarningMacro("Error opening file " << filename); +diff --git a/VTKExtensions/IOSPCTH/vtkSpyPlotUniReader.cxx b/VTKExtensions/IOSPCTH/vtkSpyPlotUniReader.cxx +index 7dfe451c9..f4ea91928 100644 +--- a/VTKExtensions/IOSPCTH/vtkSpyPlotUniReader.cxx ++++ b/VTKExtensions/IOSPCTH/vtkSpyPlotUniReader.cxx +@@ -212,7 +212,7 @@ int vtkSpyPlotUniReader::MakeCurrent() + } + + std::vector arrayBuffer; +- ifstream ifs(this->FileName, ios::binary | ios::in); ++ std::ifstream ifs(this->FileName, std::ios::binary | std::ios::in); + vtkSpyPlotIStream spis; + spis.SetStream(&ifs); + int dump; +@@ -1358,7 +1358,7 @@ int vtkSpyPlotUniReader::ReadInformation() + vtkErrorMacro("FileName not specified"); + return 0; + } +- ifstream ifs(this->FileName, ios::binary | ios::in); ++ std::ifstream ifs(this->FileName, std::ios::binary | std::ios::in); + if (!ifs) + { + vtkErrorMacro("Cannot open file: " << this->FileName); diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake new file mode 100644 index 00000000000000..ab64ef34af2c8f --- /dev/null +++ b/ports/paraview/portfile.cmake @@ -0,0 +1,172 @@ +set(VERSION 5.8) + +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 + "mpi" PARAVIEW_USE_MPI #untested + "vtkm" PARAVIEW_USE_VTKM + "python" PARAVIEW_USE_PYTHON + "tools" PARAVIEW_BUILD_TOOLS +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Kitware/ParaView + REF 56631fdd9a31f4acdfe5fce2c3be3c4fb6e6800f # v5.8.0 + SHA512 1cdf4065428debc301c98422233524cdafc843495c54569b0854bf53f6ffeba1e83acf60497450779d493e56051557cd377902325d6ece89ad1b98ae6ba831be + HEAD_REF master + PATCHES + paraview_build.patch + remove_duplicates.patch # Missed something in the above patch + cgns.patch + python_include.patch + python_wrapper.patch + add-tools-option.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND VisItPatches removedoublesymbols.patch) +endif() + +#The following two dependencies should probably be their own port +#but require additional patching in paraview to make it work. + +#Get VisItBridge Plugin +vcpkg_from_gitlab( + OUT_SOURCE_PATH VISITIT_SOURCE_PATH + GITLAB_URL https://gitlab.kitware.com/ + REPO paraview/visitbridge + REF c2605b5c3115bc4869c76a0d8bfdd8939b59f283 + SHA512 6d2c1d6e1cd345547926938451755e7a8be5dabd89e18a2ceb419db16c5b29f354554a5130eb365b7e522d655370fd4766953813ff530c06e4851fe26104ce58 + PATCHES + VisIt_Build.patch + #removeunusedsymbols.patch # These also get remove in master of ParaView + ${VisItPatches} +) +#Get QtTesting Plugin +vcpkg_from_gitlab( + OUT_SOURCE_PATH QTTESTING_SOURCE_PATH + GITLAB_URL https://gitlab.kitware.com/ + REPO paraview/qttesting + REF f2429588feb839e0d8f9f3ee73bfa8a032a3f178 + SHA512 752b13ff79095a14faa2edc134a64497ff0426da3aa6b1a5951624816fb4f113a26fbe559cedf495ebb775d782c9a1851421a88dd299a79f27cbebb730ea227e +) + +file(COPY ${VISITIT_SOURCE_PATH}/ DESTINATION ${SOURCE_PATH}/Utilities/VisItBridge) +file(COPY ${QTTESTING_SOURCE_PATH}/ DESTINATION ${SOURCE_PATH}/ThirdParty/QtTesting/vtkqttesting) + +if("python" IN_LIST FEATURES) + vcpkg_find_acquire_program(PYTHON3) + list(APPEND ADDITIONAL_OPTIONS + -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() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS ${FEATURE_OPTIONS} + -DPARAVIEW_BUILD_WITH_EXTERNAL:BOOL=ON + -DPARAVIEW_USE_EXTERNAL_VTK:BOOL=ON + -DPARAVIEW_ENABLE_VISITBRIDGE:BOOL=ON + -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) + # ParaView runs Qt tools so LD_LIBRARY_PATH must be set correctly for them to find *.so files + set(BACKUP_LD_LIBRARY_PATH $ENV{LD_LIBRARY_PATH}) + set(ENV{LD_LIBRARY_PATH} "${BACKUP_LD_LIBRARY_PATH}:${CURRENT_INSTALLED_DIR}/lib") +endif() + +vcpkg_install_cmake(ADD_BIN_TO_PATH) # Bin to path required since paraview will use some self build tools + +if(CMAKE_HOST_UNIX) + set(ENV{LD_LIBRARY_PATH} "${BACKUP_LD_LIBRARY_PATH}") +endif() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/paraview-${VERSION}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +set(TOOLVER pv${VERSION}) +set(TOOLS paraview + pvbatch + pvdataserver + pvpython + pvrenderserver + pvserver + smTestDriver + vtkProcessXML + vtkWrapClientServer) + +foreach(tool ${TOOLS}) + # Remove debug tools + set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(REMOVE ${filename}) + endif() + set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}-${TOOLVER}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(REMOVE ${filename}) + endif() + set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}-${TOOLVER}d${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(REMOVE ${filename}) + endif() + + # Move release tools + set(filename ${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(INSTALL ${filename} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(REMOVE ${filename}) + endif() + set(filename ${CURRENT_PACKAGES_DIR}/bin/${tool}-${TOOLVER}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(INSTALL ${filename} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(REMOVE ${filename}) + endif() +endforeach() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/paraview RENAME Copyright.txt) # Which one is the correct one? +file(INSTALL ${SOURCE_PATH}/License_v1.2.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/paraview RENAME copyright) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + macro(move_bin_to_lib name) + if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/${name}) + file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${name}" "${CURRENT_PACKAGES_DIR}/lib/${name}") + endif() + if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin/${name}) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/${name}" "${CURRENT_PACKAGES_DIR}/debug/lib/${name}") + endif() + endmacro() + + set(to_move Lib paraview-${VERSION} paraview-config) + foreach(name ${to_move}) + move_bin_to_lib(${name}) + endforeach() + + file(GLOB_RECURSE cmake_files ${CURRENT_PACKAGES_DIR}/share/${PORT}/*.cmake) + foreach(cmake_file ${cmake_files}) + file(READ "${cmake_file}" _contents) + STRING(REPLACE "bin/" "lib/" _contents "${_contents}") + file(WRITE "${cmake_file}" "${_contents}") + endforeach() + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() \ No newline at end of file diff --git a/ports/paraview/python_include.patch b/ports/paraview/python_include.patch new file mode 100644 index 00000000000000..42ada661bbc56b --- /dev/null +++ b/ports/paraview/python_include.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/ParaViewOptions.cmake b/CMake/ParaViewOptions.cmake +index 0ecb928e9..5b5459a37 100644 +--- a/CMake/ParaViewOptions.cmake ++++ b/CMake/ParaViewOptions.cmake +@@ -136,7 +136,7 @@ option(PARAVIEW_ENABLE_RAYTRACING "Build ParaView with OSPray and/or OptiX ray-t + + set(paraview_web_default ON) + if (PARAVIEW_USE_PYTHON AND WIN32) +- include("${CMAKE_CURRENT_SOURCE_DIR}/VTK/CMake/FindPythonModules.cmake") ++ include(FindPythonModules) + find_python_module(win32api have_pywin32) + set(paraview_web_default "${have_pywin32}") + endif () diff --git a/ports/paraview/python_wrapper.patch b/ports/paraview/python_wrapper.patch new file mode 100644 index 00000000000000..33a70f069acc51 --- /dev/null +++ b/ports/paraview/python_wrapper.patch @@ -0,0 +1,19 @@ +diff --git a/CMake/vtkModuleWrapClientServer.cmake b/CMake/vtkModuleWrapClientServer.cmake +index 3804a24e2..91fdd593a 100644 +--- a/CMake/vtkModuleWrapClientServer.cmake ++++ b/CMake/vtkModuleWrapClientServer.cmake +@@ -37,10 +37,13 @@ function (_vtk_module_wrap_client_server_sources module sources classes) + "$") + set(_vtk_client_server_genex_include_directories + "$") ++ set(_vtk_client_server_genex_interface_include_directories ++ "$") + file(GENERATE + OUTPUT "${_vtk_client_server_args_file}" + CONTENT "$<$:\n-D\'$\'>\n +-$<$:\n-I\'$\'>\n") ++ $<$:\n-I\'$\'>\n ++ $<$:\n-I\'$\'>\n") + + _vtk_module_get_module_property("${module}" + PROPERTY "hierarchy" diff --git a/ports/paraview/remove_duplicates.patch b/ports/paraview/remove_duplicates.patch new file mode 100644 index 00000000000000..4ea223e3f8bd07 --- /dev/null +++ b/ports/paraview/remove_duplicates.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b7101666c..ebac50016 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -592,6 +592,9 @@ set(_paraview_add_tests_default_data_directory + set(_paraview_add_tests_default_test_data_target + "ParaViewData") + ++list(REMOVE_DUPLICATES vtk_modules) # Missed this somewhere ++list(REMOVE_DUPLICATES paraview_modules) # probably not needed ++ + vtk_module_build( + MODULES ${paraview_modules} + KITS ${paraview_kits} diff --git a/ports/paraview/removedoublesymbols.patch b/ports/paraview/removedoublesymbols.patch new file mode 100644 index 00000000000000..70df9b0e8afaa3 --- /dev/null +++ b/ports/paraview/removedoublesymbols.patch @@ -0,0 +1,89 @@ +diff --git a/Library/VisItLib/visit_vtk/lightweight/vtkUnstructuredGridFacelistFilter.C b/Library/VisItLib/visit_vtk/lightweight/vtkUnstructuredGridFacelistFilter.C +index db64a0534..0d987d8e7 100644 +--- a/Library/VisItLib/visit_vtk/lightweight/vtkUnstructuredGridFacelistFilter.C ++++ b/Library/VisItLib/visit_vtk/lightweight/vtkUnstructuredGridFacelistFilter.C +@@ -69,7 +69,10 @@ + // + // Forward declare some of types used to hash faces. + // +-class Quad; ++namespace hidden { ++ class Quad; ++} ++using hidden::Quad; + class QuadMemoryManager; + class Tri; + class TriMemoryManager; +@@ -322,43 +325,43 @@ class HashEntryList + // Creation: October 21, 2002 + // + // **************************************************************************** ++namespace hidden { ++ class Quad ++ { ++ friend class Tri; + +-class Quad +-{ +- friend class Tri; +- +- public: +- Quad() { ordering_case = 255; }; +- +- vtkIdType AssignNodes(const vtkIdType *); +- bool Equals(Quad *); +- bool Equals(Tri *); +- void AddInRemainingTriangle(Tri *, int); +- inline void ReRegisterMemory(void) +- { +- hashEntryList->qmm.ReRegisterQuad(this); +- } ++ public: ++ Quad() { ordering_case = 255; }; + +- inline void SetOriginalZone(const int &oz) { orig_zone = oz; }; +- inline int GetOriginalZone(void) { return orig_zone; }; ++ vtkIdType AssignNodes(const vtkIdType *); ++ bool Equals(Quad *); ++ bool Equals(Tri *); ++ void AddInRemainingTriangle(Tri *, int); ++ inline void ReRegisterMemory(void) ++ { ++ hashEntryList->qmm.ReRegisterQuad(this); ++ } + +- void OutputCell(int,vtkPolyData *, vtkCellData *, vtkCellData *); ++ inline void SetOriginalZone(const int &oz) { orig_zone = oz; }; ++ inline int GetOriginalZone(void) { return orig_zone; }; + +- inline void RegisterHashEntryList(HashEntryList *hel) +- { hashEntryList = hel; }; +- inline void SetNumberOfPoints(int np) { npts = np; }; ++ void OutputCell(int,vtkPolyData *, vtkCellData *, vtkCellData *); + +- protected: +- unsigned char ordering_case; +- vtkIdType nodes[3]; +- vtkIdType orig_zone; ++ inline void RegisterHashEntryList(HashEntryList *hel) ++ { hashEntryList = hel; }; ++ inline void SetNumberOfPoints(int np) { npts = np; }; + +- HashEntryList *hashEntryList; +- int npts; ++ protected: ++ unsigned char ordering_case; ++ vtkIdType nodes[3]; ++ vtkIdType orig_zone; + +- void AddInRemainingTriangle(int, int); +-}; ++ HashEntryList *hashEntryList; ++ int npts; + ++ void AddInRemainingTriangle(int, int); ++ }; ++} + // + // We will be re-ordering the nodes into numerical order. This enumerated + // type will allow the ordering to be preserved. diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL index 1577832fd66730..06aa2ca5c996ad 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: 3 +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 2e9f532b169fd9..d21a0b8fd22175 100644 --- a/ports/pcl/CONTROL +++ b/ports/pcl/CONTROL @@ -1,5 +1,5 @@ Source: pcl -Version: 1.9.1-11 +Version: 1.9.1-13 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 diff --git a/ports/pcl/boost-1.73.patch b/ports/pcl/boost-1.73.patch new file mode 100644 index 00000000000000..d634d84bb298bf --- /dev/null +++ b/ports/pcl/boost-1.73.patch @@ -0,0 +1,50 @@ +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/fix-link-libpng.patch b/ports/pcl/fix-link-libpng.patch new file mode 100644 index 00000000000000..9d1e25a1788898 --- /dev/null +++ b/ports/pcl/fix-link-libpng.patch @@ -0,0 +1,20 @@ +diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt +index a17cb2d..b2a56b3 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} ) + + if(LIBUSB_1_FOUND) + target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES}) diff --git a/ports/pcl/portfile.cmake b/ports/pcl/portfile.cmake index cd358d41f28fd7..ef3cf959ede812 100644 --- a/ports/pcl/portfile.cmake +++ b/ports/pcl/portfile.cmake @@ -10,8 +10,10 @@ vcpkg_from_github( 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 + # Patch for https://github.com/microsoft/vcpkg/issues/7660 + use_target_link_libraries_in_pclconfig.patch + fix-link-libpng.patch + boost-1.73.patch ) file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindFLANN.cmake) @@ -44,7 +46,7 @@ vcpkg_configure_cmake( -DWITH_LIBUSB=OFF -DWITH_PNG=ON -DWITH_QHULL=ON - -DWITH_VTK=ON + -DWITH_VTK=OFF # disabled due to API changes in 9.0 # FEATURES ${FEATURE_OPTIONS} ) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index 58e40065ddb93c..cbd70b86927bb0 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,4 +1,5 @@ Source: pcre Version: 8.44 +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 546494087190e2..6175b0bbb1f43c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -1,21 +1,34 @@ set(PCRE_VERSION 8.44) +set(EXPECTED_SHA adddec1236b25ff1c90e73835c2ba25d60a5839cbde2d6be7838a8ec099f7443dede931dc39002943243e21afea572eda71ee8739058e72235a192e4324398f0) +set(PATCHES + # Fix CMake Deprecation Warning concerning OLD behavior for policy CMP0026 + # Suppress MSVC compiler warnings C4703, C4146, C4308, which fixes errors + # under x64-uwp and arm-uwp + pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch) vcpkg_download_distfile(ARCHIVE URLS "https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VERSION}.zip" - "https://downloads.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.zip" FILENAME "pcre-${PCRE_VERSION}.zip" - SHA512 adddec1236b25ff1c90e73835c2ba25d60a5839cbde2d6be7838a8ec099f7443dede931dc39002943243e21afea572eda71ee8739058e72235a192e4324398f0 + SHA512 ${EXPECTED_SHA} + SILENT_EXIT ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - # Fix CMake Deprecation Warning concerning OLD behavior for policy CMP0026 - # Suppress MSVC compiler warnings C4703, C4146, C4308, which fixes errors - # under x64-uwp and arm-uwp - pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch -) +if (EXISTS "${ARCHIVE}") + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES ${PATCHES} + ) +else() + vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO pcre/pcre + REF ${PCRE_VERSION} + FILENAME "pcre-${PCRE_VERSION}.zip" + SHA512 ${EXPECTED_SHA} + PATCHES ${PATCHES} + ) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -50,6 +63,57 @@ foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/incl file(WRITE ${FILE} "${PCRE_H}") endforeach() +# Create pkgconfig files +set(PACKAGE_VERSION ${PCRE_VERSION}) +set(prefix "${CURRENT_INSTALLED_DIR}") +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/lib") +set(includedir "\${prefix}/include") +if(VCPKG_TARGET_IS_LINUX) + # Used here in .pc.in files: Libs.private: @PTHREAD_CFLAGS@ + set(PTHREAD_CFLAGS "-pthread") +endif() +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) + + 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(SYSTEM_LIBRARIES pthread) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/pcre2/CONTROL b/ports/pcre2/CONTROL index 044bb81d36c138..75fd95488e4438 100644 --- a/ports/pcre2/CONTROL +++ b/ports/pcre2/CONTROL @@ -1,4 +1,5 @@ Source: pcre2 -Version: 10.30-7 +Version: 10.35 +Port-Version: 1 Homepage: https://pcre.org/ Description: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library diff --git a/ports/pcre2/fix-arm64-config.patch b/ports/pcre2/fix-arm64-config.patch deleted file mode 100644 index bba95718ae7726..00000000000000 --- a/ports/pcre2/fix-arm64-config.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/src/sljit/sljitConfigInternal.h b/src/sljit/sljitConfigInternal.h -index cc0810f..964afe8 100644 ---- a/src/sljit/sljitConfigInternal.h -+++ b/src/sljit/sljitConfigInternal.h -@@ -151,6 +151,8 @@ - #define SLJIT_CONFIG_X86_64 1 - #elif defined(_ARM_) - #define SLJIT_CONFIG_ARM_V5 1 -+#elif defined(_M_ARM64) -+#define SLJIT_CONFIG_ARM_64 1 - #else - #define SLJIT_CONFIG_X86_32 1 - #endif -@@ -324,9 +326,15 @@ - - #else - -+#if defined(__linux__) - /* Calls __ARM_NR_cacheflush on ARM-Linux. */ - #define SLJIT_CACHE_FLUSH(from, to) \ - __clear_cache((char*)(from), (char*)(to)) -+#elif(_WIN32) -+#pragma comment(lib, "kernel32.lib") -+#define SLJIT_CACHE_FLUSH(from, to) \ -+ FlushInstructionCache(GetCurrentProcess(), (void*)(from), (uintptr_t)(to - from)); -+#endif - - #endif - diff --git a/ports/pcre2/fix-space.patch b/ports/pcre2/fix-space.patch deleted file mode 100644 index 70f88021af9bad..00000000000000 --- a/ports/pcre2/fix-space.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fbc37fe..54e25f2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -91,7 +91,7 @@ CMAKE_POLICY(SET CMP0026 OLD) - - SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake - --SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src") -+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I\"${PROJECT_SOURCE_DIR}/src\"") - - # external packages - FIND_PACKAGE( BZip2 ) diff --git a/ports/pcre2/fix-uwp.patch b/ports/pcre2/fix-uwp.patch deleted file mode 100644 index 29aaf1a2b51c67..00000000000000 --- a/ports/pcre2/fix-uwp.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0e8a164..7e8150c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -506,6 +506,7 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H) - - IF(MSVC) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) -+ add_compile_options(/wd4146) - ENDIF(MSVC) - - SET(CMAKE_INCLUDE_CURRENT_DIR 1) -diff --git a/src/pcre2_match.c b/src/pcre2_match.c -index 050b7e9..49925a2 100644 ---- a/src/pcre2_match.c -+++ b/src/pcre2_match.c -@@ -566,7 +566,7 @@ match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, PCRE2_SIZE *ovector, - heapframe *F; /* Current frame pointer */ - heapframe *N = NULL; /* Temporary frame pointers */ - heapframe *P = NULL; --heapframe *assert_accept_frame; /* For passing back the frame with captures */ -+heapframe *assert_accept_frame = NULL; /* For passing back the frame with captures */ - PCRE2_SIZE frame_copy_size; /* Amount to copy when creating a new frame */ - - /* Local variables that do not need to be preserved over calls to RRMATCH(). */ diff --git a/ports/pcre2/pcre2-10.35_add_check_for_Intel_CET.patch b/ports/pcre2/pcre2-10.35_add_check_for_Intel_CET.patch new file mode 100644 index 00000000000000..81b91d028fcf89 --- /dev/null +++ b/ports/pcre2/pcre2-10.35_add_check_for_Intel_CET.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200 ++++ b/CMakeLists.txt 2020-07-09 19:33:12.725648600 +0200 +@@ -146,6 +146,23 @@ + ) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) + ++# Check whether Intel CET is enabled, and if so, adjust compiler flags. This ++# code was written by PH, trying to imitate the logic from the autotools ++# configuration. ++ ++CHECK_C_SOURCE_COMPILES( ++ "#ifndef __CET__ ++ #error CET is not enabled ++ #endif ++ int main() { return 0; }" ++ INTEL_CET_ENABLED ++) ++ ++IF (INTEL_CET_ENABLED) ++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk") ++ENDIF(INTEL_CET_ENABLED) ++ ++ + # User-configurable options + # + # Note: CMakeSetup displays these in alphabetical order, regardless of diff --git a/ports/pcre2/pcre2-10.35_fix-space.patch b/ports/pcre2/pcre2-10.35_fix-space.patch new file mode 100644 index 00000000000000..abcd75d2ca74ab --- /dev/null +++ b/ports/pcre2/pcre2-10.35_fix-space.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200 ++++ b/CMakeLists.txt 2020-06-03 20:50:46.532419900 +0200 +@@ -108,7 +108,7 @@ + + LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + +-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src") ++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I\"${PROJECT_SOURCE_DIR}/src\"") + + # external packages + FIND_PACKAGE( BZip2 ) diff --git a/ports/pcre2/pcre2-10.35_fix-uwp.patch b/ports/pcre2/pcre2-10.35_fix-uwp.patch new file mode 100644 index 00000000000000..476dde0f6a4ccb --- /dev/null +++ b/ports/pcre2/pcre2-10.35_fix-uwp.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200 ++++ b/CMakeLists.txt 2020-06-03 20:57:17.026182500 +0200 +@@ -619,6 +619,7 @@ + + IF(MSVC) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) ++ add_compile_options(/wd4146) + ENDIF(MSVC) + + SET(CMAKE_INCLUDE_CURRENT_DIR 1) diff --git a/ports/pcre2/pcre2-10.35_fix_postfix_for_debug_Windows_builds.patch b/ports/pcre2/pcre2-10.35_fix_postfix_for_debug_Windows_builds.patch new file mode 100644 index 00000000000000..3cb78ae806012a --- /dev/null +++ b/ports/pcre2/pcre2-10.35_fix_postfix_for_debug_Windows_builds.patch @@ -0,0 +1,141 @@ +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt (revision 1255) ++++ CMakeLists.txt (working copy) +@@ -475,6 +475,12 @@ + ${PROJECT_BINARY_DIR}/pcre2.h + @ONLY) + ++# Make sure to not link debug libs ++# against release libs and vice versa ++IF(WIN32) ++ SET(CMAKE_DEBUG_POSTFIX "d") ++ENDIF(WIN32) ++ + # Generate pkg-config files + + SET(PACKAGE_VERSION "${PCRE2_MAJOR}.${PCRE2_MINOR}") +@@ -483,6 +489,9 @@ + SET(exec_prefix "\${prefix}") + SET(libdir "\${exec_prefix}/lib") + SET(includedir "\${prefix}/include") ++IF(WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug)) ++ SET(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++ENDIF() + CONFIGURE_FILE(libpcre2-posix.pc.in libpcre2-posix.pc @ONLY) + SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-posix.pc") + +@@ -622,11 +631,6 @@ + ENDIF(MSVC) + + SET(CMAKE_INCLUDE_CURRENT_DIR 1) +-# needed to make sure to not link debug libs +-# against release libs and vice versa +-IF(WIN32) +- SET(CMAKE_DEBUG_POSTFIX "d") +-ENDIF(WIN32) + + SET(targets) + +Index: configure.ac +=================================================================== +--- configure.ac (revision 1255) ++++ configure.ac (working copy) +@@ -1007,6 +1007,9 @@ + AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"]) + + # Produce these files, in addition to config.h. ++# LIB_POSTFIX is used by CMakeLists.txt for Windows debug builds. ++# Pass empty LIB_POSTFIX to *.pc files and pcre2-config here. ++AC_SUBST(LIB_POSTFIX) + AC_CONFIG_FILES( + Makefile + libpcre2-8.pc +Index: libpcre2-16.pc.in +=================================================================== +--- libpcre2-16.pc.in (revision 1255) ++++ libpcre2-16.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre2-16 + Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre2-16 ++Libs: -L${libdir} -lpcre2-16@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ +Index: libpcre2-32.pc.in +=================================================================== +--- libpcre2-32.pc.in (revision 1255) ++++ libpcre2-32.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre2-32 + Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre2-32 ++Libs: -L${libdir} -lpcre2-32@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ +Index: libpcre2-8.pc.in +=================================================================== +--- libpcre2-8.pc.in (revision 1255) ++++ libpcre2-8.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre2-8 + Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre2-8 ++Libs: -L${libdir} -lpcre2-8@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ +Index: libpcre2-posix.pc.in +=================================================================== +--- libpcre2-posix.pc.in (revision 1255) ++++ libpcre2-posix.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre2-posix + Description: Posix compatible interface to libpcre2-8 + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre2-posix ++Libs: -L${libdir} -lpcre2-posix@LIB_POSTFIX@ + Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ + Requires.private: libpcre2-8 +Index: pcre2-config.in +=================================================================== +--- pcre2-config.in (revision 1255) ++++ pcre2-config.in (working copy) +@@ -86,7 +86,7 @@ + ;; + --libs-posix) + if test @enable_pcre2_8@ = yes ; then +- echo $libS$libR -lpcre2-posix -lpcre2-8 ++ echo $libS$libR -lpcre2-posix@LIB_POSTFIX@ -lpcre2-8@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -93,7 +93,7 @@ + ;; + --libs8) + if test @enable_pcre2_8@ = yes ; then +- echo $libS$libR -lpcre2-8 ++ echo $libS$libR -lpcre2-8@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -100,7 +100,7 @@ + ;; + --libs16) + if test @enable_pcre2_16@ = yes ; then +- echo $libS$libR -lpcre2-16 ++ echo $libS$libR -lpcre2-16@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -107,7 +107,7 @@ + ;; + --libs32) + if test @enable_pcre2_32@ = yes ; then +- echo $libS$libR -lpcre2-32 ++ echo $libS$libR -lpcre2-32@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi diff --git a/ports/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 9057ede478e4bd..3395cccf0b4b3b 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -1,19 +1,36 @@ -set(PCRE2_VERSION 10.30) -include(vcpkg_common_functions) +set(PCRE2_VERSION 10.35) +set(EXPECTED_SHA bf1cb6ab8b1103f9503609783945b02cdc4294bb266643d0ba03656c941f07b6e183793f3bf513da950460e78cb9b429bff8ade27d8930339a63caed3a3236e3) +set(PATCHES + pcre2-10.35_fix-space.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2588 + pcre2-10.35_fix-uwp.patch + pcre2-10.35_fix_postfix_for_debug_Windows_builds.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2600 + pcre2-10.35_add_check_for_Intel_CET.patch # Upstream: https://bugs.exim.org/show_bug.cgi?id=2578 +) vcpkg_download_distfile(ARCHIVE - URLS "https://ftp.pcre.org/pub/pcre/pcre2-${PCRE2_VERSION}.zip" "https://sourceforge.net/projects/pcre/files/pcre2/${PCRE2_VERSION}/pcre2-${PCRE2_VERSION}.zip/download" + URLS "https://ftp.pcre.org/pub/pcre/pcre2-${PCRE2_VERSION}.zip" FILENAME "pcre2-${PCRE2_VERSION}.zip" - SHA512 03e570b946ac29498a114b27e715a0fcf25702bfc9623f9fc085ee8a3214ab3c303baccb9c0af55da6916e8ce40d931d97f1ee9628690563041a943f0aa2bc54) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES fix-space.patch - fix-arm64-config.patch - fix-uwp.patch + SHA512 ${EXPECTED_SHA} + SILENT_EXIT ) +if (EXISTS "${ARCHIVE}") + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES ${PATCHES} + ) +else() + vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO pcre/pcre2 + REF ${PCRE2_VERSION} + FILENAME "pcre2-${PCRE2_VERSION}.zip" + SHA512 ${EXPECTED_SHA} + PATCHES ${PATCHES} + ) +endif() + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") set(JIT OFF) else() @@ -46,6 +63,9 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/include/pcre2.h "${PCRE2_H}") file(REMOVE ${CURRENT_PACKAGES_DIR}/include/pcre2posix.h) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/pcre2-posix.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pcre2-posixd.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/pcre2-posix.dll ${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-posixd.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre2-posix.pc ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre2-posix.pc) + +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() @@ -54,4 +74,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) 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() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pe-parse/CONTROL b/ports/pe-parse/CONTROL new file mode 100644 index 00000000000000..c269edd7ff1f01 --- /dev/null +++ b/ports/pe-parse/CONTROL @@ -0,0 +1,5 @@ +Source: pe-parse +Version: 1.2.0 +Description: pe-parse is a principled, lightweight C/C++ PE parser +Homepage: https://github.com/trailofbits/pe-parse +Supports: !uwp diff --git a/ports/pe-parse/portfile.cmake b/ports/pe-parse/portfile.cmake new file mode 100644 index 00000000000000..f0dc4de83a4f1e --- /dev/null +++ b/ports/pe-parse/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO trailofbits/pe-parse + REF v1.2.0 + SHA512 916ec515585ba1e83e2c6ae29667fd25bd4cac90c39e587ae6847dc9d503186e8853bd80f4e2a99177a3214f5c51eceff85fa610cadbc2bc1d3a79251e8ce942 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DBUILD_COMMAND_LINE_TOOLS=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/pe-parse TARGET_PATH share/pe-parse) + +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/pe-parse" + RENAME copyright +) diff --git a/ports/pegtl-2/CONTROL b/ports/pegtl-2/CONTROL index aba1579d1fd88c..842c9080fe22d1 100644 --- a/ports/pegtl-2/CONTROL +++ b/ports/pegtl-2/CONTROL @@ -1,3 +1,4 @@ Source: pegtl-2 -Version: 2.8.1 +Version: 2.8.1-1 Description: The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++ header-only parser combinator library for creating parsers according to a Parsing Expression Grammar (PEG). This version maintains compatibility with C++11. +Homepage: https://github.com/taocpp/PEGTL \ No newline at end of file diff --git a/ports/pegtl-2/portfile.cmake b/ports/pegtl-2/portfile.cmake index 4e43c40ce95b2b..5eedd0c400cd29 100644 --- a/ports/pegtl-2/portfile.cmake +++ b/ports/pegtl-2/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO taocpp/pegtl @@ -25,7 +24,8 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/pegtl-2/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) # Handle copyright -file(RENAME ${CURRENT_PACKAGES_DIR}/share/pegtl-2/LICENSE ${CURRENT_PACKAGES_DIR}/share/pegtl-2/copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) # Handle collision with latest pegtl -file(RENAME ${CURRENT_PACKAGES_DIR}/share/pegtl-2/pegtl-config.cmake ${CURRENT_PACKAGES_DIR}/share/pegtl-2/pegtl-2-config.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/pegtl-config.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/pegtl-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config-version.cmake) diff --git a/ports/pegtl/CONTROL b/ports/pegtl/CONTROL index 3ef0f459b09f94..be3e18fc5e406f 100644 --- a/ports/pegtl/CONTROL +++ b/ports/pegtl/CONTROL @@ -1,3 +1,4 @@ Source: pegtl -Version: 3.0.0-pre-9d58962 +Version: 3.0.0-pre-70971f4 Description: The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++ header-only parser combinator library for creating parsers according to a Parsing Expression Grammar (PEG). +Homepage: https://github.com/taocpp/PEGTL diff --git a/ports/pegtl/portfile.cmake b/ports/pegtl/portfile.cmake index 3fc6362ee9a64f..6735a36efd0341 100644 --- a/ports/pegtl/portfile.cmake +++ b/ports/pegtl/portfile.cmake @@ -1,9 +1,8 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO taocpp/pegtl - REF 9d58962818d69436384044e0a578239548f42a7b - SHA512 16f02bbdb9b601ea3c7ad3db29267bc7615aa6e5c6b3abf693c4e208e2236305cff1e2aa41b2caeb453f122f011ef56c57dd52be7258f95b21c6536482aa6a3d + REF 70971f441d7611ba3905b5c0d5c8bf4338602ef2 + SHA512 8ff0f06eaa59e547e4f00002d27241f99f06b398d7cd021c3b8475431d59234d0aa32fff8ce74faee3468c9fb542020326547a6d9cd7b98561b3bdd233a1e715 HEAD_REF master ) diff --git a/ports/pfring/CONTROL b/ports/pfring/CONTROL index 157c9879f3e371..edddaa9a5d9178 100644 --- a/ports/pfring/CONTROL +++ b/ports/pfring/CONTROL @@ -1,5 +1,5 @@ Source: pfring -Version: 2019-10-17-1 +Version: 2019-10-17-2 Homepage: https://github.com/ntop/PF_RING Description: PF_RING™ is a Linux kernel module and user-space framework that allows you to process packets at high-rates while providing you a consistent API for packet processing applications. Build-Depends: libpcap diff --git a/ports/pfring/makefile.patch b/ports/pfring/makefile.patch new file mode 100644 index 00000000000000..cc17fb1f7f2db8 --- /dev/null +++ b/ports/pfring/makefile.patch @@ -0,0 +1,59 @@ +diff --git a/Makefile b/Makefile +index 4b377c628..39cbf5cb4 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,10 +1,12 @@ + all: +- cd kernel; make +- cd userland; ./configure; make +- cd drivers; make ++ $(MAKE) -C kernel; ++ #cd kernel; make ++ cd userland; ./configure; ++ $(MAKE) -C userland; ++ $(MAKE) -C drivers; + + install: +- cd userland; make install ++ $(MAKE) install -C userland; + + clean: + -cd kernel; make clean +diff --git a/userland/Makefile b/userland/Makefile +index 959470c0f..e35ca8de7 100644 +--- a/userland/Makefile ++++ b/userland/Makefile +@@ -9,22 +9,22 @@ lib/Makefile: + config: lib/Makefile + + libpfring: config +- cd lib; make ++ $(MAKE) -C lib + + build_nbpf: config +- cd nbpf; make ++ $(MAKE) -C nbpf + + build_c++: libpfring +- cd c++; make ++ $(MAKE) -C c++ + + tcpdump/Makefile: + cd tcpdump; ./configure --with_system_libpcap=yes + + build_tcpdump: libpfring tcpdump/Makefile +- cd tcpdump; make ++ $(MAKE) -C tcpdump + + build_extcap: libpfring +- cd wireshark/extcap; make ++ $(MAKE) -C wireshark/extcap + + ################### + +@@ -46,4 +46,4 @@ extcap_clean: + cd wireshark/extcap; make clean + + install: libpfring +- cd lib; make install ++ $(MAKE) -C lib install diff --git a/ports/pfring/portfile.cmake b/ports/pfring/portfile.cmake index 0df34b47534ed2..967bdc5eebb5f8 100644 --- a/ports/pfring/portfile.cmake +++ b/ports/pfring/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platforms" ON_TARGET "Windows") +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platforms" ON_TARGET "Windows") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -8,16 +8,20 @@ vcpkg_from_github( HEAD_REF dev PATCHES use-vcpkg-libpcap.patch + makefile.patch ) - -vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - SKIP_CONFIGURE -) - + +file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(COPY "${SOURCE_PATH}/" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(COPY "${SOURCE_PATH}/" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +endif() set(ENV{VCPKG_LIBPCAP_DIR} "${CURRENT_INSTALLED_DIR}") - vcpkg_build_make() +vcpkg_fixup_pkgconfig() + vcpkg_copy_pdbs() # Install manually because pfring cannot set prefix diff --git a/ports/physfs/CONTROL b/ports/physfs/CONTROL index 037db0947461ba..de52b6a4cd12f0 100644 --- a/ports/physfs/CONTROL +++ b/ports/physfs/CONTROL @@ -1,5 +1,6 @@ Source: physfs -Version: 3.0.2-1 +Version: 3.0.2-2 Homepage: https://icculus.org/physfs/ Description: a library to provide abstract access to various archives Build-Depends: zlib +Supports: !arm64 diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index 2e841ac7eb5ccd..86d56b4fa7540c 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -1,8 +1,9 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm64") set(PHYSFS_VERSION 3.0.2) vcpkg_download_distfile(ARCHIVE URLS "https://icculus.org/physfs/downloads/physfs-${PHYSFS_VERSION}.tar.bz2" + "https://hg.icculus.org/icculus/physfs/archive/release-${PHYSFS_VERSION}.tar.bz2" FILENAME "physfs-${PHYSFS_VERSION}.tar.bz2" SHA512 4024b6c3348e0b6fc1036aac330192112dfe17de3e3d14773be9f06e9a062df5a1006869f21162b4e0b584989f463788a35e64186b1913225c073fea62754472 ) diff --git a/ports/physx/CONTROL b/ports/physx/CONTROL index c744a2ae36c38d..3f813e5e25c960 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: 4 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..e9b513c9b00de0 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) @@ -114,10 +113,10 @@ set(RELEASE_CONFIGURATION "release") 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 +135,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/pixel/CONTROL b/ports/pixel/CONTROL index 50b1bd0a828228..fae73d2fd2bbb3 100644 --- a/ports/pixel/CONTROL +++ b/ports/pixel/CONTROL @@ -1,4 +1,6 @@ Source: pixel -Version: 0.3 +Version: 0.3-1 Description: Simple 2D Graphics based on standard and portable OpenGL. Build-Depends: glew, opengl, sdl2 +Homepage: https://github.com/dascandy/pixel +Supports: !windows \ No newline at end of file diff --git a/ports/pixel/portfile.cmake b/ports/pixel/portfile.cmake index 4e2e9d7ac26eaf..0b63c66f7ae867 100644 --- a/ports/pixel/portfile.cmake +++ b/ports/pixel/portfile.cmake @@ -1,4 +1,9 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "Windows") + +if(VCPKG_TARGET_IS_LINUX) + message(WARNING"${PORT} currently requires libglu1-mesa from the system package manager: + This can be installed on Ubuntu systems via sudo apt install libglu1-mesa-dev") +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH diff --git a/ports/plf-colony/CONTROL b/ports/plf-colony/CONTROL index 384ce2d194a71c..91750341e4100b 100644 --- a/ports/plf-colony/CONTROL +++ b/ports/plf-colony/CONTROL @@ -1,4 +1,4 @@ Source: plf-colony -Version: 2019-08-10 +Version: 5.33 Description: An unordered data container providing fast iteration/insertion/erasure while maintaining pointer validity to non-erased elements Homepage: https://www.plflib.org/ diff --git a/ports/plf-colony/portfile.cmake b/ports/plf-colony/portfile.cmake index eef608ce84712c..85c9409ee4d9a0 100644 --- a/ports/plf-colony/portfile.cmake +++ b/ports/plf-colony/portfile.cmake @@ -5,8 +5,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mattreecebentley/plf_colony - REF 81fe8c4daf433491f14248837ee8ed5cf447c856 - SHA512 a6ae03d383c94b0a758e7aedee2838d46b3665881e2c0823b064a3579140a351d96fec66d456de5843b6c4c8d2f6f6efac5f547841c08edd349b0f153e9c4871 + REF 7aba4b3f27e3dd7ca54cbe41738d04695d2c05e1 + SHA512 78dc8ee96174776e6993b03f15b1e7452864015641854ff89ffbe8d45e2203982347da9bf6eed1f7a0b40a794c53ab7c06e92eee101e4e0aae20997d240db872 HEAD_REF master ) diff --git a/ports/plibsys/CONTROL b/ports/plibsys/CONTROL index 004f0708486770..dec1285c9f528e 100644 --- a/ports/plibsys/CONTROL +++ b/ports/plibsys/CONTROL @@ -1,4 +1,6 @@ Source: plibsys -Version: 0.0.4-2 +Version: 0.0.4 +Port-Version: 4 Homepage: https://github.com/saprykin/plibsys Description: Highly portable C system library: threads and synchronization, sockets, IPC, data structures and more. +Supports: !uwp diff --git a/ports/plibsys/fix_configuration.patch b/ports/plibsys/fix_configuration.patch new file mode 100644 index 00000000000000..f48249bfd192ab --- /dev/null +++ b/ports/plibsys/fix_configuration.patch @@ -0,0 +1,142 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 343e3d2..aff7929 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -785,18 +785,18 @@ if (PLIBSYS_PLATFORM_DEFINES) + endif() + + # Add targets +-add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS}) +- + if (PLIBSYS_BUILD_STATIC) + add_library (plibsysstatic STATIC ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS}) ++else() ++ add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS}) + endif() + + # Add include directories + if (COMMAND target_include_directories) +- target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS}) +- + if (PLIBSYS_BUILD_STATIC) + target_include_directories (plibsysstatic PUBLIC ${PLIBSYS_INCLUDE_DIRS}) ++ else() ++ target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS}) + endif() + else() + include_directories (${PLIBSYS_INCLUDE_DIRS}) +@@ -804,15 +804,16 @@ endif() + + # Add compile definitions + if (COMMAND target_compile_definitions) +- target_compile_definitions (plibsys PRIVATE ${PLIBSYS_COMPILE_DEFS}) +- + if (PLIBSYS_BUILD_STATIC) + target_compile_definitions (plibsysstatic PRIVATE ${PLIBSYS_COMPILE_DEFS}) ++ else() ++ target_compile_definitions (plibsys PRIVATE ${PLIBSYS_COMPILE_DEFS}) + endif() + else() + add_definitions (${PLIBSYS_COMPILE_DEFS}) + endif() + ++if(NOT PLIBSYS_BUILD_STATIC) + set_target_properties (plibsys PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) + set_target_properties (plibsys PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR}) + set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) +@@ -820,6 +821,7 @@ set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR} + if (NOT PLIBSYS_TARGET_OS STREQUAL os2 AND NOT PLIBSYS_TARGET_OS STREQUAL amigaos) + set_target_properties (plibsys PROPERTIES SOVERSION ${PLIBSYS_SOVERSION}) + endif() ++endif() + + if (PLIBSYS_BUILD_STATIC) + set_target_properties (plibsysstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) +@@ -834,10 +836,10 @@ if (PLIBSYS_PLATFORM_CFLAGS) + set (PLIBSYS_PLATFORM_CFLAGS_STR "${PLIBSYS_PLATFORM_CFLAGS_STR} ${PLATFORM_CFLAG}") + endforeach() + +- set_target_properties (plibsys PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}") +- + if (PLIBSYS_BUILD_STATIC) + set_target_properties (plibsysstatic PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}") ++ else() ++ set_target_properties (plibsys PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}") + endif() + endif() + +@@ -846,29 +848,30 @@ if (PLIBSYS_PLATFORM_LDFLAGS) + set (PLIBSYS_PLATFORM_LDFLAGS_STR "${PLIBSYS_PLATFORM_LDFLAGS_STR} ${PLATFORM_LDFLAG}") + endforeach() + +- set_target_properties (plibsys PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}") +- + if (PLIBSYS_BUILD_STATIC) + set_target_properties (plibsysstatic PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}") ++ else() ++ set_target_properties (plibsys PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}") + endif() + endif() + +-target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) + + if (PLIBSYS_BUILD_STATIC) +- target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) ++ target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) ++else() ++ target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) + endif() + + if (PLIBSYS_BUILD_STATIC) +- set (PLIBSYS_INSTALL_TARGETS plibsys plibsysstatic) ++ set (PLIBSYS_INSTALL_TARGETS plibsysstatic) + else() + set (PLIBSYS_INSTALL_TARGETS plibsys) + endif() + + if (PLIBSYS_NATIVE_WINDOWS) + install (TARGETS ${PLIBSYS_INSTALL_TARGETS} +- DESTINATION lib +- RUNTIME DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + COMPONENT Core + ) + +@@ -878,11 +881,6 @@ if (PLIBSYS_NATIVE_WINDOWS) + + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) + include (InstallRequiredSystemLibraries) +- +- install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} +- DESTINATION lib +- COMPONENT Core +- ) + endif() + + # Prepare installation dirs +@@ -890,18 +888,18 @@ if (NOT CMAKE_INSTALL_LIBDIR) + set (CMAKE_INSTALL_LIBDIR "lib") + endif() + ++if (NOT CMAKE_INSTALL_BINDIR) ++ set (CMAKE_INSTALL_BINDIR "bin") ++endif() ++ + if (NOT CMAKE_INSTALL_INCLUDEDIR) + set (CMAKE_INSTALL_INCLUDEDIR "include") + endif() + + install (TARGETS ${PLIBSYS_INSTALL_TARGETS} EXPORT plibsys-targets +- DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- COMPONENT Core +-) +-install (TARGETS ${PLIBSYS_INSTALL_TARGETS} +- DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT Core + ) + install (FILES diff --git a/ports/plibsys/portfile.cmake b/ports/plibsys/portfile.cmake index a4a032370cd88f..c6ab653b60714c 100644 --- a/ports/plibsys/portfile.cmake +++ b/ports/plibsys/portfile.cmake @@ -1,17 +1,16 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO saprykin/plibsys REF 0.0.4 SHA512 61957666fb454469e1ff68435463eaf426e960caed33540dbb495e1aa7c446c9803d100f33f1a6ea70d5f2ee2d0d19ec315f3a8c651747f65a186ad061c05e51 HEAD_REF master + PATCHES + fix_configuration.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - SET(PLIBSYS_STATIC OFF) -else() - SET(PLIBSYS_STATIC ON) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PLIBSYS_STATIC) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -19,6 +18,7 @@ vcpkg_configure_cmake( OPTIONS -DPLIBSYS_TESTS=OFF -DPLIBSYS_COVERAGE=OFF + -DPLIBSYS_BUILD_DOC=OFF -DPLIBSYS_BUILD_STATIC=${PLIBSYS_STATIC} ) @@ -26,45 +26,10 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/plibsys RENAME copyright) - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(PLIBSYS_FILENAME plibsys) - - # Put shared libraries into the proper directory - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/plibsys.dll ${CURRENT_PACKAGES_DIR}/bin/plibsys.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/plibsys.dll ${CURRENT_PACKAGES_DIR}/debug/bin/plibsys.dll) -else() - set(PLIBSYS_FILENAME plibsysstatic) - - # For static build remove dynamic libraries - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/plibsys.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/plibsys.dll) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/plibsys.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/plibsys.dll) -endif() - -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tmp) - -# Save library files -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${PLIBSYS_FILENAME}.lib ${CURRENT_PACKAGES_DIR}/tmp/plibsys.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/${PLIBSYS_FILENAME}.lib ${CURRENT_PACKAGES_DIR}/tmp/plibsys_debug.lib) - -# Remove unused shared libraries -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) +vcpkg_copy_pdbs() -# Re-install library files -file(RENAME ${CURRENT_PACKAGES_DIR}/tmp/plibsys.lib ${CURRENT_PACKAGES_DIR}/lib/plibsys.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/tmp/plibsys_debug.lib ${CURRENT_PACKAGES_DIR}/debug/lib/plibsys.lib) +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}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -# Remove duplicate library files (already installed) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tmp) -vcpkg_copy_pdbs() diff --git a/ports/plibsys/usage b/ports/plibsys/usage new file mode 100644 index 00000000000000..e679f1bdc7b388 --- /dev/null +++ b/ports/plibsys/usage @@ -0,0 +1,5 @@ +The package plibsys provides CMake targets: + + find_package(plibsys CONFIG REQUIRED) + target_include_directories(main PRIVATE ${PLIBSYS_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${PLIBSYS_LIBRARIES}) diff --git a/ports/plibsys/vcpkg-cmake-wrapper.cmake b/ports/plibsys/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..acf1ac9f8c434a --- /dev/null +++ b/ports/plibsys/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,12 @@ +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(PLIBSYS_INCLUDE_DIR NAMES plibsys.h HINTS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} PATH_SUFFIXES plibsys) + +find_library(PLIBSYS_LIBRARY_DEBUG NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(PLIBSYS_LIBRARY_RELEASE NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(PLIBSYS) + +set(PLIBSYS_INCLUDE_DIRS ${PLIBSYS_INCLUDE_DIR}) +set(PLIBSYS_LIBRARIES ${PLIBSYS_LIBRARY}) diff --git a/ports/plplot/CONTROL b/ports/plplot/CONTROL index d489bc45f84f32..fe5ea0b198d233 100644 --- a/ports/plplot/CONTROL +++ b/ports/plplot/CONTROL @@ -1,5 +1,5 @@ Source: plplot -Version: 5.13.0-4 +Version: 5.13.0-8 Build-Depends: freetype, zlib, libpng, bzip2 Description: PLplot is a cross-platform software package for creating scientific plots whose (UTF-8) plot symbols and text are limited in practice only by what Unicode-aware system fonts are installed on a user's computer. diff --git a/ports/plplot/portfile.cmake b/ports/plplot/portfile.cmake index 0bffd25aaa2745..97efa2568f2875 100644 --- a/ports/plplot/portfile.cmake +++ b/ports/plplot/portfile.cmake @@ -1,16 +1,11 @@ set(PLPLOT_VERSION 5.13.0) -set(PLPLOT_HASH 1d5cb5da17d4bde6d675585bff1f8dcb581719249a0b2687867e767703f8dab0870e7ea44b9549a497f4ac0141a3cabf6761c49520c0e2b26ffe581468512cbb) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/plplot/files/plplot/${PLPLOT_VERSION}%20Source/plplot-${PLPLOT_VERSION}.tar.gz/download" - FILENAME "plplot-${PLPLOT_VERSION}.tar.gz" - SHA512 ${PLPLOT_HASH} -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${PLPLOT_VERSION} + REPO plplot/plplot + REF ${PLPLOT_VERSION}%20Source + FILENAME "plplot-${PLPLOT_VERSION}.tar.gz" + SHA512 1d5cb5da17d4bde6d675585bff1f8dcb581719249a0b2687867e767703f8dab0870e7ea44b9549a497f4ac0141a3cabf6761c49520c0e2b26ffe581468512cbb PATCHES 0001-findwxwidgets-fixes.patch 0002-wxwidgets-dev-fixes.patch @@ -45,6 +40,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/plplot) # Remove unnecessary tool @@ -67,5 +64,4 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/plplot RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/podofo/CONTROL b/ports/podofo/CONTROL index 630b9efcf3c0e3..933f7363fc410d 100644 --- a/ports/podofo/CONTROL +++ b/ports/podofo/CONTROL @@ -1,5 +1,6 @@ Source: podofo -Version: 0.9.6-7 +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 759b6dbe130dac..36bd2c48e4cd50 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -1,23 +1,19 @@ -include(vcpkg_common_functions) - set(PODOFO_VERSION 0.9.6) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/podofo/files/podofo/${PODOFO_VERSION}/podofo-${PODOFO_VERSION}.tar.gz/download" - FILENAME "podofo-${PODOFO_VERSION}.tar.gz" - SHA512 35c1a457758768bdadc93632385f6b9214824fead279f1b85420443fb2135837cefca9ced476df0d47066f060e9150e12fcd40f60fa1606b177da433feb20130 -) -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if (VCPKG_TARGET_IS_UWP) set(ADDITIONAL_PATCH "0003-uwp_fix.patch") endif() -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO podofo/podofo REF ${PODOFO_VERSION} + FILENAME "podofo-${PODOFO_VERSION}.tar.gz" + SHA512 35c1a457758768bdadc93632385f6b9214824fead279f1b85420443fb2135837cefca9ced476df0d47066f060e9150e12fcd40f60fa1606b177da433feb20130 PATCHES 0001-unique_ptr.patch 0002-HAVE_UNISTD_H.patch + freetype.patch ${ADDITIONAL_PATCH} ) @@ -56,5 +52,4 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/podofo) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/podofo/COPYING ${CURRENT_PACKAGES_DIR}/share/podofo/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/polyclipping/CONTROL b/ports/polyclipping/CONTROL index 0e97f0a32019c6..198090cc6f1344 100644 --- a/ports/polyclipping/CONTROL +++ b/ports/polyclipping/CONTROL @@ -1,3 +1,4 @@ Source: polyclipping -Version: 6.4.2 +Version: 6.4.2-4 +Homepage: https://sourceforge.net/projects/polyclipping/ Description: The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons. diff --git a/ports/polyclipping/portfile.cmake b/ports/polyclipping/portfile.cmake index b1b1997cfc9a77..1626d81ba5d19b 100644 --- a/ports/polyclipping/portfile.cmake +++ b/ports/polyclipping/portfile.cmake @@ -1,18 +1,11 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/polyclipping/files/clipper_ver6.4.2.zip/download" - FILENAME "clipper_ver6.4.2.zip" - SHA512 ffc88818c44a38aa278d5010db6cfd505796f39664919f1e48c7fa9267563f62135868993e88f7246dcd688241d1172878e4a008a390648acb99738452e3e5dd -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO polyclipping + FILENAME "clipper_ver6.4.2.zip" NO_REMOVE_ONE_LEVEL - REF 6.4.2 + SHA512 ffc88818c44a38aa278d5010db6cfd505796f39664919f1e48c7fa9267563f62135868993e88f7246dcd688241d1172878e4a008a390648acb99738452e3e5dd ) vcpkg_configure_cmake( diff --git a/ports/polyhook2/CONTROL b/ports/polyhook2/CONTROL index e238aa954c350e..924ea7e2a5f38b 100644 --- a/ports/polyhook2/CONTROL +++ b/ports/polyhook2/CONTROL @@ -1,8 +1,30 @@ Source: polyhook2 -Version: 2020-02-17 +Version: 2020-08-04 Homepage: https://github.com/stevemk14ebr/PolyHook_2_0 Description: C++17, x86/x64 Hooking Libary v2.0 +Supports: !(arm|uwp|linux|osx) +Default-Features: capstone,zydis,exception,detours,inlinentd,pe,virtuals + +Feature: capstone Build-Depends: capstone[x86] +Description: Capstone disassembler integration. + +Feature: zydis +Build-Depends: zydis +Description: Zydis disassembler integration. + +Feature: exception +Description: Implement all exception hooking functionality + +Feature: detours +Description: Implement detour functionality + +Feature: inlinentd +Build-Depends: asmjit +Description: Support inline hooks without specifying typedefs by generating callback stubs at runtime with AsmJit + +Feature: pe +Description: Implement all win pe hooking functionality -Feature: tool -Description: Build tests \ No newline at end of file +Feature: virtuals +Description: Implement all virtual table hooking functionality diff --git a/ports/polyhook2/fix-build-error.patch b/ports/polyhook2/fix-build-error.patch deleted file mode 100644 index 1366d681619c19..00000000000000 --- a/ports/polyhook2/fix-build-error.patch +++ /dev/null @@ -1,135 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2577bb2..e88761c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,18 +12,19 @@ option(FEATURE_PE "Implement all win pe hooking functionality" ON) - option(BUILD_DLL "Build dll & lib instead of tests" OFF) - option(BUILD_STATIC "If BUILD_DLL is set, create the type that can be statically linked" ON) - option(CAPSTONE_FULL "Build all features of capstone." OFF) -+option(BUILD_TOOLS "Build tests" OFF) - - # Calculate inclusion of necessary dependencies based on features - - # for now only inlinentd uses asmjit - set(DEP_ASMJIT_NEED ${FEATURE_INLINENTD}) --set(DEP_ZYDIS_NEED ON) -+set(DEP_ZYDIS_NEED OFF) - # todo: make inclusion of capstone stuff depend on feature flags - - #IDE's like it when header file are included as source files - set(HEADER_FILES ${PROJECT_SOURCE_DIR}/polyhook2/ADisassembler.hpp - ${PROJECT_SOURCE_DIR}/polyhook2/CapstoneDisassembler.hpp -- ${PROJECT_SOURCE_DIR}/polyhook2/ZydisDisassembler.hpp -+# ${PROJECT_SOURCE_DIR}/polyhook2/ZydisDisassembler.hpp - ${PROJECT_SOURCE_DIR}/polyhook2/Enums.hpp - ${PROJECT_SOURCE_DIR}/polyhook2/IHook.hpp - ${PROJECT_SOURCE_DIR}/polyhook2/Instruction.hpp -@@ -35,13 +36,13 @@ set(HEADER_FILES ${PROJECT_SOURCE_DIR}/polyhook2/ADisassembler.hpp - - set(HEADER_IMP_SOURCES - ${PROJECT_SOURCE_DIR}/sources/CapstoneDisassembler.cpp -- ${PROJECT_SOURCE_DIR}/sources/ZydisDisassembler.cpp -+# ${PROJECT_SOURCE_DIR}/sources/ZydisDisassembler.cpp - ${PROJECT_SOURCE_DIR}/sources/MemProtector.cpp - ${PROJECT_SOURCE_DIR}/sources/TestEffectTracker.cpp - ${PROJECT_SOURCE_DIR}/sources/PageAllocator.cpp) - - # only build tests if making exe --if(BUILD_DLL MATCHES OFF) -+if(BUILD_TOOLS) - set(UNIT_TEST_SOURCES - ${PROJECT_SOURCE_DIR}/MainTests.cpp - ${PROJECT_SOURCE_DIR}/UnitTests/TestDisassembler.cpp -@@ -65,7 +66,7 @@ if(FEATURE_DETOURS MATCHES ON) - set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${DETOUR_IMP_SOURCES}) - - # only build tests if making exe -- if(BUILD_DLL MATCHES OFF) -+ if(BUILD_TOOLS) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # 64 bits - set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} -@@ -93,7 +94,7 @@ if(FEATURE_EXCEPTION MATCHES ON) - set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${EXCEPTION_IMP_SOURCES}) - - # only build tests if making exe -- if(BUILD_DLL MATCHES OFF) -+ if(BUILD_TOOLS) - set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} - ${PROJECT_SOURCE_DIR}/UnitTests/TestBreakpointHook.cpp - ${PROJECT_SOURCE_DIR}/UnitTests/TestHWBreakpointHook.cpp) -@@ -113,7 +114,7 @@ if(FEATURE_VIRTUALS MATCHES ON) - set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${VIRTUAL_IMP_SOURCES}) - - # only build tests if making exe -- if(BUILD_DLL MATCHES OFF) -+ if(BUILD_TOOLS) - set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} - ${PROJECT_SOURCE_DIR}/UnitTests/TestVTableSwapHook.cpp - ${PROJECT_SOURCE_DIR}/UnitTests/TestVFuncSwapHook.cpp) -@@ -134,7 +135,7 @@ if(FEATURE_PE MATCHES ON) - set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${PE_IMP_SOURCES}) - - # only build tests if making exe -- if(BUILD_DLL MATCHES OFF) -+ if(BUILD_TOOLS) - set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} - ${PROJECT_SOURCE_DIR}/UnitTests/TestEatHook.cpp - ${PROJECT_SOURCE_DIR}/UnitTests/TestIatHook.cpp) -@@ -152,7 +153,7 @@ if(FEATURE_INLINENTD MATCHES ON) - set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${NTD_SOURCES}) - - # only build tests if making exe -- if(BUILD_DLL MATCHES OFF) -+ if(BUILD_TOOLS) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # 64 bits - set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} -@@ -175,8 +176,10 @@ if(BUILD_DLL MATCHES ON) - else() - add_library(PolyHook_2 SHARED ${SOURCE_FILES_PLH}) - endif() --else() -- add_executable(PolyHook_2 ${SOURCE_FILES_PLH}) -+endif() -+ -+if(BUILD_TOOLS) -+ add_executable(PolyHook2_tool ${SOURCE_FILES_PLH}) - endif() - - # add WALL + PDB flags -@@ -220,8 +223,16 @@ if(NOT ${CAPSTONE_FULL}) - set(CAPSTONE_EVM_SUPPORT OFF CACHE BOOL "EVM support") - endif() - --add_subdirectory(capstone) --target_link_libraries(${PROJECT_NAME} capstone-static) -+find_library(CAPSTONE_LIBRARY NAMES capstone_dll capstone) -+find_path(CAPSTONE_INCLUDE_DIR NAMES capstone/capstone.h) -+target_link_libraries(${PROJECT_NAME} ${CAPSTONE_LIBRARY}) -+target_include_directories(${PROJECT_NAME} PRIVATE ${CAPSTONE_INCLUDE_DIR}) -+ -+if(BUILD_TOOLS) -+ target_link_libraries(PolyHook2_tool ${CAPSTONE_LIBRARY}) -+ target_include_directories(PolyHook2_tool PRIVATE ${CAPSTONE_INCLUDE_DIR}) -+ install(TARGETS PolyHook2_tool DESTINATION tool) -+endif() - - # ASMJIT - if(DEP_ASMJIT_NEED MATCHES ON) -diff --git a/polyhook2/CapstoneDisassembler.hpp b/polyhook2/CapstoneDisassembler.hpp -index d227b30..bb5d222 100644 ---- a/polyhook2/CapstoneDisassembler.hpp -+++ b/polyhook2/CapstoneDisassembler.hpp -@@ -7,7 +7,7 @@ - - #include "polyhook2/ADisassembler.hpp" - --#include -+#include - - #include - #include //for debug printing --- -2.25.0.windows.1 - diff --git a/ports/polyhook2/portfile.cmake b/ports/polyhook2/portfile.cmake index b001d26dd0d967..267945d2046cb1 100644 --- a/ports/polyhook2/portfile.cmake +++ b/ports/polyhook2/portfile.cmake @@ -3,30 +3,42 @@ 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 157112f7991768eef51f262486d59c02f18413dc - SHA512 3e8919e5a5a66db29848737b2b90bef57e97b55f516b78518abeb004fbdd2c7a3c99c26753024a8f0be5accc830ded8065f473f1d67f7e033ee419626f4212fe + REF 69fa86df9ae125617ac660b2d6ae2920c69194d9 + SHA512 822c6f07106b5264ab0fe6608875e18ff85572e4316f9bf90be9c68a2c0ed2c4a8f1d1b9fd497d8adf8420c1c9cc34ff46f2e8848f128e37491a86212ed14dc9 HEAD_REF master - PATCHES - fix-build-error.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - tool BUILD_TOOLS + capstone POLYHOOK_DISASM_CAPSTONE + zydis POLYHOOK_DISASM_ZYDIS + exception POLYHOOK_FEATURE_EXCEPTION + detours POLYHOOK_FEATURE_DETOURS + inlinentd POLYHOOK_FEATURE_INLINENTD + pe POLYHOOK_FEATURE_PE + virtuals POLYHOOK_FEATURE_VIRTUALS ) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(BUILD_STATIC ON) + set(BUILD_SHARED_LIB OFF) else() - set(BUILD_STATIC OFF) + set(BUILD_SHARED_LIB ON) +endif() + +if (VCPKG_CRT_LINKAGE STREQUAL "static") + set(BUILD_STATIC_RUNTIME ON) +else() + set(BUILD_STATIC_RUNTIME OFF) endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} - -DFEATURE_INLINENTD=OFF - -DBUILD_DLL=ON - -DBUILD_STATIC=${BUILD_STATIC} + -DPOLYHOOK_BUILD_SHARED_LIB=${BUILD_SHARED_LIB} + -DPOLYHOOK_BUILD_STATIC_RUNTIME=${BUILD_STATIC_RUNTIME} + -DPOLYHOOK_USE_EXTERNAL_ASMJIT=ON + -DPOLYHOOK_USE_EXTERNAL_CAPSTONE=ON + -DPOLYHOOK_USE_EXTERNAL_ZYDIS=ON ) vcpkg_install_cmake() @@ -34,10 +46,7 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/PolyHook_2 TARGET_PATH share/PolyHook_2) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/ponder/CONTROL b/ports/ponder/CONTROL index 7f935d30489158..6efa617997f6f8 100644 --- a/ports/ponder/CONTROL +++ b/ports/ponder/CONTROL @@ -1,3 +1,4 @@ Source: ponder -Version: 3.0.0 +Version: 3.0.0-1 Description: A C++ multi-purpose reflection library. +Homepage: https://github.com/billyquith/ponder diff --git a/ports/ponder/github-121.patch b/ports/ponder/github-121.patch new file mode 100644 index 00000000000000..e7564429d40141 --- /dev/null +++ b/ports/ponder/github-121.patch @@ -0,0 +1,21 @@ +From 83b292f263b92082e981a82f5777d927a61772ee Mon Sep 17 00:00:00 2001 +From: Cheney-Wang +Date: Fri, 13 Mar 2020 02:50:33 -0700 +Subject: [PATCH] Include in config.h + +--- + include/ponder/config.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/ponder/config.hpp b/include/ponder/config.hpp +index cd035c19..814403cd 100644 +--- a/include/ponder/config.hpp ++++ b/include/ponder/config.hpp +@@ -60,6 +60,7 @@ + #if defined(_MSC_VER) + #pragma warning(disable: 4275) // non dll-interface class 'X' used as base for dll-interface class 'Y' + #pragma warning(disable: 4251) // class 'X' needs to have dll-interface to be used by clients of class 'Y' ++ #include //In future MSVC, doesn't transitively , ponder will compile failed with error C2027 and C2065, so add for fixing these issues. + #endif + + #if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ < 9 diff --git a/ports/ponder/portfile.cmake b/ports/ponder/portfile.cmake index 8543643b5fdf9f..5c800cd7e877ab 100644 --- a/ports/ponder/portfile.cmake +++ b/ports/ponder/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO billyquith/ponder @@ -8,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES no-install-unused.patch + github-121.patch ) vcpkg_configure_cmake( diff --git a/ports/portmidi/CONTROL b/ports/portmidi/CONTROL index 1a9917935ab026..f5518c3e14c30c 100644 --- a/ports/portmidi/CONTROL +++ b/ports/portmidi/CONTROL @@ -1,5 +1,5 @@ Source: portmidi -Version: 0.217.1-1 +Version: 0.217.1-4 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 diff --git a/ports/portmidi/portfile.cmake b/ports/portmidi/portfile.cmake index f2f63bfec56e28..b78b34fb461ada 100644 --- a/ports/portmidi/portfile.cmake +++ b/ports/portmidi/portfile.cmake @@ -1,20 +1,13 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "WindowsStore not supported") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/portmedia/portmidi/217/portmidi-src-217.zip" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO portmedia/portmidi + REF 217 FILENAME "portmidi-src-217.zip" SHA512 d08d4d57429d26d292b5fe6868b7c7a32f2f1d2428f6695cd403a697e2d91629bd4380242ab2720e8f21c895bb75cb56b709fb663a20e8e623120e50bfc5d90b ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - # 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/ppconsul/CONTROL b/ports/ppconsul/CONTROL index 08c987f39c75af..0c8dfd8b68ddb8 100644 --- a/ports/ppconsul/CONTROL +++ b/ports/ppconsul/CONTROL @@ -1,5 +1,5 @@ Source: ppconsul -Version: 0.5 +Version: 0.5-1 Homepage: https://github.com/oliora/ppconsul Description: A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure. Build-Depends: boost-core, boost-variant, boost-optional, boost-fusion, curl[openssl], json11 diff --git a/ports/ppmagic/CONTROL b/ports/ppmagic/CONTROL new file mode 100644 index 00000000000000..c31d605b7d5add --- /dev/null +++ b/ports/ppmagic/CONTROL @@ -0,0 +1,4 @@ +Source: ppmagic +Version: 2020-07-03 +Description: C/C++ preprocessor macros that you can use to simplify your life. +Homepage: https://github.com/kobalicek/ppmagic diff --git a/ports/ppmagic/portfile.cmake b/ports/ppmagic/portfile.cmake new file mode 100644 index 00000000000000..18f491f8062494 --- /dev/null +++ b/ports/ppmagic/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO kobalicek/ppmagic + REF 2c7894e3056c610d383027b2d48149ba9d4a1c62 + SHA512 4ab5f1dbef4c9b7892d8042e2a2b01df21a201b2b05a1b75a6ad594f50e2ec1c6a3e4782bb1d702266c90440df679d7eb24dfe595ce35680f7d263ec6c371a3b + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/ppmagic.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL index c003eec353fce1..523e449a1e018e 100644 --- a/ports/proj4/CONTROL +++ b/ports/proj4/CONTROL @@ -1,5 +1,5 @@ Source: proj4 -Version: 6.3.1 +Version: 6.3.1-1 Homepage: https://github.com/OSGeo/PROJ Description: PROJ.4 library for cartographic projections Build-Depends: sqlite3[core] diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index cdb55c05942530..be633ef0ce6a00 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -33,6 +33,8 @@ if ("database" IN_LIST FEATURES) set(SQLITE3_BIN_PATH ${CURRENT_INSTALLED_DIR}/../x64-windows/tools) elseif (EXISTS ${CURRENT_INSTALLED_DIR}/../x64-windows-static/tools/sqlite3.exe AND (NOT CMAKE_HOST_SYSTEM_PROCESSOR OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")) set(SQLITE3_BIN_PATH ${CURRENT_INSTALLED_DIR}/../x64-windows-static/tools) + elseif (NOT TRIPLET_SYSTEM_ARCH STREQUAL "arm" AND EXISTS ${CURRENT_INSTALLED_DIR}/tools/sqlite3.exe) + set(SQLITE3_BIN_PATH ${CURRENT_INSTALLED_DIR}/tools) else() message(FATAL_ERROR "Proj4 database need to install sqlite3[tool]:x86-windows first.") endif() diff --git a/ports/protobuf-c/CONTROL b/ports/protobuf-c/CONTROL index dce11fd90ed5db..171a6d17ac218a 100644 --- a/ports/protobuf-c/CONTROL +++ b/ports/protobuf-c/CONTROL @@ -1,5 +1,5 @@ Source: protobuf-c -Version: 1.3.2 +Version: 1.3.2-2 Homepage: https://github.com/protobuf-c/protobuf-c Description: This is protobuf-c, a C implementation of the Google Protocol Buffers data serialization format. Build-Depends: protobuf @@ -9,4 +9,4 @@ Description: build tools. Feature: test Description: build test project. -Build-Depends: protobuf[tools] \ No newline at end of file +Build-Depends: protobuf-c[tools] \ No newline at end of file diff --git a/ports/protobuf-c/fix-usage-issue.patch b/ports/protobuf-c/fix-usage-issue.patch new file mode 100644 index 00000000000000..ce5e4cfa212c3a --- /dev/null +++ b/ports/protobuf-c/fix-usage-issue.patch @@ -0,0 +1,36 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +index 7c6a04d..83534cb 100644 +--- a/build-cmake/CMakeLists.txt ++++ b/build-cmake/CMakeLists.txt +@@ -14,6 +14,11 @@ option(BUILD_PROTO3 "BUILD_PROTO3" ON) + INCLUDE(TestBigEndian) + TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + ++ ++IF(CMAKE_HOST_UNIX) ++ FIND_PACKAGE(Threads REQUIRED) ++ENDIF() ++ + SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") + ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}") + ADD_DEFINITIONS(-DPACKAGE_STRING="${PACKAGE_STRING}") +@@ -67,6 +72,9 @@ FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) + ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC}) + + TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY}) ++IF(CMAKE_HOST_UNIX) ++ TARGET_LINK_LIBRARIES(protoc-gen-c ${CMAKE_THREAD_LIBS_INIT}) ++ENDIF() + ENDIF() + + IF(WITH_TEST AND WITH_TOOLS) +@@ -99,6 +107,9 @@ GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full + + ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc) + TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY}) ++IF (CMAKE_HOST_UNIX) ++ TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${CMAKE_THREAD_LIBS_INIT}) ++ENDIF() + + FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/t/generated-code2) + ADD_CUSTOM_COMMAND(OUTPUT t/generated-code2/test-full-cxx-output.inc diff --git a/ports/protobuf-c/portfile.cmake b/ports/protobuf-c/portfile.cmake index ec3bcba72fac31..98f7035f642cff 100644 --- a/ports/protobuf-c/portfile.cmake +++ b/ports/protobuf-c/portfile.cmake @@ -6,7 +6,9 @@ vcpkg_from_github( REF 1390409f4ee4e26d0635310995b516eb702c3f9e #1.3.2 SHA512 5c60883c4ef064c641875bfe7f89bf255a29dd20b5e0be5878cbaec03f2efd1f926c3e40dc0090cb172b8eef227fddafe86051f08edb3e1c26d0bd6aca673e41 HEAD_REF master - PATCHES fix-features.patch + PATCHES + fix-features.patch + fix-usage-issue.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 60663d5cde21cc..f444ab67a79ed6 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,8 +1,9 @@ Source: protobuf -Version: 3.11.3 +Version: 3.12.3 +Port-Version: 1 Homepage: https://github.com/google/protobuf Description: Protocol Buffers - Google's data interchange format Feature: zlib Description: ZLib based features like Gzip streams -Build-Depends: zlib \ No newline at end of file +Build-Depends: zlib diff --git a/ports/protobuf/fix-android-log.patch b/ports/protobuf/fix-android-log.patch new file mode 100644 index 00000000000000..47a935078e1de0 --- /dev/null +++ b/ports/protobuf/fix-android-log.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake +index 6bf86a277..424854798 100644 +--- a/cmake/libprotobuf-lite.cmake ++++ b/cmake/libprotobuf-lite.cmake +@@ -67,6 +67,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) + if(protobuf_LINK_LIBATOMIC) + target_link_libraries(libprotobuf-lite atomic) + endif() ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") ++ target_link_libraries(libprotobuf-lite log) ++endif() + target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) + if(MSVC AND protobuf_BUILD_SHARED_LIBS) + target_compile_definitions(libprotobuf-lite +diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake +index 0c12596c2..a5be494fb 100644 +--- a/cmake/libprotobuf.cmake ++++ b/cmake/libprotobuf.cmake +@@ -121,6 +121,9 @@ endif() + if(protobuf_LINK_LIBATOMIC) + target_link_libraries(libprotobuf atomic) + endif() ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") ++ target_link_libraries(libprotobuf log) ++endif() + target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) + if(MSVC AND protobuf_BUILD_SHARED_LIBS) + target_compile_definitions(libprotobuf diff --git a/ports/protobuf/fix-static-build.patch b/ports/protobuf/fix-static-build.patch new file mode 100644 index 00000000000000..22d99435cdfbe6 --- /dev/null +++ b/ports/protobuf/fix-static-build.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/install.cmake b/cmake/install.cmake +index be47c54..8b1bd97 100644 +--- a/cmake/install.cmake ++++ b/cmake/install.cmake +@@ -31,7 +31,7 @@ endforeach() + if (protobuf_BUILD_PROTOC_BINARIES) + install(TARGETS protoc EXPORT protobuf-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) +- if (UNIX AND NOT APPLE) ++ if (UNIX AND NOT APPLE AND NOT protobuf_MSVC_STATIC_RUNTIME) + set_property(TARGET protoc + PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") + elseif (APPLE) diff --git a/ports/protobuf/fix-uwp.patch b/ports/protobuf/fix-uwp.patch index 7a993c5c063ffe..af3795df415f07 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 f87b0928e..5102a10e3 100644 +index 849679995..dba537a68 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt -@@ -190,6 +190,7 @@ if (MSVC) +@@ -198,6 +198,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 58ff2053f67e5d..4bfc11644c987b 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,16 +1,18 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/protobuf - REF v3.11.3 - SHA512 beac21d495bfd8e9b40120d1db9fd82251958f954533fc6f76cd0b9c28f92533ac35368a4c298ebb1d8e09047b670ed3bd948bb7da6eb5cca7fdc0c1c44aa39b + REF 31ebe2ac71400344a5db91ffc13c4ddfb7589f92 #v3.12.3 + SHA512 74e623547bb9448ccea29925172bf13fcbffab80eb02f58d248180000b4ae7249f0dee88bb4ef438857b0e1a96a600ab270ebf3b58568da28cbf97d8a2398297 HEAD_REF master PATCHES fix-uwp.patch + fix-android-log.patch + fix-static-build.patch ) 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) @@ -32,11 +34,10 @@ else() set(VCPKG_BUILD_STATIC_CRT ON) endif() -if("zlib" IN_LIST FEATURES) - set(protobuf_WITH_ZLIB ON) -else() - set(protobuf_WITH_ZLIB OFF) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + zlib protobuf_WITH_ZLIB +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/cmake @@ -44,10 +45,10 @@ vcpkg_configure_cmake( OPTIONS -Dprotobuf_BUILD_SHARED_LIBS=${VCPKG_BUILD_SHARED_LIBS} -Dprotobuf_MSVC_STATIC_RUNTIME=${VCPKG_BUILD_STATIC_CRT} - -Dprotobuf_WITH_ZLIB=${protobuf_WITH_ZLIB} -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_CMAKEDIR:STRING=share/protobuf -Dprotobuf_BUILD_PROTOC_BINARIES=${protobuf_BUILD_PROTOC_BINARIES} + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -72,9 +73,10 @@ else() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake "${RELEASE_MODULE}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake + "\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}" + "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" +) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") @@ -112,10 +114,23 @@ else() endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - file(READ ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h _contents) - string(REPLACE "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" "\#define PROTOBUF_USE_DLLS\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h "${_contents}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h + "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" + "\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" +) 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/protozero/CONTROL b/ports/protozero/CONTROL new file mode 100644 index 00000000000000..c8e1403716eb8b --- /dev/null +++ b/ports/protozero/CONTROL @@ -0,0 +1,5 @@ +Source: protozero +Version: 1.6.8 +Homepage: https://github.com/am2222/mapnik-windows/ +Description: Minimalist protocol buffer decoder and encoder in C++ +Build-Depends: protobuf \ No newline at end of file diff --git a/ports/protozero/portfile.cmake b/ports/protozero/portfile.cmake new file mode 100644 index 00000000000000..55703492df19fa --- /dev/null +++ b/ports/protozero/portfile.cmake @@ -0,0 +1,19 @@ + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mapbox/protozero + SHA512 24bab4bf4ff7c67b4f2d8e97919ccde115db4fa476462926102da2f48b4689d6b454df56dbc30754d0e81c37f669535e4b2101033b079ace0f4ea2706447abe1 + REF v1.6.8 + HEAD_REF master +) + + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja +) + +vcpkg_install_cmake() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug") +file(COPY ${SOURCE_PATH}/include/protozero DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/pthreads/CONTROL b/ports/pthreads/CONTROL index 19e2bd0ac82d34..0aadc971514e54 100644 --- a/ports/pthreads/CONTROL +++ b/ports/pthreads/CONTROL @@ -1,5 +1,5 @@ Source: pthreads -Version: 3.0.0-4 +Version: 3.0.0-6 Homepage: https://sourceware.org/pub/pthreads-win32/ Description: pthreads for windows Supports: !(uwp|arm|arm64) \ No newline at end of file diff --git a/ports/pthreads/portfile.cmake b/ports/pthreads/portfile.cmake index 3abb2d591199fc..911eb4deda35fe 100644 --- a/ports/pthreads/portfile.cmake +++ b/ports/pthreads/portfile.cmake @@ -1,24 +1,17 @@ -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(NOT VCPKG_TARGET_IS_WINDOWS) set(VCPKG_POLICY_EMPTY_PACKAGE enabled) return() endif() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - message(FATAL_ERROR "${PORT} does not currently support UWP platform nor ARM architectures") -endif() +vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP platform nor ARM architectures" ON_TARGET "UWP" ON_ARCH "arm" ) set(PTHREADS4W_VERSION "3.0.0") -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/pthreads4w/files/pthreads4w-code-v${PTHREADS4W_VERSION}.zip/download" - FILENAME "pthreads4w-code-v${PTHREADS4W_VERSION}.zip" - SHA512 49e541b66c26ddaf812edb07b61d0553e2a5816ab002edc53a38a897db8ada6d0a096c98a9af73a8f40c94283df53094f76b429b09ac49862465d8697ed20013 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${PTHREADS4W_VERSION} +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO pthreads4w + FILENAME "pthreads4w-code-v${PTHREADS4W_VERSION}.zip" + SHA512 49e541b66c26ddaf812edb07b61d0553e2a5816ab002edc53a38a897db8ada6d0a096c98a9af73a8f40c94283df53094f76b429b09ac49862465d8697ed20013 ) find_program(NMAKE nmake REQUIRED) @@ -92,9 +85,10 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthreads RENAME copyright) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthread) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthreads) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthreads_windows) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled) diff --git a/ports/pugixml/CONTROL b/ports/pugixml/CONTROL index 154d179546af4f..2d4b2a42c9d27f 100644 --- a/ports/pugixml/CONTROL +++ b/ports/pugixml/CONTROL @@ -1,4 +1,5 @@ Source: pugixml -Version: 1.10-1 +Version: 1.10 +Port-Version: 2 Homepage: https://github.com/zeux/pugixml Description: C++ XML processing library diff --git a/ports/pugixml/portfile.cmake b/ports/pugixml/portfile.cmake index f037e674a27abd..a96d0adbe69227 100644 --- a/ports/pugixml/portfile.cmake +++ b/ports/pugixml/portfile.cmake @@ -1,11 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO zeux/pugixml REF v1.10 SHA512 0634053d4f757b9293997763bb2e51595197c192f3974e954975d6d6ff91e4a6cb7c194efa530e0eef1a2a93db16592c5630010b6482430dff5ffc6879e84b6a HEAD_REF master + PATCHES pugixml-v1.10_fix_debug_pkgconfig.patch # Upstream: https://github.com/zeux/pugixml/pull/363 ) vcpkg_configure_cmake( @@ -17,7 +16,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/pugixml) +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/readme.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/pugixml RENAME copyright) +file(INSTALL ${SOURCE_PATH}/readme.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pugixml/pugixml-v1.10_fix_debug_pkgconfig.patch b/ports/pugixml/pugixml-v1.10_fix_debug_pkgconfig.patch new file mode 100644 index 00000000000000..24d428d98a1c32 --- /dev/null +++ b/ports/pugixml/pugixml-v1.10_fix_debug_pkgconfig.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f043962..b281cba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -94,6 +94,16 @@ install(TARGETS ${LIBRARY} EXPORT pugixml-config + install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX}) + install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml) + ++if (USE_POSTFIX) ++ if(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) ++ set(LIB_POSTFIX "_r") ++ elseif(CMAKE_BUILD_TYPE MATCHES MinSizeRel) ++ set(LIB_POSTFIX "_m") ++ elseif(CMAKE_BUILD_TYPE MATCHES Debug) ++ set(LIB_POSTFIX "_d") ++ endif() ++endif() ++ + configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY) + install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig) + +diff --git a/scripts/pugixml.pc.in b/scripts/pugixml.pc.in +index f9c3fd4..7958774 100644 +--- a/scripts/pugixml.pc.in ++++ b/scripts/pugixml.pc.in +@@ -8,4 +8,4 @@ Description: Light-weight, simple and fast XML parser for C++ with XPath support + URL: https://pugixml.org/ + Version: @pugixml_VERSION@ + Cflags: -I${includedir} +-Libs: -L${libdir} -lpugixml ++Libs: -L${libdir} -lpugixml@LIB_POSTFIX@ diff --git a/ports/pybind11/CONTROL b/ports/pybind11/CONTROL index 8c50388da0793d..b01861122535e4 100644 --- a/ports/pybind11/CONTROL +++ b/ports/pybind11/CONTROL @@ -1,5 +1,5 @@ Source: pybind11 -Version: 2.4.3 +Version: 2.5.0 Homepage: https://github.com/pybind/pybind11 Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. -Build-Depends: python3 (windows) \ No newline at end of file +Build-Depends: python3 (windows) diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index 8c2a8fdde458c8..0c8778a7f90fbb 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -1,17 +1,14 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pybind/pybind11 - REF 80d452484c5409444b0ec19383faa84bb7a4d351 # v2.4.3 - SHA512 987f8c075ff3e4f90ab27a6121f3767a82939e35cd2143649819c8d39b09d1c234d39fa204ed5f6bd1d9ec97c275f590df358769d7726a16ccb720a91c550883 + REF 3b1dbebabc801c9cf6f0953a4c20b904d444f879 # v2.5.0 + SHA512 1a75d29447dbba96eebf8ecdebad1be0dd5327c32f5122b0ece9d9ec22eae4feacd0efb3a5070b3a135a892b1682c7215b0c529b179493694df932945a379f4c HEAD_REF master ) vcpkg_find_acquire_program(PYTHON3) - get_filename_component(PYPATH ${PYTHON3} PATH) -set(ENV{PATH} "$ENV{PATH};${PYPATH}") +vcpkg_add_to_path("${PYPATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -34,4 +31,4 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/) # copy license -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pybind11/copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/python3/0001-static-library.patch b/ports/python3/0001-static-library.patch new file mode 100644 index 00000000000000..d9d6024d0d0792 --- /dev/null +++ b/ports/python3/0001-static-library.patch @@ -0,0 +1,63 @@ +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index b6b8d445869bc..35b329f307c12 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -257,6 +257,7 @@ typedef int pid_t; + + /* For Windows the Python core is in a DLL by default. Test + Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ ++#define Py_NO_ENABLE_SHARED + #if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED) + # define Py_ENABLE_SHARED 1 /* standard symbol for shared library */ + # define MS_COREDLL /* deprecated old symbol */ +@@ -282,6 +283,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ + # endif /* _DEBUG */ + # endif /* _MSC_VER */ + # endif /* Py_BUILD_CORE */ ++#else ++ /* So MSVC users need not specify the .lib file in their own config */ ++# pragma comment(lib, "version.lib") ++# pragma comment(lib, "shlwapi.lib") ++# pragma comment(lib, "ws2_32.lib") + #endif /* MS_COREDLL */ + + #if defined(MS_WIN64) +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index 0666b90f66cc9..ca83b82d8a0fe 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -73,7 +73,7 @@ + + + +- DynamicLibrary ++ StaticLibrary + false + + +@@ -102,12 +102,24 @@ + /Zm200 %(AdditionalOptions) + $(PySourcePath)Python;%(AdditionalIncludeDirectories) + $(zlibDir);%(AdditionalIncludeDirectories) +- _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) ++ _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) + _Py_HAVE_ZLIB;%(PreprocessorDefinitions) + + + version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) + ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ + + + diff --git a/ports/python3/0002-static-crt.patch b/ports/python3/0002-static-crt.patch new file mode 100644 index 00000000000000..362610f38c0f20 --- /dev/null +++ b/ports/python3/0002-static-crt.patch @@ -0,0 +1,15 @@ +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index ca83b82d8a0fe..b925a26a96e5e 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -104,6 +104,10 @@ + $(zlibDir);%(AdditionalIncludeDirectories) + _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) + _Py_HAVE_ZLIB;%(PreprocessorDefinitions) ++ MultiThreadedDebug ++ MultiThreadedDebug ++ MultiThreaded ++ MultiThreaded + + + version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL index 074641ea8dd0bf..2df8d9472f54a7 100644 --- a/ports/python3/CONTROL +++ b/ports/python3/CONTROL @@ -1,8 +1,9 @@ Source: python3 -Version: 3.7.3-1 +Version: 3.8.3 +Port-Version: 1 Homepage: https://github.com/python/cpython Description: The Python programming language as an embeddable library -Build-Depends: libffi, openssl +Build-Depends: libffi, openssl, zlib (!uwp&!windows) Feature: enable-shared Description: Build shared libraries in addition to static ones built by default diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index dc9e0efa3cc8e3..c680aeb2e049ef 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -4,20 +4,33 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static endif() set(PYTHON_VERSION_MAJOR 3) -set(PYTHON_VERSION_MINOR 7) +set(PYTHON_VERSION_MINOR 8) set(PYTHON_VERSION_PATCH 3) set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}) +if(VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + list(APPEND PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-static-library.patch) + endif() + if (VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND PATCHES ${CMAKE_CURRENT_LIST_DIR}/0002-static-crt.patch) + endif() +endif() + vcpkg_from_github( OUT_SOURCE_PATH TEMP_SOURCE_PATH REPO python/cpython REF v${PYTHON_VERSION} - SHA512 023960a2f570fe7178d3901df0c3c33346466906b6d55c73ef7947c19619dbab62efc42c7262a0539bc5e31543b1113eb7a088d4615ad7557a0707bdaca27940 + SHA512 eb264a858ef55f2f61b53f663454be6e99ffe9035d8fcdb3366d7a08fd3b295613e5d15e93e2e4b9b18ad297d8c17139bde5e90e396db04fe04c6f441a443fd2 HEAD_REF master + PATCHES ${PATCHES} ) if("enable-shared" IN_LIST FEATURES) set(_ENABLED_SHARED --enable-shared) + if(VCPKG_TARGET_IS_LINUX) + message(WARNING"Feature enable-shared requires libffi-devel from the system package manager, please install it on Ubuntu system via sudo apt-get install libffi-dev.") + endif() else() unset(_ENABLED_SHARED) endif() @@ -30,9 +43,6 @@ if (VCPKG_TARGET_IS_WINDOWS) file(REMOVE_RECURSE ${SOURCE_PATH}) file(RENAME "${TEMP_SOURCE_PATH}" ${SOURCE_PATH}) - # We need per-triplet directories because we need to patch the project files differently based on the linkage - # Because the patches patch the same file, they have to be applied in the correct order - if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(BUILD_ARCH "Win32") set(OUT_DIR "win32") @@ -47,12 +57,11 @@ if (VCPKG_TARGET_IS_WINDOWS) PROJECT_PATH ${SOURCE_PATH}/PCBuild/pythoncore.vcxproj PLATFORM ${BUILD_ARCH}) - file(GLOB HEADERS ${SOURCE_PATH}/Include/*.h) file(INSTALL - ${HEADERS} + "${SOURCE_PATH}/Include/" "${SOURCE_PATH}/PC/pyconfig.h" - DESTINATION - "${CURRENT_PACKAGES_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" + DESTINATION "${CURRENT_PACKAGES_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" + FILES_MATCHING PATTERN *.h ) file(INSTALL "${SOURCE_PATH}/Lib" @@ -139,24 +148,16 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_build_process( - COMMAND make -j ${VCPKG_CONCURRENCY} - NO_PARALLEL_COMMAND make + COMMAND make install -j ${VCPKG_CONCURRENCY} + NO_PARALLEL_COMMAND make install WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} LOGNAME make-build-${TARGET_TRIPLET}-release ) - message(STATUS "Installing ${TARGET_TRIPLET}-rel") - vcpkg_execute_build_process( - COMMAND make install - WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} - LOGNAME make-install-${TARGET_TRIPLET}-release - ) - message(STATUS "Installing ${TARGET_TRIPLET}-rel headers...") - file(GLOB HEADERS - ${OUT_PATH_RELEASE}/include/*) - file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include - PATTERN "*__pycache__*" EXCLUDE + file(INSTALL "${OUT_PATH_RELEASE}/include/" + DESTINATION ${CURRENT_PACKAGES_DIR}/include + FILES_MATCHING PATTERN *.h ) message(STATUS "Installing ${TARGET_TRIPLET}-rel lib files...") @@ -177,7 +178,7 @@ 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}m.*) + ${OUT_PATH_RELEASE}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.*) file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE @@ -223,22 +224,15 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) message(STATUS "Building ${TARGET_TRIPLET}-dbg") vcpkg_execute_build_process( - COMMAND make -j ${VCPKG_CONCURRENCY} - NO_PARALLEL_COMMAND make + COMMAND make install -j ${VCPKG_CONCURRENCY} + NO_PARALLEL_COMMAND make install WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} LOGNAME make-build-${TARGET_TRIPLET}-debug ) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg") - vcpkg_execute_build_process( - COMMAND make install - WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} - LOGNAME make-install-${TARGET_TRIPLET}-debug - ) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg Python library files...") file(GLOB LIBS - ${OUT_PATH_DEBUG}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}dm.*) + ${OUT_PATH_DEBUG}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}d.*) file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib PATTERN "*.pyc" EXCLUDE PATTERN "*__pycache__*" EXCLUDE diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index 356dff560b22e2..0eadcc148d7324 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,5 +1,5 @@ Source: qca -Version: 2.2.1 +Version: 2.2.1-1 Description: Qt Cryptographic Architecture (QCA). Homepage: https://cgit.kde.org/qca.git/ -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qcustomplot/CONTROL b/ports/qcustomplot/CONTROL index 90eb89b22ef4d0..ec7dac08fc670c 100644 --- a/ports/qcustomplot/CONTROL +++ b/ports/qcustomplot/CONTROL @@ -1,4 +1,4 @@ Source: qcustomplot -Version: 2.0.1-3 +Version: 2.0.1-4 Description: QCustomPlot is a Qt C++ widget for plotting and data visualization. -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qhull/CONTROL b/ports/qhull/CONTROL index e27ef1af22d17e..4fd05103aae041 100644 --- a/ports/qhull/CONTROL +++ b/ports/qhull/CONTROL @@ -1,4 +1,4 @@ Source: qhull -Version: 7.3.2-2 +Version: 8.0.0 Homepage: https://github.com/qhull/qhull Description: computes the convex hull, Delaunay triangulation, Voronoi diagram diff --git a/ports/qhull/mac-fix.patch b/ports/qhull/mac-fix.patch index 9af0a1c7e913ad..96f16df07c2c31 100644 --- a/ports/qhull/mac-fix.patch +++ b/ports/qhull/mac-fix.patch @@ -1,37 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 07d3da2..14df8e9 100644 +index bf7a259..b527e23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -626,18 +626,18 @@ install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets - include(CMakePackageConfigHelpers) - - write_basic_package_version_file( -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" - VERSION ${qhull_VERSION} - COMPATIBILITY AnyNewerVersion - ) - - export(EXPORT QhullTargets -- FILE "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullTargets.cmake" -+ FILE "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullTargets.cmake" - NAMESPACE Qhull:: - ) - - configure_file(${PROJECT_SOURCE_DIR}/build/config.cmake.in -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" - @ONLY - ) - -@@ -652,8 +652,8 @@ install(EXPORT QhullTargets - ) - install( - FILES -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" - DESTINATION - ${ConfigPackageLocation} - COMPONENT +@@ -67,6 +67,8 @@ + project(qhull) + cmake_minimum_required(VERSION 3.0) + ++set(CMAKE_CXX_STANDARD 11) ++ + # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt + # qhull-zip.sh (twice), qhull-wiki.md, qhull-news.htm, File_id.diz, index.htm + # Makefile (SO), qhull-warn.pri (VERSION), qhull-exports.def (VERSION 8.0), qhull_p-exports.def, qhull_r-exports.def diff --git a/ports/qhull/portfile.cmake b/ports/qhull/portfile.cmake index 7792064157a36a..d67114dd6855d0 100644 --- a/ports/qhull/portfile.cmake +++ b/ports/qhull/portfile.cmake @@ -3,18 +3,17 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO qhull/qhull - REF v7.3.2 # Qhull 2019.1 - SHA512 aea2c70179de10f648aba960129a3b9a3fe309a0eb085bdb86f697e3d4b214570c241e88d4f0b4d2974137759ee7086452d0a3957c4b2a256708402fb3c9eb3d + REF v8.0.0 # Qhull 2020.1 + SHA512 b6ac17193b7c8a4ffb5f5a64cc057d1d5123f155f1c4fcd290fe1768356fef5c58d511707bba8c4814ca754bc6cdf5c370af23953d00c24a5ec28b8a1e489d31 HEAD_REF master PATCHES - uwp.patch mac-fix.patch ) -if(${TARGET_TRIPLET} STREQUAL "x64-windows-static") +if(${TARGET_TRIPLET} STREQUAL "x64-windows-static") # workaround for visual studio toolset regression LNK1201 (remove if solved) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS -DINCLUDE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/include -DMAN_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/doc/qhull -DDOC_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/doc/qhull @@ -27,7 +26,7 @@ else() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS -DINCLUDE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/include -DMAN_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/doc/qhull -DDOC_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/doc/qhull @@ -40,7 +39,7 @@ endif() vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Qhull) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Qhull) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(GLOB_RECURSE HTMFILES ${CURRENT_PACKAGES_DIR}/include/*.htm) diff --git a/ports/qhull/uwp.patch b/ports/qhull/uwp.patch deleted file mode 100644 index 98c74564efdda2..00000000000000 --- a/ports/qhull/uwp.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/libqhull/global.c b/src/libqhull/global.c -index e7de8e6..81be9df 100644 ---- a/src/libqhull/global.c -+++ b/src/libqhull/global.c -@@ -636,7 +636,7 @@ void qh_init_qhull_command(int argc, char *argv[]) { - */ - void qh_initflags(char *command) { - int k, i, lastproject; -- char *s= command, *t, *prev_s, *start, key, *lastwarning= NULL; -+ char *s= command, *t = NULL, *prev_s, *start, key, *lastwarning= NULL; - boolT isgeom= False, wasproject; - realT r; - -diff --git a/src/libqhull_r/global_r.c b/src/libqhull_r/global_r.c -index 3e6919f..8d13e47 100644 ---- a/src/libqhull_r/global_r.c -+++ b/src/libqhull_r/global_r.c -@@ -610,7 +610,7 @@ void qh_init_qhull_command(qhT *qh, int argc, char *argv[]) { - */ - void qh_initflags(qhT *qh, char *command) { - int k, i, lastproject; -- char *s= command, *t, *prev_s, *start, key, *lastwarning= NULL; -+ char *s= command, *t = NULL, *prev_s, *start, key, *lastwarning= NULL; - boolT isgeom= False, wasproject; - realT r; - diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index de162235454ff2..6f730f9931c6bc 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -1,5 +1,5 @@ Source: qscintilla -Version: 2.10-11 -Homepage: https://sourceforge.net/projects/pyqt +Version: 2.11.4-2 +Homepage: https://www.riverbankcomputing.com/software/qscintilla Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin) -Build-Depends: qt5-base, qt5-macextras (osx), qt5-winextras (windows) +Build-Depends: qt5-base[core], qt5-macextras (osx), qt5-winextras (windows) \ No newline at end of file diff --git a/ports/qscintilla/fix-static.patch b/ports/qscintilla/fix-static.patch new file mode 100644 index 00000000000000..f3a4a616d7899e --- /dev/null +++ b/ports/qscintilla/fix-static.patch @@ -0,0 +1,29 @@ +diff --git a/Qt4Qt5/qscintilla.pro b/Qt4Qt5/qscintilla.pro +index 075079c32..8ff8678b6 100644 +--- a/Qt4Qt5/qscintilla.pro ++++ b/Qt4Qt5/qscintilla.pro +@@ -37,13 +37,13 @@ CONFIG(debug, debug|release) { + TARGET = qscintilla2_qt$${QT_MAJOR_VERSION} + } + +-macx:!CONFIG(staticlib) { ++macx:!CONFIG(static) { + QMAKE_POST_LINK += install_name_tool -id @rpath/$(TARGET1) $(TARGET) + } + + INCLUDEPATH += . ../include ../lexlib ../src + +-!CONFIG(staticlib) { ++!CONFIG(static) { + DEFINES += QSCINTILLA_MAKE_DLL + } + DEFINES += SCINTILLA_QT SCI_LEXER INCLUDE_DEPRECATED_FEATURES +@@ -90,7 +90,7 @@ greaterThan(QT_MAJOR_VERSION, 4) { + } else { + features.path = $$[QT_INSTALL_DATA]/mkspecs/features + } +-CONFIG(staticlib) { ++CONFIG(static) { + features.files = $$PWD/features_staticlib/qscintilla2.prf + } else { + features.files = $$PWD/features/qscintilla2.prf diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index d34d5517cd9881..8ef89729015b30 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -1,23 +1,21 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10/QScintilla_gpl-2.10.zip" - FILENAME "QScintilla_gpl-2.10.zip" - SHA512 7c580cfee03af1056f530af756a0ff9cc2396a5419fa23aecc66a6bc8809a4fb154788956220bb0b068a5c214d571c053271c3906d6d541196fbbf7c6dbec917 + URLS "https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.11.4/QScintilla-2.11.4.tar.gz" + FILENAME "QScintilla-2.11.4.tar.gz" + SHA512 90fc2427121ca9ae55e34cf636460099bbdadd844318d9ef05f86790a36e25fb64528264bb7bb99e46b7add96378eff0cc69bb692940c6a1bddfadf86a9abdbd ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} + PATCHES + fix-static.patch ) vcpkg_find_acquire_program(PYTHON3) # Add python3 to path -get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY) -vcpkg_add_to_path(PREPEND ${PYTHON_PATH}) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin) +get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY) +vcpkg_add_to_path(${PYTHON3_PATH}) vcpkg_configure_qmake( SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5 @@ -42,5 +40,4 @@ file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/Qsci) vcpkg_copy_pdbs() # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/qscintilla) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/qscintilla/LICENSE ${CURRENT_PACKAGES_DIR}/share/qscintilla/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qt-advanced-docking-system/CONTROL b/ports/qt-advanced-docking-system/CONTROL index 3e22fb7cfb7ef9..81ef72515fe668 100644 --- a/ports/qt-advanced-docking-system/CONTROL +++ b/ports/qt-advanced-docking-system/CONTROL @@ -1,4 +1,5 @@ -Source: qt-advanced-docking-system -Version: 2019-08-14-1 -Build-Depends: qt5-base, zlib, bzip2 -Description: Create customizable layouts using an advanced window docking system similar to what is found in many popular IDEs such as Visual Studio +Source: qt-advanced-docking-system +Version: 3.2.5-2 +Build-Depends: qt5-base[core], zlib, bzip2 +Description: Create customizable layouts using an advanced window docking system similar to what is found in many popular IDEs such as Visual Studio +Homepage: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System diff --git a/ports/qt-advanced-docking-system/config_changes.patch b/ports/qt-advanced-docking-system/config_changes.patch index ea9fd280106ef8..8063b3006af7fb 100644 --- a/ports/qt-advanced-docking-system/config_changes.patch +++ b/ports/qt-advanced-docking-system/config_changes.patch @@ -1,36 +1,47 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8a9f919..9c2b8ad 100644 +index 578dfc1..a4c9460 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -62,7 +62,7 @@ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") +@@ -70,7 +70,7 @@ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") else() set(ads_PlatformDir "x64") endif() -if(BUILD_STATIC) +if(NOT BUILD_SHARED_LIBS) add_library(qtadvanceddocking STATIC ${ads_SRCS}) - set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ADS_STATIC) + target_compile_definitions(qtadvanceddocking PUBLIC ADS_STATIC) else() -@@ -80,7 +80,7 @@ install(FILES +@@ -88,7 +88,7 @@ install(FILES COMPONENT license ) install(TARGETS qtadvanceddocking -- EXPORT adsBinary +- EXPORT adsTargets + EXPORT qt-advanced-docking-systemConfig - RUNTIME DESTINATION bin COMPONENT library - LIBRARY DESTINATION lib COMPONENT library - ARCHIVE DESTINATION lib COMPONENT library -@@ -93,7 +93,6 @@ target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS}) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +@@ -100,14 +100,8 @@ write_basic_package_version_file("adsConfigVersion.cmake" + VERSION ${ads_VERSION} + COMPATIBILITY SameMajorVersion + ) +-install(EXPORT adsTargets +- FILE adsTargets.cmake +- NAMESPACE ads:: +- DESTINATION lib/cmake/ads +-) +-install(FILES "adsConfig.cmake" "${CMAKE_BINARY_DIR}/adsConfigVersion.cmake" +- DESTINATION lib/cmake/ads +-) ++ ++install(EXPORT qt-advanced-docking-systemConfig NAMESPACE qt-advanced-docking-system:: DESTINATION share/qt-advanced-docking-system) + + target_include_directories(qtadvanceddocking PUBLIC + "$" +@@ -117,7 +111,6 @@ target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS}) target_compile_definitions(qtadvanceddocking PRIVATE ${ads_COMPILE_DEFINE}) set_target_properties(qtadvanceddocking PROPERTIES VERSION ${ads_VERSION} -- EXPORT_NAME "Qt Advanced Docking System" +- EXPORT_NAME "QtAdvancedDockingSystem" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin" -@@ -103,3 +102,4 @@ if(BUILD_EXAMPLES) - add_subdirectory(demo) - endif() - -+install(EXPORT qt-advanced-docking-systemConfig NAMESPACE qt-advanced-docking-system:: DESTINATION share/qt-advanced-docking-system) -\ No newline at end of file diff --git a/ports/qt-advanced-docking-system/portfile.cmake b/ports/qt-advanced-docking-system/portfile.cmake index 2a53981cb1bf73..dd70c21e2b92d7 100644 --- a/ports/qt-advanced-docking-system/portfile.cmake +++ b/ports/qt-advanced-docking-system/portfile.cmake @@ -1,13 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO githubuser0xFFFF/Qt-Advanced-Docking-System - REF a2b07fd97f0fac63fd7a0ed7b1eb0692b3efab71 - SHA512 a44babd6100f299aea7fcf2d730874e204151ce363e1f58a2be938f70d28b07f3cb39adfbf46527fdacc3b12a630e7d97851e4a6fcd04e750a007ee06d06d3b5 + REF 661d0c4356ab61d155b53718aa1bf6bab86dad13 + SHA512 3504d91b63cc68abbc56e935f22dda2e5b667400501b547a159e3e43d5862c2cff5739423606732361b331b00596202a19a67c3273948cccfbdb8593970cb840 HEAD_REF master PATCHES config_changes.patch + skip_license_install.patch ) vcpkg_configure_cmake( @@ -18,8 +17,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt-advanced-docking-system RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/gnu-lgpl-v2.1.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/license) vcpkg_fixup_cmake_targets() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) \ No newline at end of file +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/qt-advanced-docking-system/skip_license_install.patch b/ports/qt-advanced-docking-system/skip_license_install.patch new file mode 100644 index 00000000000000..e6cfb32a5fac62 --- /dev/null +++ b/ports/qt-advanced-docking-system/skip_license_install.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a2cb47d..57a1cf5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,14 +81,8 @@ install(FILES ${ads_INSTALL_INCLUDE} + DESTINATION include + COMPONENT headers + ) +-install(FILES +- "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" +- "${CMAKE_CURRENT_SOURCE_DIR}/gnu-lgpl-v2.1.md" +- DESTINATION license +- COMPONENT license +-) + install(TARGETS qtadvanceddocking + EXPORT qt-advanced-docking-systemConfig + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib diff --git a/ports/qt5-3d/CONTROL b/ports/qt5-3d/CONTROL index 1b8f0cd61d4f3a..179432bfbada17 100644 --- a/ports/qt5-3d/CONTROL +++ b/ports/qt5-3d/CONTROL @@ -1,4 +1,4 @@ Source: qt5-3d -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering -Build-Depends: qt5-base, qt5-declarative, qt5-imageformats, qt5-gamepad +Build-Depends: qt5-base[core], qt5-declarative, qt5-imageformats, qt5-gamepad diff --git a/ports/qt5-activeqt/CONTROL b/ports/qt5-activeqt/CONTROL index e5667f7c28145e..dc7a4cd81b43ec 100644 --- a/ports/qt5-activeqt/CONTROL +++ b/ports/qt5-activeqt/CONTROL @@ -1,5 +1,5 @@ Source: qt5-activeqt -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 ActiveQt Module - ActiveX components -Build-Depends: qt5-base +Build-Depends: qt5-base[core], qt5-declarative Supports: windows \ No newline at end of file diff --git a/ports/qt5-androidextras/CONTROL b/ports/qt5-androidextras/CONTROL new file mode 100644 index 00000000000000..d10b89be0932f5 --- /dev/null +++ b/ports/qt5-androidextras/CONTROL @@ -0,0 +1,5 @@ +Source: qt5-androidextras +Version: 5.15.0 +Description: Qt5 androidextras Module; +Build-Depends: qt5-base[core] +Supports: android \ No newline at end of file diff --git a/ports/qt5-androidextras/portfile.cmake b/ports/qt5-androidextras/portfile.cmake new file mode 100644 index 00000000000000..214726759f3cf1 --- /dev/null +++ b/ports/qt5-androidextras/portfile.cmake @@ -0,0 +1,2 @@ +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 9109ea40cf48bb..28247c42d506bc 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,8 +1,9 @@ -Source: qt5-base -Version: 5.12.5-13 -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) - -Feature: latest -Description: Build latest qt version (5.13.1) instead of LTS +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, 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/configure_qt.cmake b/ports/qt5-base/cmake/configure_qt.cmake index 623924d71e9091..a6bf1dd24c947f 100644 --- a/ports/qt5-base/cmake/configure_qt.cmake +++ b/ports/qt5-base/cmake/configure_qt.cmake @@ -77,8 +77,10 @@ function(configure_qt) -extprefix ${CURRENT_INSTALLED_DIR} ${EXT_BIN_DIR} -hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}} + #-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5 -hostlibdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/lib # could probably be move to manual-link -hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/bin + #-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin # Qt VS Plugin requires a /bin subfolder with the executables in the root dir. But to use the wizard a correctly setup lib folder is also required # So with the vcpkg layout there is no way to make it work unless all dll are are copied to tools/qt5/bin and all libs to tools/qt5/lib -archdatadir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}} diff --git a/ports/qt5-base/cmake/find_qt_mkspec.cmake b/ports/qt5-base/cmake/find_qt_mkspec.cmake index 035aec1adc4cfb..c9c06c8bd9df17 100644 --- a/ports/qt5-base/cmake/find_qt_mkspec.cmake +++ b/ports/qt5-base/cmake/find_qt_mkspec.cmake @@ -77,10 +77,10 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_ else() endif() foreach(_triplet ${_test_triplets}) - find_program(QMAKE_PATH qmake PATHS ${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5/bin NO_DEFAULT_PATHS) - message(STATUS "Checking: ${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5/bin. ${QMAKE_PATH}") + find_program(QMAKE_PATH qmake PATHS ${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5/bin NO_DEFAULT_PATHS) + message(STATUS "Checking: ${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5/bin. ${QMAKE_PATH}") if(QMAKE_PATH) - set(_tmp_host_root "${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5") + set(_tmp_host_root "${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5") set(_tmp_host_qmake ${QMAKE_PATH} PARENT_SCOPE) message(STATUS "Qt host tools root dir within vcpkg: ${_tmp_host_root}") break() @@ -98,4 +98,4 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_ set(${EXT_HOST_TOOLS_OUT} ${_tmp_host_root} PARENT_SCOPE) endif() -endfunction() \ No newline at end of file +endfunction() diff --git a/ports/qt5-base/cmake/install_qt.cmake b/ports/qt5-base/cmake/install_qt.cmake index 9f9b3ea2a9ce2a..97f2e71a20e920 100644 --- a/ports/qt5-base/cmake/install_qt.cmake +++ b/ports/qt5-base/cmake/install_qt.cmake @@ -1,38 +1,13 @@ include(qt_fix_makefile_install) function(install_qt) - cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) - - if (_bc_DISABLE_PARALLEL) - set(NUMBER_OF_PROCESSORS "1") - else() - if(DEFINED ENV{NUMBER_OF_PROCESSORS}) - set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS}) - elseif(VCPKG_TARGET_IS_OSX) - execute_process( - COMMAND sysctl -n hw.ncpu - OUTPUT_VARIABLE NUMBER_OF_PROCESSORS - ) - string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") - string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") - else() - execute_process( - COMMAND nproc - OUTPUT_VARIABLE NUMBER_OF_PROCESSORS - ) - string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") - string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") - endif() - endif() - - message(STATUS "NUMBER_OF_PROCESSORS is ${NUMBER_OF_PROCESSORS}") - if(CMAKE_HOST_WIN32) vcpkg_find_acquire_program(JOM) - set(INVOKE "${JOM}" /J ${NUMBER_OF_PROCESSORS}) + set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY}) + set(INVOKE_SINGLE "${JOM}" /J 1) else() find_program(MAKE make) - set(INVOKE "${MAKE}" -j${NUMBER_OF_PROCESSORS}) + set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY}) set(INVOKE_SINGLE "${MAKE}" -j1) endif() vcpkg_find_acquire_program(PYTHON3) @@ -71,10 +46,10 @@ function(install_qt) set(_build_type_${_buildname} "release") endif() unset(_buildname) - + foreach(_buildname ${BUILDTYPES}) set(_build_triplet ${TARGET_TRIPLET}-${_short_name_${_buildname}}) - + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/bin") if(VCPKG_TARGET_IS_OSX) @@ -86,14 +61,15 @@ function(install_qt) LOGNAME cleaning-1-${_build_triplet} ) 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} ) - + if(VCPKG_TARGET_IS_OSX) # For some reason there will be an error on MacOSX without this clean! message(STATUS "Cleaning after build before install ${_build_triplet}") @@ -103,7 +79,7 @@ function(install_qt) LOGNAME cleaning-2-${_build_triplet} ) endif() - + message(STATUS "Fixing makefile installation path ${_build_triplet}") qt_fix_makefile_install("${CURRENT_BUILDTREES_DIR}/${_build_triplet}") message(STATUS "Installing ${_build_triplet}") @@ -115,7 +91,4 @@ function(install_qt) message(STATUS "Package ${_build_triplet} done") set(ENV{PATH} "${_path}") endforeach() - - - endfunction() diff --git a/ports/qt5-base/cmake/qt_build_submodule.cmake b/ports/qt5-base/cmake/qt_build_submodule.cmake index 18925adc1fcdad..b30ef029909300 100644 --- a/ports/qt5-base/cmake/qt_build_submodule.cmake +++ b/ports/qt5-base/cmake/qt_build_submodule.cmake @@ -99,4 +99,28 @@ function(qt_build_submodule SOURCE_PATH) endforeach() endif() endif() + + #This should be removed if somehow possible + if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/qt5/debug/bin") + set(CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}") + set(CURRENT_INSTALLED_DIR "./../../../.." ) # Making the qt.conf relative and not absolute + configure_file(${CURRENT_INSTALLED_DIR_BACKUP}/tools/qt5/qt_debug.conf ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/qt.conf) # This makes the tools at least useable for release + set(CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}") + + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin") + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(GLOB_RECURSE DLL_DEPS_AVAIL "${CURRENT_INSTALLED_DIR}/tools/qt5/debug/bin/*.dll") + string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/qt5/debug/bin/" "" DLL_DEPS_AVAIL "${DLL_DEPS_AVAIL}") + file(GLOB_RECURSE DLL_DEPS_NEEDED "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/*.dll") + string(REPLACE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/" "" DLL_DEPS_NEEDED "${DLL_DEPS_NEEDED}") + if(DLL_DEPS_AVAIL AND DLL_DEPS_NEEDED) + list(REMOVE_ITEM DLL_DEPS_NEEDED ${DLL_DEPS_AVAIL}) + endif() + foreach(dll_dep ${DLL_DEPS_NEEDED}) + string(REGEX REPLACE "[^/]+$" "" dll_subpath "${dll_dep}") + file(COPY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/${dll_dep}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/qt5/debug/bin/${dll_subpath}") + endforeach() + endif() + endif() + endfunction() \ No newline at end of file diff --git a/ports/qt5-base/cmake/qt_install_copyright.cmake b/ports/qt5-base/cmake/qt_install_copyright.cmake index 0f7e60cc76269d..ba4d70c28a1017 100644 --- a/ports/qt5-base/cmake/qt_install_copyright.cmake +++ b/ports/qt5-base/cmake/qt_install_copyright.cmake @@ -11,6 +11,8 @@ function(qt_install_copyright SOURCE_PATH) set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT") set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT") + elseif(EXISTS "${SOURCE_PATH}/LICENSE.FDL") + set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.FDL") endif() file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endfunction() \ No newline at end of file diff --git a/ports/qt5-base/cmake/qt_port_hashes.cmake b/ports/qt5-base/cmake/qt_port_hashes.cmake index d3ad2a0ee12035..576ec28e345721 100644 --- a/ports/qt5-base/cmake/qt_port_hashes.cmake +++ b/ports/qt5-base/cmake/qt_port_hashes.cmake @@ -1,45 +1,55 @@ #Every update requires an update of these hashes and the version within the control file of each of the 32 ports. #So it is probably better to have a central location for these hashes and let the ports update via a script -set(QT_MAJOR_MINOR_VER 5.12) -set(QT_PATCH_VER 5) +set(QT_MAJOR_MINOR_VER 5.15) +set(QT_PATCH_VER 0) set(QT_UPDATE_VERSION 0) # Switch to update qt and not build qt. Creates a file cmake/qt_new_hashes.cmake in qt5-base with the new hashes. set(QT_PORT_LIST base 3d activeqt charts connectivity datavis3d declarative gamepad graphicaleffects imageformats location macextras mqtt multimedia networkauth purchasing quickcontrols quickcontrols2 remoteobjects script scxml sensors serialport speech svg tools virtualkeyboard webchannel websockets - webview winextras xmlpatterns) + webview winextras xmlpatterns doc x11extras androidextras translations serialbus webengine webglplugin wayland) -set(QT_HASH_qt5-base 9a95060318cadfcd6dace6b28353fa868a8dcfe9def0bd884edf7d9f72606bae625de0269323a94b81d594a6c398106c266304106329b79c7dae4e5b88269660) -set(QT_HASH_qt5-3d 8cc23417b4a41bf9d19052e05c7e3be8773be062f1f5998a7784573ef9c35a04da50ce67a65b3709065bb3cf243aac8ede4bea60f0420a5400cbe6c9c7bdf05b) -set(QT_HASH_qt5-activeqt 6233bb64ca45b6b0065afa50a3082c6df7e4e20d36040dfaf391e02876f50c41ec293db79a13636aeae9469deefad35ced42902548f9fcd78476359ad4450bee) -set(QT_HASH_qt5-charts a3ba8c6a606430cd87f85661116dbb2692e0bb472f0a73310aca1950f4437563d04ee950437a48a399b1a4881dd264cd1e6fdd4f30b6c3110704ec48d1467da1) -set(QT_HASH_qt5-connectivity 96cdb27aa0e439094e3f1de0c7a680973c3ce2c65bbbff38affe25a3708c9e4e3c1c6a403d698303f77a5f261b44ac657e01a769b62a1565e0a8c64c8ac80bd5) -set(QT_HASH_qt5-datavis3d 7911d911678827ca4a704b824b8841c8e8508484fb83265d4d05e64787ac1184387b9ed0870090b3233c736f5e484adc7776ba12a1173da0fceeaac46845c6f4) -set(QT_HASH_qt5-declarative 026c5024c06e44b6e91099d1ee912f38017f314ae0125227010d25d733447c692299cc7c47edc1a4bf39366a9c9c9fe77d3a249905f2ae982d0725317d824b9b) -set(QT_HASH_qt5-gamepad bc4148bb75de53dd0885fc25ce7d679d7a5426a23ce9c93482fd11e8d6003cebe4c958fc07f17817a43f1d4449756deff24c0350fd33e100aeb2c302c650ae33) -set(QT_HASH_qt5-graphicaleffects 489a308af5f56ff2b023375ddf705f8a1b15c0e1fb1ec3bc6e5f66a80b5863d63aa0e57a3aef025ab965694add8d71424123bca120ce8d8b8448e7218f7fc640) -set(QT_HASH_qt5-imageformats 9fa76b7eec083596c45f68642b49dc88c2759a28cb9359935c3a64604082acea9adecee49bb0828cc587b86d469aec7169f8f72f83a15194c4fc10f0ca25fae0) -set(QT_HASH_qt5-location fe82194e4e6bc2a2e6e3c55e3360afdfd56a6495a8d87bfbdceb29255430954d4c1adc62f1f82e63b23778f0bf03b0a50d6f5d2a963bd786f2cf2fbed7450ccc) -set(QT_HASH_qt5-macextras 80779bf9c49ff89b866327a3358cede9308c41d6a49d8d6aa29661f4ad98d191c2f68d9af0d89be36fe54d094972f7a7689ecc26bc2bfcf53e9be1305e107178) -set(QT_HASH_qt5-mqtt 3167de873dc3d42607440237c7b341c270079a1edd72588ebe95082ab209bbd24496d60d41c87ade166b595fda924a52cb2ff0efd05b48aa4c77c7b51b125f36) -set(QT_HASH_qt5-multimedia a59983d887c8de462399fd53beb640c1b865c17f8b1a83635c2e1d27903861dd588eb64935d7c02d733c51c9a21174065e70a5fc1aa78600e5540c489b7695a3) -set(QT_HASH_qt5-networkauth d7849518614a7bdb2ddbcf92b773f5e7c26f1af4ba07f0304b4634ed69bf3c17798509d28af2c49aba0cfad35a1cad5bda27acdbde3aa8d86038efeb9f5001e0) -set(QT_HASH_qt5-purchasing b9f7e43cf4a8e23bc167d2473fa6f8af47455f066b584daf18d97d4a67dd766aaf17c7b897b2bae20cf636253174430be664815e1e86aeb07ed870bb2969ad0d) -set(QT_HASH_qt5-quickcontrols 4539a6ce1ee20f71f6bf48271bc3fe1125bd21899cf36142d1c3d41a68ba56211f27d6e4403c69e86bd4698c7c7c79bc60f2a78ef1b19c5eab5b8690d1a01037) -set(QT_HASH_qt5-quickcontrols2 afbd742783d83eabf182031e218c2f611709cd66f2b4886317bd356ffff2afabe820e1f552f478a0c3f74daf6fd1f5256900448f5445b84792d6a71b42ccd20a) -set(QT_HASH_qt5-remoteobjects ed3314b1c66f9375bdc101029eaf730a630157ee41c094de2ff9cc5340c3c92a781dcb2b2cf0b8bbad8b19e566fb80f2d3b76e58624e990f90f23b8cdd21bd54) -set(QT_HASH_qt5-script a422e47873ddf4c84adf00f51b721465acedfac535b0daeede63eac0d41c6f4f07d5a5f86513c86e981f3a0024020be03730670befab2a20cd4d6564c98d6c90) -set(QT_HASH_qt5-scxml 23d340994af3e217ae58698dd0cd38f30d67d74a042d58cabbd0f38a6c13a8d64d6238cd6dee246ce0f99d5206bc210749941b88e5f745d3b92207eab06730b1) -set(QT_HASH_qt5-sensors 81ac74e4c0a3d1942393c9267bbcc50af0e04a6f163d566010d6053dc4c69a67395c3f4b7564a50ec84ac88a715edd002920be4e145e6bd23d082a021dee1e5a) -set(QT_HASH_qt5-serialport f3a5fb8c9a9513c16f52bd22b4fd4c6400819863237762f459d9f612ef2457447733cc8ed2bd645f182ab9eab6ddb5bcdbca2fbd67745def1a5fad1392087f4e) -set(QT_HASH_qt5-speech 2a1a2c86ee3b5501623bb0c2c8e5b6f96b353707fe0eb804629187899eca5952c665ef037c4257f635edf34ddea03bc686f472a4a346d9f8e2adc7479f640482) -set(QT_HASH_qt5-svg 3d7f89d106b36c8a0fd04c6e6f0ccde0c50ced7192980ea7d9330ba73d9307559e60ed2b10c28481a419d19aaae6609bde9e1dd74ccedf340dacf0194a60429d) -set(QT_HASH_qt5-tools e88af049ad9261720bc44ff9030113179d9429eaf073bed45115decd520ecf5d3ca860983f012bac189310ce9f3826b1fcb484faadb4f6d0b16c67c0d998f34c) -set(QT_HASH_qt5-virtualkeyboard e4581673451c40bf39b9793b0131bbad29e8a3f9db2d42adb23b48847bd674b6820717c051b76e506d4fd52e87c79b042533be85285a0cce9bcdc49cca964e66) -set(QT_HASH_qt5-webchannel 8ea543f29e8f686961b033c1246714b1535d0be730026bef4b4ee172ce602c706d8a16b8391510a302df7be6545007a2f42311eb1aea4da326c3addde16ca2b2) -set(QT_HASH_qt5-websockets 970ad232ad1258630404d5e7347721505a780497e1775f88591098f11bca48cbf62c4f02491b133d31e4304eb9e16f923292c5b778e22d530d7a5a4e95d422ba) -set(QT_HASH_qt5-webview 310beedf88cefc05458e99838e7cb71971aa24ba6c460ff3da804c2ab7f56167ca1067ddca71ee29ced32ea974fe405261f24c8bbcac0c7b69063d7c4e38a4de) -set(QT_HASH_qt5-winextras 053ca5f60c7946f6409ef34094b4a7d1431039407a5195e539e8edfda795da20fc695ceec58ae0df15e4dcc597047518d06a424d11fb4aaf6ae82f1d4badab33) -set(QT_HASH_qt5-xmlpatterns 30b25e152970bfe51fcdeffa43d11dd51496e5ea6a5da644b13fa0ce4835302ebec651c1ecdcf9590c6689598cea9bd63748aab4ee0ec69f9155dc310a7c04c3) +set(QT_HASH_qt5-base c584d69e49f4959d9b8541f820f5ff1e6d1599697ad16976b47cbaaa902fc83e1ca4ae57d56d13574e42e5f602d4420245ad7fcfc13e224e10d4bbad6a537d1a) +set(QT_HASH_qt5-3d 0cc327438ec174bfc6b7b560b5957653d38cdcb1c94717e296c3f52f41750f1b95ad620e3c3777fdc9c63f885f8325b8c1d1befcc338a25fc65d3f62b2019185) +set(QT_HASH_qt5-activeqt de3c869fecb5692209d6c162ae925eafe34e1118f3074529388c99a825a7007c01f1a6e603f8e8f46b3e2ecd510e35ce4d0d74c4b57563ecc95bfcf0be9dc05c) +set(QT_HASH_qt5-charts 8046f280f460da4bd010c96503e07811fd672981940477855511c21e11734872cbfdac2ffb5da0a26dbeeaf931bda2605c57dccaa45ab3ebf61272b9e29fd183) +set(QT_HASH_qt5-connectivity 57f125d232d1b495e82dd0f52243b878c7f0d3ffd1c8f4a7ff92810167867e2a5e480f4e7a3d2f26bbebcf8693eacbced87504b54f79cc8d1c8caf5a8f2da8f2) +set(QT_HASH_qt5-datavis3d 074abcd90cea37c24728d6065ee04048efb3b056dcea4e3fe9af1d270abf6bccda984b7fd91abbbefc9f059af34f53b2b8b42c096ac35e4921214f5eb9c09a83) +set(QT_HASH_qt5-declarative 0ec3403286efea6d6ac975ea6bd4464ea656c031f5f27b852235fd69d316a627ac3ff2ea2c3cca0a5375ca278f592df3ecade4e98aa15ec92816a16927f56e5e) +set(QT_HASH_qt5-gamepad 8f81564804c96273a60738fc3bb115d5b6409dd7627420bbe329d0fb6b3e3616123fa28b7fdbdde7f928275a024d499a2b2b86aace3a55c66b7ab80f64a7b465) +set(QT_HASH_qt5-graphicaleffects 62b18a9032bc30468ad4dc95648b1234a71240467fe8ff34a76bc36ed4613eea279dfc6fe0bf8e7734143e8b6ec6442f5e2f92338c2233f4e396bd333e67bc0c) +set(QT_HASH_qt5-imageformats 3ac441915f2354ebe3eb2f6785a806ebe8bc2562a3a7d7bd0dc3380fd8842ce8a8dcdb7a767750b4da3d2d6b7881a7b54bb6c37f89c46e1468f27fc77396c304) +set(QT_HASH_qt5-location 36efb5a9a0eaaa6f2997c4d7a18307c69a80ae4caf901ab1d0efcc6cd6202dda6a10c8dac01baee44e84c14b8ab23204db1085445e1f3b42e9a0a21549eb624e) +set(QT_HASH_qt5-macextras f2551f6e61b100c9acfc624aca0b7fc329589c090f60cc271decff388dbca97f10fd68e7ad061a709754eb2eecc438fba4a2bff54db1f7b1524836fac7e612aa) +set(QT_HASH_qt5-mqtt 9946e5a481d4fcc9ce8438c86f06d0ee4c1d6393163e0762217ca820fc61909784b617b794ee35c8f3e0ee7049ac367d1c17eed62717b64912b3642bb4ddf03c) +set(QT_HASH_qt5-multimedia 120ff3be99c685fb5944da657d571d83c985e139a34b23f7527daf2a0fdde949a452d4c3691b41a86ed3f141decf1833f496b3b61fd87bc602b8164563cb79d6) +set(QT_HASH_qt5-networkauth d5d7e4522a4058775389fdbb048f71675f5c37add8bd634766fc1408ebed0f1ad2c230ceb2cdeb547bce73ee9386cf40585dfb9ca4182340f82a284f7b9b5ae3) +set(QT_HASH_qt5-purchasing 9d4ed2d7810fdb052da86a2830bab912aec7fed5f7a5878a7133a976a788f8ab59d226a63a79a0c2fd162c3d86bf67c254d184f7422b75d4b0271175c355c61a) +set(QT_HASH_qt5-quickcontrols bdfe850e13275ae074c257b75697141a9b8af5a334e114d3ac28f68a820e4b9f40ad936db96dd119dcc77ca12d6aff84cee16613b0695f594c862dcfbf942a48) +set(QT_HASH_qt5-quickcontrols2 560014b882ef9d274cb1532025cae79987eec3569541e111e91f047261fcd7f26fcb40689d8dd6921ae26fbf9cdee60a87d3a1c7212e547529ff4adf9c5cf136) +set(QT_HASH_qt5-remoteobjects 4e8cbb0cbc86de625e8d6b7deb80799bb2a040749ff065d8c826d5695660d5538287d80c4f5845555bc1d1f36b481a9a03ac2d837d98e3bfd8e887fe54d4e691) +set(QT_HASH_qt5-script 0f6b72b5b0a892ced4653e9184256040b12a804f796c922aad318fc03734e3bf8fbe175b0eb886e71899287082c09fc06a290dcd5ddb1967c65b0f72d4adea94) +set(QT_HASH_qt5-scxml 196ab4a8609695bc442a915e229183f3ece97ed03c93cdc7f93bf6c7b68ea89a8a6ad04e3e4909c9aa0780d8ebd366338ea6e8790ac4fae08806694e27c115fa) +set(QT_HASH_qt5-sensors b03e2b68d14bfa557fdbf742d26c70a960b92cf5a5884d499825743553da42c5044cced338b86682081f57fea41686fc00c0565f3f4561d945e099de5b8ebc9e) +set(QT_HASH_qt5-serialport 121837c0848c69414268332ac41538b9df1c1503ab81bcf281903b73e02f5adf34b615ebc1fca4f4e6bf0b7c8c1b3f2d4dcde20152e2eb913c965eb910e378e2) +set(QT_HASH_qt5-speech 9a63c5957663db0c4b9587751b90d9d84881bb60f911435cb92998898944f6ed4e7aa7c12e8196a6b0c7bdac1d2abba62145b99cd834fbab1d57e88e60ddb59c) +set(QT_HASH_qt5-svg 24e5b3000ee6657e6c579026d979322aafaa42b3081e07bae17cf6f276a45a9d830db6b23fb7d30d6ff4f32f63c88e258dc55e193c45de8e4069aad14cfda71b) +set(QT_HASH_qt5-tools ebcebbc828e6a34766f2f5eeb4775d29af7b60b6124549df5256902ed2bd683721084b45a869ba76d29b1b170fe3834291af0833ab17ee8d05407c509f03d3eb) +set(QT_HASH_qt5-virtualkeyboard fd850aa11e0dbd37f73e63517af1e311be480fc44ac05e74c25794a69fd26d06fd620a9ee3ffa3663ebeeedc0d2abe9520aa53c09b80363e8966ee7f24430869) +set(QT_HASH_qt5-webchannel ef4040b63ad3cca80be38b8e3336ea0e70d1a57289ff2441c182f848b837d7ef87c78472f42f14cbc7a77f7ef5d5c50c0f5533071aaa13734832fdf6019c0253) +set(QT_HASH_qt5-websockets 87d7cbce52562f6a5372106e46e15319d9647bab9ec5dbde132c017b9febbbc568ff2c182d3375165d87c1d4a88ae26d2e849baef53bce6e842d8d0d83f7ceb5) +set(QT_HASH_qt5-webview 58356c59945fb075e17587b634156b66c5569cdbcf02ba91eb9fcc1146f1a4341e0d4d6afa0a70a6050070d35f156aa92a7aec0102aff0b862b5050533c55a5e) +set(QT_HASH_qt5-winextras ece6ad8cb8f43a8e43ed0f47323eb293d5c6329f32ccdd310ee3d3811006f81e63f8711e9c1a4630198087055fd6fb38012b4bcf0b008ac3d8da7eea6a461067) +set(QT_HASH_qt5-xmlpatterns 180ccbab82b436702533ea7aaf445b399250555ed37eb3469889de64d13f218c0717489f270e29369119207441f85c05249923fe73daac5fcc2fdc7e970494c0) +##TODO +set(QT_HASH_qt5-doc 8842c7e2a5e8042b8c22f305a46d8191d7cfcccd4ead175431ed83b2fde707466ea1798f7819b56ab991af942cb94551d20eb2c13edbe9beaafb9e6bb86fba3e) +set(QT_HASH_qt5-x11extras 12fc870f94e546d6e343f2ece44d09a6fc725b3ce092e1494bd2ef334ec92b559db2a8fcf6da88fe0f73040ee41fa5bf5f84ff197e5d1a004dabca3274508a96) +set(QT_HASH_qt5-androidextras d1b4a88053bd6b771f392e843611bf8397d782cc263ee924440e0ed6f63cdc936a2c127d3eb5a1834c11ef0c6efc2c8468fb65a28ec7f7645286bdea1dad590c) +#set(QT_HASH_qt5-canvas3d 0) deprectaed +set(QT_HASH_qt5-translations 45302457e16e5dba674164dda7945110583f072d209d3984726324497efb367573475facc3534fd7cdfc61bc14295ebe4bf6588a37d45e87b676191d852f1c8a) +set(QT_HASH_qt5-serialbus 8a606fd407cb7a4a6a1f15f10daec952aa010684d6cfca7fa024f850b3db419b7cd67eecb58ba0c0dd283e10fd904a255ab42b279c38081e84fe06b7b22c4c49) +set(QT_HASH_qt5-webengine 11983470f0da9abfffba072406b2c67b475d8cf65412fdcfd925758e2a9449f509780e5b1001fb6868445c2c9540e5aa0e754954b70f1795b47335bad7c749b2) +set(QT_HASH_qt5-webglplugin cd8e63b8979601c3da37295148b7fe896863b97058d15fb9284a3eacca7fe62fae87dbd414285aee5df732ebadd67c96edd273ec9929ca005bf5282e4acb7cff) +set(QT_HASH_qt5-wayland e3d8fb79b7d3b10a94caccca1567c3a978b3517e13740aa6218d0a0b4cb180f6bdc3b533e113248908033f344ab5fcffd6fac751a1513c2d62834afe408ee714) if(QT_UPDATE_VERSION) message(STATUS "Running Qt in automatic version port update mode!") diff --git a/ports/qt5-base/cmake/qt_port_hashes_latest.cmake b/ports/qt5-base/cmake/qt_port_hashes_latest.cmake index e2b3524b384dc6..fd74151f2b9e60 100644 --- a/ports/qt5-base/cmake/qt_port_hashes_latest.cmake +++ b/ports/qt5-base/cmake/qt_port_hashes_latest.cmake @@ -1,45 +1,55 @@ #Every update requires an update of these hashes and the version within the control file of each of the 32 ports. #So it is probably better to have a central location for these hashes and let the ports update via a script -set(QT_MAJOR_MINOR_VER 5.13) -set(QT_PATCH_VER 1) +set(QT_MAJOR_MINOR_VER 5.15) +set(QT_PATCH_VER 0) set(QT_UPDATE_VERSION 0) # Switch to update qt and not build qt. Creates a file cmake/qt_new_hashes.cmake in qt5-base with the new hashes. set(QT_PORT_LIST base 3d activeqt charts connectivity datavis3d declarative gamepad graphicaleffects imageformats location macextras mqtt multimedia networkauth purchasing quickcontrols quickcontrols2 remoteobjects script scxml sensors serialport speech svg tools virtualkeyboard webchannel websockets - webview winextras xmlpatterns) + webview winextras xmlpatterns doc x11extras androidextras translations serialbus webengine webglplugin wayland) -set(QT_HASH_qt5-base 86ab39eabb8867c4b038614341b7e49136f4ef898f06d4f1c899ddd2c2c271aa630bf63ad6abcf5c1f01659e6e5005f5da7dd83bb09a1484e15eb47e5274b9b3) -set(QT_HASH_qt5-3d dc305162ff87a71736b98aeb710b338ad1c6084819a79073f92b086ecc641caa7798d1c2bea20dd9eb91a9caf853177f01404d19407f8d10cb2bb8198d75cb84) -set(QT_HASH_qt5-activeqt cc0f9e92957142bbf44734560271e64cc8c3c5c337a8e180e68fd02a8cb7db8d6f8b86431e7c8abf62405a3fc8cef9922b111031310472495d7a75faa320940c) -set(QT_HASH_qt5-charts c511d5b48f53312f0e7380d2d04019a5e500736a47bf4625f668042152026c1d5dc3299dd82243054119697063daa445329c78793e2107b01e84824968258d34) -set(QT_HASH_qt5-connectivity de66b7d828f1259f59dac693ffd4bff15313e33b591ab748ca63a6470f1b3975bd30f48f75833400554cdbd8bb2f2a844b980b3db4242f08f43b82a2eb08c763) -set(QT_HASH_qt5-datavis3d f7ee9973dd7773f52726307de057cfd1a15227b390050bf8eca5294e151726a91152c89c36f7c38039b53564fec191ac3ea630231cd8391ca98ce99621b5ad3d) -set(QT_HASH_qt5-declarative 08cae55ffc51211cdaff0e4092284aa1d8305a08757ce214a54a362df66577ea6efdcf0b3aaae40f70862138369f8ec6b2eabfc55f99d67b5b3538f4e0e1eb21) -set(QT_HASH_qt5-gamepad 0e4e7c307157a09ddb735656306ade50423bbafad03d2cbf322c007d4017a8cb5d2389429f2b487c6e99918c688fd85d732a326be0034c2938ece73ff5015428) -set(QT_HASH_qt5-graphicaleffects b929ebd56821b2350472a37bc08c84e62c2010b740b3e9b00a8883e131cd585122dc50bfe5815c714c2eab1b4d8bbc458f6659bf02929a42de458f0a3b72f4fe) -set(QT_HASH_qt5-imageformats 8a7ac126e7f88525ce490a13656608cee53db232f4af8a90783a2a2e8540fc0bfeed641d33cf41d3643e46439850f95da701b0d5215872e0882c38209da10144) -set(QT_HASH_qt5-location 661ceff9ebb757e58e9430e0af86e782445029d42da61769264d5706c6633e42bf064c0afdb657e01dd2e3d9edd73e02dbadac2e65820038bbbcc3990a8e35aa) -set(QT_HASH_qt5-macextras d27ab2b44cfcb1a4d02cd6d2403710546c8cc1bae834418975f7588bf647c822519c4701b4feaa5bca98e5ad089eb2dd9f328956339699274126422324e042fc) -set(QT_HASH_qt5-mqtt 8aef8c8e6b7ef6acba864583396b680321c26b1f4910925e182592482d9363127c0767663cfd815262bdb4c32795c7b3e706c8543c7838e6907abca6d76eb9fd) -set(QT_HASH_qt5-multimedia 4599da3fc627923ce1fae3739124cb609591097870ee873e386429b81ac6a3f5a6e3a8d1316a84fcef8a25de4b7301b1358d2f5da9d87b0c2e18ac1f34184d30) -set(QT_HASH_qt5-networkauth 8a949006a7d2adc1bd7a55d80f93a622b0cc8e4ef644884b430c7ca4b82a2fc8b34b5e28492c175fe1b13da615a0ce66e6d80f58de4290d8515897bc521e80fc) -set(QT_HASH_qt5-purchasing bdbe386562bd3203c83f61385fb23f4493c8e9f68cd05d64929598192ac80788a214e6a4bb96ea3f19f061b6a689237acf6752bc1012e4263127f1801cb3eef3) -set(QT_HASH_qt5-quickcontrols f1204d709495197d6f664b7c7cb522be67a891985e4380b009bbd5e0b9854a603aa69f9b84c2189c6f35988ec3ffd7a6032c3ee097c449b40646ec66698b4689) -set(QT_HASH_qt5-quickcontrols2 5325d06a906934d00c6a7eb4e82d9399bc9764366a1374dd2c3c83828e9152d5d646b746437a6128e306157e3a457341747773bf3aa54809346e598687d2aacd) -set(QT_HASH_qt5-remoteobjects 087fd4f9f2f1e11796cce6d09f9adccd620ae664505c0475dab01c67b4afb699d93f788abf2e993961338424f0c9a87784148120221cbbf38febf5ec87012a1d) -set(QT_HASH_qt5-script 31b2088432ae70c7d19be61cfcd5dd5bace7fc33f6882a7d489982c392ab39bdc2bca612e8403c6d30ca7cb41622a93514ad87066998378cdda8bc2ba3a42536) -set(QT_HASH_qt5-scxml 8447f624578a92eee89c9f70cc4a44943cf9d015c06b20b83a90a6344a4ca7fa88e21121b9a98237140b1b59ab74be806ce6319c7b8b54c0aa2d3945af802e35) -set(QT_HASH_qt5-sensors 7a28b57ebadae6f2fc94778f7bf5321464f182ec8c32437c3803ddbbf2dd3ac24e90a6dbefc5634be53e4fb64c82aa7bbb67fa302d58a538493a14a78cf8c798) -set(QT_HASH_qt5-serialport 2465c4e723966d8c365230667b8f441a85e2a46b76e7070fe4b024015add376631c9016efe177364735ba41f34f21eeff6726a6511cee5b1d82b267ee6a58900) -set(QT_HASH_qt5-speech 662fa345c1207143a0bf641455ed4109eb028bd376b9a1bec757747912da169dde84f26f1e47562ee8973d847cac8f258cf771b428af486e19edb5bd3ef7dcc0) -set(QT_HASH_qt5-svg 76cfb880491bfa8295e5f7abfe842479516d355903ba620ff9bb42dd98ecafa3ef234f52ddd311ea9591b8e500e181c4849c6a0814fc0a1943c18d4697cd1f09) -set(QT_HASH_qt5-tools b3bd614ed21a1b37829082f2ec89b086b4c8e7cc91be5ba7bef16dc52619e3357d2c9165c3a1eedbd1f1913d215cda3f9a59fc26d45ee0267bc1e3d7205d98b8) -set(QT_HASH_qt5-virtualkeyboard 93840660675717bcce9237df5b6222306ad4b260a83bdae45110e3770acddcbf702e10d505ca0b2c71c24fb6c1742640c8bd56015331b219e8af9e7b9c793d24) -set(QT_HASH_qt5-webchannel 4c0509bf80070ce09c0317e4e4faaa47cc87218e2e78036a3424a6e22c0b4a6175fc86f46103e90b876c73e5a2f7492a9eaaf8777885351fae0b036cc7fb629c) -set(QT_HASH_qt5-websockets a951f355c3ce8f56fc5c4252e050ef008f4b3f9825a194a3e2e61a5e8ea9a3b89c6d9965acf9360be4655142b2057b4e7fb7a5b41412c3e14bef7846307670fb) -set(QT_HASH_qt5-webview 4933a9a637eb4ca3790310f2921dcbaa44dd7363eb4226f522c6d38a8ada5dfdaf87a8b33390740524ff05056397c530426e3969f798a7c75f2f663c099192b8) -set(QT_HASH_qt5-winextras 279514fc482a6e64a28970af2c69f9bd3db1e4e1ec9bf92be7d6ec47bdbea272149a4353ba0807da03ed8d0ee916f1d7f6efdc86bdb9173227055e0a44ac0155) -set(QT_HASH_qt5-xmlpatterns 6b426e5af2f1f71b77c5cb2bba79a9dc8223c7d57192be445df0d2fe9066f07632ad5ee799b3a782bc582446057197b55fa0260d1ea525db8b3a9a3912081169) +set(QT_HASH_qt5-base c584d69e49f4959d9b8541f820f5ff1e6d1599697ad16976b47cbaaa902fc83e1ca4ae57d56d13574e42e5f602d4420245ad7fcfc13e224e10d4bbad6a537d1a) +set(QT_HASH_qt5-3d 0cc327438ec174bfc6b7b560b5957653d38cdcb1c94717e296c3f52f41750f1b95ad620e3c3777fdc9c63f885f8325b8c1d1befcc338a25fc65d3f62b2019185) +set(QT_HASH_qt5-activeqt de3c869fecb5692209d6c162ae925eafe34e1118f3074529388c99a825a7007c01f1a6e603f8e8f46b3e2ecd510e35ce4d0d74c4b57563ecc95bfcf0be9dc05c) +set(QT_HASH_qt5-charts 8046f280f460da4bd010c96503e07811fd672981940477855511c21e11734872cbfdac2ffb5da0a26dbeeaf931bda2605c57dccaa45ab3ebf61272b9e29fd183) +set(QT_HASH_qt5-connectivity 57f125d232d1b495e82dd0f52243b878c7f0d3ffd1c8f4a7ff92810167867e2a5e480f4e7a3d2f26bbebcf8693eacbced87504b54f79cc8d1c8caf5a8f2da8f2) +set(QT_HASH_qt5-datavis3d 074abcd90cea37c24728d6065ee04048efb3b056dcea4e3fe9af1d270abf6bccda984b7fd91abbbefc9f059af34f53b2b8b42c096ac35e4921214f5eb9c09a83) +set(QT_HASH_qt5-declarative 0ec3403286efea6d6ac975ea6bd4464ea656c031f5f27b852235fd69d316a627ac3ff2ea2c3cca0a5375ca278f592df3ecade4e98aa15ec92816a16927f56e5e) +set(QT_HASH_qt5-gamepad 8f81564804c96273a60738fc3bb115d5b6409dd7627420bbe329d0fb6b3e3616123fa28b7fdbdde7f928275a024d499a2b2b86aace3a55c66b7ab80f64a7b465) +set(QT_HASH_qt5-graphicaleffects 62b18a9032bc30468ad4dc95648b1234a71240467fe8ff34a76bc36ed4613eea279dfc6fe0bf8e7734143e8b6ec6442f5e2f92338c2233f4e396bd333e67bc0c) +set(QT_HASH_qt5-imageformats 3ac441915f2354ebe3eb2f6785a806ebe8bc2562a3a7d7bd0dc3380fd8842ce8a8dcdb7a767750b4da3d2d6b7881a7b54bb6c37f89c46e1468f27fc77396c304) +set(QT_HASH_qt5-location 36efb5a9a0eaaa6f2997c4d7a18307c69a80ae4caf901ab1d0efcc6cd6202dda6a10c8dac01baee44e84c14b8ab23204db1085445e1f3b42e9a0a21549eb624e) +set(QT_HASH_qt5-macextras f2551f6e61b100c9acfc624aca0b7fc329589c090f60cc271decff388dbca97f10fd68e7ad061a709754eb2eecc438fba4a2bff54db1f7b1524836fac7e612aa) +set(QT_HASH_qt5-mqtt 9946e5a481d4fcc9ce8438c86f06d0ee4c1d6393163e0762217ca820fc61909784b617b794ee35c8f3e0ee7049ac367d1c17eed62717b64912b3642bb4ddf03c) +set(QT_HASH_qt5-multimedia 120ff3be99c685fb5944da657d571d83c985e139a34b23f7527daf2a0fdde949a452d4c3691b41a86ed3f141decf1833f496b3b61fd87bc602b8164563cb79d6) +set(QT_HASH_qt5-networkauth d5d7e4522a4058775389fdbb048f71675f5c37add8bd634766fc1408ebed0f1ad2c230ceb2cdeb547bce73ee9386cf40585dfb9ca4182340f82a284f7b9b5ae3) +set(QT_HASH_qt5-purchasing 9d4ed2d7810fdb052da86a2830bab912aec7fed5f7a5878a7133a976a788f8ab59d226a63a79a0c2fd162c3d86bf67c254d184f7422b75d4b0271175c355c61a) +set(QT_HASH_qt5-quickcontrols bdfe850e13275ae074c257b75697141a9b8af5a334e114d3ac28f68a820e4b9f40ad936db96dd119dcc77ca12d6aff84cee16613b0695f594c862dcfbf942a48) +set(QT_HASH_qt5-quickcontrols2 560014b882ef9d274cb1532025cae79987eec3569541e111e91f047261fcd7f26fcb40689d8dd6921ae26fbf9cdee60a87d3a1c7212e547529ff4adf9c5cf136) +set(QT_HASH_qt5-remoteobjects 4e8cbb0cbc86de625e8d6b7deb80799bb2a040749ff065d8c826d5695660d5538287d80c4f5845555bc1d1f36b481a9a03ac2d837d98e3bfd8e887fe54d4e691) +set(QT_HASH_qt5-script 0f6b72b5b0a892ced4653e9184256040b12a804f796c922aad318fc03734e3bf8fbe175b0eb886e71899287082c09fc06a290dcd5ddb1967c65b0f72d4adea94) +set(QT_HASH_qt5-scxml 196ab4a8609695bc442a915e229183f3ece97ed03c93cdc7f93bf6c7b68ea89a8a6ad04e3e4909c9aa0780d8ebd366338ea6e8790ac4fae08806694e27c115fa) +set(QT_HASH_qt5-sensors b03e2b68d14bfa557fdbf742d26c70a960b92cf5a5884d499825743553da42c5044cced338b86682081f57fea41686fc00c0565f3f4561d945e099de5b8ebc9e) +set(QT_HASH_qt5-serialport 121837c0848c69414268332ac41538b9df1c1503ab81bcf281903b73e02f5adf34b615ebc1fca4f4e6bf0b7c8c1b3f2d4dcde20152e2eb913c965eb910e378e2) +set(QT_HASH_qt5-speech 9a63c5957663db0c4b9587751b90d9d84881bb60f911435cb92998898944f6ed4e7aa7c12e8196a6b0c7bdac1d2abba62145b99cd834fbab1d57e88e60ddb59c) +set(QT_HASH_qt5-svg 24e5b3000ee6657e6c579026d979322aafaa42b3081e07bae17cf6f276a45a9d830db6b23fb7d30d6ff4f32f63c88e258dc55e193c45de8e4069aad14cfda71b) +set(QT_HASH_qt5-tools ebcebbc828e6a34766f2f5eeb4775d29af7b60b6124549df5256902ed2bd683721084b45a869ba76d29b1b170fe3834291af0833ab17ee8d05407c509f03d3eb) +set(QT_HASH_qt5-virtualkeyboard fd850aa11e0dbd37f73e63517af1e311be480fc44ac05e74c25794a69fd26d06fd620a9ee3ffa3663ebeeedc0d2abe9520aa53c09b80363e8966ee7f24430869) +set(QT_HASH_qt5-webchannel ef4040b63ad3cca80be38b8e3336ea0e70d1a57289ff2441c182f848b837d7ef87c78472f42f14cbc7a77f7ef5d5c50c0f5533071aaa13734832fdf6019c0253) +set(QT_HASH_qt5-websockets 87d7cbce52562f6a5372106e46e15319d9647bab9ec5dbde132c017b9febbbc568ff2c182d3375165d87c1d4a88ae26d2e849baef53bce6e842d8d0d83f7ceb5) +set(QT_HASH_qt5-webview 58356c59945fb075e17587b634156b66c5569cdbcf02ba91eb9fcc1146f1a4341e0d4d6afa0a70a6050070d35f156aa92a7aec0102aff0b862b5050533c55a5e) +set(QT_HASH_qt5-winextras ece6ad8cb8f43a8e43ed0f47323eb293d5c6329f32ccdd310ee3d3811006f81e63f8711e9c1a4630198087055fd6fb38012b4bcf0b008ac3d8da7eea6a461067) +set(QT_HASH_qt5-xmlpatterns 180ccbab82b436702533ea7aaf445b399250555ed37eb3469889de64d13f218c0717489f270e29369119207441f85c05249923fe73daac5fcc2fdc7e970494c0) +##TODO +set(QT_HASH_qt5-doc 8842c7e2a5e8042b8c22f305a46d8191d7cfcccd4ead175431ed83b2fde707466ea1798f7819b56ab991af942cb94551d20eb2c13edbe9beaafb9e6bb86fba3e) +set(QT_HASH_qt5-x11extras 12fc870f94e546d6e343f2ece44d09a6fc725b3ce092e1494bd2ef334ec92b559db2a8fcf6da88fe0f73040ee41fa5bf5f84ff197e5d1a004dabca3274508a96) +set(QT_HASH_qt5-androidextras d1b4a88053bd6b771f392e843611bf8397d782cc263ee924440e0ed6f63cdc936a2c127d3eb5a1834c11ef0c6efc2c8468fb65a28ec7f7645286bdea1dad590c) +#set(QT_HASH_qt5-canvas3d 0) deprecated +set(QT_HASH_qt5-translations 45302457e16e5dba674164dda7945110583f072d209d3984726324497efb367573475facc3534fd7cdfc61bc14295ebe4bf6588a37d45e87b676191d852f1c8a) +set(QT_HASH_qt5-serialbus 8a606fd407cb7a4a6a1f15f10daec952aa010684d6cfca7fa024f850b3db419b7cd67eecb58ba0c0dd283e10fd904a255ab42b279c38081e84fe06b7b22c4c49) +set(QT_HASH_qt5-webengine 11983470f0da9abfffba072406b2c67b475d8cf65412fdcfd925758e2a9449f509780e5b1001fb6868445c2c9540e5aa0e754954b70f1795b47335bad7c749b2) +set(QT_HASH_qt5-webglplugin cd8e63b8979601c3da37295148b7fe896863b97058d15fb9284a3eacca7fe62fae87dbd414285aee5df732ebadd67c96edd273ec9929ca005bf5282e4acb7cff) +set(QT_HASH_qt5-wayland e3d8fb79b7d3b10a94caccca1567c3a978b3517e13740aa6218d0a0b4cb180f6bdc3b533e113248908033f344ab5fcffd6fac751a1513c2d62834afe408ee714) if(QT_UPDATE_VERSION) message(STATUS "Running Qt in automatic version port update mode!") diff --git a/ports/qt5-base/patches/8c44d70.diff b/ports/qt5-base/patches/8c44d70.diff new file mode 100644 index 00000000000000..3b6e3221b6e07f --- /dev/null +++ b/ports/qt5-base/patches/8c44d70.diff @@ -0,0 +1,28 @@ +diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp +index 3879b48..c380893 100644 +--- a/src/corelib/tools/qarraydata.cpp ++++ b/src/corelib/tools/qarraydata.cpp +@@ -149,19 +149,16 @@ + + // End of qtools_p.h implementation + +-QT_WARNING_PUSH +-QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") +- + const QArrayData QArrayData::shared_null[2] = { + { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, sizeof(QArrayData) }, // shared null +- /* zero initialized terminator */}; ++ { { Q_BASIC_ATOMIC_INITIALIZER(0) }, 0, 0, 0, 0 } /* zero initialized terminator */ ++}; + + static const QArrayData qt_array[3] = { + { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, sizeof(QArrayData) }, // shared empty + { { Q_BASIC_ATOMIC_INITIALIZER(0) }, 0, 0, 0, sizeof(QArrayData) }, // unsharable empty +- /* zero initialized terminator */}; +- +-QT_WARNING_POP ++ { { Q_BASIC_ATOMIC_INITIALIZER(0) }, 0, 0, 0, 0 } /* zero initialized terminator */ ++}; + + static const QArrayData &qt_array_empty = qt_array[0]; + static const QArrayData &qt_array_unsharable_empty = qt_array[1]; diff --git a/ports/qt5-base/patches/Qt5BasicConfig.patch b/ports/qt5-base/patches/Qt5BasicConfig.patch index d113fb6695bee1..4f5d1fab0bc724 100644 --- a/ports/qt5-base/patches/Qt5BasicConfig.patch +++ b/ports/qt5-base/patches/Qt5BasicConfig.patch @@ -2,12 +2,36 @@ diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/featu index c72989288..a88234dca 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in -@@ -53,7 +53,11 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI +@@ -53,8 +53,12 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura + set(_lib_deps) + set(_link_flags) + +-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +- set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}\") ++!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}\") ++ else() ++ set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}\") ++ endif() + !!ELSE + set(_qt5_install_libs \"$${CMAKE_LIB_DIR}\") + !!ENDIF +@@ -125,6 +129,8 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura + elseif(EXISTS \"${_flag}\") + # The flag is an absolute path to an existing library + list(APPEND _lib_deps \"${_flag}\") ++ elseif(_flag MATCHES \"\\\\.lib$\") #Library name only. No -l. Probably missing some cases ++ list(APPEND _lib_deps \"${_flag}\") + elseif(_flag MATCHES \"^-L(.*)$\") + # Handle -Lfoo flags by putting their paths in the search path used by find_library above + list(APPEND _search_paths \"${CMAKE_MATCH_1}\") +@@ -147,7 +153,11 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -+ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") # 1 + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") + else() + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") @@ -15,9 +39,45 @@ index c72989288..a88234dca 100644 !!ELSE set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF -@@ -69,8 +73,12 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI +@@ -174,21 +184,22 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI ) + !!IF !isEmpty(CMAKE_STATIC_TYPE) +- if(NOT "${IsDebugAndRelease}") +- set(_genex_condition \"1\") ++ #if(NOT "${IsDebugAndRelease}") ++ # set(_genex_condition \"1\") ++ #else() ++ if("${Configuration}" STREQUAL "DEBUG") ++ set(_genex_condition \"$\") + else() +- if("${Configuration}" STREQUAL "DEBUG") +- set(_genex_condition \"$\") +- else() +- set(_genex_condition \"$>\") +- endif() ++ set(_genex_condition \"$>\") + endif() ++ #endif() + + if(_static_deps) + set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\") + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_static_deps_genex}\" + ) ++ #message(STATUS \"Target Qt5::$${CMAKE_MODULE_NAME} static links: ${_static_dep} through ${_static_dep_genex}\") # Added for debugging + endif() + + set(_static_link_flags \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\") +@@ -205,13 +216,18 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_static_link_flags_genex}\" + ) ++ #message(STATUS \"Target Qt5::$${CMAKE_MODULE_NAME} static link flags: ${_static_link_flags} through ${_static_link_flags_genex}\") + endif() + endif() + !!ENDIF + !!IF !isEmpty(CMAKE_WINDOWS_BUILD) !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") @@ -29,18 +89,58 @@ index c72989288..a88234dca 100644 !!ELSE set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") !!ENDIF -@@ -270,9 +278,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) - !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD +@@ -373,13 +389,14 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) - !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) --!!IF isEmpty(CMAKE_DEBUG_TYPE) + !!IF !isEmpty(CMAKE_STATIC_TYPE) + if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES) +-!!IF !isEmpty(CMAKE_DEBUG_TYPE) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) ++ if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\") + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( +- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG ++ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS + ) ++ endif() + !!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG +@@ -387,22 +404,21 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS + ) + !!ENDIF +-!!ENDIF + +-!!IF !isEmpty(CMAKE_RELEASE_TYPE) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) ++ if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\") + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS + ) ++ endif() + !!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS + ) +-!!ENDIF + !!ENDIF + endif() + +@@ -466,7 +482,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + !!IF isEmpty(CMAKE_DEBUG_TYPE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -@@ -281,20 +288,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE +@@ -474,13 +490,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -56,23 +156,39 @@ index c72989288..a88234dca 100644 !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) - !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - endif() --!!ENDIF // CMAKE_DEBUG_TYPE - !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD - - !!ENDIF // CMAKE_RELEASE_TYPE -@@ -347,7 +353,12 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) +@@ -543,7 +559,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) !!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE) -+ if(\"${Configuration}\" STREQUAL \"DEBUG\") -+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") -+ else() - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") -+ endif() -+ +- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") ++ else() ++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") ++ endif() !!ELSE set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") !!ENDIF +@@ -557,15 +577,15 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + ${_Qt5${Plugin}_STATIC_${Configuration}_LIB_DEPENDENCIES} + ) + +- if(NOT "${IsDebugAndRelease}") +- set(_genex_condition \"1\") ++ #if(NOT "${IsDebugAndRelease}") ++ # set(_genex_condition \"1\") ++ #else() ++ if("${Configuration}" STREQUAL "DEBUG") ++ set(_genex_condition \"$\") + else() +- if("${Configuration}" STREQUAL "DEBUG") +- set(_genex_condition \"$\") +- else() +- set(_genex_condition \"$>\") +- endif() ++ set(_genex_condition \"$>\") + endif() ++ #endif() + if(_static_deps) + set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\") + set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES diff --git a/ports/qt5-base/patches/Qt5PluginTarget.patch b/ports/qt5-base/patches/Qt5PluginTarget.patch index 0ae0a03c0aa76a..a8377b58577435 100644 --- a/ports/qt5-base/patches/Qt5PluginTarget.patch +++ b/ports/qt5-base/patches/Qt5PluginTarget.patch @@ -2,21 +2,73 @@ diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/feat index 5baf0fdb1..185abfffd 100644 --- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in +++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -@@ -1,11 +1,11 @@ +@@ -15,13 +15,14 @@ foreach(_module_dep ${_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES}) + endif() + endforeach() - add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) +-!!IF !isEmpty(CMAKE_RELEASE_TYPE) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file( +- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE +- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES +- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS +-) ++if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\") ++ _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( ++ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE ++ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES ++ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS ++ ) ++endif() + !!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE +@@ -29,15 +30,15 @@ _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS + ) + !!ENDIF +-!!ENDIF + +-!!IF !isEmpty(CMAKE_DEBUG_TYPE) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file( +- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG +- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES +- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS +-) ++if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\") ++ _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( ++ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG ++ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES ++ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS ++ ) ++endif() + !!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG +@@ -45,19 +46,18 @@ _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS + ) + !!ENDIF +-!!ENDIF + + set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES + \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_$${CMAKE_PLUGIN_NAME}_Import.cpp\" + ) + !!ENDIF -!!IF !isEmpty(CMAKE_RELEASE_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) -!!ENDIF -!!IF !isEmpty(CMAKE_DEBUG_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) -!!ENDIF +if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\") -+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") ++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) +endif() +if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\") -+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") ++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) +endif() list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME) + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY QT_ALL_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED} Qt5::$${CMAKE_PLUGIN_NAME}) diff --git a/ports/qt5-base/patches/create_cmake.patch b/ports/qt5-base/patches/create_cmake.patch new file mode 100644 index 00000000000000..69bd39a2a3a48d --- /dev/null +++ b/ports/qt5-base/patches/create_cmake.patch @@ -0,0 +1,41 @@ +diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf +index 4aa5dad46..cee6d2882 100644 +--- a/mkspecs/features/create_cmake.prf ++++ b/mkspecs/features/create_cmake.prf +@@ -212,10 +212,10 @@ contains(CONFIG, plugin) { + CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _) + + win32 { +- !mingw|qtConfig(debug_and_release): debug_suffix="d" ++ debug_suffix="d" + + CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl + CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}$${debug_suffix}.prl + + isEmpty(CMAKE_STATIC_TYPE) { + CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.dll +@@ -295,6 +295,7 @@ CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";") + equals(TEMPLATE, aux): CMAKE_FEATURE_PROPERTY_PREFIX = "INTERFACE_" + + mac { ++ CMAKE_FIND_OTHER_LIBRARY_BUILD = "true" + !isEmpty(CMAKE_STATIC_TYPE) { + CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a + CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a +@@ -315,7 +316,7 @@ mac { + CMAKE_WINDOWS_BUILD = "true" + CMAKE_FIND_OTHER_LIBRARY_BUILD = "true" + +- !mingw|qtConfig(debug_and_release): debug_suffix="d" ++ debug_suffix="d" + + CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.dll + CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll +@@ -342,6 +342,7 @@ mac { + CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib + } + } else { ++ CMAKE_FIND_OTHER_LIBRARY_BUILD = "true" + !isEmpty(CMAKE_STATIC_TYPE) { + CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a + CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a diff --git a/ports/qt5-base/patches/egl.patch b/ports/qt5-base/patches/egl.patch new file mode 100644 index 00000000000000..17f0a55dec2a82 --- /dev/null +++ b/ports/qt5-base/patches/egl.patch @@ -0,0 +1,16 @@ +diff --git a/src/gui/configure.json b/src/gui/configure.json +index 5fceb1150..7702cb261 100644 +--- a/src/gui/configure.json ++++ b/src/gui/configure.json +@@ -220,7 +220,10 @@ + "headers": "EGL/egl.h", + "sources": [ + { "type": "pkgConfig", "args": "egl" }, +- { "type": "makeSpec", "spec": "EGL" } ++ { "type": "makeSpec", "spec": "EGL" }, ++ { "libs": "-lEGL -lGLESv2 -lGL -lANGLE -lGL -lX11 -ldl -lm -lpthread" }, ++ { "libs": "-DGL_GLES_PROTOTYPES=1 -DGL_GLEXT_PROTOTYPES -DEGL_EGL_PROTOTYPES=1 -DEGL_EGLEXT_PROTOTYPES -lEGL -lGLESv2 -lGL -lANGLE -lGL -lX11 -ldl -lm -lpthread" }, ++ { "libs": "-DANGLE_EXPORT -DANGLE_UTIL_EXPORT -DGL_API -DGL_APICALL -DEGLAPI -DGL_GLES_PROTOTYPES=1 -DGL_GLEXT_PROTOTYPES -DEGL_EGL_PROTOTYPES=1 -DEGL_EGLEXT_PROTOTYPES -lEGL -lGLESv2 -lGL -lANGLE -lGL -lX11 -ldl -lm -lpthread" } + ] + }, + "freetype": { diff --git a/ports/qt5-base/patches/xlib.patch b/ports/qt5-base/patches/xlib.patch new file mode 100644 index 00000000000000..07cba5b8254a2e --- /dev/null +++ b/ports/qt5-base/patches/xlib.patch @@ -0,0 +1,39 @@ +diff --git a/src/gui/configure.json b/src/gui/configure.json +index 9a749516b..242f47504 100644 +--- a/src/gui/configure.json ++++ b/src/gui/configure.json +@@ -568,7 +568,9 @@ + }, + "headers": "X11/Xlib.h", + "sources": [ +- { "type": "makeSpec", "spec": "X11" } ++ { "type": "makeSpec", "spec": "X11" }, ++ { "type": "pkgConfig", "args": "x11" }, ++ { "type": "pkgConfig", "args": "x11 --static" } + ] + }, + "x11sm": { +@@ -590,6 +592,7 @@ + "headers": "xcb/xcb.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb >= 1.11" }, ++ { "type": "pkgConfig", "args": "xcb >= 1.11 --static" }, + "-lxcb" + ] + }, +@@ -691,6 +694,7 @@ + "headers": "X11/Xlib-xcb.h", + "sources": [ + { "type": "pkgConfig", "args": "x11-xcb" }, ++ { "type": "pkgConfig", "args": "x11-xcb --static" }, + "-lX11-xcb" + ], + "use": "xcb xlib" +@@ -711,6 +715,7 @@ + "headers": "xcb/xkb.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xkb" }, ++ { "type": "pkgConfig", "args": "xcb-xkb --static" }, + "-lxcb-xkb" + ], + "use": "xcb" diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 8cb27084a6a3f4..1044df3174644f 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -6,17 +6,35 @@ else() option(QT_OPENSSL_LINK "Link against OpenSSL at compile-time." OFF) endif() +if (VCPKG_TARGET_IS_LINUX) + message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n libx11-xcb-dev\n\nThese can be installed on Ubuntu systems via apt-get install libx11-xcb-dev.") + message(WARNING "${PORT} for qt5-x11extras requires the following libraries from the system package manager:\n libxkbcommon-x11-dev\n\nThese can be installed on Ubuntu systems via apt-get install libxkbcommon-x11-dev.") + # +endif() + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) -if("latest" IN_LIST FEATURES) - set(QT_BUILD_LATEST ON) +if("latest" IN_LIST FEATURES) # latest = core currently + set(QT_BUILD_LATEST ON) + set(PATCHES + patches/Qt5BasicConfig.patch + patches/Qt5PluginTarget.patch + patches/create_cmake.patch + ) +else() + set(PATCHES + patches/Qt5BasicConfig.patch + patches/Qt5PluginTarget.patch + patches/create_cmake.patch + ) endif() include(qt_port_functions) include(configure_qt) include(install_qt) + ######################### ## Find Host and Target mkspec name for configure include(find_qt_mkspec) @@ -34,17 +52,19 @@ endif() qt_download_submodule( OUT_SOURCE_PATH SOURCE_PATH PATCHES - patches/winmain_pro.patch #Moves qtmain to manual-link - patches/windows_prf.patch #fixes the qtmain dependency due to the above move - patches/qt_app.patch #Moves the target location of qt5 host apps to always install into the host dir. - patches/gui_configure.patch #Patches the gui configure.json to break freetype/fontconfig autodetection because it does not include its dependencies. - patches/icu.patch #Help configure find static icu builds in vcpkg on windows + patches/winmain_pro.patch #Moves qtmain to manual-link + patches/windows_prf.patch #fixes the qtmain dependency due to the above move + patches/qt_app.patch #Moves the target location of qt5 host apps to always install into the host dir. + patches/gui_configure.patch #Patches the gui configure.json to break freetype/fontconfig autodetection because it does not include its dependencies. + patches/icu.patch #Help configure find static icu builds in vcpkg on windows + patches/xlib.patch #Patches Xlib check to actually use Pkgconfig instead of makeSpec only + patches/egl.patch #Fix egl detection logic. + patches/8c44d70.diff #Upstream fix for MSVC 16.6.2. static init of std::atomic. #patches/static_opengl.patch #Use this patch if you really want to statically link angle on windows (e.g. using -opengl es2 and -static). #Be carefull since it requires definining _GDI32_ for all dependent projects due to redefinition errors in the #the windows supplied gl.h header and the angle gl.h otherwise. #CMake fixes - patches/Qt5BasicConfig.patch - patches/Qt5PluginTarget.patch + ${PATCHES} patches/Qt5GuiConfigExtras.patch # Patches the library search behavior for EGL since angle is not build with Qt ) @@ -110,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) @@ -146,22 +173,34 @@ 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} ${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) +find_library(GLIB_RELEASE NAMES glib-${GLIB_LIB_VERSION} PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(GLIB_DEBUG NAMES glib-${GLIB_LIB_VERSION} PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +if(GLIB_RELEASE MATCHES "-NOTFOUND" OR GLIB_DEBUG MATCHES "-NOTFOUND") + set(GLIB_RELEASE "") + set(GLIB_DEBUG "") +endif() + set(RELEASE_OPTIONS "LIBJPEG_LIBS=${JPEG_RELEASE}" "ZLIB_LIBS=${ZLIB_RELEASE}" "LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}" "PCRE2_LIBS=${PCRE2_RELEASE}" - "FREETYPE_LIBS=${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}" + "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}" "ZLIB_LIBS=${ZLIB_DEBUG}" "LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}" "PCRE2_LIBS=${PCRE2_DEBUG}" - "FREETYPE_LIBS=${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}" + "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}" "ICU_LIBS=${ICU_DEBUG}" "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}" "QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}" @@ -180,32 +219,32 @@ if(VCPKG_TARGET_IS_WINDOWS) list(APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" "SQLITE_LIBS=${SQLITE_RELEASE}" - "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE}" + "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL}" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" ) list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" "SQLITE_LIBS=${SQLITE_DEBUG}" - "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG}" + "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL}" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" ) elseif(VCPKG_TARGET_IS_LINUX) - list(APPEND CORE_OPTIONS -fontconfig) + list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb) if (NOT EXISTS "/usr/include/GL/glu.h") message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"") endif() list(APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" - "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE}" + "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL} ${GLIB_RELEASE} -lpthread" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE}" ) list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" - "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG}" + "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL} ${GLIB_DEBUG} -lpthread" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG}" ) @@ -229,21 +268,21 @@ 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}) list(APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" - "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} -framework ApplicationServices" + "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv" ) list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" - "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} -framework ApplicationServices" + "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv" ) @@ -264,7 +303,6 @@ else() OPTIONS_RELEASE ${RELEASE_OPTIONS} OPTIONS_DEBUG ${DEBUG_OPTIONS} ) - install_qt() ######################### @@ -291,8 +329,8 @@ else() #This needs a new VCPKG policy or a static angle build (ANGLE needs to be fixed in VCPKG!) if(VCPKG_TARGET_IS_WINDOWS AND ${VCPKG_LIBRARY_LINKAGE} MATCHES "static") # Move angle dll libraries - message(STATUS "Moving ANGLE dlls from /bin to /tools/qt5-angle/bin. In static builds dlls are not allowed in /bin") if(EXISTS "${CURRENT_PACKAGES_DIR}/bin") + message(STATUS "Moving ANGLE dlls from /bin to /tools/qt5-angle/bin. In static builds dlls are not allowed in /bin") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/qt5-angle) file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/qt5-angle/bin) if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -303,9 +341,9 @@ else() endif() ## Fix location of qtmain(d).lib. Has been moved into manual-link. Add debug version + set(cmakefile "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfigExtras.cmake") + file(READ "${cmakefile}" _contents) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE) - set(cmakefile "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfigExtras.cmake") - file(READ "${cmakefile}" _contents) string(REPLACE "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)" "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)" _contents "${_contents}") string(REPLACE [[set(imported_location "${_qt5Core_install_prefix}/lib/qtmain.lib")]] @@ -321,15 +359,34 @@ else() IMPORTED_LOCATION_DEBUG ${imported_location_debug} )]] _contents "${_contents}") - file(WRITE "${cmakefile}" "${_contents}") + else() # Single configuration build (either debug or release) + # Release case + string(REPLACE + [[set(imported_location "${_qt5Core_install_prefix}/lib/qtmain.lib")]] + [[set(imported_location "${_qt5Core_install_prefix}/lib/manual-link/qtmain.lib")]] + _contents "${_contents}") + # Debug case (whichever will match) + string(REPLACE + [[set(imported_location "${_qt5Core_install_prefix}/lib/qtmaind.lib")]] + [[set(imported_location "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib")]] + _contents "${_contents}") + string(REPLACE + [[set(imported_location "${_qt5Core_install_prefix}/debug/lib/qtmaind.lib")]] + [[set(imported_location "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib")]] + _contents "${_contents}") endif() - - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5core) + file(WRITE "${cmakefile}" "${_contents}") + if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5/bin) file(COPY ${CURRENT_PACKAGES_DIR}/tools/qt5/bin DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5/bin) endif() + # This should be removed if possible! (Currently debug build of qt5-translations requires it.) + if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/bin) + file(COPY ${CURRENT_PACKAGES_DIR}/tools/qt5/bin DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5/debug) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5/debug/bin) + endif() if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf) file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf") @@ -370,4 +427,21 @@ if(QT_BUILD_LATEST) DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 ) -endif() \ No newline at end of file +endif() + +# #Code to get generated CMake files from CI +# file(RENAME "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfig.cmake" "${CURRENT_BUILDTREES_DIR}/Qt5CoreConfig.cmake.log") +# file(GLOB_RECURSE CMAKE_GUI_FILES "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Gui/*.cmake" ) +# foreach(cmake_file ${CMAKE_GUI_FILES}) + # get_filename_component(cmake_filename "${cmake_file}" NAME) + # file(COPY "${cmake_file}" DESTINATION "${CURRENT_BUILDTREES_DIR}") + # file(RENAME "${CURRENT_BUILDTREES_DIR}/${cmake_filename}" "${CURRENT_BUILDTREES_DIR}/${cmake_filename}.log") +# endforeach() +# #Copy config.log from buildtree/triplet to buildtree to get the log in CI in case of failure +# if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log") + # file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log" "${CURRENT_BUILDTREES_DIR}/config-rel.log") +# endif() +# if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log") + # file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log" "${CURRENT_BUILDTREES_DIR}/config-dbg.log") +# endif() +# message(FATAL_ERROR "Need Info from CI!") diff --git a/ports/qt5-base/vcpkg-cmake-wrapper.cmake b/ports/qt5-base/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 3e22f087c111bf..00000000000000 --- a/ports/qt5-base/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,79 +0,0 @@ -_find_package(${ARGS}) - -function(add_qt_library _target) - foreach(_lib IN LISTS ARGN) - #The fact that we are within this file means we are using the VCPKG toolchain. Has such we only need to search in VCPKG paths! - find_library(${_lib}_LIBRARY_DEBUG NAMES ${_lib}_debug ${_lib}d ${_lib} NAMES_PER_DIR PATH_SUFFIXES lib plugins/platforms PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) - find_library(${_lib}_LIBRARY_RELEASE NAMES ${_lib} NAMES_PER_DIR PATH_SUFFIXES lib plugins/platforms PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) - if(${_lib}_LIBRARY_RELEASE) - list(APPEND interface_lib \$<\$>:${${_lib}_LIBRARY_RELEASE}>) - endif() - if(${_lib}_LIBRARY_DEBUG) - list(APPEND interface_lib \$<\$:${${_lib}_LIBRARY_DEBUG}>) - endif() - set_property(TARGET ${_target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${interface_lib}) - endforeach() -endfunction() - -get_target_property(_target_type Qt5::Core TYPE) -if("${_target_type}" STREQUAL "STATIC_LIBRARY") - find_package(ZLIB) - find_package(JPEG) - find_package(PNG) - find_package(Freetype) - find_package(sqlite3 CONFIG) - find_package(PostgreSQL MODULE REQUIRED) - find_package(double-conversion CONFIG) - find_package(OpenSSL) - find_package(harfbuzz CONFIG) - - set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_LINK_LIBRARIES - ZLIB::ZLIB JPEG::JPEG PNG::PNG Freetype::Freetype sqlite3 harfbuzz::harfbuzz - double-conversion::double-conversion OpenSSL::SSL OpenSSL::Crypto PostgreSQL::PostgreSQL - ) - - add_qt_library(Qt5::Core - pcre2-16 - icuin icui18n - icutu icuuc icuio - icudt icudata - Qt5ThemeSupport - Qt5EventDispatcherSupport - Qt5PlatformCompositorSupport - Qt5FontDatabaseSupport) - - if(MSVC) - set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_LINK_LIBRARIES - Netapi32.lib Ws2_32.lib Mincore.lib Winmm.lib Iphlpapi.lib Wtsapi32.lib Dwmapi.lib Imm32.lib) - - add_qt_library(Qt5::Core Qt5WindowsUIAutomationSupport qwindows qdirect2d) - elseif(UNIX AND NOT APPLE) - add_qt_library(Qt5::Core - Qt5GraphicsSupport - Qt5ClipboardSupport - Qt5AccessibilitySupport) - elseif(APPLE) - set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_LINK_LIBRARIES - "-weak_framework DiskArbitration" "-weak_framework IOKit" "-weak_framework Foundation" "-weak_framework CoreServices" - "-weak_framework AppKit" "-weak_framework Security" "-weak_framework ApplicationServices" - "-weak_framework CoreFoundation" "-weak_framework SystemConfiguration" - "-weak_framework Carbon" - "-weak_framework QuartzCore" - "-weak_framework CoreVideo" - "-weak_framework Metal" - "-weak_framework CoreText" - "-weak_framework ApplicationServices" - "-weak_framework CoreGraphics" - "-weak_framework OpenGL" - "-weak_framework AGL" - "-weak_framework ImageIO" - "z" "m" - cups) - add_qt_library(Qt5::Core - Qt5GraphicsSupport - Qt5ClipboardSupport - Qt5AccessibilitySupport - qcocoa) - endif() - -endif() diff --git a/ports/qt5-canvas3d/CONTROL b/ports/qt5-canvas3d/CONTROL new file mode 100644 index 00000000000000..2da0b47376430a --- /dev/null +++ b/ports/qt5-canvas3d/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-canvas3d +Version: 0 +Description: Qt5 Canvas 3d Module; +Build-Depends: qt5-base[core] diff --git a/ports/qt5-canvas3d/portfile.cmake b/ports/qt5-canvas3d/portfile.cmake new file mode 100644 index 00000000000000..14a8cbdb2192d0 --- /dev/null +++ b/ports/qt5-canvas3d/portfile.cmake @@ -0,0 +1,4 @@ +message(FATAL_ERROR "${PORT} has been deprecated and will be removed in the future from VCPKG") +#set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +#include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +#qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-charts/CONTROL b/ports/qt5-charts/CONTROL index 192c57b417e495..6e3ab6231c070c 100644 --- a/ports/qt5-charts/CONTROL +++ b/ports/qt5-charts/CONTROL @@ -1,4 +1,4 @@ Source: qt5-charts -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Charts Module - UI components for displaying charts, driven by static or dynamic data models -Build-Depends: qt5-base, qt5-declarative, qt5-multimedia +Build-Depends: qt5-base[core], qt5-declarative, qt5-multimedia diff --git a/ports/qt5-connectivity/CONTROL b/ports/qt5-connectivity/CONTROL index 245cfa1b192bef..aefaea84647020 100644 --- a/ports/qt5-connectivity/CONTROL +++ b/ports/qt5-connectivity/CONTROL @@ -1,4 +1,5 @@ Source: qt5-connectivity -Version: 5.12.5-1 +Version: 5.15.0 +Port-Version: 1 Description: Qt5 Connectivity module - Provides access to Bluetooth and NFC hardware -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qt5-datavis3d/CONTROL b/ports/qt5-datavis3d/CONTROL index 56b99852d8a641..9d05c6962f57e5 100644 --- a/ports/qt5-datavis3d/CONTROL +++ b/ports/qt5-datavis3d/CONTROL @@ -1,4 +1,4 @@ Source: qt5-datavis3d -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations -Build-Depends: qt5-base, qt5-declarative, qt5-multimedia +Build-Depends: qt5-base[core], qt5-declarative, qt5-multimedia diff --git a/ports/qt5-declarative/CONTROL b/ports/qt5-declarative/CONTROL index 636c090424ea94..37b14ecf3f5e90 100644 --- a/ports/qt5-declarative/CONTROL +++ b/ports/qt5-declarative/CONTROL @@ -1,4 +1,4 @@ Source: qt5-declarative -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol. -Build-Depends: qt5-base, qt5-imageformats, qt5-svg +Build-Depends: qt5-base[core], qt5-imageformats, qt5-svg diff --git a/ports/qt5-doc/CONTROL b/ports/qt5-doc/CONTROL new file mode 100644 index 00000000000000..6637877d4d8783 --- /dev/null +++ b/ports/qt5-doc/CONTROL @@ -0,0 +1,5 @@ +Source: qt5-doc +Version: 5.15.0 +Description: Qt5 doc Module; +Build-Depends: qt5-base[core], qt5-declarative, qt5-quickcontrols2, qt5-tools +Supports: linux \ No newline at end of file diff --git a/ports/qt5-doc/portfile.cmake b/ports/qt5-doc/portfile.cmake new file mode 100644 index 00000000000000..4f6e6848e01854 --- /dev/null +++ b/ports/qt5-doc/portfile.cmake @@ -0,0 +1,7 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +if(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + message(STATUS "${PORT} will not build any artifacts on Windows!") +endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-gamepad/CONTROL b/ports/qt5-gamepad/CONTROL index 839ff9d7f80102..cc844b30a83339 100644 --- a/ports/qt5-gamepad/CONTROL +++ b/ports/qt5-gamepad/CONTROL @@ -1,4 +1,4 @@ Source: qt5-gamepad -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-graphicaleffects/CONTROL b/ports/qt5-graphicaleffects/CONTROL index 934f226ba78a62..9313123613e70a 100644 --- a/ports/qt5-graphicaleffects/CONTROL +++ b/ports/qt5-graphicaleffects/CONTROL @@ -1,4 +1,4 @@ Source: qt5-graphicaleffects -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 GraphicalEffects Module. -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL index 20ee53538f67e6..6cc1b86eadd211 100644 --- a/ports/qt5-imageformats/CONTROL +++ b/ports/qt5-imageformats/CONTROL @@ -1,4 +1,5 @@ Source: qt5-imageformats -Version: 5.12.5-3 +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, tiff, libwebp, jasper +Build-Depends: qt5-base[core], tiff, libwebp, jasper diff --git a/ports/qt5-imageformats/portfile.cmake b/ports/qt5-imageformats/portfile.cmake index dbea7fd9e45c1e..abd88a60c27e1d 100644 --- a/ports/qt5-imageformats/portfile.cmake +++ b/ports/qt5-imageformats/portfile.cmake @@ -8,9 +8,13 @@ list(APPEND CORE_OPTIONS -jasper -no-mng # must be explicitly disabled to not automatically pick up mng -verbose) - + find_library(TIFF_RELEASE NAMES tiff PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on lzma find_library(TIFF_DEBUG NAMES tiffd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(JPEG_RELEASE NAMES jpeg jpeg-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(JPEG_DEBUG NAMES jpeg jpeg-static jpegd jpeg-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(ZLIB_RELEASE NAMES z zlib PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(ZLIB_DEBUG NAMES z zlib zd zlibd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(JASPER_RELEASE NAMES jasper PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(JASPER_DEBUG NAMES jasperd jasper libjasperd libjasper PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) @@ -23,6 +27,10 @@ find_library(WEBP_RELEASE NAMES webp PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEF find_library(WEBP_DEBUG NAMES webpd webp PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(WEBPDEMUX_RELEASE NAMES webpdemux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(WEBPDEMUX_DEBUG NAMES webpdemuxd webpdemux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(WEBPMUX_RELEASE NAMES webpmux libwebpmux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(WEBPMUX_DEBUG NAMES webpmuxd webpmux libwebpmuxd libwebpmux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(WEBPDECODER_RELEASE NAMES webpdecoder libwebpdecoder PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(WEBPDECODER_DEBUG NAMES webpdecoder libwebpdecoder webpdecoderd libwebpdecoderd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) # Depends on opengl in default build but might depend on giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows) # which would require extra libraries to be linked e.g. giflib freeglut sdl1 other ones are already linked @@ -30,10 +38,17 @@ find_library(WEBPDEMUX_DEBUG NAMES webpdemuxd webpdemux PATHS "${CURRENT_INSTALL find_library(LZMA_RELEASE lzma PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(LZMA_DEBUG lzmad lzma PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -set(OPT_REL "TIFF_LIBS=${TIFF_RELEASE} ${LZMA_RELEASE}" - "WEBP_LIBS=${WEBP_RELEASE} ${WEBPDEMUX_RELEASE}" - "JASPER_LIBS=${JASPER_RELEASE} ${FREEGLUT_RELEASE}") # This will still fail if LIBWEBP is installed with all available features due to the missing additional dependencies -set(OPT_DBG "TIFF_LIBS=${TIFF_DEBUG} ${LZMA_DEBUG}" - "WEBP_LIBS=${WEBP_DEBUG} ${WEBPDEMUX_DEBUG}" - "JASPER_LIBS=${JASPER_DEBUG} ${FREEGLUT_DEBUG}") +if(NOT VCPKG_TARGET_IS_WINDOWS) + string(APPEND WEBP_RELEASE " -pthread") + string(APPEND WEBP_DEBUG " -pthread") +endif() + +set(OPT_REL "TIFF_LIBS=${TIFF_RELEASE} ${LZMA_RELEASE} ${JPEG_RELEASE} ${ZLIB_RELEASE}" + "WEBP_LIBS=${WEBPDECODER_RELEASE} ${WEBPDEMUX_RELEASE} ${WEBPMUX_RELEASE} ${WEBP_RELEASE}" + "JASPER_LIBS=${JASPER_RELEASE} ${FREEGLUT_RELEASE} ${JPEG_RELEASE} ${ZLIB_RELEASE}") # This will still fail if LIBWEBP is installed with all available features due to the missing additional dependencies +set(OPT_DBG "TIFF_LIBS=${TIFF_DEBUG} ${LZMA_DEBUG} ${JPEG_DEBUG} ${ZLIB_DEBUG}" + "WEBP_LIBS=${WEBPDECODER_DEBUG} ${WEBPDEMUX_DEBUG} ${WEBPMUX_DEBUG} ${WEBP_DEBUG}" + "JASPER_LIBS=${JASPER_DEBUG} ${FREEGLUT_DEBUG} ${JPEG_DEBUG} ${ZLIB_DEBUG}") +list(APPEND CORE_OPTIONS "WEBP_INCDIR=${CURRENT_INSTALLED_DIR}/include") # Requires libwebp[all] + qt_submodule_installation(BUILD_OPTIONS ${CORE_OPTIONS} BUILD_OPTIONS_RELEASE ${OPT_REL} BUILD_OPTIONS_DEBUG ${OPT_DBG}) \ No newline at end of file diff --git a/ports/qt5-location/CONTROL b/ports/qt5-location/CONTROL index 05de15d9dff105..c0e66e5ac1ec53 100644 --- a/ports/qt5-location/CONTROL +++ b/ports/qt5-location/CONTROL @@ -1,4 +1,5 @@ Source: qt5-location -Version: 5.12.5-2 +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, qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport +Build-Depends: qt5-base[core], qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport diff --git a/ports/qt5-location/portfile.cmake b/ports/qt5-location/portfile.cmake index f49813c337dc1a..e96fab831345ba 100644 --- a/ports/qt5-location/portfile.cmake +++ b/ports/qt5-location/portfile.cmake @@ -1,2 +1,3 @@ +message(STATUS "${PORT} has a spurious failure in which it is unable to create a parent directory! Just retry.") include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) qt_submodule_installation(PATCHES clipper.patch) \ No newline at end of file diff --git a/ports/qt5-macextras/CONTROL b/ports/qt5-macextras/CONTROL index 6bd46f216c4a87..1d7b4b2785a4ff 100644 --- a/ports/qt5-macextras/CONTROL +++ b/ports/qt5-macextras/CONTROL @@ -1,5 +1,5 @@ Source: qt5-macextras -Version: 5.12.5 +Version: 5.15.0 Description: Qt5 Mac Extras Module. Provides platform-specific APIs for mac. -Build-Depends: qt5-base +Build-Depends: qt5-base[core] Supports: osx \ No newline at end of file diff --git a/ports/qt5-macextras/portfile.cmake b/ports/qt5-macextras/portfile.cmake index 9af7a2aace4761..cc2391d870c954 100644 --- a/ports/qt5-macextras/portfile.cmake +++ b/ports/qt5-macextras/portfile.cmake @@ -1,5 +1,5 @@ -if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT QT_UPDATE_VERSION) message(FATAL_ERROR "qt5-macextras only support OSX.") endif() -include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-mqtt/CONTROL b/ports/qt5-mqtt/CONTROL index 1c7cc8740c6d67..c61bb4adb7721e 100644 --- a/ports/qt5-mqtt/CONTROL +++ b/ports/qt5-mqtt/CONTROL @@ -1,4 +1,4 @@ Source: qt5-mqtt -Version: 5.12.5 +Version: 5.15.0 Description: Qt5 MQTT module. -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qt5-mqtt/portfile.cmake b/ports/qt5-mqtt/portfile.cmake index 069860e21dc0c8..571496ff60687f 100644 --- a/ports/qt5-mqtt/portfile.cmake +++ b/ports/qt5-mqtt/portfile.cmake @@ -1,6 +1,8 @@ include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) #qt_submodule_installation() No binary package for this port. - +if(QT_UPDATE_VERSION) + set(QT_HASH_qt5-mqtt 1) # TO get an SHA512 error if the variable is set. +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO qt/qtmqtt diff --git a/ports/qt5-multimedia/CONTROL b/ports/qt5-multimedia/CONTROL index c82238ab3b8200..be36efe0ca43ed 100644 --- a/ports/qt5-multimedia/CONTROL +++ b/ports/qt5-multimedia/CONTROL @@ -1,4 +1,4 @@ Source: qt5-multimedia -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Multimedia Module - Classes and widgets for audio, video, radio and camera functionality -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-networkauth/CONTROL b/ports/qt5-networkauth/CONTROL index 7d93e5958a2ce3..c97103fda8108f 100644 --- a/ports/qt5-networkauth/CONTROL +++ b/ports/qt5-networkauth/CONTROL @@ -1,4 +1,4 @@ Source: qt5-networkauth -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Network Authorization Module -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qt5-purchasing/CONTROL b/ports/qt5-purchasing/CONTROL index 6feb7811398fb1..e7e82d57b24d47 100644 --- a/ports/qt5-purchasing/CONTROL +++ b/ports/qt5-purchasing/CONTROL @@ -1,4 +1,4 @@ Source: qt5-purchasing -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 Purchasing Module - Enables in-app purchase of products in Qt applications. -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-quickcontrols/CONTROL b/ports/qt5-quickcontrols/CONTROL index 11287f68f385d1..39ba15ca0b52a6 100644 --- a/ports/qt5-quickcontrols/CONTROL +++ b/ports/qt5-quickcontrols/CONTROL @@ -1,4 +1,4 @@ Source: qt5-quickcontrols -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 QuickControls Module. -Build-Depends: qt5-base, qt5-declarative, qt5-graphicaleffects +Build-Depends: qt5-base[core], qt5-declarative, qt5-graphicaleffects diff --git a/ports/qt5-quickcontrols2/CONTROL b/ports/qt5-quickcontrols2/CONTROL index 5a9601fa492f24..96a371edd7821c 100644 --- a/ports/qt5-quickcontrols2/CONTROL +++ b/ports/qt5-quickcontrols2/CONTROL @@ -1,4 +1,4 @@ Source: qt5-quickcontrols2 -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 QuickControls2 Module. -Build-Depends: qt5-base, qt5-declarative, qt5-imageformats +Build-Depends: qt5-base[core], qt5-declarative, qt5-imageformats diff --git a/ports/qt5-remoteobjects/CONTROL b/ports/qt5-remoteobjects/CONTROL index a46de496ca5eff..bd7596dad4b6dc 100644 --- a/ports/qt5-remoteobjects/CONTROL +++ b/ports/qt5-remoteobjects/CONTROL @@ -1,4 +1,4 @@ Source: qt5-remoteobjects -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 Remoteobjects module - Provides an easy to use mechanism for sharing a QObject's API (Properties/Signals/Slots) between processes or devices. -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-script/CONTROL b/ports/qt5-script/CONTROL index 040064f60b2f03..318c6af7d6778d 100644 --- a/ports/qt5-script/CONTROL +++ b/ports/qt5-script/CONTROL @@ -1,4 +1,4 @@ Source: qt5-script -Version: 5.12.5-1 -Build-Depends: qt5-base, qt5-tools +Version: 5.15.0 +Build-Depends: qt5-base[core], qt5-tools Description:Qt5 Script Module. diff --git a/ports/qt5-scxml/CONTROL b/ports/qt5-scxml/CONTROL index c2f22a15b75cd4..89c4fecae0d019 100644 --- a/ports/qt5-scxml/CONTROL +++ b/ports/qt5-scxml/CONTROL @@ -1,4 +1,4 @@ Source: qt5-scxml -Version: 5.12.5 +Version: 5.15.0 Description: Qt5 SCXML Module - Provides classes and tools for creating state machines from SCXML files and embedding them in applications -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-sensors/CONTROL b/ports/qt5-sensors/CONTROL index e7068815af332c..c9238cdb75c8d9 100644 --- a/ports/qt5-sensors/CONTROL +++ b/ports/qt5-sensors/CONTROL @@ -1,4 +1,4 @@ Source: qt5-sensors -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 Sensors module - Provides access to sensor hardware and motion gesture recognition. -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-serialbus/CONTROL b/ports/qt5-serialbus/CONTROL new file mode 100644 index 00000000000000..3fb0e6eb3b1b76 --- /dev/null +++ b/ports/qt5-serialbus/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-serialbus +Version: 5.15.0 +Description: Qt5 Serialbus Module; +Build-Depends: qt5-base[core], qt5-serialport diff --git a/ports/qt5-serialbus/portfile.cmake b/ports/qt5-serialbus/portfile.cmake new file mode 100644 index 00000000000000..d4e611db98f956 --- /dev/null +++ b/ports/qt5-serialbus/portfile.cmake @@ -0,0 +1,2 @@ +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() diff --git a/ports/qt5-serialport/CONTROL b/ports/qt5-serialport/CONTROL index 3f8dffc8b0b7cb..59f2351ecea13c 100644 --- a/ports/qt5-serialport/CONTROL +++ b/ports/qt5-serialport/CONTROL @@ -1,4 +1,4 @@ Source: qt5-serialport -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Serial Port - provides access to hardware and virtual serial ports -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qt5-speech/CONTROL b/ports/qt5-speech/CONTROL index 682422a95298ce..68cf863a366e28 100644 --- a/ports/qt5-speech/CONTROL +++ b/ports/qt5-speech/CONTROL @@ -1,4 +1,4 @@ Source: qt5-speech -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Speech Module -Build-Depends: qt5-base, atlmfc (windows), qt5-declarative, qt5-multimedia +Build-Depends: qt5-base[core], atlmfc (windows), qt5-declarative, qt5-multimedia diff --git a/ports/qt5-svg/CONTROL b/ports/qt5-svg/CONTROL index cbc01727a514b1..e51ed4e28b3790 100644 --- a/ports/qt5-svg/CONTROL +++ b/ports/qt5-svg/CONTROL @@ -1,4 +1,4 @@ Source: qt5-svg -Version: 5.12.5 +Version: 5.15.0 Description: Qt5 SVG Module - provides classes for displaying the contents of SVG files -Build-Depends: qt5-base +Build-Depends: qt5-base[core] diff --git a/ports/qt5-tools/CONTROL b/ports/qt5-tools/CONTROL index 0e662daf3fcffd..032db26c081483 100644 --- a/ports/qt5-tools/CONTROL +++ b/ports/qt5-tools/CONTROL @@ -1,4 +1,4 @@ Source: qt5-tools -Version: 5.12.5-5 +Version: 5.15.0 Description: Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications -Build-Depends: qt5-base, qt5-declarative, qt5-activeqt (windows) +Build-Depends: qt5-base[core], qt5-declarative, qt5-activeqt (windows) diff --git a/ports/qt5-translations/CONTROL b/ports/qt5-translations/CONTROL new file mode 100644 index 00000000000000..4df742042e2330 --- /dev/null +++ b/ports/qt5-translations/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-translations +Version: 5.15.0 +Description: Qt5 translations module +Build-Depends: qt5-base[core], qt5-tools diff --git a/ports/qt5-translations/portfile.cmake b/ports/qt5-translations/portfile.cmake new file mode 100644 index 00000000000000..d473c56257aced --- /dev/null +++ b/ports/qt5-translations/portfile.cmake @@ -0,0 +1,3 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-virtualkeyboard/CONTROL b/ports/qt5-virtualkeyboard/CONTROL index dce415c5a781d4..2a535313f72f56 100644 --- a/ports/qt5-virtualkeyboard/CONTROL +++ b/ports/qt5-virtualkeyboard/CONTROL @@ -1,4 +1,4 @@ Source: qt5-virtualkeyboard -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Virtual Keyboard Module - A framework for implementing different input methods. Supports localized keyboard layouts and custom visual themes Build-Depends: qt5-svg, qt5-quickcontrols, qt5-multimedia, qt5-quickcontrols diff --git a/ports/qt5-wayland/CONTROL b/ports/qt5-wayland/CONTROL new file mode 100644 index 00000000000000..0063cacf0bda0c --- /dev/null +++ b/ports/qt5-wayland/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-wayland +Version: 5.15.0 +Description: Qt5 wayland Module; +Build-Depends: qt5-base[core] diff --git a/ports/qt5-wayland/portfile.cmake b/ports/qt5-wayland/portfile.cmake new file mode 100644 index 00000000000000..a9d16989ea4643 --- /dev/null +++ b/ports/qt5-wayland/portfile.cmake @@ -0,0 +1,6 @@ +#Will not build on Windows! +message(WARNING "This port is just a placeholder until the required wayland libraries have been added into VCPKG! \ + As such the build will most likely fail until your system has the required wayland libraries installed (untested)") + +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-webchannel/CONTROL b/ports/qt5-webchannel/CONTROL index 91d444b2edceaa..ee2bbd2da2ee0d 100644 --- a/ports/qt5-webchannel/CONTROL +++ b/ports/qt5-webchannel/CONTROL @@ -1,4 +1,4 @@ Source: qt5-webchannel -Version: 5.12.5-2 +Version: 5.15.0 Description: Qt5 Web Channel module - Provides access to QObject or QML objects from HTML clients for seamless integration of Qt applications with HTML/JavaScript clients. -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-webengine/CONTROL b/ports/qt5-webengine/CONTROL new file mode 100644 index 00000000000000..a157652411afcc --- /dev/null +++ b/ports/qt5-webengine/CONTROL @@ -0,0 +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/build.patch b/ports/qt5-webengine/build.patch new file mode 100644 index 00000000000000..ec13b2d1446e10 --- /dev/null +++ b/ports/qt5-webengine/build.patch @@ -0,0 +1,12 @@ +diff --git a/src/3rdparty/chromium/net/cert/x509_certificate_net_log_param.h b/src/3rdparty/chromium/net/cert/x509_certificate_net_log_param.h +index 22dd9cc14..910149936 100644 +--- a/src/3rdparty/chromium/net/cert/x509_certificate_net_log_param.h ++++ b/src/3rdparty/chromium/net/cert/x509_certificate_net_log_param.h +@@ -6,6 +6,7 @@ + #define NET_CERT_X509_CERTIFICATE_NET_LOG_PARAM_H_ + + #include ++#include + + #include "net/base/net_export.h" + diff --git a/ports/qt5-webengine/common.pri.patch b/ports/qt5-webengine/common.pri.patch new file mode 100644 index 00000000000000..ad58ab9e14ae52 --- /dev/null +++ b/ports/qt5-webengine/common.pri.patch @@ -0,0 +1,12 @@ +diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri +#latest diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri +index 97d39535c..dc09da43a 100644 +--- a/src/buildtools/config/common.pri ++++ b/src/buildtools/config/common.pri +@@ -57,5 +57,5 @@ + precompile_header { +- gn_args += enable_precompiled_headers=true ++ gn_args += enable_precompiled_headers=false + } else { + gn_args += enable_precompiled_headers=false + } diff --git a/ports/qt5-webengine/gl.patch b/ports/qt5-webengine/gl.patch new file mode 100644 index 00000000000000..a48ddf6c302a4e --- /dev/null +++ b/ports/qt5-webengine/gl.patch @@ -0,0 +1,13 @@ +diff --git a/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_gl.h b/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_gl.h +index d54583e8b..1921185f8 100644 +--- a/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_gl.h ++++ b/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_gl.h +@@ -16,7 +16,7 @@ + namespace gl { + + class GLContext; +- ++typedef void *GLeglImageOES; + typedef void(GL_BINDING_CALL* glActiveShaderProgramProc)(GLuint pipeline, + GLuint program); + typedef void(GL_BINDING_CALL* glActiveTextureProc)(GLenum texture); diff --git a/ports/qt5-webengine/portfile.cmake b/ports/qt5-webengine/portfile.cmake new file mode 100644 index 00000000000000..611a3c7c035ddb --- /dev/null +++ b/ports/qt5-webengine/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) +#set(VCPKG_BUILD_TYPE release) #You probably want to set this to reduce build type and space requirements +message(STATUS "${PORT} requires a lot of free disk space (>300GB), ram (>32 GB) and time (>4h per configuration) to be successfully build.\n\ +-- As such ${PORT} is not properly tested.\n\ +-- If ${PORT} fails post build validation please open up an issue. \n\ +-- If it fails due to post validation the successfully installed files can be found in ${CURRENT_PACKAGES_DIR} \n\ +-- and just need to be copied into ${CURRENT_INSTALLED_DIR}") +if(NOT VCPKG_TARGET_IS_WINDOWS) + message(STATUS "If ${PORT} directly fails ${PORT} might require additional prerequisites on Linux and OSX. Please check the configure logs.\n") +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) +vcpkg_find_acquire_program(PYTHON2) +vcpkg_find_acquire_program(NINJA) +get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY ) +get_filename_component(BISON_DIR "${BISON}" DIRECTORY ) +get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY ) +get_filename_component(GPERF_DIR "${GPERF}" DIRECTORY ) +get_filename_component(NINJA_DIR "${NINJA}" DIRECTORY ) + +if(WIN32) # WIN32 HOST probably has win_flex and win_bison! + if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}") + file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}") + endif() + if(NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}") + file(CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}") + endif() +endif() + +vcpkg_add_to_path(PREPEND "${FLEX_DIR}") +vcpkg_add_to_path(PREPEND "${BISON_DIR}") +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 + vs2017.patch) + +if(NOT VCPKG_TARGET_IS_WINDOWS) + list(APPEND CORE_OPTIONS "BUILD_OPTIONS" "-webengine-system-libwebp" "-webengine-system-ffmpeg" "-webengine-system-icu") +endif() + +qt_submodule_installation(${CORE_OPTIONS} PATCHES ${PATCHES}) 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-webglplugin/CONTROL b/ports/qt5-webglplugin/CONTROL new file mode 100644 index 00000000000000..a88cf344819716 --- /dev/null +++ b/ports/qt5-webglplugin/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-webglplugin +Version: 5.15.0 +Description: Qt5 webglplugin Module; +Build-Depends: qt5-base[core] diff --git a/ports/qt5-webglplugin/portfile.cmake b/ports/qt5-webglplugin/portfile.cmake new file mode 100644 index 00000000000000..d473c56257aced --- /dev/null +++ b/ports/qt5-webglplugin/portfile.cmake @@ -0,0 +1,3 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-websockets/CONTROL b/ports/qt5-websockets/CONTROL index fbfeba6c44988c..a3f54c4cfab7cb 100644 --- a/ports/qt5-websockets/CONTROL +++ b/ports/qt5-websockets/CONTROL @@ -1,4 +1,4 @@ Source: qt5-websockets -Version: 5.12.5 +Version: 5.15.0 Description: Qt5 Web Sockets Module - provides WebSocket communication compliant with RFC 6455 -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5-webview/CONTROL b/ports/qt5-webview/CONTROL index 16aa0bbf618bfc..bffc35cde12ca0 100644 --- a/ports/qt5-webview/CONTROL +++ b/ports/qt5-webview/CONTROL @@ -1,4 +1,4 @@ Source: qt5-webview -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 WebView module - Provides a way to display web content in a QML application without necessarily including a full web browser stack by using native APIs where it makes sense. Build-Depends: qt5-declarative diff --git a/ports/qt5-winextras/CONTROL b/ports/qt5-winextras/CONTROL index 3f65220bf37d81..ecf111342330d8 100644 --- a/ports/qt5-winextras/CONTROL +++ b/ports/qt5-winextras/CONTROL @@ -1,5 +1,5 @@ Source: qt5-winextras -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows. -Build-Depends: qt5-base, atlmfc (windows), qt5-declarative, qt5-multimedia -Supports: windows \ No newline at end of file +Build-Depends: qt5-base[core], atlmfc (windows), qt5-declarative, qt5-multimedia +Supports: windows diff --git a/ports/qt5-x11extras/CONTROL b/ports/qt5-x11extras/CONTROL new file mode 100644 index 00000000000000..93ae3cdda2e901 --- /dev/null +++ b/ports/qt5-x11extras/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-x11extras +Version: 5.15.0 +Description: Qt5 x11extras Module; +Build-Depends: qt5-base[core] diff --git a/ports/qt5-x11extras/portfile.cmake b/ports/qt5-x11extras/portfile.cmake new file mode 100644 index 00000000000000..214726759f3cf1 --- /dev/null +++ b/ports/qt5-x11extras/portfile.cmake @@ -0,0 +1,2 @@ +include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) +qt_submodule_installation() \ No newline at end of file diff --git a/ports/qt5-xmlpatterns/CONTROL b/ports/qt5-xmlpatterns/CONTROL index 15a67649806f77..d8940876918972 100644 --- a/ports/qt5-xmlpatterns/CONTROL +++ b/ports/qt5-xmlpatterns/CONTROL @@ -1,4 +1,4 @@ Source: qt5-xmlpatterns -Version: 5.12.5-1 +Version: 5.15.0 Description: Qt5 XML Patterns Module - Support for XPath, XQuery, XSLT and XML schema validation -Build-Depends: qt5-base, qt5-declarative +Build-Depends: qt5-base[core], qt5-declarative diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 86e395438b2c43..2b06636e7b82dd 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,9 +1,163 @@ Source: qt5 -Version: 5.12.5 +Version: 5.15.0 +Port-Version: 1 Homepage: https://www.qt.io/ Description: Qt5 Application Framework -Build-Depends: qt5-3d, qt5-activeqt (windows), qt5-base, qt5-charts, qt5-datavis3d, qt5-declarative, qt5-gamepad, qt5-graphicaleffects, qt5-imageformats, qt5-location, qt5-multimedia, qt5-mqtt, qt5-networkauth, qt5-purchasing, qt5-quickcontrols, qt5-quickcontrols2, qt5-script, qt5-scxml, qt5-sensors, qt5-serialport, qt5-speech, qt5-svg, qt5-tools, qt5-virtualkeyboard, qt5-webchannel, qt5-websockets, qt5-winextras (windows), qt5-macextras (osx), qt5-xmlpatterns +Build-Depends: qt5-base[core] +Default-Features: essentials + +Feature: essentials +Build-Depends: qt5[core, tools, networkauth, quickcontrols2, multimedia, imageformats, declarative, svg, activeqt] +Description: Build the essential qt modules Feature: latest -Build-Depends: qt5-base[latest] -Description: Build latest qt version (5.13.1) instead of LTS \ No newline at end of file +Build-Depends: qt5-base[core, latest] +Description: Build latest qt version (5.14.2) instead of LTS + +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: + +Feature: 3d +Build-Depends: qt5-3d +Description: + +Feature: webchannel +Build-Depends: qt5-webchannel +Description: + +Feature: websockets +Build-Depends: qt5-websockets +Description: + +Feature: xmlpatterns +Build-Depends: qt5-xmlpatterns +Description: (deprecated) + +Feature: sensors +Build-Depends: qt5-sensors +Description: + +Feature: serialport +Build-Depends: qt5-serialport +Description: + +Feature: speech +Build-Depends: qt5-speech +Description: + +Feature: svg +Build-Depends: qt5-svg +Description: + +Feature: tools +Build-Depends: qt5-tools +Description: + +Feature: virtualkeyboard +Build-Depends: qt5-virtualkeyboard +Description: + +Feature: networkauth +Build-Depends: qt5-networkauth +Description: + +Feature: purchasing +Build-Depends: qt5-purchasing +Description: + +Feature: quickcontrols +Build-Depends: qt5-quickcontrols +Description: (deprecated) + +Feature: quickcontrols2 +Build-Depends: qt5-quickcontrols2 +Description: + +Feature: script +Build-Depends: qt5-script +Description: (deprecated) + +Feature: scxml +Build-Depends: qt5-scxml +Description: + +Feature: activeqt +Build-Depends: qt5-activeqt (windows) +Description: Windows Only + +Feature: charts +Build-Depends: qt5-charts +Description: + +Feature: datavis3d +Build-Depends: qt5-datavis3d +Description: + +Feature: declarative +Build-Depends: qt5-declarative +Description: + +Feature: gamepad +Build-Depends: qt5-gamepad +Description: + +Feature: graphicaleffects +Build-Depends: qt5-graphicaleffects +Description: + +Feature: imageformats +Build-Depends: qt5-imageformats +Description: + +Feature: location +Build-Depends: qt5-location +Description: + +Feature: multimedia +Build-Depends: qt5-multimedia +Description: + +Feature: mqtt +Build-Depends: qt5-mqtt +Description: + +Feature: webglplugin +Build-Depends: qt5-webglplugin +Description: + +Feature: webview +Build-Depends: qt5-webview +Description: + +Feature: wayland +Build-Depends: qt5-wayland +Description: + +Feature: webengine +Build-Depends: qt5-webengine +Description: + +Feature: serialbus +Build-Depends: qt5-serialbus +Description: + +Feature: translations +Build-Depends: qt5-translations +Description: + +Feature: doc +Build-Depends: qt5-doc +Description: + +Feature: remoteobjects +Build-Depends: qt5-remoteobjects +Description: + +Feature: connectivity +Build-Depends: qt5-connectivity +Description: diff --git a/ports/qtkeychain/CONTROL b/ports/qtkeychain/CONTROL index d054322cf9bc1b..2e019cc77a96c3 100644 --- a/ports/qtkeychain/CONTROL +++ b/ports/qtkeychain/CONTROL @@ -1,4 +1,4 @@ Source: qtkeychain -Version: v0.9.1 +Version: v0.9.1-1 Description: qtkeychain - Platform-independent Qt API for storing passwords securely -Build-Depends: qt5-base, qt5-tools \ No newline at end of file +Build-Depends: qt5-base[core], qt5-tools \ No newline at end of file diff --git a/ports/quadtree/CONTROL b/ports/quadtree/CONTROL new file mode 100644 index 00000000000000..320590bf3c1bce --- /dev/null +++ b/ports/quadtree/CONTROL @@ -0,0 +1,4 @@ +Source: quadtree +Version: 2020-04-13 +Description: A simple and modern C++ quadtree implementation +Homepage: https://github.com/pvigier/Quadtree \ No newline at end of file diff --git a/ports/quadtree/portfile.cmake b/ports/quadtree/portfile.cmake new file mode 100644 index 00000000000000..01e6b371a84cb2 --- /dev/null +++ b/ports/quadtree/portfile.cmake @@ -0,0 +1,19 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pvigier/Quadtree + REF fec2e1a011f656353ba12c58cefe33482e1a27b5 + SHA512 8291afb29b9ff5714125e411122f6f10e1c2e4c2109384e25afa834548dc1f63c90b2d09c7cfed213ad69a8c54cf32fc598783b3ff0882bc86562594895d5c35 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCODE_COVERAGE=OFF + -DBUILD_BENCHMARKS=OFF + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF +) + +file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/quickfix/CONTROL b/ports/quickfix/CONTROL index 03989a169bd69b..5a3fe30c21a073 100644 --- a/ports/quickfix/CONTROL +++ b/ports/quickfix/CONTROL @@ -1,5 +1,5 @@ Source: quickfix -Version: 1.15.1-3 +Version: 1.15.1-4 Build-Depends: openssl Homepage: https://github.com/quickfix/quickfix Description: QuickFIX is a free and open source implementation of the FIX protocol. diff --git a/ports/quickfix/portfile.cmake b/ports/quickfix/portfile.cmake index 6af17a2119b956..d41a13c7c7436d 100644 --- a/ports/quickfix/portfile.cmake +++ b/ports/quickfix/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -8,8 +6,9 @@ vcpkg_from_github( REF v1.15.1 SHA512 6c3dc53f25932c9b7516ab9228f634511ae0f399719f87f0ec2b38c380c0a7d1c808f0f9a14a70a063e1956118550d1121222283a9139f23cd4f8f038f595f70 HEAD_REF master - PATCHES 00001-fix-build.patch - fix_wsl_symlink_error.patch + PATCHES + 00001-fix-build.patch + fix_wsl_symlink_error.patch ) file(GLOB_RECURSE SRC_FILES RELATIVE ${SOURCE_PATH} @@ -47,5 +46,5 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/quickfix) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/quickfix/copyright COPYONLY) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/quickfix) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/quill/CONTROL b/ports/quill/CONTROL new file mode 100644 index 00000000000000..9fee17006d55c2 --- /dev/null +++ b/ports/quill/CONTROL @@ -0,0 +1,7 @@ +Source: quill +Version: 1.3.3 +Homepage: https://github.com/odygrd/quill/ +Description: C++14 Asynchronous Low Latency Logging Library +Supports: !(arm|arm64|uwp|android) +Build-Depends: fmt + diff --git a/ports/quill/portfile.cmake b/ports/quill/portfile.cmake new file mode 100644 index 00000000000000..61ad68227be8a9 --- /dev/null +++ b/ports/quill/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO odygrd/quill + REF f1d244f521a117beabebbe536f8507f8b2aa2244 #v1.3.3 + SHA512 1164f6089f92822f35570832873aef9d619d3da311d1f57f36fd83fd2f659255a1ea44db79948a1591d48c4ec45a7b7158a5745f37a3c940e7bc7b97d52dd85e + HEAD_REF master +) + +# remove bundled fmt +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/quill/quill/include/quill/bundled/fmt) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/quill/quill/src/bundled/fmt) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DQUILL_FMT_EXTERNAL=ON +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/quill) + +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/qwt/CONTROL b/ports/qwt/CONTROL index 6390365508916d..8353f4670f4306 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,5 +1,6 @@ Source: qwt -Version: 6.1.3-10 +Version: 6.1.4 +Port-Version: 1 Homepage: https://sourceforge.net/projects/qwt Description: Qt widgets library for technical applications -Build-Depends: qt5-base, qt5-svg, qt5-tools +Build-Depends: qt5-base[core], qt5-svg, qt5-tools diff --git a/ports/qwt/build.patch b/ports/qwt/build.patch new file mode 100644 index 00000000000000..8b36bb8332ac13 --- /dev/null +++ b/ports/qwt/build.patch @@ -0,0 +1,135 @@ +diff --git a/src/qwt_compass_rose.cpp b/src/qwt_compass_rose.cpp +index 8acb045c2..b7b676712 100644 +--- a/src/qwt_compass_rose.cpp ++++ b/src/qwt_compass_rose.cpp +@@ -11,6 +11,7 @@ + #include "qwt_point_polar.h" + #include "qwt_painter.h" + #include ++#include + + static QPointF qwtIntersection( + QPointF p11, QPointF p12, QPointF p21, QPointF p22 ) +diff --git a/src/qwt_dial_needle.cpp b/src/qwt_dial_needle.cpp +index 3589b011d..4f20aada1 100644 +--- a/src/qwt_dial_needle.cpp ++++ b/src/qwt_dial_needle.cpp +@@ -13,6 +13,7 @@ + #include "qwt_painter.h" + #include + #include ++#include + + #if QT_VERSION < 0x040601 + #define qFastSin(x) qSin(x) +diff --git a/src/qwt_null_paintdevice.cpp b/src/qwt_null_paintdevice.cpp +index 21b97b0ad..545804b06 100644 +--- a/src/qwt_null_paintdevice.cpp ++++ b/src/qwt_null_paintdevice.cpp +@@ -10,6 +10,7 @@ + #include "qwt_null_paintdevice.h" + #include + #include ++#include + + class QwtNullPaintDevice::PrivateData + { +diff --git a/src/qwt_painter.cpp b/src/qwt_painter.cpp +index 069e2ae42..824ddfc20 100644 +--- a/src/qwt_painter.cpp ++++ b/src/qwt_painter.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #if QT_VERSION >= 0x050000 + #include +diff --git a/src/qwt_painter_command.h b/src/qwt_painter_command.h +index 032d0348b..13db43559 100644 +--- a/src/qwt_painter_command.h ++++ b/src/qwt_painter_command.h +@@ -15,8 +15,7 @@ + #include + #include + #include +- +-class QPainterPath; ++#include + + /*! + QwtPainterCommand represents the attributes of a paint operation +diff --git a/src/qwt_plot_glcanvas.cpp b/src/qwt_plot_glcanvas.cpp +index 64b39b90e..414cb22c5 100644 +--- a/src/qwt_plot_glcanvas.cpp ++++ b/src/qwt_plot_glcanvas.cpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #define FIX_GL_TRANSLATION 0 + +diff --git a/src/qwt_plot_glcanvas.h b/src/qwt_plot_glcanvas.h +index 82770747f..be93232c4 100644 +--- a/src/qwt_plot_glcanvas.h ++++ b/src/qwt_plot_glcanvas.h +@@ -13,6 +13,7 @@ + #include "qwt_global.h" + #include + #include ++#include + + class QwtPlot; + +diff --git a/src/qwt_plot_panner.cpp b/src/qwt_plot_panner.cpp +index bed4566dd..852998f01 100644 +--- a/src/qwt_plot_panner.cpp ++++ b/src/qwt_plot_panner.cpp +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #if QT_VERSION >= 0x050000 + #if QT_VERSION < 0x050100 +diff --git a/src/qwt_plot_renderer.cpp b/src/qwt_plot_renderer.cpp +index b6c83447e..a309fe290 100644 +--- a/src/qwt_plot_renderer.cpp ++++ b/src/qwt_plot_renderer.cpp +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #ifndef QWT_NO_SVG + #ifdef QT_SVG_LIB +diff --git a/src/qwt_widget_overlay.cpp b/src/qwt_widget_overlay.cpp +index 79c46ce10..f64042ac8 100644 +--- a/src/qwt_widget_overlay.cpp ++++ b/src/qwt_widget_overlay.cpp +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + static QImage::Format qwtMaskImageFormat() + { +diff --git a/src/src.pri b/src/src.pri +index 571870361..412636d5b 100644 +--- a/src/src.pri ++++ b/src/src.pri +@@ -7,7 +7,7 @@ + # modify it under the terms of the Qwt License, Version 1.0 + ################################################################ + +- ++QT += gui + HEADERS += \ + qwt.h \ + qwt_abstract_scale_draw.h \ diff --git a/ports/qwt/fix-dynamic-static.patch b/ports/qwt/fix-dynamic-static.patch index b608681f2ecc03..918934670dd0ab 100644 --- a/ports/qwt/fix-dynamic-static.patch +++ b/ports/qwt/fix-dynamic-static.patch @@ -12,4 +12,4 @@ index 1fe6055..441c69b 100644 +} ###################################################################### - # QwtPlot enables all classes, that are needed to use the QwtPlot + # QwtPlot enables all classes, that are needed to use the QwtPlot diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index dce59e8e59f60c..795fe53b0bb408 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -1,15 +1,11 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/qwt/files/qwt/6.1.3/qwt-6.1.3.zip" - FILENAME "qwt-6.1.3.zip" - SHA512 8f249e23d50f71d14fca37776ea40d8d6931db14d9602e03a343bfb7a9bf55502202103135b77f583c3890a7924220e8a142a01c448dbde311860d89a3b10fc8 -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH + REPO qwt/qwt + REF 6.1.4 + FILENAME "qwt-6.1.4.zip" + SHA512 711256ec4d1d54d201650e9c63b584b17a61dbedde5a581e0b6227fdbee149cdbe2a889aa58f67777125b6471fc1fe248992ec845eb6481a2dfc2c4276701d7f PATCHES fix-dynamic-static.patch + build.patch ) vcpkg_configure_qmake( @@ -32,8 +28,7 @@ endif() #Install the header files file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) -file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/qwt) +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qwt) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright) +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..2ce5b0a13bac69 --- /dev/null +++ b/ports/qwtw/CONTROL @@ -0,0 +1,7 @@ +Source: qwtw +Version: 3.0 +Homepage: https://github.com/ig-or/qwtw +Description: qwt-based 2D plotting library +Supports: windows & x64 & !static +Build-Depends: qt5-base, qt5-svg, 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..c88ac2179ed5f5 --- /dev/null +++ b/ports/qwtw/portfile.cmake @@ -0,0 +1,19 @@ +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 54bedcce743991f2f274bebda0ee399683a9e9bb + SHA512 defd7f199c8bf490f5ac69deade4a4a45581c0fa5b79cf2aa1fbec8c46bbbe1d9c9cf0f7ba383e8e92f5e6145b42a837b7dc555017893797f72dab1ce490e57a + 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/range-v3/CONTROL b/ports/range-v3/CONTROL index b2ecba0285e6f3..cffad89fc45a0f 100644 --- a/ports/range-v3/CONTROL +++ b/ports/range-v3/CONTROL @@ -1,4 +1,4 @@ Source: range-v3 -Version: 0.10.0 +Version: 0.10.0-20200708 Homepage: https://github.com/ericniebler/range-v3 Description: Range library for C++11/14/17. diff --git a/ports/range-v3/portfile.cmake b/ports/range-v3/portfile.cmake index c94c3ac3d89350..f70763d7c1bc0f 100644 --- a/ports/range-v3/portfile.cmake +++ b/ports/range-v3/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ericniebler/range-v3 - REF 4d6a463bca51bc316f9b565edd94e82388206093 # 0.10.0 - SHA512 5aede48a1c9cefe8b93912c039137407f6a264190db9111bdbfa86c22663d00af3f1bba9151f3e137195c9c1a8f6d4ad14ce82a154a6d6a37fc431ee0bf242c5 + REF a7f58f8ab7d1260aca66151009ae072d0980c7c7 + SHA512 f0f4980e5e6cf9cc6911760685dbd90395568934688a7f3307171e5460e4d351e116c72051a74a124c9f84235a1ed201d4b80ed647355b0fddfc8f1f19829fcd HEAD_REF master ) @@ -24,4 +24,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) vcpkg_copy_pdbs() -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/rapidcheck/CONTROL b/ports/rapidcheck/CONTROL index 67c82313c24006..9c3e4c7b505db5 100644 --- a/ports/rapidcheck/CONTROL +++ b/ports/rapidcheck/CONTROL @@ -1,3 +1,4 @@ Source: rapidcheck -Version: 2018-11-05-1 +Version: 2018-11-05-2 +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 new file mode 100644 index 00000000000000..016f859c2384a4 --- /dev/null +++ b/ports/rapidcheck/fix-addiosfwd.patch @@ -0,0 +1,12 @@ +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 bdebdb656d432e..892942d32058e7 100644 --- a/ports/rapidcheck/portfile.cmake +++ b/ports/rapidcheck/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -8,6 +6,7 @@ vcpkg_from_github( REF cf9e0d8bd8c94e9dc00dc0ab302352bfaf1a3ac5 SHA512 6cef62edbda391c3527d63db350842f669841ad2c751a64773250cd40bb65f26c2c394b107ef5530c2d3bd15b7079148fa9778d68a7346225bbb15227b1553c5 HEAD_REF master + PATCHES fix-addiosfwd.patch ) vcpkg_configure_cmake( @@ -18,13 +17,10 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/rapidcheck/cmake) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT}/cmake) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/rapidcheck/copyright COPYONLY) - -# Post-build test for cmake libraries -vcpkg_test_cmake(PACKAGE_NAME rapidcheck) +configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/rapidxml/CONTROL b/ports/rapidxml/CONTROL index 672fe47d26aa66..7e119fb705f2dc 100644 --- a/ports/rapidxml/CONTROL +++ b/ports/rapidxml/CONTROL @@ -1,4 +1,4 @@ Source: rapidxml -Version: 1.13-1 +Version: 1.13-4 Homepage: https://sourceforge.net/projects/rapidxml Description: RapidXml is an attempt to create the fastest XML parser possible, while retaining useability, portability and reasonable W3C compatibility. diff --git a/ports/rapidxml/portfile.cmake b/ports/rapidxml/portfile.cmake index ef0cd959a17a27..b13d1a2bc86e49 100644 --- a/ports/rapidxml/portfile.cmake +++ b/ports/rapidxml/portfile.cmake @@ -1,17 +1,12 @@ #header-only library -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO rapidxml/rapidxml + REF rapidxml%201.13 FILENAME "rapidxml-1.13.zip" SHA512 6c10583e6631ccdb0217d0a5381172cb4c1046226de6ef1acf398d85e81d145228e14c3016aefcd7b70a1db8631505b048d8b4f5d4b0dbf1811d2482eefdd265 ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - # Handle copyright file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/rapidxml) file(RENAME ${CURRENT_PACKAGES_DIR}/share/rapidxml/license.txt ${CURRENT_PACKAGES_DIR}/share/rapidxml/copyright) diff --git a/ports/raylib/CONTROL b/ports/raylib/CONTROL index c3d9db7454cd6e..efa8155c234f39 100644 --- a/ports/raylib/CONTROL +++ b/ports/raylib/CONTROL @@ -1,7 +1,10 @@ Source: raylib -Version: 2.6.0 +Version: 3.0.0 +Port-Version: 2 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: use-audio +Description: Build raylib with audio module diff --git a/ports/raylib/portfile.cmake b/ports/raylib/portfile.cmake index 4620075ae09b8c..0d47a969f5b893 100644 --- a/ports/raylib/portfile.cmake +++ b/ports/raylib/portfile.cmake @@ -16,8 +16,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO raysan5/raylib - REF 6f3c99a295533e41de3049db5e683d15fd5c6e1a # 2.6.0 - SHA512 358ebcffb7e11f319f82ecf791480eb23c40a53b764cad1d2109064bb06575c7af0325bf06ec86bbb2c43b70b12f52b5b6d1318d8857e07ff8e965a1dadbd8e2 + REF 7ef114d1da2c34a70bba5442497103441647d8f3 # 3.0.0 + SHA512 e15df6f0f95d9580d6211459815f174496b1385c9797a682d372a03b1175c9eb38e51b3b27077346d5e1a2d6ee2d5c636e03e8fd3ca9a73a7fa2a67afd255bd2 HEAD_REF master ) @@ -25,8 +25,7 @@ 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 + use-audio USE_AUDIO ) vcpkg_configure_cmake( @@ -37,8 +36,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 @@ -74,8 +73,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/vcpkg-cmake-wrapper.cmake b/ports/raylib/vcpkg-cmake-wrapper.cmake index 1efda7c9e58240..81e9989ec0d357 100644 --- a/ports/raylib/vcpkg-cmake-wrapper.cmake +++ b/ports/raylib/vcpkg-cmake-wrapper.cmake @@ -6,8 +6,8 @@ if(raylib_FOUND) get_filename_component(_raylib_lib_name ${raylib_LIBRARY} NAME) set(raylib_LIBRARY - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/${_raylib_lib_name} - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/${_raylib_lib_name} + debug ${CURRENT_INSTALLED_DIR}/debug/lib/${_raylib_lib_name} + optimized ${CURRENT_INSTALLED_DIR}/lib/${_raylib_lib_name} ) set(raylib_LIBRARIES ${raylib_LIBRARY}) diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index ee405e8a0ddfde..7304016c6032c1 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -1,5 +1,5 @@ Source: realsense2 -Version: 2.33.1 +Version: 2.34.0 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). @@ -10,3 +10,6 @@ Description: Build Intel® RealSense™ examples and tools Feature: openni2 Build-Depends: openni2 Description: Build Intel® RealSense™ OpenNI2 driver + +Feature: tm2 +Description: Build Intel® RealSense™ T265 device diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index d1b1022037eb72..2db0f278ad638c 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 842ee1e1e5c4bb96d63582a7fde061dbc1bebf69#v2.33.1 - SHA512 70f6f9c2f1c5925532b2ff22779579b3610a7f616d66ac92e8e85c6f30df334bf8fb125355a0706bacef0be8370acc62bb7623f3f200326e71fe53e07726fa6a + REF 025fccf76803ee6a6e60de9f18ac6193b7ff8597 #v2.34.0 + SHA512 c502fba6b3dbb34b0ac0094deef9ffce330faf435bbc7612148fd8ba3d5b380f7990604a67236e7da815c8e6988ae58c17fa597571a2462f75c8f5000007cc0a HEAD_REF master PATCHES fix_openni2.patch @@ -12,6 +12,10 @@ vcpkg_from_github( file(COPY ${SOURCE_PATH}/src/win7/drivers/IntelRealSense_D400_series_win7.inf DESTINATION ${SOURCE_PATH}) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tm2 BUILD_WITH_TM2 +) + set(BUILD_TOOLS OFF) if("tools" IN_LIST FEATURES) set(BUILD_TOOLS ON) @@ -25,9 +29,8 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DENFORCE_METADATA=ON - -DBUILD_WITH_TM2=OFF -DBUILD_WITH_OPENMP=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} diff --git a/ports/refl-cpp/CONTROL b/ports/refl-cpp/CONTROL new file mode 100644 index 00000000000000..bb75e1e9e66e59 --- /dev/null +++ b/ports/refl-cpp/CONTROL @@ -0,0 +1,4 @@ +Source: refl-cpp +Version: 0.9.1 +Description: A compile-time reflection library for modern C++ with support for overloads, templates, attributes and proxies +Homepage: https://github.com/veselink1/refl-cpp diff --git a/ports/refl-cpp/portfile.cmake b/ports/refl-cpp/portfile.cmake new file mode 100644 index 00000000000000..999dd1c6a23bb6 --- /dev/null +++ b/ports/refl-cpp/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO veselink1/refl-cpp + REF v0.9.1 + SHA512 ddb48d7f75cf7757031af28b53d07a104cb64e279c8fc23575639c3839f1501b346e40963d358629b612e4f64aba6f86ffc5a592dd6cd8febf872a8cd1466171 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/refl.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/replxx/CONTROL b/ports/replxx/CONTROL index ec643802c701ac..efc7b3391c3a45 100644 --- a/ports/replxx/CONTROL +++ b/ports/replxx/CONTROL @@ -1,6 +1,5 @@ Source: replxx -Version: 0.0.2 +Version: 0.0.2-2 Homepage: https://github.com/AmokHuginnsson/replxx Description: A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters. Supports: !uwp - diff --git a/ports/replxx/add-stdexcept.patch b/ports/replxx/add-stdexcept.patch new file mode 100644 index 00000000000000..51fe01447f0dd0 --- /dev/null +++ b/ports/replxx/add-stdexcept.patch @@ -0,0 +1,17 @@ +diff --git a/src/io.cxx b/src/io.cxx +index a098867..6159e4b 100644 +--- a/src/io.cxx ++++ b/src/io.cxx +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include + + #ifdef _WIN32 +@@ -671,4 +672,3 @@ int Terminal::read_verbatim( char32_t* buffer_, int size_ ) { + #endif + + } +- diff --git a/ports/replxx/portfile.cmake b/ports/replxx/portfile.cmake index 0443f37d34f862..cbf2c646a78987 100644 --- a/ports/replxx/portfile.cmake +++ b/ports/replxx/portfile.cmake @@ -6,11 +6,14 @@ vcpkg_from_github( REF 45696c250ce39ab21dedeea962b94d7827007a8c SHA512 7beec508fa3049fe5a736a487728506d646d26d7194ef7453fc07bceade1982430808fab0a10ca9b1c43a8b87bf3a973f5cfe4aa22ed06927647c9a7244167fd HEAD_REF master + PATCHES + add-stdexcept.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE ) vcpkg_install_cmake() @@ -18,5 +21,6 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/replxxConfig.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/restclient-cpp/0001_fix_cmake_linking.patch b/ports/restclient-cpp/0001_fix_cmake_linking.patch deleted file mode 100644 index 815c2198cc25a0..00000000000000 --- a/ports/restclient-cpp/0001_fix_cmake_linking.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 45fc887..8b90048 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -39,7 +39,7 @@ find_package(Threads REQUIRED) - find_package(CURL REQUIRED) - find_package(jsoncpp) - --add_library(restclient-cpp SHARED -+add_library(restclient-cpp - source/restclient.cc - source/connection.cc - source/helpers.cc diff --git a/ports/restclient-cpp/CONTROL b/ports/restclient-cpp/CONTROL index 8b3ede796e508b..df8faa7b708f55 100644 --- a/ports/restclient-cpp/CONTROL +++ b/ports/restclient-cpp/CONTROL @@ -1,4 +1,5 @@ Source: restclient-cpp -Version: 0.5.1-3 +Version: 0.5.2 Build-Depends: curl -Description: Binn is a binary data serialization format designed to be compact, fast and easy to use. +Homepage: https://code.mrtazz.com/restclient-cpp/ +Description: Simple REST client for C++. It wraps libcurl for HTTP requests. diff --git a/ports/restclient-cpp/portfile.cmake b/ports/restclient-cpp/portfile.cmake index 4efcb3ddd8579a..c2ea8fa251c039 100644 --- a/ports/restclient-cpp/portfile.cmake +++ b/ports/restclient-cpp/portfile.cmake @@ -5,11 +5,9 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mrtazz/restclient-cpp - REF 0.5.1 - SHA512 d5e17a984af44f863bc7cdc7307c2b06cae9252f86c6c6c2377cdb317f61b6419d8e9aedc5e5ccdb08fd1ee13848ec3b9ef8067a8d26dcf438a5c8793b5a2ce3 + REF 0.5.2 + SHA512 f6acc6a3d5cb852d6e507463d94d2f6192a941f0c26fef7c674e9ff7753cf5474522052a2065774050d01af5c6d2a3b86398f43cd2e4f5d03abcaac9a21ef4b7 HEAD_REF master - PATCHES - 0001_fix_cmake_linking.patch ) vcpkg_configure_cmake( @@ -26,6 +24,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/restclient-cpp) vcpkg_copy_pdbs() +# Remove includes in debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright diff --git a/ports/restinio/CONTROL b/ports/restinio/CONTROL index f4f56fb9026787..12f685437c98b8 100644 --- a/ports/restinio/CONTROL +++ b/ports/restinio/CONTROL @@ -1,5 +1,5 @@ Source: restinio -Version: 0.6.5 +Version: 0.6.8.1 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 50c1eb7106037a..8d0771036505fb 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 6934bd5a8ad707eb6a04894ec3bb198a39f447d9 # v.0.6.5 - SHA512 5a0228a7a0940f38429cd63368ee3dee72ff2bc9a019bb7b3c9e59314a8fd7afee555f10f9ec375dc7dda412bc6922f7f561fc54b6cf2b783b7db3dda0c2ae6b + REF c4ed2d0956948d47a8fd569f3c0f3d2113219421 # v.0.6.8.1 + SHA512 4f325e9bb4618cde11661b92d309eea549e19ea455f834973baee54a9f181802d3b261b07cfd8de710e45dfd5d48d6c74380222f95895f32bf5996bda61172f3 ) vcpkg_configure_cmake( diff --git a/ports/robin-hood-hashing/CONTROL b/ports/robin-hood-hashing/CONTROL index 785b6f791db2ff..6aa499d881356b 100644 --- a/ports/robin-hood-hashing/CONTROL +++ b/ports/robin-hood-hashing/CONTROL @@ -1,3 +1,4 @@ Source: robin-hood-hashing -Version: 3.4.0 -Description: Fast & memory efficient hashtable based on robin hood hashing for C++14 +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 d3386f01f2c968..4169c32483f009 100644 --- a/ports/robin-hood-hashing/portfile.cmake +++ b/ports/robin-hood-hashing/portfile.cmake @@ -1,16 +1,12 @@ # header-only library -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO martinus/robin-hood-hashing - REF 3.4.0 - SHA512 7985d64063af7d28b9404639df48645d2d72b0bc752fde23c7e3bf431adbd8eb4ffbc439e5a8513a39eb54481ce875fb044fafc86c36046995e3193284a594dd + REF 3.8.0 + SHA512 f64635a2fc3ebd975d40dc4fd3e3df81a6bed11e8bb9df1d6d100e408c2c81da2679e9836313444e573c6bfb160eeecd7fde68988e9d0246601c8993ecc42085 HEAD_REF master ) -file(COPY ${SOURCE_PATH}/src/include/robin_hood.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +file(INSTALL ${SOURCE_PATH}/src/include/robin_hood.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file 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/rtlsdr/CONTROL b/ports/rtlsdr/CONTROL new file mode 100644 index 00000000000000..cbd10d653bf570 --- /dev/null +++ b/ports/rtlsdr/CONTROL @@ -0,0 +1,6 @@ +Source: rtlsdr +Version: 2020-04-16-1 +Homepage: https://osmocom.org/projects/rtl-sdr +Description: rtl-sdr is a library that turns your Realtek RTL2832 based DVB dongle into a SDR receiver +Build-Depends: libusb, pthreads (windows) +Supports: windows&(x86|x64) diff --git a/ports/rtlsdr/Compile-with-msvc.patch b/ports/rtlsdr/Compile-with-msvc.patch new file mode 100644 index 00000000000000..5374ed41260080 --- /dev/null +++ b/ports/rtlsdr/Compile-with-msvc.patch @@ -0,0 +1,88 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2def354..674ff2d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,6 +66,12 @@ endif() + ######################################################################## + # Find build dependencies + ######################################################################## ++if(MSVC) ++find_package(pthreads) ++find_package(libusb) ++include_directories(${PThreads4W_INCLUDE_DIR}) ++include_directories(${LIBUSB_INCLUDE_DIRS}) ++else() + if(WIN32 AND NOT MINGW) + set(THREADS_USE_PTHREADS_WIN32 true) + endif() +@@ -79,6 +85,7 @@ endif() + if(NOT THREADS_FOUND) + message(FATAL_ERROR "pthreads(-win32) required to compile rtl-sdr") + endif() ++endif() + + ######################################################################## + # Create uninstall target +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 33faee7..fda4612 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -20,7 +20,11 @@ + ######################################################################## + add_library(rtlsdr SHARED librtlsdr.c + tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c) ++if(MSVC) ++target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES}) ++else() + target_link_libraries(rtlsdr PkgConfig::LIBUSB) ++endif() + target_include_directories(rtlsdr PUBLIC + $ + $ # /include +@@ -36,7 +40,11 @@ generate_export_header(rtlsdr) + ######################################################################## + add_library(rtlsdr_static STATIC librtlsdr.c + tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c) ++if(MSVC) ++target_link_libraries(rtlsdr_static ${LIBUSB_LIBRARIES}) ++else() + target_link_libraries(rtlsdr_static PkgConfig::LIBUSB) ++endif() + target_include_directories(rtlsdr_static PUBLIC + $ + $ # /include +@@ -58,8 +66,8 @@ IF(MSVC) + ${CMAKE_CURRENT_SOURCE_DIR}/rtlsdr.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc + @ONLY) +- target_sources(rtlsdr ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc) +- target_sources(rtlsdr_static ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc) ++ target_sources(rtlsdr PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc) ++ target_sources(rtlsdr_static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc) + ENDIF(MSVC) + + ######################################################################## +@@ -77,6 +85,11 @@ add_library(libgetopt_static STATIC + target_link_libraries(convenience_static + rtlsdr + ) ++if(MSVC) ++target_link_libraries(convenience_static ++ ${PThreads4W_LIBRARY} ++) ++endif() + endif() + + ######################################################################## +diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c +index 562198f..b4bfa51 100644 +--- a/src/rtl_tcp.c ++++ b/src/rtl_tcp.c +@@ -35,6 +35,7 @@ + #include + #else + #include ++#include + #include "getopt/getopt.h" + #endif + diff --git a/ports/rtlsdr/Findlibusb.cmake b/ports/rtlsdr/Findlibusb.cmake new file mode 100644 index 00000000000000..052ae21dfc2eb1 --- /dev/null +++ b/ports/rtlsdr/Findlibusb.cmake @@ -0,0 +1,17 @@ +find_path( + LIBUSB_INCLUDE_DIRS + NAMES libusb.h + PATH_SUFFIXES libusb-1.0 +) + +find_library( + LIBUSB_LIBRARIES + NAMES libusb-1.0 +) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args( + LIBUSB + REQUIRED_VARS LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS +) diff --git a/ports/rtlsdr/fix-version.patch b/ports/rtlsdr/fix-version.patch new file mode 100644 index 00000000000000..854a054abafcca --- /dev/null +++ b/ports/rtlsdr/fix-version.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/modules/Version.cmake b/cmake/modules/Version.cmake +index 2d4e76d..6acffe2 100644 +--- a/cmake/modules/Version.cmake ++++ b/cmake/modules/Version.cmake +@@ -39,7 +39,9 @@ if(GIT_FOUND) + OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) +-else() ++endif() ++ ++if ("${GIT_DESCRIBE}" STREQUAL "") + set(GIT_DESCRIBE "v${MAJOR_VERSION}.${MINOR_VERSION}.x-xxx-xunknown") + endif() + diff --git a/ports/rtlsdr/portfile.cmake b/ports/rtlsdr/portfile.cmake new file mode 100644 index 00000000000000..fdf48429032381 --- /dev/null +++ b/ports/rtlsdr/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_fail_port_install( + ON_TARGET "uwp" "linux" "osx" "android" "freebsd" + ON_ARCH "arm" "arm64" +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO osmocom/rtl-sdr + REF d794155ba65796a76cd0a436f9709f4601509320 + SHA512 21fe10f1dbecca651650f03d1008560930fac439d220c33b4a23acce98d78d8476ff200765eed8cfa6cddde761d45f7ba36c8b5bc3662aa85819172830ea4938 + HEAD_REF master + PATCHES + Compile-with-msvc.patch + fix-version.patch +) + +file( + COPY ${CMAKE_CURRENT_LIST_DIR}/Findlibusb.cmake + DESTINATION ${SOURCE_PATH}/cmake/Modules +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/rtlsdr) +vcpkg_copy_pdbs() + +file( + INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtlsdr + RENAME copyright +) + +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) +else() + file(GLOB DEBUG_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") + file(GLOB RELEASE_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") + file( + INSTALL ${RELEASE_TOOLS} + DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT} + ) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(REMOVE ${DEBUG_TOOLS} ${RELEASE_TOOLS}) +endif() 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/ryml/CONTROL b/ports/ryml/CONTROL new file mode 100644 index 00000000000000..b6efa45ff353d3 --- /dev/null +++ b/ports/ryml/CONTROL @@ -0,0 +1,6 @@ +Source: ryml +Version: 2020-04-12 +Homepage: https://github.com/biojppm/rapidyaml +Description: Rapid YAML library +Build-Depends: c4core[core] +Supports: !(arm|arm64|osx) \ No newline at end of file diff --git a/ports/ryml/cmake-fix.patch b/ports/ryml/cmake-fix.patch new file mode 100644 index 00000000000000..f2ee817036e6b2 --- /dev/null +++ b/ports/ryml/cmake-fix.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3e4eb23..115b8aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + cmake_minimum_required(VERSION 3.9) ++ + project(ryml) + + include(./ext/c4core/cmake/c4Project.cmake) +@@ -19,8 +20,7 @@ option(RYML_BUILD_API "Enable API generation (python, etc)" OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core CONFIG REQUIRED) + + c4_add_library(ryml + SOURCES +@@ -46,10 +46,10 @@ c4_add_library(ryml + ryml.natvis + SOURCE_ROOT ${RYML_SRC_DIR} + INC_DIRS ++ $ + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core + ) + + if(NOT RYML_DEFAULT_CALLBACKS) + diff --git a/ports/ryml/portfile.cmake b/ports/ryml/portfile.cmake new file mode 100644 index 00000000000000..ed7953f2e50943 --- /dev/null +++ b/ports/ryml/portfile.cmake @@ -0,0 +1,70 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_fail_port_install( + ON_ARCH "arm" "arm64" + ON_TARGET "OSX" +) + +# Get rapidyaml src +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO biojppm/rapidyaml + REF ec23e87007ccc39c6132345c154b267de9381706 + SHA512 7d349c0dd58da814dad02de88a5c54394ef8d77e7db3014fb5fb684d519e35604d45f5d16db5ed6ed8ccb52b1ed4a4dbc91e717a091b54b04dc18901800e12c1 + HEAD_REF master + PATCHES cmake-fix.patch +) + +set(COMMIT_HASH a0f0c17bfc9a9a91cc72891539b513c129c6d122) + +# Get cmake scripts for rapidyaml +vcpkg_download_distfile(CMAKE_ARCHIVE + URLS "https://github.com/biojppm/cmake/archive/${COMMIT_HASH}.zip" + FILENAME "cmake-${COMMIT_HASH}.zip" + SHA512 4fbc711f3120501fa40733c3b66e34cd6a7e1b598b1378fbb59d1a87c88290a03d021f5176634089da41682fd918d7e27c6c146052dec54d7e956be15f12744f +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH_CMAKE + ARCHIVE ${CMAKE_ARCHIVE} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/deps" +) + +file(REMOVE_RECURSE "${SOURCE_PATH}/ext/c4core/cmake") +file(RENAME ${SOURCE_PATH_CMAKE} "${SOURCE_PATH}/ext/c4core/cmake") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/ryml) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ryml) +endif() + +# Move headers and natvis to own dir +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include/ryml") +file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml.hpp" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml.hpp") +file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml_std.hpp" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml_std.hpp") +file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml.natvis" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml.natvis") + +# Fix paths in headers file +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ryml/ryml.hpp" "./c4" "../c4") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ryml/ryml_std.hpp" "./c4" "../c4") + +# Fix paths in config file +file(READ "${CURRENT_PACKAGES_DIR}/share/ryml/rymlConfig.cmake" _contents) +string(REGEX REPLACE [[[ \t\r\n]*"\${PACKAGE_PREFIX_DIR}[\./\\]*"]] [["${PACKAGE_PREFIX_DIR}/../.."]] _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/share/ryml/rymlConfig.cmake" "${_contents}") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL + "${SOURCE_PATH}/LICENSE.txt" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/ryml" RENAME copyright) diff --git a/ports/ryu/CONTROL b/ports/ryu/CONTROL index c78ca9b389f361..916d6e839bdcae 100644 --- a/ports/ryu/CONTROL +++ b/ports/ryu/CONTROL @@ -1,5 +1,5 @@ Source: ryu -Version: 2.0-1 +Version: 2.0-2 Homepage: https://github.com/ulfjack/ryu Description: Ryu generates the shortest decimal representation of a floating point number that maintains round-trip safety. Supports: !(uwp|arm|x86) diff --git a/ports/ryu/portfile.cmake b/ports/ryu/portfile.cmake index 40bb6794142d36..f26b01b98c08eb 100644 --- a/ports/ryu/portfile.cmake +++ b/ports/ryu/portfile.cmake @@ -33,6 +33,6 @@ else() endif() file(INSTALL ${SOURCE_PATH}/LICENSE-Boost DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(INSTALL ${SOURCE_PATH}/ryu/ryu.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/) +file(INSTALL ${SOURCE_PATH}/ryu/ryu.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/ryu/) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/ryuConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/safeint/CONTROL b/ports/safeint/CONTROL index ca9c476df14741..a15905afabecc1 100644 --- a/ports/safeint/CONTROL +++ b/ports/safeint/CONTROL @@ -1,3 +1,4 @@ Source: safeint -Version: 3.23 +Version: 3.24 +Homepage: https://github.com/dcleblanc/SafeInt Description: SafeInt is a class library for C++ that manages integer overflows diff --git a/ports/safeint/portfile.cmake b/ports/safeint/portfile.cmake index b137d768504144..6db0fdf0907569 100644 --- a/ports/safeint/portfile.cmake +++ b/ports/safeint/portfile.cmake @@ -1,13 +1,11 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO dcleblanc/SafeInt - REF 4fe8294d73b7b442413ce85f3fe4e69ef6a9e6e2 # 3.23 - SHA512 9f50bb92b9c4733739889b16065bcaadaec72526ed645daefde730503b21c939f521c6f7d6c77529b2129915ea49099f21cd84a9f3857a01a0a5252af2b5f687 + REF 34a1b2191deb89eca9db4e5e1cfe5e72e70eb472 # 3.24 + SHA512 c76a973a9f0fc7d464f63ca8e5946f357832cd9688894b8f93573da75b238b08fff06ecbac44a3dbf4f2c7c472b038b44b774823a6ec3359c06becd645c924a7 HEAD_REF master ) file(INSTALL ${SOURCE_PATH}/SafeInt.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/safeint RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sciter/CONTROL b/ports/sciter/CONTROL index 073bebce2dfa90..5b0b7439daaf54 100644 --- a/ports/sciter/CONTROL +++ b/ports/sciter/CONTROL @@ -1,5 +1,8 @@ Source: sciter -Version: 4.4.1.5 +Version: 4.4.3.20 Homepage: https://github.com/c-smile/sciter-sdk Description: Sciter is an embeddable HTML/CSS/scripting engine. Supports: !uwp + +Feature: windowless +Description: Uses Sciter.Lite builds diff --git a/ports/sciter/portfile.cmake b/ports/sciter/portfile.cmake index c70468ea7cd0d7..4c9d7f6d309095 100644 --- a/ports/sciter/portfile.cmake +++ b/ports/sciter/portfile.cmake @@ -9,8 +9,8 @@ endif() # header-only library set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) -set(SCITER_REVISION e0f293ebfb59b9fbef058626bcaeafc38dad5fb8) -set(SCITER_SHA 30b163c478db0c749464de1f18ce249f90018490c737c3d740cebeab0963f5f76d04b907d6cd93952953a7a0ee139fc1ecfa28f6100ada210a6a9ff0e4ff12d5) +set(SCITER_REVISION 63c9328e88c1877deea721cbe060b19c4fce7cb6) +set(SCITER_SHA 151ae3f74980e76fa04e0d5ef54ed56efcee312b4654c906a04b017384073ddf9ae353c29d9f0a12f681fd83d42e57b9ed3b563c641979406ddad0b3cc26d49c) if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) set(SCITER_ARCH x64) @@ -42,8 +42,7 @@ set(TOOL_PERMS FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ # license file(COPY ${SOURCE_PATH}/logfile.htm DESTINATION ${SCITER_SHARE}) -file(COPY ${SOURCE_PATH}/license.htm DESTINATION ${SCITER_SHARE}) -file(RENAME ${SCITER_SHARE}/license.htm ${SCITER_SHARE}/copyright) +file(INSTALL ${SOURCE_PATH}/license.htm DESTINATION ${SCITER_SHARE} RENAME copyright) # samples & widgets file(COPY ${SOURCE_PATH}/samples DESTINATION ${SCITER_SHARE}) @@ -60,6 +59,10 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Linux AND VCPKG_TARGET_ARCHITECTURE STREQUAL file(INSTALL ${SCITER_BIN}/inspector DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS}) file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${SCITER_TOOLS}) + if ("windowless" IN_LIST FEATURES) + set(SCITER_BIN ${SOURCE_PATH}/bin.lnx/x64lite) + endif() + file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -93,10 +96,12 @@ else() file(INSTALL ${SCITER_BIN32}/inspector.exe DESTINATION ${SCITER_TOOLS}) file(INSTALL ${SCITER_BIN32}/sciter.dll DESTINATION ${SCITER_TOOLS}) + if ("windowless" IN_LIST FEATURES) + set(SCITER_BIN ${SOURCE_PATH}/bin.win/${SCITER_ARCH}lite) + endif() + file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${SCITER_BIN}/tiscript-sqlite.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL ${SCITER_BIN}/tiscript-sqlite.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) endif() message(STATUS "Warning: Sciter requires manual deployment of the correct DLL files.") diff --git a/ports/scnlib/CONTROL b/ports/scnlib/CONTROL index 5b589084a03b05..cccdd55c2d784a 100644 --- a/ports/scnlib/CONTROL +++ b/ports/scnlib/CONTROL @@ -1,4 +1,4 @@ Source: scnlib -Version: 0.1.2 +Version: 0.3 Description: scnlib is a modern C++ library for replacing scanf and std::istream Homepage: https://scnlib.dev/ diff --git a/ports/scnlib/portfile.cmake b/ports/scnlib/portfile.cmake index 08343fc43bd576..ae7777aa1e60d4 100644 --- a/ports/scnlib/portfile.cmake +++ b/ports/scnlib/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eliaskosunen/scnlib - REF v0.1.2 - SHA512 bb2aa176517d6547d62800839b7e9d86821a4006f7d09a8b3731b67f6fd7130f5cf8d73e7c8331c7c50f1dd5ca19bd3759bb0e181fcaed2f0bfb7fd8276ef141 + REF v0.3 + SHA512 91ab0ff5d7d2e4a4924bfa00cafc49c3b0d88b87f4adbdce786be0f51913e3c61c6948c27da6af1e020646e610540dc63323fbf7b59f9210266f1ba79bf95adc HEAD_REF master ) @@ -24,8 +22,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/scn) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/scn) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/scnlib RENAME copyright) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/share/scn) +file(INSTALL ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) vcpkg_test_cmake(PACKAGE_NAME scn) diff --git a/ports/sdformat6/CONTROL b/ports/sdformat6/CONTROL index 5733c129d2d9af..8f1e5ed585007d 100644 --- a/ports/sdformat6/CONTROL +++ b/ports/sdformat6/CONTROL @@ -1,5 +1,6 @@ Source: sdformat6 -Version: 6.2.0 +Version: 6.2.0-1 Homepage: http://sdformat.org/ Build-Depends: boost-any, boost-variant, ignition-math4, urdfdom, tinyxml Description: Simulation Description Format (SDF) parser and description files. +Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/sdformat6/portfile.cmake b/ports/sdformat6/portfile.cmake index 39e4e5bb0cac6d..e5e1c04f6e3f36 100644 --- a/ports/sdformat6/portfile.cmake +++ b/ports/sdformat6/portfile.cmake @@ -1,10 +1,10 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") -vcpkg_from_bitbucket( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO osrf/sdformat REF sdformat6_6.2.0 - SHA512 3e3934010438bffbf10c1df29bd486c098e3c1bdf2b0349b69a53fb6f4d2bd3b3c8c4b4a8dfb413da13a638c0794f41c1bff4adb11a889b1552d90ba8b94c495 + SHA512 3d139ec4b4c9fbfd547ed8bfca0adb5cdca92c1b7cc4d4b554a7c51ccf755b9079c26a006ebfedc5bc5b1ba5e16ad950bb38c47ea97bf97e59a2fd7d12d60620 HEAD_REF sdf6 ) @@ -49,7 +49,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdformat6 RENAME copyright) - -# Post-build test for cmake libraries -vcpkg_test_cmake(PACKAGE_NAME SDFormat) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sdformat9/CONTROL b/ports/sdformat9/CONTROL new file mode 100644 index 00000000000000..d9fba0d8f44a03 --- /dev/null +++ b/ports/sdformat9/CONTROL @@ -0,0 +1,6 @@ +Source: sdformat9 +Version: 9.2.0-1 +Homepage: http://sdformat.org/ +Build-Depends: ignition-math6, urdfdom, tinyxml +Description: Simulation Description Format (SDF) parser and description files. +Supports: !(linux|uwp) \ No newline at end of file diff --git a/ports/sdformat9/fix-dependency-urdfdom.patch b/ports/sdformat9/fix-dependency-urdfdom.patch new file mode 100644 index 00000000000000..d2b1a5947508ac --- /dev/null +++ b/ports/sdformat9/fix-dependency-urdfdom.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake +index 965f1ec..cf2acf4 100644 +--- a/cmake/SearchForStuff.cmake ++++ b/cmake/SearchForStuff.cmake +@@ -53,10 +53,9 @@ if (NOT PKG_CONFIG_FOUND) + endif() + + if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) +- # check for urdfdom with pkg-config +- pkg_check_modules(URDF urdfdom>=1.0) ++ find_package(urdfdom CONFIG REQUIRED) + +- if (NOT URDF_FOUND) ++ if (NOT urdfdom_FOUND) + if (NOT DEFINED USE_INTERNAL_URDF) + message(STATUS "Couldn't find urdfdom >= 1.0, using internal copy") + set(USE_INTERNAL_URDF true) diff --git a/ports/sdformat9/portfile.cmake b/ports/sdformat9/portfile.cmake new file mode 100644 index 00000000000000..c1567efbcf1661 --- /dev/null +++ b/ports/sdformat9/portfile.cmake @@ -0,0 +1,44 @@ +vcpkg_fail_port_install(ON_TARGET "linux" "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO osrf/sdformat + REF sdformat9_9.2.0 + SHA512 6fc7d0ce46d9a7d1cae4fd905ebe6a07bb4ba98faa267be92a32b3409d6d82a99d5082485008a15484f7b5be2c347b5b24bc472fb1a4be5eb8b678b105cae6af + HEAD_REF sdf9 + PATCHES + respect-build-testing.patch # Backport of https://github.com/osrf/sdformat/pull/269 + fix-dependency-urdfdom.patch +) + +# Ruby is required by the sdformat build process +vcpkg_find_acquire_program(RUBY) +get_filename_component(RUBY_PATH ${RUBY} DIRECTORY) +set(_path $ENV{PATH}) +vcpkg_add_to_path(${RUBY_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + -DUSE_EXTERNAL_URDF=ON + -DUSE_EXTERNAL_TINYXML=ON +) + +vcpkg_install_cmake() + +# Restore original path +set(ENV{PATH} ${_path}) + +# Fix cmake targets and pkg-config file location +vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/sdformat9") +vcpkg_fixup_pkgconfig() + +# Remove debug files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sdformat9/respect-build-testing.patch b/ports/sdformat9/respect-build-testing.patch new file mode 100644 index 00000000000000..8509b91ea7641c --- /dev/null +++ b/ports/sdformat9/respect-build-testing.patch @@ -0,0 +1,182 @@ +From f31b1d65e0cc550d37ff9f67a01af055534282d0 Mon Sep 17 00:00:00 2001 +From: Silvio +Date: Sat, 2 May 2020 12:39:02 +0200 +Subject: [PATCH] If defined observe the CMake variable BUILD_TESTING + +For backward compatibility if it is not defined compile the tests + +Signed-off-by: Silvio +--- + CMakeLists.txt | 10 +++- + src/CMakeLists.txt | 136 +++++++++++++++++++++++---------------------- + 2 files changed, 78 insertions(+), 68 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c0b934f9..38a71649 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -265,7 +265,15 @@ else (build_errors) + + link_directories(${PROJECT_BINARY_DIR}/src) + +- add_subdirectory(test) ++ if (NOT DEFINED BUILD_TESTING OR BUILD_TESTING) ++ set(BUILD_SDF_TEST TRUE) ++ else() ++ set(BUILD_SDF_TEST FALSE) ++ endif() ++ ++ if (BUILD_SDF_TEST) ++ add_subdirectory(test) ++ endif() + add_subdirectory(src) + add_subdirectory(include/sdf) + add_subdirectory(sdf) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7dbb9536..c283a00a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -91,74 +91,76 @@ else() + include_directories(${URDF_INCLUDE_DIRS}) + endif() + +-set (gtest_sources +- Actor_TEST.cc +- AirPressure_TEST.cc +- Altimeter_TEST.cc +- Atmosphere_TEST.cc +- Box_TEST.cc +- Camera_TEST.cc +- Collision_TEST.cc +- Console_TEST.cc +- Cylinder_TEST.cc +- Element_TEST.cc +- Error_TEST.cc +- Exception_TEST.cc +- Frame_TEST.cc +- Filesystem_TEST.cc +- Geometry_TEST.cc +- Gui_TEST.cc +- Imu_TEST.cc +- Joint_TEST.cc +- JointAxis_TEST.cc +- Lidar_TEST.cc +- Light_TEST.cc +- Link_TEST.cc +- Magnetometer_TEST.cc +- Material_TEST.cc +- Mesh_TEST.cc +- Model_TEST.cc +- Noise_TEST.cc +- parser_urdf_TEST.cc +- Param_TEST.cc +- parser_TEST.cc +- Pbr_TEST.cc +- Physics_TEST.cc +- Plane_TEST.cc +- Root_TEST.cc +- Scene_TEST.cc +- SemanticPose_TEST.cc +- SDF_TEST.cc +- Sensor_TEST.cc +- Sphere_TEST.cc +- Surface_TEST.cc +- Types_TEST.cc +- Visual_TEST.cc +- World_TEST.cc +-) +- +-# Build this test file only if Ignition Tools is installed. +-if (IGNITION-TOOLS_BINARY_DIRS) +- set (gtest_sources ${gtest_sources} +- ign_TEST.cc ++if (BUILD_SDF_TEST) ++ set (gtest_sources ++ Actor_TEST.cc ++ AirPressure_TEST.cc ++ Altimeter_TEST.cc ++ Atmosphere_TEST.cc ++ Box_TEST.cc ++ Camera_TEST.cc ++ Collision_TEST.cc ++ Console_TEST.cc ++ Cylinder_TEST.cc ++ Element_TEST.cc ++ Error_TEST.cc ++ Exception_TEST.cc ++ Frame_TEST.cc ++ Filesystem_TEST.cc ++ Geometry_TEST.cc ++ Gui_TEST.cc ++ Imu_TEST.cc ++ Joint_TEST.cc ++ JointAxis_TEST.cc ++ Lidar_TEST.cc ++ Light_TEST.cc ++ Link_TEST.cc ++ Magnetometer_TEST.cc ++ Material_TEST.cc ++ Mesh_TEST.cc ++ Model_TEST.cc ++ Noise_TEST.cc ++ parser_urdf_TEST.cc ++ Param_TEST.cc ++ parser_TEST.cc ++ Pbr_TEST.cc ++ Physics_TEST.cc ++ Plane_TEST.cc ++ Root_TEST.cc ++ Scene_TEST.cc ++ SemanticPose_TEST.cc ++ SDF_TEST.cc ++ Sensor_TEST.cc ++ Sphere_TEST.cc ++ Surface_TEST.cc ++ Types_TEST.cc ++ Visual_TEST.cc ++ World_TEST.cc + ) +-endif() +- +-sdf_build_tests(${gtest_sources}) +- +-if (NOT WIN32) +- set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) +- sdf_build_tests(Utils_TEST.cc) +-endif() +- +-if (NOT WIN32) +- set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS FrameSemantics.cc) +- sdf_build_tests(FrameSemantics_TEST.cc) +-endif() +- +-if (NOT WIN32) +- set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Converter.cc) +- sdf_build_tests(Converter_TEST.cc) ++ ++ # Build this test file only if Ignition Tools is installed. ++ if (IGNITION-TOOLS_BINARY_DIRS) ++ set (gtest_sources ${gtest_sources} ++ ign_TEST.cc ++ ) ++ endif() ++ ++ sdf_build_tests(${gtest_sources}) ++ ++ if (NOT WIN32) ++ set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) ++ sdf_build_tests(Utils_TEST.cc) ++ endif() ++ ++ if (NOT WIN32) ++ set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS FrameSemantics.cc) ++ sdf_build_tests(FrameSemantics_TEST.cc) ++ endif() ++ ++ if (NOT WIN32) ++ set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Converter.cc) ++ sdf_build_tests(Converter_TEST.cc) ++ endif() + endif() + + sdf_add_library(${sdf_target} ${sources}) diff --git a/ports/sdl1/CONTROL b/ports/sdl1/CONTROL index a313ab982fd3b0..87bb7b2afb825f 100644 --- a/ports/sdl1/CONTROL +++ b/ports/sdl1/CONTROL @@ -1,4 +1,5 @@ Source: sdl1 -Version: 1.2.15-10 +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 999b616e69edce..6dd7da6876d573 100644 --- a/ports/sdl1/portfile.cmake +++ b/ports/sdl1/portfile.cmake @@ -52,28 +52,15 @@ if (VCPKG_TARGET_IS_WINDOWS) endif() else() message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".") - - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(BUILD_SHARED yes) - set(BUILD_STATIC no) - else() - set(BUILD_SHARED no) - set(BUILD_STATIC yes) - endif() - file(REMOVE_RECURSE ${SOURCE_PATH}/m4) - file(MAKE_DIRECTORY ${SOURCE_PATH}/m4) - vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - NO_DEBUG - PRERUN_SHELL autogen.sh - OPTIONS - --enable-shared=${BUILD_SHARED} - --enable-static=${BUILD_STATIC} ) vcpkg_install_make() + 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}) @@ -83,4 +70,5 @@ else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() \ No newline at end of file diff --git a/ports/sdl2-gfx/CMakeLists.txt b/ports/sdl2-gfx/CMakeLists.txt index cceab96cf3ab69..9c94b9b220ac8d 100644 --- a/ports/sdl2-gfx/CMakeLists.txt +++ b/ports/sdl2-gfx/CMakeLists.txt @@ -24,7 +24,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC $ ) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${SDL_GFX_DEFINES}) +if(WIN32) + add_compile_definitions(${SDL_GFX_DEFINES}) +endif() target_include_directories(${PROJECT_NAME} PRIVATE ${SDL_INCLUDE_DIR}/SDL2) target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2) diff --git a/ports/sdl2-gfx/CONTROL b/ports/sdl2-gfx/CONTROL index bd6b4f6b2ad532..9a69a45580249a 100644 --- a/ports/sdl2-gfx/CONTROL +++ b/ports/sdl2-gfx/CONTROL @@ -1,4 +1,4 @@ Source: sdl2-gfx -Version: 1.0.4-5 +Version: 1.0.4-6 Build-Depends: sdl2 -Description: Graphics primitives (line, circle, rectangle etc.) with AA support, rotozoomer and other drawing related support functions wrapped up in a C based add-on library for the Simple Direct Media (SDL) cross-platform API layer. +Description: Graphics primitives (line, circle, rectangle etc.) with AA support, rotozoomer and other drawing related support functions wrapped up in a C based add-on library for the Simple Direct Media (SDL) cross-platform API layer. \ No newline at end of file diff --git a/ports/sdl2-gfx/portfile.cmake b/ports/sdl2-gfx/portfile.cmake index 802b1a2c5e610a..383192053b6770 100644 --- a/ports/sdl2-gfx/portfile.cmake +++ b/ports/sdl2-gfx/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(VERSION 1.0.4) vcpkg_download_distfile(ARCHIVE @@ -28,7 +26,6 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx/COPYING ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() \ No newline at end of file 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/CONTROL b/ports/sdl2/CONTROL index 771584a8f8406c..f9bdadb699e4d8 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,6 +1,6 @@ Source: sdl2 -Version: 2.0.10-3 -Homepage: https://github.com/SDL-Mirror/SDL +Version: 2.0.12-1 +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. Feature: vulkan diff --git a/ports/sdl2/SDL-2.0.9-bug-4391-fix.patch b/ports/sdl2/SDL-2.0.9-bug-4391-fix.patch deleted file mode 100644 index f8fc64bda6ac01..00000000000000 --- a/ports/sdl2/SDL-2.0.9-bug-4391-fix.patch +++ /dev/null @@ -1,75 +0,0 @@ -# HG changeset patch -# User Sam Lantinga -# Date 1542691020 28800 -# Node ID 9091b20040cf04cdc348d290ca22373b36364c39 -# Parent 144400e4630d885d2eb0761b7174433b4c0d90bb -Fixed bug 4391 - hid_enumerate() sometimes causes game to freeze for a few seconds - -Daniel Gibson - -Even though my game (dhewm3) doesn't use SDL_INIT_JOYSTICK, SDL_PumpEvent() calls SDL_JoystickUpdate() which ends up calling hid_enumerate() every three seconds, and sometimes on my Win7 box hid_enumerate() takes about 5 seconds, which causes the whole game to freeze for that time. - -diff -r 144400e4630d -r 9091b20040cf include/SDL_bits.h ---- a/include/SDL_bits.h Sun Nov 18 19:28:20 2018 +0300 -+++ b/include/SDL_bits.h Mon Nov 19 21:17:00 2018 -0800 -@@ -101,6 +101,15 @@ - #endif - } - -+SDL_FORCE_INLINE SDL_bool -+SDL_HasExactlyOneBitSet32(Uint32 x) -+{ -+ if (x && !(x & (x - 1))) { -+ return SDL_TRUE; -+ } -+ return SDL_FALSE; -+} -+ - /* Ends C function definitions when using C++ */ - #ifdef __cplusplus - } -diff -r 144400e4630d -r 9091b20040cf src/SDL.c ---- a/src/SDL.c Sun Nov 18 19:28:20 2018 +0300 -+++ b/src/SDL.c Mon Nov 19 21:17:00 2018 -0800 -@@ -348,6 +348,12 @@ - int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount); - Uint32 initialized = 0; - -+ /* Fast path for checking one flag */ -+ if (SDL_HasExactlyOneBitSet32(flags)) { -+ int subsystem_index = SDL_MostSignificantBitIndex32(flags); -+ return SDL_SubsystemRefCount[subsystem_index] ? flags : 0; -+ } -+ - if (!flags) { - flags = SDL_INIT_EVERYTHING; - } -diff -r 144400e4630d -r 9091b20040cf src/joystick/SDL_joystick.c ---- a/src/joystick/SDL_joystick.c Sun Nov 18 19:28:20 2018 +0300 -+++ b/src/joystick/SDL_joystick.c Mon Nov 19 21:17:00 2018 -0800 -@@ -1016,6 +1016,10 @@ - int i; - SDL_Joystick *joystick; - -+ if (!SDL_WasInit(SDL_INIT_JOYSTICK)) { -+ return; -+ } -+ - SDL_LockJoysticks(); - - if (SDL_updating_joystick) { -diff -r 144400e4630d -r 9091b20040cf src/sensor/SDL_sensor.c ---- a/src/sensor/SDL_sensor.c Sun Nov 18 19:28:20 2018 +0300 -+++ b/src/sensor/SDL_sensor.c Mon Nov 19 21:17:00 2018 -0800 -@@ -505,6 +505,10 @@ - int i; - SDL_Sensor *sensor; - -+ if (!SDL_WasInit(SDL_INIT_SENSOR)) { -+ return; -+ } -+ - SDL_LockSensors(); - - if (SDL_updating_sensor) { - diff --git a/ports/sdl2/disable-hidapi-for-uwp.patch b/ports/sdl2/disable-hidapi-for-uwp.patch index 13d1ca8d1fcce6..9a1b500b47be56 100644 --- a/ports/sdl2/disable-hidapi-for-uwp.patch +++ b/ports/sdl2/disable-hidapi-for-uwp.patch @@ -1,11 +1,11 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -172,7 +172,7 @@ - # requires root permissions to open devices, so that's not generally - # useful, and we'll disable this by default on Unix. Windows and macOS - # can use it without root access, though, so enable by default there. --if(WINDOWS OR APPLE OR ANDROID) -+if((WINDOWS AND NOT WINDOWS_STORE) OR APPLE OR ANDROID) +@@ -173,7 +173,7 @@ + # so we'll just use libusb when it's available. libusb does not support iOS, + # so we default to yes on iOS. + # TODO: Windows can support libusb, the hid.c file just depends on Unix APIs +-if(WINDOWS OR IOS OR TVOS OR ANDROID) ++if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR ANDROID) set(HIDAPI_SKIP_LIBUSB TRUE) else() set(HIDAPI_SKIP_LIBUSB FALSE) diff --git a/ports/sdl2/disable-wcslcpy-and-wcslcat-for-windows.patch b/ports/sdl2/disable-wcslcpy-and-wcslcat-for-windows.patch new file mode 100644 index 00000000000000..894b24d0d942e9 --- /dev/null +++ b/ports/sdl2/disable-wcslcpy-and-wcslcat-for-windows.patch @@ -0,0 +1,12 @@ +diff -ur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -772,7 +772,7 @@ + set(HAVE_SIGNAL_H 1) + foreach(_FN + malloc calloc realloc free qsort abs memset memcpy memmove memcmp +- wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp ++ wcslen wcsdup wcsstr wcscmp wcsncmp + strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa + _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp + _stricmp _strnicmp strtok_s sscanf diff --git a/ports/sdl2/enable-winrt-cmake.patch b/ports/sdl2/enable-winrt-cmake.patch index 03deb415c39c93..0e570847b1a868 100644 --- a/ports/sdl2/enable-winrt-cmake.patch +++ b/ports/sdl2/enable-winrt-cmake.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0128c7a..bd534e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -5,6 +5,18 @@ endif() +@@ -5,6 +5,18 @@ cmake_minimum_required(VERSION 2.8.11) project(SDL2 C CXX) @@ -21,7 +21,7 @@ index 0128c7a..bd534e4 100644 # !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property # !!! FIXME: for the SDL2 shared library (so you get an # !!! FIXME: install_name ("soname") of "@rpath/libSDL-whatever.dylib" -@@ -1209,6 +1221,11 @@ elseif(WINDOWS) +@@ -1297,6 +1309,11 @@ file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) @@ -33,7 +33,7 @@ index 0128c7a..bd534e4 100644 if(MSVC) # Prevent codegen that would use the VC runtime libraries. set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-") -@@ -1254,6 +1271,9 @@ elseif(WINDOWS) +@@ -1342,6 +1359,9 @@ check_include_file(ddraw.h HAVE_DDRAW_H) check_include_file(dsound.h HAVE_DSOUND_H) check_include_file(dinput.h HAVE_DINPUT_H) @@ -43,8 +43,8 @@ index 0128c7a..bd534e4 100644 check_include_file(dxgi.h HAVE_DXGI_H) if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H) set(HAVE_DIRECTX TRUE) -@@ -1272,18 +1292,20 @@ elseif(WINDOWS) - check_include_file(endpointvolume.h HAVE_ENDPOINTVOLUME_H) +@@ -1359,18 +1379,20 @@ + check_include_file(audioclient.h HAVE_AUDIOCLIENT_H) if(SDL_AUDIO) + if(NOT WINDOWS_STORE) @@ -66,7 +66,7 @@ index 0128c7a..bd534e4 100644 set(SDL_AUDIO_DRIVER_WASAPI 1) file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES}) -@@ -1295,11 +1317,20 @@ elseif(WINDOWS) +@@ -1382,11 +1404,20 @@ if(NOT SDL_LOADSO) message_error("SDL_VIDEO requires SDL_LOADSO, which is not enabled") endif() @@ -88,7 +88,7 @@ index 0128c7a..bd534e4 100644 set(SDL_VIDEO_RENDER_D3D 1) set(HAVE_RENDER_D3D TRUE) endif() -@@ -1322,20 +1353,31 @@ elseif(WINDOWS) +@@ -1409,20 +1440,31 @@ endif() if(SDL_POWER) @@ -120,7 +120,7 @@ index 0128c7a..bd534e4 100644 # TODO: in configure.ac the check for timers is set on # cygwin | mingw32* - does this include mingw32CE? -@@ -1357,7 +1399,7 @@ elseif(WINDOWS) +@@ -1444,7 +1486,7 @@ set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) if(SDL_VIDEO) @@ -129,7 +129,7 @@ index 0128c7a..bd534e4 100644 set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL_WGL 1) set(SDL_VIDEO_RENDER_OGL 1) -@@ -1788,12 +1830,14 @@ endif() +@@ -2027,12 +2069,14 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") # Always build SDLmain @@ -138,36 +138,36 @@ index 0128c7a..bd534e4 100644 target_include_directories(SDL2main PUBLIC "$" $ $) set(_INSTALL_LIBS "SDL2main") if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) + set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() +endif() - if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) + if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 48dd2d4..0c4fa28 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake -@@ -326,6 +326,7 @@ - #cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ +@@ -335,6 +326,7 @@ #cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ + #cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@ #cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ +#cmakedefine SDL_VIDEO_DRIVER_WINRT @SDL_VIDEO_DRIVER_WINRT@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@ #cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ -@@ -391,6 +392,7 @@ +@@ -403,6 +404,7 @@ #cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ #cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ #cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ +#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@ #cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ + #cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@ #cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ - #cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ -@@ -413,7 +415,7 @@ - #cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@ +@@ -428,7 +430,7 @@ + #cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@ + #cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@ - /* Platform specific definitions */ -#if !defined(__WIN32__) +#if !defined(__WIN32__) && !defined(__WINRT__) # if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) diff --git a/ports/sdl2/fix-EventToken-header-reference.patch b/ports/sdl2/fix-EventToken-header-reference.patch new file mode 100644 index 00000000000000..5e34dc2f2e8b4e --- /dev/null +++ b/ports/sdl2/fix-EventToken-header-reference.patch @@ -0,0 +1,17 @@ + +diff -r 398b67c0a7d3 -r 7c2f418f701b src/video/winrt/SDL_winrtgamebar.cpp +--- a/src/video/winrt/SDL_winrtgamebar.cpp Wed Jun 10 09:36:10 2020 -0700 ++++ b/src/video/winrt/SDL_winrtgamebar.cpp Wed Jun 10 09:38:43 2020 -0700 +@@ -25,7 +25,7 @@ + /* Windows includes */ + #include + #include +-#include ++#include + + + /* SDL includes */ + + + + diff --git a/ports/sdl2/fix-arm64-headers.patch b/ports/sdl2/fix-arm64-headers.patch deleted file mode 100644 index 862b65f0b50dcd..00000000000000 --- a/ports/sdl2/fix-arm64-headers.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/SDL_cpuinfo.h Tue Jul 23 21:41:00 2019 -0400 -+++ b/include/SDL_cpuinfo.h Tue Aug 13 20:26:27 2019 -0700 -@@ -73,8 +73,8 @@ - # define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ - # endif - # if defined (_M_ARM64) --# include --# include -+# include -+# include - # define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ - # endif - # endif - \ No newline at end of file diff --git a/ports/sdl2/fix-cmake-include-dir.patch b/ports/sdl2/fix-cmake-include-dir.patch deleted file mode 100644 index 11f70acc8c8b07..00000000000000 --- a/ports/sdl2/fix-cmake-include-dir.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd59d89b2..85ebe5f7b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1789,7 +1789,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - - # Always build SDLmain - add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) --target_include_directories(SDL2main PUBLIC "$" $) -+target_include_directories(SDL2main PUBLIC "$" $ $) - set(_INSTALL_LIBS "SDL2main") - if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) -@@ -1820,7 +1820,7 @@ if(SDL_SHARED) - endif() - set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) - target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) -- target_include_directories(SDL2 PUBLIC "$" $) -+ target_include_directories(SDL2 PUBLIC "$" $ $) - if (NOT ANDROID) - set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) - endif() -@@ -1860,7 +1860,7 @@ if(SDL_STATIC) - # libraries - do we need to consider this? - set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS}) - target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) -- target_include_directories(SDL2-static PUBLIC "$" $) -+ target_include_directories(SDL2-static PUBLIC "$" $ $) - if (NOT ANDROID) - set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) - endif() diff --git a/ports/sdl2/fix-space-in-path.patch b/ports/sdl2/fix-space-in-path.patch index ed7a1e7125ea5f..499161d9a48f15 100644 --- a/ports/sdl2/fix-space-in-path.patch +++ b/ports/sdl2/fix-space-in-path.patch @@ -1,7 +1,7 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2019-07-23 21:41:00.000000000 +0200 +++ b/CMakeLists.txt 2019-10-27 20:26:38.000000000 +0100 -@@ -257,7 +257,7 @@ +@@ -278,7 +278,7 @@ # General includes include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include) if(USE_GCC OR USE_CLANG) @@ -13,12 +13,12 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt diff -ur a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake --- a/cmake/sdlchecks.cmake 2019-07-23 21:41:00.000000000 +0200 +++ b/cmake/sdlchecks.cmake 2019-10-27 20:27:10.000000000 +0100 -@@ -1086,7 +1086,7 @@ +@@ -1088,7 +1088,7 @@ set(HAVE_SDL_JOYSTICK TRUE) file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} \"-I${SDL2_SOURCE_DIR}/src/hidapi/hidapi\"") if(NOT HIDAPI_SKIP_LIBUSB) - set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c) - list(APPEND EXTRA_LIBS ${LIBUSB_LIBS}) + if(HIDAPI_ONLY_LIBUSB) + set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c) diff --git a/ports/sdl2/fix-x86-windows.patch b/ports/sdl2/fix-x86-windows.patch deleted file mode 100644 index 853b68722cd884..00000000000000 --- a/ports/sdl2/fix-x86-windows.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c -index ff23c5e..fc90bba 100644 ---- a/src/events/SDL_mouse.c -+++ b/src/events/SDL_mouse.c -@@ -20,6 +20,10 @@ - */ - #include "../SDL_internal.h" - -+#ifdef __WIN32__ -+#include "../core/windows/SDL_windows.h" -+#endif -+ - /* General mouse handling code for SDL */ - - #include "SDL_assert.h" diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 8c0a25c0102757..366ad1e3ad8a04 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,16 +1,20 @@ -vcpkg_from_github( +set(SDL2_VERSION 2.0.12) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.libsdl.org/release/SDL2-2.0.12.tar.gz" + FILENAME "SDL2-${SDL2_VERSION}.tar.gz" + SHA512 3f1f04af0f3d9dda9c84a2e9274ae8d83ea0da3fc367970a820036cc4dc1dbf990cfc37e4975ae05f0b45a4ffa739c6c19e470c00bf3f2bce9b8b63717b8b317 +) + +vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH - REPO SDL-Mirror/SDL - REF release-2.0.10 - SHA512 c5fe59eed7ba9c6a82cceaf513623480793727fceec84b01d819e7cbefc8229a84be93067d7539f12d5811c49d3d54fd407272786aef3e419f439d0105c34b21 - HEAD_REF master + ARCHIVE ${ARCHIVE} PATCHES export-symbols-only-in-shared-build.patch - fix-cmake-include-dir.patch enable-winrt-cmake.patch - fix-arm64-headers.patch disable-hidapi-for-uwp.patch fix-space-in-path.patch + disable-wcslcpy-and-wcslcat-for-windows.patch + fix-EventToken-header-reference.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) diff --git a/ports/seal/CONTROL b/ports/seal/CONTROL index 743ebd30a920a8..d3712e40138762 100644 --- a/ports/seal/CONTROL +++ b/ports/seal/CONTROL @@ -1,4 +1,9 @@ Source: seal -Version: 3.4.5 +Version: 3.4.5-1 Homepage: https://github.com/microsoft/SEAL Description: Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library. +Default-Features: zlib + +Feature: zlib +Build-Depends: zlib +Description: Use zlib for compressed serialization \ No newline at end of file diff --git a/ports/seal/portfile.cmake b/ports/seal/portfile.cmake index 8e1ac060464e76..01019b8479bdb5 100644 --- a/ports/seal/portfile.cmake +++ b/ports/seal/portfile.cmake @@ -25,12 +25,17 @@ vcpkg_from_github( HEAD_REF master ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + zlib SEAL_USE_ZLIB +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/native/src PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DALLOW_COMMAND_LINE_BUILD=ON -DSEAL_LIB_BUILD_TYPE=${SEAL_LIB_BUILD_TYPE} + -DSEAL_USE_MSGSL=OFF # issue https://github.com/microsoft/SEAL/issues/159 ) vcpkg_install_cmake() 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/sfml/CONTROL b/ports/sfml/CONTROL index a62fb278ad26a9..836280f8bb795c 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,5 +1,6 @@ Source: sfml -Version: 2.5.1-6 +Version: 2.5.1 +Port-Version: 8 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/export-win-libs.patch b/ports/sfml/export-win-libs.patch deleted file mode 100644 index 210b6e52eaf699..00000000000000 --- a/ports/sfml/export-win-libs.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/SFML/System/CMakeLists.txt b/src/SFML/System/CMakeLists.txt -index d1b712d..5c12801 100644 ---- a/src/SFML/System/CMakeLists.txt -+++ b/src/SFML/System/CMakeLists.txt -@@ -96,7 +96,7 @@ endif() - if(SFML_OS_LINUX) - target_link_libraries(sfml-system PRIVATE rt) - elseif(SFML_OS_WINDOWS) -- target_link_libraries(sfml-system PRIVATE winmm) -+ target_link_libraries(sfml-system PUBLIC winmm) - elseif(SFML_OS_ANDROID) - target_link_libraries(sfml-system PRIVATE android log) - endif() -diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt -index 98ea439..53c1ac7 100644 ---- a/src/SFML/Window/CMakeLists.txt -+++ b/src/SFML/Window/CMakeLists.txt -@@ -276,7 +276,7 @@ if(SFML_OS_LINUX) - sfml_find_package(UDev INCLUDE "UDEV_INCLUDE_DIR" LINK "UDEV_LIBRARIES") - target_link_libraries(sfml-window PRIVATE UDev) - elseif(SFML_OS_WINDOWS) -- target_link_libraries(sfml-window PRIVATE winmm gdi32) -+ target_link_libraries(sfml-window PUBLIC winmm gdi32) - elseif(SFML_OS_FREEBSD) - target_link_libraries(sfml-window PRIVATE usbhid) - elseif(SFML_OS_MACOSX) diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index d6afbe2c3cf645..82f6e11d15b524 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -5,7 +5,7 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH SHA512 7aed2fc29d1da98e6c4d598d5c86cf536cb4eb5c2079cdc23bb8e502288833c052579dadbe0ce13ad6461792d959bf6d9660229f54c54cf90a541c88c6b03d59 PATCHES use-system-freetype.patch - export-win-libs.patch + stb_include.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) 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/shiva-sfml/CONTROL b/ports/shiva-sfml/CONTROL index 0bd2f08c2f224c..af5ad7b7a5dc60 100644 --- a/ports/shiva-sfml/CONTROL +++ b/ports/shiva-sfml/CONTROL @@ -1,4 +1,4 @@ Source: shiva-sfml -Version: 1.0 +Version: 1.0-1 Description: shiva-sfml plugins of shiva C++ engine Build-Depends: sfml (windows), shiva diff --git a/ports/shiva-sfml/portfile.cmake b/ports/shiva-sfml/portfile.cmake index d3b8d7d718c201..ea6969d04f9280 100644 --- a/ports/shiva-sfml/portfile.cmake +++ b/ports/shiva-sfml/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DSHIVA_BUILD_TESTS=OFF -DSHIVA_USE_SFML_AS_RENDERER=ON -DSHIVA_INSTALL_PLUGINS=ON -DSHIVA_BUILD_EXAMPLES=OFF + -DSHIVA_BUILD_TESTS=OFF -DSHIVA_USE_SFML_AS_RENDERER=ON -DSHIVA_INSTALL_PLUGINS=ON -DSHIVA_BUILD_EXAMPLES=OFF ) vcpkg_install_cmake() @@ -67,22 +67,22 @@ file(COPY ${PLUGINS_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/${SUFFIX_BINARY file(COPY ${PLUGINS_DEBUG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/${SUFFIX_BINARY}/shiva/plugins/shiva-sfml/Debug) if (NOT VCPKG_CMAKE_SYSTEM_NAME) - find_file(LUADLL lua.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(FMTDLL fmt.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(FLACDLL FLAC.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(FREETYPEDLL freetype.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(LIBBZ2DLL libbz2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(LIBPNG16DLL libpng16.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(OGGDLL ogg.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(OPENAL32DLL OpenAL32.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(SFMLAUDIO2DLL sfml-audio-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(SFMLGRAPHICS2DLL sfml-graphics-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(SFMLSYSTEM2DLL sfml-system-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(SFMLWINDOW2DLL sfml-window-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(VORBISDLL vorbis.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(VORBISENCDLL vorbisenc.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(VORBISFILEDLL vorbisfile.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) - find_file(ZLIB1DLL zlib1.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/bin) + find_file(LUADLL lua.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(FMTDLL fmt.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(FLACDLL FLAC.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(FREETYPEDLL freetype.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(LIBBZ2DLL libbz2.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(LIBPNG16DLL libpng16.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(OGGDLL ogg.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(OPENAL32DLL OpenAL32.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(SFMLAUDIO2DLL sfml-audio-2.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(SFMLGRAPHICS2DLL sfml-graphics-2.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(SFMLSYSTEM2DLL sfml-system-2.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(SFMLWINDOW2DLL sfml-window-2.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(VORBISDLL vorbis.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(VORBISENCDLL vorbisenc.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(VORBISFILEDLL vorbisfile.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) + find_file(ZLIB1DLL zlib1.dll PATHS ${CURRENT_INSTALLED_DIR}/bin) set(DEPENDANCIES_RELEASE_DLL ${LUADLL} ${FMTDLL} @@ -100,23 +100,23 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME) ${VORBISENCDLL} ${VORBISFILEDLL} ${ZLIB1DLL}) - - find_file(LUADLL_D lua.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(FMTDLL_D fmtd.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(FLACDLL_D FLAC.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(FREETYPEDLL_D freetyped.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(LIBBZ2DLL_D libbz2d.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(LIBPNG16DLL_D libpng16d.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(OGGDLL_D ogg.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(OPENAL32DLL_D OpenAL32.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(SFMLAUDIO2DLL_D sfml-audio-d-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(SFMLGRAPHICS2DLL_D sfml-graphics-d-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(SFMLSYSTEM2DLL_D sfml-system-d-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(SFMLWINDOW2DLL_D sfml-window-d-2.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(VORBISDLL_D vorbis.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(VORBISENCDLL_D vorbisenc.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(VORBISFILEDLL_D vorbisfile.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) - find_file(ZLIB1DLL_D zlibd1.dll PATHS ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/bin) + + find_file(LUADLL_D lua.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(FMTDLL_D fmtd.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(FLACDLL_D FLAC.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(FREETYPEDLL_D freetyped.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(LIBBZ2DLL_D libbz2d.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(LIBPNG16DLL_D libpng16d.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(OGGDLL_D ogg.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(OPENAL32DLL_D OpenAL32.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(SFMLAUDIO2DLL_D sfml-audio-d-2.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(SFMLGRAPHICS2DLL_D sfml-graphics-d-2.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(SFMLSYSTEM2DLL_D sfml-system-d-2.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(SFMLWINDOW2DLL_D sfml-window-d-2.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(VORBISDLL_D vorbis.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(VORBISENCDLL_D vorbisenc.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(VORBISFILEDLL_D vorbisfile.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) + find_file(ZLIB1DLL_D zlibd1.dll PATHS ${CURRENT_INSTALLED_DIR}/debug/bin) set(DEPENDANCIES_DEBUG_DLL ${LUADLL_D} ${FMTDLL_D} @@ -135,7 +135,7 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME) ${VORBISFILEDLL_D} ${ZLIB1DLL_D} ) - + file(COPY ${DEPENDANCIES_RELEASE_DLL} DESTINATION ${CURRENT_PACKAGES_DIR}/${SUFFIX_BINARY}/shiva/plugins/shiva-sfml/Release) file(COPY ${DEPENDANCIES_DEBUG_DLL} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/${SUFFIX_BINARY}/shiva/plugins/shiva-sfml/Debug) endif() diff --git a/ports/signalrclient/CONTROL b/ports/signalrclient/CONTROL index d8939e1775181f..7b9d0bc12cbefb 100644 --- a/ports/signalrclient/CONTROL +++ b/ports/signalrclient/CONTROL @@ -1,5 +1,5 @@ Source: signalrclient -Version: 1.0.0-beta1-8 +Version: 1.0.0-beta1-9 Build-Depends: cpprestsdk[default-features,websockets], openssl Homepage: https://github.com/aspnet/SignalR-Client-Cpp Description: C++ client for SignalR. diff --git a/ports/sigslot/CONTROL b/ports/sigslot/CONTROL index 9b3e16b3753c92..e785404ebbd12b 100644 --- a/ports/sigslot/CONTROL +++ b/ports/sigslot/CONTROL @@ -1,3 +1,3 @@ Source: sigslot -Version: 1.0.0 +Version: 1.0.0-3 Description: Portable C++ type-safe, thread-safe signal/slot library for ISO C++, Unix/BSD/Linux and Win32. Sigslot allows C++ code to use the signal/slot paradigm made popular by, for example, Qt. diff --git a/ports/sigslot/portfile.cmake b/ports/sigslot/portfile.cmake index 4993bf9e09ceb3..d841668bafd4d1 100644 --- a/ports/sigslot/portfile.cmake +++ b/ports/sigslot/portfile.cmake @@ -1,20 +1,11 @@ -include(vcpkg_common_functions) +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO sigslot/sigslot + REF 1.0.0 + FILENAME "sigslot-1-0-0.tar.gz" + SHA512 3f16f94a653e49934ec1d695eac02234d15b203f42e9fa88723ee582a84670a645a89e5b87afe2378fa7a9eaef054049255bf3bd531ab1d6825a042641ba8906 +) -vcpkg_download_distfile( - ARCHIVE - URLS - "https://downloads.sourceforge.net/project/sigslot/sigslot/1.0.0/sigslot-1-0-0.tar.gz" - FILENAME - "sigslot-1-0-0.tar.gz" - SHA512 - 3f16f94a653e49934ec1d695eac02234d15b203f42e9fa88723ee582a84670a645a89e5b87afe2378fa7a9eaef054049255bf3bd531ab1d6825a042641ba8906 - ) +file(INSTALL ${SOURCE_PATH}/sigslot.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}) - -file(INSTALL ${CURRENT_BUILDTREES_DIR}/sigslot/sigslot.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -file(INSTALL ${CURRENT_PORT_DIR}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/sigslot - RENAME copyright) +file(INSTALL ${CURRENT_PORT_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/simage/CONTROL b/ports/simage/CONTROL new file mode 100644 index 00000000000000..f88751b8db1425 --- /dev/null +++ b/ports/simage/CONTROL @@ -0,0 +1,5 @@ +Source: simage +Version: 1.8.0 +Description: Image file format library abstraction layer +Build-Depends: giflib (linux|uwp), libjpeg-turbo (linux|uwp), libpng (linux|uwp), libsndfile (linux|uwp), tiff (linux|uwp), libvorbis (linux|uwp) +Homepage: https://github.com/coin3d/simage diff --git a/ports/simage/disable-cpackd.patch b/ports/simage/disable-cpackd.patch new file mode 100644 index 00000000000000..6fd227a62a5bb6 --- /dev/null +++ b/ports/simage/disable-cpackd.patch @@ -0,0 +1,10 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 775037a..e3deb01 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -627,4 +627,4 @@ install(EXPORT ${PROJECT_NAME} + + # ############################################################################ + # New CPACK section, please see the README file inside cpack.d directory. +-add_subdirectory(cpack.d) ++#add_subdirectory(cpack.d) diff --git a/ports/simage/disable-examples.patch b/ports/simage/disable-examples.patch new file mode 100644 index 00000000000000..dc9236c97f5449 --- /dev/null +++ b/ports/simage/disable-examples.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 775037a..fbd81b2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -482,23 +489,23 @@ endif() + # Build examples + # ############################################################################ + +-set(SIMAGE_EXAMPLE_SOURCE +- ${CMAKE_CURRENT_SOURCE_DIR}/examples/audio2raw.c +- ${CMAKE_CURRENT_SOURCE_DIR}/examples/img2avi.c ++#set(SIMAGE_EXAMPLE_SOURCE ++# ${CMAKE_CURRENT_SOURCE_DIR}/examples/audio2raw.c ++# ${CMAKE_CURRENT_SOURCE_DIR}/examples/img2avi.c + # ${CMAKE_CURRENT_SOURCE_DIR}/examples/mpeg2enc.cpp # requires Coin to build +- ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-convert.c +- ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-read-line-test.c +-) +- +-foreach(_source ${SIMAGE_EXAMPLE_SOURCE}) +- get_filename_component(_example ${_source} NAME_WE) +- add_executable(${_example} ${_source}) +- target_compile_definitions(${_example} PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) +- target_link_libraries(${_example} simage) +- if(UNIX) +- target_link_libraries(${_example} m) +- endif() +-endforeach() ++# ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-convert.c ++# ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-read-line-test.c ++#) ++ ++#foreach(_source ${SIMAGE_EXAMPLE_SOURCE}) ++# get_filename_component(_example ${_source} NAME_WE) ++# add_executable(${_example} ${_source}) ++# target_compile_definitions(${_example} PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) ++# target_link_libraries(${_example} simage) ++# if(UNIX) ++# target_link_libraries(${_example} m) ++# endif() ++#endforeach() + + # ############################################################################ + # Build tests diff --git a/ports/simage/disable-tests.patch b/ports/simage/disable-tests.patch new file mode 100644 index 00000000000000..46790227fa21df --- /dev/null +++ b/ports/simage/disable-tests.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 775037a..b82734a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -504,25 +511,25 @@ endforeach() + # Build tests + # ############################################################################ + +-enable_testing() +- +-add_executable(loaders tests/loaders.c) +-target_link_libraries(loaders simage) +-target_compile_definitions(loaders PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) +-if(UNIX) +- target_link_libraries(loaders m) +-endif() +- +-add_test( +- loaders +- ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/loaders +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.gif +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.jpg +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.png +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.rgb +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tga +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tif +-) ++#enable_testing() ++ ++#add_executable(loaders tests/loaders.c) ++#target_link_libraries(loaders simage) ++#target_compile_definitions(loaders PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) ++#if(UNIX) ++# target_link_libraries(loaders m) ++#endif() ++ ++#add_test( ++# loaders ++# ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/loaders ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.gif ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.jpg ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.png ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.rgb ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tga ++# ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tif ++#) + + # Add a target to generate API documentation with Doxygen + if(SIMAGE_BUILD_DOCUMENTATION) diff --git a/ports/simage/link-flac-library.patch b/ports/simage/link-flac-library.patch new file mode 100644 index 00000000000000..7b8e35a10c28ae --- /dev/null +++ b/ports/simage/link-flac-library.patch @@ -0,0 +1,60 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 775037a..2de9b9f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,6 +108,10 @@ find_package(Jasper) + find_package(OggVorbis) + find_package(Sndfile) + ++if(SNDFILE_FOUND) ++ find_package(FLAC) ++endif() ++ + if(APPLE AND SIMAGE_USE_CGIMAGE) + check_cxx_source_compiles(" + #include +@@ -467,6 +471,9 @@ endif() + if(SNDFILE_FOUND) + target_include_directories(simage PRIVATE ${SNDFILE_INCLUDE_DIRS}) + target_link_libraries(simage PRIVATE ${SNDFILE_LIBRARIES}) ++ if(FLAC_FOUND) ++ target_link_libraries(simage PRIVATE ${FLAC_LIBRARIES}) ++ endif() + endif() + + if(TIFF_FOUND) +diff --git a/FindFLAC.cmake b/FindFLAC.cmake +new file mode 100644 +index 0000000..ce40a11 +--- /dev/null ++++ b/FindFLAC.cmake +@@ -0,0 +1,29 @@ ++include(FindPackageHandleStandardArgs) ++ ++find_path(FLAC_INCLUDE_DIR FLAC/all.h) ++ ++mark_as_advanced(FLAC_INCLUDE_DIR) ++ ++set(FLAC_INCLUDE_DIRS ${FLAC_INCLUDE_DIR}) ++ ++find_library(FLAC_LIBRARY NAMES FLAC) ++ ++mark_as_advanced( ++ FLAC_INCLUDE_DIR ++ FLAC_LIBRARY ++) ++ ++set(FLAC_LIBRARIES ${FLAC_LIBRARY}) ++ ++find_package_handle_standard_args( ++ FLAC ++ DEFAULT_MSG ++ FLAC_INCLUDE_DIRS ++ FLAC_LIBRARIES ++) ++ ++if(FLAC_FOUND AND NOT TARGET FLAC::FLAC) ++ add_library(FLAC::FLAC UNKNOWN IMPORTED) ++ set_target_properties(FLAC::FLAC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}") ++ set_property(TARGET FLAC::FLAC APPEND PROPERTY IMPORTED_LOCATION "${FLAC_LIBRARY}") ++endif() diff --git a/ports/simage/link-math-library.patch b/ports/simage/link-math-library.patch new file mode 100644 index 00000000000000..4ffe98bf1aba39 --- /dev/null +++ b/ports/simage/link-math-library.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a978dd..e7abd57 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -454,6 +454,9 @@ endif() + if(PNG_FOUND) + target_include_directories(simage PRIVATE ${PNG_INCLUDE_DIR}) + target_link_libraries(simage PRIVATE ${PNG_LIBRARIES}) ++ if(UNIX) ++ target_link_libraries(simage PRIVATE m) ++ endif() + endif() + + if(SIMAGE_QIMAGE_SUPPORT) diff --git a/ports/simage/link-ogg-library.patch b/ports/simage/link-ogg-library.patch new file mode 100644 index 00000000000000..752754411bfbe2 --- /dev/null +++ b/ports/simage/link-ogg-library.patch @@ -0,0 +1,16 @@ +diff --git a/FindOggVorbis.cmake b/FindOggVorbis.cmake +index a33e63e..7e2708b 100644 +--- a/FindOggVorbis.cmake ++++ b/FindOggVorbis.cmake +@@ -28,10 +28,10 @@ mark_as_advanced( + + set( + OGGVORBIS_LIBRARIES +- ${OGG_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ${VORBISENC_LIBRARY} ++ ${OGG_LIBRARY} + ) + + find_package_handle_standard_args( diff --git a/ports/simage/portfile.cmake b/ports/simage/portfile.cmake new file mode 100644 index 00000000000000..59fbf4557f1d4f --- /dev/null +++ b/ports/simage/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Coin3D/simage + REF simage-1.8.0 + SHA512 7070c845fc72094a97b1253d23a5f60f90e71dc6ed968c9c7da67e05660b05245a807fbdf0f592a1d459c7c3b725783c55f59f867182b11cb9ec40741d7ad58c + HEAD_REF master + PATCHES + disable-cpackd.patch + disable-examples.patch + disable-tests.patch + link-flac-library.patch + link-math-library.patch + link-ogg-library.patch + potentially-uninitialized-local-pointer-variable.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(SIMAGE_BUILD_SHARED_LIBS OFF) +else() + set(SIMAGE_BUILD_SHARED_LIBS ON) +endif() + +if(VCPKG_TARGET_IS_UWP) + set(SIMAGE_USE_AVIENC OFF) + set(SIMAGE_USE_GDIPLUS OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSIMAGE_BUILD_SHARED_LIBS=${SIMAGE_BUILD_SHARED_LIBS} + -DSIMAGE_USE_AVIENC=${SIMAGE_USE_AVIENC} + -DSIMAGE_USE_GDIPLUS=${SIMAGE_USE_GDIPLUS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/simage-1.8.0) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +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(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/simage/potentially-uninitialized-local-pointer-variable.patch b/ports/simage/potentially-uninitialized-local-pointer-variable.patch new file mode 100644 index 00000000000000..1b74a2f89878cd --- /dev/null +++ b/ports/simage/potentially-uninitialized-local-pointer-variable.patch @@ -0,0 +1,26 @@ +diff --git a/examples/img2avi.c b/examples/img2avi.c +index 7a5ca96..d0ee057 100644 +--- a/examples/img2avi.c ++++ b/examples/img2avi.c +@@ -30,7 +30,7 @@ int main(int argc, char *argv[]) + int first; + int width; + int height; +- s_movie * movie; ++ s_movie * movie = NULL; + s_params * params; + s_image *image; + char formatbuf[20]; +diff --git a/mpeg2enc/putvlc.c b/mpeg2enc/putvlc.c +index 6a84fbd..b373fea 100644 +--- a/mpeg2enc/putvlc.c ++++ b/mpeg2enc/putvlc.c +@@ -103,7 +103,7 @@ void + simpeg_encode_putAC(simpeg_encode_context * context,int run, int signed_level, int vlcformat) + { + int level, len; +- VLCtable *ptab; ++ VLCtable *ptab = NULL; + + level = (signed_level<0) ? -signed_level : signed_level; /* abs(signed_level) */ + diff --git a/ports/simdjson/CONTROL b/ports/simdjson/CONTROL deleted file mode 100644 index fe34d9af319b23..00000000000000 --- a/ports/simdjson/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: simdjson -Version: 2019-12-27 -Description: A extremely fast JSON library that can parse gigabytes of JSON per second -Homepage: https://github.com/lemire/simdjson -Supports: !(x86|arm|arm64) \ No newline at end of file diff --git a/ports/simdjson/no_benchmark.patch b/ports/simdjson/no_benchmark.patch deleted file mode 100644 index 74c40fd745368d..00000000000000 --- a/ports/simdjson/no_benchmark.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9668819..cf5e89f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,7 +51,6 @@ include(include/CMakeLists.txt) - add_subdirectory(src) - add_subdirectory(tools) - add_subdirectory(tests) --add_subdirectory(benchmark) - - # for fuzzing, read the comments in the fuzz/CMakeLists.txt file - option(ENABLE_FUZZING "enable building the fuzzers" ON) -@@ -73,5 +72,3 @@ set(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") - set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") - - include(CPack) -- -- --- -2.20.1.windows.1 diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake index c8f3b67ecd0d1a..409182a72b54f8 100644 --- a/ports/simdjson/portfile.cmake +++ b/ports/simdjson/portfile.cmake @@ -1,24 +1,24 @@ -# https://github.com/Microsoft/vcpkg/issues/5418#issuecomment-470519894 -vcpkg_fail_port_install(ON_ARCH "arm" "arm64" "x86") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO lemire/simdjson - REF 4da06830f1389c8cd33171f5ab3558e79f0ece04 - SHA512 ffb11ee91f97d975fba2946653c9c847565933380f94e334d15e627f77a7a750702c539ca55d17e077b2ed0a79006f56a3b9a202d888bb7e2e3f0484237cb537 + REPO simdjson/simdjson + REF 74870a81898ba44407f5dce1f0f50d4ea53fca04 # v0.4.6 HEAD_REF master - PATCHES ${CMAKE_CURRENT_LIST_DIR}/no_benchmark.patch + SHA512 abd8621cb5ed2a9ccad54c2b9e09a2fc8c8fe5d6a70501d23b879f33e34a6c25d33901b385615e9bb29817c302977aa89bc0ab2a13365e413da557f1a099dd21 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SIMDJSON_BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_TARGET_ARCHITECTURE}" "arm64" SIMDJSON_IMPLEMENTATION_ARM64) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DSIMDJSON_BUILD_STATIC=${SIMDJSON_BUILD_STATIC} - OPTIONS_DEBUG - -DSIMDJSON_SANITIZE=ON + -DSIMDJSON_IMPLEMENTATION_ARM64=${SIMDJSON_IMPLEMENTATION_ARM64} + -DSIMDJSON_JUST_LIBRARY=ON + -DSIMDJSON_GOOGLE_BENCHMARKS=OFF + -DSIMDJSON_COMPETITION=OFF + -DSIMDJSON_SANITIZE=OFF # issue 10145, pr 11495 ) vcpkg_install_cmake() @@ -27,9 +27,6 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include -) +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/simdjson/vcpkg.json b/ports/simdjson/vcpkg.json new file mode 100644 index 00000000000000..618dcaf1230d62 --- /dev/null +++ b/ports/simdjson/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "simdjson", + "version-string": "0.4.6", + "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 f7ccc5ac4222b4..3a8cd97a0c1daf 100644 --- a/ports/skia/CONTROL +++ b/ports/skia/CONTROL @@ -1,10 +1,11 @@ Source: skia -Version: 2020-02-15-1 +Version: 2020-05-18-1 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. Skia is sponsored and managed by Google, but is available for use by anyone under the BSD Free Software License. While engineering of the core components is done by the Skia development team, we consider contributions from any source. Supports: x64 & (osx | windows) +Build-Depends: expat, freetype[core], icu, harfbuzz[icu], libjpeg-turbo, libpng, libwebp, zlib Feature: metal Description: metal support for skia diff --git a/ports/skia/expat.gn b/ports/skia/expat.gn new file mode 100644 index 00000000000000..7e0e09b4cd9e4a --- /dev/null +++ b/ports/skia/expat.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("expat") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/freetype2.gn b/ports/skia/freetype2.gn new file mode 100644 index 00000000000000..5ea73b7a877a9a --- /dev/null +++ b/ports/skia/freetype2.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("freetype2") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/harfbuzz.gn b/ports/skia/harfbuzz.gn new file mode 100644 index 00000000000000..5095f6d8a13804 --- /dev/null +++ b/ports/skia/harfbuzz.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("harfbuzz") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/icu.gn b/ports/skia/icu.gn new file mode 100644 index 00000000000000..3da247995457a5 --- /dev/null +++ b/ports/skia/icu.gn @@ -0,0 +1,11 @@ +import("../third_party.gni") + +system("icu") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } + defines = @_DEFINITIONS@ +} diff --git a/ports/skia/libjpeg-turbo.gn b/ports/skia/libjpeg-turbo.gn new file mode 100644 index 00000000000000..92669bb92d515f --- /dev/null +++ b/ports/skia/libjpeg-turbo.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("libjpeg") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/libpng.gn b/ports/skia/libpng.gn new file mode 100644 index 00000000000000..0867ef8a9e04f0 --- /dev/null +++ b/ports/skia/libpng.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("libpng") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/libwebp.gn b/ports/skia/libwebp.gn new file mode 100644 index 00000000000000..bdcaffe2164b22 --- /dev/null +++ b/ports/skia/libwebp.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("libwebp") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/piex.gn b/ports/skia/piex.gn new file mode 100644 index 00000000000000..1d5a237b973ed3 --- /dev/null +++ b/ports/skia/piex.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("piex") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skia/portfile.cmake b/ports/skia/portfile.cmake index c7a5eb26357307..cf3132b2b00062 100644 --- a/ports/skia/portfile.cmake +++ b/ports/skia/portfile.cmake @@ -5,34 +5,111 @@ vcpkg_fail_port_install( vcpkg_from_git( OUT_SOURCE_PATH SOURCE_PATH URL https://skia.googlesource.com/skia.git - REF 05676f7bc238f667de848dfd37b4aa3c01b69efb + REF fb0b35fed5580d49392df7ce9374551b348fffbf ) -find_program(GIT NAMES git git.cmd) -set(ENV{GIT_EXECUTABLE} "${GIT}") - -vcpkg_find_acquire_program(PYTHON2) -get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) -vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") +function(checkout_in_path PATH URL REF) + if(EXISTS "${PATH}") + return() + endif() + + vcpkg_from_git( + OUT_SOURCE_PATH DEP_SOURCE_PATH + URL "${URL}" + REF "${REF}" + ) + file(RENAME "${DEP_SOURCE_PATH}" "${PATH}") + file(REMOVE_RECURSE "${DEP_SOURCE_PATH}") +endfunction() -vcpkg_find_acquire_program(NINJA) +set(EXTERNALS "${SOURCE_PATH}/third_party/externals") +file(MAKE_DIRECTORY "${EXTERNALS}") -message(STATUS "Syncing git dependencies...") -vcpkg_execute_required_process( - COMMAND "${PYTHON2}" tools/git-sync-deps - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME sync-deps-${TARGET_TRIPLET} +# these following aren't available in vcpkg +checkout_in_path("${EXTERNALS}/sfntly" + "https://github.com/googlefonts/sfntly" + "b55ff303ea2f9e26702b514cf6a3196a2e3e2974" +) +checkout_in_path("${EXTERNALS}/dng_sdk" + "https://android.googlesource.com/platform/external/dng_sdk" + "c8d0c9b1d16bfda56f15165d39e0ffa360a11123" ) +checkout_in_path("${EXTERNALS}/libgifcodec" + "https://skia.googlesource.com/libgifcodec" + "d06d2a6d42baf6c0c91cacc28df2542a911d05fe" +) +checkout_in_path("${EXTERNALS}/piex" + "https://android.googlesource.com/platform/external/piex" + "bb217acdca1cc0c16b704669dd6f91a1b509c406" +) + +# turn a CMake list into a GN list of quoted items +# "a;b;c" -> ["a","b","c"] +function(cmake_to_gn_list OUTPUT_ INPUT_) + if(NOT INPUT_) + set(${OUTPUT_} "[]" PARENT_SCOPE) + else() + string(REPLACE ";" "\",\"" TEMP "${INPUT_}") + set(${OUTPUT_} "[\"${TEMP}\"]" PARENT_SCOPE) + endif() +endfunction() + +# multiple libraries with multiple names may be passed as +# "libA,libA2;libB,libB2,libB3;..." +function(find_libraries RESOLVED LIBRARY_NAMES PATHS) + set(_RESOLVED "") + foreach(_LIB_GROUP ${LIBRARY_NAMES}) + string(REPLACE "," ";" _LIB_GROUP_NAMES "${_LIB_GROUP}") + unset(_LIB CACHE) + find_library(_LIB NAMES ${_LIB_GROUP_NAMES} + PATHS "${PATHS}" + NO_DEFAULT_PATH) + + if(_LIB MATCHES "-NOTFOUND") + message(FATAL_ERROR "Could not find library with names: ${_LIB_GROUP_NAMES}") + endif() + + list(APPEND _RESOLVED "${_LIB}") + endforeach() + set(${RESOLVED} "${_RESOLVED}" PARENT_SCOPE) +endfunction() + +# For each .gn file in the current list directory, configure and install at +# the corresponding directory to replace Skia dependencies with ones from vcpkg. +function(replace_skia_dep NAME INCLUDES LIBS_DBG LIBS_REL DEFINITIONS) + list(TRANSFORM INCLUDES PREPEND "${CURRENT_INSTALLED_DIR}") + cmake_to_gn_list(_INCLUDES "${INCLUDES}") -find_program(GN gn PATHS "${SOURCE_PATH}/bin" "${DEPOT_TOOLS_PATH}") + find_libraries(_LIBS_DBG "${LIBS_DBG}" "${CURRENT_INSTALLED_DIR}/debug/lib") + cmake_to_gn_list(_LIBS_DBG "${_LIBS_DBG}") + + find_libraries(_LIBS_REL "${LIBS_REL}" "${CURRENT_INSTALLED_DIR}/lib") + cmake_to_gn_list(_LIBS_REL "${_LIBS_REL}") + + cmake_to_gn_list(_DEFINITIONS "${DEFINITIONS}") + + set(OUT_FILE "${SOURCE_PATH}/third_party/${NAME}/BUILD.gn") + file(REMOVE "${OUT_FILE}") + configure_file("${CMAKE_CURRENT_LIST_DIR}/${NAME}.gn" "${OUT_FILE}" @ONLY) +endfunction() + +set(_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include") + +replace_skia_dep(expat "/include" "expat" "expat" "") +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") +replace_skia_dep(libjpeg-turbo "/include" "jpeg,jpegd;turbojpeg,turbojpegd" "jpeg;turbojpeg" "") +replace_skia_dep(libpng "/include" "libpng16,libpng16d" "libpng16" "") +replace_skia_dep(libwebp "/include" + "webp,webpd;webpdemux,webpdemuxd;webpdecoder,webpdecoderd;libwebpmux,libwebpmuxd" + "webp;webpdemux;webpdecoder;libwebpmux" "") +replace_skia_dep(zlib "/include" "z,zlib,zlibd" "z,zlib" "") set(OPTIONS "\ -skia_use_system_libjpeg_turbo=false \ -skia_use_system_libpng=false \ -skia_use_system_libwebp=false \ -skia_use_system_icu=false \ -skia_use_system_expat=false \ -skia_use_system_zlib=false") +skia_use_lua=false \ +skia_enable_tools=false \ +skia_enable_spirv_validation=false") # used for passing feature-specific definitions to the config file set(SKIA_PUBLIC_DEFINITIONS "") @@ -86,35 +163,15 @@ if(CMAKE_HOST_WIN32) endif() -set(BUILD_DIR_REL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") -set(BUILD_DIR_DBG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - -message(STATUS "Generating build (debug)...") -vcpkg_execute_required_process( - COMMAND "${GN}" gen "${BUILD_DIR_DBG}" --args=${OPTIONS_DBG} - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME generate-${TARGET_TRIPLET}-dbg -) - -message(STATUS "Generating build (release)...") -vcpkg_execute_required_process( - COMMAND "${GN}" gen "${BUILD_DIR_REL}" --args=${OPTIONS_REL} - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME generate-${TARGET_TRIPLET}-rel +vcpkg_configure_gn( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG "${OPTIONS_DBG}" + OPTIONS_RELEASE "${OPTIONS_REL}" ) -message(STATUS "Building Skia (debug)...") -vcpkg_execute_build_process( - COMMAND "${NINJA}" -C "${BUILD_DIR_DBG}" skia - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME build-${TARGET_TRIPLET}-dbg -) - -message(STATUS "Building Skia (release)...") -vcpkg_execute_build_process( - COMMAND "${NINJA}" -C "${BUILD_DIR_REL}" skia - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME build-${TARGET_TRIPLET}-rel +vcpkg_install_gn( + SOURCE_PATH "${SOURCE_PATH}" + TARGETS ":skia" ) message(STATUS "Installing: ${CURRENT_PACKAGES_DIR}/include/${PORT}") @@ -128,65 +185,9 @@ foreach(file_ ${SKIA_INCLUDE_FILES}) vcpkg_replace_string("${file_}" "#include \"include/" "#include \"${PORT}/") endforeach() -# Finds and stores a single file that matches GLOBBING_EXPR -# into the OUT_VAR or fails otherwise -function(glob_single_file OUT_VAR GLOBBING_EXPR) - file(GLOB RESULTS LIST_DIRECTORIES false "${GLOBBING_EXPR}") - list(LENGTH RESULTS RESULTS_LENGTH) - if(NOT RESULTS_LENGTH EQUAL 1) - message(FATAL_ERROR "Expected one file to match glob: '${GLOBBING_EXPR}'; found: '${RESULTS}'") - endif() - list(GET RESULTS 0 FIRST_RESULT) - set(${OUT_VAR} "${FIRST_RESULT}" PARENT_SCOPE) -endfunction() - -if(VCPKG_TARGET_IS_WINDOWS) - glob_single_file(SKIA_LIBRARY_DBG "${BUILD_DIR_DBG}/skia*.lib") - file(INSTALL "${SKIA_LIBRARY_DBG}" - DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - - glob_single_file(SKIA_LIBRARY_REL "${BUILD_DIR_REL}/skia*.lib") - file(INSTALL "${SKIA_LIBRARY_REL}" - DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - get_filename_component(SKIA_LIBRARY_IMPLIB_DBG - "${SKIA_LIBRARY_DBG}" NAME) - get_filename_component(SKIA_LIBRARY_IMPLIB_REL - "${SKIA_LIBRARY_REL}" NAME) - - glob_single_file(SKIA_LIBRARY_DBG "${BUILD_DIR_DBG}/skia*.dll") - file(INSTALL "${SKIA_LIBRARY_DBG}" - DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") - get_filename_component(SKIA_LIBRARY_NAME_DBG "${SKIA_LIBRARY_DBG}" NAME) - - glob_single_file(SKIA_LIBRARY_DBG "${BUILD_DIR_DBG}/skia*.pdb") - file(INSTALL "${SKIA_LIBRARY_DBG}" - DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") - - glob_single_file(SKIA_LIBRARY_REL "${BUILD_DIR_REL}/skia*.dll") - file(INSTALL "${SKIA_LIBRARY_REL}" - DESTINATION "${CURRENT_PACKAGES_DIR}/bin") - get_filename_component(SKIA_LIBRARY_NAME_REL "${SKIA_LIBRARY_REL}" NAME) - else() - get_filename_component(SKIA_LIBRARY_NAME_DBG "${SKIA_LIBRARY_DBG}" NAME) - get_filename_component(SKIA_LIBRARY_NAME_REL "${SKIA_LIBRARY_REL}" NAME) - endif() -else() - find_library(SKIA_LIBRARY_DBG skia PATHS "${BUILD_DIR_DBG}" NO_DEFAULT_PATH) - file(INSTALL "${SKIA_LIBRARY_DBG}" - DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - - find_library(SKIA_LIBRARY_REL skia PATHS "${BUILD_DIR_REL}" NO_DEFAULT_PATH) - file(INSTALL "${SKIA_LIBRARY_REL}" - DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - - get_filename_component(SKIA_LIBRARY_NAME_DBG "${SKIA_LIBRARY_DBG}" NAME) - get_filename_component(SKIA_LIBRARY_NAME_REL "${SKIA_LIBRARY_REL}" NAME) -endif() - # get a list of library dependencies for TARGET -function(gn_desc_target_libs SOURCE_PATH BUILD_DIR TARGET OUTPUT) +function(gn_desc_target_libs OUTPUT BUILD_DIR TARGET) + vcpkg_find_acquire_program(GN) execute_process( COMMAND ${GN} desc "${BUILD_DIR}" "${TARGET}" libs WORKING_DIRECTORY "${SOURCE_PATH}" @@ -198,8 +199,12 @@ function(gn_desc_target_libs SOURCE_PATH BUILD_DIR TARGET OUTPUT) endfunction() # skiaConfig.cmake.in input variables -gn_desc_target_libs("${SOURCE_PATH}" "${BUILD_DIR_DBG}" //:skia SKIA_DEP_DBG) -gn_desc_target_libs("${SOURCE_PATH}" "${BUILD_DIR_REL}" //:skia SKIA_DEP_REL) +gn_desc_target_libs(SKIA_DEP_DBG + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + //:skia) +gn_desc_target_libs(SKIA_DEP_REL + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + //:skia) configure_file("${CMAKE_CURRENT_LIST_DIR}/skiaConfig.cmake.in" "${CURRENT_PACKAGES_DIR}/share/skia/skiaConfig.cmake" @ONLY) diff --git a/ports/skia/skiaConfig.cmake.in b/ports/skia/skiaConfig.cmake.in index 4a1d008779c3f4..8ce8c1002d26a2 100644 --- a/ports/skia/skiaConfig.cmake.in +++ b/ports/skia/skiaConfig.cmake.in @@ -1,4 +1,5 @@ -add_library(skia::skia SHARED IMPORTED) +add_library(skia INTERFACE) +add_library(skia::skia ALIAS skia) set(SKIA_DEP_DBG @SKIA_DEP_DBG@) set(SKIA_DEP_REL @SKIA_DEP_REL@) @@ -17,62 +18,68 @@ if(_IMPORT_PREFIX STREQUAL "/") set(_IMPORT_PREFIX "") endif() -if(WIN32) - if(SKIA_LIBRARY_IMPLIB_DBG) - set_property(TARGET skia::skia PROPERTY - IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/${SKIA_LIBRARY_IMPLIB_DBG}" - ) - set_property(TARGET skia::skia PROPERTY - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/${SKIA_LIBRARY_NAME_DBG}" - ) - else() - set_property(TARGET skia::skia PROPERTY - IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/${SKIA_LIBRARY_NAME_DBG}" - ) - endif() +find_library(SKIA_LIB NAMES skia skia.dll) +target_link_libraries(skia INTERFACE "${SKIA_LIB}") - if(SKIA_LIBRARY_IMPLIB_REL) - set_property(TARGET skia::skia PROPERTY - IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/${SKIA_LIBRARY_IMPLIB_REL}" - ) - set_property(TARGET skia::skia PROPERTY - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/${SKIA_LIBRARY_NAME_REL}" - ) - else() - set_property(TARGET skia::skia PROPERTY - IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/${SKIA_LIBRARY_NAME_REL}" - ) - endif() -else() - set_property(TARGET skia::skia PROPERTY - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/lib/${SKIA_LIBRARY_NAME_DBG}" - ) - set_property(TARGET skia::skia PROPERTY - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${SKIA_LIBRARY_NAME_REL}" - ) -endif() +function(set_dependencies CONFIG LIBRARIES) + foreach(LIB ${LIBRARIES}) + if(LIB MATCHES "^/") + if(WIN32) + string(SUBSTRING "${LIB}" 1 -1 LIB) + endif() + target_link_libraries(skia INTERFACE + "$<$:${LIB}>") + else() + string(REGEX REPLACE "\\.framework" "" LIB ${LIB}) + string(REGEX REPLACE "[^a-zA-Z]" "_" LIB_NAME ${LIB}) + string(TOUPPER ${LIB_NAME} LIB_NAME) + set(LIB_NAME SKIA_${LIB_NAME}_LIBRARY) + find_library(${LIB_NAME} ${LIB}) + target_link_libraries(skia INTERFACE + "$<$:${${LIB_NAME}}>") + endif() + endforeach() +endfunction() + +set_dependencies(Debug "${SKIA_DEP_DBG}") +set_dependencies(Release "${SKIA_DEP_REL}") + +set(SKIA_DEFINITIONS_DBG + _CRT_SECURE_NO_WARNINGS + _HAS_EXCEPTIONS=0 + WIN32_LEAN_AND_MEAN + NOMINMAX + SK_GL + SK_ENABLE_DUMP_GPU + SK_SUPPORT_PDF + SK_HAS_JPEG_LIBRARY + SK_USE_LIBGIFCODEC + SK_HAS_HEIF_LIBRARY + SK_HAS_PNG_LIBRARY + SK_ENABLE_SKSL_INTERPRETER + SK_HAS_WEBP_LIBRARY + SK_XML + SKIA_DLL + SK_SUPPORT_ATLAS_TEXT=1) -foreach(LIB ${SKIA_DEP_DBG}) - string(REGEX REPLACE "\\.framework" "" LIB ${LIB}) - string(REGEX REPLACE "[^a-zA-Z]" "_" LIB_NAME ${LIB}) - string(TOUPPER ${LIB_NAME} LIB_NAME) - set(LIB_NAME SKIA_${LIB_NAME}_LIBRARY) - find_library(${LIB_NAME} ${LIB}) - set_property(TARGET skia::skia - APPEND PROPERTY INTERFACE_LINK_LIBRARIES - "$<$:${${LIB_NAME}}>") -endforeach() +set(SKIA_DEFINITIONS_REL + _CRT_SECURE_NO_WARNINGS + _HAS_EXCEPTIONS=0 + WIN32_LEAN_AND_MEAN + NOMINMAX + NDEBUG + SK_GL + SK_SUPPORT_PDF + SK_HAS_JPEG_LIBRARY + SK_USE_LIBGIFCODEC + SK_HAS_PNG_LIBRARY + SK_HAS_WEBP_LIBRARY + SK_XML + SKIA_DLL) -foreach(LIB ${SKIA_DEP_REL}) - string(REGEX REPLACE "\\.framework" "" LIB ${LIB}) - string(REGEX REPLACE "[^a-zA-Z]" "_" LIB_NAME ${LIB}) - string(TOUPPER ${LIB_NAME} LIB_NAME) - set(LIB_NAME SKIA_${LIB_NAME}_LIBRARY) - find_library(${LIB_NAME} ${LIB}) - set_property(TARGET skia::skia - APPEND PROPERTY INTERFACE_LINK_LIBRARIES - "$<$:${${LIB_NAME}}>") -endforeach() +target_compile_definitions(skia INTERFACE + $<$:${SKIA_DEFINITIONS_DBG}> + $<$:${SKIA_DEFINITIONS_REL}>) -target_include_directories(skia::skia INTERFACE ${_IMPORT_PREFIX}/include) -target_compile_definitions(skia::skia INTERFACE ${SKIA_PUBLIC_DEFINITIONS}) +target_include_directories(skia INTERFACE ${_IMPORT_PREFIX}/include) +target_compile_definitions(skia INTERFACE ${SKIA_PUBLIC_DEFINITIONS}) diff --git a/ports/skia/zlib.gn b/ports/skia/zlib.gn new file mode 100644 index 00000000000000..5c2bc8fc1c1098 --- /dev/null +++ b/ports/skia/zlib.gn @@ -0,0 +1,10 @@ +import("../third_party.gni") + +system("zlib") { + include_dirs = @_INCLUDES@ + if(is_debug) { + libs = @_LIBS_DBG@ + } else { + libs = @_LIBS_REL@ + } +} diff --git a/ports/skyr-url/CONTROL b/ports/skyr-url/CONTROL index bf05d73ca806a3..a44c81ae4d1d72 100644 --- a/ports/skyr-url/CONTROL +++ b/ports/skyr-url/CONTROL @@ -1,5 +1,5 @@ Source: skyr-url -Version: 1.4.3 -Build-Depends: tl-expected +Version: 1.12.0 +Build-Depends: tl-expected, range-v3, nlohmann-json Homepage: https://github.com/cpp-netlib/url Description: A C++ library that implements the WhatWG URL specification diff --git a/ports/skyr-url/portfile.cmake b/ports/skyr-url/portfile.cmake index c6df3658a90151..96dc3a8a36f6c4 100644 --- a/ports/skyr-url/portfile.cmake +++ b/ports/skyr-url/portfile.cmake @@ -3,25 +3,26 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO cpp-netlib/url - REF v1.4.5 - SHA512 39501217e331a904daf928a5874f81808a9665a9e8debe39c15a3fb7607ab293a5a1b335062cc7ac8f4fe239d4233a2c5ed0e9b45dbec7edcc267eb3d25509d3 - HEAD_REF master + REF v1.12.0 + SHA512 b17b3bf6bb00ba5008b0da23f6a1977cdd154026c7887a59c6cf81351378c0803249ce0a3c53812456633c2971205a5514940a282a0fbaf8f91ce808fba7c753 + HEAD_REF main ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DSkyr_BUILD_TESTS=OFF - -DSkyr_BUILD_DOCS=OFF - -DSkyr_BUILD_EXAMPLES=OFF - -DSkyr_WARNINGS_AS_ERRORS=OFF + -Dskyr_BUILD_TESTS=OFF + -Dskyr_BUILD_DOCS=OFF + -Dskyr_BUILD_EXAMPLES=OFF + -Dskyr_WARNINGS_AS_ERRORS=OFF ) vcpkg_install_cmake() vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/skyr-url RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/slikenet/CONTROL b/ports/slikenet/CONTROL index d3f350570e86f9..5753ce9aa354a4 100644 --- a/ports/slikenet/CONTROL +++ b/ports/slikenet/CONTROL @@ -1,5 +1,6 @@ Source: slikenet -Version: 2019-10-22_1 +Version: 2019-10-22-2 Homepage: https://github.com/SLikeSoft/SLikeNet Description: SLikeNetT is an Open Source/Free Software cross-platform network engine written in C++ and specifially designed for games (and applications which have comparable requirements on a network engine like games) building upon the discontinued RakNet network engine which had more than 13 years of active development. Build-Depends: openssl +Supports: !uwp diff --git a/ports/slikenet/fix-install.patch b/ports/slikenet/fix-install.patch index 418b5e048d554c..008dd1e7f29ce2 100644 --- a/ports/slikenet/fix-install.patch +++ b/ports/slikenet/fix-install.patch @@ -1,49 +1,51 @@ -diff --git a/Lib/DLL/CMakeLists.txt b/Lib/DLL/CMakeLists.txt -index 2d1e078..7e705cf 100644 ---- a/Lib/DLL/CMakeLists.txt -+++ b/Lib/DLL/CMakeLists.txt -@@ -50,13 +50,13 @@ ELSE(WIN32 AND NOT UNIX) - ENDIF(WIN32 AND NOT UNIX) - - target_link_libraries(SLikeNetDLL ${SLIKENET_LIBRARY_LIBS}) --IF(NOT WIN32 OR UNIX) -- configure_file(../../slikenet-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake @ONLY) -- -- install(TARGETS SLikeNetDLL EXPORT SLikeNetDLL DESTINATION lib/slikenet-${SLikeNet_VERSION}) -+IF(1) -+ install(TARGETS SLikeNetDLL -+ EXPORT SLikeNetDLL -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) - INSTALL(FILES ${ALL_COMPATIBILITY_HEADER_SRC} DESTINATION include/slikenet-${SLikeNet_VERSION}) - INSTALL(FILES ${ALL_COMPATIBILITY_HEADER_SRC_2} DESTINATION include/slikenet-${SLikeNet_VERSION}/slikenet/slikenet) - INSTALL(FILES ${ALL_HEADER_SRCS} DESTINATION include/slikenet-${SLikeNet_VERSION}/slikenet/include/slikenet) -- INSTALL(FILES ../../slikenet-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) -- INSTALL(EXPORT SLikeNetDLL DESTINATION lib/slikenet-${SLikeNet_VERSION}) --ENDIF(NOT WIN32 OR UNIX) -+ENDIF(1) -diff --git a/Lib/LibStatic/CMakeLists.txt b/Lib/LibStatic/CMakeLists.txt -index 955a99d..9211c45 100644 ---- a/Lib/LibStatic/CMakeLists.txt -+++ b/Lib/LibStatic/CMakeLists.txt -@@ -54,13 +54,14 @@ IF(WIN32 AND NOT UNIX) - IF(NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles") - set_target_properties(SLikeNetLibStatic PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB:\"LIBCD.lib LIBCMTD.lib MSVCRT.lib\"" ) - ENDIF(NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles") --ELSE(WIN32 AND NOT UNIX) -- configure_file(../../slikenet-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake @ONLY) -+ENDIF(WIN32 AND NOT UNIX) - - INSTALL(TARGETS SLikeNetLibStatic EXPORT SLikeNetLibStatic DESTINATION lib/slikenet-${SLikeNet_VERSION}) -+ INSTALL(TARGETS SLikeNetLibStatic -+ EXPORT SLikeNetLibStatic -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION share/slikenet) - INSTALL(FILES ${ALL_COMPATIBILITY_HEADER_SRC} DESTINATION include/slikenet-${SLikeNet_VERSION}) - INSTALL(FILES ${ALL_COMPATIBILITY_HEADER_SRC_2} DESTINATION include/slikenet-${SLikeNet_VERSION}/slikenet) - INSTALL(FILES ${ALL_HEADER_SRCS} DESTINATION include/slikenet-${SLikeNet_VERSION}/include/slikenet) -- INSTALL(FILES ../../slikenet-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) -- INSTALL(EXPORT SLikeNetLibStatic FILE slikenet.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) --ENDIF(WIN32 AND NOT UNIX) +diff --git a/Lib/DLL/CMakeLists.txt b/Lib/DLL/CMakeLists.txt +index 7f6453d..48f9562 100644 +--- a/Lib/DLL/CMakeLists.txt ++++ b/Lib/DLL/CMakeLists.txt +@@ -50,6 +50,7 @@ ELSE(WIN32 AND NOT UNIX) + ENDIF(WIN32 AND NOT UNIX) + + target_link_libraries(SLikeNetDLL ${SLIKENET_LIBRARY_LIBS}) ++if(0) + IF(NOT WIN32 OR UNIX) + configure_file(../../slikenet-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake @ONLY) + +@@ -60,3 +61,12 @@ IF(NOT WIN32 OR UNIX) + INSTALL(FILES ../../slikenet-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) + INSTALL(EXPORT SLikeNetDLL DESTINATION lib/slikenet-${SLikeNet_VERSION}) + ENDIF(NOT WIN32 OR UNIX) ++endif() ++ ++install(TARGETS SLikeNetDLL ++ EXPORT SLikeNetDLL ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++INSTALL(FILES ${ALL_HEADER_SRCS} DESTINATION include/slikenet) ++install(EXPORT SLikeNetDLL FILE slikenetTargets.cmake DESTINATION share/slikenet) +diff --git a/Lib/LibStatic/CMakeLists.txt b/Lib/LibStatic/CMakeLists.txt +index f936fa5..a5dcc4f 100644 +--- a/Lib/LibStatic/CMakeLists.txt ++++ b/Lib/LibStatic/CMakeLists.txt +@@ -50,6 +50,8 @@ ELSE(WIN32 AND NOT UNIX) + ENDIF(WIN32 AND NOT UNIX) + + target_link_libraries(SLikeNetLibStatic ${SLIKENET_LIBRARY_LIBS}) ++ ++if(0) + IF(WIN32 AND NOT UNIX) + IF(NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles") + set_target_properties(SLikeNetLibStatic PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB:\"LIBCD.lib LIBCMTD.lib MSVCRT.lib\"" ) +@@ -64,3 +66,12 @@ ELSE(WIN32 AND NOT UNIX) + INSTALL(FILES ../../slikenet-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/slikenet-config-version.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) + INSTALL(EXPORT SLikeNetLibStatic FILE slikenet.cmake DESTINATION lib/slikenet-${SLikeNet_VERSION}) + ENDIF(WIN32 AND NOT UNIX) ++endif() ++ ++INSTALL(TARGETS SLikeNetLibStatic ++ EXPORT SLikeNetLibStatic ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++INSTALL(FILES ${ALL_HEADER_SRCS} DESTINATION include/slikenet) ++INSTALL(EXPORT SLikeNetLibStatic FILE slikenetTargets.cmake DESTINATION share/slikenet) diff --git a/ports/slikenet/portfile.cmake b/ports/slikenet/portfile.cmake index d1c037a2bab893..c321f653c5917e 100644 --- a/ports/slikenet/portfile.cmake +++ b/ports/slikenet/portfile.cmake @@ -33,6 +33,11 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/slikenet) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -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}/slikenet-config.cmake" "${CURRENT_PACKAGES_DIR}/share/slikenet/slikenet-config.cmake" COPYONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/slikenet/vcpkg-cmake-wrapper.cmake" COPYONLY) +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/slikenet/slikenet-config.cmake b/ports/slikenet/slikenet-config.cmake new file mode 100644 index 00000000000000..be473367afdbd5 --- /dev/null +++ b/ports/slikenet/slikenet-config.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(OpenSSL) +set(slikenet_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include") +include(${CMAKE_CURRENT_LIST_DIR}/slikenetTargets.cmake) diff --git a/ports/slikenet/usage b/ports/slikenet/usage new file mode 100644 index 00000000000000..6f98ae5f83a145 --- /dev/null +++ b/ports/slikenet/usage @@ -0,0 +1,4 @@ +The package slikenet provides CMake targets: + + find_package(slikenet CONFIG REQUIRED) + target_link_libraries(main PRIVATE SLikeNet) \ No newline at end of file diff --git a/ports/slikenet/vcpkg-cmake-wrapper.cmake b/ports/slikenet/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..237389f63ff241 --- /dev/null +++ b/ports/slikenet/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,11 @@ +_find_package(${ARGS}) + +if(NOT TARGET SLikeNet AND TARGET SLikeNetDLL) +add_library(SLikeNet INTERFACE IMPORTED) +set_target_properties(SLikeNet PROPERTIES INTERFACE_LINK_LIBRARIES SLikeNetDLL) +endif() + +if(NOT TARGET SLikeNet AND TARGET SLikeNetLibStatic) +add_library(SLikeNet INTERFACE IMPORTED) +set_target_properties(SLikeNet PROPERTIES INTERFACE_LINK_LIBRARIES SLikeNetLibStatic) +endif() diff --git a/ports/so5extra/CONTROL b/ports/so5extra/CONTROL index d085c7fc3c60ca..db1624a833e677 100644 --- a/ports/so5extra/CONTROL +++ b/ports/so5extra/CONTROL @@ -1,5 +1,5 @@ Source: so5extra -Version: 1.4.0 +Version: 1.4.1 Homepage: https://github.com/Stiffstream/so5extra Description: A set of additional tools for SObjectizer framework. Build-Depends: sobjectizer diff --git a/ports/so5extra/portfile.cmake b/ports/so5extra/portfile.cmake index 4e2cd8119bfcea..c48ca98d9c8890 100644 --- a/ports/so5extra/portfile.cmake +++ b/ports/so5extra/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stiffstream/so5extra - REF 5bf200f495fd7774bd1e42ee563db8c69ad6fc75 # v.1.4.0 - SHA512 3d91505d2a58a6fd0fd8fc9296996cfe26dece40f9f7b8364d9d65d2046d290b98f0c6e5e48371e5fc729b17a35e55c7571f78dca45bb697c422c133aa24ff1e + REF e03e025b08921c76a650656019a04cf7500620be # v.1.4.1 + SHA512 0ee7b98d713cf5c8789f3275f96e7e92b33cb8d3c44fd98752c11cab07914cb3b104ccaf346e714afd43e115ef854dccb4d04ea37d9063b20947aa0d514dac52 ) vcpkg_configure_cmake( diff --git a/ports/sobjectizer/CONTROL b/ports/sobjectizer/CONTROL index d0f60bbd20aec6..c6c54d8ceb9eb6 100644 --- a/ports/sobjectizer/CONTROL +++ b/ports/sobjectizer/CONTROL @@ -1,4 +1,4 @@ Source: sobjectizer -Version: 5.7.0 +Version: 5.7.1 Homepage: https://github.com/Stiffstream/sobjectizer Description: SObjectizer is a C++ in-process message dispatching framework with implementation of Actor Model, Publish-Subscribe Model and CSP-like channels. diff --git a/ports/sobjectizer/portfile.cmake b/ports/sobjectizer/portfile.cmake index 1a98c9b56f1269..abda8a579998c1 100644 --- a/ports/sobjectizer/portfile.cmake +++ b/ports/sobjectizer/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stiffstream/sobjectizer - REF 407fb4cd25455441792d764d498badb6884cfb78 # v.5.7.0 - SHA512 0a6254a2f8b2aecf18ef29202f150227a0332ec16af08895567a4d27621f200cd17c15321668ef3ce0f4e0c5cd10e3cd89a4ecc89a34615019f2b23779adc51a + REF 64e9c1062ef1bbbb67de44426f2eac55d4f5241c # v.5.7.1 + SHA512 aa8f1bc982f1212fd040bb68c52d824f518104f1e5ce6af884ec57ffb70334148765fd44c5f883458e7733cf28ace380c349e68d8dbe19564374ab0afb0b969a ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) diff --git a/ports/sockpp/CONTROL b/ports/sockpp/CONTROL new file mode 100644 index 00000000000000..90ad9f7871a834 --- /dev/null +++ b/ports/sockpp/CONTROL @@ -0,0 +1,5 @@ +Source: sockpp +Version: 0.7 +Homepage: https://github.com/fpagliughi/sockpp +Description: Simple, modern, C++ socket library. This is a fairly low-level C++ wrapper around the Berkeley sockets library using socket, acceptor, and connector classes that are familiar concepts from other languages. +Supports: !uwp diff --git a/ports/sockpp/portfile.cmake b/ports/sockpp/portfile.cmake new file mode 100644 index 00000000000000..19b43486e3ce73 --- /dev/null +++ b/ports/sockpp/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO fpagliughi/sockpp + REF d8c86c01db43542a06ad05424da037f6b9892253 + SHA512 9b7ae3fea08bfd4a0d6479d7fbcc24da9101476c4f8e4a684138c7d974827cdf374282a4641e58f03c08aeb83f2c1856fc3c5193e5847fb4b3d9182c1c396087 + HEAD_REF master +) + +vcpkg_replace_string(${SOURCE_PATH}/CMakeLists.txt "\${SOCKPP}-static" "\${SOCKPP}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSOCKPP_BUILD_SHARED=OFF + -DSOCKPP_BUILD_STATIC=ON + -DSOCKPP_BUILD_DOCUMENTATION=OFF + -DSOCKPP_BUILD_EXAMPLES=OFF + -DSOCKPP_BUILD_TESTS=OFF +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${CURRENT_PORT_DIR}/sockppConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/sockpp/sockppConfig.cmake b/ports/sockpp/sockppConfig.cmake new file mode 100644 index 00000000000000..840b96ed04f378 --- /dev/null +++ b/ports/sockpp/sockppConfig.cmake @@ -0,0 +1,23 @@ +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) +if(NOT SOCKPP_FIND_COMPONENTS) + set(SOCKPP_FIND_COMPONENTS sockpp) + if(SOCKPP_FIND_REQUIRED) + set(SOCKPP_FIND_REQUIRED_sockpp TRUE) + endif() + set(SOCKPP_FOUND TRUE) +endif() + +set(SOCKPP_INCLUDE_DIRS ${_DIR}/include) +set(SOCKPP_LIBRARIES) +if (EXISTS ${_DIR}/lib/libsockpp.a) + list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/libsockpp.a) +endif() +if (EXISTS ${_DIR}/debug/lib/libsockpp.a) + list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/libsockpp.a) +endif() +if (EXISTS ${_DIR}/lib/sockpp.lib) + list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/sockpp.lib) +endif() +if (EXISTS ${_DIR}/debug/lib/sockpp.lib) + list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/sockpp.lib) +endif() diff --git a/ports/sockpp/usage b/ports/sockpp/usage new file mode 100644 index 00000000000000..5cfb06d29e77f0 --- /dev/null +++ b/ports/sockpp/usage @@ -0,0 +1,5 @@ +The package sockpp provides CMake integration: + + find_package(sockpp CONFIG REQUIRED) + target_include_directories(main PRIVATE ${SOCKPP_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${SOCKPP_LIBRARIES}) diff --git a/ports/sol2/CONTROL b/ports/sol2/CONTROL index 316e61f3fc93f2..d0871cca97aa94 100644 --- a/ports/sol2/CONTROL +++ b/ports/sol2/CONTROL @@ -1,5 +1,5 @@ Source: sol2 -Version: 3.2.0 +Version: 3.2.1 Homepage: https://github.com/ThePhD/sol2 Description: Sol v2.0 - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great Build-Depends: lua (windows) \ No newline at end of file diff --git a/ports/sol2/portfile.cmake b/ports/sol2/portfile.cmake index 6a9dd370fde5d3..88230ce4b82409 100644 --- a/ports/sol2/portfile.cmake +++ b/ports/sol2/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ThePhD/sol2 - REF e26475e75b0a116de95ce710b573989008b82a57 # v3.2.0 - SHA512 dde9ea3fba74b69e9ddadce9f82eb9773a8aa92bcc266a8c4e7a4863f4bc22b4dc52b24b690e97ff5ff4c44d858eaa06c3bd64837274f90a1d93ebd646df5d64 + REF 874c8e5f09cb2fa73a0a1d6b56fb6691a3aa1144 # v3.2.1 + SHA512 7e3e7a6d61ef7bec3ce44604cde09259eb62f808d2d0236431e2a4b290e85241b359c88974c8b21a9b1baa6c92d714c5265721adb528cee29b894aca9c581c23 HEAD_REF develop PATCHES fix-namespace.patch ) diff --git a/ports/soqt/CONTROL b/ports/soqt/CONTROL new file mode 100644 index 00000000000000..2fbde418b0757a --- /dev/null +++ b/ports/soqt/CONTROL @@ -0,0 +1,6 @@ +Source: soqt +Version: 1.6.0-1 +Description: A Qt Gui-toolkit binding for Coin +Build-Depends: coin, qt5-base[core] +Homepage: https://github.com/coin3d/soqt +Supports: !(arm|arm64|uwp) diff --git a/ports/soqt/disable-cpackd.patch b/ports/soqt/disable-cpackd.patch new file mode 100644 index 00000000000000..1450b2de3ec837 --- /dev/null +++ b/ports/soqt/disable-cpackd.patch @@ -0,0 +1,10 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 802e512c..21cc23a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -393,4 +393,4 @@ add_subdirectory(test-code) + + ############################################################################ + # New CPACK section, please see the README file inside cpack.d directory. +-add_subdirectory(cpack.d) ++#add_subdirectory(cpack.d) diff --git a/ports/soqt/disable-test-code.patch b/ports/soqt/disable-test-code.patch new file mode 100644 index 00000000000000..3e1216a92eec4e --- /dev/null +++ b/ports/soqt/disable-test-code.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b0815f2..236ffa8d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -390,7 +390,7 @@ set(PACKAGE_REQUIREMENTS "Coin, ${PACKAGE_ADDITIONAL_REQUIREMENTS}") + add_subdirectory(data) + add_subdirectory(src) + ##### small test programs (to be run interactively) +-add_subdirectory(test-code) ++#add_subdirectory(test-code) + + ############################################################################ + # New CPACK section, please see the README file inside cpack.d directory. diff --git a/ports/soqt/portfile.cmake b/ports/soqt/portfile.cmake new file mode 100644 index 00000000000000..8340753f9aace0 --- /dev/null +++ b/ports/soqt/portfile.cmake @@ -0,0 +1,89 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm" "arm64") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Coin3D/soqt + REF SoQt-1.6.0 + SHA512 204d49769dda1a9833093ff78bdb788df0c514e800ae0bc35d4ef832ece304c7c26fc7d893ee83db95c34d9457e27e04c74301bcd2029aa3a0f96ec2ecbb3984 + HEAD_REF master + PATCHES + disable-cpackd.patch + disable-test-code.patch +) + +if(VCPKG_HEAD_VERSION) + vcpkg_download_distfile( + SOANYDATA_ARCHIVE + URLS "https://github.com/coin3d/soanydata/archive/master.tar.gz" + FILENAME "Coin3D-soanydata-master.tar.gz" + SKIP_SHA512 + ) +else() + vcpkg_download_distfile( + SOANYDATA_ARCHIVE + URLS "https://github.com/coin3d/soanydata/archive/3ff6e9203fbb0cc08a2bdf209212b7ef4d78a1f2.tar.gz" + FILENAME "Coin3D-soanydata-3ff6e9203fbb0cc08a2bdf209212b7ef4d78a1f2.tar.gz" + SHA512 9e176feda43a12ccdf8756f7329517936357499771a7d0a58357d343bdea125c34f8734ff1cd16cda3eeee58090dc1680999849c50132c30940a23d3f81a5c66 + ) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOANYDATA_SOURCE_PATH + ARCHIVE ${SOANYDATA_ARCHIVE} +) + +if(NOT EXISTS ${SOURCE_PATH}/data) + file(RENAME ${SOANYDATA_SOURCE_PATH} ${SOURCE_PATH}/data) +endif() + +if(VCPKG_HEAD_VERSION) + vcpkg_download_distfile( + SOGUI_ARCHIVE + URLS "https://github.com/coin3d/sogui/archive/master.tar.gz" + FILENAME "Coin3D-sogui-master.tar.gz" + SKIP_SHA512 + ) +else() + vcpkg_download_distfile( + SOGUI_ARCHIVE + URLS "https://github.com/coin3d/sogui/archive/fb79af47cff89f0f3657501601a7ea5c11968b17.tar.gz" + FILENAME "Coin3D-sogui-fb79af47cff89f0f3657501601a7ea5c11968b17.tar.gz" + SHA512 bcf4d2e04c3b6ac87a6425d90c6077ec655732bcc0f99bf181ff2dfce8d356509f52d71b884660fafddc135551ee8fbb139e02b6706d2a01be006193918d232b + ) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOGUI_SOURCE_PATH + ARCHIVE ${SOGUI_ARCHIVE} +) + +if(NOT EXISTS ${SOURCE_PATH}/src/Inventor/Qt/common) + file(RENAME ${SOGUI_SOURCE_PATH} ${SOURCE_PATH}/src/Inventor/Qt/common) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(SOQT_BUILD_SHARED_LIBS OFF) +else() + set(SOQT_BUILD_SHARED_LIBS ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSOQT_BUILD_DOCUMENTATION=OFF + -DSOQT_BUILD_SHARED_LIBS=${SOQT_BUILD_SHARED_LIBS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SoQt-1.6.0) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +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(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/soundtouch/CONTROL b/ports/soundtouch/CONTROL index 28b6ac87c38770..2d1757f8f7927a 100644 --- a/ports/soundtouch/CONTROL +++ b/ports/soundtouch/CONTROL @@ -1,5 +1,5 @@ Source: soundtouch -Version: 2.0.0-4 +Version: 2.0.0-6 Homepage: https://www.surina.net/soundtouch Description: SoundTouch is an open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or audio files. Build-Depends: atlmfc (windows) diff --git a/ports/soundtouch/portfile.cmake b/ports/soundtouch/portfile.cmake index 5f77e2a635eec8..12cc0b08468923 100644 --- a/ports/soundtouch/portfile.cmake +++ b/ports/soundtouch/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") @@ -30,4 +28,4 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/source/SoundTouchDLL/SoundTouchDLL.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/COPYING.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/soxr/CONTROL b/ports/soxr/CONTROL index ebf120c060ccaf..e49991ff1430f9 100644 --- a/ports/soxr/CONTROL +++ b/ports/soxr/CONTROL @@ -1,3 +1,4 @@ Source: soxr -Version: 0.1.3. +Version: 0.1.3-2 +Homepage: https://sourceforge.net/projects/soxr/ Description: High quality audio resampling diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index 3a2e23c3000fb0..2641e8a5a000b7 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -1,14 +1,8 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://netcologne.dl.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz" - FILENAME "soxr-0.1.3-Source.tar.xz" - SHA512 f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO soxr + FILENAME "soxr-0.1.3-Source.tar.xz" + SHA512 f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 PATCHES 001_initialize-resampler.patch 002_disable_warning.patch diff --git a/ports/span-lite/CONTROL b/ports/span-lite/CONTROL index e7001a83ac27b5..b301e6326959ee 100644 --- a/ports/span-lite/CONTROL +++ b/ports/span-lite/CONTROL @@ -1,3 +1,4 @@ Source: span-lite -Version: 0.5.0 +Version: 0.7.0 Description: A C++20-like span for C++98, C++11 and later in a single-file header-only library +Homepage: https://github.com/martinmoene/span-lite diff --git a/ports/span-lite/portfile.cmake b/ports/span-lite/portfile.cmake index ad53591bdc1954..aa76e74e31a58c 100644 --- a/ports/span-lite/portfile.cmake +++ b/ports/span-lite/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO martinmoene/span-lite - REF v0.5.0 - SHA512 4221d9897736257077b8ff6a5246d70315bebb975a30a119778f22c1859d14cca5e3035447561ca9684bef6dbca5a00b3b5ca208dada4fcf1f3b31df2aa0cb1f + REF v0.7.0 + SHA512 af1a47e10a3c061e6476845e54fe22341a353c0326dbbc35922edc248dbd55c3e62e5e0d1de5b5509a391515d792a5b35c8265bc1bcbbfb39a2e60c30a2fabcf ) vcpkg_configure_cmake( diff --git a/ports/spdk/CONTROL b/ports/spdk/CONTROL index 0233395c11e8c7..a12729033690ac 100644 --- a/ports/spdk/CONTROL +++ b/ports/spdk/CONTROL @@ -1,5 +1,6 @@ Source: spdk Version: 19.01.1 +Port-Version: 1 Description: Storage Performance Development Kit Build-Depends: spdk-dpdk, spdk-ipsec, spdk-isal -Supports: linux \ No newline at end of file +Supports: linux diff --git a/ports/spdk/usage b/ports/spdk/usage index 6e791c3fe81907..f26b41649c99f2 100644 --- a/ports/spdk/usage +++ b/ports/spdk/usage @@ -7,7 +7,7 @@ Add following to build examples/nvme/perf/perf.c ADD_EXECUTABLE(SPDKTest perf.c) - TARGET_LINK_DIRECTORIES(SPDKTest PRIVATE ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/spdk) + TARGET_LINK_DIRECTORIES(SPDKTest PRIVATE ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/spdk) TARGET_LINK_LIBRARIES(SPDKTest PRIVATE SPDK::spdk_app_rpc SPDK::spdk_bdev diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index e7f91fc9457fad..8636d8ba951701 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,5 +1,5 @@ Source: spdlog -Version: 1.4.2-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/disable-master-project-check.patch b/ports/spdlog/disable-master-project-check.patch deleted file mode 100644 index f39ec120a77a0e..00000000000000 --- a/ports/spdlog/disable-master-project-check.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 12320fb..70f611b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -33,13 +33,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) - # Set SPDLOG_MASTER_PROJECT to ON if we are building spdlog - #--------------------------------------------------------------------------------------- - # Check if spdlog is being used directly or via add_subdirectory, but allow overriding --if (NOT DEFINED SPDLOG_MASTER_PROJECT) -- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) -- set(SPDLOG_MASTER_PROJECT ON) -- else() -- set(SPDLOG_MASTER_PROJECT OFF) -- endif() --endif () -+set(SPDLOG_MASTER_PROJECT OFF) - - # build shared option - if(NOT WIN32) diff --git a/ports/spdlog/fix-error-4275.patch b/ports/spdlog/fix-error-4275.patch deleted file mode 100644 index 4d1d8ee7d42b56..00000000000000 --- a/ports/spdlog/fix-error-4275.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd17178..c9910e1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -126,6 +126,10 @@ if(SPDLOG_FMT_EXTERNAL) - - target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL) - target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) -+ -+ if (WIN32) -+ target_compile_options(spdlog PRIVATE /wd4275) -+ endif() - - set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config - endif() diff --git a/ports/spdlog/fix-feature-export.patch b/ports/spdlog/fix-feature-export.patch deleted file mode 100644 index 51dbd84738de58..00000000000000 --- a/ports/spdlog/fix-feature-export.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt -index d087cf6..86483db 100644 ---- a/bench/CMakeLists.txt -+++ b/bench/CMakeLists.txt -@@ -26,3 +26,8 @@ add_executable(formatter-bench formatter-bench.cpp) - target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog) - - file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") -+ -+install(TARGETS bench async_bench latency -+ RUNTIME DESTINATION tools/spdlog -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -\ No newline at end of file diff --git a/ports/spdlog/fix-include.patch b/ports/spdlog/fix-include.patch deleted file mode 100644 index 7f5539201e2a7e..00000000000000 --- a/ports/spdlog/fix-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/spdlog/common.h b/include/spdlog/common.h -index e1108a0a..b4faf26e 100644 ---- a/include/spdlog/common.h -+++ b/include/spdlog/common.h -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #ifdef _WIN32 - #ifndef NOMINMAX diff --git a/ports/spdlog/fix-uwp.patch b/ports/spdlog/fix-uwp.patch deleted file mode 100644 index 42811122b3786a..00000000000000 --- a/ports/spdlog/fix-uwp.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35425db..28c555a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -128,7 +128,7 @@ if(SPDLOG_FMT_EXTERNAL) - target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) - - if (WIN32) -- target_compile_options(spdlog PRIVATE /wd4275) -+ target_compile_options(spdlog PRIVATE /wd4275 /wd4100) - endif() - - set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config -diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h -index f436b0d..82f3510 100644 ---- a/include/spdlog/details/os-inl.h -+++ b/include/spdlog/details/os-inl.h -@@ -128,7 +128,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f) - { - - #ifdef _WIN32 --#if !defined(__cplusplus_winrt) -+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) - auto file_handle = reinterpret_cast(_get_osfhandle(_fileno(f))); - if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) - SPDLOG_THROW(spdlog_ex("SetHandleInformation failed", errno)); diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index f62234090abd02..844575c134759a 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,28 +1,21 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gabime/spdlog - REF 1549ff12f1aa61ffc4d9a8727c519034724392a0 #v1.4.2 - SHA512 c159aea475baecad0a5a9eef965856203c96aa855b0480e82d751bcc050c6e08bb0aa458544da061f5d744e17dcd27bd9b6e31a62d502834f02d3591f29febec + REF 616caa5d30172b65cc3a06800894c575d70cb8e6 #v1.7.0 + SHA512 47411e8a607a339bffe2d5e13b4568b825ee8a07d88e69cf32096b08b76cdb60cbd64003620506e9c5748d3f66d8df76fa8880bb1a092923b7b405fedd18ad0c HEAD_REF v1.x - PATCHES - disable-master-project-check.patch - fix-feature-export.patch - fix-error-4275.patch - fix-uwp.patch - fix-include.patch ) -set(SPDLOG_USE_BENCHMARK OFF) -if("benchmark" IN_LIST FEATURES) - set(SPDLOG_USE_BENCHMARK ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + benchmark SPDLOG_BUILD_BENCH +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DSPDLOG_FMT_EXTERNAL=ON - -DSPDLOG_BUILD_BENCH=${SPDLOG_USE_BENCHMARK} -DSPDLOG_INSTALL=ON ) diff --git a/ports/speexdsp/CONTROL b/ports/speexdsp/CONTROL index 74963399599ae6..4edbf5f2000020 100644 --- a/ports/speexdsp/CONTROL +++ b/ports/speexdsp/CONTROL @@ -1,5 +1,5 @@ Source: speexdsp -Version: 1.2.0-1 -Homepage: https://ftp.osuosl.org/pub/xiph/releases/speex/ +Version: 1.2.0-2 +Homepage: https://speex.org/ Description: A patent-free, Open Source/Free Software DSP library. Build-Depends: diff --git a/ports/speexdsp/portfile.cmake b/ports/speexdsp/portfile.cmake index 4e4bc5742c9c65..3ed106350b682e 100644 --- a/ports/speexdsp/portfile.cmake +++ b/ports/speexdsp/portfile.cmake @@ -1,14 +1,9 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.xiph.org/releases/speex/speexdsp-1.2.0.tar.gz" - FILENAME "speexdsp-1.2.0.tar.gz" - SHA512 e357cd5377415ea66c862302c7cf8bf6a10063cacd903f0846478975b87974cf5bdf00e2c6759d8f4f453c4c869cf284e9dc948a84a83d7b2ab96bd5405c05ec -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO xiph/speexdsp + REF 64cbfa9bca7479a758351aa02bb4abdd76baa9e7 #1.2.0 + SHA512 b92488e1efd4d763cd2d438b88a1b708d2a9d8f804dc2b016bfb29c4f7366624d3cf86a23645067393274e100c1bd6467def0eb98575f04ffcaf49b20f1f1105 + HEAD_REF master ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/spirv-tools/CONTROL b/ports/spirv-tools/CONTROL index a075b87c5f41b2..3acb8e4f89f1d6 100644 --- a/ports/spirv-tools/CONTROL +++ b/ports/spirv-tools/CONTROL @@ -1,5 +1,5 @@ Source: spirv-tools -Version: 2020.1 +Version: 2020.1-1 Homepage: https://github.com/KhronosGroup/SPIRV-Tools Description: API and commands for processing SPIR-V modules Build-Depends: spirv-headers \ No newline at end of file diff --git a/ports/spirv-tools/portfile.cmake b/ports/spirv-tools/portfile.cmake index 4741a206fb2db2..305a3fde50c03d 100644 --- a/ports/spirv-tools/portfile.cmake +++ b/ports/spirv-tools/portfile.cmake @@ -20,7 +20,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DSPIRV-Headers_SOURCE_DIR=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET} + -DSPIRV-Headers_SOURCE_DIR=${CURRENT_INSTALLED_DIR} -DSPIRV_WERROR=OFF -DENABLE_SPIRV_TOOLS_INSTALL=ON ) diff --git a/ports/spscqueue/CONTROL b/ports/spscqueue/CONTROL index e8330caaa17376..f29c84e46551f6 100644 --- a/ports/spscqueue/CONTROL +++ b/ports/spscqueue/CONTROL @@ -1,4 +1,4 @@ Source: spscqueue -Version: 2019-07-26 +Version: 1.0 Description: A bounded single-producer single-consumer wait-free and lock-free queue written in C++11 Homepage: https://github.com/rigtorp/SPSCQueue diff --git a/ports/spscqueue/portfile.cmake b/ports/spscqueue/portfile.cmake index 5bc0628bc0f6d2..c0b9c48332497b 100644 --- a/ports/spscqueue/portfile.cmake +++ b/ports/spscqueue/portfile.cmake @@ -1,19 +1,22 @@ -# header-only library - -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO rigtorp/SPSCQueue - REF 5165a08ac4474c77c636050332eca6ebfdd53533 - SHA512 30cd60711f816e6003a5b114c48bd12da449cb7b0f19aa58dd57e3abc3e5200847c3eb492627b4013f57eec11d5d6f0a11fedbcb21dd8dd5c44682c49456e4e1 + REF v1.0 + SHA512 8776b49070d549b1df155b0a1ad876a4145d75e004269b3573e8f9963329ad05350d323d87bae229c793cbaf1f2421e35fa7e923e68cc4dcd9cfb6698e8cd80e HEAD_REF master ) -file(COPY - ${SOURCE_PATH}/include/rigtorp/SPSCQueue.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include/rigtorp +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA ) +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SPSCQueue) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + # Handle copyright configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 64ff002623f446..d803fc03cc44dd 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -3,7 +3,7 @@ project(sqlite3 C) include_directories(.) if(BUILD_SHARED_LIBS) - if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin") + if(UNIX) set(API "-DSQLITE_API=__attribute__((visibility(\"default\")))") elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") set(API "-DSQLITE_API=__declspec(dllexport)") @@ -46,11 +46,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 37384865e25fa2..0d17c801ec742d 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,5 +1,6 @@ Source: sqlite3 -Version: 3.31.1 +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. diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 7b14475e320d9b..2e1d2fb6fabfec 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,5 +1,5 @@ -set(SQLITE_VERSION 3310100) -set(SQLITE_HASH 3a44168a9973896d26880bc49469c3b9a120fd39dbeb27521c216b900fd32c5b3ca19ba51648e8c7715899b173cf01b4ae6e03a16cb3a7058b086147389437af ) +set(SQLITE_VERSION 3320300) +set(SQLITE_HASH 850c1eed0cfaa016d3db9ef23101d64efeb11bde53848d99fea316e60660621d470dff7c2969e94625ce270ba28f74a55bb05ecb693d057d8bc6815fc6b78a90) vcpkg_download_distfile(ARCHIVE URLS "https://sqlite.org/2020/sqlite-amalgamation-${SQLITE_VERSION}.zip" @@ -30,7 +30,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,9 +40,9 @@ 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 ) file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() 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 a59df97ae52098..5914dc17d04700 100644 --- a/ports/sqlitecpp/0001-Find-external-sqlite3.patch +++ b/ports/sqlitecpp/0001-Find-external-sqlite3.patch @@ -1,14 +1,16 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 00e058c..489b884 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -199,7 +199,8 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME}) - ## Build provided copy of SQLite3 C library ## - - # TODO --#find_package(sqlite3) -+find_package(sqlite3 CONFIG) -+target_link_libraries(SQLiteCpp PRIVATE sqlite3) - #if(sqlite3_VERSION VERSION_LESS "3.19") - # set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") - #endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9363c0d..0f47f0f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -227,9 +227,9 @@ if (SQLITECPP_INTERNAL_SQLITE) + add_subdirectory(sqlite3) + target_link_libraries(SQLiteCpp PUBLIC sqlite3) + else (SQLITECPP_INTERNAL_SQLITE) +- find_package (SQLite3 REQUIRED) ++ find_package(unofficial-sqlite3 CONFIG) + message(STATUS "Link to sqlite3 system library") +- target_link_libraries(SQLiteCpp PUBLIC SQLite::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 8f6017a299909a..372acc14b06458 100644 --- a/ports/sqlitecpp/CONTROL +++ b/ports/sqlitecpp/CONTROL @@ -1,5 +1,6 @@ Source: sqlitecpp -Version: 2.3.0-1 +Version: 3.0.0 +Port-Version: 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/portfile.cmake b/ports/sqlitecpp/portfile.cmake index 210ca3dd66ce04..9f2febab0fc1d8 100644 --- a/ports/sqlitecpp/portfile.cmake +++ b/ports/sqlitecpp/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH REPO "SRombauts/SQLiteCpp" - REF 09dd10886c560ab5af41cfe694567f34c88cd101 + REF be1a8eeace02ce98dfa3da688d1011c5bb895985 #v3.0.0 HEAD_REF master - SHA512 d0a440e2e96fca9aac7fe73d46bb6508825a82547dca1e9c93d8c3ca46878fa137e7a2a7a865bcfa641d0236e26307a3342d55fc83578552a37eec7565642d91 + SHA512 d48b5915a2674f7f6da2737fa365e2202373e95cd20e819281b765a597e2fa8b8ae33f6553d65b6a8a93741e31633de3c75caf84fffa4313154c43ce634b1323 PATCHES 0001-Find-external-sqlite3.patch ) @@ -27,4 +25,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SQLiteCpp) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sqlitecpp RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sqlpp11-connector-mysql/CONTROL b/ports/sqlpp11-connector-mysql/CONTROL index 9b3115fc1975d1..cfed369d4f8dcc 100644 --- a/ports/sqlpp11-connector-mysql/CONTROL +++ b/ports/sqlpp11-connector-mysql/CONTROL @@ -1,5 +1,14 @@ Source: sqlpp11-connector-mysql -Version: 0.29 -Description: A C++ wrapper for MySQL meant to be used in combination with sqlpp11. -Build-Depends: date, libmariadb, sqlpp11 +Version: 0.29-1 Homepage: https://github.com/rbock/sqlpp11-connector-mysql +Description: A C++ wrapper for MySQL meant to be used in combination with sqlpp11. +Build-Depends: date, sqlpp11 +Default-Features: mariadb + +Feature: mariadb +Description: Use MariaDB connector +Build-Depends: libmariadb + +Feature: mysql +Description: Use MySQL connector +Build-Depends: libmysql diff --git a/ports/sqlpp11/CONTROL b/ports/sqlpp11/CONTROL index 0d4e6ae9cb0b7d..d35889f212e600 100644 --- a/ports/sqlpp11/CONTROL +++ b/ports/sqlpp11/CONTROL @@ -1,4 +1,5 @@ Source: sqlpp11 -Version: 0.58-3 +Version: 0.59 +Homepage: https://github.com/rbock/sqlpp11 Description: A type safe embedded domain specific language for SQL queries and results in C++. Build-Depends: date diff --git a/ports/sqlpp11/ddl2cpp_path.patch b/ports/sqlpp11/ddl2cpp_path.patch index b3c16570b8a455..bc828e829f3cc2 100644 --- a/ports/sqlpp11/ddl2cpp_path.patch +++ b/ports/sqlpp11/ddl2cpp_path.patch @@ -1,13 +1,13 @@ diff --git a/cmake/Sqlpp11Config.cmake b/cmake/Sqlpp11Config.cmake -index 720fef2..d8f93b8 100644 +index 18ea9b1..730bce1 100644 --- a/cmake/Sqlpp11Config.cmake +++ b/cmake/Sqlpp11Config.cmake -@@ -34,7 +34,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/Sqlpp11Targets.cmake") - if(TARGET sqlpp11::ddl2cpp) - message(FATAL_ERROR "Target sqlpp11::ddl2cpp already defined") - endif() --get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH) -+get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../scripts/sqlpp11-ddl2cpp" REALPATH) - if(NOT EXISTS "${sqlpp11_ddl2cpp_location}") - message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.") - endif() +@@ -32,7 +32,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/Sqlpp11Targets.cmake") + + # Import "ddl2cpp" script + if(NOT TARGET sqlpp11::ddl2cpp) +- get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH) ++ get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../scripts/sqlpp11-ddl2cpp" REALPATH) + if(NOT EXISTS "${sqlpp11_ddl2cpp_location}") + message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.") + endif() diff --git a/ports/sqlpp11/portfile.cmake b/ports/sqlpp11/portfile.cmake index 596df39773b2b8..c85f6ed107c976 100644 --- a/ports/sqlpp11/portfile.cmake +++ b/ports/sqlpp11/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO rbock/sqlpp11 - REF 0.58 - SHA512 c391e72638a748e0e25b53176dc371ba468bc14bdcb6dda2f2418c4ab4d620ebc5507ee284ff81c3104888d0d959703c6c91b55ccd69a8641b07dcb20cd56209 + REF 0.59 + SHA512 9da05e7a5163200040205b9740d6bf4ad1faa94b2bf031c16d896865b3f10e0fe95a0532a2c2e89adc051250a7f76c550a239916fdd700828d4fb1da566a4fe3 HEAD_REF master - PATCHES ddl2cpp_path.patch + PATCHES ddl2cpp_path.patch ) # Use sqlpp11's own build process, skipping tests @@ -16,12 +14,11 @@ vcpkg_configure_cmake( OPTIONS -DENABLE_TESTS:BOOL=OFF ) - + vcpkg_install_cmake() # Move CMake config files to the right place -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Sqlpp11 TARGET_PATH share/sqlpp11) - +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Sqlpp11 TARGET_PATH share/${PORT}) # Delete redundant and unnecessary directories file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) @@ -31,4 +28,4 @@ file(COPY ${CURRENT_PACKAGES_DIR}/bin/sqlpp11-ddl2cpp DESTINATION ${CURRENT_PACK file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/sqlpp11 RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/stlab/CONTROL b/ports/stlab/CONTROL index b67baa4ddf7dee..72521a95543df5 100644 --- a/ports/stlab/CONTROL +++ b/ports/stlab/CONTROL @@ -1,5 +1,5 @@ Source: stlab -Version: 1.5.2 +Version: 1.5.2-1 Description: stlab is the ongoing work of what was Adobe Software Technology Lab. The Concurrency library provides futures and channels, high level constructs for implementing algorithms that eases the use of multiple CPU cores while minimizing contention. This library solves several problems of the C++11 and C++17 TS futures. diff --git a/ports/stlab/portfile.cmake b/ports/stlab/portfile.cmake index d8bcbebc80fb7d..8fb73df6b7c0ff 100644 --- a/ports/stlab/portfile.cmake +++ b/ports/stlab/portfile.cmake @@ -1,7 +1,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stlab/libraries - REF 2e411dd5c8b7eb096e9eb04c46b569c775b126c6 # V1.5.2 + REF 2e411dd5c8b7eb096e9eb04c46b569c775b126c6 # V1.5.2 SHA512 c0e3f8b7b44a6da9734b44e5693d28b84e75a9d4844e30d26dbc65cbd6673fe7e7a45f329aadf5ac3d1e7ec9b939230d179ed150bcf4c3f3e96a3a96ed04fadb HEAD_REF develop ) @@ -17,8 +17,11 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/stlab) vcpkg_copy_pdbs() -# cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/share/cmake) -# handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/stlabConfig.cmake STLAB_CONFIG) +string(REPLACE "find_dependency(Boost 1.60.0)" "if(APPLE)\nfind_dependency(Boost)\nendif()" STLAB_CONFIG ${STLAB_CONFIG}) + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/stlabConfig.cmake "${STLAB_CONFIG}") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/stormlib/CMakeLists.txt b/ports/stormlib/CMakeLists.txt index 6b0e2a66cd5d72..6a85775b5dfd5d 100644 --- a/ports/stormlib/CMakeLists.txt +++ b/ports/stormlib/CMakeLists.txt @@ -274,6 +274,7 @@ install(TARGETS stormlib EXPORT stormlibConfig RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + PUBLIC_HEADER DESTINATION include ) install(EXPORT stormlibConfig NAMESPACE stormlib:: DESTINATION share/stormlib) \ No newline at end of file diff --git a/ports/stormlib/CONTROL b/ports/stormlib/CONTROL index beb6fd3c12f233..7f1513b78ccb02 100644 --- a/ports/stormlib/CONTROL +++ b/ports/stormlib/CONTROL @@ -1,4 +1,4 @@ Source: stormlib -Version: 2019-05-10 +Version: 2019-05-10-1 Build-Depends: zlib, bzip2 Description: StormLib is a library for opening and manipulating Blizzard MPQ files diff --git a/ports/string-theory/CONTROL b/ports/string-theory/CONTROL index 4d5e1e824c9e29..9627976ab95621 100644 --- a/ports/string-theory/CONTROL +++ b/ports/string-theory/CONTROL @@ -1,4 +1,4 @@ Source: string-theory -Version: 3.1 +Version: 3.3 Homepage: https://github.com/zrax/string_theory Description: Flexible modern C++ string library with type-safe formatting. diff --git a/ports/string-theory/portfile.cmake b/ports/string-theory/portfile.cmake index bb344050495534..864dc573a17b5f 100644 --- a/ports/string-theory/portfile.cmake +++ b/ports/string-theory/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO zrax/string_theory - REF 3.1 - SHA512 fb4b5d89126ef65aeb50cd0a636dc938a6b0086d5124c872fd60f48a56752eac8f64956f67e829a3eecb0d4cebd6df442162ab6f0b88c35b93dc8ac5c62f18d2 + REF 3.3 + SHA512 86209333dce341078c3b973084bd9f3b8ff2ccac0e07a5e6acf5973bd1cfa420897b531b2d1bd6aba9f5ccc8927f85d91f06796ac0e62ec8a735564a0387d2f4 HEAD_REF master ) 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 7d31c1d9475461..722dac00485e74 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,6 +1,7 @@ Source: suitesparse -Version: 5.4.0-5 -Build-Depends: clapack (!osx) +Version: 5.4.0 +Port-Version: 7 +Build-Depends: lapack Homepage: http://faculty.cse.tamu.edu/davis/SuiteSparse Description: algebra library diff --git a/ports/suitesparse/suitesparse.patch b/ports/suitesparse/suitesparse.patch index e26a5b8cbd62e1..2255565ac173b1 100644 --- a/ports/suitesparse/suitesparse.patch +++ b/ports/suitesparse/suitesparse.patch @@ -117,12 +117,14 @@ index c6e2834..5ef08a6 100644 # 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..49387b8 100644 +index cb1f51f..12f654c 100644 --- a/cmake/SuiteSparse-config-install.cmake.in +++ b/cmake/SuiteSparse-config-install.cmake.in -@@ -4,13 +4,10 @@ get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_SELF_DIR}" PATH) - get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH) +@@ -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. @@ -136,7 +138,7 @@ index cb1f51f..49387b8 100644 # Report SuiteSparse header search locations. set(SuiteSparse_INCLUDE_DIRS ${_SuiteSparse_PREFIX}/include) -@@ -31,6 +28,11 @@ set(SuiteSparse_LIBRARIES +@@ -31,6 +27,10 @@ set(SuiteSparse_LIBRARIES SuiteSparse::spqr @SuiteSparse_EXPORTED_METIS_LIBS@ ) @@ -147,4 +149,3 @@ index cb1f51f..49387b8 100644 + +set(SUITESPARSE_FOUND TRUE) +set(SuiteSparse_FOUND TRUE) -+ diff --git a/ports/symengine/CONTROL b/ports/symengine/CONTROL new file mode 100644 index 00000000000000..4e829ba5ba3090 --- /dev/null +++ b/ports/symengine/CONTROL @@ -0,0 +1,30 @@ +Source: symengine +Version: 2020-05-25 +Description: SymEngine is a fast symbolic manipulation library +Homepage: https://github.com/symengine/symengine +Build-Depends: boost-math, boost-random +Default-Features: integer-class-boostmp + +Feature: arb +Description: Build with arb +Build-Depends: arb + +Feature: flint +Description: Build with flint +Build-Depends: flint + +Feature: mpfr +Description: Build with mpfr +Build-Depends: mpfr + +Feature: integer-class-boostmp +Description: Use Boost.multiprecision integer class +Build-Depends: boost-multiprecision + +Feature: integer-class-flint +Description: Use flint integer class +Build-Depends: flint, gmp + +Feature: tcmalloc +Description: Build with tcmalloc +Build-Depends: gperftools diff --git a/ports/symengine/portfile.cmake b/ports/symengine/portfile.cmake new file mode 100644 index 00000000000000..d61271d6806802 --- /dev/null +++ b/ports/symengine/portfile.cmake @@ -0,0 +1,61 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO symengine/symengine + REF 4f669d5954977e86f4da0f53cb5110d2eb6320b6 + SHA512 091ebc83240d3823fb73e0f65f80732d2a85e55f19c8e1a3d1435f05cfa0d1b95d893e8a3c432e1698953a35c56a6af78044ee59db04f03706cf33e0798a02c7 + HEAD_REF master +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + arb WITH_ARB + flint WITH_FLINT + mpfr WITH_MPFR + tcmalloc WITH_TCMALLOC +) + +if(integer-class-boostmp IN_LIST FEATURES) + set(INTEGER_CLASS boostmp) + + if(integer-class-flint IN_LIST FEATURES) + message(WARNING "Both boostmp and flint are given for integer class, will use boostmp only.") + endif() +elseif(integer-class-flint IN_LIST FEATURES) + set(INTEGER_CLASS flint) +endif() + +if(VCPKG_TARGET_IS_UWP) + set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE") + set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE") +endif() + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MSVC_USE_MT) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DINTEGER_CLASS=${INTEGER_CLASS} + -DBUILD_BENCHMARKS=no + -DBUILD_TESTS=no + -DMSVC_WARNING_LEVEL=3 + -DMSVC_USE_MT=${MSVC_USE_MT} + -DWITH_SYMENGINE_RCP=yes + -DWITH_SYMENGINE_TEUCHOS=no + -DINTEGER_CLASS=${INTEGER_CLASS} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/CMake) + vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) +elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +endif() + +vcpkg_copy_pdbs() + +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/tcl/CONTROL b/ports/tcl/CONTROL index 7bf3da070083d0..7a74eafaf366e5 100644 --- a/ports/tcl/CONTROL +++ b/ports/tcl/CONTROL @@ -1,5 +1,5 @@ Source: tcl -Version: 8.6.10-3 +Version: core-9-0-a1 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/portfile.cmake b/ports/tcl/portfile.cmake index 9109ffd34a293c..6e2757f33967ea 100644 --- a/ports/tcl/portfile.cmake +++ b/ports/tcl/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tcltk/tcl - REF 2abfa2c03ddc0419e6525f86c2c0323b2ba1932e - SHA512 d9bc83c389cf3b95ab64b75c57eb9a2b23b957503d2dadc2d3f6854e9e784d87d9b2059a82f35accb419693bfe675b523c4751af91efac700644e118ff689fd7) + REF 0fa6a4e5aad821a5c34fdfa070c37c3f1ffc8c8e + SHA512 9d7f35309fe8b1a7c116639aaea50cc01699787c7afb432389bee2b9ad56a67034c45d90c9585ef1ccf15bdabf0951cbef86257c0c6aedbd2591bbfae3e93b76) if (VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64") @@ -92,13 +92,14 @@ if (VCPKG_TARGET_IS_WINDOWS) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) else() + file(REMOVE "${SOURCE_PATH}/unix/configure") vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - NO_DEBUG PROJECT_SUBPATH unix ) vcpkg_install_make() + vcpkg_fixup_pkgconfig() if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/tclap/CONTROL b/ports/tclap/CONTROL index e6a1d9ff7f62e9..277e26b6748dce 100644 --- a/ports/tclap/CONTROL +++ b/ports/tclap/CONTROL @@ -1,4 +1,4 @@ Source: tclap -Version: 1.2.2-1 +Version: 1.2.2-3 Homepage: https://sourceforge.net/projects/tclap/ Description: Templatized command-line argument parser for C++ diff --git a/ports/tclap/portfile.cmake b/ports/tclap/portfile.cmake index 7e1fb4460b4d55..d23ae531dfd81a 100644 --- a/ports/tclap/portfile.cmake +++ b/ports/tclap/portfile.cmake @@ -1,18 +1,10 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/project/tclap/tclap-1.2.2.tar.gz" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO tclap FILENAME "tclap-1.2.2.tar.gz" SHA512 516ec17f82a61277922bc8c0ed66973300bf42a738847fbbd2912c6405c34f94a13e47dc964854a5b26a9a9f1f518cce682ca54e769d6016851656c647866107 ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - -file(COPY "${SOURCE_PATH}/include/tclap" - DESTINATION "${CURRENT_PACKAGES_DIR}/include" - FILES_MATCHING PATTERN "*.h") +file(COPY "${SOURCE_PATH}/include/tclap" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.h") file(INSTALL "${SOURCE_PATH}/COPYING" 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/telnetpp/CONTROL b/ports/telnetpp/CONTROL index ffb5ef01a3a620..3118d13bccb6a8 100644 --- a/ports/telnetpp/CONTROL +++ b/ports/telnetpp/CONTROL @@ -1,5 +1,5 @@ Source: telnetpp -Version: 2.0-3 +Version: 2.0-4 Homepage: https://github.com/KazDragon/telnetpp Description: Telnet++ is an implementation of the Telnet Session Layer protocol using C++14 Build-Depends: boost-container, boost-signals2, boost-variant, gsl-lite, boost-exception @@ -8,4 +8,4 @@ Supports: !uwp Feature: zlib Description: Zlib support -Build-Depends: zlib \ No newline at end of file +Build-Depends: zlib diff --git a/ports/telnetpp/github-215.patch b/ports/telnetpp/github-215.patch new file mode 100644 index 00000000000000..57461b9a7a6367 --- /dev/null +++ b/ports/telnetpp/github-215.patch @@ -0,0 +1,47 @@ + +--- + include/telnetpp/options/msdp/variable.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/telnetpp/options/msdp/variable.hpp b/include/telnetpp/options/msdp/variable.hpp +index 16dae0c..d74a6da 100644 +--- a/include/telnetpp/options/msdp/variable.hpp ++++ b/include/telnetpp/options/msdp/variable.hpp +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + namespace telnetpp { namespace options { namespace msdp { + + + +--- + include/telnetpp/options/msdp/variable.hpp | 1 - + src/options/msdp/variable.cpp | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/telnetpp/options/msdp/variable.hpp b/include/telnetpp/options/msdp/variable.hpp +index d74a6da..16dae0c 100644 +--- a/include/telnetpp/options/msdp/variable.hpp ++++ b/include/telnetpp/options/msdp/variable.hpp +@@ -5,7 +5,6 @@ + #include + #include + #include +-#include + + namespace telnetpp { namespace options { namespace msdp { + +diff --git a/src/options/msdp/variable.cpp b/src/options/msdp/variable.cpp +index dc779ea..82549e9 100644 +--- a/src/options/msdp/variable.cpp ++++ b/src/options/msdp/variable.cpp +@@ -1,5 +1,6 @@ + #include "telnetpp/options/msdp/variable.hpp" + #include "telnetpp/detail/lambda_visitor.hpp" ++#include + + namespace telnetpp { namespace options { namespace msdp { + diff --git a/ports/telnetpp/portfile.cmake b/ports/telnetpp/portfile.cmake index e71e59f74225b3..26154cf33cdfa5 100644 --- a/ports/telnetpp/portfile.cmake +++ b/ports/telnetpp/portfile.cmake @@ -8,7 +8,9 @@ vcpkg_from_github( REF 8dc780579293153ad2ae9ad6943815c050d4c659 SHA512 280a8e6c0392f5822b05968520d176d1510f00c12a2502f6039f4f1f78a558e61f825a231fb70b7de6fd21a18b24734eea3ba36a24b29f2a7e9856b1f4de5217 HEAD_REF master - PATCHES fix-build-error.patch + PATCHES + fix-build-error.patch + github-215.patch ) set(USE_ZLIB OFF) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 8bcc1cc35999cb..6fa024164b5297 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,6 @@ Source: tensorflow-cc -Version: 1.14-1 +Version: 1.14 +Port-Version: 4 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares -Supports: !x86 \ No newline at end of file +Supports: !x86 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index aebdf8d656e362..fdd95307c4bc38 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,9 +1,7 @@ -include(vcpkg_common_functions) - message(WARNING "This tensorflow port currently is experimental on Windows and Linux platforms.") if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - message(FATAL_ERROR "TensorFlow does not support 32bit system.") + message(FATAL_ERROR "TensorFlow does not support 32bit systems.") endif() vcpkg_from_github( @@ -49,6 +47,7 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VS} $ENV{VSInstallDir}) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() # tensorflow has long file names, which will not work on windows @@ -76,11 +75,12 @@ set(ENV{TF_NCCL_VERSION} 2.3) set(ENV{NCCL_INSTALL_PATH} "") set(ENV{CC_OPT_FLAGS} "/arch:AVX") set(ENV{TF_NEED_CUDA} 0) +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 ) @@ -118,4 +118,4 @@ file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tenso file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) file(COPY ${CMAKE_CURRENT_LIST_DIR}/TensorflowCCConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/TensorflowCCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/TensorflowCCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) diff --git a/ports/tesseract/CONTROL b/ports/tesseract/CONTROL index b5eea71831d691..7f646fdaf66a66 100644 --- a/ports/tesseract/CONTROL +++ b/ports/tesseract/CONTROL @@ -1,12 +1,13 @@ Source: tesseract Version: 4.1.1 +Port-Version: 1 Homepage: https://github.com/tesseract-ocr/tesseract Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google. Build-Depends: leptonica -Feature: training_tools +Feature: training-tools Description: build training tools Build-Depends: icu, pango, cairo, fontconfig -Feature: cpu_independed +Feature: cpu-independed Description: build on any cpu extension commands support diff --git a/ports/tesseract/portfile.cmake b/ports/tesseract/portfile.cmake index d0a202a7d9461b..925b19afbc65bb 100644 --- a/ports/tesseract/portfile.cmake +++ b/ports/tesseract/portfile.cmake @@ -19,12 +19,12 @@ if(VCPKG_LIBRARY_LINKAGE EQUAL "static") endif() # Handle CONTROL -if("training_tools" IN_LIST FEATURES) +if("training-tools" IN_LIST FEATURES) list(APPEND OPTIONS_LIST -DBUILD_TRAINING_TOOLS=ON) else() list(APPEND OPTIONS_LIST -DBUILD_TRAINING_TOOLS=OFF) endif() -if("cpu_independed" IN_LIST FEATURES) +if("cpu-independed" IN_LIST FEATURES) list(APPEND OPTIONS_LIST -DTARGET_ARCHITECTURE=none) else() list(APPEND OPTIONS_LIST -DTARGET_ARCHITECTURE=auto) diff --git a/ports/tgbot-cpp/CONTROL b/ports/tgbot-cpp/CONTROL new file mode 100644 index 00000000000000..3c83987838f7a3 --- /dev/null +++ b/ports/tgbot-cpp/CONTROL @@ -0,0 +1,5 @@ +Source: tgbot-cpp +Version: 1.2.1 +Homepage: https://github.com/reo7sp/tgbot-cpp +Description: C++14 library for Telegram bot API. +Build-Depends: boost-algorithm, boost-asio, boost-lexical-cast, boost-property-tree, boost-system, boost-test, boost-variant, curl, openssl, zlib diff --git a/ports/tgbot-cpp/portfile.cmake b/ports/tgbot-cpp/portfile.cmake new file mode 100644 index 00000000000000..859b5d03edc6c1 --- /dev/null +++ b/ports/tgbot-cpp/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO reo7sp/tgbot-cpp + REF v1.2.1 + SHA512 b094f9c80dd15b7930b7d7250169b3199d9c84b84826adececa8237111f5ba384ec790dbe969999f362ca2fb35b93950d053777ce5f167007e33c3e4eb133453 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +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) +endif() + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/threadpool/CONTROL b/ports/threadpool/CONTROL new file mode 100644 index 00000000000000..df98da83a48c73 --- /dev/null +++ b/ports/threadpool/CONTROL @@ -0,0 +1,6 @@ +Source: threadpool +Version: 0.2.5 +Port-Version: 1 +Homepage: http://threadpool.sourceforge.net/ +Description: threadpool is a cross-platform C++ thread pool library. It provides a convenient way for dispatching asynchronous tasks and can be easily customized. threadpool is based on the high-quality Boost source libraries. +Build-Depends: boost-thread diff --git a/ports/threadpool/portfile.cmake b/ports/threadpool/portfile.cmake new file mode 100644 index 00000000000000..05d47be5213fb6 --- /dev/null +++ b/ports/threadpool/portfile.cmake @@ -0,0 +1,14 @@ +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO threadpool/threadpool + REF "0.2.5 (Stable)" + SHA512 961576b619e5227098fa37a3c8d903128b3c2a9cf1e55c057c6f9126062bcccfa6fe2510b4e8ee5d1a0e3d0425f0077c50eccad2120a423f69e2705460780e7c + FILENAME "threadpool-0_2_5-src.zip" +) + +file(INSTALL ${SOURCE_PATH}/threadpool/boost + DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/threadpool/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) diff --git a/ports/thrift/CONTROL b/ports/thrift/CONTROL index 4e15b036ad3707..2916e3e33fe147 100644 --- a/ports/thrift/CONTROL +++ b/ports/thrift/CONTROL @@ -1,5 +1,5 @@ Source: thrift -Version: 2020-02-08 +Version: 0.13.0 Build-Depends: zlib, libevent, openssl, boost-range, boost-smart-ptr, boost-date-time, boost-locale, boost-scope-exit Homepage: https://github.com/apache/thrift Description: Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible. diff --git a/ports/thrift/portfile.cmake b/ports/thrift/portfile.cmake index 28b234c0fc10ce..f39ba11b90c674 100644 --- a/ports/thrift/portfile.cmake +++ b/ports/thrift/portfile.cmake @@ -1,10 +1,7 @@ -include(vcpkg_common_functions) - # We currently insist on static only because: # - Thrift doesn't yet support building as a DLL on Windows, # - x64-linux only builds static anyway. # From https://github.com/apache/thrift/blob/master/CHANGES.md -# it looks like it will be supported in v0.13. vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_find_acquire_program(FLEX) @@ -13,13 +10,18 @@ vcpkg_find_acquire_program(BISON) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/thrift - REF 286eee16b147a302ddc7b10740c5e5401ebbec17 - SHA512 83aff3a51281ec43228e66b33d15b344710030ee59c1373c6cf33efae9d26db1896ae3518a23b641a7897724d496c38b5217bfc7c41ff538648ec4c571b924f5 + REF cecee50308fc7e6f77f55b3fd906c1c6c471fa2f #0.13.0 + SHA512 4097fd7951a4d47f2fadc520a54fd1b91b10769d65e899c6bab490dd7ac459e12bb2aa335df8fdfc61a32095033bfac928a54660abb1ee54ca14a144216c3339 HEAD_REF master PATCHES "correct-paths.patch" ) +if (VCPKG_TARGET_IS_OSX) + message(WARNING "${PORT} requires bison version greater than 2.5,\n\ +please use command \`brew install bison\` to install bison") +endif() + # note we specify values for WITH_STATIC_LIB and WITH_SHARED_LIB because even though # they're marked as deprecated, Thrift incorrectly hard-codes a value for BUILD_SHARED_LIBS. vcpkg_configure_cmake( @@ -44,7 +46,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/thrift RENAME copyright) +vcpkg_copy_pdbs() # Move CMake config files to the right place vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/thrift) @@ -68,4 +70,4 @@ if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) endif() -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index 270455ca268859..f37049768efb92 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,5 +1,5 @@ Source: tiff -Version: 4.0.10-8 +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 d09aa10efc4cc9..ab610d3287484b 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,11 +1,9 @@ -include(vcpkg_common_functions) - -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( @@ -51,16 +49,17 @@ 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) file(INSTALL ${TIFF_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(REMOVE ${TIFF_TOOLS}) file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(REMOVE ${TIFF_TOOLS}) - + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() diff --git a/ports/tinyfiledialogs/CONTROL b/ports/tinyfiledialogs/CONTROL index c4435bd77e4079..6e5b062b88537a 100644 --- a/ports/tinyfiledialogs/CONTROL +++ b/ports/tinyfiledialogs/CONTROL @@ -1,5 +1,5 @@ Source: tinyfiledialogs -Version: 3.4.3-1 +Version: 3.6.3 Description: Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more Homepage: https://sourceforge.net/projects/tinyfiledialogs/ Supports: !uwp diff --git a/ports/tinyfiledialogs/portfile.cmake b/ports/tinyfiledialogs/portfile.cmake index 5deecdc717155c..7077d6bff9cb39 100644 --- a/ports/tinyfiledialogs/portfile.cmake +++ b/ports/tinyfiledialogs/portfile.cmake @@ -2,16 +2,11 @@ vcpkg_fail_port_install(ON_TARGET "uwp") vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/tinyfiledialogs/files/v3.4/tinyfiledialogs-3.4.3.zip/download" - FILENAME "tinyfiledialogs-3.4.3.zip" - SHA512 b4a8c8fa5ff53a0972ce9dd1a4a473eaeb82689e5a47553b83e9220ea7e0ec582d87111728088ab6d314972e6531653b11fbd8c05c5e46fbe5bc4d29c7fe23fb -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF v3.4.3 + REPO tinyfiledialogs + FILENAME "frozen_versions/tinyfiledialogs-3.6.3.zip" + SHA512 42c3bd34b0287cf2477f9ede049bea29a9306304e8fab7740065957d3737f4041899f26f29a0693e801cb0a7b63844509f86441262303ff0a4030a431ffac648 ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -28,4 +23,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(READ ${CURRENT_PACKAGES_DIR}/include/tinyfiledialogs/tinyfiledialogs.h _contents) string(SUBSTRING "${_contents}" 0 1024 _contents) -file(WRITE ${CURRENT_PACKAGES_DIR}/share/tinyfiledialogs/copyright "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "${_contents}") diff --git a/ports/tinyply/CONTROL b/ports/tinyply/CONTROL new file mode 100644 index 00000000000000..a75e1fb9b9c0af --- /dev/null +++ b/ports/tinyply/CONTROL @@ -0,0 +1,4 @@ +Source: tinyply +Version: 2020-05-22 +Description: C++11 ply 3d mesh format importer & exporter +Homepage: https://github.com/ddiakopoulos/tinyply diff --git a/ports/tinyply/fix-cmake.patch b/ports/tinyply/fix-cmake.patch new file mode 100644 index 00000000000000..681e30f1fc847d --- /dev/null +++ b/ports/tinyply/fix-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bd9563..4d4d9fe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,6 +50,8 @@ set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") + set(targets_export_name "${PROJECT_NAME}Targets") + set(namespace "") + ++include(GNUInstallDirs) ++ + write_basic_package_version_file( + "${version_config}" + VERSION ${PROJECT_VERSION} +@@ -63,9 +65,10 @@ configure_package_config_file( + + # Install + install(TARGETS tinyply EXPORT ${targets_export_name} +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(FILES source/tinyply.h + DESTINATION include) + diff --git a/ports/tinyply/portfile.cmake b/ports/tinyply/portfile.cmake new file mode 100644 index 00000000000000..a5e93530c9d1df --- /dev/null +++ b/ports/tinyply/portfile.cmake @@ -0,0 +1,34 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ddiakopoulos/tinyply + REF ca7b279fb6c9af931ffdaed96a3b11ca3ccd79ea + SHA512 d3adfe7cce849a14fd473cfd67baef0163d4e45ff32724516270d5893a18086f7ac17d87bda5c33381442766849b41516bd2c7757e97038c95af0c70d5f0edde + HEAD_REF master + PATCHES + # TODO: Remove this patch if https://github.com/ddiakopoulos/tinyply/pull/41 was accepted. + fix-cmake.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED_LIB) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSHARED_LIB=${SHARED_LIB} + -DBUILD_TESTS=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# License +file(READ "${SOURCE_PATH}/readme.md" readme_contents) +string(FIND "${readme_contents}" "License" license_line_pos) +string(SUBSTRING "${readme_contents}" ${license_line_pos} -1 license_contents) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "${license_contents}") diff --git a/ports/tinyxml/CMakeLists.txt b/ports/tinyxml/CMakeLists.txt index b849c07f9ce9df..2004da4af71acd 100644 --- a/ports/tinyxml/CMakeLists.txt +++ b/ports/tinyxml/CMakeLists.txt @@ -10,20 +10,31 @@ set(SOURCES "tinyxml.cpp" option(BUILD_SHARED_LIBS "Build shared libs" OFF) -add_library(tinyxml ${SOURCES}) -target_compile_definitions(tinyxml PRIVATE "-DTIXML_USE_STL") +add_library(unofficial-tinyxml ${SOURCES}) +target_compile_definitions(unofficial-tinyxml PRIVATE "-DTIXML_USE_STL") +set_target_properties(unofficial-tinyxml PROPERTIES OUTPUT_NAME tinyxml) include(GenerateExportHeader) -generate_export_header(tinyxml) +generate_export_header(unofficial-tinyxml BASE_NAME tinyxml) -target_include_directories(tinyxml PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) - -install( - TARGETS tinyxml +target_include_directories(unofficial-tinyxml + PUBLIC + $ + $ +) +install(TARGETS unofficial-tinyxml + EXPORT tinyxml-export ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) - +install(EXPORT tinyxml-export +FILE + tinyxmlTargets.cmake +NAMESPACE + unofficial-tinyxml:: +DESTINATION + share/tinyxml +) install(FILES ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/tinyxml_export.h DESTINATION include) diff --git a/ports/tinyxml/CONTROL b/ports/tinyxml/CONTROL index 749dc2e7e686ac..3a83e411e08302 100644 --- a/ports/tinyxml/CONTROL +++ b/ports/tinyxml/CONTROL @@ -1,4 +1,4 @@ Source: tinyxml -Version: 2.6.2-4 +Version: 2.6.2-7 Homepage: https://sourceforge.net/projects/tinyxml Description: A simple, small, minimal, C++ XML parser that can be easily integrating into other programs. diff --git a/ports/tinyxml/portfile.cmake b/ports/tinyxml/portfile.cmake index b43526efa4714f..1f42e4d75c6cbd 100644 --- a/ports/tinyxml/portfile.cmake +++ b/ports/tinyxml/portfile.cmake @@ -1,17 +1,11 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz" - FILENAME "tinyxml_2_6_2.tar.gz" - SHA512 133b5db06131a90ad0c2b39b0063f1c8e65e67288a7e5d67e1f7d9ba32af10dc5dfa0462f9723985ee27debe8f09a10a25d4b5a5aaff2ede979b1cebe8e59d56 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO tinyxml/tinyxml REF 2.6.2 + FILENAME "tinyxml_2_6_2.tar.gz" + SHA512 133b5db06131a90ad0c2b39b0063f1c8e65e67288a7e5d67e1f7d9ba32af10dc5dfa0462f9723985ee27debe8f09a10a25d4b5a5aaff2ede979b1cebe8e59d56 PATCHES 0001_use_stl.patch 0002_export_tinyxml.patch @@ -26,8 +20,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() - +vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/tinyxml RENAME copyright) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/tinyxml-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tinyxml) diff --git a/ports/tinyxml/tinyxml-config.cmake b/ports/tinyxml/tinyxml-config.cmake index 1bdc5ad7f32f2a..15ad7bdc5d6a82 100644 --- a/ports/tinyxml/tinyxml-config.cmake +++ b/ports/tinyxml/tinyxml-config.cmake @@ -3,17 +3,6 @@ if (tinyxml_CONFIG_INCLUDED) endif() set(tinyxml_CONFIG_INCLUDED TRUE) -set(tinyxml_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include") - -foreach(lib tinyxml) - set(onelib "${lib}-NOTFOUND") - find_library(onelib ${lib} - PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib" - NO_DEFAULT_PATH - ) - if(NOT onelib) - message(FATAL_ERROR "Library '${lib}' in package tinyxml is not installed properly") - endif() - list(APPEND tinyxml_LIBRARIES ${onelib}) -endforeach() - +include(${CMAKE_CURRENT_LIST_DIR}/tinyxmlTargets.cmake) +set(tinyxml_LIBRARIES unofficial-tinyxml::unofficial-tinyxml) +get_target_property(tinyxml_INCLUDE_DIRS unofficial-tinyxml::unofficial-tinyxml INTERFACE_INCLUDE_DIRECTORIES) \ No newline at end of file diff --git a/ports/tinyxml2/CONTROL b/ports/tinyxml2/CONTROL index 1535df552966cb..3be0a859c7db6f 100644 --- a/ports/tinyxml2/CONTROL +++ b/ports/tinyxml2/CONTROL @@ -1,5 +1,4 @@ Source: tinyxml2 -Version: 7.1.0 +Version: 8.0.0-1 Homepage: https://github.com/leethomason/tinyxml2 Description: A simple, small, efficient, C++ XML parser - diff --git a/ports/tinyxml2/fix-debug-postfix.patch b/ports/tinyxml2/fix-debug-postfix.patch new file mode 100644 index 00000000000000..8021e0f633ee85 --- /dev/null +++ b/ports/tinyxml2/fix-debug-postfix.patch @@ -0,0 +1,43 @@ +From 1e384d50313a08dd36a43df1925588741dc33301 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= +Date: Wed, 17 Jun 2020 06:17:06 +0200 +Subject: [PATCH] Fix debug postfix in pkgconfig file + +CMakeLists.txt uses set(CMAKE_DEBUG_POSTFIX "d") to distinguish +between debug and release lib. Use this postfix also in the +generated tinyxml2.pc file in case of a CMake Debug build. +This results in the following contents of tinyxml2.pc +- Release: + Libs: -L${libdir} -ltinyxml2 +- Debug: + Libs: -L${libdir} -ltinyxml2d +--- + CMakeLists.txt | 3 +++ + tinyxml2.pc.in | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f9ab07..7085276 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,6 +106,9 @@ endif() + + install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT tinyxml2_headers) + ++if(CMAKE_BUILD_TYPE MATCHES Debug) ++ set(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++endif() + configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT tinyxml2_config) + +diff --git a/tinyxml2.pc.in b/tinyxml2.pc.in +index b040b0e..b100f60 100644 +--- a/tinyxml2.pc.in ++++ b/tinyxml2.pc.in +@@ -6,5 +6,5 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + Name: TinyXML2 + Description: simple, small, C++ XML parser + Version: @GENERIC_LIB_VERSION@ +-Libs: -L${libdir} -ltinyxml2 ++Libs: -L${libdir} -ltinyxml2@LIB_POSTFIX@ + Cflags: -I${includedir} diff --git a/ports/tinyxml2/fix-symbol-exports.patch b/ports/tinyxml2/fix-symbol-exports.patch new file mode 100644 index 00000000000000..7108d054064e6a --- /dev/null +++ b/ports/tinyxml2/fix-symbol-exports.patch @@ -0,0 +1,36 @@ +From f8b048656b9937252ce5fb4ebea9e5df5b203bdb Mon Sep 17 00:00:00 2001 +From: Owen Rudge +Date: Wed, 27 May 2020 09:40:59 +0100 +Subject: [PATCH] cmake: Don't export symbols if building static library + +--- + CMakeLists.txt | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f9ab07..67b4f33 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,10 +50,16 @@ set(CMAKE_DEBUG_POSTFIX "d") + + add_library(tinyxml2 tinyxml2.cpp tinyxml2.h) + +-set_target_properties(tinyxml2 PROPERTIES ++if(BUILD_SHARED_LIBS) ++ set_target_properties(tinyxml2 PROPERTIES + COMPILE_DEFINITIONS "TINYXML2_EXPORT" +- VERSION "${GENERIC_LIB_VERSION}" +- SOVERSION "${GENERIC_LIB_SOVERSION}") ++ VERSION "${GENERIC_LIB_VERSION}" ++ SOVERSION "${GENERIC_LIB_SOVERSION}") ++else() ++ set_target_properties(tinyxml2 PROPERTIES ++ VERSION "${GENERIC_LIB_VERSION}" ++ SOVERSION "${GENERIC_LIB_SOVERSION}") ++endif() + + target_compile_definitions(tinyxml2 PUBLIC $<$:TINYXML2_DEBUG>) + +-- +2.25.1.windows.1 + diff --git a/ports/tinyxml2/portfile.cmake b/ports/tinyxml2/portfile.cmake index dca3eedb16d77b..d4fb1c3f97f260 100644 --- a/ports/tinyxml2/portfile.cmake +++ b/ports/tinyxml2/portfile.cmake @@ -1,11 +1,12 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO leethomason/tinyxml2 - REF 9c740e8d2341bd46dbe8e87053cdb4d931971967 # 7.1.0 - SHA512 a0e9634875f4c5f426f41510040b9f078af24adf176d2daf3cb3343d629b8068f3a1841df80a06d977bd19e3acaaa3736719a900754c1fe675631f3337820130 + REF 8.0.0 + SHA512 bcbb065c2af34ea681ec556377fd22e720b6f5d4caa73f432b1e34e08603a96f2233763f0ec5ae86b9ee71ddbe3062f58d3794cd3a162ce6903435530de0bba6 HEAD_REF master + PATCHES + fix-symbol-exports.patch + fix-debug-postfix.patch ) vcpkg_configure_cmake( @@ -16,14 +17,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/tinyxml2) +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY - ${SOURCE_PATH}/readme.md - DESTINATION ${CURRENT_PACKAGES_DIR}/share/tinyxml2 -) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/tinyxml2/readme.md ${CURRENT_PACKAGES_DIR}/share/tinyxml2/copyright) +file(INSTALL ${SOURCE_PATH}/readme.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/tomlplusplus/CONTROL b/ports/tomlplusplus/CONTROL new file mode 100644 index 00000000000000..7ac41ccf3ad0f6 --- /dev/null +++ b/ports/tomlplusplus/CONTROL @@ -0,0 +1,5 @@ +Source: tomlplusplus +Version: 1.3.0-3 +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..604d44d43e7e99 --- /dev/null +++ b/ports/tomlplusplus/portfile.cmake @@ -0,0 +1,24 @@ +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 v1.3.0 + SHA512 3c758c59f4bddfc646b596c358909f37c35d3e7200bd04663bf8c6493c2f64797352dd8a788e68bcc1a785fa41ac2dfc5621bf5328018748bdc3c5cea621b3bc + 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 4d0473c723bf67..483508089e66e3 100644 --- a/ports/tool-meson/CONTROL +++ b/ports/tool-meson/CONTROL @@ -1,3 +1,4 @@ Source: tool-meson -Version: 0.53.2 +Version: 0.54.2 +Homepage: https://github.com/mesonbuild/meson Description: Meson build system diff --git a/ports/trantor/CONTROL b/ports/trantor/CONTROL new file mode 100644 index 00000000000000..7bb7c4e7e087cf --- /dev/null +++ b/ports/trantor/CONTROL @@ -0,0 +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 diff --git a/ports/trantor/portfile.cmake b/ports/trantor/portfile.cmake new file mode 100644 index 00000000000000..aa5758d5121d90 --- /dev/null +++ b/ports/trantor/portfile.cmake @@ -0,0 +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() 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/uchardet/CONTROL b/ports/uchardet/CONTROL new file mode 100644 index 00000000000000..587f25d6826809 --- /dev/null +++ b/ports/uchardet/CONTROL @@ -0,0 +1,8 @@ +Source: uchardet +Version: 2020-04-26 +Description: An encoding detector library ported from Mozilla +Homepage: https://cgit.freedesktop.org/uchardet/uchardet/ + +Feature: tool +Description: Build uchardet CLI tool +Build-Depends: getopt diff --git a/ports/uchardet/portfile.cmake b/ports/uchardet/portfile.cmake new file mode 100644 index 00000000000000..281dec77dad354 --- /dev/null +++ b/ports/uchardet/portfile.cmake @@ -0,0 +1,56 @@ +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://gitlab.freedesktop.org/uchardet/uchardet + REF 8681fc060ea07f646434cd2d324e4a5aa7c495c4 +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tool BUILD_BINARY +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) + +if(VCPKG_TARGET_IS_UWP) + # uchardet calls `fopen` and `strdup`, which makes UWP unhappy. + set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE") + set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DBUILD_BINARY=OFF + OPTIONS_RELEASE + ${FEATURE_OPTIONS} + OPTIONS + -DBUILD_STATIC=${BUILD_STATIC} +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +if(tool IN_LIST FEATURES) + file(COPY + ${CURRENT_PACKAGES_DIR}/bin/uchardet${VCPKG_TARGET_EXECUTABLE_SUFFIX} + DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT} + ) + + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/uchardet${VCPKG_TARGET_EXECUTABLE_SUFFIX}) +endif() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/share/man +) + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/umock-c/CONTROL b/ports/umock-c/CONTROL index 540e2a3cfa62b0..44d5842b0eb56a 100644 --- a/ports/umock-c/CONTROL +++ b/ports/umock-c/CONTROL @@ -1,6 +1,7 @@ Source: umock-c -Version: 2020-02-04.1 +Version: 2020-06-17-1 Description: A pure C mocking library +Homepage: https://github.com/Azure/umock-c Build-Depends: azure-macro-utils-c Feature: public-preview diff --git a/ports/umock-c/portfile.cmake b/ports/umock-c/portfile.cmake index 815a46547a594a..71fb57c1d75869 100644 --- a/ports/umock-c/portfile.cmake +++ b/ports/umock-c/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) if("public-preview" IN_LIST FEATURES) @@ -14,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/umock-c - REF 5e3d93112360ee2d4a622b1c48eb70896da3e8c7 - SHA512 9f5c0ce782f66a41e702e2d54dcff92b07b30e7c2be0ee2c63a56e2bff0c26a1de7f77abcb2a964d668deea817dcb3a4771e328707c2d982c23526465c950608 + REF 504193e65d1c2f6eb50c15357167600a296df7ff + SHA512 68d5d986314dbd46d20de2a9b9454154c11675c25d1b5a5b1cfecdd0c0945d9dc68d0348ec1dbb00b5d1a6a1f0356121ba561d7c8fffb97ab37864edade5a85b HEAD_REF master ) endif() @@ -35,7 +33,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/umock_c) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -configure_file(${SOURCE_PATH}/readme.md ${CURRENT_PACKAGES_DIR}/share/umock-c/copyright COPYONLY) +configure_file(${SOURCE_PATH}/readme.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() diff --git a/ports/unicorn-lib/CONTROL b/ports/unicorn-lib/CONTROL index ff66a29254c2fa..d186705cff45bc 100644 --- a/ports/unicorn-lib/CONTROL +++ b/ports/unicorn-lib/CONTROL @@ -1,5 +1,5 @@ Source: unicorn-lib -Version: 2019-07-11 +Version: 2020-03-02 Homepage: https://github.com/CaptainCrowbar/unicorn-lib Description: Unicode library for C++ by Ross Smith Build-Depends: rs-core-lib, pcre2, zlib, libiconv diff --git a/ports/unicorn-lib/portfile.cmake b/ports/unicorn-lib/portfile.cmake index 6584a4d2247d4b..dfdc82bcacfac4 100644 --- a/ports/unicorn-lib/portfile.cmake +++ b/ports/unicorn-lib/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) message("unicorn-lib is a static library, now build with static.") set(VCPKG_LIBRARY_LINKAGE static) @@ -8,8 +6,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CaptainCrowbar/unicorn-lib - REF ba11f5930dbeb5f8e04b2ee727b6dd3932fd6b03 - SHA512 2b1c8f12c3d29bfcff7209763000f2b9db612cefd384d9f015cc07a1ebeb498ba3e8b13dba4d94a86828d3f7eafc17eede21be9926080426f0417d3ad2cee396 + REF 01cc7fcd2d60dbc083767d448477638e5ec8b92a # 2020-03-02 + SHA512 d8ffb80c589b34d850a507570d7d8ec707a6a23b469d484f47c80566883bd4883da23a4701434f361231a7615065ff5f1e42e40c028975f43f198c307353ec9d HEAD_REF master ) @@ -28,4 +26,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/unicorn-lib 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/units/CONTROL b/ports/units/CONTROL index 21c7f44b13153c..b8d75b23099ce6 100644 --- a/ports/units/CONTROL +++ b/ports/units/CONTROL @@ -1,4 +1,4 @@ Source: units -Version: 2.3.0 +Version: 2.3.1 Homepage: https://github.com/nholthaus/units Description: A compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies. diff --git a/ports/units/portfile.cmake b/ports/units/portfile.cmake index 910626f6d9e2b5..4d1d281c0d0456 100644 --- a/ports/units/portfile.cmake +++ b/ports/units/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nholthaus/units - REF v2.3.0 - SHA512 1b9d7806e82d0f437574562e647077b6d22c0add81a19b5ec71f53ab608642db2d785a70d03d13cb2eeea2a8bc2d20f112b6bdf49acf0afce44e8e07bb6b7c39 + REF v2.3.1 + SHA512 1ec9e4d7d60f073ad82a02116f16b9dda57406a3b22a5b06d34f9e5a4df8fd20cc28fc7acfd8fc33054718e0efca3973df0424563f7e1833687a6c1696b9c340 ) vcpkg_configure_cmake( @@ -16,9 +14,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # Handle copyright/readme/package files -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/units RENAME copyright) -file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/units) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/unitsConfig.cmake ${CURRENT_PACKAGES_DIR}/share/units/unitsConfig.cmake) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) # remove uneeded directories file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) diff --git a/ports/unixodbc/CONTROL b/ports/unixodbc/CONTROL index c82960153e6e03..8ff0ce87b86619 100644 --- a/ports/unixodbc/CONTROL +++ b/ports/unixodbc/CONTROL @@ -1,5 +1,5 @@ Source: unixodbc -Version: 2.3.7 +Version: 2.3.7-1 Homepage: https://github.com/lurcher/unixODBC Description: unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux, Mac OSX, and UNIX Supports: (osx|linux) diff --git a/ports/unixodbc/portfile.cmake b/ports/unixodbc/portfile.cmake index 31cdf33e858f6c..4ae0fd149010a0 100644 --- a/ports/unixodbc/portfile.cmake +++ b/ports/unixodbc/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG + COPY_SOURCE ) vcpkg_install_make() diff --git a/ports/uriparser/CONTROL b/ports/uriparser/CONTROL index af57f871a0d2e5..c86313339002a8 100644 --- a/ports/uriparser/CONTROL +++ b/ports/uriparser/CONTROL @@ -1,5 +1,5 @@ Source: uriparser -Version: 0.9.3-4 +Version: 0.9.3-5 Homepage: https://github.com/uriparser/uriparser Description: uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C89 ("ANSI C"). uriparser is cross-platform, fast, supports Unicode, and is licensed under the New BSD license. diff --git a/ports/uriparser/portfile.cmake b/ports/uriparser/portfile.cmake index aafd0ae6a4d0c7..5082d7e9bdffbe 100644 --- a/ports/uriparser/portfile.cmake +++ b/ports/uriparser/portfile.cmake @@ -31,21 +31,10 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if(URIPARSER_BUILD_TOOLS) - if(CMAKE_HOST_WIN32) - set(EXECUTABLE_SUFFIX ".exe") - else() - set(EXECUTABLE_SUFFIX "") - endif() - - file(COPY ${CURRENT_PACKAGES_DIR}/bin/uriparse${EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/uriparse${EXECUTABLE_SUFFIX}) - endif() + vcpkg_copy_tools( + TOOL_NAMES uriparse + AUTO_CLEAN + ) endif() set(_package_version_re "#define[ ]+PACKAGE_VERSION[ ]+\"([0-9]+.[0-9]+.[0-9]+)\"") diff --git a/ports/usd/CONTROL b/ports/usd/CONTROL index 89a63301c6ae1c..59df24ec36742f 100644 --- a/ports/usd/CONTROL +++ b/ports/usd/CONTROL @@ -1,4 +1,5 @@ Source: usd -Version: 20.02 +Version: 20.02-1 Build-Depends: boost-assign, boost-crc, boost-date-time, boost-filesystem, boost-format, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-vmd, tbb, zlib Description: Universal Scene Description (USD) is an efficient, scalable system for authoring, reading, and streaming time-sampled scene description for interchange between graphics applications. +Supports: !x86 diff --git a/ports/usd/fix-build-error.patch b/ports/usd/fix-build-error.patch new file mode 100644 index 00000000000000..b13fa69725120c --- /dev/null +++ b/ports/usd/fix-build-error.patch @@ -0,0 +1,13 @@ +diff --git a/pxr/usd/ar/packageUtils.cpp b/pxr/usd/ar/packageUtils.cpp +index d497587..ed3df29 100644 +--- a/pxr/usd/ar/packageUtils.cpp ++++ b/pxr/usd/ar/packageUtils.cpp +@@ -29,6 +29,8 @@ + #include "pxr/base/tf/pathUtils.h" + #include "pxr/base/tf/stringUtils.h" + ++#include ++ + PXR_NAMESPACE_OPEN_SCOPE + + namespace diff --git a/ports/usd/portfile.cmake b/ports/usd/portfile.cmake index 8719dd05d0dae9..e6cbfaba8bf166 100644 --- a/ports/usd/portfile.cmake +++ b/ports/usd/portfile.cmake @@ -1,14 +1,16 @@ +vcpkg_fail_port_install(ON_ARCH "x86") + # Don't file if the bin folder exists. We need exe and custom files. SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO PixarAnimationStudios/USD REF be1a80f8cb91133ac75e1fc2a2e1832cd10d91c8 # v20.02 SHA512 12c7cf7e5320b168ddde870b1a68b482515b33bd29206c4f6cbb248b9071b866c47353bf496890e01950abb5f725157eca576f9dc403e15020474f9a653b43fe HEAD_REF master + PATCHES + fix-build-error.patch ) vcpkg_find_acquire_program(PYTHON2) diff --git a/ports/utf8h/CONTROL b/ports/utf8h/CONTROL index 5f1acf4c0395d7..31b21a88fa72e7 100644 --- a/ports/utf8h/CONTROL +++ b/ports/utf8h/CONTROL @@ -1,3 +1,4 @@ Source: utf8h -Version: 841cb2deb8eb806e73fff0e1f43a11fca4f5da45 +Version: 2020-06-14 +Homepage: https://github.com/sheredom/utf8.h Description: Single header utf8 string functions for C and C++ diff --git a/ports/utf8h/portfile.cmake b/ports/utf8h/portfile.cmake index 11b35c21a378b3..e8167fe466f752 100644 --- a/ports/utf8h/portfile.cmake +++ b/ports/utf8h/portfile.cmake @@ -1,15 +1,11 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO sheredom/utf8.h - REF 841cb2deb8eb806e73fff0e1f43a11fca4f5da45 - SHA512 cce44011abc58556c031c0de1018b83225bdbbc0e8d7374e3fd6f0b63c8e200086c49e7caac61b559f1e6d5a7ad349a58a13876a1b1341c18349a5cee59a105b + REF 817789676b1c3ac9b117a0f9e04378d3e33a79be + SHA512 3e8455cbc03fa02b1f6f87832c89104510012e8dda968fd56ad5661ffb1c40498e59ea7b65f41f551233f28ee526974086efad3dd767bf944844a3ffede04e1d HEAD_REF master ) -# Copy the utf8h header files file(COPY ${SOURCE_PATH}/utf8.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/utf8h) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/utf8h RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/utfcpp/CONTROL b/ports/utfcpp/CONTROL index fd18722416cdac..52ad1c04ee344b 100644 --- a/ports/utfcpp/CONTROL +++ b/ports/utfcpp/CONTROL @@ -1,4 +1,4 @@ Source: utfcpp -Version: 3.1 +Version: 3.1.1 Homepage: https://github.com/nemtrif/utfcpp Description: UTF-8 with C++ in a Portable Way diff --git a/ports/utfcpp/portfile.cmake b/ports/utfcpp/portfile.cmake index bbbfe663fa1d12..e46077bb751614 100644 --- a/ports/utfcpp/portfile.cmake +++ b/ports/utfcpp/portfile.cmake @@ -1,16 +1,11 @@ -#header-only library -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nemtrif/utfcpp - REF v3.1 - SHA512 826ac7aa61215ac2144fa3f5edc7f291c3dd25dc69b0c82526840f4651f822515ec262915e1117d975e5c5dd729f6166806a5d397262f59a2b323eb7009671f5 + REF v3.1.1 + SHA512 720e2eba5c04f0bc4903a287138149a9cd432bc68bb163fe36b2e0d26d8bf616b4665f389b4a9c97af6ae7869e78973d97db976a4745512a241eebf774608997 HEAD_REF master ) -# Put the licence file where vcpkg expects it -file(INSTALL ${SOURCE_PATH}/source/utf8.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/utfcpp RENAME copyright) - -# Copy the utf8-cpp header files file(COPY ${SOURCE_PATH}/source/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/source/utf8.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/uthenticode/CONTROL b/ports/uthenticode/CONTROL new file mode 100644 index 00000000000000..eeb4edfa00a031 --- /dev/null +++ b/ports/uthenticode/CONTROL @@ -0,0 +1,6 @@ +Source: uthenticode +Version: 1.0.4 +Description: A cross-platform library for verifying Authenticode signatures +Homepage: https://github.com/trailofbits/uthenticode +Supports: !uwp +Build-Depends: pe-parse, openssl diff --git a/ports/uthenticode/portfile.cmake b/ports/uthenticode/portfile.cmake new file mode 100644 index 00000000000000..236d72bf20dfa7 --- /dev/null +++ b/ports/uthenticode/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO trailofbits/uthenticode + REF v1.0.4 + SHA512 82d5ff61071adefec886a140d253b733cb2318ccf34e831087973b05f7e274b207031e606303f65269a5ed1b45c3c599d79e217cf6229d60c8cc2396e842f32e + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/uthenticode TARGET_PATH share/uthenticode) + +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/uwebsockets/CONTROL b/ports/uwebsockets/CONTROL index f9f1c8c05905c2..a839725b2c5c42 100644 --- a/ports/uwebsockets/CONTROL +++ b/ports/uwebsockets/CONTROL @@ -1,5 +1,5 @@ Source: uwebsockets -Version: 0.17.2 +Version: 18.1.0 Build-Depends: zlib, usockets Homepage: https://github.com/uWebSockets/uWebSockets Description: Simple, secure & standards compliant web I/O for the most demanding of applications diff --git a/ports/uwebsockets/portfile.cmake b/ports/uwebsockets/portfile.cmake index e7a4104a11ed85..af5542f952d1a1 100644 --- a/ports/uwebsockets/portfile.cmake +++ b/ports/uwebsockets/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO uNetworking/uWebSockets - REF 7313e0168d1044b77ff262d398ae5669eb64b130 # v0.17.2 - SHA512 02888ebe3e678c9ba0d072543cb04041cc72881074a0feb05eaef3d9eb570c4b4cc4319d3b5ccdd3eca8bc93946aa0669edcbc1508fb03153251f3a1b629cfac + REF 025415d1a0174cf581b481fd2b3f155241a1265b # v18.1.0 + SHA512 e094f1c8b3d0361c5a36c9a911e8431f19567d42db0c520ef1888db1d5f12e0103c7a554d7f7117648ed9b7bc1ceb104cd2f7ce7867153e220d2c4bf9cba7907 HEAD_REF master ) diff --git a/ports/v-hacd/CMakeLists.txt b/ports/v-hacd/CMakeLists.txt new file mode 100644 index 00000000000000..f4451ecaa89c29 --- /dev/null +++ b/ports/v-hacd/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR) + +project(VHACD) + +# Determine if VHACD is built as a subproject (using add_subdirectory) +# or if it is the master project. +set(MASTER_PROJECT OFF) +if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + set(MASTER_PROJECT ON) + message(STATUS "CMake version: ${CMAKE_VERSION}") +endif () + +option(NO_OPENCL "NO_OPENCL" OFF) +option(NO_OPENMP "NO_OPENMP" OFF) + +message("NO_OPENCL " ${NO_OPENCL}) +message("NO_OPENMP " ${NO_OPENMP}) + +add_subdirectory(src) \ No newline at end of file diff --git a/ports/v-hacd/CONTROL b/ports/v-hacd/CONTROL new file mode 100644 index 00000000000000..533ea6e0974cf1 --- /dev/null +++ b/ports/v-hacd/CONTROL @@ -0,0 +1,12 @@ +Source: v-hacd +Version: 3.2.0 +Homepage: https://github.com/kmammou/v-hacd +Description: The V-HACD library decomposes a 3D surface into a set of "near" convex parts. +Supports: !arm + +Feature: opencl +Description: Builds opencl enabled lib +Build-Depends: opencl + +Feature: openmp +Description: Builds openmp enabled lib diff --git a/ports/v-hacd/fix-cmake.patch b/ports/v-hacd/fix-cmake.patch new file mode 100644 index 00000000000000..17ee4bbeb700b1 --- /dev/null +++ b/ports/v-hacd/fix-cmake.patch @@ -0,0 +1,126 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2bbb283..2f7eb52 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,12 +1 @@ +-cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) +-project(VHACD) +-option(NO_OPENCL "NO_OPENCL" OFF) +-option(NO_OPENMP "NO_OPENMP" OFF) +- +-message("NO_OPENCL " ${NO_OPENCL}) +-message("NO_OPENMP " ${NO_OPENMP}) +- +-#set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/output" CACHE PATH "project install prefix" FORCE) +-set(CMAKE_COMMON_INC "${CMAKE_SOURCE_DIR}/../scripts/cmake_common.cmake") +-add_subdirectory ("${CMAKE_SOURCE_DIR}/VHACD_Lib") +-add_subdirectory ("${CMAKE_SOURCE_DIR}/test") ++add_subdirectory ("${CMAKE_CURRENT_SOURCE_DIR}/VHACD_Lib") +\ No newline at end of file +diff --git a/src/VHACD_Lib/CMakeLists.txt b/src/VHACD_Lib/CMakeLists.txt +index 46fc1b1..2260fdc 100644 +--- a/src/VHACD_Lib/CMakeLists.txt ++++ b/src/VHACD_Lib/CMakeLists.txt +@@ -1,34 +1,36 @@ ++cmake_minimum_required(VERSION 3.10.0) ++ + project(VHACD_LIB CXX C) +-include(${CMAKE_COMMON_INC}) ++include("${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/cmake_common.cmake") ++ ++set(CMAKE_CXX_STANDARD 11) + +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") ++set(LIB_TYPE "STATIC" CACHE STRING "STATIC, SHARED or MODULE?") ++message("[VHACD] \t LIB_TYPE " ${LIB_TYPE}) ++add_library(vhacd ${LIB_TYPE} ${PROJECT_CPP_FILES} ${PROJECT_C_FILES} ${PROJECT_INC_FILES} ${PROJECT_INL_FILES} ${PROJECT_CL_FILES}) + + if (NOT NO_OPENCL) + #include(FindOpenCL OPTIONAL) +- find_package(OpenCL) ++ find_package(OpenCL REQUIRED) + endif() + if (NOT NO_OPENMP) + #include(FindOpenMP OPTIONAL) +- find_package(OpenMP) ++ find_package(OpenMP REQUIRED) + endif() + if(OPENMP_FOUND) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") ++ target_link_libraries(vhacd PRIVATE OpenMP::OpenMP_CXX) + endif() +-set(LIB_TYPE "STATIC" CACHE STRING "STATIC, SHARED or MODULE?") +-message("[VHACD] \t LIB_TYPE " ${LIB_TYPE}) +-add_library(vhacd ${LIB_TYPE} ${PROJECT_CPP_FILES} ${PROJECT_C_FILES} ${PROJECT_INC_FILES} ${PROJECT_INL_FILES} ${PROJECT_CL_FILES}) + + if (OpenCL_FOUND) +- target_include_directories(vhacd PRIVATE "${OpenCL_INCLUDE_DIR}") +- target_link_libraries(vhacd PRIVATE "${OpenCL_LIBRARY}") ++ target_link_libraries(vhacd PRIVATE OpenCL::OpenCL) + target_compile_definitions(vhacd PRIVATE -DOPENCL_FOUND=1 ) + target_compile_definitions(vhacd PRIVATE -DOPENCL_CL_FILES="${PROJECT_CL_FILES}" ) + endif() + +- + target_include_directories(vhacd PUBLIC ++ $) ++ ++target_include_directories(vhacd PRIVATE + $ + $ # /include/mylib + ) +@@ -43,32 +45,32 @@ install(FILES ${PROJECT_INL_FILES} DESTINATION include) + set(VHACD_LIB_VERSION 3.2.0) + include(CMakePackageConfigHelpers) + write_basic_package_version_file( +- "${CMAKE_CURRENT_BINARY_DIR}/vhacd/vhacd-config-version.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/vhacd/v-hacd-config-version.cmake" + VERSION ${VHACD_LIB_VERSION} + COMPATIBILITY AnyNewerVersion + ) + +-export(EXPORT vhacd-targets NAMESPACE :: +- FILE "${CMAKE_CURRENT_BINARY_DIR}/vhacd/vhacd-targets.cmake" ++export(EXPORT vhacd-targets NAMESPACE vhacd:: ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/vhacd/v-hacd-targets.cmake" + ) + + configure_file(cmake/vhacd-config.cmake +- "${CMAKE_CURRENT_BINARY_DIR}/vhacd/vhacd-config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/vhacd/v-hacd-config.cmake" + COPYONLY + ) + + set(ConfigPackageLocation lib/cmake/vhacd) + install(EXPORT vhacd-targets + FILE +- vhacd-targets.cmake ++ v-hacd-targets.cmake + DESTINATION + ${ConfigPackageLocation} +- NAMESPACE :: ++ NAMESPACE vhacd:: + ) + install( + FILES +- "${CMAKE_CURRENT_BINARY_DIR}/vhacd/vhacd-config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/vhacd/vhacd-config-version.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/vhacd/v-hacd-config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/vhacd/v-hacd-config-version.cmake" + DESTINATION + ${ConfigPackageLocation} + COMPONENT +diff --git a/src/VHACD_Lib/cmake/vhacd-config.cmake b/src/VHACD_Lib/cmake/vhacd-config.cmake +index 8fc5c58..7677f58 100644 +--- a/src/VHACD_Lib/cmake/vhacd-config.cmake ++++ b/src/VHACD_Lib/cmake/vhacd-config.cmake +@@ -1,4 +1,4 @@ + + find_package(OpenCL) + find_package(OpenMP) +-include("${CMAKE_CURRENT_LIST_DIR}/vhacd-targets.cmake") +\ No newline at end of file ++include("${CMAKE_CURRENT_LIST_DIR}/v-hacd-targets.cmake") +\ No newline at end of file diff --git a/ports/v-hacd/portfile.cmake b/ports/v-hacd/portfile.cmake new file mode 100644 index 00000000000000..3e4cdefa32a2de --- /dev/null +++ b/ports/v-hacd/portfile.cmake @@ -0,0 +1,47 @@ +vcpkg_fail_port_install(ON_ARCH "arm") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO kmammou/v-hacd + REF 1a49edf29c69039df15286181f2f27e17ceb9aef + SHA512 14157e5fd9cbfeb44735dc2952d7b4f43337ea2243f3b690125dda27e3bb8328cc38050415c7150cf11fbd85c5258c3aaa8899f306ce118f78a4d5e6139ef0f0 + HEAD_REF master + PATCHES + fix-cmake.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(LIB_TYPE "SHARED") +else() + set(LIB_TYPE "STATIC") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + openmp NO_OPENMP + opencl NO_OPENCL +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DLIB_TYPE=${LIB_TYPE} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/vhacd) + +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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/vs-yasm/CONTROL b/ports/vs-yasm/CONTROL new file mode 100644 index 00000000000000..68f7328a9c02e4 --- /dev/null +++ b/ports/vs-yasm/CONTROL @@ -0,0 +1,5 @@ +Source: vs-yasm +Version: 0.5.0 +Homepage: https://github.com/ShiftMediaProject/VSYASM +Description: Provides Visual Studio integration for the YASM assembler. +Supports: windows & !arm \ No newline at end of file diff --git a/ports/vs-yasm/portfile.cmake b/ports/vs-yasm/portfile.cmake new file mode 100644 index 00000000000000..341f66ca510990 --- /dev/null +++ b/ports/vs-yasm/portfile.cmake @@ -0,0 +1,19 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ShiftMediaProject/VSYASM + REF deb50d9f18e8461538468339d508cdf240e64897 #v0.5 + SHA512 04627546020d33e5ea91f74b09c5ce3b817dce5f6ae4548c3b4148daa82fbd837c81675ac8730d3ca1cdf91fefa8bb23eec76d1bcd02c03dda1203d0c261178d + HEAD_REF master +) + +set(_files yasm.props yasm.targets yasm.xml) +foreach(_file ${_files}) + file(INSTALL "${SOURCE_PATH}/${_file}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/") +endforeach() +set(_file "${CURRENT_PACKAGES_DIR}/share/${PORT}/yasm.props") +file(READ "${_file}" _contents) +string(REPLACE "$(VCInstallDir)" "" _contents "${_contents}") +file(WRITE "${_file}" "${_contents}") + +configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) \ No newline at end of file diff --git a/ports/vtk-dicom/CONTROL b/ports/vtk-dicom/CONTROL index 2041f21e18da3a..e8e3494d8e6b6b 100644 --- a/ports/vtk-dicom/CONTROL +++ b/ports/vtk-dicom/CONTROL @@ -1,7 +1,8 @@ Source: vtk-dicom -Version: 0.8.12 +Version: 0.8.12-1 Description: DICOM for VTK -Build-Depends: vtk, zlib +Homepage: https://github.com/dgobbi/vtk-dicom +Build-Depends: vtk[core], zlib Feature: gdcm Description: Use gdcm for decompressing DICOM files. diff --git a/ports/vtk-dicom/portfile.cmake b/ports/vtk-dicom/portfile.cmake index bd137e61eb3510..171a046a26fbb0 100644 --- a/ports/vtk-dicom/portfile.cmake +++ b/ports/vtk-dicom/portfile.cmake @@ -1,11 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO dgobbi/vtk-dicom REF 5034c68450de857b70fbe4a4b9f8dddb62badef3 # v0.8.12 SHA512 bad1ed6a4a412402a2cd69e5f85b2b73f1ee7ea46a6bbcac31c5f66d07ae006679ffbd9a3c70f9baa1b05b1af0a2d4ca0efc34ec0a85a92f5116b900e81635cd HEAD_REF master + PATCHES std.patch # similar patch is already in master ) if ("gdcm" IN_LIST FEATURES) @@ -21,22 +20,23 @@ if(USE_GDCM) -DUSE_DCMTK=OFF ) endif() - +vcpkg_find_acquire_program(PYTHON3) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF + "-DPython3_EXECUTABLE=${PYTHON3}" ${ADDITIONAL_OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(COPY ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/vtk-dicom) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/vtk-dicom/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/vtk-dicom/copyright) +file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/vtk-dicom/std.patch b/ports/vtk-dicom/std.patch new file mode 100644 index 00000000000000..59160f089b7b7c --- /dev/null +++ b/ports/vtk-dicom/std.patch @@ -0,0 +1,74 @@ +diff --git a/Source/vtkScancoCTReader.cxx b/Source/vtkScancoCTReader.cxx +index a71f2e46e..afe202ffc 100644 +--- a/Source/vtkScancoCTReader.cxx ++++ b/Source/vtkScancoCTReader.cxx +@@ -176,7 +176,7 @@ int vtkScancoCTReader::CheckVersion(const char header[16]) + //---------------------------------------------------------------------------- + int vtkScancoCTReader::CanReadFile(const char *filename) + { +- ifstream infile(filename, ios::in | ios::binary); ++ std::ifstream infile(filename, ios::in | ios::binary); + + bool canRead = false; + if (infile.good()) +@@ -409,7 +409,7 @@ void vtkScancoCTReader::StripString(char *dest, const char *cp, size_t l) + } + + //---------------------------------------------------------------------------- +-int vtkScancoCTReader::ReadISQHeader(ifstream *file, unsigned long bytesRead) ++int vtkScancoCTReader::ReadISQHeader(std::ifstream *file, unsigned long bytesRead) + { + if (bytesRead < 512) + { +@@ -620,7 +620,7 @@ int vtkScancoCTReader::ReadISQHeader(ifstream *file, unsigned long bytesRead) + } + + //---------------------------------------------------------------------------- +-int vtkScancoCTReader::ReadAIMHeader(ifstream *file, unsigned long bytesRead) ++int vtkScancoCTReader::ReadAIMHeader(std::ifstream *file, unsigned long bytesRead) + { + if (bytesRead < 160) + { +@@ -987,7 +987,7 @@ int vtkScancoCTReader::RequestInformation( + const char *ufilename = filename; + #endif + +- ifstream infile(ufilename, ios::in | ios::binary); ++ std::ifstream infile(ufilename, ios::in | ios::binary); + if (!infile.good()) + { + vtkErrorMacro("Cannot open file " << filename); +@@ -1115,7 +1115,7 @@ int vtkScancoCTReader::RequestData( + static_cast(data->GetScalarPointer()); + + // open the file +- ifstream infile(filename, ios::in | ios::binary); ++ std::ifstream infile(filename, ios::in | ios::binary); + if (!infile.good()) + { + vtkErrorMacro("Cannot open file " << filename); +diff --git a/Source/vtkScancoCTReader.h b/Source/vtkScancoCTReader.h +index ca31d7572..240d532f2 100644 +--- a/Source/vtkScancoCTReader.h ++++ b/Source/vtkScancoCTReader.h +@@ -34,6 +34,7 @@ + #ifndef vtkScancoCTReader_h + #define vtkScancoCTReader_h + ++#include + #include "vtkImageReader2.h" + #include "vtkDICOMModule.h" // For export macro + #include "vtkDICOMConfig.h" // For configuration details +@@ -185,10 +186,10 @@ protected: + void InitializeHeader(); + + //! Read an ISQ header. +- int ReadISQHeader(ifstream *file, unsigned long bytesRead); ++ int ReadISQHeader(std::ifstream *file, unsigned long bytesRead); + + //! Read AIM header. +- int ReadAIMHeader(ifstream *file, unsigned long bytesRead); ++ int ReadAIMHeader(std::ifstream *file, unsigned long bytesRead); + + //! Check the file header to see what type of file it is. + /*! diff --git a/ports/vtk-m/CONTROL b/ports/vtk-m/CONTROL new file mode 100644 index 00000000000000..6fe2933c298fcf --- /dev/null +++ b/ports/vtk-m/CONTROL @@ -0,0 +1,23 @@ +Source: vtk-m +Version: 1.5.0 +Homepage: https://gitlab.kitware.com/vtk/vtk-m/ +Description: VTK-m is a toolkit of scientific visualization algorithms for emerging processor architectures. +Supports: x64 & !uwp + +Feature: cuda +Description: Use the NVIDIA CUDA device adapter. +Build-Depends: cuda + +Feature: omp +Description: Use the OpenMP device adapter. + +Feature: tbb +Description: Use the Intel TBB device adapter. +Build-Depends: tbb + +Feature: mpi +Description: Use the MPI controller. +Build-Depends: mpi + +Feature: double +Description: Use double precision in floating point calculations diff --git a/ports/vtk-m/portfile.cmake b/ports/vtk-m/portfile.cmake new file mode 100644 index 00000000000000..658a12d2ea5889 --- /dev/null +++ b/ports/vtk-m/portfile.cmake @@ -0,0 +1,61 @@ +# VENDORED DEPENDENCIES! +# TODO: Should be replaced in the future with VCPKG internal versions +# add_subdirectory(thirdparty/diy) +# add_subdirectory(thirdparty/lodepng) +# if(VTKm_ENABLE_LOGGING) + # add_subdirectory(thirdparty/loguru) +# endif() +# add_subdirectory(thirdparty/optionparser) +# add_subdirectory(thirdparty/taotuple) +# add_subdirectory(thirdparty/lcl) + +vcpkg_check_features (OUT_FEATURE_OPTIONS OPTIONS + FEATURES + cuda VTKm_ENABLE_CUDA + omp VTKm_ENABLE_OPENMP + tbb VTKm_ENABLE_TBB + mpi VTKm_ENABLE_MPI + double VTKm_USE_DOUBLE_PRECISION + ) + +if("cuda" IN_LIST FEATURES AND NOT ENV{CUDACXX}) + set(ENV{CUDACXX} "$ENV{CUDA_PATH}/bin/nvcc") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + message(STATUS "Feature CUDA forces static build!") + endif() + set(VCPKG_LIBRARY_LINKAGE "static") # CUDA forces static build. +endif() + +list(APPEND OPTIONS -DVTKm_ENABLE_RENDERING=ON) +list(APPEND OPTIONS -DVTKm_ENABLE_DEVELOPER_FLAGS=OFF) +list(APPEND OPTIONS -DVTKm_ENABLE_CPACK=OFF) +list(APPEND OPTIONS -DVTKm_USE_DEFAULT_TYPES_FOR_VTK=ON) +# For port customizations on unix systems. +# Please feel free to make these port features if it makes any sense +#list(APPEND OPTIONS -DVTKm_ENABLE_GL_CONTEXT=ON) # or +#list(APPEND OPTIONS -DVTKm_ENABLE_EGL_CONTEXT=ON) # or +#list(APPEND OPTIONS -DVTKm_ENABLE_OSMESA_CONTEXT=ON) +list(APPEND OPTIONS -DBUILD_TESTING=OFF) + +vcpkg_from_gitlab(GITLAB_URL "https://gitlab.kitware.com" + OUT_SOURCE_PATH SOURCE_PATH + REPO vtk/vtk-m + REF f2aa6ad5be1a97e3fb41ef4680ee2c76c3434ac0 # v1.5.0 Version is strongly locked to VTK 9.0. Upgrading will most likly brake the VTK build + SHA512 2f2a273f74d9a583df9e25a4792440d8d89652fa14b3153f2ea5afbd329b50970e7b9bd68e0ccd036baf5c1f3ad7a8302d95c01dbb30d9a46c045987eebf5370) + # For people only wanting vtk-m and not VTK + #REF 74ffad9bd0679d061bc87e544a728f1c3c926269 # v1.5.1 + #SHA512 c9e1c18432b6c11ae086445255acf9477fe4c888122a2b2a9713dc63a40d2e4c2375742157526b5f0869f14c62a4ad66d81ee58d6cc75a1d53a1d615525a03c9) +vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${OPTIONS}) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/vtkm-1.5 TARGET_PATH share/vtkm) + +file(READ ${CURRENT_PACKAGES_DIR}/share/vtkm/VTKmConfig.cmake _contents) +string(REPLACE [[set_and_check(VTKm_CONFIG_DIR "${PACKAGE_PREFIX_DIR}/lib/cmake/vtkm-1.5")]] [[set_and_check(VTKm_CONFIG_DIR "${PACKAGE_PREFIX_DIR}/share/vtkm")]] _contents ${_contents}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtkm/VTKmConfig.cmake ${_contents}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt 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 bf0f64ad71de85..b542a5c47404a3 100644 --- a/ports/vtk/CONTROL +++ b/ports/vtk/CONTROL @@ -1,8 +1,13 @@ Source: vtk -Version: 8.2.0-12 +Version: 9.0.1 +Port-Version: 1 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, libjpeg-turbo, proj4, lz4, libtheora, eigen3, double-conversion, pugixml, libharu, sqlite3, netcdf-c +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 + +Feature: vtkm +Description: Build with vtk-m accelerator and module. +Build-Depends: vtk-m[core] Feature: openvr Description: OpenVR functionality for VTK @@ -10,11 +15,11 @@ Build-Depends: sdl2, openvr Feature: qt Description: Qt functionality for VTK -Build-Depends: qt5 +Build-Depends: qt5-xmlpatterns, qt5-tools, qt5-imageformats, qt5-x11extras (linux) Feature: mpi Description: MPI functionality for VTK -Build-Depends: mpi, hdf5[parallel] +Build-Depends: mpi, hdf5[core, parallel], vtk-m[core,mpi] Feature: python Description: Python functionality for VTK @@ -22,4 +27,20 @@ Build-Depends: python3 Feature: atlmfc Description: Mfc functionality for vtk on Windows -Build-Depends: atlmfc (windows) \ No newline at end of file +Build-Depends: atlmfc (windows) + +Feature: paraview +Description: Build vtk modules required by paraview +Build-Depends: vtk[core, qt], vtk[core, atlmfc] (windows) + +Feature: cuda +Description: Support CUDA compilation +Build-Depends: cuda + +Feature: opengl +Description: All opengl related modules +Build-Depends: vtk[core] + +Feature: all +Description: Build all vtk modules +Build-Depends: libmysql, ffmpeg, gdal, vtk[core, qt, python, mpi], vtk[core, atlmfc] (windows) \ No newline at end of file diff --git a/ports/vtk/FindGDAL.cmake b/ports/vtk/FindGDAL.cmake deleted file mode 100644 index e4f2f303be3bca..00000000000000 --- a/ports/vtk/FindGDAL.cmake +++ /dev/null @@ -1,127 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#.rst: -# FindGDAL -# -------- -# -# -# -# Locate gdal -# -# This module accepts the following environment variables: -# -# :: -# -# GDAL_DIR or GDAL_ROOT - Specify the location of GDAL -# -# -# -# This module defines the following CMake variables: -# -# :: -# -# GDAL_FOUND - True if libgdal is found -# GDAL_LIBRARY - A variable pointing to the GDAL library -# GDAL_INCLUDE_DIR - Where to find the headers - -# -# $GDALDIR is an environment variable that would -# correspond to the ./configure --prefix=$GDAL_DIR -# used in building gdal. -# -# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it -# for osgTerrain so I whipped this module together for completeness. -# I actually don't know the conventions or where files are typically -# placed in distros. -# Any real gdal users are encouraged to correct this (but please don't -# break the OS X framework stuff when doing so which is what usually seems -# to happen). - -# This makes the presumption that you are include gdal.h like -# -#include "gdal.h" - -find_path(GDAL_INCLUDE_DIR gdal.h - HINTS - ENV GDAL_DIR - ENV GDAL_ROOT - PATH_SUFFIXES - include/gdal - include/GDAL - include - PATHS - ~/Library/Frameworks/gdal.framework/Headers - /Library/Frameworks/gdal.framework/Headers - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt -) - -if(UNIX) - # Use gdal-config to obtain the library version (this should hopefully - # allow us to -lgdal1.x.y where x.y are correct version) - # For some reason, libgdal development packages do not contain - # libgdal.so... - find_program(GDAL_CONFIG gdal-config - HINTS - ENV GDAL_DIR - ENV GDAL_ROOT - PATH_SUFFIXES bin - PATHS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt - ) - - if(GDAL_CONFIG) - exec_program(${GDAL_CONFIG} ARGS --libs OUTPUT_VARIABLE GDAL_CONFIG_LIBS) - if(GDAL_CONFIG_LIBS) - string(REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS}) - string(REPLACE "-l" "" _gdal_lib "${_gdal_dashl}") - string(REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS}) - string(REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}") - endif() - endif() -endif() - -find_library(GDAL_LIBRARY_RELEASE - NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL - HINTS - ENV GDAL_DIR - ENV GDAL_ROOT - ${_gdal_libpath} - PATH_SUFFIXES lib - PATHS - /sw - /opt/local - /opt/csw - /opt - /usr/freeware -) - -find_library(GDAL_LIBRARY_DEBUG - NAMES ${_gdal_lib} gdald gdald_i gdald1.5.0 gdald1.4.0 gdald1.3.2 GDALD - HINTS - ENV GDAL_DIR - ENV GDAL_ROOT - ${_gdal_libpath} - PATH_SUFFIXES lib - PATHS - /sw - /opt/local - /opt/csw - /opt - /usr/freeware -) - -include(SelectLibraryConfigurations) -select_library_configurations(GDAL) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR) - -set(GDAL_LIBRARIES ${GDAL_LIBRARY}) -set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR}) diff --git a/ports/vtk/FindHDF5.cmake b/ports/vtk/FindHDF5.cmake new file mode 100644 index 00000000000000..1be15731bf41b9 --- /dev/null +++ b/ports/vtk/FindHDF5.cmake @@ -0,0 +1,23 @@ +#The original VTK file is overdoing it and still prdouces errors that the target hdf5::hdf5_hl-shared cannot be found in dynamic builds +find_package(hdf5 QUIET NO_MODULE) +if(TARGET hdf5::hdf5-shared) + set_target_properties(hdf5::hdf5-shared PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(hdf5::hdf5 ALIAS hdf5::hdf5-shared) +elseif(TARGET hdf5::hdf5-static) + set_target_properties(hdf5::hdf5-static PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(hdf5::hdf5 ALIAS hdf5::hdf5-static) +else() + message(FATAL_ERROR "HDF5 target not found") +endif() +if(TARGET hdf5::hdf5_hl-shared) + set_target_properties(hdf5::hdf5_hl-shared PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(hdf5::hdf5_hl ALIAS hdf5::hdf5_hl-shared) +elseif(TARGET hdf5::hdf5_hl-static) + set_target_properties(hdf5::hdf5_hl-static PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(hdf5::hdf5_hl ALIAS hdf5::hdf5_hl-static) +else() + message(FATAL_ERROR "HDF5 HL target not found") +endif() +set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL} CACHE BOOL "" FORCE) +set(HDF5_FOUND ON CACHE BOOL "" FORCE) +set(hdf5_FOUND ON CACHE BOOL "" FORCE) diff --git a/ports/vtk/FindLZ4.patch b/ports/vtk/FindLZ4.patch new file mode 100644 index 00000000000000..dced8bf56ffd56 --- /dev/null +++ b/ports/vtk/FindLZ4.patch @@ -0,0 +1,47 @@ +diff --git a/CMake/FindLZ4.cmake b/CMake/FindLZ4.cmake +index 8c94e3bcd..ade3f9451 100644 +--- a/CMake/FindLZ4.cmake ++++ b/CMake/FindLZ4.cmake +@@ -1,38 +1,3 @@ +-find_path(LZ4_INCLUDE_DIR +- NAMES lz4.h +- DOC "lz4 include directory") +-mark_as_advanced(LZ4_INCLUDE_DIR) +-find_library(LZ4_LIBRARY +- NAMES lz4 liblz4 +- DOC "lz4 library") +-mark_as_advanced(LZ4_LIBRARY) +- +-if (LZ4_INCLUDE_DIR) +- file(STRINGS "${LZ4_INCLUDE_DIR}/lz4.h" _lz4_version_lines +- REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)") +- string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}") +- string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}") +- string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}") +- set(LZ4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}") +- unset(_lz4_version_major) +- unset(_lz4_version_minor) +- unset(_lz4_version_release) +- unset(_lz4_version_lines) +-endif () +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LZ4 +- REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR +- VERSION_VAR LZ4_VERSION) +- +-if (LZ4_FOUND) +- set(LZ4_INCLUDE_DIRS "${LZ4_INCLUDE_DIR}") +- set(LZ4_LIBRARIES "${LZ4_LIBRARY}") +- +- if (NOT TARGET LZ4::LZ4) +- add_library(LZ4::LZ4 UNKNOWN IMPORTED) +- set_target_properties(LZ4::LZ4 PROPERTIES +- IMPORTED_LOCATION "${LZ4_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}") +- endif () +-endif () ++find_package(LZ4 CONFIG REQUIRED) ++set_target_properties(lz4::lz4 PROPERTIES IMPORTED_GLOBAL TRUE) ++add_library(LZ4::LZ4 ALIAS lz4::lz4) +\ No newline at end of file diff --git a/ports/vtk/FindLZMA.patch b/ports/vtk/FindLZMA.patch new file mode 100644 index 00000000000000..cb7f80963a2916 --- /dev/null +++ b/ports/vtk/FindLZMA.patch @@ -0,0 +1,86 @@ +diff --git a/CMake/FindLZMA.cmake b/CMake/FindLZMA.cmake +index 0c8c7943c..d60669484 100644 +--- a/CMake/FindLZMA.cmake ++++ b/CMake/FindLZMA.cmake +@@ -1,9 +1,17 @@ + find_path(LZMA_INCLUDE_DIR + NAMES lzma.h + DOC "lzma include directory") +-find_library(LZMA_LIBRARY ++# Note LZMA_LIBRARY is set somewhere else. Maybe one of the configs/wrappers installed by VCPKG defines it. ++# The original FindLZMA chokes on it since it contains optimized/debug keywords ++# VTK should probably switch to FindLibLZMA from CMake ++find_library(LZMA_LIBRARY_RELEASE + NAMES lzma + DOC "lzma library") ++find_library(LZMA_LIBRARY_DEBUG ++ NAMES lzmad lzma NAMES_PER_DIR ++ DOC "lzma library") ++ include(SelectLibraryConfigurations) ++ select_library_configurations( LZMA ) + + if (LZMA_INCLUDE_DIR) + file(STRINGS "${LZMA_INCLUDE_DIR}/lzma/version.h" _lzma_version_lines +@@ -20,22 +26,50 @@ endif () + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LZMA +- REQUIRED_VARS LZMA_LIBRARY LZMA_INCLUDE_DIR ++ REQUIRED_VARS LZMA_LIBRARY LZMA_LIBRARY_RELEASE LZMA_LIBRARY_DEBUG LZMA_INCLUDE_DIR + VERSION_VAR LZMA_VERSION) + + if (LZMA_FOUND) + set(LZMA_LIBRARIES "${LZMA_LIBRARY}") + set(LZMA_INCLUDE_DIRS "${LZMA_INCLUDE_DIR}") +- ++ + if (NOT TARGET LZMA::LZMA) + include(vtkDetectLibraryType) +- vtk_detect_library_type(lzma_library_type +- PATH "${LZMA_LIBRARY}") +- add_library(LZMA::LZMA "${lzma_library_type}" IMPORTED) +- unset(lzma_library_type) +- set_target_properties(LZMA::LZMA PROPERTIES +- IMPORTED_LOCATION "${LZMA_LIBRARY}" +- IMPORTED_IMPLIB "${LZMA_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${LZMA_INCLUDE_DIR}") +- endif () ++ if(LZMA_LIBRARY_RELEASE) ++ vtk_detect_library_type(lzma_library_type ++ PATH "${LZMA_LIBRARY_RELEASE}") ++ elseif(LZMA_LIBRARY_DEBUG) ++ vtk_detect_library_type(lzma_library_type ++ PATH "${LZMA_LIBRARY_DEBUG}") ++ else() ++ vtk_detect_library_type(lzma_library_type ++ PATH "${LZMA_LIBRARY}") ++ endif() ++ ++ add_library(LZMA::LZMA "${lzma_library_type}" IMPORTED) ++ set_target_properties(LZMA::LZMA PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${LZMA_INCLUDE_DIR}") ++ if(LZMA_LIBRARY_RELEASE) ++ set_target_properties(LZMA::LZMA PROPERTIES ++ IMPORTED_LOCATION_RELEASE "${LZMA_LIBRARY_RELEASE}" ++ IMPORTED_IMPLIB_RELEASE "${LZMA_LIBRARY_RELEASE}") ++ endif() ++ if(LZMA_LIBRARY_DEBUG) ++ set_target_properties(LZMA::LZMA PROPERTIES ++ IMPORTED_LOCATION_DEBUG "${LZMA_LIBRARY_DEBUG}" ++ IMPORTED_IMPLIB_DEBUG "${LZMA_LIBRARY_DEBUG}") ++ endif() ++ ++ # Guard against possible stupidity of depending projects reading only LOCATION without configuration ++ if(CMAKE_BUILD_TYPE MATCHES "Debug") ++ set_target_properties(LZMA::LZMA PROPERTIES ++ IMPORTED_LOCATION "${LZMA_LIBRARY_DEBUG}" ++ IMPORTED_IMPLIB "${LZMA_LIBRARY_DEBUG}") ++ else() ++ set_target_properties(LZMA::LZMA PROPERTIES ++ IMPORTED_LOCATION "${LZMA_LIBRARY_RELEASE}" ++ IMPORTED_IMPLIB "${LZMA_LIBRARY_RELEASE}") ++ endif() ++ endif() ++ #set_target_properties(LZMA::LZMA PROPERTIES IMPORTED_GLOBAL TRUE) + endif () + \ No newline at end of file diff --git a/ports/vtk/FindPostgreSQL.cmake b/ports/vtk/FindPostgreSQL.cmake new file mode 100644 index 00000000000000..913c8b9ae2653b --- /dev/null +++ b/ports/vtk/FindPostgreSQL.cmake @@ -0,0 +1,269 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindPostgreSQL +-------------- + +Find the PostgreSQL installation. + +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +This module defines :prop_tgt:`IMPORTED` target ``PostgreSQL::PostgreSQL`` +if PostgreSQL has been found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``PostgreSQL_FOUND`` + True if PostgreSQL is found. +``PostgreSQL_LIBRARIES`` + the PostgreSQL libraries needed for linking +``PostgreSQL_INCLUDE_DIRS`` + the directories of the PostgreSQL headers +``PostgreSQL_LIBRARY_DIRS`` + the link directories for PostgreSQL libraries +``PostgreSQL_VERSION_STRING`` + the version of PostgreSQL found +#]=======================================================================] + +# ---------------------------------------------------------------------------- +# History: +# This module is derived from the module originally found in the VTK source tree. +# +# ---------------------------------------------------------------------------- +# Note: +# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the +# version number of the implementation of PostgreSQL. +# In Windows the default installation of PostgreSQL uses that as part of the path. +# E.g C:\Program Files\PostgreSQL\8.4. +# Currently, the following version numbers are known to this module: +# "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0" +# +# To use this variable just do something like this: +# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4") +# before calling find_package(PostgreSQL) in your CMakeLists.txt file. +# This will mean that the versions you set here will be found first in the order +# specified before the default ones are searched. +# +# ---------------------------------------------------------------------------- +# You may need to manually set: +# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are. +# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are. +# If FindPostgreSQL.cmake cannot find the include files or the library files. +# +# ---------------------------------------------------------------------------- +# The following variables are set if PostgreSQL is found: +# PostgreSQL_FOUND - Set to true when PostgreSQL is found. +# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL +# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries +# PostgreSQL_LIBRARIES - The PostgreSQL libraries. +# +# The ``PostgreSQL::PostgreSQL`` imported target is also created. +# +# ---------------------------------------------------------------------------- +# If you have installed PostgreSQL in a non-standard location. +# (Please note that in the following comments, it is assumed that +# points to the root directory of the include directory of PostgreSQL.) +# Then you have three options. +# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to /include and +# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is +# 2) Use CMAKE_INCLUDE_PATH to set a path to /PostgreSQL<-version>. This will allow find_path() +# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file +# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") +# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have +# installed PostgreSQL, e.g. . +# +# ---------------------------------------------------------------------------- + +set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include") +set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}") +set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.") +set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}") +set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4") + + +set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} + "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") + +# Define additional search paths for root directories. +set( PostgreSQL_ROOT_DIRECTORIES + ENV PostgreSQL_ROOT + ${PostgreSQL_ROOT} +) +foreach(suffix ${PostgreSQL_KNOWN_VERSIONS}) + if(WIN32) + list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/lib") + list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/include") + list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/include/server") + endif() + if(UNIX) + list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES + "pgsql-${suffix}/lib") + list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES + "pgsql-${suffix}/include") + list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES + "postgresql/${suffix}/server" + "pgsql-${suffix}/include/server") + endif() +endforeach() + +# +# Look for an installation. +# +find_path(PostgreSQL_INCLUDE_DIR + NAMES libpq-fe.h + PATHS + # Look in other places. + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + pgsql + postgresql + include + ${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES} + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" +) + +find_path(PostgreSQL_TYPE_INCLUDE_DIR + NAMES catalog/pg_type.h + PATHS + # Look in other places. + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + postgresql + pgsql/server + postgresql/server + include/server + ${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES} + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" +) + +# The PostgreSQL library. +set (PostgreSQL_LIBRARY_TO_FIND pq) +# Setting some more prefixes for the library +set (PostgreSQL_LIB_PREFIX "") +if ( WIN32 ) + set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib") + set (PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND}) +endif() + +function(__postgresql_find_library _name) + find_library(${_name} + NAMES ${ARGN} + PATHS + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + lib + ${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES} + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}" + ) +endfunction() + +# For compatibility with versions prior to this multi-config search, honor +# any PostgreSQL_LIBRARY that is already specified and skip the search. +if(PostgreSQL_LIBRARY) + set(PostgreSQL_LIBRARIES "${PostgreSQL_LIBRARY}") + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY}" PATH) +else() + __postgresql_find_library(PostgreSQL_LIBRARY_RELEASE ${PostgreSQL_LIBRARY_TO_FIND}) + __postgresql_find_library(PostgreSQL_LIBRARY_DEBUG ${PostgreSQL_LIBRARY_TO_FIND}d) + include(SelectLibraryConfigurations) + select_library_configurations(PostgreSQL) + mark_as_advanced(PostgreSQL_LIBRARY_RELEASE PostgreSQL_LIBRARY_DEBUG) + if(PostgreSQL_LIBRARY_RELEASE) + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_RELEASE}" PATH) + elseif(PostgreSQL_LIBRARY_DEBUG) + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_DEBUG}" PATH) + else() + set(PostgreSQL_LIBRARY_DIR "") + endif() +endif() + +if (PostgreSQL_INCLUDE_DIR) + # Some platforms include multiple pg_config.hs for multi-lib configurations + # This is a temporary workaround. A better solution would be to compile + # a dummy c file and extract the value of the symbol. + file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h") + foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) + if(EXISTS "${_PG_CONFIG_HEADER}") + file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str + REGEX "^#define[\t ]+PG_VERSION_NUM[\t ]+.*") + if(pgsql_version_str) + string(REGEX REPLACE "^#define[\t ]+PG_VERSION_NUM[\t ]+([0-9]*).*" + "\\1" _PostgreSQL_VERSION_NUM "${pgsql_version_str}") + break() + endif() + endif() + endforeach() + if (_PostgreSQL_VERSION_NUM) + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + else () + foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) + if(EXISTS "${_PG_CONFIG_HEADER}") + file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str + REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"") + if(pgsql_version_str) + string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" + "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}") + break() + endif() + endif() + endforeach() + endif () + unset(_PostgreSQL_VERSION_NUM) + unset(pgsql_version_str) +endif() + +# Did we find anything? +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PostgreSQL + REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR + VERSION_VAR PostgreSQL_VERSION_STRING) +set(PostgreSQL_FOUND ${POSTGRESQL_FOUND}) + +function(__postgresql_import_library _target _var _config) + if(_config) + set(_config_suffix "_${_config}") + else() + set(_config_suffix "") + endif() + + set(_lib "${${_var}${_config_suffix}}") + if(EXISTS "${_lib}") + if(_config) + set_property(TARGET ${_target} APPEND PROPERTY + IMPORTED_CONFIGURATIONS ${_config}) + endif() + set_target_properties(${_target} PROPERTIES + IMPORTED_LOCATION${_config_suffix} "${_lib}") + endif() +endfunction() + +# Now try to get the include and library path. +if(PostgreSQL_FOUND) + if (NOT TARGET PostgreSQL::PostgreSQL) + add_library(PostgreSQL::PostgreSQL UNKNOWN IMPORTED) + set_target_properties(PostgreSQL::PostgreSQL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIR};${PostgreSQL_TYPE_INCLUDE_DIR}") + __postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "") + __postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "RELEASE") + __postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "DEBUG") + endif () + set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} ) + set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} ) +endif() + +mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR) diff --git a/ports/vtk/Findproj.patch b/ports/vtk/Findproj.patch new file mode 100644 index 00000000000000..d83b0f4510d8ea --- /dev/null +++ b/ports/vtk/Findproj.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/FindLibPROJ.cmake b/CMake/FindLibPROJ.cmake +index e2344bb17..bac4c747e 100644 +--- a/CMake/FindLibPROJ.cmake ++++ b/CMake/FindLibPROJ.cmake +@@ -9,7 +9,7 @@ find_library(LibPROJ_LIBRARY_RELEASE + mark_as_advanced(LibPROJ_LIBRARY_RELEASE) + + find_library(LibPROJ_LIBRARY_DEBUG +- NAMES projd ++ NAMES projd proj_d proj NAMES_PER_DIR + DOC "libproj debug library") + mark_as_advanced(LibPROJ_LIBRARY_DEBUG) + diff --git a/ports/vtk/NoUndefDebug.patch b/ports/vtk/NoUndefDebug.patch new file mode 100644 index 00000000000000..a7bb750e7c5957 --- /dev/null +++ b/ports/vtk/NoUndefDebug.patch @@ -0,0 +1,13 @@ +diff --git a/Utilities/Python/vtkPython.h b/Utilities/Python/vtkPython.h +index 166f24104..79ae1d371 100644 +--- a/Utilities/Python/vtkPython.h ++++ b/Utilities/Python/vtkPython.h +@@ -53,7 +53,7 @@ + #include + #include + #include +-#undef _DEBUG ++ + #if defined(_MSC_VER) + #define _CRT_NOFORCE_MANIFEST 1 + #endif diff --git a/ports/vtk/SplitLibraryConfigurations.cmake b/ports/vtk/SplitLibraryConfigurations.cmake deleted file mode 100644 index fc4d87ec8b55d7..00000000000000 --- a/ports/vtk/SplitLibraryConfigurations.cmake +++ /dev/null @@ -1,28 +0,0 @@ - -cmake_minimum_required(VERSION 3.2.0) - -function(split_library_configurations LIBRARIES OPTIMIZED_OUT_VAR DEBUG_OUT_VAR GENERAL_OUT_VAR) - set(OPTIMIZED_LIBRARIES) - set(DEBUG_LIBRARIES) - set(GENERAL_LIBRARIES) - - set(CURRENT_TYPE) - foreach(LIBRARY ${LIBRARIES}) - if("${LIBRARY}" STREQUAL "optimized" OR "${LIBRARY}" STREQUAL "debug" OR "${LIBRARY}" STREQUAL "general") - set(CURRENT_TYPE "${LIBRARY}") - else() - if("${CURRENT_TYPE}" STREQUAL "optimized") - list(APPEND OPTIMIZED_LIBRARIES "${LIBRARY}") - elseif("${CURRENT_TYPE}" STREQUAL "debug") - list(APPEND DEBUG_LIBRARIES "${LIBRARY}") - else() - list(APPEND GENERAL_LIBRARIES "${LIBRARY}") - endif() - set(CURRENT_TYPE) - endif() - endforeach() - - set(${OPTIMIZED_OUT_VAR} "${OPTIMIZED_LIBRARIES}" PARENT_SCOPE) - set(${DEBUG_OUT_VAR} "${DEBUG_LIBRARIES}" PARENT_SCOPE) - set(${GENERAL_OUT_VAR} "${GENERAL_LIBRARIES}" PARENT_SCOPE) -endfunction() \ No newline at end of file diff --git a/ports/vtk/fix-VTKConfig-cmake.patch b/ports/vtk/fix-VTKConfig-cmake.patch deleted file mode 100644 index a507d22a833900..00000000000000 --- a/ports/vtk/fix-VTKConfig-cmake.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/CMake/VTKConfig.cmake.in b/CMake/VTKConfig.cmake.in -index 13e4db42..d28e0cc2 100644 ---- a/CMake/VTKConfig.cmake.in -+++ b/CMake/VTKConfig.cmake.in -@@ -66,19 +66,11 @@ set(VTK_USE_FILE "${VTK_CMAKE_DIR}/UseVTK.cmake") - # The rendering backend VTK was configured to use. - set(VTK_RENDERING_BACKEND "@VTK_RENDERING_BACKEND@") - --if (__vtk_install_tree) -- if (WIN32) -- set (VTK_RUNTIME_DIRS "@CMAKE_INSTALL_PREFIX@/@VTK_INSTALL_RUNTIME_DIR@") -- else () -- set (VTK_RUNTIME_DIRS "@CMAKE_INSTALL_PREFIX@/@VTK_INSTALL_LIBRARY_DIR@") -- endif () --else() -- if (WIN32) -- set (VTK_RUNTIME_DIRS "@CMAKE_BINARY_DIR@/bin") -- else () -- set (VTK_RUNTIME_DIRS "@CMAKE_BINARY_DIR@/lib") -- endif () --endif() -+if (WIN32) -+ set (VTK_RUNTIME_DIRS "@CMAKE_INSTALL_PREFIX@/@VTK_INSTALL_RUNTIME_DIR@") -+else () -+ set (VTK_RUNTIME_DIRS "@CMAKE_INSTALL_PREFIX@/@VTK_INSTALL_LIBRARY_DIR@") -+endif () - - # Setup VTK-m if it was enabled - set(VTK_HAS_VTKM @VTK_HAS_VTKM@) diff --git a/ports/vtk/fix-find-lz4.patch b/ports/vtk/fix-find-lz4.patch deleted file mode 100644 index 488640de8b4116..00000000000000 --- a/ports/vtk/fix-find-lz4.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMake/FindLZ4.cmake b/CMake/FindLZ4.cmake -index 07343e1f79..b43a9af2c7 100644 ---- a/CMake/FindLZ4.cmake -+++ b/CMake/FindLZ4.cmake -@@ -1,7 +1,13 @@ -- --find_library(LZ4_LIBRARIES NAMES lz4) -+find_library(LZ4_LIBRARY NAMES lz4 PATH_SUFFIXES lib) -+find_library(LZ4_LIBRARY_DEBUG NAMES lz4d PATH_SUFFIXES debug/lib) - find_path(LZ4_INCLUDE_DIRS NAMES lz4.h) - -+if(NOT LZ4_LIBRARY_DEBUG) -+ set(LZ4_LIBRARY_DEBUG ${LZ4_LIBRARY}) -+endif(NOT LZ4_LIBRARY_DEBUG) -+ -+set(LZ4_LIBRARIES optimized ${LZ4_LIBRARY} debug ${LZ4_LIBRARY_DEBUG}) -+ - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(LZ4 - DEFAULT_MSG diff --git a/ports/vtk/fix-find-lzma.patch b/ports/vtk/fix-find-lzma.patch deleted file mode 100644 index b2e375fc44a702..00000000000000 --- a/ports/vtk/fix-find-lzma.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMake/FindLZMA.cmake b/CMake/FindLZMA.cmake -index 213ab18df1..1e290da4cb 100644 ---- a/CMake/FindLZMA.cmake -+++ b/CMake/FindLZMA.cmake -@@ -1,7 +1,10 @@ - --find_library(LZMA_LIBRARIES NAMES lzma) -+find_library(LZMA_LIBRARY_RELEASE NAMES lzma PATH_SUFFIXES lib) -+find_library(LZMA_LIBRARY_DEBUG NAMES lzmad PATH_SUFFIXES debug/lib) - find_path(LZMA_INCLUDE_DIRS NAMES lzma.h) - -+select_library_configurations(LZMA) -+ - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(LZMA - DEFAULT_MSG diff --git a/ports/vtk/fix-proj4.patch b/ports/vtk/fix-proj4.patch deleted file mode 100644 index ad49b1523e3aa2..00000000000000 --- a/ports/vtk/fix-proj4.patch +++ /dev/null @@ -1,175 +0,0 @@ -diff --git a/Geovis/Core/vtkGeoProjection.cxx b/Geovis/Core/vtkGeoProjection.cxx -index f3a8852..8240603 100644 ---- a/Geovis/Core/vtkGeoProjection.cxx -+++ b/Geovis/Core/vtkGeoProjection.cxx -@@ -72,6 +72,9 @@ public: - } - - std::map< std::string, std::string > OptionalParameters; -+#if PROJ_VERSION_MAJOR >= 5 -+ PJ_PROJ_INFO ProjInfo; -+#endif - }; - - //----------------------------------------------------------------------------- -@@ -80,7 +83,7 @@ int vtkGeoProjection::GetNumberOfProjections() - if ( vtkGeoProjectionNumProj < 0 ) - { - vtkGeoProjectionNumProj = 0; -- for ( const PJ_LIST* pj = pj_get_list_ref(); pj && pj->id; ++ pj ) -+ for ( const PJ_LIST* pj = proj_list_operations(); pj && pj->id; ++ pj ) - ++ vtkGeoProjectionNumProj; - } - return vtkGeoProjectionNumProj; -@@ -91,7 +94,7 @@ const char* vtkGeoProjection::GetProjectionName( int projection ) - if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() ) - return nullptr; - -- return pj_get_list_ref()[projection].id; -+ return proj_list_operations()[projection].id; - } - //----------------------------------------------------------------------------- - const char* vtkGeoProjection::GetProjectionDescription( int projection ) -@@ -99,7 +102,7 @@ const char* vtkGeoProjection::GetProjectionDescription( int projection ) - if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() ) - return nullptr; - -- return pj_get_list_ref()[projection].descr[0]; -+ return proj_list_operations()[projection].descr[0]; - } - //----------------------------------------------------------------------------- - vtkGeoProjection::vtkGeoProjection() -@@ -144,7 +147,7 @@ void vtkGeoProjection::PrintSelf( ostream& os, vtkIndent indent ) - int vtkGeoProjection::GetIndex() - { - int i = 0; -- for ( const PJ_LIST* proj = pj_get_list_ref(); proj && proj->id; ++ proj, ++ i ) -+ for ( const PJ_LIST* proj = proj_list_operations(); proj && proj->id; ++ proj, ++ i ) - { - if ( ! strcmp( proj->id, this->Name ) ) - { -@@ -161,7 +164,11 @@ const char* vtkGeoProjection::GetDescription() - { - return nullptr; - } -+#if PROJ_VERSION_MAJOR >= 5 -+ return this->Internals->ProjInfo.description; -+#else - return this->Projection->descr; -+#endif - } - //----------------------------------------------------------------------------- - projPJ vtkGeoProjection::GetProjection() -@@ -232,6 +239,9 @@ int vtkGeoProjection::UpdateProjection() - this->ProjectionMTime = this->GetMTime(); - if ( this->Projection ) - { -+#if PROJ_VERSION_MAJOR >= 5 -+ this->Internals->ProjInfo = proj_pj_info(this->Projection); -+#endif - return 0; - } - return 1; -diff --git a/Geovis/Core/vtkGeoTransform.cxx b/Geovis/Core/vtkGeoTransform.cxx -index aeeabc1..b80a8c0 100644 ---- a/Geovis/Core/vtkGeoTransform.cxx -+++ b/Geovis/Core/vtkGeoTransform.cxx -@@ -167,9 +167,17 @@ void vtkGeoTransform::InternalTransformPoints( double* x, vtkIdType numPts, int - double* coord = x; - for ( vtkIdType i = 0; i < numPts; ++ i ) - { -+#if PROJ_VERSION_MAJOR >= 5 -+ xy.x = coord[0]; xy.y = coord[1]; -+#else - xy.u = coord[0]; xy.v = coord[1]; -+#endif - lp = pj_inv( xy, src ); -+#if PROJ_VERSION_MAJOR >= 5 -+ coord[0] = lp.lam; coord[1] = lp.phi; -+#else - coord[0] = lp.u; coord[1] = lp.v; -+#endif - coord += stride; - } - } -@@ -191,9 +199,17 @@ void vtkGeoTransform::InternalTransformPoints( double* x, vtkIdType numPts, int - double* coord = x; - for ( vtkIdType i = 0; i < numPts; ++ i ) - { -+#if PROJ_VERSION_MAJOR >= 5 -+ lp.lam = coord[0]; lp.phi = coord[1]; -+#else - lp.u = coord[0]; lp.v = coord[1]; -+#endif - xy = pj_fwd( lp, dst ); -+#if PROJ_VERSION_MAJOR >= 5 -+ coord[0] = xy.x; coord[1] = xy.y; -+#else - coord[0] = xy.u; coord[1] = xy.v; -+#endif - coord += stride; - } - } -diff --git a/ThirdParty/libproj/CMakeLists.txt b/ThirdParty/libproj/CMakeLists.txt -index a19609e..e23e44b 100644 ---- a/ThirdParty/libproj/CMakeLists.txt -+++ b/ThirdParty/libproj/CMakeLists.txt -@@ -1,4 +1,9 @@ - vtk_module_third_party(LibPROJ - LIBRARIES vtklibproj -+ USE_VARIABLES LibPROJ_MAJOR_VERSION - INCLUDE_DIRS ${vtklibproj_SOURCE_DIR}/vtklibproj - ${vtklibproj_BINARY_DIR}/vtklibproj) -+ -+if (NOT VTK_MODULE_USE_EXTERNAL_VTK_libproj) -+ set(LibPROJ_MAJOR_VERSION "4") -+endif () -\ No newline at end of file -diff --git a/ThirdParty/libproj/vtk_libproj.h.in b/ThirdParty/libproj/vtk_libproj.h.in -index cd9edc3..d441a1a 100644 ---- a/ThirdParty/libproj/vtk_libproj.h.in -+++ b/ThirdParty/libproj/vtk_libproj.h.in -@@ -17,8 +17,23 @@ - - /* Use the libproj library configured for VTK. */ - #cmakedefine VTK_USE_SYSTEM_LIBPROJ -+ -+#define VTK_LibPROJ_MAJOR_VERSION @LibPROJ_MAJOR_VERSION@ -+ -+#if VTK_LibPROJ_MAJOR_VERSION < 5 -+# define PROJ_VERSION_MAJOR @LibPROJ_MAJOR_VERSION@ -+# define proj_list_operations pj_get_list_ref -+#endif - #ifdef VTK_USE_SYSTEM_LIBPROJ --# include -+# if VTK_LibPROJ_MAJOR_VERSION >= 5 -+# include -+# endif -+# if VTK_LibPROJ_MAJOR_VERSION < 6 -+# include -+# endif -+# if VTK_LibPROJ_MAJOR_VERSION >= 6 -+# define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 -+# endif - # include - # include - #else -diff --git a/CMake/FindLibPROJ.cmake b/CMake/FindLibPROJ.cmake -index 2d8301d..d8d08cd 100644 ---- a/CMake/FindLibPROJ.cmake -+++ b/CMake/FindLibPROJ.cmake -@@ -5,6 +5,14 @@ - # LibPROJ_LIBRARIES to libproj4 and any dependent libraries - # If LibPROJ_REQUIRED is defined, then a fatal error message will be generated if libproj4 is not found - -+find_package(PROJ4 6 CONFIG REQUIRED) -+if (PROJ4_FOUND) -+ set(LibPROJ_FOUND 1) -+ set(LibPROJ_INCLUDE_DIR ${PROJ4_INCLUDE_DIRS}) -+ set(LibPROJ_LIBRARIES ${PROJ_LIBRARY}) -+ set(LibPROJ_MAJOR_VERSION 6) -+endif() -+ - if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibPROJ_LIBRARIES OR NOT LibPROJ_FOUND ) - - if ( $ENV{LibPROJ_DIR} ) diff --git a/ports/vtk/fix-pugixml-link.patch b/ports/vtk/fix-pugixml-link.patch deleted file mode 100644 index aadd41adb89944..00000000000000 --- a/ports/vtk/fix-pugixml-link.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMake/VTKConfig.cmake.in b/CMake/VTKConfig.cmake.in -index d28e0cc..7ed48bc 100644 ---- a/CMake/VTKConfig.cmake.in -+++ b/CMake/VTKConfig.cmake.in -@@ -88,6 +88,9 @@ if(VTK_HAS_VTKM AND NOT TARGET vtkm_cont) - ) - endif() - -+# Find dependencies -+include(CMakeFindDependencyMacro) -+find_dependency(pugixml REQUIRED) - - #----------------------------------------------------------------------------- - # Load requested modules. -diff --git a/IO/CityGML/CMakeLists.txt b/IO/CityGML/CMakeLists.txt -index ce979ba..744c6f1 100644 ---- a/IO/CityGML/CMakeLists.txt -+++ b/IO/CityGML/CMakeLists.txt -@@ -4,8 +4,5 @@ vtk_module_library(vtkIOCityGML ${Module_SRCS}) - # pugixml does not set _INCLUDE_DIRS or _LIBRARIES - if(VTK_USE_SYSTEM_PUGIXML AND NOT pugixml_INCLUDE_DIRS) - find_package(pugixml REQUIRED) -- get_target_property(pugixml_INCLUDE_DIRS pugixml INTERFACE_INCLUDE_DIRECTORIES) -- get_target_property(pugixml_LIBRARIES pugixml LOCATION) -- include_directories(${pugixml_INCLUDE_DIRS}) -- vtk_module_link_libraries(vtkIOCityGML LINK_PRIVATE ${pugixml_LIBRARIES}) -+ vtk_module_link_libraries(vtkIOCityGML LINK_PUBLIC pugixml) - endif() diff --git a/ports/vtk/fix-using-hdf5.patch b/ports/vtk/fix-using-hdf5.patch new file mode 100644 index 00000000000000..834ab15e942f6e --- /dev/null +++ b/ports/vtk/fix-using-hdf5.patch @@ -0,0 +1,22 @@ +diff --git a/ThirdParty/h5part/vtkh5part/src/H5Part.c b/ThirdParty/h5part/vtkh5part/src/H5Part.c +index 228d246..41af04d 100644 +--- a/ThirdParty/h5part/vtkh5part/src/H5Part.c ++++ b/ThirdParty/h5part/vtkh5part/src/H5Part.c +@@ -2092,7 +2092,7 @@ _H5Part_iteration_operator2 ( + case H5L_TYPE_HARD: { + + H5O_info_t objinfo; +- if( H5Oget_info_by_name( group_id, member_name, &objinfo, H5P_DEFAULT ) < 0 ) { ++ if( H5Oget_info_by_name1( group_id, member_name, &objinfo, H5P_DEFAULT ) < 0 ) { + return (herr_t)HANDLE_H5G_GET_OBJINFO_ERR ( member_name ); + } + +@@ -2142,7 +2142,7 @@ _H5Part_iteration_operator2 ( + if ( obj_id < 0 ) { + return (herr_t)HANDLE_H5G_OPEN_ERR ( member_name ); + } +- else if ( H5Oget_info ( obj_id, &objinfo ) < 0 ) { ++ else if ( H5Oget_info1 ( obj_id, &objinfo ) < 0 ) { + return (herr_t)HANDLE_H5G_GET_OBJINFO_ERR ( member_name ); + } + else { diff --git a/ports/vtk/fix_ogg_linkage.patch b/ports/vtk/fix_ogg_linkage.patch deleted file mode 100644 index c7f22f4c8f0369..00000000000000 --- a/ports/vtk/fix_ogg_linkage.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/IO/Movie/module.cmake b/IO/Movie/module.cmake -index 4275171..88204ad 100644 ---- a/IO/Movie/module.cmake -+++ b/IO/Movie/module.cmake -@@ -14,6 +14,7 @@ vtk_module(vtkIOMovie - vtkIO - DEPENDS - ${vtkIOMovie_vtkoggtheora} -+ vtkogg - vtkCommonExecutionModel - PRIVATE_DEPENDS - vtkCommonCore diff --git a/ports/vtk/hdf5_static.patch b/ports/vtk/hdf5_static.patch deleted file mode 100644 index 52ade3f082f9c2..00000000000000 --- a/ports/vtk/hdf5_static.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMake/FindHDF5.cmake b/CMake/FindHDF5.cmake -index 6d558e39..c301e165 100644 ---- a/CMake/FindHDF5.cmake -+++ b/CMake/FindHDF5.cmake -@@ -8,7 +8,16 @@ if(CMAKE_VERSION VERSION_LESS 3.6.1) - else() - include(${CMAKE_ROOT}/Modules/FindHDF5.cmake) - endif() -- -+#It would be better if VTK would actually use HDF5 & SZIP targets. -+#But current module load order is wrong which will lead to the target being used before it is defined! -+if("${HDF5_LIBRARIES}" MATCHES "libhdf5") -+ find_library(SZIP_LIBRARY_RELEASE NAMES sz libsz szip libszip NAMES_PER_DIR) -+ find_library(SZIP_LIBRARY_DEBUG NAMES sz_d libsz_d szip_d libszip_d NAMES_PER_DIR) -+ select_library_configurations(SZIP) -+ list(APPEND HDF5_LIBRARIES "${SZIP_LIBRARIES}") -+ find_package(ZLIB) -+ list(APPEND HDF5_LIBRARIES "${ZLIB_LIBRARIES}") -+endif() - if(HDF5_FOUND AND (HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL)) - include(vtkMPI) - if(MPI_C_INCLUDE_PATH) diff --git a/ports/vtk/pegtl.patch b/ports/vtk/pegtl.patch new file mode 100644 index 00000000000000..6374bb3a842307 --- /dev/null +++ b/ports/vtk/pegtl.patch @@ -0,0 +1,71 @@ +diff --git a/CMake/FindPEGTL.cmake b/CMake/FindPEGTL.cmake +index 73eee02f7..22d8bc159 100644 +--- a/CMake/FindPEGTL.cmake ++++ b/CMake/FindPEGTL.cmake +@@ -19,31 +19,40 @@ + # Copyright (c) 2009 Benoit Jacob + # Redistribution and use is allowed according to the terms of the 2-clause BSD license. + +-find_path(PEGTL_INCLUDE_DIR +- NAMES pegtl/version.hpp +- PATH_SUFFIXES tao +- DOC "Path to PEGTL headers") +-mark_as_advanced(PEGTL_INCLUDE_DIR) ++message(STATUS "Searching for PEGTL") ++find_package(PEGTL CONFIG NAMES PEGTL-2) ++if(TARGET taocpp::pegtl) ++ message(STATUS "Searching for PEGTL - found target taocpp::pegtl") ++ set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE) ++ add_library(PEGTL::PEGTL ALIAS taocpp::pegtl) ++else() ++ find_path(PEGTL_INCLUDE_DIR ++ NAMES pegtl/version.hpp ++ PATH_SUFFIXES tao ++ DOC "Path to PEGTL headers") ++ mark_as_advanced(PEGTL_INCLUDE_DIR) + +-if (PEGTL_INCLUDE_DIR) +- file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header +- REGEX "TAO_PEGTL_VERSION") +- string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}") +- set(PEGTL_VERSION "${CMAKE_MATCH_1}") +- unset(_pegtl_version_header) +- unset(_pegtl_version_match) +-endif () ++ if (PEGTL_INCLUDE_DIR) ++ file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header ++ REGEX "TAO_PEGTL_VERSION") ++ string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}") ++ set(PEGTL_VERSION "${CMAKE_MATCH_1}") ++ unset(_pegtl_version_header) ++ unset(_pegtl_version_match) ++ endif () + +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(PEGTL +- REQUIRED_VARS PEGTL_INCLUDE_DIR +- VERSION_VAR PEGTL_VERSION) ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(PEGTL ++ REQUIRED_VARS PEGTL_INCLUDE_DIR ++ VERSION_VAR PEGTL_VERSION) + +-if (PEGTL_FOUND) +- set(PEGTL_INCLUDE_DIRS "${PEGTL_INCLUDE_DIR}") +- if (NOT TARGET PEGTL::PEGTL) +- add_library(PEGTL::PEGTL INTERFACE IMPORTED) +- set_target_properties(PEGTL::PEGTL PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}") +- endif () +-endif () ++ if (PEGTL_FOUND) ++ set(PEGTL_INCLUDE_DIRS "${PEGTL_INCLUDE_DIR}") ++ if (NOT TARGET PEGTL::PEGTL) ++ add_library(PEGTL::PEGTL INTERFACE IMPORTED) ++ set_target_properties(PEGTL::PEGTL PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}") ++ endif () ++ message(STATUS "Searching for PEGTL - found") ++ endif () ++endif () +\ No newline at end of file diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 183b4e96bbc10a..089dc11b67b310 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -2,122 +2,160 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) message(WARNING "You will need to install Xorg dependencies to build vtk:\napt-get install libxt-dev\n") endif() -set(VTK_SHORT_VERSION "8.2") -set(VTK_LONG_VERSION "${VTK_SHORT_VERSION}.0") -# ============================================================================= -# Options: -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - qt VTK_WITH_QT - mpi VTK_Group_MPI - python VTK_WITH_PYTHON - openvr Module_vtkRenderingOpenVR - atlmfc Module_vtkGUISupportMFC -) - -set(VTK_WITH_ALL_MODULES OFF) # IMPORTANT: if ON make sure `qt5`, `mpi`, `python3`, `ffmpeg`, `gdal`, `fontconfig`, - # `libmysql` and `atlmfc` are listed as dependency in the CONTROL file - -# ============================================================================= -# Clone & patch -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO Kitware/VTK - REF "v${VTK_LONG_VERSION}" - SHA512 fd1d9c2872baa6eca7f8105b0057b56ec554e9d5eaf25985302e7fc032bdce72255d79e3f5f16ca50504151bda49cb3a148272ba32e0f410b4bdb70959b8f3f4 - HEAD_REF master - PATCHES - fix-find-lz4.patch - fix_ogg_linkage.patch - fix-pugixml-link.patch - hdf5_static.patch - fix-find-lzma.patch - fix-proj4.patch - fix-VTKConfig-cmake.patch -) - -# Remove the FindGLEW.cmake and FindPythonLibs.cmake that are distributed with VTK, -# since they do not detect the debug libraries correctly. -# The default files distributed with CMake (>= 3.9) should be superior by all means. -# For GDAL, the one distributed with CMake does not detect the debug libraries correctly, -# so we provide an own one. -file(REMOVE ${SOURCE_PATH}/CMake/FindGLEW.cmake) -file(REMOVE ${SOURCE_PATH}/CMake/FindPythonLibs.cmake) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindGDAL.cmake DESTINATION ${SOURCE_PATH}/CMake) +# TODO: +# - add loguru as a dependency requires #8682 # ============================================================================= +# Options: # Collect CMake options for optional components -if(VTK_WITH_QT) +if("qt" IN_LIST FEATURES) list(APPEND ADDITIONAL_OPTIONS - -DVTK_Group_Qt=ON - -DVTK_QT_VERSION=5 - -DVTK_BUILD_QT_DESIGNER_PLUGIN=OFF + -DVTK_GROUP_ENABLE_Qt=YES + -DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES + -DVTK_MODULE_ENABLE_VTK_GUISupportQtSQL=YES + -DVTK_MODULE_ENABLE_VTK_RenderingQt=YES + -DVTK_MODULE_ENABLE_VTK_ViewsQt=YES + ) + +endif() +if("atlmfc" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_GUISupportMFC=YES + ) +endif() +if("vtkm" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKm=YES + -DVTK_MODULE_ENABLE_VTK_vtkm=YES ) endif() -if(VTK_WITH_PYTHON) +if("python" IN_LIST FEATURES) vcpkg_find_acquire_program(PYTHON3) list(APPEND ADDITIONAL_OPTIONS -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3 + -DPython3_FIND_REGISTRY=NEVER + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" ) + + #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages endif() -if(VTK_WITH_ALL_MODULES) +if("paraview" IN_LIST FEATURES) list(APPEND ADDITIONAL_OPTIONS - -DVTK_BUILD_ALL_MODULES=ON - -DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg - # -DVTK_USE_SYSTEM_AUTOBAHN=ON - # -DVTK_USE_SYSTEM_SIX=ON - # -DVTK_USE_SYSTEM_MPI4PY=ON - # -DVTK_USE_SYSTEM_CONSTANTLY=ON - # -DVTK_USE_SYSTEM_INCREMENTAL=ON - # -DVTK_USE_SYSTEM_TWISTED=ON - # -DVTK_USE_SYSTEM_XDMF2=ON - # -DVTK_USE_SYSTEM_XDMF3=ON - # -DVTK_USE_SYSTEM_ZFP=ON - # -DVTK_USE_SYSTEM_ZOPE=ON - # -DVTK_USE_SYSTEM_LIBPROJ=ON + -DVTK_MODULE_ENABLE_VTK_FiltersParallelStatistics=YES + -DVTK_MODULE_ENABLE_VTK_IOParallelExodus=YES + -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingParallel=YES + -DVTK_MODULE_ENABLE_VTK_RenderingVolumeAMR=YES + -DVTK_MODULE_ENABLE_VTK_IOXdmf2=YES + -DVTK_MODULE_ENABLE_VTK_IOH5part=YES + -DVTK_MODULE_ENABLE_VTK_IOParallelLSDyna=YES + -DVTK_MODULE_ENABLE_VTK_IOTRUCHAS=YES + -DVTK_MODULE_ENABLE_VTK_IOVPIC=YES + -DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingAnnotation=YES + -DVTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2=YES ) + if("python" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib=YES + ) + endif() endif() -if (VCPKG_TARGET_IS_WINDOWS) - set(PROJ_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/proj.lib") - set(PROJ_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/proj_d.lib") -else() - set(PROJ_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/libproj.a") - set(PROJ_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libproj.a") +if("mpi" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_GROUP_ENABLE_MPI=YES + ) +endif() + +if("opengl" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_DomainsChemestryOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_ImagingOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingGL2PSOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_opengl=YES + ) 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 + ) +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "cuda" VTK_USE_CUDA + "all" VTK_BUILD_ALL_MODULES +) + + +# ============================================================================= +# Clone & patch +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Kitware/VTK + REF 96e6fa9b3ff245e4d51d49f23d40e9ad8774e85e # v9.0.1 + SHA512 0efb1845053b6143e5ee7fa081b8be98f6825262c59051e88b2be02497e23362055067b2f811eff82e93eb194e5a9afd2a12e3878a252eb4011a5dab95127a6f + HEAD_REF master + PATCHES + 6811.patch + FindLZMA.patch # Will be fixed in 9.1? + FindLZ4.patch + Findproj.patch + vtkm.patch # To include an external VTKm build (v.1.5 required) + pegtl.patch + pythonwrapper.patch # Required by ParaView to Wrap required classes + NoUndefDebug.patch # Required to link against correct Python library depending on build type. + python_debug.patch + fix-using-hdf5.patch + # Last patch TODO: Patch out internal loguru +) + +# ============================================================================= +#Overwrite outdated modules if they have not been patched: +file(COPY "${CURRENT_PORT_DIR}/FindPostgreSQL.cmake" DESTINATION "${SOURCE_PATH}/CMake") # will be backported from CMake in VTK in a future release +file(COPY "${CURRENT_PORT_DIR}/FindHDF5.cmake" DESTINATION "${SOURCE_PATH}/CMake/patches/99") # due to usage of targets in netcdf-c +# ============================================================================= + # ============================================================================= # Configure & Install +# We set all libraries to "system" and explicitly list the ones that should use embedded copies vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} -DBUILD_TESTING=OFF - -DBUILD_EXAMPLES=OFF + -DVTK_BUILD_TESTING=OFF + -DVTK_BUILD_EXAMPLES=OFF -DVTK_INSTALL_INCLUDE_DIR=include -DVTK_INSTALL_DATA_DIR=share/vtk/data -DVTK_INSTALL_DOC_DIR=share/vtk/doc -DVTK_INSTALL_PACKAGE_DIR=share/vtk -DVTK_INSTALL_RUNTIME_DIR=bin -DVTK_FORBID_DOWNLOADS=ON - - # We set all libraries to "system" and explicitly list the ones that should use embedded copies - -DVTK_USE_SYSTEM_LIBRARIES=ON - -DVTK_USE_SYSTEM_GL2PS=OFF - + -DVTK_ENABLE_REMOTE_MODULES=OFF + # VTK groups to enable + -DVTK_GROUP_ENABLE_StandAlone=YES + -DVTK_GROUP_ENABLE_Rendering=YES + -DVTK_GROUP_ENABLE_Views=YES + # Disable deps not in VCPKG + -DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg # Select modules / groups to install - -DVTK_Group_Imaging=ON - -DVTK_Group_Views=ON - -DPYTHON_EXECUTABLE=${PYTHON3} - + -DVTK_USE_EXTERNAL:BOOL=ON + -DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps:BOOL=OFF # Not yet in VCPKG ${ADDITIONAL_OPTIONS} - OPTIONS_RELEASE - -DPROJ_LIBRARY=${PROJ_LIBRARY_REL} - OPTIONS_DEBUG - -DPROJ_LIBRARY=${PROJ_LIBRARY_DBG} ) vcpkg_install_cmake() @@ -125,91 +163,75 @@ vcpkg_copy_pdbs() # ============================================================================= # Fixup target files -vcpkg_fixup_cmake_targets() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/vtk-9.0) +# TODO: Check if the following is still required # For some reason the references to the XDMF libraries in the target files do not end up # correctly, so we fix them here. -if(VTK_WITH_ALL_MODULES) - file(READ ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake VTK_TARGETS_RELEASE_CONTENT) - string(REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") - string(REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") - string(REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") - string(REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake "${VTK_TARGETS_RELEASE_CONTENT}") - - file(READ ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake VTK_TARGETS_DEBUG_CONTENT) - string(REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") - string(REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") - string(REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") - string(REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake "${VTK_TARGETS_DEBUG_CONTENT}") -endif() +# if(VTK_WITH_ALL_MODULES) + # file(READ ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake VTK_TARGETS_RELEASE_CONTENT) + # string(REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") + # string(REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") + # string(REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") + # string(REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}") + # file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake "${VTK_TARGETS_RELEASE_CONTENT}") -#file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets.cmake" VTK_TARGETS_CONTENT) -# Remove unset of _IMPORT_PREFIX in VTKTargets.cmake -#_IMPORT_PREFIX is required by vtkModules due to vcpkg_fixup_cmake_targets changing all cmake files (to use _IMPORT_PREFIX). -#STRING(REPLACE [[set(_IMPORT_PREFIX)]] -#[[ -# VCPKG: The value of _IMPORT_PREFIX should not be unset. -#set(_IMPORT_PREFIX) -#]] -#VTK_TARGETS_CONTENT "${VTK_TARGETS_CONTENT}") -#file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets.cmake" "${VTK_TARGETS_CONTENT}") - -#file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets.cmake" VTK_TARGETS_CONTENT) - -# Fix _IMPORT_PREFIX. It is not set within the Modules cmake (only set in VTKTargets.cmake). -# Since for VCPKG _IMPORT_PREFIX == VTK_INSTALL_PREFIX we just replace it with that. -file(GLOB_RECURSE CMAKE_FILES ${CURRENT_PACKAGES_DIR}/share/vtk/Modules/*.cmake) -foreach(FILE IN LISTS CMAKE_FILES) - file(READ "${FILE}" _contents) - string(REPLACE "\${_IMPORT_PREFIX}" "\${VTK_INSTALL_PREFIX}" _contents "${_contents}") - file(WRITE "${FILE}" "${_contents}") -endforeach() + # file(READ ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake VTK_TARGETS_DEBUG_CONTENT) + # string(REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") + # string(REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") + # string(REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") + # string(REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}") + # file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake "${VTK_TARGETS_DEBUG_CONTENT}") +# endif() +# ============================================================================= +# Remove other files and directories that are not valid for vcpkg +# if(VTK_WITH_ALL_MODULES) + # file(REMOVE ${CURRENT_PACKAGES_DIR}/XdmfConfig.cmake) + # file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/XdmfConfig.cmake) +# endif() # ============================================================================= # Clean-up other directories + # Delete the debug binary TOOL_NAME that is not required function(_vtk_remove_debug_tool TOOL_NAME) - # on windows, the tools end with .exe - set(filename_win ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}.exe) - if(EXISTS ${filename_win}) - file(REMOVE ${filename_win}) + set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(REMOVE ${filename}) + endif() + set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}d${VCPKG_TARGET_EXECUTABLE_SUFFIX}) + if(EXISTS ${filename}) + file(REMOVE ${filename}) endif() - # on other OS, it doesn't - set(filename_unix ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}) - if(EXISTS ${filename_unix}) - file(REMOVE ${filename_unix}) + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + # we also have to bend the lines referencing the tools in VTKTargets-debug.cmake + # to make them point to the release version of the tools + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-debug.cmake" VTK_TARGETS_CONTENT_DEBUG) + string(REPLACE "debug/bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") + string(REPLACE "tools/vtk/${TOOL_NAME}d" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-debug.cmake" "${VTK_TARGETS_CONTENT_DEBUG}") endif() - # we also have to bend the lines referencing the tools in VTKTargets-debug.cmake - # to make them point to the release version of the tools - file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake" VTK_TARGETS_CONTENT_DEBUG) - string(REPLACE "debug/bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake" "${VTK_TARGETS_CONTENT_DEBUG}") endfunction() # Move the release binary TOOL_NAME from bin to tools function(_vtk_move_release_tool TOOL_NAME) - # on windows, the tools end with .exe - set(old_filename_win "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}.exe") - if(EXISTS ${old_filename_win}) - file(INSTALL ${old_filename_win} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk") - file(REMOVE ${old_filename_win}) + set(old_filename "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + if(EXISTS ${old_filename}) + file(INSTALL ${old_filename} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk" USE_SOURCE_PERMISSIONS) + file(REMOVE ${old_filename}) endif() - # on other OS, it doesn't - set(old_filename_unix "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}") - if(EXISTS ${old_filename_unix}) - file(INSTALL ${old_filename_unix} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk") - file(REMOVE ${old_filename_unix}) + + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + # we also have to bend the lines referencing the tools in VTKTargets-release.cmake + # to make them point to the tool folder + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-release.cmake" VTK_TARGETS_CONTENT_RELEASE) + string(REPLACE "bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_RELEASE "${VTK_TARGETS_CONTENT_RELEASE}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-release.cmake" "${VTK_TARGETS_CONTENT_RELEASE}") endif() - # we also have to bend the lines referencing the tools in VTKTargets-release.cmake - # to make them point to the tool folder - file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake" VTK_TARGETS_CONTENT_RELEASE) - string(REPLACE "bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_RELEASE "${VTK_TARGETS_CONTENT_RELEASE}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake" "${VTK_TARGETS_CONTENT_RELEASE}") endfunction() +set(VTK_SHORT_VERSION 9.0) set(VTK_TOOLS vtkEncodeString-${VTK_SHORT_VERSION} vtkHashSource-${VTK_SHORT_VERSION} @@ -221,27 +243,18 @@ set(VTK_TOOLS vtkWrapHierarchy-${VTK_SHORT_VERSION} vtkParseJava-${VTK_SHORT_VERSION} vtkParseOGLExt-${VTK_SHORT_VERSION} + vtkProbeOpenGLVersion-${VTK_SHORT_VERSION} + vtkTestOpenGLVersion-${VTK_SHORT_VERSION} vtkpython pvtkpython ) - +# TODO: Replace with vcpkg_copy_tools if known which tools are built with which feature +# or add and option to vcpkg_copy_tools which does not require the tool to be present foreach(TOOL_NAME IN LISTS VTK_TOOLS) _vtk_remove_debug_tool("${TOOL_NAME}") _vtk_move_release_tool("${TOOL_NAME}") endforeach() -file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/vtkhdf5.cmake" _contents) -string(REPLACE "vtk::hdf5::hdf5_hl" "" _contents "${_contents}") -string(REPLACE "vtk::hdf5::hdf5" "" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/vtkhdf5.cmake" "${_contents}") - -# ============================================================================= -# Remove other files and directories that are not valid for vcpkg -if(VTK_WITH_ALL_MODULES) - file(REMOVE ${CURRENT_PACKAGES_DIR}/XdmfConfig.cmake) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/XdmfConfig.cmake) -endif() - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -250,8 +263,53 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/vtk) - # ============================================================================= # Handle copyright file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/vtk") + +## Files Modules needed by ParaView +if("paraview" IN_LIST FEATURES) + set(VTK_CMAKE_NEEDED vtkCompilerChecks vtkCompilerPlatformFlags vtkCompilerExtraFlags vtkInitializeBuildType + vtkSupportMacros vtkDirectories vtkVersion FindPythonModules vtkModuleDebugging vtkExternalData) + foreach(module ${VTK_CMAKE_NEEDED}) + file(INSTALL "${SOURCE_PATH}/CMake/${module}.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk") + endforeach() + + ## Check List on UPDATE !! + file(INSTALL "${SOURCE_PATH}/CMake/vtkRequireLargeFilesSupport.cxx" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk") + + file(INSTALL "${SOURCE_PATH}/GUISupport/Qt/QVTKOpenGLWidget.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # Legacy header + + file(INSTALL "${SOURCE_PATH}/Common/Core/vtkRange.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK + file(INSTALL "${SOURCE_PATH}/Common/Core/vtkRangeIterableTraits.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK + file(INSTALL "${SOURCE_PATH}/Common/DataModel/vtkCompositeDataSetNodeReference.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK + #ParaView requires some internal headers + file(INSTALL "${SOURCE_PATH}/Rendering/Annotation/vtkScalarBarActorInternal.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") + file(INSTALL "${SOURCE_PATH}/Filters/Statistics/vtkStatisticsAlgorithmPrivate.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") + file(INSTALL "${SOURCE_PATH}/Rendering/OpenGL2/vtkCompositePolyDataMapper2Internal.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Rendering/OpenGL2/vtkTextureObjectVS.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/vtkpythonmodules/static_python) #python headers + file(GLOB_RECURSE STATIC_PYTHON_FILES "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/*/static_python/*.h") + file(INSTALL ${STATIC_PYTHON_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}) + endif() +endif() + +#remove one get_filename_component(_vtk_module_import_prefix "${_vtk_module_import_prefix}" DIRECTORY) from vtk-prefix.cmake and VTK-vtk-module-properties and vtk-python.cmake +set(filenames_fix_prefix vtk-prefix VTK-vtk-module-properties vtk-python) +foreach(name IN LISTS filenames_fix_prefix) +if(EXISTS "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake") + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake" _contents) + string(REPLACE +[[set(_vtk_module_import_prefix "${CMAKE_CURRENT_LIST_DIR}") +get_filename_component(_vtk_module_import_prefix "${_vtk_module_import_prefix}" DIRECTORY)]] +[[set(_vtk_module_import_prefix "${CMAKE_CURRENT_LIST_DIR}")]] _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake" "${_contents}") +else() + debug_message("FILE:${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake does not exist! No prefix correction!") +endif() +endforeach() diff --git a/ports/vtk/python_debug.patch b/ports/vtk/python_debug.patch new file mode 100644 index 00000000000000..6b69d8094dd597 --- /dev/null +++ b/ports/vtk/python_debug.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/patches/3.18/FindPython/Support.cmake b/CMake/patches/3.18/FindPython/Support.cmake +index 0879537ed..122e7228d 100644 +--- a/CMake/patches/3.18/FindPython/Support.cmake ++++ b/CMake/patches/3.18/FindPython/Support.cmake +@@ -2253,7 +2257,7 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS + NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG} + NAMES_PER_DIR + HINTS "${_${_PYTHON_PREFIX}_PATH}" ${_${_PYTHON_PREFIX}_HINTS} +- NO_DEFAULT_PATH) ++ ) + endif() + + # retrieve runtime libraries diff --git a/ports/vtk/pythonwrapper.patch b/ports/vtk/pythonwrapper.patch new file mode 100644 index 00000000000000..6cdd4162aa099c --- /dev/null +++ b/ports/vtk/pythonwrapper.patch @@ -0,0 +1,19 @@ +diff --git a/CMake/vtkModuleWrapPython.cmake b/CMake/vtkModuleWrapPython.cmake +index 5d2c2e1bf..e33a16d68 100644 +--- a/CMake/vtkModuleWrapPython.cmake ++++ b/CMake/vtkModuleWrapPython.cmake +@@ -152,11 +152,14 @@ function (_vtk_module_wrap_python_sources module sources classes) + set(_vtk_python_genex_compile_definitions + "$") + set(_vtk_python_genex_include_directories + "$") ++ set(_vtk_python_genex_interface_include_directories ++ "$") + file(GENERATE + OUTPUT "${_vtk_python_args_file}" + CONTENT "$<$:\n-D\'$\'>\n + $<$:\n-I\'$\'>\n ++$<$:\n-I\'$\'>\n + $<$:\n--types \'$\'>\n") + + set(_vtk_python_sources) diff --git a/ports/vtk/vtkm.patch b/ports/vtk/vtkm.patch new file mode 100644 index 00000000000000..27b7f40940d87b --- /dev/null +++ b/ports/vtk/vtkm.patch @@ -0,0 +1,141 @@ +diff --git a/Accelerators/Vtkm/CMakeLists.txt b/Accelerators/Vtkm/CMakeLists.txt +index 4297575bd..643df6fd5 100644 +--- a/Accelerators/Vtkm/CMakeLists.txt ++++ b/Accelerators/Vtkm/CMakeLists.txt +@@ -14,8 +14,10 @@ + ## + ##============================================================================= + +-list(INSERT 0 CMAKE_MODULE_PATH +- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake") ++find_package(VTKm CONFIG REQUIRED) ++ ++#list(INSERT 0 CMAKE_MODULE_PATH ++# "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake") + + set(sources + vtkmlib/ArrayConvertersReal.cxx +diff --git a/Accelerators/Vtkm/CMakeLists.txt b/Accelerators/Vtkm/CMakeLists.txt +index a01a6bda3..889c87ebb 100644 +--- a/Accelerators/Vtkm/CMakeLists.txt ++++ b/Accelerators/Vtkm/CMakeLists.txt +@@ -126,9 +126,9 @@ vtkm_add_target_information(${vtkm_accel_target} + MODIFY_CUDA_FLAGS + DEVICE_SOURCES ${sources}) + +-vtk_module_set_property(VTK::AcceleratorsVTKm +- PROPERTY JOB_POOL_COMPILE +- VALUE vtkm_pool) ++#vtk_module_set_property(VTK::AcceleratorsVTKm ++# PROPERTY JOB_POOL_COMPILE ++# VALUE vtkm_pool) + vtk_module_link(VTK::AcceleratorsVTKm + PRIVATE + vtkm_worklet +diff --git a/CMake/FindVTKm.cmake b/CMake/FindVTKm.cmake +new file mode 100644 +index 000000000..c0fe00c0e +--- /dev/null ++++ b/CMake/FindVTKm.cmake +@@ -0,0 +1 @@ ++find_package(VTKm CONFIG REQUIRED) +\ No newline at end of file +diff --git a/CMake/vtkCompilerPlatformFlags.cmake b/CMake/vtkCompilerPlatformFlags.cmake +index b0bdba1e6..69c570a25 100644 +--- a/CMake/vtkCompilerPlatformFlags.cmake ++++ b/CMake/vtkCompilerPlatformFlags.cmake +@@ -107,7 +107,7 @@ if(MSVC) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /bigobj") + endif() + endif() + +diff --git a/ThirdParty/vtkm/CMakeLists.txt b/ThirdParty/vtkm/CMakeLists.txt +index 5817d42f8..bc5a33d93 100644 +--- a/ThirdParty/vtkm/CMakeLists.txt ++++ b/ThirdParty/vtkm/CMakeLists.txt +@@ -1,6 +1,47 @@ +-vtk_module_third_party_internal( +- LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt" +- VERSION "master" +- SUBDIRECTORY vtkvtkm +- STANDARD_INCLUDE_DIRS +- INTERFACE) ++#vtk_module_third_party_internal( ++# LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt" ++# VERSION "master" ++# SUBDIRECTORY vtkvtkm ++# STANDARD_INCLUDE_DIRS ++# INTERFACE) ++ ++message(STATUS "VTK_MODULE_USE_EXTERNAL_VTK_vtkm: ${VTK_MODULE_USE_EXTERNAL_VTK_vtkm}") ++if(TRUE) ++ message(STATUS "Searching for external VTKm") ++ find_package(VTKm CONFIG REQUIRED) ++ if(TARGET vtkm_compiler_flags) ++ get_target_property(VTKm_INCLUDE_DIRS vtkm_compiler_flags INTERFACE_INCLUDE_DIRECTORIES) ++ message(STATUS "INCLUDE: ${VTKm_INCLUDE_DIRS}") ++ get_target_property(VTKm_DIY_INCLUDE_DIRS vtkm_diy INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(VTKm_OPTION_INCLUDE_DIRS vtkm_optionparser INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(VTKm_TAO_INCLUDE_DIRS vtkm_taotuple INTERFACE_INCLUDE_DIRECTORIES) ++ if(MSVC) ++ set(VTKm_DEFINITIONS /bigobj) ++ endif() ++ else() ++ message(FATAL_ERROR "VTKM target missing") ++ endif() ++ if(VTKM_FOUND) ++ message(STATUS "Found VTKm") ++ endif() ++endif() ++ ++vtk_module_third_party( ++ INTERNAL ++ HEADER_ONLY ++ LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt" ++ VERSION "master" ++ SUBDIRECTORY vtkvtkm ++ STANDARD_INCLUDE_DIRS ++ INTERFACE ++ EXTERNAL ++ PACKAGE VTKm ++ TARGETS vtkm_cont vtkm_filter vtkm_diy vtkm_optionparser vtkm_taotuple ++ #LIBRARIES vtkm_cont vtkm_filter vtkm_diy vtkm_optionparser vtkm_taotuple ++ INCLUDE_DIRS VTKm_INCLUDE_DIRS VTKm_DIY_INCLUDE_DIRS VTKm_OPTION_INCLUDE_DIRS VTKm_TAO_INCLUDE_DIRS) ++# configure_file( ++ # "${CMAKE_CURRENT_SOURCE_DIR}/vtk_utf8.h.in" ++ # "${CMAKE_CURRENT_BINARY_DIR}/vtk_utf8.h") ++ ++# vtk_module_install_headers( ++ # FILES "${CMAKE_CURRENT_BINARY_DIR}/vtk_utf8.h") +diff --git a/ThirdParty/vtkm/vtk.module b/ThirdParty/vtkm/vtk.module +index a8e4dad0f..c7bbbf0e8 100644 +--- a/ThirdParty/vtkm/vtk.module ++++ b/ThirdParty/vtkm/vtk.module +@@ -3,5 +3,7 @@ NAME + PRIVATE_DEPENDS + # While not needed to satisfy symbols, this is necessary to guarantee that + # VTK_SMP_IMPLEMENTATION_TYPE is available when configuring vtk-m. +- VTK::CommonCore ++ # VTK::CommonCore ++LIBRARY_NAME ++ VTKm + THIRD_PARTY +diff --git a/CMake/vtk-config.cmake.in b/CMake/vtk-config.cmake.in +index 1ecfde326..ae5576e66 100644 +--- a/CMake/vtk-config.cmake.in ++++ b/CMake/vtk-config.cmake.in +@@ -114,9 +114,7 @@ set("${CMAKE_FIND_PACKAGE_NAME}_AVAILABLE_COMPONENTS" "@vtk_all_components@") + unset("${CMAKE_FIND_PACKAGE_NAME}_FOUND") + set("${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm" "@vtk_has_vtkm@") + if (${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm) +- find_package(VTKm +- PATHS "${CMAKE_CURRENT_LIST_DIR}/vtkm" +- NO_DEFAULT_PATH) ++ find_package(VTKm CONFIG REQUIRED) + if (NOT VTKm_FOUND) + set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0) + endif () diff --git a/ports/vxl/CONTROL b/ports/vxl/CONTROL index cc7e731a2c6d1b..d95016ac05c008 100644 --- a/ports/vxl/CONTROL +++ b/ports/vxl/CONTROL @@ -1,8 +1,9 @@ Source: vxl Version: 2.0.2 +Port-Version: 1 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 -Description: core_imaging support for vxl +Feature: core-imaging +Description: core-imaging support for vxl diff --git a/ports/vxl/portfile.cmake b/ports/vxl/portfile.cmake index 55581183d4704c..232cfa3a534a9c 100644 --- a/ports/vxl/portfile.cmake +++ b/ports/vxl/portfile.cmake @@ -1,7 +1,5 @@ -include(vcpkg_common_functions) - set(BUILD_CORE_IMAGING OFF) -if("core_imaging" IN_LIST FEATURES) +if("core-imaging" IN_LIST FEATURES) set(BUILD_CORE_IMAGING ON) if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openjpeg.h") set(BUILD_CORE_IMAGING OFF) diff --git a/ports/wavelib/CONTROL b/ports/wavelib/CONTROL new file mode 100644 index 00000000000000..78c10686d3015b --- /dev/null +++ b/ports/wavelib/CONTROL @@ -0,0 +1,4 @@ +Source: wavelib +Version: 2020-05-29 +Description: C implementation of wavelet transform (DWT,SWT and MODWT) +Homepage: https://github.com/rafat/wavelib diff --git a/ports/wavelib/portfile.cmake b/ports/wavelib/portfile.cmake new file mode 100644 index 00000000000000..2f4b6aa836fdf3 --- /dev/null +++ b/ports/wavelib/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rafat/wavelib + REF c7c9ba8b1091610a678b2091ae4edba740fe83a7 + SHA512 16f24288e410732cd7a2744e0039f93ddb435c6aaa59fde169f117e5536e5f452f0e78edc75ad725b18f9e16b34870c3a100c32c84399a004eb443ba0030f758 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + DISABLE_PARALLEL_CONFIGURE + PREFER_NINJA + OPTIONS + -DBUILD_UT=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/wavpack/CONTROL b/ports/wavpack/CONTROL index e8edf703e09939..a0052e027638ef 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: 1 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..f2b7d87cf1acca 100644 --- a/ports/wavpack/portfile.cmake +++ b/ports/wavpack/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -24,13 +24,14 @@ 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() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME wavpack) diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL index 4a284f09e46296..fee55c603f02ea 100644 --- a/ports/websocketpp/CONTROL +++ b/ports/websocketpp/CONTROL @@ -1,5 +1,5 @@ Source: websocketpp -Version: 0.8.1-1 +Version: 0.8.2 Build-Depends: zlib, openssl, boost-asio Homepage: https://github.com/zaphoyd/websocketpp Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file diff --git a/ports/websocketpp/portfile.cmake b/ports/websocketpp/portfile.cmake index 2da84ba264ce9c..8feb3bd8e9d9e6 100644 --- a/ports/websocketpp/portfile.cmake +++ b/ports/websocketpp/portfile.cmake @@ -1,25 +1,24 @@ #header-only library -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO zaphoyd/websocketpp - REF 1c699ce46843a787482a703fdeff9271fbb7bb5d - SHA512 9de30e02e09b066dca8d840963e78673ef118e5183f9638b8a5c941116422916fe9fe02bb5271843aeb292a460f159b5957887594c0824a88600e6c4a5620dbd + REF 56123c87598f8b1dd471be83ca841ceae07f95ba # 0.8.2 + SHA512 f185a66e5a7c783254352a6ef87e2e559f681032b7368765d08393ed12bcae76825abed7dcaea73de09df644320409dad46279701f5f469520542a2c9b6a6163 HEAD_REF master ) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/websocketpp) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/${PORT}) # Copy the header files file(COPY "${SOURCE_PATH}/websocketpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.hpp") set(PACKAGE_INSTALL_INCLUDE_DIR "\${CMAKE_CURRENT_LIST_DIR}/../../include") -set(WEBSOCKETPP_VERSION 0.8.1) +set(WEBSOCKETPP_VERSION 0.8.2) set(PACKAGE_INIT " macro(set_and_check) set(\${ARGV}) endmacro() ") -configure_file(${SOURCE_PATH}/websocketpp-config.cmake.in "${CURRENT_PACKAGES_DIR}/share/websocketpp/websocketpp-config.cmake" @ONLY) -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/websocketpp/copyright COPYONLY) +configure_file(${SOURCE_PATH}/websocketpp-config.cmake.in "${CURRENT_PACKAGES_DIR}/share/${PORT}/websocketpp-config.cmake" @ONLY) +configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/wil/CONTROL b/ports/wil/CONTROL index 44007f50182b8d..00b29b2e6af113 100644 --- a/ports/wil/CONTROL +++ b/ports/wil/CONTROL @@ -1,3 +1,3 @@ Source: wil -Version: 2019-11-07 +Version: 2020-05-19 Description: The Windows Implementation Libraries (WIL) is a header-only C++ library created to make life easier for developers on Windows through readable type-safe C++ interfaces for common Windows coding patterns. \ No newline at end of file diff --git a/ports/wil/portfile.cmake b/ports/wil/portfile.cmake index b3c74aa0df0e91..b6bbe80a11e23c 100644 --- a/ports/wil/portfile.cmake +++ b/ports/wil/portfile.cmake @@ -4,8 +4,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/wil - REF fd6d99e737cc713dd3217663a502ab8c31d38820 - SHA512 4b38fa803145b57349b3d68681fc4d0020665285f3fd94f71afe77466f39858e85127688856bc15f08d468e9f5cc8669ba65e7b024398edfb3b9320da61ea69d + REF 3c00e7f1d8cf9930bbb8e5be3ef0df65c84e8928 + SHA512 c9c3b4a41f7523a6da6378def4a6b868e9f66438998d04ae8489b9784db91664af7af3ab6ef73c104b9ac100c0dc5ae6a13e9cb9f679ba428a4abc07b32a7dce HEAD_REF master ) diff --git a/ports/wincrypt/CONTROL b/ports/wincrypt/CONTROL index c838654071dbdc..615d2c3d91c751 100644 --- a/ports/wincrypt/CONTROL +++ b/ports/wincrypt/CONTROL @@ -1,3 +1,3 @@ Source: wincrypt -Version: 0.0-1 +Version: 0.0-2 Description: Windows Cryptography. \ No newline at end of file diff --git a/ports/wincrypt/portfile.cmake b/ports/wincrypt/portfile.cmake index 5cb5a1b196dc84..9eaedf3d243da2 100644 --- a/ports/wincrypt/portfile.cmake +++ b/ports/wincrypt/portfile.cmake @@ -1,14 +1,11 @@ -include(vcpkg_common_functions) - -vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) vcpkg_get_windows_sdk(WINDOWS_SDK) if (WINDOWS_SDK MATCHES "10.") - set(LIBFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\Crypt32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\Crypt32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\${WINDOWS_SDK}\\um") elseif(WINDOWS_SDK MATCHES "8.") - set(LIBFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\Crypt32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Include\\um") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\Crypt32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\um") else() message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") endif() @@ -27,4 +24,4 @@ elseif(WINDOWS_SDK MATCHES "8.") endif() # Allow empty include directory -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) \ No newline at end of file +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/winpcap/CONTROL b/ports/winpcap/CONTROL index ddddcab1cbcdff..c745c2d96ae12f 100644 --- a/ports/winpcap/CONTROL +++ b/ports/winpcap/CONTROL @@ -1,4 +1,5 @@ Source: winpcap -Version: 4.1.3-2 +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 964122d1789248..8549c543d26c8a 100644 --- a/ports/winpcap/portfile.cmake +++ b/ports/winpcap/portfile.cmake @@ -1,4 +1,6 @@ -include(vcpkg_common_functions) +if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libpcap") + message(FATAL_ERROR "FATAL ERROR: libpcap and winpcap are incompatible.") +endif() set(WINPCAP_VERSION 4_1_3) @@ -43,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) @@ -109,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" @@ -120,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" @@ -133,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 @@ -148,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( @@ -176,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/winreg/CONTROL b/ports/winreg/CONTROL index 0e2cc71886c5de..64f131cc917bd5 100644 --- a/ports/winreg/CONTROL +++ b/ports/winreg/CONTROL @@ -1,5 +1,5 @@ Source: winreg -Version: 1.2.1-1 +Version: 3.1.0 Homepage: https://github.com/GiovanniDicanio/WinReg Description: High-level C++ wrapper around the Windows Registry C API. -Supports: windows || uwp \ No newline at end of file +Supports: windows|uwp \ No newline at end of file diff --git a/ports/winreg/portfile.cmake b/ports/winreg/portfile.cmake index ded93e42d109b1..4293dc22606d2b 100644 --- a/ports/winreg/portfile.cmake +++ b/ports/winreg/portfile.cmake @@ -1,21 +1,16 @@ # WinReg - Header-only library - -include(vcpkg_common_functions) - -if(NOT VCPKG_TARGET_IS_WINDOWS) - message("winreg only support windows.") -endif() +vcpkg_fail_port_install(ON_TARGET "linux" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GiovanniDicanio/WinReg - REF v1.2.1 - SHA512 c919f91bf37b2fd7c30f6463430e07f3b8d1a01b8d4c84591b56299faf9d5b651d7c3b35a2adc22e3b0aa471627060a45e179f98f309242683b17d4d0d81cb7b + REF d59fd46431f0c7ca5e3339918455b831c63bba25 #v3.1.0 + SHA512 98dea669415dcb4e577c92506050a9defab5ac5f70e9d783d0b379297d84e0e2b56afc230b86ff190421a0d54b283e7abe72bb3cf53ecfe3fbe90f29c335e08c HEAD_REF master ) # Copy the single reusable library header -file(COPY ${SOURCE_PATH}/WinReg/WinReg/WinReg.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) +file(COPY ${SOURCE_PATH}/WinReg/WinReg.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) # 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/winsock2/CONTROL b/ports/winsock2/CONTROL index 298fd7ebd4b07e..1f8aff430cf0fa 100644 --- a/ports/winsock2/CONTROL +++ b/ports/winsock2/CONTROL @@ -1,3 +1,3 @@ Source: winsock2 -Version: 0.0-1 +Version: 0.0-2 Description: Windows Sockets. \ No newline at end of file diff --git a/ports/winsock2/portfile.cmake b/ports/winsock2/portfile.cmake index 76f3bc23db0827..b684c2f4327697 100644 --- a/ports/winsock2/portfile.cmake +++ b/ports/winsock2/portfile.cmake @@ -1,14 +1,11 @@ -include(vcpkg_common_functions) - -vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) vcpkg_get_windows_sdk(WINDOWS_SDK) if (WINDOWS_SDK MATCHES "10.") - set(LIBFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\Ws2_32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\Ws2_32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\${WINDOWS_SDK}\\um") elseif(WINDOWS_SDK MATCHES "8.") - set(LIBFILEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\Ws2_32.Lib") - set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Include\\um") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\Ws2_32.Lib") + set(HEADERSPATH "$ENV{WindowsSdkDir}Include\\um") else() message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") endif() @@ -27,4 +24,4 @@ elseif(WINDOWS_SDK MATCHES "8.") endif() # Allow empty include directory -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) \ No newline at end of file +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/wtl/CONTROL b/ports/wtl/CONTROL index f5fb514837a528..db55ce52f709d0 100644 --- a/ports/wtl/CONTROL +++ b/ports/wtl/CONTROL @@ -1,5 +1,4 @@ Source: wtl -Version: 10.0-4 +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. -Build-Depends: diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake index 81ae30bb5120a1..0f8d189a867d4a 100644 --- a/ports/wtl/portfile.cmake +++ b/ports/wtl/portfile.cmake @@ -1,15 +1,10 @@ -include(vcpkg_common_functions) - -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" - FILENAME "WTL10_9163.zip" - SHA512 feb7fb1c456e44ad05610f31f8c0f964eb6ce3eadf65a389219051f0ea2547069727666616622631cd90e25ea4a682a7c88c7089a374181870717246ad44e035 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO wtl/WTL%2010 + REF WTL%2010.0.10077 + FILENAME "WTL10_1077..zip" NO_REMOVE_ONE_LEVEL + 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 e41e87222a3ec6..78c7373ca1660c 100644 --- a/ports/wxwidgets/CONTROL +++ b/ports/wxwidgets/CONTROL @@ -1,5 +1,5 @@ Source: wxwidgets -Version: 3.1.3 +Version: 3.1.4 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 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-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 e2cb15df140205..55186b15ea17a8 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -1,11 +1,12 @@ -include(vcpkg_common_functions) 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 + PATCHES + disable-platform-lib-dir.patch + fix-stl-build-vs2019-16.6.patch ) set(OPTIONS) @@ -37,6 +38,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 +59,13 @@ 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) - 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) diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index 58dab0c35d74ab..b49bf0a7729147 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -1,4 +1,5 @@ Source: x264 -Version: 157-303c484ec828ed0-7 +Version: 157-303c484ec828ed0-8 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 \ No newline at end of file +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 diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index d1ed982a5e97e8..d7aff89d7b49b5 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -1,6 +1,6 @@ set(X264_VERSION 157) -vcpkg_fail_port_install(ON_TARGET "Linux" "OSX") +vcpkg_fail_port_install(ON_TARGET "OSX") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -27,11 +27,7 @@ vcpkg_configure_make( ) vcpkg_install_make() - -if(NOT VCPKG_TARGET_IS_UWP) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x264.exe ${CURRENT_PACKAGES_DIR}/tools/x264/x264.exe) -endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig @@ -57,4 +53,4 @@ endif() vcpkg_copy_pdbs() -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/x265/CONTROL b/ports/x265/CONTROL index c94ba68012bbf8..31ba77050f0aa1 100644 --- a/ports/x265/CONTROL +++ b/ports/x265/CONTROL @@ -1,4 +1,4 @@ Source: x265 -Version: 3.2-3 +Version: 3.2-4 Homepage: https://bitbucket.org/multicoreware/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 08a34eee1dd32a..eaef036f1e22f7 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -44,7 +44,7 @@ elseif(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsS file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x265.exe ${CURRENT_PACKAGES_DIR}/tools/x265/x265.exe) endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) endif() diff --git a/ports/xalan-c/CONTROL b/ports/xalan-c/CONTROL index dcefa51724b0d0..f14ca7a159eb97 100644 --- a/ports/xalan-c/CONTROL +++ b/ports/xalan-c/CONTROL @@ -1,5 +1,5 @@ Source: xalan-c -Version: 1.11-11 +Version: 1.11-12 Homepage: https://github.com/apache/xalan-c Description: Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types Build-Depends: xerces-c diff --git a/ports/xalan-c/portfile.cmake b/ports/xalan-c/portfile.cmake index 78ae19cf21e197..6fe1c4bc916551 100644 --- a/ports/xalan-c/portfile.cmake +++ b/ports/xalan-c/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -18,6 +18,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_copy_tools(TOOL_NAMES Xalan AUTO_CLEAN) if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake) vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/xalanc) @@ -31,14 +32,7 @@ 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) -else() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/Xalan.exe ${CURRENT_PACKAGES_DIR}/debug/bin/Xalan.exe) -endif() - # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xalan-c) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/xalan-c/LICENSE ${CURRENT_PACKAGES_DIR}/share/xalan-c/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/xbyak/CONTROL b/ports/xbyak/CONTROL new file mode 100644 index 00000000000000..5239d99c4b20d7 --- /dev/null +++ b/ports/xbyak/CONTROL @@ -0,0 +1,5 @@ +Source: xbyak +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 new file mode 100644 index 00000000000000..b365c38fc29302 --- /dev/null +++ b/ports/xbyak/portfile.cmake @@ -0,0 +1,14 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO herumi/xbyak + REF v5.93 + SHA512 0c7052b2aeffc1aec541991a644753327232428ba7d8719e250a3afcc66b26beca2b92476f17af8121ceaacd822515e65d082e94b9f72fa29b4a005e32065843 + HEAD_REF master +) + +# handle license file +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# copy headers +file(GLOB HEADER_FILES ${SOURCE_PATH}/xbyak/*.h) +file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/xbyak) diff --git a/ports/xerces-c/CONTROL b/ports/xerces-c/CONTROL index c5f379cac5420e..54032ce8cd9c86 100644 --- a/ports/xerces-c/CONTROL +++ b/ports/xerces-c/CONTROL @@ -1,5 +1,5 @@ Source: xerces-c -Version: 3.2.2-13 +Version: 3.2.3-1 Homepage: https://github.com/apache/xerces-c Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. @@ -7,6 +7,6 @@ Feature: icu Description: ICU support Build-Depends: icu -Feature: xmlch_wchar +Feature: xmlch-wchar Description: XMLCh type uses wchar_t diff --git a/ports/xerces-c/no-symlinks-in-static-build.patch b/ports/xerces-c/no-symlinks-in-static-build.patch deleted file mode 100644 index 34bd732d3c8857..00000000000000 --- a/ports/xerces-c/no-symlinks-in-static-build.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index c29aa25..3106d77 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -1285,15 +1285,17 @@ if(MSVC) - set_target_properties(xerces-c PROPERTIES RUNTIME_OUTPUT_NAME "xerces-c_${INTERFACE_VERSION_U}") - set_target_properties(xerces-c PROPERTIES DEBUG_POSTFIX "D") - elseif(UNIX) -- # For strict libtool compatibility on Unix. It's a horrible hack to -- # set the version in the filename, and create the symlink at install -- # time. Note: could be dropped when the SONAME is updated and -- # libtool compatibility is no longer required. -- set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") -- file(GENERATE -- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" -- CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c.so\")") -- install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") -+ if(BUILD_SHARED_LIBS) -+ # For strict libtool compatibility on Unix. It's a horrible hack to -+ # set the version in the filename, and create the symlink at install -+ # time. Note: could be dropped when the SONAME is updated and -+ # libtool compatibility is no longer required. -+ set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") -+ file(GENERATE -+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" -+ CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c.so\")") -+ install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") -+ endif() - else() - # Not used for the common cases, though this would be the default if - # not for libtool compatibility. diff --git a/ports/xerces-c/portfile.cmake b/ports/xerces-c/portfile.cmake index 1f24b672a84952..18a29890b22317 100644 --- a/ports/xerces-c/portfile.cmake +++ b/ports/xerces-c/portfile.cmake @@ -1,20 +1,19 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/xerces-c - REF v3.2.2 - SHA512 e4b2d3499fb4d1d1bcaf991ee858f352112683084b9cc7855c0e52e7fc8cc982a8e3cd548fa30718af6a6dee40e460d82ffcd3480a50f7e7516b462b2c2080c6 + REF v3.2.3 + SHA512 aaafe2de4ea156d94e71e3631c79bd66660badf17bf2a19587a0ca34011f70bd1584a0beef909409a3ff05eecea9d37ffee6dbb267625f59217fd86705d2cd28 HEAD_REF master PATCHES disable-tests.patch remove-dll-export-macro.patch - no-symlinks-in-static-build.patch ) set(DISABLE_ICU ON) if("icu" IN_LIST FEATURES) set(DISABLE_ICU OFF) endif() -if ("xmlch_wchar" IN_LIST FEATURES) +if ("xmlch-wchar" IN_LIST FEATURES) set(XMLCHTYPE -Dxmlch-type=wchar_t) endif() 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/xmlsec/CONTROL b/ports/xmlsec/CONTROL index 77e31db47ef83a..1f3750e5328e26 100644 --- a/ports/xmlsec/CONTROL +++ b/ports/xmlsec/CONTROL @@ -1,5 +1,5 @@ Source: xmlsec -Version: 1.2.29-2 +Version: 1.2.30 Homepage: https://www.aleksey.com/xmlsec/ Description: XML Security Library is a C library based on LibXML2. The library supports major XML security standards. Build-Depends: libxml2, openssl diff --git a/ports/xmlsec/portfile.cmake b/ports/xmlsec/portfile.cmake index 9c6d8d7f3ddeef..0c47010e317487 100644 --- a/ports/xmlsec/portfile.cmake +++ b/ports/xmlsec/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lsh123/xmlsec - REF xmlsec-1_2_29 - SHA512 b53eeac801cbcf4b18aa7f4fcec5fea5cae26e9cbef923d6e807ee98b988840943f00781ec6194b300403bd7f656c76ba96efce29c8b49920c9f0d67ba14ea57 + REF xmlsec-1_2_30 + SHA512 e631e7b132b39bb53f2713fe34880f8b4e81fd759fd206e8872c066236a8a64713842ba5e0ba9ad2f345f9f6d1da304acbeb61411b52cfa79d2934fc9e260ce9 HEAD_REF master PATCHES 0001-uwp-fix.patch diff --git a/ports/xmsh/CONTROL b/ports/xmsh/CONTROL index 771abe76f14639..758a54ba3a1cca 100644 --- a/ports/xmsh/CONTROL +++ b/ports/xmsh/CONTROL @@ -1,4 +1,5 @@ Source: xmsh -Version: 0.5.2 +Version: 0.5.2-1 Description: Reference Implementation of XMSH Library Build-Depends: tl-expected, nlohmann-json +Homepage: https://gitlab.com/libxmsh/xmsh \ No newline at end of file diff --git a/ports/xmsh/portfile.cmake b/ports/xmsh/portfile.cmake index 615f8fa9a2bbc0..7d74e7da9cd9dd 100644 --- a/ports/xmsh/portfile.cmake +++ b/ports/xmsh/portfile.cmake @@ -1,19 +1,15 @@ -include(vcpkg_common_functions) - vcpkg_find_acquire_program(PYTHON3) -if (NOT VCPKG_TARGET_IS_WINDOWS) - message("Building with a gcc version less than 7.1.0 is not supported.") -else() - message(FATAL_ERROR "xmsh only support Linux/OSX.") -endif() +vcpkg_fail_port_install(ON_TARGET "Windows") +message("Building with a gcc version less than 7.1.0 is not supported.") -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO libxmsh/xmsh - REF e1900845b796ef977db70519b2ac08eebd788236 #v0.5.2 - SHA512 643c6c94956de9b6fae635b6528e8ba756f4a2bc38de71613c2dd8d47f4a043aee7b6e7fec1870b306be3bea9f5c0c81d1d343bfc27883b3fba986fbc5b15406 - HEAD_REF master +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.com + OUT_SOURCE_PATH SOURCE_PATH + REPO libxmsh/xmsh + REF e1900845b796ef977db70519b2ac08eebd788236 + SHA512 643c6c94956de9b6fae635b6528e8ba756f4a2bc38de71613c2dd8d47f4a043aee7b6e7fec1870b306be3bea9f5c0c81d1d343bfc27883b3fba986fbc5b15406 + HEAD_REF master ) vcpkg_configure_cmake( @@ -29,6 +25,8 @@ set(ENV{PATH} "$ENV{PATH};${PYPATH}") vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -36,6 +34,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/copyright.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/xmsh RENAME copyright) - -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/copyright.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/yaml-cpp/0001-noexcept.patch b/ports/yaml-cpp/0001-noexcept.patch deleted file mode 100644 index e5e1882c0412bb..00000000000000 --- a/ports/yaml-cpp/0001-noexcept.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/include/yaml-cpp/exceptions.h b/include/yaml-cpp/exceptions.h -index 9c96859..a6045ee 100644 ---- a/include/yaml-cpp/exceptions.h -+++ b/include/yaml-cpp/exceptions.h -@@ -15,7 +15,7 @@ - - // This is here for compatibility with older versions of Visual Studio - // which don't support noexcept --#ifdef _MSC_VER -+#if defined(_MSC_VER) && _MSC_VER < 1900 - #define YAML_CPP_NOEXCEPT _NOEXCEPT - #else - #define YAML_CPP_NOEXCEPT noexcept -diff --git a/src/exceptions.cpp b/src/exceptions.cpp -index 9b6d891..931b4bc 100644 ---- a/src/exceptions.cpp -+++ b/src/exceptions.cpp -@@ -2,7 +2,7 @@ - - // This is here for compatibility with older versions of Visual Studio - // which don't support noexcept --#ifdef _MSC_VER -+#if defined(_MSC_VER) && _MSC_VER < 1900 - #define YAML_CPP_NOEXCEPT _NOEXCEPT - #else - #define YAML_CPP_NOEXCEPT noexcept diff --git a/ports/yaml-cpp/0003-cxx-std-features.patch b/ports/yaml-cpp/0003-cxx-std-features.patch deleted file mode 100644 index ac09c86c113b44..00000000000000 --- a/ports/yaml-cpp/0003-cxx-std-features.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c4d4be1..174264d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -279,6 +279,11 @@ set_target_properties(yaml-cpp PROPERTIES - COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags}" - ) - -+target_compile_features(yaml-cpp -+ PUBLIC -+ cxx_std_11 -+) -+ - set_target_properties(yaml-cpp PROPERTIES - VERSION "${YAML_CPP_VERSION}" - SOVERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}" diff --git a/ports/yaml-cpp/CONTROL b/ports/yaml-cpp/CONTROL index 1e0a781e2c5e43..bbd8056b25e7d3 100644 --- a/ports/yaml-cpp/CONTROL +++ b/ports/yaml-cpp/CONTROL @@ -1,4 +1,4 @@ Source: yaml-cpp -Version: 0.6.2-3 +Version: 0.6.3 Homepage: https://github.com/jbeder/yaml-cpp Description: yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec. diff --git a/ports/yaml-cpp/0002-fix-include-path.patch b/ports/yaml-cpp/fix-include-path.patch similarity index 80% rename from ports/yaml-cpp/0002-fix-include-path.patch rename to ports/yaml-cpp/fix-include-path.patch index 78c260831c03f8..9a7e9ff42da91e 100644 --- a/ports/yaml-cpp/0002-fix-include-path.patch +++ b/ports/yaml-cpp/fix-include-path.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d2d8810..c4d4be1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -326,7 +326,7 @@ else() - set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp) - endif() - --file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_ROOT_DIR}") -+set(REL_INCLUDE_DIR "../../include") - set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in - "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4732a45..3de71cc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -324,7 +324,7 @@ else() + endif() + + +-file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_ROOT_DIR}") ++set(REL_INCLUDE_DIR "../../include") + set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY) diff --git a/ports/yaml-cpp/portfile.cmake b/ports/yaml-cpp/portfile.cmake index 380f65aeeb326a..718bb50f1a1279 100644 --- a/ports/yaml-cpp/portfile.cmake +++ b/ports/yaml-cpp/portfile.cmake @@ -1,22 +1,26 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO jbeder/yaml-cpp - REF yaml-cpp-0.6.2 - SHA512 fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4 + REF 9a3624205e8774953ef18f57067b3426c1c5ada6 #v0.6.3 + SHA512 9bd0f05b882beed748eddb5d615bf356b7d1f31c4e3a4bbf80a6bdeb30b33fa1e0ccf596161a489169e6a111a3112e371d8d00514a0bfd02e6a6a11513904bed HEAD_REF master PATCHES - 0001-noexcept.patch - 0002-fix-include-path.patch - 0003-cxx-std-features.patch + fix-include-path.patch ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(YAML_BUILD_SHARED_LIBS ON) +else() + set(YAML_BUILD_SHARED_LIBS OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DYAML_CPP_BUILD_TOOLS=OFF -DYAML_CPP_BUILD_TESTS=OFF + -DYAML_BUILD_SHARED_LIBS=${YAML_BUILD_SHARED_LIBS} ) vcpkg_install_cmake() @@ -40,5 +44,4 @@ endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h "${DLL_H}") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/yaml-cpp) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/z3/CONTROL b/ports/z3/CONTROL index 866f2cf5f444c3..5f314a63de9c29 100644 --- a/ports/z3/CONTROL +++ b/ports/z3/CONTROL @@ -1,5 +1,5 @@ Source: z3 -Version: 4.8.6 +Version: 4.8.8 Homepage: https://github.com/Z3Prover/z3 Description: Z3 is a theorem prover from Microsoft Research. Supports: !arm64 && !uwp diff --git a/ports/z3/fix-install-path.patch b/ports/z3/fix-install-path.patch index 48ff2a8d855b72..cb21e13609c061 100644 --- a/ports/z3/fix-install-path.patch +++ b/ports/z3/fix-install-path.patch @@ -1,25 +1,23 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9b6f00b..8b47125 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -173,7 +173,8 @@ install(TARGETS libz3 - EXPORT Z3_EXPORTED_TARGETS - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" # On Windows this installs ``libz3.lib`` which CMake calls the "corresponding import library". Do we want this installed? -- RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" # For Windows. DLLs are runtime targets for CMake -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # For Windows. DLLs are runtime targets for CMake -+ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" # For MACOSX. - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" - ) - -diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt -index 2782463..b6cd2f1 100644 ---- a/src/shell/CMakeLists.txt -+++ b/src/shell/CMakeLists.txt -@@ -44,5 +44,5 @@ target_link_libraries(shell PRIVATE ${Z3_DEPENDENT_LIBS}) - z3_add_component_dependencies_to_target(shell ${shell_expanded_deps}) - z3_append_linker_flag_list_to_target(shell ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS}) - install(TARGETS shell -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ RUNTIME DESTINATION tools/z3 - ) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e8de0c7e4..064c18eab 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -173,6 +173,7 @@ install(TARGETS libz3 + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" # On Windows this installs ``libz3.lib`` which CMake calls the "corresponding import library". Do we want this installed? + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # For Windows. DLLs are runtime targets for CMake ++ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" # For MACOSX. + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + +diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt +index 278246341..b6cd2f1c1 100644 +--- a/src/shell/CMakeLists.txt ++++ b/src/shell/CMakeLists.txt +@@ -44,5 +44,5 @@ target_link_libraries(shell PRIVATE ${Z3_DEPENDENT_LIBS}) + z3_add_component_dependencies_to_target(shell ${shell_expanded_deps}) + z3_append_linker_flag_list_to_target(shell ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS}) + install(TARGETS shell +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ RUNTIME DESTINATION tools/z3 + ) diff --git a/ports/z3/portfile.cmake b/ports/z3/portfile.cmake index b6c46ad0126541..a7b02972453c3d 100644 --- a/ports/z3/portfile.cmake +++ b/ports/z3/portfile.cmake @@ -7,15 +7,15 @@ vcpkg_add_to_path("${PYTHON2_DIR}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Z3Prover/z3 - REF 78ed71b8de7d4d089f2799bf2d06f411ac6b9062 # z3-4.8.6 - SHA512 3505a2e3c634ea5369456b857665d9de538be631f7ce9b2eb84ef318081bffb286186abc98f7bcbf615c0396081aebc65ebc5f20135cd2b97c5228452550ffa4 + REF ad55a1f1c617a7f0c3dd735c0780fc758424c7f1 # z3-4.8.8 + SHA512 e9ee645e0a70e1884c3c7745c3c95445d009557f2f06d018a0368274758dedfd94960093b9ee9332212eb29d05aca76137e8ac61365ae0deb5c12fefbe2feee1 HEAD_REF master PATCHES fix-install-path.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(BUILD_STATIC "-DBUILD_LIBZ3_SHARED=OFF") + set(BUILD_STATIC "-DZ3_BUILD_LIBZ3_SHARED=OFF") endif() vcpkg_configure_cmake( diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 601fb1bc0eda06..b02b948ad50f87 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,4 +1,5 @@ Source: zlib -Version: 1.2.11-6 +Version: 1.2.11 +Port-Version: 7 Homepage: https://www.zlib.net/ Description: A compression library diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 01c331b119e34f..c05e7e252aceab 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(VERSION 1.2.11) vcpkg_download_distfile(ARCHIVE_FILE @@ -31,10 +29,26 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zlib RENAME copyright) +# Install the pkgconfig file +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc "-lz" "-lzlib") + endif() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc "-lz" "-lzlibd") + endif() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +endif() + +vcpkg_fixup_pkgconfig() + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE) +# vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE) diff --git a/ports/zstd/0001-export-zstd-config.patch b/ports/zstd/0001-export-zstd-config.patch new file mode 100644 index 00000000000000..43b39d4937c0ee --- /dev/null +++ b/ports/zstd/0001-export-zstd-config.patch @@ -0,0 +1,93 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 7adca875..8835d1c6 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -78,20 +78,20 @@ endif () + + # Split project to static and shared libraries build + if (ZSTD_BUILD_SHARED) +- add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources}) ++ add_library(libzstd SHARED ${Sources} ${Headers} ${PlatformDependResources}) + if (ZSTD_MULTITHREAD_SUPPORT) +- set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") ++ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") + if (UNIX) +- target_link_libraries(libzstd_shared ${THREADS_LIBS}) ++ target_link_libraries(libzstd ${THREADS_LIBS}) + endif () + endif() + endif () + if (ZSTD_BUILD_STATIC) +- add_library(libzstd_static STATIC ${Sources} ${Headers}) ++ add_library(libzstd STATIC ${Sources} ${Headers}) + if (ZSTD_MULTITHREAD_SUPPORT) +- set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") ++ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") + if (UNIX) +- target_link_libraries(libzstd_static ${THREADS_LIBS}) ++ target_link_libraries(libzstd ${THREADS_LIBS}) + endif () + endif () + endif () +@@ -99,16 +99,16 @@ endif () + # Add specific compile definitions for MSVC project + if (MSVC) + if (ZSTD_BUILD_SHARED) +- set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS") ++ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS") + endif () + if (ZSTD_BUILD_STATIC) +- set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS") ++ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS") + endif () + endif () + + # With MSVC static library needs to be renamed to avoid conflict with import library + if (MSVC) +- set(STATIC_LIBRARY_BASE_NAME zstd_static) ++ set(STATIC_LIBRARY_BASE_NAME zstd) + else () + set(STATIC_LIBRARY_BASE_NAME zstd) + endif () +@@ -116,7 +116,7 @@ endif () + # Define static and shared library names + if (ZSTD_BUILD_SHARED) + set_target_properties( +- libzstd_shared ++ libzstd + PROPERTIES + OUTPUT_NAME zstd + VERSION ${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH} +@@ -125,7 +125,7 @@ endif () + + if (ZSTD_BUILD_STATIC) + set_target_properties( +- libzstd_static ++ libzstd + PROPERTIES + OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME}) + endif () +@@ -154,12 +154,14 @@ install(FILES + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + + if (ZSTD_BUILD_SHARED) +- install(TARGETS libzstd_shared RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ install(TARGETS libzstd EXPORT zstd-config ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif() + if (ZSTD_BUILD_STATIC) +- install(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++ install(TARGETS libzstd EXPORT zstd-config ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif () + + # uninstall target +@@ -172,3 +174,6 @@ if (NOT TARGET uninstall) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif () ++ ++target_include_directories(libzstd PUBLIC $) ++install(EXPORT zstd-config DESTINATION share/cmake/zstd) diff --git a/ports/zstd/CONTROL b/ports/zstd/CONTROL index 1aa448753fc2a9..63ca9098cf463f 100644 --- a/ports/zstd/CONTROL +++ b/ports/zstd/CONTROL @@ -1,4 +1,5 @@ Source: zstd Version: 1.4.4 +Port-Version: 2 Description: Zstandard - Fast real-time compression algorithm Homepage: https://facebook.github.io/zstd/ diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake index ba97cd4b43e801..8ed5f36e9e1edf 100644 --- a/ports/zstd/portfile.cmake +++ b/ports/zstd/portfile.cmake @@ -1,10 +1,11 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebook/zstd REF 10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee # v1.4.4 SHA512 869eb031d2f8cfd9d93502835a373f6f2ec39dc1f41dd5fd0463d3d442c153915987d00bc862ae66bded5c5697e1803a1e68491803bd1a7b358397e6eba58f64 HEAD_REF dev + PATCHES + 0001-export-zstd-config.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -15,7 +16,7 @@ else() set(ZSTD_SHARED 1) endif() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) +if(VCPKG_TARGET_IS_WINDOWS) # Enable multithreaded mode. CMake build doesn't provide a multithreaded # library target, but it is the default in Makefile and VS projects. set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -DZSTD_MULTITHREAD") @@ -37,9 +38,15 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/zstd) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc" "-lzstd" "-lzstdd") +endif() +vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -if((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") foreach(HEADER zdict.h zstd.h zstd_errors.h) file(READ ${CURRENT_PACKAGES_DIR}/include/${HEADER} HEADER_CONTENTS) string(REPLACE "defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)" "1" HEADER_CONTENTS "${HEADER_CONTENTS}") @@ -47,6 +54,6 @@ if((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NA endforeach() endif() -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) -file(WRITE ${CURRENT_PACKAGES_DIR}/share/zstd/copyright "ZSTD is dual licensed - see LICENSE and COPYING files\n") +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "ZSTD is dual licensed - see LICENSE and COPYING files\n") diff --git a/ports/zxing-cpp/0002-improve-features.patch b/ports/zxing-cpp/0002-improve-features.patch new file mode 100644 index 00000000000000..5776c36eac36b4 --- /dev/null +++ b/ports/zxing-cpp/0002-improve-features.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5ade734..54071bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) + project(zxing) + set(CMAKE_CXX_STANDARD 11) + option(BUILD_TESTING "Enable generation of test targets" OFF) ++option(WITH_OPENCV "Build with opencv" OFF) ++option(WITH_ICONV "Build with iconv" OFF) + + set(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH}) + +@@ -43,8 +45,8 @@ if(WIN32) + endif() + + # OpenCV classes +-find_package(OpenCV) +-if(OpenCV_FOUND) ++if(WITH_OPENCV) ++ find_package(OpenCV REQUIRED) + list(APPEND LIBZXING_FILES + opencv/src/zxing/MatSource.cpp + opencv/src/zxing/MatSource.h +@@ -58,10 +60,10 @@ include_directories(core/src) + add_library(libzxing ${LIBZXING_FILES}) + set_target_properties(libzxing PROPERTIES PREFIX "") + +-find_package(Iconv) +-if(ICONV_FOUND) +- include_directories(${ICONV_INCLUDE_DIR}) +- target_link_libraries(libzxing ${ICONV_LIBRARIES}) ++if(WITH_ICONV) ++ find_package(Iconv REQUIRED) ++ include_directories(${Iconv_INCLUDE_DIRS}) ++ target_link_libraries(libzxing ${Iconv_LIBRARIES}) + else() + add_definitions(-DNO_ICONV=1) + endif() diff --git a/ports/zxing-cpp/CONTROL b/ports/zxing-cpp/CONTROL index fdf89409776fc6..89a07a22273ae0 100644 --- a/ports/zxing-cpp/CONTROL +++ b/ports/zxing-cpp/CONTROL @@ -1,5 +1,13 @@ Source: zxing-cpp -Version: 3.3.3-6 +Version: 3.3.3-7 Homepage: https://github.com/glassechidna/zxing-cpp -Build-Depends: opencv Description: Barcode detection and decoding library. +Default-Features: opencv, iconv + +Feature: opencv +Build-Depends: opencv +Description: Build with opencv + +Feature: iconv +Build-Depends: libiconv +Description: Build with libiconv \ No newline at end of file diff --git a/ports/zxing-cpp/portfile.cmake b/ports/zxing-cpp/portfile.cmake index 044342ed660ff5..3e966639076629 100644 --- a/ports/zxing-cpp/portfile.cmake +++ b/ports/zxing-cpp/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -10,16 +8,29 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-opencv4-compat.patch + 0002-improve-features.patch +) + +file(REMOVE ${SOURCE_PATH}/cmake/FindModules/FindIconv.cmake) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + opencv WITH_OPENCV + iconv WITH_ICONV ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_Iconv=ON + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/zxing/cmake TARGET_PATH share/zxing) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -28,18 +39,12 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor else() file(COPY ${CURRENT_PACKAGES_DIR}/bin/zxing DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/zxing) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/zxing) # Handle copyright -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/zxing-cpp) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/zxing-cpp) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/zxing-cpp/COPYING ${CURRENT_PACKAGES_DIR}/share/zxing-cpp/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/zydis/CONTROL b/ports/zydis/CONTROL index 3d50b2023d19d4..4bb8dd70f4a6af 100644 --- a/ports/zydis/CONTROL +++ b/ports/zydis/CONTROL @@ -1,4 +1,4 @@ Source: zydis -Version: 3.1.0 +Version: 3.1.0-1 Homepage: https://zydis.re -Description: Fast and lightweight x86/x86-64 disassembler library. \ No newline at end of file +Description: Fast and lightweight x86/x86-64 disassembler library. diff --git a/ports/zydis/portfile.cmake b/ports/zydis/portfile.cmake index d3dfe12161dca0..eea63d5a7771b0 100644 --- a/ports/zydis/portfile.cmake +++ b/ports/zydis/portfile.cmake @@ -30,6 +30,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_configure_cmake( + SOURCE_PATH ${ZYCORE_SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) if(EXES) diff --git a/ports/zyre/CONTROL b/ports/zyre/CONTROL index ca8a4507e31edb..5351afb3e035a5 100644 --- a/ports/zyre/CONTROL +++ b/ports/zyre/CONTROL @@ -1,5 +1,5 @@ Source: zyre -Version: 2019-07-07 +Version: 2019-07-07-1 Build-Depends: czmq Description: An open-source framework for proximity-based peer-to-peer applications Homepage: https://github.com/zeromq/zyre diff --git a/ports/zyre/portfile.cmake b/ports/zyre/portfile.cmake index db7e8e8ccde2e9..de44b4b03f3907 100644 --- a/ports/zyre/portfile.cmake +++ b/ports/zyre/portfile.cmake @@ -50,25 +50,7 @@ file(COPY DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(EXECUTABLE_SUFFIX ".exe") -else() - set(EXECUTABLE_SUFFIX "") -endif() - -file(COPY ${CURRENT_PACKAGES_DIR}/bin/zpinger${EXECUTABLE_SUFFIX} - DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - -if(ZYRE_BUILD_SHARED) - file(REMOVE - ${CURRENT_PACKAGES_DIR}/debug/bin/zpinger${EXECUTABLE_SUFFIX} - ${CURRENT_PACKAGES_DIR}/bin/zpinger${EXECUTABLE_SUFFIX}) -else() - file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() +vcpkg_copy_tools(TOOL_NAMES zpinger AUTO_CLEAN) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/scripts/Generate-SpdxLicenseList.ps1 b/scripts/Generate-SpdxLicenseList.ps1 new file mode 100644 index 00000000000000..8af5fd4de011dc --- /dev/null +++ b/scripts/Generate-SpdxLicenseList.ps1 @@ -0,0 +1,63 @@ +<# +#> +[CmdletBinding(PositionalBinding=$False)] +Param( + [Parameter(Mandatory=$True)] + [string]$Commit, + + [Parameter()] + [string]$GithubRepository = "spdx/license-list-data", + + [Parameter()] + [string]$LicensesOutFile = "$PSScriptRoot/../toolsrc/src/vcpkg/spdx-licenses.inc", + + [Parameter()] + [string]$ExceptionsOutFile = "$PSScriptRoot/../toolsrc/src/vcpkg/spdx-exceptions.inc" +) + +function Transform-JsonFile { + [CmdletBinding()] + Param( + [string]$Uri, + [string]$OutFile, + [string]$OuterName, + [string]$Id + ) + + $req = Invoke-WebRequest -Uri $Uri + + if ($req.StatusCode -ne 200) + { + Write-Error "Failed to GET $Uri" + throw + } + + $json = $req.Content | ConvertFrom-Json -Depth 10 + Write-Verbose "Writing output to $OutFile" + + $fileContent = @( + "// Data downloaded from $Uri", + "// Generated by scripts/Generate-SpdxLicenseList.ps1", + "{") + $json.$OuterName | ForEach-Object { + $fileContent += " `"$($_.$Id)`"," + } + $fileContent += "}" + + $fileContent -join "`n" | Out-File -FilePath $OutFile -Encoding 'utf8' +} + +$baseUrl = "https://raw.githubusercontent.com/$GithubRepository/$Commit/json" +Write-Verbose "Getting json files from $baseUrl" + +Transform-JsonFile ` + -Uri "$baseUrl/licenses.json" ` + -OutFile $LicensesOutFile ` + -OuterName 'licenses' ` + -Id 'licenseId' + +Transform-JsonFile ` + -Uri "$baseUrl/exceptions.json" ` + -OutFile $ExceptionsOutFile ` + -OuterName 'exceptions' ` + -Id 'licenseExceptionId' diff --git a/scripts/azure-pipelines/analyze-test-results.ps1 b/scripts/azure-pipelines/analyze-test-results.ps1 new file mode 100755 index 00000000000000..5bebe985c5c5c0 --- /dev/null +++ b/scripts/azure-pipelines/analyze-test-results.ps1 @@ -0,0 +1,440 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Analyze the test results as output by the CI system. + +.DESCRIPTION +Takes the set of port test results from $logDir, +and the baseline from $baselineFile, and makes certain that the set +of failures we expected are exactly the set of failures we got. +Then, uploads the logs from any unexpected failures. + +.PARAMETER logDir +Directory of xml test logs to analyze. + +.PARAMETER allResults +Include tests that have no change from the baseline in the output. + +.PARAMETER triplet +The triplet to analyze. + +.PARAMETER baselineFile +The path to the ci.baseline.txt file in the vcpkg repository. +#> +[CmdletBinding()] +Param( + [Parameter(Mandatory = $true)] + [string]$logDir, + [switch]$allResults, + [Parameter(Mandatory = $true)] + [string]$triplet, + [Parameter(Mandatory = $true)] + [string]$baselineFile +) + +$ErrorActionPreference = 'Stop' + +if ( -not (Test-Path $logDir) ) { + [System.Console]::Error.WriteLine("Log directory does not exist: $logDir") + exit +} + +<# +.SYNOPSIS +Creates an object the represents the test run. + +.DESCRIPTION +build_test_results takes an XML file of results from the CI run, +and constructs an object based on that XML file for further +processing. + +.OUTPUTS +An object with the following elements: + assemblyName: + assemblyStartDate: + assemblyStartTime: + assemblyTime: + collectionName: + collectionTime: + allTests: A hashtable with an entry for each port tested + The key is the name of the port + The value is an object with the following elements: + name: Name of the port (Does not include the triplet name) + result: Pass/Fail/Skip result from xunit + time: Test time in seconds + originalResult: Result as defined by Build.h in vcpkg source code + abi_tag: The port hash + features: The features installed + +.PARAMETER xmlFilename +The path to the XML file to parse. +#> +function build_test_results { + [CmdletBinding()] + Param + ( + [string]$xmlFilename + ) + if ( ($xmlFilename.Length -eq 0) -or ( -not( Test-Path $xmlFilename))) { + #write-error "Missing file: $xmlFilename" + return $null + } + + Write-Verbose "building test hash for $xmlFilename" + + [xml]$xmlContents = Get-Content $xmlFilename + + # This currently only supports one collection per assembly, which is the way + # the vcpkg tests are designed to run in the pipeline. + $xmlAssembly = $xmlContents.assemblies.assembly + $assemblyName = $xmlAssembly.name + $assemblyStartDate = $xmlAssembly."run-date" + $assemblyStartTime = $xmlAssembly."run-time" + $assemblyTime = $xmlAssembly.time + $xmlCollection = $xmlAssembly.collection + $collectionName = $xmlCollection.name + $collectionTime = $xmlCollection.time + + $allTestResults = @{ } + foreach ( $test in $xmlCollection.test) { + $name = ($test.name -replace ":.*$") + + # Reconstruct the original BuildResult enumeration (defined in Build.h) + # failure.message - why the test failed (valid only on test failure) + # reason - why the test was skipped (valid only when the test is skipped) + # case BuildResult::POST_BUILD_CHECKS_FAILED: + # case BuildResult::FILE_CONFLICTS: + # case BuildResult::BUILD_FAILED: + # case BuildResult::EXCLUDED: + # case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: + $originalResult = "NULLVALUE" + switch ($test.result) { + "Skip" { + $originalResult = $test.reason.InnerText + } + "Fail" { + $originalResult = $test.failure.message.InnerText + } + "Pass" { + $originalResult = "SUCCEEDED" + } + } + + $abi_tag = "" + $features = "" + foreach ( $trait in $test.traits.trait) { + switch ( $trait.name ) { + "abi_tag" { $abi_tag = $trait.value } + "features" { $features = $trait.value } + } + } + + # If additional fields get saved in the XML, then they should be added to this hash + # also consider using a PSCustomObject here instead of a hash + $testHash = @{ name = $name; result = $test.result; time = $test.time; originalResult = $originalResult; abi_tag = $abi_tag; features = $features } + $allTestResults[$name] = $testHash + } + + return @{ + assemblyName = $assemblyName; + assemblyStartDate = $assemblyStartDate; + assemblyStartTime = $assemblyStartTime; + assemblyTime = $assemblyTime; + collectionName = $collectionName; + collectionTime = $collectionTime; + allTests = $allTestResults + } +} + +<# +.SYNOPSIS +Creates an object that represents the baseline expectations. + +.DESCRIPTION +build_baseline_results converts the baseline file to an object representing +the expectations set up by the baseline file. It records four states: + 1) fail + 2) skip + 3) ignore + 4) pass -- this is represented by not being recorded +In other words, if a port is not contained in the object returned by this +cmdlet, expect it to pass. + +.OUTPUTS +An object containing the following fields: + collectionName: the triplet + fail: ports marked as fail + skip: ports marked as skipped + ignore: ports marked as ignore + +.PARAMETER baselineFile +The path to vcpkg's ci.baseline.txt. + +.PARAMETER triplet +The triplet to create the result object for. +#> +function build_baseline_results { + [CmdletBinding()] + Param( + $baselineFile, + $triplet + ) + #read in the file, strip out comments and blank lines and spaces, leave only the current triplet + #remove comments, remove empty lines, remove whitespace, then keep only those lines for $triplet + $baseline_list_raw = Get-Content -Path $baselineFile ` + | Where-Object { -not ($_ -match "\s*#") } ` + | Where-Object { -not ( $_ -match "^\s*$") } ` + | ForEach-Object { $_ -replace "\s" } ` + | Where-Object { $_ -match ":$triplet=" } + + #filter to skipped and trim the triplet + $skip_hash = @{ } + foreach ( $port in $baseline_list_raw | ? { $_ -match "=skip$" } | % { $_ -replace ":.*$" }) { + if ($skip_hash[$port] -ne $null) { + [System.Console]::Error.WriteLine("$($port):$($triplet) has multiple definitions in $baselineFile") + } + $skip_hash[$port] = $true + } + $fail_hash = @{ } + $baseline_list_raw | ? { $_ -match "=fail$" } | % { $_ -replace ":.*$" } | ? { $fail_hash[$_] = $true } | Out-Null + $ignore_hash = @{ } + $baseline_list_raw | ? { $_ -match "=ignore$" } | % { $_ -replace ":.*$" } | ? { $ignore_hash[$_] = $true } | Out-Null + + return @{ + collectionName = $triplet; + skip = $skip_hash; + fail = $fail_hash; + ignore = $ignore_hash + } +} + +<# +.SYNOPSIS +Analyzes the results of the current run against the baseline. + +.DESCRIPTION +combine_results compares the results to the baselie, and generates the results +for the CI -- whether it should pass or fail. + +.OUTPUTS +An object containing the following: +(Note that this is not the same data structure as build_test_results) + assemblyName: + assemblyStartDate: + assemblyStartTime: + assemblyTime: + collectionName: + collectionTime: + allTests: A hashtable of each port with a different status from the baseline + The key is the name of the port + The value is an object with the following data members: + name: The name of the port + result: xunit test result Pass/Fail/Skip + message: Human readable message describing the test result + time: time the current test results took to run. + baselineResult: + currentResult: + features: + ignored: list of ignored tests + +.PARAMETER baseline +The baseline object to use from build_baseline_results. + +.PARAMETER current +The results object to use from build_test_results. +#> +function combine_results { + [CmdletBinding()] + Param + ( + $baseline, + $current + ) + + if ($baseline.collectionName -ne $current.collectionName) { + Write-Warning "Comparing mismatched collections $($baseline.collectionName) and $($current.collectionName)" + } + + $currentTests = $current.allTests + + # lookup table with the results of all of the tests + $allTestResults = @{ } + + $ignoredList = @() + + Write-Verbose "analyzing $($currentTests.count) tests" + + foreach ($key in $currentTests.keys) { + Write-Verbose "analyzing $key" + + $message = $null + $result = $null + $time = $null + $currentResult = $null + $features = $currentTest.features + + $baselineResult = "Pass" + if ($baseline.fail[$key] -ne $null) { + Write-Verbose "$key is failing" + $baselineResult = "Fail" + } + elseif ( $baseline.skip[$key] -ne $null) { + Write-Verbose "$key is skipped" + $baselineResult = "Skip" + } + elseif ( $baseline.ignore[$key] -ne $null) { + $baselineResult = "ignore" + } + + $currentTest = $currentTests[$key] + + if ( $currentTest.result -eq $baselineResult) { + Write-Verbose "$key has no change from baseline" + $currentResult = $currentTest.result + if ($allResults) { + # Only marking regressions as failures but keep the skipped status + if ($currentResult -eq "Skip") { + $result = "Skip" + } + else { + $result = "Pass" + } + $message = "No change from baseline" + $time = $currentTest.time + } + } + elseif ( $baselineResult -eq "ignore") { + if ( $currentTest.result -eq "Fail" ) { + Write-Verbose "ignoring failure on $key" + $ignoredList += $key + } + } + else { + Write-Verbose "$key had a change from the baseline" + + $currentResult = $currentTest.result + # Test exists in both test runs but does not match. Determine if this is a regression + # Pass -> Fail = Fail (Regression) + # Pass -> Skip = Skip + # Fail -> Pass = Fail (need to update baseline) + # Fail -> Skip = Skip + # Skip -> Fail = Fail (Should not happen) + # Skip -> Pass = Fail (should not happen) + + $lookupTable = @{ + 'Pass' = @{ + 'Fail' = @('Fail', "Test passes in baseline but fails in current run. If expected update ci.baseline.txt with '$($key):$($current.collectionName)=fail'"); + 'Skip' = @($null, 'Test was skipped due to missing dependencies') + }; + 'Fail' = @{ + 'Pass' = @('Fail', "Test fails in baseline but now passes. Update ci.baseline.txt with '$($key):$($current.collectionName)=pass'"); + 'Skip' = @($null, 'Test fails in baseline but is skipped in current run') + }; + 'Skip' = @{ + 'Fail' = @('Skip', "Test is skipped in baseline but fails in current run. Results are ignored") + 'Pass' = @('Skip', "Test is skipped in baseline but passes in current run. Results are ignored") + } + } + $resultList = $lookupTable[$baselineResult][$currentResult] + $result = $resultList[0] + $message = $resultList[1] + $time = $currentTest.time + Write-Verbose ">$key $message" + } + + if ($result -ne $null) { + Write-Verbose "Adding $key to result list" + $allTestResults[$key] = @{ name = $key; result = $result; message = $message; time = $time; abi_tag = $currentTest.abi_tag; baselineResult = $baselineResult; currentResult = $currentResult; features = $features } + } + } + + return @{ + assemblyName = $current.assemblyName; + assemblyStartDate = $current.assemblyStartDate; + assemblyStartTime = $current.assemblyStartTime; + assemblyTime = $current.assemblyTime; + collectionName = $current.collectionName; + collectionTime = $current.collectionTime; + allTests = $allTestResults; + ignored = $ignoredList + } +} + +<# +.SYNOPSIS +Writes short errors to the CI logs. + +.DESCRIPTION +write_errors_for_summary takes a hashtable from triplets to combine_results +objects, and writes short errors to the CI logs. + +.PARAMETER complete_results +A hashtable from triplets to combine_results objects. +#> +function write_errors_for_summary { + [CmdletBinding()] + Param( + $complete_results + ) + + $failure_found = $false + + Write-Verbose "preparing error output for Azure Devops" + + foreach ($triplet in $complete_results.Keys) { + $triplet_results = $complete_results[$triplet] + + Write-Verbose "searching $triplet triplet" + + # add each port results + foreach ($testName in $triplet_results.allTests.Keys) { + $test = $triplet_results.allTests[$testName] + + Write-Verbose "checking $($testName):$triplet $($test.result)" + + if ($test.result -eq 'Fail') { + $failure_found = $true + if ($test.currentResult -eq "pass") { + [System.Console]::Error.WriteLine( ` + "PASSING, REMOVE FROM FAIL LIST: $($test.name):$triplet ($baselineFile)" ` + ) + } + else { + [System.Console]::Error.WriteLine( ` + "REGRESSION: $($test.name):$triplet. If expected, add $($test.name):$triplet=fail to $baselineFile." ` + ) + } + } + } + } +} + + +$complete_results = @{ } +Write-Verbose "looking for $triplet logs" + +# The standard name for logs is: +# .xml +# for example: +# x64-linux.xml + +$current_test_hash = build_test_results( Convert-Path "$logDir\$($triplet).xml" ) +$baseline_results = build_baseline_results -baselineFile $baselineFile -triplet $triplet + +if ($current_test_hash -eq $null) { + [System.Console]::Error.WriteLine("Missing $triplet test results in current test run") + $missing_triplets[$triplet] = "test" +} +else { + Write-Verbose "combining results..." + $complete_results[$triplet] = combine_results -baseline $baseline_results -current $current_test_hash +} + +Write-Verbose "done analyzing results" + +# emit error last. Unlike the table output this is going to be seen in the "status" section of the pipeline +# and needs to be formatted for a single line. +write_errors_for_summary -complete_results $complete_results diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml new file mode 100644 index 00000000000000..80c547633e3a11 --- /dev/null +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -0,0 +1,82 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +variables: + windows-pool: 'PrWin-2020-06-30' + linux-pool: 'PrLin-2020-06-30' + +stages: +- stage: check_cxx_formatting + displayName: 'Check the formatting of the C++' + pool: $(windows-pool) + jobs: + - job: + workspace: + clean: resources + steps: + - task: Powershell@2 + displayName: 'Check C++ Formatting' + inputs: + filePath: 'scripts/azure-pipelines/windows/Check-CxxFormatting.ps1' + arguments: '-Root .' +- stage: check_manifest_formatting + displayName: Check the formatting of port manifests + pool: $(windows-pool) + dependsOn: [] + jobs: + - job: + workspace: + clean: resources + steps: + - task: Powershell@2 + displayName: 'Check port manifest Formatting' + inputs: + filePath: 'scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1' + arguments: '-Root . -Downloads D:\Downloads' +- stage: run_port_ci + displayName: 'Run the Port CI' + dependsOn: + - check_cxx_formatting + - check_manifest_formatting + jobs: + - template: windows/azure-pipelines.yml + parameters: + triplet: x86-windows + jobName: x86_windows + poolName: $(windows-pool) + + - template: windows/azure-pipelines.yml + parameters: + triplet: x64-windows + jobName: x64_windows + poolName: $(windows-pool) + + - template: windows/azure-pipelines.yml + parameters: + triplet: x64-windows-static + jobName: x64_windows_static + poolName: $(windows-pool) + + - template: windows/azure-pipelines.yml + parameters: + triplet: x64-uwp + jobName: x64_uwp + poolName: $(windows-pool) + + - template: windows/azure-pipelines.yml + parameters: + triplet: arm64-windows + jobName: arm64_windows + poolName: $(windows-pool) + + - template: windows/azure-pipelines.yml + parameters: + triplet: arm-uwp + jobName: arm_uwp + poolName: $(windows-pool) + + - template: osx/azure-pipelines.yml + + - template: linux/azure-pipelines.yml + parameters: + poolName: $(linux-pool) diff --git a/scripts/azure-pipelines/create-vmss-helpers.psm1 b/scripts/azure-pipelines/create-vmss-helpers.psm1 new file mode 100755 index 00000000000000..1e83100368fbaa --- /dev/null +++ b/scripts/azure-pipelines/create-vmss-helpers.psm1 @@ -0,0 +1,166 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT + +<# +.SYNOPSIS +Returns whether there's a name collision in the resource group. + +.DESCRIPTION +Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test +collides names with any of the resources. + +.PARAMETER Test +The name to test. + +.PARAMETER Resources +The list of resources. +#> +function Find-ResourceGroupNameCollision { + [CmdletBinding()] + Param([string]$Test, $Resources) + + foreach ($resource in $Resources) { + if ($resource.ResourceGroupName -eq $Test) { + return $true + } + } + + return $false +} + +<# +.SYNOPSIS +Attempts to find a name that does not collide with any resources in the resource group. + +.DESCRIPTION +Find-ResourceGroupName takes a set of resources from Get-AzResourceGroup, and finds the +first name in {$Prefix, $Prefix-1, $Prefix-2, ...} such that the name doesn't collide with +any of the resources in the resource group. + +.PARAMETER Prefix +The prefix of the final name; the returned name will be of the form "$Prefix(-[1-9][0-9]*)?" +#> +function Find-ResourceGroupName { + [CmdletBinding()] + Param([string] $Prefix) + + $resources = Get-AzResourceGroup + $result = $Prefix + $suffix = 0 + while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) { + $suffix++ + $result = "$Prefix-$suffix" + } + + return $result +} + +<# +.SYNOPSIS +Generates a random password. + +.DESCRIPTION +New-Password generates a password, randomly, of length $Length, containing +only alphanumeric characters, underscore, and dash. + +.PARAMETER Length +The length of the returned password. +#> +function New-Password { + Param ([int] $Length = 32) + + # This 64-character alphabet generates 6 bits of entropy per character. + # The power-of-2 alphabet size allows us to select a character by masking a random Byte with bitwise-AND. + $alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-" + $mask = 63 + if ($alphabet.Length -ne 64) { + throw 'Bad alphabet length' + } + + [Byte[]]$randomData = [Byte[]]::new($Length) + $rng = $null + try { + $rng = [System.Security.Cryptography.RandomNumberGenerator]::Create() + $rng.GetBytes($randomData) + } + finally { + if ($null -ne $rng) { + $rng.Dispose() + } + } + + $result = '' + for ($idx = 0; $idx -lt $Length; $idx++) { + $result += $alphabet[$randomData[$idx] -band $mask] + } + + return $result +} + +<# +.SYNOPSIS +Waits for the shutdown of the specified resource. + +.DESCRIPTION +Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped' +code; if there is, it returns. If there isn't, it waits ten seconds and +tries again. + +.PARAMETER ResourceGroupName +The name of the resource group to look up the VM in. + +.PARAMETER Name +The name of the virtual machine to wait on. +#> +function Wait-Shutdown { + [CmdletBinding()] + Param([string]$ResourceGroupName, [string]$Name) + + Write-Host "Waiting for $Name to stop..." + while ($true) { + $Vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status + $highestStatus = $Vm.Statuses.Count + for ($idx = 0; $idx -lt $highestStatus; $idx++) { + if ($Vm.Statuses[$idx].Code -eq 'PowerState/stopped') { + return + } + } + + Write-Host "... not stopped yet, sleeping for 10 seconds" + Start-Sleep -Seconds 10 + } +} + +<# +.SYNOPSIS +Sanitizes a name to be used in a storage account. + +.DESCRIPTION +Sanitize-Name takes a string, and removes all of the '-'s and +lowercases the string, since storage account names must have no +'-'s and must be completely lowercase alphanumeric. It then makes +certain that the length of the string is not greater than 24, +since that is invalid. + +.PARAMETER RawName +The name to sanitize. +#> +function Sanitize-Name { + [CmdletBinding()] + Param( + [string]$RawName + ) + + $result = $RawName.Replace('-', '').ToLowerInvariant() + if ($result.Length -gt 24) { + Write-Error 'Sanitized name for storage account $result was too long.' + throw + } + + return $result +} + +Export-ModuleMember -Function Find-ResourceGroupName +Export-ModuleMember -Function New-Password +Export-ModuleMember -Function Wait-Shutdown +Export-ModuleMember -Function Sanitize-Name diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 new file mode 100644 index 00000000000000..b0e44765750b7e --- /dev/null +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -0,0 +1,179 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +<# +.SYNOPSIS +End-to-End tests for the vcpkg executable. + +.DESCRIPTION +These tests cover the command line interface and broad functions of vcpkg, including `install`, `remove` and certain +binary caching scenarios. They use the vcpkg executable in the current directory. + +.PARAMETER Triplet +The triplet to use for testing purposes. + +.PARAMETER WorkingRoot +The location used as scratch space for testing. + +#> + +[CmdletBinding()] +Param( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$Triplet, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$WorkingRoot +) + +$ErrorActionPreference = "Stop" + +$TestingRoot = Join-Path $WorkingRoot 'testing' +$buildtreesRoot = Join-Path $TestingRoot 'buildtrees' +$installRoot = Join-Path $TestingRoot 'installed' +$packagesRoot = Join-Path $TestingRoot 'packages' +$NuGetRoot = Join-Path $TestingRoot 'nuget' +$NuGetRoot2 = Join-Path $TestingRoot 'nuget2' +$ArchiveRoot = Join-Path $TestingRoot 'archives' +$commonArgs = @( + "--triplet", + $Triplet, + "--x-buildtrees-root=$buildtreesRoot", + "--x-install-root=$installRoot", + "--x-packages-root=$packagesRoot" +) + +function Refresh-TestRoot { + Remove-Item -Recurse -Force $TestingRoot -ErrorAction SilentlyContinue + mkdir $TestingRoot + mkdir $NuGetRoot +} + +function Require-FileExists { + [CmdletBinding()] + Param( + [string]$File + ) + if (-Not (Test-Path $File)) { + throw "'$CurrentTest' failed to create file '$File'" + } +} +function Require-FileNotExists { + [CmdletBinding()] + Param( + [string]$File + ) + if (Test-Path $File) { + throw "'$CurrentTest' should not have created file '$File'" + } +} +function Throw-IfFailed { + if ($LASTEXITCODE -ne 0) { + throw "'$CurrentTest' had a step with a nonzero exit code" + } +} + +if (-not $IsLinux -and -not $IsMacOS) +{ + Refresh-TestRoot + # Test msbuild props and targets + $CurrentTest = "zlib:x86-windows-static msbuild scripts\testing\integrate-install\..." + Write-Host $CurrentTest + ./vcpkg $commonArgs install zlib:x86-windows-static --x-binarysource=clear + Throw-IfFailed + foreach ($project in @("VcpkgTriplet", "VcpkgTriplet2", "VcpkgUseStatic", "VcpkgUseStatic2")) { + $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj" + ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ " + Throw-IfFailed + Remove-Item -Recurse -Force $TestingRoot\int + Remove-Item -Recurse -Force $TestingRoot\out + } + $CurrentTest = "zlib:x86-windows msbuild scripts\testing\integrate-install\..." + Write-Host $CurrentTest + ./vcpkg $commonArgs install zlib:x86-windows --x-binarysource=clear + Throw-IfFailed + foreach ($project in @("Project1", "NoProps")) { + $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj" + Write-Host $CurrentTest + ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ " + Throw-IfFailed + Remove-Item -Recurse -Force $TestingRoot\int + Remove-Item -Recurse -Force $TestingRoot\out + } +} + +Refresh-TestRoot + +# Test simple installation +$args = $commonArgs + @("install","rapidjson","--binarycaching","--x-binarysource=clear;files,$ArchiveRoot,write;nuget,$NuGetRoot,readwrite") +$CurrentTest = "./vcpkg $($args -join ' ')" +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed + +Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" + +# Test simple removal +$args = $commonArgs + @("remove", "rapidjson") +$CurrentTest = "./vcpkg $($args -join ' ')" +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed + +Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" + +# Test restoring from files archive +$args = $commonArgs + @("install","rapidjson","--binarycaching","--x-binarysource=clear;files,$ArchiveRoot,read") +$CurrentTest = "./vcpkg $($args -join ' ')" +Remove-Item -Recurse -Force $installRoot +Remove-Item -Recurse -Force $buildtreesRoot +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed + +Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" +Require-FileNotExists "$buildtreesRoot/rapidjson/src" + +# Test restoring from nuget +$args = $commonArgs + @("install","rapidjson","--binarycaching","--x-binarysource=clear;nuget,$NuGetRoot") +$CurrentTest = "./vcpkg $($args -join ' ')" +Remove-Item -Recurse -Force $installRoot +Remove-Item -Recurse -Force $buildtreesRoot +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed + +Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" +Require-FileNotExists "$buildtreesRoot/rapidjson/src" + +# Test four-phase flow +$args = $commonArgs + @("install","rapidjson","--dry-run","--x-write-nuget-packages-config=$TestingRoot/packages.config") +$CurrentTest = "./vcpkg $($args -join ' ')" +Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed +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 + +Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue +mkdir $NuGetRoot + +$args = $commonArgs + @("install","rapidjson","tinyxml","--binarycaching","--x-binarysource=clear;nuget,$NuGetRoot2;nuget,$NuGetRoot,write") +$CurrentTest = "./vcpkg $($args -join ' ')" +Write-Host $CurrentTest +./vcpkg @args +Throw-IfFailed +Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" +Require-FileExists "$installRoot/$Triplet/include/tinyxml.h" +Require-FileNotExists "$buildtreesRoot/rapidjson/src" +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" +} diff --git a/scripts/azure-pipelines/generate-skip-list.ps1 b/scripts/azure-pipelines/generate-skip-list.ps1 new file mode 100755 index 00000000000000..84b78b33878721 --- /dev/null +++ b/scripts/azure-pipelines/generate-skip-list.ps1 @@ -0,0 +1,83 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Generates a list of ports to skip in the CI. + +.DESCRIPTION +generate-skip-list takes a triplet, and the path to the ci.baseline.txt +file, and generates a skip list string to pass to vcpkg. + +.PARAMETER Triplet +The triplet to find skipped ports for. + +.PARAMETER BaselineFile +The path to the ci.baseline.txt file. +#> +[CmdletBinding()] +Param( + [string]$Triplet, + [string]$BaselineFile, + [switch]$SkipFailures = $false +) + +$ErrorActionPreference = 'Stop' + +if (-not (Test-Path -Path $BaselineFile)) { + Write-Error "Unable to find baseline file $BaselineFile" + throw +} + +#read in the file, strip out comments and blank lines and spaces +$baselineListRaw = Get-Content -Path $BaselineFile ` + | Where-Object { -not ($_ -match "\s*#") } ` + | Where-Object { -not ( $_ -match "^\s*$") } ` + | ForEach-Object { $_ -replace "\s" } + +############################################################### +# This script is running at the beginning of the CI test, so do a little extra +# checking so things can fail early. + +#verify everything has a valid value +$missingValues = $baselineListRaw | Where-Object { -not ($_ -match "=\w") } + +if ($missingValues) { + Write-Error "The following are missing values: $missingValues" + throw +} + +$invalidValues = $baselineListRaw ` + | Where-Object { -not ($_ -match "=(skip|pass|fail|ignore)$") } + +if ($invalidValues) { + Write-Error "The following have invalid values: $invalidValues" + throw +} + +$baselineForTriplet = $baselineListRaw ` + | Where-Object { $_ -match ":$Triplet=" } + +# Verify there are no duplicates (redefinitions are not allowed) +$file_map = @{ } +foreach ($port in $baselineForTriplet | ForEach-Object { $_ -replace ":.*$" }) { + if ($null -ne $file_map[$port]) { + Write-Error ` + "$($port):$($Triplet) has multiple definitions in $baselineFile" + throw + } + $file_map[$port] = $true +} + +# Format the skip list for the command line +if ($SkipFailures) { + $targetRegex = "=(?:skip|fail)$" +} else { + $targetRegex = "=skip$" +} + +$skip_list = $baselineForTriplet ` + | Where-Object { $_ -match $targetRegex } ` + | ForEach-Object { $_ -replace ":.*$" } +[string]::Join(",", $skip_list) diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml new file mode 100644 index 00000000000000..4d4eada627cbca --- /dev/null +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +jobs: +- job: x64_linux + pool: + name: ${{ parameters.poolName }} + workspace: + clean: resources + timeoutInMinutes: 1440 # 1 day + steps: + - bash: df -h + displayName: 'Report on Disk Space' + - bash: | + sudo mkdir /home/agent -m=777 + sudo chown `id -u` /home/agent + exit 0 + 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 + exit 0 + displayName: 'Create /mnt/vcpkg-ci/downloads' + - task: Bash@3 + displayName: 'Build vcpkg' + inputs: + filePath: bootstrap-vcpkg.sh + arguments: "-buildTests" + env: + VCPKG_DOWNLOADS: '/mnt/vcpkg-ci/downloads' + - bash: toolsrc/build.rel/vcpkg-test + displayName: 'Run vcpkg tests' + - 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-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot /mnt/vcpkg-ci -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' + inputs: + PathtoPublish: '$(System.ArtifactsDirectory)/failure-logs' + ArtifactName: 'x64-linux port build failure logs' + 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' + condition: always() + + inputs: + PathtoPublish: scripts/list_files + ArtifactName: "x64-linux package file lists" diff --git a/scripts/azure-pipelines/linux/create-vmss.ps1 b/scripts/azure-pipelines/linux/create-vmss.ps1 new file mode 100755 index 00000000000000..84c83dfeae2f3f --- /dev/null +++ b/scripts/azure-pipelines/linux/create-vmss.ps1 @@ -0,0 +1,324 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Creates a Linux virtual machine scale set, set up for vcpkg's CI. + +.DESCRIPTION +create-vmss.ps1 creates an Azure Linux VM scale set, set up for vcpkg's CI +system. See https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview +for more information. + +This script assumes you have installed Azure tools into PowerShell by following the instructions +at https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1 +or are running from Azure Cloud Shell. + +This script assumes you have installed the OpenSSH Client optional Windows component. +#> + +$Location = 'westus2' +$Prefix = 'PrLin-' + (Get-Date -Format 'yyyy-MM-dd') +$VMSize = 'Standard_D16a_v4' +$ProtoVMName = 'PROTOTYPE' +$LiveVMPrefix = 'BUILD' +$ErrorActionPreference = 'Stop' + +$ProgressActivity = 'Creating Scale Set' +$TotalProgress = 11 +$CurrentProgress = 1 + +Import-Module "$PSScriptRoot/../create-vmss-helpers.psm1" -DisableNameChecking + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating SSH key' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$sshDir = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName() +mkdir $sshDir +try { + ssh-keygen.exe -q -b 2048 -t rsa -f "$sshDir/key" -P [string]::Empty + $sshPublicKey = Get-Content "$sshDir/key.pub" +} finally { + Remove-Item $sshDir -Recurse -Force +} + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating resource group' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$ResourceGroupName = Find-ResourceGroupName $Prefix +$AdminPW = New-Password +New-AzResourceGroup -Name $ResourceGroupName -Location $Location +$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force +$Credential = New-Object System.Management.Automation.PSCredential ("AdminUser", $AdminPWSecure) + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating virtual network' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$allowHttp = New-AzNetworkSecurityRuleConfig ` + -Name AllowHTTP ` + -Description 'Allow HTTP(S)' ` + -Access Allow ` + -Protocol Tcp ` + -Direction Outbound ` + -Priority 1008 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange @(80, 443) + +$allowDns = New-AzNetworkSecurityRuleConfig ` + -Name AllowDNS ` + -Description 'Allow DNS' ` + -Access Allow ` + -Protocol * ` + -Direction Outbound ` + -Priority 1009 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange 53 + +$allowGit = New-AzNetworkSecurityRuleConfig ` + -Name AllowGit ` + -Description 'Allow git' ` + -Access Allow ` + -Protocol Tcp ` + -Direction Outbound ` + -Priority 1010 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange 9418 + +$allowStorage = New-AzNetworkSecurityRuleConfig ` + -Name AllowStorage ` + -Description 'Allow Storage' ` + -Access Allow ` + -Protocol * ` + -Direction Outbound ` + -Priority 1011 ` + -SourceAddressPrefix VirtualNetwork ` + -SourcePortRange * ` + -DestinationAddressPrefix Storage ` + -DestinationPortRange * + +$denyEverythingElse = New-AzNetworkSecurityRuleConfig ` + -Name DenyElse ` + -Description 'Deny everything else' ` + -Access Deny ` + -Protocol * ` + -Direction Outbound ` + -Priority 1012 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange * + +$NetworkSecurityGroupName = $ResourceGroupName + 'NetworkSecurity' +$NetworkSecurityGroup = New-AzNetworkSecurityGroup ` + -Name $NetworkSecurityGroupName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -SecurityRules @($allowHttp, $allowDns, $allowGit, $allowStorage, $denyEverythingElse) + +$SubnetName = $ResourceGroupName + 'Subnet' +$Subnet = New-AzVirtualNetworkSubnetConfig ` + -Name $SubnetName ` + -AddressPrefix "10.0.0.0/16" ` + -NetworkSecurityGroup $NetworkSecurityGroup + +$VirtualNetworkName = $ResourceGroupName + 'Network' +$VirtualNetwork = New-AzVirtualNetwork ` + -Name $VirtualNetworkName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -AddressPrefix "10.0.0.0/16" ` + -Subnet $Subnet + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating archives storage account' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$StorageAccountName = Sanitize-Name $ResourceGroupName + +New-AzStorageAccount ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -Name $StorageAccountName ` + -SkuName 'Standard_LRS' ` + -Kind StorageV2 + +$StorageAccountKeys = Get-AzStorageAccountKey ` + -ResourceGroupName $ResourceGroupName ` + -Name $StorageAccountName + +$StorageAccountKey = $StorageAccountKeys[0].Value + +$StorageContext = New-AzStorageContext ` + -StorageAccountName $StorageAccountName ` + -StorageAccountKey $StorageAccountKey + +New-AzStorageShare -Name 'archives' -Context $StorageContext +Set-AzStorageShareQuota -ShareName 'archives' -Context $StorageContext -Quota 1024 + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating prototype VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$NicName = $ResourceGroupName + 'NIC' +$Nic = New-AzNetworkInterface ` + -Name $NicName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -Subnet $VirtualNetwork.Subnets[0] + +$VM = New-AzVMConfig -Name $ProtoVMName -VMSize $VMSize -Priority 'Spot' -MaxPrice -1 +$VM = Set-AzVMOperatingSystem ` + -VM $VM ` + -Linux ` + -ComputerName $ProtoVMName ` + -Credential $Credential ` + -DisablePasswordAuthentication + +$VM = Add-AzVMNetworkInterface -VM $VM -Id $Nic.Id +$VM = Set-AzVMSourceImage ` + -VM $VM ` + -PublisherName 'Canonical' ` + -Offer 'UbuntuServer' ` + -Skus '18.04-LTS' ` + -Version latest + +$VM = Set-AzVMBootDiagnostic -VM $VM -Disable + +$VM = Add-AzVMSshPublicKey ` + -VM $VM ` + -KeyData $sshPublicKey ` + -Path "/home/AdminUser/.ssh/authorized_keys" + +New-AzVm ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -VM $VM + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Running provisioning script provision-image.sh in VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Invoke-AzVMRunCommand ` + -ResourceGroupName $ResourceGroupName ` + -VMName $ProtoVMName ` + -CommandId 'RunShellScript' ` + -ScriptPath "$PSScriptRoot\provision-image.sh" ` + -Parameter @{StorageAccountName=$StorageAccountName; ` + StorageAccountKey=$StorageAccountKey;} + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Restarting VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Converting VM to Image' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Stop-AzVM ` + -ResourceGroupName $ResourceGroupName ` + -Name $ProtoVMName ` + -Force + +Set-AzVM ` + -ResourceGroupName $ResourceGroupName ` + -Name $ProtoVMName ` + -Generalized + +$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName +$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name +$ImageConfig = New-AzImageConfig -Location $Location -SourceVirtualMachineId $VM.ID +$Image = New-AzImage -Image $ImageConfig -ImageName $ProtoVMName -ResourceGroupName $ResourceGroupName + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Deleting unused VM and disk' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Remove-AzVM -Id $VM.ID -Force +Remove-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $PrototypeOSDiskName -Force + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating scale set' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$VmssIpConfigName = $ResourceGroupName + 'VmssIpConfig' +$VmssIpConfig = New-AzVmssIpConfig -SubnetId $Nic.IpConfigurations[0].Subnet.Id -Primary -Name $VmssIpConfigName +$VmssName = $ResourceGroupName + 'Vmss' +$Vmss = New-AzVmssConfig ` + -Location $Location ` + -SkuCapacity 0 ` + -SkuName $VMSize ` + -SkuTier 'Standard' ` + -Overprovision $false ` + -UpgradePolicyMode Manual ` + -EvictionPolicy Delete ` + -Priority Spot ` + -MaxPrice -1 + +$Vmss = Add-AzVmssNetworkInterfaceConfiguration ` + -VirtualMachineScaleSet $Vmss ` + -Primary $true ` + -IpConfiguration $VmssIpConfig ` + -NetworkSecurityGroupId $NetworkSecurityGroup.Id ` + -Name $NicName + +$VmssPublicKey = New-Object -TypeName 'Microsoft.Azure.Management.Compute.Models.SshPublicKey' ` + -ArgumentList @('/home/AdminUser/.ssh/authorized_keys', $sshPublicKey) + +$Vmss = Set-AzVmssOsProfile ` + -VirtualMachineScaleSet $Vmss ` + -ComputerNamePrefix $LiveVMPrefix ` + -AdminUsername AdminUser ` + -AdminPassword $AdminPW ` + -LinuxConfigurationDisablePasswordAuthentication $true ` + -PublicKey @($VmssPublicKey) + +$Vmss = Set-AzVmssStorageProfile ` + -VirtualMachineScaleSet $Vmss ` + -OsDiskCreateOption 'FromImage' ` + -OsDiskCaching ReadWrite ` + -ImageReferenceId $Image.Id + +New-AzVmss ` + -ResourceGroupName $ResourceGroupName ` + -Name $VmssName ` + -VirtualMachineScaleSet $Vmss + +#################################################################################################### +Write-Progress -Activity $ProgressActivity -Completed +Write-Host "Location: $Location" +Write-Host "Resource group name: $ResourceGroupName" +Write-Host "User name: AdminUser" +Write-Host "Using generated password: $AdminPW" +Write-Host 'Finished!' diff --git a/scripts/azure-pipelines/linux/provision-image.sh b/scripts/azure-pipelines/linux/provision-image.sh new file mode 100755 index 00000000000000..5a59161e6e9a4c --- /dev/null +++ b/scripts/azure-pipelines/linux/provision-image.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +sudo apt -y update +sudo apt -y dist-upgrade +# Install common build dependencies +APT_PACKAGES="at curl unzip tar libxt-dev gperf libxaw7-dev cifs-utils \ + build-essential g++ gfortran zip libx11-dev libxkbcommon-x11-dev libxi-dev \ + libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev \ + libxcursor-dev yasm libnuma1 libnuma-dev python-six python3-six python-yaml \ + flex libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev \ + xutils-dev dh-autoreconf libgles2-mesa-dev ruby-full pkg-config" + +# Additionally required by qt5-base +APT_PACKAGES="$APT_PACKAGES libxext-dev libxfixes-dev libxrender-dev \ + libxcb1-dev libx11-xcb-dev libxcb-glx0-dev" + +# Additionally required by qt5-base for qt5-x11extras +APT_PACKAGES="$APT_PACKAGES libxkbcommon-dev libxcb-keysyms1-dev \ + libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev \ + libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \ + libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev" + +# Additionally required by libhdfs3 +APT_PACKAGES="$APT_PACKAGES libkrb5-dev" + +# Additionally required by mesa +APT_PACKAGES="$APT_PACKAGES python3-setuptools" + +# Additionally required/installed by Azure DevOps Scale Set Agents +APT_PACKAGES="$APT_PACKAGES liblttng-ust0 libkrb5-3 zlib1g libicu60" + +sudo apt -y install $APT_PACKAGES + +# Delete /etc/debian_version to prevent Azure Pipelines Scale Set Agents from +# removing some of the above +sudo apt-mark hold libcurl4 +sudo apt-mark hold liblttng-ust0 +sudo apt-mark hold libkrb5-3 +sudo apt-mark hold zlib1g +sudo apt-mark hold libicu60 + +# Install newer version of nasm than the apt package, required by intel-ipsec +mkdir /tmp/nasm +cd /tmp/nasm +curl -O https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz +tar -xf nasm-2.14.02.tar.gz +cd nasm-2.14.02/ +./configure --prefix=/usr && make -j +sudo make install +cd ~ + +# Install the latest Haskell stack +curl -sSL https://get.haskellstack.org/ | sudo sh + +# Install CUDA +wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.2.89-1_amd64.deb +sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +sudo dpkg -i cuda-repo-ubuntu1804_10.2.89-1_amd64.deb +wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb +sudo dpkg -i nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb +sudo apt -y update +sudo apt install -y --no-install-recommends cuda-compiler-10-2 cuda-libraries-dev-10-2 cuda-driver-dev-10-2 cuda-cudart-dev-10-2 libcublas10 cuda-curand-dev-10-2 +sudo apt install -y --no-install-recommends libcudnn7-dev + +# Install PowerShell +wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb +sudo dpkg -i packages-microsoft-prod.deb +sudo apt update +sudo add-apt-repository universe +sudo apt install -y powershell + +if [ -z "$StorageAccountName" ]; then +echo "No storage account supplied, skipping." +else +echo "Mapping storage account" + +# Write SMB credentials +sudo mkdir /etc/smbcredentials +smbCredentialFile=/etc/smbcredentials/$StorageAccountName.cred +echo "username=$StorageAccountName" | sudo tee $smbCredentialFile > /dev/null +echo "password=$StorageAccountKey" | sudo tee -a $smbCredentialFile > /dev/null +sudo chmod 600 $smbCredentialFile + +# Mount the archives SMB share to /archives +sudo mkdir /archives -m=777 +echo "//$StorageAccountName.file.core.windows.net/archives /archives cifs nofail,vers=3.0,credentials=$smbCredentialFile,serverino,dir_mode=0777,file_mode=0777 0 0" | sudo tee -a /etc/fstab +fi diff --git a/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 b/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 new file mode 100755 index 00000000000000..f2c0b3713953b7 --- /dev/null +++ b/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 @@ -0,0 +1,80 @@ +#!pwsh +#Requires -Version 6.0 + +<# +.SYNOPSIS +Installs the set of prerequisites for the macOS CI hosts. + +.DESCRIPTION +Install-Prerequisites.ps1 installs all of the necessary prerequisites +to run the vcpkg macOS CI in a vagrant virtual machine, +skipping all prerequisites that are already installed. + +.PARAMETER Force +Don't skip the prerequisites that are already installed. + +.INPUTS +None + +.OUTPUTS +None +#> +[CmdletBinding()] +Param( + [Parameter()] + [Switch]$Force +) + +Set-StrictMode -Version 2 + +if (-not $IsMacOS) { + Write-Error 'This script should only be run on a macOS host' + throw +} + +Import-Module "$PSScriptRoot/Utilities.psm1" + +$Installables = Get-Content "$PSScriptRoot/configuration/installables.json" | ConvertFrom-Json + +$Installables.Applications | ForEach-Object { + if (-not (Get-CommandExists $_.TestCommand)) { + Write-Host "$($_.Name) not installed; installing now" + } elseif ($Force) { + Write-Host "$($_.Name) found; attempting to upgrade or re-install" + } else { + Write-Host "$($_.Name) already installed" + return + } + + $pathToDmg = "~/Downloads/$($_.Name).dmg" + Get-RemoteFile -OutFile $pathToDmg -Uri $_.DmgUrl -Sha256 $_.Sha256 + + hdiutil attach $pathToDmg -mountpoint /Volumes/setup-installer + sudo installer -pkg "/Volumes/setup-installer/$($_.InstallerPath)" -target / + hdiutil detach /Volumes/setup-installer +} + +# Install plugins +$installedExtensionPacks = Get-InstalledVirtualBoxExtensionPacks + +$Installables.VBoxExtensions | ForEach-Object { + $extension = $_ + $installedExts = $installedExtensionPacks | Where-Object { $_.Pack -eq $extension.FullName -and $_.Usable -eq 'true' } + + if ($null -eq $installedExts) { + Write-Host "VBox extension: $($extension.Name) not installed; installing now" + } elseif ($Force) { + Write-Host "VBox extension: $($extension.Name) found; attempting to upgrade or re-install" + } else { + Write-Host "VBox extension: $($extension.Name) already installed" + return + } + + $pathToExt = "~/Downloads/$($extension.FullName -replace ' ','_').vbox-extpack" + + Get-RemoteFile -OutFile $pathToExt -Uri $extension.Url -Sha256 $extension.Sha256 | Out-Null + + Write-Host 'Attempting to install extension with sudo; you may need to enter your password' + sudo VBoxManage extpack install --replace $pathToExt + sudo VBoxManage extpack cleanup +} diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md new file mode 100644 index 00000000000000..0395908f0174f0 --- /dev/null +++ b/scripts/azure-pipelines/osx/README.md @@ -0,0 +1,69 @@ +# `vcpkg-eg-mac` VMs + +## Table of Contents + +- [`vcpkg-eg-mac` VMs](#vcpkg-eg-mac-vms) + - [Table of Contents](#table-of-contents) + - [Basic Usage](#basic-usage) + - [Setting up a new macOS machine](#setting-up-a-new-macos-machine) + +## Basic Usage + +The simplest usage, and one which should be used for when spinning up +new VMs, and when restarting old ones, is a simple: + +``` +$ cd ~/vagrant/vcpkg-eg-mac +$ vagrant up +``` + +Any modifications to the machines should be made in `configuration/VagrantFile` +and `Setup-VagrantMachines.ps1`, and make sure to push any changes! + +## Setting up a new macOS machine + +Before anything else, one must download `brew` and `powershell`. + +```sh +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +$ brew cask install powershell +``` + +Then, we need to download the `vcpkg` repository: + +```sh +$ git clone https://github.com/microsoft/vcpkg +``` + +And now all we need to do is set it up! Replace `XX` with the number of +the virtual machine. Generally, that should be the same as the number +for the physical machine; i.e., vcpkgmm-04 will have vcpkg-eg-mac-04. + +```sh +$ cd vcpkg/scripts/azure-pipelines/osx +$ ./Install-Prerequisites.ps1 -Force + # NOTE: you may get an error about CoreCLR; see the following paragraph if you do +$ ./Setup-VagrantMachines.ps1 XX \ + -Pat '' \ + -ArchivesUsername '' \ + -ArchivesAccessKey '' \ + -ArchivesUrn '.file.core.windows.net' \ + -ArchivesShare 'archives' +$ cd ~/vagrant/vcpkg-eg-mac +$ vagrant up +``` + +If you see the following error: + +``` +Failed to initialize CoreCLR, HRESULT: 0x8007001F +``` + +You have to reboot the machine; run + +```sh +$ sudo shutdown -r now +``` + +and wait for the machine to start back up. Then, start again from +`Install-Prerequisites.ps1`. diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 new file mode 100755 index 00000000000000..5600cb1ed6fc84 --- /dev/null +++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -0,0 +1,113 @@ +#!pwsh +#Requires -Version 6.0 + +<# +.SYNOPSIS +Sets up the configuration for the vagrant virtual machines. + +.DESCRIPTION +Setup-VagrantMachines.ps1 sets up the virtual machines for +vcpkg's macOS CI. It puts the VagrantFile and necessary +configuration JSON file into ~/vagrant/vcpkg-eg-mac. + +.PARAMETER Pat +The personal access token which has Read & Manage permissions on the ADO pool. + +.PARAMETER ArchivesUsername +The username for the archives share. + +.PARAMETER ArchivesAccessKey +The access key for the archives share. + +.PARAMETER ArchivesUrn +The URN of the archives share; looks like `foo.windows.core.net`. + +.PARAMETER ArchivesShare +The archives share name. + +.PARAMETER BaseName +The base name for the vagrant VM; the machine name is $BaseName-$MachineIdentifiers. +Defaults to 'vcpkg-eg-mac'. + +.PARAMETER Force +Delete any existing vagrant/vcpkg-eg-mac directory. + +.PARAMETER DiskSize +The size to make the temporary disks in gigabytes. Defaults to 425. + +.PARAMETER MachineIdentifiers +The numbers to give the machines; should match [0-9]{2}. + +.INPUTS +None + +.OUTPUTS +None +#> +[CmdletBinding(PositionalBinding=$False)] +Param( + [Parameter(Mandatory=$True)] + [String]$Pat, + + [Parameter(Mandatory=$True)] + [String]$ArchivesUsername, + + [Parameter(Mandatory=$True)] + [String]$ArchivesAccessKey, + + [Parameter(Mandatory=$True)] + [String]$ArchivesUrn, + + [Parameter(Mandatory=$True)] + [String]$ArchivesShare, + + [Parameter()] + [String]$BaseName = 'vcpkg-eg-mac', + + [Parameter()] + [Switch]$Force, + + [Parameter()] + [Int]$DiskSize = 425, + + [Parameter(Mandatory=$True, ValueFromRemainingArguments)] + [String[]]$MachineIdentifiers +) + +Set-StrictMode -Version 2 + +if (-not $IsMacOS) { + throw 'This script should only be run on a macOS host' +} + +if (Test-Path '~/vagrant') { + if ($Force) { + Write-Host 'Deleting existing directories' + Remove-Item -Recurse -Force -Path '~/vagrant' | Out-Null + } else { + throw '~/vagrant already exists; try re-running with -Force' + } +} + +Write-Host 'Creating new directories' +New-Item -ItemType 'Directory' -Path '~/vagrant' | Out-Null +New-Item -ItemType 'Directory' -Path '~/vagrant/vcpkg-eg-mac' | Out-Null + +Copy-Item ` + -Path "$PSScriptRoot/configuration/VagrantFile" ` + -Destination '~/vagrant/vcpkg-eg-mac/VagrantFile' + +$configuration = @{ + pat = $Pat; + base_name = $BaseName; + machine_identifiers = $MachineIdentifiers; + disk_size = $DiskSize; + archives = @{ + username = $ArchivesUsername; + access_key = $ArchivesAccessKey; + urn = $ArchivesUrn; + share = $ArchivesShare; + }; +} +ConvertTo-Json -InputObject $configuration -Depth 5 ` + | Set-Content -Path '~/vagrant/vcpkg-eg-mac/vagrant-configuration.json' diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 new file mode 100644 index 00000000000000..b7ad489bb7995a --- /dev/null +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -0,0 +1,151 @@ +#Requires -Version 6.0 +Set-StrictMode -Version 2 + +<# +.SYNOPSIS +Returns whether the specified command exists in the current environment. + +.DESCRIPTION +Get-CommandExists takes a string as a parameter, +and returns whether it exists in the current environment; +either a function, alias, or an executable in the path. +It's somewhat equivalent to `which`. + +.PARAMETER Name +Specifies the name of the command which may or may not exist. + +.INPUTS +System.String + The name of the command. + +.OUTPUTS +System.Boolean + Whether the command exists. +#> +function Get-CommandExists +{ + [CmdletBinding()] + [OutputType([Boolean])] + Param( + [Parameter(ValueFromPipeline)] + [String]$Name + ) + + $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) +} + +<# +.SYNOPSIS +Downloads a file and checks its hash. + +.DESCRIPTION +Get-RemoteFile takes a URI and a hash, +downloads the file at that URI to OutFile, +and checks that the hash of the downloaded file. +It then returns a FileInfo object corresponding to the downloaded file. + +.PARAMETER OutFile +Specifies the file path to download to. + +.PARAMETER Uri +The URI to download from. + +.PARAMETER Sha256 +The expected SHA256 of the downloaded file. + +.INPUTS +None + +.OUTPUTS +System.IO.FileInfo + The FileInfo for the downloaded file. +#> +function Get-RemoteFile +{ + [CmdletBinding(PositionalBinding=$False)] + [OutputType([System.IO.FileInfo])] + Param( + [Parameter(Mandatory=$True)] + [String]$OutFile, + [Parameter(Mandatory=$True)] + [String]$Uri, + [Parameter(Mandatory=$True)] + [String]$Sha256 + ) + + Invoke-WebRequest -OutFile $OutFile -Uri $Uri + $actualHash = Get-FileHash -Algorithm SHA256 -Path $OutFile + + if ($actualHash.Hash -ne $Sha256) { + throw @" +Invalid hash for file $OutFile; + expected: $Hash + found: $($actualHash.Hash) +Please make sure that the hash in the powershell file is correct. +"@ + } + + Get-Item $OutFile +} + +<# +.SYNOPSIS +Gets the list of installed extensions as powershell objects. + +.DESCRIPTION +Get-InstalledVirtualBoxExtensionPacks gets the installed extensions, +returning objects that look like: + +{ + Pack = 'Oracle VM VirtualBox Extension Pack'; + Version = '6.1.10'; + ... +} + +.INPUTS +None + +.OUTPUTS +PSCustomObject + The list of VBox Extension objects that are installed. +#> +function Get-InstalledVirtualBoxExtensionPacks +{ + [CmdletBinding()] + [OutputType([PSCustomObject])] + Param() + + $lines = VBoxManage list extpacks + + $result = @() + + $currentObject = $null + $currentKey = "" + $currentString = "" + + $lines | ForEach-Object { + $Line = $_ + if ($Line[0] -eq ' ') { + $currentString += "`n$($Line.Trim())" + } else { + if ($null -ne $currentObject) { + $currentObject.$currentKey = $currentString + } + $currentKey, $currentString = $Line -Split ':' + $currentString = $currentString.Trim() + + if ($currentKey.StartsWith('Pack no')) { + $currentKey = 'Pack' + if ($null -ne $currentObject) { + Write-Output ([PSCustomObject]$currentObject) + } + $currentObject = @{} + } + } + } + + if ($null -ne $currentObject) { + $currentObject.$currentKey = $currentString + Write-Output ([PSCustomObject]$currentObject) + } +} diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml new file mode 100644 index 00000000000000..3c9510bac5692b --- /dev/null +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -0,0 +1,68 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +jobs: +- job: x64_osx + pool: + name: vcpkgAgentPool + demands: Agent.OS -equals Darwin + workspace: + clean: resources + timeoutInMinutes: 1440 # 1 day + steps: + - bash: | + df -h + displayName: 'Report on Disk Space' + condition: always() + - bash: | + brew list autoconf || brew install autoconf + brew list automake || brew install automake + brew list pkg-config || brew install pkg-config + brew list libtool || brew install libtool + brew list bison || brew install bison + brew list gfortran || brew cask install gfortran + 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 + exit 0 + displayName: 'Create /Users/vagrant/Data/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: '*** 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)' + - bash: | + df -h + displayName: 'Report on Disk Space After Build' + condition: always() + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: x64-osx port build failure logs' + inputs: + PathtoPublish: '$(System.ArtifactsDirectory)/failure-logs' + ArtifactName: 'x64-osx port build failure logs' + 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' + condition: always() + + inputs: + PathtoPublish: scripts/list_files + ArtifactName: "x64-osx package file lists" diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile new file mode 100644 index 00000000000000..1e1cce50f06c99 --- /dev/null +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -0,0 +1,136 @@ +require 'json' + +require "erb" +include ERB::Util + +configuration = JSON.parse(File.read('./vagrant-configuration.json')) + +servers = configuration['machine_identifiers'].map do |id| + { + :hostname => "#{configuration['base_name']}-#{id}", + :box => 'ramsey/macos-catalina', + :ram => 12000, + :cpu => 5 + } +end + +brew_formulas = [ + 'autoconf', + 'automake', + 'libtool', + 'bison' ] + +brew_cask_formulas = [ + 'powershell', + 'gfortran' ] + +azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.171.1/vsts-agent-osx-x64-2.171.1.tar.gz' +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['urn']}/#{archives['share']}" + +Vagrant.configure('2') do |config| + # give them extra time to boot up + config.vm.boot_timeout = 600 + + servers.each do |machine| + config.vm.define machine[:hostname] do |node| + + node.vm.box = machine[:box] + node.vm.hostname = machine[:hostname] + node.vm.synced_folder '.', '/vagrant', disabled: true + + 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', + name: 'Format and mount the data filesystem', + inline: 'diskutil partitionDisk /dev/disk0 1 GPT jhfs+ data 0', + privileged: true + + node.vm.provision 'shell', + run: 'once', + name: 'Link the data filesystem to the home directory', + inline: "ln -s /Volumes/data ~/Data", + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Download azure agent', + inline: "curl -s -o ~/Downloads/azure-agent.tar.gz #{azure_agent_url}", + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Unpack azure agent', + inline: 'mkdir myagent; cd myagent; tar xf ~/Downloads/azure-agent.tar.gz', + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Install brew and xcode command line tools', + inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Install brew applications', + inline: "brew install #{brew_formulas.join(' ')} && brew cask install #{brew_cask_formulas.join(' ')}", + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Create archives mountpoint', + inline: 'mkdir ~/Data/archives', + privileged: false + + node.vm.provision "shell", + run: 'once', + name: 'Mount archives directory', + inline: "mount_smbfs -d 777 -f 777 #{archives_url} ~/Data/archives", + privileged: false + + node.vm.provision 'shell', + run: 'once', + name: 'Add VM to azure agent pool', + inline: "cd ~/myagent;\ + ./config.sh --unattended \ + --url #{devops_url} \ + --work ~/Data/work \ + --auth pat --token #{pat} \ + --pool #{agent_pool} \ + --agent `hostname` \ + --replace \ + --acceptTeeEula", + privileged: false + + # Start listening for jobs + node.vm.provision 'shell', + run: 'always', + name: 'Start running azure pipelines', + inline: 'cd /Users/vagrant/myagent;\ + nohup ./run.sh&', + privileged: false + end + end +end diff --git a/scripts/azure-pipelines/osx/configuration/installables.json b/scripts/azure-pipelines/osx/configuration/installables.json new file mode 100644 index 00000000000000..bd9b33ae406bf4 --- /dev/null +++ b/scripts/azure-pipelines/osx/configuration/installables.json @@ -0,0 +1,28 @@ +{ + "$schema": "./installables.schema.json", + + "Applications": [ + { + "Name": "VirtualBox", + "TestCommand": "VBoxManage", + "DmgUrl": "https://download.virtualbox.org/virtualbox/6.1.10/VirtualBox-6.1.10-138449-OSX.dmg", + "Sha256": "EF0CA4924922514B6AD71469998821F2CF7C596B4B8B59736C3699759E0F1DF8", + "InstallerPath": "VirtualBox.pkg" + }, + { + "Name": "vagrant", + "TestCommand": "vagrant", + "DmgUrl": "https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.dmg", + "Sha256": "529CDE2A78E6DF38EC906B65C70B36A087E2601EAB42E25856E35B20CCB027C0", + "InstallerPath": "vagrant.pkg" + } + ], + "VBoxExtensions": [ + { + "Name": "Extension Pack", + "FullName": "Oracle VM VirtualBox Extension Pack", + "Url": "https://download.virtualbox.org/virtualbox/6.1.10/Oracle_VM_VirtualBox_Extension_Pack-6.1.10.vbox-extpack", + "Sha256": "03067F27F4DA07C5D0FDAFC56D27E3EA23A60682B333B2A1010FB74EF9A40C28" + } + ] +} diff --git a/scripts/azure-pipelines/osx/configuration/installables.schema.json b/scripts/azure-pipelines/osx/configuration/installables.schema.json new file mode 100644 index 00000000000000..9f7734cc6f70ac --- /dev/null +++ b/scripts/azure-pipelines/osx/configuration/installables.schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "type": "object", + "definitions": { + "sha256": { + "type": "string", + "pattern": "[A-Z0-9]{64}" + } + }, + "required": [ + "Applications", + "VBoxExtensions" + ], + "properties": { + "Applications": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "TestCommand": { + "type": "string" + }, + "DmgUrl": { + "type": "string", + "format": "uri" + }, + "Sha256": { + "$ref": "#/definitions/sha256" + }, + "InstallerPath": { + "type": "string" + } + } + } + }, + "VBoxExtensions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "FullName": { + "type": "string" + }, + "Url": { + "type": "string", + "format": "uri" + }, + "Sha256": { + "$ref": "#/definitions/sha256" + } + } + } + } + } +} diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json new file mode 100644 index 00000000000000..f0abc1673419ce --- /dev/null +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + + "type": "object", + + "required": [ + "pat", + "base_name", + "disk_size", + "machine_identifiers", + "archives" + ], + + "properties": { + "pat": { + "type": "string" + }, + "base_name": { + "type": "string" + }, + "disk_size": { + "type": "integer" + }, + "machine_identifiers": { + "type": "array", + + "items": { + "type": "string", + "pattern": "[0-9]{2}" + } + }, + "archives": { + "type": "object", + "required": [ + "username", + "access_key", + "urn", + "share" + ], + "properties": { + "username": { "type": "string" }, + "access_key": { "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 new file mode 100755 index 00000000000000..27ff3290ca0d27 --- /dev/null +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -0,0 +1,107 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Runs the 'Test Modified Ports' part of the vcpkg CI system for all platforms. + +.PARAMETER Triplet +The triplet to test. + +.PARAMETER ArchivesRoot +The location where the binary caching archives are stored. Shared across runs of this script. + +.PARAMETER WorkingRoot +The location used as scratch space for 'installed', 'packages', and 'buildtrees' vcpkg directories. + +.PARAMETER ArtifactsDirectory +The Azure Pipelines artifacts directory. If not supplied, defaults to the current directory. + +.PARAMETER BuildReason +The reason Azure Pipelines is running this script (controls whether Binary Caching is used). If not +supplied, binary caching will be used. +#> + +[CmdletBinding()] +Param( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$Triplet, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + $ArchivesRoot, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + $WorkingRoot, + [ValidateNotNullOrEmpty()] + $ArtifactsDirectory = '.', + $BuildReason = $null +) + +if (-Not (Test-Path "triplets/$Triplet.cmake")) { + Write-Error "Incorrect triplet '$Triplet', please supply a valid triplet." + throw +} + +$env:VCPKG_DOWNLOADS = Join-Path $WorkingRoot 'downloads' +$buildtreesRoot = Join-Path $WorkingRoot 'buildtrees' +$installRoot = Join-Path $WorkingRoot 'installed' +$packagesRoot = Join-Path $WorkingRoot 'packages' +$commonArgs = @( + '--binarycaching', + "--x-buildtrees-root=$buildtreesRoot", + "--x-install-root=$installRoot", + "--x-packages-root=$packagesRoot", + "--overlay-ports=scripts/test_ports" +) + +$binaryCachingMode = 'readwrite' +$skipFailures = $false +if ([string]::IsNullOrWhiteSpace($BuildReason)) { + Write-Host 'Build reason not specified, defaulting to using binary caching in read write mode.' +} +elseif ($BuildReason -eq 'PullRequest') { + Write-Host 'Build reason was Pull Request, using binary caching in read write mode, skipping failures.' + $skipFailures = $true +} +else { + Write-Host "Build reason was $BuildReason, using binary caching in write only mode." + $binaryCachingMode = 'write' +} + +$commonArgs += @("--x-binarysource=clear;files,$ArchivesRoot,$binaryCachingMode") + +if ($Triplet -eq 'x64-linux') { + $env:HOME = '/home/agent' + $executableExtension = [string]::Empty +} +elseif ($Triplet -eq 'x64-osx') { + $executableExtension = [string]::Empty +} +else { + $executableExtension = '.exe' +} + +$xmlResults = Join-Path $ArtifactsDirectory 'xml-results' +mkdir $xmlResults +$xmlFile = Join-Path $xmlResults "$Triplet.xml" + +$failureLogs = Join-Path $ArtifactsDirectory 'failure-logs' + +& "./vcpkg$executableExtension" x-ci-clean @commonArgs +$skipList = . "$PSScriptRoot/generate-skip-list.ps1" ` + -Triplet $Triplet ` + -BaselineFile "$PSScriptRoot/../ci.baseline.txt" ` + -SkipFailures:$skipFailures + +# WORKAROUND: the x86-windows flavors of these are needed for all cross-compilation, but they are not auto-installed. +# Install them so the CI succeeds: +if ($Triplet -in @('x64-uwp', 'arm64-windows', 'arm-uwp')) { + .\vcpkg.exe install protobuf:x86-windows boost-build:x86-windows sqlite3:x86-windows @commonArgs +} + +& "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @commonArgs +& "$PSScriptRoot/analyze-test-results.ps1" -logDir $xmlResults ` + -triplet $Triplet ` + -baselineFile .\scripts\ci.baseline.txt diff --git a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 new file mode 100644 index 00000000000000..2adeeae45cdb19 --- /dev/null +++ b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 @@ -0,0 +1,51 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True)] + [string]$Root, + [Parameter()] + [switch]$IgnoreErrors # allows one to just format +) + +$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 +} + +$toolsrc = Get-Item "$Root/toolsrc" +Push-Location $toolsrc + +try +{ + $files = Get-ChildItem -Recurse -LiteralPath "$toolsrc/src" -Filter '*.cpp' + $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg" -Filter '*.h' + $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg-test" -Filter '*.h' + $files += Get-Item "$toolsrc/include/pch.h" + $fileNames = $files.FullName + + & $clangFormat -style=file -i @fileNames + + $changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $toolsrc + if (-not $IgnoreErrors -and $null -ne $changedFiles) + { + $msg = @( + "", + "The formatting of the C++ files didn't match our expectation.", + "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#vcpkg-internal-code for solution." + ) + $msg += "File list:" + $msg += " $changedFiles" + $msg += "" + + $msg += "clang-format should produce the following diff:" + $msg += git diff $toolsrc + + Write-Error ($msg -join "`n") + throw + } +} +finally +{ + Pop-Location +} diff --git a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 new file mode 100644 index 00000000000000..f4385c2b4e237c --- /dev/null +++ b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 @@ -0,0 +1,56 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True)] + [string]$Root, + [Parameter()] + [string]$DownloadsDirectory, + [Parameter()] + [switch]$IgnoreErrors # allows one to just format +) + +$portsTree = Get-Item "$Root/ports" + +if (-not (Test-Path "$Root/.vcpkg-root")) +{ + Write-Error "The vcpkg root was not at $Root" + throw +} + +if (-not [string]::IsNullOrEmpty($DownloadsDirectory)) +{ + $env:VCPKG_DOWNLOADS = $DownloadsDirectory +} + +if (-not (Test-Path "$Root/vcpkg.exe")) +{ + & "$Root/bootstrap-vcpkg.bat" + if (-not $?) + { + Write-Error "Bootstrapping vcpkg failed" + throw + } +} + +& "$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.", + "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifest for solution." + ) + $msg += "" + + $msg += "vcpkg should produce the following diff:" + $msg += git diff $portsTree + + Write-Error ($msg -join "`n") + throw +} diff --git a/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1 b/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1 new file mode 100644 index 00000000000000..e299369a047538 --- /dev/null +++ b/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1 @@ -0,0 +1,9 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True)] + [string]$Directory +) + +git status --porcelain $Directory | ForEach-Object { + (-split $_)[1] +} diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml new file mode 100644 index 00000000000000..5ec0b300c290b0 --- /dev/null +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -0,0 +1,79 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +jobs: +- job: ${{ parameters.jobName }} + pool: + name: ${{ parameters.poolName }} + workspace: + clean: resources + timeoutInMinutes: 1440 # 1 day + + steps: + - task: PowerShell@2 + displayName: 'Initialize Environment' + inputs: + filePath: 'scripts/azure-pipelines/windows/initialize-environment.ps1' + - task: PowerShell@2 + displayName: 'Report on Disk Space' + condition: always() + inputs: + filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' + # Note: D: is the Azure machines' temporary disk. + - task: CmdLine@2 + 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% + 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: '*** 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)' + - task: PowerShell@2 + displayName: 'Report on Disk Space After Build' + condition: always() + inputs: + filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ${{ parameters.triplet }} port build failure logs' + inputs: + PathtoPublish: '$(System.ArtifactsDirectory)\failure-logs' + ArtifactName: '${{ parameters.triplet }} port build failure logs' + condition: failed() + - task: PowerShell@2 + displayName: "Generating all packages files" + 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\ + - task: PublishBuildArtifacts@1 + displayName: 'Upload file lists for all packages' + condition: always() + inputs: + PathtoPublish: scripts/list_files + ArtifactName: "${{ parameters.triplet }} package file lists" diff --git a/scripts/azure-pipelines/windows/create-vmss.ps1 b/scripts/azure-pipelines/windows/create-vmss.ps1 new file mode 100644 index 00000000000000..b1aa5d0ce8c4ad --- /dev/null +++ b/scripts/azure-pipelines/windows/create-vmss.ps1 @@ -0,0 +1,320 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Creates a Windows virtual machine scale set, set up for vcpkg's CI. + +.DESCRIPTION +create-vmss.ps1 creates an Azure Windows VM scale set, set up for vcpkg's CI +system. See https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview +for more information. + +This script assumes you have installed Azure tools into PowerShell by following the instructions +at https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1 +or are running from Azure Cloud Shell. +#> + +$Location = 'westus2' +$Prefix = 'PrWin-' + (Get-Date -Format 'yyyy-MM-dd') +$VMSize = 'Standard_D16a_v4' +$ProtoVMName = 'PROTOTYPE' +$LiveVMPrefix = 'BUILD' +$WindowsServerSku = '2019-Datacenter' +$ErrorActionPreference = 'Stop' + +$ProgressActivity = 'Creating Scale Set' +$TotalProgress = 12 +$CurrentProgress = 1 + +Import-Module "$PSScriptRoot/../create-vmss-helpers.psm1" -DisableNameChecking + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating resource group' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$ResourceGroupName = Find-ResourceGroupName $Prefix +$AdminPW = New-Password +New-AzResourceGroup -Name $ResourceGroupName -Location $Location +$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force +$Credential = New-Object System.Management.Automation.PSCredential ("AdminUser", $AdminPWSecure) + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating virtual network' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$allowHttp = New-AzNetworkSecurityRuleConfig ` + -Name AllowHTTP ` + -Description 'Allow HTTP(S)' ` + -Access Allow ` + -Protocol Tcp ` + -Direction Outbound ` + -Priority 1008 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange @(80, 443) + +$allowDns = New-AzNetworkSecurityRuleConfig ` + -Name AllowDNS ` + -Description 'Allow DNS' ` + -Access Allow ` + -Protocol * ` + -Direction Outbound ` + -Priority 1009 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange 53 + +$allowGit = New-AzNetworkSecurityRuleConfig ` + -Name AllowGit ` + -Description 'Allow git' ` + -Access Allow ` + -Protocol Tcp ` + -Direction Outbound ` + -Priority 1010 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange 9418 + +$allowStorage = New-AzNetworkSecurityRuleConfig ` + -Name AllowStorage ` + -Description 'Allow Storage' ` + -Access Allow ` + -Protocol * ` + -Direction Outbound ` + -Priority 1011 ` + -SourceAddressPrefix VirtualNetwork ` + -SourcePortRange * ` + -DestinationAddressPrefix Storage ` + -DestinationPortRange * + +$denyEverythingElse = New-AzNetworkSecurityRuleConfig ` + -Name DenyElse ` + -Description 'Deny everything else' ` + -Access Deny ` + -Protocol * ` + -Direction Outbound ` + -Priority 1012 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange * + +$NetworkSecurityGroupName = $ResourceGroupName + 'NetworkSecurity' +$NetworkSecurityGroup = New-AzNetworkSecurityGroup ` + -Name $NetworkSecurityGroupName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -SecurityRules @($allowHttp, $allowDns, $allowGit, $allowStorage, $denyEverythingElse) + +$SubnetName = $ResourceGroupName + 'Subnet' +$Subnet = New-AzVirtualNetworkSubnetConfig ` + -Name $SubnetName ` + -AddressPrefix "10.0.0.0/16" ` + -NetworkSecurityGroup $NetworkSecurityGroup + +$VirtualNetworkName = $ResourceGroupName + 'Network' +$VirtualNetwork = New-AzVirtualNetwork ` + -Name $VirtualNetworkName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -AddressPrefix "10.0.0.0/16" ` + -Subnet $Subnet + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating archives storage account' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$StorageAccountName = Sanitize-Name $ResourceGroupName + +New-AzStorageAccount ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -Name $StorageAccountName ` + -SkuName 'Standard_LRS' ` + -Kind StorageV2 + +$StorageAccountKeys = Get-AzStorageAccountKey ` + -ResourceGroupName $ResourceGroupName ` + -Name $StorageAccountName + +$StorageAccountKey = $StorageAccountKeys[0].Value + +$StorageContext = New-AzStorageContext ` + -StorageAccountName $StorageAccountName ` + -StorageAccountKey $StorageAccountKey + +New-AzStorageShare -Name 'archives' -Context $StorageContext +Set-AzStorageShareQuota -ShareName 'archives' -Context $StorageContext -Quota 2048 + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating prototype VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$NicName = $ResourceGroupName + 'NIC' +$Nic = New-AzNetworkInterface ` + -Name $NicName ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -Subnet $VirtualNetwork.Subnets[0] + +$VM = New-AzVMConfig -Name $ProtoVMName -VMSize $VMSize -Priority 'Spot' -MaxPrice -1 +$VM = Set-AzVMOperatingSystem ` + -VM $VM ` + -Windows ` + -ComputerName $ProtoVMName ` + -Credential $Credential ` + -ProvisionVMAgent + +$VM = Add-AzVMNetworkInterface -VM $VM -Id $Nic.Id +$VM = Set-AzVMSourceImage ` + -VM $VM ` + -PublisherName 'MicrosoftWindowsServer' ` + -Offer 'WindowsServer' ` + -Skus $WindowsServerSku ` + -Version latest + +$VM = Set-AzVMBootDiagnostic -VM $VM -Disable +New-AzVm ` + -ResourceGroupName $ResourceGroupName ` + -Location $Location ` + -VM $VM + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Running provisioning script provision-image.txt (as a .ps1) in VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Invoke-AzVMRunCommand ` + -ResourceGroupName $ResourceGroupName ` + -VMName $ProtoVMName ` + -CommandId 'RunPowerShellScript' ` + -ScriptPath "$PSScriptRoot\provision-image.txt" ` + -Parameter @{AdminUserPassword = $AdminPW; ` + StorageAccountName=$StorageAccountName; ` + StorageAccountKey=$StorageAccountKey;} + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Restarting VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Running provisioning script sysprep.ps1 in VM' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Invoke-AzVMRunCommand ` + -ResourceGroupName $ResourceGroupName ` + -VMName $ProtoVMName ` + -CommandId 'RunPowerShellScript' ` + -ScriptPath "$PSScriptRoot\sysprep.ps1" + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Waiting for VM to shut down' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Wait-Shutdown -ResourceGroupName $ResourceGroupName -Name $ProtoVMName + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Converting VM to Image' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Stop-AzVM ` + -ResourceGroupName $ResourceGroupName ` + -Name $ProtoVMName ` + -Force + +Set-AzVM ` + -ResourceGroupName $ResourceGroupName ` + -Name $ProtoVMName ` + -Generalized + +$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName +$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name +$ImageConfig = New-AzImageConfig -Location $Location -SourceVirtualMachineId $VM.ID +$Image = New-AzImage -Image $ImageConfig -ImageName $ProtoVMName -ResourceGroupName $ResourceGroupName + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Deleting unused VM and disk' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Remove-AzVM -Id $VM.ID -Force +Remove-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $PrototypeOSDiskName -Force + +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Creating scale set' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +$VmssIpConfigName = $ResourceGroupName + 'VmssIpConfig' +$VmssIpConfig = New-AzVmssIpConfig -SubnetId $Nic.IpConfigurations[0].Subnet.Id -Primary -Name $VmssIpConfigName +$VmssName = $ResourceGroupName + 'Vmss' +$Vmss = New-AzVmssConfig ` + -Location $Location ` + -SkuCapacity 0 ` + -SkuName $VMSize ` + -SkuTier 'Standard' ` + -Overprovision $false ` + -UpgradePolicyMode Manual ` + -EvictionPolicy Delete ` + -Priority Spot ` + -MaxPrice -1 + +$Vmss = Add-AzVmssNetworkInterfaceConfiguration ` + -VirtualMachineScaleSet $Vmss ` + -Primary $true ` + -IpConfiguration $VmssIpConfig ` + -NetworkSecurityGroupId $NetworkSecurityGroup.Id ` + -Name $NicName + +$Vmss = Set-AzVmssOsProfile ` + -VirtualMachineScaleSet $Vmss ` + -ComputerNamePrefix $LiveVMPrefix ` + -AdminUsername 'AdminUser' ` + -AdminPassword $AdminPW ` + -WindowsConfigurationProvisionVMAgent $true ` + -WindowsConfigurationEnableAutomaticUpdate $true + +$Vmss = Set-AzVmssStorageProfile ` + -VirtualMachineScaleSet $Vmss ` + -OsDiskCreateOption 'FromImage' ` + -OsDiskCaching ReadWrite ` + -ImageReferenceId $Image.Id + +New-AzVmss ` + -ResourceGroupName $ResourceGroupName ` + -Name $VmssName ` + -VirtualMachineScaleSet $Vmss + +#################################################################################################### +Write-Progress -Activity $ProgressActivity -Completed +Write-Host "Location: $Location" +Write-Host "Resource group name: $ResourceGroupName" +Write-Host "User name: AdminUser" +Write-Host "Using generated password: $AdminPW" +Write-Host 'Finished!' diff --git a/scripts/azure-pipelines/windows/disk-space.ps1 b/scripts/azure-pipelines/windows/disk-space.ps1 new file mode 100644 index 00000000000000..8680d770158c35 --- /dev/null +++ b/scripts/azure-pipelines/windows/disk-space.ps1 @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Prints total and free disk space for each disk on the system +#> + +Function Format-Size { + [CmdletBinding()] + Param([long]$Size) + + if ($Size -lt 1024) { + $Size = [int]$Size + return "$Size B" + } + + $Size = $Size / 1024 + if ($Size -lt 1024) { + $Size = [int]$Size + return "$Size KiB" + } + + $Size = $Size / 1024 + if ($Size -lt 1024) { + $Size = [int]$Size + return "$Size MiB" + } + + $Size = [int]($Size / 1024) + return "$Size GiB" +} + +Get-CimInstance -ClassName Win32_LogicalDisk | Format-Table -Property @{Label="Disk"; Expression={ $_.DeviceID }},@{Label="Label"; Expression={ $_.VolumeName }},@{Label="Size"; Expression={ Format-Size($_.Size) }},@{Label="Free Space"; Expression={ Format-Size($_.FreeSpace) }} diff --git a/scripts/azure-pipelines/windows/initialize-environment.ps1 b/scripts/azure-pipelines/windows/initialize-environment.ps1 new file mode 100644 index 00000000000000..4a252df49b07ed --- /dev/null +++ b/scripts/azure-pipelines/windows/initialize-environment.ps1 @@ -0,0 +1,47 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +<# +.SYNOPSIS +Sets up the environment to run other vcpkg CI steps in an Azure Pipelines job. + +.DESCRIPTION +This script maps network drives from infrastructure and cleans out anything that +might have been leftover from a previous run. + +.PARAMETER ForceAllPortsToRebuildKey +A subdirectory / key to use to force a build without any previous run caching, +if necessary. +#> + +[CmdletBinding()] +Param( + [string]$ForceAllPortsToRebuildKey = '' +) + +$StorageAccountName = $env:StorageAccountName +$StorageAccountKey = $env:StorageAccountKey + +Write-Host 'Setting up archives mount' +if (-Not (Test-Path W:)) { + net use W: "\\$StorageAccountName.file.core.windows.net\archives" /u:"AZURE\$StorageAccountName" $StorageAccountKey +} + +Write-Host 'Creating downloads directory' +mkdir D:\downloads -ErrorAction SilentlyContinue + +# Delete entries in the downloads folder, except: +# those in the 'tools' folder +# those last accessed in the last 30 days +Get-ChildItem -Path D:\downloads -Exclude "tools" ` + | Where-Object{ $_.LastAccessTime -lt (get-Date).AddDays(-30) } ` + | ForEach-Object{Remove-Item -Path $_ -Recurse -Force} + +# Msys sometimes leaves a database lock file laying around, especially if there was a failed job +# which causes unrelated failures in jobs that run later on the machine. +# work around this by just removing the vcpkg installed msys2 if it exists +if( Test-Path D:\downloads\tools\msys2 ) +{ + Write-Host "removing previously installed msys2" + Remove-Item D:\downloads\tools\msys2 -Recurse -Force +} diff --git a/scripts/azure-pipelines/windows/provision-image.txt b/scripts/azure-pipelines/windows/provision-image.txt new file mode 100644 index 00000000000000..798b96e9a13866 --- /dev/null +++ b/scripts/azure-pipelines/windows/provision-image.txt @@ -0,0 +1,537 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT + +<# +.SYNOPSIS +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, +(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. + +This script must either be run as admin, or one must pass AdminUserPassword; +if the script is run with AdminUserPassword, it runs itself again as an +administrator. + +.PARAMETER AdminUserPassword +The administrator user's password; if this is $null, or not passed, then the +script assumes it's running on an administrator account. + +.PARAMETER StorageAccountName +The name of the storage account. Stored in the environment variable %StorageAccountName%. +Used by the CI system to access the global storage. + +.PARAMETER StorageAccountKey +The key of the storage account. Stored in the environment variable %StorageAccountKey%. +Used by the CI system to access the global storage. +#> +param( + [string]$AdminUserPassword = $null, + [string]$StorageAccountName = $null, + [string]$StorageAccountKey = $null +) + +$ErrorActionPreference = 'Stop' + +<# +.SYNOPSIS +Gets a random file path in the temp directory. + +.DESCRIPTION +Get-TempFilePath takes an extension, and returns a path with a random +filename component in the temporary directory with that extension. + +.PARAMETER Extension +The extension to use for the path. +#> +Function Get-TempFilePath { + Param( + [String]$Extension + ) + + if ([String]::IsNullOrWhiteSpace($Extension)) { + throw 'Missing Extension' + } + + $tempPath = [System.IO.Path]::GetTempPath() + $tempName = [System.IO.Path]::GetRandomFileName() + '.' + $Extension + return Join-Path $tempPath $tempName +} + +if (-not [string]::IsNullOrEmpty($AdminUserPassword)) { + Write-Host "AdminUser password supplied; switching to AdminUser" + $PsExecPath = Get-TempFilePath -Extension 'exe' + Write-Host "Downloading psexec to $PsExecPath" + & curl.exe -L -o $PsExecPath -s -S https://live.sysinternals.com/PsExec64.exe + $PsExecArgs = @( + '-u', + 'AdminUser', + '-p', + $AdminUserPassword, + '-accepteula', + '-h', + 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', + '-ExecutionPolicy', + 'Unrestricted', + '-File', + $PSCommandPath + ) + + if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountName))) { + $PsExecArgs += '-StorageAccountName' + $PsExecArgs += $StorageAccountName + } + + if (-Not ([string]::IsNullOrWhiteSpace($StorageAccountKey))) { + $PsExecArgs += '-StorageAccountKey' + $PsExecArgs += $StorageAccountKey + } + + Write-Host "Executing $PsExecPath " + @PsExecArgs + & $PsExecPath @PsExecArgs > C:\ProvisionLog.txt + Write-Host 'Cleaning up...' + Remove-Item $PsExecPath + exit $proc.ExitCode +} + +$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/16/release/vs_enterprise.exe' +$Workloads = @( + 'Microsoft.VisualStudio.Workload.NativeDesktop', + 'Microsoft.VisualStudio.Workload.Universal', + 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + 'Microsoft.VisualStudio.Component.VC.Tools.ARM', + 'Microsoft.VisualStudio.Component.VC.Tools.ARM64', + 'Microsoft.VisualStudio.Component.VC.ATL', + 'Microsoft.VisualStudio.Component.VC.ATLMFC', + 'Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre', + 'Microsoft.VisualStudio.Component.Windows10SDK.18362', + 'Microsoft.Net.Component.4.8.SDK', + 'Microsoft.Component.NetFX.Native', + 'Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset', + 'Microsoft.VisualStudio.Component.VC.Llvm.Clang' +) + +$WindowsSDKUrl = 'https://download.microsoft.com/download/1/c/3/1c3d5161-d9e9-4e4b-9b43-b70fe8be268c/windowssdk/winsdksetup.exe' + +$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 ' + ` + 'nvdisasm_10.1 nvprof_10.1 visual_profiler_10.1 visual_studio_integration_10.1 cublas_10.1 cublas_dev_10.1 ' + ` + 'cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 ' + ` + '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' + +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +<# +.SYNOPSIS +Writes a message to the screen depending on ExitCode. + +.DESCRIPTION +Since msiexec can return either 0 or 3010 successfully, in both cases +we write that installation succeeded, and which exit code it exited with. +If msiexec returns anything else, we write an error. + +.PARAMETER ExitCode +The exit code that msiexec returned. +#> +Function PrintMsiExitCodeMessage { + Param( + $ExitCode + ) + + # 3010 is probably ERROR_SUCCESS_REBOOT_REQUIRED + if ($ExitCode -eq 0 -or $ExitCode -eq 3010) { + Write-Host "Installation successful! Exited with $ExitCode." + } + else { + Write-Error "Installation failed! Exited with $ExitCode." + throw + } +} + +<# +.SYNOPSIS +Install Visual Studio. + +.DESCRIPTION +InstallVisualStudio takes the $Workloads array, and installs it with the +installer that's pointed at by $BootstrapperUrl. + +.PARAMETER Workloads +The set of VS workloads to install. + +.PARAMETER BootstrapperUrl +The URL of the Visual Studio installer, i.e. one of vs_*.exe. + +.PARAMETER InstallPath +The path to install Visual Studio at. + +.PARAMETER Nickname +The nickname to give the installation. +#> +Function InstallVisualStudio { + Param( + [String[]]$Workloads, + [String]$BootstrapperUrl, + [String]$InstallPath = $null, + [String]$Nickname = $null + ) + + try { + Write-Host 'Downloading Visual Studio...' + [string]$bootstrapperExe = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $bootstrapperExe -s -S $BootstrapperUrl + Write-Host "Installing Visual Studio..." + $args = @('/c', $bootstrapperExe, '--quiet', '--norestart', '--wait', '--nocache') + foreach ($workload in $Workloads) { + $args += '--add' + $args += $workload + } + + if (-not ([String]::IsNullOrWhiteSpace($InstallPath))) { + $args += '--installpath' + $args += $InstallPath + } + + if (-not ([String]::IsNullOrWhiteSpace($Nickname))) { + $args += '--nickname' + $args += $Nickname + } + + $proc = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru + PrintMsiExitCodeMessage $proc.ExitCode + } + catch { + Write-Error "Failed to install Visual Studio! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Install a .msi file. + +.DESCRIPTION +InstallMSI takes a url where an .msi lives, and installs that .msi to the system. + +.PARAMETER Name +The name of the thing to install. + +.PARAMETER Url +The URL at which the .msi lives. +#> +Function InstallMSI { + Param( + [String]$Name, + [String]$Url + ) + + try { + Write-Host "Downloading $Name..." + [string]$msiPath = Get-TempFilePath -Extension 'msi' + curl.exe -L -o $msiPath -s -S $Url + Write-Host "Installing $Name..." + $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') + $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru + PrintMsiExitCodeMessage $proc.ExitCode + } + catch { + Write-Error "Failed to install $Name! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Unpacks a zip file to $Dir. + +.DESCRIPTION +InstallZip takes a URL of a zip file, and unpacks the zip file to the directory +$Dir. + +.PARAMETER Name +The name of the tool being installed. + +.PARAMETER Url +The URL of the zip file to unpack. + +.PARAMETER Dir +The directory to unpack the zip file to. +#> +Function InstallZip { + Param( + [String]$Name, + [String]$Url, + [String]$Dir + ) + + try { + Write-Host "Downloading $Name..." + [string]$zipPath = Get-TempFilePath -Extension 'zip' + curl.exe -L -o $zipPath -s -S $Url + Write-Host "Installing $Name..." + Expand-Archive -Path $zipPath -DestinationPath $Dir -Force + } + catch { + Write-Error "Failed to install $Name! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Installs Windows SDK version 2004 + +.DESCRIPTION +Downloads the Windows SDK installer located at $Url, and installs it with the +correct flags. + +.PARAMETER Url +The URL of the installer. +#> +Function InstallWindowsSDK { + Param( + [String]$Url + ) + + try { + Write-Host 'Downloading Windows SDK...' + [string]$installerPath = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $installerPath -s -S $Url + Write-Host 'Installing Windows SDK...' + $proc = Start-Process -FilePath $installerPath -ArgumentList @('/features', '+', '/q') -Wait -PassThru + $exitCode = $proc.ExitCode + if ($exitCode -eq 0) { + Write-Host 'Installation successful!' + } + else { + Write-Error "Installation failed! Exited with $exitCode." + throw + } + } + catch { + Write-Error "Failed to install Windows SDK! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Installs Windows WDK version 2004 + +.DESCRIPTION +Downloads the Windows WDK installer located at $Url, and installs it with the +correct flags. + +.PARAMETER Url +The URL of the installer. +#> +Function InstallWindowsWDK { + Param( + [String]$Url + ) + + try { + Write-Host 'Downloading Windows WDK...' + [string]$installerPath = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $installerPath -s -S $Url + Write-Host 'Installing Windows WDK...' + $proc = Start-Process -FilePath $installerPath -ArgumentList @('/features', '+', '/q') -Wait -PassThru + $exitCode = $proc.ExitCode + if ($exitCode -eq 0) { + Write-Host 'Installation successful!' + } + else { + Write-Error "Installation failed! Exited with $exitCode." + throw + } + } + catch { + Write-Error "Failed to install Windows WDK! $($_.Exception.Message)" + throw + } +} + +<# +.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 + +.DESCRIPTION +Downloads the MPI installer located at $Url, and installs it with the +correct flags. + +.PARAMETER Url +The URL of the installer. +#> +Function InstallMpi { + Param( + [String]$Url + ) + + try { + Write-Host 'Downloading MPI...' + [string]$installerPath = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $installerPath -s -S $Url + Write-Host 'Installing MPI...' + $proc = Start-Process -FilePath $installerPath -ArgumentList @('-force', '-unattend') -Wait -PassThru + $exitCode = $proc.ExitCode + if ($exitCode -eq 0) { + Write-Host 'Installation successful!' + } + else { + Write-Error "Installation failed! Exited with $exitCode." + throw + } + } + catch { + Write-Error "Failed to install MPI! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Installs NVIDIA's CUDA Toolkit. + +.DESCRIPTION +InstallCuda installs the CUDA Toolkit with the features specified as a +space separated list of strings in $Features. + +.PARAMETER Url +The URL of the CUDA installer. + +.PARAMETER Features +A space-separated list of features to install. +#> +Function InstallCuda { + Param( + [String]$Url, + [String]$Features + ) + + try { + Write-Host 'Downloading CUDA...' + [string]$installerPath = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $installerPath -s -S $Url + Write-Host 'Installing CUDA...' + $proc = Start-Process -FilePath $installerPath -ArgumentList @('-s ' + $Features) -Wait -PassThru + $exitCode = $proc.ExitCode + if ($exitCode -eq 0) { + Write-Host 'Installation successful!' + } + else { + Write-Error "Installation failed! Exited with $exitCode." + throw + } + } + catch { + Write-Error "Failed to install CUDA! $($_.Exception.Message)" + throw + } +} + +Write-Host "AdminUser password not supplied; assuming already running as AdminUser" + +Write-Host 'Disabling pagefile...' +wmic computersystem set AutomaticManagedPagefile=False +wmic pagefileset delete + +$av = Get-Command Add-MPPreference -ErrorAction SilentlyContinue +if ($null -eq $av) { + Write-Host 'AntiVirus not installed, skipping exclusions.' +} else { + Write-Host 'Configuring AntiVirus exclusions...' + Add-MPPreference -ExclusionPath D:\ + Add-MPPreference -ExclusionProcess ninja.exe + Add-MPPreference -ExclusionProcess clang-cl.exe + Add-MPPreference -ExclusionProcess cl.exe + Add-MPPreference -ExclusionProcess link.exe + Add-MPPreference -ExclusionProcess python.exe +} + +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' +if ([string]::IsNullOrWhiteSpace($StorageAccountName)) { + Write-Host 'No storage account name configured.' +} else { + Write-Host 'Storing storage account name to environment' + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' ` + -Name StorageAccountName ` + -Value $StorageAccountName +} +if ([string]::IsNullOrWhiteSpace($StorageAccountKey)) { + Write-Host 'No storage account key configured.' +} else { + Write-Host 'Storing storage account key to environment' + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' ` + -Name StorageAccountKey ` + -Value $StorageAccountKey +} diff --git a/scripts/azure-pipelines/windows/sysprep.ps1 b/scripts/azure-pipelines/windows/sysprep.ps1 new file mode 100644 index 00000000000000..c0965350d4cd99 --- /dev/null +++ b/scripts/azure-pipelines/windows/sysprep.ps1 @@ -0,0 +1,17 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Prepares the virtual machine for imaging. + +.DESCRIPTION +Runs the `sysprep` utility to prepare the system for imaging. +See https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview +for more information. +#> + +$ErrorActionPreference = 'Stop' +Write-Host 'Running sysprep' +& C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index e154bd38d97da5..8136a9799eb8aa 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param ( $libraries = @(), - $version = "1.72.0", + $version = "1.73.0", $portsDir = $null ) @@ -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") + if ($per_port_data[$library].supports) { - # these only work on windows desktop - "$library (windows)" - } - elseif ($library -match "type[_-]erasure|contract") - { - # 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,46 +92,34 @@ function Generate() $controlDeps = ($Depends | sort) -join ", " - $versionSuffix = "" - if ($PortName -eq "iostreams" -or $PortName -eq "process" -or $PortName -eq "python") - { - $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" - "Description: ICU backend for Boost.Locale" - "Build-Depends: icu" - ) + $controlLines += @("Supports: $($per_port_data[$PortName].supports)") } - if ($PortName -eq "regex") + if ($per_port_data[$PortName].features) { - $controlLines += @( - "" - "Feature: icu" - "Description: ICU backend for Boost.Regex" - "Build-Depends: icu" - ) + $controlLines += @("") + $per_port_data[$PortName].features } $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL" $portfileLines = @( "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "" - "include(vcpkg_common_functions)" - "" ) if ($PortName -eq "system") @@ -107,17 +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 "process") + else { - $portfileLines += @(" PATCHES async_pipe_header.patch") + $portfileLines += @(" PATCHES") + foreach ($patch in $patches) + { + $portfileLines += @(" $($patches.name)") + } } $portfileLines += @( ")" @@ -131,58 +166,24 @@ function Generate() if ($NeedsBuild) { - if ($PortName -eq "locale") - { - $portfileLines += @( - "if(`"icu`" IN_LIST FEATURES)" - " set(BOOST_LOCALE_ICU on)" - "else()" - " set(BOOST_LOCALE_ICU off)" - "endif()" - "" - "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)" - "boost_modular_build(" - " SOURCE_PATH `${SOURCE_PATH}" - " BOOST_CMAKE_FRAGMENT `"`${CMAKE_CURRENT_LIST_DIR}/cmake-fragment.cmake`"" - " OPTIONS" - " boost.locale.iconv=off" - " boost.locale.posix=off" - " /boost/locale//boost_locale" - " boost.locale.icu=`${BOOST_LOCALE_ICU}" - ")" - ) - } - elseif ($PortName -eq "regex") - { - $portfileLines += @( - "if(`"icu`" IN_LIST FEATURES)" - " set(REQUIREMENTS `"/user-config//icuuc /user-config//icudt /user-config//icuin BOOST_HAS_ICU=1`")" - "else()" - " set(REQUIREMENTS)" - "endif()" - "" - "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)" - "boost_modular_build(SOURCE_PATH `${SOURCE_PATH} REQUIREMENTS `"`${REQUIREMENTS}`")" - ) - } - elseif ($PortName -eq "thread") + $portfileLines += @( + "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)" + ) + # b2-options.cmake contains port-specific build options + if (Test-Path "$portsDir/boost-$PortName/b2-options.cmake") { $portfileLines += @( - "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)" "boost_modular_build(" " SOURCE_PATH `${SOURCE_PATH}" - " REQUIREMENTS `"/boost/date_time//boost_date_time`"" - " OPTIONS /boost/thread//boost_thread" - " BOOST_CMAKE_FRAGMENT `${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" + " BOOST_CMAKE_FRAGMENT `"`${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake`"" ")" ) } else { $portfileLines += @( - "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)" "boost_modular_build(SOURCE_PATH `${SOURCE_PATH})" - ) + ) } } @@ -297,31 +298,34 @@ 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" } + elseif ($_ -match "cstdint|integer_fwd|integer_traits") { "integer" } elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" } elseif ($_ -match "^version|^workaround") { "config" } - elseif ($_ -match "enable_shared_from_this|shared_ptr|make_shared|make_unique|intrusive_ptr|scoped_ptr|pointer_to_other|weak_ptr|shared_array|scoped_array") { "smart_ptr" } + elseif ($_ -match "enable_shared_from_this|shared_ptr|make_shared|make_unique|intrusive_ptr|scoped_ptr|pointer_cast|pointer_to_other|weak_ptr|shared_array|scoped_array") { "smart_ptr" } elseif ($_ -match "iterator_adaptors|generator_iterator|pointee") { "iterator" } elseif ($_ -eq "regex_fwd") { "regex" } elseif ($_ -eq "make_default") { "convert" } elseif ($_ -eq "foreach_fwd") { "foreach" } elseif ($_ -eq "cerrno") { "system" } + elseif ($_ -eq "circular_buffer_fwd") { "circular_buffer" } elseif ($_ -eq "archive") { "serialization" } - elseif ($_ -eq "none") { "optional" } - elseif ($_ -eq "integer_traits") { "integer" } + elseif ($_ -match "none|none_t") { "optional" } elseif ($_ -eq "limits") { "compatibility" } - elseif ($_ -eq "math_fwd") { "math" } + elseif ($_ -match "cstdfloat|math_fwd") { "math" } + elseif ($_ -eq "cast") { "conversion"; "numeric_conversion" } # DEPRECATED header file, includes and elseif ($_ -match "polymorphic_cast|implicit_cast") { "conversion" } elseif ($_ -eq "nondet_random") { "random" } elseif ($_ -eq "memory_order") { "atomic" } - elseif ($_ -eq "blank") { "detail" } + elseif ($_ -match "blank|blank_fwd|numeric_traits") { "detail" } elseif ($_ -match "is_placeholder|mem_fn") { "bind" } elseif ($_ -eq "exception_ptr") { "exception" } - elseif ($_ -eq "multi_index_container") { "multi_index" } + elseif ($_ -match "multi_index_container|multi_index_container_fwd") { "multi_index" } elseif ($_ -eq "lexical_cast") { "lexical_cast"; "math" } elseif ($_ -match "token_iterator|token_functions") { "tokenizer" } elseif ($_ -eq "numeric" -and $library -notmatch "numeric_conversion|interval|odeint|ublas") { "numeric_conversion"; "interval"; "odeint"; "ublas" } + elseif ($_ -eq "io_fwd") { "io" } else { $_ } } | group | % name | ? { $_ -ne $library } @@ -335,6 +339,8 @@ foreach ($library in $libraries) # Boost contains cycles, so remove a few dependencies to break the loop. (($library -notmatch "core|assert|mpl|detail|throw_exception|type_traits|^exception") -or ($_ -notmatch "utility")) ` -and ` + (($library -notmatch "assert") -or ($_ -notmatch "integer"))` + -and ` (($library -notmatch "range") -or ($_ -notmatch "algorithm"))` -and ` (($library -ne "config") -or ($_ -notmatch "integer"))` @@ -356,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") @@ -410,13 +416,14 @@ foreach ($library in $libraries) if ($libraries_in_boost_port.length -gt 1) { # Generate master boost control file which depends on each individual library - # mpi is excluded due to it having a dependency on msmpi + # mpi is excluded due to it having a dependency on msmpi/openmpi $boostDependsList = @($libraries_in_boost_port | % { "boost-$_" } | ? { $_ -notmatch "boost-mpi" }) -join ", " @( "# 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/boost/post-source-stubs/python.cmake b/scripts/boost/post-source-stubs/python.cmake deleted file mode 100644 index 5e2ae2b765fe41..00000000000000 --- a/scripts/boost/post-source-stubs/python.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# Find Python3 executable -vcpkg_find_acquire_program(PYTHON3) -set(VCPKG_PYTHON_EXECUTABLE "${PYTHON3}") -# Find Python3 libraries. Can't use find_package here, but we already know where everything is -file(GLOB VCPKG_PYTHON_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*") -set(VCPKG_PYTHON_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") -set(VCPKG_PYTHON_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") -string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON_VERSION "${VCPKG_PYTHON_INCLUDE}") diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 1eaf1c598335ca..0d87d6ee8939fb 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -57,12 +57,12 @@ 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." - return + Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist." + throw } function getVisualStudioInstances() @@ -140,7 +140,7 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) $VisualStudioInstances = getVisualStudioInstances if ($null -eq $VisualStudioInstances) { - throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." + throw "Could not find Visual Studio. VS2015, VS2017, or VS2019 (with C++) needs to be installed." } Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstances))" @@ -339,9 +339,9 @@ 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 } else @@ -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() { @@ -408,8 +408,9 @@ $ec = vcpkgInvokeCommandClean $msbuildExe $arguments if ($ec -ne 0) { Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." - return + throw } + Write-Host "`nBuilding vcpkg.exe... done.`n" if (-not $disableMetrics) @@ -417,14 +418,23 @@ if (-not $disableMetrics) Write-Host @" Telemetry --------- -vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running bootstrap-vcpkg.bat with -disableMetrics. -Read more about vcpkg telemetry at docs/about/privacy.md +vcpkg collects usage data in order to help us improve your experience. +The data collected by Microsoft is anonymous. +You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics, +passing --disable-metrics to vcpkg on the command line, +or by setting the VCPKG_DISABLE_METRICS environment variable. +Read more about vcpkg telemetry at docs/about/privacy.md "@ } Write-Verbose "Placing vcpkg.exe in the correct location" Copy-Item "$vcpkgReleaseDir\vcpkg.exe" "$vcpkgRootDir\vcpkg.exe" -Copy-Item "$vcpkgReleaseDir\vcpkgmetricsuploader.exe" "$vcpkgRootDir\scripts\vcpkgmetricsuploader.exe" + +if (-not $disableMetrics) +{ + Copy-Item "$vcpkgReleaseDir\vcpkgmetricsuploader.exe" "$vcpkgRootDir\scripts\vcpkgmetricsuploader.exe" +} + Remove-Item "$vcpkgReleaseDir" -Force -Recurse -ErrorAction SilentlyContinue diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 722ffe5c25d794..321a16e05d5d95 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -6,18 +6,11 @@ while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do vcpkgRootDir="$(dirname "$vcpkgRootDir")" done -# Enable using this entry point on windows from git bash by redirecting to the .bat file. -unixName=$(uname -s | sed 's/MINGW.*_NT.*/MINGW_NT/') -if [ "$unixName" = "MINGW_NT" ]; then - vcpkgRootDir=$(cygpath -aw "$vcpkgRootDir") - cmd "/C $vcpkgRootDir\\bootstrap-vcpkg.bat" || exit 1 - exit 0 -fi - # Argument parsing vcpkgDisableMetrics="OFF" vcpkgUseSystem=false vcpkgAllowAppleClang=false +vcpkgBuildTests="OFF" for var in "$@" do if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then @@ -26,6 +19,8 @@ do vcpkgUseSystem=true elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then vcpkgAllowAppleClang=true + elif [ "$var" = "-buildTests" ]; then + vcpkgBuildTests="ON" elif [ "$var" = "-help" -o "$var" = "--help" ]; then echo "Usage: ./bootstrap-vcpkg.sh [options]" echo @@ -41,6 +36,20 @@ do fi done +# Enable using this entry point on windows from git bash by redirecting to the .bat file. +unixName=$(uname -s | sed 's/MINGW.*_NT.*/MINGW_NT/') +if [ "$unixName" = "MINGW_NT" ]; then + if [ "$vcpkgDisableMetrics" = "ON" ]; then + args="-disableMetrics" + else + args="" + fi + + vcpkgRootDir=$(cygpath -aw "$vcpkgRootDir") + cmd "/C $vcpkgRootDir\\bootstrap-vcpkg.bat $args" || exit 1 + exit 0 +fi + if [ -z ${VCPKG_DOWNLOADS+x} ]; then downloadsDir="$vcpkgRootDir/downloads" else @@ -100,7 +109,7 @@ vcpkgDownloadFile() url=$1; downloadPath=$2 sha512=$3 vcpkgCheckRepoTool "curl" rm -rf "$downloadPath.part" - curl -L $url --create-dirs --retry 3 --output "$downloadPath.part" || exit 1 + curl -L $url --tlsv1.2 --create-dirs --retry 3 --output "$downloadPath.part" || exit 1 vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512 mv "$downloadPath.part" "$downloadPath" @@ -200,9 +209,7 @@ fetchTool() selectCXX() { if [ "x$CXX" = "x" ]; then - if which g++ >/dev/null 2>&1; then - CXX=g++ - elif which g++-9 >/dev/null 2>&1; then + if which g++-9 >/dev/null 2>&1; then CXX=g++-9 elif which g++-8 >/dev/null 2>&1; then CXX=g++-8 @@ -210,6 +217,8 @@ selectCXX() CXX=g++-7 elif which g++-6 >/dev/null 2>&1; then CXX=g++-6 + elif which g++ >/dev/null 2>&1; then + CXX=g++ fi # If we can't find g++, allow CMake to do the look-up fi @@ -236,21 +245,26 @@ else fi # Do the build -srcDir="$vcpkgRootDir/toolsrc" -buildDir="$srcDir/build.rel" +buildDir="$vcpkgRootDir/toolsrc/build.rel" rm -rf "$buildDir" mkdir -p "$buildDir" -("$cmakeExe" -B "$buildDir" -S "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_WARNINGS_AS_ERRORS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 -("$cmakeExe" --build "$buildDir") || exit 1 +(cd "$buildDir" && CXX="$CXX" "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +(cd "$buildDir" && "$cmakeExe" --build .) || exit 1 rm -rf "$vcpkgRootDir/vcpkg" cp "$buildDir/vcpkg" "$vcpkgRootDir/" if ! [ "$vcpkgDisableMetrics" = "ON" ]; then - echo "Telemetry" - echo "---------" - echo "vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running bootstrap-vcpkg.sh with -disableMetrics" - echo "Read more about vcpkg telemetry at docs/about/privacy.md" - echo "" + cat < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/buildsystems/msbuild/vcpkg.props b/scripts/buildsystems/msbuild/vcpkg.props new file mode 100644 index 00000000000000..f9db4fc58a7772 --- /dev/null +++ b/scripts/buildsystems/msbuild/vcpkg.props @@ -0,0 +1,41 @@ + + + true + true + true + false + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root)) + $(Configuration) + $(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml + + + + + uwp + + + windows + + + + + x86 + + + $(Platform) + + + + + false + true + $([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json)) + + + + + $(VcpkgPlatformTarget)-$(VcpkgOSTarget) + $(VcpkgUserTriplet) + $(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml + + diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 8807befd8248f7..c43837e53c8a67 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,96 +1,113 @@ - - + + + true - x86-windows + true + false + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root)) + $(Configuration) + $(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml + false + true + $([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json)) - - true - x86-uwp + + + uwp - - - true - x86-windows + + windows - - true - x86-uwp + + + x86 - - - true - x64-windows + + $(Platform) - - true - arm-windows + + + $(VcpkgPlatformTarget)-$(VcpkgOSTarget) + $(VcpkgUserTriplet) + $(VcpkgRoot)\installed\$(VcpkgTriplet)\ - - true - arm64-windows - + + + + Project + + - - true - x64-uwp + + + $(VcpkgManifestRoot)\vcpkg_installed\ + + + $(VcpkgRoot)\installed\ - - true - arm-uwp + + + $(VcpkgUserTriplet)-static - - true - arm64-uwp + + $(VcpkgInstalledDir)$(VcpkgTriplet) - $(Configuration) Debug Release - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ + debug\ + $(VcpkgRoot)\ + $(VcpkgCurrentInstalledDir)\ + $(VcpkgManifestRoot)\ true - - false + false - %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib - %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link - %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link + %(AdditionalDependencies);$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib;$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\manual-link - %(AdditionalIncludeDirectories);$(VcpkgRoot)include + %(AdditionalIncludeDirectories);$(VcpkgCurrentInstalledDir)include - %(AdditionalIncludeDirectories);$(VcpkgRoot)include + %(AdditionalIncludeDirectories);$(VcpkgCurrentInstalledDir)include + + + + + - + - + + + + + + - - - diff --git a/scripts/buildsystems/osx/applocal.py b/scripts/buildsystems/osx/applocal.py index b3f8f138e8409a..e01223c7e75d6b 100644 --- a/scripts/buildsystems/osx/applocal.py +++ b/scripts/buildsystems/osx/applocal.py @@ -84,7 +84,7 @@ def get_dependencies(filename): deps = [] if proc_out.retcode == 0: # some string splitting - deps = [s.strip().split(' ')[0] for s in proc_out.stdout.splitlines()[1:] if s] + deps = [s.strip().split(b' ')[0].decode('utf-8') for s in proc_out.stdout.splitlines()[1:] if s] # prevent infinite recursion when a binary depends on itself (seen with QtWidgets)... deps = [s for s in deps if os.path.basename(filename) not in s] return deps diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 963546e9832662..7eb6d474ae5ed1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,10 +1,52 @@ # Mark variables as used so cmake doesn't complain about them mark_as_advanced(CMAKE_TOOLCHAIN_FILE) -# VCPKG toolchain options. +# VCPKG toolchain options. option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF) mark_as_advanced(VCPKG_VERBOSE) +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) + if(EXISTS ${_vcpkg_get_dir_candidate}/${FILENAME}) + set(_vcpkg_get_dir_out ${_vcpkg_get_dir_candidate}) + else() + get_filename_component(_vcpkg_get_dir_candidate_tmp ${_vcpkg_get_dir_candidate} DIRECTORY) + if(_vcpkg_get_dir_candidate STREQUAL _vcpkg_get_dir_candidate_tmp) # we've reached the root + set(_vcpkg_get_dir_out "${OUT}-NOTFOUND") + else() + set(_vcpkg_get_dir_candidate ${_vcpkg_get_dir_candidate_tmp}) + endif() + endif() + endwhile() + + 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_MODE) + if(_VCPKG_MANIFEST_DIR) + set(VCPKG_MANIFEST_MODE ON) + else() + set(VCPKG_MANIFEST_MODE OFF) + endif() +elseif(VCPKG_MANIFEST_MODE AND NOT _VCPKG_MANIFEST_DIR) + message(FATAL_ERROR + "vcpkg manifest mode was enabled, but we couldn't find a manifest file (vcpkg.json) " + "in any directories above ${CMAKE_CURRENT_SOURCE_DIR}. Please add a manifest, or " + "disable manifests by turning off VCPKG_MANIFEST_MODE.") +endif() + +if(VCPKG_MANIFEST_MODE) + 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() + # Determine whether the toolchain is loaded during a try-compile configuration get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) @@ -28,7 +70,7 @@ endif() #If CMake does not have a mapping for MinSizeRel and RelWithDebInfo in imported targets #it will map those configuration to the first valid configuration in CMAKE_CONFIGURATION_TYPES or the targets IMPORTED_CONFIGURATIONS. -#In most cases this is the debug configuration which is wrong. +#In most cases this is the debug configuration which is wrong. if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL) set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release;") if(VCPKG_VERBOSE) @@ -107,8 +149,10 @@ else() return() endif() endif() - elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") + 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) else() if( _CMAKE_IN_TRY_COMPILE ) message(STATUS "Unable to determine target architecture, continuing without vcpkg.") @@ -144,17 +188,28 @@ if(NOT DEFINED _VCPKG_ROOT_DIR) while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive - message(FATAL_ERROR "Could not find .vcpkg-root") else() SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) endif() endwhile() set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE INTERNAL "Vcpkg root directory") endif() -set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) -if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_IN_TRY_COMPILE AND NOT VCPKG_SUPPRESS_INSTALLED_LIBRARIES_WARNING) - message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.") +_vcpkg_get_directory_name_of_file_above(_VCPKG_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR} ".vcpkg-root") +if(NOT _VCPKG_ROOT_DIR) + message(FATAL_ERROR "Could not find .vcpkg-root") +endif() + +if (NOT DEFINED _VCPKG_INSTALLED_DIR) + if(_VCPKG_MANIFEST_DIR) + set(_VCPKG_INSTALLED_DIR ${CMAKE_BINARY_DIR}/vcpkg_installed) + else() + set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) + endif() + + set(_VCPKG_INSTALLED_DIR ${_VCPKG_INSTALLED_DIR} + CACHE PATH + "The directory which contains the installed libraries for each triplet") endif() if(CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. @@ -179,6 +234,16 @@ else() #Release build: Put Release paths before Debug paths. Debug Paths are req ) endif() +# If one CMAKE_FIND_ROOT_PATH_MODE_* variables is set to ONLY, to make sure that ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +# and ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug are searched, it is not sufficient to just add them to CMAKE_FIND_ROOT_PATH, +# as CMAKE_FIND_ROOT_PATH specify "one or more directories to be prepended to all other search directories", so to make sure that +# the libraries are searched as they are, it is necessary to add "/" to the CMAKE_PREFIX_PATH +if(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE STREQUAL "ONLY" OR + CMAKE_FIND_ROOT_PATH_MODE_LIBRARY STREQUAL "ONLY" OR + CMAKE_FIND_ROOT_PATH_MODE_PACKAGE STREQUAL "ONLY") + list(APPEND CMAKE_PREFIX_PATH "/") +endif() + set(VCPKG_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}) file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) @@ -216,6 +281,63 @@ foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) endif() endforeach() + +# CMAKE_EXECUTABLE_SUFFIX is not yet defined +if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(_VCPKG_EXECUTABLE "${_VCPKG_ROOT_DIR}/vcpkg.exe") + set(_VCPKG_BOOTSTRAP_SCRIPT "${_VCPKG_ROOT_DIR}/bootstrap-vcpkg.bat") +else() + set(_VCPKG_EXECUTABLE "${_VCPKG_ROOT_DIR}/vcpkg") + set(_VCPKG_BOOTSTRAP_SCRIPT "${_VCPKG_ROOT_DIR}/bootstrap-vcpkg.sh") +endif() + +if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE) + if(NOT EXISTS "${_VCPKG_EXECUTABLE}") + message(STATUS "Bootstrapping vcpkg before install") + + execute_process( + COMMAND "${_VCPKG_BOOTSTRAP_SCRIPT}" + RESULT_VARIABLE _VCPKG_BOOTSTRAP_RESULT) + + if (NOT _VCPKG_BOOTSTRAP_RESULT EQUAL 0) + message(FATAL_ERROR "Bootstrapping vcpkg before install - failed") + endif() + + message(STATUS "Bootstrapping vcpkg before install - done") + endif() + + 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}" + ${_VCPKG_MANIFEST_FEATURES} + ${_VCPKG_MANIFEST_NO_DEFAULT_FEATURES} + RESULT_VARIABLE _VCPKG_INSTALL_RESULT) + + if (NOT _VCPKG_INSTALL_RESULT EQUAL 0) + message(FATAL_ERROR "Running vcpkg install - failed") + endif() + + message(STATUS "Running vcpkg install - done") + + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS + "${_VCPKG_MANIFEST_DIR}/vcpkg.json" + "${_VCPKG_INSTALLED_DIR}/vcpkg/status") +endif() + option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) function(add_executable name) _add_executable(${ARGV}) @@ -289,7 +411,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 44a951e9fc2a53..a6cc7c886ffb13 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1,1910 +1,1908 @@ -########################################################################### -## This file defines the current expected build state of ports in CI. -## -## States -## pass - (default) the port builds in the CI system. If a port is -## missing from this file then it is assumed to build. -## fail - the port does not build in the CI system. -## This is not necessarily the same as if a port is expected to build -## on a developers machine because it may fail due to the machine -## configuration. When set to fail the CI system will still attempt -## to build the port and will report a CI failure until this file is updated. -## skip - Do not build this port in the CI system. -## This is added to ports that may be flaky or conflict with other -## ports. Please comment for why a port is skipped so it can be -## removed when the issue is resolved. -## ignore - attempt to build the port, but do not fail the CI test if the -## port does not build. Any ignored build failures will be reported -## in the test summary. -## -## -## CI tested triplets: -## arm64-windows -## arm-uwp -## x64-linux -## x64-osx -## x64-uwp -## x64-windows -## x64-windows-static -## x86-windows -## - - -# Add new items alphabetically - -3fd:arm64-windows=fail -3fd:arm-uwp=fail -3fd:x64-linux=fail -3fd:x64-osx=fail -3fd:x64-windows=fail -3fd:x64-windows-static=fail -3fd:x86-windows=ignore -7zip:arm64-windows=fail -7zip:arm-uwp=fail -7zip:x64-linux=fail -7zip:x64-osx=fail -7zip:x64-uwp=fail -abseil:arm-uwp=fail -ace:arm64-windows=fail -ace:arm-uwp=fail -ace:x64-osx=fail -ace:x64-uwp=fail -activemq-cpp:x64-windows-static=fail -akali:x64-uwp=fail -akali:arm-uwp=fail -akali:arm64-windows=fail -alac:arm-uwp=fail -alac:x64-uwp=fail -alembic:x64-linux=fail -alembic:x64-osx=fail -alembic:x64-windows-static=fail -ampl-mp:arm64-windows=fail -ampl-mp:arm-uwp=fail -ampl-mp:x64-uwp=fail -angelscript:arm64-windows=fail -angelscript:arm-uwp=fail -antlr4:arm64-windows=fail -antlr4:arm-uwp=fail -antlr4:x64-uwp=fail -anyrpc:arm-uwp=ignore -anyrpg:x64-uwp=ignore -anyrpc:x64-windows-static=ignore -apr:arm64-windows=fail -apr:arm-uwp=fail -apr:x64-linux=fail -apr:x64-osx=fail -apr:x64-uwp=fail -argtable2:arm-uwp=fail -argtable2:x64-uwp=fail -arrow:arm64-windows=fail -arrow:x64-linux=fail -arrow:x86-windows=fail -asiosdk:x64-linux=fail -asiosdk:x64-osx=fail -asiosdk:x64-uwp=fail -asiosdk:arm64-windows=fail -asiosdk:arm-uwp=fail -asmjit:arm64-windows=fail -asmjit:arm-uwp=fail -asmjit:x64-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 -avro-c:arm-uwp=fail -avro-c:x64-linux=fail -avro-c:x64-osx=fail -avro-c:x64-uwp=fail -aws-c-common:arm64-windows=fail -aws-c-common:arm-uwp=fail -aws-c-common:x64-uwp=fail -aws-checksums:arm64-windows=fail -aws-lambda-cpp:arm64-windows=fail -aws-lambda-cpp:arm-uwp=fail -aws-lambda-cpp:x64-uwp=fail -aws-lambda-cpp:x64-windows=fail -aws-lambda-cpp:x64-windows-static=fail -aws-lambda-cpp:x86-windows=fail -aws-lambda-cpp:x64-osx=fail -aws-sdk-cpp:x64-linux=ignore -azure-c-shared-utility:arm-uwp=fail -azure-c-shared-utility:x64-uwp=fail -basisu:x64-linux=ignore -bde:arm64-windows=fail -bde:arm-uwp=fail -bde:x64-uwp=fail -bde:x64-windows=fail -bde:x64-windows-static=fail -bde:x86-windows=fail -benchmark:arm64-windows=fail -benchmark:arm-uwp=fail -benchmark:x64-uwp=fail -berkeleydb:arm64-windows=fail -berkeleydb:arm-uwp=fail -berkeleydb:x64-linux=fail -berkeleydb:x64-osx=fail -berkeleydb:x64-uwp=fail -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 -blitz:x64-uwp=fail -blitz:arm64-windows=fail -blitz:arm-uwp=fail -blosc:arm64-windows=fail -blosc:arm-uwp=fail -blosc:x64-uwp=fail -bond:arm-uwp=fail -bond:x64-osx=fail -bond:x64-uwp=fail -boost-context:arm-uwp=fail -boost-context:x64-uwp=fail -boost-coroutine:arm-uwp=fail -boost-coroutine:arm64-windows=fail -boost-coroutine:x64-uwp=fail -boost-fiber:arm-uwp=fail -boost-fiber:arm64-windows=fail -boost-fiber:x64-osx=fail -boost-fiber:x64-uwp=fail -boost-fiber:x64-linux=ignore -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-mpi:x64-osx=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 -breakpad:x64-osx=fail -bullet3:arm64-windows=fail -bullet3:arm-uwp=fail -bullet3:x64-uwp=fail -butteraugli:x64-linux=ignore -caf:arm-uwp=fail -caf:arm64-windows=fail -caf:x64-uwp=fail -caf:x64-linux=ignore -caffe2:x86-windows=fail -cairomm:x64-linux=fail -capnproto:arm64-windows=fail -capnproto:arm-uwp=fail -capnproto:x64-uwp=fail -c-ares:arm-uwp=fail -c-ares:x64-uwp=fail -cartographer:x64-osx=fail -casclib:arm-uwp=fail -casclib:x64-uwp=fail -catch-classic:arm64-windows = skip -catch-classic:arm-uwp = skip -catch-classic:x64-linux = skip -catch-classic:x64-osx = skip -catch-classic:x64-uwp = skip -catch-classic:x64-windows = skip -catch-classic:x64-windows-static = skip -catch-classic:x86-windows = skip -ccd:arm-uwp=fail -ccd:x64-uwp=fail -cello:arm-uwp=fail -cello:x64-uwp=fail -cfitsio:arm-uwp=fail -cfitsio:x64-uwp=fail -cgicc:arm-uwp=fail -cgicc:x64-uwp=fail -chakracore:arm64-windows=fail -chakracore:arm-uwp=fail -chakracore:x64-linux=fail -chakracore:x64-osx=fail -chakracore:x64-uwp=fail -chakracore:x64-windows-static=fail -# DCMTK currently has a vendored copy of libcharls.a, which causes conflicts with charls (TODO: use charls' copy) -charls:x64-linux=skip -charls:x64-osx=skip -chartdir:arm64-windows=fail -chartdir:arm-uwp=fail -chartdir:x64-uwp=fail -chartdir:x64-windows-static=fail -chipmunk:arm64-windows=fail -chipmunk:arm-uwp=fail -chipmunk:x64-linux=fail -chipmunk:x64-osx=fail -chipmunk:x64-uwp=fail -chmlib:arm-uwp=fail -chmlib:x64-uwp=fail -civetweb:arm64-windows = skip -civetweb:arm-uwp = skip -civetweb:x64-linux = skip -civetweb:x64-osx = skip -civetweb:x64-uwp = skip -civetweb:x64-windows = skip -civetweb:x64-windows-static = skip -civetweb:x86-windows = skip -clapack:x64-uwp=fail -clblast:x64-osx=ignore -clblast:x64-linux=fail -clblast:x64-windows-static=fail -clockutils:x64-linux=fail -clockutils:x64-osx=fail -cmark:x64-windows-static=fail -cmcstl2:arm64-windows = skip -cmcstl2:arm-uwp = skip -cmcstl2:x64-linux = skip -cmcstl2:x64-osx = skip -cmcstl2:x64-uwp = skip -cmcstl2:x64-windows = skip -cmcstl2:x64-windows-static = skip -cmcstl2:x86-windows = skip -collada-dom:x64-osx=fail -collada-dom:x64-windows-static=fail -coolprop:arm-uwp=fail -coolprop:x64-linux=fail -coolprop:x64-osx=fail -coolprop:x64-uwp=fail -coroutine:arm-uwp=fail -coroutine:x64-linux=fail -coroutine:x64-uwp=fail -coroutine:x86-windows=fail -corrade:arm64-windows=fail -corrade:arm-uwp=fail -corrade:x64-uwp=fail -cppcms:x64-linux=fail -cppcms:x64-osx=fail -cppcms:x64-windows-static=fail -cppfs:arm-uwp=fail -cppfs:x64-uwp=fail -cppgraphqlgen:arm-uwp=fail -cppgraphqlgen:x64-uwp=ignore -cppkafka:x64-linux=ignore -cppmicroservices:arm64-windows=fail -cppmicroservices:arm-uwp=fail -cppmicroservices:x64-uwp=fail -cpp-netlib:arm-uwp=fail -cpp-netlib:x64-uwp=fail -cpp-netlib:x64-linux=ignore -cpp-taskflow:x64-osx=fail -cppunit:arm64-windows=fail -cppunit:arm-uwp=fail -cppunit:x64-linux=fail -cppunit:x64-osx=fail -cppunit:x64-uwp=fail -cpr:x64-linux=ignore -cpuinfo:arm64-windows=ignore -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 -ctemplate:x64-osx=fail -cuda:x64-linux=fail -cuda:x64-osx=fail -cudnn:arm64-windows=fail -cudnn:arm-uwp=fail -cudnn:x64-uwp=fail -cudnn:x64-windows-static=fail -cudnn:x86-windows=fail -date:arm64-windows=fail -dbow2:x64-osx=fail -dcmtk:arm64-windows=fail -dcmtk:arm-uwp=fail -dcmtk:x64-uwp=fail -detours:x64-linux=fail -detours:x64-osx=fail -devicenameresolver:arm-uwp=fail -devicenameresolver:x64-linux=fail -devicenameresolver:x64-osx=fail -devicenameresolver:x64-uwp=fail -devicenameresolver:x64-windows-static=fail -dimcli:arm-uwp=fail -dimcli:x64-osx=fail -dimcli:x64-uwp=fail -directxmesh:x64-linux=fail -directxmesh:x64-osx=fail -directxmesh:x64-windows-static=fail -directxtex:x64-linux=fail -directxtex:x64-osx=fail -directxtex:x64-windows-static=fail -directxtk:x64-linux=fail -directxtk:x64-osx=fail -directxtk:x64-windows-static=fail -directxtk12:x64-linux=fail -directxtk12:x64-osx=fail -directxtk12:x64-windows-static=fail -discord-rpc:arm-uwp=fail -discord-rpc:x64-uwp=fail -dlfcn-win32:arm-uwp=fail -dlfcn-win32:x64-linux=fail -dlfcn-win32:x64-osx=fail -dlfcn-win32:x64-uwp=fail -dmlc:arm-uwp=fail -dmlc:x64-uwp=fail -dmlc:x64-windows-static=ignore -dmlc:x86-windows=ignore -dpdk:arm64-windows=fail -dpdk:arm-uwp=fail -dpdk:x64-osx=fail -dpdk:x64-uwp=fail -dpdk:x64-windows=fail -dpdk:x64-windows-static=fail -dpdk:x86-windows=fail -duckx:arm64-windows = skip -duckx:arm-uwp = skip -duckx:x64-linux = skip -duckx:x64-osx = skip -duckx:x64-uwp = skip -duckx:x64-windows = skip -duckx:x64-windows-static = skip -duckx:x86-windows = skip -duilib:arm-uwp=fail -duilib:x64-linux=fail -duilib:x64-osx=fail -duilib:x64-uwp=fail - -# requires python@2 from brew, but that no longer exists -# python2 EOL yay! -duktape:x64-osx=skip - -dxut:arm64-windows=fail -dxut:arm-uwp=fail -dxut:x64-linux=fail -dxut:x64-osx=fail -dxut:x64-windows-static=fail -eastl:arm-uwp=fail -easyhook:arm64-windows=fail -easyhook:arm-uwp=fail -easyhook:x64-linux=fail -easyhook:x64-osx=fail -easyhook:x64-uwp=fail -easyhook:x64-windows-static=fail -easyloggingpp:arm-uwp=fail -easyloggingpp:x64-uwp=fail -eathread:arm64-windows=fail -eathread:arm-uwp=fail -eathread:x64-uwp=fail -eathread:x86-windows=fail -ebml:arm-uwp=fail -ebml:x64-uwp=fail -ecm:arm64-windows = skip -ecm:arm-uwp = skip -ecm:x64-linux = skip -ecm:x64-osx = skip -ecm:x64-uwp = skip -ecm:x64-windows = skip -ecm:x64-windows-static = skip -ecm:x86-windows = skip -ecsutil:arm64-windows=fail -ecsutil:arm-uwp=fail -ecsutil:x64-linux=fail -ecsutil:x64-osx=fail -ecsutil:x64-uwp=fail -embree2:x64-linux=fail -embree2:x64-osx=fail -embree2:x64-windows-static=fail -enet:arm-uwp=fail -enet:x64-uwp=fail -epsilon:arm-uwp=fail -epsilon:x64-linux=fail -epsilon:x64-osx=fail -epsilon:x64-uwp=fail -evpp:x64-osx=fail -expat:arm-uwp=fail -expat:x64-uwp=fail -faad2:x64-linux=fail -faad2:x64-osx=fail -fann:arm-uwp=fail -fann:x64-linux=fail -fann:x64-osx=fail -fann:x64-uwp=fail -fann:x64-windows-static=fail -farmhash:arm64-windows=fail -farmhash:arm-uwp=fail -farmhash:x64-uwp=fail -farmhash:x64-windows=fail -farmhash:x64-windows-static=fail -farmhash:x86-windows=fail -fastcdr:x64-linux=fail -fastrtps:arm-uwp=fail -fastrtps:x64-linux=fail -fastrtps:x64-osx=fail -fastrtps:x64-uwp=fail -fastrtps:x64-windows-static=fail -fdk-aac:arm64-windows=fail -fdk-aac:arm-uwp=fail -fdk-aac:x64-uwp=fail -fdlibm:arm-uwp=fail -fdlibm:x64-uwp=fail -fftw3:arm-uwp=fail -fftw3:x64-uwp=fail -field3d:x64-windows=fail -field3d:x64-windows-static=fail -field3d:x86-windows=fail -fizz:x64-windows=fail -fizz:x64-windows-static=fail -flint:x64-linux=fail -flint:x64-osx=fail -fltk:arm-uwp=fail -fltk:x64-uwp=fail -fluidsynth:x64-linux=fail -fluidsynth:x64-osx=fail -fmem:arm-uwp=fail -fmem:x64-uwp=fail -fmi4cpp:arm-uwp=fail -fmi4cpp:x64-uwp=fail -fmilib:arm64-windows=fail -fmilib:arm-uwp=fail -fmilib:x64-linux=ignore -fmilib:x64-uwp=fail -fmilib:x64-windows=ignore -fmilib:x64-windows-static=ignore -fmilib:x86-windows=ignore -# Folly fails due to a compiler bug in MSVC 19.22.27905, fixed in newer releases -folly:arm64-windows=fail -folly:x86-windows=fail -folly:x64-windows=fail -folly:x64-windows-static=fail -foonathan-memory:arm64-windows=fail -foonathan-memory:arm-uwp=fail -foonathan-memory:x64-uwp=fail -forge:x86-windows=fail -freeglut:arm64-windows=fail -freeglut:arm-uwp=fail -freeglut:x64-uwp=fail -freeglut:x64-osx=fail -freerdp:arm64-windows=fail -freerdp:arm-uwp=fail -freerdp:x64-osx=fail -freerdp:x64-uwp=fail -freetds:arm64-windows=fail -freetds:arm-uwp=fail -freetds:x64-linux=fail -freetds:x64-osx=fail -freetds:x64-uwp=fail -freetype-gl:x64-uwp=fail -freexl:arm-uwp=fail -freexl:arm64-windows=ignore -freexl:x64-uwp=fail -freexl:x86-windows=ignore -freexl:x64-windows=ignore -freexl:x64-windows-static=ignore -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 -fuzzylite:x64-linux=fail -fuzzylite:x64-osx=fail -fuzzylite:x64-uwp=fail -g3log:arm64-windows=fail -g3log:arm-uwp=fail -g3log:x64-uwp=fail -gainput:arm-uwp=fail -gainput:x64-linux=fail -gainput:x64-uwp=fail -gainput:x64-windows-static=fail -gamma:x64-linux=fail -gamma:x64-osx=fail -gdcm:arm64-windows=fail -gdcm:x64-linux = skip -geographiclib:x64-linux=ignore -geos:arm-uwp=fail -geos:x64-uwp=fail -getopt:arm-uwp=fail -getopt:x64-uwp=fail -getopt-win32:arm64-windows=fail -getopt-win32:arm-uwp=fail -getopt-win32:x64-linux=fail -getopt-win32:x64-osx=fail -getopt-win32:x64-uwp=fail -getopt-win32:x64-windows-static=fail -gflags:arm-uwp=fail -gflags:x64-uwp=fail - -# Conflicts with libevent -gherkin-c:arm64-windows = skip -gherkin-c:arm-uwp = skip -gherkin-c:x64-linux=fail -gherkin-c:x64-osx=fail -gherkin-c:x64-uwp = skip -gherkin-c:x64-windows = skip -gherkin-c:x64-windows-static = skip -gherkin-c:x86-windows = skip -gl3w:arm64-windows=fail -gl3w:arm-uwp=fail -glew:arm64-windows=fail -glew:arm-uwp=fail -glfw3:arm64-windows=fail -glfw3:arm-uwp=fail -glfw3:x64-uwp=fail -glib:x64-uwp=fail -glib:x64-windows-static=fail -glib:x64-osx=fail -globjects:x64-linux=ignore -gmmlib:arm64-windows=fail -gmmlib:arm-uwp=fail -gmmlib:x64-osx=fail -gmmlib:x64-uwp=fail -gmmlib:x64-windows=fail -gmmlib:x64-windows-static=fail -gmmlib:x86-windows=fail -googleapis:arm64-windows=fail -googleapis:arm-uwp=fail -googleapis:x64-uwp=fail -google-cloud-cpp-spanner:x86-windows=fail -gppanel:x64-osx=fail -gperf:x64-uwp=fail -gperf:arm-uwp=fail -graphicsmagick:arm64-windows=fail -graphicsmagick:arm-uwp=fail -graphicsmagick:x64-uwp=fail -graphite2:arm-uwp=fail -graphite2:x64-uwp=fail -graphqlparser:arm-uwp=fail -graphqlparser:x64-uwp=fail -grpc:arm-uwp=fail -gsl:arm-uwp=fail -gsl:x64-uwp=fail -gsoap:arm-uwp=ignore -gsoap:x64-linux=fail -gsoap:x64-osx=fail -gsoap:x86-windows=ignore -gtk:x64-linux=fail -gtk:x86-windows=ignore -gts:x64-linux=fail -gts:x64-osx=fail -guetzli:x64-osx=fail -h3:arm64-windows=fail -h3:arm-uwp=fail -h3:x64-uwp=fail -halide:x64-windows-static=fail -hdf5:arm64-windows=fail -hdf5:arm-uwp=fail -hdf5:x64-uwp=fail -healpix:x86-windows=fail -healpix:x64-windows=fail -healpix:x64-windows-static=fail -healpix:x64-uwp=fail -healpix:arm64-windows=fail -healpix:arm-uwp=fail -healpix:x64-osx=fail -hidapi:arm64-windows=fail -hidapi:arm-uwp=fail -hidapi:x64-linux=fail -hidapi:x64-osx=fail -hidapi:x64-uwp=fail -hiredis:arm-uwp=fail -hiredis:x64-uwp=fail -hpx:x64-windows-static=fail -hwloc:arm64-windows=fail -hwloc:arm-uwp=fail -hwloc:x64-linux=fail -hwloc:x64-osx=fail -hwloc:x64-uwp=fail -hyperscan:x64-linux=ignore -hypre:x64-linux=fail -hypre:x64-osx=fail -icu:arm64-windows=fail -icu:arm-uwp=fail -icu:x64-uwp=fail -ignition-msgs1:arm64-windows=fail -ignition-msgs1:arm-uwp=fail -ignition-msgs1:x64-uwp=fail -imgui-sfml:x64-linux=ignore -intel-ipsec:arm64-windows=fail -intel-ipsec:arm-uwp=fail -intel-ipsec:x64-osx=fail -intel-ipsec:x64-uwp=fail -intel-ipsec:x64-windows=fail -intel-ipsec:x64-windows-static=fail -intel-ipsec:x86-windows=fail -intel-mkl:arm64-windows=fail -intel-mkl:arm-uwp=fail -intel-mkl:x64-linux=fail -intel-mkl:x64-osx=fail -intel-mkl:x64-uwp=fail -intel-mkl:x64-windows=fail -intel-mkl:x64-windows-static=fail -intel-mkl:x86-windows=fail -intelrdfpmathlib:arm-uwp=fail -intelrdfpmathlib:x64-linux=fail -intelrdfpmathlib:x64-uwp=fail -io2d:x64-linux=fail -irrlicht:arm64-windows=fail -irrlicht:arm-uwp=fail -irrlicht:x64-osx=fail -irrlicht:x64-uwp=fail -isal:arm64-windows=fail -isal:arm-uwp=fail -isal:x64-osx=fail -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 -ixwebsocket:x64-linux=ignore -jack2:arm-uwp=fail -jack2:x64-uwp=fail -jbig2dec:arm-uwp=fail -jbig2dec:x64-uwp=fail -jemalloc:arm64-windows=fail -jemalloc:arm-uwp=fail -jemalloc:x64-linux=fail -jemalloc:x64-osx=fail -jemalloc:x64-uwp=fail -jemalloc:x64-windows-static=fail -jinja2cpplight:arm-uwp=fail -jinja2cpplight:x64-uwp=fail -keystone:arm64-windows=fail -keystone:arm-uwp=fail -keystone:x64-uwp=fail -kinectsdk1:arm64-windows=fail -kinectsdk1:arm-uwp=fail -kinectsdk1:x64-linux=fail -kinectsdk1:x64-osx=fail -kinectsdk2:arm64-windows=fail -kinectsdk2:arm-uwp=fail -kinectsdk2:x64-linux=fail -kinectsdk2:x64-osx=fail -lastools:arm-uwp=fail -lastools:x64-uwp=fail -laszip:arm-uwp=fail -laszip:x64-uwp=fail -lcm:x64-linux=fail -lcm:x64-osx=fail -leptonica:x64-uwp=fail -leptonica:arm-uwp=fail -leptonica:arm64-windows=fail -leveldb:arm-uwp=fail -leveldb:x64-uwp=fail -libaiff:x64-linux=fail -libarchive:arm64-windows=fail -libarchive:arm-uwp=fail -libarchive:x64-uwp=fail -libass:x64-windows-static=fail -libb2:x86-windows=fail -libb2:x64-windows=fail -libb2:x64-windows-static=fail -libb2:x64-uwp=fail -libb2:arm64-windows=fail -libb2:arm-uwp=fail -libb2:x64-osx=fail -libbf:arm64-windows=fail -libbf:arm-uwp=fail -libbf:x64-uwp=fail -libbf:x64-windows=fail -libbf:x64-windows-static=fail -libbf:x86-windows=fail -libbson:arm-uwp=fail -libbson:x64-uwp=fail -libcds:arm64-windows=fail -libcds:arm-uwp=fail -libcds:x64-uwp=fail -libconfig:x64-osx=fail -libcopp:arm64-windows=fail -libcopp:arm-uwp=fail -libcopp:x64-windows-static=fail -cpuid:arm-uwp=fail -cpuid:x64-uwp=fail -cpuid:arm64-windows=fail -libdatrie:x64-linux=fail -libdatrie:x64-osx=fail -libdisasm:arm-uwp=fail -libdisasm:x64-uwp=fail -libdshowcapture:arm64-windows=fail -libdshowcapture:arm-uwp=fail -libdshowcapture:x64-linux=fail -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 -libevent:x64-uwp=fail -libevhtp:x86-windows=fail -libevhtp:x64-windows=fail -libevhtp:x64-windows-static=fail -libevhtp:x64-uwp=fail -libevhtp:arm64-windows=fail -libevhtp:arm-uwp=fail -libexif:arm-uwp=fail -libexif:x64-uwp=fail -libfabric:arm-uwp=fail -libfabric:x64-linux=fail -libfabric:x64-osx=fail -libfabric:x64-uwp=fail -libfabric:x64-windows=ignore -libfreenect2:arm64-windows=fail -libgd:x64-linux=ignore -libgit2:arm64-windows=fail -libgit2:arm-uwp=fail -libgit2:x64-uwp=fail -libgo:arm64-windows=fail -libgo:x64-linux=fail -libgo:x64-osx=fail -libgo:x64-windows=fail -libgo:x64-windows-static=fail -libgo:x86-windows=fail -libgpod:arm64-windows=fail -libgpod:arm-uwp=fail -libgpod:x64-uwp=fail -libgpod:x64-windows=fail -libgpod:x64-windows-static=fail -libgpod:x86-windows=fail -libhdfs3:arm64-windows=fail -libhdfs3:arm-uwp=fail -libhdfs3:x64-uwp=fail -libhdfs3:x64-windows=fail -libhdfs3:x64-windows-static=fail -libhdfs3:x86-windows=fail -libhdfs3:x64-linux=fail -libhydrogen:arm64-windows=fail -libics:arm-uwp=fail -libics:x64-uwp=fail -libidn2:x64-linux=fail -libidn2:x64-osx=fail -libigl:arm64-windows=fail -libigl:arm-uwp=fail -libigl:x64-uwp=fail -liblemon:arm-uwp=fail -liblemon:x64-uwp=fail -liblinear:arm-uwp=fail -liblinear:x64-uwp=fail -liblo:arm-uwp=fail -liblo:x64-linux=fail -liblo:x64-osx=fail -liblo:x64-uwp=fail -liblsl:arm64-windows=fail -liblsl:arm-uwp=fail -liblsl:x64-linux=fail -liblsl:x64-osx=fail -liblsl:x64-uwp=fail -libmad:arm-uwp=fail -libmad:x64-uwp=fail -libmagic:x86-windows=fail -libmagic:x64-windows=fail -libmagic:x64-windows-static=fail -libmagic:x64-uwp=fail -libmagic:arm64-windows=fail -libmagic:arm-uwp=fail -libmariadb:arm64-windows = skip -libmariadb:arm-uwp = skip -libmariadb:x64-linux = skip -libmariadb:x64-osx = skip -libmariadb:x64-uwp = skip -libmariadb:x64-windows = skip -libmariadb:x64-windows-static = skip -libmariadb:x86-windows = skip -# libmesh installs tons of problematic files that conflict with other ports (boost, eigen, etc) -libmesh:arm64-windows=skip -libmesh:arm-uwp=skip -libmesh:x64-uwp=skip -libmesh:x64-windows=skip -libmesh:x64-windows-static=skip -libmesh:x86-windows=skip -libmesh:x64-osx=skip -libmesh:x64-linux=skip -libmicrohttpd:arm64-windows=fail -libmicrohttpd:arm-uwp=fail -libmicrohttpd:x64-linux=fail -libmicrohttpd:x64-osx=fail -libmicrohttpd:x64-uwp=fail -libmodbus:arm-uwp=fail -libmodbus:x64-uwp=fail -libmodman:arm-uwp=fail -libmodman:x64-uwp=fail -libmodman:x64-windows-static=fail -libmodplug:arm-uwp=fail -libmodplug:x64-uwp=fail -libmupdf:x64-linux=fail -libmupdf:x64-osx=fail -libmysql:x86-windows=fail -libnice:x64-linux=fail -libnice:x64-osx=fail -libodb-boost:x64-linux=ignore -libodb-pgsql:x64-linux=ignore -libodb-pgsql:x64-windows=ignore -libopenmpt:x64-linux=fail -libopenmpt:x64-osx=fail -libopusenc:arm-uwp=fail -libopusenc:x64-linux=fail -libopusenc:x64-osx=fail -libopusenc:x64-uwp=fail -libosip2:arm64-windows=fail -libosip2:arm-uwp=fail -libosip2:x64-uwp=fail -libosip2:x64-windows=fail -libosip2:x64-windows-static=fail -libosip2:x86-windows=fail -libp7-baical:arm64-windows = skip -libp7-baical:arm-uwp = skip -libp7-baical:x64-linux = skip -libp7-baical:x64-osx = skip -libp7-baical:x64-uwp = skip -libp7-baical:x64-windows = skip -libp7-baical:x64-windows-static = skip -libp7-baical:x86-windows = skip -libp7client:arm64-windows=fail -libp7client:arm-uwp=fail -libp7client:x64-linux=fail -libp7client:x64-osx=fail -libp7client:x64-uwp=fail -libpcap:arm64-windows=fail -libpcap:arm-uwp=fail -libpcap:x64-osx=fail -libpcap:x64-uwp=fail -libpcap:x64-windows=fail -libpcap:x64-windows-static=fail -libpcap:x86-windows=fail -libpff:arm-uwp=fail -libpff:x64-linux=fail -libpff:x64-osx=fail -libpff:x64-uwp=fail -libpff:x64-windows-static=fail -libplist:x64-windows-static=fail -libpng-apng:arm64-windows = skip -libpng-apng:arm-uwp = skip -libpng-apng:x64-linux = skip -libpng-apng:x64-osx = skip -libpng-apng:x64-uwp = skip -libpng-apng:x64-windows = skip -libpng-apng:x64-windows-static = skip -libpng-apng:x86-windows = skip -libpq:arm-uwp=fail -libpq:x64-uwp=fail -librabbitmq:x64-linux=ignore -libraqm:x64-windows-static=fail -librdkafka:arm-uwp=fail -librdkafka:x64-uwp=fail - -# Conflicts with openssl -boringssl:arm64-windows = skip -boringssl:arm-uwp = skip -boringssl:x64-linux = skip -boringssl:x64-osx = skip -boringssl:x64-uwp = skip -boringssl:x64-windows = skip -boringssl:x64-windows-static = skip -boringssl:x86-windows = skip -libressl:arm64-windows = skip -libressl:arm-uwp = skip -libressl:x64-linux = skip -libressl:x64-osx = skip -libressl:x64-uwp = skip -libressl:x64-windows = skip -libressl:x64-windows-static = skip -libressl:x86-windows = skip -librsync:arm-uwp=fail -librsync:x64-uwp=fail -libsamplerate:arm64-windows=fail -libsamplerate:arm-uwp=fail -libsamplerate:x64-osx=fail -libsoundio:arm64-windows=fail -libsoundio:arm-uwp=fail -libsoundio:x64-uwp=fail -libsrt:arm-uwp=fail -libsrt:x64-uwp=fail -libssh:arm64-windows=fail -libssh:arm-uwp=fail -libssh:x64-uwp=fail -libstk:arm-uwp=fail -libstk:x64-uwp=fail -libtins:arm-uwp=fail -libtins:x64-uwp=fail -libtorrent:arm-uwp=fail -libtorrent:x64-uwp=fail -libudis86:arm-uwp=fail -libudis86:x64-linux=fail -libudis86:x64-osx=fail -libudis86:x64-uwp=fail -libudns:arm64-windows=fail -libudns:arm-uwp=fail -libudns:x64-uwp=fail -libudns:x64-windows=fail -libudns:x64-windows-static=fail -libudns:x86-windows=fail -libudns:x64-osx=fail -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 -libusbmuxd:x64-linux=fail -libusbmuxd:x64-osx=fail -libusb-win32:arm64-windows=fail -libusb-win32:arm-uwp=fail -libusb-win32:x64-linux=fail -libusb-win32:x64-osx=fail -libusb-win32:x64-uwp=fail -libuuid:arm64-windows=fail -libuuid:arm-uwp=fail - -# Causes build failures in vxl and podofo on osx -# Conflicts with Darwin kernel sdk uuid.h (has missing definitions) -libuuid:x64-osx = skip -libuuid:x64-uwp=fail -libuuid:x64-windows=fail -libuuid:x64-windows-static=fail -libuuid:x86-windows=fail -libuv:arm64-windows=fail -libuv:arm-uwp=fail -libuv:x64-uwp=fail -libvpx:arm64-windows=fail -libvpx:arm-uwp=fail -libvpx:x64-linux=fail -libvpx:x64-osx=fail -libwandio:x86-windows=fail -libwandio:x64-windows=fail -libwandio:x64-windows-static=fail -libwandio:x64-uwp=fail -libwandio:arm64-windows=fail -libwandio:arm-uwp=fail -libwebsockets:arm-uwp=fail -libwebsockets:x64-uwp=fail -libxmp-lite:x64-linux=fail -libxmp-lite:x64-osx=fail -libxslt:arm-uwp=fail -libxslt:x64-osx=fail -libxslt:x64-uwp=fail -libyuv:arm-uwp=fail -libyuv:x64-uwp=fail -libzen:arm-uwp=fail -libzen:x64-uwp=fail -libzippp:x64-linux=ignore -linenoise-ng:arm-uwp=fail -linenoise-ng:x64-uwp=fail -live555:arm64-windows=fail -live555:arm-uwp=fail -live555:x64-linux=fail -live555:x64-osx=fail -live555:x64-uwp=fail -live555:x64-windows=fail -live555:x64-windows-static=fail -live555:x86-windows=fail -llgl:arm-uwp=fail -llgl:x64-uwp=fail -llvm:arm64-windows=fail -llvm:arm-uwp=fail -llvm:x64-uwp=fail -llvm:x64-linux=ignore -# disable them temporarily and wait for fix -llvm:x64-windows=fail -llvm:x64-windows-static=fail -# installing iconv makes building llvm fail; needs to be fixed -llvm:x64-osx=ignore -lmdb:arm64-windows=fail -lmdb:arm-uwp=fail -lmdb:x64-uwp=fail -log4cplus:arm-uwp=fail -log4cplus:x64-uwp=fail -log4cpp:arm-uwp=fail -log4cpp:x64-uwp=fail -lpeg:x64-linux=fail -lpeg:x64-osx=fail -lua:arm-uwp=fail -lua:x64-uwp=fail -luafilesystem:x64-linux=fail -luafilesystem:x64-osx=fail -luajit:arm64-windows = skip -luajit:arm-uwp = skip -luajit:x64-linux = skip -luajit:x64-osx = skip -luajit:x64-uwp = skip -luajit:x64-windows = skip -luajit:x64-windows-static = skip -luajit:x86-windows = skip -luasocket:x64-linux=fail -luasocket:x64-osx=fail -lzfse:arm-uwp=fail -marl:arm-uwp=fail -marl:x64-uwp=fail -mathgl:x64-osx=fail -mathgl:x64-uwp=fail -mathgl:x64-linux=ignore -matio:x64-linux=fail -matio:x64-osx=fail -mbedtls:arm-uwp=fail -mbedtls:x64-uwp=fail -mdnsresponder:arm64-windows=fail -mdnsresponder:arm-uwp=fail -mdnsresponder:x64-linux=fail -mdnsresponder:x64-osx=fail -mdnsresponder:x64-uwp=fail -mecab:arm64-windows = skip -mecab:arm-uwp = skip -mecab:x64-linux = skip -mecab:x64-uwp = skip -mecab:x64-windows = skip -mecab:x64-windows-static = skip -mecab:x86-windows = skip -memorymodule:arm-uwp=fail -memorymodule:x64-linux=fail -memorymodule:x64-osx=fail -memorymodule:x64-uwp=fail -meschach:arm-uwp=fail -meschach:x64-linux=fail -meschach:x64-osx=fail -meschach:x64-uwp=fail -metis:arm-uwp=fail -metis:x64-uwp=fail -metrohash:arm-uwp=fail -metrohash:x64-uwp=fail -metrohash:x86-windows=fail -metrohash:arm64-windows=fail -mhook:arm64-windows=fail -mhook:arm-uwp=fail -mhook:x64-linux=fail -mhook:x64-osx=fail -mhook:x64-uwp=fail -milerius-sfml-imgui:x64-osx=fail -milerius-sfml-imgui:x64-windows-static=fail -milerius-sfml-imgui:x64-linux=ignore -mimalloc:arm64-windows=fail -mimalloc:arm-uwp=fail -mimalloc:x64-uwp=fail -minhook:arm64-windows=fail -minhook:arm-uwp=fail -minhook:x64-linux=fail -minhook:x64-osx=fail -minhook:x64-uwp=fail -minifb:arm-uwp=fail -minifb:x64-uwp=fail -minisat-master-keying:arm-uwp=fail -minisat-master-keying:x64-uwp=fail -miniupnpc:arm-uwp=fail -miniupnpc:x64-uwp=fail -minizip:arm-uwp=fail -minizip:x64-uwp=fail -mlpack:x64-linux=ignore -mman:x64-linux=fail -mman:x64-osx=fail -# mmx installs many problematic headers, such as `json.h` and `sched.h` -mmx:x64-windows=skip -mmx:x64-windows-static=skip -mmx:x86-windows=skip -mmx:x64-linux=skip -mmx:x64-osx=skip -mmx:arm-uwp=skip -mmx:x64-uwp=skip -mmx:arm64-windows=skip -# Flaky strange linker error -mongo-c-driver:x64-osx=skip -mongoose:arm-uwp=fail -mongoose:x64-uwp=fail -monkeys-audio:arm64-windows=fail -monkeys-audio:arm-uwp=fail -monkeys-audio:x64-linux=fail -monkeys-audio:x64-osx=fail -monkeys-audio:x64-uwp=fail -monkeys-audio:x64-windows-static=fail -moos-core:arm-uwp=fail -moos-core:x64-uwp=fail -moos-core:x64-windows=ignore -moos-core:x64-windows-static=fail -moos-core:x86-windows=ignore -moos-essential:arm64-windows=fail -moos-essential:x64-windows=fail -moos-essential:x86-windows=fail -moos-essential:x64-linux=ignore -mosquitto:x64-windows-static=fail -mozjpeg:arm64-windows = skip -mozjpeg:arm-uwp = skip -mozjpeg:x64-linux = skip -mozjpeg:x64-osx = skip -mozjpeg:x64-uwp = skip -mozjpeg:x64-windows = skip -mozjpeg:x64-windows-static = skip -mozjpeg:x86-windows = skip -mpg123:arm-uwp=fail -mpg123:x64-uwp=fail -mpir:arm64-windows=fail -mpir:arm-uwp=fail -mpir:x64-uwp=fail - -#Conflicts with angle -ms-angle:arm64-windows = skip -ms-angle:arm-uwp = skip -ms-angle:x64-linux = skip -ms-angle:x64-osx = skip -ms-angle:x64-uwp = skip -ms-angle:x64-windows = skip -ms-angle:x64-windows-static = skip -ms-angle:x86-windows = skip -msix:x64-linux=fail -msix:x64-osx=fail -msix:x64-windows-static=fail -msmpi:arm64-windows=fail -msmpi:arm-uwp=fail -msmpi:x64-linux=fail -msmpi:x64-osx=fail -msmpi:x64-uwp=fail -muparser:arm-uwp=fail -muparser:x64-uwp=fail -murmurhash:arm-uwp=fail -murmurhash:x64-uwp=fail -murmurhash:arm64-windows=fail -nana:arm-uwp=fail -nana:x64-linux=fail -nana:x64-osx=fail -nana:x64-uwp=fail -nanodbc:arm-uwp=fail -nanodbc:x64-linux=fail -nanodbc:x64-osx=fail -nanodbc:x64-uwp=fail -nanorange:arm64-windows=fail -nanorange:arm-uwp=fail -nanorange:x64-linux=fail -nanorange:x64-osx=fail -nanorange:x64-uwp=fail -nanorange:x64-windows=fail -nanorange:x64-windows-static=fail -nanorange:x86-windows=fail -nanovg:arm-uwp=fail -nanovg:arm64-windows=ignore -nanovg:x64-uwp=fail -nanovg:x64-linux=ignore -nanovg:x64-windows=ignore -nanovg:x64-windows-static=ignore -nanovg:x86-windows=ignore -nativefiledialog:arm-uwp=fail -nativefiledialog:x64-uwp=fail -netcdf-cxx4:x64-linux=ignore -nethost:x64-uwp=fail -nethost:arm-uwp=fail -networkdirect-sdk:arm64-windows=fail -networkdirect-sdk:arm-uwp=fail -networkdirect-sdk:x64-linux=fail -networkdirect-sdk:x64-osx=fail -networkdirect-sdk:x64-uwp=fail -networkdirect-sdk:x86-windows=fail -nlopt:arm-uwp=fail -nlopt:x64-uwp=fail -nmslib:arm64-windows=fail -nmslib:arm-uwp=fail -nmslib:x64-uwp=fail -nng:arm-uwp=fail -nng:x64-uwp=fail -nrf-ble-driver:arm-uwp=fail -nrf-ble-driver:x64-uwp=fail -nrf-ble-driver:x64-linux=ignore -numactl:arm64-windows=fail -numactl:arm-uwp=fail -numactl:x64-osx=fail -numactl:x64-uwp=fail -numactl:x64-windows=fail -numactl:x64-windows-static=fail -numactl:x86-windows=fail -nvtt:arm64-windows=fail -nvtt:arm-uwp=fail -nvtt:x64-uwp=fail -octomap:arm-uwp=fail -octomap:x64-uwp=fail -ode:arm64-windows=fail -ode:arm-uwp=fail -ode:x64-uwp=fail -ode:x64-linux=ignore -offscale-libetcd-cpp:arm64-windows=fail -offscale-libetcd-cpp:arm-uwp=fail -offscale-libetcd-cpp:x64-uwp=fail -ogdf:arm64-windows = skip -ogdf:arm-uwp = skip -ogdf:x64-osx=fail -ogdf:x64-uwp = skip -ogdf:x64-windows = skip -ogdf:x64-windows-static = skip -ogdf:x86-windows = skip -ogre:x64-osx=fail -# Conflicts with ogre -ogre-next:arm64-windows = skip -ogre-next:arm-uwp = skip -ogre-next:x64-osx = skip -ogre-next:x64-linux = skip -ogre-next:x64-uwp = skip -ogre-next:x64-windows = skip -ogre-next:x64-windows-static = skip -ogre-next:x86-windows = skip -ois:arm64-windows=fail -ois:arm-uwp=fail -ois:x64-uwp=fail -ompl:x64-osx=fail -ompl:x64-linux=ignore -open62541:arm-uwp=fail -open62541:x64-uwp=fail -openal-soft:arm-uwp=fail -openal-soft:x64-uwp=fail -openblas:arm64-windows=fail -openblas:arm-uwp=fail -opencensus-cpp:arm64-windows=fail -opencensus-cpp:x64-windows=fail -opencensus-cpp:x64-windows-static=fail -opencensus-cpp:x86-windows=fail -opencensus-cpp:x64-uwp=fail -opencl:arm64-windows=fail -opencl:arm-uwp=fail -opencl:x64-uwp=fail -opencolorio:x64-linux=ignore -opencsg:x64-uwp=fail -opencv3:arm64-windows = skip -opencv3:arm-uwp = skip -opencv3:x64-linux = skip -opencv3:x64-osx = skip -opencv3:x64-uwp = skip -opencv3:x64-windows = skip -opencv3:x64-windows-static = skip -opencv3:x86-windows = skip -opendnp3:x64-uwp=fail -opendnp3:arm-uwp=fail -openexr:arm64-windows=fail -openexr:arm-uwp=fail -openexr:x64-uwp=fail -opengl:arm64-windows=fail -opengl:arm-uwp=fail -openimageio:x64-linux=ignore -openmama:x64-windows=ignore -openmama:x86-windows=ignore -openmesh:arm64-windows=fail -openmesh:arm-uwp=fail -openmesh:x64-uwp=fail -openmpi:arm64-windows=fail -openmpi:arm-uwp=fail -openmpi:x64-uwp=fail -openmpi:x64-windows=fail -openmpi:x64-windows-static=fail -openmpi:x86-windows=fail -openmvg:x64-linux=ignore -openmvs:x64-linux=fail -openni2:x64-uwp=fail -openni2:x64-windows-static=fail -openscap:x64-linux=fail -openssl-unix:arm64-windows=fail -openssl-unix:arm-uwp=fail -openssl-unix:x64-uwp=fail -openssl-unix:x64-windows=fail -openssl-unix:x64-windows-static=fail -openssl-unix:x86-windows=fail -openssl-uwp:arm64-windows=fail -openssl-uwp:x64-linux=fail -openssl-uwp:x64-osx=fail -openssl-uwp:x64-windows=fail -openssl-uwp:x64-windows-static=fail -openssl-uwp:x86-windows=fail -openssl-windows:arm-uwp=fail -openssl-windows:x64-linux=fail -openssl-windows:x64-osx=fail -openssl-windows:x64-uwp=fail -opentracing:arm-uwp=fail -opentracing:x64-uwp=fail -openvdb:x64-linux=ignore -openvdb:x64-osx=fail -openvdb:x64-windows-static=fail -openvpn3:x64-osx=fail -openvr:arm64-windows=fail -openvr:arm-uwp=fail -openvr:x64-osx=fail -openvr:x64-uwp=fail -openxr-loader:arm64-windows=fail -openxr-loader:arm-uwp=fail -openxr-loader:x64-osx=fail -openxr-loader:x64-uwp=fail -optional-bare:arm64-windows = skip -optional-bare:arm-uwp = skip -optional-bare:x64-linux = skip -optional-bare:x64-osx = skip -optional-bare:x64-uwp = skip -optional-bare:x64-windows = skip -optional-bare:x64-windows-static = skip -optional-bare:x86-windows = skip -opusfile:arm-uwp=fail -opusfile:x64-uwp=fail -orc:x64-linux=ignore -orocos-kdl:arm-uwp=fail -orocos-kdl:x64-uwp=fail -osg:x86-windows=skip -osg:x64-windows=skip -osgearth:x64-osx=fail -osgearth:x64-linux=fail -osgearth:x64-windows-static=fail -osg-qt:x64-windows-static=fail -# Missing Fontconfig linkage in vcpkg_cmake_wrapper. Will be fixed by #9860 with the removal of the wrapper. -osg-qt:x64-osx=fail -osg-qt:x64-linux=ignore -otl:x64-windows=ignore -otl:x64-windows-static=ignore -otl:x64-uwp=ignore -otl:x64-linux=ignore -otl:x86-windows=ignore -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:x64-windows=ignore -pangomm:x86-windows=ignore -pangomm:arm64-windows=fail -parmetis:x64-linux=fail -parmetis:x64-osx=fail -pbc:arm-uwp=fail -pbc:x64-uwp=fail -pcre2:arm-uwp=fail -pdal:x64-linux=fail -pdal:x64-osx=fail -pdal-c:x64-windows-static=fail -pdcurses:arm-uwp=fail -pdcurses:x64-linux=fail -pdcurses:x64-osx=fail -pdcurses:x64-uwp=fail -pdcurses:x64-windows-static=fail -pfring:arm64-windows=fail -pfring:arm-uwp=fail -pfring:x64-uwp=fail -pfring:x64-windows=fail -pfring:x64-windows-static=fail -pfring:x86-windows=fail -pfring:x64-osx=fail -physfs:arm64-windows=fail -physx:arm64-windows=fail -physx:x64-linux=fail -physx:x64-osx=fail -piex:x64-osx=fail -pistache:arm64-windows=fail -pistache:arm-uwp=fail -pistache:x64-osx=fail -pistache:x64-uwp=fail -pistache:x64-windows=fail -pistache:x64-windows-static=fail -pistache:x86-windows=fail -pixel:x64-uwp=fail -pixel:x64-windows=fail -pixel:x64-windows-static=fail -pixel:x86-windows=fail -pixel:x64-linux=ignore -platform-folders:arm-uwp=fail -platform-folders:x64-uwp=fail -plib:arm-uwp=fail -plib:x64-osx=fail -plib:x64-uwp=fail -plibsys:arm-uwp=fail -plibsys:x64-linux=fail -plibsys:x64-osx=fail -plibsys:x64-uwp=fail -plplot:arm64-windows=fail -plplot:arm-uwp=fail -plplot:x64-uwp=fail -pmdk:arm64-windows=fail -pmdk:arm-uwp=fail -pmdk:x64-linux=fail -pmdk:x64-osx=fail -pmdk:x64-uwp=fail -pmdk:x64-windows-static=fail -pmdk:x86-windows=fail -pngwriter:arm-uwp=fail -pngwriter:x64-uwp=fail -pngwriter:x64-linux=ignore -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:arm64-windows=fail -portaudio:arm-uwp=fail -portaudio:x64-uwp=fail -portmidi:arm64-windows=fail -portmidi:arm-uwp=fail -portmidi:x64-linux=fail -portmidi:x64-osx=fail -portmidi:x64-uwp=fail -ppconsul:arm-uwp=fail -ppconsul:x64-uwp=fail -ppconsul:x64-linux=ignore -pqp:arm-uwp=fail -pqp:x64-uwp=fail -proj4:arm64-windows=fail -proj4:arm-uwp=fail -proj4:x64-uwp=fail -protobuf-c:x86-windows=fail -protobuf-c:x64-windows=fail -protobuf-c:x64-windows-static=fail -protobuf-c:x64-uwp=fail -protobuf-c:arm64-windows=fail -protobuf-c:arm-uwp=fail -ptex:arm-uwp=fail -ptex:x64-linux=fail -ptex:x64-osx=fail -ptex:x64-uwp=fail -pthreads:arm64-windows=fail -pthreads:arm-uwp=fail -pthreads:x64-uwp=fail -python2:arm64-windows=fail -python2:arm-uwp=fail -python2:x64-linux=fail -python2:x64-osx=fail -python2:x64-uwp=fail -python3:arm64-windows=fail -python3:arm-uwp=fail -python3:x64-osx=fail -python3:x64-uwp=fail -qca:x64-linux=fail -qca:x64-osx=fail -qca:x64-windows-static=fail -qhull:arm-uwp=ignore -qhull:x64-windows-static=ignore -qhull:x64-uwp=ignore -qpid-proton:arm-uwp=fail -qpid-proton:x64-uwp=fail -qpid-proton:x64-windows-static=fail -qscintilla:x64-linux=fail -qt5-activeqt:x64-linux=fail -qt5-activeqt:x64-osx=fail -qt5-macextras:x64-linux=fail -qt5-macextras:x64-windows=fail -qt5-macextras:x64-windows-static=fail -qt5-macextras:x86-windows=fail -qt5-winextras:x64-linux=fail -qt5-winextras:x64-osx=fail -quickfast:x64-linux=ignore -quickfix:x64-linux=ignore -quickfix:x64-windows=ignore -quickfix:x64-windows-static=ignore -quickfix:x86-windows=ignore -quickfix:x64-uwp=fail -quickfix:arm-uwp=fail -quirc:arm64-windows = skip -quirc:arm-uwp = skip -quirc:x64-linux = skip -quirc:x64-osx = skip -quirc:x64-uwp = skip -quirc:x64-windows = skip -quirc:x64-windows-static = skip -quirc:x86-windows = skip -qwt:x64-osx=ignore -rabit:x64-osx=fail -rabit:x64-linux=ignore -ragel:arm-uwp=fail -ragel:x64-uwp=fail -range-v3-vs2015:arm64-windows = skip -range-v3-vs2015:arm-uwp = skip -range-v3-vs2015:x64-linux = skip -range-v3-vs2015:x64-osx = skip -range-v3-vs2015:x64-uwp = skip -range-v3-vs2015:x64-windows = skip -range-v3-vs2015:x64-windows-static = skip -range-v3-vs2015:x86-windows = skip -rapidstring:arm64-windows=fail -rapidstring:arm-uwp=fail -rapidstring:x64-linux=fail -rapidstring:x64-uwp=fail -rapidstring:x64-windows=fail -rapidstring:x64-windows-static=fail -rapidstring:x86-windows=fail -raylib:arm64-windows=fail -raylib:arm-uwp=fail -raylib:x64-uwp=fail -readline:arm-uwp=fail -readline:x64-uwp=fail -readline-win32:arm64-windows=fail -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 -redis-plus-plus:x64-windows-static=fail -redis-plus-plus:arm64-windows=fail -replxx:arm-uwp=fail -replxx:x64-uwp=fail -replxx:arm64-windows=fail -reproc:arm-uwp=fail -reproc:x64-uwp=fail -restbed:arm-uwp=fail -restbed:x64-uwp=fail -rhash:arm64-windows=fail -rhash:arm-uwp=fail -rhash:x64-uwp=fail -rocksdb:arm-uwp=fail -rocksdb:x64-uwp=fail -rocksdb:x64-linux=ignore -rpclib:arm64-windows=fail -rpclib:arm-uwp=fail -rpclib:x64-uwp=fail -rpclib:x64-windows=ignore -rpclib:x86-windows=ignore -rpclib:x64-windows-static=ignore -rttr:arm-uwp=fail -rttr:x64-uwp=fail -rxspencer:x64-uwp=fail -rxspencer:arm-uwp=fail -ryu:arm-uwp=fail -ryu:x64-uwp=fail -ryu:x64-windows-static=fail -ryu:x86-windows=fail -ryu::arm64-windows=fail -scintilla:arm-uwp=fail -scintilla:x64-linux=fail -scintilla:x64-osx=fail -scintilla:x64-uwp=fail -scintilla:x64-windows-static=fail -sciter:arm64-windows=fail -sciter:arm-uwp=fail -sciter:x64-uwp=fail -sciter:x64-windows-static=fail -scnlib:arm-uwp=fail -scnlib:x64-uwp=fail -scnlib:x86-windows=fail -scylla-wrapper:arm64-windows=fail -scylla-wrapper:arm-uwp=fail -scylla-wrapper:x64-linux=fail -scylla-wrapper:x64-osx=fail -scylla-wrapper:x64-uwp=fail -scylla-wrapper:x64-windows-static=fail -sdformat6:arm64-windows=fail -sdformat6:arm-uwp=fail -sdformat6:x64-uwp=fail -sdformat6:x64-linux=ignore -sdl1:arm-uwp=fail -sdl1:x64-uwp=fail -sdl1:x64-osx=fail -sdl2-gfx:x64-linux=fail -sdl2-gfx:x64-osx=fail -sdl2-image:arm-uwp=fail -sdl2-image:x64-uwp=fail -sdl2-mixer:arm-uwp=fail -sdl2-mixer:x64-uwp=fail -sdl2-net:arm-uwp=fail -sdl2-net:x64-uwp=fail -seal:arm-uwp=fail -seal:x64-uwp=fail -secp256k1:x64-linux=fail -secp256k1:x64-osx=fail -selene:x64-linux=ignore -sentencepiece:arm64-windows=fail -sentencepiece:arm-uwp=fail -sentencepiece:x64-uwp=fail -sentencepiece:x64-windows=fail -sentencepiece:x86-windows=fail -septag-sx:arm64-windows=fail -septag-sx:arm-uwp=fail -septag-sx:x64-uwp=fail -sfgui:x64-linux=ignore -sfml:arm64-windows=fail -shapelib:arm-uwp=fail -shapelib:x64-uwp=fail -shiva:x64-windows-static=fail -shiva-sfml:x64-linux=fail -shiva-sfml:x64-osx=fail -shiva-sfml:x86-windows=fail -shiva-sfml:x64-windows=fail -shogun:arm64-windows = skip -shogun:arm-uwp = skip -shogun:x64-osx=fail -shogun:x64-uwp = skip -shogun:x64-windows = skip -shogun:x64-windows-static = skip -shogun:x86-windows = skip -signalrclient:x64-uwp=fail -signalrclient:arm-uwp=fail -simdjson:arm64-windows=fail -simdjson:arm-uwp=fail -simdjson:x86-windows=fail -skia:arm64-windows=fail -skia:arm-uwp=fail -skia:x64-linux=fail -skia:x64-uwp=fail -skia:x86-windows=fail -slikenet:arm-uwp=fail -slikenet:x64-uwp=fail -smpeg2:arm-uwp=fail -smpeg2:x64-linux=fail -smpeg2:x64-uwp=fail -soci:arm-uwp=fail -soci:x64-uwp=fail -soem:x64-uwp=fail -soem:arm-uwp=fail -soil:arm-uwp=fail -soil:x64-uwp=fail -soil2:arm-uwp=fail -soil2:x64-uwp=fail -sophus:x64-linux=fail -soundtouch:arm-uwp=fail -soundtouch:x64-linux=ignore -soundtouch:x64-uwp=fail -soundtouch:x64-windows-static=fail -spaceland:arm64-windows=fail -spaceland:arm-uwp=fail -spaceland:x64-uwp=fail -spaceland:x64-linux=ignore -spdk:x64-linux=fail -spdk-dpdk:arm64-windows=fail -spdk-dpdk:arm-uwp=fail -spdk-dpdk:x64-osx=fail -spdk-dpdk:x64-uwp=fail -spdk-dpdk:x64-windows=fail -spdk-dpdk:x64-windows-static=fail -spdk-dpdk:x86-windows=fail -spdk-ipsec:arm64-windows=fail -spdk-ipsec:arm-uwp=fail -spdk-ipsec:x64-osx=fail -spdk-ipsec:x64-uwp=fail -spdk-ipsec:x64-windows=fail -spdk-ipsec:x64-windows-static=fail -spdk-ipsec:x86-windows=fail -spdk-isal:arm64-windows=fail -spdk-isal:arm-uwp=fail -spdk-isal:x64-osx=fail -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 -spirv-tools:x64-uwp=fail -stormlib:arm-uwp=fail -stormlib:x64-uwp=fail -stxxl:arm-uwp=fail -stxxl:x64-uwp=fail -superlu:arm64-windows=fail -superlu:arm-uwp=fail -superlu:x64-uwp=fail -systemc:arm64-windows=fail -systemc:arm-uwp=fail -systemc:x64-uwp=fail -taglib:x64-linux=ignore -tbb:arm64-windows=fail -tbb:arm-uwp=fail -tbb:x64-uwp=fail -tcl:arm-uwp=ignore -tcl:arm64-windows=ignore -tcl:x64-uwp=ignore -tcl:x64-linux=ignore -tcl:x64-osx=ignore -teemo:x64-uwp=fail -teemo:arm-uwp=fail -teemo:arm64-windows=fail -teemo:x64-osx=fail -telnetpp:arm-uwp=fail -telnetpp:x64-uwp=fail -tensorflow-cc:arm64-windows=fail -tensorflow-cc:x64-linux=skip -tensorflow-cc:x64-osx=skip -tensorflow-cc:x64-windows=fail -tensorflow-cc:x64-windows-static=fail -tensorflow-cc:x86-windows=fail -tesseract:x64-windows=ignore -tesseract:x64-windows-static=ignore -tesseract:x86-windows=ignore -tfhe:x86-windows=fail -tfhe:x64-windows=fail -tfhe:x64-windows-static=fail -tfhe:x64-uwp=fail -tfhe:arm64-windows=fail -tfhe:arm-uwp=fail -theia:arm64-windows = skip -theia:arm-uwp = skip -theia:x64-uwp = skip -theia:x64-windows = skip -theia:x64-windows-static = skip -theia:x86-windows = skip -thor:x64-linux=fail -thor:x64-osx=fail -thrift:x64-osx=fail -tidy-html5:arm-uwp=fail -tidy-html5:x64-uwp=fail -tinkerforge:arm-uwp=fail -tinkerforge:x64-uwp=fail -tinyexif:arm-uwp=fail -tinyexif:x64-uwp=fail -tinyfiledialogs:arm-uwp=fail -tinyfiledialogs:x64-uwp=fail -tinynpy:x64-linux=ignore -tiny-process-library:arm-uwp=fail -tiny-process-library:x64-uwp=fail -tinyutf8:arm64-windows=fail -tinyutf8:arm-uwp=fail -tinyutf8:x64-uwp=fail - -#Flaky on windows only due to error PRI210: 0x80070020 - File move failed -tmx:arm64-windows = skip -tmx:arm-uwp = skip -tmx:x64-uwp = skip -tmx:x64-windows = skip -tmx:x64-windows-static = skip -tmx:x86-windows = skip -tmxlite:arm-uwp=fail -tmxlite:x64-uwp=fail -tmxparser:arm64-windows=fail -tmxparser:arm-uwp=fail -tmxparser:x64-uwp=fail -tmxparser:x64-windows=fail -tmxparser:x64-windows-static=fail -tmxparser:x86-windows=fail -torch-th:arm64-windows=fail -torch-th:arm-uwp=fail -torch-th:x64-uwp=fail -torch-th:x64-windows-static=fail -tre:x64-osx=fail -treehopper:x64-windows-static=fail -turbobase64:arm64-windows=fail -turbobase64:arm-uwp=fail -turbobase64:x64-uwp=fail -turbobase64:x64-windows=fail -turbobase64:x64-windows-static=fail -turbobase64:x86-windows=fail -unicorn:arm64-windows=fail -unicorn:arm-uwp=fail -unicorn:x64-linux=fail -unicorn:x64-osx=fail -unicorn:x64-uwp=fail -unicorn-lib:x64-uwp=fail -unittest-cpp:arm64-windows=fail -unittest-cpp:arm-uwp=fail -unittest-cpp:x64-uwp=fail -unixodbc:arm64-windows=fail -unixodbc:arm-uwp=fail -unixodbc:x64-uwp=fail -unixodbc:x64-windows=fail -unixodbc:x64-windows-static=fail -unixodbc:x86-windows=fail -unrar:arm64-windows=fail -unrar:arm-uwp=fail -unrar:x64-linux=fail -unrar:x64-osx=fail -unrar:x64-uwp=fail -unrar:x64-windows-static=fail -urdfdom:x64-windows-static=fail -usd:x64-linux=ignore -usd:x86-windows=fail -usrsctp:arm-uwp=fail -usrsctp:x64-uwp=fail -uvatlas:arm64-windows=fail -uvatlas:arm-uwp=fail -uvatlas:x64-linux=fail -uvatlas:x64-osx=fail -uvatlas:x64-windows-static=fail -vectorclass:arm64-windows=fail -vectorclass:arm-uwp=fail -vlpp:x64-osx=fail -vulkan:arm64-windows=fail -vulkan:arm-uwp=fail -vulkan:x64-linux=fail -vulkan:x64-osx=fail -vulkan:x64-uwp=fail -vulkan:x64-windows=fail -vulkan:x64-windows-static=fail -vulkan:x86-windows=fail -# Conflicts with latest openjpeg port (vxl ships with an old version of openjpeg) -# conflicts with qt5-location -vxl:arm64-windows = skip -vxl:arm-uwp = skip -vxl:x64-linux = skip -vxl:x64-osx = skip -vxl:x64-uwp = skip -vxl:x64-windows = skip -vxl:x64-windows-static = skip -vxl:x86-windows = skip -wampcc:x64-linux=ignore -wangle:x64-linux=ignore -wavpack:arm64-windows=fail -wavpack:x64-linux=fail -wavpack:x64-osx=fail -wepoll:arm-uwp=ignore -wepoll:x64-uwp=ignore -wepoll:x64-linux=ignore -wepoll:x64-osx=ignore -wildmidi:x64-osx=fail -wincrypt:x64-linux=fail -wincrypt:x64-osx=fail -winpcap:arm64-windows = skip -winpcap:arm-uwp = skip -winpcap:x64-linux=fail -winpcap:x64-osx=fail -winpcap:x64-uwp = skip -winpcap:x64-windows = skip -winpcap:x64-windows-static = skip -winpcap:x86-windows = skip -winsock2:x64-linux=fail -winsock2:x64-osx=fail -wintoast:arm-uwp=fail -wintoast:x64-linux=fail -wintoast:x64-osx=fail -wintoast:x64-uwp=fail -woff2:x64-linux=fail -woff2:x64-osx=fail -woff2:x64-windows-static=fail -wpilib:x64-osx=fail -wxchartdir:x64-osx=fail -wxwidgets:x64-linux=fail -x264:arm64-windows=fail -x264:arm-uwp=fail -x264:x64-uwp=ignore -x264:x64-linux=fail -x264:x64-osx=fail -x264:x86-windows=ignore -x264:x64-windows=ignore -x264:x64-windows-static=ignore -x265:arm64-windows=fail -x265:arm-uwp=fail -x265:x64-uwp=fail -xalan-c:x64-windows-static=fail -xerces-c:arm64-windows=fail -xerces-c:arm-uwp=fail -xerces-c:x64-uwp=fail -xeus:x64-linux=ignore -xmlsec:arm-uwp=fail -xmlsec:x64-uwp=fail -xmsh:arm64-windows=fail -xmsh:arm-uwp=fail -xmsh:x64-uwp=fail -xmsh:x64-windows=fail -xmsh:x64-windows-static=fail -xmsh:x86-windows=fail -xmsh:x64-linux=ignore -xtensor-io:x64-uwp=ignore -x-plane:arm64-windows=fail -x-plane:arm-uwp=fail -x-plane:x64-linux=fail -x-plane:x86-windows=fail -yajl:arm-uwp=fail -yajl:x64-uwp=fail -yara:arm64-windows=fail -yara:arm-uwp=fail -yara:x64-uwp=fail -yasm:arm64-windows=fail -yasm:arm-uwp=fail -yasm:x64-linux=fail -yasm:x64-osx=fail -yasm:x64-uwp=fail -yato:arm64-windows=fail -yato:arm-uwp=fail -yato:x64-uwp=fail -z3:arm64-windows=fail -z3:arm-uwp=fail -z3:x64-uwp=fail -zeromq:arm64-windows=fail -zeromq:arm-uwp=fail -zeromq:x64-uwp=fail -zkpp:x86-windows=fail -zkpp:x64-windows=fail -zkpp:x64-windows-static=fail -zkpp:arm64-windows=fail -zkpp:x64-uwp=fail -zkpp:arm-uwp=fail +########################################################################### +## This file defines the current expected build state of ports in CI. +## +## States +## pass - (default) the port builds in the CI system. If a port is +## missing from this file then it is assumed to build. +## fail - the port does not build in the CI system. +## This is not necessarily the same as if a port is expected to build +## on a developers machine because it may fail due to the machine +## configuration. When set to fail the CI system will still attempt +## to build the port and will report a CI failure until this file is updated. +## skip - Do not build this port in the CI system. +## This is added to ports that may be flaky or conflict with other +## ports. Please comment for why a port is skipped so it can be +## removed when the issue is resolved. +## +## +## CI tested triplets: +## arm64-windows +## arm-uwp +## x64-linux +## x64-osx +## x64-uwp +## x64-windows +## x64-windows-static +## x86-windows +## + + +# Add new items alphabetically + +3fd:arm64-windows=fail +3fd:arm-uwp=fail +3fd:x64-linux=fail +3fd:x64-osx=fail +3fd:x64-windows=fail +3fd:x64-windows-static=fail +3fd:x86-windows=fail +7zip:arm64-windows=fail +7zip:arm-uwp=fail +7zip:x64-linux=fail +7zip:x64-osx=fail +7zip:x64-uwp=fail +activemq-cpp:x64-linux=fail +activemq-cpp:x64-osx=fail +akali:x64-uwp=fail +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 +ampl-mp:arm-uwp=fail +ampl-mp:x64-uwp=fail +amqpcpp:arm-uwp=fail +amqpcpp:x64-uwp=fail +angelscript:arm64-windows=fail +angelscript:arm-uwp=fail +antlr4:arm-uwp=fail +antlr4:x64-uwp=fail +apr:arm-uwp=fail +apr:x64-uwp=fail +# Cross compiling CI machine cannot run gen_test_char to generate apr_escape_test_char.h +apr:arm64-windows=fail +argtable2:arm-uwp=fail +argtable2:x64-uwp=fail +arrow:arm64-windows=fail +arrow:x86-windows=fail +asiosdk:x64-linux=fail +asiosdk:x64-osx=fail +asiosdk:x64-uwp=fail +asiosdk:arm64-windows=fail +asiosdk: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 +aws-checksums:arm64-windows=fail +aws-lambda-cpp:arm64-windows=fail +aws-lambda-cpp:arm-uwp=fail +aws-lambda-cpp:x64-uwp=fail +aws-lambda-cpp:x64-windows=fail +aws-lambda-cpp:x64-windows-static=fail +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 +bde:x64-windows=fail +bde:x64-windows-static=fail +bde:x86-windows=fail +benchmark:arm64-windows=fail +benchmark:arm-uwp=fail +benchmark:x64-uwp=fail +berkeleydb:arm-uwp=fail +berkeleydb:x64-linux=fail +berkeleydb:x64-osx=fail +berkeleydb:x64-uwp=fail +bitserializer-rapidyaml:arm-uwp=skip +bitserializer-rapidyaml:arm64-windows=skip +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 +blitz:x64-uwp=fail +blitz:arm64-windows=fail +blitz:arm-uwp=fail +blosc:arm64-windows=fail +blosc:arm-uwp=fail +blosc:x64-uwp=fail +bond:arm-uwp=fail +bond:x64-osx=fail +bond: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 +bullet3:x64-uwp=fail +caf:arm-uwp=fail +caf:arm64-windows=fail +caf:x64-uwp=fail +caffe2:x86-windows=fail +caffe2:arm64-windows=fail +cairomm:x64-linux=fail +capnproto:arm64-windows=fail +capnproto:arm-uwp=fail +capnproto:x64-uwp=fail +c-ares:arm-uwp=fail +c-ares:x64-uwp=fail +cartographer:x64-osx=fail +casclib:arm-uwp=fail +casclib:x64-uwp=fail +catch-classic:arm64-windows = skip +catch-classic:arm-uwp = skip +catch-classic:x64-linux = skip +catch-classic:x64-osx = skip +catch-classic:x64-uwp = skip +catch-classic:x64-windows = skip +catch-classic:x64-windows-static = skip +catch-classic:x86-windows = skip +ccd:arm-uwp=fail +ccd:x64-uwp=fail +cello:arm-uwp=fail +cello:x64-uwp=fail +cfitsio:arm-uwp=fail +cfitsio:x64-uwp=fail +cgicc:arm-uwp=fail +cgicc:x64-uwp=fail +chakracore:arm64-windows=fail +chakracore:arm-uwp=fail +chakracore:x64-linux=fail +chakracore:x64-osx=fail +chakracore:x64-uwp=fail +chakracore:x64-windows-static=fail +# DCMTK currently has a vendored copy of libcharls.a, which causes conflicts with charls (TODO: use charls' copy) +charls:arm64-windows=skip +charls:arm-uwp=skip +charls:x64-linux=skip +charls:x64-osx=skip +charls:x64-uwp=skip +charls:x64-windows=skip +charls:x64-windows-static=skip +charls:x86-windows=skip +chartdir:arm64-windows=fail +chartdir:arm-uwp=fail +chartdir:x64-uwp=fail +chartdir:x64-windows-static=fail +chipmunk:arm64-windows=fail +chipmunk:arm-uwp=fail +chipmunk:x64-linux=fail +chipmunk:x64-osx=fail +chipmunk:x64-uwp=fail +chmlib:arm-uwp=fail +chmlib:x64-uwp=fail +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 +clockutils:x64-linux=fail +clockutils:x64-osx=fail +cmark:x64-windows-static=fail +cmcstl2:arm64-windows = skip +cmcstl2:arm-uwp = skip +cmcstl2:x64-linux = skip +cmcstl2:x64-osx = skip +cmcstl2:x64-uwp = skip +cmcstl2:x64-windows = skip +cmcstl2:x64-windows-static = skip +cmcstl2:x86-windows = skip +coin:arm64-windows=fail +coin:arm-uwp=fail +coin:x64-uwp=fail +collada-dom:x64-windows-static=fail +coolprop:arm-uwp=fail +coolprop:x64-linux=fail +coolprop:x64-osx=fail +coolprop:x64-uwp=fail +coroutine:arm-uwp=fail +coroutine:x64-linux=fail +coroutine:x64-uwp=fail +corrade:arm-uwp=fail +corrade:x64-uwp=fail +cppcms:x64-linux=fail +cppcms:x64-osx=fail +cppcms:x64-windows-static=fail +cppfs:arm-uwp=fail +cppfs:x64-uwp=fail +cppmicroservices:arm64-windows=fail +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 +cppunit:arm64-windows=fail +cppunit:arm-uwp=fail +cppunit:x64-linux=fail +cppunit:x64-osx=fail +cppunit:x64-uwp=fail +cpuinfo:arm64-windows=fail +crashpad:arm64-windows=fail +crashpad:arm-uwp=fail +crashpad:x64-linux=fail +crashpad:x64-uwp=fail +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 +ctemplate:x64-osx=fail +cuda:x64-osx=fail +cudnn:arm64-windows=fail +cudnn:arm-uwp=fail +cudnn:x64-uwp=fail +cudnn:x64-windows-static=fail +cudnn:x86-windows=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 +dbow2:x64-osx=fail +dcmtk:arm-uwp=fail +dcmtk:arm64-windows=fail +dcmtk:x64-uwp=fail +detours:x64-linux=fail +detours:x64-osx=fail +devicenameresolver:arm-uwp=fail +devicenameresolver:x64-linux=fail +devicenameresolver:x64-osx=fail +devicenameresolver:x64-uwp=fail +devicenameresolver:x64-windows-static=fail +dimcli:arm-uwp=fail +dimcli:x64-osx=fail +dimcli:x64-uwp=fail +directxmesh:x64-linux=fail +directxmesh:x64-osx=fail +directxmesh:x64-windows-static=fail +directxtex:x64-linux=fail +directxtex:x64-osx=fail +directxtex:x64-windows-static=fail +directxtk:x64-linux=fail +directxtk:x64-osx=fail +directxtk:x64-windows-static=fail +directxtk12:x64-linux=fail +directxtk12:x64-osx=fail +directxtk12:x64-windows-static=fail +discord-game-sdk:x64-windows-static=fail +discord-rpc:arm-uwp=fail +discord-rpc:x64-uwp=fail +dlfcn-win32:arm-uwp=fail +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 +dpdk:x64-linux=fail +dpdk:x64-osx=fail +dpdk:x64-uwp=fail +dpdk:x64-windows-static=fail +dpdk:x64-windows=fail +dpdk:x86-windows=fail +duckx:arm64-windows = skip +duckx:arm-uwp = skip +duckx:x64-linux = skip +duckx:x64-osx = skip +duckx:x64-uwp = skip +duckx:x64-windows = skip +duckx:x64-windows-static = skip +duckx:x86-windows = skip +duilib:arm-uwp=fail +duilib:x64-linux=fail +duilib:x64-osx=fail +duilib:x64-uwp=fail + +# requires python@2 from brew, but that no longer exists +# python2 EOL yay! +duktape:x64-osx=skip + +dxut:arm64-windows=fail +dxut:arm-uwp=fail +dxut:x64-linux=fail +dxut:x64-osx=fail +dxut:x64-windows-static=fail +eastl:arm-uwp=fail +easyhook:arm64-windows=fail +easyhook:arm-uwp=fail +easyhook:x64-linux=fail +easyhook:x64-osx=fail +easyhook:x64-uwp=fail +easyhook:x64-windows-static=fail +easyloggingpp:arm-uwp=fail +easyloggingpp:x64-uwp=fail +eathread:arm64-windows=fail +eathread:arm-uwp=fail +eathread:x64-uwp=fail +eathread:x86-windows=fail +ebml:arm-uwp=fail +ebml:x64-uwp=fail +ecm:arm64-windows = skip +ecm:arm-uwp = skip +ecm:x64-linux = skip +ecm:x64-osx = skip +ecm:x64-uwp = skip +ecm:x64-windows = skip +ecm:x64-windows-static = skip +ecm:x86-windows = skip +ecsutil:arm64-windows=fail +ecsutil:arm-uwp=fail +ecsutil:x64-linux=fail +ecsutil:x64-osx=fail +ecsutil:x64-uwp=fail +embree2:x64-linux=fail +embree2:x64-osx=fail +embree2:x64-windows-static=fail +enet:arm-uwp=fail +enet:x64-uwp=fail +epsilon:x64-windows-static=fail +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 +fann:x64-linux=fail +fann:x64-osx=fail +fann:x64-uwp=fail +fann:x64-windows-static=fail +farmhash:arm64-windows=fail +farmhash:arm-uwp=fail +farmhash:x64-uwp=fail +farmhash:x64-windows=fail +farmhash:x64-windows-static=fail +farmhash:x86-windows=fail +fastcdr:x64-linux=fail +fastrtps:arm-uwp=fail +fastrtps:x64-linux=fail +fastrtps:x64-osx=fail +fastrtps:x64-uwp=fail +fastrtps:x64-windows-static=fail +fdk-aac:arm64-windows=fail +fdk-aac:arm-uwp=fail +fdk-aac:x64-uwp=fail +fdlibm:arm-uwp=fail +fdlibm:x64-uwp=fail +fftw3:arm-uwp=fail +fftw3:x64-uwp=fail +flint:x64-linux=fail +flint:x64-osx=fail +fltk:arm-uwp=fail +fltk:x64-uwp=fail +fluidsynth:x64-linux=fail +fluidsynth:x64-osx=fail +fmem:arm-uwp=fail +fmem:x64-uwp=fail +fmi4cpp:arm-uwp=fail +fmi4cpp:x64-uwp=fail +fmilib:arm64-windows=fail +fmilib:arm-uwp=fail +fmilib:x64-linux=fail +fmilib:x64-uwp=fail +foonathan-memory:arm64-windows=fail +foonathan-memory:arm-uwp=fail +foonathan-memory:x64-uwp=fail +forge:x86-windows=fail +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 +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 +fuzzylite:x64-linux=fail +fuzzylite:x64-osx=fail +fuzzylite:x64-uwp=fail +g3log:arm64-windows=fail +g3log:arm-uwp=fail +g3log:x64-uwp=fail +gainput:arm-uwp=fail +gainput:x64-linux=fail +gainput:x64-uwp=fail +gamma:x64-linux=fail +gamma:x64-osx=fail +gasol:arm64-windows=fail +gasol:arm-uwp=fail +gasol:x64-uwp=fail +gdcm:arm64-windows=fail +gdcm:x64-linux = skip +geos:arm-uwp=fail +geos:x64-uwp=fail +getopt:arm-uwp=fail +getopt:x64-uwp=fail +getopt-win32:arm64-windows=fail +getopt-win32:arm-uwp=fail +getopt-win32:x64-linux=fail +getopt-win32:x64-osx=fail +getopt-win32:x64-uwp=fail +getopt-win32:x64-windows-static=fail +gflags:arm-uwp=fail +gflags:x64-uwp=fail + +# Conflicts with libevent +gherkin-c:arm64-windows = skip +gherkin-c:arm-uwp = skip +gherkin-c:x64-linux=fail +gherkin-c:x64-osx=fail +gherkin-c:x64-uwp = skip +gherkin-c:x64-windows = skip +gherkin-c:x64-windows-static = skip +gherkin-c:x86-windows = skip +gl3w:arm64-windows=fail +gl3w:arm-uwp=fail +glew:arm64-windows=fail +glew:arm-uwp=fail +glfw3:arm-uwp=fail +glfw3:x64-uwp=fail +glib:x64-uwp=fail +glib:x64-windows-static=fail +glib:x64-osx=fail +gmmlib:arm64-windows=fail +gmmlib:arm-uwp=fail +gmmlib:x64-osx=fail +gmmlib:x64-uwp=fail +gmmlib:x64-windows=fail +gmmlib:x64-windows-static=fail +gmmlib:x86-windows=fail +google-cloud-cpp:arm64-windows=fail +google-cloud-cpp:arm-uwp=fail +google-cloud-cpp:x64-uwp=fail +gppanel:x64-osx=fail +gperf:x64-uwp=fail +gperf:arm-uwp=fail +gperftools:arm64-windows=fail +gperftools:x64-uwp=fail +gperftools:arm-uwp=fail +graphicsmagick:arm-uwp=fail +graphicsmagick:x64-uwp=fail +graphite2:arm-uwp=fail +graphite2:x64-uwp=fail +graphqlparser:arm-uwp=fail +graphqlparser:x64-uwp=fail +gsl:arm-uwp=fail +gsl:x64-uwp=fail +# https://github.com/microsoft/vcpkg/pull/11048 +gtk:x64-linux=fail +guetzli:x64-osx=fail +h3:arm64-windows=fail +h3:arm-uwp=fail +h3:x64-uwp=fail +halide:x64-windows-static=fail +hdf5:arm64-windows=fail +hdf5:arm-uwp=fail +hdf5:x64-uwp=fail +healpix:x86-windows=fail +healpix:x64-windows=fail +healpix:x64-windows-static=fail +healpix:x64-uwp=fail +healpix:arm64-windows=fail +healpix:arm-uwp=fail +healpix:x64-osx=fail +hidapi:arm64-windows=fail +hidapi:arm-uwp=fail +hidapi:x64-linux=fail +hidapi:x64-osx=fail +hidapi:x64-uwp=fail +hiredis:arm-uwp=fail +hiredis:x64-uwp=fail +hpx:x64-windows-static=fail +hpx:x64-linux=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 +idevicerestore:x64-linux=fail +idevicerestore:x64-osx=fail +ignition-common1:x64-linux=fail +ignition-msgs1:arm64-windows=fail +ignition-msgs1:arm-uwp=fail +ignition-msgs1:x64-uwp=fail +ignition-msgs5:x64-linux=fail +ignition-msgs5:arm64-windows=fail +ignition-msgs5:arm-uwp=fail +ignition-msgs5:x64-uwp=fail +ignition-msgs5:x64-osx=skip +intel-ipsec:arm64-windows=fail +intel-ipsec:arm-uwp=fail +intel-ipsec:x64-osx=fail +intel-ipsec:x64-uwp=fail +intel-ipsec:x64-windows=fail +intel-ipsec:x64-windows-static=fail +intel-ipsec:x86-windows=fail +intel-mkl:arm64-windows=fail +intel-mkl:arm-uwp=fail +intel-mkl:x64-linux=fail +intel-mkl:x64-osx=fail +intel-mkl:x64-uwp=fail +intel-mkl:x64-windows=fail +intel-mkl:x64-windows-static=fail +intel-mkl:x86-windows=fail +intelrdfpmathlib:arm-uwp=fail +intelrdfpmathlib:x64-linux=fail +intelrdfpmathlib:x64-uwp=fail +irrlicht:arm64-windows=fail +irrlicht:arm-uwp=fail +irrlicht:x64-osx=fail +irrlicht:x64-uwp=fail +isal:arm64-windows=fail +isal:arm-uwp=fail +isal:x64-osx=fail +isal:x64-uwp=fail +isal:x64-windows=fail +isal:x64-windows-static=fail +isal:x86-windows=fail +jack2:arm-uwp=fail +jack2:x64-uwp=fail +jaeger-client-cpp:arm64-windows=fail +jbig2dec:arm-uwp=fail +jbig2dec:x64-uwp=fail +jemalloc:arm64-windows=fail +jemalloc:arm-uwp=fail +jemalloc:x64-linux=fail +jemalloc:x64-osx=fail +jemalloc:x64-uwp=fail +jemalloc:x64-windows-static=fail +jinja2cpplight:arm-uwp=fail +jinja2cpplight:x64-uwp=fail +keystone:arm-uwp=fail +keystone:x64-uwp=fail +kfr:arm64-windows=fail +kfr:arm-uwp=fail +kfr:x64-linux=fail +kinectsdk1:arm64-windows=fail +kinectsdk1:arm-uwp=fail +kinectsdk1:x64-linux=fail +kinectsdk1:x64-osx=fail +kinectsdk2:arm64-windows=fail +kinectsdk2:arm-uwp=fail +kinectsdk2:x64-linux=fail +kinectsdk2:x64-osx=fail +lastools:arm-uwp=fail +lastools:x64-uwp=fail +laszip:arm-uwp=fail +laszip:x64-uwp=fail +lcm:x64-linux=fail +lcm:x64-osx=fail +leptonica:x64-uwp=fail +leptonica:arm-uwp=fail +leveldb:arm-uwp=fail +leveldb:x64-uwp=fail +libaiff:x64-linux=fail +libarchive:arm-uwp=fail +libbf:arm64-windows=fail +libbf:arm-uwp=fail +libbf:x64-uwp=fail +libbf:x64-windows=fail +libbf:x64-windows-static=fail +libbf:x86-windows=fail +libbson:arm-uwp=fail +libbson:x64-uwp=fail +libcds:arm64-windows=fail +libcds:arm-uwp=fail +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 +cpuid:x64-uwp=fail +cpuid:arm64-windows=fail +libdatrie:x64-linux=fail +libdatrie:x64-osx=fail +libdisasm:arm-uwp=fail +libdisasm:x64-uwp=fail +libdshowcapture:arm-uwp=fail +libdshowcapture:x64-linux=fail +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 +libevent:x64-uwp=fail +libevhtp:x86-windows=fail +libevhtp:x64-windows=fail +libevhtp:x64-windows-static=fail +libevhtp:x64-uwp=fail +libevhtp:arm64-windows=fail +libevhtp:arm-uwp=fail +libexif:arm-uwp=fail +libexif:x64-uwp=fail +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 +libgo:x64-uwp=fail +libgo:arm64-windows=fail +libgo:x64-windows=fail +libgo:x86-windows=fail +libgpod:arm64-windows=fail +libgpod:arm-uwp=fail +libgpod:x64-uwp=fail +libgpod:x64-windows=fail +libgpod:x64-windows-static=fail +libgpod:x86-windows=fail +libhdfs3:arm64-windows=fail +libhdfs3:arm-uwp=fail +libhdfs3:x64-uwp=fail +libhdfs3:x64-windows=fail +libhdfs3:x64-windows-static=fail +libhdfs3:x86-windows=fail +libhdfs3:x64-linux=fail +libhydrogen:arm64-windows=fail +libics:arm-uwp=fail +libics:x64-uwp=fail +libidn2:x64-linux=fail +libidn2:x64-osx=fail +libigl:arm64-windows=fail +libigl:arm-uwp=fail +libigl:x64-uwp=fail +liblemon:arm-uwp=fail +liblemon:x64-uwp=fail +liblinear:arm-uwp=fail +liblinear:x64-uwp=fail +liblo:arm-uwp=fail +liblo:x64-linux=fail +liblo:x64-osx=fail +liblo:x64-uwp=fail +liblsl:arm64-windows=fail +liblsl:arm-uwp=fail +liblsl:x64-linux=fail +liblsl:x64-osx=fail +liblsl:x64-uwp=fail +libmad:arm-uwp=fail +libmad:x64-uwp=fail +libmagic:x86-windows=fail +libmagic:x64-windows=fail +libmagic:x64-windows-static=fail +libmagic:x64-uwp=fail +libmagic:arm64-windows=fail +libmagic:arm-uwp=fail +libmariadb:arm64-windows = skip +libmariadb:arm-uwp = skip +libmariadb:x64-linux = skip +libmariadb:x64-osx = skip +libmariadb:x64-uwp = skip +libmariadb:x64-windows = skip +libmariadb:x64-windows-static = skip +libmariadb:x86-windows = skip +# libmesh installs tons of problematic files that conflict with other ports (boost, eigen, etc) +libmesh:arm64-windows=skip +libmesh:arm-uwp=skip +libmesh:x64-uwp=skip +libmesh:x64-windows=skip +libmesh:x64-windows-static=skip +libmesh:x86-windows=skip +libmesh:x64-osx=skip +libmesh:x64-linux=skip +libmodman:arm-uwp=fail +libmodman:x64-uwp=fail +libmodman:x64-windows-static=fail +libmodplug:arm-uwp=fail +libmodplug:x64-uwp=fail +libmpeg2:arm-uwp=fail +libmpeg2:x64-linux=fail +libmpeg2:x64-osx=fail +libmpeg2:x64-uwp=fail +libmupdf:x64-osx=fail +libmysql:x86-windows=fail +libnice:x64-linux=fail +libnice:x64-osx=fail +libopenmpt:x64-linux=fail +libopenmpt:x64-osx=fail +libopusenc:arm-uwp=fail +libopusenc:x64-linux=fail +libopusenc:x64-osx=fail +libopusenc:x64-uwp=fail +libosip2:arm64-windows=fail +libosip2:arm-uwp=fail +libosip2:x64-uwp=fail +libosip2:x64-windows=fail +libosip2:x64-windows-static=fail +libosip2:x86-windows=fail +libp7-baical:arm64-windows = skip +libp7-baical:arm-uwp = skip +libp7-baical:x64-linux = skip +libp7-baical:x64-osx = skip +libp7-baical:x64-uwp = skip +libp7-baical:x64-windows = skip +libp7-baical:x64-windows-static = skip +libp7-baical:x86-windows = skip +libp7client:arm64-windows=fail +libp7client:arm-uwp=fail +libp7client:x64-linux=fail +libp7client:x64-osx=fail +libp7client:x64-uwp=fail +libpcap:arm64-windows=fail +libpcap:arm-uwp=fail +libpcap:x64-osx=fail +libpcap:x64-uwp=fail +libpcap:x64-windows-static=fail +libpff:arm-uwp=fail +libpff:x64-linux=fail +libpff:x64-osx=fail +libpff:x64-uwp=fail +libpff:x64-windows-static=fail +libplist:x64-windows-static=fail +libpng-apng:arm64-windows = skip +libpng-apng:arm-uwp = skip +libpng-apng:x64-linux = skip +libpng-apng:x64-osx = skip +libpng-apng:x64-uwp = skip +libpng-apng:x64-windows = skip +libpng-apng:x64-windows-static = skip +libpng-apng:x86-windows = skip +libpq:arm-uwp=fail +libpq:x64-uwp=fail +libqcow:arm-uwp=fail +libqcow:x64-uwp=fail +libqcow:x64-windows-static=fail +libraqm:x64-windows-static=fail +librdkafka:arm-uwp=fail +librdkafka:x64-uwp=fail + +# Conflicts with openssl +boringssl:arm64-windows = skip +boringssl:arm-uwp = skip +boringssl:x64-linux = skip +boringssl:x64-osx = skip +boringssl:x64-uwp = skip +boringssl:x64-windows = skip +boringssl:x64-windows-static = skip +boringssl:x86-windows = skip +libressl:arm64-windows = skip +libressl:arm-uwp = skip +libressl:x64-linux = skip +libressl:x64-osx = skip +libressl:x64-uwp = skip +libressl:x64-windows = skip +libressl:x64-windows-static = skip +libressl:x86-windows = skip +librsync:arm-uwp=fail +librsync:x64-uwp=fail +libsamplerate:arm64-windows=fail +libsamplerate:arm-uwp=fail +libsamplerate:x64-osx=fail +libsoundio:arm64-windows=fail +libsoundio:arm-uwp=fail +libsoundio:x64-uwp=fail +libsrt:arm-uwp=fail +libsrt:x64-uwp=fail +libssh:arm64-windows=fail +libssh:arm-uwp=fail +libssh:x64-uwp=fail +libstk:arm-uwp=fail +libstk:x64-uwp=fail +libtins:arm-uwp=fail +libtins:x64-uwp=fail +libtomcrypt:arm64-windows=fail +libtomcrypt:arm-uwp=fail +libudis86:arm-uwp=fail +libudis86:x64-linux=fail +libudis86:x64-osx=fail +libudis86:x64-uwp=fail +libudns:arm64-windows=fail +libudns:arm-uwp=fail +libudns:x64-uwp=fail +libudns:x64-windows=fail +libudns:x64-windows-static=fail +libudns:x86-windows=fail +libudns:x64-osx=fail +libui:arm-uwp=fail +libui:x64-linux=fail +libui:x64-uwp=fail +libusb:arm-uwp=fail +libusb:x64-uwp=fail +libusbmuxd:arm-uwp=fail +libusbmuxd:x64-uwp=fail +libusbmuxd:x64-linux=fail +libusbmuxd:x64-osx=fail +libusb-win32:arm-uwp=fail +libusb-win32:x64-linux=fail +libusb-win32:x64-osx=fail +libusb-win32:x64-uwp=fail +libuuid:arm64-windows=fail +libuuid:arm-uwp=fail + +# Causes build failures in vxl and podofo on osx +# Conflicts with Darwin kernel sdk uuid.h (has missing definitions) +libuuid:x64-osx = skip +libuuid:x64-uwp=fail +libuuid:x64-windows=fail +libuuid:x64-windows-static=fail +libuuid:x86-windows=fail +libuv:arm-uwp=fail +libuv:x64-uwp=fail +libvmdk:arm-uwp=fail +libvmdk:x64-uwp=fail +libwandio:x86-windows=fail +libwandio:x64-windows=fail +libwandio:x64-windows-static=fail +libwandio:x64-uwp=fail +libwandio:arm64-windows=fail +libwandio:arm-uwp=fail +libwebsockets:arm-uwp=fail +libwebsockets:x64-uwp=fail +libxmp-lite:x64-linux=fail +libxmp-lite:x64-osx=fail +libxslt:arm-uwp=fail +libxslt:x64-osx=fail +libxslt:x64-uwp=fail +libyuv:arm-uwp=fail +libyuv:x64-uwp=fail +licensepp:arm-uwp=fail +licensepp:x64-uwp=fail +linenoise-ng:arm-uwp=fail +linenoise-ng:x64-uwp=fail +live555:arm64-windows=fail +live555:arm-uwp=fail +live555:x64-linux=fail +live555:x64-osx=fail +live555:x64-uwp=fail +live555:x64-windows=fail +live555:x64-windows-static=fail +live555:x86-windows=fail +llgl:arm-uwp=fail +llgl:x64-uwp=fail +llvm:arm-uwp=fail +llvm:arm64-windows=fail +llvm:x64-uwp=fail +lmdb:arm-uwp=fail +lmdb:x64-uwp=fail +log4cplus:arm-uwp=fail +log4cplus:x64-uwp=fail +log4cxx:arm64-windows=fail +log4cxx:arm-uwp=fail +log4cxx:x64-linux=fail +log4cxx:x64-uwp=fail +log4cxx:x64-windows-static=fail +log4cxx:x64-osx=fail +lua:arm-uwp=fail +lua:x64-uwp=fail +luajit:arm64-windows = skip +luajit:arm-uwp = skip +luajit:x64-linux = skip +luajit:x64-osx = skip +luajit:x64-uwp = skip +luajit:x64-windows = skip +luajit:x64-windows-static = skip +luajit:x86-windows = skip +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 +mathgl:x64-uwp=fail +matio:x64-linux=fail +matio:x64-osx=fail +mbedtls:arm-uwp=fail +mbedtls:x64-uwp=fail +mdnsresponder:arm64-windows=fail +mdnsresponder:arm-uwp=fail +mdnsresponder:x64-linux=fail +mdnsresponder:x64-osx=fail +mdnsresponder:x64-uwp=fail +mecab:arm64-windows = skip +mecab:arm-uwp = skip +mecab:x64-linux = skip +mecab:x64-uwp = skip +mecab:x64-windows = skip +mecab:x64-windows-static = skip +mecab:x86-windows = skip +memorymodule:arm-uwp=fail +memorymodule:x64-linux=fail +memorymodule:x64-osx=fail +memorymodule:x64-uwp=fail +meschach:arm-uwp=fail +meschach:x64-linux=fail +meschach:x64-osx=fail +meschach:x64-uwp=fail +metis:arm-uwp=fail +metis:x64-uwp=fail +metrohash:arm-uwp=fail +metrohash:x64-uwp=fail +metrohash:x86-windows=fail +metrohash:arm64-windows=fail +mhook:arm64-windows=fail +mhook:arm-uwp=fail +mhook:x64-linux=fail +mhook:x64-osx=fail +mhook:x64-uwp=fail +milerius-sfml-imgui:x64-osx=fail +milerius-sfml-imgui:x64-windows-static=fail +mimalloc:arm64-windows=fail +mimalloc:arm-uwp=fail +mimalloc:x64-uwp=fail +minhook:arm64-windows=fail +minhook:arm-uwp=fail +minhook:x64-linux=fail +minhook:x64-osx=fail +minhook:x64-uwp=fail +minifb:arm-uwp=fail +minifb:x64-uwp=fail +minisat-master-keying:arm-uwp=fail +minisat-master-keying:x64-uwp=fail +miniupnpc:arm-uwp=fail +miniupnpc:x64-uwp=fail +minizip:arm-uwp=fail +minizip:x64-uwp=fail +# Conflicts with signalrclient +microsoft-signalr:arm64-windows=skip +microsoft-signalr:arm-uwp=skip +microsoft-signalr:x64-linux=skip +microsoft-signalr:x64-osx=skip +microsoft-signalr:x64-uwp=skip +microsoft-signalr:x64-windows=skip +microsoft-signalr:x64-windows-static=skip +microsoft-signalr:x86-windows=skip +mman:x64-linux=fail +mman:x64-osx=fail +mmloader:arm64-windows=fail +mmloader:arm-uwp=fail +mmloader:x64-linux=fail +mmloader:x64-osx=fail +mmloader:x64-uwp=fail +mmloader:x64-windows=fail +mmloader:x86-windows=fail +# mmx installs many problematic headers, such as `json.h` and `sched.h` +mmx:x64-windows=skip +mmx:x64-windows-static=skip +mmx:x86-windows=skip +mmx:x64-linux=skip +mmx:x64-osx=skip +mmx:arm-uwp=skip +mmx:x64-uwp=skip +mmx:arm64-windows=skip +# Flaky strange linker error +mongo-c-driver:x64-osx=skip +mongoose:arm-uwp=fail +mongoose:x64-uwp=fail +monkeys-audio:arm64-windows=fail +monkeys-audio:arm-uwp=fail +monkeys-audio:x64-linux=fail +monkeys-audio:x64-osx=fail +monkeys-audio:x64-uwp=fail +monkeys-audio:x64-windows-static=fail +moos-core:arm-uwp=fail +moos-core:x64-uwp=fail +moos-core:x64-windows=fail +moos-core:x64-windows-static=fail +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 +mozjpeg:x64-osx = skip +mozjpeg:x64-uwp = skip +mozjpeg:x64-windows = skip +mozjpeg:x64-windows-static = skip +mozjpeg:x86-windows = skip +# mpir conflicts with gmp +# see https://github.com/microsoft/vcpkg/issues/11756 +mpir:x86-windows=skip +mpir:x64-windows=skip +mpir:x64-windows-static=skip +mpir:arm64-windows=skip +mpir:x64-osx=skip +mpir:x64-linux=skip +msix:x64-linux=fail +msix:x64-osx=fail +msix:x64-windows-static=fail +msmpi:arm64-windows=fail +msmpi:arm-uwp=fail +msmpi:x64-linux=fail +msmpi:x64-osx=fail +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 +murmurhash:x64-uwp=fail +murmurhash:arm64-windows=fail +nana:arm-uwp=fail +nana:x64-linux=fail +nana:x64-osx=fail +nana:x64-uwp=fail +nanodbc:arm-uwp=fail +nanodbc:x64-osx=fail +nanodbc:x64-uwp=fail +nanodbc:x64-linux=skip +nanogui:arm64-windows=fail +nanorange:arm64-windows=fail +nanorange:arm-uwp=fail +nanorange:x64-linux=fail +nanorange:x64-osx=fail +nanorange:x64-uwp=fail +nanorange:x64-windows=fail +nanorange:x64-windows-static=fail +nanorange:x86-windows=fail +nanovg:arm-uwp=fail +nanovg:x64-uwp=fail +nativefiledialog:arm-uwp=fail +nativefiledialog:x64-uwp=fail +nethost:x64-uwp=fail +nethost:arm-uwp=fail +nettle:x64-windows-static=skip +nettle:x64-windows=skip +nettle:x64-osx=fail +networkdirect-sdk:arm64-windows=fail +networkdirect-sdk:arm-uwp=fail +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 +nng:arm-uwp=fail +nng:x64-uwp=fail +nrf-ble-driver:arm-uwp=fail +nrf-ble-driver:x64-uwp=fail +numactl:arm64-windows=fail +numactl:arm-uwp=fail +numactl:x64-osx=fail +numactl:x64-uwp=fail +numactl:x64-windows=fail +numactl:x64-windows-static=fail +numactl:x86-windows=fail +nvtt:arm64-windows=fail +nvtt:arm-uwp=fail +nvtt:x64-uwp=fail +ocilib:arm64-windows=fail +ocilib:arm-uwp=fail +ocilib:x64-uwp=fail +ocilib:x64-windows-static=fail +octomap:arm-uwp=fail +octomap:x64-uwp=fail +ode:arm64-windows=fail +ode:arm-uwp=fail +ode:x64-uwp=fail +offscale-libetcd-cpp:arm64-windows=fail +offscale-libetcd-cpp:arm-uwp=fail +offscale-libetcd-cpp:x64-uwp=fail +ogdf:arm64-windows = skip +ogdf:arm-uwp = skip +ogdf:x64-osx=fail +ogdf:x64-uwp = skip +ogdf:x64-windows = skip +ogdf:x64-windows-static = skip +ogdf:x86-windows = skip +ogre:x64-osx=fail +# Conflicts with ogre +ogre-next:arm64-windows = skip +ogre-next:arm-uwp = skip +ogre-next:x64-osx = skip +ogre-next:x64-linux = skip +ogre-next:x64-uwp = skip +ogre-next:x64-windows = skip +ogre-next:x64-windows-static = skip +ogre-next:x86-windows = skip +ois:arm64-windows=fail +ois:arm-uwp=fail +ois:x64-uwp=fail +open62541:arm-uwp=fail +open62541:x64-uwp=fail +openal-soft:arm-uwp=fail +openal-soft:x64-uwp=fail +openblas:arm64-windows=fail +openblas:arm-uwp=fail +# opencc/deps/rapidjson-1.1.0/rapidjson.h: Unknown machine endianess detected +opencc:arm64-windows=fail +# opencc/deps/marisa-0.2.5/lib/marisa/grimoire/io/mapper.cc currently doesn't support UWP. +opencc:arm-uwp=fail +opencc:x64-uwp=fail +opencensus-cpp:arm64-windows=fail +opencensus-cpp:x64-windows=fail +opencensus-cpp:x64-windows-static=fail +opencensus-cpp:x86-windows=fail +opencensus-cpp:x64-uwp=fail +opencl:arm-uwp=fail +opencl:x64-uwp=fail +opencsg:x64-uwp=fail +opencv2:arm64-windows = skip +opencv2:arm-uwp = skip +opencv2:x64-linux = skip +opencv2:x64-osx = skip +opencv2:x64-uwp = skip +opencv2:x64-windows = skip +opencv2:x64-windows-static = skip +opencv2:x86-windows = skip +opencv3:arm64-windows = skip +opencv3:arm-uwp = skip +opencv3:x64-linux = skip +opencv3:x64-osx = skip +opencv3:x64-uwp = skip +opencv3:x64-windows = skip +opencv3:x64-windows-static = skip +opencv3:x86-windows = skip +opendnp3:x64-uwp=fail +opendnp3:arm-uwp=fail +openexr:arm64-windows=fail +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 +openmpi:arm64-windows=fail +openmpi:arm-uwp=fail +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 +openssl-unix:arm64-windows=fail +openssl-unix:arm-uwp=fail +openssl-unix:x64-uwp=fail +openssl-unix:x64-windows=fail +openssl-unix:x64-windows-static=fail +openssl-unix:x86-windows=fail +openssl-uwp:arm64-windows=fail +openssl-uwp:x64-linux=fail +openssl-uwp:x64-osx=fail +openssl-uwp:x64-windows=fail +openssl-uwp:x64-windows-static=fail +openssl-uwp:x86-windows=fail +openssl-windows:arm-uwp=fail +openssl-windows:x64-linux=fail +openssl-windows:x64-osx=fail +openssl-windows:x64-uwp=fail +opentracing:arm-uwp=fail +opentracing:x64-uwp=fail +openvdb:x64-osx=fail +#openvdb:x64-windows-static=fail # https://github.com/microsoft/vcpkg/pull/10816#issuecomment-613784827 +openvpn3:x64-osx=fail +openvr:arm64-windows=fail +openvr:arm-uwp=fail +openvr:x64-osx=fail +openvr:x64-uwp=fail +openvr:x64-windows-static=fail +openxr-loader:arm64-windows=fail +openxr-loader:arm-uwp=fail +openxr-loader:x64-osx=fail +openxr-loader:x64-uwp=fail +optional-bare:arm64-windows = skip +optional-bare:arm-uwp = skip +optional-bare:x64-linux = skip +optional-bare:x64-osx = skip +optional-bare:x64-uwp = skip +optional-bare:x64-windows = skip +optional-bare:x64-windows-static = skip +optional-bare:x86-windows = skip +opusfile:arm-uwp=fail +opusfile:x64-uwp=fail +orocos-kdl:arm-uwp=fail +orocos-kdl:x64-uwp=fail +osg:x86-windows=skip +osg:x64-windows=skip +osgearth:x64-osx=fail +osgearth:x64-linux=fail +osgearth:x64-windows-static=fail +osg-qt:x64-windows-static=fail +paho-mqtt:arm-uwp=fail +paho-mqtt:x64-uwp=fail +pangomm:x64-osx=fail +pangomm:arm64-windows=fail +parmetis:x64-linux=fail +parmetis:x64-osx=fail +pdal:x64-linux=fail +pdal:x64-osx=fail +pdal-c:x64-windows-static=fail +pdcurses:arm-uwp=fail +pdcurses:x64-linux=fail +pdcurses:x64-osx=fail +pdcurses:x64-uwp=fail +pdcurses:x64-windows-static=fail +pfring:arm64-windows=fail +pfring:arm-uwp=fail +pfring:x64-uwp=fail +pfring:x64-windows=fail +pfring:x64-windows-static=fail +pfring:x86-windows=fail +pfring:x64-osx=fail +# pfring on Linux currently fails because its build scripts enable warnings as +# errors, and warnings trigger with the Linux kernel headers in the Azure images. +pfring:x64-linux=fail +physfs:arm64-windows=fail +physx:arm64-windows=fail +physx:x64-linux=fail +physx:x64-osx=fail +piex:x64-osx=fail +pistache:arm64-windows=fail +pistache:arm-uwp=fail +pistache:x64-osx=fail +pistache:x64-uwp=fail +pistache:x64-windows=fail +pistache:x64-windows-static=fail +pistache:x86-windows=fail +pixel:x64-uwp=fail +pixel:x64-windows=fail +pixel:x64-windows-static=fail +pixel:x86-windows=fail +platform-folders:arm-uwp=fail +platform-folders:x64-uwp=fail +plib:arm-uwp=fail +plib:x64-osx=fail +plib:x64-uwp=fail +plibsys:arm-uwp=fail +plibsys:x64-uwp=fail +plplot:arm64-windows=fail +plplot:arm-uwp=fail +plplot:x64-uwp=fail +pmdk:arm-uwp=fail +pmdk:arm64-windows=fail +pmdk:x64-linux=fail +pmdk:x64-osx=fail +pmdk:x64-uwp=fail +pmdk:x64-windows-static=fail +pmdk:x86-windows=fail +pngwriter:arm-uwp=fail +pngwriter:x64-uwp=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 +portaudio:arm64-windows=fail +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 +proj4:arm-uwp=fail +proj4:x64-uwp=fail +protobuf-c:x86-windows=fail +protobuf-c:x64-windows=fail +protobuf-c:x64-windows-static=fail +protobuf-c:x64-uwp=fail +protobuf-c:arm64-windows=fail +protobuf-c:arm-uwp=fail +# proxygen fails with "Target 'Windows' not supported by proxygen!" +proxygen:x64-windows=fail +proxygen:x64-windows-static=fail +ptex:arm-uwp=fail +ptex:x64-linux=fail +ptex:x64-osx=fail +ptex:x64-uwp=fail +pthreads:arm64-windows=fail +pthreads:arm-uwp=fail +pthreads:x64-uwp=fail +python2:arm64-windows=fail +python2:arm-uwp=fail +python2:x64-linux=fail +python2:x64-osx=fail +python2:x64-uwp=fail +python3:arm64-windows=fail +python3:arm-uwp=fail +python3:x64-uwp=fail +qca:x64-linux=fail +qca:x64-osx=fail +qca:x64-windows-static=fail +qhull:x64-uwp=fail +qhull:arm-uwp=fail +qpid-proton:arm-uwp=fail +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 +# (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 +qt5-canvas3d:x64-windows=skip +qt5-canvas3d:x64-windows-static=skip +qt5-canvas3d:x86-windows=skip +qt5-macextras:x64-linux=fail +qt5-macextras:x64-windows=fail +qt5-macextras:x64-windows-static=fail +qt5-macextras:x86-windows=fail +# Missing system libraries +qt5-wayland:x64-osx=fail +# Missing libraries +qt5-wayland:x86-windows=fail +qt5-wayland:x64-windows=fail +qt5-wayland:x64-windows-static=fail +qt5-winextras:x64-linux=fail +qt5-winextras:x64-osx=fail +# Missing prerequisites for CI success +qt5-webengine:x64-linux=fail +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 +qt5-webengine:x64-windows-static=skip +# Missing system libraries +qt5-x11extras:x64-osx=fail +# Missing libraries +qt5-x11extras:x86-windows=fail +qt5-x11extras:x64-windows=fail +qt5-x11extras:x64-windows-static=fail +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 +quirc:arm64-windows = skip +quirc:arm-uwp = skip +quirc:x64-linux = skip +quirc:x64-osx = skip +quirc:x64-uwp = skip +quirc:x64-windows = skip +quirc:x64-windows-static = skip +quirc:x86-windows = skip +qwt:x64-osx=fail +rabit:x64-osx=fail +ragel:arm-uwp=fail +ragel:x64-uwp=fail +range-v3-vs2015:arm64-windows = skip +range-v3-vs2015:arm-uwp = skip +range-v3-vs2015:x64-linux = skip +range-v3-vs2015:x64-osx = skip +range-v3-vs2015:x64-uwp = skip +range-v3-vs2015:x64-windows = skip +range-v3-vs2015:x64-windows-static = skip +range-v3-vs2015:x86-windows = skip +rapidstring:arm64-windows=fail +rapidstring:arm-uwp=fail +rapidstring:x64-linux=fail +rapidstring:x64-uwp=fail +rapidstring:x64-windows=fail +rapidstring:x64-windows-static=fail +rapidstring:x86-windows=fail +raylib:arm64-windows=fail +raylib:arm-uwp=fail +raylib:x64-uwp=fail +readline:arm-uwp=fail +readline:x64-uwp=fail +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 +redis-plus-plus:x64-windows-static=fail +redis-plus-plus:arm64-windows=fail +replxx:arm-uwp=fail +replxx:x64-uwp=fail +reproc:arm-uwp=fail +reproc:x64-uwp=fail +restbed:arm-uwp=fail +restbed:x64-uwp=fail +rhash:arm64-windows=fail +rhash:arm-uwp=fail +rhash:x64-uwp=fail +rocksdb:arm-uwp=fail +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 +rtlsdr:x64-linux=fail +rtlsdr:x64-osx=fail +rttr:arm-uwp=fail +rttr:x64-uwp=fail +rxspencer:x64-uwp=fail +rxspencer:arm-uwp=fail +ryml:arm-uwp=fail +ryml:arm64-windows=fail +ryml:x64-osx=fail +ryu:arm-uwp=fail +ryu:x64-uwp=fail +ryu:x64-windows-static=fail +ryu:x86-windows=fail +ryu::arm64-windows=fail +scintilla:arm-uwp=fail +scintilla:x64-linux=fail +scintilla:x64-osx=fail +scintilla:x64-uwp=fail +scintilla:x64-windows-static=fail +sciter:arm64-windows=fail +sciter:arm-uwp=fail +sciter:x64-uwp=fail +sciter:x64-windows-static=fail +scnlib:arm-uwp=fail +scnlib:x64-uwp=fail +scylla-wrapper:arm-uwp=fail +scylla-wrapper:x64-linux=fail +scylla-wrapper:x64-osx=fail +scylla-wrapper:x64-uwp=fail +scylla-wrapper:x64-windows-static=fail +sdformat6:arm64-windows=fail +sdformat6:arm-uwp=fail +sdformat6:x64-uwp=fail +sdformat9:x64-linux=fail +sdformat9:arm-uwp=fail +sdformat9:x64-uwp=fail +sdl1:arm-uwp=fail +sdl1:x64-uwp=fail +sdl1:x64-osx=fail +sdl2-image:arm-uwp=fail +sdl2-image:x64-uwp=fail +sdl2-mixer:arm-uwp=fail +sdl2-mixer:x64-uwp=fail +sdl2-net:arm-uwp=fail +sdl2-net:x64-uwp=fail +# https://github.com/microsoft/vcpkg/issues/10918 +seal:arm-uwp=fail +seal:x64-uwp=fail +sentencepiece:arm64-windows=fail +sentencepiece:arm-uwp=fail +sentencepiece:x64-uwp=fail +sentencepiece:x64-windows=fail +sentencepiece:x86-windows=fail +septag-sx:arm64-windows=fail +septag-sx:arm-uwp=fail +septag-sx:x64-uwp=fail +sfml:arm64-windows=fail +shapelib:arm-uwp=fail +shapelib:x64-uwp=fail +shiva:x64-windows-static=fail +shiva-sfml:x64-linux=fail +shiva-sfml:x64-osx=fail +shiva-sfml:x86-windows=fail +shiva-sfml:x64-windows=fail +shogun:arm64-windows = skip +shogun:arm-uwp = skip +shogun:x64-osx = skip +shogun:x64-uwp = skip +shogun:x64-windows = skip +shogun:x64-windows-static = skip +shogun:x86-windows = skip +signalrclient:x64-uwp=fail +signalrclient:arm-uwp=fail +skia:arm64-windows=fail +skia:arm-uwp=fail +skia:x64-linux=fail +skia:x64-uwp=fail +skia:x86-windows=fail +slikenet:arm-uwp=fail +slikenet:x64-uwp=fail +smpeg2:arm-uwp=fail +smpeg2:x64-linux=fail +smpeg2:x64-uwp=fail +soci:arm-uwp=fail +soci:x64-uwp=fail +sockpp:arm-uwp=fail +sockpp:x64-uwp=fail +soem:x64-uwp=fail +soem:arm-uwp=fail +soil:arm-uwp=fail +soil:x64-uwp=fail +soil2:arm-uwp=fail +soil2:x64-uwp=fail +sophus:x64-linux=fail +soqt:arm64-windows=fail +soqt:arm-uwp=fail +soqt:x64-uwp=fail +soundtouch:arm-uwp=fail +soundtouch:x64-uwp=fail +soundtouch:x64-windows-static=fail +spaceland:arm64-windows=fail +spaceland:arm-uwp=fail +spaceland:x64-uwp=fail +spdk:x64-linux=fail +spdk-dpdk:arm64-windows=fail +spdk-dpdk:arm-uwp=fail +spdk-dpdk:x64-osx=fail +spdk-dpdk:x64-uwp=fail +spdk-dpdk:x64-windows=fail +spdk-dpdk:x64-windows-static=fail +spdk-dpdk:x86-windows=fail +spdk-ipsec:arm64-windows=fail +spdk-ipsec:arm-uwp=fail +spdk-ipsec:x64-osx=fail +spdk-ipsec:x64-uwp=fail +spdk-ipsec:x64-windows=fail +spdk-ipsec:x64-windows-static=fail +spdk-ipsec:x86-windows=fail +spdk-isal:arm64-windows=fail +spdk-isal:arm-uwp=fail +spdk-isal:x64-osx=fail +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 +spirv-tools:x64-uwp=fail +stormlib:arm-uwp=fail +stormlib:x64-uwp=fail +stxxl:arm-uwp=fail +stxxl:x64-uwp=fail +# Sundials was broken by Ninja 1.9.0 https://github.com/ninja-build/ninja/pull/1406 +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 +tbb:arm64-windows=fail +tbb:arm-uwp=fail +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 +teemo:arm64-windows=fail +teemo:x64-osx=fail +telnetpp:arm-uwp=fail +telnetpp:x64-uwp=fail +tensorflow-cc:arm64-windows=fail +tensorflow-cc:x64-linux=skip +tensorflow-cc:x64-osx=skip +tensorflow-cc:x64-windows=fail +tensorflow-cc:x64-windows-static=fail +tensorflow-cc:x86-windows=fail +tesseract:x64-windows=fail +tesseract:x64-windows-static=fail +tesseract:x86-windows=fail +tesseract:arm64-windows=fail +tfhe:x86-windows=fail +tfhe:x64-windows=fail +tfhe:x64-windows-static=fail +tfhe:x64-uwp=fail +tfhe:arm64-windows=fail +tfhe:arm-uwp=fail +theia:arm64-windows = skip +theia:arm-uwp = skip +theia:x64-uwp = skip +theia:x64-windows = skip +theia:x64-windows-static = skip +theia:x86-windows = skip +thor:x64-linux=fail +thor:x64-osx=fail +tidy-html5:arm-uwp=fail +tidy-html5:x64-uwp=fail +tinkerforge:arm-uwp=fail +tinkerforge:x64-uwp=fail +tinyexif:arm-uwp=fail +tinyexif:x64-uwp=fail +tinyfiledialogs:arm-uwp=fail +tinyfiledialogs:x64-uwp=fail +tiny-process-library:arm-uwp=fail +tiny-process-library:x64-uwp=fail +tinyutf8:arm64-windows=fail +tinyutf8:arm-uwp=fail +tinyutf8:x64-uwp=fail + +#Flaky on windows only due to error PRI210: 0x80070020 - File move failed +tmx:arm64-windows = skip +tmx:arm-uwp = skip +tmx:x64-uwp = skip +tmx:x64-windows = skip +tmx:x64-windows-static = skip +tmx:x86-windows = skip +tmxlite:arm-uwp=fail +tmxlite:x64-uwp=fail +tmxparser:arm64-windows=fail +tmxparser:arm-uwp=fail +tmxparser:x64-uwp=fail +tmxparser:x64-windows=fail +tmxparser:x64-windows-static=fail +tmxparser:x86-windows=fail +torch-th:arm64-windows=fail +torch-th:arm-uwp=fail +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 +turbobase64:x64-windows=fail +turbobase64:x64-windows-static=fail +turbobase64:x86-windows=fail +unicorn:arm64-windows=fail +unicorn:arm-uwp=fail +unicorn:x64-linux=fail +unicorn:x64-osx=fail +unicorn:x64-uwp=fail +unicorn-lib:arm-uwp=fail +unicorn-lib:x64-uwp=fail +unittest-cpp:arm64-windows=fail +unittest-cpp:arm-uwp=fail +unittest-cpp:x64-uwp=fail +unixodbc:arm64-windows=fail +unixodbc:arm-uwp=fail +unixodbc:x64-uwp=fail +unixodbc:x64-windows=fail +unixodbc:x64-windows-static=fail +unixodbc:x86-windows=fail +unrar:arm64-windows=fail +unrar:arm-uwp=fail +unrar:x64-linux=fail +unrar:x64-osx=fail +unrar:x64-uwp=fail +unrar:x64-windows-static=fail +urdfdom:x64-windows-static=fail +usd:x86-windows=fail +usrsctp:arm-uwp=fail +usrsctp:x64-uwp=fail +uthenticode:arm-uwp=fail +uthenticode:x64-uwp=fail +uvatlas:arm64-windows=fail +uvatlas:arm-uwp=fail +uvatlas:x64-linux=fail +uvatlas:x64-osx=fail +uvatlas:x64-windows-static=fail +vectorclass:arm64-windows=fail +vectorclass:arm-uwp=fail +vlpp:x64-osx=fail +vulkan:arm64-windows=fail +vulkan:arm-uwp=fail +vulkan:x64-linux=fail +vulkan:x64-osx=fail +vulkan:x64-uwp=fail +vulkan:x64-windows=fail +vulkan:x64-windows-static=fail +vulkan:x86-windows=fail +# Conflicts with latest openjpeg port (vxl ships with an old version of openjpeg) +# conflicts with qt5-location +vxl:arm64-windows = skip +vxl:arm-uwp = skip +vxl:x64-linux = skip +vxl:x64-osx = skip +vxl:x64-uwp = skip +vxl:x64-windows = skip +vxl:x64-windows-static = skip +vxl:x86-windows = skip +wampcc:arm64-windows=fail +wepoll:arm-uwp=fail +wepoll:x64-uwp=fail +wepoll:x64-linux=fail +wepoll:x64-osx=fail +wildmidi:x64-osx=fail +wincrypt:x64-linux=fail +wincrypt:x64-osx=fail +winpcap:arm64-windows = skip +winpcap:arm-uwp = skip +winpcap:x64-linux=fail +winpcap:x64-osx=fail +winpcap:x64-uwp = skip +winpcap:x64-windows = skip +winpcap:x64-windows-static = skip +winpcap:x86-windows = skip +winreg:x64-linux=fail +winreg:x64-osx=fail +winsock2:x64-linux=fail +winsock2:x64-osx=fail +wintoast:arm-uwp=fail +wintoast:x64-linux=fail +wintoast:x64-osx=fail +wintoast:x64-uwp=fail +woff2:x64-linux=fail +woff2:x64-osx=fail +woff2:x64-windows-static=fail +wpilib:arm64-windows=fail +wpilib:x64-osx=fail +wxchartdir:x64-osx=fail +wxwidgets:x64-linux=fail +x264:arm64-windows=fail +x264:arm-uwp=fail +x264:x64-uwp=fail +x264:x64-osx=fail +x264:x86-windows=fail +x264:x64-windows=fail +x264:x64-windows-static=fail +x265:arm64-windows=fail +x265:arm-uwp=fail +x265:x64-uwp=fail +xalan-c:x64-windows-static=fail +xalan-c:arm64-windows=fail +xbyak:arm64-windows=fail +xbyak:arm-uwp=fail +xbyak:x64-uwp=fail +xerces-c:arm-uwp=fail +xerces-c:x64-uwp=fail +xmlsec:arm-uwp=fail +xmlsec:x64-uwp=fail +# The xmsh upstream repository is gone, if we find no replacement before +# 2021-01-01 we will remove the port outright. +xmsh:arm-uwp=skip +xmsh:arm64-windows=skip +xmsh:x64-linux=skip +xmsh:x64-osx=skip +xmsh:x64-uwp=skip +xmsh:x64-windows-static=skip +xmsh:x64-windows=skip +xmsh:x86-windows=skip +x-plane:arm64-windows=fail +x-plane:arm-uwp=fail +x-plane:x64-linux=fail +x-plane:x86-windows=fail +yajl:arm-uwp=fail +yajl:x64-uwp=fail +yara:arm-uwp=fail +yara:x64-uwp=fail +yasm:arm64-windows=fail +yasm:arm-uwp=fail +yasm:x64-linux=fail +yasm:x64-osx=fail +yasm:x64-uwp=fail +yato:arm64-windows=fail +yato:arm-uwp=fail +yato:x64-uwp=fail +z3:arm64-windows=fail +z3:arm-uwp=fail +z3:x64-uwp=fail +zeromq:arm64-windows=fail +zeromq:arm-uwp=fail +zeromq:x64-uwp=fail +zkpp:x86-windows=fail +zkpp:x64-windows=fail +zkpp:x64-windows-static=fail +zkpp:arm64-windows=fail +zkpp:x64-uwp=fail +zkpp:arm-uwp=fail +c4core:arm-uwp=fail +c4core:arm64-windows=fail +c4core:x64-osx=fail + +# Official downloading server of CTP library is only guaranteed to be available during trading hours of China futures market +# Skip CI to avoid random failures +ctp:arm64-windows=skip +ctp:arm-uwp=skip +ctp:x64-linux=skip +ctp:x64-osx=skip +ctp:x64-uwp=skip +ctp:x64-windows=skip +ctp:x64-windows-static=skip +ctp:x86-windows=skip +protozero:arm-uwp=fail +protozero:x64-uwp=fail diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 85ca811cd06a38..a663459ebfc97d 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -81,6 +81,19 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 ${HASH} ) + # download the new keyring, without it new packages and package updates + # might not install + vcpkg_download_distfile(KEYRING_PATH + URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz + FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz + SHA512 a5023fd17ccf6364bc6e27c5e63aea25f1fc264a5247cbae4008864c828c38c3e0b4de09ded650e28d2e24e319b5fcf7a9c0da0fa3a8ac81679470fc6bd120c9 + ) + vcpkg_download_distfile(KEYRING_SIG_PATH + URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig + FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig + SHA512 c326fefd13f58339afe0d0dc78306aa6ab27cafa8c4d792c2d34aa81fdd1f759d490990ab79daa9664a03a6dfa14ffd2b2ad828bf19a883410112d01f5ed6c4c + ) + file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) _execute_process( @@ -91,6 +104,38 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) + # install the new keyring + _execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --verify ${KEYRING_SIG_PATH}" + WORKING_DIRECTORY ${TOOLPATH} + RESULT_VARIABLE _vam_error_code + ) + if(_vam_error_code) + message(FATAL_ERROR "Cannot verify MSYS2 keyring.") + endif() + _execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -U ${KEYRING_PATH} --noconfirm" + 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} @@ -107,7 +152,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) 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 -Sy --noconfirm --needed ${_am_PACKAGES}" + 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} ) @@ -116,14 +161,5 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) message(STATUS "Acquiring MSYS Packages... OK") endif() - # Deal with a stale process created by MSYS - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE - COMMAND TASKKILL /F /IM gpg-agent.exe /fi "memusage gt 2" - WORKING_DIRECTORY ${SOURCE_PATH} - ) - endif() - set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index d049c907b96398..5274c29da194f0 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -75,9 +75,9 @@ function(vcpkg_build_cmake) if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") if(BUILDTYPE STREQUAL "debug") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") else() - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") endif() endif() diff --git a/scripts/cmake/vcpkg_build_gn.cmake b/scripts/cmake/vcpkg_build_gn.cmake new file mode 100644 index 00000000000000..cf0ea89cf8421f --- /dev/null +++ b/scripts/cmake/vcpkg_build_gn.cmake @@ -0,0 +1,18 @@ +## # vcpkg_build_gn +## +## Build a GN project +## +## ## Usage: +## ```cmake +## vcpkg_build_gn( +## [TARGETS ...] +## ) +## ``` +## +## ## Parameters: +## ### TARGETS +## Only build the specified targets. + +function(vcpkg_build_gn) + vcpkg_build_ninja(${ARGN}) +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 202ef33f41c293..17a755890f6360 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -4,16 +4,26 @@ ## ## ## Usage: ## ```cmake -## vcpkg_build_make([TARGET ]) +## vcpkg_build_make([BUILD_TARGET ] +## [ADD_BIN_TO_PATH] +## [ENABLE_INSTALL]) +## [LOGFILE_ROOT ]) ## ``` ## -## ### TARGET -## The target passed to the configure/make build command (`./configure/make/make install`). If not specified, no target will +## ### BUILD_TARGET +## The target passed to the make build command (`./make `). If not specified, the 'all' target will ## be passed. ## ## ### ADD_BIN_TO_PATH ## Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. ## +## ### ENABLE_INSTALL +## IF the port supports the install target use vcpkg_install_make() instead of vcpkg_build_make() +## +## ### BUILD_TARGET +## The target passed to the make build command (`./make `). If not specified, the 'all' target will +## be passed. +## ## ## 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 @@ -26,60 +36,93 @@ ## * [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" "" ${ARGN}) + cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN}) if(NOT _bc_LOGFILE_ROOT) set(_bc_LOGFILE_ROOT "build") endif() - - if (_VCPKG_PROJECT_SUBPATH) - set(_VCPKG_PROJECT_SUBPATH /${_VCPKG_PROJECT_SUBPATH}/) + + if(NOT _bc_BUILD_TARGET) + set(_bc_BUILD_TARGET "all") + endif() + + if(WIN32) + set(_VCPKG_PREFIX ${CURRENT_PACKAGES_DIR}) + set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) + else() + string(REPLACE " " "\ " _VCPKG_PREFIX "${CURRENT_PACKAGES_DIR}") + string(REPLACE " " "\ " _VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}") endif() - + set(MAKE ) set(MAKE_OPTS ) set(INSTALL_OPTS ) - if (_VCPKG_MAKE_GENERATOR STREQUAL "make") - if (CMAKE_HOST_WIN32) - # Compiler requriements - vcpkg_find_acquire_program(YASM) - vcpkg_find_acquire_program(PERL) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES make) - get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - - set(PATH_GLOBAL "$ENV{PATH}") - set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}") - set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - # Set make command and install command - set(MAKE ${BASH} --noprofile --norc -c "${_VCPKG_PROJECT_SUBPATH}make") - # Must use absolute path to call make in windows - set(MAKE_OPTS -j ${VCPKG_CONCURRENCY}) - set(INSTALL_OPTS install -j ${VCPKG_CONCURRENCY}) - else() - # Compiler requriements - find_program(MAKE make REQUIRED) - set(MAKE make;) - # Set make command and install command - set(MAKE_OPTS -j;${VCPKG_CONCURRENCY}) - set(INSTALL_OPTS install;-j;${VCPKG_CONCURRENCY}) - endif() - elseif (_VCPKG_MAKE_GENERATOR STREQUAL "nmake") - find_program(NMAKE nmake REQUIRED) - get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY) + if (CMAKE_HOST_WIN32) set(PATH_GLOBAL "$ENV{PATH}") - set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}") - set(ENV{CL} "$ENV{CL} /MP") + # 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 + set(MAKE_COMMAND "${MAKE}") + set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --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}") + set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} --trace -f Makefile install DESTDIR=${_VCPKG_PACKAGE_PREFIX}) + #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 ${NMAKE} /NOLOGO /G /U) - set(MAKE_OPTS -f makefile all) - set(INSTALL_OPTS install) + set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -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() - message(FATAL_ERROR "${_VCPKG_MAKE_GENERATOR} not supported.") + 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() - - set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") - + foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") @@ -88,6 +131,7 @@ function(vcpkg_build_make) continue() endif() set(SHORT_BUILDTYPE "-dbg") + set(CMAKE_BUILDTYPE "DEBUG") else() # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory. if (_VCPKG_NO_DEBUG) @@ -95,51 +139,76 @@ function(vcpkg_build_make) else() set(SHORT_BUILDTYPE "-rel") endif() + set(CMAKE_BUILDTYPE "RELEASE") endif() - - if (CMAKE_HOST_WIN32) - # In windows we can remotely call make - set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}) - else() - set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH}) - endif() - + + set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}") + message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") - if(CMAKE_HOST_WIN32) - set(_PATHSEP ";") + if(BUILDTYPE STREQUAL "debug") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") else() - set(_PATHSEP ":") + 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{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin${_PATHSEP}$ENV{PATH}") + 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{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}") + 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() endif() - if (CMAKE_HOST_WIN32) - vcpkg_execute_build_process( - COMMAND "${MAKE} ${MAKE_OPTS}" - WORKING_DIRECTORY ${WORKING_DIRECTORY} - LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" - ) + if(MAKE_BASH) + set(MAKE_CMD_LINE "${MAKE_COMMAND} ${MAKE_OPTS}") else() - vcpkg_execute_build_process( - COMMAND "${MAKE};${MAKE_OPTS}" - WORKING_DIRECTORY ${WORKING_DIRECTORY} + set(MAKE_CMD_LINE ${MAKE_COMMAND} ${MAKE_OPTS}) + endif() + vcpkg_execute_build_process( + COMMAND ${MAKE_BASH} ${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}") endif() endif() endforeach() - + if (_bc_ENABLE_INSTALL) foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) @@ -157,29 +226,46 @@ function(vcpkg_build_make) set(SHORT_BUILDTYPE "-rel") endif() endif() - + message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") - if (CMAKE_HOST_WIN32) - # In windows we can remotely call make - set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}) - vcpkg_execute_build_process( - COMMAND "${MAKE} ${INSTALL_OPTS}" - WORKING_DIRECTORY ${WORKING_DIRECTORY} - LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" - ) + + if(MAKE_BASH) + set(MAKE_CMD_LINE "${MAKE_COMMAND} ${INSTALL_OPTS}") else() - set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH}) - vcpkg_execute_build_process( - COMMAND "${MAKE};${INSTALL_OPTS}" - WORKING_DIRECTORY ${WORKING_DIRECTORY} - LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" - ) + set(MAKE_CMD_LINE ${MAKE_COMMAND} ${INSTALL_OPTS}) endif() + + set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}") + vcpkg_execute_build_process( + COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE} + WORKING_DIRECTORY "${WORKING_DIRECTORY}" + LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}" + ) + endif() endforeach() + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") + file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}_tmp") + file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${_VCPKG_INSTALL_PREFIX}/" "${CURRENT_PACKAGES_DIR}") + 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() + + endfunction() diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index cfd429da2f26aa..bc118b4c0d2312 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -96,6 +96,7 @@ function(vcpkg_build_msbuild) /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:VcpkgManifestInstall=false /m ) @@ -110,6 +111,7 @@ function(vcpkg_build_msbuild) APPEND _csc_OPTIONS /p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets "/p:VcpkgTriplet=${TARGET_TRIPLET}" + "/p:VcpkgCurrentInstalledDir=${CURRENT_INSTALLED_DIR}" ) endif() diff --git a/scripts/cmake/vcpkg_build_ninja.cmake b/scripts/cmake/vcpkg_build_ninja.cmake new file mode 100644 index 00000000000000..3eb05c98b32453 --- /dev/null +++ b/scripts/cmake/vcpkg_build_ninja.cmake @@ -0,0 +1,37 @@ +## # vcpkg_build_ninja +## +## Build a ninja project +## +## ## Usage: +## ```cmake +## vcpkg_build_ninja( +## [TARGETS ...] +## ) +## ``` +## +## ## Parameters: +## ### TARGETS +## Only build the specified targets. + +function(vcpkg_build_ninja) + cmake_parse_arguments(_vbn "" "" "TARGETS" ${ARGN}) + + vcpkg_find_acquire_program(NINJA) + + function(build CONFIG) + message(STATUS "Building (${CONFIG})...") + vcpkg_execute_build_process( + COMMAND "${NINJA}" -C "${CURRENT_BUILDTREES_DIR}/${CONFIG}" ${_vbn_TARGETS} + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME build-${CONFIG} + ) + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + build(${TARGET_TRIPLET}-dbg) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + build(${TARGET_TRIPLET}-rel) + endif() +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index ef6fb30f3ec668..deecf4f061a2ee 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -6,7 +6,6 @@ # :: # vcpkg_build_qmake() # - function(vcpkg_build_qmake) cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS" ${ARGN}) @@ -18,9 +17,9 @@ function(vcpkg_build_qmake) set(INVOKE "${MAKE}") endif() - # Make sure that the linker finds the libraries used + # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") - + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) if(NOT _csc_BUILD_LOGNAME) @@ -29,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( - COMMAND ${INVOKE} ${TARGETS} + 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} ) @@ -46,16 +46,16 @@ function(vcpkg_build_qmake) set(_buildname "DEBUG") list(APPEND BUILDTYPES ${_buildname}) set(_short_name_${_buildname} "dbg") - set(_path_suffix_${_buildname} "/debug") + set(_path_suffix_${_buildname} "/debug") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") set(_buildname "RELEASE") list(APPEND BUILDTYPES ${_buildname}) set(_short_name_${_buildname} "rel") - set(_path_suffix_${_buildname} "") + set(_path_suffix_${_buildname} "") endif() unset(_buildname) - + foreach(_buildname ${BUILDTYPES}) set(_BUILD_PREFIX "${_path_suffix_${_buildname}}") vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${_BUILD_PREFIX}/bin") @@ -67,7 +67,7 @@ function(vcpkg_build_qmake) run_jom("${_csc_${_buildname}_TARGETS}" ${_csc_BUILD_LOGNAME} ${_short_name_${_buildname}}) unset(_BUILD_PREFIX) endforeach() - + # Restore the original value of ENV{PATH} set(ENV{PATH} "${ENV_PATH_BACKUP}") set(ENV{_CL_} "${ENV_CL_BACKUP}") diff --git a/scripts/cmake/vcpkg_clean_executables_in_bin.cmake b/scripts/cmake/vcpkg_clean_executables_in_bin.cmake new file mode 100644 index 00000000000000..5321e05b63fdfb --- /dev/null +++ b/scripts/cmake/vcpkg_clean_executables_in_bin.cmake @@ -0,0 +1,58 @@ +## # vcpkg_clean_executables_in_bin +## +## Remove specified executables found in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. If, after all specified executables have been removed, and the `bin` and `debug/bin` directories are empty, then also delete `bin` and `debug/bin` directories. +## +## ## Usage +## ```cmake +## vcpkg_clean_executables_in_bin( +## FILE_NAMES ... +## ) +## ``` +## +## ## Parameters +## ### FILE_NAMES +## A list of executable filenames without extension. +## +## ## Notes +## Generally, there is no need to call this function manually. Instead, pass an extra `AUTO_CLEAN` argument when calling `vcpkg_copy_tools`. +## +## ## Examples +## * [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake) +function(vcpkg_clean_executables_in_bin) + cmake_parse_arguments(_vct "" "" "FILE_NAMES" ${ARGN}) + + if(NOT DEFINED _vct_FILE_NAMES) + message(FATAL_ERROR "FILE_NAMES must be specified.") + endif() + + foreach(file_name ${_vct_FILE_NAMES}) + file(REMOVE + "${CURRENT_PACKAGES_DIR}/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" + "${CURRENT_PACKAGES_DIR}/debug/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" + ) + endforeach() + + function(try_remove_empty_directory directory) + if(NOT EXISTS "${directory}") + return() + endif() + + if(NOT IS_DIRECTORY "${directory}") + message(FATAL_ERROR "${directory} is supposed to be an existing directory.") + endif() + + # TODO: + # For an empty directory, + # file(GLOB items "${directory}" "${directory}/*") + # will return a list with one item. + file(GLOB items "${directory}/" "${directory}/*") + list(LENGTH items items_count) + + if(${items_count} EQUAL 0) + file(REMOVE_RECURSE "${directory}") + endif() + endfunction() + + try_remove_empty_directory("${CURRENT_PACKAGES_DIR}/bin") + try_remove_empty_directory("${CURRENT_PACKAGES_DIR}/debug/bin") +endfunction() diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 724644abcb9119..2414b5df6c0487 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -16,6 +16,7 @@ ## VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX import library suffix for target (same as CMAKE_IMPORT_LIBRARY_SUFFIX) ## VCPKG_FIND_LIBRARY_PREFIXES target dependent prefixes used for find_library calls in portfiles ## VCPKG_FIND_LIBRARY_SUFFIXES target dependent suffixes used for find_library calls in portfiles +## VCPKG_SYSTEM_LIBRARIES list of libraries are provide by the toolchain and are not managed by vcpkg ## ``` ## ## CMAKE_STATIC_LIBRARY_(PREFIX|SUFFIX), CMAKE_SHARED_LIBRARY_(PREFIX|SUFFIX) and CMAKE_IMPORT_LIBRARY_(PREFIX|SUFFIX) are defined for the target @@ -31,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") @@ -111,3 +114,22 @@ set(CMAKE_IMPORT_LIBRARY_PREFIX "${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}") set(CMAKE_FIND_LIBRARY_SUFFIXES "${VCPKG_FIND_LIBRARY_SUFFIXES}" CACHE INTERNAL "") # Required by find_library set(CMAKE_FIND_LIBRARY_PREFIXES "${VCPKG_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "") # Required by find_library + +# Append platform libraries to VCPKG_SYSTEM_LIBRARIES +# The variable are just appended to permit to custom triplets define the variable + +# Platforms with libdl +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES dl) +endif() + +# Platforms with libm +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD) + list(APPEND VCPKG_SYSTEM_LIBRARIES m) +endif() + +# Windows system libs +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) + list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) +endif() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 564ac9421b1d73..2fad7f0ed9632a 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -3,6 +3,7 @@ include(vcpkg_acquire_msys) include(vcpkg_add_to_path) include(vcpkg_check_features) include(vcpkg_check_linkage) +include(vcpkg_clean_executables_in_bin) include(vcpkg_clean_msbuild) include(vcpkg_download_distfile) include(vcpkg_extract_source_archive) @@ -13,28 +14,34 @@ include(vcpkg_execute_build_process) include(vcpkg_fail_port_install) include(vcpkg_find_acquire_program) include(vcpkg_fixup_cmake_targets) +include(vcpkg_fixup_pkgconfig) include(vcpkg_from_github) include(vcpkg_from_gitlab) include(vcpkg_from_bitbucket) +include(vcpkg_from_sourceforge) include(vcpkg_build_cmake) +include(vcpkg_build_gn) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) include(vcpkg_build_make) +include(vcpkg_build_ninja) include(vcpkg_build_nmake) include(vcpkg_install_cmake) +include(vcpkg_install_gn) include(vcpkg_install_meson) include(vcpkg_install_msbuild) include(vcpkg_install_make) include(vcpkg_install_nmake) include(vcpkg_install_qmake) include(vcpkg_configure_cmake) +include(vcpkg_configure_gn) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) include(vcpkg_configure_make) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) -include(vcpkg_get_program_files_32_bit) +include(vcpkg_copy_tools) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) include(vcpkg_replace_string) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index ab65a5683bc1ca..9f75c5e071348d 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -236,6 +236,9 @@ function(vcpkg_configure_cmake) "-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" + "-D_VCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}" + "-D_VCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" + "-DVCPKG_MANIFEST_INSTALL=OFF" ) if(DEFINED ARCH) diff --git a/scripts/cmake/vcpkg_configure_gn.cmake b/scripts/cmake/vcpkg_configure_gn.cmake new file mode 100644 index 00000000000000..3ae14b8bea506a --- /dev/null +++ b/scripts/cmake/vcpkg_configure_gn.cmake @@ -0,0 +1,58 @@ +## # vcpkg_configure_gn +## +## Generate Ninja (GN) targets +## +## ## Usage: +## ```cmake +## vcpkg_configure_gn( +## SOURCE_PATH +## [OPTIONS ] +## [OPTIONS_DEBUG ] +## [OPTIONS_RELEASE ] +## ) +## ``` +## +## ## Parameters: +## ### SOURCE_PATH (required) +## The path to the GN project. +## +## ### OPTIONS +## Options to be passed to both the debug and release targets. +## Note: Must be provided as a space-separated string. +## +## ### OPTIONS_DEBUG (space-separated string) +## Options to be passed to the debug target. +## +## ### OPTIONS_RELEASE (space-separated string) +## Options to be passed to the release target. + +function(vcpkg_configure_gn) + cmake_parse_arguments(_vcg "" "SOURCE_PATH;OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" "" ${ARGN}) + + if(NOT DEFINED _vcg_SOURCE_PATH) + message(FATAL_ERROR "SOURCE_PATH must be specified.") + endif() + + vcpkg_find_acquire_program(PYTHON2) + get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) + vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") + + vcpkg_find_acquire_program(GN) + + function(generate CONFIG ARGS) + message(STATUS "Generating build (${CONFIG})...") + vcpkg_execute_required_process( + COMMAND "${GN}" gen "${CURRENT_BUILDTREES_DIR}/${CONFIG}" "${ARGS}" + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME generate-${CONFIG} + ) + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + generate(${TARGET_TRIPLET}-dbg "--args=${_vcg_OPTIONS} ${_vcg_OPTIONS_DEBUG}") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + generate(${TARGET_TRIPLET}-rel "--args=${_vcg_OPTIONS} ${_vcg_OPTIONS_RELEASE}") + endif() +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 1a691a9458c280..0e47b948b8a296 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -7,9 +7,6 @@ ## vcpkg_configure_make( ## SOURCE_PATH <${SOURCE_PATH}> ## [AUTOCONFIG] -## [DISABLE_AUTO_HOST] -## [DISABLE_AUTO_DST] -## [GENERATOR] ## [NO_DEBUG] ## [SKIP_CONFIGURE] ## [PROJECT_SUBPATH <${PROJ_SUBPATH}>] @@ -28,10 +25,6 @@ ## ### PROJECT_SUBPATH ## Specifies the directory containing the ``configure`/`configure.ac`. ## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. -## Should use `GENERATOR NMake` first. -## -## ### NO_DEBUG -## This port doesn't support debug mode. ## ## ### SKIP_CONFIGURE ## Skip configure process @@ -39,21 +32,8 @@ ## ### AUTOCONFIG ## Need to use autoconfig to generate configure file. ## -## ### DISABLE_AUTO_HOST -## Don't set host automatically, the default value is `i686`. -## If use this option, you will need to set host manually. -## -## ### DISABLE_AUTO_DST -## Don't set installation path automatically, the default value is `${CURRENT_PACKAGES_DIR}` and `${CURRENT_PACKAGES_DIR}/debug` -## If use this option, you will need to set dst path manually. -## -## ### GENERATOR -## Specifies the precise generator to use. -## NMake: nmake(windows) make(unix) -## MAKE: make(windows) make(unix) -## ## ### PRERUN_SHELL -## Script that needs to be called before configuration +## Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure) ## ## ### OPTIONS ## Additional options passed to configure during the configuration. @@ -73,300 +53,444 @@ ## * [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}") + 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) + 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) + 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) + 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!" ) + else() + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) + endif() + set(TARGET_ARCH ${VCPKG_TARGET_ARCHITECTURE}) +endmacro() + +macro(_vcpkg_backup_env_variable envvar) + if(ENV{${envvar}}) + set(${envvar}_BACKUP "$ENV{${envvar}}") + set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}") + else() + set(${envvar}_PATHLIKE_CONCAT) + endif() +endmacro() + +macro(_vcpkg_restore_env_variable envvar) + if(${envvar}_BACKUP) + set(ENV{${envvar}} ${${envvar}_BACKUP}) + else() + unset(ENV{${envvar}}) + endif() +endmacro() + + function(vcpkg_configure_make) cmake_parse_arguments(_csc - "AUTOCONFIG;DISABLE_AUTO_HOST;DISABLE_AUTO_DST;NO_DEBUG;SKIP_CONFIGURE" - "SOURCE_PATH;PROJECT_SUBPATH;GENERATOR;PRERUN_SHELL" + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE" + "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN} ) - - if(NOT VCPKG_PLATFORM_TOOLSET) - message(FATAL_ERROR "Vcpkg has been updated with VS2017 support; " - "however, vcpkg.exe must be rebuilt by re-running bootstrap-vcpkg.bat\n") - endif() - - if (_csc_OPTIONS_DEBUG STREQUAL _csc_OPTIONS_RELEASE OR NMAKE_OPTION_RELEASE STREQUAL NMAKE_OPTION_DEBUG) - message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_configure_make") - endif() - # Select compiler - if(_csc_GENERATOR MATCHES "NMake") - message(FATAL_ERROR "Sorry, NMake does not supported currently.") - if (CMAKE_HOST_WIN32) - set(GENERATOR "nmake") - else() - set(GENERATOR "make") - endif() - elseif(NOT _csc_GENERATOR OR _csc_GENERATOR MATCHES "MAKE") - if (CMAKE_HOST_WIN32) - set(GENERATOR "make") - else() - set(GENERATOR "make") - endif() - else() - message(FATAL_ERROR "${_csc_GENERATOR} not supported.") - 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}") + #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}") - set(WIN_TARGET_ARCH ) - set(WIN_TARGET_COMPILER ) - # Detect compiler - if (GENERATOR STREQUAL "nmake") - message(STATUS "Using generator NMAKE") - find_program(NMAKE nmake REQUIRED) - elseif (GENERATOR STREQUAL "make") - message(STATUS "Using generator make") - find_program(MAKE make REQUIRED) - else() - message(FATAL_ERROR "${GENERATOR} not supported.") + 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) - vcpkg_find_acquire_program(YASM) - vcpkg_find_acquire_program(PERL) - set(MSYS_REQUIRE_PACKAGES diffutils) + # 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) - set(MSYS_REQUIRE_PACKAGES ${MSYS_REQUIRE_PACKAGES} autoconf automake m4 libtool perl) + list(APPEND MSYS_REQUIRE_PACKAGES autoconf + autoconf-archive + automake + m4 + ) endif() vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) - get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") + 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") + endif() - if (NOT _csc_DISABLE_AUTO_HOST) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(WIN_TARGET_ARCH --host=i686-pc-mingw32) - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(WIN_TARGET_ARCH --host=i686-pc-mingw64) - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(WIN_TARGET_ARCH --host=arm-pc-mingw32) + macro(_vcpkg_append_to_configure_environment inoutstring var defaultval) + # Allows to overwrite settings in custom triplets via the enviromnent + if(ENV{${var}}) + string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") + else() + string(APPEND ${inoutstring} " ${var}='${defaultval}'") endif() - endif() - set(WIN_TARGET_COMPILER CC=cl) - set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}") - set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - elseif (_csc_AUTOCONFIG) - find_program(autoreconf autoreconf REQUIRED) - 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") + _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 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") + # 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") + + # 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. + # CXXCOMPILE The command used to actually compile a C++ source file. The file name is appended to form the complete command line. + # CXXLINK The command used to actually link a C++ program. - if (NOT _csc_NO_DEBUG) - file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + #Some PATH handling for dealing with spaces....some tools will still fail with that! + string(REPLACE " " "\\\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR}) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PREFIX "${_VCPKG_PREFIX}") + set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) + 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}) + set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile! else() - file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") + string(REPLACE " " "\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR}) + string(REPLACE " " "\ " _VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) + set(_VCPKG_INSTALLED_PKGCONF ${CURRENT_INSTALLED_DIR}) + set(EXTRA_QUOTES) + set(prefix_var "\${prefix}") endif() - if (NOT _csc_DISABLE_AUTO_DST) - set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} - --prefix=${CURRENT_PACKAGES_DIR} - --bindir=${CURRENT_PACKAGES_DIR}/bin - --sbindir=${CURRENT_PACKAGES_DIR}/bin - --libdir=${CURRENT_PACKAGES_DIR}/lib - --includedir=${CURRENT_PACKAGES_DIR}/include) + # Cleanup previous build dirs + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + "${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}" + # Important: These should all be relative to prefix! + "--bindir=${prefix_var}/tools/${PORT}/bin" + "--sbindir=${prefix_var}/tools/${PORT}/sbin" + #"--libdir='\${prefix}'/lib" # already the default! + #"--includedir='\${prefix}'/include" # already the default! + "--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}" + # 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}") - set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} - --prefix=${CURRENT_PACKAGES_DIR}/debug - --bindir=${CURRENT_PACKAGES_DIR}/debug/bin - --sbindir=${CURRENT_PACKAGES_DIR}/debug/bin - --libdir=${CURRENT_PACKAGES_DIR}/debug/lib - --includedir=${CURRENT_PACKAGES_DIR}/debug/include) + # Setup common options + 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() + else() + list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-static --disable-shared) endif() - set(base_cmd ) + file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") + + set(base_cmd) if(CMAKE_HOST_WIN32) - set(base_cmd ${BASH} --noprofile --norc -c) - - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(_csc_OPTIONS ${_csc_OPTIONS} --enable-shared) - if (VCPKG_TARGET_IS_UWP) - set(_csc_OPTIONS ${_csc_OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) - endif() - else() - set(_csc_OPTIONS ${_csc_OPTIONS} --enable-static) - endif() + set(base_cmd ${BASH} --noprofile --norc --debug) # Load toolchains if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") endif() include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - - set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") - set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") - set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS}") - 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) - - set(rel_command - ${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}" - ) - set(dbg_command - ${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}" - ) - else() - set(base_cmd ./) - set(rel_command - ${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_RELEASE}" - ) - set(dbg_command - ${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_DEBUG}" - ) endif() - # Configure debug - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT _csc_NO_DEBUG) - if (CMAKE_HOST_WIN32) - unset(ENV{CFLAGS}) - unset(ENV{CXXFLAGS}) - unset(ENV{LDFLAGS}) - set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}") - string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}") - set(ENV{CFLAGS} ${TMP_CFLAGS}) - set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}") - set(ENV{CXXFLAGS} ${TMP_CXXFLAGS}) - set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL}") - string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}") - set(ENV{LDFLAGS} ${TMP_LDFLAGS}) + # 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 -> TODO: Further improve with toolchain file in mind! + 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 + 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() - - set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH}) - - file(MAKE_DIRECTORY ${OBJ_DIR}) - - if (NOT CMAKE_HOST_WIN32) - file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*) - foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES}) - get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH) - string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}") - file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR}) - endforeach() + 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}) + endif() + + set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") - if (_csc_PRERUN_SHELL) - message(STATUS "Prerun shell with ${TARGET_TRIPLET}-dbg") + # 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) + 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\")") + endif() + message(STATUS "Generating configure for ${TARGET_TRIPLET}") + if (CMAKE_HOST_WIN32) vcpkg_execute_required_process( - COMMAND ${base_cmd}${_csc_PRERUN_SHELL} - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME prerun-${TARGET_TRIPLET}-dbg + COMMAND ${base_cmd} -c "autoreconf -vfi" + WORKING_DIRECTORY "${SRC_DIR}" + LOGNAME autoconf-${TARGET_TRIPLET} + ) + else() + vcpkg_execute_required_process( + COMMAND autoreconf -vfi + WORKING_DIRECTORY "${SRC_DIR}" + LOGNAME autoconf-${TARGET_TRIPLET} ) endif() - - if (_csc_AUTOCONFIG) - message(STATUS "Generating configure with ${TARGET_TRIPLET}-dbg") - if (CMAKE_HOST_WIN32) - vcpkg_execute_required_process( - COMMAND ${base_cmd} autoreconf -vfi - WORKING_DIRECTORY ${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH} - LOGNAME prerun-${TAR_TRIPLET_DIR} - ) - else() - vcpkg_execute_required_process( - COMMAND autoreconf -vfi - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME prerun-${TAR_TRIPLET_DIR} - ) - endif() - endif() - - if (NOT _csc_SKIP_CONFIGURE) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + message(STATUS "Finished generating configure for ${TARGET_TRIPLET}") + endif() + if(REQUIRES_AUTOGEN) + message(STATUS "Generating configure for ${TARGET_TRIPLET} via autogen.sh") + if (CMAKE_HOST_WIN32) vcpkg_execute_required_process( - COMMAND ${dbg_command} - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME config-${TARGET_TRIPLET}-dbg + COMMAND ${base_cmd} -c "./autogen.sh" + WORKING_DIRECTORY "${SRC_DIR}" + LOGNAME autoconf-${TARGET_TRIPLET} + ) + else() + vcpkg_execute_required_process( + COMMAND "./autogen.sh" + WORKING_DIRECTORY "${SRC_DIR}" + LOGNAME autoconf-${TARGET_TRIPLET} ) endif() + message(STATUS "Finished generating configure for ${TARGET_TRIPLET}") endif() - # Configure release - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - if (CMAKE_HOST_WIN32) - unset(ENV{CFLAGS}) - unset(ENV{CXXFLAGS}) - unset(ENV{LDFLAGS}) - set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}") - string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}") - set(ENV{CFLAGS} ${TMP_CFLAGS}) - - set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}") - set(ENV{CXXFLAGS} ${TMP_CXXFLAGS}) - - set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") - string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}") - set(ENV{LDFLAGS} ${TMP_LDFLAGS}) + if (_csc_PRERUN_SHELL) + message(STATUS "Prerun shell with ${TARGET_TRIPLET}") + vcpkg_execute_required_process( + COMMAND ${base_cmd} -c "${_csc_PRERUN_SHELL}" + WORKING_DIRECTORY "${SRC_DIR}" + LOGNAME prerun-${TARGET_TRIPLET} + ) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT _csc_NO_DEBUG) + set(_VAR_SUFFIX DEBUG) + set(PATH_SUFFIX_${_VAR_SUFFIX} "/debug") + 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]+/" " -" 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(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}}") endif() - - if (_csc_NO_DEBUG) - set(TAR_TRIPLET_DIR ${TARGET_TRIPLET}) - set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR}) + unset(_VAR_SUFFIX) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(_VAR_SUFFIX RELEASE) + 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 + 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(TAR_TRIPLET_DIR ${TARGET_TRIPLET}-rel) - set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR}) + 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}}") endif() - set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH}) - - file(MAKE_DIRECTORY ${OBJ_DIR}) - - if (NOT CMAKE_HOST_WIN32) - file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*) - foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES}) - get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH) - string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}") - file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR}) - endforeach() + unset(_VAR_SUFFIX) + endif() + + foreach(_buildtype IN LISTS _buildtypes) + 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}") + + if(_csc_COPY_SOURCE) + file(COPY "${SRC_DIR}/" DESTINATION "${TAR_DIR}") + set(RELATIVE_BUILD_PATH .) endif() - - if (_csc_PRERUN_SHELL) - message(STATUS "Prerun shell with ${TAR_TRIPLET_DIR}") - vcpkg_execute_required_process( - COMMAND ${base_cmd}${_csc_PRERUN_SHELL} - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME prerun-${TAR_TRIPLET_DIR} - ) + + set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_buildtype}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") + + if(ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}") endif() - - if (_csc_AUTOCONFIG) - message(STATUS "Generating configure with ${TAR_TRIPLET_DIR}") - if (CMAKE_HOST_WIN32) - vcpkg_execute_required_process( - COMMAND ${base_cmd} autoreconf -vfi - WORKING_DIRECTORY ${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH} - LOGNAME prerun-${TAR_TRIPLET_DIR} - ) - else() - vcpkg_execute_required_process( - COMMAND autoreconf -vfi - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME prerun-${TAR_TRIPLET_DIR} - ) - endif() + + # Setup enviromnent + 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{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}}") + else() + set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) endif() - + if (NOT _csc_SKIP_CONFIGURE) - message(STATUS "Configuring ${TAR_TRIPLET_DIR}") + message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") vcpkg_execute_required_process( - COMMAND ${rel_command} - WORKING_DIRECTORY ${PRJ_DIR} - LOGNAME config-${TAR_TRIPLET_DIR} + COMMAND ${command} + WORKING_DIRECTORY "${TAR_DIR}" + LOGNAME config-${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}} ) + if(EXISTS "${TAR_DIR}/libtool" AND VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(_file "${TAR_DIR}/libtool") + file(READ "${_file}" _contents) + string(REPLACE ".dll.lib" ".lib" _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") + endif() endif() - endif() - - # Restore envs - if (CMAKE_HOST_WIN32) - set(ENV{CFLAGS} "${C_FLAGS_GLOBAL}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL}") - set(ENV{LDFLAGS} "${LD_FLAGS_GLOBAL}") - endif() - - set(_VCPKG_MAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) - set(_VCPKG_NO_DEBUG ${_csc_NO_DEBUG} PARENT_SCOPE) + + if(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}) + set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}}") + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() + unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}) + 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}") 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_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index 4e9f642b5b4961..12154d91c4d94d 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -39,7 +39,7 @@ function(vcpkg_copy_pdbs) set(${OUTVAR} ${MSG} PARENT_SCOPE) endfunction() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND NOT VCPKG_TARGET_IS_MINGW) file(GLOB_RECURSE DLLS ${_vcp_BUILD_PATHS}) set(DLLS_WITHOUT_MATCHING_PDBS) diff --git a/scripts/cmake/vcpkg_copy_tools.cmake b/scripts/cmake/vcpkg_copy_tools.cmake new file mode 100644 index 00000000000000..9651b5357812db --- /dev/null +++ b/scripts/cmake/vcpkg_copy_tools.cmake @@ -0,0 +1,56 @@ +## # vcpkg_copy_tools +## +## Copy tools and all their DLL dependencies into the `tools` folder. +## +## ## Usage +## ```cmake +## vcpkg_copy_tools( +## TOOL_NAMES ... +## [SEARCH_DIR <${CURRENT_PACKAGES_DIR}/bin>] +## [AUTO_CLEAN] +## ) +## ``` +## ## Parameters +## ### TOOL_NAMES +## A list of tool filenames without extension. +## +## ### SEARCH_DIR +## The path to the directory containing the tools. This will be set to `${CURRENT_PACKAGES_DIR}/bin` if ommited. +## +## ### AUTO_CLEAN +## Auto clean executables in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. +## +## ## Examples +## +## * [cpuinfo](https://github.com/microsoft/vcpkg/blob/master/ports/cpuinfo/portfile.cmake) +## * [nanomsg](https://github.com/microsoft/vcpkg/blob/master/ports/nanomsg/portfile.cmake) +## * [uriparser](https://github.com/microsoft/vcpkg/blob/master/ports/uriparser/portfile.cmake) +function(vcpkg_copy_tools) + cmake_parse_arguments(_vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES" ${ARGN}) + + if(NOT DEFINED _vct_TOOL_NAMES) + message(FATAL_ERROR "TOOL_NAMES must be specified.") + endif() + + if(NOT DEFINED _vct_SEARCH_DIR) + set(_vct_SEARCH_DIR ${CURRENT_PACKAGES_DIR}/bin) + elseif(NOT IS_DIRECTORY ${_vct_SEARCH_DIR}) + message(FATAL_ERROR "SEARCH_DIR ${_vct_SEARCH_DIR} is supposed to be a directory.") + endif() + + foreach(tool_name ${_vct_TOOL_NAMES}) + set(tool_path "${_vct_SEARCH_DIR}/${tool_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + + if(EXISTS ${tool_path}) + file(COPY ${tool_path} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + else() + message(FATAL_ERROR "Couldn't find this tool: ${tool_path}.") + endif() + endforeach() + + if(_vct_AUTO_CLEAN) + vcpkg_clean_executables_in_bin(FILE_NAMES ${_vct_TOOL_NAMES}) + endif() + + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +endfunction() diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 8a8efd205fd3fe..6ad0738039ed50 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -47,7 +47,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) + set(options SKIP_SHA512 SILENT_EXIT) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS HEADERS) cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) @@ -171,18 +171,31 @@ function(vcpkg_download_distfile VAR) endforeach(url) endif() - if (NOT download_success) - message(FATAL_ERROR - " \n" - " Failed to download file.\n" - " If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment\n" - " variables to \"https://user:password@your-proxy-ip-address:port/\".\n" - " Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + if (NOT vcpkg_download_distfile_SILENT_EXIT) + if (NOT download_success) + message(FATAL_ERROR + " \n" + " Failed to download file.\n" + " If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment\n" + " variables to \"https://user:password@your-proxy-ip-address:port/\".\n" + " Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + else() + test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME ${download_file_path_part} ${downloaded_file_path}) + endif() else() - test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") - get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) - file(MAKE_DIRECTORY "${downloaded_file_dir}") - file(RENAME ${download_file_path_part} ${downloaded_file_path}) + if (NOT download_success) + message(WARNING + " \n" + " Failed to download file.\n") + else() + test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME ${download_file_path_part} ${downloaded_file_path}) + endif() endif() endif() set(${VAR} ${downloaded_file_path} PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index 9da6cec9f57baa..67607d768685a7 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -61,8 +61,11 @@ 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 out_contents MATCHES "Cannot create parent directory" + # Multiple threads using the same directory at the same time cause conflicts, will try again. + ) 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_extract_source_archive_ex.cmake b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake index 67916d09df300c..9ce5047a2db682 100644 --- a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake @@ -101,9 +101,16 @@ function(vcpkg_extract_source_archive_ex) string(SHA512 PATCHSET_HASH ${PATCHSET_HASH}) string(SUBSTRING ${PATCHSET_HASH} 0 10 PATCHSET_HASH) set(SOURCE_PATH "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}") + if (NOT _VCPKG_EDITABLE) + string(APPEND SOURCE_PATH ".clean") + if(EXISTS ${SOURCE_PATH}) + message(STATUS "Cleaning sources at ${SOURCE_PATH}. Use --editable to skip cleaning for the packages you specify.") + file(REMOVE_RECURSE ${SOURCE_PATH}) + endif() + endif() if(NOT EXISTS ${SOURCE_PATH}) - set(TEMP_DIR "${_vesae_WORKING_DIRECTORY}/TEMP") + set(TEMP_DIR "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}.tmp") file(REMOVE_RECURSE ${TEMP_DIR}) vcpkg_extract_source_archive("${_vesae_ARCHIVE}" "${TEMP_DIR}") diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index c7fbe0f8479999..8b006990a5e5c2 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -25,6 +25,7 @@ ## - PYTHON2 ## - PYTHON3 ## - GIT +## - GN ## - GO ## - JOM ## - MESON @@ -32,6 +33,7 @@ ## - NINJA ## - NUGET ## - SCONS +## - SWIG ## - YASM ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). @@ -55,14 +57,20 @@ function(vcpkg_find_acquire_program VAR) unset(POST_INSTALL_COMMAND) vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS) - vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) + set(PROGRAM_FILES_32_BIT $ENV{ProgramFiles\(X86\)}) + if (NOT DEFINED PROGRAM_FILES_32_BIT) + set(PROGRAM_FILES_32_BIT $ENV{PROGRAMFILES}) + endif() if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) set(BREW_PACKAGE_NAME "perl") set(APT_PACKAGE_NAME "perl") - set(URL "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip") + 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" + ) set(ARCHIVE "strawberry-perl-5.30.0.1-32bit.zip") set(HASH d353d3dc743ebdc6d1e9f6f2b7a6db3c387c1ce6c890bae8adc8ae5deae8404f4c5e3cf249d1e151e7256d4c5ee9cd317e6c41f3b6f244340de18a24b938e0c4) elseif(VAR MATCHES "NASM") @@ -90,17 +98,40 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "GIT") set(PROGNAME git) if(CMAKE_HOST_WIN32) - set(SUBDIR "git-2.25.1-1-windows") - set(URL "https://github.com/git-for-windows/git/releases/download/v2.25.1.windows.1/PortableGit-2.25.1-32-bit.7z.exe") - set(ARCHIVE "PortableGit-2.25.1-32-bit.7z.exe") - set(HASH 222d6e384ecae5841cb02dc004c4b3f56659d19b662bc93ab531df844c9477c9717c4a1adfb8bc2d3159678238fa4c79ccbdcb5c116eea5eccd652f4b483359e) - set(PATHS + 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(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36) + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin" "${DOWNLOADS}/tools/git/${SUBDIR}/mingw32/bin") else() set(BREW_PACKAGE_NAME "git") set(APT_PACKAGE_NAME "git") endif() + elseif(VAR MATCHES "GN") + set(PROGNAME gn) + set(_vfa_RENAME "gn") + set(CIPD_DOWNLOAD_GN "https://chrome-infra-packages.appspot.com/dl/gn/gn") + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(_vfa_SUPPORTED ON) + set(GN_VERSION "xus7xtaPhpv5vCmKFOnsBVoB-PKmhZvRsSTjbQAuF0MC") + set(GN_PLATFORM "linux-amd64") + set(HASH "871e75d7f3597b74fb99e36bb41fe5a9f8ce8a4d9f167f4729fc6e444807a59f35ec8aca70c2274a99c79d70a1108272be1ad991678a8ceb39e30f77abb13135") + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_vfa_SUPPORTED ON) + set(GN_VERSION "qhxILDNcJ2H44HfHmfiU-XIY3E_SIXvFqLd2wvbIgOoC") + set(GN_PLATFORM "mac-amd64") + set(HASH "03ee64cb15bae7fceb412900d470601090bce147cfd45eb9b46683ac1a5dca848465a5d74c55a47df7f0e334d708151249a6d37bb021de74dd48b97ed4a07937") + else() + set(GN_VERSION "qUkAhy9J0P7c5racy-9wB6AHNK_btS18im8S06_ehhwC") + set(GN_PLATFORM "windows-amd64") + 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) @@ -113,18 +144,18 @@ function(vcpkg_find_acquire_program VAR) if(CMAKE_HOST_WIN32) set(PROGNAME python) if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(SUBDIR "python-3.7.3-x86") - set(URL "https://www.python.org/ftp/python/3.7.3/python-3.7.3-embed-win32.zip") - set(ARCHIVE "python-3.7.3-embed-win32.zip") - set(HASH 2c1b1f0a29d40a91771ae21a5f733eedc10984cd182cb10c2793bbd24191a89f20612a3f23c34047f37fb06369016bfd4a52915ed1b4a56f8bd2b4ca6994eb31) + 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(HASH 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a) else() - set(SUBDIR "python-3.7.3-x64") - set(URL "https://www.python.org/ftp/python/3.7.3/python-3.7.3-embed-amd64.zip") - set(ARCHIVE "python-3.7.3-embed-amd64.zip") - set(HASH 4b3e0067b5e8d00b1cac5d556ab4fbd71df2a1852afb3354ee62363aabc8801aca84da09dbd26125527ae54b50488f808c1d82abf18969c23a51dcd57576885f) + 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(HASH a322fc925167edb1897764297cf47e294ad3f52c109a05f8911412807eb83e104f780e9fe783b17fe0d9b18b7838797c15e9b0805dab759829f77a9bc0159424) endif() set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) - set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E remove python37._pth) + set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E remove python38._pth) else() set(PROGNAME python3) set(BREW_PACKAGE_NAME "python") @@ -160,8 +191,8 @@ 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" + 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(ARCHIVE "jom_1_1_3.zip") @@ -174,9 +205,10 @@ function(vcpkg_find_acquire_program VAR) set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) - set(SUBDIR "ninja-1.8.2") + set(SUBDIR "ninja-1.10.0") if(CMAKE_HOST_WIN32) - set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-windows") + list(APPEND PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") @@ -186,62 +218,66 @@ function(vcpkg_find_acquire_program VAR) endif() set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") - set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip") - set(ARCHIVE "ninja-win-1.8.2.zip") - set(HASH 9b9ce248240665fcd6404b989f3b3c27ed9682838225e6dc9b67b551774f251e4ff8a207504f941e7c811e7a8be1945e7bcb94472a335ef15e23a0200a32e6d5) + 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) elseif(VAR MATCHES "NUGET") set(PROGNAME nuget) - set(PATHS "${DOWNLOADS}/tools/nuget") + set(SUBDIR "5.5.1") + set(PATHS "${DOWNLOADS}/tools/nuget/${SUBDIR}") set(BREW_PACKAGE_NAME "nuget") - set(URL "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe") - set(ARCHIVE "nuget.exe") + set(URL "https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe") + set(_vfa_RENAME "nuget.exe") + set(ARCHIVE "nuget.5.5.1.exe") set(NOEXTRACT ON) - set(HASH 42cb744338af8decc033a75bce5b4c4df28e102bafc45f9a8ba86d7bc010f5b43ebacae80d7b28c4f85ac900eefc2a349620ae65f27f6ca1c21c53b63b92924b) + set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) elseif(VAR MATCHES "MESON") - 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) + if(NOT CMAKE_HOST_APPLE) + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + 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) else() - set(SCRIPTNAME meson) + set(PROGNAME meson) + set(BREW_PACKAGE_NAME "meson") endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.53.2) - set(URL "https://github.com/mesonbuild/meson/archive/0.53.2.zip") - set(ARCHIVE "meson-0.53.2.zip") - set(HASH 86c3347395528d2358c9514a76ec8a60908f8abadece5ecb9bac633ea735d4b40a27683002db017f06fa48ec68ea1bfe64d216fa17a54d6d42c8bc45f55606b2) - elseif(VAR MATCHES "FLEX") + elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") if(CMAKE_HOST_WIN32) - set(PROGNAME win_flex) - set(SUBDIR win_flex-2.5.16) - set(PATHS ${DOWNLOADS}/tools/win_flex/${SUBDIR}) - set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download") - set(ARCHIVE "win_flex_bison-2.5.16.zip") - set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123) + set(SOURCEFORGE_ARGS + REPO winflexbison + FILENAME winflexbison-2.5.16.zip + SHA512 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123 + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/winflexbison" + ) + if(VAR MATCHES "FLEX") + set(PROGNAME win_flex) + else() + set(PROGNAME win_bison) + endif() + set(PATHS ${DOWNLOADS}/tools/winflexbison/0a14154bff-a8cf65db07) if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4") file(REMOVE_RECURSE "${PATHS}") endif() - else() + elseif(VAR MATCHES "FLEX") set(PROGNAME flex) set(APT_PACKAGE_NAME flex) set(BREW_PACKAGE_NAME flex) - endif() - elseif(VAR MATCHES "BISON") - if(CMAKE_HOST_WIN32) - set(PROGNAME win_bison) - set(SUBDIR win_bison-2.5.16) - set(PATHS ${DOWNLOADS}/tools/win_bison/${SUBDIR}) - set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download") - set(ARCHIVE "win_flex_bison-2.5.16.zip") - set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123) - if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4") - file(REMOVE_RECURSE "${PATHS}") - endif() else() set(PROGNAME bison) set(APT_PACKAGE_NAME bison) set(BREW_PACKAGE_NAME bison) + if (APPLE) + set(PATHS /usr/local/opt/bison/bin) + endif() endif() elseif(VAR MATCHES "GPERF") set(PROGNAME gperf) @@ -274,7 +310,32 @@ function(vcpkg_find_acquire_program VAR) 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(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 "swigwin-${VERSION}") + set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}") + 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 + 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) @@ -298,12 +359,12 @@ function(vcpkg_find_acquire_program VAR) 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(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(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(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(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53) endif() @@ -320,10 +381,12 @@ function(vcpkg_find_acquire_program VAR) macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + find_program(${VAR} ${PROGNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + find_program(${VAR} ${PROGNAME}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) - find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS}) + find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + find_file(SCRIPT_${VAR} ${SCRIPTNAME}) set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) endif() endmacro() @@ -340,41 +403,48 @@ function(vcpkg_find_acquire_program VAR) message(FATAL_ERROR "Could not find ${PROGNAME}. Please install it via your package manager${EXAMPLE}") endif() - vcpkg_download_distfile(ARCHIVE_PATH - URLS ${URL} - SHA512 ${HASH} - FILENAME ${ARCHIVE} - ) - - set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") - file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) - if(DEFINED NOEXTRACT) - if(DEFINED _vfa_RENAME) - file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - else() - file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - endif() + if(DEFINED SOURCEFORGE_ARGS) + # Locally change editable to suppress re-extraction each time + set(_VCPKG_EDITABLE 1) + vcpkg_from_sourceforge(OUT_SOURCE_PATH SFPATH ${SOURCEFORGE_ARGS}) + unset(_VCPKG_EDITABLE) else() - get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} LAST_EXT) - string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) - if(ARCHIVE_EXTENSION STREQUAL ".msi") - file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) - file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) - _execute_process( - COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} - WORKING_DIRECTORY ${DOWNLOADS} - ) - elseif("${ARCHIVE_PATH}" MATCHES ".7z.exe$") - vcpkg_find_acquire_program(7Z) - _execute_process( - COMMAND ${7Z} x "${ARCHIVE_PATH}" "-o${PROG_PATH_SUBDIR}" -y -bso0 -bsp0 - WORKING_DIRECTORY ${PROG_PATH_SUBDIR} - ) + vcpkg_download_distfile(ARCHIVE_PATH + URLS ${URL} + SHA512 ${HASH} + FILENAME ${ARCHIVE} + ) + + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") + file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) + if(DEFINED NOEXTRACT) + if(DEFINED _vfa_RENAME) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + else() + file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + endif() else() - _execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} - WORKING_DIRECTORY ${PROG_PATH_SUBDIR} - ) + get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} LAST_EXT) + string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) + if(ARCHIVE_EXTENSION STREQUAL ".msi") + file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) + file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) + _execute_process( + COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} + WORKING_DIRECTORY ${DOWNLOADS} + ) + elseif("${ARCHIVE_PATH}" MATCHES ".7z.exe$") + vcpkg_find_acquire_program(7Z) + _execute_process( + COMMAND ${7Z} x "${ARCHIVE_PATH}" "-o${PROG_PATH_SUBDIR}" -y -bso0 -bsp0 + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} + ) + else() + _execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} + ) + endif() endif() endif() diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index b2faa4abe3a0cf..0be2dfc5405e29 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -6,7 +6,7 @@ ## ## ## Usage ## ```cmake -## vcpkg_fixup_cmake_targets([CONFIG_PATH ] [TARGET_PATH ]) +## vcpkg_fixup_cmake_targets([CONFIG_PATH ] [TARGET_PATH ] [DO_NOT_DELETE_PARENT_CONFIG_PATH]) ## ``` ## ## ## Parameters @@ -22,6 +22,11 @@ ## ## Defaults to `share/${PORT}`. ## +## ### DO_NOT_DELETE_PARENT_CONFIG_PATH +## By default the parent directory of CONFIG_PATH is removed if it is named "cmake". +## Passing this option disable such behavior, as it is convenient for ports that install +## more than one CMake package configuration file. +## ## ## Notes ## Transform all `/debug//*targets-debug.cmake` files and move them to `/`. ## Removes all `/debug//*targets.cmake` and `/debug//*config.cmake`. @@ -38,7 +43,7 @@ ## * [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake) ## * [nlohmann-json](https://github.com/Microsoft/vcpkg/blob/master/ports/nlohmann-json/portfile.cmake) function(vcpkg_fixup_cmake_targets) - cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN}) + cmake_parse_arguments(_vfct "DO_NOT_DELETE_PARENT_CONFIG_PATH" "CONFIG_PATH;TARGET_PATH" "" ${ARGN}) if(_vfct_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") @@ -48,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}) @@ -85,13 +86,13 @@ function(vcpkg_fixup_cmake_targets) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) - if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT _vfct_DO_NOT_DELETE_PARENT_CONFIG_PATH) file(REMOVE_RECURSE ${DEBUG_CONFIG}) else() get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) - if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT _vfct_DO_NOT_DELETE_PARENT_CONFIG_PATH) file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) endif() endif() @@ -99,13 +100,13 @@ function(vcpkg_fixup_cmake_targets) get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG} NAME) string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) - if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake") + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT _vfct_DO_NOT_DELETE_PARENT_CONFIG_PATH) file(REMOVE_RECURSE ${RELEASE_CONFIG}) else() get_filename_component(RELEASE_CONFIG_PARENT_DIR ${RELEASE_CONFIG} DIRECTORY) get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG_PARENT_DIR} NAME) string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) - if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake") + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT _vfct_DO_NOT_DELETE_PARENT_CONFIG_PATH) file(REMOVE_RECURSE ${RELEASE_CONFIG_PARENT_DIR}) endif() endif() @@ -168,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 new file mode 100644 index 00000000000000..24302a6af91962 --- /dev/null +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -0,0 +1,369 @@ +## # vcpkg_fixup_pkgconfig +## +## Fix common paths in *.pc files and make everything relativ to $(prefix) +## +## ## Usage +## ```cmake +## vcpkg_fixup_pkgconfig( +## [RELEASE_FILES ...] +## [DEBUG_FILES ...] +## [SYSTEM_LIBRARIES ...] +## [IGNORE_FLAGS ] +## [SKIP_CHECK] +## ) +## ``` +## +## ## Parameters +## ### RELEASE_FILES +## Specifies a list of files to apply the fixes for release paths. +## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ +## +## ### DEBUG_FILES +## 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_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. +## +## ### 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_files pkg_cfg_cmd _file _config _system_libs _ignore_flags) + # Setup pkg-config paths + if(CMAKE_HOST_WIN32) + # Those replacements are probably only necessary since we use pkg-config from msys + 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}") + string(REPLACE " " "\ " _VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") + string(REPLACE "\\" "/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") + else() + set(_VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") + set(_VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") + endif() + + 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}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${PKGCONFIG_PACKAGES_SHARE_DIR}:$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${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}'") + 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(lib_suffixes d _d _debug -s -sd _s _sd -static -staticd _static _staticd) + elseif("${_config}" STREQUAL "RELEASE") + set(lib_suffixes -s _s -static _static) + else() + message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") + endif() + + 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() + + 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(.+)$") + 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("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() + 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() + 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() + endforeach() + + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) +endfunction() + +function(vcpkg_fixup_pkgconfig) + 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() + + if(_vfpkg_NOT_STATIC_PKGCONFIG) + set(PKGCONFIG_STATIC) + else() + set(PKGCONFIG_STATIC --static) + endif() + + message(STATUS "Fixing pkgconfig") + if(_vfpkg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") + endif() + + 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/") + 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() + + if(NOT PKGCONFIG) + find_program(PKGCONFIG pkg-config PATHS "bin" "/usr/bin" "/usr/local/bin") + if(NOT PKGCONFIG AND CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) + find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) + endif() + debug_message("Using pkg-config from: ${PKGCONFIG}") + if(NOT PKGCONFIG AND NOT _vfpkg_SKIP_CHECK) + message(WARNING "Unable to find pkg-config to validate *.pc files. Skipping checkes!") + set(_vfpkg_SKIP_CHECK TRUE) + endif() + endif() + + #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}") + foreach(_file ${_vfpkg_RELEASE_FILES}) + message(STATUS "Checking 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}") + #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 + string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + file(WRITE "${_file}" "${_contents}") + unset(PKG_LIB_SEARCH_PATH) + endforeach() + + 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() + + message(STATUS "Fixing pkgconfig - debug") + debug_message("Files: ${_vfpkg_DEBUG_FILES}") + foreach(_file ${_vfpkg_DEBUG_FILES}) + message(STATUS "Checking 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(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. + file(WRITE "${_file}" "${_contents}") + unset(PKG_LIB_SEARCH_PATH) + endforeach() + + 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() + message(STATUS "Fixing pkgconfig --- finished") + + set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) + # Variable to check if this function has been called! + # Theoreotically vcpkg could look for *.pc files and automatically call this function + # or check if this function has been called if *.pc files are detected. + # The same is true for vcpkg_fixup_cmake_targets +endfunction() + + + # script to test the function locally without running vcpkg. Uncomment fix filepaths and use cmake -P vcpkg_fixup_pkgconfig + # set(_file "G:\\xlinux\\packages\\xlib_x64-windows\\lib\\pkgconfig\\x11.pc") + # include(${CMAKE_CURRENT_LIST_DIR}/vcpkg_common_definitions.cmake) + # file(READ "${_file}" _contents) + # set(CURRENT_INSTALLED_DIR "G:/xlinux/installed/x64-windows") + # set(CURRENT_PACKAGES_DIR "G:/xlinux/packages/xlib_x64-windows") + # set(_vfpkg_SYSTEM_LIBRARIES "blu\\ ub") + # set(_vfpkg_SYSTEM_PACKAGES "szip") + # vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") 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 new file mode 100644 index 00000000000000..34b2a12b098acc --- /dev/null +++ b/scripts/cmake/vcpkg_from_sourceforge.cmake @@ -0,0 +1,200 @@ +## # vcpkg_from_sourceforge +## +## Download and extract a project from sourceforge. +## +## ## Usage: +## ```cmake +## vcpkg_from_sourceforge( +## OUT_SOURCE_PATH SOURCE_PATH +## REPO +## [REF <2.1-3>] +## SHA512 <547b417109332...> +## FILENAME +## [DISABLE_SSL] +## [NO_REMOVE_ONE_LEVEL] +## [PATCHES ...] +## ) +## ``` +## +## ## Parameters: +## ### OUT_SOURCE_PATH +## Specifies the out-variable that will contain the extracted location. +## +## This should be set to `SOURCE_PATH` by convention. +## +## ### REPO +## The organization or user and repository (optional) on sourceforge. +## +## ### REF +## A stable version number that will not change contents. +## +## ### FILENAME +## The local name for the file. Files are shared between ports, so the file may need to be renamed to make it clearly attributed to this port and avoid conflicts. +## +## For example, we can get the download link: +## https://sourceforge.net/settings/mirror_choices?projectname=mad&filename=libmad/0.15.1b/libmad-0.15.1b.tar.gz&selected=nchc +## So the REPO is `mad/libmad`, the REF is `0.15.1b`, and the FILENAME is `libmad-0.15.1b.tar.gz` +## +## For some special links: +## https://sourceforge.net/settings/mirror_choices?projectname=soxr&filename=soxr-0.1.3-Source.tar.xz&selected=nchc +## The REPO is `soxr`, REF is not exist, and the FILENAME is `soxr-0.1.3-Source.tar.xz` +## +## ### SHA512 +## The SHA512 hash that should match the archive. +## +## ### WORKING_DIRECTORY +## If specified, the archive will be extracted into the working directory instead of `${CURRENT_BUILDTREES_DIR}/src/`. +## +## Note that the archive will still be extracted into a subfolder underneath that directory (`${WORKING_DIRECTORY}/${REF}-${HASH}/`). +## +## ### PATCHES +## A list of patches to be applied to the extracted sources. +## +## Relative paths are based on the port directory. +## +## ### DISABLE_SSL +## Disable ssl when downloading source. +## +## ### NO_REMOVE_ONE_LEVEL +## Specifies that the default removal of the top level folder should not occur. +## +## ## Examples: +## +## * [cunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cunit/portfile.cmake) +## * [polyclipping](https://github.com/Microsoft/vcpkg/blob/master/ports/polyclipping/portfile.cmake) +## * [tinyfiledialogs](https://github.com/Microsoft/vcpkg/blob/master/ports/tinyfiledialogs/portfile.cmake) + +function(vcpkg_from_sourceforge) + set(booleanValueArgs DISABLE_SSL NO_REMOVE_ONE_LEVEL) + set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 FILENAME WORKING_DIRECTORY) + set(multipleValuesArgs PATCHES) + cmake_parse_arguments(_vdus "${booleanValueArgs}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + + if(NOT DEFINED _vdus_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if(NOT DEFINED _vdus_SHA512) + message(FATAL_ERROR "SHA512 must be specified.") + endif() + + if(NOT DEFINED _vdus_REPO) + message(FATAL_ERROR "The sourceforge repository must be specified.") + endif() + + if(DEFINED _vdus_WORKING_DIRECTORY) + set(WORKING_DIRECTORY WORKING_DIRECTORY "${_vdus_WORKING_DIRECTORY}") + else() + set(WORKING_DIRECTORY) + endif() + + if (_vdus_DISABLE_SSL) + set(URL_PROTOCOL http:) + else() + set(URL_PROTOCOL https:) + endif() + + set(SOURCEFORGE_HOST ${URL_PROTOCOL}//sourceforge.net/projects) + + string(FIND ${_vdus_REPO} "/" FOUND_ORG) + if (NOT FOUND_ORG EQUAL -1) + string(SUBSTRING "${_vdus_REPO}" 0 ${FOUND_ORG} ORG_NAME) + math(EXPR FOUND_ORG "${FOUND_ORG} + 1") # skip the slash + string(SUBSTRING "${_vdus_REPO}" ${FOUND_ORG} -1 REPO_NAME) + if (REPO_NAME MATCHES "/") + message(FATAL_ERROR "REPO should contain at most one slash (found ${_vdus_REPO}).") + endif() + set(ORG_NAME ${ORG_NAME}/) + else() + set(ORG_NAME ${_vdus_REPO}/) + set(REPO_NAME ) + endif() + + if (DEFINED _vdus_REF) + set(URL "${SOURCEFORGE_HOST}/${ORG_NAME}files/${REPO_NAME}/${_vdus_REF}/${_vdus_FILENAME}") + else() + set(URL "${SOURCEFORGE_HOST}/${ORG_NAME}${REPO_NAME}/files/${_vdus_FILENAME}") + endif() + + set(NO_REMOVE_ONE_LEVEL ) + if (_vdus_NO_REMOVE_ONE_LEVEL) + set(NO_REMOVE_ONE_LEVEL "NO_REMOVE_ONE_LEVEL") + endif() + + string(SUBSTRING "${_vdus_SHA512}" 0 10 SANITIZED_REF) + + list(APPEND SOURCEFORGE_MIRRORS + cfhcable # United States + pilotfiber # New York, NY + gigenet # Chicago, IL + versaweb # Las Vegas, NV + ayera # Modesto, CA + netactuate # Durham, NC + phoenixnap # Tempe, AZ + astuteinternet # Vancouver, BC + freefr # Paris, France + netcologne # Cologne, Germany + deac-riga # Latvia + excellmedia # Hyderabad, India + iweb # Montreal, QC + jaist # Nomi, Japan + jztkft # Mezotur, Hungary + managedway # Detroit, MI + nchc # Taipei, Taiwan + netix # Bulgaria + ufpr # Curitiba, Brazil + tenet # Wynberg, South Africa + ) + + # Try to use auto-select first + set(DOWNLOAD_URL ${URL}/download) + message(STATUS "Trying auto-select mirror...") + vcpkg_download_distfile(ARCHIVE + URLS "${DOWNLOAD_URL}" + SHA512 "${_vdus_SHA512}" + FILENAME "${_vdus_FILENAME}" + SILENT_EXIT + ) + + if (EXISTS ${ARCHIVE}) + set(download_success 1) + endif() + + if (NOT download_success EQUAL 1) + foreach(SOURCEFORGE_MIRROR ${SOURCEFORGE_MIRRORS}) + set(DOWNLOAD_URL ${URL}/download?use_mirror=${SOURCEFORGE_MIRROR}) + message(STATUS "Trying mirror ${SOURCEFORGE_MIRROR}...") + vcpkg_download_distfile(ARCHIVE + URLS "${DOWNLOAD_URL}" + SHA512 "${_vdus_SHA512}" + FILENAME "${_vdus_FILENAME}" + SILENT_EXIT + ) + + if (EXISTS ${ARCHIVE}) + set(download_success 1) + break() + endif() + endforeach() + endif() + + if (NOT download_success) + message(FATAL_ERROR [[ + Couldn't download source from any of the sourceforge mirrors, please check your network. + If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment + variables to "http[s]://user:password@your-proxy-ip-address:port/". + Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues + ]]) + endif() + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${SANITIZED_REF}" + ${NO_REMOVE_ONE_LEVEL} + ${WORKING_DIRECTORY} + PATCHES ${_vdus_PATCHES} + ) + + set(${_vdus_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake deleted file mode 100644 index 6f434547399c6b..00000000000000 --- a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake +++ /dev/null @@ -1,10 +0,0 @@ -function(vcpkg_get_program_files_32_bit ret) - - set(ret_temp $ENV{ProgramFiles\(X86\)}) - if (NOT DEFINED ret_temp) - set(ret_temp $ENV{PROGRAMFILES}) - endif() - - set(${ret} ${ret_temp} PARENT_SCOPE) - -endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_install_gn.cmake b/scripts/cmake/vcpkg_install_gn.cmake new file mode 100644 index 00000000000000..29a87a6cd2ab51 --- /dev/null +++ b/scripts/cmake/vcpkg_install_gn.cmake @@ -0,0 +1,97 @@ +## # vcpkg_install_gn +## +## Installs a GN project +## +## ## Usage: +## ```cmake +## vcpkg_install_gn( +## SOURCE_PATH +## [TARGETS ...] +## ) +## ``` +## +## ## Parameters: +## ### SOURCE_PATH +## The path to the source directory +## +## ### TARGETS +## Only install the specified targets. +## +## Note: includes must be handled separately + +function(vcpkg_install_gn) + cmake_parse_arguments(_vig "" "SOURCE_PATH" "TARGETS" ${ARGN}) + + if(NOT DEFINED _vig_SOURCE_PATH) + message(FATAL_ERROR "SOURCE_PATH must be specified.") + endif() + + vcpkg_build_ninja(TARGETS ${_vig_TARGETS}) + + vcpkg_find_acquire_program(GN) + + function(gn_get_target_type OUT_VAR BUILD_DIR TARGET) + execute_process( + COMMAND ${GN} desc "${BUILD_DIR}" "${TARGET}" + WORKING_DIRECTORY "${_vig_SOURCE_PATH}" + OUTPUT_VARIABLE OUTPUT_ + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX MATCH "type: ([A-Za-z0-9_]+)" OUTPUT_ "${OUTPUT_}") + set(${OUT_VAR} ${CMAKE_MATCH_1} PARENT_SCOPE) + endfunction() + + function(gn_desc OUT_VAR BUILD_DIR TARGET WHAT_TO_DISPLAY) + execute_process( + COMMAND ${GN} desc "${BUILD_DIR}" "${TARGET}" "${WHAT_TO_DISPLAY}" + WORKING_DIRECTORY "${_vig_SOURCE_PATH}" + OUTPUT_VARIABLE OUTPUT_ + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX REPLACE "\n|(\r\n)" ";" OUTPUT_ "${OUTPUT_}") + set(${OUT_VAR} ${OUTPUT_} PARENT_SCOPE) + endfunction() + + function(install_ BUILD_DIR INSTALL_DIR) + if(_vig_TARGETS) + foreach(TARGET ${_vig_TARGETS}) + # GN targets must start with a // + gn_desc(OUTPUTS "${BUILD_DIR}" "//${TARGET}" outputs) + gn_get_target_type(TARGET_TYPE "${BUILD_DIR}" "//${TARGET}") + foreach(OUTPUT ${OUTPUTS}) + if(NOT EXISTS "${OUTPUT}") + if(OUTPUT MATCHES "^//") + # relative path (e.g. //out/Release/target.lib) + string(REGEX REPLACE "^//" "${_vig_SOURCE_PATH}/" OUTPUT "${OUTPUT}") + elseif(OUTPUT MATCHES "^/" AND CMAKE_HOST_WIN32) + # absolute path (e.g. /C:/path/to/target.lib) + string(REGEX REPLACE "^/" "" OUTPUT "${OUTPUT}") + endif() + endif() + + if(NOT EXISTS "${OUTPUT}") + message(STATUS "Output for target, ${TARGET} doesn't exist: ${OUTPUT}.") + continue() + endif() + + if(TARGET_TYPE STREQUAL "executable") + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/tools") + elseif("${OUTPUT}" MATCHES "(\\.dll|\\.pdb)$") + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/bin") + else() + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/lib") + endif() + endforeach() + endforeach() + endif() + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + install_("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_PACKAGES_DIR}/debug") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + install_("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_PACKAGES_DIR}") + endif() + +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_install_make.cmake b/scripts/cmake/vcpkg_install_make.cmake index 1672d7c5a51249..4246894686cc83 100644 --- a/scripts/cmake/vcpkg_install_make.cmake +++ b/scripts/cmake/vcpkg_install_make.cmake @@ -21,5 +21,5 @@ ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) function(vcpkg_install_make) - vcpkg_build_make(LOGFILE_ROOT ENABLE_INSTALL) + vcpkg_build_make(${ARGN} LOGFILE_ROOT ENABLE_INSTALL) endfunction() diff --git a/scripts/cmake/vcpkg_install_msbuild.cmake b/scripts/cmake/vcpkg_install_msbuild.cmake index db2874a9ffd273..1a0d9513df190b 100644 --- a/scripts/cmake/vcpkg_install_msbuild.cmake +++ b/scripts/cmake/vcpkg_install_msbuild.cmake @@ -136,6 +136,9 @@ function(vcpkg_install_msbuild) /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:VcpkgTriplet=${TARGET_TRIPLET} + "/p:VcpkgCurrentInstalledDir=${CURRENT_INSTALLED_DIR}" + /p:VcpkgManifestInstall=false /m ) 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/detect_compiler/CMakeLists.txt b/scripts/detect_compiler/CMakeLists.txt new file mode 100644 index 00000000000000..ea27db2b9ca297 --- /dev/null +++ b/scripts/detect_compiler/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.10) +project(detect_compiler NONE) + +if(CMAKE_GENERATOR STREQUAL "Ninja" AND CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(CMAKE_C_COMPILER_WORKS 1) + set(CMAKE_C_COMPILER_ID_RUN 1) + set(CMAKE_C_COMPILER_FORCED 1) + set(CMAKE_CXX_COMPILER_WORKS 1) + set(CMAKE_CXX_COMPILER_ID_RUN 1) + set(CMAKE_CXX_COMPILER_FORCED 1) +endif() + +enable_language(C) +enable_language(CXX) + +file(SHA1 "${CMAKE_CXX_COMPILER}" CXX_HASH) +file(SHA1 "${CMAKE_C_COMPILER}" C_HASH) +string(SHA1 COMPILER_HASH "${C_HASH}${CXX_HASH}") + +message("#COMPILER_HASH#${COMPILER_HASH}") diff --git a/scripts/detect_compiler/CONTROL b/scripts/detect_compiler/CONTROL new file mode 100644 index 00000000000000..d76f041f0083ac --- /dev/null +++ b/scripts/detect_compiler/CONTROL @@ -0,0 +1,3 @@ +Source: detect-compiler +Version: 0 +Description: None diff --git a/scripts/detect_compiler/portfile.cmake b/scripts/detect_compiler/portfile.cmake new file mode 100644 index 00000000000000..4f68faea46936b --- /dev/null +++ b/scripts/detect_compiler/portfile.cmake @@ -0,0 +1,28 @@ +set(LOGS + ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-out.log + ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-rel-out.log + ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-dbg-out.log + ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-rel-err.log + ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-dbg-err.log +) + +foreach(LOG IN LISTS LOGS) + file(REMOVE ${LOG}) + if(EXISTS ${LOG}) + message(FATAL_ERROR "Could not remove ${LOG}") + endif() +endforeach() + +set(VCPKG_BUILD_TYPE release) + +vcpkg_configure_cmake( + SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}" + PREFER_NINJA +) + +foreach(LOG IN LISTS LOGS) + if(EXISTS ${LOG}) + file(READ "${LOG}" _contents) + message("${_contents}") + endif() +endforeach() diff --git a/scripts/file_script.py b/scripts/file_script.py new file mode 100644 index 00000000000000..de57f2720991fb --- /dev/null +++ b/scripts/file_script.py @@ -0,0 +1,42 @@ +import os +import os.path +import sys + + +keyword = "include/" + +def getFiles(path): + files = os.listdir(path) + return list(filter(lambda x: x[0] != '.', files)) + +def gen_all_file_strings(path, files, headers, output): + for file in files: + package = file[:file.find("_")] + f = open(path + file) + for line in f: + idx = line.strip().find(keyword) + if idx >= 0 and line.strip()[-1] != "/": + headers.write(package + ":" + line[idx + len(keyword):]) + output.write(package + ":" + line[idx-1:]) + elif line.strip()[-1] != "/": + output.write(package + ":" + line[line.find("/"):]) + f.close() + +def main(path): + try: + os.mkdir("scripts/list_files") + except FileExistsError: + print("Path already exists, continuing...") + + try: + headers = open("scripts/list_files/VCPKGHeadersDatabase.txt", mode='w') + output = open("scripts/list_files/VCPKGDatabase.txt", mode='w') + gen_all_file_strings(path, getFiles(path), headers, output) + headers.close() + output.close() + except e: + print("Failed to generate file lists") + +if __name__ == "__main__": + main(sys.argv[1]) + diff --git a/scripts/ports.cmake b/scripts/ports.cmake index fcec5ad2fbeaf7..5e21e3d7d20f7d 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -6,34 +6,23 @@ macro(debug_message) endif() endmacro() -#Detect .vcpkg-root to figure VCPKG_ROOT_DIR, starting from triplet folder. -set(VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) - -if(DEFINED VCPKG_ROOT_PATH) - set(VCPKG_ROOT_DIR_CANDIDATE ${VCPKG_ROOT_PATH}) -else() +if((NOT DEFINED VCPKG_ROOT_DIR) + OR (NOT DEFINED DOWNLOADS) + OR (NOT DEFINED _VCPKG_INSTALLED_DIR) + OR (NOT DEFINED PACKAGES_DIR) + OR (NOT DEFINED BUILDTREES_DIR)) message(FATAL_ERROR [[ Your vcpkg executable is outdated and is not compatible with the current CMake scripts. Please re-build vcpkg by running bootstrap-vcpkg. ]]) endif() -# fixup Windows drive letter to uppercase. -get_filename_component(VCPKG_ROOT_DIR_CANDIDATE ${VCPKG_ROOT_DIR_CANDIDATE} ABSOLUTE) - -# Validate VCPKG_ROOT_DIR_CANDIDATE -if (NOT EXISTS "${VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") - message(FATAL_ERROR "Could not find .vcpkg-root") -endif() - -set(VCPKG_ROOT_DIR ${VCPKG_ROOT_DIR_CANDIDATE}) +file(TO_CMAKE_PATH ${BUILDTREES_DIR} BUILDTREES_DIR) +file(TO_CMAKE_PATH ${PACKAGES_DIR} PACKAGES_DIR) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) -set(CURRENT_INSTALLED_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET} CACHE PATH "Location to install final packages") -set(DOWNLOADS ${VCPKG_ROOT_DIR}/downloads CACHE PATH "Location to download sources and tools") +set(CURRENT_INSTALLED_DIR ${_VCPKG_INSTALLED_DIR}/${TARGET_TRIPLET} CACHE PATH "Location to install final packages") set(SCRIPTS ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Location to stored scripts") -set(PACKAGES_DIR ${VCPKG_ROOT_DIR}/packages CACHE PATH "Location to store package images") -set(BUILDTREES_DIR ${VCPKG_ROOT_DIR}/buildtrees CACHE PATH "Location to perform actual extract+config+build") if(PORT) set(CURRENT_BUILDTREES_DIR ${BUILDTREES_DIR}/${PORT}) @@ -57,8 +46,8 @@ if(CMD MATCHES "^BUILD$") if(NOT EXISTS ${CURRENT_PORT_DIR}/portfile.cmake) message(FATAL_ERROR "Port is missing portfile: ${CURRENT_PORT_DIR}/portfile.cmake") endif() - if(NOT EXISTS ${CURRENT_PORT_DIR}/CONTROL) - message(FATAL_ERROR "Port is missing control file: ${CURRENT_PORT_DIR}/CONTROL") + if(NOT EXISTS ${CURRENT_PORT_DIR}/CONTROL AND NOT EXISTS ${CURRENT_PORT_DIR}/vcpkg.json) + message(FATAL_ERROR "Port is missing control or manifest file: ${CURRENT_PORT_DIR}/{CONTROL,vcpkg.json}") endif() unset(PACKAGES_DIR) @@ -88,37 +77,50 @@ if(CMD MATCHES "^BUILD$") include(${SCRIPTS}/cmake/vcpkg_common_definitions.cmake) include(${SCRIPTS}/cmake/vcpkg_common_functions.cmake) include(${CURRENT_PORT_DIR}/portfile.cmake) - include(${SCRIPTS}/build_info.cmake) + if(DEFINED PORT) + include(${SCRIPTS}/build_info.cmake) + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) - if(EXISTS ports/${PORT}/portfile.cmake) - message(FATAL_ERROR "Portfile already exists: '${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\portfile.cmake'") + set(PORT_PATH "${VCPKG_ROOT_DIR}/ports/${PORT}") + file(TO_NATIVE_PATH ${PORT_PATH} NATIVE_PORT_PATH) + set(PORTFILE_PATH "${PORT_PATH}/portfile.cmake") + file(TO_NATIVE_PATH ${PORTFILE_PATH} NATIVE_PORTFILE_PATH) + set(MANIFEST_PATH "${PORT_PATH}/vcpkg.json") + file(TO_NATIVE_PATH ${MANIFEST_PATH} NATIVE_MANIFEST_PATH) + + if(EXISTS "${PORTFILE_PATH}") + message(FATAL_ERROR "Portfile already exists: '${NATIVE_PORTFILE_PATH}'") endif() if(NOT FILENAME) get_filename_component(FILENAME "${URL}" NAME) endif() string(REGEX REPLACE "(\\.(zip|gz|tar|tgz|bz2))+\$" "" ROOT_NAME ${FILENAME}) - if(EXISTS ${DOWNLOADS}/${FILENAME}) - message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOADS}\\${FILENAME}") - message(STATUS "If this is not desired, delete the file and ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}") + + set(DOWNLOAD_PATH "${DOWNLOADS}/${FILENAME}") + file(TO_NATIVE_PATH ${DOWNLOAD_PATH} NATIVE_DOWNLOAD_PATH) + + if(EXISTS "${DOWNLOAD_PATH}") + message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOAD_PATH}") + message(STATUS "If this is not desired, delete the file and ${NATIVE_PORT_PATH}") else() include(vcpkg_download_distfile) - set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") + set(_VCPKG_INTERNAL_NO_HASH_CHECK ON) vcpkg_download_distfile(ARCHIVE URLS ${URL} FILENAME ${FILENAME} ) - set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") + set(_VCPKG_INTERNAL_NO_HASH_CHECK OFF) endif() - file(SHA512 ${DOWNLOADS}/${FILENAME} SHA512) + file(SHA512 ${DOWNLOAD_PATH} SHA512) - file(MAKE_DIRECTORY ports/${PORT}) - configure_file(${SCRIPTS}/templates/portfile.in.cmake ports/${PORT}/portfile.cmake @ONLY) - configure_file(${SCRIPTS}/templates/CONTROL.in ports/${PORT}/CONTROL @ONLY) + file(MAKE_DIRECTORY ${PORT_PATH}) + configure_file(${SCRIPTS}/templates/portfile.in.cmake ${PORTFILE_PATH} @ONLY) + configure_file(${SCRIPTS}/templates/vcpkg.json.in ${MANIFEST_PATH} @ONLY) - message(STATUS "Generated portfile: ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\portfile.cmake") - message(STATUS "Generated CONTROL: ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\CONTROL") + message(STATUS "Generated portfile: ${NATIVE_PORTFILE_PATH}") + message(STATUS "Generated manifest: ${NATIVE_MANIFEST_PATH}") message(STATUS "To launch an editor for these new files, run") message(STATUS " .\\vcpkg edit ${PORT}") endif() diff --git a/scripts/templates/CONTROL.in b/scripts/templates/CONTROL.in deleted file mode 100644 index 77f287e0aa3a5a..00000000000000 --- a/scripts/templates/CONTROL.in +++ /dev/null @@ -1,10 +0,0 @@ -Source: @PORT@ -Version: -Homepage: -Description: -Build-Depends: -Default-Features: - -Feature: -Description: -Build-Depends: \ No newline at end of file diff --git a/scripts/templates/vcpkg.json.in b/scripts/templates/vcpkg.json.in new file mode 100644 index 00000000000000..2e217387e76ecc --- /dev/null +++ b/scripts/templates/vcpkg.json.in @@ -0,0 +1,16 @@ +{ + "name": "@PORT@", + "version-string": "", + "homepage": "", + "description": "", + "dependencies": [], + + "default-features": [], + "features": [ + { + "name": "", + "description": "", + "dependencies": [] + } + ] +} diff --git a/scripts/test_ports/cmake/CONTROL b/scripts/test_ports/cmake/CONTROL new file mode 100644 index 00000000000000..ba5848dbcb7386 --- /dev/null +++ b/scripts/test_ports/cmake/CONTROL @@ -0,0 +1,5 @@ +Source: cmake +Version: 3.17.2 +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..9f41be53c16a39 --- /dev/null +++ b/scripts/test_ports/cmake/portfile.cmake @@ -0,0 +1,53 @@ +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 615129f3ebd308abeaaee7f5f0689e7fc4616c28 + SHA512 5f02e05b7e6119c9c165c868d0679e0fbe5cc6b4f081a4e63a87d663c029bc378327ec042ae6bfd16bf48737bfaa5bae3be33a6dd33648e1f47cdc1a2370c366 + 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=ON + -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) \ No newline at end of file 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/testing/integrate-install/NoProps.vcxproj b/scripts/testing/integrate-install/NoProps.vcxproj new file mode 100644 index 00000000000000..5b75d0961550cb --- /dev/null +++ b/scripts/testing/integrate-install/NoProps.vcxproj @@ -0,0 +1,145 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + Project1 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/testing/integrate-install/Project1.vcxproj b/scripts/testing/integrate-install/Project1.vcxproj new file mode 100644 index 00000000000000..a8896fe29d1039 --- /dev/null +++ b/scripts/testing/integrate-install/Project1.vcxproj @@ -0,0 +1,146 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + Project1 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/testing/integrate-install/Source.cpp b/scripts/testing/integrate-install/Source.cpp new file mode 100644 index 00000000000000..24a84e4d7fdab3 --- /dev/null +++ b/scripts/testing/integrate-install/Source.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + zlibVersion(); + return 0; +} \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgTriplet.vcxproj b/scripts/testing/integrate-install/VcpkgTriplet.vcxproj new file mode 100644 index 00000000000000..883fc8ec1a7311 --- /dev/null +++ b/scripts/testing/integrate-install/VcpkgTriplet.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + VcpkgUseStatic + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + x86-windows-static + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj b/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj new file mode 100644 index 00000000000000..d3352e195b4a11 --- /dev/null +++ b/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj @@ -0,0 +1,149 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + VcpkgUseStatic + 10.0 + x86-windows-static + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj b/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj new file mode 100644 index 00000000000000..28c4fc7158ca12 --- /dev/null +++ b/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + VcpkgUseStatic + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + true + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj b/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj new file mode 100644 index 00000000000000..98beaee4b12fb1 --- /dev/null +++ b/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj @@ -0,0 +1,149 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} + VcpkgUseStatic + 10.0 + true + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/scripts/toolchains/android.cmake b/scripts/toolchains/android.cmake index 69192aeca9fca2..a7a7ea2d0cae41 100644 --- a/scripts/toolchains/android.cmake +++ b/scripts/toolchains/android.cmake @@ -5,22 +5,32 @@ 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}") endif() +if (VCPKG_CRT_LINKAGE STREQUAL "dynamic") + set(ANDROID_STL c++_shared CACHE STRING "") +else() + set(ANDROID_STL c++_static CACHE STRING "") +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") @@ -33,14 +43,14 @@ 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} ") endif() endif() diff --git a/scripts/toolchains/ios.cmake b/scripts/toolchains/ios.cmake index 5497117a302a7e..b93cdbb8aee788 100644 --- a/scripts/toolchains/ios.cmake +++ b/scripts/toolchains/ios.cmake @@ -16,9 +16,11 @@ if(NOT _VCPKG_IOS_TOOLCHAIN) set(_vcpkg_ios_system_processor "arm") set(_vcpkg_ios_target_architecture "armv7") elseif("${arch}" STREQUAL "x64") + set(_vcpkg_ios_system_processor "x86_64") set(_vcpkg_ios_sysroot "iphonesimulator") set(_vcpkg_ios_target_architecture "x86_64") elseif("${arch}" STREQUAL "x86") + set(_vcpkg_ios_system_processor "i386") set(_vcpkg_ios_sysroot "iphonesimulator") set(_vcpkg_ios_target_architecture "i386") else() diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index 70f224da993af0..0c1e15ef13b872 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -6,6 +6,10 @@ endif() set(CMAKE_SYSTEM_NAME Linux CACHE STRING "") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "") + string(APPEND VCPKG_C_FLAGS " -m32") + string(APPEND VCPKG_CXX_FLAGS " -m32") endif() get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 43e6d2c2d9a005..160e9d9341f729 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -19,8 +19,8 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CHARSET_FLAG) endif() - set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") - set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + 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) @@ -29,8 +29,13 @@ if(NOT _CMAKE_IN_TRY_COMPILE) 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 "") - - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" 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 "") + + 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 ") endif() endif() diff --git a/scripts/vcpkg.schema.json b/scripts/vcpkg.schema.json new file mode 100644 index 00000000000000..ae20ad6e3298bc --- /dev/null +++ b/scripts/vcpkg.schema.json @@ -0,0 +1,206 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "title": "Vcpkg manifest", + "description": "Vcpkg manifest file. See https://github.com/microsoft/vcpkg/blob/master/docs/specifications/manifests.md.", + "definitions": { + "identifier": { + "description": "Identifiers used for feature names.", + "allOf": [ + { + "description": "Identifier are lowercase with digits and dashes.", + "type": "string", + "pattern": "[a-z0-9]+(-[a-z0-9]+)*" + }, + { + "not": { + "description": "Identifiers must not be a Windows filesystem or vcpkg reserved name.", + "type": "string", + "pattern": "^prn|aux|nul|con|lpt[1-9]|com[1-9]|core|default$" + } + } + ] + }, + "package-name": { + "description": "Name of a package.", + "allOf": [ + { + "description": "Package name must be a dot-separated list of valid identifiers", + "type": "string", + "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)*$" + }, + { + "not": { + "description": "Identifiers must not be a Windows filesystem or vcpkg reserved name.", + "type": "string", + "pattern": "(^|\\.)(prn|aux|nul|con|lpt[1-9]|com[1-9]|core|default)(\\.|$)" + } + } + ] + }, + "description-field": { + "description": "A string or array of strings containing the description of a package or feature.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "dependency-object": { + "description": "Expanded form of a dependency with explicit features and platform.", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/package-name" + }, + "features": { + "type": "array", + "items": { + "$ref": "#/definitions/identifier" + } + }, + "default-features": { + "type": "boolean", + "default": true + }, + "platform": { + "$ref": "#/definitions/platform-expression" + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "dependency": { + "description": "A dependency fetchable by Vcpkg.", + "oneOf": [ + { + "$ref": "#/definitions/package-name" + }, + { + "$ref": "#/definitions/dependency-object" + } + ] + }, + "platform-expression": { + "description": "A specification of a set of platforms. See https://github.com/microsoft/vcpkg/blob/master/docs/specifications/manifests.md#definitions.", + "type": "string" + }, + "feature": { + "description": "A package feature that can be activated by consumers.", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/identifier" + }, + "description": { + "$ref": "#/definitions/description-field" + }, + "dependencies": { + "description": "Dependencies used by this feature.", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name", + "description" + ], + "additionalProperties": false + } + }, + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/package-name" + }, + "version-string": { + "description": "A string without semantic meaning, equivalent to `CONTROL`'s `Version` field.", + "type": "string" + }, + "port-version": { + "description": "A non-negative integer. If this field doesn't exist, it's assumed to be `0`.", + "type": "integer", + "minimum": 0, + "default": 0 + }, + "maintainers": { + "description": "An array of strings which contain the authors of a package", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "$ref": "#/definitions/description-field" + }, + "homepage": { + "description": "A url which points to the homepage of a package.", + "type": "string", + "format": "uri" + }, + "documentation": { + "description": "A url which points to the documentation of a package.", + "type": "string", + "format": "uri" + }, + "license": { + "description": "An SPDX license expression at version 3.9.", + "type": "string" + }, + "dependencies": { + "description": "Dependencies that are always required.", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + }, + "dev-dependencies": { + "description": "Dependencies only required for developers (testing and the like).", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + }, + "features": { + "description": "An array of features supported by the package", + "type": "array", + "items": { + "$ref": "#/definitions/feature" + } + }, + "default-features": { + "description": "Features enabled by default with the package.", + "type": "array", + "items": { + "$ref": "#/definitions/identifier" + } + }, + "supports": { + "$ref": "#/definitions/platform-expression" + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name", + "version-string" + ], + "additionalProperties": false +} diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 5ac380279a4a62..fed4af09beebf5 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,25 +1,32 @@ + + 3.8.3 + python.exe + https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-win32.zip + 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a + python-3.8.3-embed-win32.zip + - 3.14.0 - cmake-3.14.0-win32-x86\bin\cmake.exe - https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-win32-x86.zip - 60eb6a0790883da4152a957bd1133405f620f4b7a073af3bea97695b3ef8c22c41d9b90e45815f2a896df5be0cd6dedb73a6df5f17a42761ca8f457c9f3b708c - cmake-3.14.0-win32-x86.zip + 3.17.2 + cmake-3.17.2-win32-x86\bin\cmake.exe + https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.zip + 63bb3dc5a8683ed193025450620a70b8dd675eccba4a83882c96f21eda8994dd5b21854036a0c17f978bf31f67d1d1b33b416c7f6ffb0470c9f48c2e495d44c1 + cmake-3.17.2-win32-x86.zip - 3.14.0 - cmake-3.14.0-Darwin-x86_64/CMake.app/Contents/bin/cmake - https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Darwin-x86_64.tar.gz - a5a7217a049be3bb2ef5c93292b1d92eb4dd5ec6ab2dd04984aae01d2732eb343cea4f9741b333a5e21a27eb7934f568f780f3558e7ff870150c3309fc4656b3 - cmake-3.14.0-Darwin-x86_64.tar.gz + 3.17.2 + cmake-3.17.2-Darwin-x86_64/CMake.app/Contents/bin/cmake + https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-Darwin-x86_64.tar.gz + 804b06439c05b9cf36a988223b7dc47b06b8613cb4653989eff52aad5ab0fa312b8da1ac0c760ad101e74b2c9edaf5b119bd48617a5efb57dff9380ca74e54a9 + cmake-3.17.2-Darwin-x86_64.tar.gz - 3.14.0 - cmake-3.14.0-Linux-x86_64/bin/cmake - https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz - e687c0f3acfb15c880ddac67e2821907f833cb900c6ecedb4ab5df5102604d82753c948e3c7dca6e5bcce6278a09b7d577b1afade2e133aec5b2057ac48d3c74 - cmake-3.14.0-Linux-x86_64.tar.gz + 3.17.2 + cmake-3.17.2-Linux-x86_64/bin/cmake + https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-Linux-x86_64.tar.gz + 2afc023363c40b110d97d871fb9a8917643bba308ca0c029ee8fe1164db1c168e32b2c9d7647475d84efa290c1242357f7cf260ea4d1f92f5a829cf418955490 + cmake-3.17.2-Linux-x86_64.tar.gz 3.12.4 @@ -29,11 +36,11 @@ cmake-3.12.4-FreeBSD-x86_64.tar.gz - 2.25.1-1 + 2.26.2-1 mingw32\bin\git.exe - https://github.com/git-for-windows/git/releases/download/v2.25.1.windows.1/PortableGit-2.25.1-32-bit.7z.exe - 222d6e384ecae5841cb02dc004c4b3f56659d19b662bc93ab531df844c9477c9717c4a1adfb8bc2d3159678238fa4c79ccbdcb5c116eea5eccd652f4b483359e - PortableGit-2.25.1-32-bit.7z.exe + https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe + d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36 + PortableGit-2.26.2-32-bit.7z.exe 2.7.4 @@ -60,10 +67,22 @@ f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1 - 4.8.1 + 5.5.1 + nuget.exe + https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe + 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619 + + + 5.5.1 + nuget.exe + https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe + 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619 + + + 5.5.1 nuget.exe - https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe - 42cb744338af8decc033a75bce5b4c4df28e102bafc45f9a8ba86d7bc010f5b43ebacae80d7b28c4f85ac900eefc2a349620ae65f27f6ca1c21c53b63b92924b + https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe + 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619 3.1.81 @@ -87,25 +106,25 @@ aria2-1.33.1-win-32bit-build1.zip - 1.8.2 + 1.10.0 ninja.exe - https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip - 9b9ce248240665fcd6404b989f3b3c27ed9682838225e6dc9b67b551774f251e4ff8a207504f941e7c811e7a8be1945e7bcb94472a335ef15e23a0200a32e6d5 - ninja-win-1.8.2.zip + https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip + a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97 + ninja-win-1.10.0.zip - 1.8.2 + 1.10.0 ninja - https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip - 38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5 - ninja-linux-1.8.2.zip + https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip + ffb179ab8ea315167fcc99a8f13286e1363590185b18cf819cc73e09f2a7553790e9dc45fd1ccd0bd1d2dbf543aee3f6c0951cf9ce453a7168ffd2ac873cdd29 + ninja-linux-1.10.0.zip - 1.8.2 + 1.10.0 ninja - https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip - acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3 - ninja-mac-1.8.2.zip + https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-mac.zip + 619a1924067a0b30fc5f8887f868d3ee5481838d2f0f158d031f7614a2a10b95a73d4a56b658d5d560283ebf809e2e536b968c6c01ff0108075c3f393f5780ba + ninja-mac-1.10.0.zip 1.8.2 diff --git a/toolsrc/.clang-format b/toolsrc/.clang-format index 4d2c34fc41c436..6c32a733ae18c4 100644 --- a/toolsrc/.clang-format +++ b/toolsrc/.clang-format @@ -1,4 +1,3 @@ ---- BasedOnStyle: WebKit Language: Cpp Standard: Cpp11 @@ -32,3 +31,20 @@ ForEachMacros: [TEST_CASE, SECTION] PenaltyReturnTypeOnItsOwnLine: 1000 SpaceAfterTemplateKeyword: false SpaceBeforeCpp11BracedList: false +DeriveLineEnding: false +UseCRLF: false + +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^(|"pch\.h")$' + Priority: -1 + - Regex: '^$' + Priority: 1 + - Regex: '^$' + Priority: 2 + - Regex: '^$' + Priority: 3 + - Regex: '^<[a-z0-9_]*\.h>$' + Priority: 4 + - Regex: '^<[a-z0-9_]*>$' # C++ standard library + Priority: 5 diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 226985366500e7..10a280faacbd30 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -14,6 +14,7 @@ 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) @@ -44,7 +45,7 @@ if(MSVC) if (MSVC_VERSION GREATER 1900) # Visual Studio 2017 or later - add_compile_options(-permissive-) + add_compile_options(-permissive- -utf-8) endif() if(VCPKG_DEVELOPMENT_WARNINGS) @@ -53,6 +54,8 @@ if(MSVC) 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() @@ -113,19 +116,27 @@ 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) + 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) @@ -148,4 +159,3 @@ if(MSVC) target_sources(vcpkglib PRIVATE src/pch.cpp) target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) endif() - diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 966303f8ace7ab..86c0faff15f398 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"2020.02.04" +"2020.06.15" diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake index 8f088cea42bd09..b99063a658ad9c 100644 --- a/toolsrc/cmake/utilities.cmake +++ b/toolsrc/cmake/utilities.cmake @@ -1,28 +1,38 @@ # Outputs to Cache: VCPKG_COMPILER function(vcpkg_detect_compiler) if(NOT DEFINED CACHE{VCPKG_COMPILER}) + message(STATUS "Detecting the C++ compiler in use") if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) - message(FATAL_ERROR - "The g++ version picked up is too old; please install a newer compiler such as g++-7. - On Ubuntu try the following: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update -y - sudo apt-get install g++-7 -y - On CentOS try the following: - sudo yum install centos-release-scl - sudo yum install devtoolset-7 - scl enable devtoolset-7 bash") + message(FATAL_ERROR [[ +The g++ version picked up is too old; please install a newer compiler such as g++-7. +On Ubuntu try the following: + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update -y + sudo apt-get install g++-7 -y +On CentOS try the following: + sudo yum install centos-release-scl + sudo yum install devtoolset-7 + scl enable devtoolset-7 bash +]]) endif() set(COMPILER "gcc") elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG) - message(FATAL_ERROR - "Building the vcpkg tool requires support for the C++ Filesystem TS. - Apple clang versions 10.01 and below do not have support for it. - Please install gcc6 or newer from homebrew (brew install gcc). - If you would like to try anyway, pass --allowAppleClang to bootstrap.sh.") + #[[ + Note: CMAKE_SYSTEM_VERSION uses darwin versions + - Darwin 19.0.0 = macOS 10.15, iOS 13 + - Darwin 18.0.0 = macOS 10.14, iOS 12 + - Darwin 17.0.0 = macOS 10.13, iOS 11 + - Darwin 16.0.0 = macOS 10.12, iOS 10 + ]] + if(CMAKE_SYSTEM_VERSION VERSION_LESS "19.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG) + message(FATAL_ERROR [[ +Building the vcpkg tool requires support for the C++ Filesystem TS. +macOS versions below 10.15 do not have support for it with Apple Clang. +Please install gcc6 or newer from homebrew (brew install gcc). +If you would like to try anyway, pass --allowAppleClang to bootstrap.sh. +]]) endif() set(COMPILER "clang") elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") @@ -36,6 +46,7 @@ function(vcpkg_detect_compiler) set(VCPKG_COMPILER ${COMPILER} CACHE STRING "The compiler in use; one of gcc, clang, msvc") + message(STATUS "Detecting the C++ compiler in use - ${VCPKG_COMPILER}") endif() endfunction() @@ -48,26 +59,29 @@ function(vcpkg_detect_standard_library) # note: since is the smallest header, generally it's used to get the standard library version set(CMAKE_REQUIRED_QUIET ON) - check_cxx_source_compiles( - "#include - #if !defined(__GLIBCXX__) - #error not libstdc++ - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if !defined(__GLIBCXX__) +#error "not libstdc++" +#endif +int main() {} +]] _VCPKG_STANDARD_LIBRARY_LIBSTDCXX) - check_cxx_source_compiles( - "#include - #if !defined(_LIBCPP_VERSION) - #error not libc++ - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if !defined(_LIBCPP_VERSION) +#error "not libc++" +#endif +int main() {} +]] _VCPKG_STANDARD_LIBRARY_LIBCXX) - check_cxx_source_compiles( - "#include - #if !defined(_MSVC_STL_VERSION) - #error not MSVC stl - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if !defined(_MSVC_STL_VERSION) +#error "not MSVC stl" +#endif +int main() {} +]] _VCPKG_STANDARD_LIBRARY_MSVC_STL) if(_VCPKG_STANDARD_LIBRARY_LIBSTDCXX) set(STANDARD_LIBRARY "libstdc++") @@ -98,32 +112,35 @@ function(vcpkg_detect_std_filesystem) set(CMAKE_REQUIRED_QUIET ON) if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") - check_cxx_source_compiles( - "#include - #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9 - #error libstdc++ after version 9 does not require -lstdc++fs - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9 +#error "libstdc++ after version 9 does not require -lstdc++fs" +#endif +int main() {} +]] _VCPKG_REQUIRE_LINK_CXXFS) - check_cxx_source_compiles( - "#include - #if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8 - #error libstdc++ before version 8 doesn't support - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8 +#error "libstdc++ before version 8 does not support " +#endif +int main() {} +]] _VCPKG_USE_STD_FILESYSTEM) 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) else() - check_cxx_source_compiles( - "#include - #if _LIBCPP_VERSION >= 9000 - #error libc++ after version 9 does not require -lc++fs - #endif - int main() {}" + check_cxx_source_compiles([[ +#include +#if _LIBCPP_VERSION >= 9000 +#error "libc++ after version 9 does not require -lc++fs" +#endif +int main() {} +]] _VCPKG_REQUIRE_LINK_CXXFS) endif() @@ -133,7 +150,7 @@ function(vcpkg_detect_std_filesystem) check_cxx_source_compiles( "#include #if !defined(_MSVC_STL_UPDATE) || _MSVC_STL_UPDATE < 201803 - #error MSVC STL before 15.7 doesn't support + #error \"MSVC STL before 15.7 does not support \" #endif int main() {}" _VCPKG_USE_STD_FILESYSTEM) diff --git a/toolsrc/include/catch2/catch.hpp b/toolsrc/include/catch2/catch.hpp index 303f664ffc3b05..f471a2ec68a3dd 100644 --- a/toolsrc/include/catch2/catch.hpp +++ b/toolsrc/include/catch2/catch.hpp @@ -11282,10 +11282,10 @@ namespace Catch { Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) { auto trimmed = [&] (size_t start, size_t end) { - while (names[start] == ',' || isspace(names[start])) { + while (names[start] == ',' || isspace(static_cast(names[start]))) { ++start; } - while (names[end] == ',' || isspace(names[end])) { + while (names[end] == ',' || isspace(static_cast(names[end]))) { --end; } return names.substr(start, end - start + 1); diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index bdc13aedf5e41b..f92792411c9da5 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -1,24 +1,21 @@ #pragma once -#include +#include -#if defined(_WIN32) -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN - -#pragma warning(suppress : 4768) -#include - -#pragma warning(suppress : 4768) -#include +#include +#if defined(_WIN32) #include #include #include -#else -#include #endif +#include +#include +#include +#include +#include + #include #include #include @@ -26,16 +23,14 @@ #include #include #include -#include -#include -#include -#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING -#include + #if VCPKG_USE_STD_FILESYSTEM #include #else +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include #endif + #include #include #include @@ -55,14 +50,10 @@ #include #endif -#include -// glibc defines major and minor in sys/types.h, and should not -#undef major -#undef minor +#include #include #include -#include #include #include #include diff --git a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h index 21207c8563b283..482f9ea400dcb9 100644 --- a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h +++ b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h @@ -1,38 +1,38 @@ -#pragma once - -#include - -namespace vcpkg::Test -{ - struct MockCMakeVarProvider : CMakeVars::CMakeVarProvider - { - void load_generic_triplet_vars(Triplet triplet) const override { generic_triplet_vars[triplet] = {}; } - - void load_dep_info_vars(Span specs) const override - { - for (auto&& spec : specs) - dep_info_vars[spec] = {}; - } - - void load_tag_vars(Span specs, - const PortFileProvider::PortFileProvider& port_provider) const override - { - for (auto&& spec : specs) - tag_vars[spec.package_spec] = {}; - Util::unused(port_provider); - } - - Optional&> get_generic_triplet_vars( - Triplet triplet) const override; - - Optional&> get_dep_info_vars( - const PackageSpec& spec) const override; - - Optional&> get_tag_vars( - const PackageSpec& spec) const override; - - mutable std::unordered_map> dep_info_vars; - mutable std::unordered_map> tag_vars; - mutable std::unordered_map> generic_triplet_vars; - }; -} +#pragma once + +#include + +namespace vcpkg::Test +{ + struct MockCMakeVarProvider : CMakeVars::CMakeVarProvider + { + void load_generic_triplet_vars(Triplet triplet) const override { generic_triplet_vars[triplet] = {}; } + + void load_dep_info_vars(Span specs) const override + { + for (auto&& spec : specs) + dep_info_vars[spec] = {}; + } + + void load_tag_vars(Span specs, + const PortFileProvider::PortFileProvider& port_provider) const override + { + for (auto&& spec : specs) + tag_vars[spec.package_spec] = {}; + Util::unused(port_provider); + } + + Optional&> get_generic_triplet_vars( + Triplet triplet) const override; + + Optional&> get_dep_info_vars( + const PackageSpec& spec) const override; + + Optional&> get_tag_vars( + const PackageSpec& spec) const override; + + mutable std::unordered_map> dep_info_vars; + mutable std::unordered_map> tag_vars; + mutable std::unordered_map> generic_triplet_vars; + }; +} diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h index c15846d05da235..ce403c308095d8 100644 --- a/toolsrc/include/vcpkg-test/util.h +++ b/toolsrc/include/vcpkg-test/util.h @@ -1,7 +1,10 @@ +#include + #include -#include #include +#include + #include #include @@ -52,7 +55,7 @@ namespace vcpkg::Test { std::unordered_map map; Triplet triplet; - PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) {} + PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) { } PackageSpec emplace(const char* name, const char* depends = "", @@ -84,9 +87,9 @@ namespace vcpkg::Test Yes = true, } tag; - constexpr AllowSymlinks(Tag tag) noexcept : tag(tag) {} + constexpr AllowSymlinks(Tag tag) noexcept : tag(tag) { } - constexpr explicit AllowSymlinks(bool b) noexcept : tag(b ? Yes : No) {} + constexpr explicit AllowSymlinks(bool b) noexcept : tag(b ? Yes : No) { } constexpr operator bool() const noexcept { return tag == Yes; } }; diff --git a/toolsrc/include/vcpkg/archives.h b/toolsrc/include/vcpkg/archives.h index 2298f9e1e88483..073217064b1fb1 100644 --- a/toolsrc/include/vcpkg/archives.h +++ b/toolsrc/include/vcpkg/archives.h @@ -1,6 +1,7 @@ #pragma once #include + #include namespace vcpkg::Archives diff --git a/toolsrc/include/vcpkg/base/cache.h b/toolsrc/include/vcpkg/base/cache.h index dfc7565b8aad4e..1996f2587d9169 100644 --- a/toolsrc/include/vcpkg/base/cache.h +++ b/toolsrc/include/vcpkg/base/cache.h @@ -1,21 +1,21 @@ -#pragma once - -#include - -namespace vcpkg -{ - template - struct Cache - { - template - Value const& get_lazy(const Key& k, const F& f) const - { - auto it = m_cache.find(k); - if (it != m_cache.end()) return it->second; - return m_cache.emplace(k, f()).first->second; - } - - private: - mutable std::map m_cache; - }; -} +#pragma once + +#include + +namespace vcpkg +{ + template + struct Cache + { + template + Value const& get_lazy(const Key& k, const F& f) const + { + auto it = m_cache.find(k); + if (it != m_cache.end()) return it->second; + return m_cache.emplace(k, f()).first->second; + } + + private: + mutable std::map m_cache; + }; +} diff --git a/toolsrc/include/vcpkg/base/chrono.h b/toolsrc/include/vcpkg/base/chrono.h index 118e9c382dc95d..0505192a0a8b78 100644 --- a/toolsrc/include/vcpkg/base/chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -13,8 +13,8 @@ namespace vcpkg::Chrono using duration = std::chrono::high_resolution_clock::time_point::duration; public: - constexpr ElapsedTime() noexcept : m_duration() {} - constexpr ElapsedTime(duration d) noexcept : m_duration(d) {} + constexpr ElapsedTime() noexcept : m_duration() { } + constexpr ElapsedTime(duration d) noexcept : m_duration(d) { } template TimeUnit as() const @@ -34,7 +34,7 @@ namespace vcpkg::Chrono public: static ElapsedTimer create_started(); - constexpr ElapsedTimer() noexcept : m_start_tick() {} + constexpr ElapsedTimer() noexcept : m_start_tick() { } ElapsedTime elapsed() const { @@ -56,8 +56,8 @@ namespace vcpkg::Chrono static Optional get_current_date_time(); static Optional parse(CStringView str); - constexpr CTime() noexcept : m_tm{} {} - explicit constexpr CTime(tm t) noexcept : m_tm{t} {} + constexpr CTime() noexcept : m_tm{} { } + explicit constexpr CTime(tm t) noexcept : m_tm{t} { } CTime add_hours(const int hours) const; diff --git a/toolsrc/include/vcpkg/base/cstringview.h b/toolsrc/include/vcpkg/base/cstringview.h index d49bfc82ffe40e..7d46ecf2e4cda3 100644 --- a/toolsrc/include/vcpkg/base/cstringview.h +++ b/toolsrc/include/vcpkg/base/cstringview.h @@ -7,10 +7,10 @@ namespace vcpkg { struct CStringView { - constexpr CStringView() noexcept : cstr(nullptr) {} - constexpr CStringView(const char* cstr) : cstr(cstr) {} + constexpr CStringView() noexcept : cstr(nullptr) { } + constexpr CStringView(const char* cstr) : cstr(cstr) { } constexpr CStringView(const CStringView&) = default; - CStringView(const std::string& str) : cstr(str.c_str()) {} + CStringView(const std::string& str) : cstr(str.c_str()) { } constexpr const char* c_str() const { return cstr; } diff --git a/toolsrc/include/vcpkg/base/expected.h b/toolsrc/include/vcpkg/base/expected.h index 2b19bad2ac51ef..d8a2cacaa00133 100644 --- a/toolsrc/include/vcpkg/base/expected.h +++ b/toolsrc/include/vcpkg/base/expected.h @@ -10,7 +10,7 @@ namespace vcpkg template struct ErrorHolder { - ErrorHolder() : m_is_error(false) {} + ErrorHolder() : m_is_error(false), m_err{} { } template ErrorHolder(U&& err) : m_is_error(true), m_err(std::forward(err)) { @@ -31,7 +31,7 @@ namespace vcpkg template<> struct ErrorHolder { - ErrorHolder() : m_is_error(false) {} + ErrorHolder() : m_is_error(false) { } template ErrorHolder(U&& err) : m_is_error(true), m_err(std::forward(err)) { @@ -53,7 +53,7 @@ namespace vcpkg struct ErrorHolder { ErrorHolder() = default; - ErrorHolder(const std::error_code& err) : m_err(err) {} + ErrorHolder(const std::error_code& err) : m_err(err) { } bool has_error() const { return bool(m_err); } @@ -79,8 +79,8 @@ namespace vcpkg struct ExpectedHolder { ExpectedHolder() = default; - ExpectedHolder(const T& t) : t(t) {} - ExpectedHolder(T&& t) : t(std::move(t)) {} + ExpectedHolder(const T& t) : t(t) { } + ExpectedHolder(T&& t) : t(std::move(t)) { } using pointer = T*; using const_pointer = const T*; T* get() { return &t; } @@ -90,8 +90,8 @@ namespace vcpkg template struct ExpectedHolder { - ExpectedHolder(T& t) : t(&t) {} - ExpectedHolder() : t(nullptr) {} + ExpectedHolder(T& t) : t(&t) { } + ExpectedHolder() : t(nullptr) { } using pointer = T*; using const_pointer = T*; T* get() { return t; } @@ -107,10 +107,10 @@ namespace vcpkg // Constructors are intentionally implicit - ExpectedT(const S& s, ExpectedRightTag = {}) : m_s(s) {} - ExpectedT(S&& s, ExpectedRightTag = {}) : m_s(std::move(s)) {} + ExpectedT(const S& s, ExpectedRightTag = {}) : m_s(s) { } + ExpectedT(S&& s, ExpectedRightTag = {}) : m_s(std::move(s)) { } - ExpectedT(const T& t, ExpectedLeftTag = {}) : m_t(t) {} + ExpectedT(const T& t, ExpectedLeftTag = {}) : m_t(t) { } template>> ExpectedT(T&& t, ExpectedLeftTag = {}) : m_t(std::move(t)) { @@ -187,7 +187,7 @@ namespace vcpkg } else { - return {std::move(error()), expected_right_tag}; + return {std::move(*this).error(), expected_right_tag}; } } @@ -213,7 +213,7 @@ namespace vcpkg } else { - return U{std::move(error()), expected_right_tag}; + return U{std::move(*this).error(), expected_right_tag}; } } diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index 0bad428c01de1b..a202bfdef48d60 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -19,6 +19,7 @@ namespace fs #endif using stdfs::copy_options; + using stdfs::directory_iterator; using stdfs::path; using stdfs::perms; using stdfs::u8path; @@ -58,6 +59,14 @@ namespace fs perms m_permissions; }; + struct SystemHandle + { + using type = intptr_t; // HANDLE + type system_handle = -1; + + bool is_valid() const { return system_handle != -1; } + }; + #else using stdfs::file_type; @@ -70,6 +79,14 @@ namespace fs using stdfs::file_status::type; }; + struct SystemHandle + { + using type = int; // file descriptor + type system_handle = -1; + + bool is_valid() const { return system_handle != -1; } + }; + #endif inline bool is_symlink(file_status s) noexcept @@ -110,6 +127,8 @@ namespace vcpkg::Files { std::string read_contents(const fs::path& file_path, LineInfo linfo) const; virtual Expected read_contents(const fs::path& file_path) const = 0; + ///

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 std::vector get_files_recursive(const fs::path& dir) const = 0; @@ -133,6 +152,9 @@ namespace vcpkg::Files virtual void remove_all(const fs::path& path, std::error_code& ec, fs::path& failure_point) = 0; void remove_all(const fs::path& path, LineInfo li); void remove_all(const fs::path& path, ignore_errors_t); + virtual void remove_all_inside(const fs::path& path, std::error_code& ec, fs::path& failure_point) = 0; + void remove_all_inside(const fs::path& path, LineInfo li); + void remove_all_inside(const fs::path& path, ignore_errors_t); bool exists(const fs::path& path, std::error_code& ec) const; bool exists(LineInfo li, const fs::path& path) const; bool exists(const fs::path& path, ignore_errors_t = ignore_errors) const; @@ -141,13 +163,16 @@ namespace vcpkg::Files virtual bool is_empty(const fs::path& path) const = 0; virtual bool create_directory(const fs::path& path, std::error_code& ec) = 0; bool create_directory(const fs::path& path, ignore_errors_t); + bool create_directory(const fs::path& path, LineInfo li); virtual bool create_directories(const fs::path& path, std::error_code& ec) = 0; bool create_directories(const fs::path& path, ignore_errors_t); + bool create_directories(const fs::path& path, LineInfo); virtual void copy(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts) = 0; virtual bool copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, std::error_code& ec) = 0; + void copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, LineInfo li); virtual void copy_symlink(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) = 0; virtual fs::file_status status(const fs::path& path, std::error_code& ec) const = 0; virtual fs::file_status symlink_status(const fs::path& path, std::error_code& ec) const = 0; @@ -155,9 +180,21 @@ namespace vcpkg::Files fs::file_status status(const fs::path& p, ignore_errors_t) const noexcept; fs::file_status symlink_status(LineInfo li, const fs::path& p) const noexcept; fs::file_status symlink_status(const fs::path& p, ignore_errors_t) const noexcept; + virtual fs::path absolute(const fs::path& path, std::error_code& ec) const = 0; + fs::path absolute(LineInfo li, const fs::path& path) const; virtual fs::path canonical(const fs::path& path, std::error_code& ec) const = 0; fs::path canonical(LineInfo li, const fs::path& path) const; fs::path canonical(const fs::path& path, ignore_errors_t) const; + virtual fs::path current_path(std::error_code&) const = 0; + fs::path current_path(LineInfo li) const; + virtual void current_path(const fs::path& path, std::error_code&) = 0; + void current_path(const fs::path& path, LineInfo li); + + // waits forever for the file lock + virtual fs::SystemHandle take_exclusive_file_lock(const fs::path& path, std::error_code&) = 0; + // waits, at most, 1.5 seconds, for the file lock + virtual fs::SystemHandle try_take_exclusive_file_lock(const fs::path& path, std::error_code&) = 0; + virtual void unlock_file_lock(fs::SystemHandle handle, std::error_code&) = 0; virtual std::vector find_from_PATH(const std::string& name) const = 0; }; @@ -169,4 +206,8 @@ namespace vcpkg::Files bool has_invalid_chars_for_filesystem(const std::string& s); void print_paths(const std::vector& paths); + + /// Performs "lhs / rhs" according to the C++17 Filesystem Library Specification. + /// This function exists as a workaround for TS implementations. + fs::path combine(const fs::path& lhs, const fs::path& rhs); } diff --git a/toolsrc/include/vcpkg/base/graphs.h b/toolsrc/include/vcpkg/base/graphs.h index f368a872d728d6..ac5f953dc3b322 100644 --- a/toolsrc/include/vcpkg/base/graphs.h +++ b/toolsrc/include/vcpkg/base/graphs.h @@ -1,12 +1,12 @@ #pragma once +#include +#include + #include #include #include -#include -#include - namespace vcpkg::Graphs { enum class ExplorationStatus @@ -34,7 +34,7 @@ namespace vcpkg::Graphs virtual int random(int max_exclusive) = 0; protected: - ~Randomizer() {} + ~Randomizer() { } }; namespace details diff --git a/toolsrc/include/vcpkg/base/ignore_errors.h b/toolsrc/include/vcpkg/base/ignore_errors.h index 44077059abe508..ed8b38c561c93b 100644 --- a/toolsrc/include/vcpkg/base/ignore_errors.h +++ b/toolsrc/include/vcpkg/base/ignore_errors.h @@ -1,10 +1,10 @@ -#pragma once - -namespace vcpkg -{ - struct ignore_errors_t - { - }; - - constexpr ignore_errors_t ignore_errors; -} +#pragma once + +namespace vcpkg +{ + struct ignore_errors_t + { + }; + + constexpr ignore_errors_t ignore_errors; +} diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h new file mode 100644 index 00000000000000..b7adde38f93b6a --- /dev/null +++ b/toolsrc/include/vcpkg/base/json.h @@ -0,0 +1,432 @@ +#pragma once + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace vcpkg::Json +{ + struct JsonStyle + { + enum class Newline + { + Lf, + CrLf + } newline_kind = Newline::Lf; + + constexpr JsonStyle() noexcept = default; + + static JsonStyle with_tabs() noexcept { return JsonStyle{-1}; } + static JsonStyle with_spaces(int indent) noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, indent >= 0); + return JsonStyle{indent}; + } + + void set_tabs() noexcept { this->indent = -1; } + void set_spaces(int indent_) noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, indent >= 0); + this->indent = indent_; + } + + bool use_tabs() const noexcept { return indent == -1; } + bool use_spaces() const noexcept { return indent >= 0; } + + int spaces() const noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, indent >= 0); + return indent; + } + + const char* newline() const noexcept + { + switch (this->newline_kind) + { + case Newline::Lf: return "\n"; + case Newline::CrLf: return "\r\n"; + default: Checks::exit_fail(VCPKG_LINE_INFO); + } + } + + private: + constexpr explicit JsonStyle(int indent) : indent(indent) { } + // -1 for tab, >=0 gives # of spaces + int indent = 2; + }; + + struct Array; + struct Object; + + enum class ValueKind + { + Null, + Boolean, + Integer, + Number, + String, + Array, + Object + }; + + 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(); + + ValueKind kind() const noexcept; + + bool is_null() const noexcept; + bool is_boolean() const noexcept; + bool is_integer() const noexcept; + // either integer _or_ number + bool is_number() const noexcept; + bool is_string() const noexcept; + bool is_array() const noexcept; + bool is_object() const noexcept; + + // a.x() asserts when !a.is_x() + bool boolean() const noexcept; + int64_t integer() const noexcept; + double number() const noexcept; + StringView string() const noexcept; + + const Array& array() const& noexcept; + Array& array() & noexcept; + Array&& array() && noexcept; + + const Object& object() const& noexcept; + Object& object() & noexcept; + Object&& object() && noexcept; + + static Value null(std::nullptr_t) noexcept; + 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 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; + std::unique_ptr underlying_; + }; + + struct Array + { + private: + using underlying_t = std::vector; + + public: + Array() = default; + Array(Array const&) = default; + Array(Array&&) = default; + Array& operator=(Array const&) = default; + Array& operator=(Array&&) = default; + ~Array() = default; + + using iterator = underlying_t::iterator; + using const_iterator = underlying_t::const_iterator; + + Value& push_back(Value&& value); + Object& push_back(Object&& value); + Array& push_back(Array&& value); + Value& insert_before(iterator it, Value&& value); + Object& insert_before(iterator it, Object&& value); + Array& insert_before(iterator it, Array&& value); + + std::size_t size() const noexcept { return this->underlying_.size(); } + + // asserts idx < size + Value& operator[](std::size_t idx) noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, idx < this->size()); + return this->underlying_[idx]; + } + const Value& operator[](std::size_t idx) const noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, idx < this->size()); + return this->underlying_[idx]; + } + + iterator begin() { return underlying_.begin(); } + iterator end() { return underlying_.end(); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + 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 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&) = default; + Object(Object&&) = default; + Object& operator=(Object const&) = default; + Object& operator=(Object&&) = default; + ~Object() = default; + + // 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; + + // asserts on lookup failure + Value& operator[](StringView key) noexcept + { + auto res = this->get(key); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + return *res; + } + const Value& operator[](StringView key) const noexcept + { + auto res = this->get(key); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + return *res; + } + + Value* get(StringView key) noexcept; + const Value* get(StringView key) const noexcept; + + 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; + using reference = value_type; + using iterator_category = std::forward_iterator_tag; + + value_type operator*() const noexcept { return *underlying_; } + const_iterator& operator++() noexcept + { + ++underlying_; + return *this; + } + const_iterator operator++(int) noexcept + { + auto res = *this; + ++underlying_; + return res; + } + + bool operator==(const_iterator other) const noexcept { return this->underlying_ == other.underlying_; } + bool operator!=(const_iterator other) const noexcept { return !(this->underlying_ == other.underlying_); } + + private: + friend struct Object; + explicit const_iterator(const underlying_t::const_iterator& it) : underlying_(it) { } + underlying_t::const_iterator underlying_; + }; + using iterator = const_iterator; + + const_iterator begin() const noexcept { return this->cbegin(); } + const_iterator end() const noexcept { return this->cend(); } + 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 + { + 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; + + virtual ~ReaderError() = default; + }; + + struct Reader + { + explicit Reader(ReaderError* err) : err(err) { } + + ReaderError& error() const { return *err; } + + private: + ReaderError* err; + + template + using VisitorType = typename std::remove_reference_t::type; + + template + Optional> internal_visit(const Value& value, StringView key, Visitor& 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()); + } + + vcpkg::Checks::exit_fail(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) + { + auto value = obj.get(key); + if (!value) + { + return false; + } + + Optional> opt = internal_visit(*value, key, visitor); + + if (auto val = opt.get()) + { + place = std::move(*val); + } + else + { + err->add_expected_type(key.to_string(), visitor.type_name().to_string()); + } + + return true; + } + + public: + template + void required_object_field( + StringView type, const Object& obj, StringView key, VisitorType& place, Visitor&& visitor) + { + if (!internal_field(obj, key, place, visitor)) + { + err->add_missing_field(type.to_string(), key.to_string()); + } + } + + template + void optional_object_field(const Object& obj, StringView key, VisitorType& place, Visitor&& visitor) + { + internal_field(obj, key, place, visitor); + } + + template + Optional>> array_elements(const Array& arr, StringView key, Visitor&& visitor) + { + std::vector> result; + for (const auto& el : arr) + { + auto opt = internal_visit(el, key, visitor); + if (auto p = opt.get()) + { + result.push_back(std::move(*p)); + } + else + { + return nullopt; + } + } + return std::move(result); + } + }; + + // Warning: NEVER use this type except as a CRTP base + template + struct VisitorCrtpBase + { + // 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)); + } + 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&) + { + return Optional(nullopt); + } + auto visit_object(Reader&, StringView, const Json::Object&) + { + return Optional(nullopt); + } + // 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::string stringify(const Value&, JsonStyle style); + std::string stringify(const Object&, JsonStyle style); + std::string stringify(const Array&, JsonStyle style); + +} diff --git a/toolsrc/include/vcpkg/base/lazy.h b/toolsrc/include/vcpkg/base/lazy.h index 58c11c002fd616..d0afdaeb26c5f8 100644 --- a/toolsrc/include/vcpkg/base/lazy.h +++ b/toolsrc/include/vcpkg/base/lazy.h @@ -6,7 +6,7 @@ namespace vcpkg class Lazy { public: - Lazy() : value(T()), initialized(false) {} + Lazy() : value(T()), initialized(false) { } template T const& get_lazy(const F& f) const diff --git a/toolsrc/include/vcpkg/base/lineinfo.h b/toolsrc/include/vcpkg/base/lineinfo.h index 2f03fef162331a..b90b6fac3e4b75 100644 --- a/toolsrc/include/vcpkg/base/lineinfo.h +++ b/toolsrc/include/vcpkg/base/lineinfo.h @@ -6,8 +6,8 @@ namespace vcpkg { struct LineInfo { - constexpr LineInfo() noexcept : m_line_number(0), m_file_name("") {} - constexpr LineInfo(const int lineno, const char* filename) : m_line_number(lineno), m_file_name(filename) {} + constexpr LineInfo() noexcept : m_line_number(0), m_file_name("") { } + constexpr LineInfo(const int lineno, const char* filename) : m_line_number(lineno), m_file_name(filename) { } std::string to_string() const; void to_string(std::string& out) const; diff --git a/toolsrc/include/vcpkg/base/optional.h b/toolsrc/include/vcpkg/base/optional.h index 50586ecc8d2528..091cd498ed9e3f 100644 --- a/toolsrc/include/vcpkg/base/optional.h +++ b/toolsrc/include/vcpkg/base/optional.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -9,7 +10,7 @@ namespace vcpkg { struct NullOpt { - explicit constexpr NullOpt(int) {} + explicit constexpr NullOpt(int) { } }; const static constexpr NullOpt nullopt{0}; @@ -19,29 +20,23 @@ namespace vcpkg template::value> struct OptionalStorage { -#if defined(_WIN32) -#pragma warning(suppress : 26495) -#endif - constexpr OptionalStorage() noexcept : m_is_present(false), m_inactive() {} - constexpr OptionalStorage(const T& t) : m_is_present(true), m_t(t) {} - constexpr OptionalStorage(T&& t) : m_is_present(true), m_t(std::move(t)) {} + VCPKG_MSVC_WARNING(suppress : 26495) + constexpr OptionalStorage() noexcept : m_is_present(false), m_inactive() { } + constexpr OptionalStorage(const T& t) : m_is_present(true), m_t(t) { } + constexpr OptionalStorage(T&& t) : m_is_present(true), m_t(std::move(t)) { } ~OptionalStorage() noexcept { if (m_is_present) m_t.~T(); } -#if defined(_WIN32) -#pragma warning(suppress : 26495) -#endif + VCPKG_MSVC_WARNING(suppress : 26495) OptionalStorage(const OptionalStorage& o) : m_is_present(o.m_is_present), m_inactive() { if (m_is_present) new (&m_t) T(o.m_t); } -#if defined(_WIN32) -#pragma warning(suppress : 26495) -#endif + VCPKG_MSVC_WARNING(suppress : 26495) OptionalStorage(OptionalStorage&& o) noexcept : m_is_present(o.m_is_present), m_inactive() { if (m_is_present) @@ -100,7 +95,8 @@ namespace vcpkg } bool m_is_present; - union { + union + { char m_inactive; T m_t; }; @@ -109,20 +105,16 @@ namespace vcpkg template struct OptionalStorage { -#if defined(_WIN32) -#pragma warning(suppress : 26495) -#endif - constexpr OptionalStorage() noexcept : m_is_present(false), m_inactive() {} - constexpr OptionalStorage(T&& t) : m_is_present(true), m_t(std::move(t)) {} + VCPKG_MSVC_WARNING(suppress : 26495) + constexpr OptionalStorage() noexcept : m_is_present(false), m_inactive() { } + constexpr OptionalStorage(T&& t) : m_is_present(true), m_t(std::move(t)) { } ~OptionalStorage() noexcept { if (m_is_present) m_t.~T(); } -#if defined(_WIN32) -#pragma warning(suppress : 26495) -#endif + VCPKG_MSVC_WARNING(suppress : 26495) OptionalStorage(OptionalStorage&& o) noexcept : m_is_present(o.m_is_present), m_inactive() { if (m_is_present) @@ -163,7 +155,8 @@ namespace vcpkg } bool m_is_present; - union { + union + { char m_inactive; T m_t; }; @@ -172,8 +165,8 @@ namespace vcpkg template struct OptionalStorage { - constexpr OptionalStorage() noexcept : m_t(nullptr) {} - constexpr OptionalStorage(T& t) : m_t(&t) {} + constexpr OptionalStorage() noexcept : m_t(nullptr) { } + constexpr OptionalStorage(T& t) : m_t(&t) { } constexpr bool has_value() const { return m_t != nullptr; } @@ -190,10 +183,10 @@ namespace vcpkg template struct Optional { - constexpr Optional() noexcept {} + constexpr Optional() noexcept { } // Constructors are intentionally implicit - constexpr Optional(NullOpt) {} + constexpr Optional(NullOpt) { } template, Optional>::value>> constexpr Optional(U&& t) : m_base(std::forward(t)) diff --git a/toolsrc/include/vcpkg/parse.h b/toolsrc/include/vcpkg/base/parse.h similarity index 53% rename from toolsrc/include/vcpkg/parse.h rename to toolsrc/include/vcpkg/base/parse.h index 539bb2ed7f6ae8..cc5db02d375ca6 100644 --- a/toolsrc/include/vcpkg/parse.h +++ b/toolsrc/include/vcpkg/base/parse.h @@ -3,6 +3,8 @@ #include #include #include +#include + #include #include @@ -42,41 +44,31 @@ namespace vcpkg::Parse { struct SourceLoc { - const char* it; + Unicode::Utf8Decoder it; + Unicode::Utf8Decoder start_of_line; int row; int column; }; - void init(CStringView text, CStringView origin, TextRowCol init_rowcol = {}) - { - m_text = text; - m_origin = origin; - m_it = text.c_str(); - row = init_rowcol.row ? init_rowcol.row : 1; - column = init_rowcol.column ? init_rowcol.column : 1; - } + ParserBase(StringView text, StringView origin, TextRowCol init_rowcol = {}); - static constexpr bool is_whitespace(char ch) { return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'; } - static constexpr bool is_lower_alpha(char ch) { return ch >= 'a' && ch <= 'z'; } - static constexpr bool is_upper_alpha(char ch) { return ch >= 'A' && ch <= 'Z'; } - static constexpr bool is_ascii_digit(char ch) { return ch >= '0' && ch <= '9'; } - static constexpr bool is_lineend(char ch) { return ch == '\r' || ch == '\n' || ch == '\0'; } - static constexpr bool is_alphanum(char ch) + static constexpr bool is_whitespace(char32_t ch) { return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'; } + static constexpr bool is_lower_alpha(char32_t ch) { return ch >= 'a' && ch <= 'z'; } + static constexpr bool is_upper_alpha(char32_t ch) { return ch >= 'A' && ch <= 'Z'; } + static constexpr bool is_ascii_digit(char32_t ch) { return ch >= '0' && ch <= '9'; } + static constexpr bool is_lineend(char32_t ch) { return ch == '\r' || ch == '\n' || ch == Unicode::end_of_file; } + static constexpr bool is_alphanum(char32_t ch) { return is_upper_alpha(ch) || is_lower_alpha(ch) || is_ascii_digit(ch); } - static constexpr bool is_alphanumdash(char ch) { return is_alphanum(ch) || ch == '-'; } + static constexpr bool is_alphanumdash(char32_t ch) { return is_alphanum(ch) || ch == '-'; } StringView skip_whitespace() { return match_zero_or_more(is_whitespace); } StringView skip_tabs_spaces() { - return match_zero_or_more([](char ch) { return ch == ' ' || ch == '\t'; }); - } - void skip_to_eof() - { - while (cur()) - ++m_it; + return match_zero_or_more([](char32_t ch) { return ch == ' ' || ch == '\t'; }); } + void skip_to_eof() { m_it = m_it.end(); } void skip_newline() { if (cur() == '\r') next(); @@ -91,29 +83,29 @@ namespace vcpkg::Parse template StringView match_zero_or_more(Pred p) { - const char* start = m_it; + const char* start = m_it.pointer_to_current(); auto ch = cur(); - while (ch != '\0' && p(ch)) + while (ch != Unicode::end_of_file && p(ch)) ch = next(); - return {start, m_it}; + return {start, m_it.pointer_to_current()}; } template StringView match_until(Pred p) { - const char* start = m_it; + const char* start = m_it.pointer_to_current(); auto ch = cur(); - while (ch != '\0' && !p(ch)) + while (ch != Unicode::end_of_file && !p(ch)) ch = next(); - return {start, m_it}; + return {start, m_it.pointer_to_current()}; } - CStringView text() const { return m_text; } - const char* it() const { return m_it; } - char cur() const { return *m_it; } - SourceLoc cur_loc() const { return {m_it, row, column}; } - TextRowCol cur_rowcol() const { return {row, column}; } - char next(); - bool at_eof() const { return *m_it == 0; } + StringView text() const { return m_text; } + Unicode::Utf8Decoder it() const { return m_it; } + char32_t cur() const { return m_it == m_it.end() ? Unicode::end_of_file : *m_it; } + SourceLoc cur_loc() const { return {m_it, m_start_of_line, m_row, m_column}; } + TextRowCol cur_rowcol() const { return {m_row, m_column}; } + char32_t next(); + bool at_eof() const { return m_it == m_it.end(); } void add_error(std::string message) { add_error(std::move(message), cur_loc()); } void add_error(std::string message, const SourceLoc& loc); @@ -122,12 +114,13 @@ namespace vcpkg::Parse std::unique_ptr extract_error() { return std::move(m_err); } private: - const char* m_it; - int row; - int column; + Unicode::Utf8Decoder m_it; + Unicode::Utf8Decoder m_start_of_line; + int m_row; + int m_column; - CStringView m_text; - CStringView m_origin; + StringView m_text; + StringView m_origin; std::unique_ptr m_err; }; diff --git a/toolsrc/include/vcpkg/base/pragmas.h b/toolsrc/include/vcpkg/base/pragmas.h new file mode 100644 index 00000000000000..73f14c4b246637 --- /dev/null +++ b/toolsrc/include/vcpkg/base/pragmas.h @@ -0,0 +1,34 @@ +#pragma once + +#if defined(_MSC_VER) && _MSC_VER < 1911 +// [[nodiscard]] is not recognized before VS 2017 version 15.3 +#pragma warning(disable : 5030) +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1910 +// https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4800?view=vs-2019 +#pragma warning(disable : 4800) +#endif + +#if defined(__GNUC__) && __GNUC__ < 7 +// [[nodiscard]] is not recognized before GCC version 7 +#pragma GCC diagnostic ignored "-Wattributes" +#endif + +#if defined(_MSC_VER) +#include +#endif + +#if defined(_MSC_VER) +#define ASSUME(expr) __assume(expr) +#else +#define ASSUME(expr) +#endif + +#ifdef _MSC_VER +#define VCPKG_MSVC_WARNING(...) __pragma(warning(__VA_ARGS__)) +#define GCC_DIAGNOSTIC(...) +#else +#define VCPKG_MSVC_WARNING(...) +#define GCC_DIAGNOSTIC(...) _Pragma("diagnostic " #__VA_ARGS__) +#endif diff --git a/toolsrc/include/vcpkg/base/sortedvector.h b/toolsrc/include/vcpkg/base/sortedvector.h index fbb7e5a5aeb41d..33379676e831e1 100644 --- a/toolsrc/include/vcpkg/base/sortedvector.h +++ b/toolsrc/include/vcpkg/base/sortedvector.h @@ -13,7 +13,7 @@ namespace vcpkg using size_type = typename std::vector::size_type; using iterator = typename std::vector::const_iterator; - SortedVector() : m_data() {} + SortedVector() : m_data() { } explicit SortedVector(std::vector v) : m_data(std::move(v)) { diff --git a/toolsrc/include/vcpkg/base/span.h b/toolsrc/include/vcpkg/base/span.h index a5ba884aff4e46..221cccc8cec8bd 100644 --- a/toolsrc/include/vcpkg/base/span.h +++ b/toolsrc/include/vcpkg/base/span.h @@ -1,57 +1,57 @@ -#pragma once - -#include -#include -#include -#include - -namespace vcpkg -{ - template - struct Span - { - public: - static_assert(std::is_object::value, "Span is illegal"); - - using value_type = std::decay_t; - using element_type = T; - using pointer = std::add_pointer_t; - using reference = std::add_lvalue_reference_t; - using iterator = pointer; - - constexpr Span() noexcept : m_ptr(nullptr), m_count(0) {} - constexpr Span(std::nullptr_t) noexcept : m_ptr(nullptr), m_count(0) {} - constexpr Span(pointer ptr, size_t count) noexcept : m_ptr(ptr), m_count(count) {} - constexpr Span(pointer ptr_begin, pointer ptr_end) noexcept : m_ptr(ptr_begin), m_count(ptr_end - ptr_begin) {} - - template - constexpr Span(T (&arr)[N]) noexcept : m_ptr(arr), m_count(N) - { - } - - template>> - constexpr Span(std::remove_const_t (&arr)[N]) noexcept : m_ptr(arr), m_count(N) - { - } - - template().data()), - class = std::enable_if_t, Span>::value>> - constexpr Span(Range&& v) noexcept : Span(v.data(), v.size()) - { - static_assert(std::is_same::value_type, value_type>::value, - "Cannot convert incompatible ranges"); - } - - constexpr iterator begin() const { return m_ptr; } - constexpr iterator end() const { return m_ptr + m_count; } - - constexpr reference operator[](size_t i) const { return m_ptr[i]; } - constexpr pointer data() const { return m_ptr; } - constexpr size_t size() const { return m_count; } - - private: - pointer m_ptr; - size_t m_count; - }; -} +#pragma once + +#include +#include +#include +#include + +namespace vcpkg +{ + template + struct Span + { + public: + static_assert(std::is_object::value, "Span is illegal"); + + using value_type = std::decay_t; + using element_type = T; + using pointer = std::add_pointer_t; + using reference = std::add_lvalue_reference_t; + using iterator = pointer; + + constexpr Span() noexcept : m_ptr(nullptr), m_count(0) { } + constexpr Span(std::nullptr_t) noexcept : m_ptr(nullptr), m_count(0) { } + constexpr Span(pointer ptr, size_t count) noexcept : m_ptr(ptr), m_count(count) { } + constexpr Span(pointer ptr_begin, pointer ptr_end) noexcept : m_ptr(ptr_begin), m_count(ptr_end - ptr_begin) { } + + template + constexpr Span(T (&arr)[N]) noexcept : m_ptr(arr), m_count(N) + { + } + + template>> + constexpr Span(std::remove_const_t (&arr)[N]) noexcept : m_ptr(arr), m_count(N) + { + } + + template().data()), + class = std::enable_if_t, Span>::value>> + constexpr Span(Range&& v) noexcept : Span(v.data(), v.size()) + { + static_assert(std::is_same::value_type, value_type>::value, + "Cannot convert incompatible ranges"); + } + + constexpr iterator begin() const { return m_ptr; } + constexpr iterator end() const { return m_ptr + m_count; } + + constexpr reference operator[](size_t i) const { return m_ptr[i]; } + constexpr pointer data() const { return m_ptr; } + constexpr size_t size() const { return m_count; } + + private: + pointer m_ptr; + size_t m_count; + }; +} diff --git a/toolsrc/include/vcpkg/base/stringliteral.h b/toolsrc/include/vcpkg/base/stringliteral.h index 602e0bfd23146d..43d17182959891 100644 --- a/toolsrc/include/vcpkg/base/stringliteral.h +++ b/toolsrc/include/vcpkg/base/stringliteral.h @@ -1,8 +1,9 @@ #pragma once -#include #include +#include + namespace vcpkg { struct StringLiteral : ZStringView diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 481e686d11088a..5042dd15883149 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -2,10 +2,14 @@ #include #include +#include #include #include #include -#include + +#include +#include +#include #include @@ -47,6 +51,7 @@ namespace vcpkg::Strings::details } inline void append_internal(std::string& into, const char* v) { into.append(v); } inline void append_internal(std::string& into, const std::string& s) { into.append(s); } + inline void append_internal(std::string& into, StringView s) { into.append(s.begin(), s.end()); } template().to_string(std::declval()))> void append_internal(std::string& into, const T& t) @@ -59,6 +64,11 @@ namespace vcpkg::Strings::details { to_string(into, t); } + + struct tolower_char + { + char operator()(char c) const { return (c < 'A' || c > 'Z') ? c : c - 'A' + 'a'; } + }; } namespace vcpkg::Strings @@ -116,6 +126,11 @@ namespace vcpkg::Strings bool case_insensitive_ascii_equals(StringView left, StringView right); + template + void ascii_to_lowercase(It first, It last) + { + std::transform(first, last, first, details::tolower_char{}); + } std::string ascii_to_lowercase(std::string&& s); std::string ascii_to_uppercase(std::string&& s); @@ -133,11 +148,11 @@ namespace vcpkg::Strings } std::string output; - output.append(transformer(*begin)); + append(output, transformer(*begin)); for (auto it = std::next(begin); it != end; ++it) { output.append(delimiter); - output.append(transformer(*it)); + append(output, transformer(*it)); } return output; @@ -146,8 +161,8 @@ namespace vcpkg::Strings template std::string join(const char* delimiter, const Container& v, Transformer transformer) { - const auto begin = v.begin(); - const auto end = v.end(); + const auto begin = std::begin(v); + const auto end = std::end(v); return join(delimiter, begin, end, transformer); } @@ -162,7 +177,7 @@ namespace vcpkg::Strings template std::string join(const char* delimiter, const Container& v) { - using Element = decltype(*v.begin()); + using Element = decltype(*std::begin(v)); return join(delimiter, v, [](const Element& x) -> const Element& { return x; }); } @@ -170,11 +185,13 @@ 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(const std::string& s, const std::string& delimiter); + std::vector split(StringView s, const char delimiter); - std::vector split(const std::string& s, const std::string& delimiter, size_t max_count); + const char* find_first_of(StringView searched, StringView candidates); std::vector find_all_enclosed(StringView input, StringView left_delim, StringView right_delim); @@ -192,6 +209,77 @@ namespace vcpkg::Strings return ret; } + // Equivalent to one of the `::strto[T]` functions. Returns `nullopt` if there is an error. + template + Optional strto(CStringView sv); + + template<> + inline Optional strto(CStringView sv) + { + char* endptr = nullptr; + double res = strtod(sv.c_str(), &endptr); + if (endptr == sv.c_str()) + { + // no digits + return nullopt; + } + // else, we may have HUGE_VAL but we expect the caller to deal with that + return res; + } + + template<> + inline Optional strto(CStringView sv) + { + char* endptr = nullptr; + long res = strtol(sv.c_str(), &endptr, 10); + if (endptr == sv.c_str()) + { + // no digits + return nullopt; + } + if (errno == ERANGE) + { + // out of bounds + return nullopt; + } + + return res; + } + + template<> + inline Optional strto(CStringView sv) + { + char* endptr = nullptr; + long long res = strtoll(sv.c_str(), &endptr, 10); + if (endptr == sv.c_str()) + { + // no digits + return nullopt; + } + if (errno == ERANGE) + { + // out of bounds + return nullopt; + } + + return res; + } + + template<> + inline Optional strto(CStringView sv) + { + auto res = strto(sv); + if (auto r = res.get()) + { + if (*r < INT_MIN || *r > INT_MAX) + { + return nullopt; + } + return static_cast(*r); + } + return nullopt; + } + const char* search(StringView haystack, StringView needle); bool contains(StringView haystack, StringView needle); diff --git a/toolsrc/include/vcpkg/base/stringview.h b/toolsrc/include/vcpkg/base/stringview.h index 8503f5f10415ec..405142c3683f53 100644 --- a/toolsrc/include/vcpkg/base/stringview.h +++ b/toolsrc/include/vcpkg/base/stringview.h @@ -2,6 +2,7 @@ #include +#include #include #include @@ -23,23 +24,32 @@ namespace vcpkg constexpr StringView() = default; StringView(const std::string& s); // Implicit by design + + // NOTE: we do this instead of the delegating constructor since delegating ctors are a perf footgun template - StringView(const char (&arr)[Sz]) : m_ptr(arr), m_size(Sz - 1) + constexpr StringView(const char (&arr)[Sz]) : m_ptr(arr), m_size(Sz - 1) { } - constexpr StringView(const char* ptr, size_t size) : m_ptr(ptr), m_size(size) {} - constexpr StringView(const char* b, const char* e) : m_ptr(b), m_size(static_cast(e - b)) {} + constexpr StringView(const char* ptr, size_t size) : m_ptr(ptr), m_size(size) { } + constexpr StringView(const char* b, const char* e) : m_ptr(b), m_size(static_cast(e - b)) { } 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; } std::string to_string() const; void to_string(std::string& out) const; + StringView substr(size_t pos, size_t count = std::numeric_limits::max()) const; + + constexpr char byte_at_index(size_t pos) const { return m_ptr[pos]; } + private: const char* m_ptr = 0; size_t m_size = 0; @@ -47,4 +57,8 @@ namespace vcpkg bool operator==(StringView lhs, StringView rhs) noexcept; bool operator!=(StringView lhs, StringView rhs) noexcept; + bool operator<(StringView lhs, StringView rhs) noexcept; + bool operator>(StringView lhs, StringView rhs) noexcept; + bool operator<=(StringView lhs, StringView rhs) noexcept; + bool operator>=(StringView lhs, StringView rhs) noexcept; } diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 4172f0c5001e47..2340728fd032ce 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -9,6 +9,14 @@ namespace vcpkg::System { Optional get_environment_variable(ZStringView varname) noexcept; + const ExpectedS& get_home_dir() noexcept; + + const ExpectedS& get_platform_cache_home() noexcept; + +#ifdef _WIN32 + const ExpectedS& get_appdata_local() noexcept; +#endif + Optional get_registry_string(void* base_hkey, StringView subkey, StringView valuename); enum class CPUArchitecture @@ -17,6 +25,7 @@ namespace vcpkg::System X64, ARM, ARM64, + S390X, }; Optional to_cpu_architecture(StringView arch); diff --git a/toolsrc/include/vcpkg/base/system.print.h b/toolsrc/include/vcpkg/base/system.print.h index 890c13667dd81f..abe685cf5f98a1 100644 --- a/toolsrc/include/vcpkg/base/system.print.h +++ b/toolsrc/include/vcpkg/base/system.print.h @@ -41,4 +41,27 @@ namespace vcpkg::System { ::vcpkg::System::details::print(Strings::concat_or_view(args...)); } + + class BufferedPrint + { + ::std::string stdout_buffer; + static constexpr ::std::size_t buffer_size_target = 2048; + static constexpr ::std::size_t expected_maximum_print = 256; + static constexpr ::std::size_t alloc_size = buffer_size_target + expected_maximum_print; + + public: + BufferedPrint() { stdout_buffer.reserve(alloc_size); } + BufferedPrint(const BufferedPrint&) = delete; + BufferedPrint& operator=(const BufferedPrint&) = delete; + void append(::vcpkg::StringView nextView) + { + stdout_buffer.append(nextView.data(), nextView.size()); + if (stdout_buffer.size() > buffer_size_target) + { + ::vcpkg::System::details::print(stdout_buffer); + stdout_buffer.clear(); + } + } + ~BufferedPrint() { ::vcpkg::System::details::print(stdout_buffer); } + }; } diff --git a/toolsrc/include/vcpkg/base/system.process.h b/toolsrc/include/vcpkg/base/system.process.h index 51ea728c34699f..91faa59854b4e2 100644 --- a/toolsrc/include/vcpkg/base/system.process.h +++ b/toolsrc/include/vcpkg/base/system.process.h @@ -19,9 +19,21 @@ namespace vcpkg::System std::string s; }; - std::string make_cmake_cmd(const fs::path& cmake_exe, - const fs::path& cmake_script, - const std::vector& pass_variables); + std::string make_basic_cmake_cmd(const fs::path& cmake_tool_path, + const fs::path& cmake_script, + const std::vector& pass_variables); + + struct CmdLineBuilder + { + CmdLineBuilder& path_arg(const fs::path& p) { return string_arg(p.u8string()); } + CmdLineBuilder& string_arg(StringView s); + std::string extract() noexcept { return std::move(buf); } + + operator ZStringView() const { return buf; } + + private: + std::string buf; + }; fs::path get_exe_path_of_current_process(); diff --git a/toolsrc/include/vcpkg/base/system_headers.h b/toolsrc/include/vcpkg/base/system_headers.h new file mode 100644 index 00000000000000..6667fd3951c538 --- /dev/null +++ b/toolsrc/include/vcpkg/base/system_headers.h @@ -0,0 +1,40 @@ +#pragma once + +#if defined(_WIN32) + +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#pragma warning(suppress : 4768) +#include + +#pragma warning(suppress : 4768) +#include + +#else // ^^^^ Windows / Unix vvvv + +// 2020-05-19: workaround for a c standard library bug +// ctermid is not behind an `extern "C"` barrier, so it's linked incorrectly. +// This has been reported; remove it after 2023-05-19 +#if __APPLE__ +extern "C" +{ +#endif + +#include + +#if __APPLE__ +} +#endif + +#endif + +#include +// glibc defines major and minor in sys/types.h, and should not +#undef major +#undef minor diff --git a/toolsrc/include/vcpkg/base/uint128.h b/toolsrc/include/vcpkg/base/uint128.h index 6b7816760f2cd2..feac68bb7a7999 100644 --- a/toolsrc/include/vcpkg/base/uint128.h +++ b/toolsrc/include/vcpkg/base/uint128.h @@ -2,25 +2,23 @@ #include -namespace vcpkg { +namespace vcpkg +{ + struct UInt128 + { + UInt128() = default; + UInt128(uint64_t value) : bottom(value), top(0) { } -struct UInt128 { - UInt128() = default; - UInt128(uint64_t value) : bottom(value), top(0) {} + UInt128& operator<<=(int by) noexcept; + UInt128& operator>>=(int by) noexcept; + UInt128& operator+=(uint64_t lhs) noexcept; - UInt128& operator<<=(int by) noexcept; - UInt128& operator>>=(int by) noexcept; - UInt128& operator+=(uint64_t lhs) noexcept; + uint64_t bottom_64_bits() const noexcept { return bottom; } + uint64_t top_64_bits() const noexcept { return top; } - uint64_t bottom_64_bits() const noexcept { - return bottom; - } - uint64_t top_64_bits() const noexcept { - return top; - } -private: - uint64_t bottom; - uint64_t top; -}; + private: + uint64_t bottom; + uint64_t top; + }; } diff --git a/toolsrc/include/vcpkg/base/unicode.h b/toolsrc/include/vcpkg/base/unicode.h new file mode 100644 index 00000000000000..c2143a23578e77 --- /dev/null +++ b/toolsrc/include/vcpkg/base/unicode.h @@ -0,0 +1,148 @@ +#pragma once + +#include + +namespace vcpkg::Unicode +{ + enum class Utf8CodeUnitKind + { + Invalid = -1, + Continue = 0, + StartOne = 1, + StartTwo = 2, + StartThree = 3, + StartFour = 4, + }; + + Utf8CodeUnitKind utf8_code_unit_kind(unsigned char code_unit) noexcept; + int utf8_code_unit_count(Utf8CodeUnitKind kind) noexcept; + int utf8_code_unit_count(char code_unit) noexcept; + + int utf8_encode_code_point(char (&array)[4], char32_t code_point) noexcept; + + template + String& utf8_append_code_point(String& str, char32_t code_point) + { + char buf[4] = {}; + int count = ::vcpkg::Unicode::utf8_encode_code_point(buf, code_point); + str.append(buf, buf + count); + return str; + } + + bool utf8_is_valid_string(const char* first, const char* last) noexcept; + + constexpr bool utf16_is_leading_surrogate_code_point(char32_t code_point) + { + return code_point >= 0xD800 && code_point < 0xDC00; + } + constexpr bool utf16_is_trailing_surrogate_code_point(char32_t code_point) + { + return code_point >= 0xDC00 && code_point < 0xE000; + } + constexpr bool utf16_is_surrogate_code_point(char32_t code_point) + { + return code_point >= 0xD800 && code_point < 0xE000; + } + + char32_t utf16_surrogates_to_code_point(char32_t leading, char32_t trailing); + + constexpr static char32_t end_of_file = 0xFFFF'FFFF; + + enum class utf8_errc + { + NoError = 0, + InvalidCodeUnit = 1, + InvalidCodePoint = 2, + PairedSurrogates = 3, + UnexpectedContinue = 4, + UnexpectedStart = 5, + UnexpectedEof = 6, + }; + + struct utf8_category : std::error_category + { + const char* name() const noexcept override; + std::string message(int condition) const override; + }; + + inline std::error_code make_error_code(utf8_errc err) noexcept + { + return std::error_code(static_cast(err), utf8_category()); + } + + /* + There are two ways to parse utf-8: we could allow unpaired surrogates (as in [wtf-8]) -- this is important + for representing things like file paths on Windows. We could also require strict utf-8, as in the JSON + specification. We need both, since when parsing JSON, we need to require strict utf-8; however, when + outputting JSON, we need to be able to stringify unpaired surrogates (as '\uDxyz'). This dichotomy is an + issue _because_ we need to be able to decode two different kinds of utf-8: utf-8 as read off of a disk + (strict), and utf-8 as contained in a C++ string (non-strict). + + Since one is a strict superset of the other, we allow the non-strict utf-8 in this decoder; if a consumer + wishes to make certain that the utf-8 is strictly conforming, it will have to do the check on it's own with + `utf16_is_surrogate_code_point`. + + [wtf-8]: https://simonsapin.github.io/wtf-8/ + */ + struct Utf8Decoder + { + Utf8Decoder() noexcept; + Utf8Decoder(const char* first, const char* last) noexcept; + + struct sentinel + { + }; + + bool is_eof() const noexcept; + + void next(std::error_code& ec); + + Utf8Decoder& operator=(sentinel) noexcept; + + char const* pointer_to_current() const noexcept; + + char32_t operator*() const noexcept; + + Utf8Decoder& operator++() noexcept; + Utf8Decoder operator++(int) noexcept + { + auto res = *this; + ++*this; + return res; + } + + Utf8Decoder begin() const { return *this; } + + sentinel end() const { return sentinel(); } + + friend bool operator==(const Utf8Decoder& lhs, const Utf8Decoder& rhs) noexcept; + + using difference_type = std::ptrdiff_t; + using value_type = char32_t; + using pointer = void; + using reference = char32_t; + using iterator_category = std::forward_iterator_tag; + + private: + char32_t current_; + const char* next_; + const char* last_; + }; + + inline bool operator!=(const Utf8Decoder& lhs, const Utf8Decoder& rhs) noexcept { return !(lhs == rhs); } + + inline bool operator==(const Utf8Decoder& d, Utf8Decoder::sentinel) { return d.is_eof(); } + inline bool operator==(Utf8Decoder::sentinel s, const Utf8Decoder& d) { return d == s; } + inline bool operator!=(const Utf8Decoder& d, Utf8Decoder::sentinel) { return !d.is_eof(); } + inline bool operator!=(Utf8Decoder::sentinel s, const Utf8Decoder& d) { return d != s; } + +} + +namespace std +{ + template<> + struct is_error_code_enum : std::true_type + { + }; + +} diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 849781b95daf89..a6d8781b057239 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -22,6 +22,11 @@ namespace vcpkg::Util { augend->insert(augend->end(), addend.begin(), addend.end()); } + template + bool contains(const Vec& container, const Key& item) + { + return std::find(container.begin(), container.end(), item) != container.end(); + } } namespace Sets @@ -44,6 +49,19 @@ namespace vcpkg::Util } } + template> + std::vector filter(const Range& xs, Pred&& f) + { + std::vector ret; + + for (auto&& x : xs) + { + if (f(x)) ret.push_back(x); + } + + return ret; + } + template using FmapOut = std::remove_reference_t()(*std::declval().begin()))>; @@ -200,7 +218,7 @@ namespace vcpkg::Util T* get() { return &m_ptr; } - LockGuardPtr(LockGuarded& sync) : m_lock(sync.m_mutex), m_ptr(sync.m_t) {} + LockGuardPtr(LockGuarded& sync) : m_lock(sync.m_mutex), m_ptr(sync.m_t) { } private: std::unique_lock m_lock; diff --git a/toolsrc/include/vcpkg/base/view.h b/toolsrc/include/vcpkg/base/view.h index 8a9c4099440f54..491e8351b25e21 100644 --- a/toolsrc/include/vcpkg/base/view.h +++ b/toolsrc/include/vcpkg/base/view.h @@ -1,9 +1,9 @@ -#pragma once - -#include - -namespace vcpkg -{ - template - using View = Span; -} +#pragma once + +#include + +namespace vcpkg +{ + template + using View = Span; +} diff --git a/toolsrc/include/vcpkg/base/work_queue.h b/toolsrc/include/vcpkg/base/work_queue.h deleted file mode 100644 index a60613a3c902b2..00000000000000 --- a/toolsrc/include/vcpkg/base/work_queue.h +++ /dev/null @@ -1,140 +0,0 @@ -#pragma once - -#include - -#include -#include -#include - -namespace vcpkg -{ - template - struct WorkQueue - { - WorkQueue(LineInfo li) : m_line_info(li) {} - WorkQueue(const WorkQueue&) = delete; - - ~WorkQueue() - { - auto lck = std::unique_lock(m_mutex, std::try_to_lock); - /* - if we don't own the lock, there isn't much we can do - it is likely a spurious failure - */ - if (lck && m_running_workers != 0) - { - Checks::exit_with_message( - m_line_info, "Internal error -- outstanding workers (%u) at destruct point", m_running_workers); - } - } - - template - void run_and_join(unsigned num_threads, const F& tld_init) noexcept - { - if (m_actions.empty()) return; - - std::vector threads; - threads.reserve(num_threads); - for (unsigned i = 0; i < num_threads; ++i) - { - threads.emplace_back(Worker{this, tld_init()}); - } - - for (auto& thrd : threads) - { - thrd.join(); - } - } - - // useful in the case of errors - // doesn't stop any existing running tasks - // returns immediately, so that one can call this in a task - void cancel() const - { - { - auto lck = std::lock_guard(m_mutex); - m_cancelled = true; - m_actions.clear(); - } - m_cv.notify_all(); - } - - void enqueue_action(Action a) const - { - { - auto lck = std::lock_guard(m_mutex); - if (m_cancelled) return; - - m_actions.push_back(std::move(a)); - } - m_cv.notify_one(); - } - - private: - template - struct Worker - { - const WorkQueue* work_queue; - ThreadLocalData tld; - - void operator()() - { - auto lck = std::unique_lock(work_queue->m_mutex); - for (;;) - { - const auto& w = *work_queue; - work_queue->m_cv.wait(lck, [&w] { - if (w.m_cancelled) - return true; - else if (!w.m_actions.empty()) - return true; - else if (w.m_running_workers == 0) - return true; - else - return false; - }); - - if (work_queue->m_cancelled || work_queue->m_actions.empty()) - { - /* - if we've been cancelled, or if the work queue is empty - and there are no other workers, we want to return - immediately; we don't check for the latter condition - since if we're at this point, then either the queue - is not empty, or there are no other workers, or both. - We can't have an empty queue, and other workers, or - we would still be in the wait. - */ - break; - } - - ++work_queue->m_running_workers; - - auto action = std::move(work_queue->m_actions.back()); - work_queue->m_actions.pop_back(); - - lck.unlock(); - work_queue->m_cv.notify_one(); - std::move(action)(tld, *work_queue); - lck.lock(); - - const auto after = --work_queue->m_running_workers; - if (work_queue->m_actions.empty() && after == 0) - { - work_queue->m_cv.notify_all(); - return; - } - } - } - }; - - mutable std::mutex m_mutex{}; - // these are all under m_mutex - mutable bool m_cancelled = false; - mutable std::vector m_actions{}; - mutable std::condition_variable m_cv{}; - mutable unsigned long m_running_workers = 0; - - LineInfo m_line_info; - }; -} diff --git a/toolsrc/include/vcpkg/base/zstringview.h b/toolsrc/include/vcpkg/base/zstringview.h index 7f80bf726df4b5..ab2c232519695b 100644 --- a/toolsrc/include/vcpkg/base/zstringview.h +++ b/toolsrc/include/vcpkg/base/zstringview.h @@ -1,12 +1,12 @@ #pragma once +#include + #include #include #include #include -#include - namespace vcpkg { // A counted view of a null-terminated string @@ -14,7 +14,7 @@ namespace vcpkg { using value_type = char; - constexpr ZStringView() : m_size(0), m_cstr("") {} + constexpr ZStringView() : m_size(0), m_cstr("") { } template constexpr ZStringView(const char (&str)[N]) @@ -22,8 +22,8 @@ namespace vcpkg { } - ZStringView(const std::string& s) : m_size(s.size()), m_cstr(s.c_str()) {} - constexpr ZStringView(const char* str, size_t sz) : m_size(sz), m_cstr(str) {} + ZStringView(const std::string& s) : m_size(s.size()), m_cstr(s.c_str()) { } + constexpr ZStringView(const char* str, size_t sz) : m_size(sz), m_cstr(str) { } constexpr const char* data() const { return m_cstr; } constexpr size_t size() const { return m_size; } diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h index 199b01accc03dc..be52d1e498dd69 100644 --- a/toolsrc/include/vcpkg/binarycaching.h +++ b/toolsrc/include/vcpkg/binarycaching.h @@ -1,39 +1,53 @@ -#pragma once - -#include -#include -#include - -namespace vcpkg::Dependencies -{ - struct InstallPlanAction; -} -namespace vcpkg::Build -{ - struct AbiTagAndFile; - struct BuildPackageOptions; -} - -namespace vcpkg -{ - enum class RestoreResult - { - missing, - success, - build_failed, - }; - - struct IBinaryProvider - { - virtual ~IBinaryProvider() = default; - virtual void prefetch() = 0; - virtual RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; - virtual void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; - virtual void push_failure(const VcpkgPaths& paths, const std::string& abi_tag, const PackageSpec& spec) = 0; - virtual RestoreResult precheck(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - bool purge_tombstones) = 0; - }; - - std::unique_ptr create_archives_provider(); -} +#pragma once + +#include +#include + +#include +#include + +namespace vcpkg::Dependencies +{ + struct InstallPlanAction; + struct ActionPlan; +} +namespace vcpkg::Build +{ + struct AbiTagAndFile; + struct BuildPackageOptions; +} + +namespace vcpkg +{ + enum class RestoreResult + { + missing, + success, + build_failed, + }; + + struct IBinaryProvider + { + virtual ~IBinaryProvider() = default; + /// Gives the BinaryProvider an opportunity to batch any downloading or server communication for executing + /// `plan`. + virtual void prefetch(const VcpkgPaths& paths, const Dependencies::ActionPlan& plan) = 0; + /// Attempts to restore the package referenced by `action` into the packages directory. + virtual RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; + /// Called upon a successful build of `action` + virtual void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; + /// Requests the result of `try_restore()` without actually downloading the package. Used by CI to determine + /// missing packages. + virtual RestoreResult precheck(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; + }; + + IBinaryProvider& null_binary_provider(); + + ExpectedS> create_binary_provider_from_configs(View args); + ExpectedS> create_binary_provider_from_configs_pure(const std::string& env_string, + View args); + + std::string generate_nuget_packages_config(const Dependencies::ActionPlan& action); + + void help_topic_binary_caching(const VcpkgPaths& paths); +} diff --git a/toolsrc/include/vcpkg/binarycaching.private.h b/toolsrc/include/vcpkg/binarycaching.private.h new file mode 100644 index 00000000000000..1b5d587de635bf --- /dev/null +++ b/toolsrc/include/vcpkg/binarycaching.private.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include + +#include + +namespace vcpkg +{ + std::string reformat_version(const std::string& version, const std::string& abi_tag); + + struct NugetReference + { + explicit NugetReference(const Dependencies::InstallPlanAction& action) + : NugetReference(action.spec, + action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO) + .source_control_file->core_paragraph->version, + action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi) + { + } + + NugetReference(const PackageSpec& spec, const std::string& raw_version, const std::string& abi_tag) + : id(spec.dir()), version(reformat_version(raw_version, abi_tag)) + { + } + + std::string id; + std::string version; + + std::string nupkg_filename() const { return Strings::concat(id, '.', version, ".nupkg"); } + }; + + std::string generate_nuspec(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + const NugetReference& ref); + + struct XmlSerializer + { + XmlSerializer& emit_declaration(); + XmlSerializer& open_tag(StringLiteral sl); + XmlSerializer& start_complex_open_tag(StringLiteral sl); + XmlSerializer& text_attr(StringLiteral name, StringView content); + XmlSerializer& finish_complex_open_tag(); + XmlSerializer& finish_self_closing_complex_tag(); + XmlSerializer& close_tag(StringLiteral sl); + XmlSerializer& text(StringView sv); + XmlSerializer& simple_tag(StringLiteral tag, StringView content); + XmlSerializer& line_break(); + + std::string buf; + + private: + XmlSerializer& emit_pending_indent(); + + int m_indent = 0; + bool m_pending_indent = false; + }; + +} diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index edb2b6a13c687e..2d2e4cf200de52 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -28,17 +28,23 @@ namespace vcpkg std::string dir() const; + bool is_feature() const { return !feature.empty(); } + PackageSpec spec; std::string version; - std::string description; - std::string maintainer; + int port_version = 0; + std::vector description; + std::vector maintainers; std::string feature; std::vector default_features; - std::vector depends; + std::vector dependencies; std::string abi; Type type; }; + bool operator==(const BinaryParagraph&, const BinaryParagraph&); + bool operator!=(const BinaryParagraph&, const BinaryParagraph&); + struct BinaryControlFile { BinaryParagraph core_paragraph; diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index d8e87f131695d2..83d797fd1df216 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -1,16 +1,18 @@ #pragma once +#include +#include +#include +#include + #include +#include #include #include #include #include #include -#include -#include -#include - #include #include #include @@ -27,15 +29,50 @@ namespace vcpkg::Dependencies struct ActionPlan; } +namespace vcpkg::System +{ + struct Environment; +} + namespace vcpkg::Build { + enum class BuildResult + { + NULLVALUE = 0, + SUCCEEDED, + BUILD_FAILED, + POST_BUILD_CHECKS_FAILED, + FILE_CONFLICTS, + CASCADED_DUE_TO_MISSING_DEPENDENCIES, + EXCLUDED, + DOWNLOADED + }; + + struct IBuildLogsRecorder + { + virtual void record_build_result(const VcpkgPaths& paths, + const PackageSpec& spec, + BuildResult result) const = 0; + }; + + const IBuildLogsRecorder& null_build_logs_recorder() noexcept; + namespace Command { + int perform_ex(const FullPackageSpec& full_spec, + const SourceControlFileLocation& scfl, + const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binaryprovider, + const IBuildLogsRecorder& build_logs_recorder, + const VcpkgPaths& paths); void perform_and_exit_ex(const FullPackageSpec& full_spec, const SourceControlFileLocation& scfl, const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binaryprovider, + const IBuildLogsRecorder& build_logs_recorder, const VcpkgPaths& paths); + int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); } @@ -87,20 +124,13 @@ namespace vcpkg::Build ARIA2, }; const std::string& to_string(DownloadTool tool); - - enum class BinaryCaching + enum class PurgeDecompressFailure { NO = 0, YES }; - enum class FailOnTombstone - { - NO = 0, - YES - }; - - enum class PurgeDecompressFailure + enum class Editable { NO = 0, YES @@ -115,21 +145,20 @@ namespace vcpkg::Build CleanPackages clean_packages; CleanDownloads clean_downloads; DownloadTool download_tool; - BinaryCaching binary_caching; - FailOnTombstone fail_on_tombstone; PurgeDecompressFailure purge_decompress_failure; + Editable editable; }; - enum class BuildResult - { - NULLVALUE = 0, - SUCCEEDED, - BUILD_FAILED, - POST_BUILD_CHECKS_FAILED, - FILE_CONFLICTS, - CASCADED_DUE_TO_MISSING_DEPENDENCIES, - EXCLUDED, - DOWNLOADED + static constexpr BuildPackageOptions default_build_package_options{ + Build::UseHeadVersion::NO, + Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, + Build::CleanBuildtrees::YES, + Build::CleanPackages::YES, + Build::CleanDownloads::NO, + Build::DownloadTool::BUILT_IN, + Build::PurgeDecompressFailure::YES, + Build::Editable::NO, }; static constexpr std::array BUILD_RESULT_VALUES = { @@ -147,14 +176,14 @@ namespace vcpkg::Build /// /// Settings from the triplet file which impact the build environment and post-build checks /// - struct PreBuildInfo + struct PreBuildInfo : Util::ResourceBase { PreBuildInfo(const VcpkgPaths& paths, Triplet triplet, const std::unordered_map& cmakevars); - bool load_vcvars_env; - std::string triplet_abi_tag; + Triplet triplet; + bool load_vcvars_env = false; std::string target_architecture; std::string cmake_system_name; std::string cmake_system_version; @@ -163,38 +192,16 @@ namespace vcpkg::Build Optional external_toolchain_file; Optional build_type; Optional public_abi_override; - Optional port; std::vector passthrough_env_vars; - }; - std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset); + fs::path toolchain_file() const; + bool using_vcvars() const; - enum class VcpkgTripletVar - { - TARGET_ARCHITECTURE = 0, - CMAKE_SYSTEM_NAME, - CMAKE_SYSTEM_VERSION, - PLATFORM_TOOLSET, - VISUAL_STUDIO_PATH, - CHAINLOAD_TOOLCHAIN_FILE, - BUILD_TYPE, - ENV_PASSTHROUGH, - PUBLIC_ABI_OVERRIDE, - LOAD_VCVARS_ENV, + private: + const VcpkgPaths& m_paths; }; - const std::unordered_map VCPKG_OPTIONS = { - {"VCPKG_TARGET_ARCHITECTURE", VcpkgTripletVar::TARGET_ARCHITECTURE}, - {"VCPKG_CMAKE_SYSTEM_NAME", VcpkgTripletVar::CMAKE_SYSTEM_NAME}, - {"VCPKG_CMAKE_SYSTEM_VERSION", VcpkgTripletVar::CMAKE_SYSTEM_VERSION}, - {"VCPKG_PLATFORM_TOOLSET", VcpkgTripletVar::PLATFORM_TOOLSET}, - {"VCPKG_VISUAL_STUDIO_PATH", VcpkgTripletVar::VISUAL_STUDIO_PATH}, - {"VCPKG_CHAINLOAD_TOOLCHAIN_FILE", VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE}, - {"VCPKG_BUILD_TYPE", VcpkgTripletVar::BUILD_TYPE}, - {"VCPKG_ENV_PASSTHROUGH", VcpkgTripletVar::ENV_PASSTHROUGH}, - {"VCPKG_PUBLIC_ABI_OVERRIDE", VcpkgTripletVar::PUBLIC_ABI_OVERRIDE}, - {"VCPKG_LOAD_VCVARS_ENV", VcpkgTripletVar::LOAD_VCVARS_ENV}, - }; + std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset); struct ExtendedBuildResult { @@ -209,7 +216,8 @@ namespace vcpkg::Build ExtendedBuildResult build_package(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& config, - IBinaryProvider* binaries_provider, + IBinaryProvider& binaries_provider, + const IBuildLogsRecorder& build_logs_recorder, const StatusParagraphs& status_db); enum class BuildPolicy @@ -236,8 +244,7 @@ namespace vcpkg::Build BuildPolicy::ALLOW_OBSOLETE_MSVCRT, BuildPolicy::ALLOW_RESTRICTED_HEADERS, BuildPolicy::SKIP_DUMPBIN_CHECKS, - BuildPolicy::SKIP_ARCHITECTURE_CHECK - }; + BuildPolicy::SKIP_ARCHITECTURE_CHECK}; const std::string& to_string(BuildPolicy policy); CStringView to_cmake_variable(BuildPolicy policy); @@ -245,7 +252,7 @@ namespace vcpkg::Build struct BuildPolicies { BuildPolicies() = default; - BuildPolicies(std::map&& map) : m_policies(std::move(map)) {} + BuildPolicies(std::map&& map) : m_policies(std::move(map)) { } bool is_enabled(BuildPolicy policy) const { @@ -284,7 +291,7 @@ namespace vcpkg::Build std::string value; AbiEntry() = default; - AbiEntry(const std::string& key, const std::string& value) : key(key), value(value) {} + AbiEntry(const std::string& key, const std::string& value) : key(key), value(value) { } bool operator<(const AbiEntry& other) const { @@ -298,12 +305,53 @@ namespace vcpkg::Build fs::path tag_file; }; + struct AbiInfo + { + std::unique_ptr pre_build_info; + Optional toolset; + Optional triplet_abi; + std::string package_abi; + Optional abi_tag_file; + }; + void compute_all_abis(const VcpkgPaths& paths, Dependencies::ActionPlan& action_plan, const CMakeVars::CMakeVarProvider& var_provider, const StatusParagraphs& status_db); - Optional compute_abi_tag(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& config, - Span dependency_abis); + struct EnvCache + { + explicit EnvCache(bool compiler_tracking) : m_compiler_tracking(compiler_tracking) { } + + const System::Environment& get_action_env(const VcpkgPaths& paths, const AbiInfo& abi_info); + const std::string& get_triplet_info(const VcpkgPaths& paths, const AbiInfo& abi_info); + + private: + struct TripletMapEntry + { + std::string hash; + Cache compiler_hashes; + }; + Cache m_triplet_cache; + Cache m_toolchain_cache; + +#if defined(_WIN32) + struct EnvMapEntry + { + std::unordered_map env_map; + Cache cmd_cache; + }; + + Cache, EnvMapEntry> envs; +#endif + + 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 new file mode 100644 index 00000000000000..1216caa2a018d0 --- /dev/null +++ b/toolsrc/include/vcpkg/buildenvironment.h @@ -0,0 +1,13 @@ +#include + +#include + +#include +#include + +namespace vcpkg +{ + std::string make_cmake_cmd(const VcpkgPaths& paths, + const fs::path& cmake_script, + std::vector&& pass_variables); +} 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 9d2d0b6c629850..948d4b5e84f78b 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -1,10 +1,9 @@ #pragma once #include +#include #include #include -#include -#include #include #include @@ -12,133 +11,6 @@ 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); - - 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 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; - 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 Import - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Integrate - { - extern const char* const INTEGRATE_COMMAND_HELPSTRING; - extern const CommandStructure COMMAND_STRUCTURE; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - 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); - } - - namespace Contact - { - extern const CommandStructure COMMAND_STRUCTURE; - const std::string& email(); - void perform_and_exit(const VcpkgCmdArguments& args); - } - - 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); - } - template struct PackageNameAndFunction { @@ -146,12 +18,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.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..10d213522007bc --- /dev/null +++ b/toolsrc/include/vcpkg/commands.interface.h @@ -0,0 +1,33 @@ +#pragma once + +#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..13676b2bd96a36 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.owns.h @@ -0,0 +1,14 @@ +#pragma once + +#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..6220a886630e5c --- /dev/null +++ b/toolsrc/include/vcpkg/commands.search.h @@ -0,0 +1,14 @@ +#pragma once + +#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/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 26ba9a67c7342e..a9021355f570d6 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -2,6 +2,7 @@ #include #include + #include #include #include @@ -10,6 +11,7 @@ #include #include +#include #include namespace vcpkg::Graphs @@ -50,10 +52,11 @@ namespace vcpkg::Dependencies InstallPlanAction(const PackageSpec& spec, const SourceControlFileLocation& scfl, const RequestType& request_type, - std::unordered_map>&& dependencies); + std::map>&& dependencies); std::string displayname() const; const std::string& public_abi() const; + const Build::PreBuildInfo& pre_build_info(LineInfo linfo) const; PackageSpec spec; @@ -64,13 +67,11 @@ namespace vcpkg::Dependencies RequestType request_type; Build::BuildPackageOptions build_options; - std::unordered_map> feature_dependencies; + std::map> feature_dependencies; std::vector package_dependencies; std::vector feature_list; - Optional> pre_build_info; - Optional package_abi; - Optional abi_tag_file; + Optional abi_info; }; enum class RemovePlanType @@ -162,5 +163,5 @@ namespace vcpkg::Dependencies void print_plan(const ActionPlan& action_plan, const bool is_recursive = true, - const fs::path& default_ports_dir = ""); + const fs::path& default_ports_dir = {}); } diff --git a/toolsrc/include/vcpkg/export.chocolatey.h b/toolsrc/include/vcpkg/export.chocolatey.h index 7804108fd1a009..1e6f9a12b98d17 100644 --- a/toolsrc/include/vcpkg/export.chocolatey.h +++ b/toolsrc/include/vcpkg/export.chocolatey.h @@ -1,19 +1,19 @@ -#pragma once - -#include -#include - -#include - -namespace vcpkg::Export::Chocolatey -{ - struct Options - { - Optional maybe_maintainer; - Optional maybe_version_suffix; - }; - - void do_export(const std::vector& export_plan, - const VcpkgPaths& paths, - const Options& chocolatey_options); -} +#pragma once + +#include +#include + +#include + +namespace vcpkg::Export::Chocolatey +{ + struct Options + { + Optional maybe_maintainer; + Optional maybe_version_suffix; + }; + + void do_export(const std::vector& export_plan, + const VcpkgPaths& paths, + const Options& chocolatey_options); +} 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.prefab.h b/toolsrc/include/vcpkg/export.prefab.h index 56a5ba371935b0..8fa064e7744241 100644 --- a/toolsrc/include/vcpkg/export.prefab.h +++ b/toolsrc/include/vcpkg/export.prefab.h @@ -1,10 +1,10 @@ #pragma once #include + #include #include - #include namespace vcpkg::Export::Prefab @@ -18,22 +18,19 @@ namespace vcpkg::Export::Prefab Optional maybe_version; Optional maybe_min_sdk; Optional maybe_target_sdk; - bool enable_maven; - bool enable_debug; + bool enable_maven = false; + bool enable_debug = false; }; struct NdkVersion { - NdkVersion(int _major, int _minor, int _patch) : m_major{_major}, - m_minor{_minor}, - m_patch{_patch}{ - } - int major() { return this->m_major; } - int minor() { return this->m_minor; } - int patch() { return this->m_patch; } + NdkVersion(int _major, int _minor, int _patch) : m_major{_major}, m_minor{_minor}, m_patch{_patch} { } + int major() { return this->m_major; } + int minor() { return this->m_minor; } + int patch() { return this->m_patch; } std::string to_string(); void to_string(std::string& out); - private: + private: int m_major; int m_minor; int m_patch; @@ -72,11 +69,10 @@ namespace vcpkg::Export::Prefab std::string to_json(); }; - - void do_export(const std::vector& export_plan, const VcpkgPaths& paths, - const Options& prefab_options, const Triplet& triplet); - Optional find_ndk_version(const std::string &content); - Optional to_version(const std::string &version); + const Options& prefab_options, + const Triplet& triplet); + Optional find_ndk_version(const std::string& content); + Optional to_version(const std::string& version); } diff --git a/toolsrc/include/vcpkg/globalstate.h b/toolsrc/include/vcpkg/globalstate.h index 263b5f80c49e2a..35ca71dbba2b90 100644 --- a/toolsrc/include/vcpkg/globalstate.h +++ b/toolsrc/include/vcpkg/globalstate.h @@ -13,8 +13,6 @@ namespace vcpkg static Util::LockGuarded timer; static Util::LockGuarded g_surveydate; - static std::atomic g_binary_caching; - static std::atomic g_init_console_cp; static std::atomic g_init_console_output_cp; static std::atomic g_init_console_initialized; diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h index 87ce60b7605e26..3e1ef381e41317 100644 --- a/toolsrc/include/vcpkg/help.h +++ b/toolsrc/include/vcpkg/help.h @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include #include @@ -13,19 +12,8 @@ namespace vcpkg::Help void help_topic_valid_triplet(const VcpkgPaths& paths); - void print_usage(); - - std::string create_example_string(const std::string& command_and_arguments); - - struct HelpTableFormatter + struct HelpCommand : Commands::PathsCommand { - void format(StringView col1, StringView col2); - - std::string m_str; - - private: - void newline_indent(); - void indent(); + 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 1c42cc102c13aa..0ba0932e04fa72 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -1,6 +1,7 @@ #pragma once #include + #include #include #include @@ -70,7 +71,13 @@ namespace vcpkg::Install std::vector get_all_port_names(const VcpkgPaths& paths); - void install_files_and_write_listfile(Files::Filesystem& fs, const fs::path& source_dir, const InstallDir& dirs); + void install_package_and_write_listfile(const VcpkgPaths& paths, const PackageSpec& spec, const InstallDir& dirs); + + void install_files_and_write_listfile(Files::Filesystem& fs, + const fs::path& source_dir, + const std::vector& files, + const InstallDir& destination_dir); + InstallResult install_package(const VcpkgPaths& paths, const BinaryControlFile& binary_paragraph, StatusParagraphs* status_db); @@ -79,9 +86,18 @@ namespace vcpkg::Install const KeepGoing keep_going, const VcpkgPaths& paths, StatusParagraphs& status_db, + IBinaryProvider& binaryprovider, + const Build::IBuildLogsRecorder& build_logs_recorder, const CMakeVars::CMakeVarProvider& var_provider); 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/logicexpression.h b/toolsrc/include/vcpkg/logicexpression.h deleted file mode 100644 index 3a3d0debe824bf..00000000000000 --- a/toolsrc/include/vcpkg/logicexpression.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace vcpkg -{ - struct ExpressionContext - { - // map of cmake variables and their values. - const std::unordered_map& cmake_context; - - // The legacy context is a string (typically the name of the triplet). - // An identifier was considered 'true' if it is a substring of this. - // It is now used for backwards compatability diagnostic messages and - // will be eventually removed. - const std::string& legacy_context; - }; - - // Evaluate simple vcpkg logic expressions. An identifier in the expression is considered 'true' - // if it is a substring of the evaluation_context (typically the name of the triplet) - ExpectedT evaluate_expression(const std::string& expression, const ExpressionContext& context); -} \ No newline at end of file diff --git a/toolsrc/include/vcpkg/metrics.h b/toolsrc/include/vcpkg/metrics.h index cb27ba58d6505f..3ab1bc758606b4 100644 --- a/toolsrc/include/vcpkg/metrics.h +++ b/toolsrc/include/vcpkg/metrics.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -10,19 +11,22 @@ namespace vcpkg::Metrics { void set_send_metrics(bool should_send_metrics); void set_print_metrics(bool should_print_metrics); + void set_disabled(bool disabled); void set_user_information(const std::string& user_id, const std::string& first_use_time); static void init_user_information(std::string& user_id, std::string& first_use_time); void track_metric(const std::string& name, double value); void track_buildtime(const std::string& name, double value); void track_property(const std::string& name, const std::string& value); + void track_feature(const std::string& feature, bool value); + + bool metrics_enabled(); void upload(const std::string& payload); - void flush(); + void flush(Files::Filesystem& fs); }; extern Util::LockGuarded g_metrics; std::string get_MAC_user(); - bool get_compiled_metrics_enabled(); } diff --git a/toolsrc/include/vcpkg/packagespec.h b/toolsrc/include/vcpkg/packagespec.h index a37dc99b3649b8..7601127d53867c 100644 --- a/toolsrc/include/vcpkg/packagespec.h +++ b/toolsrc/include/vcpkg/packagespec.h @@ -1,7 +1,10 @@ #pragma once #include +#include #include + +#include #include namespace vcpkg::Parse @@ -19,8 +22,10 @@ namespace vcpkg /// struct PackageSpec { - PackageSpec() noexcept = default; - PackageSpec(std::string name, Triplet triplet) : m_name(std::move(name)), m_triplet(triplet) {} + constexpr static StringLiteral MANIFEST_NAME = "default"; + + PackageSpec() = default; + PackageSpec(std::string name, Triplet triplet) : m_name(std::move(name)), m_triplet(triplet) { } static std::vector to_package_specs(const std::vector& ports, Triplet triplet); @@ -53,7 +58,7 @@ namespace vcpkg /// struct FeatureSpec { - FeatureSpec(const PackageSpec& spec, const std::string& feature) : m_spec(spec), m_feature(feature) {} + FeatureSpec(const PackageSpec& spec, const std::string& feature) : m_spec(spec), m_feature(feature) { } const std::string& name() const { return m_spec.name(); } const std::string& feature() const { return m_feature; } @@ -96,7 +101,7 @@ namespace vcpkg PackageSpec package_spec; std::vector features; - FullPackageSpec() noexcept = default; + FullPackageSpec() = default; explicit FullPackageSpec(PackageSpec spec, std::vector features = {}) : package_spec(std::move(spec)), features(std::move(features)) { @@ -123,10 +128,14 @@ namespace vcpkg struct Dependency { - Features depend; - std::string qualifier; + std::string name; + std::vector features; + PlatformExpression::Expr platform; + + Json::Object extra_info; - static ExpectedS from_string(const std::string& input); + friend bool operator==(const Dependency& lhs, const Dependency& rhs); + friend bool operator!=(const Dependency& lhs, const Dependency& rhs) { return !(lhs == rhs); } }; struct ParsedQualifiedSpecifier @@ -134,16 +143,16 @@ namespace vcpkg std::string name; Optional> features; Optional triplet; - Optional qualifier; + Optional platform; }; Optional parse_feature_name(Parse::ParserBase& parser); Optional parse_package_name(Parse::ParserBase& parser); - ExpectedS parse_qualified_specifier(CStringView input); + 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); + inline bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } } namespace std diff --git a/toolsrc/include/vcpkg/paragraphparser.h b/toolsrc/include/vcpkg/paragraphparser.h index cc46374025d45c..4403b3aea727ca 100644 --- a/toolsrc/include/vcpkg/paragraphparser.h +++ b/toolsrc/include/vcpkg/paragraphparser.h @@ -1,9 +1,11 @@ #pragma once #include + #include #include +#include #include #include #include @@ -14,9 +16,16 @@ namespace vcpkg::Parse struct ParseControlErrorInfo { std::string name; - std::vector missing_fields; - std::vector extra_fields; + std::map> missing_fields; + std::map> extra_fields; + std::map expected_types; + std::map> mutually_exclusive_fields; std::string error; + + bool has_error() const + { + return !missing_fields.empty() || !extra_fields.empty() || !expected_types.empty() || !error.empty(); + } }; template @@ -26,26 +35,32 @@ namespace vcpkg::Parse struct ParagraphParser { - ParagraphParser(Paragraph&& fields) : fields(std::move(fields)) {} + ParagraphParser(Paragraph&& fields) : fields(std::move(fields)) { } + std::string required_field(const std::string& fieldname); void required_field(const std::string& fieldname, std::string& out); - std::string optional_field(const std::string& fieldname); void required_field(const std::string& fieldname, std::pair out); + + std::string optional_field(const std::string& fieldname); void optional_field(const std::string& fieldname, std::pair out); + + void add_type_error(const std::string& fieldname, const char* type) { expected_types[fieldname] = type; } + std::unique_ptr error_info(const std::string& name) const; private: Paragraph&& fields; std::vector missing_fields; + std::map expected_types; }; ExpectedS> parse_default_features_list(const std::string& str, - CStringView origin = "", + StringView origin = "", TextRowCol textrowcol = {}); ExpectedS> parse_qualified_specifier_list(const std::string& str, - CStringView origin = "", + StringView origin = "", TextRowCol textrowcol = {}); ExpectedS> parse_dependencies_list(const std::string& str, - CStringView origin = "", + StringView origin = "", TextRowCol textrowcol = {}); } diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index 02e87a76d91d7f..25d037591bf062 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -1,20 +1,28 @@ #pragma once +#include + #include #include #include -#include - namespace vcpkg::Paragraphs { using Paragraph = Parse::Paragraph; + ExpectedS parse_single_paragraph(const std::string& str, const std::string& origin); ExpectedS get_single_paragraph(const Files::Filesystem& fs, const fs::path& control_path); ExpectedS> get_paragraphs(const Files::Filesystem& fs, const fs::path& control_path); ExpectedS> parse_paragraphs(const std::string& str, const std::string& origin); - Parse::ParseExpected try_load_port(const Files::Filesystem& fs, const fs::path& control_path); + 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); diff --git a/toolsrc/include/vcpkg/platform-expression.h b/toolsrc/include/vcpkg/platform-expression.h new file mode 100644 index 00000000000000..43ae6e89de5c85 --- /dev/null +++ b/toolsrc/include/vcpkg/platform-expression.h @@ -0,0 +1,99 @@ +#pragma once + +#include +#include + +#include +#include + +namespace vcpkg::PlatformExpression +{ + // map of cmake variables and their values. + using Context = std::unordered_map; + + namespace detail + { + struct ExprImpl; + } + struct Expr + { + static Expr Identifier(StringView id); + static Expr Not(Expr&& e); + static Expr And(std::vector&& exprs); + static Expr Or(std::vector&& exprs); + + // The empty expression is always true + static Expr Empty() { return Expr(); } + + // since ExprImpl is not yet defined, we need to define the ctor and dtor in the C++ file + Expr(); + Expr(const Expr&); + Expr(Expr&&); + Expr& operator=(const Expr& e); + Expr& operator=(Expr&&); + + explicit Expr(std::unique_ptr&& e); + ~Expr(); + + 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_; + }; + + // Note: for backwards compatibility, in CONTROL files, + // multiple binary operators are allowed to be next to one another; i.e. + // (windows & arm) = (windows && arm) = (windows &&& arm), etc. + enum class MultipleBinaryOperators + { + Deny, + Allow, + }; + + // platform expression parses the following : + // : + // + // + // + // : + // ( ) + // + // : + // A lowercase alpha-numeric string + // : + // + // ! + // + // + // & + // + // + // | + ExpectedS parse_platform_expression(StringView expression, MultipleBinaryOperators multiple_binary_operators); +} diff --git a/toolsrc/include/vcpkg/portfileprovider.h b/toolsrc/include/vcpkg/portfileprovider.h index 36cdba5897adbf..e26580729b5bfe 100644 --- a/toolsrc/include/vcpkg/portfileprovider.h +++ b/toolsrc/include/vcpkg/portfileprovider.h @@ -2,6 +2,7 @@ #include #include + #include #include @@ -26,12 +27,15 @@ namespace vcpkg::PortFileProvider struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider { explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, - const std::vector* ports_dirs_paths); + const std::vector& ports_dirs_paths); ExpectedS get_control_file(const std::string& src_name) const override; std::vector load_all_control_files() const override; private: + const SourceControlFileLocation* load_manifest_file() const; + Files::Filesystem& filesystem; + fs::path manifest; std::vector ports_dirs; mutable std::unordered_map cache; }; diff --git a/toolsrc/include/vcpkg/postbuildlint.buildtype.h b/toolsrc/include/vcpkg/postbuildlint.buildtype.h index 0b469d9a0d3030..4d6da1494d5b56 100644 --- a/toolsrc/include/vcpkg/postbuildlint.buildtype.h +++ b/toolsrc/include/vcpkg/postbuildlint.buildtype.h @@ -1,6 +1,7 @@ #pragma once #include + #include #include diff --git a/toolsrc/include/vcpkg/pragmas.h b/toolsrc/include/vcpkg/pragmas.h deleted file mode 100644 index fa1039bce0d1b6..00000000000000 --- a/toolsrc/include/vcpkg/pragmas.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#if defined(_MSC_VER) && _MSC_VER < 1911 -// [[nodiscard]] is not recognized before VS 2017 version 15.3 -#pragma warning(disable : 5030) -#endif - -#if defined(__GNUC__) && __GNUC__ < 7 -// [[nodiscard]] is not recognized before GCC version 7 -#pragma GCC diagnostic ignored "-Wattributes" -#endif 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 08c306abf17e7d..2ce4c7bcad44f1 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -1,13 +1,14 @@ #pragma once -#include #include +#include #include #include #include + #include #include -#include +#include namespace vcpkg { @@ -28,14 +29,22 @@ namespace vcpkg static Type from_string(const std::string&); }; + bool operator==(const Type&, const Type&); + bool operator!=(const Type&, const Type&); + /// /// Port metadata of additional feature in a package (part of CONTROL file) /// struct FeatureParagraph { std::string name; - std::string description; - std::vector depends; + std::vector description; + std::vector dependencies; + + 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); } }; /// @@ -45,13 +54,22 @@ namespace vcpkg { std::string name; std::string version; - std::string description; - std::string maintainer; + int port_version = 0; + std::vector description; + std::vector maintainers; std::string homepage; - std::vector depends; + std::string documentation; + std::vector dependencies; std::vector default_features; + std::string license; // SPDX license expression + Type type; - std::string supports_expression; + 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); } }; /// @@ -65,20 +83,30 @@ 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)); } } + static Parse::ParseExpected parse_manifest_file(const fs::path& path_to_manifest, + const Json::Object& object); + static Parse::ParseExpected parse_control_file( const fs::path& path_to_control, std::vector&& control_paragraphs); + // Always non-null in non-error cases std::unique_ptr core_paragraph; std::vector> feature_paragraphs; 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. @@ -105,6 +133,7 @@ namespace vcpkg fs::path source_location; }; + std::string get_error_message(Span> error_info_list); void print_error_message(Span> error_info_list); inline void print_error_message(const std::unique_ptr& error_info_list) { diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index 2c6d34865fbf36..dde4ecb19866cc 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -2,7 +2,7 @@ #include -#include +#include namespace vcpkg { @@ -47,7 +47,7 @@ namespace vcpkg struct InstalledPackageView { - InstalledPackageView() noexcept : core(nullptr) {} + InstalledPackageView() noexcept : core(nullptr) { } InstalledPackageView(const StatusParagraph* c, std::vector&& fs) : core(c), features(std::move(fs)) @@ -56,7 +56,7 @@ namespace vcpkg const PackageSpec& spec() const { return core->package.spec; } std::vector dependencies() const; - std::unordered_map> feature_dependencies() const; + std::map> feature_dependencies() const; const StatusParagraph* core; std::vector features; diff --git a/toolsrc/include/vcpkg/statusparagraphs.h b/toolsrc/include/vcpkg/statusparagraphs.h index 7fcf0e91626667..8fd85b4e05fb56 100644 --- a/toolsrc/include/vcpkg/statusparagraphs.h +++ b/toolsrc/include/vcpkg/statusparagraphs.h @@ -35,12 +35,12 @@ namespace vcpkg /// Triplet /// Feature name /// Iterator for found spec - iterator find(const std::string& name, Triplet triplet, const std::string& feature = ""); - const_iterator find(const std::string& name, Triplet triplet, const std::string& feature = "") const; + iterator find(const std::string& name, Triplet triplet, const std::string& feature = {}); + const_iterator find(const std::string& name, Triplet triplet, const std::string& feature = {}) const; std::vector*> find_all(const std::string& name, Triplet triplet); - Optional find_all_installed(const PackageSpec& spec) const; + Optional get_installed_package_view(const PackageSpec& spec) const; /// Find the StatusParagraph for given spec if installed /// Package specification to find the status for diff --git a/toolsrc/include/vcpkg/textrowcol.h b/toolsrc/include/vcpkg/textrowcol.h index 90c50d887469b0..b8269f6979930e 100644 --- a/toolsrc/include/vcpkg/textrowcol.h +++ b/toolsrc/include/vcpkg/textrowcol.h @@ -1,14 +1,17 @@ -#pragma once - -namespace vcpkg::Parse -{ - struct TextRowCol - { - constexpr TextRowCol() noexcept = default; - constexpr TextRowCol(int row, int column) noexcept : row(row), column(column) {} - /// '0' indicates uninitialized; '1' is the first row. - int row = 0; - /// '0' indicates uninitialized; '1' is the first column. - int column = 0; - }; -} +#pragma once + +namespace vcpkg::Parse +{ + struct TextRowCol + { + constexpr TextRowCol() noexcept = default; + constexpr TextRowCol(int row, int column) noexcept : row(row), column(column) { } + /// '0' indicates uninitialized; '1' is the first row. + int row = 0; + /// '0' indicates uninitialized; '1' is the first column. + int column = 0; + + constexpr int row_or(int def) const noexcept { return row ? row : def; } + constexpr int column_or(int def) const noexcept { return column ? column : def; } + }; +} diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h index 6a096c3218599f..b57ca2918919b9 100644 --- a/toolsrc/include/vcpkg/tools.h +++ b/toolsrc/include/vcpkg/tools.h @@ -11,7 +11,7 @@ namespace vcpkg struct ToolCache { - virtual ~ToolCache() {} + virtual ~ToolCache() { } virtual const fs::path& get_tool_path(const VcpkgPaths& paths, const std::string& tool) const = 0; virtual const std::string& get_tool_version(const VcpkgPaths& paths, const std::string& tool) const = 0; diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index 92ea10175c5f69..736b22a2d11b14 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -1,8 +1,11 @@ #pragma once -#include -#include #include +#include + +#include + +#include namespace vcpkg { @@ -11,7 +14,7 @@ namespace vcpkg struct Triplet { public: - constexpr Triplet() noexcept : m_instance(&DEFAULT_INSTANCE) {} + constexpr Triplet() noexcept : m_instance(&DEFAULT_INSTANCE) { } static Triplet from_canonical_name(std::string&& triplet_as_string); @@ -23,7 +26,7 @@ namespace vcpkg 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; @@ -41,12 +44,14 @@ namespace vcpkg private: static const TripletInstance DEFAULT_INSTANCE; - constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) {} + constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) { } const TripletInstance* m_instance; }; inline bool operator!=(Triplet left, Triplet right) { return !(left == right); } + + Triplet default_triplet(const VcpkgCmdArguments& args); } namespace std 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/userconfig.h b/toolsrc/include/vcpkg/userconfig.h index d044f43ef7feb3..74f8c876a89e24 100644 --- a/toolsrc/include/vcpkg/userconfig.h +++ b/toolsrc/include/vcpkg/userconfig.h @@ -1,8 +1,9 @@ #pragma once -#include #include +#include + namespace vcpkg { struct UserConfig diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index fe7911ae3fba31..82c4f6dc2363ce 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -72,7 +73,8 @@ namespace vcpkg std::vector (*valid_arguments)(const VcpkgPaths& paths); }; - void display_usage(const CommandStructure& command_structure); + void print_usage(); + void print_usage(const CommandStructure& command_structure); #if defined(_WIN32) using CommandLineCharType = wchar_t; @@ -80,30 +82,108 @@ namespace vcpkg using CommandLineCharType = char; #endif + std::string create_example_string(const std::string& command_and_arguments); + + std::string format_environment_variable(StringLiteral lit); + + struct HelpTableFormatter + { + void format(StringView col1, StringView col2); + void example(StringView example_text); + void header(StringView name); + void blank(); + void text(StringView text, int indent = 0); + + std::string m_str; + }; + struct VcpkgCmdArguments { - static VcpkgCmdArguments create_from_command_line(const int argc, const CommandLineCharType* const* const argv); + static VcpkgCmdArguments create_from_command_line(const Files::Filesystem& fs, + const int argc, + const CommandLineCharType* const* const argv); static VcpkgCmdArguments create_from_arg_sequence(const std::string* arg_begin, const std::string* arg_end); + static void append_common_options(HelpTableFormatter& target); + + constexpr static StringLiteral VCPKG_ROOT_DIR_ENV = "VCPKG_ROOT"; + constexpr static StringLiteral VCPKG_ROOT_DIR_ARG = "vcpkg-root"; std::unique_ptr vcpkg_root_dir; + constexpr static StringLiteral MANIFEST_ROOT_DIR_ARG = "x-manifest-root"; + std::unique_ptr manifest_root_dir; + + constexpr static StringLiteral BUILDTREES_ROOT_DIR_ARG = "x-buildtrees-root"; + std::unique_ptr buildtrees_root_dir; + constexpr static StringLiteral DOWNLOADS_ROOT_DIR_ENV = "VCPKG_DOWNLOADS"; + constexpr static StringLiteral DOWNLOADS_ROOT_DIR_ARG = "downloads-root"; + std::unique_ptr downloads_root_dir; + constexpr static StringLiteral INSTALL_ROOT_DIR_ARG = "x-install-root"; + std::unique_ptr install_root_dir; + constexpr static StringLiteral PACKAGES_ROOT_DIR_ARG = "x-packages-root"; + std::unique_ptr packages_root_dir; + constexpr static StringLiteral SCRIPTS_ROOT_DIR_ARG = "x-scripts-root"; std::unique_ptr scripts_root_dir; + + constexpr static StringLiteral DEFAULT_VISUAL_STUDIO_PATH_ENV = "VCPKG_VISUAL_STUDIO_PATH"; + std::unique_ptr default_visual_studio_path; + + constexpr static StringLiteral TRIPLET_ENV = "VCPKG_DEFAULT_TRIPLET"; + constexpr static StringLiteral TRIPLET_ARG = "triplet"; std::unique_ptr triplet; - std::unique_ptr> overlay_ports; - std::unique_ptr> overlay_triplets; + 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"; + std::vector overlay_triplets; + + constexpr static StringLiteral BINARY_SOURCES_ARG = "binarysource"; + std::vector binary_sources; + + constexpr static StringLiteral DEBUG_SWITCH = "debug"; Optional debug = nullopt; - Optional sendmetrics = nullopt; - Optional printmetrics = nullopt; + constexpr static StringLiteral SEND_METRICS_SWITCH = "sendmetrics"; + Optional send_metrics = nullopt; + // fully disable metrics -- both printing and sending + constexpr static StringLiteral DISABLE_METRICS_ENV = "VCPKG_DISABLE_METRICS"; + constexpr static StringLiteral DISABLE_METRICS_SWITCH = "disable-metrics"; + Optional disable_metrics = nullopt; + constexpr static StringLiteral PRINT_METRICS_SWITCH = "printmetrics"; + Optional print_metrics = nullopt; + + constexpr static StringLiteral WAIT_FOR_LOCK_SWITCH = "x-wait-for-lock"; + Optional wait_for_lock = nullopt; // feature flags - Optional featurepackages = nullopt; - Optional binarycaching = nullopt; + constexpr static StringLiteral FEATURE_FLAGS_ENV = "VCPKG_FEATURE_FLAGS"; + constexpr static StringLiteral FEATURE_FLAGS_ARG = "feature-flags"; + + constexpr static StringLiteral FEATURE_PACKAGES_SWITCH = "featurepackages"; + Optional feature_packages = nullopt; + constexpr static StringLiteral BINARY_CACHING_FEATURE = "binarycaching"; + constexpr static StringLiteral BINARY_CACHING_SWITCH = "binarycaching"; + Optional binary_caching = nullopt; + constexpr static StringLiteral COMPILER_TRACKING_FEATURE = "compilertracking"; + Optional compiler_tracking = nullopt; + constexpr static StringLiteral MANIFEST_MODE_FEATURE = "manifests"; + Optional manifest_mode = nullopt; + + bool binary_caching_enabled() const { return binary_caching.value_or(true); } + bool compiler_tracking_enabled() const { return compiler_tracking.value_or(true); } std::string command; std::vector command_arguments; ParsedArguments parse_arguments(const CommandStructure& command_structure) const; + void imbue_from_environment(); + + void check_feature_flag_consistency() const; + + void debug_print_feature_flags() const; + void track_feature_flag_metrics() const; + private: - std::unordered_map>> optional_command_arguments; + std::unordered_set command_switches; + std::unordered_map> command_options; }; } diff --git a/toolsrc/include/vcpkg/vcpkglib.h b/toolsrc/include/vcpkg/vcpkglib.h index 5674d30dbbccbd..0fd66e8144e136 100644 --- a/toolsrc/include/vcpkg/vcpkglib.h +++ b/toolsrc/include/vcpkg/vcpkglib.h @@ -1,6 +1,7 @@ #pragma once #include + #include #include diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 31d8374f1e6d93..594407c4b32194 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -1,13 +1,15 @@ #pragma once -#include -#include -#include - #include -#include #include #include +#include +#include + +#include +#include +#include +#include namespace vcpkg { @@ -18,6 +20,7 @@ namespace vcpkg 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"; @@ -45,45 +48,61 @@ namespace vcpkg namespace Build { struct PreBuildInfo; + struct AbiInfo; + } + + namespace System + { + struct Environment; + } + + namespace details + { + struct VcpkgPathsImpl; } - struct VcpkgPaths + struct VcpkgPaths : Util::MoveOnlyBase { struct TripletFile { std::string name; fs::path location; - TripletFile(const std::string& name, const fs::path& location) : name(name), location(location) {} + TripletFile(const std::string& name, const fs::path& location) : name(name), location(location) { } }; - static Expected create(const fs::path& vcpkg_root_dir, - const Optional& vcpkg_scripts_root_dir, - const std::string& default_vs_path, - const std::vector* triplets_dirs); + VcpkgPaths(Files::Filesystem& filesystem, const VcpkgCmdArguments& args); + ~VcpkgPaths(); fs::path package_dir(const PackageSpec& spec) const; + fs::path build_dir(const PackageSpec& spec) const; + fs::path build_dir(const std::string& package_name) const; fs::path build_info_file_path(const PackageSpec& spec) const; fs::path listfile_path(const BinaryParagraph& pgh) const; bool is_valid_triplet(Triplet t) const; const std::vector get_available_triplets_names() const; const std::vector& get_available_triplets() const; + const std::map& get_cmake_script_hashes() const; const fs::path get_triplet_file_path(Triplet triplet) const; + fs::path original_cwd; fs::path root; - fs::path packages; + fs::path manifest_root_dir; fs::path buildtrees; fs::path downloads; + fs::path packages; fs::path ports; fs::path installed; fs::path triplets; fs::path community_triplets; fs::path scripts; + fs::path prefab; fs::path tools; fs::path buildsystems; fs::path buildsystems_msbuild_targets; + fs::path buildsystems_msbuild_props; fs::path vcpkg_dir; fs::path vcpkg_dir_status_file; @@ -103,15 +122,13 @@ namespace vcpkg Files::Filesystem& get_filesystem() const; - private: - Lazy> available_triplets; - Lazy> toolsets; - Lazy> toolsets_vs2013; + 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(); } - fs::path default_vs_path; - std::vector triplets_dirs; + void track_feature_flag_metrics() const; - mutable std::unique_ptr m_tool_cache; - mutable vcpkg::Cache m_triplets_cache; + private: + std::unique_ptr m_pimpl; }; } diff --git a/toolsrc/include/vcpkg/versiont.h b/toolsrc/include/vcpkg/versiont.h index e893f1abcf6c04..768ca0c47d51aa 100644 --- a/toolsrc/include/vcpkg/versiont.h +++ b/toolsrc/include/vcpkg/versiont.h @@ -6,18 +6,19 @@ namespace vcpkg struct VersionT { VersionT() noexcept; - VersionT(std::string&& value); - VersionT(const std::string& value); + VersionT(std::string&& value, int port_version); + VersionT(const std::string& value, int port_version); - const std::string& to_string() const; + std::string to_string() const; + + friend bool operator==(const VersionT& left, const VersionT& right); + friend bool operator!=(const VersionT& left, const VersionT& right); private: std::string value; + int port_version; }; - bool operator==(const VersionT& left, const VersionT& right); - bool operator!=(const VersionT& left, const VersionT& right); - struct VersionDiff { VersionT left; diff --git a/toolsrc/include/vcpkg/visualstudio.h b/toolsrc/include/vcpkg/visualstudio.h index cd99db352785bf..da6652b3eebf47 100644 --- a/toolsrc/include/vcpkg/visualstudio.h +++ b/toolsrc/include/vcpkg/visualstudio.h @@ -1,14 +1,14 @@ -#pragma once - -#if defined(_WIN32) - -#include - -namespace vcpkg::VisualStudio -{ - std::vector get_visual_studio_instances(const VcpkgPaths& paths); - - std::vector find_toolset_instances_preferred_first(const VcpkgPaths& paths); -} - -#endif +#pragma once + +#if defined(_WIN32) + +#include + +namespace vcpkg::VisualStudio +{ + std::vector get_visual_studio_instances(const VcpkgPaths& paths); + + std::vector find_toolset_instances_preferred_first(const VcpkgPaths& paths); +} + +#endif diff --git a/toolsrc/src/vcpkg-fuzz/main.cpp b/toolsrc/src/vcpkg-fuzz/main.cpp new file mode 100644 index 00000000000000..85ce742f8d562a --- /dev/null +++ b/toolsrc/src/vcpkg-fuzz/main.cpp @@ -0,0 +1,194 @@ +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +using namespace vcpkg; + +namespace +{ + enum class FuzzKind + { + None, + Utf8Decoder, + JsonParser, + PlatformExpr, + }; + + struct FuzzArgs + { + FuzzArgs(int argc, char** argv) + { + if (argc <= 1) + { + print_help_and_exit(); + } + + char** it = argv + 1; // skip the name of the program + char** last = argv + argc; + + for (; it != last; ++it) + { + auto arg = StringView(*it, strlen(*it)); + if (arg == "/?") + { + print_help_and_exit(); + } + + auto pr = split_arg(arg); + auto key = pr.first; + auto value = pr.second; + if (key == "h" || key == "help") + { + print_help_and_exit(); + } + + if (key == "kind") + { + if (value == "json") + { + kind = FuzzKind::JsonParser; + } + else if (value == "utf-8") + { + kind = FuzzKind::Utf8Decoder; + } + else if (value == "platform-expr") + { + kind = FuzzKind::PlatformExpr; + } + else + { + System::print2(System::Color::error, "Invalid kind: ", value, "\n"); + System::print2(System::Color::error, " Expected one of: utf-8, json, platform-expr\n\n"); + print_help_and_exit(true); + } + } + else + { + System::print2("Unknown option: ", key, "\n\n"); + print_help_and_exit(true); + } + } + } + + // returns {arg, ""} when there isn't an `=` + // skips preceding `-`s + std::pair split_arg(StringView arg) + { + auto first = std::find_if(arg.begin(), arg.end(), [](char c) { return c != '-'; }); + auto division = std::find(first, arg.end(), '='); + if (division == arg.end()) + { + return {StringView(first, arg.end()), StringView(arg.end(), arg.end())}; + } + else + { + return {StringView(first, division), StringView(division + 1, arg.end())}; + } + } + + [[noreturn]] void print_help_and_exit(bool invalid = false) + { + constexpr auto help = + R"( +Usage: vcpkg-fuzz + +Accepts input on stdin. + +Options: + --kind=... One of {utf-8, json} +)"; + + auto color = invalid ? System::Color::error : System::Color::success; + + System::print2(color, help); + if (invalid) + { + Checks::exit_fail(VCPKG_LINE_INFO); + } + else + { + Checks::exit_success(VCPKG_LINE_INFO); + } + } + + FuzzKind kind; + }; + + std::string read_all_of_stdin() + { + std::stringstream ss; + ss << std::cin.rdbuf(); + return std::move(ss).str(); + } + + [[noreturn]] void fuzz_json_and_exit(StringView text) + { + auto res = Json::parse(text); + if (!res) + { + Checks::exit_with_message(VCPKG_LINE_INFO, res.error()->format()); + } + + Checks::exit_success(VCPKG_LINE_INFO); + } + + [[noreturn]] void fuzz_utf8_and_exit(StringView text) + { + auto res = Unicode::Utf8Decoder(text.begin(), text.end()); + for (auto ch : res) + { + (void)ch; + } + + Checks::exit_success(VCPKG_LINE_INFO); + } + + [[noreturn]] void fuzz_platform_expr_and_exit(StringView text) + { + auto res1 = + PlatformExpression::parse_platform_expression(text, PlatformExpression::MultipleBinaryOperators::Deny); + auto res2 = + PlatformExpression::parse_platform_expression(text, PlatformExpression::MultipleBinaryOperators::Allow); + + if (!res1) + { + Checks::exit_with_message(VCPKG_LINE_INFO, res1.error()); + } + if (!res2) + { + Checks::exit_with_message(VCPKG_LINE_INFO, res2.error()); + } + + Checks::exit_success(VCPKG_LINE_INFO); + } +} + +int main(int argc, char** argv) +{ + auto args = FuzzArgs(argc, argv); + + if (args.kind == FuzzKind::None) + { + args.print_help_and_exit(true); + } + + auto text = read_all_of_stdin(); + switch (args.kind) + { + case FuzzKind::JsonParser: fuzz_json_and_exit(text); + case FuzzKind::Utf8Decoder: fuzz_utf8_and_exit(text); + case FuzzKind::PlatformExpr: fuzz_platform_expr_and_exit(text); + default: Checks::exit_fail(VCPKG_LINE_INFO); + } +} diff --git a/toolsrc/src/vcpkg-test/arguments.cpp b/toolsrc/src/vcpkg-test/arguments.cpp index c63a313967cb9e..7ade6aa2a95ac1 100644 --- a/toolsrc/src/vcpkg-test/arguments.cpp +++ b/toolsrc/src/vcpkg-test/arguments.cpp @@ -27,18 +27,18 @@ TEST_CASE ("VcpkgCmdArguments from lowercase argument sequence", "[arguments]") REQUIRE(*v.scripts_root_dir == "C:\\scripts"); REQUIRE(v.debug); REQUIRE(*v.debug.get()); - REQUIRE(v.sendmetrics); - REQUIRE(*v.sendmetrics.get()); - REQUIRE(v.printmetrics); - REQUIRE(*v.printmetrics.get()); - - REQUIRE(v.overlay_ports->size() == 2); - REQUIRE(v.overlay_ports->at(0) == "C:\\ports1"); - REQUIRE(v.overlay_ports->at(1) == "C:\\ports2"); - - REQUIRE(v.overlay_triplets->size() == 2); - REQUIRE(v.overlay_triplets->at(0) == "C:\\tripletsA"); - REQUIRE(v.overlay_triplets->at(1) == "C:\\tripletsB"); + REQUIRE(v.send_metrics); + REQUIRE(*v.send_metrics.get()); + REQUIRE(v.print_metrics); + REQUIRE(*v.print_metrics.get()); + + REQUIRE(v.overlay_ports.size() == 2); + REQUIRE(v.overlay_ports.at(0) == "C:\\ports1"); + REQUIRE(v.overlay_ports.at(1) == "C:\\ports2"); + + REQUIRE(v.overlay_triplets.size() == 2); + REQUIRE(v.overlay_triplets.at(0) == "C:\\tripletsA"); + REQUIRE(v.overlay_triplets.at(1) == "C:\\tripletsB"); } TEST_CASE ("VcpkgCmdArguments from uppercase argument sequence", "[arguments]") @@ -59,32 +59,32 @@ TEST_CASE ("VcpkgCmdArguments from uppercase argument sequence", "[arguments]") REQUIRE(*v.scripts_root_dir == "C:\\scripts"); REQUIRE(v.debug); REQUIRE(*v.debug.get()); - REQUIRE(v.sendmetrics); - REQUIRE(*v.sendmetrics.get()); - REQUIRE(v.printmetrics); - REQUIRE(*v.printmetrics.get()); - - REQUIRE(v.overlay_ports->size() == 2); - REQUIRE(v.overlay_ports->at(0) == "C:\\ports1"); - REQUIRE(v.overlay_ports->at(1) == "C:\\ports2"); - - REQUIRE(v.overlay_triplets->size() == 2); - REQUIRE(v.overlay_triplets->at(0) == "C:\\tripletsA"); - REQUIRE(v.overlay_triplets->at(1) == "C:\\tripletsB"); + REQUIRE(v.send_metrics); + REQUIRE(*v.send_metrics.get()); + REQUIRE(v.print_metrics); + REQUIRE(*v.print_metrics.get()); + + REQUIRE(v.overlay_ports.size() == 2); + REQUIRE(v.overlay_ports.at(0) == "C:\\ports1"); + REQUIRE(v.overlay_ports.at(1) == "C:\\ports2"); + + REQUIRE(v.overlay_triplets.size() == 2); + REQUIRE(v.overlay_triplets.at(0) == "C:\\tripletsA"); + REQUIRE(v.overlay_triplets.at(1) == "C:\\tripletsB"); } TEST_CASE ("VcpkgCmdArguments from argument sequence with valued options", "[arguments]") { SECTION ("case 1") { - std::array settings = {{{"--a", ""}}}; + std::array settings = {{{"a", ""}}}; CommandStructure cmdstruct = {"", 0, SIZE_MAX, {{}, settings}, nullptr}; std::vector t = {"--a=b", "command", "argument"}; auto v = VcpkgCmdArguments::create_from_arg_sequence(t.data(), t.data() + t.size()); auto opts = v.parse_arguments(cmdstruct); - REQUIRE(opts.settings["--a"] == "b"); + REQUIRE(opts.settings["a"] == "b"); REQUIRE(v.command_arguments.size() == 1); REQUIRE(v.command_arguments[0] == "argument"); REQUIRE(v.command == "command"); @@ -92,18 +92,18 @@ TEST_CASE ("VcpkgCmdArguments from argument sequence with valued options", "[arg SECTION ("case 2") { - std::array switches = {{{"--a", ""}, {"--c", ""}}}; - std::array settings = {{{"--b", ""}, {"--d", ""}}}; + std::array switches = {{{"a", ""}, {"c", ""}}}; + std::array settings = {{{"b", ""}, {"d", ""}}}; CommandStructure cmdstruct = {"", 0, SIZE_MAX, {switches, settings}, nullptr}; std::vector t = {"--a", "--b=c"}; auto v = VcpkgCmdArguments::create_from_arg_sequence(t.data(), t.data() + t.size()); auto opts = v.parse_arguments(cmdstruct); - REQUIRE(opts.settings["--b"] == "c"); - REQUIRE(opts.settings.find("--d") == opts.settings.end()); - REQUIRE(opts.switches.find("--a") != opts.switches.end()); - REQUIRE(opts.settings.find("--c") == opts.settings.end()); + REQUIRE(opts.settings["b"] == "c"); + REQUIRE(opts.settings.find("d") == opts.settings.end()); + REQUIRE(opts.switches.find("a") != opts.switches.end()); + REQUIRE(opts.settings.find("c") == opts.settings.end()); REQUIRE(v.command_arguments.size() == 0); } } diff --git a/toolsrc/src/vcpkg-test/binarycaching.cpp b/toolsrc/src/vcpkg-test/binarycaching.cpp new file mode 100644 index 00000000000000..a8204f9c2add0e --- /dev/null +++ b/toolsrc/src/vcpkg-test/binarycaching.cpp @@ -0,0 +1,215 @@ +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +using namespace vcpkg; + +TEST_CASE ("reformat_version semver-ish", "[reformat_version]") +{ + REQUIRE(reformat_version("0.0.0", "abitag") == "0.0.0-abitag"); + REQUIRE(reformat_version("1.0.1", "abitag") == "1.0.1-abitag"); + REQUIRE(reformat_version("1.01.000", "abitag") == "1.1.0-abitag"); + REQUIRE(reformat_version("1.2", "abitag") == "1.2.0-abitag"); + REQUIRE(reformat_version("v52", "abitag") == "52.0.0-abitag"); + REQUIRE(reformat_version("v09.01.02", "abitag") == "9.1.2-abitag"); + REQUIRE(reformat_version("1.1.1q", "abitag") == "1.1.1-abitag"); + REQUIRE(reformat_version("1", "abitag") == "1.0.0-abitag"); +} + +TEST_CASE ("reformat_version date", "[reformat_version]") +{ + REQUIRE(reformat_version("2020-06-26", "abitag") == "2020.6.26-abitag"); + REQUIRE(reformat_version("20-06-26", "abitag") == "0.0.0-abitag"); + REQUIRE(reformat_version("2020-06-26-release", "abitag") == "2020.6.26-abitag"); + REQUIRE(reformat_version("2020-06-26000", "abitag") == "2020.6.26-abitag"); +} + +TEST_CASE ("reformat_version generic", "[reformat_version]") +{ + REQUIRE(reformat_version("apr", "abitag") == "0.0.0-abitag"); + REQUIRE(reformat_version("", "abitag") == "0.0.0-abitag"); +} + +TEST_CASE ("generate_nuspec", "[generate_nuspec]") +{ + auto& fsWrapper = Files::get_real_filesystem(); + VcpkgCmdArguments args = VcpkgCmdArguments::create_from_arg_sequence(nullptr, nullptr); + args.packages_root_dir = std::make_unique("/"); + VcpkgPaths paths(fsWrapper, args); + + auto pghs = Paragraphs::parse_paragraphs(R"( +Source: zlib2 +Version: 1.5 +Build-Depends: zlib +Description: a spiffy compression library wrapper + +Feature: a +Description: a feature + +Feature: b +Description: enable bzip capabilities +Build-Depends: bzip +)", + ""); + REQUIRE(pghs.has_value()); + auto maybe_scf = SourceControlFile::parse_control_file(fs::path(), std::move(*pghs.get())); + REQUIRE(maybe_scf.has_value()); + SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; + + Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Triplet::X64_WINDOWS}, + scfl, + Dependencies::RequestType::USER_REQUESTED, + {{"a", {}}, {"b", {}}}); + + ipa.abi_info = Build::AbiInfo{}; + ipa.abi_info.get()->package_abi = "packageabi"; + std::string tripletabi("tripletabi"); + ipa.abi_info.get()->triplet_abi = tripletabi; + + NugetReference ref(ipa); + + REQUIRE(ref.nupkg_filename() == "zlib2_x64-windows.1.5.0-packageabi.nupkg"); + + 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: + + + + + +)"; + 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) + { + INFO("on line: " << i); + REQUIRE(nuspec_lines[i] == expected_lines[i]); + } + REQUIRE(nuspec_lines.size() == expected_lines.size()); +} + +TEST_CASE ("XmlSerializer", "[XmlSerializer]") +{ + XmlSerializer xml; + xml.open_tag("a"); + xml.open_tag("b"); + xml.simple_tag("c", "d"); + xml.close_tag("b"); + xml.text("escaping: & < > \" '"); + + REQUIRE(xml.buf == R"(descaping: & < > " ')"); + + xml = XmlSerializer(); + xml.emit_declaration(); + xml.start_complex_open_tag("a") + .text_attr("b", "<") + .text_attr("c", " ") + .finish_self_closing_complex_tag() + .line_break(); + xml.simple_tag("d", "e"); + REQUIRE(xml.buf == R"()" + "\ne"); + + xml = XmlSerializer(); + xml.start_complex_open_tag("a").finish_complex_open_tag(); + REQUIRE(xml.buf == R"()"); + + xml = XmlSerializer(); + xml.line_break(); + xml.open_tag("a").line_break().line_break(); + xml.close_tag("a").line_break().line_break(); + REQUIRE(xml.buf == "\n\n\n\n\n"); + + xml = XmlSerializer(); + xml.start_complex_open_tag("a") + .text_attr("b", "<") + .line_break() + .text_attr("c", " ") + .finish_complex_open_tag() + .line_break(); + xml.simple_tag("d", "e").line_break(); + REQUIRE(xml.buf == "\n e\n"); +} + +TEST_CASE ("generate_nuget_packages_config", "[generate_nuget_packages_config]") +{ + Dependencies::ActionPlan plan; + auto packageconfig = generate_nuget_packages_config(plan); + REQUIRE(packageconfig == R"( + + +)"); + + auto pghs = Paragraphs::parse_paragraphs(R"( +Source: zlib +Version: 1.5 +Description: a spiffy compression library wrapper +)", + ""); + REQUIRE(pghs.has_value()); + auto maybe_scf = SourceControlFile::parse_control_file(fs::path(), std::move(*pghs.get())); + 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].source_control_file_location = scfl; + plan.install_actions[0].abi_info = Build::AbiInfo{}; + plan.install_actions[0].abi_info.get()->package_abi = "packageabi"; + + packageconfig = generate_nuget_packages_config(plan); + REQUIRE(packageconfig == R"( + + + +)"); + + auto pghs2 = Paragraphs::parse_paragraphs(R"( +Source: zlib2 +Version: 1.52 +Description: a spiffy compression library wrapper +)", + ""); + REQUIRE(pghs2.has_value()); + auto maybe_scf2 = SourceControlFile::parse_control_file(fs::path(), std::move(*pghs2.get())); + 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].source_control_file_location = scfl2; + plan.install_actions[1].abi_info = Build::AbiInfo{}; + plan.install_actions[1].abi_info.get()->package_abi = "packageabi2"; + + packageconfig = generate_nuget_packages_config(plan); + REQUIRE(packageconfig == R"( + + + + +)"); +} diff --git a/toolsrc/src/vcpkg-test/binaryconfigparser.cpp b/toolsrc/src/vcpkg-test/binaryconfigparser.cpp new file mode 100644 index 00000000000000..259f1986e1405b --- /dev/null +++ b/toolsrc/src/vcpkg-test/binaryconfigparser.cpp @@ -0,0 +1,300 @@ +#include + +#include + +using namespace vcpkg; + +#if defined(_WIN32) +#define ABSOLUTE_PATH "C:\\foo" +#else +#define ABSOLUTE_PATH "/foo" +#endif + +TEST_CASE ("BinaryConfigParser empty", "[binaryconfigparser]") +{ + auto parsed = create_binary_provider_from_configs_pure("", {}); + REQUIRE(parsed.has_value()); +} + +TEST_CASE ("BinaryConfigParser unacceptable provider", "[binaryconfigparser]") +{ + auto parsed = create_binary_provider_from_configs_pure("unacceptable", {}); + REQUIRE(!parsed.has_value()); +} + +TEST_CASE ("BinaryConfigParser files provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("files", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files,relative-path", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files,C:foo", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",nonsense", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",read", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",write", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",readwrite", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",readwrite,extra", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files,,upload", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser nuget source provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("nuget", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget,relative-path", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget,http://example.org/", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget," ABSOLUTE_PATH, {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget," ABSOLUTE_PATH ",nonsense", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget," ABSOLUTE_PATH ",readwrite", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget," ABSOLUTE_PATH ",readwrite,extra", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nuget,,readwrite", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser nuget config provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig,relative-path", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig,http://example.org/", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH, {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH ",nonsense", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH ",read", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH ",write", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH ",readwrite", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig," ABSOLUTE_PATH ",readwrite,extra", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("nugetconfig,,readwrite", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser default provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("default", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("default,nonsense", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("default,read", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("default,readwrite", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("default,write", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("default,read,extra", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser clear provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("clear", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear,upload", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser interactive provider", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("interactive", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("interactive,read", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser multiple providers", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure("clear;default", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear;default,read", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear;default,write", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear;default,readwrite", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear;default,readwrite;clear;clear", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("clear;files,relative;default", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure(";;;clear;;;;", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure(";;;,;;;;", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser escaping", "[binaryconfigparser]") +{ + { + auto parsed = create_binary_provider_from_configs_pure(";;;;;;;`", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure(";;;;;;;`defaul`t", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH "`", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH "`,", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH "``", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH "```", {}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH "````", {}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH ",", {}); + REQUIRE(!parsed.has_value()); + } +} + +TEST_CASE ("BinaryConfigParser args", "[binaryconfigparser]") +{ + { + auto parsed = + create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, std::vector{"clear"}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = + create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, std::vector{"clear;default"}); + REQUIRE(parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, + std::vector{"clear;default,"}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, + std::vector{"clear", "clear;default,"}); + REQUIRE(!parsed.has_value()); + } + { + auto parsed = create_binary_provider_from_configs_pure("files," ABSOLUTE_PATH, + std::vector{"clear", "clear"}); + REQUIRE(parsed.has_value()); + } +} diff --git a/toolsrc/src/vcpkg-test/commands.build.cpp b/toolsrc/src/vcpkg-test/commands.build.cpp new file mode 100644 index 00000000000000..88749e7fe3b17d --- /dev/null +++ b/toolsrc/src/vcpkg-test/commands.build.cpp @@ -0,0 +1,37 @@ +#include + +#include + +#include +#include +#include + +#include +#include + +#include + +using namespace vcpkg; + +TEST_CASE ("build smoke test", "[commands-build]") +{ + static const std::string args_raw[] = {"build", "zlib"}; + + auto& fs_wrapper = Files::get_real_filesystem(); + 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()); + args.install_root_dir = + std::make_unique((Test::base_temporary_directory() / fs::u8path("installed")).u8string()); + args.packages_root_dir = + std::make_unique((Test::base_temporary_directory() / fs::u8path("packages")).u8string()); + 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); + if (fs_wrapper.exists(paths.installed)) fs_wrapper.remove_all_inside(paths.installed, VCPKG_LINE_INFO); + auto triplet = default_triplet(args); + const auto exit_code = Build::Command::perform(args, paths, triplet); + REQUIRE(exit_code == 0); + REQUIRE(paths.get_filesystem().is_directory(paths.buildtrees / fs::u8path("zlib"))); +} diff --git a/toolsrc/src/vcpkg-test/commands.cpp b/toolsrc/src/vcpkg-test/commands.cpp new file mode 100644 index 00000000000000..eeefa30985833d --- /dev/null +++ b/toolsrc/src/vcpkg-test/commands.cpp @@ -0,0 +1,68 @@ +#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() == 18); + + 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-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 new file mode 100644 index 00000000000000..0cc93bd57652fb --- /dev/null +++ b/toolsrc/src/vcpkg-test/commands.create.cpp @@ -0,0 +1,27 @@ +#include + +#include + +#include +#include +#include + +#include +#include + +TEST_CASE ("create smoke test", "[commands-create]") +{ + using namespace vcpkg; + static const std::string argsRaw[] = {"create", "zlib2", "http://zlib.net/zlib-1.2.11.tar.gz", "zlib-1.2.11.zip"}; + + auto& fsWrapper = Files::get_real_filesystem(); + VcpkgCmdArguments args = VcpkgCmdArguments::create_from_arg_sequence(std::begin(argsRaw), std::end(argsRaw)); + VcpkgPaths paths(fsWrapper, args); + const auto exit_code = Commands::Create::perform(args, paths); + REQUIRE(exit_code == 0); + const auto expected_port = paths.ports / fs::u8path("zlib2"); + const auto expected_portfile_cmake = expected_port / fs::u8path("portfile.cmake"); + const auto lines = fsWrapper.read_lines(expected_portfile_cmake); + REQUIRE(lines.has_value()); + fsWrapper.remove_all(expected_port, ignore_errors); +} diff --git a/toolsrc/src/vcpkg-test/dependencies.cpp b/toolsrc/src/vcpkg-test/dependencies.cpp index c9eb0df3547943..6bd9dfc42b4c4f 100644 --- a/toolsrc/src/vcpkg-test/dependencies.cpp +++ b/toolsrc/src/vcpkg-test/dependencies.cpp @@ -1,10 +1,12 @@ #include -#include -#include + #include #include #include +#include +#include + using namespace vcpkg; using namespace vcpkg::Parse; @@ -14,8 +16,10 @@ TEST_CASE ("parse depends", "[dependencies]") REQUIRE(w); auto& v = *w.get(); REQUIRE(v.size() == 1); - REQUIRE(v.at(0).depend.name == "liba"); - REQUIRE(v.at(0).qualifier == "windows"); + REQUIRE(v.at(0).name == "liba"); + REQUIRE(v.at(0).platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", ""}})); + REQUIRE(v.at(0).platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"}})); + REQUIRE(!v.at(0).platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "Darwin"}})); } TEST_CASE ("filter depends", "[dependencies]") @@ -48,14 +52,17 @@ TEST_CASE ("parse feature depends", "[dependencies]") auto& v = *u_.get(); REQUIRE(v.size() == 2); auto&& a0 = v.at(0); - REQUIRE(a0.depend.name == "libwebp"); - REQUIRE(a0.depend.features.size() == 9); - REQUIRE(a0.qualifier.empty()); + REQUIRE(a0.name == "libwebp"); + REQUIRE(a0.features.size() == 9); + REQUIRE(a0.platform.is_empty()); auto&& a1 = v.at(1); - REQUIRE(a1.depend.name == "libwebp"); - REQUIRE(a1.depend.features.size() == 2); - REQUIRE(a1.qualifier == "!osx"); + REQUIRE(a1.name == "libwebp"); + REQUIRE(a1.features.size() == 2); + REQUIRE(!a1.platform.is_empty()); + REQUIRE(a1.platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", ""}})); + REQUIRE(a1.platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "Linux"}})); + REQUIRE_FALSE(a1.platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "Darwin"}})); } TEST_CASE ("qualified dependency", "[dependencies]") diff --git a/toolsrc/src/vcpkg-test/files.cpp b/toolsrc/src/vcpkg-test/files.cpp index cbe1e81c3c39eb..bc617d3268303d 100644 --- a/toolsrc/src/vcpkg-test/files.cpp +++ b/toolsrc/src/vcpkg-test/files.cpp @@ -1,14 +1,14 @@ #include -#include #include #include #include #include - #include +#include + using vcpkg::Test::AllowSymlinks; using vcpkg::Test::base_temporary_directory; using vcpkg::Test::can_create_symlinks; @@ -38,21 +38,21 @@ namespace struct MaxDepth { std::uint64_t i; - explicit MaxDepth(std::uint64_t i) : i(i) {} + explicit MaxDepth(std::uint64_t i) : i(i) { } operator uint64_t() const { return i; } }; struct Width { std::uint64_t i; - explicit Width(std::uint64_t i) : i(i) {} + explicit Width(std::uint64_t i) : i(i) { } operator uint64_t() const { return i; } }; struct CurrentDepth { std::uint64_t i; - explicit CurrentDepth(std::uint64_t i) : i(i) {} + explicit CurrentDepth(std::uint64_t i) : i(i) { } operator uint64_t() const { return i; } CurrentDepth incremented() const { return CurrentDepth{i + 1}; } }; diff --git a/toolsrc/src/vcpkg-test/json.cpp b/toolsrc/src/vcpkg-test/json.cpp new file mode 100644 index 00000000000000..0b9941861e4221 --- /dev/null +++ b/toolsrc/src/vcpkg-test/json.cpp @@ -0,0 +1,230 @@ +#include + +#include +#include + +#include + +#include "math.h" + +// TODO: remove this once we switch to C++20 completely +// This is the worst, but we also can't really deal with it any other way. +#if __cpp_char8_t +template +static auto _u8_string_to_char_string(const char8_t (&literal)[Sz]) -> const char (&)[Sz] +{ + return reinterpret_cast(literal); +} + +#define U8_STR(s) (::vcpkg::Unicode::_u8_string_to_char_string(u8"" s)) +#else +#define U8_STR(s) (u8"" s) +#endif + +namespace Json = vcpkg::Json; +using Json::Value; + +static std::string mystringify(const Value& val) { return Json::stringify(val, Json::JsonStyle{}); } + +TEST_CASE ("JSON stringify weird strings", "[json]") +{ + vcpkg::StringView str = U8_STR("😀 😁 😂 🤣 😃 😄 😅 😆 😉"); + REQUIRE(mystringify(Value::string(str)) == ('"' + str.to_string() + "\"\n")); + REQUIRE(mystringify(Value::string("\xED\xA0\x80")) == "\"\\ud800\"\n"); // unpaired surrogate +} + +TEST_CASE ("JSON parse keywords", "[json]") +{ + auto res = Json::parse("true"); + REQUIRE(res); + REQUIRE(res.get()->first.is_boolean()); + REQUIRE(res.get()->first.boolean()); + res = Json::parse(" false "); + REQUIRE(res); + REQUIRE(res.get()->first.is_boolean()); + REQUIRE(!res.get()->first.boolean()); + res = Json::parse(" null\t "); + REQUIRE(res); + REQUIRE(res.get()->first.is_null()); +} + +TEST_CASE ("JSON parse strings", "[json]") +{ + auto res = Json::parse(R"("")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string().size() == 0); + + res = Json::parse(R"("\ud800")"); // unpaired surrogate + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\xED\xA0\x80"); + + const auto make_json_string = [](vcpkg::StringView sv) { return '"' + sv.to_string() + '"'; }; + const vcpkg::StringView radical = U8_STR("⎷"); + const vcpkg::StringView grin = U8_STR("😁"); + + res = Json::parse(R"("\uD83D\uDE01")"); // paired surrogates for grin + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == grin.to_string()); + + res = Json::parse(make_json_string(radical)); // character in BMP + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == radical); + + res = Json::parse(make_json_string(grin)); // character above BMP + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + 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"); + REQUIRE(res); + REQUIRE(res.get()->first.is_integer()); + REQUIRE(res.get()->first.integer() == 0); + res = Json::parse("12345"); + REQUIRE(res); + REQUIRE(res.get()->first.is_integer()); + REQUIRE(res.get()->first.integer() == 12345); + res = Json::parse("-12345"); + REQUIRE(res); + REQUIRE(res.get()->first.is_integer()); + REQUIRE(res.get()->first.integer() == -12345); + res = Json::parse("9223372036854775807"); // INT64_MAX + REQUIRE(res); + REQUIRE(res.get()->first.is_integer()); + REQUIRE(res.get()->first.integer() == 9223372036854775807); + res = Json::parse("-9223372036854775808"); + REQUIRE(res); + REQUIRE(res.get()->first.is_integer()); + REQUIRE(res.get()->first.integer() == (-9223372036854775807 - 1)); // INT64_MIN (C++'s parser is fun) +} + +TEST_CASE ("JSON parse floats", "[json]") +{ + auto res = Json::parse("0.0"); + REQUIRE(res); + REQUIRE(res.get()->first.is_number()); + REQUIRE(!res.get()->first.is_integer()); + REQUIRE(res.get()->first.number() == 0.0); + REQUIRE(!signbit(res.get()->first.number())); + res = Json::parse("-0.0"); + REQUIRE(res); + REQUIRE(res.get()->first.is_number()); + REQUIRE(res.get()->first.number() == 0.0); + REQUIRE(signbit(res.get()->first.number())); + res = Json::parse("12345.6789"); + REQUIRE(res); + REQUIRE(res.get()->first.is_number()); + REQUIRE_THAT(res.get()->first.number(), Catch::WithinULP(12345.6789, 3)); + res = Json::parse("-12345.6789"); + REQUIRE(res); + REQUIRE(res.get()->first.is_number()); + REQUIRE_THAT(res.get()->first.number(), Catch::WithinULP(-12345.6789, 3)); +} + +TEST_CASE ("JSON parse arrays", "[json]") +{ + auto res = Json::parse("[]"); + REQUIRE(res); + auto val = std::move(res.get()->first); + REQUIRE(val.is_array()); + REQUIRE(val.array().size() == 0); + + res = Json::parse("[123]"); + REQUIRE(res); + val = std::move(res.get()->first); + REQUIRE(val.is_array()); + REQUIRE(val.array().size() == 1); + REQUIRE(val.array()[0].is_integer()); + REQUIRE(val.array()[0].integer() == 123); + + res = Json::parse("[123, 456]"); + REQUIRE(res); + val = std::move(res.get()->first); + REQUIRE(val.is_array()); + REQUIRE(val.array().size() == 2); + REQUIRE(val.array()[0].is_integer()); + REQUIRE(val.array()[0].integer() == 123); + REQUIRE(val.array()[1].is_integer()); + REQUIRE(val.array()[1].integer() == 456); + + res = Json::parse("[123, 456, [null]]"); + REQUIRE(res); + val = std::move(res.get()->first); + REQUIRE(val.is_array()); + REQUIRE(val.array().size() == 3); + REQUIRE(val.array()[2].is_array()); + REQUIRE(val.array()[2].array().size() == 1); + REQUIRE(val.array()[2].array()[0].is_null()); +} + +TEST_CASE ("JSON parse objects", "[json]") +{ + auto res = Json::parse("{}"); + REQUIRE(res); + auto val = std::move(res.get()->first); + REQUIRE(val.is_object()); + REQUIRE(val.object().size() == 0); +} + +TEST_CASE ("JSON parse full file", "[json]") +{ + vcpkg::StringView json = +#include "large-json-document.json.inc" + ; + + auto res = Json::parse(json); + if (!res) + { + std::cerr << res.error()->format() << '\n'; + } + REQUIRE(res); +} diff --git a/toolsrc/src/vcpkg-test/large-json-document.json.inc b/toolsrc/src/vcpkg-test/large-json-document.json.inc new file mode 100644 index 00000000000000..6cab7cf217f802 --- /dev/null +++ b/toolsrc/src/vcpkg-test/large-json-document.json.inc @@ -0,0 +1,516 @@ +// randomly generated by json-generator.com +R"json([ + { + "_id": "5e7a86c71cf688019f4c4b9f", + "index": 0, + "guid": "0e3c8a89-9960-4d87-8634-f9d3fcdaf735", + "isActive": false, + "balance": "$2,473.46", + "picture": "http://placehold.it/32x32", + "age": 21, + "eyeColor": "blue", + "name": { + "first": "Dana", + "last": "Romero" + }, + "company": "NETPLODE", + "email": "dana.romero@netplode.info", + "phone": "+1 (981) 479-2769", + "address": "501 Cass Place, Strykersville, Missouri, 8329", + "about": "Incididunt in fugiat ipsum proident aliqua voluptate Lorem nostrud laboris ut velit minim. Dolor culpa magna tempor cupidatat. Id esse quis ipsum incididunt. Aliqua deserunt aliquip esse minim cillum esse aliquip veniam non labore dolor incididunt. Sint ea consectetur exercitation aliqua proident reprehenderit tempor ea eu. Amet ipsum labore magna elit.", + "registered": "Wednesday, September 4, 2019 8:29 AM", + "latitude": "-49.844379", + "longitude": "-5.565357", + "tags": [ + "dolor", + "fugiat", + "ea", + "nisi", + "non" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Elena Suarez" + }, + { + "id": 1, + "name": "Pruitt Leach" + }, + { + "id": 2, + "name": "Pugh Robinson" + } + ], + "greeting": "Hello, Dana! You have 8 unread messages.", + "favoriteFruit": "apple" + }, + { + "_id": "5e7a86c70efbf62ab5579408", + "index": 1, + "guid": "2c64c2d3-a830-4598-a399-f68f798ba6dc", + "isActive": true, + "balance": "$1,838.58", + "picture": "http://placehold.it/32x32", + "age": 33, + "eyeColor": "brown", + "name": { + "first": "Ladonna", + "last": "Willis" + }, + "company": "JOVIOLD", + "email": "ladonna.willis@joviold.us", + "phone": "+1 (921) 591-2296", + "address": "441 Highland Place, Leyner, Pennsylvania, 1788", + "about": "Consequat deserunt nisi sit ex occaecat. Magna pariatur irure nisi duis laborum proident ipsum duis. Tempor qui consectetur consequat sunt proident ex ad id sint cupidatat sint.", + "registered": "Wednesday, January 13, 2016 6:03 PM", + "latitude": "-62.130182", + "longitude": "-102.884995", + "tags": [ + "fugiat", + "ipsum", + "ut", + "pariatur", + "enim" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Gamble Rose" + }, + { + "id": 1, + "name": "Olive Horn" + }, + { + "id": 2, + "name": "Benita Ochoa" + } + ], + "greeting": "Hello, Ladonna! You have 6 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "5e7a86c71e30c95bbb0ff386", + "index": 2, + "guid": "04e45222-d785-461b-99be-b330585eb1a1", + "isActive": true, + "balance": "$3,591.60", + "picture": "http://placehold.it/32x32", + "age": 32, + "eyeColor": "brown", + "name": { + "first": "Lee", + "last": "Buckley" + }, + "company": "TELEQUIET", + "email": "lee.buckley@telequiet.biz", + "phone": "+1 (897) 511-2132", + "address": "675 Argyle Road, Kempton, Ohio, 4411", + "about": "Sunt aliquip excepteur veniam fugiat consequat commodo ex est nulla laboris cillum enim. Laboris cupidatat et ipsum anim reprehenderit officia officia aute aliqua tempor. Incididunt sunt cupidatat mollit deserunt id nisi esse elit nisi est eiusmod aliquip. Lorem cillum ipsum quis aliquip laboris ex minim eu quis. Dolore incididunt officia labore enim Lorem in occaecat aliquip. Mollit ad duis non non qui et Lorem cillum.", + "registered": "Tuesday, January 16, 2018 3:14 PM", + "latitude": "-51.283144", + "longitude": "-112.569722", + "tags": [ + "id", + "veniam", + "dolor", + "nulla", + "pariatur" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Dina Craft" + }, + { + "id": 1, + "name": "Ashlee Ferrell" + }, + { + "id": 2, + "name": "Mcbride Gill" + } + ], + "greeting": "Hello, Lee! You have 7 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "5e7a86c70e08bf0c278749f9", + "index": 3, + "guid": "0928ccac-e028-405a-a614-76628ba131b4", + "isActive": false, + "balance": "$2,867.88", + "picture": "http://placehold.it/32x32", + "age": 26, + "eyeColor": "green", + "name": { + "first": "Chen", + "last": "Rosa" + }, + "company": "EXPOSA", + "email": "chen.rosa@exposa.me", + "phone": "+1 (956) 519-3064", + "address": "239 Amersfort Place, Fillmore, South Carolina, 2443", + "about": "Est ipsum cillum proident veniam voluptate enim sit eu excepteur veniam sit. Sunt aliqua qui incididunt id irure nulla qui. Et consequat ad anim proident minim dolor quis aliquip Lorem qui fugiat voluptate ex.", + "registered": "Wednesday, April 9, 2014 12:45 PM", + "latitude": "-15.222992", + "longitude": "76.730424", + "tags": [ + "eiusmod", + "sit", + "do", + "aute", + "ea" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Huff Townsend" + }, + { + "id": 1, + "name": "Stacie Downs" + }, + { + "id": 2, + "name": "Liza Barron" + } + ], + "greeting": "Hello, Chen! You have 8 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "5e7a86c7086fc15efc387abc", + "index": 4, + "guid": "c71e62aa-8428-44cd-a2a5-7c30aaf963fe", + "isActive": true, + "balance": "$3,022.64", + "picture": "http://placehold.it/32x32", + "age": 32, + "eyeColor": "blue", + "name": { + "first": "Walton", + "last": "Mendez" + }, + "company": "BUZZNESS", + "email": "walton.mendez@buzzness.tv", + "phone": "+1 (849) 560-2058", + "address": "507 Colonial Court, Collins, New York, 7941", + "about": "Et nisi in excepteur velit non incididunt sit. Consectetur magna sunt dolor eu Lorem adipisicing incididunt laborum consequat proident. Laboris ut dolor laboris esse ut dolor adipisicing ad fugiat commodo fugiat incididunt pariatur anim. Amet reprehenderit aute fugiat incididunt irure eu duis sint amet aliquip excepteur tempor dolore. Anim reprehenderit commodo irure sint et tempor occaecat fugiat ex commodo consectetur. Id ex dolor et culpa mollit. Voluptate magna est ex proident deserunt ullamco enim quis nulla cupidatat voluptate culpa exercitation Lorem.", + "registered": "Tuesday, May 9, 2017 2:38 PM", + "latitude": "86.083203", + "longitude": "57.386268", + "tags": [ + "Lorem", + "aute", + "proident", + "eu", + "incididunt" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Byers Sims" + }, + { + "id": 1, + "name": "Suzanne Gonzalez" + }, + { + "id": 2, + "name": "Vicki Velasquez" + } + ], + "greeting": "Hello, Walton! You have 5 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "5e7a86c7dc9b82ffcb2868a2", + "index": 5, + "guid": "76f1c1cc-9164-43df-8858-633ee696df1c", + "isActive": true, + "balance": "$2,625.28", + "picture": "http://placehold.it/32x32", + "age": 40, + "eyeColor": "green", + "name": { + "first": "Wise", + "last": "Head" + }, + "company": "FARMEX", + "email": "wise.head@farmex.com", + "phone": "+1 (850) 478-3280", + "address": "425 Kent Street, Witmer, New Jersey, 2411", + "about": "Velit amet fugiat enim occaecat do. Nulla sint officia anim ullamco. Ea quis excepteur excepteur enim ullamco. Amet aliqua mollit ad excepteur minim voluptate in velit sunt elit duis quis consequat nulla. Est dolor quis culpa aute id occaecat adipisicing mollit do consectetur fugiat. Mollit elit ex nostrud pariatur. Deserunt proident et voluptate occaecat labore occaecat Lorem exercitation est minim magna.", + "registered": "Monday, March 23, 2015 10:14 PM", + "latitude": "29.880281", + "longitude": "126.094567", + "tags": [ + "enim", + "sunt", + "cupidatat", + "officia", + "aute" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Fuentes Tyler" + }, + { + "id": 1, + "name": "Flora Massey" + }, + { + "id": 2, + "name": "Manuela Parks" + } + ], + "greeting": "Hello, Wise! You have 8 unread messages.", + "favoriteFruit": "strawberry" + }, + { + "_id": "5e7a86c7b3605b4ab198b25f", + "index": 6, + "guid": "818a0d46-9595-4066-a819-c93979220983", + "isActive": true, + "balance": "$3,193.77", + "picture": "http://placehold.it/32x32", + "age": 30, + "eyeColor": "brown", + "name": { + "first": "Baldwin", + "last": "Mcguire" + }, + "company": "ZILCH", + "email": "baldwin.mcguire@zilch.io", + "phone": "+1 (803) 562-3968", + "address": "address replaced", + "about": "Nostrud exercitation Lorem reprehenderit commodo aliquip. Exercitation exercitation proident aliquip et do cillum id ad ad reprehenderit ipsum elit nostrud. Occaecat velit sit commodo aliquip esse.", + "registered": "Saturday, January 14, 2017 3:13 AM", + "latitude": "-38.674801", + "longitude": "78.160951", + "tags": [ + "reprehenderit", + "eu", + "magna", + "nulla", + "non" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Austin Gonzales" + }, + { + "id": 1, + "name": "Polly Mcknight" + }, + { + "id": 2, + "name": "Lucy Wagner" + } + ], + "greeting": "Hello, Baldwin! You have 7 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "5e7a86c700d93af1dcbe69f3", + "index": 7, + "guid": "09dc8fc1-207f-45f2-9d2c-f1e70e278e9a", + "isActive": true, + "balance": "$3,895.90", + "picture": "http://placehold.it/32x32", + "age": 21, + "eyeColor": "brown", + "name": { + "first": "Key", + "last": "Bolton" + }, + "company": "MAGNINA", + "email": "key.bolton@magnina.net", + "phone": "+1 (918) 466-2785", + "address": "139 Blake Court, Chautauqua, Georgia, 3570", + "about": "Cupidatat excepteur reprehenderit eiusmod aute ea commodo ipsum pariatur dolore veniam adipisicing dolor. Excepteur ex in laborum cupidatat cillum cillum qui dolore consequat excepteur. Lorem deserunt eiusmod esse proident et ullamco reprehenderit ad ea. Cupidatat veniam deserunt magna eu labore ipsum et officia officia irure non eiusmod.", + "registered": "Wednesday, October 5, 2016 8:28 AM", + "latitude": "89.82294", + "longitude": "45.807834", + "tags": [ + "et", + "excepteur", + "sunt", + "ea", + "irure" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Farmer Adkins" + }, + { + "id": 1, + "name": "Summers Huffman" + }, + { + "id": 2, + "name": "Lessie Holden" + } + ], + "greeting": "Hello, Key! You have 9 unread messages.", + "favoriteFruit": "strawberry" + }, + { + "_id": "5e7a86c7a3fcbd25660a493d", + "index": 8, + "guid": "7d58a9c2-6940-499e-ba24-75227b1a09d9", + "isActive": true, + "balance": "$1,606.76", + "picture": "http://placehold.it/32x32", + "age": 31, + "eyeColor": "green", + "name": { + "first": "Gonzales", + "last": "Manning" + }, + "company": "ORGANICA", + "email": "gonzales.manning@organica.name", + "phone": "+1 (993) 556-2745", + "address": "690 Regent Place, Rodman, Marshall Islands, 7114", + "about": "Magna ullamco voluptate nostrud et magna ea aute sint id quis proident ad excepteur ullamco. Aliquip nostrud qui quis duis occaecat commodo laborum labore aute. Mollit ullamco in qui eu voluptate dolore aute mollit sint do sit nulla aliqua. Occaecat laborum ex velit ea ex ad eiusmod enim fugiat.", + "registered": "Monday, December 1, 2014 6:32 AM", + "latitude": "48.780262", + "longitude": "-75.333042", + "tags": [ + "non", + "laborum", + "et", + "Lorem", + "id" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Hester Finch" + }, + { + "id": 1, + "name": "Tia Cooley" + }, + { + "id": 2, + "name": "Cathryn Howe" + } + ], + "greeting": "Hello, Gonzales! You have 5 unread messages.", + "favoriteFruit": "apple" + } +])json" diff --git a/toolsrc/src/vcpkg-test/manifests.cpp b/toolsrc/src/vcpkg-test/manifests.cpp new file mode 100644 index 00000000000000..9fc041a19c1256 --- /dev/null +++ b/toolsrc/src/vcpkg-test/manifests.cpp @@ -0,0 +1,291 @@ +#include + +#include +#include + +#include +#include + +#include + +using namespace vcpkg; +using namespace vcpkg::Paragraphs; +using namespace vcpkg::Test; + +static Json::Object parse_json_object(StringView sv) +{ + auto json = Json::parse(sv); + // we're not testing json parsing here, so just fail on errors + if (auto r = json.get()) + { + return std::move(r->first.object()); + } + else + { + Checks::exit_with_message(VCPKG_LINE_INFO, json.error()->format()); + } +} + +static Parse::ParseExpected test_parse_manifest(StringView sv, bool expect_fail = false) +{ + auto object = parse_json_object(sv); + auto res = SourceControlFile::parse_manifest_file(fs::u8path(""), object); + if (!res.has_value() && !expect_fail) + { + print_error_message(res.error()); + } + return res; +} + +TEST_CASE ("manifest construct minimum", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "zlib", + "version-string": "1.2.8" + })json"); + + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->name == "zlib"); + REQUIRE(pgh.core_paragraph->version == "1.2.8"); + REQUIRE(pgh.core_paragraph->maintainers.empty()); + REQUIRE(pgh.core_paragraph->description.empty()); + REQUIRE(pgh.core_paragraph->dependencies.empty()); +} + +TEST_CASE ("manifest construct maximum", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "s", + "version-string": "v", + "maintainers": ["m"], + "description": "d", + "dependencies": ["bd"], + "default-features": ["df"], + "features": [ + { + "name": "iroh", + "description": "zuko's uncle", + "dependencies": [ + "firebending", + { + "name": "tea" + }, + { + "name": "order.white-lotus", + "features": [ "the-ancient-ways" ], + "platform": "!(windows & arm)" + } + ] + }, + { + "name": "zuko", + "description": ["son of the fire lord", "firebending 師父"] + } + ] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->name == "s"); + REQUIRE(pgh.core_paragraph->version == "v"); + REQUIRE(pgh.core_paragraph->maintainers.size() == 1); + REQUIRE(pgh.core_paragraph->maintainers[0] == "m"); + REQUIRE(pgh.core_paragraph->description.size() == 1); + REQUIRE(pgh.core_paragraph->description[0] == "d"); + REQUIRE(pgh.core_paragraph->dependencies.size() == 1); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "bd"); + REQUIRE(pgh.core_paragraph->default_features.size() == 1); + REQUIRE(pgh.core_paragraph->default_features[0] == "df"); + + REQUIRE(pgh.feature_paragraphs.size() == 2); + + REQUIRE(pgh.feature_paragraphs[0]->name == "iroh"); + 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 == "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[1].platform.evaluate( + {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); + 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"); + REQUIRE(pgh.feature_paragraphs[1]->description[1] == "firebending 師父"); +} + +TEST_CASE ("SourceParagraph manifest two dependencies", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "zlib", + "version-string": "1.2.8", + "dependencies": ["z", "openssl"] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->dependencies.size() == 2); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); +} + +TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "zlib", + "version-string": "1.2.8", + "dependencies": ["z", "openssl", "xyz"] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->dependencies.size() == 3); + // 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]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "zlib", + "version-string": "1.2.8", + "dependencies": [ + { + "name": "liba", + "platform": "windows" + }, + { + "name": "libb", + "platform": "uwp" + } + ] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->name == "zlib"); + REQUIRE(pgh.core_paragraph->version == "1.2.8"); + REQUIRE(pgh.core_paragraph->maintainers.empty()); + REQUIRE(pgh.core_paragraph->description.empty()); + REQUIRE(pgh.core_paragraph->dependencies.size() == 2); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "liba"); + REQUIRE(pgh.core_paragraph->dependencies[0].platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", ""}})); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "libb"); + REQUIRE(pgh.core_paragraph->dependencies[1].platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"}})); +} + +TEST_CASE ("SourceParagraph manifest default features", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "a", + "version-string": "1.0", + "default-features": ["a1"] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->default_features.size() == 1); + REQUIRE(pgh.core_paragraph->default_features[0] == "a1"); +} + +TEST_CASE ("SourceParagraph manifest description paragraph", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "a", + "version-string": "1.0", + "description": ["line 1", "line 2", "line 3"] + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->description.size() == 3); + REQUIRE(pgh.core_paragraph->description[0] == "line 1"); + REQUIRE(pgh.core_paragraph->description[1] == "line 2"); + REQUIRE(pgh.core_paragraph->description[2] == "line 3"); +} + +TEST_CASE ("SourceParagraph manifest supports", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "a", + "version-string": "1.0", + "supports": "!(windows | osx)" + })json"); + REQUIRE(m_pgh.has_value()); + auto& pgh = **m_pgh.get(); + + REQUIRE(pgh.core_paragraph->supports_expression.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "Linux"}})); + REQUIRE_FALSE(pgh.core_paragraph->supports_expression.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", ""}})); + REQUIRE_FALSE(pgh.core_paragraph->supports_expression.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "Darwin"}})); +} + +TEST_CASE ("SourceParagraph manifest empty supports", "[manifests]") +{ + auto m_pgh = test_parse_manifest(R"json({ + "name": "a", + "version-string": "1.0", + "supports": "" + })json", + 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()); + auto paths = VcpkgPaths{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, control.u8string()); + 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/mockcmakevarsprovider.cpp b/toolsrc/src/vcpkg-test/mockcmakevarsprovider.cpp index 655bc33b4d7003..77a796fade0781 100644 --- a/toolsrc/src/vcpkg-test/mockcmakevarsprovider.cpp +++ b/toolsrc/src/vcpkg-test/mockcmakevarsprovider.cpp @@ -1,28 +1,28 @@ -#include - -namespace vcpkg::Test -{ - Optional&> MockCMakeVarProvider::get_generic_triplet_vars( - Triplet triplet) const - { - auto it = generic_triplet_vars.find(triplet); - if (it == generic_triplet_vars.end()) return nullopt; - return it->second; - } - - Optional&> MockCMakeVarProvider::get_dep_info_vars( - const PackageSpec& spec) const - { - auto it = dep_info_vars.find(spec); - if (it == dep_info_vars.end()) return nullopt; - return it->second; - } - - Optional&> MockCMakeVarProvider::get_tag_vars( - const PackageSpec& spec) const - { - auto it = tag_vars.find(spec); - if (it == tag_vars.end()) return nullopt; - return it->second; - } -} \ No newline at end of file +#include + +namespace vcpkg::Test +{ + Optional&> MockCMakeVarProvider::get_generic_triplet_vars( + Triplet triplet) const + { + auto it = generic_triplet_vars.find(triplet); + if (it == generic_triplet_vars.end()) return nullopt; + return it->second; + } + + Optional&> MockCMakeVarProvider::get_dep_info_vars( + const PackageSpec& spec) const + { + auto it = dep_info_vars.find(spec); + if (it == dep_info_vars.end()) return nullopt; + return it->second; + } + + Optional&> MockCMakeVarProvider::get_tag_vars( + const PackageSpec& spec) const + { + auto it = tag_vars.find(spec); + if (it == tag_vars.end()) return nullopt; + return it->second; + } +} diff --git a/toolsrc/src/vcpkg-test/optional.cpp b/toolsrc/src/vcpkg-test/optional.cpp index ce728208f4585f..929410eb305178 100644 --- a/toolsrc/src/vcpkg-test/optional.cpp +++ b/toolsrc/src/vcpkg-test/optional.cpp @@ -1,5 +1,7 @@ #include + #include + #include namespace @@ -19,9 +21,9 @@ TEST_CASE ("equal", "[optional]") using vcpkg::Optional; CHECK(Optional{} == Optional{}); - CHECK(!(Optional{} == Optional{42})); - CHECK(!(Optional{42} == Optional{})); - CHECK(!(Optional{1729} == Optional{42})); + CHECK_FALSE(Optional{} == Optional{42}); + CHECK_FALSE(Optional{42} == Optional{}); + CHECK_FALSE(Optional{1729} == Optional{42}); CHECK(Optional{42} == Optional{42}); } diff --git a/toolsrc/src/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index 678064f1cccc1e..05ba8cfba3d803 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -1,35 +1,36 @@ #include -#include #include #include +#include + namespace Strings = vcpkg::Strings; using vcpkg::Parse::Paragraph; -namespace { - -auto test_parse_control_file(const std::vector>& v) +namespace { - std::vector pghs; - for (auto&& p : v) + auto test_parse_control_file(const std::vector>& v) { - pghs.emplace_back(); - for (auto&& kv : p) - pghs.back().emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{})); + std::vector pghs; + for (auto&& p : v) + { + pghs.emplace_back(); + for (auto&& kv : p) + pghs.back().emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{})); + } + return vcpkg::SourceControlFile::parse_control_file("", std::move(pghs)); } - return vcpkg::SourceControlFile::parse_control_file("", std::move(pghs)); -} -auto test_make_binary_paragraph(const std::unordered_map& v) -{ - Paragraph pgh; - for (auto&& kv : v) - pgh.emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{})); + auto test_make_binary_paragraph(const std::unordered_map& v) + { + Paragraph pgh; + for (auto&& kv : v) + pgh.emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{})); - return vcpkg::BinaryParagraph(std::move(pgh)); -} + return vcpkg::BinaryParagraph(std::move(pgh)); + } } @@ -45,9 +46,9 @@ TEST_CASE ("SourceParagraph construct minimum", "[paragraph]") REQUIRE(pgh.core_paragraph->name == "zlib"); REQUIRE(pgh.core_paragraph->version == "1.2.8"); - REQUIRE(pgh.core_paragraph->maintainer == ""); - REQUIRE(pgh.core_paragraph->description == ""); - REQUIRE(pgh.core_paragraph->depends.size() == 0); + REQUIRE(pgh.core_paragraph->maintainers.empty()); + REQUIRE(pgh.core_paragraph->description.empty()); + REQUIRE(pgh.core_paragraph->dependencies.size() == 0); } TEST_CASE ("SourceParagraph construct maximum", "[paragraph]") @@ -65,15 +66,17 @@ TEST_CASE ("SourceParagraph construct maximum", "[paragraph]") REQUIRE(pgh.core_paragraph->name == "s"); REQUIRE(pgh.core_paragraph->version == "v"); - REQUIRE(pgh.core_paragraph->maintainer == "m"); - REQUIRE(pgh.core_paragraph->description == "d"); - REQUIRE(pgh.core_paragraph->depends.size() == 1); - REQUIRE(pgh.core_paragraph->depends[0].depend.name == "bd"); + REQUIRE(pgh.core_paragraph->maintainers.size() == 1); + REQUIRE(pgh.core_paragraph->maintainers[0] == "m"); + REQUIRE(pgh.core_paragraph->description.size() == 1); + REQUIRE(pgh.core_paragraph->description[0] == "d"); + REQUIRE(pgh.core_paragraph->dependencies.size() == 1); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "bd"); REQUIRE(pgh.core_paragraph->default_features.size() == 1); REQUIRE(pgh.core_paragraph->default_features[0] == "df"); } -TEST_CASE ("SourceParagraph two depends", "[paragraph]") +TEST_CASE ("SourceParagraph two dependencies", "[paragraph]") { auto m_pgh = test_parse_control_file({{ {"Source", "zlib"}, @@ -83,12 +86,13 @@ TEST_CASE ("SourceParagraph two depends", "[paragraph]") REQUIRE(m_pgh.has_value()); auto& pgh = **m_pgh.get(); - REQUIRE(pgh.core_paragraph->depends.size() == 2); - REQUIRE(pgh.core_paragraph->depends[0].depend.name == "z"); - REQUIRE(pgh.core_paragraph->depends[1].depend.name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies.size() == 2); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); } -TEST_CASE ("SourceParagraph three depends", "[paragraph]") +TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") { auto m_pgh = test_parse_control_file({{ {"Source", "zlib"}, @@ -98,13 +102,14 @@ TEST_CASE ("SourceParagraph three depends", "[paragraph]") REQUIRE(m_pgh.has_value()); auto& pgh = **m_pgh.get(); - REQUIRE(pgh.core_paragraph->depends.size() == 3); - REQUIRE(pgh.core_paragraph->depends[0].depend.name == "z"); - REQUIRE(pgh.core_paragraph->depends[1].depend.name == "openssl"); - REQUIRE(pgh.core_paragraph->depends[2].depend.name == "xyz"); + REQUIRE(pgh.core_paragraph->dependencies.size() == 3); + // 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 depends", "[paragraph]") +TEST_CASE ("SourceParagraph construct qualified dependencies", "[paragraph]") { auto m_pgh = test_parse_control_file({{ {"Source", "zlib"}, @@ -116,13 +121,13 @@ TEST_CASE ("SourceParagraph construct qualified depends", "[paragraph]") REQUIRE(pgh.core_paragraph->name == "zlib"); REQUIRE(pgh.core_paragraph->version == "1.2.8"); - REQUIRE(pgh.core_paragraph->maintainer == ""); - REQUIRE(pgh.core_paragraph->description == ""); - REQUIRE(pgh.core_paragraph->depends.size() == 2); - REQUIRE(pgh.core_paragraph->depends[0].depend.name == "liba"); - REQUIRE(pgh.core_paragraph->depends[0].qualifier == "windows"); - REQUIRE(pgh.core_paragraph->depends[1].depend.name == "libb"); - REQUIRE(pgh.core_paragraph->depends[1].qualifier == "uwp"); + REQUIRE(pgh.core_paragraph->maintainers.empty()); + REQUIRE(pgh.core_paragraph->description.empty()); + REQUIRE(pgh.core_paragraph->dependencies.size() == 2); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "liba"); + REQUIRE(pgh.core_paragraph->dependencies[0].platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", ""}})); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "libb"); + REQUIRE(pgh.core_paragraph->dependencies[1].platform.evaluate({{"VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"}})); } TEST_CASE ("SourceParagraph default features", "[paragraph]") @@ -150,10 +155,10 @@ TEST_CASE ("BinaryParagraph construct minimum", "[paragraph]") REQUIRE(pgh.spec.name() == "zlib"); REQUIRE(pgh.version == "1.2.8"); - REQUIRE(pgh.maintainer == ""); - REQUIRE(pgh.description == ""); + REQUIRE(pgh.maintainers.empty()); + REQUIRE(pgh.description.empty()); REQUIRE(pgh.spec.triplet().canonical_name() == "x86-windows"); - REQUIRE(pgh.depends.size() == 0); + REQUIRE(pgh.dependencies.size() == 0); } TEST_CASE ("BinaryParagraph construct maximum", "[paragraph]") @@ -170,13 +175,15 @@ TEST_CASE ("BinaryParagraph construct maximum", "[paragraph]") REQUIRE(pgh.spec.name() == "s"); REQUIRE(pgh.version == "v"); - REQUIRE(pgh.maintainer == "m"); - REQUIRE(pgh.description == "d"); - REQUIRE(pgh.depends.size() == 1); - REQUIRE(pgh.depends[0] == "bd"); + REQUIRE(pgh.maintainers.size() == 1); + REQUIRE(pgh.maintainers[0] == "m"); + REQUIRE(pgh.description.size() == 1); + REQUIRE(pgh.description[0] == "d"); + REQUIRE(pgh.dependencies.size() == 1); + REQUIRE(pgh.dependencies[0] == "bd"); } -TEST_CASE ("BinaryParagraph three depends", "[paragraph]") +TEST_CASE ("BinaryParagraph three dependencies", "[paragraph]") { auto pgh = test_make_binary_paragraph({ {"Package", "zlib"}, @@ -186,10 +193,10 @@ TEST_CASE ("BinaryParagraph three depends", "[paragraph]") {"Depends", "a, b, c"}, }); - REQUIRE(pgh.depends.size() == 3); - REQUIRE(pgh.depends[0] == "a"); - REQUIRE(pgh.depends[1] == "b"); - REQUIRE(pgh.depends[2] == "c"); + REQUIRE(pgh.dependencies.size() == 3); + REQUIRE(pgh.dependencies[0] == "a"); + REQUIRE(pgh.dependencies[1] == "b"); + REQUIRE(pgh.dependencies[2] == "c"); } TEST_CASE ("BinaryParagraph abi", "[paragraph]") @@ -202,7 +209,7 @@ TEST_CASE ("BinaryParagraph abi", "[paragraph]") {"Abi", "abcd123"}, }); - REQUIRE(pgh.depends.size() == 0); + REQUIRE(pgh.dependencies.size() == 0); REQUIRE(pgh.abi == "abcd123"); } @@ -216,7 +223,7 @@ TEST_CASE ("BinaryParagraph default features", "[paragraph]") {"Default-Features", "a1"}, }); - REQUIRE(pgh.depends.size() == 0); + REQUIRE(pgh.dependencies.size() == 0); REQUIRE(pgh.default_features.size() == 1); REQUIRE(pgh.default_features[0] == "a1"); } @@ -300,8 +307,8 @@ TEST_CASE ("parse paragraphs empty fields", "[paragraph]") REQUIRE(pghs.size() == 1); REQUIRE(pghs[0].size() == 2); - REQUIRE(pghs[0]["f1"].first == ""); - REQUIRE(pghs[0]["f2"].first == ""); + REQUIRE(pghs[0]["f1"].first.empty()); + REQUIRE(pghs[0]["f2"].first.empty()); REQUIRE(pghs[0].size() == 2); } @@ -408,7 +415,7 @@ TEST_CASE ("BinaryParagraph serialize max", "[paragraph]") REQUIRE(pghs[0]["Version"].first == "1.2.8"); REQUIRE(pghs[0]["Architecture"].first == "x86-windows"); REQUIRE(pghs[0]["Multi-Arch"].first == "same"); - REQUIRE(pghs[0]["Description"].first == "first line\n second line"); + REQUIRE(pghs[0]["Description"].first == "first line\n second line"); REQUIRE(pghs[0]["Depends"].first == "dep"); REQUIRE(pghs[0]["Type"].first == "Port"); } diff --git a/toolsrc/src/vcpkg-test/plan.cpp b/toolsrc/src/vcpkg-test/plan.cpp index d3d4310e929d01..09c377ecc1da57 100644 --- a/toolsrc/src/vcpkg-test/plan.cpp +++ b/toolsrc/src/vcpkg-test/plan.cpp @@ -1,8 +1,7 @@ #include -#include -#include #include + #include #include #include @@ -12,6 +11,9 @@ #include #include +#include +#include + using namespace vcpkg; using Test::make_control_file; @@ -37,7 +39,7 @@ static void features_check(Dependencies::InstallPlanAction& plan, for (auto&& feature_name : expected_features) { // TODO: see if this can be simplified - if (feature_name == "core" || feature_name == "") + if (feature_name == "core" || feature_name.empty()) { REQUIRE((Util::find(feature_list, "core") != feature_list.end() || Util::find(feature_list, "") != feature_list.end())); @@ -369,9 +371,8 @@ TEST_CASE ("basic feature test 7", "[plan]") remove_plan_check(plan.remove_actions.at(0), "x"); remove_plan_check(plan.remove_actions.at(1), "b"); - // TODO: order here may change but A < X, and B anywhere - features_check(plan.install_actions.at(0), "b", {"core", "b1"}); - features_check(plan.install_actions.at(1), "a", {"core"}); + features_check(plan.install_actions.at(0), "a", {"core"}); + features_check(plan.install_actions.at(1), "b", {"core", "b1"}); features_check(plan.install_actions.at(2), "x", {"core"}); } @@ -624,6 +625,34 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::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); + spec_map.emplace("a", "b"); + // "b" has a default feature + spec_map.emplace("b", "", {{"b1", ""}}, {"b1"}); + + 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); + + // Install "a" (without explicit feature specification) + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + PortFileProvider::MapPortFileProvider map_port{spec_map.map}; + MockCMakeVarProvider var_provider; + + auto install_plan = Dependencies::create_feature_install_plan(map_port, + var_provider, + {install_specs.value_or_exit(VCPKG_LINE_INFO)}, + StatusParagraphs(std::move(status_paragraphs))); + + // 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); +} + TEST_CASE ("install default features of dependency test 3", "[plan]") { std::vector> status_paragraphs; diff --git a/toolsrc/src/vcpkg-test/specifier.cpp b/toolsrc/src/vcpkg-test/specifier.cpp index 2a1398416f16c0..f350ff60132b41 100644 --- a/toolsrc/src/vcpkg-test/specifier.cpp +++ b/toolsrc/src/vcpkg-test/specifier.cpp @@ -2,6 +2,7 @@ #include #include + #include using namespace vcpkg; diff --git a/toolsrc/src/vcpkg-test/statusparagraphs.cpp b/toolsrc/src/vcpkg-test/statusparagraphs.cpp index acb8b333c0176c..382eab1a72fcdd 100644 --- a/toolsrc/src/vcpkg-test/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg-test/statusparagraphs.cpp @@ -1,10 +1,12 @@ #include -#include #include + #include #include +#include + using namespace vcpkg; using namespace vcpkg::Paragraphs; using namespace vcpkg::Test; diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index d58d1b17256b41..95a6de2af9d086 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -2,15 +2,17 @@ #include -#include +#include + +#include #include #include TEST_CASE ("b32 encoding", "[strings]") { - using u64 = std::uint64_t; + using u64 = uint64_t; - std::vector> map; + std::vector> map; map.emplace_back(0, "AAAAAAAAAAAAA"); map.emplace_back(1, "BAAAAAAAAAAAA"); @@ -24,10 +26,29 @@ TEST_CASE ("b32 encoding", "[strings]") map.emplace_back(0x1405'64E7'FE7E'A88C, "MEK5H774ELBIB"); map.emplace_back(0xFFFF'FFFF'FFFF'FFFF, "777777777777P"); - std::string result; for (const auto& pr : map) { - result = vcpkg::Strings::b32_encode(pr.first); REQUIRE(vcpkg::Strings::b32_encode(pr.first) == pr.second); } } + +TEST_CASE ("split by char", "[strings]") +{ + using vcpkg::Strings::split; + using result_t = std::vector; + REQUIRE(split(",,,,,,", ',').empty()); + REQUIRE(split(",,a,,b,,", ',') == result_t{"a", "b"}); + REQUIRE(split("hello world", ' ') == result_t{"hello", "world"}); + REQUIRE(split(" hello world ", ' ') == result_t{"hello", "world"}); + REQUIRE(split("no delimiters", ',') == result_t{"no delimiters"}); +} + +TEST_CASE ("find_first_of", "[strings]") +{ + using vcpkg::Strings::find_first_of; + REQUIRE(find_first_of("abcdefg", "hij") == std::string()); + REQUIRE(find_first_of("abcdefg", "a") == std::string("abcdefg")); + REQUIRE(find_first_of("abcdefg", "g") == std::string("g")); + REQUIRE(find_first_of("abcdefg", "bg") == std::string("bcdefg")); + REQUIRE(find_first_of("abcdefg", "gb") == std::string("bcdefg")); +} diff --git a/toolsrc/src/vcpkg-test/stringview.cpp b/toolsrc/src/vcpkg-test/stringview.cpp index 4df8e6be567a92..953a7de99603fe 100644 --- a/toolsrc/src/vcpkg-test/stringview.cpp +++ b/toolsrc/src/vcpkg-test/stringview.cpp @@ -2,16 +2,18 @@ #include -template -static vcpkg::StringView sv(const char (&cstr)[N]) { - return cstr; +template +static vcpkg::StringView sv(const char (&cstr)[N]) +{ + return cstr; } -TEST_CASE("string view operator==", "[stringview]") { - // these are due to a bug in operator== - // see commit 782723959399a1a0725ac49 - REQUIRE(sv("hey") != sv("heys")); - REQUIRE(sv("heys") != sv("hey")); - REQUIRE(sv("hey") == sv("hey")); - REQUIRE(sv("hey") != sv("hex")); +TEST_CASE ("string view operator==", "[stringview]") +{ + // these are due to a bug in operator== + // see commit 782723959399a1a0725ac49 + REQUIRE(sv("hey") != sv("heys")); + REQUIRE(sv("heys") != sv("hey")); + REQUIRE(sv("hey") == sv("hey")); + REQUIRE(sv("hey") != sv("hex")); } diff --git a/toolsrc/src/vcpkg-test/system.cpp b/toolsrc/src/vcpkg-test/system.cpp index 70424f0b54c8df..01540635816275 100644 --- a/toolsrc/src/vcpkg-test/system.cpp +++ b/toolsrc/src/vcpkg-test/system.cpp @@ -1,33 +1,29 @@ +#include + #include -#include #include -#include -#include #include +#include #include +#include +#include -#if defined(_WIN32) -#define _NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include -#else -#include -#endif +#include +using vcpkg::nullopt; using vcpkg::Optional; using vcpkg::StringView; using vcpkg::ZStringView; using vcpkg::Checks::check_exit; +using vcpkg::System::CPUArchitecture; using vcpkg::System::get_environment_variable; -using vcpkg::System::to_cpu_architecture; using vcpkg::System::guess_visual_studio_prompt_target_architecture; -using vcpkg::nullopt; -using vcpkg::System::CPUArchitecture; +using vcpkg::System::to_cpu_architecture; namespace { - void set_environment_variable(StringView varname, Optional value) + void set_environment_variable(ZStringView varname, Optional value) { #if defined(_WIN32) const auto w_varname = vcpkg::Strings::to_utf16(varname); @@ -45,19 +41,14 @@ namespace check_exit(VCPKG_LINE_INFO, exit_code != 0); #else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv - std::string tmp; - tmp.append(varname.data(), varname.size()); - tmp.push_back('='); if (auto v = value.get()) { - tmp.append(*v); + check_exit(VCPKG_LINE_INFO, setenv(varname.c_str(), v->c_str(), 1) == 0); + } + else + { + check_exit(VCPKG_LINE_INFO, unsetenv(varname.c_str()) == 0); } - - // putenv expects the string to never go out of scope - char* env_string = new char[tmp.size() + 1]; // overflow checked by tmp's null allocation - memcpy(env_string, tmp.data(), tmp.size()); - const int exit_code = putenv(env_string); - check_exit(VCPKG_LINE_INFO, exit_code == 0); #endif // defined(_WIN32) } @@ -138,30 +129,43 @@ TEST_CASE ("guess_visual_studio_prompt", "[system]") set_environment_variable("VSCMD_ARG_TGT_ARCH", nullopt); CHECK(!guess_visual_studio_prompt_target_architecture().has_value()); set_environment_variable("VSCMD_ARG_TGT_ARCH", "x86"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); set_environment_variable("VSCMD_ARG_TGT_ARCH", "x64"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X64); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X64); set_environment_variable("VSCMD_ARG_TGT_ARCH", "arm"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM); set_environment_variable("VSCMD_ARG_TGT_ARCH", "arm64"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM64); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM64); // check that apparent "nested" prompts defer to "vsdevcmd" set_environment_variable("VCINSTALLDIR", "anything"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM64); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::ARM64); set_environment_variable("VSCMD_ARG_TGT_ARCH", nullopt); set_environment_variable("Platform", nullopt); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); set_environment_variable("Platform", "x86"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X86); set_environment_variable("Platform", "x64"); - CHECK(guess_visual_studio_prompt_target_architecture() - .value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X64); + CHECK(guess_visual_studio_prompt_target_architecture().value_or_exit(VCPKG_LINE_INFO) == CPUArchitecture::X64); +} + +TEST_CASE ("cmdlinebuilder", "[system]") +{ + using vcpkg::System::CmdLineBuilder; + + CmdLineBuilder cmd; + cmd.path_arg(fs::u8path("relative/path.exe")); + cmd.string_arg("abc"); + cmd.string_arg("hello world!"); + cmd.string_arg("|"); + cmd.string_arg(";"); + REQUIRE(cmd.extract() == "relative/path.exe abc \"hello world!\" \"|\" \";\""); + + cmd.path_arg(fs::u8path("trailing\\slash\\")); + cmd.string_arg("inner\"quotes"); +#ifdef _WIN32 + REQUIRE(cmd.extract() == "\"trailing\\slash\\\\\" \"inner\\\"quotes\""); +#else + REQUIRE(cmd.extract() == "\"trailing\\\\slash\\\\\" \"inner\\\"quotes\""); +#endif } diff --git a/toolsrc/src/vcpkg-test/uint128.cpp b/toolsrc/src/vcpkg-test/uint128.cpp index 57d0169afc1e6a..a13b25e4f96c70 100644 --- a/toolsrc/src/vcpkg-test/uint128.cpp +++ b/toolsrc/src/vcpkg-test/uint128.cpp @@ -2,63 +2,67 @@ #include -TEST_CASE ("uint128 constructor and assign", "[uint128]") { - vcpkg::UInt128 x = 120; - REQUIRE(x.bottom_64_bits() == 120); - REQUIRE(x.top_64_bits() == 0); +TEST_CASE ("uint128 constructor and assign", "[uint128]") +{ + vcpkg::UInt128 x = 120; + REQUIRE(x.bottom_64_bits() == 120); + REQUIRE(x.top_64_bits() == 0); - x = 3201; - REQUIRE(x.bottom_64_bits() == 3201); - REQUIRE(x.top_64_bits() == 0); - - x = 0xFFFF'FFFF'FFFF'FFFF; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); - REQUIRE(x.top_64_bits() == 0); + x = 3201; + REQUIRE(x.bottom_64_bits() == 3201); + REQUIRE(x.top_64_bits() == 0); + + x = 0xFFFF'FFFF'FFFF'FFFF; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); + REQUIRE(x.top_64_bits() == 0); } -TEST_CASE ("uint128 add-assign", "[uint128]") { - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x += 1; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 1); +TEST_CASE ("uint128 add-assign", "[uint128]") +{ + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x += 1; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 1); } -TEST_CASE ("uint128 shl-assign", "[uint128]") { - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x <<= 32; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); - REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); - - x <<= 60; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'F000'0000); +TEST_CASE ("uint128 shl-assign", "[uint128]") +{ + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x <<= 32; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); + REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); + + x <<= 60; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'F000'0000); - x = 1; - x <<= 96; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == (uint64_t(1) << 32)); + x = 1; + x <<= 96; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == (uint64_t(1) << 32)); } -TEST_CASE ("uint128 shr-assign", "[uint128]") { - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x <<= 64; - REQUIRE(x.bottom_64_bits() == 0x0000'0000'0000'0000); - REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); +TEST_CASE ("uint128 shr-assign", "[uint128]") +{ + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x <<= 64; + REQUIRE(x.bottom_64_bits() == 0x0000'0000'0000'0000); + REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); + + x >>= 32; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); + REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); - x >>= 32; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); - REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); - - x >>= 60; - REQUIRE(x.bottom_64_bits() == 0x0000'000F'FFFF'FFFF); - REQUIRE(x.top_64_bits() == 0x0000'0000'0000'0000); + x >>= 60; + REQUIRE(x.bottom_64_bits() == 0x0000'000F'FFFF'FFFF); + REQUIRE(x.top_64_bits() == 0x0000'0000'0000'0000); - x = 0x8000'0000'0000'0000; - x <<= 64; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 0x8000'0000'0000'0000); + x = 0x8000'0000'0000'0000; + x <<= 64; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 0x8000'0000'0000'0000); - x >>= 96; - REQUIRE(x.bottom_64_bits() == (uint64_t(1) << 31)); - REQUIRE(x.top_64_bits() == 0); + x >>= 96; + REQUIRE(x.bottom_64_bits() == (uint64_t(1) << 31)); + REQUIRE(x.top_64_bits() == 0); } diff --git a/toolsrc/src/vcpkg-test/update.cpp b/toolsrc/src/vcpkg-test/update.cpp index 5370a842160f99..68339547a55578 100644 --- a/toolsrc/src/vcpkg-test/update.cpp +++ b/toolsrc/src/vcpkg-test/update.cpp @@ -1,10 +1,11 @@ #include -#include #include #include +#include + using namespace vcpkg; using namespace vcpkg::Update; using namespace vcpkg::Test; diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index c615f6bb2b9760..74ade3aeb89220 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -1,14 +1,17 @@ +#include + #include -#include #include #include #include + #include +#include + // used to get the implementation specific compiler flags (i.e., __cpp_lib_filesystem) #include - #include #include @@ -20,15 +23,13 @@ #define FILESYSTEM_SYMLINK_UNIX 1 #define FILESYSTEM_SYMLINK_NONE 2 -#if defined(__cpp_lib_filesystem) +#if VCPKG_USE_STD_FILESYSTEM #define FILESYSTEM_SYMLINK FILESYSTEM_SYMLINK_STD -#include // required for filesystem::create_{directory_}symlink #elif !defined(_MSC_VER) #define FILESYSTEM_SYMLINK FILESYSTEM_SYMLINK_UNIX -#include #else @@ -114,19 +115,21 @@ namespace vcpkg::Test #elif !defined(_WIN32) // FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_STD return AllowSymlinks::Yes; #else - constexpr static const wchar_t regkey[] = - LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)"; + constexpr static const wchar_t regkey[] = LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)"; constexpr static const wchar_t regkey_member[] = LR"(AllowDevelopmentWithoutDevLicense)"; DWORD data; DWORD dataSize = sizeof(data); - const auto status = RegGetValueW( - HKEY_LOCAL_MACHINE, regkey, regkey_member, RRF_RT_DWORD, nullptr, &data, &dataSize); + const auto status = + RegGetValueW(HKEY_LOCAL_MACHINE, regkey, regkey_member, RRF_RT_DWORD, nullptr, &data, &dataSize); - if (status == ERROR_SUCCESS && data == 1) { + if (status == ERROR_SUCCESS && data == 1) + { return AllowSymlinks::Yes; - } else { - std::clog << "Symlinks are not allowed on this system\n"; + } + else + { + std::cout << "Symlinks are not allowed on this system\n"; return AllowSymlinks::No; } #endif @@ -155,9 +158,11 @@ namespace vcpkg::Test #endif } - const static fs::path BASE_TEMPORARY_DIRECTORY = internal_base_temporary_directory(); - - const fs::path& base_temporary_directory() noexcept { return BASE_TEMPORARY_DIRECTORY; } + const fs::path& base_temporary_directory() noexcept + { + const static fs::path BASE_TEMPORARY_DIRECTORY = internal_base_temporary_directory(); + return BASE_TEMPORARY_DIRECTORY; + } #if FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_NONE constexpr char no_filesystem_message[] = @@ -169,10 +174,10 @@ namespace vcpkg::Test #if FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_STD if (can_create_symlinks()) { - std::filesystem::path targetp = target.native(); - std::filesystem::path filep = file.native(); + fs::path targetp = target.native(); + fs::path filep = file.native(); - std::filesystem::create_symlink(targetp, filep, ec); + fs::stdfs::create_symlink(targetp, filep, ec); } else { diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index c2ee422005bc66..0158b3755643b3 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -1,32 +1,16 @@ -#if defined(_MSC_VER) && _MSC_VER < 1911 -// [[nodiscard]] is not recognized before VS 2017 version 15.3 -#pragma warning(disable : 5030) -#endif - -#if defined(__GNUC__) && __GNUC__ < 7 -// [[nodiscard]] is not recognized before GCC version 7 -#pragma GCC diagnostic ignored "-Wattributes" -#endif - -#if defined(_WIN32) -#define WIN32_LEAN_AND_MEAN -#include - -#pragma warning(push) -#pragma warning(disable : 4768) -#include -#pragma warning(pop) -#else -#include -#endif +#include #include #include +#include #include #include #include #include + +#include #include +#include #include #include #include @@ -56,16 +40,16 @@ static constexpr int SURVEY_INITIAL_OFFSET_IN_HOURS = SURVEY_INTERVAL_IN_HOURS - static void invalid_command(const std::string& cmd) { System::print2(System::Color::error, "invalid command: ", cmd, '\n'); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } -static void inner(const VcpkgCmdArguments& args) +static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) { Metrics::g_metrics.lock()->track_property("command", args.command); if (args.command.empty()) { - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -79,72 +63,20 @@ static void inner(const VcpkgCmdArguments& args) return &*it; } else - return static_cast(nullptr); - }; - - if (const auto command_function = find_command(Commands::get_available_commands_type_c())) - { - return command_function->function(args); - } - - fs::path vcpkg_root_dir; - if (args.vcpkg_root_dir != nullptr) - { - vcpkg_root_dir = fs::stdfs::absolute(fs::u8path(*args.vcpkg_root_dir)); - } - else - { - const auto vcpkg_root_dir_env = System::get_environment_variable("VCPKG_ROOT"); - if (const auto v = vcpkg_root_dir_env.get()) { - vcpkg_root_dir = fs::stdfs::absolute(*v); - } - else - { - const fs::path current_path = fs::stdfs::current_path(); - vcpkg_root_dir = Files::get_real_filesystem().find_file_recursively_up(current_path, ".vcpkg-root"); - - if (vcpkg_root_dir.empty()) - { - vcpkg_root_dir = Files::get_real_filesystem().find_file_recursively_up( - fs::stdfs::absolute(System::get_exe_path_of_current_process()), ".vcpkg-root"); - } + return static_cast(nullptr); } - } - - Checks::check_exit(VCPKG_LINE_INFO, !vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root."); - - Debug::print("Using vcpkg-root: ", vcpkg_root_dir.u8string(), '\n'); + }; - Optional vcpkg_scripts_root_dir = nullopt; - if (nullptr != args.scripts_root_dir) + if (const auto command_function = find_command(Commands::get_available_basic_commands())) { - vcpkg_scripts_root_dir = fs::stdfs::canonical(fs::u8path(*args.scripts_root_dir)); - Debug::print("Using scripts-root: ", vcpkg_scripts_root_dir.value_or_exit(VCPKG_LINE_INFO).u8string(), '\n'); + return command_function->function->perform_and_exit(args, fs); } - auto default_vs_path = System::get_environment_variable("VCPKG_VISUAL_STUDIO_PATH").value_or(""); - - const Expected expected_paths = - VcpkgPaths::create(vcpkg_root_dir, vcpkg_scripts_root_dir, default_vs_path, args.overlay_triplets.get()); - Checks::check_exit(VCPKG_LINE_INFO, - !expected_paths.error(), - "Error: Invalid vcpkg root directory %s: %s", - vcpkg_root_dir.string(), - expected_paths.error().message()); - const VcpkgPaths& paths = expected_paths.value_or_exit(VCPKG_LINE_INFO); - -#if defined(_WIN32) - const int exit_code = _wchdir(paths.root.c_str()); -#else - const int exit_code = chdir(paths.root.c_str()); -#endif - Checks::check_exit( - VCPKG_LINE_INFO, - exit_code == 0, - "Changing the working directory to the vcpkg root directory failed. Did you incorrectly define the VCPKG_ROOT " - "environment variable, or did you mistakenly create a file named .vcpkg-root somewhere?"); + 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") { Commands::Version::warn_if_vcpkg_version_mismatch(paths); @@ -172,53 +104,24 @@ static void inner(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); - } - - Triplet default_triplet; - if (args.triplet != nullptr) - { - default_triplet = Triplet::from_canonical_name(std::string(*args.triplet)); - } - else - { - auto vcpkg_default_triplet_env = System::get_environment_variable("VCPKG_DEFAULT_TRIPLET"); - if (auto v = vcpkg_default_triplet_env.get()) - { - default_triplet = Triplet::from_canonical_name(std::move(*v)); - } - else - { -#if defined(_WIN32) - default_triplet = Triplet::X86_WINDOWS; -#elif defined(__APPLE__) - default_triplet = Triplet::from_canonical_name("x64-osx"); -#elif defined(__FreeBSD__) - default_triplet = Triplet::from_canonical_name("x64-freebsd"); -#elif defined(__GLIBC__) - default_triplet = Triplet::from_canonical_name("x64-linux"); -#else - default_triplet = Triplet::from_canonical_name("x64-linux-musl"); -#endif - } + 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); } -static void load_config() +static void load_config(vcpkg::Files::Filesystem& fs) { - auto& fs = Files::get_real_filesystem(); - auto config = UserConfig::try_read_data(fs); bool write_config = false; @@ -282,6 +185,7 @@ int main(const int argc, const char* const* const argv) { if (argc == 0) std::abort(); + auto& fs = Files::get_real_filesystem(); *GlobalState::timer.lock() = Chrono::ElapsedTimer::create_started(); #if defined(_WIN32) @@ -303,7 +207,7 @@ int main(const int argc, const char* const* const argv) auto metrics = Metrics::g_metrics.lock(); metrics->track_metric("elapsed_us", elapsed_us_inner); Debug::g_debugging = false; - metrics->flush(); + metrics->flush(Files::get_real_filesystem()); #if defined(_WIN32) if (GlobalState::g_init_console_initialized) @@ -327,33 +231,41 @@ int main(const int argc, const char* const* const argv) System::register_console_ctrl_handler(); - load_config(); + load_config(fs); - const auto vcpkg_feature_flags_env = System::get_environment_variable("VCPKG_FEATURE_FLAGS"); - if (const auto v = vcpkg_feature_flags_env.get()) - { - auto flags = Strings::split(*v, ","); - if (std::find(flags.begin(), flags.end(), "binarycaching") != flags.end()) GlobalState::g_binary_caching = true; - } + VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(fs, argc, argv); + args.imbue_from_environment(); + args.check_feature_flag_consistency(); - const VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(argc, argv); + if (const auto p = args.disable_metrics.get()) Metrics::g_metrics.lock()->set_disabled(*p); + if (const auto p = args.print_metrics.get()) Metrics::g_metrics.lock()->set_print_metrics(*p); + if (const auto p = args.send_metrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p); + if (const auto p = args.debug.get()) Debug::g_debugging = *p; - if (const auto p = args.binarycaching.get()) GlobalState::g_binary_caching = *p; + if (args.send_metrics.has_value() && !Metrics::g_metrics.lock()->metrics_enabled()) + { + System::print2(System::Color::warning, + "Warning: passed either --sendmetrics or --no-sendmetrics, but metrics are disabled.\n"); + } + if (args.print_metrics.has_value() && !Metrics::g_metrics.lock()->metrics_enabled()) + { + System::print2(System::Color::warning, + "Warning: passed either --printmetrics or --no-printmetrics, but metrics are disabled.\n"); + } - if (const auto p = args.printmetrics.get()) Metrics::g_metrics.lock()->set_print_metrics(*p); - if (const auto p = args.sendmetrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p); - if (const auto p = args.debug.get()) Debug::g_debugging = *p; + args.debug_print_feature_flags(); + args.track_feature_flag_metrics(); if (Debug::g_debugging) { - inner(args); + inner(fs, args); Checks::exit_fail(VCPKG_LINE_INFO); } std::string exc_msg; try { - inner(args); + inner(fs, args); Checks::exit_fail(VCPKG_LINE_INFO); } catch (std::exception& e) diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index d22e841de3b865..ca82b3100f29ac 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -1,7 +1,8 @@ #include "pch.h" -#include #include + +#include #include namespace vcpkg::Archives diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 995e2d4f39dd3b..051e8306fa0a8a 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -33,6 +33,7 @@ namespace vcpkg::Downloads url_path, target_file_path, std::to_string(err)); + ASSUME(f != nullptr); auto hSession = WinHttpOpen(L"vcpkg/1.0", IsWindows8Point1OrGreater() ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 0bd1cb893d2803..f2684633ce18f2 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -6,19 +6,19 @@ #include #include #include -#include #if !defined(_WIN32) #include + +#include #include -#include -#include #endif + #if defined(__linux__) #include #elif defined(__APPLE__) #include -#endif +#endif // ^^^ defined(__APPLE__) namespace vcpkg::Files { @@ -34,6 +34,7 @@ namespace vcpkg::Files WIN32_FILE_ATTRIBUTE_DATA file_attributes; auto ft = file_type::unknown; auto permissions = perms::unknown; + ec.clear(); if (!GetFileAttributesExW(p.c_str(), GetFileExInfoStandard, &file_attributes)) { const auto err = GetLastError(); @@ -73,14 +74,14 @@ namespace vcpkg::Files constexpr auto all_write = perms::group_write | perms::owner_write | perms::others_write; permissions = perms::all & ~all_write; } - else if (ft != file_type::none && ft != file_type::none) + else if (ft != file_type::none) { permissions = perms::all; } return fs::file_status(ft, permissions); -#else +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv auto result = follow_symlinks ? fs::stdfs::status(p, ec) : fs::stdfs::symlink_status(p, ec); // libstdc++ doesn't correctly not-set ec on nonexistent paths if (ec.value() == ENOENT || ec.value() == ENOTDIR) @@ -89,7 +90,7 @@ namespace vcpkg::Files return fs::file_status(file_type::not_found, perms::unknown); } return fs::file_status(result.type(), result.permissions()); -#endif +#endif // ^^^ !defined(_WIN32) } fs::file_status status(const fs::path& p, std::error_code& ec) noexcept @@ -101,6 +102,64 @@ namespace vcpkg::Files return status_implementation(false, p, ec); } +#if defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM + fs::path read_symlink_implementation(const fs::path& oldpath, std::error_code& ec) + { + ec.clear(); + auto handle = CreateFileW(oldpath.c_str(), + 0, // open just the metadata + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + nullptr /* no security attributes */, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + nullptr /* no template file */); + if (handle == INVALID_HANDLE_VALUE) + { + ec.assign(GetLastError(), std::system_category()); + return oldpath; + } + fs::path target; + const DWORD maxsize = 32768; + const std::unique_ptr buffer(new wchar_t[maxsize]); + const auto rc = GetFinalPathNameByHandleW(handle, buffer.get(), maxsize, 0); + if (rc > 0 && rc < maxsize) + { + target = buffer.get(); + } + else + { + ec.assign(GetLastError(), std::system_category()); + } + CloseHandle(handle); + return target; + } +#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM + + void copy_symlink_implementation(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) + { +#if defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM + const auto target = read_symlink_implementation(oldpath, ec); + if (ec) return; + + 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(); + ec.assign(err, std::system_category()); + return; + } + ec.clear(); + return; +#else // ^^^ defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM // !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM vvv + return fs::stdfs::copy_symlink(oldpath, newpath, ec); +#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM + } + // does _not_ follow symlinks void set_writeable(const fs::path& path, std::error_code& ec) noexcept { @@ -119,7 +178,7 @@ namespace vcpkg::Files { ec.assign(GetLastError(), std::system_category()); } -#else +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv struct stat s; if (lstat(path.c_str(), &s)) { @@ -137,7 +196,7 @@ namespace vcpkg::Files ec.assign(errno, std::system_category()); } } -#endif +#endif // ^^^ !defined(_WIN32) } } @@ -204,12 +263,45 @@ namespace vcpkg::Files return this->create_directory(path, ec); } + bool Filesystem::create_directory(const fs::path& path, LineInfo li) + { + std::error_code ec; + bool result = this->create_directory(path, ec); + if (ec) + { + vcpkg::Checks::exit_with_message(li, "error creating directory %s", path.u8string(), ec.message()); + } + + return result; + } + bool Filesystem::create_directories(const fs::path& path, ignore_errors_t) { std::error_code ec; return this->create_directories(path, ec); } + bool Filesystem::create_directories(const fs::path& path, LineInfo li) + { + std::error_code ec; + bool result = this->create_directories(path, ec); + if (ec) + { + vcpkg::Checks::exit_with_message(li, "error creating directories %s", path.u8string(), ec.message()); + } + + return result; + } + + void Filesystem::copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, LineInfo li) + { + std::error_code ec; + 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()); + } + fs::file_status Filesystem::status(vcpkg::LineInfo li, const fs::path& p) const noexcept { std::error_code ec; @@ -272,6 +364,39 @@ namespace vcpkg::Files this->remove_all(path, ec, failure_point); } + void Filesystem::remove_all_inside(const fs::path& path, LineInfo li) + { + std::error_code ec; + fs::path failure_point; + + this->remove_all_inside(path, ec, failure_point); + + if (ec) + { + Checks::exit_with_message(li, + "Failure to remove_all_inside(%s) due to file %s: %s", + path.string(), + failure_point.string(), + ec.message()); + } + } + + void Filesystem::remove_all_inside(const fs::path& path, ignore_errors_t) + { + std::error_code ec; + fs::path failure_point; + + this->remove_all_inside(path, ec, failure_point); + } + + fs::path Filesystem::absolute(LineInfo li, const fs::path& path) const + { + std::error_code ec; + const auto result = this->absolute(path, ec); + if (ec) Checks::exit_with_message(li, "Error getting absolute path of %s: %s", path.string(), ec.message()); + return result; + } + fs::path Filesystem::canonical(LineInfo li, const fs::path& path) const { std::error_code ec; @@ -286,6 +411,20 @@ namespace vcpkg::Files std::error_code ec; return this->canonical(path, ec); } + fs::path Filesystem::current_path(LineInfo li) const + { + std::error_code ec; + const auto result = this->current_path(ec); + + if (ec) Checks::exit_with_message(li, "Error getting current path: %s", ec.message()); + return result; + } + void Filesystem::current_path(const fs::path& path, LineInfo li) + { + std::error_code ec; + this->current_path(path, ec); + if (ec) Checks::exit_with_message(li, "Error setting current path: %s", ec.message()); + } struct RealFilesystem final : Filesystem { @@ -461,7 +600,7 @@ namespace vcpkg::Files auto written_bytes = sendfile(o_fd, i_fd, &bytes, info.st_size); #elif defined(__APPLE__) auto written_bytes = fcopyfile(i_fd, o_fd, 0, COPYFILE_ALL); -#else +#else // ^^^ defined(__APPLE__) // !(defined(__APPLE__) || defined(__linux__)) vvv ssize_t written_bytes = 0; { constexpr std::size_t buffer_length = 4096; @@ -489,7 +628,7 @@ namespace vcpkg::Files copy_failure:; } -#endif +#endif // ^^^ !(defined(__APPLE__) || defined(__linux__)) if (written_bytes == -1) { ec.assign(errno, std::generic_category()); @@ -506,7 +645,7 @@ namespace vcpkg::Files if (ec) return; this->remove(oldpath, ec); } -#endif +#endif // ^^^ !defined(_WIN32) } virtual bool remove(const fs::path& path, std::error_code& ec) override { return fs::stdfs::remove(path, ec); } virtual void remove_all(const fs::path& path, std::error_code& ec, fs::path& failure_point) override @@ -558,13 +697,20 @@ namespace vcpkg::Files { ec.assign(GetLastError(), std::system_category()); } -#else +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv if (rmdir(current_path.c_str())) { ec.assign(errno, std::system_category()); } -#endif +#endif // ^^^ !defined(_WIN32) } +#if VCPKG_USE_STD_FILESYSTEM + else + { + fs::stdfs::remove(current_path, ec); + if (check_ec(ec, current_path, err)) return; + } +#else // ^^^ VCPKG_USE_STD_FILESYSTEM // !VCPKG_USE_STD_FILESYSTEM vvv #if defined(_WIN32) else if (path_type == fs::file_type::directory_symlink) { @@ -580,7 +726,7 @@ namespace vcpkg::Files ec.assign(GetLastError(), std::system_category()); } } -#else +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv else { if (unlink(current_path.c_str())) @@ -588,7 +734,8 @@ namespace vcpkg::Files ec.assign(errno, std::system_category()); } } -#endif +#endif // ^^^ !defined(_WIN32) +#endif // ^^^ !VCPKG_USE_STD_FILESYSTEM check_ec(ec, current_path, err); } @@ -635,6 +782,58 @@ namespace vcpkg::Files ec = std::move(err.ec); failure_point = std::move(err.failure_point); } + + virtual void remove_all_inside(const fs::path& path, std::error_code& ec, fs::path& failure_point) override + { + fs::directory_iterator last{}; + fs::directory_iterator first(path, ec); + if (ec) + { + failure_point = path; + return; + } + + for (;;) + { + if (first == last) + { + return; + } + + auto stats = first->status(ec); + if (ec) + { + break; + } + + auto& thisPath = first->path(); + if (stats.type() == fs::stdfs::file_type::directory) + { + this->remove_all(thisPath, ec, failure_point); + if (ec) + { + return; // keep inner failure_point + } + } + else + { + this->remove(thisPath, ec); + if (ec) + { + break; + } + } + + first.increment(ec); + if (ec) + { + break; + } + } + + failure_point = first->path(); + } + virtual bool is_directory(const fs::path& path) const override { return fs::stdfs::is_directory(path); } virtual bool is_regular_file(const fs::path& path) const override { return fs::stdfs::is_regular_file(path); } virtual bool is_empty(const fs::path& path) const override { return fs::stdfs::is_empty(path); } @@ -659,7 +858,7 @@ namespace vcpkg::Files } virtual void copy_symlink(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) override { - return fs::stdfs::copy_symlink(oldpath, newpath, ec); + return Files::copy_symlink_implementation(oldpath, newpath, ec); } virtual fs::file_status status(const fs::path& path, std::error_code& ec) const override @@ -677,10 +876,10 @@ namespace vcpkg::Files FILE* f = nullptr; #if defined(_WIN32) auto err = _wfopen_s(&f, file_path.native().c_str(), L"wb"); -#else +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv f = fopen(file_path.native().c_str(), "wb"); int err = f != nullptr ? 0 : 1; -#endif +#endif // ^^^ !defined(_WIN32) if (err != 0) { ec.assign(err, std::system_category()); @@ -699,20 +898,190 @@ namespace vcpkg::Files } } + virtual fs::path absolute(const fs::path& path, std::error_code& ec) const override + { +#if VCPKG_USE_STD_FILESYSTEM + return fs::stdfs::absolute(path, ec); +#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); +#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv + if (path.is_absolute()) + { + return path; + } + else + { + auto current_path = this->current_path(ec); + if (ec) return fs::path(); + return std::move(current_path) / path; + } +#endif // ^^^ !defined(_WIN32) +#endif // ^^^ !VCPKG_USE_STD_FILESYSTEM + } + virtual fs::path canonical(const fs::path& path, std::error_code& ec) const override { return fs::stdfs::canonical(path, ec); } + virtual fs::path current_path(std::error_code& ec) const override { return fs::stdfs::current_path(ec); } + virtual void current_path(const fs::path& path, std::error_code& ec) override + { + fs::stdfs::current_path(path, ec); + } + + struct TakeExclusiveFileLockHelper + { + fs::SystemHandle& res; + const fs::path::string_type& native; + TakeExclusiveFileLockHelper(fs::SystemHandle& res, const fs::path::string_type& native) + : res(res), native(native) + { + } + +#if defined(WIN32) + void assign_busy_error(std::error_code& ec) { ec.assign(ERROR_BUSY, std::system_category()); } + + bool operator()(std::error_code& ec) + { + ec.clear(); + auto handle = CreateFileW(native.c_str(), + GENERIC_READ, + 0 /* no sharing */, + nullptr /* no security attributes */, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + nullptr /* no template file */); + if (handle == INVALID_HANDLE_VALUE) + { + const auto err = GetLastError(); + if (err != ERROR_SHARING_VIOLATION) + { + ec.assign(err, std::system_category()); + } + return false; + } + + res.system_handle = reinterpret_cast(handle); + return true; + } +#else // ^^^ WIN32 / !WIN32 vvv + int fd = -1; + + void assign_busy_error(std::error_code& ec) { ec.assign(EBUSY, std::generic_category()); } + + bool operator()(std::error_code& ec) + { + ec.clear(); + if (fd == -1) + { + fd = ::open(native.c_str(), 0); + if (fd < 0) + { + ec.assign(errno, std::generic_category()); + return false; + } + } + + if (::flock(fd, LOCK_EX | LOCK_NB) != 0) + { + if (errno != EWOULDBLOCK) + { + ec.assign(errno, std::generic_category()); + } + return false; + } + + res.system_handle = fd; + fd = -1; + return true; + }; + + ~TakeExclusiveFileLockHelper() + { + if (fd != -1) + { + ::close(fd); + } + } +#endif + }; + + virtual fs::SystemHandle take_exclusive_file_lock(const fs::path& path, std::error_code& ec) override + { + fs::SystemHandle res; + TakeExclusiveFileLockHelper helper(res, path.native()); + + if (helper(ec) || ec) + { + return res; + } + + System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); + const auto wait = std::chrono::milliseconds(1000); + for (;;) + { + std::this_thread::sleep_for(wait); + if (helper(ec) || ec) + { + return res; + } + } + } + + virtual fs::SystemHandle try_take_exclusive_file_lock(const fs::path& path, std::error_code& ec) override + { + fs::SystemHandle res; + TakeExclusiveFileLockHelper helper(res, path.native()); + + if (helper(ec) || ec) + { + return res; + } + + System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); + auto wait = std::chrono::milliseconds(100); + // waits, at most, a second and a half. + while (wait < std::chrono::milliseconds(1000)) + { + std::this_thread::sleep_for(wait); + if (helper(ec) || ec) + { + return res; + } + wait *= 2; + } + + helper.assign_busy_error(ec); + return res; + } + + virtual void unlock_file_lock(fs::SystemHandle handle, std::error_code& ec) override + { +#if defined(WIN32) + if (CloseHandle(reinterpret_cast(handle.system_handle)) == 0) + { + ec.assign(GetLastError(), std::system_category()); + } +#else + if (flock(handle.system_handle, LOCK_UN) != 0 || close(handle.system_handle) != 0) + { + ec.assign(errno, std::generic_category()); + } +#endif + } + virtual std::vector find_from_PATH(const std::string& name) const override { #if defined(_WIN32) static constexpr StringLiteral EXTS[] = {".cmd", ".exe", ".bat"}; - auto paths = Strings::split(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO), ";"); -#else + auto paths = Strings::split(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO), ';'); +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv static constexpr StringLiteral EXTS[] = {""}; - auto paths = Strings::split(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO), ":"); -#endif + auto paths = Strings::split(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO), ':'); +#endif // ^^^ !defined(_WIN32) std::vector ret; std::error_code ec; @@ -755,4 +1124,20 @@ namespace vcpkg::Files message.push_back('\n'); System::print2(message); } + + fs::path combine(const fs::path& lhs, const fs::path& rhs) + { +#if VCPKG_USE_STD_FILESYSTEM + return lhs / rhs; +#else // ^^^ VCPKG_USE_STD_FILESYSTEM // !VCPKG_USE_STD_FILESYSTEM vvv + if (rhs.is_absolute()) + { + return rhs; + } + else + { + return lhs / rhs; + } +#endif + } } diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 45ce43cdd29bc1..58e17e1ad47803 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -1,11 +1,10 @@ #include "pch.h" -#include - #include -#include +#include #include #include +#include #include #if defined(_WIN32) @@ -51,12 +50,14 @@ namespace vcpkg::Hash } } - template - auto top_bits(UIntTy x) -> std::enable_if_t::value, uchar> { + template + auto top_bits(UIntTy x) -> std::enable_if_t::value, uchar> + { return static_cast(x >> ((sizeof(x) - 1) * 8)); } - template - auto top_bits(UIntTy x) -> decltype(top_bits(x.top_64_bits())) { + template + auto top_bits(UIntTy x) -> decltype(top_bits(x.top_64_bits())) + { return top_bits(x.top_64_bits()); } diff --git a/toolsrc/src/vcpkg/base/json.cpp b/toolsrc/src/vcpkg/base/json.cpp new file mode 100644 index 00000000000000..440bc6745f22f6 --- /dev/null +++ b/toolsrc/src/vcpkg/base/json.cpp @@ -0,0 +1,1216 @@ +#include "pch.h" + +#include +#include +#include +#include + +#include + +namespace vcpkg::Json +{ + using VK = ValueKind; + + // struct Value { + namespace impl + { + // TODO: add a value_kind value template once we get rid of VS2015 support + template + using ValueKindConstant = std::integral_constant; + + struct ValueImpl + { + VK tag; + union + { + std::nullptr_t null; + bool boolean; + int64_t integer; + double number; + std::string string; + Array array; + Object object; + }; + + ValueImpl(ValueKindConstant vk, std::nullptr_t) : tag(vk), null() { } + ValueImpl(ValueKindConstant vk, bool b) : tag(vk), boolean(b) { } + 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 + { + switch (other.tag) + { + case VK::Null: return internal_assign(VK::Null, &ValueImpl::null, other); + case VK::Boolean: return internal_assign(VK::Boolean, &ValueImpl::boolean, other); + case VK::Integer: return internal_assign(VK::Integer, &ValueImpl::integer, other); + case VK::Number: return internal_assign(VK::Number, &ValueImpl::number, other); + case VK::String: return internal_assign(VK::String, &ValueImpl::string, other); + case VK::Array: return internal_assign(VK::Array, &ValueImpl::array, other); + case VK::Object: return internal_assign(VK::Object, &ValueImpl::object, other); + } + } + + ~ValueImpl() { destroy_underlying(); } + + private: + template + ValueImpl& internal_assign(ValueKind vk, T ValueImpl::*mp, ValueImpl& other) noexcept + { + if (tag == vk) + { + this->*mp = std::move(other.*mp); + } + else + { + destroy_underlying(); + new (&(this->*mp)) T(std::move(other.*mp)); + tag = vk; + } + + return *this; + } + + void destroy_underlying() noexcept + { + switch (tag) + { + case VK::String: string.~basic_string(); break; + case VK::Array: array.~Array(); break; + case VK::Object: object.~Object(); break; + default: break; + } + new (&null) std::nullptr_t(); + tag = VK::Null; + } + }; + } + + using impl::ValueImpl; + using impl::ValueKindConstant; + + VK Value::kind() const noexcept + { + if (underlying_) + { + return underlying_->tag; + } + else + { + return VK::Null; + } + } + + bool Value::is_null() const noexcept { return kind() == VK::Null; } + bool Value::is_boolean() const noexcept { return kind() == VK::Boolean; } + bool Value::is_integer() const noexcept { return kind() == VK::Integer; } + bool Value::is_number() const noexcept + { + auto k = kind(); + return k == VK::Integer || k == VK::Number; + } + bool Value::is_string() const noexcept { return kind() == VK::String; } + bool Value::is_array() const noexcept { return kind() == VK::Array; } + bool Value::is_object() const noexcept { return kind() == VK::Object; } + + bool Value::boolean() const noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_boolean()); + return underlying_->boolean; + } + int64_t Value::integer() const noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_integer()); + return underlying_->integer; + } + double Value::number() const noexcept + { + auto k = kind(); + if (k == VK::Number) + { + return underlying_->number; + } + else + { + return static_cast(integer()); + } + } + StringView Value::string() const noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string()); + return underlying_->string; + } + + const Array& Value::array() const& noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); + return underlying_->array; + } + Array& Value::array() & noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_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()); + return underlying_->object; + } + Object& Value::object() & noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); + return underlying_->object; + } + Object&& Value::object() && noexcept { return std::move(this->object()); } + + Value::Value() noexcept = default; + Value::Value(Value&&) noexcept = default; + Value& Value::operator=(Value&&) noexcept = default; + + Value::Value(const Value& other) + { + switch (other.kind()) + { + 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 + { + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), b); + return val; + } + Value Value::integer(int64_t i) noexcept + { + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), i); + return val; + } + Value Value::number(double d) noexcept + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, isfinite(d)); + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), d); + return val; + } + Value Value::string(StringView sv) noexcept + { + if (!Unicode::utf8_is_valid_string(sv.begin(), sv.end())) + { + Debug::print("Invalid string: ", sv, '\n'); + vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid utf8 passed to Value::string(StringView)"); + } + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), sv.to_string()); + return val; + } + Value Value::array(Array&& arr) noexcept + { + Value val; + 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; + } + Value Value::object(const Object& obj) noexcept + { + 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()) + { + 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); + } + } + // } struct Value + // struct Array { + Value& Array::push_back(Value&& value) + { + underlying_.push_back(std::move(value)); + return underlying_.back(); + } + Object& Array::push_back(Object&& obj) { return push_back(Value::object(std::move(obj))).object(); } + Array& Array::push_back(Array&& arr) { return push_back(Value::array(std::move(arr))).array(); } + Value& Array::insert_before(iterator it, Value&& value) + { + size_t index = it - underlying_.begin(); + underlying_.insert(it, std::move(value)); + return underlying_[index]; + } + Object& Array::insert_before(iterator it, Object&& obj) + { + return insert_before(it, Value::object(std::move(obj))).object(); + } + Array& Array::insert_before(iterator it, Array&& arr) + { + 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) + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, !contains(key)); + 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); + if (v) + { + *v = std::move(value); + return *v; + } + else + { + underlying_.push_back({std::move(key), std::move(value)}); + 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 + { + return std::find_if( + underlying_.begin(), underlying_.end(), [key](const auto& pair) { return pair.first == key; }); + } + + // returns whether the key existed + bool Object::remove(StringView key) noexcept + { + auto it = internal_find_key(key); + if (it == underlying_.end()) + { + return false; + } + else + { + underlying_.erase(it); + return true; + } + } + + Value* Object::get(StringView key) noexcept + { + auto it = internal_find_key(key); + if (it == underlying_.end()) + { + return nullptr; + } + else + { + return &underlying_[it - underlying_.begin()].second; + } + } + const Value* Object::get(StringView key) const noexcept + { + auto it = internal_find_key(key); + if (it == underlying_.end()) + { + return nullptr; + } + else + { + return &it->second; + } + } + + void Object::sort_keys() + { + 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() { + namespace + { + struct Parser : private Parse::ParserBase + { + Parser(StringView text, StringView origin) : Parse::ParserBase(text, origin), style_() { } + + char32_t next() noexcept + { + auto ch = cur(); + if (ch == '\r') style_.newline_kind = JsonStyle::Newline::CrLf; + if (ch == '\t') style_.set_tabs(); + return Parse::ParserBase::next(); + } + + static constexpr bool is_digit(char32_t code_point) noexcept + { + return code_point >= '0' && code_point <= '9'; + } + static constexpr bool is_hex_digit(char32_t code_point) noexcept + { + return is_digit(code_point) || (code_point >= 'a' && code_point <= 'f') || + (code_point >= 'A' && code_point <= 'F'); + } + static bool is_number_start(char32_t code_point) noexcept + { + 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 + { + if (is_digit(code_point)) + { + return static_cast(code_point) - '0'; + } + else if (code_point >= 'a' && code_point <= 'f') + { + return static_cast(code_point) - 'a' + 10; + } + else if (code_point >= 'A' && code_point <= 'F') + { + return static_cast(code_point) - 'A' + 10; + } + else + { + vcpkg::Checks::unreachable(VCPKG_LINE_INFO); + } + } + + // parses a _single_ code point of a string -- either a literal code point, or an escape sequence + // returns end_of_file if it reaches an unescaped '"' + // _does not_ pair escaped surrogates -- returns the literal surrogate. + char32_t parse_string_code_point() noexcept + { + char32_t current = cur(); + if (current == '"') + { + next(); + return Unicode::end_of_file; + } + else if (current <= 0x001F) + { + add_error("Control character in string"); + next(); + return Unicode::end_of_file; + } + else if (current != '\\') + { + next(); + return current; + } + + // cur == '\\' + if (at_eof()) + { + add_error("Unexpected EOF after escape character"); + return Unicode::end_of_file; + } + current = next(); + + switch (current) + { + 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; + for (int i = 0; i < 4; ++i) + { + current = next(); + + if (current == Unicode::end_of_file) + { + add_error("Unexpected end of file in middle of unicode escape"); + return Unicode::end_of_file; + } + if (is_hex_digit(current)) + { + code_unit *= 16; + code_unit += from_hex_digit(current); + } + else + { + add_error("Invalid hex digit in unicode escape"); + return Unicode::end_of_file; + } + } + next(); + + return code_unit; + } + default: add_error("Unexpected escape sequence continuation"); return Unicode::end_of_file; + } + } + + std::string parse_string() noexcept + { + Checks::check_exit(VCPKG_LINE_INFO, cur() == '"'); + next(); + + std::string res; + char32_t previous_leading_surrogate = Unicode::end_of_file; + while (!at_eof()) + { + auto code_point = parse_string_code_point(); + + if (previous_leading_surrogate != Unicode::end_of_file) + { + if (Unicode::utf16_is_trailing_surrogate_code_point(code_point)) + { + const auto full_code_point = + Unicode::utf16_surrogates_to_code_point(previous_leading_surrogate, code_point); + Unicode::utf8_append_code_point(res, full_code_point); + previous_leading_surrogate = Unicode::end_of_file; + continue; + } + else + { + Unicode::utf8_append_code_point(res, previous_leading_surrogate); + } + } + previous_leading_surrogate = Unicode::end_of_file; + + if (Unicode::utf16_is_leading_surrogate_code_point(code_point)) + { + previous_leading_surrogate = code_point; + } + else if (code_point == Unicode::end_of_file) + { + return res; + } + else + { + Unicode::utf8_append_code_point(res, code_point); + } + } + + add_error("Unexpected EOF in middle of string"); + return res; + } + + Value parse_number() noexcept + { + Checks::check_exit(VCPKG_LINE_INFO, is_number_start(cur())); + + bool floating = false; + bool negative = false; // negative & 0 -> floating, so keep track of it + std::string number_to_parse; + + char32_t current = cur(); + if (cur() == '-') + { + number_to_parse.push_back('-'); + negative = true; + current = next(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF after minus sign"); + return Value(); + } + } + + if (current == '0') + { + current = next(); + if (current == '.') + { + number_to_parse.append("0."); + floating = true; + current = next(); + } + else if (is_digit(current)) + { + add_error("Unexpected digits after a leading zero"); + return Value(); + } + else + { + if (negative) + { + return Value::number(-0.0); + } + else + { + return Value::integer(0); + } + } + } + + while (is_digit(current)) + { + number_to_parse.push_back(static_cast(current)); + current = next(); + } + if (!floating && current == '.') + { + floating = true; + number_to_parse.push_back('.'); + current = next(); + if (!is_digit(current)) + { + add_error("Expected digits after the decimal point"); + return Value(); + } + while (is_digit(current)) + { + number_to_parse.push_back(static_cast(current)); + current = next(); + } + } + + if (floating) + { + auto opt = Strings::strto(number_to_parse); + if (auto res = opt.get()) + { + if (std::abs(*res) < INFINITY) + { + return Value::number(*res); + } + else + { + add_error(Strings::format("Floating point constant too big: %s", number_to_parse)); + } + } + else + { + add_error(Strings::format("Invalid floating point constant: %s", number_to_parse)); + } + } + else + { + auto opt = Strings::strto(number_to_parse); + if (auto res = opt.get()) + { + return Value::integer(*res); + } + else + { + add_error(Strings::format("Invalid integer constant: %s", number_to_parse)); + } + } + + return Value(); + } + + Value parse_keyword() noexcept + { + char32_t current = cur(); + const char32_t* rest; + Value val; + switch (current) + { + case 't': // parse true + rest = U"rue"; + val = Value::boolean(true); + break; + case 'f': // parse false + rest = U"alse"; + val = Value::boolean(false); + break; + case 'n': // parse null + rest = U"ull"; + val = Value::null(nullptr); + break; + default: vcpkg::Checks::unreachable(VCPKG_LINE_INFO); + } + + for (const char32_t* rest_it = rest; *rest_it != '\0'; ++rest_it) + { + current = next(); + + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF in middle of keyword"); + return Value(); + } + if (current != *rest_it) + { + add_error("Unexpected character in middle of keyword"); + } + } + next(); + + return val; + } + + Value parse_array() noexcept + { + Checks::check_exit(VCPKG_LINE_INFO, cur() == '['); + next(); + + Array arr; + bool first = true; + for (;;) + { + skip_whitespace(); + + char32_t current = cur(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF in middle of array"); + return Value(); + } + if (current == ']') + { + next(); + return Value::array(std::move(arr)); + } + + if (first) + { + first = false; + } + else if (current == ',') + { + next(); + skip_whitespace(); + current = cur(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF in middle of array"); + return Value(); + } + if (current == ']') + { + add_error("Trailing comma in array"); + return Value::array(std::move(arr)); + } + } + else + { + add_error("Unexpected character in middle of array"); + return Value(); + } + + arr.push_back(parse_value()); + } + } + + std::pair parse_kv_pair() noexcept + { + skip_whitespace(); + + auto current = cur(); + + std::pair res = {std::string(""), Value()}; + + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF; expected property name"); + return res; + } + if (current != '"') + { + add_error("Unexpected character; expected property name"); + return res; + } + res.first = parse_string(); + + skip_whitespace(); + current = cur(); + if (current == ':') + { + next(); + } + else if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF; expected colon"); + return res; + } + else + { + add_error("Unexpected character; expected colon"); + return res; + } + + res.second = parse_value(); + + return res; + } + + Value parse_object() noexcept + { + char32_t current = cur(); + + Checks::check_exit(VCPKG_LINE_INFO, current == '{'); + next(); + + Object obj; + bool first = true; + for (;;) + { + skip_whitespace(); + current = cur(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF; expected property or close brace"); + return Value(); + } + else if (current == '}') + { + next(); + return Value::object(std::move(obj)); + } + + if (first) + { + first = false; + } + else if (current == ',') + { + next(); + skip_whitespace(); + current = cur(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF; expected property"); + return Value(); + } + else if (current == '}') + { + add_error("Trailing comma in an object"); + return Value(); + } + } + else + { + add_error("Unexpected character; expected comma or close brace"); + } + + auto val = parse_kv_pair(); + obj.insert(std::move(val.first), std::move(val.second)); + } + } + + Value parse_value() noexcept + { + skip_whitespace(); + char32_t current = cur(); + if (current == Unicode::end_of_file) + { + add_error("Unexpected EOF; expected value"); + return Value(); + } + + switch (current) + { + case '{': return parse_object(); + case '[': return parse_array(); + case '"': return Value::string(parse_string()); + case 'n': + case 't': + case 'f': return parse_keyword(); + default: + if (is_number_start(current)) + { + return parse_number(); + } + else + { + add_error("Unexpected character; expected value"); + return Value(); + } + } + } + + static ExpectedT, std::unique_ptr> parse( + StringView json, StringView origin) noexcept + { + auto parser = Parser(json, origin); + + auto val = parser.parse_value(); + + parser.skip_whitespace(); + if (!parser.at_eof()) + { + parser.add_error("Unexpected character; expected EOF"); + return std::move(parser).extract_error(); + } + else if (parser.get_error()) + { + return std::move(parser).extract_error(); + } + else + { + return std::make_pair(std::move(val), parser.style()); + } + } + + JsonStyle style() const noexcept { return style_; } + + private: + JsonStyle style_; + }; + } + + ExpectedT, std::unique_ptr> parse_file(const Files::Filesystem& fs, + const fs::path& path, + std::error_code& ec) noexcept + { + auto res = fs.read_contents(path); + if (auto buf = res.get()) + { + return parse(*buf, path); + } + else + { + ec = res.error(); + return std::unique_ptr(); + } + } + + ExpectedT, std::unique_ptr> parse(StringView json, + const fs::path& filepath) noexcept + { + return Parser::parse(json, filepath.generic_u8string()); + } + // } auto parse() + + namespace + { + struct Stringifier + { + JsonStyle style; + std::string& buffer; + + void append_indent(int indent) + { + if (style.use_tabs()) + { + buffer.append(indent, '\t'); + } + else + { + buffer.append(indent * style.spaces(), ' '); + } + }; + + void append_unicode_escape(char16_t code_unit) + { + buffer.append("\\u"); + + // AFAIK, there's no standard way of doing this? + constexpr const char hex_digit[16] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + + buffer.push_back(hex_digit[(code_unit >> 12) & 0x0F]); + buffer.push_back(hex_digit[(code_unit >> 8) & 0x0F]); + buffer.push_back(hex_digit[(code_unit >> 4) & 0x0F]); + buffer.push_back(hex_digit[(code_unit >> 0) & 0x0F]); + } + + // taken from the ECMAScript 2020 standard, 24.5.2.2: Runtime Semantics: QuoteJSONString + void append_quoted_json_string(StringView sv) + { + // Table 66: JSON Single Character Escape Sequences + constexpr static std::array, 7> escape_sequences = {{ + {0x0008, R"(\b)"}, // BACKSPACE + {0x0009, R"(\t)"}, // CHARACTER TABULATION + {0x000A, R"(\n)"}, // LINE FEED (LF) + {0x000C, R"(\f)"}, // FORM FEED (FF) + {0x000D, R"(\r)"}, // CARRIAGE RETURN (CR) + {0x0022, R"(\")"}, // QUOTATION MARK + {0x005C, R"(\\)"} // REVERSE SOLIDUS + }}; + // 1. Let product be the String value consisting solely of the code unit 0x0022 (QUOTATION MARK). + buffer.push_back('"'); + + // 2. For each code point C in ! UTF16DecodeString(value), do + // (note that we use utf8 instead of utf16) + for (auto code_point : Unicode::Utf8Decoder(sv.begin(), sv.end())) + { + // a. If C is listed in the "Code Point" column of Table 66, then + const auto match = std::find_if(begin(escape_sequences), + end(escape_sequences), + [code_point](const std::pair& attempt) { + return attempt.first == code_point; + }); + // i. Set product to the string-concatenation of product and the escape sequence for C as + // specified in the "Escape Sequence" column of the corresponding row. + if (match != end(escape_sequences)) + { + buffer.append(match->second); + continue; + } + + // b. Else if C has a numeric value less than 0x0020 (SPACE), or if C has the same numeric value as + // a leading surrogate or trailing surrogate, then + if (code_point < 0x0020 || Unicode::utf16_is_surrogate_code_point(code_point)) + { + // i. Let unit be the code unit whose numeric value is that of C. + // ii. Set product to the string-concatenation of product and UnicodeEscape(unit). + append_unicode_escape(static_cast(code_point)); + break; + } + + // c. Else, + // i. Set product to the string-concatenation of product and the UTF16Encoding of C. + // (again, we use utf-8 here instead) + Unicode::utf8_append_code_point(buffer, code_point); + } + + // 3. Set product to the string-concatenation of product and the code unit 0x0022 (QUOTATION MARK). + buffer.push_back('"'); + } + + void stringify_object(const Object& obj, int current_indent) + { + buffer.push_back('{'); + if (obj.size() != 0) + { + bool first = true; + + for (const auto& el : obj) + { + if (!first) + { + buffer.push_back(','); + } + first = false; + + buffer.append(style.newline()); + append_indent(current_indent + 1); + + append_quoted_json_string(el.first); + buffer.append(": "); + stringify(el.second, current_indent + 1); + } + buffer.append(style.newline()); + append_indent(current_indent); + } + buffer.push_back('}'); + } + + void stringify_array(const Array& arr, int current_indent) + { + buffer.push_back('['); + if (arr.size() == 0) + { + buffer.push_back(']'); + } + else + { + bool first = true; + + for (const auto& el : arr) + { + if (!first) + { + buffer.push_back(','); + } + first = false; + + buffer.append(style.newline()); + append_indent(current_indent + 1); + + stringify(el, current_indent + 1); + } + buffer.append(style.newline()); + append_indent(current_indent); + buffer.push_back(']'); + } + } + + void stringify(const Value& value, int current_indent) + { + switch (value.kind()) + { + case VK::Null: buffer.append("null"); break; + case VK::Boolean: + { + auto v = value.boolean(); + buffer.append(v ? "true" : "false"); + break; + } + // TODO: switch to `to_chars` once we are able to remove support for old compilers + case VK::Integer: buffer.append(std::to_string(value.integer())); break; + case VK::Number: buffer.append(std::to_string(value.number())); break; + case VK::String: + { + append_quoted_json_string(value.string()); + break; + } + case VK::Array: + { + stringify_array(value.array(), current_indent); + break; + } + case VK::Object: + { + stringify_object(value.object(), current_indent); + break; + } + } + } + }; + } + + std::string stringify(const Value& value, JsonStyle style) + { + std::string res; + Stringifier{style, res}.stringify(value, 0); + res.push_back('\n'); + return res; + } + std::string stringify(const Object& obj, JsonStyle style) + { + std::string res; + Stringifier{style, res}.stringify_object(obj, 0); + res.push_back('\n'); + return res; + } + std::string stringify(const Array& arr, JsonStyle style) + { + std::string res; + Stringifier{style, res}.stringify_array(arr, 0); + res.push_back('\n'); + return res; + } + // } auto stringify() + +} diff --git a/toolsrc/src/vcpkg/parse.cpp b/toolsrc/src/vcpkg/base/parse.cpp similarity index 67% rename from toolsrc/src/vcpkg/parse.cpp rename to toolsrc/src/vcpkg/base/parse.cpp index 9e33c95f930bd3..7d6576f4168caa 100644 --- a/toolsrc/src/vcpkg/parse.cpp +++ b/toolsrc/src/vcpkg/base/parse.cpp @@ -1,17 +1,19 @@ #include "pch.h" -#include +#include #include #include + #include #include -#include + +#include using namespace vcpkg; namespace vcpkg::Parse { - static void advance_rowcol(char ch, int& row, int& column) + static void advance_rowcol(char32_t ch, int& row, int& column) { if (ch == '\t') column = (column + 7) / 8 * 8 + 1; // round to next 8-width tab stop @@ -28,10 +30,14 @@ namespace vcpkg::Parse std::string ParseError::format() const { - int ignore_row = 1; - int spacing = 20; - for (int i = 0; i < caret_col; ++i) - advance_rowcol(line[i], ignore_row, spacing); + auto caret_spacing = std::string(18, ' '); + auto decoder = Unicode::Utf8Decoder(line.data(), line.data() + line.size()); + for (int i = 0; i < caret_col; ++i, ++decoder) + { + const char32_t cp = *decoder; + // this may eventually want to check for full-width characters and grapheme clusters as well + caret_spacing.push_back(cp == '\t' ? '\t' : ' '); + } return Strings::concat("Error: ", origin, @@ -42,49 +48,59 @@ namespace vcpkg::Parse ": ", message, "\n" - " on expression: \"", // 9 columns + " on expression: ", // 18 columns line, - "\"\n", - std::string(spacing - 1, ' '), + "\n", + caret_spacing, "^\n"); } - char ParserBase::next() + ParserBase::ParserBase(StringView text, StringView origin, TextRowCol init_rowcol) + : m_it(text.begin(), text.end()) + , m_start_of_line(m_it) + , m_row(init_rowcol.row_or(1)) + , m_column(init_rowcol.column_or(1)) + , m_text(text) + , m_origin(origin) { - char ch = *m_it; + } + + char32_t ParserBase::next() + { + if (m_it == m_it.end()) + { + return Unicode::end_of_file; + } // See https://www.gnu.org/prep/standards/standards.html#Errors - if (ch == '\0') + advance_rowcol(*m_it, m_row, m_column); + + ++m_it; + if (m_it != m_it.end() && Unicode::utf16_is_surrogate_code_point(*m_it)) { - return '\0'; + m_it = m_it.end(); } - else - advance_rowcol(ch, row, column); - return *++m_it; + + return cur(); } - void ParserBase::add_error(std::string message, const ParserBase::SourceLoc& loc) + void ParserBase::add_error(std::string message, const SourceLoc& loc) { // avoid cascading errors by only saving the first if (!m_err) { - // find beginning of line - auto linestart = loc.it; - while (linestart != m_text.c_str()) + // find end of line + auto line_end = loc.it; + while (line_end != line_end.end() && *line_end != '\n' && *line_end != '\r') { - if (linestart[-1] == '\n') break; - --linestart; + ++line_end; } - - // find end of line - auto lineend = loc.it; - while (*lineend != '\n' && *lineend != '\r' && *lineend != '\0') - ++lineend; - m_err.reset(new ParseError(m_origin.c_str(), - loc.row, - loc.column, - static_cast(loc.it - linestart), - {linestart, lineend}, - std::move(message))); + m_err = std::make_unique( + m_origin.to_string(), + loc.row, + loc.column, + static_cast(std::distance(loc.start_of_line, loc.it)), + std::string(loc.start_of_line.pointer_to_current(), line_end.pointer_to_current()), + std::move(message)); } // Avoid error loops by skipping to the end @@ -129,6 +145,13 @@ namespace vcpkg::Parse 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 { @@ -136,8 +159,9 @@ namespace vcpkg::Parse { auto err = std::make_unique(); err->name = name; - err->extra_fields = Util::extract_keys(fields); - err->missing_fields = std::move(missing_fields); + 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; @@ -167,21 +191,19 @@ namespace vcpkg::Parse } ExpectedS> parse_default_features_list(const std::string& str, - CStringView origin, + StringView origin, TextRowCol textrowcol) { - Parse::ParserBase parser; - parser.init(str, origin, 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, - CStringView origin, + StringView origin, TextRowCol textrowcol) { - Parse::ParserBase parser; - parser.init(str, origin, 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}; @@ -189,11 +211,10 @@ namespace vcpkg::Parse return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; } ExpectedS> parse_dependencies_list(const std::string& str, - CStringView origin, + StringView origin, TextRowCol textrowcol) { - Parse::ParserBase parser; - parser.init(str, origin, 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 { @@ -202,7 +223,7 @@ namespace vcpkg::Parse parser.add_error("triplet specifier not allowed in this context", loc); return nullopt; } - return Dependency{{pqs.name, pqs.features.value_or({})}, pqs.qualifier.value_or({})}; + return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; }); }); if (!opt) return {parser.get_error()->format(), expected_right_tag}; diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 46e78a36346783..19b9384e679476 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -7,13 +7,12 @@ namespace vcpkg::Strings::details { // To disambiguate between two overloads - static bool is_space(const char c) { return std::isspace(c) != 0; } + static bool is_space(const char c) { return std::isspace(static_cast(c)) != 0; } // Avoids C4244 warnings because of char<->int conversion that occur when using std::tolower() - static char tolower_char(const char c) { return (c < 'A' || c > 'Z') ? c : c - 'A' + 'a'; } static char toupper_char(const char c) { return (c < 'a' || c > 'z') ? c : c - 'a' + 'A'; } - static bool icase_eq(char a, char b) { return tolower_char(a) == tolower_char(b); } + static bool icase_eq(char a, char b) { return tolower_char{}(a) == tolower_char{}(b); } #if defined(_WIN32) static _locale_t& c_locale() @@ -102,7 +101,7 @@ bool Strings::case_insensitive_ascii_equals(StringView left, StringView right) std::string Strings::ascii_to_lowercase(std::string&& s) { - std::transform(s.begin(), s.end(), s.begin(), &details::tolower_char); + Strings::ascii_to_lowercase(s.begin(), s.end()); return std::move(s); } @@ -147,6 +146,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) @@ -157,63 +163,28 @@ void Strings::trim_all_and_remove_whitespace_strings(std::vector* s Util::erase_remove_if(*strings, [](const std::string& s) { return s.empty(); }); } -std::vector Strings::split(const std::string& s, const std::string& delimiter) +std::vector Strings::split(StringView s, const char delimiter) { std::vector output; - - if (delimiter.empty()) - { - output.push_back(s); - return output; - } - - const size_t delimiter_length = delimiter.length(); - size_t i = 0; - for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) + auto first = s.begin(); + const auto last = s.end(); + for (;;) { - output.push_back(s.substr(i, pos - i)); - pos += delimiter_length; - i = pos; - } + first = std::find_if(first, last, [=](const char c) { return c != delimiter; }); + if (first == last) + { + return output; + } - // Add the rest of the string after the last delimiter, unless there is nothing after it - if (i != s.length()) - { - output.push_back(s.substr(i, s.length())); + auto next = std::find(first, last, delimiter); + output.emplace_back(first, next); + first = next; } - - return output; } -std::vector Strings::split(const std::string& s, const std::string& delimiter, size_t max_count) +const char* Strings::find_first_of(StringView input, StringView chars) { - std::vector output; - - Checks::check_exit(VCPKG_LINE_INFO, max_count >= 1); - - if (delimiter.empty()) - { - output.push_back(s); - return output; - } - - const size_t delimiter_length = delimiter.length(); - size_t i = 0; - for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) - { - if (output.size() == max_count - 1) break; - output.push_back(s.substr(i, pos - i)); - pos += delimiter_length; - i = pos; - } - - // Add the rest of the string after the last delimiter, unless there is nothing after it - if (i != s.length()) - { - output.push_back(s.substr(i, s.length())); - } - - return output; + return std::find_first_of(input.begin(), input.end(), chars.begin(), chars.end()); } std::vector Strings::find_all_enclosed(StringView input, StringView left_delim, StringView right_delim) @@ -223,7 +194,7 @@ std::vector Strings::find_all_enclosed(StringView input, StringView std::vector output; - while (true) + for (;;) { it_left = std::search(it_right, input.end(), left_delim.begin(), left_delim.end()); if (it_left == input.end()) break; diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index 6b159db4824837..8ab114a5e4efce 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -71,15 +71,39 @@ namespace vcpkg return result.front(); } - StringView::StringView(const std::string& s) : m_ptr(s.data()), m_size(s.size()) {} + StringView::StringView(const std::string& s) : m_ptr(s.data()), m_size(s.size()) { } std::string StringView::to_string() const { return std::string(m_ptr, m_size); } void StringView::to_string(std::string& s) const { s.append(m_ptr, m_size); } + StringView StringView::substr(size_t pos, size_t count) const + { + if (pos > m_size) + { + return StringView(); + } + + if (count > m_size - pos) + { + return StringView(m_ptr + pos, m_size - pos); + } + + return StringView(m_ptr + pos, count); + } + bool operator==(StringView lhs, StringView rhs) noexcept { return lhs.size() == rhs.size() && memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; } bool operator!=(StringView lhs, StringView rhs) noexcept { return !(lhs == rhs); } + + bool operator<(StringView lhs, StringView rhs) noexcept + { + return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); + } + + bool operator>(StringView lhs, StringView rhs) noexcept { return rhs < lhs; } + bool operator<=(StringView lhs, StringView rhs) noexcept { return !(rhs < lhs); } + bool operator>=(StringView lhs, StringView rhs) noexcept { return !(lhs < rhs); } } diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index f49632cac085f8..d06e338bef7644 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -19,6 +19,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 +31,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 +47,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 @@ -105,6 +109,107 @@ namespace vcpkg #endif // defined(_WIN32) } + const ExpectedS& System::get_home_dir() noexcept + { + static ExpectedS s_home = []() -> ExpectedS { +#ifdef _WIN32 +#define HOMEVAR "%USERPROFILE%" + auto maybe_home = System::get_environment_variable("USERPROFILE"); + if (!maybe_home.has_value() || maybe_home.get()->empty()) + return {"unable to read " HOMEVAR, ExpectedRightTag{}}; +#else +#define HOMEVAR "$HOME" + auto maybe_home = System::get_environment_variable("HOME"); + if (!maybe_home.has_value() || maybe_home.get()->empty()) + return {"unable to read " HOMEVAR, ExpectedRightTag{}}; +#endif + + auto p = fs::u8path(*maybe_home.get()); + if (!p.is_absolute()) return {HOMEVAR " was not an absolute path", ExpectedRightTag{}}; + + return {std::move(p), ExpectedLeftTag{}}; + }(); + return s_home; +#undef HOMEVAR + } + +#ifdef _WIN32 + const ExpectedS& System::get_appdata_local() noexcept + { + static ExpectedS s_home = []() -> ExpectedS { + auto maybe_home = System::get_environment_variable("LOCALAPPDATA"); + if (!maybe_home.has_value() || maybe_home.get()->empty()) + { + // Consult %APPDATA% as a workaround for Service accounts + // Microsoft/vcpkg#12285 + maybe_home = System::get_environment_variable("APPDATA"); + if (!maybe_home.has_value() || maybe_home.get()->empty()) + { + return {"unable to read %LOCALAPPDATA% or %APPDATA%", ExpectedRightTag{}}; + } + + auto p = fs::u8path(*maybe_home.get()).parent_path(); + p /= "Local"; + if (!p.is_absolute()) return {"%APPDATA% was not an absolute path", ExpectedRightTag{}}; + return {std::move(p), ExpectedLeftTag{}}; + } + + auto p = fs::u8path(*maybe_home.get()); + if (!p.is_absolute()) return {"%LOCALAPPDATA% was not an absolute path", ExpectedRightTag{}}; + + return {std::move(p), ExpectedLeftTag{}}; + }(); + 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 = [] { + auto maybe_home = System::get_environment_variable("XDG_CACHE_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(".cache"); + return home; + }); + } + }(); + return s_home; + } +#endif + + const ExpectedS& System::get_platform_cache_home() noexcept + { +#ifdef _WIN32 + return System::get_appdata_local(); +#else + return get_xdg_cache_home(); +#endif + } + #if defined(_WIN32) static bool is_string_keytype(const DWORD hkey_type) { @@ -137,7 +242,7 @@ namespace vcpkg ret.pop_back(); // remove extra trailing null byte return Strings::to_utf8(ret); } -#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv +#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv Optional System::get_registry_string(void*, StringView, StringView) { return nullopt; } #endif // defined(_WIN32) @@ -187,10 +292,10 @@ namespace vcpkg Optional System::guess_visual_studio_prompt_target_architecture() { // Check for the "vsdevcmd" infrastructure used by Visual Studio 2017 and later - const auto VSCMD_ARG_TGT_ARCH = System::get_environment_variable("VSCMD_ARG_TGT_ARCH"); - if (VSCMD_ARG_TGT_ARCH) + const auto vscmd_arg_tgt_arch_env = System::get_environment_variable("VSCMD_ARG_TGT_ARCH"); + if (vscmd_arg_tgt_arch_env) { - return to_cpu_architecture(VSCMD_ARG_TGT_ARCH.value_or_exit(VCPKG_LINE_INFO)); + return to_cpu_architecture(vscmd_arg_tgt_arch_env.value_or_exit(VCPKG_LINE_INFO)); } // Check for the "vcvarsall" infrastructure used by Visual Studio 2015 diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index 2bb61455e8d198..300e318df0d167 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -30,7 +30,7 @@ namespace vcpkg { struct CtrlCStateMachine { - CtrlCStateMachine() : m_number_of_external_processes(0), m_global_job(NULL), m_in_interactive(0) {} + CtrlCStateMachine() : m_number_of_external_processes(0), m_global_job(NULL), m_in_interactive(0) { } void transition_to_spawn_process() noexcept { @@ -167,7 +167,7 @@ namespace vcpkg } System::CMakeVariable::CMakeVariable(const StringView varname, const char* varvalue) - : s(Strings::format(R"("-D%s=%s")", varname, varvalue)) + : s(Strings::format("-D%s=%s", varname, varvalue)) { } System::CMakeVariable::CMakeVariable(const StringView varname, const std::string& varvalue) @@ -179,27 +179,81 @@ namespace vcpkg { } - std::string System::make_cmake_cmd(const fs::path& cmake_exe, - const fs::path& cmake_script, - const std::vector& pass_variables) + std::string System::make_basic_cmake_cmd(const fs::path& cmake_tool_path, + const fs::path& cmake_script, + const std::vector& pass_variables) { - const std::string cmd_cmake_pass_variables = Strings::join(" ", pass_variables, [](auto&& v) { return v.s; }); - return Strings::format( - R"("%s" %s -P "%s")", cmake_exe.u8string(), cmd_cmake_pass_variables, cmake_script.generic_u8string()); + System::CmdLineBuilder cmd; + cmd.path_arg(cmake_tool_path); + for (auto&& var : pass_variables) + { + cmd.string_arg(var.s); + } + cmd.string_arg("-P").path_arg(cmake_script); + return cmd.extract(); + } + + System::CmdLineBuilder& System::CmdLineBuilder::string_arg(StringView s) + { + if (!buf.empty()) buf.push_back(' '); + if (Strings::find_first_of(s, " \t\n\r\"\\,;&`^|'") != s.end()) + { + // TODO: improve this to properly handle all escaping +#if _WIN32 + // On Windows, `\`s before a double-quote must be doubled. Inner double-quotes must be escaped. + buf.push_back('"'); + size_t n_slashes = 0; + for (auto ch : s) + { + if (ch == '\\') + { + ++n_slashes; + } + else if (ch == '"') + { + buf.append(n_slashes + 1, '\\'); + n_slashes = 0; + } + else + { + n_slashes = 0; + } + buf.push_back(ch); + } + buf.append(n_slashes, '\\'); + buf.push_back('"'); +#else + // On non-Windows, `\` is the escape character and always requires doubling. Inner double-quotes must be + // escaped. + buf.push_back('"'); + for (auto ch : s) + { + if (ch == '\\' || ch == '"') buf.push_back('\\'); + buf.push_back(ch); + } + buf.push_back('"'); +#endif + } + else + { + Strings::append(buf, s); + } + return *this; } #if defined(_WIN32) Environment System::get_modified_clean_environment(const std::unordered_map& extra_env, const std::string& prepend_to_path) { - static const std::string SYSTEM_ROOT = get_environment_variable("SystemRoot").value_or_exit(VCPKG_LINE_INFO); - static const std::string SYSTEM_32 = SYSTEM_ROOT + R"(\system32)"; + static const std::string system_root_env = + get_environment_variable("SystemRoot").value_or_exit(VCPKG_LINE_INFO); + static const std::string system32_env = system_root_env + R"(\system32)"; std::string new_path = Strings::format(R"(Path=%s%s;%s;%s\Wbem;%s\WindowsPowerShell\v1.0\)", prepend_to_path, - SYSTEM_32, - SYSTEM_ROOT, - SYSTEM_32, - SYSTEM_32); + system32_env, + system_root_env, + system32_env, + system32_env); std::vector env_wstrings = { L"ALLUSERSPROFILE", @@ -237,6 +291,7 @@ namespace vcpkg L"USERDOMAIN_ROAMINGPROFILE", L"USERNAME", L"USERPROFILE", + L"VCPKG_DISABLE_METRICS", L"windir", // Enables proxy information to be passed to Curl, the underlying download library in cmake.exe L"http_proxy", @@ -253,9 +308,12 @@ namespace vcpkg L"CUDA_PATH_V9_1", L"CUDA_PATH_V10_0", L"CUDA_PATH_V10_1", + L"CUDA_PATH_V10_2", + L"CUDA_PATH_V11_0", 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 @@ -267,7 +325,7 @@ namespace vcpkg if (k && !k->empty()) { - auto vars = Strings::split(*k, ";"); + auto vars = Strings::split(*k, ';'); for (auto&& var : vars) { @@ -295,6 +353,8 @@ namespace vcpkg env_cstr.push_back(L'\0'); env_cstr.append(L"VSLANG=1033"); env_cstr.push_back(L'\0'); + env_cstr.append(L"VSCMD_SKIP_SENDTELEMETRY=1"); + env_cstr.push_back(L'\0'); for (const auto& item : extra_env) { @@ -325,29 +385,47 @@ namespace vcpkg #if defined(_WIN32) struct ProcessInfo { - constexpr ProcessInfo() : proc_info{} {} + constexpr ProcessInfo() noexcept : proc_info{} { } + ProcessInfo(ProcessInfo&& other) noexcept : proc_info(other.proc_info) + { + other.proc_info.hProcess = nullptr; + other.proc_info.hThread = nullptr; + } + ~ProcessInfo() + { + if (proc_info.hThread) + { + CloseHandle(proc_info.hThread); + } + if (proc_info.hProcess) + { + CloseHandle(proc_info.hProcess); + } + } - unsigned int wait_and_close_handles() + ProcessInfo& operator=(ProcessInfo&& other) noexcept { - CloseHandle(proc_info.hThread); + ProcessInfo{std::move(other)}.swap(*this); + return *this; + } + void swap(ProcessInfo& other) noexcept + { + std::swap(proc_info.hProcess, other.proc_info.hProcess); + std::swap(proc_info.hThread, other.proc_info.hThread); + } + + friend void swap(ProcessInfo& lhs, ProcessInfo& rhs) noexcept { lhs.swap(rhs); } + + unsigned int wait() + { const DWORD result = WaitForSingleObject(proc_info.hProcess, INFINITE); Checks::check_exit(VCPKG_LINE_INFO, result != WAIT_FAILED, "WaitForSingleObject failed"); - DWORD exit_code = 0; GetExitCodeProcess(proc_info.hProcess, &exit_code); - - CloseHandle(proc_info.hProcess); - return exit_code; } - void close_handles() - { - CloseHandle(proc_info.hThread); - CloseHandle(proc_info.hProcess); - } - PROCESS_INFORMATION proc_info; }; @@ -363,16 +441,23 @@ namespace vcpkg // Flush stdout before launching external process fflush(nullptr); - bool succeeded = TRUE == CreateProcessW(nullptr, - Strings::to_utf16(cmd_line).data(), - nullptr, - nullptr, - TRUE, - IDLE_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | dwCreationFlags, - (void*)(env.m_env_data.empty() ? nullptr : env.m_env_data.data()), - nullptr, - &startup_info, - &process_info.proc_info); + + VCPKG_MSVC_WARNING(suppress : 6335) // Leaking process information handle 'process_info.proc_info.hProcess' + // /analyze can't tell that we transferred ownership here + bool succeeded = + TRUE == CreateProcessW(nullptr, + Strings::to_utf16(cmd_line).data(), + nullptr, + nullptr, + TRUE, + IDLE_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | dwCreationFlags, + env.m_env_data.empty() + ? nullptr + : const_cast(static_cast(env.m_env_data.data())), + nullptr, + &startup_info, + &process_info.proc_info); + if (succeeded) return process_info; else @@ -411,7 +496,7 @@ namespace vcpkg CloseHandle(child_stdout); - return proc_info.wait_and_close_handles(); + return proc_info.wait(); } }; @@ -465,11 +550,7 @@ namespace vcpkg auto timer = Chrono::ElapsedTimer::create_started(); auto process_info = windows_create_process(cmd_line, {}, DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB); - if (auto p = process_info.get()) - { - p->close_handles(); - } - else + if (!process_info.get()) { Debug::print("cmd_execute_no_wait() failed with error code ", process_info.error(), "\n"); } @@ -492,7 +573,7 @@ namespace vcpkg std::wstring out_env; - while (1) + for (;;) { auto eq = std::find(it, e, '='); if (eq == e) break; @@ -518,10 +599,10 @@ namespace vcpkg #if defined(_WIN32) using vcpkg::g_ctrl_c_state; g_ctrl_c_state.transition_to_spawn_process(); - auto proc_info = windows_create_process(cmd_line, env, NULL); + auto proc_info = windows_create_process(cmd_line, env, 0); auto long_exit_code = [&]() -> unsigned long { if (auto p = proc_info.get()) - return p->wait_and_close_handles(); + return p->wait(); else return proc_info.error(); }(); @@ -535,6 +616,7 @@ namespace vcpkg (void)env; Debug::print("system(", cmd_line, ")\n"); fflush(nullptr); + int exit_code = system(cmd_line.c_str()); Debug::print( "system() returned ", exit_code, " after ", static_cast(timer.microseconds()), " us\n"); @@ -579,7 +661,7 @@ namespace vcpkg using vcpkg::g_ctrl_c_state; g_ctrl_c_state.transition_to_spawn_process(); - auto maybe_proc_info = windows_create_process_redirect(cmd_line, env, NULL); + auto maybe_proc_info = windows_create_process_redirect(cmd_line, env, 0); auto exit_code = [&]() -> unsigned long { if (auto p = maybe_proc_info.get()) return p->wait_and_stream_output(data_cb); @@ -594,6 +676,7 @@ namespace vcpkg Debug::print("popen(", actual_cmd_line, ")\n"); // Flush stdout before launching external process fflush(stdout); + const auto pipe = popen(actual_cmd_line.c_str(), "r"); if (pipe == nullptr) { @@ -644,6 +727,6 @@ namespace vcpkg SetConsoleCtrlHandler(reinterpret_cast(ctrl_handler), TRUE); } #else - void System::register_console_ctrl_handler() {} + void System::register_console_ctrl_handler() { } #endif } diff --git a/toolsrc/src/vcpkg/base/uint128.cpp b/toolsrc/src/vcpkg/base/uint128.cpp index e0256075e09451..900cbf9e635eef 100644 --- a/toolsrc/src/vcpkg/base/uint128.cpp +++ b/toolsrc/src/vcpkg/base/uint128.cpp @@ -2,54 +2,65 @@ #include -namespace vcpkg { +namespace vcpkg +{ + UInt128& UInt128::operator<<=(int by) noexcept + { + if (by == 0) + { + return *this; + } + + if (by < 64) + { + top <<= by; + const auto shift_up = bottom >> (64 - by); + top |= shift_up; + bottom <<= by; + } + else + { + top = bottom; + top <<= (by - 64); + bottom = 0; + } -UInt128& UInt128::operator<<=(int by) noexcept { - if (by == 0) { return *this; } - if (by < 64) { - top <<= by; - const auto shift_up = bottom >> (64 - by); - top |= shift_up; - bottom <<= by; - } else { - top = bottom; - top <<= (by - 64); - bottom = 0; - } + UInt128& UInt128::operator>>=(int by) noexcept + { + if (by == 0) + { + return *this; + } - return *this; -} + if (by < 64) + { + bottom >>= by; + const auto shift_down = top << (64 - by); + bottom |= shift_down; + top >>= by; + } + else + { + bottom = top; + bottom >>= (by - 64); + top = 0; + } -UInt128& UInt128::operator>>=(int by) noexcept { - if (by == 0) { return *this; } - if (by < 64) { - bottom >>= by; - const auto shift_down = top << (64 - by); - bottom |= shift_down; - top >>= by; - } else { - bottom = top; - bottom >>= (by - 64); - top = 0; - } - - return *this; -} - -UInt128& UInt128::operator+=(uint64_t rhs) noexcept { - // bottom + lhs > uint64::max - if (bottom > std::numeric_limits::max() - rhs) + UInt128& UInt128::operator+=(uint64_t rhs) noexcept { + // bottom + lhs > uint64::max + if (bottom > std::numeric_limits::max() - rhs) + { top += 1; + } + bottom += rhs; + return *this; } - bottom += rhs; - return *this; -} } diff --git a/toolsrc/src/vcpkg/base/unicode.cpp b/toolsrc/src/vcpkg/base/unicode.cpp new file mode 100644 index 00000000000000..149bad20f9180a --- /dev/null +++ b/toolsrc/src/vcpkg/base/unicode.cpp @@ -0,0 +1,284 @@ +#include "pch.h" + +#include +#include + +namespace vcpkg::Unicode +{ + Utf8CodeUnitKind utf8_code_unit_kind(unsigned char code_unit) noexcept + { + if (code_unit < 0b1000'0000) + { + return Utf8CodeUnitKind::StartOne; + } + else if (code_unit < 0b1100'0000) + { + return Utf8CodeUnitKind::Continue; + } + else if (code_unit < 0b1110'0000) + { + return Utf8CodeUnitKind::StartTwo; + } + else if (code_unit < 0b1111'0000) + { + return Utf8CodeUnitKind::StartThree; + } + else if (code_unit < 0b1111'1000) + { + return Utf8CodeUnitKind::StartFour; + } + else + { + return Utf8CodeUnitKind::Invalid; + } + } + + int utf8_code_unit_count(Utf8CodeUnitKind kind) noexcept { return static_cast(kind); } + int utf8_code_unit_count(char code_unit) noexcept { return utf8_code_unit_count(utf8_code_unit_kind(code_unit)); } + + static int utf8_encode_code_unit_count(char32_t code_point) noexcept + { + if (code_point < 0x80) + { + return 1; + } + else if (code_point < 0x800) + { + return 2; + } + else if (code_point < 0x10000) + { + return 3; + } + else if (code_point < 0x110000) + { + return 4; + } + else + { + vcpkg::Checks::exit_with_message( + VCPKG_LINE_INFO, "Invalid code point passed to utf8_encoded_code_point_count (%x)", code_point); + } + } + + int utf8_encode_code_point(char (&array)[4], char32_t code_point) noexcept + { + // count \in {2, 3, 4} + const auto start_code_point = [](char32_t code_point, int count) { + const unsigned char and_mask = 0xFF >> (count + 1); + const unsigned char or_mask = (0xFF << (8 - count)) & 0xFF; + const int shift = 6 * (count - 1); + return static_cast(or_mask | ((code_point >> shift) & and_mask)); + }; + // count \in {2, 3, 4}, byte \in {1, 2, 3} + const auto continue_code_point = [](char32_t code_point, int count, int byte) { + constexpr unsigned char and_mask = 0xFF >> 2; + constexpr unsigned char or_mask = (0xFF << 7) & 0xFF; + const int shift = 6 * (count - byte - 1); + return static_cast(or_mask | ((code_point >> shift) & and_mask)); + }; + + int count = utf8_encode_code_unit_count(code_point); + if (count == 1) + { + array[0] = static_cast(code_point); + return 1; + } + + array[0] = start_code_point(code_point, count); + for (int i = 1; i < count; ++i) + { + array[i] = continue_code_point(code_point, count, i); + } + + return count; + } + + bool utf8_is_valid_string(const char* first, const char* last) noexcept + { + std::error_code ec; + for (auto dec = Utf8Decoder(first, last); dec != dec.end(); dec.next(ec)) + { + } + return !ec; + } + + char32_t utf16_surrogates_to_code_point(char32_t leading, char32_t trailing) + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, utf16_is_leading_surrogate_code_point(leading)); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, utf16_is_trailing_surrogate_code_point(trailing)); + + char32_t res = (leading & 0b11'1111'1111) << 10; + res |= trailing & 0b11'1111'1111; + res += 0x0001'0000; + + return res; + } + + const char* utf8_category::name() const noexcept { return "utf8"; } + std::string utf8_category::message(int condition) const + { + switch (static_cast(condition)) + { + case utf8_errc::NoError: return "no error"; + case utf8_errc::InvalidCodeUnit: return "invalid code unit"; + case utf8_errc::InvalidCodePoint: return "invalid code point (>0x10FFFF)"; + case utf8_errc::PairedSurrogates: + return "trailing surrogate following leading surrogate (paired surrogates are invalid)"; + case utf8_errc::UnexpectedContinue: return "found continue code unit in start position"; + case utf8_errc::UnexpectedStart: return "found start code unit in continue position"; + case utf8_errc::UnexpectedEof: return "found end of string in middle of code point"; + default: return "error code out of range"; + } + } + + Utf8Decoder::Utf8Decoder() noexcept : current_(end_of_file), next_(nullptr), last_(nullptr) { } + Utf8Decoder::Utf8Decoder(const char* first, const char* last) noexcept : current_(0), next_(first), last_(last) + { + if (next_ != last_) + { + ++*this; + } + else + { + current_ = end_of_file; + } + } + + char const* Utf8Decoder::pointer_to_current() const noexcept + { + if (is_eof()) + { + return last_; + } + + auto count = utf8_encode_code_unit_count(current_); + return next_ - count; + } + + bool Utf8Decoder::is_eof() const noexcept { return current_ == end_of_file; } + char32_t Utf8Decoder::operator*() const noexcept + { + if (is_eof()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "Dereferenced Utf8Decoder on the end of a string"); + } + return current_; + } + + void Utf8Decoder::next(std::error_code& ec) + { + ec.clear(); + + if (is_eof()) + { + vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Incremented Utf8Decoder at the end of the string"); + } + + if (next_ == last_) + { + current_ = end_of_file; + return; + } + + auto set_error = [&ec, this](utf8_errc err) { + ec = err; + *this = sentinel(); + }; + + unsigned char code_unit = static_cast(*next_++); + + auto kind = utf8_code_unit_kind(code_unit); + if (kind == Utf8CodeUnitKind::Invalid) + { + return set_error(utf8_errc::InvalidCodeUnit); + } + else if (kind == Utf8CodeUnitKind::Continue) + { + return set_error(utf8_errc::UnexpectedContinue); + } + + const int count = utf8_code_unit_count(kind); + if (count == 1) + { + current_ = static_cast(code_unit); + } + else + { + // 2 -> 0b0001'1111, 6 + // 3 -> 0b0000'1111, 12 + // 4 -> 0b0000'0111, 18 + const auto start_mask = static_cast(0xFF >> (count + 1)); + const int start_shift = 6 * (count - 1); + auto code_point = static_cast(code_unit & start_mask) << start_shift; + + constexpr unsigned char continue_mask = 0b0011'1111; + for (int byte = 1; byte < count; ++byte) + { + if (next_ == last_) + { + return set_error(utf8_errc::UnexpectedContinue); + } + code_unit = static_cast(*next_++); + + kind = utf8_code_unit_kind(code_unit); + if (kind == Utf8CodeUnitKind::Invalid) + { + return set_error(utf8_errc::InvalidCodeUnit); + } + else if (kind != Utf8CodeUnitKind::Continue) + { + return set_error(utf8_errc::UnexpectedStart); + } + + const int shift = 6 * (count - byte - 1); + code_point |= (code_unit & continue_mask) << shift; + } + + if (code_point > 0x10'FFFF) + { + return set_error(utf8_errc::InvalidCodePoint); + } + else if (utf16_is_trailing_surrogate_code_point(code_point) && + utf16_is_leading_surrogate_code_point(current_)) + { + return set_error(utf8_errc::PairedSurrogates); + } + else + { + current_ = code_point; + } + } + } + + Utf8Decoder& Utf8Decoder::operator++() noexcept + { + std::error_code ec; + next(ec); + if (ec) + { + vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, ec.message()); + } + + return *this; + } + + Utf8Decoder& Utf8Decoder::operator=(sentinel) noexcept + { + next_ = last_; + current_ = end_of_file; + return *this; + } + + bool operator==(const Utf8Decoder& lhs, const Utf8Decoder& rhs) noexcept + { + if (lhs.last_ != rhs.last_) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Comparing Utf8Decoders with different provenance; this is always an error"); + } + + return lhs.next_ == rhs.next_; + } + +} diff --git a/toolsrc/src/vcpkg/binarycaching.cpp b/toolsrc/src/vcpkg/binarycaching.cpp index 0750366fffee9a..75701d7ee76cb3 100644 --- a/toolsrc/src/vcpkg/binarycaching.cpp +++ b/toolsrc/src/vcpkg/binarycaching.cpp @@ -1,226 +1,1078 @@ -#include "pch.h" - -#include -#include -#include -#include -#include -#include -#include - -using namespace vcpkg; - -namespace -{ - static System::ExitCodeAndOutput decompress_archive(const VcpkgPaths& paths, - const PackageSpec& spec, - const fs::path& archive_path) - { - auto& fs = paths.get_filesystem(); - - auto pkg_path = paths.package_dir(spec); - fs.remove_all(pkg_path, VCPKG_LINE_INFO); - 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()); - -#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()); -#else - auto cmd = Strings::format(R"(unzip -qq "%s" "-d%s")", archive_path.u8string(), pkg_path.u8string()); -#endif - return System::cmd_execute_and_capture_output(cmd, System::get_clean_environment()); - } - - // Compress the source directory into the destination file. - static void compress_directory(const VcpkgPaths& paths, const fs::path& source, const fs::path& destination) - { - auto& fs = paths.get_filesystem(); - - std::error_code ec; - - fs.remove(destination, ec); - Checks::check_exit( - VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", destination.u8string()); -#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()), - System::get_clean_environment()); -#else - System::cmd_execute_clean( - Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", source.u8string(), destination.u8string())); -#endif - } - - struct ArchivesBinaryProvider : IBinaryProvider - { - ~ArchivesBinaryProvider() = default; - void prefetch() override {} - RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override - { - const auto& abi_tag = action.package_abi.value_or_exit(VCPKG_LINE_INFO); - auto& spec = action.spec; - auto& fs = paths.get_filesystem(); - std::error_code ec; - const fs::path archives_root_dir = paths.root / "archives"; - const std::string archive_name = abi_tag + ".zip"; - const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; - const fs::path archive_path = archives_root_dir / archive_subpath; - const fs::path archive_tombstone_path = archives_root_dir / "fail" / archive_subpath; - if (fs.exists(archive_path)) - { - System::print2("Using cached binary package: ", archive_path.u8string(), "\n"); - - int archive_result = decompress_archive(paths, spec, archive_path).exit_code; - - if (archive_result != 0) - { - System::print2("Failed to decompress archive package\n"); - if (action.build_options.purge_decompress_failure == Build::PurgeDecompressFailure::NO) - { - return RestoreResult::build_failed; - } - else - { - System::print2("Purging bad archive\n"); - fs.remove(archive_path, ec); - } - } - else - { - return RestoreResult::success; - } - } - - if (fs.exists(archive_tombstone_path)) - { - if (action.build_options.fail_on_tombstone == Build::FailOnTombstone::YES) - { - System::print2("Found failure tombstone: ", archive_tombstone_path.u8string(), "\n"); - return RestoreResult::build_failed; - } - else - { - System::print2( - System::Color::warning, "Found failure tombstone: ", archive_tombstone_path.u8string(), "\n"); - } - } - else - { - System::printf("Could not locate cached archive: %s\n", archive_path.u8string()); - } - - return RestoreResult::missing; - } - void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override - { - const auto& abi_tag = action.package_abi.value_or_exit(VCPKG_LINE_INFO); - auto& spec = action.spec; - auto& fs = paths.get_filesystem(); - const fs::path archives_root_dir = paths.root / "archives"; - const std::string archive_name = abi_tag + ".zip"; - const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; - const fs::path archive_path = archives_root_dir / archive_subpath; - - const auto tmp_archive_path = paths.buildtrees / spec.name() / (spec.triplet().to_string() + ".zip"); - - compress_directory(paths, paths.package_dir(spec), tmp_archive_path); - - fs.create_directories(archive_path.parent_path(), ignore_errors); - std::error_code ec; - fs.rename_or_copy(tmp_archive_path, archive_path, ".tmp", ec); - if (ec) - { - System::printf(System::Color::warning, - "Failed to store binary cache %s: %s\n", - archive_path.u8string(), - ec.message()); - } - else - System::printf("Stored binary cache: %s\n", archive_path.u8string()); - } - void push_failure(const VcpkgPaths& paths, const std::string& abi_tag, const PackageSpec& spec) override - { - auto& fs = paths.get_filesystem(); - std::error_code ec; - const fs::path archives_root_dir = paths.root / "archives"; - const std::string archive_name = abi_tag + ".zip"; - const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; - const fs::path archive_path = archives_root_dir / archive_subpath; - const fs::path archive_tombstone_path = archives_root_dir / "fail" / archive_subpath; - 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 (!fs.exists(archive_tombstone_path)) - { - // Build failed, store all failure logs in the tombstone. - const auto tmp_log_path = paths.buildtrees / spec.name() / "tmp_failure_logs"; - const auto tmp_log_path_destination = tmp_log_path / spec.name(); - const auto tmp_failure_zip = paths.buildtrees / spec.name() / "failure_logs.zip"; - fs.create_directories(tmp_log_path_destination, ignore_errors); - - for (auto& log_file : fs::stdfs::directory_iterator(paths.buildtrees / spec.name())) - { - if (log_file.path().extension() == ".log") - { - fs.copy_file(log_file.path(), - tmp_log_path_destination / log_file.path().filename(), - fs::stdfs::copy_options::none, - ec); - } - } - - compress_directory(paths, tmp_log_path, paths.buildtrees / spec.name() / "failure_logs.zip"); - - fs.create_directories(archive_tombstone_path.parent_path(), ignore_errors); - fs.rename_or_copy(tmp_failure_zip, archive_tombstone_path, ".tmp", ec); - - // clean up temporary directory - fs.remove_all(tmp_log_path, VCPKG_LINE_INFO); - } - } - RestoreResult precheck(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - bool purge_tombstones) override - { - const auto& abi_tag = action.package_abi.value_or_exit(VCPKG_LINE_INFO); - auto& fs = paths.get_filesystem(); - std::error_code ec; - const fs::path archives_root_dir = paths.root / "archives"; - const std::string archive_name = abi_tag + ".zip"; - const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; - const fs::path archive_path = archives_root_dir / archive_subpath; - const fs::path archive_tombstone_path = archives_root_dir / "fail" / archive_subpath; - - if (fs.exists(archive_path)) - { - return RestoreResult::success; - } - - if (purge_tombstones) - { - fs.remove(archive_tombstone_path, ec); // Ignore error - } - else if (fs.exists(archive_tombstone_path)) - { - if (action.build_options.fail_on_tombstone == Build::FailOnTombstone::YES) - { - return RestoreResult::build_failed; - } - } - - return RestoreResult::missing; - } - }; -} - -std::unique_ptr vcpkg::create_archives_provider() -{ - return std::make_unique(); -} +#include "pch.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace vcpkg; + +namespace +{ + static System::ExitCodeAndOutput decompress_archive(const VcpkgPaths& paths, + const PackageSpec& spec, + const fs::path& archive_path) + { + auto& fs = paths.get_filesystem(); + + auto pkg_path = paths.package_dir(spec); + fs.remove_all(pkg_path, VCPKG_LINE_INFO); + 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()); + +#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()); +#else + auto cmd = Strings::format(R"(unzip -qq "%s" "-d%s")", archive_path.u8string(), pkg_path.u8string()); +#endif + return System::cmd_execute_and_capture_output(cmd, System::get_clean_environment()); + } + + // Compress the source directory into the destination file. + static void compress_directory(const VcpkgPaths& paths, const fs::path& source, const fs::path& destination) + { + auto& fs = paths.get_filesystem(); + + std::error_code ec; + + fs.remove(destination, ec); + Checks::check_exit( + VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", destination.u8string()); +#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()), + System::get_clean_environment()); +#else + System::cmd_execute_clean( + Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", source.u8string(), destination.u8string())); +#endif + } + + struct ArchivesBinaryProvider : IBinaryProvider + { + ArchivesBinaryProvider(std::vector&& read_dirs, std::vector&& write_dirs) + : m_read_dirs(std::move(read_dirs)), m_write_dirs(std::move(write_dirs)) + { + } + ~ArchivesBinaryProvider() = default; + void prefetch(const VcpkgPaths&, const Dependencies::ActionPlan&) override { } + RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + const auto& abi_tag = action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi; + auto& spec = action.spec; + auto& fs = paths.get_filesystem(); + std::error_code ec; + for (auto&& archives_root_dir : m_read_dirs) + { + const std::string archive_name = abi_tag + ".zip"; + const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; + 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"); + + int archive_result = decompress_archive(paths, spec, archive_path).exit_code; + + if (archive_result == 0) + { + return RestoreResult::success; + } + else + { + System::print2("Failed to decompress archive package\n"); + if (action.build_options.purge_decompress_failure == Build::PurgeDecompressFailure::NO) + { + return RestoreResult::build_failed; + } + else + { + System::print2("Purging bad archive\n"); + fs.remove(archive_path, ec); + } + } + } + + System::printf("Could not locate cached archive: %s\n", archive_path.u8string()); + } + + return RestoreResult::missing; + } + void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + if (m_write_dirs.empty()) return; + const auto& abi_tag = action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi; + auto& spec = action.spec; + auto& fs = paths.get_filesystem(); + const auto tmp_archive_path = paths.buildtrees / spec.name() / (spec.triplet().to_string() + ".zip"); + compress_directory(paths, paths.package_dir(spec), tmp_archive_path); + + for (auto&& m_directory : m_write_dirs) + { + const fs::path& archives_root_dir = m_directory; + const std::string archive_name = abi_tag + ".zip"; + const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; + const fs::path archive_path = archives_root_dir / archive_subpath; + + fs.create_directories(archive_path.parent_path(), ignore_errors); + std::error_code ec; + if (m_write_dirs.size() > 1) + fs.copy_file(tmp_archive_path, archive_path, fs::copy_options::overwrite_existing, ec); + else + fs.rename_or_copy(tmp_archive_path, archive_path, ".tmp", ec); + if (ec) + { + System::printf(System::Color::warning, + "Failed to store binary cache %s: %s\n", + archive_path.u8string(), + ec.message()); + } + else + System::printf("Stored binary cache: %s\n", archive_path.u8string()); + } + if (m_write_dirs.size() > 1) fs.remove(tmp_archive_path, ignore_errors); + } + RestoreResult precheck(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + const auto& abi_tag = action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi; + auto& fs = paths.get_filesystem(); + std::error_code ec; + for (auto&& archives_root_dir : m_read_dirs) + { + const std::string archive_name = abi_tag + ".zip"; + const fs::path archive_subpath = fs::u8path(abi_tag.substr(0, 2)) / archive_name; + const fs::path archive_path = archives_root_dir / archive_subpath; + + if (fs.exists(archive_path)) + { + return RestoreResult::success; + } + } + return RestoreResult::missing; + } + + private: + std::vector m_read_dirs, m_write_dirs; + }; + + static std::string trim_leading_zeroes(std::string v) + { + auto n = v.find_first_not_of('0'); + if (n == std::string::npos) + { + v = "0"; + } + else if (n > 0) + { + v.erase(0, n); + } + return v; + } + + struct NugetBinaryProvider : IBinaryProvider + { + NugetBinaryProvider(std::vector&& read_sources, + std::vector&& write_sources, + std::vector&& read_configs, + std::vector&& write_configs, + bool interactive) + : m_read_sources(std::move(read_sources)) + , m_write_sources(std::move(write_sources)) + , m_read_configs(std::move(read_configs)) + , m_write_configs(std::move(write_configs)) + , m_interactive(interactive) + { + } + void prefetch(const VcpkgPaths& paths, const Dependencies::ActionPlan& plan) override + { + if (m_read_sources.empty() && m_read_configs.empty()) return; + + auto& fs = paths.get_filesystem(); + + std::vector> nuget_refs; + + for (auto&& action : plan.install_actions) + { + if (action.build_options.editable == Build::Editable::YES) continue; + + auto& spec = action.spec; + fs.remove_all(paths.package_dir(spec), VCPKG_LINE_INFO); + + nuget_refs.emplace_back(spec, NugetReference(action)); + } + + if (nuget_refs.empty()) return; + + System::print2("Attempting to fetch ", nuget_refs.size(), " packages from nuget.\n"); + + auto packages_config = paths.buildtrees / fs::u8path("packages.config"); + + auto generate_packages_config = [&] { + XmlSerializer xml; + xml.emit_declaration().line_break(); + xml.open_tag("packages").line_break(); + + for (auto&& nuget_ref : nuget_refs) + xml.start_complex_open_tag("package") + .text_attr("id", nuget_ref.second.id) + .text_attr("version", nuget_ref.second.version) + .finish_self_closing_complex_tag() + .line_break(); + + xml.close_tag("packages").line_break(); + paths.get_filesystem().write_contents(packages_config, xml.buf, VCPKG_LINE_INFO); + }; + + const auto& nuget_exe = paths.get_tool_exe("nuget"); + std::vector cmdlines; + + if (!m_read_sources.empty()) + { + // First check using all sources + System::CmdLineBuilder cmdline; +#ifndef _WIN32 + cmdline.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmdline.path_arg(nuget_exe) + .string_arg("install") + .path_arg(packages_config) + .string_arg("-OutputDirectory") + .path_arg(paths.packages) + .string_arg("-Source") + .string_arg(Strings::join(";", m_read_sources)) + .string_arg("-ExcludeVersion") + .string_arg("-NoCache") + .string_arg("-PreRelease") + .string_arg("-DirectDownload") + .string_arg("-PackageSaveMode") + .string_arg("nupkg") + .string_arg("-Verbosity") + .string_arg("detailed") + .string_arg("-ForceEnglishOutput"); + if (!m_interactive) cmdline.string_arg("-NonInteractive"); + cmdlines.push_back(cmdline.extract()); + } + for (auto&& cfg : m_read_configs) + { + // Then check using each config + System::CmdLineBuilder cmdline; +#ifndef _WIN32 + cmdline.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmdline.path_arg(nuget_exe) + .string_arg("install") + .path_arg(packages_config) + .string_arg("-OutputDirectory") + .path_arg(paths.packages) + .string_arg("-ConfigFile") + .path_arg(cfg) + .string_arg("-ExcludeVersion") + .string_arg("-NoCache") + .string_arg("-PreRelease") + .string_arg("-DirectDownload") + .string_arg("-PackageSaveMode") + .string_arg("nupkg") + .string_arg("-Verbosity") + .string_arg("detailed") + .string_arg("-ForceEnglishOutput"); + if (!m_interactive) cmdline.string_arg("-NonInteractive"); + cmdlines.push_back(cmdline.extract()); + } + + size_t num_restored = 0; + + for (const auto& cmdline : cmdlines) + { + if (nuget_refs.empty()) break; + + [&] { + generate_packages_config(); + if (Debug::g_debugging) + System::cmd_execute(cmdline); + else + { + auto res = System::cmd_execute_and_capture_output(cmdline); + if (res.output.find("Authentication may require manual action.") != std::string::npos) + { + System::print2( + System::Color::warning, + "One or more NuGet credential providers requested manual action. Add the binary " + "source 'interactive' to allow interactivity.\n"); + } + } + }(); + + Util::erase_remove_if(nuget_refs, [&](const std::pair& nuget_ref) -> bool { + auto nupkg_path = paths.package_dir(nuget_ref.first) / fs::u8path(nuget_ref.second.id + ".nupkg"); + if (fs.exists(nupkg_path, ignore_errors)) + { + fs.remove(nupkg_path, VCPKG_LINE_INFO); + Checks::check_exit(VCPKG_LINE_INFO, + !fs.exists(nupkg_path, ignore_errors), + "Unable to remove nupkg after restoring: %s", + nupkg_path.u8string()); + m_restored.emplace(nuget_ref.first); + ++num_restored; + return true; + } + else + { + return false; + } + }); + } + + System::print2("Restored ", num_restored, " packages. Use --debug for more information.\n"); + } + RestoreResult try_restore(const VcpkgPaths&, const Dependencies::InstallPlanAction& action) override + { + if (Util::Sets::contains(m_restored, action.spec)) + return RestoreResult::success; + else + return RestoreResult::missing; + } + void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + if (m_write_sources.empty() && m_write_configs.empty()) return; + auto& spec = action.spec; + + NugetReference nuget_ref(action); + auto nuspec_path = paths.buildtrees / spec.name() / (spec.triplet().to_string() + ".nuspec"); + paths.get_filesystem().write_contents( + nuspec_path, generate_nuspec(paths, action, nuget_ref), VCPKG_LINE_INFO); + + const auto& nuget_exe = paths.get_tool_exe("nuget"); + System::CmdLineBuilder cmdline; +#ifndef _WIN32 + cmdline.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmdline.path_arg(nuget_exe) + .string_arg("pack") + .path_arg(nuspec_path) + .string_arg("-OutputDirectory") + .path_arg(paths.buildtrees) + .string_arg("-NoDefaultExcludes") + .string_arg("-ForceEnglishOutput"); + if (!m_interactive) cmdline.string_arg("-NonInteractive"); + + auto pack_rc = [&] { + if (Debug::g_debugging) + return System::cmd_execute(cmdline); + else + return System::cmd_execute_and_capture_output(cmdline).exit_code; + }(); + + if (pack_rc != 0) + { + System::print2(System::Color::error, "Packing NuGet failed. Use --debug for more information.\n"); + } + else + { + auto nupkg_path = paths.buildtrees / nuget_ref.nupkg_filename(); + for (auto&& write_src : m_write_sources) + { + System::CmdLineBuilder cmd; +#ifndef _WIN32 + cmd.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmd.path_arg(nuget_exe) + .string_arg("push") + .path_arg(nupkg_path) + .string_arg("-ApiKey") + .string_arg("AzureDevOps") + .string_arg("-ForceEnglishOutput") + .string_arg("-Source") + .string_arg(write_src); + if (!m_interactive) cmd.string_arg("-NonInteractive"); + + System::print2("Uploading binaries for ", spec, " to NuGet source ", write_src, ".\n"); + + auto rc = [&] { + if (Debug::g_debugging) + return System::cmd_execute(cmd); + else + return System::cmd_execute_and_capture_output(cmd).exit_code; + }(); + + if (rc != 0) + { + System::print2(System::Color::error, + "Pushing NuGet to ", + write_src, + " failed. Use --debug for more information.\n"); + } + } + for (auto&& write_cfg : m_write_configs) + { + System::CmdLineBuilder cmd; +#ifndef _WIN32 + cmd.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmd.path_arg(nuget_exe) + .string_arg("push") + .path_arg(nupkg_path) + .string_arg("-ApiKey") + .string_arg("AzureDevOps") + .string_arg("-ForceEnglishOutput") + .string_arg("-ConfigFile") + .path_arg(write_cfg); + if (!m_interactive) cmd.string_arg("-NonInteractive"); + + System::print2( + "Uploading binaries for ", spec, " using NuGet config ", write_cfg.u8string(), ".\n"); + + auto rc = [&] { + if (Debug::g_debugging) + return System::cmd_execute(cmd); + else + return System::cmd_execute_and_capture_output(cmd).exit_code; + }(); + + if (rc != 0) + { + System::print2(System::Color::error, + "Pushing NuGet with ", + write_cfg.u8string(), + " failed. Use --debug for more information.\n"); + } + } + paths.get_filesystem().remove(nupkg_path, ignore_errors); + } + } + RestoreResult precheck(const VcpkgPaths&, const Dependencies::InstallPlanAction&) override + { + return RestoreResult::missing; + } + + private: + std::vector m_read_sources; + std::vector m_write_sources; + + std::vector m_read_configs; + std::vector m_write_configs; + + std::set m_restored; + bool m_interactive; + }; + + struct MergeBinaryProviders : IBinaryProvider + { + explicit MergeBinaryProviders(std::vector>&& providers) + : m_providers(std::move(providers)) + { + } + + void prefetch(const VcpkgPaths& paths, const Dependencies::ActionPlan& plan) override + { + for (auto&& provider : m_providers) + { + provider->prefetch(paths, plan); + } + } + RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + for (auto&& provider : m_providers) + { + auto result = provider->try_restore(paths, action); + switch (result) + { + case RestoreResult::build_failed: + case RestoreResult::success: return result; + case RestoreResult::missing: continue; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + return RestoreResult::missing; + } + void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + for (auto&& provider : m_providers) + { + provider->push_success(paths, action); + } + } + RestoreResult precheck(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) override + { + for (auto&& provider : m_providers) + { + auto result = provider->precheck(paths, action); + switch (result) + { + case RestoreResult::build_failed: + case RestoreResult::success: return result; + case RestoreResult::missing: continue; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + return RestoreResult::missing; + } + + private: + std::vector> m_providers; + }; + + struct NullBinaryProvider : IBinaryProvider + { + void prefetch(const VcpkgPaths&, const Dependencies::ActionPlan&) override { } + RestoreResult try_restore(const VcpkgPaths&, const Dependencies::InstallPlanAction&) override + { + return RestoreResult::missing; + } + void push_success(const VcpkgPaths&, const Dependencies::InstallPlanAction&) override { } + RestoreResult precheck(const VcpkgPaths&, const Dependencies::InstallPlanAction&) override + { + return RestoreResult::missing; + } + }; +} + +XmlSerializer& XmlSerializer::emit_declaration() +{ + buf.append(R"()"); + return *this; +} +XmlSerializer& XmlSerializer::open_tag(StringLiteral sl) +{ + emit_pending_indent(); + Strings::append(buf, '<', sl, '>'); + m_indent += 2; + return *this; +} +XmlSerializer& XmlSerializer::start_complex_open_tag(StringLiteral sl) +{ + emit_pending_indent(); + Strings::append(buf, '<', sl); + m_indent += 2; + return *this; +} +XmlSerializer& XmlSerializer::text_attr(StringLiteral name, StringView content) +{ + if (m_pending_indent) + { + m_pending_indent = false; + buf.append(m_indent, ' '); + } + else + { + buf.push_back(' '); + } + Strings::append(buf, name, "=\""); + text(content); + Strings::append(buf, '"'); + return *this; +} +XmlSerializer& XmlSerializer::finish_complex_open_tag() +{ + emit_pending_indent(); + Strings::append(buf, '>'); + return *this; +} +XmlSerializer& XmlSerializer::finish_self_closing_complex_tag() +{ + emit_pending_indent(); + Strings::append(buf, "/>"); + m_indent -= 2; + return *this; +} +XmlSerializer& XmlSerializer::close_tag(StringLiteral sl) +{ + m_indent -= 2; + emit_pending_indent(); + Strings::append(buf, "'); + return *this; +} +XmlSerializer& XmlSerializer::text(StringView sv) +{ + emit_pending_indent(); + for (auto ch : sv) + { + if (ch == '&') + { + buf.append("&"); + } + else if (ch == '<') + { + buf.append("<"); + } + else if (ch == '>') + { + buf.append(">"); + } + else if (ch == '"') + { + buf.append("""); + } + else if (ch == '\'') + { + buf.append("'"); + } + else + { + buf.push_back(ch); + } + } + return *this; +} +XmlSerializer& XmlSerializer::simple_tag(StringLiteral tag, StringView content) +{ + return emit_pending_indent().open_tag(tag).text(content).close_tag(tag); +} +XmlSerializer& XmlSerializer::line_break() +{ + buf.push_back('\n'); + m_pending_indent = true; + return *this; +} +XmlSerializer& XmlSerializer::emit_pending_indent() +{ + if (m_pending_indent) + { + m_pending_indent = false; + buf.append(m_indent, ' '); + } + return *this; +} + +IBinaryProvider& vcpkg::null_binary_provider() +{ + static NullBinaryProvider p; + return p; +} + +ExpectedS> vcpkg::create_binary_provider_from_configs(View args) +{ + std::string env_string = System::get_environment_variable("VCPKG_BINARY_SOURCES").value_or(""); + + return create_binary_provider_from_configs_pure(env_string, args); +} +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: " + path.u8string(), + expected_right_tag}; + if (!fs::stdfs::is_directory(status)) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not a directory: " + + path.u8string(), + expected_right_tag}; + if (!path.is_absolute()) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not absolute: " + + path.u8string(), + expected_right_tag}; + return ExpectedS(path); + } + p /= fs::u8path("vcpkg/archives"); + if (p.is_absolute()) + { + return {std::move(p), expected_left_tag}; + } + else + { + return {"default path was not absolute: " + p.u8string(), expected_right_tag}; + } + }); + if (cachepath.has_value()) + Debug::print("Default binary cache path is: ", cachepath.get()->u8string(), '\n'); + else + Debug::print("No binary cache path. Reason: ", cachepath.error(), '\n'); + return cachepath; + } + + struct State + { + bool m_cleared = false; + bool interactive = false; + + std::vector archives_to_read; + std::vector archives_to_write; + + std::vector sources_to_read; + std::vector sources_to_write; + + std::vector configs_to_read; + std::vector configs_to_write; + + void clear() + { + m_cleared = true; + interactive = false; + archives_to_read.clear(); + archives_to_write.clear(); + sources_to_read.clear(); + sources_to_write.clear(); + configs_to_read.clear(); + configs_to_write.clear(); + } + }; + + struct BinaryConfigParser : Parse::ParserBase + { + BinaryConfigParser(StringView text, StringView origin, State* state) + : Parse::ParserBase(text, origin), state(state) + { + } + + State* state; + + void parse() + { + while (!at_eof()) + { + std::vector> segments; + + for (;;) + { + SourceLoc loc = cur_loc(); + std::string segment; + for (;;) + { + auto n = match_until([](char32_t ch) { return ch == ',' || ch == '`' || ch == ';'; }); + Strings::append(segment, n); + auto ch = cur(); + if (ch == Unicode::end_of_file || ch == ',' || ch == ';') + break; + else if (ch == '`') + { + ch = next(); + if (ch == Unicode::end_of_file) + add_error("unexpected eof: trailing unescaped backticks (`) are not allowed"); + else + Unicode::utf8_append_code_point(segment, ch); + next(); + } + else + Checks::unreachable(VCPKG_LINE_INFO); + } + segments.emplace_back(std::move(loc), std::move(segment)); + + auto ch = cur(); + if (ch == Unicode::end_of_file || ch == ';') + break; + else if (ch == ',') + { + next(); + continue; + } + else + Checks::unreachable(VCPKG_LINE_INFO); + } + + if (segments.size() != 1 || !segments[0].second.empty()) handle_segments(std::move(segments)); + segments.clear(); + if (get_error()) return; + if (cur() == ';') next(); + } + } + + template + void handle_readwrite(std::vector& read, + std::vector& write, + T&& t, + const std::vector>& segments, + size_t segment_idx) + { + if (segment_idx >= segments.size()) + { + read.push_back(std::move(t)); + return; + } + + auto& mode = segments[segment_idx].second; + + if (mode == "read") + { + read.push_back(std::move(t)); + } + else if (mode == "write") + { + write.push_back(std::move(t)); + } + else if (mode == "readwrite") + { + read.push_back(t); + write.push_back(std::move(t)); + } + else + { + return add_error("unexpected argument: expected 'read', readwrite', or 'write'", + segments[segment_idx].first); + } + } + + void handle_segments(std::vector>&& segments) + { + if (segments.empty()) return; + if (segments[0].second == "clear") + { + if (segments.size() != 1) + return add_error("unexpected arguments: binary config 'clear' does not take arguments", + segments[1].first); + state->clear(); + } + else if (segments[0].second == "files") + { + if (segments.size() < 2) + { + return add_error("expected arguments: binary config 'files' requires at least a path argument", + segments[0].first); + } + + auto p = fs::u8path(segments[1].second); + if (!p.is_absolute()) + { + return add_error("expected arguments: path arguments for binary config strings must be absolute", + segments[1].first); + } + handle_readwrite(state->archives_to_read, state->archives_to_write, std::move(p), segments, 2); + if (segments.size() > 3) + return add_error("unexpected arguments: binary config 'files' requires 1 or 2 arguments", + segments[3].first); + } + else if (segments[0].second == "interactive") + { + if (segments.size() > 1) + return add_error("unexpected arguments: binary config 'interactive' does not accept any arguments", + segments[1].first); + state->interactive = true; + } + else if (segments[0].second == "nugetconfig") + { + if (segments.size() < 2) + return add_error( + "expected arguments: binary config 'nugetconfig' requires at least a source argument", + segments[0].first); + + auto p = fs::u8path(segments[1].second); + if (!p.is_absolute()) + return add_error("expected arguments: path arguments for binary config strings must be absolute", + segments[1].first); + handle_readwrite(state->configs_to_read, state->configs_to_write, std::move(p), segments, 2); + if (segments.size() > 3) + return add_error("unexpected arguments: binary config 'nugetconfig' requires 1 or 2 arguments", + segments[3].first); + } + else if (segments[0].second == "nuget") + { + if (segments.size() < 2) + return add_error("expected arguments: binary config 'nuget' requires at least a source argument", + segments[0].first); + + auto&& p = segments[1].second; + if (p.empty()) + return add_error("unexpected arguments: binary config 'nuget' requires non-empty source"); + + handle_readwrite(state->sources_to_read, state->sources_to_write, std::move(p), segments, 2); + if (segments.size() > 3) + return add_error("unexpected arguments: binary config 'nuget' requires 1 or 2 arguments", + segments[3].first); + } + else if (segments[0].second == "default") + { + if (segments.size() > 2) + { + return add_error("unexpected arguments: binary config 'default' does not take more than 1 argument", + segments[0].first); + } + + const auto& maybe_home = default_cache_path(); + if (!maybe_home.has_value()) return add_error(maybe_home.error(), segments[0].first); + + handle_readwrite( + state->archives_to_read, state->archives_to_write, fs::path(*maybe_home.get()), segments, 1); + } + else + { + return add_error( + "unknown binary provider type: valid providers are 'clear', 'default', 'nuget', 'nugetconfig', " + "'interactive', and 'files'", + segments[0].first); + } + } + }; +} + +ExpectedS> vcpkg::create_binary_provider_from_configs_pure( + const std::string& env_string, View args) +{ + State s; + + BinaryConfigParser default_parser("default,readwrite", "", &s); + default_parser.parse(); + + BinaryConfigParser env_parser(env_string, "VCPKG_BINARY_SOURCES", &s); + env_parser.parse(); + if (auto err = env_parser.get_error()) return err->format(); + for (auto&& arg : args) + { + BinaryConfigParser arg_parser(arg, "", &s); + arg_parser.parse(); + if (auto err = arg_parser.get_error()) return err->format(); + } + + std::vector> providers; + if (!s.archives_to_read.empty() || !s.archives_to_write.empty()) + providers.push_back( + std::make_unique(std::move(s.archives_to_read), std::move(s.archives_to_write))); + if (!s.sources_to_read.empty() || !s.sources_to_write.empty() || !s.configs_to_read.empty() || + !s.configs_to_write.empty()) + providers.push_back(std::make_unique(std::move(s.sources_to_read), + std::move(s.sources_to_write), + std::move(s.configs_to_read), + std::move(s.configs_to_write), + s.interactive)); + + return {std::make_unique(std::move(providers))}; +} + +std::string vcpkg::reformat_version(const std::string& version, const std::string& abi_tag) +{ + static const std::regex semver_matcher(R"(v?(\d+)(\.\d+|$)(\.\d+)?.*)"); + + std::smatch sm; + if (std::regex_match(version.cbegin(), version.cend(), sm, semver_matcher)) + { + auto major = trim_leading_zeroes(sm.str(1)); + auto minor = sm.size() > 2 && !sm.str(2).empty() ? trim_leading_zeroes(sm.str(2).substr(1)) : "0"; + auto patch = sm.size() > 3 && !sm.str(3).empty() ? trim_leading_zeroes(sm.str(3).substr(1)) : "0"; + return Strings::concat(major, '.', minor, '.', patch, "-", abi_tag); + } + + static const std::regex date_matcher(R"((\d\d\d\d)-(\d\d)-(\d\d).*)"); + if (std::regex_match(version.cbegin(), version.cend(), sm, date_matcher)) + { + return Strings::concat(trim_leading_zeroes(sm.str(1)), + '.', + trim_leading_zeroes(sm.str(2)), + '.', + trim_leading_zeroes(sm.str(3)), + "-", + abi_tag); + } + + return Strings::concat("0.0.0-", abi_tag); +} + +std::string vcpkg::generate_nuspec(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + const vcpkg::NugetReference& ref) +{ + auto& spec = action.spec; + auto& scf = *action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO).source_control_file; + auto& version = scf.core_paragraph->version; + std::string description = + Strings::concat("NOT FOR DIRECT USE. Automatically generated cache package.\n\n", + Strings::join("\n ", scf.core_paragraph->description), + "\n\nVersion: ", + version, + "\nTriplet/Compiler hash: ", + action.abi_info.value_or_exit(VCPKG_LINE_INFO).triplet_abi.value_or_exit(VCPKG_LINE_INFO), + "\nFeatures:", + Strings::join(",", action.feature_list, [](const std::string& s) { return " " + s; }), + "\nDependencies:\n"); + + for (auto&& dep : action.package_dependencies) + { + Strings::append(description, " ", dep.name(), '\n'); + } + XmlSerializer xml; + xml.open_tag("package").line_break(); + xml.open_tag("metadata").line_break(); + xml.simple_tag("id", ref.id).line_break(); + xml.simple_tag("version", ref.version).line_break(); + if (!scf.core_paragraph->homepage.empty()) xml.simple_tag("projectUrl", scf.core_paragraph->homepage); + xml.simple_tag("authors", "vcpkg").line_break(); + xml.simple_tag("description", description).line_break(); + 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(); + 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("target", "") + .finish_self_closing_complex_tag(); + xml.close_tag("files").line_break(); + xml.close_tag("package").line_break(); + return std::move(xml.buf); +} + +void vcpkg::help_topic_binary_caching(const VcpkgPaths&) +{ + HelpTableFormatter tbl; + tbl.text("Vcpkg can cache compiled packages to accelerate restoration on a single machine or across the network." + " This functionality is currently enabled by default and can be disabled by either passing " + "`--no-binarycaching` to every vcpkg command line or setting the environment variable " + "`VCPKG_FEATURE_FLAGS` to `-binarycaching`."); + tbl.blank(); + tbl.blank(); + tbl.text( + "Once caching is enabled, it can be further configured by either passing `--binarysource=` options " + "to every command line or setting the `VCPKG_BINARY_SOURCES` environment variable to a set of sources (Ex: " + "\";;...\"). Command line sources are interpreted after environment sources."); + tbl.blank(); + tbl.blank(); + tbl.header("Valid source strings"); + tbl.format("clear", "Removes all previous sources"); + tbl.format("default[,]", "Adds the default file-based location."); + tbl.format("files,[,]", "Adds a custom file-based location."); + tbl.format("nuget,[,]", + "Adds a NuGet-based source; equivalent to the `-Source` parameter of the NuGet CLI."); + tbl.format("nugetconfig,[,]", + "Adds a NuGet-config-file-based source; equivalent to the `-Config` parameter of the NuGet CLI. This " + "config should specify `defaultPushSource` for uploads."); + tbl.format("interactive", "Enables interactive credential management for some source types"); + tbl.blank(); + tbl.text("The `` optional parameter for certain strings controls whether they will be consulted for " + "downloading binaries and whether on-demand builds will be uploaded to that remote. It can be specified " + "as 'read', 'write', or 'readwrite'."); + tbl.blank(); + System::print2(tbl.m_str); + const auto& maybe_cachepath = default_cache_path(); + if (auto p = maybe_cachepath.get()) + { + auto p_preferred = *p; + System::print2( + "\nBased on your system settings, the default path to store binaries is\n ", + p_preferred.make_preferred().u8string(), + "\n\nThis consults %LOCALAPPDATA%/%APPDATA% on Windows and $XDG_CACHE_HOME or $HOME on other platforms."); + } +} + +std::string vcpkg::generate_nuget_packages_config(const Dependencies::ActionPlan& action) +{ + auto refs = Util::fmap(action.install_actions, + [&](const Dependencies::InstallPlanAction& ipa) { return NugetReference(ipa); }); + XmlSerializer xml; + xml.emit_declaration().line_break(); + xml.open_tag("packages").line_break(); + for (auto&& ref : refs) + { + xml.start_complex_open_tag("package") + .text_attr("id", ref.id) + .text_attr("version", ref.version) + .finish_self_closing_complex_tag() + .line_break(); + } + xml.close_tag("packages").line_break(); + return std::move(xml.buf); +} diff --git a/toolsrc/src/vcpkg/binaryparagraph.cpp b/toolsrc/src/vcpkg/binaryparagraph.cpp index f142c307d22e28..0b0819fd718f3e 100644 --- a/toolsrc/src/vcpkg/binaryparagraph.cpp +++ b/toolsrc/src/vcpkg/binaryparagraph.cpp @@ -6,6 +6,7 @@ #include #include +#include namespace vcpkg { @@ -13,6 +14,7 @@ namespace vcpkg { static const std::string PACKAGE = "Package"; static const std::string VERSION = "Version"; + static const std::string PORT_VERSION = "Port-Version"; static const std::string ARCHITECTURE = "Architecture"; static const std::string MULTI_ARCH = "Multi-Arch"; } @@ -24,7 +26,7 @@ namespace vcpkg static const std::string DESCRIPTION = "Description"; static const std::string MAINTAINER = "Maintainer"; static const std::string DEPENDS = "Depends"; - static const std::string DEFAULTFEATURES = "Default-Features"; + static const std::string DEFAULT_FEATURES = "Default-Features"; static const std::string TYPE = "Type"; } @@ -48,23 +50,46 @@ namespace vcpkg this->version = parser.optional_field(Fields::VERSION); this->feature = parser.optional_field(Fields::FEATURE); - this->description = parser.optional_field(Fields::DESCRIPTION); - this->maintainer = parser.optional_field(Fields::MAINTAINER); + auto pv_str = parser.optional_field(Fields::PORT_VERSION); + this->port_version = 0; + if (!pv_str.empty()) + { + auto pv_opt = Strings::strto(pv_str); + if (auto pv = pv_opt.get()) + { + this->port_version = *pv; + } + else + { + parser.add_type_error(Fields::PORT_VERSION, "a non-negative integer"); + } + } + + this->description = Strings::split(parser.optional_field(Fields::DESCRIPTION), '\n'); + for (auto& desc : this->description) + { + desc = Strings::trim(std::move(desc)); + } + this->maintainers = Strings::split(parser.optional_field(Fields::MAINTAINER), '\n'); + for (auto& maintainer : this->maintainers) + { + maintainer = Strings::trim(std::move(maintainer)); + } this->abi = parser.optional_field(Fields::ABI); std::string multi_arch; parser.required_field(Fields::MULTI_ARCH, multi_arch); - this->depends = Util::fmap( + this->dependencies = Util::fmap( parse_qualified_specifier_list(parser.optional_field(Fields::DEPENDS)).value_or_exit(VCPKG_LINE_INFO), [](const ParsedQualifiedSpecifier& dep) { // for compatibility with previous vcpkg versions, we discard all irrelevant information return dep.name; }); - if (this->feature.empty()) + if (!this->is_feature()) { - this->default_features = parse_default_features_list(parser.optional_field(Fields::DEFAULTFEATURES)) + this->default_features = parse_default_features_list(parser.optional_field(Fields::DEFAULT_FEATURES)) .value_or_exit(VCPKG_LINE_INFO); } @@ -85,31 +110,43 @@ namespace vcpkg Triplet triplet, const std::string& abi_tag, const std::vector& deps) - : version(spgh.version) + : spec(spgh.name, triplet) + , version(spgh.version) + , port_version(spgh.port_version) , description(spgh.description) - , maintainer(spgh.maintainer) + , maintainers(spgh.maintainers) + , feature() + , default_features(spgh.default_features) + , dependencies() , abi(abi_tag) , type(spgh.type) { - this->spec = PackageSpec(spgh.name, triplet); - this->depends = Util::fmap(deps, [](const FeatureSpec& spec) { return spec.spec().name(); }); - Util::sort_unique_erase(this->depends); + this->dependencies = Util::fmap(deps, [](const FeatureSpec& spec) { return spec.spec().name(); }); + Util::sort_unique_erase(this->dependencies); } BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh, const FeatureParagraph& fpgh, Triplet triplet, const std ::vector& deps) - : version(), description(fpgh.description), maintainer(), feature(fpgh.name), type(spgh.type) + : spec(spgh.name, triplet) + , version() + , port_version() + , description(fpgh.description) + , maintainers() + , feature(fpgh.name) + , default_features() + , dependencies() + , abi() + , type(spgh.type) { - this->spec = PackageSpec(spgh.name, triplet); - this->depends = Util::fmap(deps, [](const FeatureSpec& spec) { return spec.spec().name(); }); - Util::sort_unique_erase(this->depends); + this->dependencies = Util::fmap(deps, [](const FeatureSpec& spec) { return spec.spec().name(); }); + Util::sort_unique_erase(this->dependencies); } std::string BinaryParagraph::displayname() const { - if (this->feature.empty() || this->feature == "core") + if (!this->is_feature() || this->feature == "core") return Strings::format("%s:%s", this->spec.name(), this->spec.triplet()); return Strings::format("%s[%s]:%s", this->spec.name(), this->feature, this->spec.triplet()); } @@ -121,27 +158,157 @@ namespace vcpkg return Strings::format("%s_%s_%s", this->spec.name(), this->version, this->spec.triplet()); } + bool operator==(const BinaryParagraph& lhs, const BinaryParagraph& rhs) + { + if (lhs.spec != rhs.spec) return false; + if (lhs.version != rhs.version) return false; + if (lhs.port_version != rhs.port_version) return false; + if (lhs.description != rhs.description) return false; + if (lhs.maintainers != rhs.maintainers) return false; + if (lhs.feature != rhs.feature) return false; + if (lhs.default_features != rhs.default_features) return false; + if (lhs.dependencies != rhs.dependencies) return false; + if (lhs.abi != rhs.abi) return false; + if (lhs.type != rhs.type) return false; + + return true; + } + + bool operator!=(const BinaryParagraph& lhs, const BinaryParagraph& rhs) { return !(lhs == rhs); } + + static void serialize_string(StringView name, const std::string& field, std::string& out_str) + { + if (field.empty()) + { + return; + } + + out_str.append(name.begin(), name.end()).append(": ").append(field).push_back('\n'); + } + static void serialize_array(StringView name, + const std::vector& array, + std::string& out_str, + const char* joiner = ", ") + { + if (array.empty()) + { + return; + } + + out_str.append(name.begin(), name.end()).append(": "); + out_str.append(Strings::join(joiner, array)); + out_str.push_back('\n'); + } + static void serialize_paragraph(StringView name, const std::vector& array, std::string& out_str) + { + serialize_array(name, array, out_str, "\n "); + } + void serialize(const BinaryParagraph& pgh, std::string& out_str) { - out_str.append("Package: ").append(pgh.spec.name()).push_back('\n'); - if (!pgh.version.empty()) - out_str.append("Version: ").append(pgh.version).push_back('\n'); - else if (!pgh.feature.empty()) - out_str.append("Feature: ").append(pgh.feature).push_back('\n'); - if (!pgh.depends.empty()) + const size_t initial_end = out_str.size(); + + serialize_string(Fields::PACKAGE, pgh.spec.name(), out_str); + + serialize_string(Fields::VERSION, pgh.version, out_str); + if (pgh.port_version != 0) + { + out_str.append(Fields::PORT_VERSION).append(": ").append(std::to_string(pgh.port_version)).push_back('\n'); + } + + if (pgh.is_feature()) + { + serialize_string(Fields::FEATURE, pgh.feature, out_str); + } + + if (!pgh.dependencies.empty()) { - out_str.append("Depends: "); - out_str.append(Strings::join(", ", pgh.depends)); - out_str.push_back('\n'); + serialize_array(Fields::DEPENDS, pgh.dependencies, out_str); } - out_str.append("Architecture: ").append(pgh.spec.triplet().to_string()).push_back('\n'); - out_str.append("Multi-Arch: same\n"); + serialize_string(Fields::ARCHITECTURE, pgh.spec.triplet().to_string(), out_str); + serialize_string(Fields::MULTI_ARCH, "same", out_str); - if (!pgh.maintainer.empty()) out_str.append("Maintainer: ").append(pgh.maintainer).push_back('\n'); - if (!pgh.abi.empty()) out_str.append("Abi: ").append(pgh.abi).push_back('\n'); - if (!pgh.description.empty()) out_str.append("Description: ").append(pgh.description).push_back('\n'); + serialize_paragraph(Fields::MAINTAINER, pgh.maintainers, out_str); - out_str.append("Type: ").append(Type::to_string(pgh.type)).push_back('\n'); + serialize_string(Fields::ABI, pgh.abi, out_str); + + serialize_paragraph(Fields::DESCRIPTION, pgh.description, out_str); + + serialize_string(Fields::TYPE, Type::to_string(pgh.type), out_str); + serialize_array(Fields::DEFAULT_FEATURES, pgh.default_features, out_str); + + // sanity check the serialized data + const auto my_paragraph = out_str.substr(initial_end); + auto parsed_paragraph = Paragraphs::parse_single_paragraph( + out_str.substr(initial_end), "vcpkg::serialize(const BinaryParagraph&, std::string&)"); + if (!parsed_paragraph.has_value()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + R"([sanity check] Failed to parse a serialized binary paragraph. +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: + Error: %s + +=== Serialized BinaryParagraph === +%s + )", + parsed_paragraph.error(), + my_paragraph); + } + + auto binary_paragraph = BinaryParagraph(*parsed_paragraph.get()); + if (binary_paragraph != pgh) + { + const auto& join_str = R"(", ")"; + Checks::exit_with_message( + VCPKG_LINE_INFO, + R"([sanity check] The serialized binary paragraph was different from the original binary paragraph. +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: + +=== Original BinaryParagraph === +spec: "%s" +version: "%s" +port_version: %d +description: ["%s"] +maintainers: ["%s"] +feature: "%s" +default_features: ["%s"] +dependencies: ["%s"] +abi: "%s" +type: %s + +=== Serialized BinaryParagraph === +spec: "%s" +version: "%s" +port_version: %d +description: ["%s"] +maintainers: ["%s"] +feature: "%s" +default_features: ["%s"] +dependencies: ["%s"] +abi: "%s" +type: %s +)", + pgh.spec.to_string(), + pgh.version, + pgh.port_version, + Strings::join(join_str, pgh.description), + Strings::join(join_str, pgh.maintainers), + pgh.feature, + Strings::join(join_str, pgh.default_features), + Strings::join(join_str, pgh.dependencies), + pgh.abi, + Type::to_string(pgh.type), + binary_paragraph.spec.to_string(), + binary_paragraph.version, + binary_paragraph.port_version, + Strings::join(join_str, binary_paragraph.description), + Strings::join(join_str, binary_paragraph.maintainers), + binary_paragraph.feature, + Strings::join(join_str, binary_paragraph.default_features), + Strings::join(join_str, binary_paragraph.dependencies), + binary_paragraph.abi, + Type::to_string(binary_paragraph.type)); + } } } diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index fe17c490af4b8c..cfba94b9f65772 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1,1093 +1,1275 @@ -#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 - -using namespace vcpkg; -using vcpkg::Build::BuildResult; -using vcpkg::Parse::ParseControlErrorInfo; -using vcpkg::Parse::ParseExpected; -using vcpkg::PortFileProvider::PathsPortFileProvider; - -namespace vcpkg::Build::Command -{ - using Dependencies::InstallPlanAction; - using Dependencies::InstallPlanType; - - void perform_and_exit_ex(const FullPackageSpec& full_spec, - const SourceControlFileLocation& scfl, - const PathsPortFileProvider& provider, - const VcpkgPaths& paths) - { - 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_tag_vars(std::array{full_spec}, provider); - - StatusParagraphs status_db = database_load_check(paths); - - auto action_plan = Dependencies::create_feature_install_plan( - provider, var_provider, std::vector{full_spec}, status_db); - - const PackageSpec& spec = full_spec.package_spec; - const SourceControlFile& scf = *scfl.source_control_file; - - Checks::check_exit(VCPKG_LINE_INFO, - spec.name() == scf.core_paragraph->name, - "The Source field inside the CONTROL file does not match the port directory: '%s' != '%s'", - scf.core_paragraph->name, - spec.name()); - - const Build::BuildPackageOptions build_package_options{ - Build::UseHeadVersion::NO, - Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, - Build::CleanBuildtrees::NO, - Build::CleanPackages::NO, - Build::CleanDownloads::NO, - Build::DownloadTool::BUILT_IN, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, - Build::FailOnTombstone::NO, - }; - - InstallPlanAction* action = nullptr; - for (auto& install_action : action_plan.already_installed) - { - if (install_action.spec == full_spec.package_spec) - { - action = &install_action; - } - } - for (auto& install_action : action_plan.install_actions) - { - if (install_action.spec == full_spec.package_spec) - { - action = &install_action; - } - } - - Checks::check_exit(VCPKG_LINE_INFO, action != nullptr); - - action->build_options = build_package_options; - - const auto build_timer = Chrono::ElapsedTimer::create_started(); - const auto result = Build::build_package(paths, *action, create_archives_provider().get(), status_db); - System::print2("Elapsed time for package ", spec, ": ", build_timer, '\n'); - - if (result.code == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) - { - System::print2(System::Color::error, - "The build command requires all dependencies to be already installed.\n"); - System::print2("The following dependencies are missing:\n\n"); - for (const auto& p : result.unmet_dependencies) - { - System::print2(" ", p, '\n'); - } - System::print2('\n'); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - Checks::check_exit(VCPKG_LINE_INFO, result.code != BuildResult::EXCLUDED); - - if (result.code != BuildResult::SUCCEEDED) - { - System::print2(System::Color::error, Build::create_error_message(result.code, spec), '\n'); - System::print2(Build::create_user_troubleshooting_message(spec), '\n'); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - Checks::exit_success(VCPKG_LINE_INFO); - } - - const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("build zlib:x64-windows"), - 1, - 1, - {{}, {}}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) - { - // Build only takes a single package and all dependencies must already be installed - const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); - std::string first_arg = args.command_arguments.at(0); - - const FullPackageSpec spec = Input::check_and_get_full_package_spec( - std::move(first_arg), default_triplet, COMMAND_STRUCTURE.example_text); - - Input::check_triplet(spec.package_spec.triplet(), paths); - - PathsPortFileProvider provider(paths, args.overlay_ports.get()); - const auto port_name = spec.package_spec.name(); - const auto* scfl = provider.get_control_file(port_name).get(); - - Checks::check_exit(VCPKG_LINE_INFO, scfl != nullptr, "Error: Couldn't find port '%s'", port_name); - - perform_and_exit_ex(spec, *scfl, provider, paths); - } -} - -namespace vcpkg::Build -{ - static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; - static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; - static const std::string NAME_DLLS_WITHOUT_EXPORTS = "PolicyDLLsWithoutExports"; - static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT"; - static const std::string NAME_EMPTY_INCLUDE_FOLDER = "PolicyEmptyIncludeFolder"; - static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt"; - static const std::string NAME_ALLOW_RESTRICTED_HEADERS = "PolicyAllowRestrictedHeaders"; - static const std::string NAME_SKIP_DUMPBIN_CHECKS = "PolicySkipDumpbinChecks"; - static const std::string NAME_SKIP_ARCHITECTURE_CHECK = "PolicySkipArchitectureCheck"; - - const std::string& to_string(BuildPolicy policy) - { - switch (policy) - { - case BuildPolicy::EMPTY_PACKAGE: return NAME_EMPTY_PACKAGE; - case BuildPolicy::DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; - case BuildPolicy::DLLS_WITHOUT_EXPORTS: return NAME_DLLS_WITHOUT_EXPORTS; - case BuildPolicy::ONLY_RELEASE_CRT: return NAME_ONLY_RELEASE_CRT; - case BuildPolicy::EMPTY_INCLUDE_FOLDER: return NAME_EMPTY_INCLUDE_FOLDER; - case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT; - case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return NAME_ALLOW_RESTRICTED_HEADERS; - case BuildPolicy::SKIP_DUMPBIN_CHECKS: return NAME_SKIP_DUMPBIN_CHECKS; - case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return NAME_SKIP_ARCHITECTURE_CHECK; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - CStringView to_cmake_variable(BuildPolicy policy) - { - switch (policy) - { - case BuildPolicy::EMPTY_PACKAGE: return "VCPKG_POLICY_EMPTY_PACKAGE"; - case BuildPolicy::DLLS_WITHOUT_LIBS: return "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; - case BuildPolicy::DLLS_WITHOUT_EXPORTS: return "VCPKG_POLICY_DLLS_WITHOUT_EXPORTS"; - case BuildPolicy::ONLY_RELEASE_CRT: return "VCPKG_POLICY_ONLY_RELEASE_CRT"; - case BuildPolicy::EMPTY_INCLUDE_FOLDER: return "VCPKG_POLICY_EMPTY_INCLUDE_FOLDER"; - case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT"; - case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return "VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS"; - case BuildPolicy::SKIP_DUMPBIN_CHECKS: return "VCPKG_POLICY_SKIP_DUMPBIN_CHECKS"; - case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return "VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK"; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - static const std::string NAME_BUILD_IN_DOWNLOAD = "BUILT_IN"; - static const std::string NAME_ARIA2_DOWNLOAD = "ARIA2"; - - const std::string& to_string(DownloadTool tool) - { - switch (tool) - { - case DownloadTool::BUILT_IN: return NAME_BUILD_IN_DOWNLOAD; - case DownloadTool::ARIA2: return NAME_ARIA2_DOWNLOAD; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - Optional to_linkage_type(const std::string& str) - { - if (str == "dynamic") return LinkageType::DYNAMIC; - if (str == "static") return LinkageType::STATIC; - return nullopt; - } - - namespace BuildInfoRequiredField - { - static const std::string CRT_LINKAGE = "CRTLinkage"; - static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; - } - - static CStringView to_vcvarsall_target(const std::string& cmake_system_name) - { - if (cmake_system_name.empty()) return ""; - if (cmake_system_name == "Windows") return ""; - if (cmake_system_name == "WindowsStore") return "store"; - - Checks::exit_with_message(VCPKG_LINE_INFO, "Unsupported vcvarsall target %s", cmake_system_name); - } - - static CStringView to_vcvarsall_toolchain(const std::string& target_architecture, const Toolset& toolset) - { - auto maybe_target_arch = System::to_cpu_architecture(target_architecture); - Checks::check_exit( - VCPKG_LINE_INFO, maybe_target_arch.has_value(), "Invalid architecture string: %s", target_architecture); - auto target_arch = maybe_target_arch.value_or_exit(VCPKG_LINE_INFO); - auto host_architectures = System::get_supported_host_architectures(); - - for (auto&& host : host_architectures) - { - const auto it = Util::find_if(toolset.supported_architectures, [&](const ToolsetArchOption& opt) { - return host == opt.host_arch && target_arch == opt.target_arch; - }); - if (it != toolset.supported_architectures.end()) return it->name; - } - - Checks::exit_with_message(VCPKG_LINE_INFO, - "Unsupported toolchain combination. Target was: %s but supported ones were:\n%s", - target_architecture, - Strings::join(",", toolset.supported_architectures, [](const ToolsetArchOption& t) { - return t.name.c_str(); - })); - } - -#if defined(_WIN32) - static const std::unordered_map& make_env_passthrough(const PreBuildInfo& pre_build_info) - { - static Cache, std::unordered_map> envs; - return envs.get_lazy(pre_build_info.passthrough_env_vars, [&]() { - std::unordered_map env; - - for (auto&& env_var : pre_build_info.passthrough_env_vars) - { - auto env_val = System::get_environment_variable(env_var); - - if (env_val) - { - env[env_var] = env_val.value_or_exit(VCPKG_LINE_INFO); - } - } - - return env; - }); - } -#endif - - std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset) - { - if (pre_build_info.external_toolchain_file.has_value() && !pre_build_info.load_vcvars_env) return ""; - if (!pre_build_info.cmake_system_name.empty() && pre_build_info.cmake_system_name != "WindowsStore") return ""; - - const char* tonull = " >nul"; - if (Debug::g_debugging) - { - tonull = ""; - } - - const auto arch = to_vcvarsall_toolchain(pre_build_info.target_architecture, toolset); - 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 create_binary_control_file( - const SourceParagraph& source_paragraph, - Triplet triplet, - const BuildInfo& build_info, - const std::string& abi_tag, - const std::vector& core_dependencies) - { - auto bcf = std::make_unique(); - BinaryParagraph bpgh(source_paragraph, triplet, abi_tag, core_dependencies); - if (const auto p_ver = build_info.version.get()) - { - bpgh.version = *p_ver; - } - - bcf->core_paragraph = std::move(bpgh); - return bcf; - } - - static void write_binary_control_file(const VcpkgPaths& paths, const BinaryControlFile& bcf) - { - std::string start = Strings::serialize(bcf.core_paragraph); - for (auto&& feature : bcf.features) - { - start += "\n" + Strings::serialize(feature); - } - const fs::path binary_control_file = paths.packages / bcf.core_paragraph.dir() / "CONTROL"; - paths.get_filesystem().write_contents(binary_control_file, start, VCPKG_LINE_INFO); - } - - static int get_concurrency() - { - static int concurrency = [] { - auto user_defined_concurrency = System::get_environment_variable("VCPKG_MAX_CONCURRENCY"); - if (user_defined_concurrency) - { - return std::stoi(user_defined_concurrency.value_or_exit(VCPKG_LINE_INFO)); - } - else - { - return System::get_num_logical_cores() + 1; - } - }(); - - return concurrency; - } - - static std::vector get_cmake_vars(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - Triplet triplet, - const Toolset& toolset) - { -#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)); -#endif - auto& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); - auto& scf = *scfl.source_control_file; - const fs::path& git_exe_path = paths.get_tool_exe(Tools::GIT); - - std::string all_features; - for (auto& feature : scf.feature_paragraphs) - { - all_features.append(feature->name + ";"); - } - - std::vector variables{ - {"CMD", "BUILD"}, - {"PORT", scf.core_paragraph->name}, - {"CURRENT_PORT_DIR", scfl.source_location}, - {"VCPKG_ROOT_PATH", paths.root}, - {"TARGET_TRIPLET", triplet.canonical_name()}, - {"TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()}, - {"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()}, - {"VCPKG_USE_HEAD_VERSION", Util::Enum::to_bool(action.build_options.use_head_version) ? "1" : "0"}, - {"DOWNLOADS", paths.downloads}, - {"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(action.build_options.allow_downloads) ? "1" : "0"}, - {"_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)}, - {"FEATURES", Strings::join(";", action.feature_list)}, - {"ALL_FEATURES", all_features}, - {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, - }; - - if (Util::Enum::to_bool(action.build_options.only_downloads)) - { - variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); - } - - if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) - { - variables.push_back({"GIT", git_exe_path}); - } - - const Files::Filesystem& fs = paths.get_filesystem(); - - std::vector port_configs; - for (const PackageSpec& dependency : action.package_dependencies) - { - const fs::path port_config_path = paths.installed / dependency.triplet().canonical_name() / "share" / - dependency.name() / "vcpkg-port-config.cmake"; - - if (fs.is_regular_file(port_config_path)) - { - port_configs.emplace_back(port_config_path.u8string()); - } - } - - if (!port_configs.empty()) - { - variables.emplace_back("VCPKG_PORT_CONFIGS", Strings::join(";", port_configs)); - } - - return variables; - } - - static std::string get_triplet_abi(const VcpkgPaths& paths, const PreBuildInfo& pre_build_info, Triplet triplet) - { - static std::map s_hash_cache; - - const fs::path triplet_file_path = paths.get_triplet_file_path(triplet); - const auto& fs = paths.get_filesystem(); - - std::string hash; - - auto it_hash = s_hash_cache.find(triplet_file_path); - if (it_hash != s_hash_cache.end()) - { - hash = it_hash->second; - } - else - { - const auto algo = Hash::Algorithm::Sha1; - // TODO: Use file path as part of hash. - // REASON: Copying a triplet file without modifying it produces the same hash as the original. - hash = Hash::get_file_hash(VCPKG_LINE_INFO, fs, triplet_file_path, algo); - - if (auto p = pre_build_info.external_toolchain_file.get()) - { - hash += "-"; - hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, *p, algo); - } - else if (pre_build_info.cmake_system_name == "Linux") - { - hash += "-"; - hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "linux.cmake", algo); - } - else if (pre_build_info.cmake_system_name == "Darwin") - { - hash += "-"; - hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "osx.cmake", algo); - } - else if (pre_build_info.cmake_system_name == "FreeBSD") - { - hash += "-"; - hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "freebsd.cmake", algo); - } - else if (pre_build_info.cmake_system_name == "Android") - { - hash += "-"; - hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "android.cmake", algo); - } - - s_hash_cache.emplace(triplet_file_path, hash); - } - - return hash; - } - - static ExtendedBuildResult do_build_package(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) - { - const auto& pre_build_info = *action.pre_build_info.value_or_exit(VCPKG_LINE_INFO).get(); - - auto& fs = paths.get_filesystem(); - auto&& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); - -#if defined(_WIN32) - const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core"); - if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe")) - { - fs.copy(powershell_exe_path, powershell_exe_path.parent_path() / "powershell.exe", fs::copy_options::none); - } -#endif - - Triplet triplet = action.spec.triplet(); - const auto& triplet_file_path = paths.get_triplet_file_path(triplet).u8string(); - - if (Strings::case_insensitive_ascii_starts_with(triplet_file_path, paths.community_triplets.u8string())) - { - 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())) - { - 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())) - { - System::printf("-- Installing port from location: %s\n", u8portdir); - } - - const auto timer = Chrono::ElapsedTimer::create_started(); - - auto command = - System::make_cmake_cmd(paths.get_tool_exe(Tools::CMAKE), - paths.ports_cmake, - get_cmake_vars(paths, action, triplet, paths.get_toolset(pre_build_info))); -#if defined(_WIN32) - std::string build_env_cmd = make_build_env_cmd(pre_build_info, paths.get_toolset(pre_build_info)); - - const std::unordered_map& base_env = make_env_passthrough(pre_build_info); - static Cache*, std::string>, System::Environment> - build_env_cache; - - const auto& env = build_env_cache.get_lazy({&base_env, build_env_cmd}, [&]() { - auto clean_env = - System::get_modified_clean_environment(base_env, powershell_exe_path.parent_path().u8string() + ";"); - if (build_env_cmd.empty()) - return clean_env; - else - return System::cmd_execute_modify_env(build_env_cmd, clean_env); - }); -#else - const auto& env = System::get_clean_environment(); -#endif - auto buildpath = paths.buildtrees / action.spec.name(); - if (!fs.exists(buildpath)) - { - std::error_code err; - fs.create_directory(buildpath, err); - Checks::check_exit(VCPKG_LINE_INFO, - !err.value(), - "Failed to create directory '%s', code: %d", - buildpath.u8string(), - 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()); - 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()); - }, - env); - out_file.close(); - - // With the exception of empty packages, builds in "Download Mode" always result in failure. - if (action.build_options.only_downloads == Build::OnlyDownloads::YES) - { - // TODO: Capture executed command output and evaluate whether the failure was intended. - // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status. - return BuildResult::DOWNLOADED; - } - - const auto buildtimeus = timer.microseconds(); - const auto spec_string = action.spec.to_string(); - - { - auto locked_metrics = Metrics::g_metrics.lock(); - - locked_metrics->track_buildtime(Hash::get_string_hash(spec_string, Hash::Algorithm::Sha256) + ":[" + - Strings::join(",", - action.feature_list, - [](const std::string& feature) { - return Hash::get_string_hash(feature, - Hash::Algorithm::Sha256); - }) + - "]", - buildtimeus); - if (return_code != 0) - { - locked_metrics->track_property("error", "build failed"); - locked_metrics->track_property("build_error", spec_string); - return BuildResult::BUILD_FAILED; - } - } - - const BuildInfo build_info = read_build_info(fs, paths.build_info_file_path(action.spec)); - const size_t error_count = - PostBuildLint::perform_all_checks(action.spec, paths, pre_build_info, build_info, scfl.source_location); - - auto find_itr = action.feature_dependencies.find("core"); - Checks::check_exit(VCPKG_LINE_INFO, find_itr != action.feature_dependencies.end()); - - std::unique_ptr bcf = create_binary_control_file(*scfl.source_control_file->core_paragraph, - triplet, - build_info, - action.public_abi(), - std::move(find_itr->second)); - - if (error_count != 0) - { - return BuildResult::POST_BUILD_CHECKS_FAILED; - } - for (auto&& feature : action.feature_list) - { - for (auto&& f_pgh : scfl.source_control_file->feature_paragraphs) - { - if (f_pgh->name == feature) - { - find_itr = action.feature_dependencies.find(feature); - Checks::check_exit(VCPKG_LINE_INFO, find_itr != action.feature_dependencies.end()); - - bcf->features.emplace_back( - *scfl.source_control_file->core_paragraph, *f_pgh, triplet, std::move(find_itr->second)); - } - } - } - - write_binary_control_file(paths, *bcf); - return {BuildResult::SUCCEEDED, std::move(bcf)}; - } - - static ExtendedBuildResult do_build_package_and_clean_buildtrees(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action) - { - auto result = do_build_package(paths, action); - - if (action.build_options.clean_buildtrees == CleanBuildtrees::YES) - { - auto& fs = paths.get_filesystem(); - const fs::path buildtrees_dir = paths.buildtrees / action.spec.name(); - auto buildtree_files = fs.get_files_non_recursive(buildtrees_dir); - for (auto&& file : buildtree_files) - { - if (fs.is_directory(file)) // Will only keep the logs - { - std::error_code ec; - fs::path failure_point; - fs.remove_all(file, ec, failure_point); - } - } - } - - return result; - } - - Optional compute_abi_tag(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - Span dependency_abis) - { - auto& fs = paths.get_filesystem(); - Triplet triplet = action.spec.triplet(); - const std::string& name = action.spec.name(); - const auto& pre_build_info = *action.pre_build_info.value_or_exit(VCPKG_LINE_INFO); - - std::vector abi_tag_entries(dependency_abis.begin(), dependency_abis.end()); - - // Sorted here as the order of dependency_abis is the only - // non-deterministically ordered set of AbiEntries - Util::sort(abi_tag_entries); - - // If there is an unusually large number of files in the port then - // something suspicious is going on. Rather than hash all of them - // just mark the port as no-hash - const int max_port_file_count = 100; - - // the order of recursive_directory_iterator is undefined so save the names to sort - auto&& port_dir = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO).source_location; - std::vector port_files; - for (auto& port_file : fs::stdfs::recursive_directory_iterator(port_dir)) - { - if (fs::is_regular_file(fs.status(VCPKG_LINE_INFO, port_file))) - { - port_files.emplace_back( - port_file.path().filename().u8string(), - vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, port_file, Hash::Algorithm::Sha1)); - - if (port_files.size() > max_port_file_count) - { - abi_tag_entries.emplace_back("no_hash_max_portfile", ""); - break; - } - } - } - - if (port_files.size() <= max_port_file_count) - { - Util::sort(port_files, [](const AbiEntry& l, const AbiEntry& r) { - return l.value < r.value || (l.value == r.value && l.key < r.key); - }); - - std::move(port_files.begin(), port_files.end(), std::back_inserter(abi_tag_entries)); - } - - abi_tag_entries.emplace_back("cmake", paths.get_tool_version(Tools::CMAKE)); - -#if defined(_WIN32) - abi_tag_entries.emplace_back("powershell", paths.get_tool_version("powershell-core")); -#endif - - abi_tag_entries.emplace_back( - "vcpkg_fixup_cmake_targets", - vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, - fs, - paths.scripts / "cmake" / "vcpkg_fixup_cmake_targets.cmake", - Hash::Algorithm::Sha1)); - - abi_tag_entries.emplace_back("post_build_checks", "2"); - abi_tag_entries.emplace_back("triplet", pre_build_info.triplet_abi_tag); - std::vector sorted_feature_list = action.feature_list; - Util::sort(sorted_feature_list); - abi_tag_entries.emplace_back("features", Strings::join(";", sorted_feature_list)); - - if (pre_build_info.public_abi_override) - { - abi_tag_entries.emplace_back( - "public_abi_override", - Hash::get_string_hash(pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO), - Hash::Algorithm::Sha1)); - } - - // No need to sort, the variables are stored in the same order they are written down in the abi-settings file - for (const auto& env_var : pre_build_info.passthrough_env_vars) - { - abi_tag_entries.emplace_back( - "ENV:" + env_var, - Hash::get_string_hash(System::get_environment_variable(env_var).value_or(""), Hash::Algorithm::Sha1)); - } - - if (action.build_options.use_head_version == UseHeadVersion::YES) abi_tag_entries.emplace_back("head", ""); - - const std::string full_abi_info = - Strings::join("", abi_tag_entries, [](const AbiEntry& p) { return p.key + " " + p.value + "\n"; }); - - if (Debug::g_debugging) - { - std::string message = "[DEBUG] \n"; - for (auto&& entry : abi_tag_entries) - { - Strings::append(message, "[DEBUG] ", entry.key, "|", entry.value, "\n"); - } - Strings::append(message, "[DEBUG] \n"); - System::print2(message); - } - - auto abi_tag_entries_missing = abi_tag_entries; - Util::erase_remove_if(abi_tag_entries_missing, [](const AbiEntry& p) { return !p.value.empty(); }); - - if (abi_tag_entries_missing.empty()) - { - std::error_code ec; - fs.create_directories(paths.buildtrees / name, ec); - const auto abi_file_path = paths.buildtrees / name / (triplet.canonical_name() + ".vcpkg_abi_info.txt"); - fs.write_contents(abi_file_path, full_abi_info, VCPKG_LINE_INFO); - - return AbiTagAndFile{Hash::get_file_hash(VCPKG_LINE_INFO, fs, abi_file_path, Hash::Algorithm::Sha1), - abi_file_path}; - } - - System::print2( - "Warning: abi keys are missing values:\n", - Strings::join("", abi_tag_entries_missing, [](const AbiEntry& e) { return " " + e.key + "\n"; }), - "\n"); - - return nullopt; - } - - void compute_all_abis(const VcpkgPaths& paths, - Dependencies::ActionPlan& action_plan, - const CMakeVars::CMakeVarProvider& var_provider, - const StatusParagraphs& status_db) - { - using Dependencies::InstallPlanAction; - for (auto it = action_plan.install_actions.begin(); it != action_plan.install_actions.end(); ++it) - { - auto& action = *it; - std::vector dependency_abis; - if (!Util::Enum::to_bool(action.build_options.only_downloads)) - { - for (auto&& pspec : action.package_dependencies) - { - if (pspec == action.spec) continue; - - auto pred = [&](const InstallPlanAction& ipa) { return ipa.spec == pspec; }; - auto it2 = std::find_if(action_plan.install_actions.begin(), it, pred); - if (it2 == it) - { - // Finally, look in current installed - auto status_it = status_db.find(pspec); - if (status_it == status_db.end()) - { - Checks::exit_with_message( - VCPKG_LINE_INFO, "Failed to find dependency abi for %s -> %s", action.spec, pspec); - } - else - { - dependency_abis.emplace_back(AbiEntry{pspec.name(), status_it->get()->package.abi}); - } - } - else - { - dependency_abis.emplace_back(AbiEntry{pspec.name(), it2->public_abi()}); - } - } - } - - action.pre_build_info = std::make_unique( - paths, action.spec.triplet(), var_provider.get_tag_vars(action.spec).value_or_exit(VCPKG_LINE_INFO)); - auto maybe_abi_tag_and_file = compute_abi_tag(paths, action, dependency_abis); - if (auto p = maybe_abi_tag_and_file.get()) - { - action.abi_tag_file = std::move(p->tag_file); - action.package_abi = std::move(p->tag); - } - else - { - action.package_abi = ""; - } - } - } - - ExtendedBuildResult build_package(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - IBinaryProvider* binaries_provider, - const StatusParagraphs& status_db) - { - auto binary_caching_enabled = binaries_provider && action.build_options.binary_caching == BinaryCaching::YES; - - auto& fs = paths.get_filesystem(); - auto& spec = action.spec; - const std::string& name = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO) - .source_control_file->core_paragraph->name; - - std::vector missing_fspecs; - for (const auto& kv : action.feature_dependencies) - { - for (const FeatureSpec& fspec : kv.second) - { - if (!(status_db.is_installed(fspec) || fspec.name() == name)) - { - missing_fspecs.emplace_back(fspec); - } - } - } - - if (!missing_fspecs.empty()) - { - return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(missing_fspecs)}; - } - - std::vector dependency_abis; - for (auto&& pspec : action.package_dependencies) - { - if (pspec == spec || Util::Enum::to_bool(action.build_options.only_downloads)) - { - continue; - } - const auto status_it = status_db.find_installed(pspec); - Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); - dependency_abis.emplace_back( - AbiEntry{status_it->get()->package.spec.name(), status_it->get()->package.abi}); - } - - if (!action.abi_tag_file) - { - return do_build_package_and_clean_buildtrees(paths, action); - } - - auto& abi_file = *action.abi_tag_file.get(); - - 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 (binary_caching_enabled) - { - auto restore = binaries_provider->try_restore(paths, action); - if (restore == RestoreResult::build_failed) - return BuildResult::BUILD_FAILED; - else if (restore == RestoreResult::success) - { - auto maybe_bcf = Paragraphs::try_load_cached_package(paths, spec); - auto bcf = std::make_unique(std::move(maybe_bcf).value_or_exit(VCPKG_LINE_INFO)); - return {BuildResult::SUCCEEDED, std::move(bcf)}; - } - else - { - // missing package, proceed to build. - } - } - - ExtendedBuildResult result = do_build_package_and_clean_buildtrees(paths, action); - - fs.create_directories(abi_package_dir, ec); - fs.copy_file(abi_file, abi_file_in_package, fs::stdfs::copy_options::none, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not copy into file: %s", abi_file_in_package.u8string()); - - if (binary_caching_enabled && result.code == BuildResult::SUCCEEDED) - { - binaries_provider->push_success(paths, action); - } - else if (binary_caching_enabled && - (result.code == BuildResult::BUILD_FAILED || result.code == BuildResult::POST_BUILD_CHECKS_FAILED)) - { - binaries_provider->push_failure(paths, action.package_abi.value_or_exit(VCPKG_LINE_INFO), spec); - } - - return result; - } - - const std::string& to_string(const BuildResult build_result) - { - static const std::string NULLVALUE_STRING = Enums::nullvalue_to_string("vcpkg::Commands::Build::BuildResult"); - static const std::string SUCCEEDED_STRING = "SUCCEEDED"; - static const std::string BUILD_FAILED_STRING = "BUILD_FAILED"; - static const std::string FILE_CONFLICTS_STRING = "FILE_CONFLICTS"; - static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED"; - static const std::string CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING = "CASCADED_DUE_TO_MISSING_DEPENDENCIES"; - static const std::string EXCLUDED_STRING = "EXCLUDED"; - static const std::string DOWNLOADED_STRING = "DOWNLOADED"; - - switch (build_result) - { - case BuildResult::NULLVALUE: return NULLVALUE_STRING; - case BuildResult::SUCCEEDED: return SUCCEEDED_STRING; - case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING; - case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING; - case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING; - case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; - case BuildResult::EXCLUDED: return EXCLUDED_STRING; - case BuildResult::DOWNLOADED: return DOWNLOADED_STRING; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - std::string create_error_message(const BuildResult build_result, const PackageSpec& spec) - { - return Strings::format("Error: Building package %s failed with: %s", spec, Build::to_string(build_result)); - } - - 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" - "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.", - spec, - Commands::Version::version()); - } - - static BuildInfo inner_create_buildinfo(Parse::Paragraph pgh) - { - Parse::ParagraphParser parser(std::move(pgh)); - - BuildInfo build_info; - - { - std::string crt_linkage_as_string; - parser.required_field(BuildInfoRequiredField::CRT_LINKAGE, crt_linkage_as_string); - - auto crtlinkage = to_linkage_type(crt_linkage_as_string); - if (const auto p = crtlinkage.get()) - build_info.crt_linkage = *p; - else - Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid crt linkage type: [%s]", crt_linkage_as_string); - } - - { - std::string library_linkage_as_string; - parser.required_field(BuildInfoRequiredField::LIBRARY_LINKAGE, library_linkage_as_string); - auto liblinkage = to_linkage_type(library_linkage_as_string); - if (const auto p = liblinkage.get()) - build_info.library_linkage = *p; - else - Checks::exit_with_message( - VCPKG_LINE_INFO, "Invalid library linkage type: [%s]", library_linkage_as_string); - } - std::string version = parser.optional_field("Version"); - if (!version.empty()) build_info.version = std::move(version); - - std::map policies; - for (auto policy : G_ALL_POLICIES) - { - const auto setting = parser.optional_field(to_string(policy)); - if (setting.empty()) continue; - if (setting == "enabled") - policies.emplace(policy, true); - else if (setting == "disabled") - policies.emplace(policy, false); - else - Checks::exit_with_message( - VCPKG_LINE_INFO, "Unknown setting for policy '%s': %s", to_string(policy), setting); - } - - if (const auto err = parser.error_info("PostBuildInformation")) - { - print_error_message(err); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - build_info.policies = BuildPolicies(std::move(policies)); - - return build_info; - } - - BuildInfo read_build_info(const Files::Filesystem& fs, const fs::path& filepath) - { - const ExpectedS pghs = Paragraphs::get_single_paragraph(fs, filepath); - Checks::check_exit( - VCPKG_LINE_INFO, pghs.get() != nullptr, "Invalid BUILD_INFO file for package: %s", pghs.error()); - return inner_create_buildinfo(*pghs.get()); - } - - PreBuildInfo::PreBuildInfo(const VcpkgPaths& paths, - Triplet triplet, - const std::unordered_map& cmakevars) - { - for (auto&& kv : VCPKG_OPTIONS) - { - auto find_itr = cmakevars.find(kv.first); - if (find_itr == cmakevars.end()) - { - continue; - } - - const std::string& variable_value = find_itr->second; - - switch (kv.second) - { - case VcpkgTripletVar::TARGET_ARCHITECTURE: target_architecture = variable_value; break; - case VcpkgTripletVar::CMAKE_SYSTEM_NAME: cmake_system_name = variable_value; break; - case VcpkgTripletVar::CMAKE_SYSTEM_VERSION: cmake_system_version = variable_value; break; - case VcpkgTripletVar::PLATFORM_TOOLSET: - platform_toolset = variable_value.empty() ? nullopt : Optional{variable_value}; - break; - case VcpkgTripletVar::VISUAL_STUDIO_PATH: - visual_studio_path = variable_value.empty() ? nullopt : Optional{variable_value}; - break; - case VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE: - external_toolchain_file = variable_value.empty() ? nullopt : Optional{variable_value}; - break; - case VcpkgTripletVar::BUILD_TYPE: - if (variable_value.empty()) - build_type = nullopt; - else if (Strings::case_insensitive_ascii_equals(variable_value, "debug")) - build_type = ConfigurationType::DEBUG; - else if (Strings::case_insensitive_ascii_equals(variable_value, "release")) - build_type = ConfigurationType::RELEASE; - else - Checks::exit_with_message( - VCPKG_LINE_INFO, "Unknown setting for VCPKG_BUILD_TYPE: %s", variable_value); - break; - case VcpkgTripletVar::ENV_PASSTHROUGH: - passthrough_env_vars = Strings::split(variable_value, ";"); - break; - case VcpkgTripletVar::PUBLIC_ABI_OVERRIDE: - public_abi_override = variable_value.empty() ? nullopt : Optional{variable_value}; - break; - case VcpkgTripletVar::LOAD_VCVARS_ENV: - if (variable_value.empty()) - { - load_vcvars_env = true; - if(external_toolchain_file) - load_vcvars_env = false; - } - else if (Strings::case_insensitive_ascii_equals(variable_value, "1") || - Strings::case_insensitive_ascii_equals(variable_value, "on") || - Strings::case_insensitive_ascii_equals(variable_value, "true")) - load_vcvars_env = true; - else if (Strings::case_insensitive_ascii_equals(variable_value, "0") || - Strings::case_insensitive_ascii_equals(variable_value, "off") || - Strings::case_insensitive_ascii_equals(variable_value, "false")) - load_vcvars_env = false; - else - Checks::exit_with_message( - VCPKG_LINE_INFO, "Unknown boolean setting for VCPKG_LOAD_VCVARS_ENV: %s", variable_value); - break; - } - } - - triplet_abi_tag = get_triplet_abi(paths, *this, triplet); - } - - ExtendedBuildResult::ExtendedBuildResult(BuildResult code) : code(code) {} - ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::unique_ptr&& bcf) - : code(code), binary_control_file(std::move(bcf)) - { - } - ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::vector&& unmet_deps) - : code(code), unmet_dependencies(std::move(unmet_deps)) - { - } -} +#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 + +using namespace vcpkg; +using vcpkg::Build::BuildResult; +using vcpkg::Parse::ParseControlErrorInfo; +using vcpkg::Parse::ParseExpected; +using vcpkg::PortFileProvider::PathsPortFileProvider; + +namespace +{ + using vcpkg::PackageSpec; + using vcpkg::VcpkgPaths; + using vcpkg::Build::IBuildLogsRecorder; + struct NullBuildLogsRecorder final : IBuildLogsRecorder + { + void record_build_result(const VcpkgPaths& paths, const PackageSpec& spec, BuildResult result) const override + { + (void)paths; + (void)spec; + (void)result; + } + }; + + static const NullBuildLogsRecorder null_build_logs_recorder_instance; +} + +namespace vcpkg::Build +{ + using Dependencies::InstallPlanAction; + using Dependencies::InstallPlanType; + + void Command::perform_and_exit_ex(const FullPackageSpec& full_spec, + const SourceControlFileLocation& scfl, + const PathsPortFileProvider& provider, + IBinaryProvider& binaryprovider, + const IBuildLogsRecorder& build_logs_recorder, + const VcpkgPaths& paths) + { + Checks::exit_with_code(VCPKG_LINE_INFO, + perform_ex(full_spec, scfl, provider, binaryprovider, build_logs_recorder, paths)); + } + + const CommandStructure COMMAND_STRUCTURE = { + create_example_string("build zlib:x64-windows"), + 1, + 1, + {{}, {}}, + nullptr, + }; + + void Command::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) + { + Checks::exit_with_code(VCPKG_LINE_INFO, perform(args, paths, default_triplet)); + } + + int Command::perform_ex(const FullPackageSpec& full_spec, + const SourceControlFileLocation& scfl, + const PathsPortFileProvider& provider, + IBinaryProvider& binaryprovider, + const IBuildLogsRecorder& build_logs_recorder, + const VcpkgPaths& paths) + { + 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}); + + StatusParagraphs status_db = database_load_check(paths); + + auto action_plan = Dependencies::create_feature_install_plan( + provider, var_provider, std::vector{full_spec}, status_db); + + var_provider.load_tag_vars(action_plan, provider); + + const PackageSpec& spec = full_spec.package_spec; + const SourceControlFile& scf = *scfl.source_control_file; + + Checks::check_exit(VCPKG_LINE_INFO, + spec.name() == scf.core_paragraph->name, + "The Source field inside the CONTROL file does not match the port directory: '%s' != '%s'", + scf.core_paragraph->name, + spec.name()); + + compute_all_abis(paths, action_plan, var_provider, status_db); + + InstallPlanAction* action = nullptr; + for (auto& install_action : action_plan.already_installed) + { + if (install_action.spec == full_spec.package_spec) + { + action = &install_action; + } + } + for (auto& install_action : action_plan.install_actions) + { + if (install_action.spec == full_spec.package_spec) + { + action = &install_action; + } + } + + Checks::check_exit(VCPKG_LINE_INFO, action != nullptr); + ASSUME(action != nullptr); + action->build_options = default_build_package_options; + action->build_options.editable = Editable::YES; + action->build_options.clean_buildtrees = CleanBuildtrees::NO; + action->build_options.clean_packages = CleanPackages::NO; + + const auto build_timer = Chrono::ElapsedTimer::create_started(); + const auto result = Build::build_package(paths, *action, binaryprovider, build_logs_recorder, status_db); + System::print2("Elapsed time for package ", spec, ": ", build_timer, '\n'); + + if (result.code == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) + { + System::print2(System::Color::error, + "The build command requires all dependencies to be already installed.\n"); + System::print2("The following dependencies are missing:\n\n"); + for (const auto& p : result.unmet_dependencies) + { + System::print2(" ", p, '\n'); + } + System::print2('\n'); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + Checks::check_exit(VCPKG_LINE_INFO, result.code != BuildResult::EXCLUDED); + + if (result.code != BuildResult::SUCCEEDED) + { + System::print2(System::Color::error, Build::create_error_message(result.code, spec), '\n'); + System::print2(Build::create_user_troubleshooting_message(spec), '\n'); + return 1; + } + + return 0; + } + + int Command::perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) + { + // Build only takes a single package and all dependencies must already be installed + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + std::string first_arg = args.command_arguments.at(0); + + auto binaryprovider = create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); + + const FullPackageSpec spec = Input::check_and_get_full_package_spec( + std::move(first_arg), default_triplet, COMMAND_STRUCTURE.example_text); + + Input::check_triplet(spec.package_spec.triplet(), paths); + + PathsPortFileProvider provider(paths, args.overlay_ports); + const auto port_name = spec.package_spec.name(); + const auto* scfl = provider.get_control_file(port_name).get(); + + Checks::check_exit(VCPKG_LINE_INFO, scfl != nullptr, "Error: Couldn't find port '%s'", port_name); + ASSUME(scfl != nullptr); + + return perform_ex(spec, + *scfl, + provider, + args.binary_caching_enabled() ? *binaryprovider : null_binary_provider(), + 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 +{ + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; + static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + static const std::string NAME_DLLS_WITHOUT_EXPORTS = "PolicyDLLsWithoutExports"; + static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT"; + static const std::string NAME_EMPTY_INCLUDE_FOLDER = "PolicyEmptyIncludeFolder"; + static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt"; + static const std::string NAME_ALLOW_RESTRICTED_HEADERS = "PolicyAllowRestrictedHeaders"; + static const std::string NAME_SKIP_DUMPBIN_CHECKS = "PolicySkipDumpbinChecks"; + static const std::string NAME_SKIP_ARCHITECTURE_CHECK = "PolicySkipArchitectureCheck"; + + const std::string& to_string(BuildPolicy policy) + { + switch (policy) + { + case BuildPolicy::EMPTY_PACKAGE: return NAME_EMPTY_PACKAGE; + case BuildPolicy::DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; + case BuildPolicy::DLLS_WITHOUT_EXPORTS: return NAME_DLLS_WITHOUT_EXPORTS; + case BuildPolicy::ONLY_RELEASE_CRT: return NAME_ONLY_RELEASE_CRT; + case BuildPolicy::EMPTY_INCLUDE_FOLDER: return NAME_EMPTY_INCLUDE_FOLDER; + case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT; + case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return NAME_ALLOW_RESTRICTED_HEADERS; + case BuildPolicy::SKIP_DUMPBIN_CHECKS: return NAME_SKIP_DUMPBIN_CHECKS; + case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return NAME_SKIP_ARCHITECTURE_CHECK; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + CStringView to_cmake_variable(BuildPolicy policy) + { + switch (policy) + { + case BuildPolicy::EMPTY_PACKAGE: return "VCPKG_POLICY_EMPTY_PACKAGE"; + case BuildPolicy::DLLS_WITHOUT_LIBS: return "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + case BuildPolicy::DLLS_WITHOUT_EXPORTS: return "VCPKG_POLICY_DLLS_WITHOUT_EXPORTS"; + case BuildPolicy::ONLY_RELEASE_CRT: return "VCPKG_POLICY_ONLY_RELEASE_CRT"; + case BuildPolicy::EMPTY_INCLUDE_FOLDER: return "VCPKG_POLICY_EMPTY_INCLUDE_FOLDER"; + case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT"; + case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return "VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS"; + case BuildPolicy::SKIP_DUMPBIN_CHECKS: return "VCPKG_POLICY_SKIP_DUMPBIN_CHECKS"; + case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return "VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK"; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + static const std::string NAME_BUILD_IN_DOWNLOAD = "BUILT_IN"; + static const std::string NAME_ARIA2_DOWNLOAD = "ARIA2"; + + const std::string& to_string(DownloadTool tool) + { + switch (tool) + { + case DownloadTool::BUILT_IN: return NAME_BUILD_IN_DOWNLOAD; + case DownloadTool::ARIA2: return NAME_ARIA2_DOWNLOAD; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + Optional to_linkage_type(const std::string& str) + { + if (str == "dynamic") return LinkageType::DYNAMIC; + if (str == "static") return LinkageType::STATIC; + return nullopt; + } + + namespace BuildInfoRequiredField + { + static const std::string CRT_LINKAGE = "CRTLinkage"; + static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; + } + + static CStringView to_vcvarsall_target(const std::string& cmake_system_name) + { + if (cmake_system_name.empty()) return ""; + if (cmake_system_name == "Windows") return ""; + if (cmake_system_name == "WindowsStore") return "store"; + + Checks::exit_with_message(VCPKG_LINE_INFO, "Unsupported vcvarsall target %s", cmake_system_name); + } + + static CStringView to_vcvarsall_toolchain(const std::string& target_architecture, const Toolset& toolset) + { + auto maybe_target_arch = System::to_cpu_architecture(target_architecture); + Checks::check_exit( + VCPKG_LINE_INFO, maybe_target_arch.has_value(), "Invalid architecture string: %s", target_architecture); + auto target_arch = maybe_target_arch.value_or_exit(VCPKG_LINE_INFO); + auto host_architectures = System::get_supported_host_architectures(); + + for (auto&& host : host_architectures) + { + const auto it = Util::find_if(toolset.supported_architectures, [&](const ToolsetArchOption& opt) { + return host == opt.host_arch && target_arch == opt.target_arch; + }); + if (it != toolset.supported_architectures.end()) return it->name; + } + + Checks::exit_with_message(VCPKG_LINE_INFO, + "Unsupported toolchain combination. Target was: %s but supported ones were:\n%s", + target_architecture, + Strings::join(",", toolset.supported_architectures, [](const ToolsetArchOption& t) { + return t.name.c_str(); + })); + } + + 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)); + + const auto& base_env = envs.get_lazy(abi_info.pre_build_info->passthrough_env_vars, [&]() -> EnvMapEntry { + std::unordered_map env; + + for (auto&& env_var : abi_info.pre_build_info->passthrough_env_vars) + { + auto env_val = System::get_environment_variable(env_var); + + if (env_val) + { + env[env_var] = env_val.value_or_exit(VCPKG_LINE_INFO); + } + } + + return {env}; + }); + + return base_env.cmd_cache.get_lazy(build_env_cmd, [&]() { + const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core"); + auto& fs = paths.get_filesystem(); + if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe")) + { + fs.copy( + 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() + ";"); + if (build_env_cmd.empty()) + return clean_env; + else + return System::cmd_execute_modify_env(build_env_cmd, clean_env); + }); +#else + return System::get_clean_environment(); +#endif + } + + static std::string load_compiler_hash(const VcpkgPaths& paths, const AbiInfo& abi_info); + + const std::string& EnvCache::get_triplet_info(const VcpkgPaths& paths, const AbiInfo& abi_info) + { + const auto& fs = paths.get_filesystem(); + Checks::check_exit(VCPKG_LINE_INFO, abi_info.pre_build_info != nullptr); + const fs::path triplet_file_path = paths.get_triplet_file_path(abi_info.pre_build_info->triplet); + + auto tcfile = abi_info.pre_build_info->toolchain_file(); + auto&& toolchain_hash = m_toolchain_cache.get_lazy( + tcfile, [&]() { return Hash::get_file_hash(VCPKG_LINE_INFO, fs, tcfile, Hash::Algorithm::Sha1); }); + + auto&& triplet_entry = m_triplet_cache.get_lazy(triplet_file_path, [&]() -> TripletMapEntry { + return TripletMapEntry{Hash::get_file_hash(VCPKG_LINE_INFO, fs, triplet_file_path, Hash::Algorithm::Sha1)}; + }); + + return triplet_entry.compiler_hashes.get_lazy(toolchain_hash, [&]() -> std::string { + if (m_compiler_tracking) + { + auto compiler_hash = load_compiler_hash(paths, abi_info); + return Strings::concat(triplet_entry.hash, '-', toolchain_hash, '-', compiler_hash); + } + else + { + return triplet_entry.hash + "-" + toolchain_hash; + } + }); + } + + std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset) + { + if (!pre_build_info.using_vcvars()) return ""; + + const char* tonull = " >nul"; + if (Debug::g_debugging) + { + tonull = ""; + } + + const auto arch = to_vcvarsall_toolchain(pre_build_info.target_architecture, toolset); + 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 create_binary_control_file( + const SourceParagraph& source_paragraph, + Triplet triplet, + const BuildInfo& build_info, + const std::string& abi_tag, + const std::vector& core_dependencies) + { + auto bcf = std::make_unique(); + BinaryParagraph bpgh(source_paragraph, triplet, abi_tag, core_dependencies); + if (const auto p_ver = build_info.version.get()) + { + bpgh.version = *p_ver; + } + + bcf->core_paragraph = std::move(bpgh); + return bcf; + } + + static void write_binary_control_file(const VcpkgPaths& paths, const BinaryControlFile& bcf) + { + std::string start = Strings::serialize(bcf.core_paragraph); + for (auto&& feature : bcf.features) + { + start += "\n" + Strings::serialize(feature); + } + const fs::path binary_control_file = paths.packages / bcf.core_paragraph.dir() / fs::u8path("CONTROL"); + paths.get_filesystem().write_contents(binary_control_file, start, VCPKG_LINE_INFO); + } + + static int get_concurrency() + { + static int concurrency = [] { + auto user_defined_concurrency = System::get_environment_variable("VCPKG_MAX_CONCURRENCY"); + if (user_defined_concurrency) + { + return std::stoi(user_defined_concurrency.value_or_exit(VCPKG_LINE_INFO)); + } + else + { + return System::get_num_logical_cores() + 1; + } + }(); + + return concurrency; + } + + static void get_generic_cmake_build_args(const VcpkgPaths& paths, + Triplet triplet, + const Toolset& toolset, + std::vector& out_vars) + { + Util::Vectors::append(&out_vars, + std::initializer_list{ + {"CMD", "BUILD"}, + {"TARGET_TRIPLET", triplet.canonical_name()}, + {"TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()}, + {"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()}, + {"DOWNLOADS", paths.downloads}, + {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, + }); + if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) + { + const fs::path& git_exe_path = paths.get_tool_exe(Tools::GIT); + out_vars.push_back({"GIT", git_exe_path}); + } + } + + static std::string load_compiler_hash(const VcpkgPaths& paths, const AbiInfo& abi_info) + { + auto triplet = abi_info.pre_build_info->triplet; + System::print2("Detecting compiler hash for triplet ", triplet, "...\n"); + auto buildpath = paths.buildtrees / "detect_compiler"; + +#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)); +#endif + std::vector cmake_args{ + {"CURRENT_PORT_DIR", paths.scripts / "detect_compiler"}, + {"CURRENT_BUILDTREES_DIR", buildpath}, + {"CURRENT_PACKAGES_DIR", paths.packages / ("detect_compiler_" + triplet.canonical_name())}, + }; + get_generic_cmake_build_args(paths, triplet, abi_info.toolset.value_or_exit(VCPKG_LINE_INFO), cmake_args); + + auto command = vcpkg::make_cmake_cmd(paths, paths.ports_cmake, std::move(cmake_args)); + + const auto& env = paths.get_action_env(abi_info); + auto& fs = paths.get_filesystem(); + if (!fs.exists(buildpath)) + { + std::error_code err; + fs.create_directory(buildpath, err); + Checks::check_exit(VCPKG_LINE_INFO, + !err.value(), + "Failed to create directory '%s', code: %d", + buildpath.u8string(), + 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()); + std::string compiler_hash; + System::cmd_execute_and_stream_lines( + command, + [&](const std::string& s) { + static const StringLiteral s_marker = "#COMPILER_HASH#"; + if (Strings::starts_with(s, s_marker)) + { + compiler_hash = s.data() + s_marker.size(); + } + 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()); + }, + env); + out_file.close(); + + if (compiler_hash.empty()) + { + Debug::print("Compiler information tracking can be disabled by passing --", + VcpkgCmdArguments::FEATURE_FLAGS_ARG, + "=-", + VcpkgCmdArguments::COMPILER_TRACKING_FEATURE, + "\n"); + } + Checks::check_exit(VCPKG_LINE_INFO, + !compiler_hash.empty(), + "Error occured while detecting compiler information. Pass `--debug` for more information."); + + Debug::print("Detecting compiler hash for triplet ", triplet, ": ", compiler_hash, "\n"); + return compiler_hash; + } + + static std::vector get_cmake_build_args(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + Triplet triplet) + { +#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)); +#endif + auto& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); + auto& scf = *scfl.source_control_file; + + std::string all_features; + for (auto& feature : scf.feature_paragraphs) + { + all_features.append(feature->name + ";"); + } + + std::vector variables{ + {"PORT", scf.core_paragraph->name}, + {"CURRENT_PORT_DIR", scfl.source_location}, + {"VCPKG_USE_HEAD_VERSION", Util::Enum::to_bool(action.build_options.use_head_version) ? "1" : "0"}, + {"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(action.build_options.allow_downloads) ? "1" : "0"}, + {"_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)}, + {"_VCPKG_EDITABLE", Util::Enum::to_bool(action.build_options.editable) ? "1" : "0"}, + {"FEATURES", Strings::join(";", action.feature_list)}, + {"ALL_FEATURES", all_features}, + }; + get_generic_cmake_build_args( + paths, + triplet, + action.abi_info.value_or_exit(VCPKG_LINE_INFO).toolset.value_or_exit(VCPKG_LINE_INFO), + variables); + + if (Util::Enum::to_bool(action.build_options.only_downloads)) + { + variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); + } + + const Files::Filesystem& fs = paths.get_filesystem(); + + std::vector port_configs; + for (const PackageSpec& dependency : action.package_dependencies) + { + const fs::path port_config_path = paths.installed / fs::u8path(dependency.triplet().canonical_name()) / + fs::u8path("share") / fs::u8path(dependency.name()) / + fs::u8path("vcpkg-port-config.cmake"); + + if (fs.is_regular_file(port_config_path)) + { + port_configs.emplace_back(port_config_path.u8string()); + } + } + + if (!port_configs.empty()) + { + variables.emplace_back("VCPKG_PORT_CONFIGS", Strings::join(";", port_configs)); + } + + return variables; + } + + bool PreBuildInfo::using_vcvars() const + { + return (!external_toolchain_file.has_value() || load_vcvars_env) && + (cmake_system_name.empty() || cmake_system_name == "WindowsStore"); + } + + fs::path PreBuildInfo::toolchain_file() const + { + if (auto p = external_toolchain_file.get()) + { + return fs::u8path(*p); + } + else if (cmake_system_name == "Linux") + { + return m_paths.scripts / fs::u8path("toolchains/linux.cmake"); + } + else if (cmake_system_name == "Darwin") + { + return m_paths.scripts / fs::u8path("toolchains/osx.cmake"); + } + else if (cmake_system_name == "FreeBSD") + { + return m_paths.scripts / fs::u8path("toolchains/freebsd.cmake"); + } + else if (cmake_system_name == "Android") + { + return m_paths.scripts / fs::u8path("toolchains/android.cmake"); + } + else if (cmake_system_name == "iOS") + { + return m_paths.scripts / fs::u8path("toolchains/ios.cmake"); + } + else if (cmake_system_name == "MinGW") + { + return m_paths.scripts / fs::u8path("toolchains/mingw.cmake"); + } + else if (cmake_system_name.empty() || cmake_system_name == "Windows" || cmake_system_name == "WindowsStore") + { + return m_paths.scripts / fs::u8path("toolchains/windows.cmake"); + } + else + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Unable to determine toolchain to use for triplet %s with CMAKE_SYSTEM_NAME %s", + triplet, + cmake_system_name); + } + } + + static ExtendedBuildResult do_build_package(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) + { + const auto& pre_build_info = action.pre_build_info(VCPKG_LINE_INFO); + + auto& fs = paths.get_filesystem(); + 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(); + + if (Strings::case_insensitive_ascii_starts_with(triplet_file_path, paths.community_triplets.u8string())) + { + 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())) + { + 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())) + { + System::printf("-- Installing port from location: %s\n", u8portdir); + } + + const auto timer = Chrono::ElapsedTimer::create_started(); + + auto command = vcpkg::make_cmake_cmd(paths, paths.ports_cmake, get_cmake_build_args(paths, action, triplet)); + + const auto& env = paths.get_action_env(action.abi_info.value_or_exit(VCPKG_LINE_INFO)); + + auto buildpath = paths.buildtrees / action.spec.name(); + if (!fs.exists(buildpath)) + { + std::error_code err; + fs.create_directory(buildpath, err); + Checks::check_exit(VCPKG_LINE_INFO, + !err.value(), + "Failed to create directory '%s', code: %d", + buildpath.u8string(), + 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()); + 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()); + }, + env); + out_file.close(); + + // With the exception of empty packages, builds in "Download Mode" always result in failure. + if (action.build_options.only_downloads == Build::OnlyDownloads::YES) + { + // TODO: Capture executed command output and evaluate whether the failure was intended. + // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status. + return BuildResult::DOWNLOADED; + } + + const auto buildtimeus = timer.microseconds(); + const auto spec_string = action.spec.to_string(); + + { + auto locked_metrics = Metrics::g_metrics.lock(); + + locked_metrics->track_buildtime(Hash::get_string_hash(spec_string, Hash::Algorithm::Sha256) + ":[" + + Strings::join(",", + action.feature_list, + [](const std::string& feature) { + return Hash::get_string_hash(feature, + Hash::Algorithm::Sha256); + }) + + "]", + buildtimeus); + if (return_code != 0) + { + locked_metrics->track_property("error", "build failed"); + locked_metrics->track_property("build_error", spec_string); + return BuildResult::BUILD_FAILED; + } + } + + const BuildInfo build_info = read_build_info(fs, paths.build_info_file_path(action.spec)); + const size_t error_count = + PostBuildLint::perform_all_checks(action.spec, paths, pre_build_info, build_info, scfl.source_location); + + auto find_itr = action.feature_dependencies.find("core"); + Checks::check_exit(VCPKG_LINE_INFO, find_itr != action.feature_dependencies.end()); + + std::unique_ptr bcf = create_binary_control_file(*scfl.source_control_file->core_paragraph, + triplet, + build_info, + action.public_abi(), + std::move(find_itr->second)); + + if (error_count != 0) + { + return BuildResult::POST_BUILD_CHECKS_FAILED; + } + for (auto&& feature : action.feature_list) + { + for (auto&& f_pgh : scfl.source_control_file->feature_paragraphs) + { + if (f_pgh->name == feature) + { + find_itr = action.feature_dependencies.find(feature); + Checks::check_exit(VCPKG_LINE_INFO, find_itr != action.feature_dependencies.end()); + + bcf->features.emplace_back( + *scfl.source_control_file->core_paragraph, *f_pgh, triplet, std::move(find_itr->second)); + } + } + } + + write_binary_control_file(paths, *bcf); + return {BuildResult::SUCCEEDED, std::move(bcf)}; + } + + static ExtendedBuildResult do_build_package_and_clean_buildtrees(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action) + { + auto result = do_build_package(paths, action); + + if (action.build_options.clean_buildtrees == CleanBuildtrees::YES) + { + auto& fs = paths.get_filesystem(); + auto buildtree_files = fs.get_files_non_recursive(paths.build_dir(action.spec)); + for (auto&& file : buildtree_files) + { + if (fs.is_directory(file)) // Will only keep the logs + { + std::error_code ec; + fs::path failure_point; + fs.remove_all(file, ec, failure_point); + } + } + } + + return result; + } + + static void abi_entries_from_abi_info(const AbiInfo& abi_info, std::vector& abi_tag_entries) + { + abi_tag_entries.emplace_back("triplet", abi_info.triplet_abi.value_or_exit(VCPKG_LINE_INFO)); + + const auto& pre_build_info = *abi_info.pre_build_info; + if (pre_build_info.public_abi_override) + { + abi_tag_entries.emplace_back( + "public_abi_override", + Hash::get_string_hash(pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO), + Hash::Algorithm::Sha1)); + } + + for (const auto& env_var : pre_build_info.passthrough_env_vars) + { + abi_tag_entries.emplace_back( + "ENV:" + env_var, + Hash::get_string_hash(System::get_environment_variable(env_var).value_or(""), Hash::Algorithm::Sha1)); + } + } + + static Optional compute_abi_tag(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + Span dependency_abis) + { + auto& fs = paths.get_filesystem(); + Triplet triplet = action.spec.triplet(); + + std::vector abi_tag_entries(dependency_abis.begin(), dependency_abis.end()); + + abi_entries_from_abi_info(action.abi_info.value_or_exit(VCPKG_LINE_INFO), abi_tag_entries); + + // If there is an unusually large number of files in the port then + // something suspicious is going on. Rather than hash all of them + // just mark the port as no-hash + const int max_port_file_count = 100; + + auto&& port_dir = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO).source_location; + size_t port_file_count = 0; + for (auto& port_file : fs::stdfs::recursive_directory_iterator(port_dir)) + { + if (fs::is_regular_file(fs.status(VCPKG_LINE_INFO, port_file))) + { + abi_tag_entries.emplace_back( + port_file.path().filename().u8string(), + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, port_file, Hash::Algorithm::Sha1)); + + ++port_file_count; + if (port_file_count > max_port_file_count) + { + abi_tag_entries.emplace_back("no_hash_max_portfile", ""); + break; + } + } + } + + abi_tag_entries.emplace_back("cmake", paths.get_tool_version(Tools::CMAKE)); + +#if defined(_WIN32) + abi_tag_entries.emplace_back("powershell", paths.get_tool_version("powershell-core")); +#endif + + auto& helpers = paths.get_cmake_script_hashes(); + auto portfile_contents = + fs.read_contents(port_dir / fs::u8path("portfile.cmake")).value_or_exit(VCPKG_LINE_INFO); + for (auto&& helper : helpers) + { + if (Strings::case_insensitive_ascii_contains(portfile_contents, helper.first)) + { + abi_tag_entries.emplace_back(helper.first, helper.second); + } + } + + abi_tag_entries.emplace_back("post_build_checks", "2"); + std::vector sorted_feature_list = action.feature_list; + Util::sort(sorted_feature_list); + 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", ""); + + Util::sort(abi_tag_entries); + + const std::string full_abi_info = + Strings::join("", abi_tag_entries, [](const AbiEntry& p) { return p.key + " " + p.value + "\n"; }); + + if (Debug::g_debugging) + { + std::string message = Strings::concat("[DEBUG] \n"); + for (auto&& entry : abi_tag_entries) + { + Strings::append(message, "[DEBUG] ", entry.key, "|", entry.value, "\n"); + } + Strings::append(message, "[DEBUG] \n"); + System::print2(message); + } + + auto abi_tag_entries_missing = Util::filter(abi_tag_entries, [](const AbiEntry& p) { return p.value.empty(); }); + + if (abi_tag_entries_missing.empty()) + { + auto current_build_tree = paths.build_dir(action.spec); + fs.create_directory(current_build_tree, VCPKG_LINE_INFO); + const auto abi_file_path = current_build_tree / (triplet.canonical_name() + ".vcpkg_abi_info.txt"); + fs.write_contents(abi_file_path, full_abi_info, VCPKG_LINE_INFO); + + return AbiTagAndFile{Hash::get_file_hash(VCPKG_LINE_INFO, fs, abi_file_path, Hash::Algorithm::Sha1), + abi_file_path}; + } + + Debug::print( + "Warning: abi keys are missing values:\n", + Strings::join("", abi_tag_entries_missing, [](const AbiEntry& e) { return " " + e.key + "\n"; }), + "\n"); + + return nullopt; + } + + void compute_all_abis(const VcpkgPaths& paths, + Dependencies::ActionPlan& action_plan, + const CMakeVars::CMakeVarProvider& var_provider, + const StatusParagraphs& status_db) + { + using Dependencies::InstallPlanAction; + for (auto it = action_plan.install_actions.begin(); it != action_plan.install_actions.end(); ++it) + { + auto& action = *it; + if (action.abi_info.has_value()) continue; + + std::vector dependency_abis; + if (!Util::Enum::to_bool(action.build_options.only_downloads)) + { + for (auto&& pspec : action.package_dependencies) + { + if (pspec == action.spec) continue; + + auto pred = [&](const InstallPlanAction& ipa) { return ipa.spec == pspec; }; + auto it2 = std::find_if(action_plan.install_actions.begin(), it, pred); + if (it2 == it) + { + // Finally, look in current installed + auto status_it = status_db.find(pspec); + if (status_it == status_db.end()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to find dependency abi for %s -> %s", action.spec, pspec); + } + else + { + dependency_abis.emplace_back(AbiEntry{pspec.name(), status_it->get()->package.abi}); + } + } + else + { + dependency_abis.emplace_back(AbiEntry{pspec.name(), it2->public_abi()}); + } + } + } + + action.abi_info = AbiInfo(); + auto& abi_info = action.abi_info.value_or_exit(VCPKG_LINE_INFO); + + abi_info.pre_build_info = std::make_unique( + paths, action.spec.triplet(), var_provider.get_tag_vars(action.spec).value_or_exit(VCPKG_LINE_INFO)); + abi_info.toolset = paths.get_toolset(*abi_info.pre_build_info); + abi_info.triplet_abi = paths.get_triplet_info(abi_info); + + auto maybe_abi_tag_and_file = compute_abi_tag(paths, action, dependency_abis); + if (auto p = maybe_abi_tag_and_file.get()) + { + abi_info.package_abi = std::move(p->tag); + abi_info.abi_tag_file = std::move(p->tag_file); + } + } + } + + ExtendedBuildResult build_package(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + IBinaryProvider& binaries_provider, + const IBuildLogsRecorder& build_logs_recorder, + const StatusParagraphs& status_db) + { + auto& fs = paths.get_filesystem(); + auto& spec = action.spec; + const std::string& name = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO) + .source_control_file->core_paragraph->name; + + std::vector missing_fspecs; + for (const auto& kv : action.feature_dependencies) + { + for (const FeatureSpec& fspec : kv.second) + { + if (!(status_db.is_installed(fspec) || fspec.name() == name)) + { + missing_fspecs.emplace_back(fspec); + } + } + } + + if (!missing_fspecs.empty() && !Util::Enum::to_bool(action.build_options.only_downloads)) + { + return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(missing_fspecs)}; + } + + std::vector dependency_abis; + for (auto&& pspec : action.package_dependencies) + { + if (pspec == spec || Util::Enum::to_bool(action.build_options.only_downloads)) + { + continue; + } + const auto status_it = status_db.find_installed(pspec); + Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); + dependency_abis.emplace_back( + AbiEntry{status_it->get()->package.spec.name(), status_it->get()->package.abi}); + } + + auto& abi_info = action.abi_info.value_or_exit(VCPKG_LINE_INFO); + if (!abi_info.abi_tag_file) + { + return do_build_package_and_clean_buildtrees(paths, action); + } + + auto& abi_file = *abi_info.abi_tag_file.get(); + + 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) + { + auto restore = binaries_provider.try_restore(paths, action); + if (restore == RestoreResult::build_failed) + { + return BuildResult::BUILD_FAILED; + } + else if (restore == RestoreResult::success) + { + auto maybe_bcf = Paragraphs::try_load_cached_package(paths, spec); + auto bcf = std::make_unique(std::move(maybe_bcf).value_or_exit(VCPKG_LINE_INFO)); + return {BuildResult::SUCCEEDED, std::move(bcf)}; + } + else + { + // missing package, proceed to build. + } + } + + ExtendedBuildResult result = do_build_package_and_clean_buildtrees(paths, action); + + 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()); + + if (action.build_options.editable == Build::Editable::NO && result.code == BuildResult::SUCCEEDED) + { + binaries_provider.push_success(paths, action); + } + + build_logs_recorder.record_build_result(paths, spec, result.code); + + return result; + } + + const std::string& to_string(const BuildResult build_result) + { + static const std::string NULLVALUE_STRING = Enums::nullvalue_to_string("vcpkg::Commands::Build::BuildResult"); + static const std::string SUCCEEDED_STRING = "SUCCEEDED"; + static const std::string BUILD_FAILED_STRING = "BUILD_FAILED"; + static const std::string FILE_CONFLICTS_STRING = "FILE_CONFLICTS"; + static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED"; + static const std::string CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING = "CASCADED_DUE_TO_MISSING_DEPENDENCIES"; + static const std::string EXCLUDED_STRING = "EXCLUDED"; + static const std::string DOWNLOADED_STRING = "DOWNLOADED"; + + switch (build_result) + { + case BuildResult::NULLVALUE: return NULLVALUE_STRING; + case BuildResult::SUCCEEDED: return SUCCEEDED_STRING; + case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING; + case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING; + case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING; + case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; + case BuildResult::EXCLUDED: return EXCLUDED_STRING; + case BuildResult::DOWNLOADED: return DOWNLOADED_STRING; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + std::string create_error_message(const BuildResult build_result, const PackageSpec& spec) + { + return Strings::format("Error: Building package %s failed with: %s", spec, Build::to_string(build_result)); + } + + 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" + "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.", + spec, + Commands::Version::version()); + } + + static BuildInfo inner_create_buildinfo(Parse::Paragraph pgh) + { + Parse::ParagraphParser parser(std::move(pgh)); + + BuildInfo build_info; + + { + std::string crt_linkage_as_string; + parser.required_field(BuildInfoRequiredField::CRT_LINKAGE, crt_linkage_as_string); + + auto crtlinkage = to_linkage_type(crt_linkage_as_string); + if (const auto p = crtlinkage.get()) + build_info.crt_linkage = *p; + else + Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid crt linkage type: [%s]", crt_linkage_as_string); + } + + { + std::string library_linkage_as_string; + parser.required_field(BuildInfoRequiredField::LIBRARY_LINKAGE, library_linkage_as_string); + auto liblinkage = to_linkage_type(library_linkage_as_string); + if (const auto p = liblinkage.get()) + build_info.library_linkage = *p; + else + Checks::exit_with_message( + VCPKG_LINE_INFO, "Invalid library linkage type: [%s]", library_linkage_as_string); + } + std::string version = parser.optional_field("Version"); + if (!version.empty()) build_info.version = std::move(version); + + std::map policies; + for (auto policy : G_ALL_POLICIES) + { + const auto setting = parser.optional_field(to_string(policy)); + if (setting.empty()) continue; + if (setting == "enabled") + policies.emplace(policy, true); + else if (setting == "disabled") + policies.emplace(policy, false); + else + Checks::exit_with_message( + VCPKG_LINE_INFO, "Unknown setting for policy '%s': %s", to_string(policy), setting); + } + + if (const auto err = parser.error_info("PostBuildInformation")) + { + print_error_message(err); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + build_info.policies = BuildPolicies(std::move(policies)); + + return build_info; + } + + BuildInfo read_build_info(const Files::Filesystem& fs, const fs::path& filepath) + { + const ExpectedS pghs = Paragraphs::get_single_paragraph(fs, filepath); + Checks::check_exit( + VCPKG_LINE_INFO, pghs.get() != nullptr, "Invalid BUILD_INFO file for package: %s", pghs.error()); + return inner_create_buildinfo(*pghs.get()); + } + + PreBuildInfo::PreBuildInfo(const VcpkgPaths& paths, + Triplet triplet, + const std::unordered_map& cmakevars) + : triplet(triplet), m_paths(paths) + { + enum class VcpkgTripletVar + { + TARGET_ARCHITECTURE = 0, + CMAKE_SYSTEM_NAME, + CMAKE_SYSTEM_VERSION, + PLATFORM_TOOLSET, + VISUAL_STUDIO_PATH, + CHAINLOAD_TOOLCHAIN_FILE, + BUILD_TYPE, + ENV_PASSTHROUGH, + PUBLIC_ABI_OVERRIDE, + LOAD_VCVARS_ENV, + }; + + static const std::vector> VCPKG_OPTIONS = { + {"VCPKG_TARGET_ARCHITECTURE", VcpkgTripletVar::TARGET_ARCHITECTURE}, + {"VCPKG_CMAKE_SYSTEM_NAME", VcpkgTripletVar::CMAKE_SYSTEM_NAME}, + {"VCPKG_CMAKE_SYSTEM_VERSION", VcpkgTripletVar::CMAKE_SYSTEM_VERSION}, + {"VCPKG_PLATFORM_TOOLSET", VcpkgTripletVar::PLATFORM_TOOLSET}, + {"VCPKG_VISUAL_STUDIO_PATH", VcpkgTripletVar::VISUAL_STUDIO_PATH}, + {"VCPKG_CHAINLOAD_TOOLCHAIN_FILE", VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE}, + {"VCPKG_BUILD_TYPE", VcpkgTripletVar::BUILD_TYPE}, + {"VCPKG_ENV_PASSTHROUGH", VcpkgTripletVar::ENV_PASSTHROUGH}, + {"VCPKG_PUBLIC_ABI_OVERRIDE", VcpkgTripletVar::PUBLIC_ABI_OVERRIDE}, + {"VCPKG_LOAD_VCVARS_ENV", VcpkgTripletVar::LOAD_VCVARS_ENV}, + }; + + std::string empty; + for (auto&& kv : VCPKG_OPTIONS) + { + const std::string& variable_value = [&]() -> const std::string& { + auto find_itr = cmakevars.find(kv.first); + if (find_itr == cmakevars.end()) + { + return empty; + } + else + { + return find_itr->second; + } + }(); + + switch (kv.second) + { + case VcpkgTripletVar::TARGET_ARCHITECTURE: target_architecture = variable_value; break; + case VcpkgTripletVar::CMAKE_SYSTEM_NAME: cmake_system_name = variable_value; break; + case VcpkgTripletVar::CMAKE_SYSTEM_VERSION: cmake_system_version = variable_value; break; + case VcpkgTripletVar::PLATFORM_TOOLSET: + platform_toolset = variable_value.empty() ? nullopt : Optional{variable_value}; + break; + case VcpkgTripletVar::VISUAL_STUDIO_PATH: + visual_studio_path = variable_value.empty() ? nullopt : Optional{variable_value}; + break; + case VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE: + external_toolchain_file = variable_value.empty() ? nullopt : Optional{variable_value}; + break; + case VcpkgTripletVar::BUILD_TYPE: + if (variable_value.empty()) + build_type = nullopt; + else if (Strings::case_insensitive_ascii_equals(variable_value, "debug")) + build_type = ConfigurationType::DEBUG; + else if (Strings::case_insensitive_ascii_equals(variable_value, "release")) + build_type = ConfigurationType::RELEASE; + else + Checks::exit_with_message( + VCPKG_LINE_INFO, + "Unknown setting for VCPKG_BUILD_TYPE: %s. Valid settings are '', 'debug' and 'release'.", + variable_value); + break; + case VcpkgTripletVar::ENV_PASSTHROUGH: + passthrough_env_vars = Strings::split(variable_value, ';'); + break; + case VcpkgTripletVar::PUBLIC_ABI_OVERRIDE: + public_abi_override = variable_value.empty() ? nullopt : Optional{variable_value}; + break; + case VcpkgTripletVar::LOAD_VCVARS_ENV: + if (variable_value.empty()) + { + load_vcvars_env = true; + if (external_toolchain_file) load_vcvars_env = false; + } + else if (Strings::case_insensitive_ascii_equals(variable_value, "1") || + Strings::case_insensitive_ascii_equals(variable_value, "on") || + Strings::case_insensitive_ascii_equals(variable_value, "true")) + load_vcvars_env = true; + else if (Strings::case_insensitive_ascii_equals(variable_value, "0") || + Strings::case_insensitive_ascii_equals(variable_value, "off") || + Strings::case_insensitive_ascii_equals(variable_value, "false")) + load_vcvars_env = false; + else + Checks::exit_with_message(VCPKG_LINE_INFO, + "Unknown boolean setting for VCPKG_LOAD_VCVARS_ENV: %s. Valid " + "settings are '', '1', '0', 'ON', 'OFF', 'TRUE', and 'FALSE'.", + variable_value); + break; + } + } + } + + ExtendedBuildResult::ExtendedBuildResult(BuildResult code) : code(code) { } + ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::unique_ptr&& bcf) + : code(code), binary_control_file(std::move(bcf)) + { + } + ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::vector&& unmet_deps) + : code(code), unmet_dependencies(std::move(unmet_deps)) + { + } + + const IBuildLogsRecorder& null_build_logs_recorder() noexcept { return null_build_logs_recorder_instance; } +} diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp new file mode 100644 index 00000000000000..9ef330e660df58 --- /dev/null +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -0,0 +1,20 @@ +#include "pch.h" + +#include + +namespace vcpkg +{ + std::string make_cmake_cmd(const VcpkgPaths& paths, + const fs::path& cmake_script, + std::vector&& pass_variables) + { + auto local_variables = std::move(pass_variables); + local_variables.emplace_back("VCPKG_ROOT_DIR", paths.root); + local_variables.emplace_back("PACKAGES_DIR", paths.packages); + local_variables.emplace_back("BUILDTREES_DIR", paths.buildtrees); + local_variables.emplace_back("_VCPKG_INSTALLED_DIR", paths.installed); + local_variables.emplace_back("DOWNLOADS", paths.downloads); + local_variables.emplace_back("VCPKG_MANIFEST_INSTALL", "OFF"); + return System::make_basic_cmake_cmd(paths.get_tool_exe(Tools::CMAKE), cmake_script, local_variables); + } +} diff --git a/toolsrc/src/vcpkg/cmakevars.cpp b/toolsrc/src/vcpkg/cmakevars.cpp index 98b2546edba5ea..ee718d40822993 100644 --- a/toolsrc/src/vcpkg/cmakevars.cpp +++ b/toolsrc/src/vcpkg/cmakevars.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -30,7 +31,7 @@ namespace vcpkg::CMakeVars { struct TripletCMakeVarProvider : Util::ResourceBase, CMakeVarProvider { - explicit TripletCMakeVarProvider(const vcpkg::VcpkgPaths& paths) : paths(paths) {} + explicit TripletCMakeVarProvider(const vcpkg::VcpkgPaths& paths) : paths(paths) { } void load_generic_triplet_vars(Triplet triplet) const override; @@ -58,7 +59,6 @@ namespace vcpkg::CMakeVars std::vector>>& vars) const; const VcpkgPaths& paths; - const fs::path& cmake_exe_path = paths.get_tool_exe(Tools::CMAKE); const fs::path get_tags_path = paths.scripts / "vcpkg_get_tags.cmake"; const fs::path get_dep_info_path = paths.scripts / "vcpkg_get_dep_info.cmake"; mutable std::unordered_map> dep_resolution_vars; @@ -115,8 +115,7 @@ namespace vcpkg::CMakeVars fs::path path = paths.buildtrees / Strings::concat(tag_extract_id++, ".vcpkg_tags.cmake"); - std::error_code ec; - fs.create_directories(paths.buildtrees, ec); + fs.create_directories(paths.buildtrees, ignore_errors); fs.write_contents(path, extraction_file, VCPKG_LINE_INFO); return path; @@ -170,11 +169,11 @@ namespace vcpkg::CMakeVars static constexpr CStringView BLOCK_START_GUID = "c35112b6-d1ba-415b-aa5d-81de856ef8eb"; static constexpr CStringView BLOCK_END_GUID = "e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f"; - const auto cmd_launch_cmake = System::make_cmake_cmd(cmake_exe_path, script_path, {}); + const auto cmd_launch_cmake = vcpkg::make_cmake_cmd(paths, script_path, {}); const auto ec_data = System::cmd_execute_and_capture_output(cmd_launch_cmake); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, ec_data.output); - const std::vector lines = Strings::split(ec_data.output, "\n"); + const std::vector lines = Strings::split(ec_data.output, '\n'); const auto end = lines.cend(); @@ -192,7 +191,7 @@ namespace vcpkg::CMakeVars { const std::string& line = *block_start; - std::vector s = Strings::split(line, "="); + std::vector s = Strings::split(line, '='); Checks::check_exit(VCPKG_LINE_INFO, s.size() == 1 || s.size() == 2, "Expected format is [VARIABLE_NAME=VARIABLE_VALUE], but was [%s]", diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index 2857988ba5bd1b..b035aa3dd4261d 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -1,7 +1,11 @@ #include "pch.h" #include -#include + +#include +#include +#include +#include #include #include #include @@ -30,7 +34,7 @@ namespace vcpkg::Commands::Autocomplete { Metrics::g_metrics.lock()->set_send_metrics(false); const std::string to_autocomplete = Strings::join(" ", args.command_arguments); - const std::vector tokens = Strings::split(to_autocomplete, " "); + const std::vector tokens = Strings::split(to_autocomplete, ' '); std::smatch match; @@ -137,11 +141,17 @@ namespace vcpkg::Commands::Autocomplete const bool is_option = Strings::case_insensitive_ascii_starts_with(prefix, "-"); if (is_option) { - results = Util::fmap(command.structure.options.switches, - [](const CommandSwitch& s) -> std::string { return s.name.to_string(); }); + results = Util::fmap(command.structure.options.switches, [](const CommandSwitch& s) -> std::string { + return Strings::format("--%s", s.name.to_string()); + }); - auto settings = Util::fmap(command.structure.options.settings, [](auto&& s) { return s.name; }); + auto settings = Util::fmap(command.structure.options.settings, + [](auto&& s) { return Strings::format("--%s", s.name); }); results.insert(results.end(), settings.begin(), settings.end()); + + auto multisettings = Util::fmap(command.structure.options.multisettings, + [](auto&& s) { return Strings::format("--%s", s.name); }); + results.insert(results.end(), multisettings.begin(), multisettings.end()); } else { @@ -168,4 +178,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 07ad7b6b173c3a..5f2e707c4f7879 100644 --- a/toolsrc/src/vcpkg/commands.buildexternal.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -1,15 +1,16 @@ #include "pch.h" +#include #include #include -#include +#include #include #include namespace vcpkg::Commands::BuildExternal { const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"), + create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"), 2, 2, {}, @@ -20,19 +21,33 @@ namespace vcpkg::Commands::BuildExternal { const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + auto binaryprovider = create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); + const FullPackageSpec spec = Input::check_and_get_full_package_spec( std::string(args.command_arguments.at(0)), default_triplet, COMMAND_STRUCTURE.example_text); Input::check_triplet(spec.package_spec.triplet(), paths); - auto overlays = args.overlay_ports ? *args.overlay_ports : std::vector(); + auto overlays = args.overlay_ports; overlays.insert(overlays.begin(), args.command_arguments.at(1)); - PortFileProvider::PathsPortFileProvider provider(paths, &overlays); + PortFileProvider::PathsPortFileProvider provider(paths, overlays); auto maybe_scfl = provider.get_control_file(spec.package_spec.name()); Checks::check_exit( VCPKG_LINE_INFO, maybe_scfl.has_value(), "could not load control file for %s", spec.package_spec.name()); - Build::Command::perform_and_exit_ex(spec, maybe_scfl.value_or_exit(VCPKG_LINE_INFO), provider, paths); + Build::Command::perform_and_exit_ex(spec, + maybe_scfl.value_or_exit(VCPKG_LINE_INFO), + provider, + args.binary_caching_enabled() ? *binaryprovider : null_binary_provider(), + 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 5fb9d15f44f1f5..5c2de88b39542d 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -2,8 +2,9 @@ #include #include + #include -#include +#include #include #include @@ -14,7 +15,7 @@ namespace vcpkg::Commands::Cache std::vector output; for (auto&& path : paths.get_filesystem().get_files_non_recursive(paths.packages)) { - const auto pghs = Paragraphs::get_single_paragraph(paths.get_filesystem(), path / "CONTROL"); + const auto pghs = Paragraphs::get_single_paragraph(paths.get_filesystem(), path / fs::u8path("CONTROL")); if (const auto p = pghs.get()) { const BinaryParagraph binary_paragraph = BinaryParagraph(*p); @@ -28,7 +29,7 @@ namespace vcpkg::Commands::Cache const CommandStructure COMMAND_STRUCTURE = { Strings::format( "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", - Help::create_example_string("cache png")), + create_example_string("cache png")), 0, 1, {}, @@ -70,4 +71,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 f21366a36e896d..04633903df398c 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -6,20 +6,70 @@ #include #include #include + #include #include -#include +#include #include #include #include #include #include -#include #include +#include #include using namespace vcpkg; +namespace +{ + using namespace vcpkg::Build; + + const fs::path dot_log = fs::u8path(".log"); + const fs::path readme_dot_log = fs::u8path("readme.log"); + + class CiBuildLogsRecorder final : public IBuildLogsRecorder + { + fs::path base_path; + + public: + CiBuildLogsRecorder(const fs::path& base_path_) : base_path(base_path_) { } + + virtual void record_build_result(const VcpkgPaths& paths, + const PackageSpec& spec, + BuildResult result) const override + { + if (result == BuildResult::SUCCEEDED) + { + return; + } + + auto& filesystem = paths.get_filesystem(); + const auto source_path = paths.build_dir(spec); + auto children = filesystem.get_files_non_recursive(source_path); + Util::erase_remove_if(children, [](const fs::path& p) { return p.extension() != dot_log; }); + const auto target_path = base_path / fs::u8path(spec.name()); + (void)filesystem.create_directory(target_path, VCPKG_LINE_INFO); + if (children.empty()) + { + std::string message = + "There are no build logs for " + spec.to_string() + + " build.\n" + "This is usually because the build failed early and outside of a task that is logged.\n" + "See the console output logs from vcpkg for more information on the failure.\n"; + filesystem.write_contents(target_path / readme_dot_log, message, VCPKG_LINE_INFO); + } + else + { + for (const fs::path& p : children) + { + filesystem.copy_file(p, target_path / p.filename(), fs::copy_options::none, VCPKG_LINE_INFO); + } + } + } + }; +} + namespace vcpkg::Commands::CI { using Build::BuildResult; @@ -32,25 +82,24 @@ namespace vcpkg::Commands::CI Install::InstallSummary summary; }; - static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; - static constexpr StringLiteral OPTION_EXCLUDE = "--exclude"; - static constexpr StringLiteral OPTION_PURGE_TOMBSTONES = "--purge-tombstones"; - static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; - static constexpr StringLiteral OPTION_RANDOMIZE = "--x-randomize"; + static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; + static constexpr StringLiteral OPTION_EXCLUDE = "exclude"; + static constexpr StringLiteral OPTION_FAILURE_LOGS = "failure-logs"; + static constexpr StringLiteral OPTION_XUNIT = "x-xunit"; + static constexpr StringLiteral OPTION_RANDOMIZE = "x-randomize"; - static constexpr std::array CI_SETTINGS = {{ - {OPTION_EXCLUDE, "Comma separated list of ports to skip"}, - {OPTION_XUNIT, "File to output results in XUnit format (internal)"}, - }}; + static constexpr std::array CI_SETTINGS = { + {{OPTION_EXCLUDE, "Comma separated list of ports to skip"}, + {OPTION_XUNIT, "File to output results in XUnit format (internal)"}, + {OPTION_FAILURE_LOGS, "Directory to which failure logs will be copied"}}}; - static constexpr std::array CI_SWITCHES = {{ + static constexpr std::array CI_SWITCHES = {{ {OPTION_DRY_RUN, "Print out plan without execution"}, {OPTION_RANDOMIZE, "Randomize the install order"}, - {OPTION_PURGE_TOMBSTONES, "Purge failure tombstones and retry building the ports"}, }}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("ci x64-windows"), + create_example_string("ci x64-windows"), 1, SIZE_MAX, {CI_SWITCHES, CI_SETTINGS}, @@ -173,7 +222,7 @@ namespace vcpkg::Commands::CI } std::string traits_block; - if (test.abi_tag != "") + if (!test.abi_tag.empty()) { traits_block += Strings::format(R"()", test.abi_tag); } @@ -228,26 +277,11 @@ namespace vcpkg::Commands::CI const InstallPlanAction* install_plan) { auto&& scfl = install_plan->source_control_file_location.value_or_exit(VCPKG_LINE_INFO); - const std::string& supports_expression = scfl.source_control_file->core_paragraph->supports_expression; - if (supports_expression.empty()) - { - return true; // default to 'supported' - } + const auto& supports_expression = scfl.source_control_file->core_paragraph->supports_expression; + PlatformExpression::Context context = + var_provider.get_tag_vars(install_plan->spec).value_or_exit(VCPKG_LINE_INFO); - ExpressionContext context = {var_provider.get_tag_vars(install_plan->spec).value_or_exit(VCPKG_LINE_INFO), - install_plan->spec.triplet().canonical_name()}; - auto maybe_result = evaluate_expression(supports_expression, context); - if (auto b = maybe_result.get()) - return *b; - else - { - System::print2(System::Color::error, - "Error: while processing ", - install_plan->spec.to_string(), - "\n", - maybe_result.error()); - Checks::exit_fail(VCPKG_LINE_INFO); - } + return supports_expression.evaluate(context); } static std::unique_ptr find_unknown_ports_for_ci( @@ -256,32 +290,20 @@ namespace vcpkg::Commands::CI const PortFileProvider::PortFileProvider& provider, const CMakeVars::CMakeVarProvider& var_provider, const std::vector& specs, - const bool purge_tombstones) + IBinaryProvider& binaryprovider) { auto ret = std::make_unique(); std::set will_fail; - const Build::BuildPackageOptions build_options = { - Build::UseHeadVersion::NO, - Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, - Build::CleanBuildtrees::YES, - Build::CleanPackages::YES, - Build::CleanDownloads::NO, - Build::DownloadTool::BUILT_IN, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, - Build::FailOnTombstone::YES, - }; - std::vector packages_with_qualified_deps; - auto has_qualifier = [](Dependency const& dep) { return !dep.qualifier.empty(); }; + auto has_qualifier = [](Dependency const& dep) { return !dep.platform.is_empty(); }; for (auto&& spec : specs) { auto&& scfl = provider.get_control_file(spec.package_spec.name()).value_or_exit(VCPKG_LINE_INFO); - if (Util::any_of(scfl.source_control_file->core_paragraph->depends, has_qualifier) || + if (Util::any_of(scfl.source_control_file->core_paragraph->dependencies, has_qualifier) || Util::any_of(scfl.source_control_file->feature_paragraphs, - [&](auto&& pgh) { return Util::any_of(pgh->depends, has_qualifier); })) + [&](auto&& pgh) { return Util::any_of(pgh->dependencies, has_qualifier); })) { packages_with_qualified_deps.push_back(spec.package_spec); } @@ -293,7 +315,7 @@ namespace vcpkg::Commands::CI std::vector install_specs; for (auto&& install_action : action_plan.install_actions) { - install_specs.emplace_back(FullPackageSpec{install_action.spec, install_action.feature_list}); + install_specs.emplace_back(install_action.spec, install_action.feature_list); } var_provider.load_tag_vars(install_specs, provider); @@ -306,105 +328,100 @@ namespace vcpkg::Commands::CI Build::compute_all_abis(paths, action_plan, var_provider, {}); - auto binaryprovider = create_archives_provider(); - - std::string stdout_buffer; - for (auto&& action : action_plan.install_actions) { - auto p = &action; - ret->abi_map.emplace(action.spec, action.package_abi.value_or_exit(VCPKG_LINE_INFO)); - ret->features.emplace(action.spec, action.feature_list); - if (auto scfl = p->source_control_file_location.get()) + vcpkg::System::BufferedPrint stdout_print; + for (auto&& action : action_plan.install_actions) { - auto emp = ret->default_feature_provider.emplace(p->spec.name(), *scfl); - emp.first->second.source_control_file->core_paragraph->default_features = p->feature_list; + auto p = &action; + ret->abi_map.emplace(action.spec, action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi); + ret->features.emplace(action.spec, action.feature_list); + if (auto scfl = p->source_control_file_location.get()) + { + auto emp = ret->default_feature_provider.emplace(p->spec.name(), *scfl); + emp.first->second.source_control_file->core_paragraph->default_features = p->feature_list; - p->build_options = build_options; - } + p->build_options = vcpkg::Build::default_build_package_options; + } - auto precheck_result = binaryprovider->precheck(paths, action, purge_tombstones); - bool b_will_build = false; + auto precheck_result = binaryprovider.precheck(paths, action); + bool b_will_build = false; - std::string state; + std::string state; - if (Util::Sets::contains(exclusions, p->spec.name())) - { - state = "skip"; - ret->known.emplace(p->spec, BuildResult::EXCLUDED); - will_fail.emplace(p->spec); - } - else if (!supported_for_triplet(var_provider, p)) - { - // This treats unsupported ports as if they are excluded - // which means the ports dependent on it will be cascaded due to missing dependencies - // Should this be changed so instead it is a failure to depend on a unsupported port? - state = "n/a"; - ret->known.emplace(p->spec, BuildResult::EXCLUDED); - will_fail.emplace(p->spec); - } - else if (Util::any_of(p->package_dependencies, - [&](const PackageSpec& spec) { return Util::Sets::contains(will_fail, spec); })) - { - state = "cascade"; - ret->known.emplace(p->spec, BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES); - will_fail.emplace(p->spec); - } - else if (precheck_result == RestoreResult::success) - { - state = "pass"; - ret->known.emplace(p->spec, BuildResult::SUCCEEDED); - } - else if (precheck_result == RestoreResult::build_failed) - { - state = "fail"; - ret->known.emplace(p->spec, BuildResult::BUILD_FAILED); - will_fail.emplace(p->spec); - } - else - { - ret->unknown.push_back(FullPackageSpec{p->spec, {p->feature_list.begin(), p->feature_list.end()}}); - b_will_build = true; - } + if (Util::Sets::contains(exclusions, p->spec.name())) + { + state = "skip"; + ret->known.emplace(p->spec, BuildResult::EXCLUDED); + will_fail.emplace(p->spec); + } + else if (!supported_for_triplet(var_provider, p)) + { + // This treats unsupported ports as if they are excluded + // which means the ports dependent on it will be cascaded due to missing dependencies + // Should this be changed so instead it is a failure to depend on a unsupported port? + state = "n/a"; + ret->known.emplace(p->spec, BuildResult::EXCLUDED); + will_fail.emplace(p->spec); + } + else if (Util::any_of(p->package_dependencies, + [&](const PackageSpec& spec) { return Util::Sets::contains(will_fail, spec); })) + { + state = "cascade"; + ret->known.emplace(p->spec, BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES); + will_fail.emplace(p->spec); + } + else if (precheck_result == RestoreResult::success) + { + state = "pass"; + ret->known.emplace(p->spec, BuildResult::SUCCEEDED); + } + else if (precheck_result == RestoreResult::build_failed) + { + state = "fail"; + ret->known.emplace(p->spec, BuildResult::BUILD_FAILED); + will_fail.emplace(p->spec); + } + else + { + ret->unknown.emplace_back(p->spec, p->feature_list); + b_will_build = true; + } - Strings::append(stdout_buffer, - Strings::format("%40s: %1s %8s: %s\n", - p->spec, - (b_will_build ? "*" : " "), - state, - action.package_abi.value_or_exit(VCPKG_LINE_INFO))); - if (stdout_buffer.size() > 2048) - { - System::print2(stdout_buffer); - stdout_buffer.clear(); + stdout_print.append(Strings::format("%40s: %1s %8s: %s\n", + p->spec, + (b_will_build ? "*" : " "), + state, + action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi)); } - } - System::print2(stdout_buffer); - stdout_buffer.clear(); + } // flush stdout_print System::printf("Time to determine pass/fail: %s\n", timer.elapsed()); - return ret; } void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) { - if (!GlobalState::g_binary_caching) + std::unique_ptr binaryproviderStorage; + if (args.binary_caching_enabled()) { - System::print2(System::Color::warning, "Warning: Running ci without binary caching!\n"); + binaryproviderStorage = + create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); } + IBinaryProvider& binaryprovider = binaryproviderStorage ? *binaryproviderStorage : null_binary_provider(); + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + auto& settings = options.settings; std::set exclusions_set; - auto it_exclusions = options.settings.find(OPTION_EXCLUDE); - if (it_exclusions != options.settings.end()) + auto it_exclusions = settings.find(OPTION_EXCLUDE); + if (it_exclusions != settings.end()) { - auto exclusions = Strings::split(it_exclusions->second, ","); + auto exclusions = Strings::split(it_exclusions->second, ','); exclusions_set.insert(exclusions.begin(), exclusions.end()); } const auto is_dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); - const auto purge_tombstones = Util::Sets::contains(options.switches, OPTION_PURGE_TOMBSTONES); std::vector triplets = Util::fmap( args.command_arguments, [](std::string s) { return Triplet::from_canonical_name(std::move(s)); }); @@ -414,25 +431,28 @@ namespace vcpkg::Commands::CI triplets.push_back(default_triplet); } + auto& filesystem = paths.get_filesystem(); + Optional build_logs_recorder_storage; + { + auto it_failure_logs = settings.find(OPTION_FAILURE_LOGS); + if (it_failure_logs != settings.end()) + { + auto raw_path = fs::u8path(it_failure_logs->second); + System::printf("Creating failure logs output directory %s\n", it_failure_logs->second); + filesystem.create_directories(raw_path, VCPKG_LINE_INFO); + build_logs_recorder_storage = filesystem.canonical(VCPKG_LINE_INFO, raw_path); + } + } + + const IBuildLogsRecorder& build_logs_recorder = + build_logs_recorder_storage ? *(build_logs_recorder_storage.get()) : null_build_logs_recorder(); + StatusParagraphs status_db = database_load_check(paths); - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; - const Build::BuildPackageOptions install_plan_options = { - Build::UseHeadVersion::NO, - Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, - Build::CleanBuildtrees::YES, - Build::CleanPackages::YES, - Build::CleanDownloads::NO, - Build::DownloadTool::BUILT_IN, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, - Build::FailOnTombstone::YES, - Build::PurgeDecompressFailure::YES, - }; - std::vector> all_known_results; XunitTestResults xunitTestResults; @@ -459,7 +479,7 @@ namespace vcpkg::Commands::CI }); auto split_specs = find_unknown_ports_for_ci( - paths, exclusions_set, provider, var_provider, all_default_full_specs, purge_tombstones); + paths, exclusions_set, provider, var_provider, all_default_full_specs, binaryprovider); PortFileProvider::MapPortFileProvider new_default_provider(split_specs->default_feature_provider); Dependencies::CreateInstallPlanOptions serialize_options; @@ -492,7 +512,7 @@ namespace vcpkg::Commands::CI } else { - action.build_options = install_plan_options; + action.build_options = vcpkg::Build::default_build_package_options; } } @@ -503,7 +523,13 @@ namespace vcpkg::Commands::CI else { auto collection_timer = Chrono::ElapsedTimer::create_started(); - auto summary = Install::perform(action_plan, Install::KeepGoing::YES, paths, status_db, var_provider); + auto summary = Install::perform(action_plan, + Install::KeepGoing::YES, + paths, + status_db, + binaryprovider, + build_logs_recorder, + var_provider); auto collection_time_elapsed = collection_timer.elapsed(); // Adding results for ports that were built or pulled from an archive @@ -544,13 +570,20 @@ namespace vcpkg::Commands::CI System::print2("Total elapsed time: ", result.summary.total_elapsed_time, "\n"); result.summary.print(); } - auto& fs = paths.get_filesystem(); - auto it_xunit = options.settings.find(OPTION_XUNIT); - if (it_xunit != options.settings.end()) + + auto it_xunit = settings.find(OPTION_XUNIT); + if (it_xunit != settings.end()) { - fs.write_contents(fs::u8path(it_xunit->second), xunitTestResults.build_xml(), VCPKG_LINE_INFO); + filesystem.write_contents(fs::u8path(it_xunit->second), xunitTestResults.build_xml(), VCPKG_LINE_INFO); } 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 new file mode 100644 index 00000000000000..107c8119fcf6bd --- /dev/null +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -0,0 +1,47 @@ +#include "pch.h" + +#include +#include +#include + +#include +#include + +using namespace vcpkg; + +namespace +{ + void clear_directory(Files::Filesystem& fs, const fs::path& target) + { + using vcpkg::System::print2; + if (fs.is_directory(target)) + { + print2("Clearing contents of ", target.u8string(), "\n"); + fs.remove_all_inside(target, VCPKG_LINE_INFO); + } + else + { + print2("Skipping clearing contents of ", target.u8string(), " because it was not a directory\n"); + } + } +} + +namespace vcpkg::Commands::CIClean +{ + void perform_and_exit(const VcpkgCmdArguments&, const VcpkgPaths& paths) + { + using vcpkg::System::print2; + auto& fs = paths.get_filesystem(); + print2("Starting vcpkg CI clean\n"); + clear_directory(fs, paths.buildtrees); + clear_directory(fs, paths.installed); + clear_directory(fs, paths.packages); + 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 afbdc1fa768f2c..b7ed9a9414ce34 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -3,7 +3,8 @@ #include #include #include -#include + +#include #include #include @@ -15,21 +16,21 @@ namespace vcpkg::Commands::Contact return S_EMAIL; } - static constexpr StringLiteral OPTION_SURVEY = "--survey"; + static constexpr StringLiteral OPTION_SURVEY = "survey"; static constexpr std::array SWITCHES = {{ {OPTION_SURVEY, "Launch default browser to the current vcpkg survey"}, }}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("contact"), + create_example_string("contact"), 0, 0, {SWITCHES, {}}, nullptr, }; - void perform_and_exit(const VcpkgCmdArguments& args) + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) { const ParsedArguments parsed_args = args.parse_arguments(COMMAND_STRUCTURE); @@ -38,7 +39,6 @@ namespace vcpkg::Commands::Contact auto maybe_now = Chrono::CTime::get_current_date_time(); if (const auto p_now = maybe_now.get()) { - auto& fs = Files::get_real_filesystem(); auto config = UserConfig::try_read_data(fs); config.last_completed_survey = p_now->to_string(); config.try_write_data(fs); @@ -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 1f424a559371a7..9c8950a9b7743a 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -1,10 +1,32 @@ #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 @@ -13,103 +35,85 @@ namespace vcpkg::Commands { - Span> get_available_commands_type_a() + Span> get_available_basic_commands() { - static std::vector> t = { - {"install", &Install::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}, - {"import", &Import::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-history", &PortHistory::perform_and_exit}, - {"x-vsinstances", &X_VSInstances::perform_and_exit}, - }; - return t; - } + static const Help::HelpCommand help{}; + static const Search::SearchCommand search{}; + static const List::ListCommand list{}; + 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-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", Help::create_example_string("fetch cmake")), - 1, - 1, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(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(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", - Help::create_example_string("hash boost_1_62_0.tar.bz2")), - 1, - 2, - {}, - 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 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 e04599dfe7f083..8843a509d5f9f3 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -2,29 +2,28 @@ #include #include -#include -#include + +#include +#include #include namespace vcpkg::Commands::Create { const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib1211.zip "zlib1211-2.zip")###"), + create_example_string(R"###(create zlib2 http://zlib.net/zlib1211.zip "zlib1211-2.zip")###"), 2, 3, {}, nullptr, }; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); const std::string port_name = args.command_arguments.at(0); const std::string url = args.command_arguments.at(1); - const fs::path& cmake_exe = paths.get_tool_exe(Tools::CMAKE); - - std::vector cmake_args{{"CMD", "CREATE"}, {"PORT", port_name}, {"URL", url}, {"VCPKG_ROOT_PATH", paths.root}}; + std::vector cmake_args{{"CMD", "CREATE"}, {"PORT", port_name}, {"URL", url}}; if (args.command_arguments.size() >= 3) { @@ -37,7 +36,17 @@ namespace vcpkg::Commands::Create cmake_args.emplace_back("FILENAME", zip_file_name); } - const std::string cmd_launch_cmake = make_cmake_cmd(cmake_exe, paths.ports_cmake, cmake_args); - Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute_clean(cmd_launch_cmake)); + const std::string cmd_launch_cmake = make_cmake_cmd(paths, paths.ports_cmake, std::move(cmake_args)); + return System::cmd_execute_clean(cmd_launch_cmake); + } + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + 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 f153626fae11df..77a8c6c4ebe913 100644 --- a/toolsrc/src/vcpkg/commands.dependinfo.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -1,329 +1,338 @@ -#include "pch.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using vcpkg::Dependencies::ActionPlan; -using vcpkg::Dependencies::InstallPlanAction; -using vcpkg::PortFileProvider::PathsPortFileProvider; - -namespace vcpkg::Commands::DependInfo -{ - namespace - { - constexpr StringLiteral OPTION_DOT = "--dot"; - constexpr StringLiteral OPTION_DGML = "--dgml"; - constexpr StringLiteral OPTION_SHOW_DEPTH = "--show-depth"; - constexpr StringLiteral OPTION_MAX_RECURSE = "--max-recurse"; - constexpr StringLiteral OPTION_SORT = "--sort"; - - constexpr int NO_RECURSE_LIMIT_VALUE = -1; - - constexpr std::array DEPEND_SWITCHES = { - {{OPTION_DOT, "Creates graph on basis of dot"}, - {OPTION_DGML, "Creates graph on basis of dgml"}, - {OPTION_SHOW_DEPTH, "Show recursion depth in output"}}}; - - constexpr std::array DEPEND_SETTINGS = { - {{OPTION_MAX_RECURSE, "Set max recursion depth, a value of -1 indicates no limit"}, - {OPTION_SORT, - "Set sort order for the list of dependencies, accepted values are: lexicographical, topological " - "(default), " - "reverse"}}}; - - struct PackageDependInfo - { - std::string package; - int depth; - std::unordered_set features; - std::vector dependencies; - }; - - enum SortMode - { - Lexicographical = 0, - Topological, - ReverseTopological, - Default = Topological - }; - - int get_max_depth(const ParsedArguments& options) - { - auto iter = options.settings.find(OPTION_MAX_RECURSE); - if (iter != options.settings.end()) - { - std::string value = iter->second; - try - { - return std::stoi(value); - } - catch (std::exception&) - { - Checks::exit_with_message(VCPKG_LINE_INFO, "Value of --max-depth must be an integer"); - } - } - // No --max-depth set, default to no limit. - return NO_RECURSE_LIMIT_VALUE; - } - - SortMode get_sort_mode(const ParsedArguments& options) - { - constexpr StringLiteral OPTION_SORT_LEXICOGRAPHICAL = "lexicographical"; - constexpr StringLiteral OPTION_SORT_TOPOLOGICAL = "topological"; - constexpr StringLiteral OPTION_SORT_REVERSE = "reverse"; - - static const std::map sortModesMap{{OPTION_SORT_LEXICOGRAPHICAL, Lexicographical}, - {OPTION_SORT_TOPOLOGICAL, Topological}, - {OPTION_SORT_REVERSE, ReverseTopological}}; - - auto iter = options.settings.find(OPTION_SORT); - if (iter != options.settings.end()) - { - const std::string value = Strings::ascii_to_lowercase(std::string{iter->second}); - auto it = sortModesMap.find(value); - if (it != sortModesMap.end()) - { - return it->second; - } - Checks::exit_with_message(VCPKG_LINE_INFO, - "Value of --sort must be one of `%s`, `%s`, or `%s`", - OPTION_SORT_LEXICOGRAPHICAL, - OPTION_SORT_TOPOLOGICAL, - OPTION_SORT_REVERSE); - } - return Default; - } - - std::string create_dot_as_string(const std::vector& depend_info) - { - int empty_node_count = 0; - - std::string s; - s.append("digraph G{ rankdir=LR; edge [minlen=3]; overlap=false;"); - - for (const auto& package : depend_info) - { - if (package.dependencies.empty()) - { - empty_node_count++; - continue; - } - - const std::string name = Strings::replace_all(std::string{package.package}, "-", "_"); - s.append(Strings::format("%s;", name)); - for (const auto& d : package.dependencies) - { - const std::string dependency_name = Strings::replace_all(std::string{d}, "-", "_"); - s.append(Strings::format("%s -> %s;", name, dependency_name)); - } - } - - s.append(Strings::format("empty [label=\"%d singletons...\"]; }", empty_node_count)); - return s; - } - - std::string create_dgml_as_string(const std::vector& depend_info) - { - std::string s; - s.append(""); - s.append(""); - - std::string nodes, links; - for (const auto& package : depend_info) - { - const std::string name = package.package; - nodes.append(Strings::format("", name)); - - // Iterate over dependencies. - for (const auto& d : package.dependencies) - { - links.append(Strings::format("", name, d)); - } - } - - s.append(Strings::format("%s", nodes)); - - s.append(Strings::format("%s", links)); - - s.append(""); - return s; - } - - std::string create_graph_as_string(const std::unordered_set& switches, - const std::vector& depend_info) - { - if (Util::Sets::contains(switches, OPTION_DOT)) - { - return create_dot_as_string(depend_info); - } - else if (Util::Sets::contains(switches, OPTION_DGML)) - { - return create_dgml_as_string(depend_info); - } - return ""; - } - - void assign_depth_to_dependencies(const std::string& package, - const int depth, - const int max_depth, - std::map& dependencies_map) - { - auto iter = dependencies_map.find(package); - Checks::check_exit( - VCPKG_LINE_INFO, iter != dependencies_map.end(), "Package not found in dependency graph"); - - PackageDependInfo& info = iter->second; - - if (depth > info.depth) - { - info.depth = depth; - if (depth < max_depth || max_depth == NO_RECURSE_LIMIT_VALUE) - { - for (auto&& dependency : info.dependencies) - { - assign_depth_to_dependencies(dependency, depth + 1, max_depth, dependencies_map); - } - } - } - } - - std::vector extract_depend_info(const std::vector& install_actions, - const int max_depth) - { - std::map package_dependencies; - for (const InstallPlanAction* pia : install_actions) - { - const InstallPlanAction& install_action = *pia; - - const std::vector dependencies = Util::fmap( - install_action.package_dependencies, [](const PackageSpec& spec) { return spec.name(); }); - - std::unordered_set features{install_action.feature_list.begin(), - install_action.feature_list.end()}; - features.erase("core"); - - std::string port_name = install_action.spec.name(); - - PackageDependInfo info{port_name, -1, features, dependencies}; - package_dependencies.emplace(port_name, std::move(info)); - } - - const InstallPlanAction& init = *install_actions.back(); - assign_depth_to_dependencies(init.spec.name(), 0, max_depth, package_dependencies); - - std::vector out = - Util::fmap(package_dependencies, [](auto&& kvpair) -> PackageDependInfo { return kvpair.second; }); - Util::erase_remove_if(out, [](auto&& info) { return info.depth < 0; }); - return out; - } - } - - const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("depend-info sqlite3"), - 1, - 1, - {DEPEND_SWITCHES, DEPEND_SETTINGS}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) - { - const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); - const int max_depth = get_max_depth(options); - const SortMode sort_mode = get_sort_mode(options); - const bool show_depth = Util::Sets::contains(options.switches, OPTION_SHOW_DEPTH); - - const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { - return Input::check_and_get_full_package_spec( - std::string{arg}, default_triplet, COMMAND_STRUCTURE.example_text); - }); - - for (auto&& spec : specs) - { - Input::check_triplet(spec.package_spec.triplet(), paths); - } - - PathsPortFileProvider provider(paths, args.overlay_ports.get()); - auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); - auto& var_provider = *var_provider_storage; - - // By passing an empty status_db, we should get a plan containing all dependencies. - // All actions in the plan should be install actions, as there's no installed packages to remove. - StatusParagraphs status_db; - auto action_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, status_db); - Checks::check_exit( - VCPKG_LINE_INFO, action_plan.remove_actions.empty(), "Only install actions should exist in the plan"); - std::vector install_actions = - Util::fmap(action_plan.already_installed, [&](const auto& action) { return &action; }); - for (auto&& action : action_plan.install_actions) - install_actions.push_back(&action); - - std::vector depend_info = extract_depend_info(install_actions, max_depth); - - if (Util::Sets::contains(options.switches, OPTION_DOT) || Util::Sets::contains(options.switches, OPTION_DGML)) - { - const std::vector source_control_files = - Util::fmap(install_actions, [](const InstallPlanAction* install_action) { - const SourceControlFileLocation& scfl = - install_action->source_control_file_location.value_or_exit(VCPKG_LINE_INFO); - return const_cast(scfl.source_control_file.get()); - }); - - const std::string graph_as_string = create_graph_as_string(options.switches, depend_info); - System::print2(graph_as_string, '\n'); - Checks::exit_success(VCPKG_LINE_INFO); - } - - // TODO: Improve this code - auto lex = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { - return lhs.package < rhs.package; - }; - auto topo = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { - return lhs.depth > rhs.depth; - }; - auto reverse = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { - return lhs.depth < rhs.depth; - }; - - switch (sort_mode) - { - case SortMode::Lexicographical: std::sort(std::begin(depend_info), std::end(depend_info), lex); break; - case SortMode::ReverseTopological: - std::sort(std::begin(depend_info), std::end(depend_info), reverse); - break; - case SortMode::Topological: std::sort(std::begin(depend_info), std::end(depend_info), topo); break; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - - for (auto&& info : depend_info) - { - if (info.depth >= 0) - { - std::string features = Strings::join(", ", info.features); - const std::string dependencies = Strings::join(", ", info.dependencies); - - if (show_depth) - { - System::print2(System::Color::error, "(", info.depth, ") "); - } - System::print2(System::Color::success, info.package); - if (!features.empty()) - { - System::print2("["); - System::print2(System::Color::warning, features); - System::print2("]"); - } - System::print2(": ", dependencies, "\n"); - } - } - Checks::exit_success(VCPKG_LINE_INFO); - } -} +#include "pch.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +using vcpkg::Dependencies::ActionPlan; +using vcpkg::Dependencies::InstallPlanAction; +using vcpkg::PortFileProvider::PathsPortFileProvider; + +namespace vcpkg::Commands::DependInfo +{ + namespace + { + constexpr StringLiteral OPTION_DOT = "dot"; + constexpr StringLiteral OPTION_DGML = "dgml"; + constexpr StringLiteral OPTION_SHOW_DEPTH = "show-depth"; + constexpr StringLiteral OPTION_MAX_RECURSE = "max-recurse"; + constexpr StringLiteral OPTION_SORT = "sort"; + + constexpr int NO_RECURSE_LIMIT_VALUE = -1; + + constexpr std::array DEPEND_SWITCHES = { + {{OPTION_DOT, "Creates graph on basis of dot"}, + {OPTION_DGML, "Creates graph on basis of dgml"}, + {OPTION_SHOW_DEPTH, "Show recursion depth in output"}}}; + + constexpr std::array DEPEND_SETTINGS = { + {{OPTION_MAX_RECURSE, "Set max recursion depth, a value of -1 indicates no limit"}, + {OPTION_SORT, + "Set sort order for the list of dependencies, accepted values are: lexicographical, topological " + "(default), " + "reverse"}}}; + + struct PackageDependInfo + { + std::string package; + int depth; + std::unordered_set features; + std::vector dependencies; + }; + + enum SortMode + { + Lexicographical = 0, + Topological, + ReverseTopological, + Default = Topological + }; + + int get_max_depth(const ParsedArguments& options) + { + auto iter = options.settings.find(OPTION_MAX_RECURSE); + if (iter != options.settings.end()) + { + std::string value = iter->second; + try + { + return std::stoi(value); + } + catch (std::exception&) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "Value of --max-depth must be an integer"); + } + } + // No --max-depth set, default to no limit. + return NO_RECURSE_LIMIT_VALUE; + } + + SortMode get_sort_mode(const ParsedArguments& options) + { + constexpr StringLiteral OPTION_SORT_LEXICOGRAPHICAL = "lexicographical"; + constexpr StringLiteral OPTION_SORT_TOPOLOGICAL = "topological"; + constexpr StringLiteral OPTION_SORT_REVERSE = "reverse"; + + static const std::map sortModesMap{{OPTION_SORT_LEXICOGRAPHICAL, Lexicographical}, + {OPTION_SORT_TOPOLOGICAL, Topological}, + {OPTION_SORT_REVERSE, ReverseTopological}}; + + auto iter = options.settings.find(OPTION_SORT); + if (iter != options.settings.end()) + { + const std::string value = Strings::ascii_to_lowercase(std::string{iter->second}); + auto it = sortModesMap.find(value); + if (it != sortModesMap.end()) + { + return it->second; + } + Checks::exit_with_message(VCPKG_LINE_INFO, + "Value of --sort must be one of `%s`, `%s`, or `%s`", + OPTION_SORT_LEXICOGRAPHICAL, + OPTION_SORT_TOPOLOGICAL, + OPTION_SORT_REVERSE); + } + return Default; + } + + std::string create_dot_as_string(const std::vector& depend_info) + { + int empty_node_count = 0; + + std::string s; + s.append("digraph G{ rankdir=LR; edge [minlen=3]; overlap=false;"); + + for (const auto& package : depend_info) + { + if (package.dependencies.empty()) + { + empty_node_count++; + continue; + } + + const std::string name = Strings::replace_all(std::string{package.package}, "-", "_"); + s.append(Strings::format("%s;", name)); + for (const auto& d : package.dependencies) + { + const std::string dependency_name = Strings::replace_all(std::string{d}, "-", "_"); + s.append(Strings::format("%s -> %s;", name, dependency_name)); + } + } + + s.append(Strings::format("empty [label=\"%d singletons...\"]; }", empty_node_count)); + return s; + } + + std::string create_dgml_as_string(const std::vector& depend_info) + { + std::string s; + s.append(""); + s.append(""); + + std::string nodes, links; + for (const auto& package : depend_info) + { + const std::string name = package.package; + nodes.append(Strings::format("", name)); + + // Iterate over dependencies. + for (const auto& d : package.dependencies) + { + links.append(Strings::format("", name, d)); + } + } + + s.append(Strings::format("%s", nodes)); + + s.append(Strings::format("%s", links)); + + s.append(""); + return s; + } + + std::string create_graph_as_string(const std::unordered_set& switches, + const std::vector& depend_info) + { + if (Util::Sets::contains(switches, OPTION_DOT)) + { + return create_dot_as_string(depend_info); + } + else if (Util::Sets::contains(switches, OPTION_DGML)) + { + return create_dgml_as_string(depend_info); + } + return ""; + } + + void assign_depth_to_dependencies(const std::string& package, + const int depth, + const int max_depth, + std::map& dependencies_map) + { + auto iter = dependencies_map.find(package); + Checks::check_exit( + VCPKG_LINE_INFO, iter != dependencies_map.end(), "Package not found in dependency graph"); + + PackageDependInfo& info = iter->second; + + if (depth > info.depth) + { + info.depth = depth; + if (depth < max_depth || max_depth == NO_RECURSE_LIMIT_VALUE) + { + for (auto&& dependency : info.dependencies) + { + assign_depth_to_dependencies(dependency, depth + 1, max_depth, dependencies_map); + } + } + } + } + + std::vector extract_depend_info(const std::vector& install_actions, + const int max_depth) + { + std::map package_dependencies; + for (const InstallPlanAction* pia : install_actions) + { + const InstallPlanAction& install_action = *pia; + + const std::vector dependencies = Util::fmap( + install_action.package_dependencies, [](const PackageSpec& spec) { return spec.name(); }); + + std::unordered_set features{install_action.feature_list.begin(), + install_action.feature_list.end()}; + features.erase("core"); + + std::string port_name = install_action.spec.name(); + + PackageDependInfo info{port_name, -1, features, dependencies}; + package_dependencies.emplace(port_name, std::move(info)); + } + + const InstallPlanAction& init = *install_actions.back(); + assign_depth_to_dependencies(init.spec.name(), 0, max_depth, package_dependencies); + + std::vector out = + Util::fmap(package_dependencies, [](auto&& kvpair) -> PackageDependInfo { return kvpair.second; }); + Util::erase_remove_if(out, [](auto&& info) { return info.depth < 0; }); + return out; + } + } + + const CommandStructure COMMAND_STRUCTURE = { + create_example_string("depend-info sqlite3"), + 1, + 1, + {DEPEND_SWITCHES, DEPEND_SETTINGS}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) + { + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + const int max_depth = get_max_depth(options); + const SortMode sort_mode = get_sort_mode(options); + const bool show_depth = Util::Sets::contains(options.switches, OPTION_SHOW_DEPTH); + + const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { + return Input::check_and_get_full_package_spec( + std::string{arg}, default_triplet, COMMAND_STRUCTURE.example_text); + }); + + for (auto&& spec : specs) + { + Input::check_triplet(spec.package_spec.triplet(), paths); + } + + PathsPortFileProvider provider(paths, args.overlay_ports); + auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); + auto& var_provider = *var_provider_storage; + + // By passing an empty status_db, we should get a plan containing all dependencies. + // All actions in the plan should be install actions, as there's no installed packages to remove. + StatusParagraphs status_db; + auto action_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, status_db); + Checks::check_exit( + VCPKG_LINE_INFO, action_plan.remove_actions.empty(), "Only install actions should exist in the plan"); + std::vector install_actions = + Util::fmap(action_plan.already_installed, [&](const auto& action) { return &action; }); + for (auto&& action : action_plan.install_actions) + install_actions.push_back(&action); + + std::vector depend_info = extract_depend_info(install_actions, max_depth); + + if (Util::Sets::contains(options.switches, OPTION_DOT) || Util::Sets::contains(options.switches, OPTION_DGML)) + { + const std::vector source_control_files = + Util::fmap(install_actions, [](const InstallPlanAction* install_action) { + const SourceControlFileLocation& scfl = + install_action->source_control_file_location.value_or_exit(VCPKG_LINE_INFO); + return const_cast(scfl.source_control_file.get()); + }); + + const std::string graph_as_string = create_graph_as_string(options.switches, depend_info); + System::print2(graph_as_string, '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } + + // TODO: Improve this code + auto lex = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { + return lhs.package < rhs.package; + }; + auto topo = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { + return lhs.depth > rhs.depth; + }; + auto reverse = [](const PackageDependInfo& lhs, const PackageDependInfo& rhs) -> bool { + return lhs.depth < rhs.depth; + }; + + switch (sort_mode) + { + case SortMode::Lexicographical: std::sort(std::begin(depend_info), std::end(depend_info), lex); break; + case SortMode::ReverseTopological: + std::sort(std::begin(depend_info), std::end(depend_info), reverse); + break; + case SortMode::Topological: std::sort(std::begin(depend_info), std::end(depend_info), topo); break; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + + for (auto&& info : depend_info) + { + if (info.depth >= 0) + { + std::string features = Strings::join(", ", info.features); + const std::string dependencies = Strings::join(", ", info.dependencies); + + if (show_depth) + { + System::print2(System::Color::error, "(", info.depth, ") "); + } + System::print2(System::Color::success, info.package); + if (!features.empty()) + { + System::print2("["); + System::print2(System::Color::warning, features); + System::print2("]"); + } + System::print2(": ", dependencies, "\n"); + } + } + 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 8391b3476df7d4..fb3b66883876ad 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -3,21 +3,24 @@ #include #include #include -#include + +#include #include #include -namespace vcpkg::Commands::Edit -{ +#include + #if defined(_WIN32) - static std::vector find_from_registry() +namespace +{ + std::vector find_from_registry() { std::vector output; struct RegKey { HKEY root; - StringLiteral subkey; + vcpkg::StringLiteral subkey; } REGKEYS[] = { {HKEY_LOCAL_MACHINE, R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)"}, @@ -33,8 +36,8 @@ namespace vcpkg::Commands::Edit for (auto&& keypath : REGKEYS) { - const Optional code_installpath = - System::get_registry_string(keypath.root, keypath.subkey, "InstallLocation"); + const vcpkg::Optional code_installpath = + vcpkg::System::get_registry_string(keypath.root, keypath.subkey, "InstallLocation"); if (const auto c = code_installpath.get()) { const fs::path install_path = fs::u8path(*c); @@ -44,11 +47,42 @@ namespace vcpkg::Commands::Edit } return output; } + + std::string expand_environment_strings(const std::string& input) + { + const auto widened = vcpkg::Strings::to_utf16(input); + std::wstring result; + result.resize(result.capacity()); + bool done; + do + { + if (result.size() == ULONG_MAX) + { + vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); // integer overflow + } + + const auto required_size = + ExpandEnvironmentStringsW(widened.c_str(), &result[0], static_cast(result.size() + 1)); + if (required_size == 0) + { + vcpkg::System::print2(vcpkg::System::Color::error, "Error: could not expand the environment string:\n"); + vcpkg::System::print2(vcpkg::System::Color::error, input); + vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + } + + done = required_size <= result.size() + 1; + result.resize(required_size - 1); + } while (!done); + return vcpkg::Strings::to_utf8(result); + } +} #endif - static constexpr StringLiteral OPTION_BUILDTREES = "--buildtrees"; +namespace vcpkg::Commands::Edit +{ + static constexpr StringLiteral OPTION_BUILDTREES = "buildtrees"; - static constexpr StringLiteral OPTION_ALL = "--all"; + static constexpr StringLiteral OPTION_ALL = "all"; static std::vector valid_arguments(const VcpkgPaths& paths) { @@ -63,7 +97,7 @@ namespace vcpkg::Commands::Edit {OPTION_ALL, "Open editor into the port as well as the port-specific buildtree subfolder"}}}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("edit zlib"), + create_example_string("edit zlib"), 1, 10, {EDIT_SWITCHES, {}}, @@ -83,7 +117,7 @@ namespace vcpkg::Commands::Edit return Util::fmap(ports, [&](const std::string& port_name) -> std::string { const auto portpath = paths.ports / port_name; const auto portfile = portpath / "portfile.cmake"; - const auto buildtrees_current_dir = paths.buildtrees / port_name; + const auto buildtrees_current_dir = paths.build_dir(port_name); const auto pattern = port_name + "_"; std::string package_paths; @@ -106,8 +140,7 @@ namespace vcpkg::Commands::Edit if (Util::Sets::contains(options.switches, OPTION_BUILDTREES)) { return Util::fmap(ports, [&](const std::string& port_name) -> std::string { - const auto buildtrees_current_dir = paths.buildtrees / port_name; - return Strings::format(R"###("%s")###", buildtrees_current_dir.u8string()); + return Strings::format(R"###("%s")###", paths.build_dir(port_name).u8string()); }); } @@ -171,17 +204,12 @@ namespace vcpkg::Commands::Edit const auto txt_default = System::get_registry_string(HKEY_CLASSES_ROOT, R"(.txt\ShellNew)", "ItemName"); if (const auto entry = txt_default.get()) { -#ifdef UNICODE - LPWSTR dst = new wchar_t[MAX_PATH]; - ExpandEnvironmentStrings(Strings::to_utf16(*entry).c_str(), dst, MAX_PATH); - auto full_path = Strings::to_utf8(dst); -#else - LPSTR dst = new char[MAX_PATH]; - ExpandEnvironmentStrings(entry->c_str(), dst, MAX_PATH); - auto full_path = std::string(dst); -#endif - auto begin = full_path.find_first_not_of('@'); - candidate_paths.push_back(fs::u8path(full_path.substr(begin, full_path.find_first_of(',') - begin))); + auto full_path = expand_environment_strings(*entry); + auto first = full_path.begin(); + const auto last = full_path.end(); + first = std::find_if_not(first, last, [](const char c) { return c == '@'; }); + const auto comma = std::find(first, last, ','); + candidate_paths.push_back(fs::u8path(first, comma)); } #elif defined(__APPLE__) candidate_paths.push_back( @@ -239,4 +267,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 ca398068f32c7d..f1d84571f91f3f 100644 --- a/toolsrc/src/vcpkg/commands.env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -5,16 +5,16 @@ #include #include -#include +#include #include namespace vcpkg::Commands::Env { - static constexpr StringLiteral OPTION_BIN = "--bin"; - static constexpr StringLiteral OPTION_INCLUDE = "--include"; - static constexpr StringLiteral OPTION_DEBUG_BIN = "--debug-bin"; - static constexpr StringLiteral OPTION_TOOLS = "--tools"; - static constexpr StringLiteral OPTION_PYTHON = "--python"; + static constexpr StringLiteral OPTION_BIN = "bin"; + static constexpr StringLiteral OPTION_INCLUDE = "include"; + static constexpr StringLiteral OPTION_DEBUG_BIN = "debug-bin"; + static constexpr StringLiteral OPTION_TOOLS = "tools"; + static constexpr StringLiteral OPTION_PYTHON = "python"; static constexpr std::array SWITCHES = {{ {OPTION_BIN, "Add installed bin/ to PATH"}, @@ -25,7 +25,7 @@ namespace vcpkg::Commands::Env }}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("env --triplet x64-windows"), + create_example_string("env --triplet x64-windows"), 0, 1, {SWITCHES, {}}, @@ -39,7 +39,7 @@ namespace vcpkg::Commands::Env const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; @@ -99,4 +99,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..6de20c0b0ca7cd --- /dev/null +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -0,0 +1,29 @@ +#include "pch.h" + +#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) + { + Util::unused(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(tool_path.u8string(), '\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 new file mode 100644 index 00000000000000..d0eced7ea4eeb1 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp @@ -0,0 +1,289 @@ +#include "pch.h" + +#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 = manifest_path.u8string(); + 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 scf = SourceControlFile::parse_manifest_file(manifest_path, parsed_json.object()); + 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 = control_path.u8string(); + 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 = data.original_path.u8string(); + auto file_to_write_string = data.file_to_write.u8string(); + 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."}, + {OPTION_CONVERT_CONTROL, "Convert CONTROL files to manifest files."}, + }; + + const CommandStructure COMMAND_STRUCTURE = { + create_example_string(R"###(x-format-manifest --all)###"), + 0, + SIZE_MAX, + {FORMAT_SWITCHES, {}, {}}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE); + + auto& fs = paths.get_filesystem(); + bool has_error = false; + + 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) + { + 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); + if (path.is_relative()) + { + path = paths.original_cwd / path; + } + + if (path.filename() == fs::u8path("CONTROL")) + { + add_file(read_control_file(fs, std::move(path))); + } + else + { + add_file(read_manifest(fs, std::move(path))); + } + } + + if (format_all) + { + for (const auto& dir : fs::directory_iterator(paths.ports)) + { + 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", + dir.path().u8string()); + + 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); + } + else + { + System::print2("Succeeded in formatting the manifest files.\n"); + 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..12ad1554d19f67 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -0,0 +1,39 @@ +#include "pch.h" + +#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) + { + 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); + } + + 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.import.cpp b/toolsrc/src/vcpkg/commands.import.cpp deleted file mode 100644 index 521892e88d54fe..00000000000000 --- a/toolsrc/src/vcpkg/commands.import.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "pch.h" - -#include -#include -#include -#include -#include - -namespace vcpkg::Commands::Import -{ - struct Binaries - { - std::vector dlls; - std::vector libs; - }; - - static void check_is_directory(const LineInfo& line_info, const Files::Filesystem& fs, const fs::path& dirpath) - { - Checks::check_exit(line_info, fs.is_directory(dirpath), "The path %s is not a directory", dirpath.string()); - } - - static Binaries find_binaries_in_dir(const Files::Filesystem& fs, const fs::path& path) - { - auto files = fs.get_files_recursive(path); - - check_is_directory(VCPKG_LINE_INFO, fs, path); - - Binaries binaries; - for (auto&& file : files) - { - if (fs.is_directory(file)) continue; - const auto ext = file.extension(); - if (ext == ".dll") - binaries.dlls.push_back(std::move(file)); - else if (ext == ".lib") - binaries.libs.push_back(std::move(file)); - } - return binaries; - } - - static void copy_files_into_directory(Files::Filesystem& fs, - const std::vector& files, - const fs::path& destination_folder) - { - std::error_code ec; - fs.create_directory(destination_folder, ec); - - for (auto const& src_path : files) - { - const fs::path dest_path = destination_folder / src_path.filename(); - fs.copy(src_path, dest_path, fs::copy_options::overwrite_existing); - } - } - - static void place_library_files_in(Files::Filesystem& fs, - const fs::path& include_directory, - const fs::path& project_directory, - const fs::path& destination_path) - { - check_is_directory(VCPKG_LINE_INFO, fs, include_directory); - check_is_directory(VCPKG_LINE_INFO, fs, project_directory); - check_is_directory(VCPKG_LINE_INFO, fs, destination_path); - const Binaries debug_binaries = find_binaries_in_dir(fs, project_directory / "Debug"); - const Binaries release_binaries = find_binaries_in_dir(fs, project_directory / "Release"); - - const fs::path destination_include_directory = destination_path / "include"; - fs.copy(include_directory, - destination_include_directory, - fs::copy_options::recursive | fs::copy_options::overwrite_existing); - - copy_files_into_directory(fs, release_binaries.dlls, destination_path / "bin"); - copy_files_into_directory(fs, release_binaries.libs, destination_path / "lib"); - - std::error_code ec; - fs.create_directory(destination_path / "debug", ec); - copy_files_into_directory(fs, debug_binaries.dlls, destination_path / "debug" / "bin"); - copy_files_into_directory(fs, debug_binaries.libs, destination_path / "debug" / "lib"); - } - - static void do_import(const VcpkgPaths& paths, - const fs::path& include_directory, - const fs::path& project_directory, - const BinaryParagraph& control_file_data) - { - auto& fs = paths.get_filesystem(); - const fs::path library_destination_path = paths.package_dir(control_file_data.spec); - std::error_code ec; - fs.create_directory(library_destination_path, ec); - place_library_files_in(paths.get_filesystem(), include_directory, project_directory, library_destination_path); - - const fs::path control_file_path = library_destination_path / "CONTROL"; - fs.write_contents(control_file_path, Strings::serialize(control_file_data), VCPKG_LINE_INFO); - } - - const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"), - 3, - 3, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - - const fs::path control_file_path(args.command_arguments[0]); - const fs::path include_directory(args.command_arguments[1]); - const fs::path project_directory(args.command_arguments[2]); - - const auto pghs = Paragraphs::get_single_paragraph(paths.get_filesystem(), control_file_path); - Checks::check_exit(VCPKG_LINE_INFO, - pghs.get() != nullptr, - "Invalid control file %s for package", - control_file_path.generic_u8string(), - "\n", - pghs.error()); - - StatusParagraph spgh; - spgh.package = BinaryParagraph(*pghs.get()); - auto& control_file_data = spgh.package; - - do_import(paths, include_directory, project_directory, control_file_data); - Checks::exit_success(VCPKG_LINE_INFO); - } -} diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index b427cb2475139d..0bb30cb85d5977 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -6,14 +6,15 @@ #include #include #include -#include + +#include #include #include namespace vcpkg::Commands::Integrate { #if defined(_WIN32) - static std::string create_appdata_targets_shortcut(const std::string& target_path) noexcept + static std::string create_appdata_shortcut(const std::string& target_path) noexcept { return Strings::format(R"###( @@ -34,6 +35,7 @@ namespace vcpkg::Commands::Integrate $(LOCALAPPDATA)\vcpkg\vcpkg.user + )###"; @@ -79,7 +81,7 @@ namespace vcpkg::Commands::Integrate dir_id.erase(1, 1); // Erasing the ":" // NuGet id cannot have invalid characters. We will only use alphanumeric and dot. - Util::erase_remove_if(dir_id, [](char c) { return !isalnum(c) && (c != '.'); }); + Util::erase_remove_if(dir_id, [](char c) { return !isalnum(static_cast(c)) && (c != '.'); }); const std::string nuget_id = "vcpkg." + dir_id; return nuget_id; @@ -154,9 +156,13 @@ namespace vcpkg::Commands::Integrate #if defined(_WIN32) static fs::path get_appdata_targets_path() { - static const fs::path LOCAL_APP_DATA = - fs::u8path(System::get_environment_variable("LOCALAPPDATA").value_or_exit(VCPKG_LINE_INFO)); - return LOCAL_APP_DATA / "vcpkg" / "vcpkg.user.targets"; + return System::get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / fs::u8path("vcpkg/vcpkg.user.targets"); + } +#endif +#if defined(_WIN32) + static fs::path get_appdata_props_path() + { + return System::get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / fs::u8path("vcpkg/vcpkg.user.props"); } #endif @@ -248,7 +254,7 @@ namespace vcpkg::Commands::Integrate const fs::path appdata_src_path = tmp_dir / "vcpkg.user.targets"; fs.write_contents(appdata_src_path, - create_appdata_targets_shortcut(paths.buildsystems_msbuild_targets.u8string()), + create_appdata_shortcut(paths.buildsystems_msbuild_targets.u8string()), VCPKG_LINE_INFO); auto appdata_dst_path = get_appdata_targets_path(); @@ -264,6 +270,26 @@ namespace vcpkg::Commands::Integrate "\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()), + VCPKG_LINE_INFO); + auto appdata_dst_path2 = get_appdata_props_path(); + + const auto rc2 = + fs.copy_file(appdata_src_path2, appdata_dst_path2, fs::copy_options::overwrite_existing, ec); + + if (!rc2 || ec) + { + System::print2(System::Color::error, + "Error: Failed to copy file: ", + appdata_src_path2.u8string(), + " -> ", + appdata_dst_path2.u8string(), + "\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } } #endif @@ -304,6 +330,11 @@ CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s" was_deleted |= fs.remove(path, ec); Checks::check_exit(VCPKG_LINE_INFO, !ec, "Error: Unable to remove user-wide integration: %s", ec.message()); + + const fs::path path2 = get_appdata_props_path(); + + was_deleted |= fs.remove(path2, ec); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Error: Unable to remove user-wide integration: %s", ec.message()); #endif was_deleted |= fs.remove(get_path_txt_path(), ec); @@ -446,19 +477,27 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console } #endif + void append_helpstring(HelpTableFormatter& table) + { #if defined(_WIN32) - const char* const INTEGRATE_COMMAND_HELPSTRING = - " vcpkg integrate install Make installed packages available user-wide. Requires admin privileges on " - "first use\n" - " vcpkg integrate remove Remove user-wide integration\n" - " vcpkg integrate project Generate a referencing nuget package for individual VS project use\n" - " vcpkg integrate powershell Enable PowerShell tab-completion\n"; -#else - const char* const INTEGRATE_COMMAND_HELPSTRING = - " vcpkg integrate install Make installed packages available user-wide.\n" - " vcpkg integrate remove Remove user-wide integration\n" - " vcpkg integrate bash Enable bash tab-completion\n"; -#endif + table.format("vcpkg integrate install", + "Make installed packages available user-wide. Requires admin privileges on first use"); + table.format("vcpkg integrate remove", "Remove user-wide integration"); + table.format("vcpkg integrate project", "Generate a referencing nuget package for individual VS project use"); + table.format("vcpkg integrate powershell", "Enable PowerShell tab-completion"); +#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv + table.format("vcpkg integrate install", "Make installed packages available user-wide"); + table.format("vcpkg integrate remove", "Remove user-wide integration"); + table.format("vcpkg integrate bash", "Enable bash tab-completion"); +#endif // ^^^ !defined(_WIN32) + } + + std::string get_helpstring() + { + HelpTableFormatter table; + append_helpstring(table); + return std::move(table.m_str); + } namespace Subcommand { @@ -483,9 +522,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console } const CommandStructure COMMAND_STRUCTURE = { - Strings::format("Commands:\n" - "%s", - INTEGRATE_COMMAND_HELPSTRING), + "Commands:\n" + get_helpstring(), 1, 1, {}, @@ -522,4 +559,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 71738427cc5cba..b271841f479513 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -1,38 +1,89 @@ #include "pch.h" #include -#include + +#include #include #include +#include namespace vcpkg::Commands::List { - static constexpr StringLiteral OPTION_FULLDESC = - "--x-full-desc"; // TODO: This should find a better home, eventually + 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; + for (const StatusParagraph* status_paragraph : installed_packages) + { + auto current_spec = status_paragraph->package.spec; + if (obj.contains(current_spec.to_string())) + { + if (status_paragraph->package.is_feature()) + { + Json::Value* value_obj = obj.get(current_spec.to_string()); + auto& feature_list = value_obj->object()["features"].array(); + feature_list.push_back(Json::Value::string(status_paragraph->package.feature)); + } + } + else + { + Json::Object& library_obj = obj.insert(current_spec.to_string(), Json::Object()); + library_obj.insert("package_name", Json::Value::string(current_spec.name())); + library_obj.insert("triplet", Json::Value::string(current_spec.triplet().to_string())); + library_obj.insert("version", Json::Value::string(status_paragraph->package.version)); + library_obj.insert("port_version", Json::Value::integer(status_paragraph->package.port_version)); + Json::Array& features_array = library_obj.insert("features", Json::Array()); + if (status_paragraph->package.is_feature()) + { + features_array.push_back(Json::Value::string(status_paragraph->package.feature)); + } + Json::Array& desc = library_obj.insert("desc", Json::Array()); + for (const auto& line : status_paragraph->package.description) + { + desc.push_back(Json::Value::string(line)); + } + } + } + + System::print2(Json::stringify(obj, Json::JsonStyle{})); + } static void do_print(const StatusParagraph& pgh, const bool full_desc) { + auto full_version = VersionT(pgh.package.version, pgh.package.port_version).to_string(); if (full_desc) { - System::printf("%-50s %-16s %s\n", pgh.package.displayname(), pgh.package.version, pgh.package.description); + System::printf("%-50s %-16s %s\n", + pgh.package.displayname(), + full_version, + Strings::join("\n ", pgh.package.description)); } else { + std::string description; + if (!pgh.package.description.empty()) + { + description = pgh.package.description[0]; + } System::printf("%-50s %-16s %s\n", vcpkg::shorten_text(pgh.package.displayname(), 50), - vcpkg::shorten_text(pgh.package.version, 16), - vcpkg::shorten_text(pgh.package.description, 51)); + vcpkg::shorten_text(full_version, 16), + vcpkg::shorten_text(description, 51)); } } - 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 = { Strings::format( "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", - Help::create_example_string("list png")), + create_example_string("list png")), 0, 1, {LIST_SWITCHES, {}}, @@ -64,29 +115,34 @@ 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()) + if (!args.command_arguments.empty()) { - for (const StatusParagraph* status_paragraph : installed_packages) - { - do_print(*status_paragraph, enable_fulldesc); - } + auto& query = args.command_arguments[0]; + auto pghs = Util::filter(installed_packages, [query](const StatusParagraph* status_paragraph) { + return Strings::case_insensitive_ascii_contains(status_paragraph->package.displayname(), query); + }); + installed_packages = pghs; + } + + if (enable_json) + { + do_print_json(installed_packages); } else { - // At this point there is 1 argument for (const StatusParagraph* status_paragraph : installed_packages) { - const std::string displayname = status_paragraph->package.displayname(); - if (!Strings::case_insensitive_ascii_contains(displayname, args.command_arguments[0])) - { - continue; - } - do_print(*status_paragraph, enable_fulldesc); } } 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 58ed69e8b7c1b4..0850b14c980ee0 100644 --- a/toolsrc/src/vcpkg/commands.owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -1,7 +1,8 @@ #include "pch.h" #include -#include + +#include #include #include @@ -24,8 +25,7 @@ namespace vcpkg::Commands::Owns } } const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be a pattern to search for. %s", - Help::create_example_string("owns zlib.dll")), + Strings::format("The argument should be a pattern to search for. %s", create_example_string("owns zlib.dll")), 1, 1, {}, @@ -40,4 +40,9 @@ namespace vcpkg::Commands::Owns 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 44fccbb7fec746..c06517f3c9075d 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -1,12 +1,12 @@ #include "pch.h" -#include -#include - #include #include #include +#include +#include + namespace vcpkg::Commands::PortHistory { struct PortControlVersion @@ -36,8 +36,14 @@ namespace vcpkg::Commands::PortHistory const std::string cmd = Strings::format(R"(show %s:ports/%s/CONTROL)", commit_id, port_name); auto output = run_git_command(paths, cmd); - const auto version = Strings::find_at_most_one_enclosed(output.output, "Version: ", "\n"); + const auto version = Strings::find_at_most_one_enclosed(output.output, "\nVersion: ", "\n"); + const auto port_version = Strings::find_at_most_one_enclosed(output.output, "\nPort-Version: ", "\n"); Checks::check_exit(VCPKG_LINE_INFO, version.has_value(), "CONTROL file does not have a 'Version' field"); + if (auto pv = port_version.get()) + { + return Strings::format("%s#%s", version.get()->to_string(), pv->to_string()); + } + return version.get()->to_string(); } @@ -48,8 +54,8 @@ namespace vcpkg::Commands::PortHistory auto output = run_git_command(paths, cmd); auto commits = Util::fmap( - Strings::split(output.output, "\n"), [](const std::string& line) -> auto { - auto parts = Strings::split(line, " "); + Strings::split(output.output, '\n'), [](const std::string& line) -> auto { + auto parts = Strings::split(line, ' '); return std::make_pair(parts[0], parts[1]); }); @@ -68,7 +74,7 @@ namespace vcpkg::Commands::PortHistory } const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("history "), + create_example_string("history "), 1, 1, {}, @@ -88,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 7a9a49da42a000..c4d1d2b1e451e8 100644 --- a/toolsrc/src/vcpkg/commands.portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -1,15 +1,15 @@ #include "pch.h" -#include -#include -#include -#include - #include #include #include #include +#include +#include +#include +#include + namespace vcpkg::Commands::PortsDiff { struct UpdatedPort @@ -104,7 +104,10 @@ namespace vcpkg::Commands::PortsDiff Paragraphs::load_all_ports(paths.get_filesystem(), temp_checkout_path / ports_dir_name_as_string); std::map names_and_versions; for (auto&& port : all_ports) - names_and_versions.emplace(port->core_paragraph->name, port->core_paragraph->version); + { + const auto& core_pgh = *port->core_paragraph; + names_and_versions.emplace(port->core_paragraph->name, VersionT(core_pgh.version, core_pgh.port_version)); + } fs.remove_all(temp_checkout_path, VCPKG_LINE_INFO); return names_and_versions; } @@ -121,7 +124,7 @@ namespace vcpkg::Commands::PortsDiff const CommandStructure COMMAND_STRUCTURE = { Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", - Help::create_example_string("portsdiff mybranchname")), + create_example_string("portsdiff mybranchname")), 1, 2, {}, @@ -187,4 +190,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 372c394fa213d2..1a483a6e1f4d42 100644 --- a/toolsrc/src/vcpkg/commands.search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -1,34 +1,43 @@ #include "pch.h" #include -#include + +#include #include #include #include #include #include #include +#include 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_FULLDESC = "x-full-desc"; // TODO: This should find a better home, eventually static void do_print(const SourceParagraph& source_paragraph, bool full_desc) { + auto full_version = VersionT(source_paragraph.version, source_paragraph.port_version).to_string(); if (full_desc) { - System::printf( - "%-20s %-16s %s\n", source_paragraph.name, source_paragraph.version, source_paragraph.description); + System::printf("%-20s %-16s %s\n", + source_paragraph.name, + full_version, + Strings::join("\n ", source_paragraph.description)); } else { + std::string description; + if (!source_paragraph.description.empty()) + { + description = source_paragraph.description[0]; + } System::printf("%-20s %-16s %s\n", vcpkg::shorten_text(source_paragraph.name, 20), - vcpkg::shorten_text(source_paragraph.version, 16), - vcpkg::shorten_text(source_paragraph.description, 81)); + vcpkg::shorten_text(full_version, 16), + vcpkg::shorten_text(description, 81)); } } @@ -37,13 +46,17 @@ namespace vcpkg::Commands::Search auto full_feature_name = Strings::concat(name, "[", feature_paragraph.name, "]"); if (full_desc) { - System::printf("%-37s %s\n", full_feature_name, feature_paragraph.description); + System::printf("%-37s %s\n", full_feature_name, Strings::join("\n ", feature_paragraph.description)); } else { - System::printf("%-37s %s\n", - vcpkg::shorten_text(full_feature_name, 37), - vcpkg::shorten_text(feature_paragraph.description, 81)); + std::string description; + if (!feature_paragraph.description.empty()) + { + description = feature_paragraph.description[0]; + } + System::printf( + "%-37s %s\n", vcpkg::shorten_text(full_feature_name, 37), vcpkg::shorten_text(description, 81)); } } @@ -54,7 +67,7 @@ namespace vcpkg::Commands::Search const CommandStructure COMMAND_STRUCTURE = { Strings::format( "The argument should be a substring to search for, or no argument to display all libraries.\n%s", - Help::create_example_string("search png")), + create_example_string("search png")), 0, 1, {SEARCH_SWITCHES, {}}, @@ -66,7 +79,7 @@ namespace vcpkg::Commands::Search const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); const bool full_description = Util::Sets::contains(options.switches, OPTION_FULLDESC); - PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PathsPortFileProvider provider(paths, args.overlay_ports); auto source_paragraphs = Util::fmap(provider.load_all_control_files(), [](auto&& port) -> const SourceControlFile* { return port->source_control_file.get(); }); @@ -84,24 +97,40 @@ namespace vcpkg::Commands::Search } else { - const auto& icontains = Strings::case_insensitive_ascii_contains; - // At this point there is 1 argument auto&& args_zero = args.command_arguments[0]; + const auto contained_in = [&args_zero](const auto& s) { + return Strings::case_insensitive_ascii_contains(s, args_zero); + }; for (const auto& source_control_file : source_paragraphs) { auto&& sp = *source_control_file->core_paragraph; - const bool contains_name = icontains(sp.name, args_zero); - if (contains_name || icontains(sp.description, args_zero)) + bool found_match = contained_in(sp.name); + if (!found_match) + { + found_match = std::any_of(sp.description.begin(), sp.description.end(), contained_in); + } + + if (found_match) { do_print(sp, full_description); } for (auto&& feature_paragraph : source_control_file->feature_paragraphs) { - if (contains_name || icontains(feature_paragraph->name, args_zero) || - icontains(feature_paragraph->description, args_zero)) + bool found_match_for_feature = found_match; + if (!found_match_for_feature) + { + found_match_for_feature = contained_in(feature_paragraph->name); + } + if (!found_match_for_feature) + { + found_match_for_feature = std::any_of( + feature_paragraph->description.begin(), feature_paragraph->description.end(), contained_in); + } + + if (found_match_for_feature) { do_print(sp.name, *feature_paragraph, full_description); } @@ -115,4 +144,9 @@ namespace vcpkg::Commands::Search 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 new file mode 100644 index 00000000000000..a99c3af4a902d0 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp @@ -0,0 +1,174 @@ +#include "pch.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace vcpkg::Commands::SetInstalled +{ + static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; + static constexpr StringLiteral OPTION_WRITE_PACKAGES_CONFIG = "x-write-nuget-packages-config"; + + static constexpr CommandSwitch INSTALL_SWITCHES[] = { + {OPTION_DRY_RUN, "Do not actually build or install"}, + }; + static constexpr CommandSetting INSTALL_SETTINGS[] = { + {OPTION_WRITE_PACKAGES_CONFIG, + "Writes out a NuGet packages.config-formatted file for use with external binary caching.\n" + "See `vcpkg help binarycaching` for more information."}, + }; + + const CommandStructure COMMAND_STRUCTURE = { + create_example_string(R"(x-set-installed ...)"), + 0, + SIZE_MAX, + {INSTALL_SWITCHES, INSTALL_SETTINGS}, + nullptr, + }; + + 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& maybe_pkgsconfig) + { + cmake_vars.load_tag_vars(action_plan, provider); + Build::compute_all_abis(paths, action_plan, cmake_vars, {}); + + std::set all_abis; + + for (const auto& action : action_plan.install_actions) + { + all_abis.insert(action.abi_info.value_or_exit(VCPKG_LINE_INFO).package_abi); + } + + // currently (or once) installed specifications + auto status_db = database_load_check(paths); + std::vector specs_to_remove; + std::set specs_installed; + for (auto&& status_pgh : status_db) + { + if (!status_pgh->is_installed()) continue; + if (status_pgh->package.is_feature()) continue; + + const auto& abi = status_pgh->package.abi; + if (abi.empty() || !Util::Sets::contains(all_abis, abi)) + { + specs_to_remove.push_back(status_pgh->package.spec); + } + else + { + specs_installed.emplace(status_pgh->package.spec); + } + } + + action_plan.remove_actions = Dependencies::create_remove_plan(specs_to_remove, status_db); + + for (const auto& action : action_plan.remove_actions) + { + // This should not technically be needed, however ensuring that all specs to be removed are not included in + // `specs_installed` acts as a sanity check + specs_installed.erase(action.spec); + } + + Util::erase_remove_if(action_plan.install_actions, [&](const Dependencies::InstallPlanAction& ipa) { + return Util::Sets::contains(specs_installed, ipa.spec); + }); + + Dependencies::print_plan(action_plan, true, paths.ports); + + if (auto p_pkgsconfig = maybe_pkgsconfig.get()) + { + Build::compute_all_abis(paths, action_plan, cmake_vars, status_db); + auto& fs = paths.get_filesystem(); + 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"); + } + + if (dry_run == DryRun::Yes) + { + Checks::exit_success(VCPKG_LINE_INFO); + } + + const auto summary = Install::perform(action_plan, + Install::KeepGoing::NO, + paths, + status_db, + args.binary_caching_enabled() ? binary_provider : null_binary_provider(), + Build::null_build_logs_recorder(), + cmake_vars); + + System::print2("\nTotal elapsed time: ", summary.total_elapsed_time, "\n\n"); + + Checks::exit_success(VCPKG_LINE_INFO); + } + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) + { + // input sanitization + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + + const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { + return Input::check_and_get_full_package_spec( + std::string(arg), default_triplet, COMMAND_STRUCTURE.example_text); + }); + + for (auto&& spec : specs) + { + Input::check_triplet(spec.package_spec.triplet(), paths); + } + + auto binary_provider = create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); + + const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); + + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); + auto cmake_vars = CMakeVars::make_triplet_cmake_var_provider(paths); + + Optional pkgsconfig; + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) + { + 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, + 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 fbce1a421648d9..f3324f9616fb14 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -1,6 +1,10 @@ #include "pch.h" -#include +#include +#include + +#include +#include #include #include #include @@ -10,16 +14,13 @@ #include #include -#include -#include - namespace vcpkg::Commands::Upgrade { using Install::KeepGoing; using Install::to_keep_going; - static constexpr StringLiteral OPTION_NO_DRY_RUN = "--no-dry-run"; - static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going"; + static constexpr StringLiteral OPTION_NO_DRY_RUN = "no-dry-run"; + static constexpr StringLiteral OPTION_KEEP_GOING = "keep-going"; static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_NO_DRY_RUN, "Actually upgrade"}, @@ -27,7 +28,7 @@ namespace vcpkg::Commands::Upgrade }}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("upgrade --no-dry-run"), + create_example_string("upgrade --no-dry-run"), 0, SIZE_MAX, {INSTALL_SWITCHES, {}}, @@ -41,10 +42,12 @@ namespace vcpkg::Commands::Upgrade const bool no_dry_run = Util::Sets::contains(options.switches, OPTION_NO_DRY_RUN); const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING)); + auto binaryprovider = create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); + StatusParagraphs status_db = database_load_check(paths); // Load ports from ports dirs - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; @@ -153,22 +156,10 @@ namespace vcpkg::Commands::Upgrade Checks::check_exit(VCPKG_LINE_INFO, !action_plan.empty()); - const Build::BuildPackageOptions install_plan_options = { - Build::UseHeadVersion::NO, - Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, - Build::CleanBuildtrees::NO, - Build::CleanPackages::NO, - Build::CleanDownloads::NO, - Build::DownloadTool::BUILT_IN, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, - Build::FailOnTombstone::NO, - }; - // Set build settings for all install actions for (auto&& action : action_plan.install_actions) { - action.build_options = install_plan_options; + action.build_options = vcpkg::Build::default_build_package_options; } Dependencies::print_plan(action_plan, true, paths.ports); @@ -184,7 +175,13 @@ namespace vcpkg::Commands::Upgrade var_provider.load_tag_vars(action_plan, provider); const Install::InstallSummary summary = - Install::perform(action_plan, keep_going, paths, status_db, var_provider); + Install::perform(action_plan, + keep_going, + paths, + status_db, + args.binary_caching_enabled() ? *binaryprovider : null_binary_provider(), + Build::null_build_logs_recorder(), + var_provider); System::print2("\nTotal elapsed time: ", summary.total_elapsed_time, "\n\n"); @@ -195,4 +192,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 7029c8bfd24a60..2630a18ddfc954 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -1,7 +1,8 @@ #include "pch.h" #include -#include + +#include #include #include @@ -32,7 +33,7 @@ namespace vcpkg::Commands::Version #ifndef NDEBUG + std::string("-debug") #endif - + std::string(Metrics::get_compiled_metrics_enabled() ? "" : "-external"); + ; return S_VERSION; } @@ -74,14 +75,14 @@ namespace vcpkg::Commands::Version } } const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("version"), + create_example_string("version"), 0, 0, {}, nullptr, }; - void perform_and_exit(const VcpkgCmdArguments& args) + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem&) { Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); @@ -92,4 +93,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 a110bbb185c76a..589ea73e75af62 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -1,35 +1,41 @@ -#include "pch.h" - -#include -#include -#include -#include - -namespace vcpkg::Commands::X_VSInstances -{ - const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("x-vsinstances"), - 0, - 0, - {{}, {}}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { -#if defined(_WIN32) - const ParsedArguments parsed_args = args.parse_arguments(COMMAND_STRUCTURE); - - const auto instances = vcpkg::VisualStudio::get_visual_studio_instances(paths); - for (const std::string& instance : instances) - { - System::print2(instance, '\n'); - } - - Checks::exit_success(VCPKG_LINE_INFO); -#else - Util::unused(args, paths); - Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); -#endif - } -} +#include "pch.h" + +#include + +#include +#include +#include + +namespace vcpkg::Commands::X_VSInstances +{ + const CommandStructure COMMAND_STRUCTURE = { + create_example_string("x-vsinstances"), + 0, + 0, + {{}, {}}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { +#if defined(_WIN32) + const ParsedArguments parsed_args = args.parse_arguments(COMMAND_STRUCTURE); + + const auto instances = vcpkg::VisualStudio::get_visual_studio_instances(paths); + for (const std::string& instance : instances) + { + System::print2(instance, '\n'); + } + + Checks::exit_success(VCPKG_LINE_INFO); +#else + Util::unused(args, 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/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index 07aad4d2209175..d4757cfcc408a4 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -4,6 +4,7 @@ #include #include #include + #include #include #include @@ -39,7 +40,7 @@ namespace vcpkg::Dependencies struct ClusterInstallInfo { - std::unordered_map> build_edges; + std::map> build_edges; bool defaults_requested = false; }; @@ -53,7 +54,7 @@ namespace vcpkg::Dependencies { } - Cluster(const PackageSpec& spec, const SourceControlFileLocation& scfl) : m_spec(spec), m_scfl(scfl) {} + Cluster(const PackageSpec& spec, const SourceControlFileLocation& scfl) : m_spec(spec), m_scfl(scfl) { } bool has_feature_installed(const std::string& feature) const { @@ -106,15 +107,13 @@ namespace vcpkg::Dependencies &m_scfl.source_control_file->find_dependencies_for_feature(feature).value_or_exit(VCPKG_LINE_INFO); std::vector dep_list; - if (maybe_vars) + if (auto vars = maybe_vars.get()) { // Qualified dependency resolution is available - auto fullspec_list = filter_dependencies( - *qualified_deps, m_spec.triplet(), maybe_vars.value_or_exit(VCPKG_LINE_INFO)); + auto fullspec_list = filter_dependencies(*qualified_deps, m_spec.triplet(), *vars); for (auto&& fspec : fullspec_list) { - // TODO: this is incorrect and does not handle default features nor "*" Util::Vectors::append(&dep_list, fspec.to_feature_specs({"default"}, {"default"})); } @@ -126,12 +125,11 @@ namespace vcpkg::Dependencies bool requires_qualified_resolution = false; for (const Dependency& dep : *qualified_deps) { - if (dep.qualifier.empty()) + if (dep.platform.is_empty()) { - Util::Vectors::append( - &dep_list, - FullPackageSpec({dep.depend.name, m_spec.triplet()}, dep.depend.features) - .to_feature_specs({"default"}, {"default"})); + Util::Vectors::append(&dep_list, + FullPackageSpec({dep.name, m_spec.triplet()}, dep.features) + .to_feature_specs({"default"}, {"default"})); } else { @@ -296,7 +294,7 @@ namespace vcpkg::Dependencies auto end() const { return m_graph.end(); } private: - std::unordered_map m_graph; + std::map m_graph; const PortFileProvider::PortFileProvider& m_port_provider; }; @@ -354,7 +352,7 @@ namespace vcpkg::Dependencies InstallPlanAction::InstallPlanAction(const PackageSpec& spec, const SourceControlFileLocation& scfl, const RequestType& request_type, - std::unordered_map>&& dependencies) + std::map>&& dependencies) : spec(spec) , source_control_file_location(scfl) , plan_type(InstallPlanType::BUILD_AND_INSTALL) @@ -405,12 +403,24 @@ namespace vcpkg::Dependencies } const std::string& InstallPlanAction::public_abi() const { - if (auto p = pre_build_info.get()) + switch (plan_type) { - if (auto q = p->get()->public_abi_override.get()) return *q; + case InstallPlanType::ALREADY_INSTALLED: + return installed_package.value_or_exit(VCPKG_LINE_INFO).core->package.abi; + case InstallPlanType::BUILD_AND_INSTALL: + { + auto&& i = abi_info.value_or_exit(VCPKG_LINE_INFO); + if (auto o = i.pre_build_info->public_abi_override.get()) + return *o; + else + return i.package_abi; + } + default: Checks::unreachable(VCPKG_LINE_INFO); } - if (auto p = installed_package.get()) return p->core->package.abi; - return package_abi.value_or_exit(VCPKG_LINE_INFO); + } + const Build::PreBuildInfo& InstallPlanAction::pre_build_info(LineInfo linfo) const + { + return *abi_info.value_or_exit(linfo).pre_build_info.get(); } bool InstallPlanAction::compare_by_name(const InstallPlanAction* left, const InstallPlanAction* right) @@ -560,7 +570,7 @@ namespace vcpkg::Dependencies ? RequestType::USER_REQUESTED : RequestType::AUTO_SELECTED; - auto maybe_ipv = status_db.find_all_installed(spec); + auto maybe_ipv = status_db.get_installed_package_view(spec); if (auto p_ipv = maybe_ipv.get()) { @@ -617,7 +627,19 @@ namespace vcpkg::Dependencies } pgraph.install(feature_specs); - return pgraph.serialize(options); + auto res = pgraph.serialize(options); + + const auto is_manifest_spec = [](const auto& action) { + return action.spec.name() == PackageSpec::MANIFEST_NAME; + }; + + Util::erase_remove_if(res.install_actions, is_manifest_spec); + + Checks::check_exit(VCPKG_LINE_INFO, + !std::any_of(res.remove_actions.begin(), res.remove_actions.end(), is_manifest_spec), + "\"default\" should never be installed"); + + return res; } void PackageGraph::mark_for_reinstall(const PackageSpec& first_remove_spec, @@ -674,7 +696,7 @@ namespace vcpkg::Dependencies const std::vector* paragraph_depends = nullptr; if (spec.feature() == "core") { - paragraph_depends = &clust.m_scfl.source_control_file->core_paragraph->depends; + paragraph_depends = &clust.m_scfl.source_control_file->core_paragraph->dependencies; } else if (spec.feature() == "default") { @@ -687,12 +709,12 @@ namespace vcpkg::Dependencies "Package %s does not have a %s feature", spec.name(), spec.feature()); - paragraph_depends = &maybe_paragraph.value_or_exit(VCPKG_LINE_INFO).depends; + paragraph_depends = &maybe_paragraph.value_or_exit(VCPKG_LINE_INFO).dependencies; } // And it has at least one qualified dependency if (paragraph_depends && - Util::any_of(*paragraph_depends, [](auto&& dep) { return !dep.qualifier.empty(); })) + Util::any_of(*paragraph_depends, [](auto&& dep) { return !dep.platform.is_empty(); })) { // Add it to the next batch run qualified_dependencies.emplace_back(spec); @@ -785,7 +807,7 @@ namespace vcpkg::Dependencies { struct BaseEdgeProvider : Graphs::AdjacencyProvider { - BaseEdgeProvider(const ClusterGraph& parent) : m_parent(parent) {} + BaseEdgeProvider(const ClusterGraph& parent) : m_parent(parent) { } std::string to_string(const PackageSpec& spec) const override { return spec.to_string(); } const Cluster* load_vertex_data(const PackageSpec& spec) const override @@ -859,7 +881,7 @@ namespace vcpkg::Dependencies { auto&& scfl = p_cluster->m_scfl; - std::unordered_map> computed_edges; + std::map> computed_edges; for (auto&& kv : info_ptr->build_edges) { std::set fspecs; @@ -938,7 +960,14 @@ namespace vcpkg::Dependencies void print_plan(const ActionPlan& action_plan, const bool is_recursive, const fs::path& default_ports_dir) { - std::vector remove_plans; + if (action_plan.remove_actions.empty() && action_plan.already_installed.empty() && + action_plan.install_actions.empty()) + { + System::print2("All requested packages are currently installed.\n"); + return; + } + + std::set remove_specs; std::vector rebuilt_plans; std::vector only_install_plans; std::vector new_plans; @@ -952,16 +981,16 @@ namespace vcpkg::Dependencies for (auto&& remove_action : action_plan.remove_actions) { - remove_plans.emplace_back(&remove_action); + remove_specs.emplace(remove_action.spec); } for (auto&& install_action : action_plan.install_actions) { // remove plans are guaranteed to come before install plans, so we know the plan will be contained // if at all. - auto it = Util::find_if(remove_plans, - [&](const RemovePlanAction* plan) { return plan->spec == install_action.spec; }); - if (it != remove_plans.end()) + auto it = remove_specs.find(install_action.spec); + if (it != remove_specs.end()) { + remove_specs.erase(it); rebuilt_plans.push_back(&install_action); } else @@ -978,7 +1007,6 @@ namespace vcpkg::Dependencies } already_installed_plans = Util::fmap(action_plan.already_installed, [](auto&& action) { return &action; }); - std::sort(remove_plans.begin(), remove_plans.end(), &RemovePlanAction::compare_by_name); std::sort(rebuilt_plans.begin(), rebuilt_plans.end(), &InstallPlanAction::compare_by_name); std::sort(only_install_plans.begin(), only_install_plans.end(), &InstallPlanAction::compare_by_name); std::sort(new_plans.begin(), new_plans.end(), &InstallPlanAction::compare_by_name); @@ -1009,6 +1037,16 @@ namespace vcpkg::Dependencies '\n'); } + if (!remove_specs.empty()) + { + std::string msg = "The following packages will be removed:\n"; + for (auto spec : remove_specs) + { + Strings::append(msg, to_output_string(RequestType::USER_REQUESTED, spec.to_string()), '\n'); + } + System::print2(msg); + } + if (!rebuilt_plans.empty()) { System::print2("The following packages will be rebuilt:\n", actions_to_output_string(rebuilt_plans), '\n'); @@ -1029,8 +1067,8 @@ namespace vcpkg::Dependencies if (has_non_user_requested_packages) System::print2("Additional packages (*) will be modified to complete this operation.\n"); - - if (!remove_plans.empty() && !is_recursive) + bool have_removals = !remove_specs.empty() || !rebuilt_plans.empty(); + if (have_removals && !is_recursive) { System::print2(System::Color::warning, "If you are sure you want to rebuild the above packages, run the command with the " diff --git a/toolsrc/src/vcpkg/export.chocolatey.cpp b/toolsrc/src/vcpkg/export.chocolatey.cpp index 81bdeacd76a95a..40564ae135d163 100644 --- a/toolsrc/src/vcpkg/export.chocolatey.cpp +++ b/toolsrc/src/vcpkg/export.chocolatey.cpp @@ -1,43 +1,44 @@ -#include "pch.h" - -#include -#include -#include -#include -#include -#include - -namespace vcpkg::Export::Chocolatey -{ - using Dependencies::ExportPlanAction; - using Dependencies::ExportPlanType; - using Install::InstallDir; - - static std::string create_nuspec_dependencies(const BinaryParagraph& binary_paragraph, - const std::map& packages_version) - { - static constexpr auto CONTENT_TEMPLATE = R"()"; - - std::string nuspec_dependencies; - for (const std::string& depend : binary_paragraph.depends) - { - auto found = packages_version.find(depend); - if (found == packages_version.end()) - { - Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot find desired dependency version."); - } - std::string nuspec_dependency = Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_ID@", depend); - nuspec_dependency = Strings::replace_all(std::move(nuspec_dependency), "@PACKAGE_VERSION@", found->second); - nuspec_dependencies += nuspec_dependency; - } - return nuspec_dependencies; - } - - static std::string create_nuspec_file_contents(const std::string& exported_root_dir, - const BinaryParagraph& binary_paragraph, - const std::map& packages_version, - const Options& chocolatey_options) - { +#include "pch.h" + +#include +#include + +#include +#include +#include +#include + +namespace vcpkg::Export::Chocolatey +{ + using Dependencies::ExportPlanAction; + using Dependencies::ExportPlanType; + using Install::InstallDir; + + static std::string create_nuspec_dependencies(const BinaryParagraph& binary_paragraph, + const std::map& packages_version) + { + static constexpr auto CONTENT_TEMPLATE = R"()"; + + std::string nuspec_dependencies; + for (const std::string& depend : binary_paragraph.dependencies) + { + auto found = packages_version.find(depend); + if (found == packages_version.end()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot find desired dependency version."); + } + std::string nuspec_dependency = Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_ID@", depend); + nuspec_dependency = Strings::replace_all(std::move(nuspec_dependency), "@PACKAGE_VERSION@", found->second); + nuspec_dependencies += nuspec_dependency; + } + return nuspec_dependencies; + } + + static std::string create_nuspec_file_contents(const std::string& exported_root_dir, + const BinaryParagraph& binary_paragraph, + const std::map& packages_version, + const Options& chocolatey_options) + { static constexpr auto CONTENT_TEMPLATE = R"( @@ -56,30 +57,30 @@ namespace vcpkg::Export::Chocolatey -)"; - auto package_version = packages_version.find(binary_paragraph.spec.name()); - if (package_version == packages_version.end()) - { - Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot find desired package version."); - } - std::string nuspec_file_content = - Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_ID@", binary_paragraph.spec.name()); - nuspec_file_content = - Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_VERSION@", package_version->second); - nuspec_file_content = Strings::replace_all( - std::move(nuspec_file_content), "@PACKAGE_MAINTAINER@", chocolatey_options.maybe_maintainer.value_or("")); - nuspec_file_content = - Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_DESCRIPTION@", binary_paragraph.description); - nuspec_file_content = - Strings::replace_all(std::move(nuspec_file_content), "@EXPORTED_ROOT_DIR@", exported_root_dir); - nuspec_file_content = Strings::replace_all(std::move(nuspec_file_content), - "@PACKAGE_DEPENDENCIES@", - create_nuspec_dependencies(binary_paragraph, packages_version)); - return nuspec_file_content; - } - - static std::string create_chocolatey_install_contents() - { +)"; + auto package_version = packages_version.find(binary_paragraph.spec.name()); + if (package_version == packages_version.end()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot find desired package version."); + } + std::string nuspec_file_content = + Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_ID@", binary_paragraph.spec.name()); + nuspec_file_content = + Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_VERSION@", package_version->second); + nuspec_file_content = Strings::replace_all( + std::move(nuspec_file_content), "@PACKAGE_MAINTAINER@", chocolatey_options.maybe_maintainer.value_or("")); + nuspec_file_content = Strings::replace_all( + std::move(nuspec_file_content), "@PACKAGE_DESCRIPTION@", Strings::join("\n", binary_paragraph.description)); + nuspec_file_content = + Strings::replace_all(std::move(nuspec_file_content), "@EXPORTED_ROOT_DIR@", exported_root_dir); + nuspec_file_content = Strings::replace_all(std::move(nuspec_file_content), + "@PACKAGE_DEPENDENCIES@", + create_nuspec_dependencies(binary_paragraph, packages_version)); + return nuspec_file_content; + } + + static std::string create_chocolatey_install_contents() + { static constexpr auto CONTENT_TEMPLATE = R"###( $ErrorActionPreference = 'Stop'; @@ -92,12 +93,12 @@ namespace vcpkg::Export::Chocolatey $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) - { +)###"; + return CONTENT_TEMPLATE; + } + + static std::string create_chocolatey_uninstall_contents(const BinaryParagraph& binary_paragraph) + { static constexpr auto CONTENT_TEMPLATE = R"###( $ErrorActionPreference = 'Stop'; @@ -113,7 +114,7 @@ Get-Content $whereToInstallCache | Foreach-Object { } $installedDir = Join-Path $whereToInstall 'installed' -Get-Content $listFile | Foreach-Object { +Get-Content $listFile | Foreach-Object { $fileToRemove = Join-Path $installedDir $_ if (Test-Path $fileToRemove -PathType Leaf) { Remove-Item $fileToRemove @@ -142,90 +143,90 @@ if (Test-Path $installedDir) } ) { $empties | Remove-Item } } -)###"; - std::string chocolatey_uninstall_content = - Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_FULLSTEM@", binary_paragraph.fullstem()); - return chocolatey_uninstall_content; - } - - void do_export(const std::vector& export_plan, - const VcpkgPaths& paths, - const Options& chocolatey_options) - { - Checks::check_exit( - VCPKG_LINE_INFO, chocolatey_options.maybe_maintainer.has_value(), "--x-maintainer option is required."); - - Files::Filesystem& fs = paths.get_filesystem(); - const fs::path vcpkg_root_path = paths.root; - const fs::path raw_exported_dir_path = vcpkg_root_path / "chocolatey"; - const fs::path exported_dir_path = vcpkg_root_path / "chocolatey_exports"; - const fs::path& nuget_exe = paths.get_tool_exe(Tools::NUGET); - - std::error_code ec; - fs.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); - fs.create_directory(raw_exported_dir_path, ec); - fs.remove_all(exported_dir_path, VCPKG_LINE_INFO); - fs.create_directory(exported_dir_path, ec); - - // execute the plan - std::map packages_version; - for (const ExportPlanAction& action : export_plan) - { - if (action.plan_type != ExportPlanType::ALREADY_BUILT) - { - Checks::unreachable(VCPKG_LINE_INFO); - } - - const BinaryParagraph& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); - auto norm_version = binary_paragraph.version; - - // normalize the version string to be separated by dots to be compliant with Nusepc. - norm_version = Strings::replace_all(std::move(norm_version), "-", "."); - norm_version = Strings::replace_all(std::move(norm_version), "_", "."); - norm_version = norm_version + chocolatey_options.maybe_version_suffix.value_or(""); - packages_version.insert(std::make_pair(binary_paragraph.spec.name(), norm_version)); - } - - for (const ExportPlanAction& action : export_plan) - { - const std::string display_name = action.spec.to_string(); - System::print2("Exporting package ", display_name, "...\n"); - - const fs::path per_package_dir_path = raw_exported_dir_path / action.spec.name(); - - const BinaryParagraph& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); - - const InstallDir dirs = InstallDir::from_destination_root( - per_package_dir_path / "installed", - action.spec.triplet().to_string(), - per_package_dir_path / "installed" / "vcpkg" / "info" / (binary_paragraph.fullstem() + ".list")); - - Install::install_files_and_write_listfile(paths.get_filesystem(), paths.package_dir(action.spec), dirs); - - const std::string nuspec_file_content = create_nuspec_file_contents( - per_package_dir_path.string(), binary_paragraph, packages_version, chocolatey_options); - const fs::path nuspec_file_path = - per_package_dir_path / Strings::concat(binary_paragraph.spec.name(), ".nuspec"); - fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); - - fs.create_directory(per_package_dir_path / "tools", ec); - - const std::string chocolatey_install_content = create_chocolatey_install_contents(); - const fs::path chocolatey_install_file_path = per_package_dir_path / "tools" / "chocolateyInstall.ps1"; - fs.write_contents(chocolatey_install_file_path, chocolatey_install_content, VCPKG_LINE_INFO); - - const std::string chocolatey_uninstall_content = create_chocolatey_uninstall_contents(binary_paragraph); - const fs::path chocolatey_uninstall_file_path = per_package_dir_path / "tools" / "chocolateyUninstall.ps1"; - 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()); - - 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: NuGet package creation failed"); - } - } -} +)###"; + std::string chocolatey_uninstall_content = + Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_FULLSTEM@", binary_paragraph.fullstem()); + return chocolatey_uninstall_content; + } + + void do_export(const std::vector& export_plan, + const VcpkgPaths& paths, + const Options& chocolatey_options) + { + Checks::check_exit( + VCPKG_LINE_INFO, chocolatey_options.maybe_maintainer.has_value(), "--x-maintainer option is required."); + + Files::Filesystem& fs = paths.get_filesystem(); + const fs::path vcpkg_root_path = paths.root; + const fs::path raw_exported_dir_path = vcpkg_root_path / "chocolatey"; + const fs::path exported_dir_path = vcpkg_root_path / "chocolatey_exports"; + const fs::path& nuget_exe = paths.get_tool_exe(Tools::NUGET); + + std::error_code ec; + fs.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); + fs.create_directory(raw_exported_dir_path, ec); + fs.remove_all(exported_dir_path, VCPKG_LINE_INFO); + fs.create_directory(exported_dir_path, ec); + + // execute the plan + std::map packages_version; + for (const ExportPlanAction& action : export_plan) + { + if (action.plan_type != ExportPlanType::ALREADY_BUILT) + { + Checks::unreachable(VCPKG_LINE_INFO); + } + + const BinaryParagraph& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); + auto norm_version = binary_paragraph.version; + + // normalize the version string to be separated by dots to be compliant with Nusepc. + norm_version = Strings::replace_all(std::move(norm_version), "-", "."); + norm_version = Strings::replace_all(std::move(norm_version), "_", "."); + norm_version = norm_version + chocolatey_options.maybe_version_suffix.value_or(""); + packages_version.insert(std::make_pair(binary_paragraph.spec.name(), norm_version)); + } + + for (const ExportPlanAction& action : export_plan) + { + const std::string display_name = action.spec.to_string(); + System::print2("Exporting package ", display_name, "...\n"); + + const fs::path per_package_dir_path = raw_exported_dir_path / action.spec.name(); + + const BinaryParagraph& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); + + const InstallDir dirs = InstallDir::from_destination_root( + per_package_dir_path / "installed", + action.spec.triplet().to_string(), + per_package_dir_path / "installed" / "vcpkg" / "info" / (binary_paragraph.fullstem() + ".list")); + + Install::install_package_and_write_listfile(paths, action.spec, dirs); + + const std::string nuspec_file_content = create_nuspec_file_contents( + per_package_dir_path.string(), binary_paragraph, packages_version, chocolatey_options); + const fs::path nuspec_file_path = + per_package_dir_path / Strings::concat(binary_paragraph.spec.name(), ".nuspec"); + fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); + + fs.create_directory(per_package_dir_path / "tools", ec); + + const std::string chocolatey_install_content = create_chocolatey_install_contents(); + const fs::path chocolatey_install_file_path = per_package_dir_path / "tools" / "chocolateyInstall.ps1"; + fs.write_contents(chocolatey_install_file_path, chocolatey_install_content, VCPKG_LINE_INFO); + + const std::string chocolatey_uninstall_content = create_chocolatey_uninstall_contents(binary_paragraph); + const fs::path chocolatey_uninstall_file_path = per_package_dir_path / "tools" / "chocolateyUninstall.ps1"; + 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()); + + 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: NuGet package creation failed"); + } + } +} diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index b41d88dc176fd1..10d79195f527ae 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -1,22 +1,22 @@ #include "pch.h" +#include +#include +#include +#include + #include #include #include -#include #include #include +#include #include #include #include #include #include -#include -#include -#include -#include - namespace vcpkg::Export { using Dependencies::ExportPlanAction; @@ -25,7 +25,8 @@ namespace vcpkg::Export using Install::InstallDir; static std::string create_nuspec_file_contents(const std::string& raw_exported_dir, - const std::string& targets_redirect_path, + const fs::path& targets_redirect_path, + const fs::path& props_redirect_path, const std::string& nuget_id, const std::string& nupkg_version) { @@ -44,6 +45,7 @@ namespace vcpkg::Export + )"; @@ -52,8 +54,10 @@ namespace vcpkg::Export nuspec_file_content = Strings::replace_all(std::move(nuspec_file_content), "@VERSION@", nupkg_version); 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); + nuspec_file_content = Strings::replace_all( + std::move(nuspec_file_content), "@TARGETS_REDIRECT_PATH@", targets_redirect_path.u8string()); + nuspec_file_content = Strings::replace_all( + std::move(nuspec_file_content), "@PROPS_REDIRECT_PATH@", props_redirect_path.u8string()); return nuspec_file_content; } @@ -61,9 +65,6 @@ namespace vcpkg::Export { return Strings::format(R"###( - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ - )###", @@ -75,18 +76,6 @@ namespace vcpkg::Export { static constexpr std::array ORDER = {ExportPlanType::ALREADY_BUILT, ExportPlanType::NOT_BUILT}; - static constexpr Build::BuildPackageOptions BUILD_OPTIONS = { - Build::UseHeadVersion::NO, - Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, - Build::CleanBuildtrees::NO, - Build::CleanPackages::NO, - Build::CleanDownloads::NO, - Build::DownloadTool::BUILT_IN, - Build::BinaryCaching::NO, - Build::FailOnTombstone::NO, - }; - for (const ExportPlanType plan_type : ORDER) { const auto it = group_by_plan_type.find(plan_type); @@ -98,7 +87,8 @@ namespace vcpkg::Export std::vector cont = it->second; std::sort(cont.begin(), cont.end(), &ExportPlanAction::compare_by_name); const std::string as_string = Strings::join("\n", cont, [](const ExportPlanAction* p) { - return Dependencies::to_output_string(p->request_type, p->spec.to_string(), BUILD_OPTIONS); + return Dependencies::to_output_string( + p->request_type, p->spec.to_string(), vcpkg::Build::default_build_package_options); }); switch (plan_type) @@ -139,18 +129,23 @@ namespace vcpkg::Export Files::Filesystem& fs = paths.get_filesystem(); const fs::path& nuget_exe = paths.get_tool_exe(Tools::NUGET); + std::error_code ec; + fs.create_directories(paths.buildsystems / "tmp", ec); + // This file will be placed in "build\native" in the nuget package. Therefore, go up two dirs. const std::string targets_redirect_content = create_targets_redirect("$(MSBuildThisFileDirectory)../../scripts/buildsystems/msbuild/vcpkg.targets"); const fs::path targets_redirect = paths.buildsystems / "tmp" / "vcpkg.export.nuget.targets"; - - std::error_code ec; - fs.create_directories(paths.buildsystems / "tmp", ec); - fs.write_contents(targets_redirect, targets_redirect_content, VCPKG_LINE_INFO); - const std::string nuspec_file_content = - create_nuspec_file_contents(raw_exported_dir.string(), targets_redirect.string(), nuget_id, nuget_version); + // This file will be placed in "build\native" in the nuget package. Therefore, go up two dirs. + const std::string props_redirect_content = + create_targets_redirect("$(MSBuildThisFileDirectory)../../scripts/buildsystems/msbuild/vcpkg.props"); + const fs::path props_redirect = paths.buildsystems / "tmp" / "vcpkg.export.nuget.props"; + fs.write_contents(props_redirect, props_redirect_content, VCPKG_LINE_INFO); + + const std::string nuspec_file_content = create_nuspec_file_contents( + raw_exported_dir.string(), targets_redirect, props_redirect, nuget_id, nuget_version); const fs::path nuspec_file_path = paths.buildsystems / "tmp" / "vcpkg.export.nuspec"; fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); @@ -235,24 +230,23 @@ namespace vcpkg::Export void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths) { const std::vector integration_files_relative_to_root = { - {".vcpkg-root"}, {fs::path{"scripts"} / "buildsystems" / "msbuild" / "applocal.ps1"}, {fs::path{"scripts"} / "buildsystems" / "msbuild" / "vcpkg.targets"}, + {fs::path{"scripts"} / "buildsystems" / "msbuild" / "vcpkg.props"}, + {fs::path{"scripts"} / "buildsystems" / "msbuild" / "vcpkg-general.xml"}, {fs::path{"scripts"} / "buildsystems" / "vcpkg.cmake"}, {fs::path{"scripts"} / "cmake" / "vcpkg_get_windows_sdk.cmake"}, }; + Files::Filesystem& fs = paths.get_filesystem(); for (const fs::path& file : integration_files_relative_to_root) { const fs::path source = paths.root / file; fs::path destination = raw_exported_dir_path / file; - Files::Filesystem& fs = paths.get_filesystem(); - std::error_code ec; - fs.create_directories(destination.parent_path(), ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - fs.copy_file(source, destination, fs::copy_options::overwrite_existing, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); + fs.create_directories(destination.parent_path(), ignore_errors); + fs.copy_file(source, destination, fs::copy_options::overwrite_existing, VCPKG_LINE_INFO); } + fs.write_contents(raw_exported_dir_path / fs::u8path(".vcpkg-root"), "", VCPKG_LINE_INFO); } struct ExportArguments @@ -278,36 +272,33 @@ namespace vcpkg::Export std::vector specs; }; - static constexpr StringLiteral OPTION_OUTPUT = "--output"; - static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; - static constexpr StringLiteral OPTION_RAW = "--raw"; - static constexpr StringLiteral OPTION_NUGET = "--nuget"; - static constexpr StringLiteral OPTION_IFW = "--ifw"; - static constexpr StringLiteral OPTION_ZIP = "--zip"; - static constexpr StringLiteral OPTION_SEVEN_ZIP = "--7zip"; - static constexpr StringLiteral OPTION_NUGET_ID = "--nuget-id"; - static constexpr StringLiteral OPTION_NUGET_VERSION = "--nuget-version"; - static constexpr StringLiteral OPTION_IFW_REPOSITORY_URL = "--ifw-repository-url"; - static constexpr StringLiteral OPTION_IFW_PACKAGES_DIR_PATH = "--ifw-packages-directory-path"; - static constexpr StringLiteral OPTION_IFW_REPOSITORY_DIR_PATH = "--ifw-repository-directory-path"; - static constexpr StringLiteral OPTION_IFW_CONFIG_FILE_PATH = "--ifw-configuration-file-path"; - static constexpr StringLiteral OPTION_IFW_INSTALLER_FILE_PATH = "--ifw-installer-file-path"; - static constexpr StringLiteral OPTION_CHOCOLATEY = "--x-chocolatey"; - static constexpr StringLiteral OPTION_CHOCOLATEY_MAINTAINER = "--x-maintainer"; - static constexpr StringLiteral OPTION_CHOCOLATEY_VERSION_SUFFIX = "--x-version-suffix"; - static constexpr StringLiteral OPTION_ALL_INSTALLED = "--x-all-installed"; - - static constexpr StringLiteral OPTION_PREFAB = "--prefab"; - static constexpr StringLiteral OPTION_PREFAB_GROUP_ID = "--prefab-group-id"; - static constexpr StringLiteral OPTION_PREFAB_ARTIFACT_ID = "--prefab-artifact-id"; - static constexpr StringLiteral OPTION_PREFAB_VERSION = "--prefab-version"; - static constexpr StringLiteral OPTION_PREFAB_SDK_MIN_VERSION = "--prefab-min-sdk"; - static constexpr StringLiteral OPTION_PREFAB_SDK_TARGET_VERSION = "--prefab-target-sdk"; - static constexpr StringLiteral OPTION_PREFAB_ENABLE_MAVEN = "--prefab-maven"; - static constexpr StringLiteral OPTION_PREFAB_ENABLE_DEBUG = "--prefab-debug"; - - - + static constexpr StringLiteral OPTION_OUTPUT = "output"; + static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; + static constexpr StringLiteral OPTION_RAW = "raw"; + static constexpr StringLiteral OPTION_NUGET = "nuget"; + static constexpr StringLiteral OPTION_IFW = "ifw"; + static constexpr StringLiteral OPTION_ZIP = "zip"; + static constexpr StringLiteral OPTION_SEVEN_ZIP = "7zip"; + static constexpr StringLiteral OPTION_NUGET_ID = "nuget-id"; + static constexpr StringLiteral OPTION_NUGET_VERSION = "nuget-version"; + static constexpr StringLiteral OPTION_IFW_REPOSITORY_URL = "ifw-repository-url"; + static constexpr StringLiteral OPTION_IFW_PACKAGES_DIR_PATH = "ifw-packages-directory-path"; + static constexpr StringLiteral OPTION_IFW_REPOSITORY_DIR_PATH = "ifw-repository-directory-path"; + static constexpr StringLiteral OPTION_IFW_CONFIG_FILE_PATH = "ifw-configuration-file-path"; + static constexpr StringLiteral OPTION_IFW_INSTALLER_FILE_PATH = "ifw-installer-file-path"; + static constexpr StringLiteral OPTION_CHOCOLATEY = "x-chocolatey"; + static constexpr StringLiteral OPTION_CHOCOLATEY_MAINTAINER = "x-maintainer"; + static constexpr StringLiteral OPTION_CHOCOLATEY_VERSION_SUFFIX = "x-version-suffix"; + static constexpr StringLiteral OPTION_ALL_INSTALLED = "x-all-installed"; + + static constexpr StringLiteral OPTION_PREFAB = "prefab"; + static constexpr StringLiteral OPTION_PREFAB_GROUP_ID = "prefab-group-id"; + static constexpr StringLiteral OPTION_PREFAB_ARTIFACT_ID = "prefab-artifact-id"; + static constexpr StringLiteral OPTION_PREFAB_VERSION = "prefab-version"; + static constexpr StringLiteral OPTION_PREFAB_SDK_MIN_VERSION = "prefab-min-sdk"; + static constexpr StringLiteral OPTION_PREFAB_SDK_TARGET_VERSION = "prefab-target-sdk"; + static constexpr StringLiteral OPTION_PREFAB_ENABLE_MAVEN = "prefab-maven"; + static constexpr StringLiteral OPTION_PREFAB_ENABLE_DEBUG = "prefab-debug"; static constexpr std::array EXPORT_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually export"}, @@ -336,7 +327,7 @@ namespace vcpkg::Export "Specify the maintainer for the exported Chocolatey package (experimental feature)"}, {OPTION_CHOCOLATEY_VERSION_SUFFIX, "Specify the version suffix to add for the exported Chocolatey package (experimental feature)"}, - {OPTION_PREFAB_GROUP_ID, "GroupId uniquely identifies your project according maven specifications"}, + {OPTION_PREFAB_GROUP_ID, "GroupId uniquely identifies your project according maven specifications"}, {OPTION_PREFAB_ARTIFACT_ID, "Artifact Id is the name of the project according maven specifications"}, {OPTION_PREFAB_VERSION, "Version is the name of the project according maven specifications"}, {OPTION_PREFAB_SDK_MIN_VERSION, "Android minimum supported sdk version"}, @@ -344,7 +335,7 @@ namespace vcpkg::Export }}; const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("export zlib zlib:x64-windows boost --nuget"), + create_example_string("export zlib zlib:x64-windows boost --nuget"), 0, SIZE_MAX, {EXPORT_SWITCHES, EXPORT_SETTINGS}, @@ -389,10 +380,12 @@ namespace vcpkg::Export }); } - if (!ret.raw && !ret.nuget && !ret.ifw && !ret.zip && !ret.seven_zip && !ret.dry_run && !ret.chocolatey && !ret.prefab) + if (!ret.raw && !ret.nuget && !ret.ifw && !ret.zip && !ret.seven_zip && !ret.dry_run && !ret.chocolatey && + !ret.prefab) { - System::print2(System::Color::error, - "Must provide at least one export type: --raw --nuget --ifw --zip --7zip --chocolatey --prefab\n"); + System::print2( + System::Color::error, + "Must provide at least one export type: --raw --nuget --ifw --zip --7zip --chocolatey --prefab\n"); System::print2(COMMAND_STRUCTURE.example_text); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -512,7 +505,18 @@ namespace vcpkg::Export action.spec.triplet().to_string(), raw_exported_dir_path / "installed" / "vcpkg" / "info" / (binary_paragraph.fullstem() + ".list")); - Install::install_files_and_write_listfile(paths.get_filesystem(), paths.package_dir(action.spec), dirs); + auto lines = fs.read_lines(paths.listfile_path(binary_paragraph)).value_or_exit(VCPKG_LINE_INFO); + std::vector files; + for (auto&& suffix : lines) + { + if (suffix.empty()) continue; + if (suffix.back() == '/') suffix.pop_back(); + if (suffix == action.spec.triplet().to_string()) continue; + files.push_back(paths.installed / fs::u8path(suffix)); + } + + Install::install_files_and_write_listfile( + fs, paths.installed / action.spec.triplet().to_string(), files, dirs); } // Copy files needed for integration @@ -572,13 +576,20 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) { + if (paths.manifest_mode_enabled()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + "vcpkg export does not support manifest mode, in order to allow for future design considerations. You " + "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); for (auto&& spec : opts.specs) Input::check_triplet(spec.triplet(), paths); // Load ports from ports dirs - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); // create the plan std::vector export_plan = Dependencies::create_export_plan(opts.specs, status_db); @@ -641,10 +652,18 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Chocolatey::do_export(export_plan, paths, opts.chocolatey_options); } - if(opts.prefab){ + if (opts.prefab) + { Prefab::do_export(export_plan, paths, opts.prefab_options, default_triplet); } 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 98% rename from toolsrc/src/vcpkg/commands.exportifw.cpp rename to toolsrc/src/vcpkg/export.ifw.cpp index 33b6acf0b7662a..8356313cf3f94f 100644 --- a/toolsrc/src/vcpkg/commands.exportifw.cpp +++ b/toolsrc/src/vcpkg/export.ifw.cpp @@ -2,6 +2,7 @@ #include #include + #include #include #include @@ -94,7 +95,7 @@ namespace vcpkg::Export::IFW package_xml_file_path.generic_u8string()); auto deps = Strings::join( - ",", binary_paragraph.depends, [](const std::string& dep) { return "packages." + dep + ":"; }); + ",", binary_paragraph.dependencies, [](const std::string& dep) { return "packages." + dep + ":"; }); if (!deps.empty()) deps = "\n " + deps + ""; @@ -175,7 +176,7 @@ namespace vcpkg::Export::IFW )###", action.spec.name(), - safe_rich_from_plain_text(binary_paragraph.description), + safe_rich_from_plain_text(Strings::join("\n", binary_paragraph.description)), binary_paragraph.version, create_release_date()), VCPKG_LINE_INFO); @@ -476,7 +477,7 @@ namespace vcpkg::Export::IFW ifw_package_dir_path / "vcpkg" / "info" / (binary_paragraph.fullstem() + ".list")); - Install::install_files_and_write_listfile(paths.get_filesystem(), paths.package_dir(action.spec), dirs); + Install::install_package_and_write_listfile(paths, action.spec, dirs); } System::printf("Exporting packages %s... done\n", ifw_packages_dir_path.generic_u8string()); diff --git a/toolsrc/src/vcpkg/export.prefab.cpp b/toolsrc/src/vcpkg/export.prefab.cpp index 9a3f240fa678d0..7dd516ac55702b 100644 --- a/toolsrc/src/vcpkg/export.prefab.cpp +++ b/toolsrc/src/vcpkg/export.prefab.cpp @@ -4,6 +4,7 @@ #include #include #include + #include #include #include @@ -18,8 +19,6 @@ namespace vcpkg::Export::Prefab using Install::InstallDir; using System::CPUArchitecture; - - static std::vector find_modules(const VcpkgPaths& system, const fs::path& root, const std::string& ext) { std::vector paths; @@ -161,7 +160,7 @@ namespace vcpkg::Export::Prefab if (std::regex_search(content, pkg_match, pkg_regex)) { - for (const auto& p : pkg_match) + for (const auto& p : pkg_match) { std::string delimiter = "="; std::string s = p.str(); @@ -220,28 +219,25 @@ namespace vcpkg::Export::Prefab static void maven_install(const fs::path& aar, const fs::path& pom, const Options& prefab_options) { - if(prefab_options.enable_debug){ + if (prefab_options.enable_debug) + { System::print2("\n[DEBUG] Installing POM and AAR file to ~/.m2\n\n"); } - const char* cmd_line_format = prefab_options.enable_debug ? R"("%s" "install:install-file" "-Dfile=%s" "-DpomFile=%s")" - : R"("%s" "-q" "install:install-file" "-Dfile=%s" "-DpomFile=%s")"; + const char* cmd_line_format = prefab_options.enable_debug + ? 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, aar.u8string(), pom.u8string()); 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()); } - static Build::PreBuildInfo build_info_from_triplet(const VcpkgPaths& paths, - const std::unique_ptr& provider, - const Triplet& triplet) + static std::unique_ptr build_info_from_triplet( + const VcpkgPaths& paths, const std::unique_ptr& provider, const Triplet& triplet) { provider->load_generic_triplet_vars(triplet); - const Build::PreBuildInfo pre_build_info( + return std::make_unique( paths, triplet, provider->get_generic_triplet_vars(triplet).value_or_exit(VCPKG_LINE_INFO)); - return pre_build_info; } static bool is_supported(const Build::PreBuildInfo& info) @@ -256,35 +252,40 @@ namespace vcpkg::Export::Prefab { auto provider = CMakeVars::make_triplet_cmake_var_provider(paths); - auto build_info = build_info_from_triplet(paths, provider, default_triplet); - Checks::check_exit(VCPKG_LINE_INFO, is_supported(build_info), "Currenty supported on android triplets"); + { + auto build_info = build_info_from_triplet(paths, provider, default_triplet); + Checks::check_exit(VCPKG_LINE_INFO, is_supported(*build_info), "Currenty supported on android triplets"); + } std::vector available_triplets = paths.get_available_triplets(); - std::unordered_map required_archs = { - {CPUArchitecture::ARM, "armeabi-v7a"}, - {CPUArchitecture::ARM64, "arm64-v8a"}, - {CPUArchitecture::X86, "x86"}, - {CPUArchitecture::X64, "x86_64"}}; + std::unordered_map required_archs = {{CPUArchitecture::ARM, "armeabi-v7a"}, + {CPUArchitecture::ARM64, "arm64-v8a"}, + {CPUArchitecture::X86, "x86"}, + {CPUArchitecture::X64, "x86_64"}}; std::unordered_map cpu_architecture_api_map = {{CPUArchitecture::ARM64, 21}, - {CPUArchitecture::ARM, 16}, - {CPUArchitecture::X64, 21}, - {CPUArchitecture::X86, 16}}; - + {CPUArchitecture::ARM, 16}, + {CPUArchitecture::X64, 21}, + {CPUArchitecture::X86, 16}}; std::vector triplets; std::unordered_map triplet_abi_map; std::unordered_map triplet_api_map; - for (auto& triplet_file : available_triplets){ - if (triplet_file.name.size() > 0){ + for (auto& triplet_file : available_triplets) + { + if (triplet_file.name.size() > 0) + { Triplet triplet = Triplet::from_canonical_name(std::move(triplet_file.name)); auto triplet_build_info = build_info_from_triplet(paths, provider, triplet); - if (is_supported(triplet_build_info)){ - auto cpu_architecture = System::to_cpu_architecture(triplet_build_info.target_architecture).value_or_exit(VCPKG_LINE_INFO); + if (is_supported(*triplet_build_info)) + { + auto cpu_architecture = System::to_cpu_architecture(triplet_build_info->target_architecture) + .value_or_exit(VCPKG_LINE_INFO); auto required_arch = required_archs.find(cpu_architecture); - if (required_arch != required_archs.end()){ + if (required_arch != required_archs.end()) + { triplets.push_back(triplet); triplet_abi_map[triplet] = required_archs[cpu_architecture]; triplet_api_map[triplet] = cpu_architecture_api_map[cpu_architecture]; @@ -294,9 +295,10 @@ namespace vcpkg::Export::Prefab } } - Checks::check_exit( - VCPKG_LINE_INFO, required_archs.empty(), "Export requires the following architectures arm64-v8a, armeabi-v7a, x86_64, x86 to be present"); + VCPKG_LINE_INFO, + required_archs.empty(), + "Export requires the following architectures arm64-v8a, armeabi-v7a, x86_64, x86 to be present"); Optional android_ndk_home = System::get_environment_variable("ANDROID_NDK_HOME"); @@ -329,10 +331,7 @@ namespace vcpkg::Export::Prefab NdkVersion version = to_version(version_opt.value_or_exit(VCPKG_LINE_INFO)).value_or_exit(VCPKG_LINE_INFO); - const fs::path vcpkg_root_path = paths.root; - const fs::path raw_exported_dir_path = vcpkg_root_path / "prefab"; - - utils.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); + utils.remove_all(paths.prefab, VCPKG_LINE_INFO); /* prefab @@ -374,32 +373,35 @@ namespace vcpkg::Export::Prefab for (const auto& action : export_plan) { - const std::string name = action.spec.name(); auto dependencies = action.dependencies(default_triplet); const auto action_build_info = Build::read_build_info(utils, paths.build_info_file_path(action.spec)); - const bool is_empty_package = action_build_info.policies.is_enabled(Build::BuildPolicy::EMPTY_PACKAGE); + const bool is_empty_package = action_build_info.policies.is_enabled(Build::BuildPolicy::EMPTY_PACKAGE); - - if(is_empty_package){ + if (is_empty_package) + { empty_package_dependencies[name] = std::set(); - for(auto dependency : dependencies){ - if(empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()){ - auto& child_deps = empty_package_dependencies[name]; + for (auto dependency : dependencies) + { + if (empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()) + { + auto& child_deps = empty_package_dependencies[name]; auto& parent_deps = empty_package_dependencies[dependency.name()]; - for(auto parent_dep: parent_deps){ - child_deps.insert(parent_dep); + for (auto parent_dep : parent_deps) + { + child_deps.insert(parent_dep); } } - else { + else + { empty_package_dependencies[name].insert(dependency); } } continue; } - const fs::path per_package_dir_path = raw_exported_dir_path / name; + const fs::path per_package_dir_path = paths.prefab / fs::u8path(name); const auto& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); const std::string norm_version = binary_paragraph.version; @@ -436,7 +438,7 @@ namespace vcpkg::Export::Prefab utils.create_directories(meta_dir, error_code); const fs::path share_root = - vcpkg_root_path / "packages" / Strings::format("%s_%s", name, action.spec.triplet()); + paths.packages / fs::u8path(Strings::format("%s_%s", name, action.spec.triplet())); utils.copy_file(share_root / "share" / name / "copyright", meta_dir / "LICENSE", @@ -450,13 +452,17 @@ namespace vcpkg::Export::Prefab std::set dependencies_minus_empty_packages; - for(auto dependency: dependencies){ - if(empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()){ - for(auto& empty_package_dep: empty_package_dependencies[dependency.name()]){ + for (auto dependency : dependencies) + { + if (empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()) + { + for (auto& empty_package_dep : empty_package_dependencies[dependency.name()]) + { dependencies_minus_empty_packages.insert(empty_package_dep); } } - else { + else + { dependencies_minus_empty_packages.insert(dependency); } } @@ -489,29 +495,34 @@ namespace vcpkg::Export::Prefab pom_dependencies.push_back("\n"); } - if(prefab_options.enable_debug){ - 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())); + if (prefab_options.enable_debug) + { + 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())); } utils.write_contents(manifest_path, manifest, VCPKG_LINE_INFO); utils.write_contents(prefab_path, pm.to_json(), VCPKG_LINE_INFO); - if(prefab_options.enable_debug){ - std::vector triplet_names; - for(auto triplet: triplets){ + if (prefab_options.enable_debug) + { + std::vector triplet_names; + for (auto triplet : triplets) + { triplet_names.push_back(triplet.canonical_name()); } - System::print2(Strings::format("[DEBUG] Found %d triplets\n\t%s\n\n", triplets.size(), - Strings::join("\n\t", triplet_names))); + System::print2(Strings::format( + "[DEBUG] Found %d triplets\n\t%s\n\n", triplets.size(), Strings::join("\n\t", triplet_names))); } for (const auto& triplet : triplets) { - const fs::path listfile = vcpkg_root_path / "installed" / "vcpkg" / "info" / - (Strings::format("%s_%s_%s", name, norm_version, triplet) + ".list"); - const fs::path installed_dir = vcpkg_root_path / "packages" / Strings::format("%s_%s", name, triplet); + const fs::path listfile = + paths.vcpkg_dir_info / + fs::u8path(Strings::format("%s_%s_%s", name, norm_version, triplet) + ".list"); + const fs::path installed_dir = paths.packages / fs::u8path(Strings::format("%s_%s", name, triplet)); Checks::check_exit(VCPKG_LINE_INFO, utils.exists(listfile), "Error: Packages not installed %s:%s %s", @@ -519,7 +530,7 @@ namespace vcpkg::Export::Prefab triplet, listfile.generic_u8string()); - fs::path libs = installed_dir / "lib"; + fs::path libs = installed_dir / fs::u8path("lib"); std::vector modules; @@ -540,13 +551,13 @@ namespace vcpkg::Export::Prefab if (modules.empty()) { fs::path module_dir = modules_directory / name; - fs::path module_libs_dir = module_dir / "libs"; + fs::path module_libs_dir = module_dir / fs::u8path("libs"); utils.create_directories(module_libs_dir, error_code); - fs::path installed_headers_dir = installed_dir / "include"; - fs::path exported_headers_dir = module_dir / "include"; + fs::path installed_headers_dir = installed_dir / fs::u8path("include"); + fs::path exported_headers_dir = module_dir / fs::u8path("include"); ModuleMetadata meta; - fs::path module_meta_path = module_dir / "module.json"; + fs::path module_meta_path = module_dir / fs::u8path("module.json"); utils.write_contents(module_meta_path, meta.to_json(), VCPKG_LINE_INFO); utils.copy(installed_headers_dir, exported_headers_dir, fs::copy_options::recursive); @@ -561,12 +572,13 @@ namespace vcpkg::Export::Prefab ABIMetadata ab; ab.abi = triplet_abi_map[triplet]; - ab.api = triplet_api_map[triplet]; + ab.api = triplet_api_map[triplet]; - ab.stl = Strings::contains(extension, "a") ?"c++_static": "c++_shared"; + ab.stl = Strings::contains(extension, "a") ? "c++_static" : "c++_shared"; ab.ndk = version.major(); - if(prefab_options.enable_debug){ + if (prefab_options.enable_debug) + { System::print2(Strings::format("[DEBUG] Found module %s:%s\n", module_name, ab.abi)); } @@ -577,15 +589,15 @@ namespace vcpkg::Export::Prefab module_name = module_name.substr(3); } fs::path module_dir = (modules_directory / module_name); - fs::path module_libs_dir = - module_dir / "libs" / Strings::format("android.%s", ab.abi); + fs::path module_libs_dir = module_dir / "libs" / Strings::format("android.%s", ab.abi); utils.create_directories(module_libs_dir, error_code); fs::path abi_path = module_libs_dir / "abi.json"; - if(prefab_options.enable_debug){ - System::print2(Strings::format("\tWriting abi metadata\n\tTo %s\n", - abi_path.generic_u8string())); + if (prefab_options.enable_debug) + { + System::print2( + Strings::format("\tWriting abi metadata\n\tTo %s\n", abi_path.generic_u8string())); } utils.write_contents(abi_path, ab.to_string(), VCPKG_LINE_INFO); @@ -596,17 +608,20 @@ namespace vcpkg::Export::Prefab exported_module_path, fs::copy_options::overwrite_existing, error_code); - if(prefab_options.enable_debug){ + 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())); + installed_module_path.generic_u8string(), + exported_module_path.generic_u8string())); } fs::path installed_headers_dir = installed_dir / "include"; fs::path exported_headers_dir = module_libs_dir / "include"; - - if(prefab_options.enable_debug){ + 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())); + installed_headers_dir.generic_u8string(), + exported_headers_dir.generic_u8string())); } utils.copy(installed_headers_dir, exported_headers_dir, fs::copy_options::recursive); @@ -615,9 +630,10 @@ namespace vcpkg::Export::Prefab fs::path module_meta_path = module_dir / "module.json"; - if(prefab_options.enable_debug){ + if (prefab_options.enable_debug) + { System::print2(Strings::format("\tWriting module metadata\n\tTo %s\n\n", - module_meta_path.generic_u8string())); + module_meta_path.generic_u8string())); } utils.write_contents(module_meta_path, meta.to_json(), VCPKG_LINE_INFO); @@ -628,9 +644,11 @@ namespace vcpkg::Export::Prefab fs::path exported_archive_path = per_package_dir_path / Strings::format("%s-%s.aar", name, norm_version); fs::path pom_path = per_package_dir_path / "pom.xml"; - if(prefab_options.enable_debug){ + 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())); + exported_archive_path.generic_u8string(), + pom_path.generic_u8string())); } compress_directory(paths, package_directory, exported_archive_path); @@ -660,14 +678,16 @@ namespace vcpkg::Export::Prefab if (prefab_options.enable_maven) { - maven_install(exported_archive_path, pom_path, prefab_options); - if(prefab_options.enable_debug){ - System::print2( - Strings::format("\n\n[DEBUG] Configuration properties in Android Studio\nIn app/build.gradle\n\n\t%s:%s:%s\n\n", - group_id, artifact_id, norm_version)); + if (prefab_options.enable_debug) + { + System::print2(Strings::format( + "\n\n[DEBUG] Configuration properties in Android Studio\nIn app/build.gradle\n\n\t%s:%s:%s\n\n", + group_id, + artifact_id, + norm_version)); - System::print2(R"(And cmake flags + System::print2(R"(And cmake flags externalNativeBuild { cmake { @@ -678,18 +698,18 @@ namespace vcpkg::Export::Prefab )"); - System::print2(R"(In gradle.properties + System::print2(R"(In gradle.properties android.enablePrefab=true android.enableParallelJsonGen=false android.prefabVersion=${prefab.version} -)");} +)"); + } } - System::print2(System::Color::success, - Strings::format("Successfuly exported %s. Checkout %s \n", - name, - raw_exported_dir_path.generic_u8string())); + System::print2( + System::Color::success, + Strings::format("Successfuly exported %s. Checkout %s \n", name, paths.prefab.generic_u8string())); } } } diff --git a/toolsrc/src/vcpkg/globalstate.cpp b/toolsrc/src/vcpkg/globalstate.cpp index aac5148fa85228..037232f11e8e25 100644 --- a/toolsrc/src/vcpkg/globalstate.cpp +++ b/toolsrc/src/vcpkg/globalstate.cpp @@ -7,8 +7,6 @@ namespace vcpkg Util::LockGuarded GlobalState::timer; Util::LockGuarded GlobalState::g_surveydate; - std::atomic GlobalState::g_binary_caching(false); - std::atomic GlobalState::g_init_console_cp(0); std::atomic GlobalState::g_init_console_output_cp(0); std::atomic GlobalState::g_init_console_initialized(false); diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index f4a8a0ab821b9f..856ea56239b11c 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -1,7 +1,16 @@ #include "pch.h" #include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9,56 +18,11 @@ namespace vcpkg::Help { - void HelpTableFormatter::format(StringView col1, StringView col2) - { - // 1 space, 32 col1, 1 space, 85 col2 = 119 - m_str.append(1, ' '); - Strings::append(m_str, col1); - if (col1.size() > 32) - { - newline_indent(); - } - else - { - m_str.append(33 - col1.size(), ' '); - } - const char* line_start = col2.begin(); - const char* const e = col2.end(); - const char* best_break = std::find_if(line_start, e, [](char ch) { return ch == ' ' || ch == '\n'; }); - - while (best_break != e) - { - const char* next_break = std::find_if(best_break + 1, e, [](char ch) { return ch == ' ' || ch == '\n'; }); - if (next_break - line_start > 85 || *best_break == '\n') - { - m_str.append(line_start, best_break); - line_start = best_break + 1; - best_break = next_break; - if (line_start != e) - { - newline_indent(); - } - } - else - { - best_break = next_break; - } - } - m_str.append(line_start, best_break); - m_str.push_back('\n'); - } - void HelpTableFormatter::newline_indent() - { - m_str.push_back('\n'); - indent(); - } - void HelpTableFormatter::indent() { m_str.append(34, ' '); } - struct Topic { using topic_function = void (*)(const VcpkgPaths& paths); - constexpr Topic(CStringView n, topic_function fn) : name(n), print(fn) {} + constexpr Topic(CStringView n, topic_function fn) : name(n), print(fn) { } CStringView name; topic_function print; @@ -67,28 +31,29 @@ namespace vcpkg::Help template static void command_topic_fn(const VcpkgPaths&) { - display_usage(S); + print_usage(S); } static void integrate_topic_fn(const VcpkgPaths&) { - System::print2("Commands:\n", Commands::Integrate::INTEGRATE_COMMAND_HELPSTRING); + System::print2("Commands:\n", Commands::Integrate::get_helpstring()); } static void help_topics(const VcpkgPaths&); const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("help"), + create_example_string("help"), 0, 1, {}, nullptr, }; - static constexpr std::array topics = {{ + static constexpr std::array topics = {{ + {"binarycaching", help_topic_binary_caching}, {"create", command_topic_fn}, - {"edit", command_topic_fn}, {"depend-info", command_topic_fn}, + {"edit", command_topic_fn}, {"env", command_topic_fn}, {"export", command_topic_fn}, {"help", command_topic_fn}, @@ -99,13 +64,12 @@ namespace vcpkg::Help {"remove", command_topic_fn}, {"search", command_topic_fn}, {"topics", help_topics}, + {"triplet", help_topic_valid_triplet}, }}; static void help_topics(const VcpkgPaths&) { - System::print2("Available help topics:\n" - " triplet\n" - " integrate", + System::print2("Available help topics:", Strings::join("", topics, [](const Topic& topic) { return std::string("\n ") + topic.name; }), "\n"); } @@ -145,67 +109,6 @@ namespace vcpkg::Help } } - void print_usage() - { -// Write environment variable names as %VARIABLE% on Windows and $VARIABLE in *nix -#ifdef _WIN32 -#define ENVVAR(VARNAME) "%" #VARNAME "%" -#else -#define ENVVAR(VARNAME) "$" #VARNAME -#endif - - System::print2( - "Commands:\n" - " vcpkg search [pat] Search for packages available to be built\n" - " vcpkg install ... Install a package\n" - " vcpkg remove ... Uninstall a package\n" - " vcpkg remove --outdated Uninstall all out-of-date packages\n" - " vcpkg list List installed packages\n" - " vcpkg update Display list of packages for updating\n" - " vcpkg upgrade Rebuild all outdated packages\n" - " vcpkg x-history (Experimental) Shows the history of CONTROL versions of a package\n" - " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" - " vcpkg help topics Display the list of help topics\n" - " vcpkg help Display help for a specific topic\n" - "\n", - Commands::Integrate::INTEGRATE_COMMAND_HELPSTRING, // Integration help - "\n" - " vcpkg export ... [opt]... Exports a package\n" - // clang-format off - " vcpkg edit Open up a port for editing (uses " ENVVAR(EDITOR) ", default 'code')\n" - " vcpkg import Import a pre-built library\n" - " vcpkg create [archivename]\n" - " Create a new package\n" - " vcpkg owns Search for files in installed packages\n" - " vcpkg depend-info ... Display a list of dependencies for packages\n" - " vcpkg env Creates a clean shell environment for development or compiling.\n" - " vcpkg version Display version information\n" - " vcpkg contact Display contact information to send feedback\n" - "\n" - "Options:\n" - " --triplet Specify the target architecture triplet. See 'vcpkg help triplet'\n" - " (default: " ENVVAR(VCPKG_DEFAULT_TRIPLET) ")\n" - " --overlay-ports= Specify directories to be used when searching for ports\n" - " --overlay-triplets= Specify directories containing triplets files\n" - " --vcpkg-root Specify the vcpkg root directory\n" - " (default: " ENVVAR(VCPKG_ROOT) ")\n" - " --x-scripts-root= (Experimental) Specify the scripts root directory\n" - "\n" - " @response_file Specify a response file to provide additional parameters\n" - "\n" - "For more help (including examples) see the accompanying README.md and docs folder.\n"); - // clang-format on -#undef ENVVAR - } - - std::string create_example_string(const std::string& command_and_arguments) - { - std::string cs = Strings::format("Example:\n" - " vcpkg %s\n", - command_and_arguments); - return cs; - } - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); @@ -216,7 +119,7 @@ namespace vcpkg::Help Checks::exit_success(VCPKG_LINE_INFO); } const auto& topic = args.command_arguments[0]; - if (topic == "triplet" || topic == "triplets" || topic == "triple") + if (topic == "triplets" || topic == "triple") { help_topic_valid_triplet(paths); Checks::exit_success(VCPKG_LINE_INFO); @@ -233,4 +136,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 0abe5182380210..f9184983c67947 100644 --- a/toolsrc/src/vcpkg/input.cpp +++ b/toolsrc/src/vcpkg/input.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include #include #include diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 1b9b7db34d6aa7..5cadbd786b9c9d 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -4,10 +4,11 @@ #include #include #include + #include #include #include -#include +#include #include #include #include @@ -42,30 +43,37 @@ namespace vcpkg::Install const fs::path& InstallDir::listfile() const { return this->m_listfile; } + void install_package_and_write_listfile(const VcpkgPaths& paths, + const PackageSpec& spec, + const InstallDir& destination_dir) + { + 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()); + auto files = fs.get_files_recursive(source_dir); + install_files_and_write_listfile(fs, source_dir, files, destination_dir); + } void install_files_and_write_listfile(Files::Filesystem& fs, const fs::path& source_dir, + const std::vector& files, const InstallDir& destination_dir) { std::vector output; std::error_code ec; - const size_t prefix_length = source_dir.native().size(); + const size_t prefix_length = source_dir.generic_u8string().size(); const fs::path& destination = destination_dir.destination(); const std::string& destination_subdirectory = destination_dir.destination_subdirectory(); const fs::path& listfile = destination_dir.listfile(); - Checks::check_exit( - VCPKG_LINE_INFO, fs.exists(source_dir), "Source directory %s does not exist", source_dir.generic_string()); fs.create_directories(destination, ec); - Checks::check_exit( - VCPKG_LINE_INFO, !ec, "Could not create destination directory %s", destination.generic_string()); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create destination directory %s", destination.u8string()); 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.generic_string()); + Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not create directory for listfile %s", listfile.u8string()); output.push_back(Strings::format(R"(%s/)", destination_subdirectory)); - auto files = fs.get_files_recursive(source_dir); for (auto&& file : files) { const auto status = fs.symlink_status(file, ec); @@ -75,11 +83,12 @@ namespace vcpkg::Install continue; } - const std::string filename = file.filename().u8string(); + const std::string filename = file.filename().generic_u8string(); 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"))) { - // Do not copy the control file + // Do not copy the control file or manifest file continue; } @@ -278,7 +287,7 @@ namespace vcpkg::Install const InstallDir install_dir = InstallDir::from_destination_root( paths.installed, triplet.to_string(), paths.listfile_path(bcf.core_paragraph)); - install_files_and_write_listfile(paths.get_filesystem(), package_dir, install_dir); + install_package_and_write_listfile(paths, bcf.core_paragraph.spec, install_dir); source_paragraph.state = InstallState::INSTALLED; write_update(paths, source_paragraph); @@ -298,9 +307,10 @@ namespace vcpkg::Install using Build::ExtendedBuildResult; static ExtendedBuildResult perform_install_plan_action(const VcpkgPaths& paths, - InstallPlanAction& action, - StatusParagraphs& status_db, - IBinaryProvider* binaries_provider) + InstallPlanAction& action, + StatusParagraphs& status_db, + IBinaryProvider& binaries_provider, + const Build::IBuildLogsRecorder& build_logs_recorder) { const InstallPlanType& plan_type = action.plan_type; const std::string display_name = action.spec.to_string(); @@ -320,19 +330,6 @@ namespace vcpkg::Install return BuildResult::SUCCEEDED; } - auto aux_install = [&](const std::string& name, const BinaryControlFile& bcf) -> BuildResult { - System::printf("Installing package %s...\n", name); - const auto install_result = install_package(paths, bcf, &status_db); - switch (install_result) - { - case InstallResult::SUCCESS: - System::printf(System::Color::success, "Installing package %s... done\n", name); - return BuildResult::SUCCEEDED; - case InstallResult::FILE_CONFLICTS: return BuildResult::FILE_CONFLICTS; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - }; - if (plan_type == InstallPlanType::BUILD_AND_INSTALL) { if (use_head_version) @@ -340,7 +337,7 @@ namespace vcpkg::Install else System::printf("Building package %s...\n", display_name_with_features); - auto result = Build::build_package(paths, action, binaries_provider, status_db); + auto result = Build::build_package(paths, action, binaries_provider, build_logs_recorder, status_db); if (BuildResult::DOWNLOADED == result.code) { @@ -359,7 +356,19 @@ namespace vcpkg::Install auto bcf = std::make_unique( Paragraphs::try_load_cached_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO)); - auto code = aux_install(display_name_with_features, *bcf); + System::printf("Installing package %s...\n", display_name_with_features); + const auto install_result = install_package(paths, *bcf, &status_db); + BuildResult code; + switch (install_result) + { + case InstallResult::SUCCESS: + System::printf( + System::Color::success, "Installing package %s... done\n", display_name_with_features); + code = BuildResult::SUCCEEDED; + break; + case InstallResult::FILE_CONFLICTS: code = BuildResult::FILE_CONFLICTS; break; + default: Checks::unreachable(VCPKG_LINE_INFO); + } if (action.build_options.clean_packages == Build::CleanPackages::YES) { @@ -421,88 +430,124 @@ namespace vcpkg::Install } } + struct TrackedPackageInstallGuard + { + SpecSummary* current_summary = nullptr; + Chrono::ElapsedTimer build_timer = Chrono::ElapsedTimer::create_started(); + + TrackedPackageInstallGuard(const size_t package_count, + std::vector& results, + const PackageSpec& spec) + { + results.emplace_back(spec, nullptr); + current_summary = &results.back(); + System::printf("Starting package %zd/%zd: %s\n", results.size(), package_count, spec.to_string()); + } + + ~TrackedPackageInstallGuard() + { + current_summary->timing = build_timer.elapsed(); + System::printf( + "Elapsed time for package %s: %s\n", current_summary->spec.to_string(), current_summary->timing); + } + + TrackedPackageInstallGuard(const TrackedPackageInstallGuard&) = delete; + TrackedPackageInstallGuard& operator=(const TrackedPackageInstallGuard&) = delete; + }; + InstallSummary perform(ActionPlan& action_plan, const KeepGoing keep_going, const VcpkgPaths& paths, StatusParagraphs& status_db, + IBinaryProvider& binaryprovider, + const Build::IBuildLogsRecorder& build_logs_recorder, const CMakeVars::CMakeVarProvider& var_provider) { std::vector results; - - const auto timer = Chrono::ElapsedTimer::create_started(); - size_t counter = 0; const size_t package_count = action_plan.remove_actions.size() + action_plan.install_actions.size(); - auto with_tracking = [&](const PackageSpec& spec, auto f) { - const auto build_timer = Chrono::ElapsedTimer::create_started(); - counter++; - - const std::string display_name = spec.to_string(); - System::printf("Starting package %zd/%zd: %s\n", counter, package_count, display_name); - - results.emplace_back(spec, nullptr); - - f(); - - results.back().timing = build_timer.elapsed(); - System::printf("Elapsed time for package %s: %s\n", display_name, results.back().timing); - }; - + const auto timer = Chrono::ElapsedTimer::create_started(); for (auto&& action : action_plan.remove_actions) { - with_tracking(action.spec, - [&]() { Remove::perform_remove_plan_action(paths, action, Remove::Purge::YES, &status_db); }); + TrackedPackageInstallGuard this_install(package_count, results, action.spec); + Remove::perform_remove_plan_action(paths, action, Remove::Purge::YES, &status_db); } for (auto&& action : action_plan.already_installed) { results.emplace_back(action.spec, &action); - results.back().build_result = perform_install_plan_action(paths, action, status_db, nullptr); + results.back().build_result = + perform_install_plan_action(paths, action, status_db, binaryprovider, build_logs_recorder); } Build::compute_all_abis(paths, action_plan, var_provider, status_db); - auto binary_provider = create_archives_provider(); + binaryprovider.prefetch(paths, action_plan); + for (auto&& action : action_plan.install_actions) { - with_tracking(action.spec, [&]() { - auto result = perform_install_plan_action(paths, action, status_db, binary_provider.get()); - - if (result.code != BuildResult::SUCCEEDED && keep_going == KeepGoing::NO) - { - System::print2(Build::create_user_troubleshooting_message(action.spec), '\n'); - Checks::exit_fail(VCPKG_LINE_INFO); - } + TrackedPackageInstallGuard this_install(package_count, results, action.spec); + auto result = perform_install_plan_action(paths, action, status_db, binaryprovider, build_logs_recorder); + if (result.code != BuildResult::SUCCEEDED && keep_going == KeepGoing::NO) + { + System::print2(Build::create_user_troubleshooting_message(action.spec), '\n'); + Checks::exit_fail(VCPKG_LINE_INFO); + } - results.back().action = &action; - results.back().build_result = std::move(result); - }); + this_install.current_summary->action = &action; + this_install.current_summary->build_result = std::move(result); } + return InstallSummary{std::move(results), timer.to_string()}; } - static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; - static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "--head"; - static constexpr StringLiteral OPTION_NO_DOWNLOADS = "--no-downloads"; - static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "--only-downloads"; - static constexpr StringLiteral OPTION_RECURSE = "--recurse"; - static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going"; - static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; - static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2"; - static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "--clean-after-build"; - - static constexpr std::array INSTALL_SWITCHES = {{ + static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; + static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "head"; + static constexpr StringLiteral OPTION_NO_DOWNLOADS = "no-downloads"; + static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "only-downloads"; + static constexpr StringLiteral OPTION_RECURSE = "recurse"; + static constexpr StringLiteral OPTION_KEEP_GOING = "keep-going"; + static constexpr StringLiteral OPTION_EDITABLE = "editable"; + static constexpr StringLiteral OPTION_XUNIT = "x-xunit"; + 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"}, + {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"}, + }}; + 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 = {{ + + static constexpr std::array INSTALL_SETTINGS = {{ {OPTION_XUNIT, "File to output results in XUnit format (Internal use)"}, + {OPTION_WRITE_PACKAGES_CONFIG, + "Writes out a NuGet packages.config-formatted file for use with external binary caching.\nSee `vcpkg help " + "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) @@ -514,13 +559,21 @@ namespace vcpkg::Install } const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("install zlib zlib:x64-windows curl boost"), + create_example_string("install zlib zlib:x64-windows curl boost"), 1, SIZE_MAX, {INSTALL_SWITCHES, INSTALL_SETTINGS}, &get_all_port_names, }; + const CommandStructure MANIFEST_COMMAND_STRUCTURE = { + create_example_string("install --triplet x64-windows"), + 0, + 0, + {MANIFEST_INSTALL_SWITCHES, INSTALL_SETTINGS, MANIFEST_INSTALL_MULTISETTINGS}, + nullptr, + }; + static void print_cmake_information(const BinaryParagraph& bpgh, const VcpkgPaths& paths) { static const std::regex cmake_library_regex(R"(\badd_library\(([^\$\s\)]+)\s)", @@ -544,6 +597,8 @@ namespace vcpkg::Install { std::map config_files; std::map> library_targets; + bool is_header_only = true; + std::string header_path; for (auto&& suffix : *p_lines) { @@ -583,10 +638,42 @@ namespace vcpkg::Install config_files[find_package_name] = root; } } + if (Strings::case_insensitive_ascii_contains(suffix, "/lib/") || + Strings::case_insensitive_ascii_contains(suffix, "/bin/")) + { + if (!Strings::ends_with(suffix, ".pc") && !Strings::ends_with(suffix, "/")) is_header_only = false; + } + + if (is_header_only && header_path.empty()) + { + auto it = suffix.find("/include/"); + if (it != std::string::npos && !Strings::ends_with(suffix, "/")) + { + header_path = suffix.substr(it + 9); + } + } } if (library_targets.empty()) { + if (is_header_only && !header_path.empty()) + { + static auto cmakeify = [](std::string name) { + auto n = Strings::ascii_to_uppercase(Strings::replace_all(std::move(name), "-", "_")); + if (n.empty() || Parse::ParserBase::is_ascii_digit(n[0])) + { + n.insert(n.begin(), '_'); + } + return n; + }; + + const auto name = cmakeify(bpgh.spec.name()); + auto msg = Strings::concat( + "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); + } } else { @@ -636,23 +723,17 @@ namespace vcpkg::Install void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) { // input sanitization - const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + const ParsedArguments options = + args.parse_arguments(paths.manifest_mode_enabled() ? MANIFEST_COMMAND_STRUCTURE : COMMAND_STRUCTURE); - const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { - return Input::check_and_get_full_package_spec( - std::string(arg), default_triplet, COMMAND_STRUCTURE.example_text); - }); - - for (auto&& spec : specs) - { - Input::check_triplet(spec.package_spec.triplet(), paths); - } + auto binaryprovider = create_binary_provider_from_configs(args.binary_sources).value_or_exit(VCPKG_LINE_INFO); const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION)); const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS)); const bool only_downloads = Util::Sets::contains(options.switches, (OPTION_ONLY_DOWNLOADS)); const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE)); + const bool is_editable = Util::Sets::contains(options.switches, (OPTION_EDITABLE)); const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2)); const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD)); const KeepGoing keep_going = @@ -660,10 +741,6 @@ namespace vcpkg::Install auto& fs = paths.get_filesystem(); - // create the plan - System::print2("Computing installation plan...\n"); - StatusParagraphs status_db = database_load_check(paths); - Build::DownloadTool download_tool = Build::DownloadTool::BUILT_IN; if (use_aria2) download_tool = Build::DownloadTool::ARIA2; @@ -671,19 +748,78 @@ namespace vcpkg::Install Util::Enum::to_enum(use_head_version), Util::Enum::to_enum(!no_downloads), Util::Enum::to_enum(only_downloads), - clean_after_build ? Build::CleanBuildtrees::YES : Build::CleanBuildtrees::NO, - clean_after_build ? Build::CleanPackages::YES : Build::CleanPackages::NO, - clean_after_build ? Build::CleanDownloads::YES : Build::CleanDownloads::NO, + Util::Enum::to_enum(clean_after_build), + Util::Enum::to_enum(clean_after_build), + Util::Enum::to_enum(clean_after_build), download_tool, - (GlobalState::g_binary_caching && !only_downloads) ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, - Build::FailOnTombstone::NO, + Build::PurgeDecompressFailure::NO, + Util::Enum::to_enum(is_editable), }; - //// Load ports from ports dirs - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); auto var_provider_storage = CMakeVars::make_triplet_cmake_var_provider(paths); auto& var_provider = *var_provider_storage; + if (paths.manifest_mode_enabled()) + { + Optional pkgsconfig; + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) + { + pkgsconfig = fs::u8path(it_pkgsconfig->second); + } + + std::vector features; + + if (Util::Sets::contains(options.switches, OPTION_MANIFEST_NO_DEFAULT_FEATURES)) + { + features.emplace_back("core"); + } + + auto manifest_feature_it = options.multisettings.find(OPTION_MANIFEST_FEATURE); + if (manifest_feature_it != options.multisettings.end()) + { + for (const auto& feature : manifest_feature_it->second) + { + features.push_back(feature); + } + } + + std::vector specs; + specs.emplace_back(PackageSpec{PackageSpec::MANIFEST_NAME, default_triplet}, std::move(features)); + auto install_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, {}); + + for (InstallPlanAction& action : install_plan.install_actions) + { + 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, + std::move(install_plan), + dry_run ? Commands::DryRun::Yes : Commands::DryRun::No, + pkgsconfig); + } + + const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { + return Input::check_and_get_full_package_spec( + std::string(arg), default_triplet, COMMAND_STRUCTURE.example_text); + }); + + for (auto&& spec : specs) + { + Input::check_triplet(spec.package_spec.triplet(), paths); + } + + // create the plan + System::print2("Computing installation plan...\n"); + StatusParagraphs status_db = database_load_check(paths); + // Note: action_plan will hold raw pointers to SourceControlFileLocations from this map auto action_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, status_db); @@ -691,7 +827,10 @@ namespace vcpkg::Install { action.build_options = install_plan_options; if (action.request_type != RequestType::USER_REQUESTED) + { action.build_options.use_head_version = Build::UseHeadVersion::NO; + action.build_options.editable = Build::Editable::NO; + } } var_provider.load_tag_vars(action_plan, provider); @@ -731,7 +870,7 @@ namespace vcpkg::Install { const auto vs_prompt_view = to_zstring_view(vs_prompt); System::print2(vcpkg::System::Color::warning, - "warning: vcpkg appears to be in a Visual Studio prompt targeting ", + "warning: vcpkg appears to be in a Visual Studio prompt targeting ", vs_prompt_view, " but is installing packages for ", common_triplet.to_string(), @@ -750,12 +889,30 @@ namespace vcpkg::Install Dependencies::print_plan(action_plan, is_recursive, paths.ports); + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) + { + Build::compute_all_abis(paths, action_plan, var_provider, status_db); + + 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"); + } + if (dry_run) { Checks::exit_success(VCPKG_LINE_INFO); } - const InstallSummary summary = perform(action_plan, keep_going, paths, status_db, var_provider); + const InstallSummary summary = + perform(action_plan, + keep_going, + paths, + status_db, + args.binary_caching_enabled() && !only_downloads ? *binaryprovider : null_binary_provider(), + Build::null_build_logs_recorder(), + var_provider); System::print2("\nTotal elapsed time: ", summary.total_elapsed_time, "\n\n"); @@ -787,6 +944,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/logicexpression.cpp b/toolsrc/src/vcpkg/logicexpression.cpp deleted file mode 100644 index e91c57310b33c6..00000000000000 --- a/toolsrc/src/vcpkg/logicexpression.cpp +++ /dev/null @@ -1,314 +0,0 @@ -#include "pch.h" - -#include -#include -#include -#include - -#include -#include - -namespace vcpkg -{ - using vcpkg::Parse::ParseError; - - enum class Identifier - { - invalid, // not a recognized identifier - x64, - x86, - arm, - arm64, - - windows, - linux, - osx, - uwp, - android, - - static_link, - }; - - // logic expression supports the following : - // primary-expression: - // ( logic-expression ) - // identifier - // identifier: - // alpha-numeric string of characters - // logic-expression: <- this is the entry point - // not-expression - // not-expression | logic-expression - // not-expression & logic-expression - // not-expression: - // ! primary-expression - // primary-expression - // - // | and & have equal precidence and cannot be used together at the same nesting level - // for example a|b&c is not allowd but (a|b)&c and a|(b&c) are allowed. - class ExpressionParser : public Parse::ParserBase - { - public: - ExpressionParser(const std::string& str, const ExpressionContext& context) : evaluation_context(context) - { - this->init(str, "CONTROL"); - { - auto override_vars = evaluation_context.cmake_context.find("VCPKG_DEP_INFO_OVERRIDE_VARS"); - if (override_vars != evaluation_context.cmake_context.end()) - { - auto cmake_list = Strings::split(override_vars->second, ";"); - for (auto& override_id : cmake_list) - { - if (!override_id.empty()) - { - if (override_id[0] == '!') - { - context_override.insert({override_id.substr(1), false}); - } - else - { - context_override.insert({override_id, true}); - } - } - } - } - } - skip_whitespace(); - - final_result = logic_expression(); - - if (!at_eof()) - { - add_error("invalid logic expression, unexpected character"); - } - } - - bool get_result() const { return final_result; } - - private: - const ExpressionContext& evaluation_context; - std::map context_override; - - bool final_result; - - static bool is_identifier_char(char ch) - { - return is_upper_alpha(ch) || is_lower_alpha(ch) || is_ascii_digit(ch) || ch == '-'; - } - - // Legacy evaluation only searches for substrings. Use this only for diagnostic purposes. - bool evaluate_identifier_legacy(const std::string name) const - { - return evaluation_context.legacy_context.find(name) != std::string::npos; - } - - static Identifier string2identifier(const std::string& name) - { - static const std::map id_map = { - {"x64", Identifier::x64}, - {"x86", Identifier::x86}, - {"arm", Identifier::arm}, - {"arm64", Identifier::arm64}, - {"windows", Identifier::windows}, - {"linux", Identifier::linux}, - {"osx", Identifier::osx}, - {"uwp", Identifier::uwp}, - {"android", Identifier::android}, - {"static", Identifier::static_link}, - }; - - auto id_pair = id_map.find(name); - - if (id_pair == id_map.end()) - { - return Identifier::invalid; - } - - return id_pair->second; - } - - bool true_if_exists_and_equal(const std::string& variable_name, const std::string& value) - { - auto iter = evaluation_context.cmake_context.find(variable_name); - if (iter == evaluation_context.cmake_context.end()) - { - return false; - } - return iter->second == value; - } - - // If an identifier is on the explicit override list, return the override value - // Otherwise fall back to the built in logic to evaluate - // All unrecognized identifiers are an error - bool evaluate_identifier_cmake(const std::string name, const SourceLoc& loc) - { - auto id = string2identifier(name); - - switch (id) - { - case Identifier::invalid: - // Point out in the diagnostic that they should add to the override list because that is what - // most users should do, however it is also valid to update the built in identifiers to recognize - // the name. - add_error("Unrecognized identifer name. Add to override list in triplet file.", loc); - break; - - case Identifier::x64: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "x64"); - case Identifier::x86: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "x86"); - case Identifier::arm: - // For backwards compatability arm is also true for arm64. - // This is because it previously was only checking for a substring. - return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm") || - true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm64"); - case Identifier::arm64: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm64"); - case Identifier::windows: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "") || true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"); - case Identifier::linux: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Linux"); - case Identifier::osx: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Darwin"); - case Identifier::uwp: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"); - case Identifier::android: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Android"); - case Identifier::static_link: return true_if_exists_and_equal("VCPKG_LIBRARY_LINKAGE", "static"); - } - - return evaluation_context.legacy_context.find(name) != std::string::npos; - } - - bool evaluate_identifier(const std::string name, const SourceLoc& loc) - { - if (!context_override.empty()) - { - auto override_id = context_override.find(name); - if (override_id != context_override.end()) - { - return override_id->second; - } - // Fall through to use the cmake logic if the id does not have an override - } - - bool legacy = evaluate_identifier_legacy(name); - bool cmake = evaluate_identifier_cmake(name, loc); - if (legacy != cmake) - { - // Legacy evaluation only used the name of the triplet, now we use the actual - // cmake variables. This has the potential to break custom triplets. - // For now just print a message, this will need to change once we start introducing - // new variables that did not exist previously (such as host-*) - System::print2("Warning: qualifier has changed meaning recently:\n ", name, '\n'); - } - return cmake; - } - - // identifier: - // alpha-numeric string of characters - bool identifier_expression() - { - auto start_loc = cur_loc(); - std::string name = match_zero_or_more(is_identifier_char).to_string(); - - if (name.empty()) - { - add_error("unexpected character in logic expression"); - return false; - } - - bool result = evaluate_identifier(name, start_loc); - skip_whitespace(); - return result; - } - - // not-expression: - // ! primary-expression - // primary-expression - bool not_expression() - { - if (cur() == '!') - { - next(); - skip_whitespace(); - return !primary_expression(); - } - - return primary_expression(); - } - - template - bool logic_expression_helper(bool seed) - { - do - { - // Support chains of the operator to avoid breaking backwards compatability - while (next() == oper) - { - }; - skip_whitespace(); - seed = operation(not_expression(), seed); - - } while (cur() == oper); - - if (cur() == other) - { - add_error("mixing & and | is not allowed, use () to specify order of operations"); - } - - skip_whitespace(); - return seed; - } - static bool and_helper(bool left, bool right) { return left && right; } - static bool or_helper(bool left, bool right) { return left || right; } - - // logic-expression: <- entry point - // not-expression - // not-expression | logic-expression - // not-expression & logic-expression - bool logic_expression() - { - auto result = not_expression(); - - switch (cur()) - { - case '|': - { - return logic_expression_helper<'|', '&', or_helper>(result); - } - case '&': - { - return logic_expression_helper<'&', '|', and_helper>(result); - } - default: return result; - } - } - - // primary-expression: - // ( logic-expression ) - // identifier - bool primary_expression() - { - if (cur() == '(') - { - next(); - skip_whitespace(); - bool result = logic_expression(); - if (cur() != ')') - { - add_error("missing closing )"); - return result; - } - next(); - skip_whitespace(); - return result; - } - - return identifier_expression(); - } - }; - - ExpectedT evaluate_expression(const std::string& expression, const ExpressionContext& context) - { - ExpressionParser parser(expression, context); - - if (auto err = parser.get_error()) - { - return err->format(); - } - - return parser.get_result(); - } -} diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 06478d3f40e01d..49c4f0d0c635cb 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -1,14 +1,16 @@ #include "pch.h" -#include -#include - #include #include #include +#include #include #include +#include +#include +#include + #if defined(_WIN32) #pragma comment(lib, "version") #pragma comment(lib, "winhttp") @@ -29,88 +31,85 @@ namespace vcpkg::Metrics return ""; } - static std::string generate_random_UUID() + struct append_hexits { - int part_sizes[] = {8, 4, 4, 4, 12}; - char uuid[37]; - memset(uuid, 0, sizeof(uuid)); - int num; - srand(static_cast(time(nullptr))); - int index = 0; - for (int part = 0; part < 5; part++) + constexpr static char hex[17] = "0123456789abcdef"; + void operator()(std::string& res, std::uint8_t bits) const { - if (part > 0) - { - uuid[index] = '-'; - index++; - } + res.push_back(hex[(bits >> 4) & 0x0F]); + res.push_back(hex[(bits >> 0) & 0x0F]); + } + }; - // Generating UUID format version 4 - // http://en.wikipedia.org/wiki/Universally_unique_identifier - for (int i = 0; i < part_sizes[part]; i++, index++) - { - if (part == 2 && i == 0) - { - num = 4; - } - else if (part == 4 && i == 0) - { - num = (rand() % 4) + 8; - } - else - { - num = rand() % 16; - } + // 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) + { + // uuid_field_size in bytes, not hex characters + constexpr size_t uuid_top_field_size[] = {4, 2, 2}; + constexpr size_t uuid_bottom_field_size[] = {2, 6}; - if (num < 10) - { - uuid[index] = static_cast('0' + num); - } - else - { - uuid[index] = static_cast('a' + (num - 10)); - } - } - } + // uuid_field_size in hex characters, not bytes + constexpr size_t uuid_size = 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12; - return uuid; - } + constexpr static append_hexits write_byte; - static const std::string& get_session_id() - { - static const std::string ID = generate_random_UUID(); - return ID; - } + // set the version bits to 4 + top &= 0xFFFF'FFFF'FFFF'0FFFULL; + top |= 0x0000'0000'0000'4000ULL; - static std::string to_json_string(const std::string& str) - { - std::string encoded = "\""; - for (auto&& ch : str) + // set the variant bits to 2 (variant one) + bottom &= 0x3FFF'FFFF'FFFF'FFFFULL; + bottom |= 0x8000'0000'0000'0000ULL; + + std::string res; + res.reserve(uuid_size); + + bool first = true; + size_t start_byte = 0; + for (auto field_size : uuid_top_field_size) { - if (ch == '\\') + if (!first) { - encoded.append("\\\\"); + res.push_back('-'); } - else if (ch == '"') + first = false; + for (size_t i = start_byte; i < start_byte + field_size; ++i) { - encoded.append("\\\""); + auto shift = 64 - (i + 1) * 8; + write_byte(res, (top >> shift) & 0xFF); } - else if (ch < 0x20 || static_cast(ch) >= 0x80) - { - // Note: this treats incoming Strings as Latin-1 - static constexpr const char HEX[16] = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - encoded.append("\\u00"); - encoded.push_back(HEX[ch / 16]); - encoded.push_back(HEX[ch % 16]); - } - else + start_byte += field_size; + } + + start_byte = 0; + for (auto field_size : uuid_bottom_field_size) + { + res.push_back('-'); + for (size_t i = start_byte; i < start_byte + field_size; ++i) { - encoded.push_back(ch); + auto shift = 64 - (i + 1) * 8; + write_byte(res, (bottom >> shift) & 0xFF); } + start_byte += field_size; } - encoded.push_back('"'); - return encoded; + + return res; + } + + // UUID format version 4, variant 1 + // http://en.wikipedia.org/wiki/Universally_unique_identifier + // [0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12} + static std::string generate_random_UUID() + { + std::random_device rnd{}; + std::uniform_int_distribution uid{}; + return uuid_of_integers(uid(rnd), uid(rnd)); + } + + static const std::string& get_session_id() + { + static const std::string ID = generate_random_UUID(); + return ID; } static std::string get_os_version_string() @@ -150,32 +149,33 @@ namespace vcpkg::Metrics std::string user_id = generate_random_UUID(); std::string user_timestamp; std::string timestamp = get_current_date_time(); - std::string properties; - std::string measurements; - std::vector buildtime_names; - std::vector buildtime_times; + Json::Object properties; + Json::Object measurements; + + Json::Array buildtime_names; + Json::Array buildtime_times; + + Json::Object feature_flags; void track_property(const std::string& name, const std::string& value) { - if (properties.size() != 0) properties.push_back(','); - properties.append(to_json_string(name)); - properties.push_back(':'); - properties.append(to_json_string(value)); + properties.insert_or_replace(name, Json::Value::string(value)); } void track_metric(const std::string& name, double value) { - if (measurements.size() != 0) measurements.push_back(','); - measurements.append(to_json_string(name)); - measurements.push_back(':'); - measurements.append(std::to_string(value)); + measurements.insert_or_replace(name, Json::Value::number(value)); } void track_buildtime(const std::string& name, double value) { - buildtime_names.push_back(name); - buildtime_times.push_back(std::to_string(value)); + buildtime_names.push_back(Json::Value::string(name)); + buildtime_times.push_back(Json::Value::number(value)); + } + void track_feature(const std::string& name, bool value) + { + feature_flags.insert(name, Json::Value::boolean(value)); } std::string format_event_data_template() const @@ -183,58 +183,62 @@ namespace vcpkg::Metrics auto props_plus_buildtimes = properties; if (buildtime_names.size() > 0) { - if (props_plus_buildtimes.size() > 0) props_plus_buildtimes.push_back(','); - props_plus_buildtimes.append(Strings::format(R"("buildnames_1": [%s], "buildtimes": [%s])", - Strings::join(",", buildtime_names, to_json_string), - Strings::join(",", buildtime_times))); + props_plus_buildtimes.insert("buildnames_1", buildtime_names); + props_plus_buildtimes.insert("buildtimes", buildtime_times); } - const std::string& session_id = get_session_id(); - return Strings::format(R"([{ - "ver": 1, - "name": "Microsoft.ApplicationInsights.Event", - "time": "%s", - "sampleRate": 100.000000, - "seq": "0:0", - "iKey": "b4e88960-4393-4dd9-ab8e-97e8fe6d7603", - "flags": 0.000000, - "tags": { - "ai.device.os": "Other", - "ai.device.osVersion": "%s-%s", - "ai.session.id": "%s", - "ai.user.id": "%s", - "ai.user.accountAcquisitionDate": "%s" - }, - "data": { - "baseType": "EventData", - "baseData": { - "ver": 2, - "name": "commandline_test7", - "properties": { %s }, - "measurements": { %s } - } - } -}])", - timestamp, + Json::Array arr = Json::Array(); + Json::Object& obj = arr.push_back(Json::Object()); + + obj.insert("ver", Json::Value::integer(1)); + obj.insert("name", Json::Value::string("Microsoft.ApplicationInsights.Event")); + obj.insert("time", Json::Value::string(timestamp)); + obj.insert("sampleRate", Json::Value::number(100.0)); + obj.insert("seq", Json::Value::string("0:0")); + obj.insert("iKey", Json::Value::string("b4e88960-4393-4dd9-ab8e-97e8fe6d7603")); + obj.insert("flags", Json::Value::integer(0)); + + { + Json::Object& tags = obj.insert("tags", Json::Object()); + + tags.insert("ai.device.os", Json::Value::string("Other")); + + const char* os_name = #if defined(_WIN32) - "Windows", + "Windows"; #elif defined(__APPLE__) - "OSX", + "OSX"; #elif defined(__linux__) - "Linux", + "Linux"; #elif defined(__FreeBSD__) - "FreeBSD", + "FreeBSD"; #elif defined(__unix__) - "Unix", + "Unix"; #else - "Other", + "Other"; #endif - get_os_version_string(), - session_id, - user_id, - user_timestamp, - props_plus_buildtimes, - measurements); + + tags.insert("ai.device.osVersion", + Json::Value::string(Strings::format("%s-%s", os_name, get_os_version_string()))); + tags.insert("ai.session.id", Json::Value::string(get_session_id())); + tags.insert("ai.user.id", Json::Value::string(user_id)); + tags.insert("ai.user.accountAcquisitionDate", Json::Value::string(user_timestamp)); + } + + { + Json::Object& data = obj.insert("data", Json::Object()); + + data.insert("baseType", Json::Value::string("EventData")); + Json::Object& base_data = data.insert("baseData", Json::Object()); + + base_data.insert("ver", Json::Value::integer(2)); + base_data.insert("name", Json::Value::string("commandline_test7")); + 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()); } }; @@ -247,12 +251,39 @@ namespace vcpkg::Metrics #endif ; static bool g_should_print_metrics = false; + static bool g_metrics_disabled = +#if VCPKG_DISABLE_METRICS + true +#else + false +#endif + ; - bool get_compiled_metrics_enabled() { return VCPKG_DISABLE_METRICS == 0; } + // for child vcpkg processes, we also want to disable metrics + static void set_vcpkg_disable_metrics_environment_variable(bool disabled) + { +#if defined(_WIN32) + SetEnvironmentVariableW(L"VCPKG_DISABLE_METRICS", disabled ? L"1" : nullptr); +#else + if (disabled) + { + setenv("VCPKG_DISABLE_METRICS", "1", true); + } + else + { + unsetenv("VCPKG_DISABLE_METRICS"); + } +#endif + } std::string get_MAC_user() { #if defined(_WIN32) + if (!g_metrics.lock()->metrics_enabled()) + { + return "{}"; + } + auto getmac = System::cmd_execute_and_capture_output("getmac"); if (getmac.exit_code != 0) return "0"; @@ -293,20 +324,64 @@ namespace vcpkg::Metrics void Metrics::set_print_metrics(bool should_print_metrics) { g_should_print_metrics = should_print_metrics; } - void Metrics::track_metric(const std::string& name, double value) { g_metricmessage.track_metric(name, value); } + void Metrics::set_disabled(bool disabled) + { + set_vcpkg_disable_metrics_environment_variable(disabled); + g_metrics_disabled = disabled; + } + + bool Metrics::metrics_enabled() + { +#if VCPKG_DISABLE_METRICS + return false; +#else + return !g_metrics_disabled; +#endif + } + + void Metrics::track_metric(const std::string& name, double value) + { + if (!metrics_enabled()) + { + return; + } + g_metricmessage.track_metric(name, value); + } void Metrics::track_buildtime(const std::string& name, double value) { + if (!metrics_enabled()) + { + return; + } g_metricmessage.track_buildtime(name, value); } void Metrics::track_property(const std::string& name, const std::string& value) { + if (!metrics_enabled()) + { + return; + } g_metricmessage.track_property(name, value); } + void Metrics::track_feature(const std::string& name, bool value) + { + if (!metrics_enabled()) + { + return; + } + g_metricmessage.track_feature(name, value); + } + void Metrics::upload(const std::string& payload) { + if (!metrics_enabled()) + { + return; + } + #if !defined(_WIN32) Util::unused(payload); #else @@ -315,9 +390,15 @@ namespace vcpkg::Metrics const HINTERNET session = WinHttpOpen( L"vcpkg/1.0", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); - if (session) connect = WinHttpConnect(session, L"dc.services.visualstudio.com", INTERNET_DEFAULT_HTTPS_PORT, 0); + + unsigned long secure_protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; + if (session && WinHttpSetOption(session, WINHTTP_OPTION_SECURE_PROTOCOLS, &secure_protocols, sizeof(DWORD))) + { + connect = WinHttpConnect(session, L"dc.services.visualstudio.com", INTERNET_DEFAULT_HTTPS_PORT, 0); + } if (connect) + { request = WinHttpOpenRequest(connect, L"POST", L"/v2/track", @@ -325,6 +406,7 @@ namespace vcpkg::Metrics WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE); + } if (request) { @@ -393,8 +475,13 @@ namespace vcpkg::Metrics #endif } - void Metrics::flush() + void Metrics::flush(Files::Filesystem& fs) { + if (!metrics_enabled()) + { + return; + } + const std::string payload = g_metricmessage.format_event_data_template(); if (g_should_print_metrics) std::cerr << payload << "\n"; if (!g_should_send_metrics) return; @@ -408,8 +495,6 @@ namespace vcpkg::Metrics temp_folder_path / Strings::format("vcpkgmetricsuploader-%s.exe", Commands::Version::base_version()); #endif - auto& fs = Files::get_real_filesystem(); - #if defined(_WIN32) const fs::path exe_path = [&fs]() -> fs::path { @@ -448,7 +533,7 @@ namespace vcpkg::Metrics #else auto escaped_path = Strings::escape_string(vcpkg_metrics_txt_path.u8string(), '\'', '\\'); const std::string cmd_line = Strings::format( - R"((curl "https://dc.services.visualstudio.com/v2/track" -H "Content-Type: application/json" -X POST --data '@%s' >/dev/null 2>&1; rm '%s') &)", + 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, escaped_path); System::cmd_execute_clean(cmd_line); diff --git a/toolsrc/src/vcpkg/packagespec.cpp b/toolsrc/src/vcpkg/packagespec.cpp index 702f7aad3daed3..c9b6091b815e72 100644 --- a/toolsrc/src/vcpkg/packagespec.cpp +++ b/toolsrc/src/vcpkg/packagespec.cpp @@ -1,10 +1,11 @@ #include "pch.h" #include +#include #include + #include #include -#include namespace vcpkg { @@ -64,7 +65,8 @@ namespace vcpkg { return parse_qualified_specifier(spec_as_string) .then([&](ParsedQualifiedSpecifier&& p) -> ExpectedS { - if (p.qualifier) return "Error: qualifier not allowed in this context: " + spec_as_string + "\n"; + if (p.platform) + return "Error: platform specifier not allowed in this context: " + spec_as_string + "\n"; auto triplet = p.triplet ? Triplet::from_canonical_name(std::move(*p.triplet.get())) : default_triplet; return FullPackageSpec({p.name, triplet}, p.features.value_or({})); }); @@ -91,32 +93,31 @@ 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 { if (pqs.triplet) return "Error: triplet not allowed in this context: " + name + "\n"; - if (pqs.qualifier) return "Error: qualifier not allowed in this context: " + name + "\n"; + if (pqs.platform) return "Error: platform specifier not allowed in this context: " + name + "\n"; return Features{pqs.name, pqs.features.value_or({})}; }); } - static bool is_package_name_char(char ch) + static bool is_package_name_char(char32_t ch) { return Parse::ParserBase::is_lower_alpha(ch) || Parse::ParserBase::is_ascii_digit(ch) || ch == '-'; } - static bool is_feature_name_char(char ch) { - // TODO: we do not intend underscores to be valid, however there is currently a feature using them (libwebp[vwebp_sdl]). + static bool is_feature_name_char(char32_t ch) + { + // TODO: we do not intend underscores to be valid, however there is currently a feature using them + // (libwebp[vwebp_sdl]). // TODO: we need to rename this feature, then remove underscores from this list. return is_package_name_char(ch) || ch == '_'; } - ExpectedS parse_qualified_specifier(CStringView input) + ExpectedS parse_qualified_specifier(StringView input) { - Parse::ParserBase parser; - parser.init(input, ""); + auto parser = Parse::ParserBase(input, ""); auto maybe_pqs = parse_qualified_specifier(parser); if (!parser.at_eof()) parser.add_error("expected eof"); if (auto e = parser.get_error()) return e->format(); @@ -128,11 +129,15 @@ namespace vcpkg using Parse::ParserBase; auto ret = parser.match_zero_or_more(is_feature_name_char).to_string(); auto ch = parser.cur(); - if (ParserBase::is_upper_alpha(ch) || ch == '_') + + // ignores the feature name vwebp_sdl as a back-compat thing + const bool has_underscore = std::find(ret.begin(), ret.end(), '_') != ret.end() && ret != "vwebp_sdl"; + if (has_underscore || ParserBase::is_upper_alpha(ch)) { parser.add_error("invalid character in feature name (must be lowercase, digits, '-')"); return nullopt; } + if (ret.empty()) { parser.add_error("expected feature name (must be lowercase, digits, '-')"); @@ -225,6 +230,7 @@ namespace vcpkg if (ch == '(') { auto loc = parser.cur_loc(); + std::string platform_string; int depth = 1; while (depth > 0 && (ch = parser.next()) != 0) { @@ -233,10 +239,20 @@ namespace vcpkg } if (depth > 0) { - parser.add_error("unmatched open braces in qualifier", loc); + parser.add_error("unmatched open braces in platform specifier", loc); return nullopt; } - ret.qualifier = StringView(loc.it + 1, parser.it()).to_string(); + platform_string.append((++loc.it).pointer_to_current(), parser.it().pointer_to_current()); + auto platform_opt = PlatformExpression::parse_platform_expression( + platform_string, PlatformExpression::MultipleBinaryOperators::Allow); + if (auto platform = platform_opt.get()) + { + ret.platform = std::move(*platform); + } + else + { + parser.add_error(platform_opt.error(), loc); + } parser.next(); } // This makes the behavior of the parser more consistent -- otherwise, it will skip tabs and spaces only if @@ -244,4 +260,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 index 920a4b16b03835..8bd5c0d7ac1068 100644 --- a/toolsrc/src/vcpkg/paragraphparseresult.cpp +++ b/toolsrc/src/vcpkg/paragraphparseresult.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include namespace vcpkg diff --git a/toolsrc/src/vcpkg/paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp index 82bc7b1095987f..20a82ee0c09f32 100644 --- a/toolsrc/src/vcpkg/paragraphs.cpp +++ b/toolsrc/src/vcpkg/paragraphs.cpp @@ -1,13 +1,14 @@ #include "pch.h" #include +#include #include #include #include + #include #include #include -#include using namespace vcpkg::Parse; using namespace vcpkg; @@ -67,12 +68,12 @@ namespace vcpkg::Paragraphs } public: - ExpectedS> get_paragraphs(CStringView text, CStringView origin) + PghParser(StringView text, StringView origin) : Parse::ParserBase(text, origin) { } + + ExpectedS> get_paragraphs() { std::vector paragraphs; - init(text, origin); - skip_whitespace(); while (!at_eof()) { @@ -86,10 +87,9 @@ namespace vcpkg::Paragraphs } }; - static ExpectedS parse_single_paragraph(const std::string& str, const std::string& origin) + ExpectedS parse_single_paragraph(const std::string& str, const std::string& origin) { - PghParser parser; - auto pghs = parser.get_paragraphs(str, origin); + auto pghs = PghParser(str, origin).get_paragraphs(); if (auto p = pghs.get()) { @@ -126,20 +126,74 @@ namespace vcpkg::Paragraphs ExpectedS> parse_paragraphs(const std::string& str, const std::string& origin) { - PghParser parser; - return parser.get_paragraphs(str, origin); + return PghParser(str, origin).get_paragraphs(); + } + + bool is_port_directory(const Files::Filesystem& fs, const fs::path& path) + { + 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) + { + auto error_info = std::make_unique(); + auto res = Json::parse_file(fs, path_to_manifest, ec); + if (ec) return error_info; + + if (auto val = res.get()) + { + if (val->first.is_object()) + { + return SourceControlFile::parse_manifest_file(path_to_manifest, val->first.object()); + } + else + { + error_info->name = port_name; + error_info->error = "Manifest files must have a top-level object"; + return error_info; + } + } + else + { + error_info->name = port_name; + error_info->error = res.error()->format(); + return error_info; + } } ParseExpected try_load_port(const Files::Filesystem& fs, const fs::path& path) { - const auto path_to_control = path / "CONTROL"; + const auto path_to_manifest = path / fs::u8path("vcpkg.json"); + const auto path_to_control = path / fs::u8path("CONTROL"); + if (fs.exists(path_to_manifest)) + { + 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()); + + std::error_code ec; + auto res = try_load_manifest(fs, path.filename().u8string(), path_to_manifest, ec); + if (ec) + { + auto error_info = std::make_unique(); + error_info->name = path.filename().u8string(); + error_info->error = Strings::format( + "Failed to load manifest file for port: %s\n", path_to_manifest.u8string(), ec.message()); + } + + return res; + } ExpectedS> pghs = get_paragraphs(fs, path_to_control); if (auto vector_pghs = pghs.get()) { return SourceControlFile::parse_control_file(path_to_control, std::move(*vector_pghs)); } auto error_info = std::make_unique(); - error_info->name = path.filename().generic_u8string(); + error_info->name = path.filename().u8string(); error_info->error = pghs.error(); return error_info; } diff --git a/toolsrc/src/vcpkg/platform-expression.cpp b/toolsrc/src/vcpkg/platform-expression.cpp new file mode 100644 index 00000000000000..03bc81367df3d8 --- /dev/null +++ b/toolsrc/src/vcpkg/platform-expression.cpp @@ -0,0 +1,551 @@ +#include "pch.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include + +namespace vcpkg::PlatformExpression +{ + using vcpkg::Parse::ParseError; + + enum class Identifier + { + invalid = -1, // not a recognized identifier + x86, + x64, + arm, + arm64, + wasm32, + + windows, + linux, + osx, + uwp, + android, + emscripten, + + static_link, + }; + + static Identifier string2identifier(StringView name) + { + static const std::map id_map = { + {"x86", Identifier::x86}, + {"x64", Identifier::x64}, + {"arm", Identifier::arm}, + {"arm64", Identifier::arm64}, + {"wasm32", Identifier::wasm32}, + {"windows", Identifier::windows}, + {"linux", Identifier::linux}, + {"osx", Identifier::osx}, + {"uwp", Identifier::uwp}, + {"android", Identifier::android}, + {"emscripten", Identifier::emscripten}, + {"static", Identifier::static_link}, + }; + + auto id_pair = id_map.find(name); + + if (id_pair == id_map.end()) + { + return Identifier::invalid; + } + + return id_pair->second; + } + + namespace detail + { + enum class ExprKind + { + identifier, + op_not, + op_and, + op_or + }; + + struct ExprImpl + { + ExprImpl(ExprKind k, std::string i, std::vector> es) + : kind(k), identifier(std::move(i)), exprs(std::move(es)) + { + } + + ExprImpl(ExprKind k, std::string i) : kind(k), identifier(std::move(i)) { } + ExprImpl(ExprKind k, std::unique_ptr a) : kind(k) { exprs.push_back(std::move(a)); } + ExprImpl(ExprKind k, std::vector> es) : kind(k), exprs(std::move(es)) { } + + ExprKind kind; + std::string identifier; + std::vector> exprs; + + std::unique_ptr clone() const + { + return std::make_unique( + ExprImpl{kind, identifier, Util::fmap(exprs, [](auto&& p) { return p->clone(); })}); + } + }; + + class ExpressionParser : public Parse::ParserBase + { + public: + ExpressionParser(StringView str, MultipleBinaryOperators multiple_binary_operators) + : Parse::ParserBase(str, "CONTROL"), multiple_binary_operators(multiple_binary_operators) + { + } + + MultipleBinaryOperators multiple_binary_operators; + + bool allow_multiple_binary_operators() const + { + return multiple_binary_operators == MultipleBinaryOperators::Allow; + } + + PlatformExpression::Expr parse() + { + skip_whitespace(); + + auto res = expr(); + + if (!at_eof()) + { + add_error("invalid logic expression, unexpected character"); + } + + return Expr(std::move(res)); + } + + private: + // + // + // & + // + // + // | + + static bool is_identifier_char(char32_t ch) { return is_lower_alpha(ch) || is_ascii_digit(ch); } + + // : + // + // + // + std::unique_ptr expr() + { + auto result = expr_not(); + + switch (cur()) + { + case '|': + { + return expr_binary<'|', '&'>(std::make_unique(ExprKind::op_or, std::move(result))); + } + case '&': + { + return expr_binary<'&', '|'>(std::make_unique(ExprKind::op_and, std::move(result))); + } + default: return result; + } + } + + // : + // ( ) + // + std::unique_ptr expr_simple() + { + if (cur() == '(') + { + next(); + skip_whitespace(); + auto result = expr(); + if (cur() != ')') + { + add_error("missing closing )"); + return result; + } + next(); + skip_whitespace(); + return result; + } + + return expr_identifier(); + } + + // : + // A lowercase alpha-numeric string + std::unique_ptr expr_identifier() + { + std::string name = match_zero_or_more(is_identifier_char).to_string(); + + if (name.empty()) + { + add_error("unexpected character in logic expression"); + } + + skip_whitespace(); + return std::make_unique(ExprKind::identifier, std::move(name)); + } + + // : + // + // ! + std::unique_ptr expr_not() + { + if (cur() == '!') + { + next(); + skip_whitespace(); + return std::make_unique(ExprKind::op_not, expr_simple()); + } + + return expr_simple(); + } + + template + std::unique_ptr expr_binary(std::unique_ptr&& seed) + { + do + { + // Support chains of the operator to avoid breaking backwards compatibility + do + { + next(); + } while (allow_multiple_binary_operators() && cur() == oper); + + skip_whitespace(); + seed->exprs.push_back(expr_not()); + } while (cur() == oper); + + if (cur() == other) + { + add_error("mixing & and | is not allowed; use () to specify order of operations"); + } + + skip_whitespace(); + return std::move(seed); + } + }; + } + + using namespace detail; + + Expr::Expr() = default; + Expr::Expr(Expr&& other) = default; + Expr& Expr::operator=(Expr&& other) = default; + + Expr::Expr(const Expr& other) + { + if (other.underlying_) + { + this->underlying_ = other.underlying_->clone(); + } + } + Expr& Expr::operator=(const Expr& other) + { + if (other.underlying_) + { + this->underlying_ = other.underlying_->clone(); + } + else + { + this->underlying_.reset(); + } + + return *this; + } + + Expr::Expr(std::unique_ptr&& e) : underlying_(std::move(e)) { } + Expr::~Expr() = default; + + Expr Expr::Identifier(StringView id) + { + return Expr(std::make_unique(ExprKind::identifier, id.to_string())); + } + Expr Expr::Not(Expr&& e) { return Expr(std::make_unique(ExprKind::op_not, std::move(e.underlying_))); } + Expr Expr::And(std::vector&& exprs) + { + return Expr(std::make_unique( + ExprKind::op_and, Util::fmap(exprs, [](Expr& expr) { return std::move(expr.underlying_); }))); + } + Expr Expr::Or(std::vector&& exprs) + { + return Expr(std::make_unique( + ExprKind::op_or, Util::fmap(exprs, [](Expr& expr) { return std::move(expr.underlying_); }))); + } + + bool Expr::evaluate(const Context& context) const + { + if (!this->underlying_) + { + return true; // empty expression is always true + } + + std::map override_ctxt; + { + auto override_vars = context.find("VCPKG_DEP_INFO_OVERRIDE_VARS"); + if (override_vars != context.end()) + { + auto cmake_list = Strings::split(override_vars->second, ';'); + for (auto& override_id : cmake_list) + { + if (!override_id.empty()) + { + if (override_id[0] == '!') + { + override_ctxt.insert({override_id.substr(1), false}); + } + else + { + override_ctxt.insert({override_id, true}); + } + } + } + } + } + + struct Visitor + { + const Context& context; + const std::map& override_ctxt; + + bool true_if_exists_and_equal(const std::string& variable_name, const std::string& value) const + { + auto iter = context.find(variable_name); + if (iter == context.end()) + { + return false; + } + return iter->second == value; + } + + bool visit(const ExprImpl& expr) const + { + if (expr.kind == ExprKind::identifier) + { + if (!override_ctxt.empty()) + { + auto override_id = override_ctxt.find(expr.identifier); + if (override_id != override_ctxt.end()) + { + return override_id->second; + } + // Fall through to use the cmake logic if the id does not have an override + } + + auto id = string2identifier(expr.identifier); + switch (id) + { + case Identifier::invalid: + // Point out in the diagnostic that they should add to the override list because that is + // what most users should do, however it is also valid to update the built in identifiers to + // recognize the name. + System::printf( + System::Color::error, + "Error: Unrecognized identifer name %s. Add to override list in triplet file.\n", + expr.identifier); + return false; + case Identifier::x64: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "x64"); + case Identifier::x86: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "x86"); + case Identifier::arm: + // For backwards compatability arm is also true for arm64. + // This is because it previously was only checking for a substring. + return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm") || + true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm64"); + case Identifier::arm64: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "arm64"); + case Identifier::windows: + return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "") || + true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"); + case Identifier::linux: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Linux"); + case Identifier::osx: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Darwin"); + case Identifier::uwp: + return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "WindowsStore"); + case Identifier::android: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Android"); + case Identifier::emscripten: + return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Emscripten"); + case Identifier::wasm32: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "wasm32"); + case Identifier::static_link: + return true_if_exists_and_equal("VCPKG_LIBRARY_LINKAGE", "static"); + default: + Checks::exit_with_message( + VCPKG_LINE_INFO, + "vcpkg bug: string2identifier returned a value that we don't recognize: %d\n", + static_cast(id)); + } + } + else if (expr.kind == ExprKind::op_not) + { + return !visit(*expr.exprs.at(0)); + } + else if (expr.kind == ExprKind::op_and) + { + bool valid = true; + + // we want to print errors in all expressions, so we check all of the expressions all the time + for (const auto& e : expr.exprs) + { + valid &= visit(*e); + } + + return valid; + } + else if (expr.kind == ExprKind::op_or) + { + bool valid = false; + + // we want to print errors in all expressions, so we check all of the expressions all the time + for (const auto& e : expr.exprs) + { + valid |= visit(*e); + } + + return valid; + } + else + { + Checks::unreachable(VCPKG_LINE_INFO); + } + } + }; + + 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); + auto res = parser.parse(); + + if (auto p = parser.extract_error()) + { + return p->format(); + } + else + { + 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 e43fa862a878ca..c0538fdb8264d5 100644 --- a/toolsrc/src/vcpkg/portfileprovider.cpp +++ b/toolsrc/src/vcpkg/portfileprovider.cpp @@ -1,4 +1,6 @@ -#include +#include "pch.h" + +#include #include #include @@ -24,35 +26,76 @@ namespace vcpkg::PortFileProvider } PathsPortFileProvider::PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, - const std::vector* ports_dirs_paths) + const std::vector& ports_dirs_paths) : filesystem(paths.get_filesystem()) { - auto& fs = Files::get_real_filesystem(); - if (ports_dirs_paths) + if (paths.manifest_mode_enabled()) + { + manifest = paths.manifest_root_dir / fs::u8path("vcpkg.json"); + } + auto& fs = paths.get_filesystem(); + for (auto&& overlay_path : ports_dirs_paths) { - for (auto&& overlay_path : *ports_dirs_paths) + if (!overlay_path.empty()) { - if (!overlay_path.empty()) + auto overlay = fs::u8path(overlay_path); + if (overlay.is_absolute()) + { + overlay = fs.canonical(VCPKG_LINE_INFO, overlay); + } + else { - auto overlay = fs::stdfs::canonical(fs::u8path(overlay_path)); + overlay = fs.canonical(VCPKG_LINE_INFO, paths.original_cwd / overlay); + } - Checks::check_exit(VCPKG_LINE_INFO, - filesystem.exists(overlay), - "Error: Path \"%s\" does not exist", - overlay.string()); + Debug::print("Using overlay: ", overlay.u8string(), "\n"); - Checks::check_exit(VCPKG_LINE_INFO, - fs::is_directory(fs.status(VCPKG_LINE_INFO, overlay)), - "Error: Path \"%s\" must be a directory", - overlay.string()); + Checks::check_exit( + VCPKG_LINE_INFO, filesystem.exists(overlay), "Error: Path \"%s\" does not exist", overlay.string()); - ports_dirs.emplace_back(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); } } ports_dirs.emplace_back(paths.ports); } + const SourceControlFileLocation* PathsPortFileProvider::load_manifest_file() const + { + if (!manifest.empty()) + { + std::error_code ec; + auto maybe_scf = Paragraphs::try_load_manifest(filesystem, "manifest", manifest, ec); + if (ec) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to read manifest file %s: %s", manifest.u8string(), ec.message()); + } + + if (auto scf = maybe_scf.get()) + { + auto it = cache.emplace(std::piecewise_construct, + std::forward_as_tuple(PackageSpec::MANIFEST_NAME), + std::forward_as_tuple(std::move(*scf), manifest.parent_path())); + return &it.first->second; + } + else + { + vcpkg::print_error_message(maybe_scf.error()); + Checks::exit_with_message( + VCPKG_LINE_INFO, "Error: Failed to load manifest file %s.", manifest.u8string()); + } + } + else + { + return nullptr; + } + } + ExpectedS PathsPortFileProvider::get_control_file(const std::string& spec) const { auto cache_it = cache.find(spec); @@ -61,10 +104,22 @@ namespace vcpkg::PortFileProvider return cache_it->second; } + if (spec == PackageSpec::MANIFEST_NAME) + { + if (auto p = load_manifest_file()) + { + return *p; + } + else + { + Checks::unreachable(VCPKG_LINE_INFO); + } + } + for (auto&& ports_dir : ports_dirs) { // Try loading individual port - if (filesystem.exists(ports_dir / "CONTROL")) + if (Paragraphs::is_port_directory(filesystem, ports_dir)) { auto maybe_scf = Paragraphs::try_load_port(filesystem, ports_dir); if (auto scf = maybe_scf.get()) @@ -81,12 +136,16 @@ 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, ports_dir.u8string()); } + + continue; } - else if (filesystem.exists(ports_dir / spec / "CONTROL")) + + auto ports_spec = ports_dir / spec; + if (Paragraphs::is_port_directory(filesystem, ports_spec)) { - auto found_scf = Paragraphs::try_load_port(filesystem, ports_dir / spec); + auto found_scf = Paragraphs::try_load_port(filesystem, ports_spec); if (auto scf = found_scf.get()) { if (scf->get()->core_paragraph->name == spec) @@ -119,10 +178,16 @@ namespace vcpkg::PortFileProvider // Reload cache with ports contained in all ports_dirs cache.clear(); std::vector ret; + + if (auto p = load_manifest_file()) + { + ret.push_back(p); + } + for (auto&& ports_dir : ports_dirs) { // Try loading individual port - if (filesystem.exists(ports_dir / "CONTROL")) + if (Paragraphs::is_port_directory(filesystem, ports_dir)) { auto maybe_scf = Paragraphs::try_load_port(filesystem, ports_dir); if (auto scf = maybe_scf.get()) diff --git a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp index e966ce78a3e8c1..e9215ed8ccb69e 100644 --- a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include using vcpkg::Build::ConfigurationType; diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index c6d5f04beb03b5..f70876c2ed7dc3 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -5,6 +5,7 @@ #include #include #include + #include #include #include @@ -152,6 +153,7 @@ 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}; @@ -318,7 +320,7 @@ namespace vcpkg::PostBuildLint { return LintStatus::SUCCESS; } - const fs::path current_buildtrees_dir = paths.buildtrees / spec.name(); + const fs::path current_buildtrees_dir = paths.build_dir(spec); const fs::path current_buildtrees_dir_src = current_buildtrees_dir / "src"; std::vector potential_copyright_files; @@ -342,17 +344,19 @@ namespace vcpkg::PostBuildLint System::printf(System::Color::warning, "The software license must be available at ${CURRENT_PACKAGES_DIR}/share/%s/copyright\n", spec.name()); - if (potential_copyright_files.size() == - 1) // if there is only one candidate, provide the cmake lines needed to place it in the proper location + if (potential_copyright_files.size() == 1) { + // if there is only one candidate, provide the cmake lines needed to place it in the proper location const fs::path found_file = potential_copyright_files[0]; - const fs::path relative_path = found_file.string().erase( - 0, current_buildtrees_dir.string().size() + 1); // The +1 is needed to remove the "/" - System::printf( - "\n configure_file(\"${CURRENT_BUILDTREES_DIR}/%s/%s\" \"${CURRENT_PACKAGES_DIR}/share/%s/copyright\" COPYONLY)\n", - relative_path.generic_string(), - found_file.filename().generic_string(), - spec.name()); + auto found_relative_native = found_file.native(); + found_relative_native.erase(current_buildtrees_dir.native().size() + + 1); // The +1 is needed to remove the "/" + const fs::path relative_path = found_relative_native; + System::printf("\n configure_file(\"${CURRENT_BUILDTREES_DIR}/%s/%s\" " + "\"${CURRENT_PACKAGES_DIR}/share/%s/copyright\" COPYONLY)\n", + relative_path.generic_string(), + found_file.filename().generic_string(), + spec.name()); } else if (potential_copyright_files.size() > 1) { diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index e1a03b808945a1..8f6a9926256c1d 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -2,6 +2,7 @@ #include #include + #include #include #include @@ -21,7 +22,7 @@ namespace vcpkg::Remove void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db) { auto& fs = paths.get_filesystem(); - auto maybe_ipv = status_db->find_all_installed(spec); + auto maybe_ipv = status_db->get_installed_package_view(spec); Checks::check_exit( VCPKG_LINE_INFO, maybe_ipv.has_value(), "unable to remove package %s: already removed", spec); @@ -72,6 +73,7 @@ namespace vcpkg::Remove fs.remove(target, ec); if (ec) { + // TODO: this is racy; should we ignore this error? #if defined(_WIN32) fs::stdfs::permissions(target, fs::perms::owner_all | fs::perms::group_all, ec); fs.remove(target, ec); @@ -177,22 +179,20 @@ namespace vcpkg::Remove if (purge == Purge::YES) { - System::printf("Purging package %s...\n", display_name); Files::Filesystem& fs = paths.get_filesystem(); fs.remove_all(paths.packages / action.spec.dir(), VCPKG_LINE_INFO); - System::printf(System::Color::success, "Purging package %s... done\n", display_name); } } - static constexpr StringLiteral OPTION_PURGE = "--purge"; - static constexpr StringLiteral OPTION_NO_PURGE = "--no-purge"; - static constexpr StringLiteral OPTION_RECURSE = "--recurse"; - static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; - static constexpr StringLiteral OPTION_OUTDATED = "--outdated"; + static constexpr StringLiteral OPTION_PURGE = "purge"; + static constexpr StringLiteral OPTION_NO_PURGE = "no-purge"; + static constexpr StringLiteral OPTION_RECURSE = "recurse"; + static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; + static constexpr StringLiteral OPTION_OUTDATED = "outdated"; static constexpr std::array SWITCHES = {{ {OPTION_PURGE, "Remove the cached copy of the package (default)"}, - {OPTION_NO_PURGE, "Do not remove the cached copy of the package"}, + {OPTION_NO_PURGE, "Do not remove the cached copy of the package (deprecated)"}, {OPTION_RECURSE, "Allow removal of packages not explicitly specified on the command line"}, {OPTION_DRY_RUN, "Print the packages to be removed, but do not remove them"}, {OPTION_OUTDATED, "Select all packages with versions that do not match the portfiles"}, @@ -207,7 +207,7 @@ namespace vcpkg::Remove } const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("remove zlib zlib:x64-windows curl boost"), + create_example_string("remove zlib zlib:x64-windows curl boost"), 0, SIZE_MAX, {SWITCHES, {}}, @@ -216,6 +216,12 @@ namespace vcpkg::Remove void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet) { + if (paths.manifest_mode_enabled()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "vcpkg remove does not support manifest mode. In order to remove dependencies, " + "you will need to edit your manifest (vcpkg.json)."); + } const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); StatusParagraphs status_db = database_load_check(paths); @@ -229,7 +235,7 @@ namespace vcpkg::Remove } // Load ports from ports dirs - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); specs = Util::fmap(Update::find_outdated_packages(provider, status_db), [](auto&& outdated) { return outdated.spec; }); @@ -293,6 +299,27 @@ namespace vcpkg::Remove } } + for (const auto& action : remove_plan) + { + if (action.plan_type == RemovePlanType::NOT_INSTALLED && action.request_type == RequestType::USER_REQUESTED) + { + // The user requested removing a package that was not installed. If the port is installed for another + // triplet, warn the user that they may have meant that other package. + for (const auto& package : status_db) + { + if (package->is_installed() && !package->package.is_feature() && + package->package.spec.name() == action.spec.name()) + { + System::print2( + System::Color::warning, + "Another installed package matches the name of an unmatched request. Did you mean ", + package->package.spec, + "?\n"); + } + } + } + } + if (dry_run) { Checks::exit_success(VCPKG_LINE_INFO); @@ -305,4 +332,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 b5e0ebe314606b..7bd560c8adbf3f 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -1,45 +1,140 @@ #include "pch.h" -#include -#include -#include -#include - #include #include #include +#include #include #include +#include +#include +#include +#include + 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"; - static const std::string DEFAULTFEATURES = "Default-Features"; + static const std::string DEFAULT_FEATURES = "Default-Features"; static const std::string DESCRIPTION = "Description"; static const std::string FEATURE = "Feature"; - static const std::string MAINTAINER = "Maintainer"; - static const std::string SOURCE = "Source"; + static const std::string MAINTAINERS = "Maintainer"; + static const std::string NAME = "Source"; static const std::string VERSION = "Version"; + static const std::string PORT_VERSION = "Port-Version"; static const std::string HOMEPAGE = "Homepage"; static const std::string TYPE = "Type"; static const std::string SUPPORTS = "Supports"; } - static Span get_list_of_valid_fields() + 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 std::string valid_fields[] = { - SourceParagraphFields::SOURCE, + static const StringView valid_fields[] = { + SourceParagraphFields::NAME, SourceParagraphFields::VERSION, + SourceParagraphFields::PORT_VERSION, SourceParagraphFields::DESCRIPTION, - SourceParagraphFields::MAINTAINER, + SourceParagraphFields::MAINTAINERS, SourceParagraphFields::BUILD_DEPENDS, SourceParagraphFields::HOMEPAGE, SourceParagraphFields::TYPE, SourceParagraphFields::SUPPORTS, + SourceParagraphFields::DEFAULT_FEATURES, + }; + + 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; @@ -65,22 +160,29 @@ namespace vcpkg if (!error_info->extra_fields.empty()) { System::print2(System::Color::error, - "Error: There are invalid fields in the control file of ", + "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\n ", - Strings::join("\n ", error_info->extra_fields), - "\n\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 (case-sensitive): \n\n ", + 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("Different source may be available for vcpkg. Use .\\bootstrap-vcpkg.bat to update.\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) @@ -91,9 +193,29 @@ namespace vcpkg "Error: There are missing fields in the control file of ", error_info->name, '\n'); - System::print2("The following fields were missing:\n\n ", - Strings::join("\n ", error_info->missing_fields), - "\n\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"); } } } @@ -111,10 +233,132 @@ namespace vcpkg Type Type::from_string(const std::string& t) { if (t == "Alias") return Type{Type::ALIAS}; - if (t == "Port" || t == "") return Type{Type::PORT}; + if (t == "Port" || t.empty()) return Type{Type::PORT}; return Type{Type::UNKNOWN}; } + bool operator==(const Type& lhs, const Type& rhs) { return lhs.type == rhs.type; } + bool operator!=(const Type& lhs, const Type& rhs) { return !(lhs == rhs); } + + static void trim_all(std::vector& arr) + { + for (auto& el : arr) + { + el = Strings::trim(std::move(el)); + } + } + + 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(); @@ -123,20 +367,53 @@ namespace vcpkg auto spgh = std::make_unique(); - parser.required_field(SourceParagraphFields::SOURCE, spgh->name); + parser.required_field(SourceParagraphFields::NAME, spgh->name); parser.required_field(SourceParagraphFields::VERSION, spgh->version); - spgh->description = parser.optional_field(SourceParagraphFields::DESCRIPTION); - spgh->maintainer = parser.optional_field(SourceParagraphFields::MAINTAINER); + auto pv_str = parser.optional_field(SourceParagraphFields::PORT_VERSION); + if (!pv_str.empty()) + { + auto pv_opt = Strings::strto(pv_str); + if (auto pv = pv_opt.get()) + { + spgh->port_version = *pv; + } + else + { + parser.add_type_error(SourceParagraphFields::PORT_VERSION, "a non-negative integer"); + } + } + + spgh->description = Strings::split(parser.optional_field(SourceParagraphFields::DESCRIPTION), '\n'); + trim_all(spgh->description); + + spgh->maintainers = Strings::split(parser.optional_field(SourceParagraphFields::MAINTAINERS), '\n'); + trim_all(spgh->maintainers); + spgh->homepage = parser.optional_field(SourceParagraphFields::HOMEPAGE); TextRowCol textrowcol; std::string buf; parser.optional_field(SourceParagraphFields::BUILD_DEPENDS, {buf, textrowcol}); - spgh->depends = parse_dependencies_list(buf, origin, textrowcol).value_or_exit(VCPKG_LINE_INFO); + spgh->dependencies = parse_dependencies_list(buf, origin, textrowcol).value_or_exit(VCPKG_LINE_INFO); buf.clear(); - parser.optional_field(SourceParagraphFields::DEFAULTFEATURES, {buf, textrowcol}); + parser.optional_field(SourceParagraphFields::DEFAULT_FEATURES, {buf, textrowcol}); spgh->default_features = parse_default_features_list(buf, origin, textrowcol).value_or_exit(VCPKG_LINE_INFO); - spgh->supports_expression = parser.optional_field(SourceParagraphFields::SUPPORTS); + + auto supports_expr = parser.optional_field(SourceParagraphFields::SUPPORTS); + if (!supports_expr.empty()) + { + auto maybe_expr = PlatformExpression::parse_platform_expression( + supports_expr, PlatformExpression::MultipleBinaryOperators::Allow); + if (auto expr = maybe_expr.get()) + { + spgh->supports_expression = std::move(*expr); + } + else + { + parser.add_type_error(SourceParagraphFields::SUPPORTS, "a platform expression"); + } + } + spgh->type = Type::from_string(parser.optional_field(SourceParagraphFields::TYPE)); auto err = parser.error_info(spgh->name.empty() ? origin : spgh->name); if (err) @@ -153,10 +430,12 @@ namespace vcpkg auto fpgh = std::make_unique(); parser.required_field(SourceParagraphFields::FEATURE, fpgh->name); - parser.required_field(SourceParagraphFields::DESCRIPTION, fpgh->description); + fpgh->description = Strings::split(parser.required_field(SourceParagraphFields::DESCRIPTION), '\n'); + trim_all(fpgh->description); - fpgh->depends = parse_dependencies_list(parser.optional_field(SourceParagraphFields::BUILD_DEPENDS), origin) - .value_or_exit(VCPKG_LINE_INFO); + fpgh->dependencies = + parse_dependencies_list(parser.optional_field(SourceParagraphFields::BUILD_DEPENDS), origin) + .value_or_exit(VCPKG_LINE_INFO); auto err = parser.error_info(fpgh->name.empty() ? origin : fpgh->name); if (err) @@ -194,9 +473,565 @@ 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 + { + 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; + } + + 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 NaturalNumberField : Json::VisitorCrtpBase + { + using type = int; + StringView type_name() { return "a natural number"; } + + Optional visit_integer(Json::Reader&, StringView, int64_t value) + { + if (value > std::numeric_limits::max() || value < 0) + { + return nullopt; + } + return static_cast(value); + } + }; + + struct BooleanField : Json::VisitorCrtpBase + { + using type = bool; + StringView type_name() { return "a boolean"; } + + 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_; } + + ArrayField(StringView type_name_, AllowEmpty allow_empty, T&& t = {}) + : type_name_(type_name_), underlying_visitor_(static_cast(t)), allow_empty_(allow_empty) + { + } + + Optional visit_array(Json::Reader& r, StringView key, const Json::Array& arr) + { + if (allow_empty_ == AllowEmpty::No && arr.size() == 0) + { + 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"}); + } + }; + + 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) + { + 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; + } + + Optional visit_string(Json::Reader&, StringView, StringView sv) + { + if (is_ident(sv)) + { + return sv.to_string(); + } + else + { + return nullopt; + } + } + }; + + struct PackageNameField : Json::VisitorCrtpBase + { + using type = std::string; + StringView type_name() { return "a package name"; } + + static bool is_package_name(StringView sv) + { + if (sv.size() == 0) + { + return false; + } + + for (const auto& ident : Strings::split(sv, '.')) + { + if (!IdentifierField::is_ident(ident)) + { + return false; + } + } + + return true; + } + + Optional visit_string(Json::Reader&, StringView, StringView sv) + { + if (!is_package_name(sv)) + { + return nullopt; + } + return sv.to_string(); + } + }; + + // We "parse" this so that we can add actual license parsing at some point in the future + // without breaking anyone + struct LicenseExpressionField : Json::VisitorCrtpBase + { + using type = std::string; + StringView type_name() { return "an SPDX license expression"; } + + enum class Mode + { + ExpectExpression, + ExpectContinue, + 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) + { + Mode mode = Mode::ExpectExpression; + size_t open_parens = 0; + std::string current_word; + + const auto check_current_word = [¤t_word, &mode] { + if (current_word.empty()) + { + return true; + } + + Span valid_ids; + bool case_sensitive = false; + switch (mode) + { + case Mode::ExpectExpression: + valid_ids = VALID_LICENSES; + mode = Mode::ExpectContinue; + // a single + is allowed on the end of licenses + if (current_word.back() == '+') + { + current_word.pop_back(); + } + break; + case Mode::ExpectContinue: + valid_ids = EXPRESSION_WORDS; + mode = Mode::ExpectExpression; + case_sensitive = true; + break; + case Mode::ExpectException: + valid_ids = VALID_EXCEPTIONS; + mode = Mode::ExpectContinue; + break; + } + + const auto equal = [&](StringView sv) { + if (case_sensitive) + { + return sv == current_word; + } + else + { + return Strings::case_insensitive_ascii_equals(sv, current_word); + } + }; + + if (std::find_if(valid_ids.begin(), valid_ids.end(), equal) == valid_ids.end()) + { + return false; + } + + if (current_word == "WITH") + { + mode = Mode::ExpectException; + } + + current_word.clear(); + return true; + }; + + for (const auto& ch : sv) + { + if (ch == ' ' || ch == '\t') + { + if (!check_current_word()) + { + return nullopt; + } + } + else if (ch == '(') + { + if (!check_current_word()) + { + return nullopt; + } + if (mode != Mode::ExpectExpression) + { + return nullopt; + } + ++open_parens; + } + else if (ch == ')') + { + if (!check_current_word()) + { + return nullopt; + } + if (mode != Mode::ExpectContinue) + { + return nullopt; + } + if (open_parens == 0) + { + return nullopt; + } + --open_parens; + } + else + { + current_word.push_back(ch); + } + } + + if (!check_current_word()) + { + return nullopt; + } + else + { + return sv.to_string(); + } + } + }; + + struct PlatformExprField : Json::VisitorCrtpBase + { + 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; + } + } + }; + + struct DependencyField : Json::VisitorCrtpBase + { + using type = Dependency; + StringView type_name() { return "a dependency"; } + + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral FEATURES = "features"; + constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; + constexpr static StringLiteral PLATFORM = "platform"; + const static StringView KNOWN_FIELDS[4]; // not constexpr in MSVC 2015 + + Optional visit_string(Json::Reader&, StringView, StringView sv) + { + if (!PackageNameField::is_package_name(sv)) + { + return nullopt; + } + + Dependency dep; + dep.name = sv.to_string(); + return dep; + } + + Optional visit_object(Json::Reader& r, StringView, const Json::Object& obj) + { + { + auto extra_fields = invalid_json_fields(obj, KNOWN_FIELDS); + if (!extra_fields.empty()) + { + r.error().add_extra_fields(type_name().to_string(), std::move(extra_fields)); + } + } + + Dependency dep; + + for (const auto& el : obj) + { + if (Strings::starts_with(el.first, "$")) + { + dep.extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } + + r.required_object_field(type_name(), obj, NAME, dep.name, PackageNameField{}); + r.optional_object_field( + obj, FEATURES, dep.features, ArrayField{"an array of identifiers", AllowEmpty::Yes}); + + bool default_features = true; + r.optional_object_field(obj, DEFAULT_FEATURES, default_features, BooleanField{}); + if (!default_features) + { + dep.features.push_back("core"); + } + + r.optional_object_field(obj, PLATFORM, dep.platform, PlatformExprField{}); + + return dep; + } + }; + const StringView DependencyField::KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; + + struct FeatureField : Json::VisitorCrtpBase + { + using type = std::unique_ptr; + StringView type_name() { return "a feature"; } + + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral DESCRIPTION = "description"; + constexpr static StringLiteral DEPENDENCIES = "dependencies"; + const static StringView KNOWN_FIELDS[3]; // Not constexpr in MSVC 2015 + + Optional> visit_object(Json::Reader& r, StringView, const Json::Object& obj) + { + { + auto extra_fields = invalid_json_fields(obj, KNOWN_FIELDS); + if (!extra_fields.empty()) + { + r.error().add_extra_fields(type_name().to_string(), std::move(extra_fields)); + } + } + + auto feature = std::make_unique(); + + for (const auto& el : obj) + { + if (Strings::starts_with(el.first, "$")) + { + feature->extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } + + 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}); + + return std::move(feature); + } + }; + const StringView FeatureField::KNOWN_FIELDS[] = {NAME, DESCRIPTION, DEPENDENCIES}; + + Parse::ParseExpected SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest, + const Json::Object& manifest) + { + struct JsonErr final : Json::ReaderError + { + ParseControlErrorInfo pcei; + + void add_missing_field(std::string&& type, std::string&& key) override + { + pcei.missing_fields[std::move(type)].push_back(std::move(key)); + } + void add_expected_type(std::string&& key, std::string&& expected_type) override + { + pcei.expected_types.emplace(std::move(key), std::move(expected_type)); + } + void add_extra_fields(std::string&& type, std::vector&& fields) override + { + if (!fields.empty()) + { + auto& fields_for_type = pcei.extra_fields[std::move(type)]; + fields_for_type.insert(fields_for_type.end(), fields.begin(), fields.end()); + } + } + void add_mutually_exclusive_fields(std::string&& type, std::vector&& fields) override + { + if (!fields.empty()) + { + auto& fields_for_type = pcei.mutually_exclusive_fields[std::move(type)]; + fields_for_type.insert(fields_for_type.end(), fields.begin(), fields.end()); + } + } + } err = {}; + auto visit = Json::Reader{&err}; + + err.pcei.name = path_to_manifest.u8string(); + { + auto extra_fields = invalid_json_fields(manifest, get_list_of_manifest_fields()); + if (!extra_fields.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; + spgh->type = Type{Type::PORT}; + + for (const auto& el : manifest) + { + if (Strings::starts_with(el.first, "$")) + { + spgh->extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } + + 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::PORT_VERSION, spgh->port_version, NaturalNumberField{}); + 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}); + + if (err.pcei.has_error()) + { + return std::make_unique(std::move(err.pcei)); + } + + canonicalize(*control_file); + return std::move(control_file); + } + Optional SourceControlFile::find_feature(const std::string& featurename) const { auto it = Util::find_if(feature_paragraphs, @@ -211,10 +1046,10 @@ namespace vcpkg { if (featurename == "core") { - return core_paragraph->depends; + return core_paragraph->dependencies; } else if (auto p_feature = find_feature(featurename).get()) - return p_feature->depends; + return p_feature->dependencies; else return nullopt; } @@ -226,13 +1061,154 @@ namespace vcpkg std::vector ret; for (auto&& dep : deps) { - const auto& qualifier = dep.qualifier; - if (qualifier.empty() || - evaluate_expression(qualifier, {cmake_vars, t.canonical_name()}).value_or_exit(VCPKG_LINE_INFO)) + if (dep.platform.evaluate(cmake_vars)) { - ret.emplace_back(FullPackageSpec({dep.depend.name, t}, dep.depend.features)); + ret.emplace_back(FullPackageSpec({dep.name, t}, dep.features)); } } 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(DependencyField::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(DependencyField::DEFAULT_FEATURES, Json::Value::boolean(false)); + features_copy.erase(core_it); + } + + serialize_optional_array(dep_obj, DependencyField::FEATURES, features_copy); + serialize_optional_string(dep_obj, DependencyField::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(ManifestFields::NAME, Json::Value::string(scf.core_paragraph->name)); + obj.insert(ManifestFields::VERSION, Json::Value::string(scf.core_paragraph->version)); + + if (scf.core_paragraph->port_version != 0 || debug) + { + obj.insert(ManifestFields::PORT_VERSION, Json::Value::integer(scf.core_paragraph->port_version)); + } + + serialize_paragraph(obj, ManifestFields::MAINTAINERS, scf.core_paragraph->maintainers); + serialize_paragraph(obj, ManifestFields::DESCRIPTION, scf.core_paragraph->description); + + serialize_optional_string(obj, ManifestFields::HOMEPAGE, scf.core_paragraph->homepage); + serialize_optional_string(obj, ManifestFields::DOCUMENTATION, scf.core_paragraph->documentation); + serialize_optional_string(obj, ManifestFields::LICENSE, scf.core_paragraph->license); + serialize_optional_string(obj, ManifestFields::SUPPORTS, to_string(scf.core_paragraph->supports_expression)); + + if (!scf.core_paragraph->dependencies.empty() || debug) + { + auto& deps = obj.insert(ManifestFields::DEPENDENCIES, Json::Array()); + + for (const auto& dep : scf.core_paragraph->dependencies) + { + serialize_dependency(deps, dep); + } + } + + serialize_optional_array(obj, ManifestFields::DEFAULT_FEATURES, scf.core_paragraph->default_features); + + if (!scf.feature_paragraphs.empty() || debug) + { + auto& arr = obj.insert(ManifestFields::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(FeatureField::NAME, Json::Value::string(feature->name)); + serialize_paragraph(feature_obj, FeatureField::DESCRIPTION, feature->description, true); + + if (!feature->dependencies.empty() || debug) + { + auto& deps = feature_obj.insert(FeatureField::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/spdx-exceptions.inc b/toolsrc/src/vcpkg/spdx-exceptions.inc new file mode 100644 index 00000000000000..c6ef04b702a745 --- /dev/null +++ b/toolsrc/src/vcpkg/spdx-exceptions.inc @@ -0,0 +1,45 @@ +// Data downloaded from https://raw.githubusercontent.com/spdx/license-list-data/a3cab5c04eaf399ea8ee07ac69c749a9ad6a3f17/json/exceptions.json +// Generated by scripts/Generate-SpdxLicenseList.ps1 +{ + "GCC-exception-2.0", + "openvpn-openssl-exception", + "Nokia-Qt-exception-1.1", + "GPL-3.0-linking-exception", + "Fawkes-Runtime-exception", + "u-boot-exception-2.0", + "PS-or-PDF-font-exception-20170817", + "gnu-javamail-exception", + "LGPL-3.0-linking-exception", + "DigiRule-FOSS-exception", + "LLVM-exception", + "Linux-syscall-note", + "GPL-3.0-linking-source-exception", + "Qwt-exception-1.0", + "389-exception", + "mif-exception", + "eCos-exception-2.0", + "CLISP-exception-2.0", + "Bison-exception-2.2", + "Libtool-exception", + "LZMA-exception", + "OpenJDK-assembly-exception-1.0", + "Font-exception-2.0", + "OCaml-LGPL-linking-exception", + "GCC-exception-3.1", + "Bootloader-exception", + "SHL-2.0", + "Classpath-exception-2.0", + "Swift-exception", + "Autoconf-exception-2.0", + "FLTK-exception", + "freertos-exception-2.0", + "Universal-FOSS-exception-1.0", + "WxWindows-exception-3.1", + "OCCT-exception-1.0", + "Autoconf-exception-3.0", + "i2p-gpl-java-exception", + "GPL-CC-1.0", + "Qt-LGPL-exception-1.1", + "SHL-2.1", + "Qt-GPL-exception-1.0", +} diff --git a/toolsrc/src/vcpkg/spdx-licenses.inc b/toolsrc/src/vcpkg/spdx-licenses.inc new file mode 100644 index 00000000000000..ad3523934ccc20 --- /dev/null +++ b/toolsrc/src/vcpkg/spdx-licenses.inc @@ -0,0 +1,426 @@ +// Data downloaded from https://raw.githubusercontent.com/spdx/license-list-data/a3cab5c04eaf399ea8ee07ac69c749a9ad6a3f17/json/licenses.json +// Generated by scripts/Generate-SpdxLicenseList.ps1 +{ + "0BSD", + "AAL", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "AGPL-1.0", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "AMDPLPA", + "AML", + "AMPAS", + "ANTLR-PD", + "APAFML", + "APL-1.0", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Abstyles", + "Adobe-2006", + "Adobe-Glyph", + "Afmparse", + "Aladdin", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "Artistic-1.0", + "Artistic-1.0-Perl", + "Artistic-1.0-cl8", + "Artistic-2.0", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "BSD-2-Clause-Patent", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-4-Clause", + "BSD-4-Clause-UC", + "BSD-Protection", + "BSD-Source-Code", + "BSL-1.0", + "Bahyph", + "Barr", + "Beerware", + "BitTorrent-1.0", + "BitTorrent-1.1", + "BlueOak-1.0.0", + "Borceux", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-3.0", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDLA-Permissive-1.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "CUA-OPL-1.0", + "Caldera", + "ClArtistic", + "Condor-1.1", + "Crossword", + "CrystalStacker", + "Cube", + "D-FSL-1.0", + "DOC", + "DSDP", + "Dotseqn", + "ECL-1.0", + "ECL-2.0", + "EFL-1.0", + "EFL-2.0", + "EPL-1.0", + "EPL-2.0", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Entessa", + "ErlPL-1.1", + "Eurosym", + "FSFAP", + "FSFUL", + "FSFULLR", + "FTL", + "Fair", + "Frameworx-1.0", + "FreeImage", + "GFDL-1.1", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "GL2PS", + "GPL-1.0", + "GPL-1.0+", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-2.0", + "GPL-2.0+", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-2.0-with-GCC-exception", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-3.0", + "GPL-3.0+", + "GPL-3.0-only", + "GPL-3.0-or-later", + "GPL-3.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "Giftware", + "Glide", + "Glulxe", + "HPND", + "HPND-sell-variant", + "HaskellReport", + "Hippocratic-2.1", + "IBM-pibs", + "ICU", + "IJG", + "IPA", + "IPL-1.0", + "ISC", + "ImageMagick", + "Imlib2", + "Info-ZIP", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "JPNIC", + "JSON", + "JasPer-2.0", + "LAL-1.2", + "LAL-1.3", + "LGPL-2.0", + "LGPL-2.0+", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.1", + "LGPL-2.1+", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-3.0", + "LGPL-3.0+", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPLLR", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "Latex2e", + "Leptonica", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Libpng", + "Linux-OpenIB", + "MIT", + "MIT-0", + "MIT-CMU", + "MIT-advertising", + "MIT-enna", + "MIT-feh", + "MITNFA", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "MS-PL", + "MS-RL", + "MTLL", + "MakeIndex", + "MirOS", + "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NASA-1.3", + "NBPL-1.0", + "NCGL-UK-2.0", + "NCSA", + "NGPL", + "NLOD-1.0", + "NLPL", + "NOSL", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTP", + "NTP-0", + "Naumen", + "Net-SNMP", + "NetCDF", + "Newsletr", + "Nokia", + "Noweb", + "Nunit", + "O-UDA-1.0", + "OCCT-PL", + "OCLC-2.0", + "ODC-By-1.0", + "ODbL-1.0", + "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", + "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OPL-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "OpenSSL", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "PSF-2.0", + "Parity-6.0.0", + "Parity-7.0.0", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "Python-2.0", + "QPL-1.0", + "Qhull", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Rdisc", + "Ruby", + "SAX-PD", + "SCEA", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SHL-0.5", + "SHL-0.51", + "SISSL", + "SISSL-1.2", + "SMLNJ", + "SMPPL", + "SNIA", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSPL-1.0", + "SWL", + "Saxpath", + "Sendmail", + "Sendmail-8.23", + "SimPL-2.0", + "Sleepycat", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "StandardML-NJ", + "SugarCRM-1.1.3", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TMate", + "TORQUE-1.1", + "TOSL", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "UCL-1.0", + "UPL-1.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "Unlicense", + "VOSTROM", + "VSL-1.0", + "Vim", + "W3C", + "W3C-19980720", + "W3C-20150513", + "WTFPL", + "Watcom-1.0", + "Wsuipa", + "X11", + "XFree86-1.1", + "XSkat", + "Xerox", + "Xnet", + "YPL-1.0", + "YPL-1.1", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "blessing", + "bzip2-1.0.5", + "bzip2-1.0.6", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "curl", + "diffmark", + "dvipdfm", + "eCos-2.0", + "eGenix", + "etalab-2.0", + "gSOAP-1.3b", + "gnuplot", + "iMatix", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "mpich2", + "psfrag", + "psutils", + "wxWindows", + "xinetd", + "xpp", + "zlib-acknowledgement", +} diff --git a/toolsrc/src/vcpkg/statusparagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp index ef8715ec2794b2..398129a0484a51 100644 --- a/toolsrc/src/vcpkg/statusparagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include using namespace vcpkg::Parse; @@ -12,7 +13,7 @@ namespace vcpkg static const std::string STATUS = "Status"; } - StatusParagraph::StatusParagraph() noexcept : want(Want::ERROR_STATE), state(InstallState::ERROR_STATE) {} + StatusParagraph::StatusParagraph() noexcept : want(Want::ERROR_STATE), state(InstallState::ERROR_STATE) { } void serialize(const StatusParagraph& pgh, std::string& out_str) { @@ -86,16 +87,16 @@ namespace vcpkg } } - std::unordered_map> InstalledPackageView::feature_dependencies() const + std::map> InstalledPackageView::feature_dependencies() const { auto extract_deps = [&](const std::string& name) { return FeatureSpec{{name, spec().triplet()}, "core"}; }; - std::unordered_map> deps; + std::map> deps; - deps.emplace("core", Util::fmap(core->package.depends, extract_deps)); + deps.emplace("core", Util::fmap(core->package.dependencies, extract_deps)); for (const StatusParagraph* const& feature : features) - deps.emplace(feature->package.feature, Util::fmap(feature->package.depends, extract_deps)); + deps.emplace(feature->package.feature, Util::fmap(feature->package.dependencies, extract_deps)); return deps; } @@ -106,11 +107,11 @@ namespace vcpkg // Todo: make this unneeded by collapsing all package dependencies into the core package std::vector deps; for (auto&& feature : features) - for (auto&& dep : feature->package.depends) + for (auto&& dep : feature->package.dependencies) deps.push_back(dep); // Add the core paragraph dependencies to the list - for (auto&& dep : core->package.depends) + for (auto&& dep : core->package.dependencies) deps.push_back(dep); Util::erase_remove_if(deps, [&](const std::string& pspec) { return pspec == spec().name(); }); diff --git a/toolsrc/src/vcpkg/statusparagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp index 2621c43e3116cd..d282a5ccbea959 100644 --- a/toolsrc/src/vcpkg/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include namespace vcpkg @@ -18,16 +19,16 @@ namespace vcpkg { if (p->package.spec.name() == name && p->package.spec.triplet() == triplet) { - if (p->package.feature.empty()) - spghs.emplace(spghs.begin(), &p); - else + if (p->package.is_feature()) spghs.emplace_back(&p); + else + spghs.emplace(spghs.begin(), &p); } } return spghs; } - Optional StatusParagraphs::find_all_installed(const PackageSpec& spec) const + Optional StatusParagraphs::get_installed_package_view(const PackageSpec& spec) const { InstalledPackageView ipv; for (auto&& p : *this) @@ -35,13 +36,15 @@ namespace vcpkg if (p->package.spec.name() == spec.name() && p->package.spec.triplet() == spec.triplet() && p->is_installed()) { - if (p->package.feature.empty()) + if (p->package.is_feature()) + { + ipv.features.emplace_back(p.get()); + } + else { Checks::check_exit(VCPKG_LINE_INFO, ipv.core == nullptr); ipv.core = p.get(); } - else - ipv.features.emplace_back(p.get()); } } if (ipv.core != nullptr) @@ -56,8 +59,8 @@ namespace vcpkg { if (feature == "core") { - // The core feature maps to .feature == "" - return find(name, triplet, ""); + // The core feature maps to .feature is empty + return find(name, triplet, {}); } return std::find_if(begin(), end(), [&](const std::unique_ptr& pgh) { const PackageSpec& spec = pgh->package.spec; diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 9354493bd345c5..9098cb135fd0cc 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -1,9 +1,5 @@ #include "pch.h" -#include -#include -#include - #include #include #include @@ -14,6 +10,10 @@ #include #include +#include +#include +#include + namespace vcpkg { struct ToolData @@ -108,14 +108,17 @@ namespace vcpkg const std::string tool_dir_name = Strings::format("%s-%s-%s", tool, version_as_string, OS_STRING); const fs::path tool_dir_path = paths.tools / tool_dir_name; const fs::path exe_path = tool_dir_path / exe_relative_path; + fs::path download_path; + if (auto a = archive_name.get()) + { + download_path = paths.downloads / fs::u8path(a->to_string()); + } + else + { + download_path = paths.downloads / fs::u8path(Strings::concat(sha512.substr(0, 8), '-', exe_relative_path)); + } - return ToolData{*version.get(), - exe_path, - url, - paths.downloads / archive_name.value_or(exe_relative_path).to_string(), - archive_name.has_value(), - tool_dir_path, - sha512}; + return ToolData{*version.get(), exe_path, url, download_path, archive_name.has_value(), tool_dir_path, sha512}; #endif } @@ -135,18 +138,19 @@ namespace vcpkg { Util::unused(out_candidate_paths); } - virtual Optional get_version(const fs::path& path_to_exe) const = 0; + virtual Optional get_version(const VcpkgPaths& paths, const fs::path& path_to_exe) const = 0; }; - static Optional find_first_with_sufficient_version(const Files::Filesystem& fs, + static Optional find_first_with_sufficient_version(const VcpkgPaths& paths, const ToolProvider& tool_provider, const std::vector& candidates, const std::array& expected_version) { + const auto& fs = paths.get_filesystem(); for (auto&& candidate : candidates) { if (!fs.exists(candidate)) continue; - auto maybe_version = tool_provider.get_version(candidate); + auto maybe_version = tool_provider.get_version(paths, candidate); const auto version = maybe_version.get(); if (!version) continue; const auto parsed_version = parse_version_string(*version); @@ -218,7 +222,8 @@ namespace vcpkg const ToolData& tool_data) { const auto downloaded_path = fetch_tool(paths, tool_provider.tool_data_name(), tool_data); - const auto downloaded_version = tool_provider.get_version(downloaded_path).value_or_exit(VCPKG_LINE_INFO); + const auto downloaded_version = + tool_provider.get_version(paths, downloaded_path).value_or_exit(VCPKG_LINE_INFO); return {downloaded_path, downloaded_version}; } @@ -245,7 +250,7 @@ namespace vcpkg tool.add_special_paths(candidate_paths); - const auto maybe_path = find_first_with_sufficient_version(fs, tool, candidate_paths, min_version); + const auto maybe_path = find_first_with_sufficient_version(paths, tool, candidate_paths, min_version); if (const auto p = maybe_path.get()) { return *p; @@ -264,7 +269,7 @@ namespace vcpkg virtual const std::string& tool_data_name() const override { return m_exe; } virtual const std::string& exe_stem() const override { return m_exe; } - virtual std::array default_min_version() const override { return {3, 5, 1}; } + virtual std::array default_min_version() const override { return {3, 17, 1}; } virtual void add_special_paths(std::vector& out_candidate_paths) const override { @@ -279,7 +284,7 @@ namespace vcpkg Util::unused(out_candidate_paths); #endif } - virtual Optional get_version(const fs::path& path_to_exe) const override + 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 auto rc = System::cmd_execute_and_capture_output(cmd); @@ -305,7 +310,7 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake). virtual const std::string& exe_stem() const override { return m_exe; } virtual std::array default_min_version() const override { return {3, 5, 1}; } - virtual Optional get_version(const fs::path& path_to_exe) const override + 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 auto rc = System::cmd_execute_and_capture_output(cmd); @@ -329,10 +334,16 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake). virtual const std::string& exe_stem() const override { return m_exe; } virtual std::array default_min_version() const override { return {4, 6, 2}; } - virtual Optional get_version(const fs::path& path_to_exe) const override + virtual Optional get_version(const VcpkgPaths& paths, const fs::path& path_to_exe) const override { - const std::string cmd = Strings::format(R"("%s")", path_to_exe.u8string()); - const auto rc = System::cmd_execute_and_capture_output(cmd); + System::CmdLineBuilder cmd; +#ifndef _WIN32 + cmd.path_arg(paths.get_tool_exe(Tools::MONO)); +#else + Util::unused(paths); +#endif + cmd.path_arg(path_to_exe); + const auto rc = System::cmd_execute_and_capture_output(cmd.extract()); if (rc.exit_code != 0) { return nullopt; @@ -371,7 +382,7 @@ Type 'NuGet help ' for help on a specific command. #endif } - virtual Optional get_version(const fs::path& path_to_exe) const override + 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 auto rc = System::cmd_execute_and_capture_output(cmd); @@ -390,9 +401,36 @@ git version 2.17.1.windows.2 } }; + struct MonoProvider : ToolProvider + { + std::string m_exe = "mono"; + + virtual const std::string& tool_data_name() const override { return m_exe; } + virtual const std::string& exe_stem() const override { return m_exe; } + virtual std::array default_min_version() const override { return {0, 0, 0}; } + + virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override + { + const auto rc = System::cmd_execute_and_capture_output( + System::CmdLineBuilder().path_arg(path_to_exe).string_arg("--version").extract()); + if (rc.exit_code != 0) + { + return nullopt; + } + + /* Sample output: +Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 UTC 2020) + */ + const auto idx = rc.output.find("Mono JIT compiler version "); + Checks::check_exit( + VCPKG_LINE_INFO, idx != std::string::npos, "Unexpected format of mono version string: %s", rc.output); + return rc.output.substr(idx); + } + }; + struct IfwInstallerBaseProvider : ToolProvider { - std::string m_exe = ""; + std::string m_exe; std::string m_toolname = "installerbase"; virtual const std::string& tool_data_name() const override { return m_toolname; } @@ -411,7 +449,7 @@ git version 2.17.1.windows.2 // "Qt" / "QtIFW-3.1.0" / "bin" / "installerbase.exe"); } - virtual Optional get_version(const fs::path& path_to_exe) const override + 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 auto rc = System::cmd_execute_and_capture_output(cmd); @@ -476,6 +514,7 @@ git version 2.17.1.windows.2 } if (tool == Tools::NUGET) return get_path(paths, NuGetProvider()); if (tool == Tools::IFW_INSTALLER_BASE) return get_path(paths, IfwInstallerBaseProvider()); + if (tool == Tools::MONO) return get_path(paths, MonoProvider()); // For other tools, we simply always auto-download them. auto maybe_tool_data = parse_tool_data_from_xml(paths, tool); diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp index 47b82498964e71..f9438c00afe871 100644 --- a/toolsrc/src/vcpkg/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -1,13 +1,14 @@ #include "pch.h" #include + #include namespace vcpkg { struct TripletInstance { - TripletInstance(std::string&& s) : value(std::move(s)), hash(std::hash()(value)) {} + TripletInstance(std::string&& s) : value(std::move(s)), hash(std::hash()(value)) { } const std::string value; const size_t hash = 0; @@ -65,7 +66,7 @@ namespace vcpkg { return CPUArchitecture::X86; } - else if (*this == X64_WINDOWS || *this == X64_UWP || *this ==X64_ANDROID) + else if (*this == X64_WINDOWS || *this == X64_UWP || *this == X64_ANDROID) { return CPUArchitecture::X64; } @@ -80,4 +81,34 @@ namespace vcpkg return nullopt; } + + Triplet default_triplet(const VcpkgCmdArguments& args) + { + if (args.triplet != nullptr) + { + return Triplet::from_canonical_name(std::string(*args.triplet)); + } + else + { + auto vcpkg_default_triplet_env = System::get_environment_variable("VCPKG_DEFAULT_TRIPLET"); + if (auto v = vcpkg_default_triplet_env.get()) + { + return Triplet::from_canonical_name(std::move(*v)); + } + else + { +#if defined(_WIN32) + return Triplet::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__) + return Triplet::from_canonical_name("x64-linux"); +#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 8cb2ac5574b675..4c99c6f4827c73 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include + #include #include #include @@ -26,11 +27,13 @@ namespace vcpkg::Update auto maybe_scfl = provider.get_control_file(pgh->package.spec.name()); if (auto p_scfl = maybe_scfl.get()) { - auto&& port_version = p_scfl->source_control_file->core_paragraph->version; - auto&& installed_version = pgh->package.version; - if (installed_version != port_version) + const auto& latest_pgh = *p_scfl->source_control_file->core_paragraph; + auto latest_version = VersionT(latest_pgh.version, latest_pgh.port_version); + auto installed_version = VersionT(pgh->package.version, pgh->package.port_version); + if (latest_version != installed_version) { - output.push_back({pgh->package.spec, VersionDiff(installed_version, port_version)}); + output.push_back( + {pgh->package.spec, VersionDiff(std::move(installed_version), std::move(latest_version))}); } } else @@ -43,7 +46,7 @@ namespace vcpkg::Update } const CommandStructure COMMAND_STRUCTURE = { - Help::create_example_string("update"), + create_example_string("update"), 0, 0, {}, @@ -57,7 +60,7 @@ namespace vcpkg::Update const StatusParagraphs status_db = database_load_check(paths); - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports.get()); + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); const auto outdated_packages = SortedVector(find_outdated_packages(provider, status_db), &OutdatedPackage::compare_by_name); @@ -84,4 +87,9 @@ namespace vcpkg::Update 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 69bae5bfc81915..32588b2bbfbc7d 100644 --- a/toolsrc/src/vcpkg/userconfig.cpp +++ b/toolsrc/src/vcpkg/userconfig.cpp @@ -2,37 +2,17 @@ #include #include +#include + #include #include -#if defined(_WIN32) -namespace -{ - static vcpkg::Lazy s_localappdata; - - static const fs::path& get_localappdata() - { - return s_localappdata.get_lazy([]() { - fs::path localappdata; - { - // Config path in AppDataLocal - wchar_t* localappdatapath = nullptr; - if (S_OK != SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localappdatapath)) __fastfail(1); - localappdata = localappdatapath; - CoTaskMemFree(localappdatapath); - } - return localappdata; - }); - } -} -#endif - namespace vcpkg { fs::path get_user_dir() { #if defined(_WIN32) - return get_localappdata() / "vcpkg"; + return System::get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg"; #else auto maybe_home = System::get_environment_variable("HOME"); return fs::path(maybe_home.value_or("/var")) / ".vcpkg"; diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 46e4c86ea9517e..e1cc3e7419d95d 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -1,85 +1,150 @@ #include "pch.h" +#include #include + #include +#include #include -#include #include #include namespace vcpkg { + static void set_from_feature_flag(const std::vector& flags, StringView flag, Optional& place) + { + if (!place.has_value()) + { + const auto not_flag = [flag](const std::string& el) { + return !el.empty() && el[0] == '-' && flag == StringView{el.data() + 1, el.data() + el.size()}; + }; + + if (std::find(flags.begin(), flags.end(), flag) != flags.end()) + { + place = true; + } + if (std::find_if(flags.begin(), flags.end(), not_flag) != flags.end()) + { + if (place.has_value()) + { + System::printf( + System::Color::error, "Error: both %s and -%s were specified as feature flags\n", flag, flag); + Metrics::g_metrics.lock()->track_property("error", "error feature flag +-" + flag.to_string()); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + place = false; + } + } + } + + static void parse_feature_flags(const std::vector& flags, VcpkgCmdArguments& args) + { + // NOTE: when these features become default, switch the value_or(false) to value_or(true) + struct FeatureFlag + { + StringView flag_name; + Optional& local_option; + }; + + const FeatureFlag flag_descriptions[] = { + {VcpkgCmdArguments::BINARY_CACHING_FEATURE, args.binary_caching}, + {VcpkgCmdArguments::MANIFEST_MODE_FEATURE, args.manifest_mode}, + {VcpkgCmdArguments::COMPILER_TRACKING_FEATURE, args.compiler_tracking}, + }; + + for (const auto& desc : flag_descriptions) + { + set_from_feature_flag(flags, desc.flag_name, desc.local_option); + } + } + static void parse_value(const std::string* arg_begin, const std::string* arg_end, - const std::string& option_name, + StringView option_name, std::unique_ptr& option_field) { if (arg_begin == arg_end) { - System::print2(System::Color::error, "Error: expected value after ", option_name, '\n'); + System::print2(System::Color::error, "Error: expected value after --", option_name, '\n'); Metrics::g_metrics.lock()->track_property("error", "error option name"); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } if (option_field != nullptr) { - System::print2(System::Color::error, "Error: ", option_name, " specified multiple times\n"); + System::print2(System::Color::error, "Error: --", option_name, " specified multiple times\n"); Metrics::g_metrics.lock()->track_property("error", "error option specified multiple times"); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } option_field = std::make_unique(*arg_begin); } - static void parse_cojoined_value(std::string new_value, - const std::string& option_name, + static void parse_cojoined_value(StringView new_value, + StringView option_name, std::unique_ptr& option_field) { if (nullptr != option_field) { - System::printf(System::Color::error, "Error: %s specified multiple times\n", option_name); + System::printf(System::Color::error, "Error: --%s specified multiple times\n", option_name); Metrics::g_metrics.lock()->track_property("error", "error option specified multiple times"); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } - option_field = std::make_unique(std::move(new_value)); + option_field = std::make_unique(new_value.begin(), new_value.end()); } - static void parse_switch(bool new_setting, const std::string& option_name, Optional& option_field) + static void parse_switch(bool new_setting, StringView option_name, Optional& option_field) { if (option_field && option_field != new_setting) { System::print2(System::Color::error, "Error: conflicting values specified for --", option_name, '\n'); Metrics::g_metrics.lock()->track_property("error", "error conflicting switches"); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } option_field = new_setting; } - static void parse_cojoined_multivalue(std::string new_value, - const std::string& option_name, - std::unique_ptr>& option_field) + static void parse_cojoined_multivalue(StringView new_value, + StringView option_name, + std::vector& option_field) { - if (new_value.empty()) + if (new_value.size() == 0) { System::print2(System::Color::error, "Error: expected value after ", option_name, '\n'); Metrics::g_metrics.lock()->track_property("error", "error option name"); - Help::print_usage(); + print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } - if (!option_field) + option_field.emplace_back(new_value.begin(), new_value.end()); + } + + static void parse_cojoined_list_multivalue(StringView new_value, + StringView option_name, + std::vector& option_field) + { + if (new_value.size() == 0) + { + System::print2(System::Color::error, "Error: expected value after ", option_name, '\n'); + Metrics::g_metrics.lock()->track_property("error", "error option name"); + print_usage(); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + for (const auto& v : Strings::split(new_value, ',')) { - option_field = std::make_unique>(); + option_field.emplace_back(v.begin(), v.end()); } - option_field->emplace_back(std::move(new_value)); } - VcpkgCmdArguments VcpkgCmdArguments::create_from_command_line(const int argc, + VcpkgCmdArguments VcpkgCmdArguments::create_from_command_line(const Files::Filesystem& fs, + const int argc, const CommandLineCharType* const* const argv) { std::vector v; @@ -95,7 +160,6 @@ namespace vcpkg if (arg.size() > 0 && arg[0] == '@') { arg.erase(arg.begin()); - const auto& fs = Files::get_real_filesystem(); auto lines = fs.read_lines(fs::u8path(arg)); if (!lines.has_value()) { @@ -113,145 +177,193 @@ namespace vcpkg return VcpkgCmdArguments::create_from_arg_sequence(v.data(), v.data() + v.size()); } + // returns true if this does parse this argument as this option + template + static bool try_parse_argument_as_option(StringView option, StringView arg, T& place, F parser) + { + if (arg.size() <= option.size() + 1) + { + // it is impossible for this argument to be this option + return false; + } + + if (Strings::starts_with(arg, "x-") && !Strings::starts_with(option, "x-")) + { + arg = arg.substr(2); + } + if (Strings::starts_with(arg, option) && arg.byte_at_index(option.size()) == '=') + { + parser(arg.substr(option.size() + 1), option, place); + return true; + } + + return false; + } + + static bool equals_modulo_experimental(StringView arg, StringView option) + { + if (Strings::starts_with(arg, "x-") && !Strings::starts_with(option, "x-")) + { + return arg.substr(2) == option; + } + else + { + return arg == option; + } + } + + // returns true if this does parse this argument as this option + template + static bool try_parse_argument_as_switch(StringView option, StringView arg, T& place) + { + if (equals_modulo_experimental(arg, option)) + { + parse_switch(true, option, place); + return true; + } + + if (Strings::starts_with(arg, "no-") && equals_modulo_experimental(arg.substr(3), option)) + { + parse_switch(false, option, place); + return true; + } + + return false; + } + VcpkgCmdArguments VcpkgCmdArguments::create_from_arg_sequence(const std::string* arg_begin, const std::string* arg_end) { VcpkgCmdArguments args; + std::vector feature_flags; - for (; arg_begin != arg_end; ++arg_begin) + for (auto it = arg_begin; it != arg_end; ++it) { - std::string arg = *arg_begin; + std::string basic_arg = *it; - if (arg.empty()) + if (basic_arg.empty()) { continue; } - if (arg[0] == '-' && arg[1] != '-') + if (basic_arg.size() >= 2 && basic_arg[0] == '-' && basic_arg[1] != '-') { Metrics::g_metrics.lock()->track_property("error", "error short options are not supported"); - Checks::exit_with_message(VCPKG_LINE_INFO, "Error: short options are not supported: %s", arg); + Checks::exit_with_message(VCPKG_LINE_INFO, "Error: short options are not supported: %s", basic_arg); } - if (arg[0] == '-' && arg[1] == '-') + if (basic_arg.size() < 2 || basic_arg[0] != '-') { - // make argument case insensitive before the first = - auto& f = std::use_facet>(std::locale()); - auto first_eq = std::find(std::begin(arg), std::end(arg), '='); - f.tolower(&arg[0], &arg[0] + (first_eq - std::begin(arg))); - // command switch - if (arg == "--vcpkg-root") - { - ++arg_begin; - parse_value(arg_begin, arg_end, "--vcpkg-root", args.vcpkg_root_dir); - continue; - } - if (Strings::starts_with(arg, "--x-scripts-root=")) - { - parse_cojoined_value( - arg.substr(sizeof("--x-scripts-root=") - 1), "--x-scripts-root", args.scripts_root_dir); - continue; - } - if (arg == "--triplet") - { - ++arg_begin; - parse_value(arg_begin, arg_end, "--triplet", args.triplet); - continue; - } - if (Strings::starts_with(arg, "--overlay-ports=")) - { - parse_cojoined_multivalue( - arg.substr(sizeof("--overlay-ports=") - 1), "--overlay-ports", args.overlay_ports); - continue; - } - if (Strings::starts_with(arg, "--overlay-triplets=")) + if (args.command.empty()) { - parse_cojoined_multivalue( - arg.substr(sizeof("--overlay-triplets=") - 1), "--overlay-triplets", args.overlay_triplets); - continue; + args.command = std::move(basic_arg); } - if (arg == "--debug") - { - parse_switch(true, "debug", args.debug); - continue; - } - if (arg == "--sendmetrics") - { - parse_switch(true, "sendmetrics", args.sendmetrics); - continue; - } - if (arg == "--printmetrics") - { - parse_switch(true, "printmetrics", args.printmetrics); - continue; - } - if (arg == "--no-sendmetrics") - { - parse_switch(false, "sendmetrics", args.sendmetrics); - continue; - } - if (arg == "--no-printmetrics") - { - parse_switch(false, "printmetrics", args.printmetrics); - continue; - } - if (arg == "--featurepackages") - { - parse_switch(true, "featurepackages", args.featurepackages); - continue; - } - if (arg == "--no-featurepackages") + else { - parse_switch(false, "featurepackages", args.featurepackages); - continue; + args.command_arguments.push_back(std::move(basic_arg)); } - if (arg == "--binarycaching") + continue; + } + + // make argument case insensitive before the first = + auto first_eq = std::find(std::begin(basic_arg), std::end(basic_arg), '='); + Strings::ascii_to_lowercase(std::begin(basic_arg), first_eq); + // basic_arg[0] == '-' && basic_arg[1] == '-' + StringView arg = StringView(basic_arg).substr(2); + + // command switch + if (arg == VCPKG_ROOT_DIR_ARG) + { + ++it; + parse_value(it, arg_end, VCPKG_ROOT_DIR_ARG, args.vcpkg_root_dir); + continue; + } + if (arg == TRIPLET_ARG) + { + ++it; + parse_value(it, arg_end, TRIPLET_ARG, args.triplet); + continue; + } + + constexpr static std::pair VcpkgCmdArguments::*> + cojoined_values[] = { + {MANIFEST_ROOT_DIR_ARG, &VcpkgCmdArguments::manifest_root_dir}, + {BUILDTREES_ROOT_DIR_ARG, &VcpkgCmdArguments::buildtrees_root_dir}, + {DOWNLOADS_ROOT_DIR_ARG, &VcpkgCmdArguments::downloads_root_dir}, + {INSTALL_ROOT_DIR_ARG, &VcpkgCmdArguments::install_root_dir}, + {PACKAGES_ROOT_DIR_ARG, &VcpkgCmdArguments::packages_root_dir}, + {SCRIPTS_ROOT_DIR_ARG, &VcpkgCmdArguments::scripts_root_dir}, + }; + + constexpr static std::pair VcpkgCmdArguments::*> + cojoined_multivalues[] = { + {OVERLAY_PORTS_ARG, &VcpkgCmdArguments::overlay_ports}, + {OVERLAY_TRIPLETS_ARG, &VcpkgCmdArguments::overlay_triplets}, + {BINARY_SOURCES_ARG, &VcpkgCmdArguments::binary_sources}, + }; + + constexpr static std::pair VcpkgCmdArguments::*> switches[] = { + {DEBUG_SWITCH, &VcpkgCmdArguments::debug}, + {DISABLE_METRICS_SWITCH, &VcpkgCmdArguments::disable_metrics}, + {SEND_METRICS_SWITCH, &VcpkgCmdArguments::send_metrics}, + {PRINT_METRICS_SWITCH, &VcpkgCmdArguments::print_metrics}, + {FEATURE_PACKAGES_SWITCH, &VcpkgCmdArguments::feature_packages}, + {BINARY_CACHING_SWITCH, &VcpkgCmdArguments::binary_caching}, + {WAIT_FOR_LOCK_SWITCH, &VcpkgCmdArguments::wait_for_lock}, + }; + + bool found = false; + for (const auto& pr : cojoined_values) + { + if (try_parse_argument_as_option(pr.first, arg, args.*pr.second, parse_cojoined_value)) { - parse_switch(true, "binarycaching", args.binarycaching); - continue; + found = true; + break; } - if (arg == "--no-binarycaching") + } + if (found) continue; + + for (const auto& pr : cojoined_multivalues) + { + if (try_parse_argument_as_option(pr.first, arg, args.*pr.second, parse_cojoined_multivalue)) { - parse_switch(false, "binarycaching", args.binarycaching); - continue; + found = true; + break; } + } + if (found) continue; - const auto eq_pos = arg.find('='); - if (eq_pos != std::string::npos) - { - const auto& key = arg.substr(0, eq_pos); - const auto& value = arg.substr(eq_pos + 1); + if (try_parse_argument_as_option(FEATURE_FLAGS_ARG, arg, feature_flags, parse_cojoined_list_multivalue)) + { + continue; + } - auto it = args.optional_command_arguments.find(key); - if (args.optional_command_arguments.end() == it) - { - args.optional_command_arguments.emplace(key, std::vector{value}); - } - else - { - if (auto* maybe_values = it->second.get()) - { - maybe_values->emplace_back(value); - } - } - } - else + for (const auto& pr : switches) + { + if (try_parse_argument_as_switch(pr.first, arg, args.*pr.second)) { - args.optional_command_arguments.emplace(arg, nullopt); + found = true; + break; } - continue; } + if (found) continue; - if (args.command.empty()) + const auto eq_pos = std::find(arg.begin(), arg.end(), '='); + if (eq_pos != arg.end()) { - args.command = arg; + const auto& key = StringView(arg.begin(), eq_pos); + const auto& value = StringView(eq_pos + 1, arg.end()); + + args.command_options[key.to_string()].push_back(value.to_string()); } else { - args.command_arguments.push_back(arg); + args.command_switches.insert(arg.to_string()); } } + parse_feature_flags(feature_flags, args); + return args; } @@ -296,98 +408,123 @@ namespace vcpkg } } - auto options_copy = this->optional_command_arguments; - for (auto&& option : command_structure.options.switches) + auto switches_copy = this->command_switches; + auto options_copy = this->command_options; + + const auto find_option = [](const auto& set, StringLiteral name) { + auto it = set.find(name); + if (it == set.end() && !Strings::starts_with(name, "x-")) + { + it = set.find(Strings::format("x-%s", name)); + } + + return it; + }; + + for (const auto& switch_ : command_structure.options.switches) + { + const auto it = find_option(switches_copy, switch_.name); + if (it != switches_copy.end()) + { + output.switches.insert(switch_.name); + switches_copy.erase(it); + } + const auto option_it = find_option(options_copy, switch_.name); + if (option_it != options_copy.end()) + { + // This means that the switch was passed like '--a=xyz' + System::printf( + System::Color::error, "Error: The option '--%s' does not accept an argument.\n", switch_.name); + options_copy.erase(option_it); + failed = true; + } + } + + for (const auto& option : command_structure.options.settings) { - const auto it = options_copy.find(option.name); + const auto it = find_option(options_copy, option.name); if (it != options_copy.end()) { - if (it->second.has_value()) + const auto& value = it->second; + if (value.empty()) + { + Checks::unreachable(VCPKG_LINE_INFO); + } + + if (value.size() > 1) { - // Having a string value indicates it was passed like '--a=xyz' System::printf( - System::Color::error, "Error: The option '%s' does not accept an argument.\n", option.name); + System::Color::error, "Error: The option '%s' can only be passed once.\n", option.name); + failed = true; + } + else if (value.front().empty()) + { + // Fail when not given a value, e.g.: "vcpkg install sqlite3 --additional-ports=" + System::printf(System::Color::error, + "Error: The option '--%s' must be passed a non-empty argument.\n", + option.name); failed = true; } else { - output.switches.insert(option.name); + output.settings.emplace(option.name, value.front()); options_copy.erase(it); } } + const auto switch_it = find_option(switches_copy, option.name); + if (switch_it != switches_copy.end()) + { + // This means that the option was passed like '--a' + System::printf( + System::Color::error, "Error: The option '--%s' must be passed an argument.\n", option.name); + switches_copy.erase(switch_it); + failed = true; + } } - for (auto&& option : command_structure.options.settings) + for (const auto& option : command_structure.options.multisettings) { - const auto it = options_copy.find(option.name); + const auto it = find_option(options_copy, option.name); if (it != options_copy.end()) { - if (!it->second.has_value()) + const auto& value = it->second; + for (const auto& v : value) { - // Not having a string value indicates it was passed like '--a' - System::printf( - System::Color::error, "Error: The option '%s' must be passed an argument.\n", option.name); - failed = true; - } - else - { - const auto& value = it->second.value_or_exit(VCPKG_LINE_INFO); - if (value.front().empty()) + if (v.empty()) { - // Fail when not given a value, e.g.: "vcpkg install sqlite3 --additional-ports=" - System::printf( - System::Color::error, "Error: The option '%s' must be passed an argument.\n", option.name); + System::printf(System::Color::error, + "Error: The option '--%s' must be passed non-empty arguments.\n", + option.name); failed = true; } else { - output.settings.emplace(option.name, value.front()); - options_copy.erase(it); + output.multisettings[option.name].push_back(v); } } + options_copy.erase(it); } - } - - for (auto&& option : command_structure.options.multisettings) - { - const auto it = options_copy.find(option.name); - if (it != options_copy.end()) + const auto switch_it = find_option(switches_copy, option.name); + if (switch_it != switches_copy.end()) { - if (!it->second.has_value()) - { - // Not having a string value indicates it was passed like '--a' - System::printf( - System::Color::error, "Error: The option '%s' must be passed an argument.\n", option.name); - failed = true; - } - else - { - const auto& value = it->second.value_or_exit(VCPKG_LINE_INFO); - for (auto&& v : value) - { - if (v.empty()) - { - System::printf(System::Color::error, - "Error: The option '%s' must be passed an argument.\n", - option.name); - failed = true; - } - else - { - output.multisettings[option.name].emplace_back(v); - } - } - options_copy.erase(it); - } + // This means that the option was passed like '--a' + System::printf( + System::Color::error, "Error: The option '--%s' must be passed an argument.\n", option.name); + switches_copy.erase(switch_it); + failed = true; } } - if (!options_copy.empty()) + if (!switches_copy.empty()) { System::printf(System::Color::error, "Unknown option(s) for command '%s':\n", this->command); + for (auto&& switch_ : switches_copy) + { + System::print2(" '--", switch_, "'\n"); + } for (auto&& option : options_copy) { - System::print2(" '", option.first, "'\n"); + System::print2(" '--", option.first, "'\n"); } System::print2("\n"); failed = true; @@ -395,41 +532,325 @@ namespace vcpkg if (failed) { - display_usage(command_structure); + print_usage(command_structure); Checks::exit_fail(VCPKG_LINE_INFO); } return output; } - void display_usage(const CommandStructure& command_structure) + void print_usage() { + HelpTableFormatter table; + table.header("Commands"); + table.format("vcpkg search [pat]", "Search for packages available to be built"); + table.format("vcpkg install ...", "Install a package"); + table.format("vcpkg remove ...", "Uninstall a package"); + table.format("vcpkg remove --outdated", "Uninstall all out-of-date packages"); + table.format("vcpkg list", "List installed packages"); + table.format("vcpkg update", "Display list of packages for updating"); + table.format("vcpkg upgrade", "Rebuild all outdated packages"); + table.format("vcpkg x-history ", "(Experimental) Shows the history of CONTROL versions of a package"); + table.format("vcpkg hash [alg]", "Hash a file by specific algorithm, default SHA512"); + table.format("vcpkg help topics", "Display the list of help topics"); + table.format("vcpkg help ", "Display help for a specific topic"); + table.blank(); + Commands::Integrate::append_helpstring(table); + table.blank(); + table.format("vcpkg export ... [opt]...", "Exports a package"); + table.format("vcpkg edit ", + "Open up a port for editing (uses " + format_environment_variable("EDITOR") + ", default 'code')"); + table.format("vcpkg import ", "Import a pre-built library"); + table.format("vcpkg create [archivename]", "Create a new package"); + table.format("vcpkg owns ", "Search for files in installed packages"); + table.format("vcpkg depend-info ...", "Display a list of dependencies for packages"); + table.format("vcpkg env", "Creates a clean shell environment for development or compiling"); + table.format("vcpkg version", "Display version information"); + table.format("vcpkg contact", "Display contact information to send feedback"); + table.blank(); + table.header("Options"); + VcpkgCmdArguments::append_common_options(table); + table.blank(); + table.format("@response_file", "Specify a response file to provide additional parameters"); + table.blank(); + table.example("For more help (including examples) see the accompanying README.md and docs folder."); + System::print2(table.m_str); + } + + void print_usage(const CommandStructure& command_structure) + { + HelpTableFormatter table; if (!command_structure.example_text.empty()) { - System::print2(command_structure.example_text, "\n"); + table.example(command_structure.example_text); } - System::print2("Options:\n"); - Help::HelpTableFormatter table; + table.header("Options"); for (auto&& option : command_structure.options.switches) { - table.format(option.name, option.short_help_text); + table.format(Strings::format("--%s", option.name), option.short_help_text); } for (auto&& option : command_structure.options.settings) { - table.format((option.name + "=..."), option.short_help_text); + table.format(Strings::format("--%s=...", option.name), option.short_help_text); } for (auto&& option : command_structure.options.multisettings) { - table.format((option.name + "=..."), option.short_help_text); + table.format(Strings::format("--%s=...", option.name), option.short_help_text); } - table.format("--triplet ", "Set the default triplet for unqualified packages"); - table.format("--overlay-ports=", "Specify directories to be used when searching for ports"); - table.format("--overlay-triplets=", "Specify directories containing triplets files"); - table.format("--vcpkg-root ", - "Specify the vcpkg directory to use instead of current directory or tool directory"); - table.format("--x-scripts-root=", - "(Experimental) Specify the scripts directory to use instead of default vcpkg scripts directory"); + + VcpkgCmdArguments::append_common_options(table); System::print2(table.m_str); } + + 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); + }; + + 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'"); + table.format(opt(DOWNLOADS_ROOT_DIR_ARG, "=", ""), "Specify the downloads root directory"); + table.format("", "(default: " + format_environment_variable("VCPKG_DOWNLOADS") + ')'); + table.format(opt(VCPKG_ROOT_DIR_ARG, " ", ""), "Specify the vcpkg root directory"); + table.format("", "(default: " + format_environment_variable("VCPKG_ROOT") + ')'); + table.format(opt(BUILDTREES_ROOT_DIR_ARG, "=", ""), + "(Experimental) Specify the buildtrees root directory"); + 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"); + } + + void VcpkgCmdArguments::imbue_from_environment() + { + if (!disable_metrics) + { + const auto vcpkg_disable_metrics_env = System::get_environment_variable(DISABLE_METRICS_ENV); + if (vcpkg_disable_metrics_env.has_value()) + { + disable_metrics = true; + } + } + + if (!triplet) + { + const auto vcpkg_default_triplet_env = System::get_environment_variable(TRIPLET_ENV); + if (const auto unpacked = vcpkg_default_triplet_env.get()) + { + triplet = std::make_unique(*unpacked); + } + } + + { + 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); + if (const auto unpacked = vcpkg_root_env.get()) + { + vcpkg_root_dir = std::make_unique(*unpacked); + } + } + + if (!downloads_root_dir) + { + const auto vcpkg_downloads_env = vcpkg::System::get_environment_variable(DOWNLOADS_ROOT_DIR_ENV); + if (const auto unpacked = vcpkg_downloads_env.get()) + { + downloads_root_dir = std::make_unique(*unpacked); + } + } + + const auto vcpkg_feature_flags_env = System::get_environment_variable(FEATURE_FLAGS_ENV); + if (const auto v = vcpkg_feature_flags_env.get()) + { + auto flags = Strings::split(*v, ','); + parse_feature_flags(flags, *this); + } + + { + const auto vcpkg_visual_studio_path_env = System::get_environment_variable(DEFAULT_VISUAL_STUDIO_PATH_ENV); + if (const auto unpacked = vcpkg_visual_studio_path_env.get()) + { + default_visual_studio_path = std::make_unique(*unpacked); + } + } + } + + void VcpkgCmdArguments::check_feature_flag_consistency() const + { + struct + { + StringView flag; + StringView option; + bool is_inconsistent; + } possible_inconsistencies[] = { + {BINARY_CACHING_FEATURE, BINARY_SOURCES_ARG, !binary_sources.empty() && !binary_caching.value_or(true)}, + {MANIFEST_MODE_FEATURE, MANIFEST_ROOT_DIR_ARG, manifest_root_dir && !manifest_mode.value_or(true)}, + }; + for (const auto& el : possible_inconsistencies) + { + if (el.is_inconsistent) + { + System::printf(System::Color::warning, + "Warning: %s feature specifically turned off, but --%s was specified.\n", + el.flag, + el.option); + System::printf(System::Color::warning, "Warning: Defaulting to %s being on.\n", el.flag); + Metrics::g_metrics.lock()->track_property( + "warning", Strings::format("warning %s alongside %s", el.flag, el.option)); + } + } + } + + void VcpkgCmdArguments::debug_print_feature_flags() const + { + struct + { + StringView name; + Optional flag; + } flags[] = { + {BINARY_CACHING_FEATURE, binary_caching}, + {MANIFEST_MODE_FEATURE, manifest_mode}, + {COMPILER_TRACKING_FEATURE, compiler_tracking}, + }; + + for (const auto& flag : flags) + { + if (auto r = flag.flag.get()) + { + Debug::print("Feature flag '", flag.name, "' = ", *r ? "on" : "off", "\n"); + } + else + { + Debug::print("Feature flag '", flag.name, "' unset\n"); + } + } + } + + void VcpkgCmdArguments::track_feature_flag_metrics() const + { + struct + { + StringView flag; + bool enabled; + } flags[] = { + {BINARY_CACHING_FEATURE, binary_caching_enabled()}, + {COMPILER_TRACKING_FEATURE, compiler_tracking_enabled()}, + }; + + for (const auto& flag : flags) + { + Metrics::g_metrics.lock()->track_feature(flag.flag.to_string(), flag.enabled); + } + } + + std::string format_environment_variable(StringLiteral lit) + { + std::string result; +#if defined(_WIN32) + result.reserve(lit.size() + 2); + result.push_back('%'); + result.append(lit.data(), lit.size()); + result.push_back('%'); +#else + result.reserve(lit.size() + 1); + result.push_back('$'); + result.append(lit.data(), lit.size()); +#endif + return result; + } + + std::string create_example_string(const std::string& command_and_arguments) + { + std::string cs = Strings::format("Example:\n" + " vcpkg %s\n", + command_and_arguments); + return cs; + } + + static void help_table_newline_indent(std::string& target) + { + target.push_back('\n'); + target.append(34, ' '); + } + + static constexpr ptrdiff_t S_MAX_LINE_LENGTH = 100; + + void HelpTableFormatter::format(StringView col1, StringView col2) + { + // 2 space, 31 col1, 1 space, 65 col2 = 99 + m_str.append(2, ' '); + Strings::append(m_str, col1); + if (col1.size() > 31) + { + help_table_newline_indent(m_str); + } + else + { + m_str.append(32 - col1.size(), ' '); + } + text(col2, 34); + + m_str.push_back('\n'); + } + + void HelpTableFormatter::header(StringView name) + { + m_str.append(name.data(), name.size()); + m_str.push_back(':'); + m_str.push_back('\n'); + } + + void HelpTableFormatter::example(StringView example_text) + { + m_str.append(example_text.data(), example_text.size()); + m_str.push_back('\n'); + } + + void HelpTableFormatter::blank() { m_str.push_back('\n'); } + + // Note: this formatting code does not properly handle unicode, however all of our documentation strings are English + // ASCII. + void HelpTableFormatter::text(StringView text, int indent) + { + const char* line_start = text.begin(); + const char* const e = text.end(); + const char* best_break = std::find_if(line_start, e, [](char ch) { return ch == ' ' || ch == '\n'; }); + + while (best_break != e) + { + const char* next_break = std::find_if(best_break + 1, e, [](char ch) { return ch == ' ' || ch == '\n'; }); + if (*best_break == '\n' || next_break - line_start + indent > S_MAX_LINE_LENGTH) + { + m_str.append(line_start, best_break); + m_str.push_back('\n'); + line_start = best_break + 1; + best_break = next_break; + m_str.append(indent, ' '); + } + else + { + best_break = next_break; + } + } + m_str.append(line_start, best_break); + } } diff --git a/toolsrc/src/vcpkg/vcpkglib.cpp b/toolsrc/src/vcpkg/vcpkglib.cpp index 2a52111a65188a..ce9c6273418867 100644 --- a/toolsrc/src/vcpkg/vcpkglib.cpp +++ b/toolsrc/src/vcpkg/vcpkglib.cpp @@ -3,6 +3,7 @@ #include #include #include + #include #include #include @@ -178,7 +179,7 @@ namespace vcpkg { if (!pgh->is_installed()) continue; auto& ipv = ipv_map[pgh->package.spec]; - if (pgh->package.feature.empty()) + if (!pgh->package.is_feature()) { ipv.core = pgh.get(); } @@ -206,7 +207,7 @@ namespace vcpkg for (const std::unique_ptr& pgh : status_db) { - if (!pgh->is_installed() || !pgh->package.feature.empty()) + if (!pgh->is_installed() || pgh->package.is_feature()) { continue; } diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index bf16f09f3fd45d..4837c4b713083e 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -2,122 +2,248 @@ #include #include -#include +#include +#include +#include #include + #include #include +#include #include #include #include #include -namespace vcpkg +namespace { - Expected VcpkgPaths::create(const fs::path& vcpkg_root_dir, - const Optional& vcpkg_scripts_root_dir, - const std::string& default_vs_path, - const std::vector* triplets_dirs) + using namespace vcpkg; + fs::path process_input_directory_impl( + Files::Filesystem& filesystem, const fs::path& root, std::string* option, StringLiteral name, LineInfo li) { - auto& fs = Files::get_real_filesystem(); - std::error_code ec; - const fs::path canonical_vcpkg_root_dir = fs.canonical(vcpkg_root_dir, ec); - if (ec) + if (option) + { + // input directories must exist, so we use canonical + return filesystem.canonical(li, fs::u8path(*option)); + } + else { - return ec; + return root / fs::u8path(name.begin(), name.end()); } + } - VcpkgPaths paths; - paths.root = canonical_vcpkg_root_dir; - paths.default_vs_path = default_vs_path; + fs::path process_input_directory( + 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'); + return result; + } - if (paths.root.empty()) + fs::path process_output_directory_impl( + Files::Filesystem& filesystem, const fs::path& root, std::string* option, StringLiteral name, LineInfo li) + { + if (option) { - Metrics::g_metrics.lock()->track_property("error", "Invalid vcpkg root directory"); - Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid vcpkg root directory: %s", paths.root.string()); + // output directories might not exist, so we use merely absolute + return filesystem.absolute(li, fs::u8path(*option)); } + else + { + return root / fs::u8path(name.begin(), name.end()); + } + } + + fs::path process_output_directory( + 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'); + return result; + } + + void uppercase_win32_drive_letter(fs::path& path) + { +#if defined(_WIN32) + const auto& nativePath = path.native(); + if (nativePath.size() > 2 && (nativePath[0] >= L'a' && nativePath[0] <= L'z') && nativePath[1] == L':') + { + auto uppercaseFirstLetter = std::move(path).native(); + uppercaseFirstLetter[0] = nativePath[0] - L'a' + L'A'; + path = uppercaseFirstLetter; + } +#endif + (void)path; + } - paths.packages = paths.root / "packages"; - paths.buildtrees = paths.root / "buildtrees"; +} // unnamed namespace - const auto overriddenDownloadsPath = System::get_environment_variable("VCPKG_DOWNLOADS"); - if (auto odp = overriddenDownloadsPath.get()) +namespace vcpkg +{ + namespace details + { + struct VcpkgPathsImpl { - auto asPath = fs::u8path(*odp); - if (!fs::is_directory(fs.status(VCPKG_LINE_INFO, asPath))) + VcpkgPathsImpl(Files::Filesystem& fs, bool compiler_tracking) + : fs_ptr(&fs), m_tool_cache(get_tool_cache()), m_env_cache(compiler_tracking) { - Metrics::g_metrics.lock()->track_property("error", "Invalid VCPKG_DOWNLOADS override directory."); - Checks::exit_with_message( - VCPKG_LINE_INFO, - "Invalid downloads override directory: %s; " - "create that directory or unset VCPKG_DOWNLOADS to use the default downloads location.", - asPath.u8string()); } - paths.downloads = fs::stdfs::canonical(std::move(asPath), ec); - if (ec) + Lazy> available_triplets; + Lazy> toolsets; + Lazy> cmake_script_hashes; + + Files::Filesystem* fs_ptr; + + fs::path default_vs_path; + std::vector triplets_dirs; + + std::unique_ptr m_tool_cache; + Cache m_triplets_cache; + Build::EnvCache m_env_cache; + + fs::SystemHandle file_lock_handle; + }; + } + + VcpkgPaths::VcpkgPaths(Files::Filesystem& filesystem, const VcpkgCmdArguments& args) + : m_pimpl(std::make_unique(filesystem, args.compiler_tracking_enabled())) + { + original_cwd = filesystem.current_path(VCPKG_LINE_INFO); + if (args.vcpkg_root_dir) + { + root = filesystem.canonical(VCPKG_LINE_INFO, fs::u8path(*args.vcpkg_root_dir)); + } + else + { + root = filesystem.find_file_recursively_up(original_cwd, ".vcpkg-root"); + if (root.empty()) { - return ec; + root = filesystem.find_file_recursively_up( + filesystem.canonical(VCPKG_LINE_INFO, System::get_exe_path_of_current_process()), ".vcpkg-root"); } } + 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'); + + std::error_code ec; + bool manifest_mode_on = args.manifest_mode.value_or(args.manifest_root_dir != nullptr); + if (args.manifest_root_dir) + { + manifest_root_dir = filesystem.canonical(VCPKG_LINE_INFO, fs::u8path(*args.manifest_root_dir)); + } else { - paths.downloads = paths.root / "downloads"; + manifest_root_dir = filesystem.find_file_recursively_up(original_cwd, "vcpkg.json"); } + uppercase_win32_drive_letter(manifest_root_dir); - paths.ports = paths.root / "ports"; - paths.installed = paths.root / "installed"; - paths.triplets = paths.root / "triplets"; - paths.community_triplets = paths.triplets / "community"; + if (!manifest_root_dir.empty() && manifest_mode_on) + { + Debug::print("Using manifest-root: ", manifest_root_dir.u8string(), '\n'); - if (auto scripts_dir = vcpkg_scripts_root_dir.get()) + installed = process_output_directory( + filesystem, manifest_root_dir, args.install_root_dir.get(), "vcpkg_installed", VCPKG_LINE_INFO); + const auto vcpkg_lock = root / ".vcpkg-root"; + if (args.wait_for_lock.value_or(false)) + { + m_pimpl->file_lock_handle = filesystem.take_exclusive_file_lock(vcpkg_lock, ec); + } + else + { + m_pimpl->file_lock_handle = filesystem.try_take_exclusive_file_lock(vcpkg_lock, ec); + } + if (ec) + { + System::printf( + System::Color::error, "Failed to take the filesystem lock on %s:\n", vcpkg_lock.u8string()); + System::printf(System::Color::error, " %s\n", ec.message()); + Checks::exit_fail(VCPKG_LINE_INFO); + } + } + else { - if (scripts_dir->empty() || !fs::stdfs::is_directory(*scripts_dir)) + // we ignore the manifest root dir if the user requests -manifest + if (!manifest_root_dir.empty() && !args.manifest_mode.has_value()) { - Metrics::g_metrics.lock()->track_property("error", "Invalid scripts override directory."); - Checks::exit_with_message( - VCPKG_LINE_INFO, - "Invalid scripts override directory: %s; " - "create that directory or unset --x-scripts-root to use the default scripts location.", - scripts_dir->u8string()); + System::print2(System::Color::warning, + "Warning: manifest-root detected at ", + manifest_root_dir.generic_u8string(), + ", 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: + * Add the `%s` feature flag to the comma-separated environment + variable `%s`. + * Add the `%s` feature flag to the `--%s` option. + * Pass your manifest directory to the `--%s` option. +If you wish to silence this error and use classic mode, you can: + * Add the `-%s` feature flag to `%s`. + * Add the `-%s` feature flag to `--%s`. +)", + VcpkgCmdArguments::MANIFEST_MODE_FEATURE, + VcpkgCmdArguments::FEATURE_FLAGS_ENV, + VcpkgCmdArguments::MANIFEST_MODE_FEATURE, + VcpkgCmdArguments::FEATURE_FLAGS_ARG, + VcpkgCmdArguments::MANIFEST_ROOT_DIR_ARG, + VcpkgCmdArguments::MANIFEST_MODE_FEATURE, + VcpkgCmdArguments::FEATURE_FLAGS_ENV, + VcpkgCmdArguments::MANIFEST_MODE_FEATURE, + VcpkgCmdArguments::FEATURE_FLAGS_ARG); } - paths.scripts = *scripts_dir; + manifest_root_dir.clear(); + installed = + process_output_directory(filesystem, root, args.install_root_dir.get(), "installed", VCPKG_LINE_INFO); } - else + + buildtrees = + process_output_directory(filesystem, root, args.buildtrees_root_dir.get(), "buildtrees", VCPKG_LINE_INFO); + downloads = + process_output_directory(filesystem, root, args.downloads_root_dir.get(), "downloads", VCPKG_LINE_INFO); + packages = + process_output_directory(filesystem, root, args.packages_root_dir.get(), "packages", VCPKG_LINE_INFO); + ports = filesystem.canonical(VCPKG_LINE_INFO, root / fs::u8path("ports")); + scripts = process_input_directory(filesystem, root, args.scripts_root_dir.get(), "scripts", VCPKG_LINE_INFO); + prefab = root / fs::u8path("prefab"); + + if (args.default_visual_studio_path) { - paths.scripts = paths.root / "scripts"; + m_pimpl->default_vs_path = + filesystem.canonical(VCPKG_LINE_INFO, fs::u8path(*args.default_visual_studio_path)); } - paths.tools = paths.downloads / "tools"; - paths.buildsystems = paths.scripts / "buildsystems"; - paths.buildsystems_msbuild_targets = paths.buildsystems / "msbuild" / "vcpkg.targets"; + triplets = filesystem.canonical(VCPKG_LINE_INFO, root / fs::u8path("triplets")); + community_triplets = filesystem.canonical(VCPKG_LINE_INFO, triplets / fs::u8path("community")); + + tools = downloads / fs::u8path("tools"); + buildsystems = scripts / fs::u8path("buildsystems"); + const auto msbuildDirectory = buildsystems / fs::u8path("msbuild"); + buildsystems_msbuild_targets = msbuildDirectory / fs::u8path("vcpkg.targets"); + buildsystems_msbuild_props = msbuildDirectory / fs::u8path("vcpkg.props"); - paths.vcpkg_dir = paths.installed / "vcpkg"; - paths.vcpkg_dir_status_file = paths.vcpkg_dir / "status"; - paths.vcpkg_dir_info = paths.vcpkg_dir / "info"; - paths.vcpkg_dir_updates = paths.vcpkg_dir / "updates"; + vcpkg_dir = installed / fs::u8path("vcpkg"); + vcpkg_dir_status_file = vcpkg_dir / fs::u8path("status"); + vcpkg_dir_info = vcpkg_dir / fs::u8path("info"); + vcpkg_dir_updates = vcpkg_dir / fs::u8path("updates"); - paths.ports_cmake = paths.scripts / "ports.cmake"; + ports_cmake = filesystem.canonical(VCPKG_LINE_INFO, scripts / fs::u8path("ports.cmake")); - if (triplets_dirs) + for (auto&& overlay_triplets_dir : args.overlay_triplets) { - for (auto&& triplets_dir : *triplets_dirs) - { - auto path = fs::u8path(triplets_dir); - Checks::check_exit(VCPKG_LINE_INFO, - paths.get_filesystem().exists(path), - "Error: Path does not exist '%s'", - triplets_dir); - paths.triplets_dirs.emplace_back(fs::stdfs::canonical(path)); - } + m_pimpl->triplets_dirs.emplace_back( + filesystem.canonical(VCPKG_LINE_INFO, fs::u8path(overlay_triplets_dir))); } - paths.triplets_dirs.emplace_back(fs::stdfs::canonical(paths.triplets)); - paths.triplets_dirs.emplace_back(fs::stdfs::canonical(paths.community_triplets)); - - return paths; + m_pimpl->triplets_dirs.emplace_back(triplets); + m_pimpl->triplets_dirs.emplace_back(community_triplets); } - fs::path VcpkgPaths::package_dir(const PackageSpec& spec) const { return this->packages / spec.dir(); } + fs::path VcpkgPaths::package_dir(const PackageSpec& spec) const { return this->packages / fs::u8path(spec.dir()); } + fs::path VcpkgPaths::build_dir(const PackageSpec& spec) const { return this->buildtrees / fs::u8path(spec.name()); } + fs::path VcpkgPaths::build_dir(const std::string& package_name) const + { + return this->buildtrees / fs::u8path(package_name); + } fs::path VcpkgPaths::build_info_file_path(const PackageSpec& spec) const { @@ -145,10 +271,10 @@ namespace vcpkg const std::vector& VcpkgPaths::get_available_triplets() const { - return this->available_triplets.get_lazy([this]() -> std::vector { + return m_pimpl->available_triplets.get_lazy([this]() -> std::vector { std::vector output; Files::Filesystem& fs = this->get_filesystem(); - for (auto&& triplets_dir : triplets_dirs) + for (auto&& triplets_dir : m_pimpl->triplets_dirs) { for (auto&& path : fs.get_files_non_recursive(triplets_dir)) { @@ -162,11 +288,31 @@ namespace vcpkg }); } + const std::map& VcpkgPaths::get_cmake_script_hashes() const + { + return m_pimpl->cmake_script_hashes.get_lazy([this]() -> std::map { + auto& fs = this->get_filesystem(); + std::map helpers; + auto files = fs.get_files_non_recursive(this->scripts / fs::u8path("cmake")); + auto common_functions = fs::u8path("vcpkg_common_functions"); + for (auto&& file : files) + { + auto stem = file.stem(); + if (stem != common_functions) + { + helpers.emplace(stem.u8string(), + Hash::get_file_hash(VCPKG_LINE_INFO, fs, file, Hash::Algorithm::Sha1)); + } + } + return helpers; + }); + } + const fs::path VcpkgPaths::get_triplet_file_path(Triplet triplet) const { - return m_triplets_cache.get_lazy( + return m_pimpl->m_triplets_cache.get_lazy( triplet, [&]() -> auto { - for (const auto& triplet_dir : triplets_dirs) + for (const auto& triplet_dir : m_pimpl->triplets_dirs) { auto path = triplet_dir / (triplet.canonical_name() + ".cmake"); if (this->get_filesystem().exists(path)) @@ -182,29 +328,26 @@ namespace vcpkg const fs::path& VcpkgPaths::get_tool_exe(const std::string& tool) const { - if (!m_tool_cache) m_tool_cache = get_tool_cache(); - return m_tool_cache->get_tool_path(*this, tool); + return m_pimpl->m_tool_cache->get_tool_path(*this, tool); } const std::string& VcpkgPaths::get_tool_version(const std::string& tool) const { - if (!m_tool_cache) m_tool_cache = get_tool_cache(); - return m_tool_cache->get_tool_version(*this, tool); + return m_pimpl->m_tool_cache->get_tool_version(*this, tool); } const Toolset& VcpkgPaths::get_toolset(const Build::PreBuildInfo& prebuildinfo) const { - if ((prebuildinfo.external_toolchain_file && !prebuildinfo.load_vcvars_env) || - (!prebuildinfo.cmake_system_name.empty() && prebuildinfo.cmake_system_name != "WindowsStore")) + if (!prebuildinfo.using_vcvars()) { static Toolset external_toolset = []() -> Toolset { Toolset ret; - ret.dumpbin = ""; + ret.dumpbin.clear(); ret.supported_architectures = { ToolsetArchOption{"", System::get_host_processor(), System::get_host_processor()}}; - ret.vcvarsall = ""; + ret.vcvarsall.clear(); ret.vcvarsall_options = {}; ret.version = "external"; - ret.visual_studio_root_path = ""; + ret.visual_studio_root_path.clear(); return ret; }(); return external_toolset; @@ -213,15 +356,15 @@ namespace vcpkg #if !defined(_WIN32) Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot build windows triplets from non-windows."); #else - const std::vector& vs_toolsets = - this->toolsets.get_lazy([this]() { return VisualStudio::find_toolset_instances_preferred_first(*this); }); + const std::vector& vs_toolsets = m_pimpl->toolsets.get_lazy( + [this]() { return VisualStudio::find_toolset_instances_preferred_first(*this); }); std::vector candidates = Util::fmap(vs_toolsets, [](auto&& x) { return &x; }); const auto tsv = prebuildinfo.platform_toolset.get(); auto vsp = prebuildinfo.visual_studio_path.get(); - if (!vsp && !default_vs_path.empty()) + if (!vsp && !m_pimpl->default_vs_path.empty()) { - vsp = &default_vs_path; + vsp = &m_pimpl->default_vs_path; } if (tsv && vsp) @@ -262,5 +405,42 @@ namespace vcpkg #endif } - Files::Filesystem& VcpkgPaths::get_filesystem() const { return Files::get_real_filesystem(); } + const System::Environment& VcpkgPaths::get_action_env(const Build::AbiInfo& abi_info) const + { + return m_pimpl->m_env_cache.get_action_env(*this, abi_info); + } + + const std::string& VcpkgPaths::get_triplet_info(const Build::AbiInfo& abi_info) const + { + return m_pimpl->m_env_cache.get_triplet_info(*this, abi_info); + } + + Files::Filesystem& VcpkgPaths::get_filesystem() const { return *m_pimpl->fs_ptr; } + + void VcpkgPaths::track_feature_flag_metrics() const + { + struct + { + StringView flag; + bool enabled; + } flags[] = {{VcpkgCmdArguments::MANIFEST_MODE_FEATURE, manifest_mode_enabled()}}; + + for (const auto& flag : flags) + { + Metrics::g_metrics.lock()->track_feature(flag.flag.to_string(), flag.enabled); + } + } + + VcpkgPaths::~VcpkgPaths() + { + std::error_code ec; + if (m_pimpl->file_lock_handle.is_valid()) + { + m_pimpl->fs_ptr->unlock_file_lock(m_pimpl->file_lock_handle, ec); + if (ec) + { + Debug::print("Failed to unlock filesystem lock: ", ec.message(), '\n'); + } + } + } } diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp index 2c025fa1dbe4de..b3e5b2590fea6b 100644 --- a/toolsrc/src/vcpkg/versiont.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -1,19 +1,28 @@ #include "pch.h" #include + #include namespace vcpkg { - VersionT::VersionT() noexcept : value("0.0.0") {} - VersionT::VersionT(std::string&& value) : value(std::move(value)) {} - VersionT::VersionT(const std::string& value) : value(value) {} - const std::string& VersionT::to_string() const { return value; } - bool operator==(const VersionT& left, const VersionT& right) { return left.to_string() == right.to_string(); } - bool operator!=(const VersionT& left, const VersionT& right) { return left.to_string() != right.to_string(); } + VersionT::VersionT() noexcept : value("0.0.0"), port_version(0) { } + VersionT::VersionT(std::string&& value, int port_version) : value(std::move(value)), port_version(port_version) { } + VersionT::VersionT(const std::string& value, int port_version) : value(value), port_version(port_version) { } + + std::string VersionT::to_string() const + { + return port_version == 0 ? value : Strings::format("%s#%d", value, port_version); + } + + bool operator==(const VersionT& left, const VersionT& right) + { + return left.port_version == right.port_version && left.value == right.value; + } + bool operator!=(const VersionT& left, const VersionT& right) { return !(left == right); } - VersionDiff::VersionDiff() noexcept : left(), right() {} - VersionDiff::VersionDiff(const VersionT& left, const VersionT& right) : left(left), right(right) {} + VersionDiff::VersionDiff() noexcept : left(), right() { } + VersionDiff::VersionDiff(const VersionT& left, const VersionT& right) : left(left), right(right) { } std::string VersionDiff::to_string() const { diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index df3c70de2170a4..a9a5d5565fed2e 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -7,6 +7,7 @@ #include #include #include + #include namespace vcpkg::VisualStudio @@ -119,7 +120,23 @@ namespace vcpkg::VisualStudio } } - const auto append_if_has_cl = [&](fs::path&& path_root) { + // VS2019 instance from environment variable + auto maybe_vs160_comntools = System::get_environment_variable("vs160comntools"); + if (const auto path_as_string = maybe_vs160_comntools.get()) + { + // We want lexically_normal(), but it is not available + // Correct root path might be 2 or 3 levels up, depending on if the path has trailing backslash. + auto common7_tools = fs::u8path(*path_as_string); + if (common7_tools.filename().empty()) + instances.emplace_back(common7_tools.parent_path().parent_path().parent_path(), + "16.0", + VisualStudioInstance::ReleaseType::LEGACY); + else + instances.emplace_back( + common7_tools.parent_path().parent_path(), "16.0", VisualStudioInstance::ReleaseType::LEGACY); + } + + const auto append_if_has_cl_vs140 = [&](fs::path&& path_root) { const auto cl_exe = path_root / "VC" / "bin" / "cl.exe"; const auto vcvarsall_bat = path_root / "VC" / "vcvarsall.bat"; @@ -132,14 +149,16 @@ namespace vcpkg::VisualStudio if (const auto path_as_string = maybe_vs140_comntools.get()) { // We want lexically_normal(), but it is not available - // Correct root path might be 2 or 3 levels up, depending on if the path has trailing backslash. Try both. - auto common7_tools = fs::path{*path_as_string}; - append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path()); - append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path().parent_path()); + // Correct root path might be 2 or 3 levels up, depending on if the path has trailing backslash. + auto common7_tools = fs::u8path(*path_as_string); + if (common7_tools.filename().empty()) + append_if_has_cl_vs140(common7_tools.parent_path().parent_path().parent_path()); + else + append_if_has_cl_vs140(common7_tools.parent_path().parent_path()); } // VS2015 instance from Program Files - append_if_has_cl(program_files_32_bit / "Microsoft Visual Studio 14.0"); + append_if_has_cl_vs140(program_files_32_bit / "Microsoft Visual Studio 14.0"); return instances; } diff --git a/toolsrc/src/vcpkgmetricsuploader.cpp b/toolsrc/src/vcpkgmetricsuploader.cpp index 2239fe75062b1d..800ffb5d217ebf 100644 --- a/toolsrc/src/vcpkgmetricsuploader.cpp +++ b/toolsrc/src/vcpkgmetricsuploader.cpp @@ -1,9 +1,11 @@ -#include +#include #include #include -#include +#include + +#include using namespace vcpkg; diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln deleted file mode 100644 index b9f6ade652be11..00000000000000 --- a/toolsrc/vcpkg.sln +++ /dev/null @@ -1,106 +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_32_bit.cmake = ..\scripts\cmake\vcpkg_get_program_files_32_bit.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/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj deleted file mode 100644 index ed80a210e88c89..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ /dev/null @@ -1,293 +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 4e2bbb45a9d748..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ /dev/null @@ -1,444 +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\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 - - - - - 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 - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - \ 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/toolsrc/dirs.proj b/toolsrc/windows-bootstrap/dirs.proj similarity index 93% rename from toolsrc/dirs.proj rename to toolsrc/windows-bootstrap/dirs.proj index 7729c989792961..960374bffd18cb 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/windows-bootstrap/dirs.proj @@ -5,7 +5,7 @@ - + diff --git a/toolsrc/windows-bootstrap/vcpkg.sln b/toolsrc/windows-bootstrap/vcpkg.sln new file mode 100644 index 00000000000000..51dc3649eb5cbd --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkg.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +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("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E4FAF582-0DB7-4CF5-BAE0-E2D38C48593B}" + 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 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {030760DE-1214-461B-B241-39608AD6FB66} + EndGlobalSection +EndGlobal diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj similarity index 92% rename from toolsrc/vcpkg/vcpkg.vcxproj rename to toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj index 917cd3b9c86123..b6229d9a3fb115 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -139,10 +139,10 @@ - + - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters similarity index 89% rename from toolsrc/vcpkg/vcpkg.vcxproj.filters rename to toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters index 3821d89b399d94..3710939ca920b3 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters @@ -15,12 +15,12 @@ - + Source Files - + Source Files diff --git a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj new file mode 100644 index 00000000000000..cd98c2256ba927 --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj @@ -0,0 +1,327 @@ + + + + + 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/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters new file mode 100644 index 00000000000000..f1772fa5f8ceb6 --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters @@ -0,0 +1,540 @@ + + + + + {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 + + + 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 + + + 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/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj similarity index 93% rename from toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj rename to toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 9e2e8c08ac122e..027ef1917b50fe 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -134,7 +134,7 @@ - + diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters similarity index 91% rename from toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters rename to toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters index ad56c0c7214e35..d103d50c26ed8b 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters +++ b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files diff --git a/triplets/community/arm-mingw-dynamic.cmake b/triplets/community/arm-mingw-dynamic.cmake new file mode 100644 index 00000000000000..b23870c11a5b08 --- /dev/null +++ b/triplets/community/arm-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE arm) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/arm-mingw.cmake b/triplets/community/arm-mingw-static.cmake similarity index 100% rename from triplets/community/arm-mingw.cmake rename to triplets/community/arm-mingw-static.cmake diff --git a/triplets/community/arm64-mingw-dynamic.cmake b/triplets/community/arm64-mingw-dynamic.cmake new file mode 100644 index 00000000000000..30ed204ed78477 --- /dev/null +++ b/triplets/community/arm64-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/arm64-mingw.cmake b/triplets/community/arm64-mingw-static.cmake similarity index 100% rename from triplets/community/arm64-mingw.cmake rename to triplets/community/arm64-mingw-static.cmake diff --git a/triplets/community/arm64-osx.cmake b/triplets/community/arm64-osx.cmake new file mode 100644 index 00000000000000..62325a696759f3 --- /dev/null +++ b/triplets/community/arm64-osx.cmake @@ -0,0 +1,6 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +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/arm64-windows-static.cmake b/triplets/community/arm64-windows-static.cmake new file mode 100644 index 00000000000000..34c53f0a231162 --- /dev/null +++ b/triplets/community/arm64-windows-static.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + 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/wasm32-emscripten.cmake b/triplets/community/wasm32-emscripten.cmake new file mode 100644 index 00000000000000..2394e12270cc0f --- /dev/null +++ b/triplets/community/wasm32-emscripten.cmake @@ -0,0 +1,15 @@ +set(VCPKG_ENV_PASSTHROUGH EMSDK PATH) + +if(NOT DEFINED ENV{EMSDK}) + message(FATAL_ERROR "The EMSDK environment variable must be defined") +endif() + +if(NOT EXISTS $ENV{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake) + message(FATAL_ERROR "Emscripten.cmake toolchain file not found") +endif() + +set(VCPKG_TARGET_ARCHITECTURE wasm32) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME Emscripten) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE $ENV{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake) diff --git a/triplets/community/x64-mingw-dynamic.cmake b/triplets/community/x64-mingw-dynamic.cmake new file mode 100644 index 00000000000000..1f132cfe15672d --- /dev/null +++ b/triplets/community/x64-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/x64-mingw.cmake b/triplets/community/x64-mingw-static.cmake similarity index 100% rename from triplets/community/x64-mingw.cmake rename to triplets/community/x64-mingw-static.cmake diff --git a/triplets/community/x86-mingw-dynamic.cmake b/triplets/community/x86-mingw-dynamic.cmake new file mode 100644 index 00000000000000..000b36d9607789 --- /dev/null +++ b/triplets/community/x86-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/x86-mingw.cmake b/triplets/community/x86-mingw-static.cmake similarity index 100% rename from triplets/community/x86-mingw.cmake rename to triplets/community/x86-mingw-static.cmake