2023-03-08 20:58:11 +03:00
|
|
|
|
distributable:
|
2023-10-02 03:41:57 +03:00
|
|
|
|
url: https://github.com/xiph/opus/archive/refs/tags/v{{ version.raw }}.tar.gz
|
|
|
|
|
strip-components: 1
|
2023-03-08 20:58:11 +03:00
|
|
|
|
|
|
|
|
|
# if there’s a github then we can parse the versions
|
|
|
|
|
versions:
|
2023-10-02 03:41:57 +03:00
|
|
|
|
github: xiph/opus/tags # reads github tags from github
|
2023-03-08 20:58:11 +03:00
|
|
|
|
strip: /^v/
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
dependencies:
|
|
|
|
|
gnu.org/autoconf: 2
|
|
|
|
|
gnu.org/automake: 1.16
|
|
|
|
|
gnu.org/libtool: 2.4
|
|
|
|
|
script: |
|
|
|
|
|
./autogen.sh
|
|
|
|
|
./configure $ARGS
|
2023-10-02 03:41:57 +03:00
|
|
|
|
make --jobs {{ hw.concurrency }}
|
2023-03-08 20:58:11 +03:00
|
|
|
|
make install
|
|
|
|
|
|
|
|
|
|
mv {{ prefix}}/include/opus/* {{prefix}}/include
|
|
|
|
|
rmdir {{ prefix}}/include/opus
|
|
|
|
|
ln -s . {{ prefix }}/include/opus
|
|
|
|
|
# it’s extremely common for packages to require the above
|
2023-10-02 03:41:57 +03:00
|
|
|
|
env:
|
2023-03-08 20:58:11 +03:00
|
|
|
|
ARGS:
|
|
|
|
|
- --prefix={{ prefix }}
|
|
|
|
|
- --disable-dependency-tracking
|
|
|
|
|
- --disable-doc
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
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;
|
|
|
|
|
}
|
2023-10-02 03:41:57 +03:00
|
|
|
|
script: |
|
2023-03-08 20:58:11 +03:00
|
|
|
|
mv $FIXTURE fixture.cpp
|
|
|
|
|
cc fixture.cpp -lopus
|
|
|
|
|
./a.out
|