From acc8feb00c809861fdd45046db1d8262ee826066 Mon Sep 17 00:00:00 2001 From: danelsan Date: Mon, 6 Aug 2018 08:18:20 +0200 Subject: [PATCH 1/2] Compile Vim without graphical library and selinux --- src/minimal_overlay/bundles/vim/02_build.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/minimal_overlay/bundles/vim/02_build.sh b/src/minimal_overlay/bundles/vim/02_build.sh index 919cb7bff..85fff90de 100755 --- a/src/minimal_overlay/bundles/vim/02_build.sh +++ b/src/minimal_overlay/bundles/vim/02_build.sh @@ -23,7 +23,24 @@ echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ - --prefix=/usr + --prefix=/usr \ + --enable-gui=no \ + --without-x \ + --with-tlib=ncurses \ + --disable-xsmp \ + --disable-gpm \ + --disable-selinux + +export CONF_OPT_GUI='--enable-gui=no' +export CONF_OPT_PERL='--enable-perlinterp' +export CONF_OPT_PYTHON='--enable-pythoninterp' +export CONF_OPT_TCL='--enable-tclinterp' +export CONF_OPT_RUBY='--enable-rubyinterp' +export CONF_OPT_LUA='--enable-luainterp' +export CONF_OPT_X='--without-x' +export CONF_OPT_CSCOPE='--enable-cscope' +export CONF_OPT_MULTIBYTE='--enable-multibyte' +export CONF_OPT_FEAT='--with-features=huge' echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS From 9f26f8fac5fef67609f6feda6c86936e4c1edb49 Mon Sep 17 00:00:00 2001 From: danelsan Date: Mon, 6 Aug 2018 09:57:44 +0200 Subject: [PATCH 2/2] Add python 3.7 bundle --- src/minimal_overlay/bundles/python/.config | 5 +++ src/minimal_overlay/bundles/python/01_get.sh | 38 ++++++++++++++++ .../bundles/python/02_build.sh | 45 +++++++++++++++++++ src/minimal_overlay/bundles/python/bundle.sh | 10 +++++ .../bundles/python/bundle_deps | 2 + 5 files changed, 100 insertions(+) create mode 100644 src/minimal_overlay/bundles/python/.config create mode 100755 src/minimal_overlay/bundles/python/01_get.sh create mode 100755 src/minimal_overlay/bundles/python/02_build.sh create mode 100755 src/minimal_overlay/bundles/python/bundle.sh create mode 100644 src/minimal_overlay/bundles/python/bundle_deps diff --git a/src/minimal_overlay/bundles/python/.config b/src/minimal_overlay/bundles/python/.config new file mode 100644 index 000000000..2d6065d3c --- /dev/null +++ b/src/minimal_overlay/bundles/python/.config @@ -0,0 +1,5 @@ +# You can find the latest python archives here: +# +# https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz +# +PYTHON_SOURCE_URL=https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz diff --git a/src/minimal_overlay/bundles/python/01_get.sh b/src/minimal_overlay/bundles/python/01_get.sh new file mode 100755 index 000000000..3f741a6a4 --- /dev/null +++ b/src/minimal_overlay/bundles/python/01_get.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +# Read the common configuration properties. +DOWNLOAD_URL=`read_property PYTHON_SOURCE_URL` +USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE` + +# Grab everything after the last '/' character. +ARCHIVE_FILE=${DOWNLOAD_URL##*/} + +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 PYTHON source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local PYTHON source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted vim. +echo "Removing PYTHON work area. This may take a while." +rm -rf $WORK_DIR/overlay/$BUNDLE_NAME +mkdir $WORK_DIR/overlay/$BUNDLE_NAME + +# 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/$BUNDLE_NAME + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/python/02_build.sh b/src/minimal_overlay/bundles/python/02_build.sh new file mode 100755 index 000000000..5fd90d588 --- /dev/null +++ b/src/minimal_overlay/bundles/python/02_build.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +cd $WORK_DIR/overlay/$BUNDLE_NAME + +# Change to the vim source directory which ls finds, e.g. 'Pythno-3.7.0'. +cd $(ls -d Python-*) + +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi + +rm -rf $DEST_DIR + +echo "Configuring '$BUNDLE_NAME'." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr CXX="/usr/bin/g++" --enable-optimizations + +echo "Building '$BUNDLE_NAME'." +make -j $NUM_JOBS + +echo "Installing '$BUNDLE_NAME'." +make -j $NUM_JOBS install DESTDIR=$DEST_DIR + +echo "Generating '$BUNDLE_NAME'." + +#echo "Reducing '$BUNDLE_NAME' size." +#set +e +#strip -g $DEST_DIR/usr/bin/* +#set -e + +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS + +echo "Bundle '$BUNDLE_NAME' has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/python/bundle.sh b/src/minimal_overlay/bundles/python/bundle.sh new file mode 100755 index 000000000..e132bc25f --- /dev/null +++ b/src/minimal_overlay/bundles/python/bundle.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +./01_get.sh +./02_build.sh + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/python/bundle_deps b/src/minimal_overlay/bundles/python/bundle_deps new file mode 100644 index 000000000..a150aae5e --- /dev/null +++ b/src/minimal_overlay/bundles/python/bundle_deps @@ -0,0 +1,2 @@ +glibc_libpthread +glibc_libutil