|
root / test / ports / devel / ncurses / build.sh
build.sh Bash 49 lines 1.1 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
#!/bin/sh
# Build script for ncurses
# Terminal UI library

set -e

echo "Building ncurses..."

cd ncurses-6.4

# On illumos, use GNU make
MAKE=gmake
if [ "$(uname -s)" != "SunOS" ]; then
    MAKE=make
fi

# Configure with common options
./configure \
    --prefix=/usr \
    --with-shared \
    --with-cxx-shared \
    --without-debug \
    --without-normal \
    --enable-widec \
    --enable-pc-files \
    --with-pkg-config-libdir=/usr/lib/pkgconfig

# Build
$MAKE ${MAKEFLAGS}

# Install to DESTDIR
echo "Installing to ${DESTDIR}..."
$MAKE DESTDIR="${DESTDIR}" install

# Create compatibility symlinks for non-wide-char programs
# Many programs expect -lncurses, but we built -lncursesw
cd "${DESTDIR}/usr/lib"
for lib in ncurses form panel menu; do
    ln -sf lib${lib}w.so lib${lib}.so 2>/dev/null || true
    ln -sf ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc 2>/dev/null || true
done

# Also provide curses.h symlink
cd "${DESTDIR}/usr/include"
ln -sf ncursesw/curses.h curses.h 2>/dev/null || true
ln -sf ncursesw/ncurses.h ncurses.h 2>/dev/null || true

echo "Build complete!"