gfx stack update (still holding the breaking llvm)
[nyanlinux.git] / builders / alsa-utils-1.2.7 / builder.sh
blobc37d0dc0af3c36f6281a457c34c92cc6a889a1e3
1 src_name=alsa-utils
2 version=${pkg_name##*-}
3 slot=$version
4 archive_name=$src_name-$version.tar.bz2
5 url0=ftp://ftp.alsa-project.org/pub/utils/$src_name-$version.tar.bz2
7 src_dir=$src_dir_root/$src_name-$version
8 cd $src_dir_root
9 rm -Rf $src_name-$version
10 tar xf $archive_name
12 # ifdef missing
13 cd $src_dir
14 cp $nyan_root/builders/$pkg_name/aplay.patch $src_dir/aplay.patch
15 patch -p1 -i $src_dir/aplay.patch
17 build_dir=$builds_dir_root/$pkg_name-$version
18 rm -Rf $build_dir
19 mkdir -p $build_dir
20 cd $build_dir
22 PATH_SAVED=$PATH
23 export PATH="\
24 /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin:\
25 /nyan/make/current/bin:\
26 /nyan/pkgconf/current/bin:\
27 $PATH\
29 target_gnu_triple=$(basename "$(ls -d /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin/*-gcc)")
30 target_gnu_triple=${target_gnu_triple%-gcc}
33 export "PKG_CONFIG_LIBDIR=/nyan/alsa-lib/current/lib/pkgconfig"
35 # alsa cppflags broken
36 export OBJDUMP=$target_gnu_triple-objdump
37 export AR=$target_gnu_triple-ar
38 export PKG_CONFIG=/nyan/pkgconf/current/bin/pkgconf
39 export "CPPFLAGS=-I/nyan/ncurses/current/include/ncurses -I/nyan/ncurses/current/include $(pkgconf --cflags-only-I alsa)"
40 echo CPPFLAGS=$CPPFLAGS
41 # at link time, the only way to tell gnu ld where to look for shared lib dependencies is to pass the -rpath-link option
42 export "CC=$target_gnu_triple-gcc \
43 -isystem /nyan/linux-headers/current/include \
44 -isystem /nyan/glibc/current/include \
45 -static-libgcc \
46 -B/nyan/glibc/current/lib \
47 -L/nyan/glibc/current/lib \
48 -Wl,-s \
49 -Wl,-rpath-link,\
50 /nyan/glibc/current/lib"
51 export 'CFLAGS=-O2 -pipe -fPIC'
52 export "LDFLAGS=-L/nyan/ncurses/current/lib -L/nyan/alsa-lib/current/lib"
53 export LIBS=-ltinfo
54 $src_dir/configure \
55 --prefix=/nyan/alsa-utils/$slot \
56 --disable-shared \
57 --disable-nls \
58 --disable-rpath \
59 --disable-alsatest \
60 --disable-xmlto \
61 --disable-rst2man
62 unset OBJDUMP
63 unset AR
64 unset PKG_CONFIG_LIBDIR
65 unset PKG_CONFIG
66 unset CPPFLAGS
67 unset CFLAGS
68 unset CC
69 unset LDFLAGS
70 unset LIBS
72 make -j $threads_n
73 make install
75 # cleanup and tidying
76 rm -Rf /nyan/$src_name/$slot/share/man
78 # fix detected bashism
79 sed -i -e 's/bash/sh/' \
80 /nyan/alsa-utils/$slot/sbin/alsabat-test.sh \
81 /nyan/alsa-utils/$slot/sbin/alsaconf \
82 /nyan/alsa-utils/$slot/sbin/alsa-info.sh
84 export PATH=$PATH_SAVED
85 unset PATH_SAVED
86 unset target_gnu_triple
87 rm -f $pkgs_dir_root/$archive_name
88 rm -Rf $build_dir $src_dir