Hello community, here is the log from the commit of package ghc-zlib for openSUSE:Factory checked in at 2018-05-30 12:16:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-zlib (Old) and /work/SRC/openSUSE:Factory/.ghc-zlib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-zlib" Wed May 30 12:16:15 2018 rev:13 rq:607960 version:0.6.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-zlib/ghc-zlib.changes 2017-09-15 22:28:42.441474337 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-zlib.new/ghc-zlib.changes 2018-05-30 12:28:01.988751775 +0200 @@ -1,0 +2,8 @@ +Mon May 14 17:02:11 UTC 2018 - psim...@suse.com + +- Update zlib to version 0.6.2. + * New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16) + * Use CApiFFI where available for cross-compile friendliness (#14) + * Change the window bits range from 8..15 to 9..15 (#11) + +------------------------------------------------------------------- Old: ---- zlib-0.6.1.2.tar.gz New: ---- zlib-0.6.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-zlib.spec ++++++ --- /var/tmp/diff_new_pack.910Pnz/_old 2018-05-30 12:28:02.748724932 +0200 +++ /var/tmp/diff_new_pack.910Pnz/_new 2018-05-30 12:28:02.752724789 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-zlib # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name zlib %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.6.1.2 +Version: 0.6.2 Release: 0 Summary: Compression and decompression in the gzip and zlib formats License: BSD-2-Clause @@ -78,7 +78,7 @@ %ghc_pkg_recache %files -f %{name}.files -%doc LICENSE +%license LICENSE %files devel -f %{name}-devel.files %doc changelog examples ++++++ zlib-0.6.1.2.tar.gz -> zlib-0.6.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/Codec/Compression/Zlib/Stream.hsc new/zlib-0.6.2/Codec/Compression/Zlib/Stream.hsc --- old/zlib-0.6.1.2/Codec/Compression/Zlib/Stream.hsc 2016-10-23 20:13:38.000000000 +0200 +++ new/zlib-0.6.2/Codec/Compression/Zlib/Stream.hsc 2018-03-08 16:13:31.000000000 +0100 @@ -2,6 +2,9 @@ #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE DeriveGeneric #-} #endif +#if __GLASGOW_HASKELL__ >= 706 +{-# LANGUAGE CApiFFI #-} +#endif ----------------------------------------------------------------------------- -- | -- Copyright : (c) 2006-2015 Duncan Coutts @@ -709,8 +712,8 @@ -- usage. -- -- The compression window size is the value of the the window bits raised to --- the power 2. The window bits must be in the range @8..15@ which corresponds --- to compression window sizes of 256b to 32Kb. The default is 15 which is also +-- the power 2. The window bits must be in the range @9..15@ which corresponds +-- to compression window sizes of 512b to 32Kb. The default is 15 which is also -- the maximum size. -- -- The total amount of memory used depends on the window bits and the @@ -737,19 +740,19 @@ defaultWindowBits :: WindowBits defaultWindowBits = WindowBits 15 --- | A specific compression window size, specified in bits in the range @8..15@ +-- | A specific compression window size, specified in bits in the range @9..15@ -- windowBits :: Int -> WindowBits windowBits n - | n >= 8 && n <= 15 = WindowBits n - | otherwise = error "WindowBits must be in the range 8..15" + | n >= 9 && n <= 15 = WindowBits n + | otherwise = error "WindowBits must be in the range 9..15" fromWindowBits :: Format -> WindowBits-> CInt fromWindowBits format bits = (formatModifier format) (checkWindowBits bits) where checkWindowBits DefaultWindowBits = 15 checkWindowBits (WindowBits n) - | n >= 8 && n <= 15 = fromIntegral n - | otherwise = error "WindowBits must be in the range 8..15" + | n >= 9 && n <= 15 = fromIntegral n + | otherwise = error "WindowBits must be in the range 9..15" formatModifier Zlib = id formatModifier GZip = (+16) formatModifier GZipOrZlib = (+32) @@ -1008,6 +1011,10 @@ -- -- So we define c_inflateInit2 and c_deflateInit2 here as wrappers around -- their _ counterparts and pass the extra args. +-- +-- As of GHC 7.6, we can import macros directly using the CApiFFI extension. +-- This avoids the need for the hsc2hs #{const_str} construct, which means +-- hsc2hs can run in cross-compilation mode. ##ifdef NON_BLOCKING_FFI ##define SAFTY safe @@ -1015,6 +1022,14 @@ ##define SAFTY unsafe ##endif +#if __GLASGOW_HASKELL__ >= 706 +foreign import capi unsafe "zlib.h inflateInit2" + c_inflateInit2 :: StreamState -> CInt -> IO CInt + +foreign import capi unsafe "zlib.h deflateInit2" + c_deflateInit2 :: StreamState + -> CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt +#else foreign import ccall unsafe "zlib.h inflateInit2_" c_inflateInit2_ :: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt @@ -1023,15 +1038,6 @@ withCAString #{const_str ZLIB_VERSION} $ \versionStr -> c_inflateInit2_ z n versionStr (#{const sizeof(z_stream)} :: CInt) -foreign import ccall SAFTY "zlib.h inflate" - c_inflate :: StreamState -> CInt -> IO CInt - -foreign import ccall unsafe "zlib.h &inflateEnd" - c_inflateEnd :: FinalizerPtr StreamState - -foreign import ccall unsafe "zlib.h inflateReset" - c_inflateReset :: StreamState -> IO CInt - foreign import ccall unsafe "zlib.h deflateInit2_" c_deflateInit2_ :: StreamState -> CInt -> CInt -> CInt -> CInt -> CInt @@ -1043,6 +1049,16 @@ c_deflateInit2 z a b c d e = withCAString #{const_str ZLIB_VERSION} $ \versionStr -> c_deflateInit2_ z a b c d e versionStr (#{const sizeof(z_stream)} :: CInt) +#endif + +foreign import ccall SAFTY "zlib.h inflate" + c_inflate :: StreamState -> CInt -> IO CInt + +foreign import ccall unsafe "zlib.h &inflateEnd" + c_inflateEnd :: FinalizerPtr StreamState + +foreign import ccall unsafe "zlib.h inflateReset" + c_inflateReset :: StreamState -> IO CInt foreign import ccall unsafe "zlib.h deflateSetDictionary" c_deflateSetDictionary :: StreamState diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/changelog new/zlib-0.6.2/changelog --- old/zlib-0.6.1.2/changelog 2016-10-23 20:13:38.000000000 +0200 +++ new/zlib-0.6.2/changelog 2018-03-08 16:13:31.000000000 +0100 @@ -1,3 +1,9 @@ +0.6.2 Herbert Valerio Riedel <h...@gnu.org> March 2018 + + * New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16) + * Use CApiFFI where available for cross-compile friendliness (#14) + * Change the window bits range from 8..15 to 9..15 (#11) + 0.6.1.2 Herbert Valerio Riedel <h...@gnu.org> October 2016 * Fix a segfault when reading the stream multithreaded, #7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/test/Test/Codec/Compression/Zlib/Stream.hs new/zlib-0.6.2/test/Test/Codec/Compression/Zlib/Stream.hs --- old/zlib-0.6.1.2/test/Test/Codec/Compression/Zlib/Stream.hs 2016-10-23 20:13:38.000000000 +0200 +++ new/zlib-0.6.2/test/Test/Codec/Compression/Zlib/Stream.hs 2018-03-08 16:13:31.000000000 +0100 @@ -24,7 +24,7 @@ instance Arbitrary WindowBits where - arbitrary = elements $ defaultWindowBits:map windowBits [8..15] + arbitrary = elements $ defaultWindowBits:map windowBits [9..15] instance Arbitrary MemoryLevel where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/test/Test.hs new/zlib-0.6.2/test/Test.hs --- old/zlib-0.6.1.2/test/Test.hs 2016-10-23 20:13:38.000000000 +0200 +++ new/zlib-0.6.2/test/Test.hs 2018-03-08 16:13:31.000000000 +0100 @@ -61,10 +61,7 @@ -> Property prop_decompress_after_compress w cp dp = (w /= zlibFormat || decompressWindowBits dp >= compressWindowBits cp) && - -- Zlib decompression has been observed to fail with both compress and decompress - -- window bits = 8. This seems to be contrary to the docs and to a quick reading - -- of the zlib source code. - (decompressWindowBits dp > compressWindowBits cp || decompressWindowBits dp > WindowBits 8) && + (decompressWindowBits dp > compressWindowBits cp) && decompressBufferSize dp > 0 && compressBufferSize cp > 0 ==> liftM2 (==) (decompress w dp . compress w cp) id diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/zlib.cabal new/zlib-0.6.2/zlib.cabal --- old/zlib-0.6.1.2/zlib.cabal 2016-10-23 20:13:38.000000000 +0200 +++ new/zlib-0.6.2/zlib.cabal 2018-03-08 16:13:31.000000000 +0100 @@ -1,5 +1,5 @@ name: zlib -version: 0.6.1.2 +version: 0.6.2 copyright: (c) 2006-2016 Duncan Coutts license: BSD3 license-file: LICENSE @@ -20,7 +20,7 @@ provides access to the full zlib feature set. build-type: Simple cabal-version: >= 1.10 -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.1, GHC==8.0.2, GHC ==8.1.* +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.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.1 extra-source-files: changelog -- zlib C sources (for Windows) @@ -45,6 +45,11 @@ 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. + library exposed-modules: Codec.Compression.GZip, Codec.Compression.Zlib, @@ -60,6 +65,8 @@ DeriveDataTypeable if impl(ghc >= 7.2) other-extensions: DeriveGeneric + if impl(ghc >= 7.6) + other-extensions: CApiFFI build-depends: base >= 4 && < 5, bytestring >= 0.9 && < 0.12 if impl(ghc >= 7.2 && < 7.6) @@ -68,18 +75,23 @@ ghc-options: -Wall -fwarn-tabs if flag(non-blocking-ffi) cpp-options: -DNON_BLOCKING_FFI - if !os(windows) - -- 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.8 - c-sources: cbits/adler32.c cbits/compress.c cbits/crc32.c + -- don't use pkg-config + if !os(windows) + -- Normally we use the the standard system zlib. + extra-libraries: z + 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.8 + 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 + include-dirs: cbits + install-includes: zlib.h zconf.h test-suite tests type: exitcode-stdio-1.0