master chld/ports-heresy / utils / alsa-utils / ndmake.sh
 1#!/bin/sh -ue
 2NAME=alsa-utils
 3VERSION=1.2.16
 4RELEASE=1
 5SOURCE="https://www.alsa-project.org/files/pub/utils/alsa-utils-${VERSION}.tar.bz2"
 6
 7overwrite_libtool(){
 8    cat << 'EOF' > libtool
 9#!/bin/sh
10set -x
11
12for a do
13 case "$a" in
14  --mode=*) shift
15  	    break
16  	    ;;
17  *) shift;;
18 esac
19done
20
21c="$*"
22c=$(echo "$c"|sed -E 's/-module|-avoid-version|-export-dynamic|-no-undefined//g')
23
24mkdir -p .deps
25exec $c
26EOF
27}
28
29prebuild(){
30    msg "NOTE: alsa will not build with netbsd-curses. uninstall netbsd-curses before building!"
31    echo
32}
33
34build() {
35    static_cc='clang -static'
36    export eflags='-Qunused-arguments -Wno-error=unused-command-line-argument'
37    CC="$static_cc" CFLAGS="-static $eflags" LDFLAGS='-static' PREFIX="$PREFIX" DESTDIR="$PKG" ./configure \
38		--disable-nls \
39		--bindir=/bin \
40		--libdir=/lib \
41		--sysconfdir=/etc \
42		--sbindir=/bin \
43		--prefix=/ \
44		--without-gnu-ld \
45		--without-librt \
46		--with-curses=ncursesw \
47		--disable-libtool-lock \
48		--disable-alsatplg \
49		--disable-shared \
50		--disable-alsa-topology \
51		--disable-alsa-test \
52		--disable-nhlt \
53		--disable-largefile \
54		--disable-bat \
55		--disable-alsaloop \
56		--enable-static || die "configure failed"
57    overwrite_libtool
58    rm -rf nhlt/ topology/nhlt/
59    sed -i 's/nhlt//g' Makefile
60    sed -i 's/nhlt//g' topology/Makefile
61	gmake PREFIX="$PREFIX" CC="$static_cc" CFLAGS="-static $eflags" LDFLAGS='-static' -j"$NPROC" || die "make failed"
62	gmake PREFIX="$PREFIX" DESTDIR="$PKG" install || die "make install failed"
63}
64
65. ${0%/*}/../../libsh/libdmake.sh