diff --git a/.github/workflows/build-libs.yml b/.github/workflows/build-libs.yml index adbf295..82302b7 100644 --- a/.github/workflows/build-libs.yml +++ b/.github/workflows/build-libs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["macos-11"] + os: ["macos-13"] fail-fast: true steps: @@ -28,7 +28,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["macos-11"] + os: ["macos-14"] fail-fast: true steps: @@ -58,69 +58,42 @@ jobs: name: lib-linux-x86_64 path: "libsndfile.so" - build-libs-linux-x86_64-glibc2_17: + build-libs-linux-x86_64-glibc2_28: runs-on: "ubuntu-latest" strategy: fail-fast: true container: - image: centos:7 - env: - # OpenSSL<=1.0.2 is available for CentOS7, so we need to compile OpenSSL and Curl - SSL_VERSION: 3.1.0 - CURL_VERSION: 8.0.1 + image: quay.io/pypa/manylinux_2_28_x86_64 steps: - uses: actions/checkout@v3 - - name: Install required packages - run: | - yum install -y gcc gcc-c++ make bzip2 zlib-devel perl-core libmetalink-devel libssh2-devel c-ares-devel lbzip2 - - name: Compile OpenSSL - run : | - curl -LO https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz - tar xvf openssl-${SSL_VERSION}.tar.gz - cd openssl-${SSL_VERSION} - ./config --prefix=/usr shared zlib-dynamic - make - make test - make install - # check version - openssl version - - name: Compile curl - run: | - curl -LO https://curl.se/download/curl-${CURL_VERSION}.tar.gz - tar xvf curl-${CURL_VERSION}.tar.gz - cd curl-${CURL_VERSION} - ./configure --enable-libcurl-option --with-openssl - make - make install - rm /usr/bin/curl - # check version - curl -V - - name: Compile library run: ./linux_build.sh - uses: actions/upload-artifact@v3 with: - name: lib-linux-x86_64-glibc2_17 + name: lib-linux-x86_64-glibc2_28 path: "libsndfile.so" build-libs-linux-arm64: runs-on: ${{ matrix.os }} + container: debian:10 strategy: matrix: os: ["ubuntu-20.04"] fail-fast: true steps: + - name: Install aarch64-linux-gnu cross-compiler + run: | + apt-get update + apt-get install -y build-essential \ + curl \ + python3 \ + g++-aarch64-linux-gnu - uses: actions/checkout@v3 - name: Compile library - uses: pguyot/arm-runner-action@v2 - with: - base_image: raspios_lite_arm64:2022-04-04 - cpu: cortex-a53 - cpu_info: cpuinfo/raspberrypi_zero2_w_arm64 - bind_mount_repository: true - commands: | - ./linux_build.sh + run: | + export CONFIGURE_FLAGS="--host=aarch64-linux-gnu --build=x86_64-linux-gnu" + ./linux_build.sh - uses: actions/upload-artifact@v3 with: name: lib-linux-arm64 diff --git a/darwin.cmake b/darwin.cmake index 7574cc1..03149ef 100644 --- a/darwin.cmake +++ b/darwin.cmake @@ -17,5 +17,5 @@ set(OPUS_INCLUDE_DIR $ENV{OPUS_INCLUDE}) set(MP3LAME_LIBRARY $ENV{MP3LAME_LIBS}) set(MP3LAME_INCLUDE_DIR $ENV{MP3LAME_INCLUDE}) -set(MPG123_LIBRARY $ENV{MPG123_LIBS}) -set(MPG123_INCLUDE_DIR $ENV{MPG123_INCLUDE}) +set(mpg123_LIBRARY $ENV{MPG123_LIBS}) +set(mpg123_INCLUDE_DIR $ENV{MPG123_INCLUDE}) diff --git a/linux_build.sh b/linux_build.sh index 1896df4..bb53b7c 100755 --- a/linux_build.sh +++ b/linux_build.sh @@ -1,3 +1,5 @@ +#!/bin/sh + OGGVERSION=1.3.5 VORBISVERSION=1.3.7 FLACVERSION=1.4.3 @@ -11,6 +13,8 @@ SNDFILENAME=libsndfile-$SNDFILE_VERSION OGG_INCDIR="$(pwd)/libogg-$OGGVERSION/include" OGG_LIBDIR="$(pwd)/libogg-$OGGVERSION/src/.libs" +set -e + # make sure all static libraries are position-independent, so we can link them # into the libsndfile.so later: export CFLAGS="-fPIC" @@ -21,16 +25,19 @@ export LDFLAGS="-fPIC" curl -LO https://downloads.xiph.org/releases/ogg/libogg-$OGGVERSION.tar.gz tar xvf libogg-$OGGVERSION.tar.gz cd libogg-$OGGVERSION -./configure --disable-shared +./configure --disable-shared $CONFIGURE_FLAGS make -j$JOBS cd .. # libvorbis +export OGG_CFLAGS="-I$OGG_INCDIR" +export OGG_LIBS="-L$OGG_LIBDIR -logg" + curl -LO https://downloads.xiph.org/releases/vorbis/libvorbis-$VORBISVERSION.tar.gz tar xvf libvorbis-$VORBISVERSION.tar.gz cd libvorbis-$VORBISVERSION -./configure --disable-shared --with-ogg-includes=$OGG_INCDIR --with-ogg-libraries=$OGG_LIBDIR +./configure --disable-shared --with-ogg-includes=$OGG_INCDIR --with-ogg-libraries=$OGG_LIBDIR $CONFIGURE_FLAGS make -j$JOBS cd .. @@ -39,7 +46,7 @@ cd .. curl -LO https://downloads.xiph.org/releases/flac/flac-$FLACVERSION.tar.xz tar xvf flac-$FLACVERSION.tar.xz cd flac-$FLACVERSION -./configure --enable-static --disable-shared --with-ogg-includes=$OGG_INCDIR --with-ogg-libraries=$OGG_LIBDIR +./configure --enable-static --disable-shared --with-ogg-includes=$OGG_INCDIR --with-ogg-libraries=$OGG_LIBDIR $CONFIGURE_FLAGS make -j$JOBS cd .. @@ -48,7 +55,7 @@ cd .. curl -LO https://downloads.xiph.org/releases/opus/opus-$OPUSVERSION.tar.gz tar xvf opus-$OPUSVERSION.tar.gz cd opus-$OPUSVERSION -./configure --disable-shared +./configure --disable-shared $CONFIGURE_FLAGS make -j$JOBS cd .. @@ -57,7 +64,7 @@ cd .. curl -LO https://sourceforge.net/projects/mpg123/files/mpg123/$MPG123VERSION/mpg123-$MPG123VERSION.tar.bz2 tar xvf mpg123-$MPG123VERSION.tar.bz2 cd mpg123-$MPG123VERSION -./configure --enable-static --disable-shared +./configure --enable-static --disable-shared $CONFIGURE_FLAGS make -j$JOBS cd .. @@ -66,7 +73,7 @@ cd .. curl -LO https://sourceforge.net/projects/lame/files/lame/$LAMEVERSION/lame-$LAMEVERSION.tar.gz tar xvf lame-$LAMEVERSION.tar.gz cd lame-$LAMEVERSION -./configure --enable-static --disable-shared +./configure --enable-static --disable-shared $CONFIGURE_FLAGS make -j$JOBS cd .. @@ -101,7 +108,8 @@ cp lame-$LAMEVERSION/include/*.h lame-$LAMEVERSION/include/lame curl -LO https://github.com/libsndfile/libsndfile/releases/download/$SNDFILE_VERSION/libsndfile-$SNDFILE_VERSION.tar.xz tar xvf libsndfile-$SNDFILE_VERSION.tar.xz cd $SNDFILENAME -./configure --disable-static --disable-sqlite --disable-alsa && make -j$JOBS +./configure --disable-static --disable-sqlite --disable-alsa --enable-external-libs --enable-mpeg $CONFIGURE_FLAGS +make -j$JOBS cd .. cp $SNDFILENAME/src/.libs/libsndfile.so libsndfile.so diff --git a/mac_build.sh b/mac_build.sh index eafb533..46412ba 100755 --- a/mac_build.sh +++ b/mac_build.sh @@ -1,3 +1,5 @@ +#!/bin/sh + OGGVERSION=1.3.5 VORBISVERSION=1.3.7 FLACVERSION=1.4.3 @@ -11,6 +13,8 @@ SNDFILENAME=libsndfile-$SNDFILE_VERSION OGG_INCDIR="$(pwd)/libogg-$OGGVERSION/include" OGG_LIBDIR="$(pwd)/libogg-$OGGVERSION/src/.libs" +set -e + if [ "$1" = "arm64" ]; then echo "Cross compiling for Darwin arm64.." export MACOSX_DEPLOYMENT_TARGET=11.0 @@ -34,9 +38,13 @@ cd .. # libvorbis +export OGG_CFLAGS="-I$OGG_INCDIR" +export OGG_LIBS="-L$OGG_LIBDIR -logg" + curl -LO https://downloads.xiph.org/releases/vorbis/libvorbis-$VORBISVERSION.tar.gz tar zxvf libvorbis-$VORBISVERSION.tar.gz cd libvorbis-$VORBISVERSION +sed -e 's/ -force_cpusubtype_ALL / /' -i.orig configure CFLAGS=$EXTRA_CFLAGS CXXFLAGS=$EXTRA_CFLAGS ./configure $BUILD_HOST --disable-shared --with-ogg-includes=$OGG_INCDIR --with-ogg-libraries=$OGG_LIBDIR make -j$JOBS cd ..