From 939e4b36ac9a92cea1d059a9f05f70ef88224b6a Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Mon, 1 May 2023 20:17:21 +0300 Subject: [PATCH] dkrz.de/libaec (#1776) * new file: projects/dkrz.de/libaec/fixture.cpp new file: projects/dkrz.de/libaec/package.yml * shouldn't need `-L` --------- Co-authored-by: Jacob Heider --- projects/dkrz.de/libaec/fixture.cpp | 25 +++++++++++++++++++++++++ projects/dkrz.de/libaec/package.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 projects/dkrz.de/libaec/fixture.cpp create mode 100644 projects/dkrz.de/libaec/package.yml diff --git a/projects/dkrz.de/libaec/fixture.cpp b/projects/dkrz.de/libaec/fixture.cpp new file mode 100644 index 00000000..11741a5e --- /dev/null +++ b/projects/dkrz.de/libaec/fixture.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include +int main() { + unsigned char * data = (unsigned char *) calloc(1024, sizeof(unsigned char)); + unsigned char * compressed = (unsigned char *) calloc(1024, sizeof(unsigned char)); + for(int i = 0; i < 1024; i++) { data[i] = (unsigned char)(i); } + struct aec_stream strm; + strm.bits_per_sample = 16; + strm.block_size = 64; + strm.rsi = 129; + strm.flags = AEC_DATA_PREPROCESS | AEC_DATA_MSB; + strm.next_in = data; + strm.avail_in = 1024; + strm.next_out = compressed; + strm.avail_out = 1024; + assert(aec_encode_init(&strm) == 0); + assert(aec_encode(&strm, AEC_FLUSH) == 0); + assert(strm.total_out > 0); + assert(aec_encode_end(&strm) == 0); + free(data); + free(compressed); + return 0; +} \ No newline at end of file diff --git a/projects/dkrz.de/libaec/package.yml b/projects/dkrz.de/libaec/package.yml new file mode 100644 index 00000000..a6a89ee0 --- /dev/null +++ b/projects/dkrz.de/libaec/package.yml @@ -0,0 +1,27 @@ +distributable: + url: https://github.com/MathisRosenhauer/libaec/releases/download/v{{version}}/libaec-{{version}}.tar.gz + strip-components: 1 + +versions: + github: MathisRosenhauer/libaec + strip: /^v/ + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: | + ./configure $ARGS + make --jobs {{ hw.concurrency }} install + env: + ARGS: + - --prefix="{{prefix}}" + +provides: + - bin/aec + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + cc -o testlibaec fixture.cpp -laec