#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2015-2016, 2026 InterGenJLU
#
# speex 1.2.1 — Audio codec designed for speech compression
# BLFS 13.0 — builds both speex and speexdsp

configure() {
    set -e
    ./configure --prefix=/usr    \
                --disable-static \
                --docdir=/usr/share/doc/speex-${PKG_VERSION}
}

build() {
    set -e
    make -j${IGOS_JOBS}
}

do_install() {
    set -e
    make DESTDIR="$DESTDIR" install

    # BLFS: now build and install speexdsp from second source tarball
    cd ..
    tar -xf ${IGOS_SOURCES}/speexdsp-${PKG_VERSION}.tar.gz
    cd speexdsp-${PKG_VERSION}

    ./configure --prefix=/usr    \
                --disable-static \
                --docdir=/usr/share/doc/speexdsp-${PKG_VERSION}
    make -j${IGOS_JOBS}
    make DESTDIR="$DESTDIR" install
}
