Add chromaprint

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
nyanmisaka 2022-11-03 23:35:13 +08:00 committed by BtbN
parent fd4fac0ec7
commit c03ab7a812
2 changed files with 34 additions and 2 deletions

View file

@ -4,8 +4,6 @@ SCRIPT_REPO="https://github.com/FFTW/fftw3.git"
SCRIPT_COMMIT="9426cd59106ffddde1f55131c07fa9c562fa2f8e"
ffbuild_enabled() {
# Dependency of GPL-Only librubberband
[[ $VARIANT == lgpl* ]] && return -1
return 0
}

34
scripts.d/50-chromaprint.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
SCRIPT_REPO="https://github.com/acoustid/chromaprint.git"
SCRIPT_COMMIT="41e23c212594ee22d30a9d64b3438efae7ab6148"
ffbuild_enabled() {
# pkg-config check is currently only available in master
[[ $ADDINS_STR == *4.4* ]] && return -1
[[ $ADDINS_STR == *5.0* ]] && return -1
[[ $ADDINS_STR == *5.1* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" chromaprint
cd chromaprint
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DBUILD_SHARED_LIBS=OFF -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF -DFFT_LIB=fftw3 ..
make -j$(nproc)
make install
echo "Libs.private: -lfftw3 -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libchromaprint.pc
echo "Cflags.private: -DCHROMAPRINT_NODLL" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libchromaprint.pc
}
ffbuild_configure() {
echo --enable-chromaprint
}
ffbuild_unconfigure() {
echo --disable-chromaprint
}