Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Fix build of boost::iostreams zlib filter #115

Merged
merged 9 commits into from
Feb 6, 2022
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
4 changes: 4 additions & 0 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ pin_run_as_build:
max_pin: x
xz:
max_pin: x.x
zlib:
max_pin: x.x
target_platform:
- linux-64
xz:
- '5.2'
zlib:
- '1.2'
zstd:
- '1.5'
4 changes: 4 additions & 0 deletions .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ pin_run_as_build:
max_pin: x
xz:
max_pin: x.x
zlib:
max_pin: x.x
target_platform:
- linux-aarch64
xz:
- '5.2'
zlib:
- '1.2'
zstd:
- '1.5'
4 changes: 4 additions & 0 deletions .ci_support/linux_ppc64le_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ pin_run_as_build:
max_pin: x
xz:
max_pin: x.x
zlib:
max_pin: x.x
target_platform:
- linux-ppc64le
xz:
- '5.2'
zlib:
- '1.2'
zstd:
- '1.5'
7 changes: 0 additions & 7 deletions .ci_support/migrations/icu69.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ pin_run_as_build:
max_pin: x
xz:
max_pin: x.x
zlib:
max_pin: x.x
target_platform:
- osx-64
xz:
- '5.2'
zlib:
- '1.2'
zstd:
- '1.5'
4 changes: 4 additions & 0 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ pin_run_as_build:
max_pin: x
xz:
max_pin: x.x
zlib:
max_pin: x.x
target_platform:
- osx-arm64
xz:
- '5.2'
zlib:
- '1.2'
zstd:
- '1.5'
4 changes: 4 additions & 0 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ cxx_compiler:
pin_run_as_build:
bzip2:
max_pin: x
zlib:
max_pin: x.x
target_platform:
- win-64
zlib:
- '1.2'
zstd:
- '1.5'
7 changes: 6 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source:
- e193f080c7d209516ac9b712fa0c50bb08026fa2.patch

build:
number: 6
number: 7

requirements:
build:
Expand All @@ -24,6 +24,7 @@ requirements:
- icu # [unix]
- xz # [unix]
- bzip2
- zlib
- zstd

run:
Expand All @@ -36,6 +37,10 @@ requirements:
- libboost <0

test:
files:
- test
requires:
- {{ compiler('cxx') }} # [build_platform == target_platform]
commands:
# Verify Python headers are removed.
- "! test -f $PREFIX/include/boost/python.hpp" # [unix]
Expand Down
4 changes: 4 additions & 0 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:: Test boost::iostreams zlib filter support
cd test
cl.exe /EHsc /MD /DBOOST_ALL_DYN_LINK /DBOOST_ZLIB_BINARY=kernel32 /I%PREFIX%\Library\include test_iostreams_zlib.cpp /link /libpath:%PREFIX%\Library\lib
if errorlevel 1 exit 1
8 changes: 8 additions & 0 deletions recipe/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Skip compile tests if we are cross-compiling
if [[ "${build_platform}" != "${target_platform}" ]]; then
exit 0
fi

# Test boost::iostreams zlib filter support
cd test
${CXX} -I$PREFIX/include -L$PREFIX/lib test_iostreams_zlib.cpp -lboost_iostreams
19 changes: 19 additions & 0 deletions recipe/test/test_iostreams_zlib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Ensure that boost::iostreams includes the zlib filter support

#include <fstream>
#include <iostream>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/zlib.hpp>

int main()
{
using namespace std;

ifstream file("hello.z", ios_base::in | ios_base::binary);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
in.push(boost::iostreams::zlib_decompressor());
in.push(file);
boost::iostreams::copy(in, cout);
return 0;
}