Files
BMLFS/build-scripts/libedit.build
2023-05-19 15:15:55 -05:00

66 lines
2.0 KiB
Bash

#! /bin/bash
# Libedit 3.1.2022.10.30
# Source: https://www.thrysoee.dk/editline/libedit-20221030-3.1.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built package
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
# LTO: GCC + Binutils, no LLVM
# If optimizing, use these flags
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
export LDFLAGS="-Wl,-O2 -Wl,--as-needed "
# If compiling with clang instead of gcc, apply patch from
# Chimera-Linux:
cd src
patch -Np1 -i ../../patches/libedit-chimera/clang.patch
cd -
./configure --prefix=/usr $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
read -p "Press Enter to install" &&
# if not using a package manager:
# make install
# if using pkgtools from Slackware, then:
sudo -S make DESTDIR=$BUILD install &&
read -p "Press Enter to create package description." &&
cd $BUILD && sudo mkdir -v install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
libedit: libedit (Editline Library)
libedit:
libedit: This is an autotool- and libtoolized port of the NetBSD Editline
libedit: library (libedit). This Berkeley-style licensed command line editor
libedit: library provides generic line editing, history, and tokenization
libedit: functions, similar to those found in GNU Readline.
libedit:
libedit: Homepage: http://thrysoee.dk/editline/
libedit:
libedit:
libedit:
EOF
sudo mv /tmp/slack-desc install/ &&
read -p "Enter to build package" &&
sudo makepkg -l y -c n $PKGS/libedit-3.1.2022.10.30-${PSUFFIX} &&
sudo rm -rf $BUILD/*