more house keeping
[nyanlinux.git] / builders / nasm-2.16.01 / builder.sh
blob5ed5f65f969bd0d512c5951bc7dadc153eef5507
1 src_name=nasm
2 version=${pkg_name##*-}
3 slot=$version
4 archive_name=$src_name-$version.tar.xz
5 url0=http://www.nasm.us/pub/$src_name/releasebuilds/$archive_name/$archive_name
7 pkg_dir=$pkgs_dir_root/$src_name-$version
8 rm -Rf $pkg_dir
9 mkdir -p $pkgs_dir_root
10 cp -f $src_dir_root/$archive_name $pkgs_dir_root
11 cd $pkgs_dir_root
12 tar xf $archive_name
14 # Must be build into the src directory.
15 cd $pkg_dir
17 PATH_SAVED=$PATH
18 export PATH="\
19 /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin:\
20 /nyan/make/current/bin:\
21 $PATH\
23 target_gnu_triple=$(basename "$(ls -d /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin/*-gcc)")
24 target_gnu_triple=${target_gnu_triple%-gcc}
26 export "CC=$target_gnu_triple-gcc \
27 -isystem /nyan/glibc/current/include \
28 -isystem /nyan/linux-headers/current/include \
29 -B/nyan/glibc/current/lib \
30 -L/nyan/glibc/current/lib \
31 -Wl,-rpath-link,/nyan/glibc/current/lib \
32 -Wl,-s \
33 -static-libgcc"
34 export 'CFLAGS=-O2 -pipe -fPIC'
35 export AR=$target_gnu_triple-ar
36 ./configure \
37 --prefix=/nyan/$src_name/$slot
38 unset CC
39 unset CFLAGS
40 unset AR
42 make -j $threads_n
43 make install
45 rm -Rf /nyan/$src_name/$slot/share
47 export PATH=$PATH_SAVED
48 unset PATH_SAVED
49 unset target_gnu_triple
50 rm -f $pkgs_dir_root/$archive_name
51 rm -Rf $pkg_dir