Skip to content

Commit

Permalink
[corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06 (#…
Browse files Browse the repository at this point in the history
…12211)

* [magnum] Improve maintainability of feature to cmake flag conversion

* [magnum] Ignore features not supported on current platform

Allows `vcpkg install magnum[*]` on any platform.

Signed-off-by: Squareys <[email protected]>

* [magnum] Add cglcontext and windowlesscglapplication features

* docs: Update valid VCPKG_CMAKE_SYSTEM_NAME values

Signed-off-by: Squareys <[email protected]>

* [magnum-plugins] Replace deprecated basisu with archive download

Signed-off-by: Squareys <[email protected]>

* [magnum-plugins] Add meshoptimizersceneconverter feature

Signed-off-by: Squareys <[email protected]>

* [magnum-plugins] Also use vcpkg_check_features

Analog to magnum port.

Signed-off-by: Squareys <[email protected]>

* [corrade,magnum,*-plugins,*-extras,*-integration] Update to v2020.06

Signed-off-by: Squareys <[email protected]>

* [meshoptimizer] Add initial port

Signed-off-by: Squareys <[email protected]>

* [magnum-plugins] Replace meshoptimizer download with feature dependency

Signed-off-by: Squareys <[email protected]>

* [corrade,magnum-*] Fix license installation command

Signed-off-by: Squareys <[email protected]>

* [meshoptimizer] Use vcpkg_fixup_cmake_targets

Co-authored-by: Robert Schumacher <[email protected]>
  • Loading branch information
Squareys and ras0219-msft authored Jul 14, 2020
1 parent 9891a8f commit 5e40afc
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 202 deletions.
4 changes: 3 additions & 1 deletion docs/users/triplets.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ 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)

Expand Down Expand Up @@ -127,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
Expand Down
2 changes: 1 addition & 1 deletion ports/corrade/CONTROL
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 7 additions & 22 deletions ports/corrade/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -31,7 +31,6 @@ vcpkg_configure_cmake(
OPTIONS
-DUTILITY_USE_ANSI_COLORS=ON
-DBUILD_STATIC=${BUILD_STATIC}
${_CUSTOM_BUILD_FLAGS}
${_COMPONENT_FLAGS}
)

Expand All @@ -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
Expand All @@ -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()
2 changes: 1 addition & 1 deletion ports/magnum-extras/CONTROL
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
10 changes: 6 additions & 4 deletions ports/magnum-extras/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion ports/magnum-integration/CONTROL
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
9 changes: 5 additions & 4 deletions ports/magnum-integration/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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()
24 changes: 20 additions & 4 deletions ports/magnum-plugins/CONTROL
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Source: magnum-plugins
Version: 2019.10-2
Version: 2020.06
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
Expand All @@ -14,11 +14,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
Expand Down Expand Up @@ -51,6 +51,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]
Expand All @@ -59,6 +63,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]
Expand All @@ -79,6 +87,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]
Expand All @@ -95,6 +107,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]
66 changes: 42 additions & 24 deletions ports/magnum-plugins/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,51 +1,68 @@
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}
)

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
Expand Down Expand Up @@ -86,7 +103,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()
43 changes: 0 additions & 43 deletions ports/magnum/002-sdl-includes-head.patch

This file was deleted.

Loading

0 comments on commit 5e40afc

Please sign in to comment.