diff --git a/ghc-zlib.spec b/ghc-zlib.spec index b4b9b36edc997f365ea4f6364054897890194251..f6f8b6b17920e4cd5cdf2202fe0a9eda8fdc8f5d 100644 --- a/ghc-zlib.spec +++ b/ghc-zlib.spec @@ -3,7 +3,7 @@ %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.6.3.0 +Version: 0.7.1.0 Release: 1 Summary: Compression and decompression in the gzip and zlib formats License: BSD-2-Clause @@ -94,5 +94,22 @@ cp -p %{SOURCE1} %{pkg_name}.cabal %files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files %changelog +* Tue Dec 3 2024 yangxudong 0.7.1.0-1 +- Update package to version 0.7.1.0-1 +- Split zlib C sources into zlib-clib package (thanks @hasufell). +- Use zlib-clib on Windows, unless pkg-config is available. +- Bump bundled zlib to 1.3.1. +- Hide deprecated constructors of CompressionLevel, Method, WindowBits, MemoryLevel, CompressionStrategy and Format. +- Make WindowBits, MemoryLevel and CompressionLevel newtypes over Int. +- Add smart constructors rleStrategy and fixedStrategy. +- Add assorted Eq, Ord, Typeable and Generic instances. +- Make flag pkg-config automatic and on by default. +- Make flag bundled-c-zlib to take priority over pkg-config. +- Do not force bundled-c-zlib on Windows, but force it for WASM. +- Strip install-includes, do not install any headers. +- Export DecompressError from non-internal modules. +- Fix compression/decompression of ByteString chunks > 4G. +- Flip flag non-blocking-ffi to be True be default. + * Thu Sep 28 2023 Lin Runze 0.6.3.0-1 - Initial packaging (Version 0.6.3.0) diff --git a/zlib-0.6.3.0.tar.gz b/zlib-0.6.3.0.tar.gz deleted file mode 100644 index 053d4b6683959268e4f27b53c4d2ab0960adf463..0000000000000000000000000000000000000000 Binary files a/zlib-0.6.3.0.tar.gz and /dev/null differ diff --git a/zlib-0.7.1.0.tar.gz b/zlib-0.7.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..869ef86ea50e3fc4cb1451198355c6454f59ca24 Binary files /dev/null and b/zlib-0.7.1.0.tar.gz differ diff --git a/zlib.cabal b/zlib.cabal index ccb9f39deae6da52ecb643133de7926484cd0a6e..b230b7603d3f12edc53950648e7d16bd87eaf166 100644 --- a/zlib.cabal +++ b/zlib.cabal @@ -1,7 +1,6 @@ cabal-version: >= 1.10 name: zlib -version: 0.6.3.0 -x-revision: 4 +version: 0.7.1.0 copyright: (c) 2006-2016 Duncan Coutts license: BSD3 @@ -23,13 +22,7 @@ description: This package provides a pure interface for compressing and provides access to the full zlib feature set. build-type: Simple -tested-with: GHC == 7.0.4 - , GHC == 7.2.2 - , GHC == 7.4.2 - , GHC == 7.6.3 - , GHC == 7.8.4 - , GHC == 7.10.3 - , GHC == 8.0.2 +tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5 @@ -37,16 +30,15 @@ tested-with: GHC == 7.0.4 , GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.8 - , GHC == 9.4.7 - , GHC == 9.6.3 - , GHC == 9.8.1 + , GHC == 9.4.8 + , GHC == 9.6.5 + , GHC == 9.8.2 + , GHC == 9.10.1 -extra-source-files: changelog +extra-source-files: changelog.md README.md - -- zlib C sources (for Windows) - cbits/crc32.h cbits/inffast.h cbits/inflate.h - cbits/trees.h cbits/deflate.h cbits/inffixed.h - cbits/inftrees.h cbits/zutil.h cbits/gzguts.h + -- extra headers + cbits-extra/hs-zlib.h -- test data files test/data/bad-crc.gz test/data/custom-dict.zlib test/data/custom-dict.zlib-dict test/data/hello.gz @@ -59,23 +51,23 @@ source-repository head location: https://github.com/haskell/zlib.git flag non-blocking-ffi - default: False + default: True manual: True description: The (de)compression calls can sometimes take a long time, which prevents other Haskell threads running. Enabling this flag avoids this unfairness, but with greater overall cost. flag pkg-config - default: False - manual: True - description: Use @pkg-config(1)@ to locate foreign @zlib@ library. + default: True + manual: False + description: Use @pkg-config@ executable to locate foreign @zlib@ library. flag bundled-c-zlib default: False manual: True - description: Use the bundled zlib C sources. Requires pkg-config to be False. - For windows, this is the default. - + description: Use @zlib-clib@ package with C sources instead of a system library. + C sources are used for GHCJS and WASM unconditionally + and on Windows unless @pkg-config@ flag is on. library exposed-modules: Codec.Compression.GZip, @@ -85,45 +77,46 @@ library other-modules: Codec.Compression.Zlib.Stream, Codec.Compression.Zlib.ByteStringCompat - if impl(ghc < 7) - default-language: Haskell98 - default-extensions: PatternGuards - else - default-language: Haskell2010 + default-language: Haskell2010 other-extensions: CPP, ForeignFunctionInterface, RankNTypes, BangPatterns, DeriveDataTypeable - if impl(ghc >= 7.2) - other-extensions: DeriveGeneric - if impl(ghc >= 7.6) - other-extensions: CApiFFI + other-extensions: DeriveGeneric + other-extensions: CApiFFI - build-depends: base >= 4 && < 4.20, + build-depends: base >= 4.9 && < 4.21, bytestring >= 0.9 && < 0.13 - if impl(ghc >= 7.0 && < 8.0.3) - build-depends: ghc-prim - includes: zlib.h + build-tools: hsc2hs >= 0.67 && < 0.69 + if os(windows) && impl(ghc < 8.4) + build-tools: hsc2hs < 0.68.5 + -- GHC 7 ships hsc2hs-0.67 + + -- use `includes:` to include them when compiling + includes: zlib.h hs-zlib.h + include-dirs: cbits-extra + c-sources: cbits-extra/hs-zlib.c ghc-options: -Wall -fwarn-tabs if flag(non-blocking-ffi) cpp-options: -DNON_BLOCKING_FFI - if flag(pkg-config) && !impl(ghcjs) && !os(ghcjs) - -- NB: pkg-config is available on windows as well when using msys2 - pkgconfig-depends: zlib + + -- Cross-platform builds (such as JS and WASM) must have access + -- to C sources, so using zlib-clib unconditionally. + -- + -- On Windows, zlib is shipped as part of GHC's mingw/lib directory, + -- which GHC always includes in its linker search path. However, + -- there is no guarantee that zlib1.dll (the corresponding shared library) + -- will be available on the user's PATH at runtime, making it risky to depend upon + -- (see https://github.com/haskell/zlib/issues/65 for what can go wrong). + -- Thus, we resort to zlib-clib unless pkg-config is available. + if flag(bundled-c-zlib) || impl(ghcjs) || os(ghcjs) || arch(wasm32) || (!flag(pkg-config) && os(windows)) + build-depends: zlib-clib < 2 else - -- don't use pkg-config - if !os(windows) && !flag(bundled-c-zlib) && !impl(ghcjs) && !os(ghcjs) - -- Normally we use the the standard system zlib. - extra-libraries: z + if flag(pkg-config) + -- NB: pkg-config is available on windows as well when using msys2 + pkgconfig-depends: zlib else - -- However for the benefit of users of Windows (which does not have zlib - -- by default) we bundle a complete copy of the C sources of zlib-1.2.11 - c-sources: cbits/adler32.c cbits/compress.c cbits/crc32.c - cbits/deflate.c cbits/infback.c - cbits/inffast.c cbits/inflate.c cbits/inftrees.c - cbits/trees.c cbits/uncompr.c cbits/zutil.c - include-dirs: cbits - install-includes: zlib.h zconf.h + extra-libraries: z test-suite tests type: exitcode-stdio-1.0