Skip to content
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

Split packages into zlib/zlib-clib #67

Merged
merged 4 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 34 additions & 51 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'zlib.cabal'
# haskell-ci 'github' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/andreasabel/haskell-ci
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.18.1.20240316
# version: 0.19.20240420
#
# REGENDATA ("0.18.1.20240316",["github","zlib.cabal"])
# REGENDATA ("0.19.20240420",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,24 +23,24 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:focal
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.10.0.20240313
- compiler: ghc-9.10.0.20240413
compilerKind: ghc
compilerVersion: 9.10.0.20240313
compilerVersion: 9.10.0.20240413
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.4
- compiler: ghc-9.6.5
compilerKind: ghc
compilerVersion: 9.6.4
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand Down Expand Up @@ -88,36 +88,20 @@ jobs:
compilerVersion: 8.0.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.1 || (cat "$HOME"/.ghcup/logs/*.* && false)
apt-get update
apt-get install -y zlib1g-dev
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME" zlib1g-dev
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.1 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
apt-get update
apt-get install -y zlib1g-dev
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -129,22 +113,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.1 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.1 -vnormal+nowrap" >> "$GITHUB_ENV"
fi

HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -219,7 +194,8 @@ jobs:
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./zlib" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./zlib-clib" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -233,18 +209,23 @@ jobs:
run: |
PKGDIR_zlib="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/zlib-[0-9.]*')"
echo "PKGDIR_zlib=${PKGDIR_zlib}" >> "$GITHUB_ENV"
PKGDIR_zlib_clib="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/zlib-clib-[0-9.]*')"
echo "PKGDIR_zlib_clib=${PKGDIR_zlib_clib}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_zlib}" >> cabal.project
echo "packages: ${PKGDIR_zlib_clib}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package zlib" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package zlib-clib" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(zlib)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(zlib|zlib-clib)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -274,6 +255,8 @@ jobs:
run: |
cd ${PKGDIR_zlib} || false
${CABAL} -vnormal check
cd ${PKGDIR_zlib_clib} || false
${CABAL} -vnormal check
- name: haddock
run: |
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
Expand Down
35 changes: 18 additions & 17 deletions .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: [windows-latest, macOS-latest]
ghc: ['7.10', '8.0', '8.2', '8.4', '9.2', 'latest']
ghc: ['8.0', '8.2', '8.4', '9.2', 'latest']
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
Expand All @@ -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,10 +109,11 @@ 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: |
cd zlib
wasmtime.sh $(wasm32-wasi-cabal list-bin test:tests)

i386:
Expand All @@ -130,4 +131,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

66 changes: 66 additions & 0 deletions zlib-clib/zlib-clib.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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

tested-with: GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.4
, GHC == 8.10.7
, GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.8
, GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1

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.
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.
Loading