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

Map zlib to zlib-ng #208

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Map zlib to zlib-ng #208

merged 1 commit into from
Jan 10, 2025

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

@@ -12,6 +12,7 @@
{
"name": "vcpkg-cmake-config",
"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.

2 participants