-
Notifications
You must be signed in to change notification settings - Fork 18
Map zlib to zlib-ng #208
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
Merged
Merged
Map zlib to zlib-ng #208
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ repos: | |
owner: unicode-org | ||
repo: icu | ||
|
||
zlib: | ||
zlib-ng: | ||
host: github | ||
owner: zlib-ng | ||
repo: zlib-ng | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,2 @@ | ||
set(VERSION 2.2.2) | ||
|
||
set(FILENAME "zlib-ng-${VERSION}.zip") | ||
set(URLS "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${VERSION}.zip") | ||
|
||
# Get archive | ||
vcpkg_download_distfile(ARCHIVE | ||
URLS ${URLS} | ||
FILENAME ${FILENAME} | ||
SHA512 98586b3ce67bf481ccb94f3263340dffde10c3735218b0c60173a91fe931f4e40a772691c7d19b691a167ae9709f62efcc247c2711d15cf19ca3bd318cab9689 | ||
) | ||
|
||
# Extract archive | ||
vcpkg_extract_source_archive_ex( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
ARCHIVE ${ARCHIVE} | ||
REF ${VERSION} | ||
PATCHES ${PATCHES} | ||
) | ||
|
||
# Run CMake build | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
OPTIONS | ||
-DZLIB_COMPAT=ON | ||
-DZLIB_ENABLE_TESTS=OFF | ||
OPTIONS_DEBUG | ||
-DSKIP_INSTALL_HEADERS=ON | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_copy_pdbs() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ZLIB) | ||
vcpkg_fixup_pkgconfig() | ||
|
||
# Prepare distribution | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/zlib RENAME copyright) | ||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/zlib/version "${VERSION}") | ||
# Mapping zlib-ng to zlib | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
{ | ||
"name": "zlib", | ||
"version": "2.2.2", | ||
"version-string": "zlib-ng", | ||
"description": "A compression library", | ||
"homepage": "https://github.com/zlib-ng/zlib-ng", | ||
"license": "Zlib", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
"zlib-ng" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_cmake_configure_options
There was a problem hiding this comment.
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
(There are other efforts, but I don't think anything is ready now.)
There was a problem hiding this comment.
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
Can wait until microsoft/vcpkg#43122 lands before proposing the changes.