gfx stack update (still holding the breaking llvm)
[nyanlinux.git] / builders / freetype-2.12.0 / builder.sh
blob2a45c86b487b92d4c992f8f3024b76ad2439f4ce
1 src_name=freetype
2 version=${pkg_name##*-}
3 slot=$version
4 archive_name=$src_name-$version.tar.xz
5 url0=http://download.savannah.gnu.org/releases/$src_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 # enable lcd subpixel filtering
15 sed -r "s:.*(#.*SUBPIXEL_RENDERING) .*:\1:" \
16 -i $pkg_dir/include/freetype/config/ftoption.h
18 build_dir=$builds_dir_root/$src_name-$version
19 rm -Rf $build_dir
20 mkdir -p $build_dir
21 cd $build_dir
23 PATH_SAVED=$PATH
24 export PATH="\
25 /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin:\
26 /nyan/make/current/bin:\
27 /nyan/pkgconf/current/bin:\
28 $PATH\
30 target_gnu_triple=$(basename "$(ls -d /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin/*-gcc)")
31 target_gnu_triple=${target_gnu_triple%-gcc}
33 export "PKG_CONFIG_LIBDIR=\
34 /nyan/zlib/current/lib/pkgconfig:\
35 /nyan/libpng/current/lib/pkgconfig"
36 export PKG_CONFIG=pkgconf
37 export "CPPFLAGS=\
38 -isystem /nyan/glibc/current/include \
39 -isystem /nyan/linux-headers/current/include \
40 -I/nyan/bzip2/current/include"
41 export 'CFLAGS=-O2 -pipe -fPIC -static-libgcc'
42 export "LDFLAGS=\
43 -L/nyan/bzip2/current/lib \
44 -B/nyan/glibc/current/lib \
45 -L/nyan/glibc/current/lib \
46 -Wl,-rpath-link,/nyan/glibc/current/lib \
47 -Wl,-s \
48 -static-libgcc"
49 # must add the full blow CC for tools
50 export "CC=$target_gnu_triple-gcc \
51 $CPPFLAGS \
52 $LDFLAGS"
53 $pkg_dir/configure \
54 --prefix=/nyan/$src_name/$slot \
55 --disable-static \
56 --enable-shared \
57 --enable-mmap \
58 --without-harfbuzz
59 unset PKG_CONFIG
60 unset CPPFLAGS
61 unset CFLAGS
62 unset LDFLAGS
63 unset CC
65 make -j $threads_n
66 make install
68 rm -Rf /nyan/$src_name/$slot/share/man
69 rm -f /nyan/$src_name/$slot/lib/*.la
71 export PATH=$PATH_SAVED
72 unset PATH_SAVED
73 unset target_gnu_triple
74 rm -f $pkgs_dir_root/$archive_name
75 rm -Rf $build_dir $pkg_dir