Add vim bundle
This commit is contained in:
parent
f740473319
commit
04ecdb96ec
@ -116,6 +116,12 @@ STATIC_GET_SOURCE_URL=http://s.minos.io/s
|
|||||||
#
|
#
|
||||||
UTIL_LINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz
|
UTIL_LINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz
|
||||||
|
|
||||||
|
# You can find the latest vim source bundles here:
|
||||||
|
#
|
||||||
|
# https://github.com/vim/vim/releases
|
||||||
|
#
|
||||||
|
VIM_SOURCE_URL=https://github.com/vim/vim/archive/v8.0.1298.tar.gz
|
||||||
|
|
||||||
# You can find the latest ZLIB source bundles here:
|
# You can find the latest ZLIB source bundles here:
|
||||||
#
|
#
|
||||||
# http://zlib.net
|
# http://zlib.net
|
||||||
@ -213,11 +219,12 @@ COPY_SOURCE_ISO=true
|
|||||||
# openjdk - installs Open JDK. All operations are automated.
|
# openjdk - installs Open JDK. All operations are automated.
|
||||||
# static_get - portable binaries for Linux (http://s.minos.io).
|
# static_get - portable binaries for Linux (http://s.minos.io).
|
||||||
# util_linux - set of executable utilities distributed by the Linux Kernel Org.
|
# util_linux - set of executable utilities distributed by the Linux Kernel Org.
|
||||||
|
# vim - an advanced text editor.
|
||||||
# zlib - DEFLATE compression/decompression library.
|
# zlib - DEFLATE compression/decompression library.
|
||||||
#
|
#
|
||||||
# Refer to the README file for more information.
|
# Refer to the README file for more information.
|
||||||
#
|
#
|
||||||
#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib
|
#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,vim,zlib
|
||||||
#OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib
|
#OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib
|
||||||
|
|
||||||
# This property enables the standard penguin boot logo in the upper left corner
|
# This property enables the standard penguin boot logo in the upper left corner
|
||||||
|
@ -84,6 +84,12 @@ Currently available overlay bundles:
|
|||||||
|
|
||||||
Some packages in this overlay bundle require ncurses.
|
Some packages in this overlay bundle require ncurses.
|
||||||
|
|
||||||
|
* vim - An advanced text editor that seeks to provide the power of
|
||||||
|
the de-facto Unix editor 'Vi', with a more complete feature
|
||||||
|
set.
|
||||||
|
|
||||||
|
This package will create symlinks on top of vi.
|
||||||
|
|
||||||
* ZLIB - Software library used for data compression.
|
* ZLIB - Software library used for data compression.
|
||||||
|
|
||||||
|
|
||||||
|
41
src/minimal_overlay/bundles/vim/01_get.sh
Executable file
41
src/minimal_overlay/bundles/vim/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 VIM_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 vim source bundle file. The '-c' option allows the download to resume.
|
||||||
|
echo "Downloading vim source bundle from $DOWNLOAD_URL"
|
||||||
|
wget -c $DOWNLOAD_URL
|
||||||
|
else
|
||||||
|
echo "Using local vim source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Delete folder with previously extracted vim.
|
||||||
|
echo "Removing vim work area. This may take a while..."
|
||||||
|
rm -rf $WORK_DIR/overlay/vim
|
||||||
|
mkdir $WORK_DIR/overlay/vim
|
||||||
|
|
||||||
|
# Extract vim to folder 'work/overlay/vim'.
|
||||||
|
# Full path will be something like 'work/overlay/vim/vim-8.0.1298'.
|
||||||
|
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/vim
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
||||||
|
|
61
src/minimal_overlay/bundles/vim/02_build.sh
Executable file
61
src/minimal_overlay/bundles/vim/02_build.sh
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
|
cd $WORK_DIR/overlay/vim
|
||||||
|
|
||||||
|
DESTDIR="$PWD/vim_installed"
|
||||||
|
|
||||||
|
# Change to the vim source directory which ls finds, e.g. 'vim-8.0.1298'.
|
||||||
|
cd $(ls -d vim-*)
|
||||||
|
|
||||||
|
echo "Preparing vim work area. This may take a while..."
|
||||||
|
make -j $NUM_JOBS clean
|
||||||
|
|
||||||
|
rm -rf $DESTDIR
|
||||||
|
|
||||||
|
echo "Setting vimrc location..."
|
||||||
|
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
|
||||||
|
|
||||||
|
echo "Configuring vim..."
|
||||||
|
CFLAGS="$CFLAGS" ./configure \
|
||||||
|
--prefix=/usr
|
||||||
|
|
||||||
|
echo "Building vim..."
|
||||||
|
make -j $NUM_JOBS
|
||||||
|
|
||||||
|
echo "Installing vim..."
|
||||||
|
make -j $NUM_JOBS install DESTDIR=$DESTDIR
|
||||||
|
|
||||||
|
echo "Generating vimrc..."
|
||||||
|
mkdir -p $DESTDIR/etc
|
||||||
|
cat > $DESTDIR/etc/vimrc << "EOF"
|
||||||
|
" Begin /etc/vimrc
|
||||||
|
|
||||||
|
set nocompatible
|
||||||
|
set backspace=2
|
||||||
|
set mouse=r
|
||||||
|
syntax on
|
||||||
|
set background=dark
|
||||||
|
|
||||||
|
" End /etc/vimrc
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Symlinking vim to vi..."
|
||||||
|
ln -sv vim $DESTDIR/usr/bin/vi
|
||||||
|
mkdir -p $DESTDIR/bin
|
||||||
|
ln -sv vim $DESTDIR/bin/vi
|
||||||
|
|
||||||
|
echo "Reducing vim size..."
|
||||||
|
strip -g $DESTDIR/usr/bin/*
|
||||||
|
|
||||||
|
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
|
||||||
|
|
||||||
|
cp -r $DESTDIR/* $ROOTFS
|
||||||
|
|
||||||
|
echo "vim has been installed."
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
||||||
|
|
9
src/minimal_overlay/bundles/vim/bundle.sh
Executable file
9
src/minimal_overlay/bundles/vim/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