Add libevent bundle
This commit is contained in:
parent
46d7102136
commit
497721addd
@ -84,6 +84,12 @@ KBD_SOURCE_URL=https://www.kernel.org/pub/linux/utils/kbd/kbd-2.0.4.tar.gz
|
||||
#
|
||||
KEXEC_TOOLS_SOURCE_URL=http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.15.tar.xz
|
||||
|
||||
# You can find the latest libevent archives here:
|
||||
#
|
||||
# https://github.com/libevent/libevent/releases/
|
||||
#
|
||||
LIBEVENT_SOURCE_URL=https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
|
||||
|
||||
# You can find the latest Links source bundles here:
|
||||
#
|
||||
# http://links.twibright.com
|
||||
@ -223,6 +229,7 @@ COPY_SOURCE_ISO=true
|
||||
# felix - Apache Felix OSGi framework.
|
||||
# java - installs Oracle's JRE or JDK. Manual preparations are required.
|
||||
# kbd - keyboard utilities
|
||||
# libevent - event notification library.
|
||||
# links - text browser for the web.
|
||||
# lua - scripting language.
|
||||
# mll_utils - set of executable utilities (mll-*).
|
||||
|
@ -57,6 +57,10 @@ Currently available overlay bundles:
|
||||
|
||||
loadkeys de
|
||||
|
||||
* libevent - event notification library API provides a mechanism to execute a
|
||||
callback function when a specific event occurs on a file
|
||||
descriptor or after a timeout has been reached.
|
||||
|
||||
* Links - Text based browser. Requires ~1MB additional space. Use the
|
||||
"links" command to activate the browser.
|
||||
|
||||
|
41
src/minimal_overlay/bundles/libevent/01_get.sh
Executable file
41
src/minimal_overlay/bundles/libevent/01_get.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
# Grab everything after the '=' character.
|
||||
DOWNLOAD_URL=$(grep -i LIBEVENT_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
USE_LOCAL_SOURCE="false"
|
||||
fi
|
||||
|
||||
cd $MAIN_SRC_DIR/source/overlay
|
||||
|
||||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
|
||||
# Downloading libevent source bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading libevent source bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local libevent source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted libevent.
|
||||
echo "Removing libevent work area. This may take a while..."
|
||||
rm -rf $WORK_DIR/overlay/libevent
|
||||
mkdir $WORK_DIR/overlay/libevent
|
||||
|
||||
# Extract libevent to folder 'work/overlay/libevent'.
|
||||
# Full path will be something like 'work/overlay/libevent/libevent-2.1.8-stable'.
|
||||
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/libevent
|
||||
|
||||
cd $SRC_DIR
|
||||
|
37
src/minimal_overlay/bundles/libevent/02_build.sh
Executable file
37
src/minimal_overlay/bundles/libevent/02_build.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
cd $WORK_DIR/overlay/libevent
|
||||
|
||||
DESTDIR="$PWD/libevent_installed"
|
||||
|
||||
# Change to the libevent source directory which ls finds, e.g. 'libevent-2.1.8-stable'.
|
||||
cd $(ls -d libevent-*)
|
||||
|
||||
echo "Preparing libevent work area. This may take a while..."
|
||||
make -j $NUM_JOBS clean
|
||||
|
||||
rm -rf $DESTDIR
|
||||
|
||||
echo "Configuring libevent..."
|
||||
CFLAGS="$CFLAGS" ./configure
|
||||
|
||||
echo "Building libevent..."
|
||||
make -j $NUM_JOBS
|
||||
|
||||
echo "Installing libevent..."
|
||||
make -j $NUM_JOBS install DESTDIR=$DESTDIR
|
||||
|
||||
echo "Reducing libevent size..."
|
||||
strip -g $DESTDIR/usr/bin/*
|
||||
|
||||
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
|
||||
|
||||
cp -r $DESTDIR/usr/local/* $ROOTFS
|
||||
|
||||
echo "libevent has been installed."
|
||||
|
||||
cd $SRC_DIR
|
9
src/minimal_overlay/bundles/libevent/bundle.sh
Executable file
9
src/minimal_overlay/bundles/libevent/bundle.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
./01_get.sh
|
||||
./02_build.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
Loading…
x
Reference in New Issue
Block a user