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 diff --git a/src/minimal_overlay/bundles/vim/02_build.sh b/src/minimal_overlay/bundles/vim/02_build.sh index 41f324d1d..85fff90de 100755 --- a/src/minimal_overlay/bundles/vim/02_build.sh +++ b/src/minimal_overlay/bundles/vim/02_build.sh @@ -42,7 +42,6 @@ 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