From 79875fe7645d9d92b21c2eadc539ac9a50d7422e Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 17 Feb 2022 01:45:22 -0800 Subject: [PATCH] Cross-compile support and various other build cleanups. --- .cmake/ConfigureCompilerFlags.cmake | 4 +- .cmake/RaspberryPiToolchain.cmake | 15 +++ CMakeLists.txt | 8 ++ script/archive-standalone-nix.sh | 41 ++++++-- script/build-vendor-libraries.sh | 113 +++++++++++++++++------ script/stage-vendor-libraries.sh | 34 +++---- src/plugins/taglib_plugin/CMakeLists.txt | 11 ++- 7 files changed, 165 insertions(+), 61 deletions(-) create mode 100644 .cmake/RaspberryPiToolchain.cmake diff --git a/.cmake/ConfigureCompilerFlags.cmake b/.cmake/ConfigureCompilerFlags.cmake index e8ccfaeab..97c51f652 100644 --- a/.cmake/ConfigureCompilerFlags.cmake +++ b/.cmake/ConfigureCompilerFlags.cmake @@ -4,7 +4,7 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") # enable for additional memory checking with fsanitize # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -fsanitize=address,undefined") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -frtti -fexceptions") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -frtti -fexceptions -Wno-psabi") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -Wno-psabi") add_definitions(-DHAVE_BOOST -D_FILE_OFFSET_BITS=64 -DSIGSLOT_USE_POSIX_THREADS) \ No newline at end of file diff --git a/.cmake/RaspberryPiToolchain.cmake b/.cmake/RaspberryPiToolchain.cmake new file mode 100644 index 000000000..d8a5ca3d4 --- /dev/null +++ b/.cmake/RaspberryPiToolchain.cmake @@ -0,0 +1,15 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR arm) + +set(CROSS_COMPILE_SYSROOT /build/rpi/sysroot) + +set(CMAKE_SYSROOT ${CROSS_COMPILE_SYSROOT}) +set(CMAKE_STAGING_PREFIX /build/rpi/staging) + +set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bce3aee5..a65204eeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,14 @@ include(ConfigureTaglib) include(ConfigureCompilerFlags) include(FindVendorLibrary) +if (CROSS_COMPILE_SYSROOT) + message(STATUS "[cross-compile] enabled, rooted at: ${CROSS_COMPILE_SYSROOT}") + set(CMAKE_FIND_ROOT_PATH /build/rpi/sysroot /build/musikcube/vendor) + set(ENV{PKG_CONFIG_PATH} /build/rpi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig) +else() + message(STATUS "[cross-compile] not enabled!") +endif() + message(STATUS "[vendor-link-directories] ${VENDOR_LINK_DIRECTORIES}") message(STATUS "[vendor-include-directories] ${VENDOR_INCLUDE_DIRECTORIES}") message(STATUS "[os-system-libs] ${DEFAULT_OS_SYSTEM_LIBS}") diff --git a/script/archive-standalone-nix.sh b/script/archive-standalone-nix.sh index 5e901af14..d3c05cd84 100755 --- a/script/archive-standalone-nix.sh +++ b/script/archive-standalone-nix.sh @@ -4,7 +4,7 @@ VERSION=$1 -if [ -z "$VERSION" ]; then +if [[ -z "$VERSION" ]]; then echo "usage: archive-nix.sh " exit fi @@ -12,30 +12,53 @@ fi OS=$(uname) JOBS="-j8" + FRIENDLY_OS_NAME="linux" -if [ $OS == "Darwin" ]; then +if [[ $OS == "Darwin" ]]; then FRIENDLY_OS_NAME="macos" JOBS="-j$(sysctl -n hw.ncpu)" fi ARCH=$(uname -m) +DEB_ARCH=$ARCH +if [[ -n $CROSSCOMPILE ]]; then + ARCH=$CROSSCOMPILE + DEB_ARCH="armhf" +elif [[ $ARCH == "x86_64" ]]; then + DEB_ARCH="amd64" +fi + OS_ARCH="${FRIENDLY_OS_NAME}_${ARCH}" OUTNAME="musikcube_standalone_${OS_ARCH}_$VERSION" OUTDIR="dist/$VERSION/$OUTNAME" SCRIPTDIR=`dirname "$0"` +CMAKE_TOOLCHAIN="" DLL_EXT="so" -if [ $OS == "Darwin" ]; then +if [[ $OS == "Darwin" ]]; then DLL_EXT="dylib" fi OS_SPECIFIC_BUILD_FLAGS="" -if [ $OS == "Linux" ]; then - OS_SPECIFIC_BUILD_FLAGS="-DENABLE_PIPEWIRE=true -DGENERATE_DEB=true -DDEB_ARCHITECTURE=amd64 -DCMAKE_INSTALL_PREFIX=/usr" +if [[ $OS == "Linux" ]]; then + OS_SPECIFIC_BUILD_FLAGS="-DGENERATE_DEB=true -DDEB_ARCHITECTURE=${DEB_ARCH} -DCMAKE_INSTALL_PREFIX=/usr" + if [[ -z $CROSSCOMPILE ]]; then + # for now we don't support pipewire when cross compiling... + OS_SPECIFIC_BUILD_FLAGS="$OS_SPECIFIC_BUILD_FLAGS -DENABLE_PIPEWIRE=true" + fi fi +if [[ $CROSSCOMPILE == "rpi" ]]; then + CMAKE_TOOLCHAIN="-DCMAKE_TOOLCHAIN_FILE=.cmake/RaspberryPiToolchain.cmake" +fi + +rm vendor +ln -s ../vendor-$ARCH/ ./vendor +printf "\nsetup symlink:\n" +ls -ald vendor + printf "\n" -read -p ' clean and rebuild [y]? ' CLEAN +read -p 'clean and rebuild [y]? ' CLEAN if [[ $CLEAN == 'n' || $CLEAN == 'N' ]]; then printf "\n\n\n ***** SKIPPING REBUILD *****\n\n\n" ./script/stage-vendor-libraries.sh || exit $? @@ -46,11 +69,11 @@ else ${SCRIPTDIR}/clean-nix.sh rm -rf bin/ 2> /dev/null ./script/stage-vendor-libraries.sh || exit $? - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STANDALONE=true ${OS_SPECIFIC_BUILD_FLAGS} . || exit $? + cmake ${CMAKE_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DBUILD_STANDALONE=true ${OS_SPECIFIC_BUILD_FLAGS} . || exit $? make ${JOBS} || exit $? fi -rm -rf dist/$VERSION 2> /dev/null +rm -rf dist/$VERSION/*${OS_ARCH}_$VERSION* 2> /dev/null mkdir -p $OUTDIR/lib mkdir -p $OUTDIR/plugins @@ -79,7 +102,7 @@ tar cvf $OUTNAME.tar $OUTNAME bzip2 $OUTNAME.tar cd ../../ -if [ $OS == "Linux" ]; then +if [[ $OS == "Linux" ]]; then cpack mv *.deb dist/$VERSION/ mv *.rpm dist/$VERSION/ diff --git a/script/build-vendor-libraries.sh b/script/build-vendor-libraries.sh index e9473e0d4..9ce2110a8 100755 --- a/script/build-vendor-libraries.sh +++ b/script/build-vendor-libraries.sh @@ -1,5 +1,18 @@ #!/bin/bash +# this script is used to download and build all non-system-provided dependencies +# used by musikcube. they are configured with only the features that are strictly +# necessary for the app to function, and processed in stage in such a way that they +# have no external dependencies except for each other, libc, libc++ and libz. +# +# this script can also be configured to cross-compile the aforementioned dependencies +# for use with raspberry pi; simply set the CROSSCOMPILE=rpi to do so. +# +# the script will create a "vendor" subdirectory in the current path, and stage +# all final files in "vendor/lib". +# +# dependencies: boost, openssl, curl, libmicrohttpd, ffmpeg, lame, libopenmpt + # set -x # @@ -21,15 +34,38 @@ LIBMICROHTTPD_VERSION="0.9.75" FFMPEG_VERSION="5.0" LAME_VERSION="3.100" LIBOPENMPT_VERSION="0.6.1" - OUTDIR="$(pwd)/vendor/bin" LIBDIR="$OUTDIR/lib" JOBS="-j8" -if [ $OS == "Darwin" ]; then +if [[ $OS == "Darwin" ]]; then JOBS="-j$(sysctl -n hw.ncpu)" fi +OPENSSL_TYPE="linux-${ARCH}" +if [[ $OS == "Darwin" ]]; then + OPENSSL_TYPE="darwin64-${ARCH}-cc" +fi + +# update cross-compile vars, if specified. +if [[ $CROSSCOMPILE == "rpi" ]]; then + ARM_ROOT="/build/rpi/sysroot" + export CPPFLAGS="-I${ARM_ROOT}/usr/include" + export CXXFLAGS="$CXXFLAGS -I${ARM_ROOT}/usr/include" + export LDFLAGS="$LDFLAGS --sysroot=${ARM_ROOT} -L${ARM_ROOT}/lib/arm-linux-gnueabihf/" + OPENSSL_TYPE="linux-generic32" + OPENSSL_CROSSCOMPILE_PREFIX="--cross-compile-prefix=arm-linux-gnueabihf-" + GENERIC_CONFIGURE_FLAGS="--build=x86_64-pc-linux-gnu --host=arm-linux-gnueabihf --with-sysroot=${ARM_ROOT}" + FFMPEG_CONFIGURE_FLAGS="--arch=${ARCH} --target-os=linux --cross-prefix=arm-linux-gnueabihf-" + BOOST_TOOLSET="toolset=gcc-arm" + PKG_CONFIG_PATH="${OUTDIR}:${ARM_ROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig/" + printf "\n\ndetected CROSSCOMPILE=${CROSSCOMPILE}\n" + printf " CFLAGS=${CFLAGS}\n CXXFLAGS=${CXXFLAGS}\n LDFLAGS=${LDFLAGS}\n GENERIC_CONFIGURE_FLAGS=${GENERIC_CONFIGURE_FLAGS}\n" + printf " BOOST_TOOLSET=${BOOST_TOOLSET}\n OPENSSL_TYPE=${OPENSSL_TYPE}\n OPENSSL_CROSSCOMPILE_PREFIX=${OPENSSL_CROSSCOMPILE_PREFIX}\n" + printf " FFMPEG_CONFIGURE_FLAGS=${FFMPEG_CONFIGURE_FLAGS}\n PKG_CONFIG_PATH=${PKG_CONFIG_PATH}\n\n" + sleep 3 +fi + function clean() { rm -rf vendor mkdir vendor @@ -39,14 +75,28 @@ function clean() { # download deps # +function copy_or_download { + url_path=$1 + fn=$2 + wget_cache="/tmp/musikcube_build_wget_cache" + mkdir -p wget_cache 2> /dev/null + if [[ -f "$wget_cache/$fn" ]]; then + cp "$wget_cache/$fn" . + else + wget -P $wget_cache "$url_path/$fn" || exit $? + cp "$wget_cache/$fn" . || exit $? + fi +} + function fetch_packages() { - wget https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION_URL_PATH}/source/boost_${BOOST_VERSION}.tar.bz2 - wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz - wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz - wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${LIBMICROHTTPD_VERSION}.tar.gz - wget https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 - wget https://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz - wget https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${LIBOPENMPT_VERSION}+release.autotools.tar.gz + # no trailing slash on url dirs! + copy_or_download https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION_URL_PATH}/source boost_${BOOST_VERSION}.tar.bz2 + copy_or_download https://www.openssl.org/source openssl-${OPENSSL_VERSION}.tar.gz + copy_or_download https://curl.se/download curl-${CURL_VERSION}.tar.gz + copy_or_download https://ftp.gnu.org/gnu/libmicrohttpd libmicrohttpd-${LIBMICROHTTPD_VERSION}.tar.gz + copy_or_download https://ffmpeg.org/releases ffmpeg-${FFMPEG_VERSION}.tar.bz2 + copy_or_download https://downloads.sourceforge.net/project/lame/lame/3.100 lame-${LAME_VERSION}.tar.gz + copy_or_download https://lib.openmpt.org/files/libopenmpt/src libopenmpt-${LIBOPENMPT_VERSION}+release.autotools.tar.gz } # @@ -55,15 +105,24 @@ function fetch_packages() { function build_boost() { BOOST_CXX_FLAGS="-fPIC" - if [ $OS == "Darwin" ]; then + if [[ $OS == "Darwin" ]]; then BOOST_CXX_FLAGS="-fPIC -std=c++14 -stdlib=libc++" fi tar xvfj boost_${BOOST_VERSION}.tar.bz2 cd boost_${BOOST_VERSION} - ./bootstrap.sh --with-libraries=atomic,chrono,date_time,filesystem,system,thread - ./b2 headers - ./b2 -d ${JOBS} -sNO_LZMA=1 -sNO_ZSTD=1 threading=multi link=shared cxxflags=${BOOST_CXX_FLAGS} --prefix=${OUTDIR} install || exit $? + + if [[ $CROSSCOMPILE == "rpi" ]]; then + printf "creating ~/user-config.jam with arm compiler\n" + echo "using gcc : arm : arm-linux-gnueabihf-g++ ;" > ~/user-config.jam + else + printf "removing ~/user-config.jam\n" + rm ~/user-config.jam 2> /dev/null + fi + + ./bootstrap.sh --with-libraries=atomic,chrono,date_time,filesystem,system,thread || exit $? + ./b2 headers || exit $? + ./b2 -d ${JOBS} -sNO_LZMA=1 -sNO_ZSTD=1 ${BOOST_TOOLSET} threading=multi link=shared cxxflags="${BOOST_CXX_FLAGS}" --prefix=${OUTDIR} install || exit $? cd .. } @@ -72,16 +131,11 @@ function build_boost() { # function build_openssl() { - OPENSSL_TYPE="linux-${ARCH}" - if [ $OS == "Darwin" ]; then - OPENSSL_TYPE="darwin64-${ARCH}-cc" - fi - tar xvfz openssl-${OPENSSL_VERSION}.tar.gz cd openssl-${OPENSSL_VERSION} - perl ./Configure --prefix=${OUTDIR} no-ssl3 no-ssl3-method no-zlib ${OPENSSL_TYPE} + perl ./Configure --prefix=${OUTDIR} no-ssl3 no-ssl3-method no-zlib ${OPENSSL_TYPE} ${OPENSSL_CROSSCOMPILE_PREFIX} || exit $? make - make install + make install_sw cd .. } @@ -122,7 +176,8 @@ function build_curl() { --without-brotli \ --without-libidn2 \ --without-nghttp2 \ - --prefix=${OUTDIR} + ${GENERIC_CONFIGURE_FLAGS} \ + --prefix=${OUTDIR} || exit $? make ${JOBS} || exit $? make install cd .. @@ -136,7 +191,7 @@ function build_libmicrohttpd() { rm -rf libmicrohttpd-${LIBMICROHTTPD_VERSION} tar xvfz libmicrohttpd-${LIBMICROHTTPD_VERSION}.tar.gz cd libmicrohttpd-${LIBMICROHTTPD_VERSION} - ./configure --enable-shared --with-pic --enable-https=no --disable-curl --prefix=${OUTDIR} + ./configure --enable-shared --with-pic --enable-https=no --disable-curl --prefix=${OUTDIR} ${GENERIC_CONFIGURE_FLAGS} make -j8 || exit $? make install cd .. @@ -147,11 +202,13 @@ function build_libmicrohttpd() { # function build_ffmpeg() { + # fix for cross-compile: https://github.com/NixOS/nixpkgs/pull/76915/files rm -rf ffmpeg-${FFMPEG_VERSION} tar xvfj ffmpeg-${FFMPEG_VERSION}.tar.bz2 cd ffmpeg-${FFMPEG_VERSION} ./configure \ --prefix=${OUTDIR} \ + --pkg-config="pkg-config" \ --enable-rpath \ --disable-asm \ --enable-pic \ @@ -323,7 +380,8 @@ function build_ffmpeg() { --enable-encoder=wmav1 \ --enable-encoder=wmav2 \ --enable-encoder=libvorbis \ - --build-suffix=-musikcube + ${FFMPEG_CONFIGURE_FLAGS} \ + --build-suffix=-musikcube || exit $? make ${JOBS} || exit $? make install cd .. @@ -339,7 +397,7 @@ function build_lame() { cd lame-${LAME_VERSION} # https://sourceforge.net/p/lame/mailman/message/36081038/ perl -i.bak -0pe "s|lame_init_old\n||" include/libmp3lame.sym - ./configure --disable-dependency-tracking --disable-debug --enable-nasm --prefix=${OUTDIR} + ./configure --disable-dependency-tracking --disable-debug --enable-nasm --prefix=${OUTDIR} ${GENERIC_CONFIGURE_FLAGS} || exit $? make ${JOBS} || exit $? make install cd .. @@ -369,7 +427,8 @@ function build_libopenmpt() { --without-portaudiocpp \ --without-sndfile \ --without-flac \ - --prefix=${OUTDIR} + ${GENERIC_CONFIGURE_FLAGS} \ + --prefix=${OUTDIR} || exit $? make ${JOBS} || exit $? make install cd .. @@ -380,7 +439,7 @@ function build_libopenmpt() { # function stage_opus_ogg_vorbis() { - if [ $OS == "Darwin" ]; then + if [[ $OS == "Darwin" ]]; then # instead of building opus, ogg and vorbis from source we snag them # from brew, update their dylib ids with @rpath, re-sign them, then create # new pkg-config files to point towards this directory. that way ffmpeg @@ -446,7 +505,7 @@ function stage_opus_ogg_vorbis() { } function patch_dylib_rpaths() { - if [ $OS == "Darwin" ]; then + if [[ $OS == "Darwin" ]]; then cd bin/lib install_name_tool -id "$RPATH/libavutil-musikcube.57.dylib" libavutil-musikcube.57.dylib diff --git a/script/stage-vendor-libraries.sh b/script/stage-vendor-libraries.sh index 9ebc4ff3c..642cf4dbf 100755 --- a/script/stage-vendor-libraries.sh +++ b/script/stage-vendor-libraries.sh @@ -17,26 +17,20 @@ if [[ "$PLATFORM" == 'Darwin' ]]; then cp vendor/bin/lib/libavformat-musikcube.59.dylib ./bin/lib cp vendor/bin/lib/libavutil-musikcube.57.dylib ./bin/lib cp vendor/bin/lib/libswresample-musikcube.4.dylib ./bin/lib - cp vendor/bin/lib/libopus.0.dylib ./bin/lib cp vendor/bin/lib/libogg.0.dylib ./bin/lib cp vendor/bin/lib/libvorbis.0.dylib ./bin/lib cp vendor/bin/lib/libvorbisenc.2.dylib ./bin/lib - cp vendor/bin/lib/libboost_atomic.dylib ./bin/lib cp vendor/bin/lib/libboost_chrono.dylib ./bin/lib cp vendor/bin/lib/libboost_date_time.dylib ./bin/lib cp vendor/bin/lib/libboost_filesystem.dylib ./bin/lib cp vendor/bin/lib/libboost_system.dylib ./bin/lib cp vendor/bin/lib/libboost_thread.dylib ./bin/lib - cp vendor/bin/lib/libcrypto.1.1.dylib ./bin/lib cp vendor/bin/lib/libssl.1.1.dylib ./bin/lib - cp vendor/bin/lib/libcurl.4.dylib ./bin/lib - cp vendor/bin/lib/libmicrohttpd.12.dylib ./bin/lib - cp vendor/bin/lib/libmp3lame.0.dylib ./bin/lib mkdir -p ./bin/share/terminfo @@ -49,34 +43,34 @@ elif [[ "$PLATFORM" == 'Linux' ]]; then cp vendor/bin/lib/libavformat-musikcube.so.59 ./bin/lib cp vendor/bin/lib/libavutil-musikcube.so.57 ./bin/lib cp vendor/bin/lib/libswresample-musikcube.so.4 ./bin/lib - cp vendor/bin/lib/libboost_atomic.so.1.76.0 ./bin/lib cp vendor/bin/lib/libboost_chrono.so.1.76.0 ./bin/lib cp vendor/bin/lib/libboost_date_time.so.1.76.0 ./bin/lib cp vendor/bin/lib/libboost_filesystem.so.1.76.0 ./bin/lib cp vendor/bin/lib/libboost_system.so.1.76.0 ./bin/lib cp vendor/bin/lib/libboost_thread.so.1.76.0 ./bin/lib - cp vendor/bin/lib/libcrypto.so.1.1 ./bin/lib cp vendor/bin/lib/libssl.so.1.1 ./bin/lib - cp vendor/bin/lib/libcurl.so.4 ./bin/lib - cp vendor/bin/lib/libmp3lame.so.0 ./bin/lib - cp vendor/bin/lib/libmicrohttpd.so.12 ./bin/lib - cp vendor/bin/lib/libopenmpt.so.0 ./bin/lib - cp /lib/x86_64-linux-gnu/libncursesw.so.6 ./bin/lib - cp /lib/x86_64-linux-gnu/libtinfo.so.6 ./bin/lib - cp /usr/lib/x86_64-linux-gnu/libpanelw.so.6 ./bin/lib + SYSTEM_ROOT="" + SYSTEM_TYPE="x86_64-linux-gnu" + if [[ $CROSSCOMPILE == "rpi" ]]; then + SYSTEM_ROOT="/build/rpi/sysroot" + SYSTEM_TYPE="arm-linux-gnueabihf" + fi - cp /usr/lib/x86_64-linux-gnu/libvorbis.so.0 ./bin/lib - cp /usr/lib/x86_64-linux-gnu/libogg.so.0 ./bin/lib - cp /usr/lib/x86_64-linux-gnu/libopus.so.0 ./bin/lib - cp /usr/lib/x86_64-linux-gnu/libvorbis.so.0 ./bin/lib - cp /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 ./bin/lib + cp $SYSTEM_ROOT/lib/$SYSTEM_TYPE/libncursesw.so.6 ./bin/lib + cp $SYSTEM_ROOT/lib/$SYSTEM_TYPE/libtinfo.so.6 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libpanelw.so.6 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libvorbis.so.0 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libogg.so.0 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libopus.so.0 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libvorbis.so.0 ./bin/lib + cp $SYSTEM_ROOT/usr/lib/$SYSTEM_TYPE/libvorbisenc.so.2 ./bin/lib mkdir -p ./bin/share/terminfo cp -rfp /lib/terminfo/* ./bin/share/terminfo diff --git a/src/plugins/taglib_plugin/CMakeLists.txt b/src/plugins/taglib_plugin/CMakeLists.txt index d5db8ed2d..6ccc5c7a3 100644 --- a/src/plugins/taglib_plugin/CMakeLists.txt +++ b/src/plugins/taglib_plugin/CMakeLists.txt @@ -10,16 +10,21 @@ find_library(LIBZ z) if (NOT ${ENABLE_BUNDLED_TAGLIB} MATCHES "false") message(STATUS "[taglibmetadatareader] using bundled taglib = true") + message(STATUS "[taglibmetadatareader] CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") include(ExternalProject) ExternalProject_Add(taglib - SOURCE_DIR "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11" + SOURCE_DIR + "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11" BUILD_IN_SOURCE 0 DOWNLOAD_COMMAND "" UPDATE_COMMAND "" - CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/" - INSTALL_COMMAND make install) + CMAKE_ARGS + "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" + "-DCMAKE_INSTALL_PREFIX=${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/" + INSTALL_COMMAND + make install) include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include") add_dependencies(taglibreader taglib)