Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update in vcpkg #286

Open
NikolayKanchevski opened this issue Jan 8, 2023 · 1 comment
Open

Update in vcpkg #286

NikolayKanchevski opened this issue Jan 8, 2023 · 1 comment

Comments

@NikolayKanchevski
Copy link

Hi, thanks for the great framework!

I was just wondering if it would be possible for you to update it in vcpkg, as it is outdated.

Thanks!

@crud89
Copy link

crud89 commented Mar 2, 2023

As the readme says:

Latest stable tagged version is 1.83. Current master version is 1.84 WIP.

The last stable version is 1.83, which is also used by the vcpkg port. If you want to use a more recent version, you can easily achieve this on your own using overlay ports. This is actually pretty straightforward. Create a folder somewhere in your repository that stores the overlay, e.g., ./modules/overlay-ports/imguizmo/. Then copy all files from here into this directory. Next open the portfile.cmake and replace the reference revision with the commit id you need. For example, the latest commit to date is fbc3614abcc642de7f3868cc0d68a35503ca9a4e. Also set the SHA512 to 0.

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO CedricGuillemet/ImGuizmo
    REF fbc3614abcc642de7f3868cc0d68a35503ca9a4e
    SHA512 0
    HEAD_REF master
)

Next, tell vcpkg to pick up the overlay port. Using CMake you can do this using:

SET(VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/modules/overlay-ports/imguizmo/")

This of course assumes, that your top-level CMakeLists.txt is placed in the root directory of the repository and that you are using the vcpkg toolchain file. If you are running vcpkg from command line use --overlay-ports=... instead:

.\vcpkg.exe install imguizmo --overlay-ports=modules/overlay-ports/imguizmo/

Alternatively, you can create a vcpkg-configuration.json file that lists the overlay-ports directory.

Whichever way you decide to go, running this the first time should yield an error, saying that there was a mismatch in the archive hashes. This error also prints the correct archive hash:

[DEBUG] Downloading https://github.com/CedricGuillemet/ImGuizmo/archive/fbc3614abcc642de7f3868cc0d68a35503ca9a4e.tar.gz
CUSTOMBUILD : error : Failed to download from mirror set:
File does not have the expected hash:
             url : [ https://github.com/CedricGuillemet/ImGuizmo/archive/fbc3614abcc642de7f3868cc0d68a35503ca9a4e.tar.gz ]
       File path : [ .\modules\vcpkg\downloads\CedricGuillemet-ImGuizmo-fbc3614abcc642de7f3868cc0d68a35503ca9a4e.tar.gz.10792.part ]
   Expected hash : [ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ]
     Actual hash : [ c9d57575478590d59d019fb35a6179ff73654c99c3a170849e8197b4be4c478a86aa118764fed96bdb659031a45de8572a7089f0dcff3554f3320d955e14cdf0 ]

Copy this hash into the portfile.cmake file where we earlier placed the 0 and retry. That should do the trick. 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants