Skip to content

Conversation

@donny-dont
Copy link
Collaborator

Remove the zlib port implementation and instead create an empty zlib port that depends on zlib-ng.

@donny-dont
Copy link
Collaborator Author

Implementation idea taken from microsoft/vcpkg#30743

"host": true
}
},
"zlib-ng"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remove vcpkg-cmake and vcpkg-cmake-config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that and the general technique!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The show-stopper might be the lack of activating ZLIB_COMPAT. AFAICS it is not (and cannot be) mapped to a feature, and so it would need to be injected by triplet file customization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's disappointing. The whole point of zlib-ng is to have a drop in replacement.

You have an example on how one would inject it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Drop-in replacement" is the same as "alternative", and vcpkg is unable to allow alternatives.

Basically, all (overlay) triplet files need

if(PORT STREQUAL "zlib-ng")
    set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DZLIB_COMPAT=ON")
endif()

(There are other efforts, but I don't think anything is ready now.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty so it seems like the port itself needs a change to make this work

if(ZLIB_COMPAT)
    set(_cmake_dir "ZLIB")
else()
    set(_port_suffix "zlib-ng")
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${_cmake_dir})

Can wait until microsoft/vcpkg#43122 lands before proposing the changes.

@donny-dont donny-dont force-pushed the map-zlib-ng branch 4 times, most recently from 1ff30c5 to 5cb0b7c Compare January 6, 2025 21:08
Remove the zlib port implementation and instead create an empty zlib port that depends on zlib-ng.
@donny-dont donny-dont merged commit bb3d98d into main Jan 10, 2025
1 check passed
@donny-dont donny-dont deleted the map-zlib-ng branch January 14, 2025 22:22
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

Successfully merging this pull request may close these issues.

3 participants