Gfx Stack Update
[nyanlinux.git] / builders / xkbcomp-1.4.6 / builder.sh
blob17537738b18569bb0f817c050ee747a59baee29c
1 src_name=xkbcomp
2 version=${pkg_name##*-}
3 slot=$version
4 archive_name=$src_name-$version.tar.xz
5 url0=http://www.x.org/releases/individual/app/$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 build_dir=$builds_dir_root/$pkg_name
15 rm -Rf $build_dir
16 mkdir -p $build_dir
17 cd $build_dir
19 # XXX: for all X11 based header we do not define MALLOC_0_RETURNS_NULL for glibc allocator
21 mkdir -p $build_dir/bin
22 cat >$build_dir/bin/cc <<EOF
23 #!/bin/sh
24 exec \
25 /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin/x86_64-nyan2-linux-gnu-gcc \
27 -isystem /nyan/glibc/current/include \
28 -isystem /nyan/linux-headers/current/include \
30 -I/nyan/libxkbfile/current/include \
31 -I/nyan/libX11/current/include \
32 -I/nyan/xorgproto/current/include \
34 -O2 -pipe -fPIC -static-libgcc -ftls-model=global-dynamic -fpic \
36 -B/nyan/glibc/current/lib \
38 -L/nyan/libxkbfile/current/lib \
39 -L/nyan/libX11/current/lib \
40 -L/nyan/glibc/current/lib \
42 "\$@"
43 EOF
44 chmod +x $build_dir/bin/cc
45 export PATH_SAVED=$PATH
46 export PATH="\
47 $build_dir/bin:\
48 $PATH\
51 #/nyan/bison/current/bin/bison --defines=xkbparse.h -o $build_dir/xkbparse.c \
52 # $pkg_dir/xkbparse.y
54 xkbcomp_src_files="\
55 $pkg_dir/xkbparse.c \
56 $pkg_dir/action.c \
57 $pkg_dir/alias.c \
58 $pkg_dir/compat.c \
59 $pkg_dir/expr.c \
60 $pkg_dir/geometry.c \
61 $pkg_dir/indicators.c \
62 $pkg_dir/keycodes.c \
63 $pkg_dir/keymap.c \
64 $pkg_dir/keytypes.c \
65 $pkg_dir/listing.c \
66 $pkg_dir/misc.c \
67 $pkg_dir/parseutils.c \
68 $pkg_dir/symbols.c \
69 $pkg_dir/utils.c \
70 $pkg_dir/vmod.c \
71 $pkg_dir/xkbcomp.c \
72 $pkg_dir/xkbpath.c \
73 $pkg_dir/xkbscan.c \
75 #---------------------------------------------------------------------------------------------------
76 # TODO: we are still using the compiler driver, bad
77 for f in $xkbcomp_src_files
79 o=$(basename $f .c).o
80 os="$os $o"
82 printf "CC $f->$o\n"
83 cc -c $f -o $build_dir/$o \
84 -DDFLT_XKB_CONFIG_ROOT='"/usr/share/X11/xkb"' \
85 -DHAVE_STRDUP \
86 -DHAVE_STRCASECMP \
87 -DPACKAGE_VERSION=\"$version\" &
88 done
89 #---------------------------------------------------------------------------------------------------
90 wait
91 #---------------------------------------------------------------------------------------------------
92 # TODO: we are still using the compiler driver, bad
93 printf "CCLD xkbcomp\n"
94 cc -o $build_dir/xkbcomp \
95 -Wl,-s \
96 $os \
97 -lxkbfile \
98 -lX11
99 #---------------------------------------------------------------------------------------------------
100 # XXX: The xserver should have been configured to find xkbcomp properly.
101 mkdir -p /nyan/$src_name/$slot/bin
102 cp -f $build_dir/xkbcomp /nyan/$src_name/$slot/bin
104 export PATH=$PATH_SAVED
105 unset PATH_SAVED
106 rm -f $pkgs_dir_root/$archive_name
107 rm -Rf $build_dir $pkg_dir