pantry/projects/opus-codec.org/package.yml
2023-03-08 13:29:27 -05:00

62 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

distributable:
url: https://github.com/xiph/opus/archive/refs/tags/v{{ version }}.tar.gz
strip-components: 1
# if theres a github then we can parse the versions
versions:
github: xiph/opus/tags # reads github tags from github
strip: /^v/
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
gnu.org/autoconf: 2
gnu.org/automake: 1.16
gnu.org/libtool: 2.4
script: |
./autogen.sh
./configure $ARGS
make --jobs {{ hw.concurrency }}
make install
mv {{ prefix}}/include/opus/* {{prefix}}/include
rmdir {{ prefix}}/include/opus
ln -s . {{ prefix }}/include/opus
# its extremely common for packages to require the above
env:
ARGS:
- --prefix={{ prefix }}
- --disable-dependency-tracking
- --disable-doc
test:
dependencies:
tea.xyz/gx/cc: c99
fixture: |
#include <opus.h>
int main(int argc, char **argv)
{
int err = 0;
opus_int32 rate = 48000;
int channels = 2;
int app = OPUS_APPLICATION_AUDIO;
OpusEncoder *enc;
int ret;
enc = opus_encoder_create(rate, channels, app, &err);
if (!(err < 0))
{
err = opus_encoder_ctl(enc, OPUS_SET_BITRATE(OPUS_AUTO));
if (!(err < 0))
{
opus_encoder_destroy(enc);
return 0;
}
}
return err;
}
script: |
mv $FIXTURE fixture.cpp
cc fixture.cpp -lopus
./a.out