Skip to content

Commit

Permalink
Map zlib to zlib-ng
Browse files Browse the repository at this point in the history
Remove the zlib port implementation and instead create an empty zlib port that depends on zlib-ng.
  • Loading branch information
donny-dont committed Jan 10, 2025
1 parent e82dce6 commit bb3d98d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
- name: Read zlib config
if: steps.zlib.outcome == 'success' || steps.zlib.outcome == 'failure'
continue-on-error: true
run: Get-Content ./buildtrees/zlib/config-${{ matrix.triplet }}-out.log
run: Get-Content ./buildtrees/zlib-ng/config-${{ matrix.triplet }}-out.log
- name: Read zlib debug build log
if: steps.zlib.outcome == 'success' || steps.zlib.outcome == 'failure'
continue-on-error: true
run: Get-Content ./buildtrees/zlib/install-${{ matrix.triplet }}-dbg-out.log
run: Get-Content ./buildtrees/zlib-ng/install-${{ matrix.triplet }}-dbg-out.log
- name: Read zlib release build log
if: steps.zlib.outcome == 'success' || steps.zlib.outcome == 'failure'
continue-on-error: true
run: Get-Content ./buildtrees/zlib/install-${{ matrix.triplet }}-rel-out.log
run: Get-Content ./buildtrees/zlib-ng/install-${{ matrix.triplet }}-rel-out.log

- name: Build brotli
id: brotli
Expand Down
2 changes: 1 addition & 1 deletion .reqcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
owner: unicode-org
repo: icu

zlib:
zlib-ng:
host: github
owner: zlib-ng
repo: zlib-ng
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
| Library | Version | Release Date |
|---|:---:|:---:|
| [icu](http://site.icu-project.org) | 76.1 | 2024-10-24 |
| [zlib](https://github.com/zlib-ng/zlib-ng) | 2.2.2 | 2024-09-17 |
| [curl](https://curl.se) | 8.11.0 | 2024-11-05 |
| [libxml2](http://xmlsoft.org) | 2.13.5 | 2024-11-12 |
| [sqlite](http://sqlite.org) | 3.47.0 | 2024-10-21 |
Expand Down
41 changes: 2 additions & 39 deletions ports/zlib/portfile.cmake
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)
11 changes: 2 additions & 9 deletions ports/zlib/vcpkg.json
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"
]
}
5 changes: 5 additions & 0 deletions triplets/x64-windows-webkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ if (PORT STREQUAL "highway")
elseif (PORT STREQUAL "pixman")
set(VCPKG_LIBRARY_LINKAGE static)
endif ()

# Turn on zlib compatibility
if (PORT STREQUAL "zlib-ng")
set(ZLIB_COMPAT ON)
endif ()

0 comments on commit bb3d98d

Please sign in to comment.