Fix broken SF3 support for Android binaries (#890)

Libsndfile was unintentionally compiled without OGG/Vorbis support. That's because libopus was missing. When compiling libsndfile with autotools [you get a nice warning](9349a566e2/configure.ac (L381-L386)). When using CMake you don't...

Solution: Compile libopus before compiling libsndfile. Now it reports

```
-- The following features have been enabled:

 * ENABLE_EXTERNAL_LIBS, enable FLAC, Vorbis, and Opus codecs
```
This commit is contained in:
Tom M 2021-05-12 17:43:35 +02:00 committed by GitHub
parent 8446023255
commit cd393d863a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -43,6 +43,7 @@ variables:
INSTPATCH_VERSION: '1.1.6'
VORBIS_VERSION: '1.3.7'
OGG_VERSION: '1.3.4'
OPUS_VERSION: '1.3.1'
# flac 1.3.3 is completely broken: pkgconfig is incorrectly installed, compilation failure, etc.; use recent master instead
FLAC_VERSION: '27c615706cedd252a206dd77e3910dfa395dcc49'
@ -158,12 +159,15 @@ jobs:
wget -O flac-${FLAC_VERSION}.tar.gz https://github.com/xiph/flac/archive/${FLAC_VERSION}.tar.gz
tar xf flac-${FLAC_VERSION}.tar.gz
wget -O opus-${OPUS_VERSION}.tar.gz https://github.com/xiph/opus/archive/refs/tags/v${OPUS_VERSION}.tar.gz
tar xf opus-${OPUS_VERSION}.tar.gz
displayName: 'Download Dependencies'
workingDirectory: $(DEV)
- task: Cache@2
inputs:
key: '$(ARCH) | $(DEV)/*.tar.gz | cacheVersion1'
key: '$(ARCH) | $(DEV)/*.tar.gz | cacheVersion2'
path: '$(PREFIX)'
cacheHitVar: 'CACHE_RESTORED'
displayName: 'Cache fluidsynth dependency libraries'
@ -495,6 +499,21 @@ jobs:
condition: always()
workingDirectory: $(DEV)
# another broken xiph project that doesn't specify the C standard and keeps complaining of you don't have C99
- template: cmake-android.yml
parameters:
sourceDir: 'opus-$(OPUS_VERSION)'
cmakeArgs: '-DBUILD_PROGRAMS=0 -DOPUS_MAY_HAVE_NEON=1 -DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1'
- script: |
ls -la opus-${OPUS_VERSION}/build/CMakeFiles/
cat opus-${OPUS_VERSION}/build/CMakeFiles/CMakeError.log
cat opus-${OPUS_VERSION}/build/CMakeFiles/CMakeOutput.log
true
displayName: 'Print OPUS Cmake Error Log'
condition: always()
workingDirectory: $(DEV)
- template: cmake-android.yml
parameters:
sourceDir: 'libsndfile-$(SNDFILE_VERSION)'
@ -606,6 +625,7 @@ jobs:
ls libintl.so
ls liboboe.so
ls libogg.so
ls libopus.so
ls libsndfile.so
ls libvorbis.so
ls libvorbisenc.so

View file

@ -33,6 +33,7 @@ steps:
cmake -G "Unix Makefiles" \
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DANDROID_NATIVE_API_LEVEL=${ANDROID_API} \
-DANDROID_ABI=${ANDROID_ABI_CMAKE} \
-DANDROID_TOOLCHAIN=${CC} \