-
Notifications
You must be signed in to change notification settings - Fork 323
Expand file tree
/
Copy path02_build.sh
More file actions
executable file
·78 lines (61 loc) · 1.9 KB
/
02_build.sh
File metadata and controls
executable file
·78 lines (61 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
set -e
. ../../common.sh
cd $WORK_DIR/overlay/$BUNDLE_NAME
# Change to the ncurses source directory which ls finds, e.g. 'ncurses-6.0'.
cd $(ls -d ncurses-*)
if [ -f Makefile ] ; then
echo "Preparing '$BUNDLE_NAME' work area. This may take a while."
make -j $NUM_JOBS clean
else
echo "The clean phase for '$BUNDLE_NAME' has been skipped."
fi
rm -rf $DEST_DIR
# Remove static library
sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
# http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html
echo "Configuring '$BUNDLE_NAME'."
CFLAGS="$CFLAGS" ./configure \
--prefix=/usr \
--with-termlib \
--with-terminfo-dirs=/lib/terminfo \
--with-default-terminfo-dirs=/lib/terminfo \
--without-normal \
--without-debug \
--without-cxx-binding \
--with-abi-version=6 \
--enable-widec \
--enable-pc-files \
--with-shared \
CPPFLAGS=-I$PWD/ncurses/widechar \
LDFLAGS=-L$PWD/lib \
CPPFLAGS="-P"
# Most configuration switches are from AwlsomeAlex
# https://github.com/AwlsomeAlex/AwlsomeLinux/blob/59d59730703b058081a2371076a807590cacb31e/src/overlay_ncurses.sh
# CPPFLAGS fixes a bug with Ubuntu 16.04
# https://trac.sagemath.org/ticket/19762
echo "Building '$BUNDLE_NAME'."
make -j $NUM_JOBS
echo "Installing '$BUNDLE_NAME'."
make -j $NUM_JOBS install DESTDIR=$DEST_DIR
# Symnlink wide character libraries
if [ -d "$DEST_DIR/usr/lib" ]
then
cd $DEST_DIR/usr/lib
else
cd $DEST_DIR/usr/lib64
fi
ln -s libncursesw.so.6 libncurses.so.6
ln -s libncurses.so.6 libncurses.so
ln -s libtinfow.so.6 libtinfo.so.6
ln -s libtinfo.so.6 libtinfo.so
echo "Reducing '$BUNDLE_NAME' size."
set +e
strip -g $DEST_DIR/usr/bin/*
set -e
# With '--remove-destination' all possibly existing soft links in
# '$OVERLAY_ROOTFS' will be overwritten correctly.
cp -r --remove-destination $DEST_DIR/usr/* \
$OVERLAY_ROOTFS
echo "Bundle '$BUNDLE_NAME' has been installed."
cd $SRC_DIR