diff --git a/projects/boost.org/package.yml b/projects/boost.org/package.yml new file mode 100644 index 00000000..788dd399 --- /dev/null +++ b/projects/boost.org/package.yml @@ -0,0 +1,25 @@ +distributable: + url: https://boostorg.jfrog.io/artifactory/main/release/{{ version }}/source/boost_{{version.major}}_{{version.minor}}_{{version.patch}}.tar.gz + strip-components: 1 + +versions: + github: boostorg/boost + strip: /^boost-/ + +dependencies: + facebook.com/zstd: ^1 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: | + ./bootstrap.sh --prefix={{ prefix }} + ./b2 install --prefix={{ prefix }} + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + c++ test.cpp -std=c++14 -lboost_iostreams -lzstd + ./a.out diff --git a/projects/boost.org/test.cpp b/projects/boost.org/test.cpp new file mode 100644 index 00000000..456c40e1 --- /dev/null +++ b/projects/boost.org/test.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::algorithm; +using namespace boost::iostreams; +using namespace std; + +int main() { + string str("a,b"); + vector strVec; + split(strVec, str, is_any_of(",")); + assert(strVec.size()==2); + assert(strVec[0]=="a"); + assert(strVec[1]=="b"); + // Test boost::iostreams::zstd_compressor() linking + std::vector v; + back_insert_device> snk{v}; + filtering_ostream os; + os.push(zstd_compressor()); + os.push(snk); + os << "Boost" << std::flush; + os.pop(); + array_source src{v.data(), v.size()}; + filtering_istream is; + is.push(zstd_decompressor()); + is.push(src); + std::string s; + is >> s; + assert(s == "Boost"); + return 0; +} diff --git a/projects/facebook.com/zstd/package.yml b/projects/facebook.com/zstd/package.yml new file mode 100644 index 00000000..03f3e2b9 --- /dev/null +++ b/projects/facebook.com/zstd/package.yml @@ -0,0 +1,48 @@ +distributable: + url: https://github.com/facebook/zstd/archive/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: facebook/zstd/releases/tags + +dependencies: + lz4.org: ^1 + tukaani.org/xz: ^5 + zlib.net: ^1 + +provides: + - bin/pzstd + - bin/unzstd + - bin/zstd + - bin/zstdcat + - bin/zstdgrep + - bin/zstdless + - bin/zstdmt + +build: + dependencies: + tea.xyz/gx/cc: c99 + cmake.org: ^3 + ninja-build.org: ^1 + working-directory: build/out + script: | + cmake ../cmake $ARGS + cmake --build . + cmake --install . + env: + ARGS: + - -GNinja + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX="{{prefix}}" + - -DZSTD_PROGRAMS_LINK_SHARED=ON # link `zstd` to `libzstd` + - -DZSTD_BUILD_CONTRIB=ON + - -DZSTD_LEGACY_SUPPORT=ON + - -DZSTD_ZLIB_SUPPORT=ON + - -DZSTD_LZMA_SUPPORT=ON + - -DZSTD_LZ4_SUPPORT=ON + +test: | + export fixture="asdf123%!*" + for x in zstd pzstd xz lz4 gzip; do + test $(echo "$fixture" | $x | zstd -d) = "$fixture" + done diff --git a/projects/lz4.org/package.yml b/projects/lz4.org/package.yml new file mode 100644 index 00000000..290b6984 --- /dev/null +++ b/projects/lz4.org/package.yml @@ -0,0 +1,24 @@ +distributable: + url: https://github.com/lz4/lz4/archive/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: lz4/lz4 + strip: /^LZ4 / + +provides: + - bin/lz4 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: + make --jobs {{hw.concurrency}} install PREFIX="{{prefix}}" + +test: + fixture: + testing compression and decompression + script: | + cat $FIXTURE | lz4 | lz4 -d > out + test "$(cat $FIXTURE)" = "$(cat out)"