Skip to content

Commit

Permalink
Split packages into zlib/zlib-clib
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell authored and Bodigrim committed Apr 20, 2024
1 parent 16571cb commit c3809b5
Show file tree
Hide file tree
Showing 60 changed files with 111 additions and 30 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ jobs:
key: ${{ runner.os }}-ghc-${{ steps.setup-haskell-cabal.outputs.ghc-version }}
- name: Build
run: |
cabal sdist -z -o .
cabal sdist -o . all
cabal get zlib-*.tar.gz
cd zlib-*/
cabal build
echo "packages: ./$(ls zlib-clib-*.tar.gz | sed 's/\.tar\.gz//')/" > cabal.project
rm zlib-clib*.tar.gz
echo " ./$(ls zlib-*.tar.gz | sed 's/\.tar\.gz//')/" >> cabal.project
cabal build all
- name: Test
run: |
cd zlib-*/
cabal test
cabal test all
- name: Haddock
if: matrix.ghc != '7.10' && matrix.ghc != '8.0'
run: |
cd zlib-*/
cabal haddock
cabal haddock all
bundled-c-zlib:
runs-on: ${{ matrix.os }}
Expand All @@ -68,18 +68,18 @@ jobs:
key: ${{ runner.os }}-ghc-${{ steps.setup-haskell-cabal.outputs.ghc-version }}
- name: Build
run: |
cabal sdist -z -o .
cabal sdist -o . all
cabal get zlib-*.tar.gz
cd zlib-*/
cabal build -c 'zlib +bundled-c-zlib'
echo "packages: ./$(ls zlib-clib-*.tar.gz | sed 's/\.tar\.gz//')/" > cabal.project
rm zlib-clib*.tar.gz
echo " ./$(ls zlib-*.tar.gz | sed 's/\.tar\.gz//')/" >> cabal.project
cabal build -c 'zlib +bundled-c-zlib' all
- name: Test
run: |
cd zlib-*/
cabal test -c 'zlib +bundled-c-zlib'
cabal test -c 'zlib +bundled-c-zlib' all
- name: Haddock
run: |
cd zlib-*/
cabal haddock
cabal haddock all
wasi:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Build
run: |
mv cabal.project.wasi cabal.project.local
wasm32-wasi-cabal build --enable-tests
wasm32-wasi-cabal build --enable-tests all
wasm32-wasi-cabal list-bin test:tests
- name: Test
run: |
Expand All @@ -130,4 +130,4 @@ jobs:
run: |
source ~/.ghcup/env
cabal update
cabal test
cabal test all
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: ./zlib/
./zlib-clib/
3 changes: 3 additions & 0 deletions cabal.project.wasi
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages: ./zlib/
./zlib-clib/

-- https://github.com/haskellari/splitmix/pull/73
source-repository-package
type: git
Expand Down
22 changes: 22 additions & 0 deletions zlib-clib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright notice:

(C) 1995-2024 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
3 changes: 3 additions & 0 deletions zlib-clib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# zlib-clib

Zlib C library bits following https://zlib.net
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions zlib-clib/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1.3.1 Julian Ospald <hasufell@posteo> March 2024

* initial split off of zlib package
4 changes: 3 additions & 1 deletion update-c-sources.sh → zlib-clib/update-c-sources.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

set -x
set -e pipefail

curl -s http://zlib.net/zlib.tar.gz | tar xz
Expand All @@ -9,4 +10,5 @@ do
mv zlib-*/"${csrc##*/}" cbits/
done

rm -rf zlib-*
rm -rf zlib-*/ zlib-*.tar.gz

53 changes: 53 additions & 0 deletions zlib-clib/zlib-clib.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cabal-version: 2.4
name: zlib-clib
version: 1.3.1

copyright: (c) 2006-2016 Duncan Coutts
license: Zlib
license-file: LICENSE
author: Duncan Coutts <duncan@community.haskell.org>
maintainer: Duncan Coutts <duncan@community.haskell.org>, Andrew Lelechenko <andrew.lelechenko@gmail.com>, Emily Pillmore <emilypi@cohomolo.gy>, Herbert Valerio Riedel <hvr@gnu.org>
bug-reports: https://github.com/haskell/zlib/issues
category: Codec
synopsis: zlib C library bits
description: This package provides the zlib C library bits that Haskell
bindings can use to link against.
build-type: Simple
extra-source-files: changelog.md
README.md

source-repository head
type: git
location: https://github.com/haskell/zlib.git

library
default-language: Haskell2010

include-dirs: cbits
includes: zlib.h

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

install-includes:
crc32.h
inffast.h
inflate.h
trees.h
deflate.h
inffixed.h
inftrees.h
zutil.h
gzguts.h
zlib.h
zconf.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions changelog.md → zlib/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
See also http://pvp.haskell.org/faq

0.7.1.0 Julian Ospald <hasufell@posteo> March 2024

* split zlib C sources into `zlib-clib` package

0.7.0.0 Bodigrim <andrew.lelechenko@gmail.com> February 2024

* Bump bundled `zlib` to 1.3.1.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 2 additions & 13 deletions zlib.cabal → zlib/zlib.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: >= 1.10
name: zlib
version: 0.7.0.0
version: 0.7.1.0

copyright: (c) 2006-2016 Duncan Coutts
license: BSD3
Expand Down Expand Up @@ -38,11 +38,6 @@ tested-with: GHC == 7.10.3

extra-source-files: changelog.md
README.md
-- zlib headers
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
cbits/zlib.h cbits/zconf.h
-- extra headers
cbits-extra/hs-zlib.h
-- test data files
Expand Down Expand Up @@ -106,13 +101,7 @@ library
cpp-options: -DNON_BLOCKING_FFI

if flag(bundled-c-zlib) || impl(ghcjs) || os(ghcjs) || arch(wasm32)
-- We bundle a complete copy of the C sources of zlib-1.3.1,
-- downloaded via update-c-sources.sh.
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
build-depends: zlib-clib
else
if flag(pkg-config)
-- NB: pkg-config is available on windows as well when using msys2
Expand Down

0 comments on commit c3809b5

Please sign in to comment.