Skip to content

SpeexDSP Compilation Workflow #51

Description

@SineVector241

Just thought I would share this: I've written a github workflow provided below that cross compiles the speexdsp lib to several platforms, so far only android, windows and linux binaries are available. I will update this when I figure out apple compilations. I have also ran a compilation of this workflow which is available here - https://github.com/SineVector241/ActionsTesting/actions/runs/11395970177

Hopefully someone will find this useful.

EDIT: Added windows arm workflow. It's a bit scuffed though

name: SpeexDSP Compile

on:
  pull_request:
    branches: [ "main" ]

  workflow_dispatch:

jobs:
  Linux_Build_x64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: sudo apt-get install g++-multilib

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit
        run: ./speexdsp/configure CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: linux-x86_64-libspeexdsp.so.1.5.2
          path: ./libspeexdsp/.libs/libspeexdsp.so.1.5.2

  Linux_Build_x32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: sudo apt-get install g++-multilib

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit
        run: ./speexdsp/configure CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: linux-x86-libspeexdsp.so.1.5.2
          path: ./libspeexdsp/.libs/libspeexdsp.so.1.5.2

  Linux_Build_Arm64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Build Libraries
        run: sudo apt-get install g++-aarch64-linux-gnu

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit ARM
        run: ./speexdsp/configure --host=aarch64-linux-gnu && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: linux-arm64-libspeexdsp.so.1.5.2
          path: ./libspeexdsp/.libs/libspeexdsp.so.1.5.2
          
  Linux_Build_Arm32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: sudo apt-get install g++-arm-linux-gnueabi

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit ARM
        run: ./speexdsp/configure --host=arm-linux-gnueabi && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: linux-arm32-libspeexdsp.so.1.5.2
          path: ./libspeexdsp/.libs/libspeexdsp.so.1.5.2

  Win_Build_x64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: sudo apt-get install mingw-w64

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit
        run: ./speexdsp/configure --host=x86_64-w64-mingw32 && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: win-x86_64-libspeexdsp-1.dll
          path: ./libspeexdsp/.libs/libspeexdsp-1.dll

  Win_Build_x32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: sudo apt-get install mingw-w64

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit
        run: ./speexdsp/configure --host=i686-w64-mingw32 && make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: win-x86-libspeexdsp-1.dll
          path: ./libspeexdsp/.libs/libspeexdsp-1.dll

  Win_Build_arm64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: |
          curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20241015/llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz
          tar -xf ./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz
          rm -rf ./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit ARM
        run: |
          export TOOLCHAIN=./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64
          export TARGET=aarch64-w64-mingw32
          export AR=$TOOLCHAIN/bin/$TARGET-llvm-ar
          export CC="$TOOLCHAIN/bin/$TARGET-clang --target=$TARGET"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/$TARGET-clang++ --target=$TARGET"
          export LD=$TOOLCHAIN/bin/$TARGET-ld
          export RANLIB=$TOOLCHAIN/bin/$TARGET-llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          cp -r $TOOLCHAIN ./libspeexdsp
          make
#cp -r $TOOLCHAIN ./libspeexdsp IS STUPID BUT IT WORKS

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: win-arm64-libspeexdsp-1.dll
          path: ./libspeexdsp/.libs/libspeexdsp-1.dll

  Win_Build_arm32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Build Libraries
        run: |
          curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20241015/llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz
          tar -xf ./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz
          rm -rf ./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64.tar.xz

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit ARM
        run: |
          export TOOLCHAIN=./llvm-mingw-20241015-ucrt-ubuntu-20.04-x86_64
          export TARGET=armv7-w64-mingw32
          export AR=$TOOLCHAIN/bin/$TARGET-llvm-ar
          export CC="$TOOLCHAIN/bin/$TARGET-clang --target=$TARGET"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/$TARGET-clang++ --target=$TARGET"
          export LD=$TOOLCHAIN/bin/$TARGET-ld
          export RANLIB=$TOOLCHAIN/bin/$TARGET-llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          cp -r $TOOLCHAIN ./libspeexdsp
          make
#cp -r $TOOLCHAIN ./libspeexdsp IS STUPID BUT IT WORKS

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: win-arm32-libspeexdsp-1.dll
          path: ./libspeexdsp/.libs/libspeexdsp-1.dll

  Android_Build_x64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r27b
          add-to-path: false
        env:
          ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit
        run: |
          export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
          export TARGET=x86_64-linux-android
          export API=21
          export AR=$TOOLCHAIN/bin/llvm-ar
          export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET$API"
          export LD=$TOOLCHAIN/bin/ld
          export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: android-x86_64-libspeexdsp.so
          path: ./libspeexdsp/.libs/libspeexdsp.so

  Android_Build_x32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r27b
          add-to-path: false
        env:
          ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit
        run: |
          export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
          export TARGET=i686-linux-android
          export API=21
          export AR=$TOOLCHAIN/bin/llvm-ar
          export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET$API"
          export LD=$TOOLCHAIN/bin/ld
          export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: android-x86-libspeexdsp.so
          path: ./libspeexdsp/.libs/libspeexdsp.so
          
  Android_Build_arm64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r27b
          add-to-path: false
        env:
          ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 64bit ARM
        run: |
          export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
          export TARGET=aarch64-linux-android
          export API=21
          export AR=$TOOLCHAIN/bin/llvm-ar
          export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET$API"
          export LD=$TOOLCHAIN/bin/ld
          export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          make

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: android-arm64-libspeexdsp.so
          path: ./libspeexdsp/.libs/libspeexdsp.so

  Android_Build_arm32:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r27b
          add-to-path: false
        env:
          ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

      - name: Clone Repository
        run: git clone https://github.com/xiph/speexdsp.git

      - name: Autogen
        run: ./speexdsp/autogen.sh

      - name: Configure And Build 32bit ARM
        run: |
          export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
          export TARGET=armv7a-linux-android
          export API=21
          export AR=$TOOLCHAIN/bin/llvm-ar
          export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API"
          export AS=$CC
          export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET$API"
          export LD=$TOOLCHAIN/bin/ld
          export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
          export STRIP=$TOOLCHAIN/bin/llvm-strip
          ./speexdsp/configure --host $TARGET
          make
          
      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: android-arm32-libspeexdsp.so
          path: ./libspeexdsp/.libs/libspeexdsp.so

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions