3.27. ncurses-6.3

#!/bin/sh
# Copyright © 1999-2022 Gerard Beekmans
# Copyright © 2017-2022 Random Crew
# Distributed under the terms of MIT License.

Configuration

Options under variable add_options are absent in lfs-11.1 and added later. The same version of ncurses package is used in different LFS versions, so we need to check it out.

src_config()
{
    cxx_option="--with-cxx-shared"
    case ${LFS_VERSION} in
        11.1)
            cxx_option=
        ;;
    esac
    ./configure \
        --prefix=${PREFIX} \
        --mandir=${PREFIX}/share/man \
        --with-shared   \
        --without-debug \
        --without-normal \
        ${cxx_option} \
        --with-cxx-shared \
        --enable-pc-files \
        --enable-widec \
        --with-pkg-config-libdir=${PREFIX}/lib/pkgconfig
}

Compilation

src_compile()
{
    make ${MAKEOPTS}
}

Installation

src_install()
{
    make install ${MAKEOPTS} DESTDIR=${D}

    mkdir -p ${D}/lib
    for lib in ncurses form panel menu ; do
        rm -f ${D}/${PREFIX}/lib/lib${lib}.so
        echo "INPUT(-l${lib}w)" > ${D}/${PREFIX}/lib/lib${lib}.so
        ln -sf ${lib}w.pc ${D}/${PREFIX}/lib/pkgconfig/${lib}.pc
    done
    rm -f ${D}/${PREFIX}/lib/libcursesw.so
    echo "INPUT(-lncursesw)" > ${D}/${PREFIX}/lib/libcursesw.so
    ln -sf libncurses.so ${D}/${PREFIX}/lib/libcurses.so

    mkdir -p ${D}/${PREFIX}/share/doc/${P}
    cp -R doc/* ${D}/${PREFIX}/share/doc/${P}
}

Build code

ncurses.build
pass1.sh

Other files

meta.txt
text

Links

url.lfs: https://linuxfromscratch.org/lfs/view/11.1/chapter08/ncurses.html
url.lfs.stage1: https://linuxfromscratch.org/lfs/view/11.1/chapter06/ncurses.html