ipkg_decompress_package()
{
+ # Removing old build directory (if any)
+ if [ -d ${LFS_TMP}/${PACKAGE} ]; then
+ echo "Removing old build directory"
+ rm -rf ${LFS_TMP}/${PACKAGE}
+ fi
+
echo "Decompressing package"
decompress_package ${PACKAGE}
# Saving package source size in global variable.
SOURCE_SIZE=$(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }')
- # Removing old build directory (if any)
- if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
- echo "Removing old build directory"
- rm -rf ${LFS_TMP}/${PACKAGE}-build
+ # Creating build directory (if applicable).
+ if [ ! -d ${BUILD_DIR} ]; then
+ mkdir -p ${BUILD_DIR}
fi
-
- # Creating build directory
- mkdir -v ${LFS_TMP}/${PACKAGE}-build
}
# Default configure function
hvconfig()
{
- if [ "x${IPKG_MODE}" = "xacnb" -o "x${IPKG_MODE}" = "xpm" ]; then
- # Broken autoconf package that must build in source dir, or Perl module.
- cd ${LFS_TMP}/${PACKAGE}
- else
- # Standard autoconf mode
- cd ${LFS_TMP}/${PACKAGE}-build
- fi
+ cd ${BUILD_DIR}
if [ "x${IPKG_MODE}" = "xpm" ]; then
# Configure Perl module.
# accept the default configuration.
perl Makefile.PL -n ${CONFIGURE_OPTS}
else
- if [ ! -f ${LFS_TMP}/${PACKAGE}/configure ]; then
- if [ -f ${LFS_TMP}/${PACKAGE}/configure.in -o \
- -f ${LFS_TMP}/${PACKAGE}/configure.ac ]; then
+ if [ ! -f ${SRC_DIR}/configure ]; then
+ if [ -f ${SRC_DIR}/configure.in -o \
+ -f ${SRC_DIR}/configure.ac ]; then
# Try to automatically generate missing configure script.
- autoreconf -vi
+ touch ${SRC_DIR}/{NEWS,README,AUTHORS} # Required files
+ autoreconf -vi ${SRC_DIR}
fi
fi
# Standard configure script
- ${LFS_TMP}/${PACKAGE}/configure ${CONFIGURE_OPTS}
+ ${SRC_DIR}/configure ${CONFIGURE_OPTS}
fi
}
# Default build function
hvbuild()
{
- if [ "x${IPKG_MODE}" = "xacnb" -o \
- "x${IPKG_MODE}" = "xnoac" -o \
- "x${IPKG_MODE}" = "xpm" ]; then
- # Broken autoconf package that must build in source dir, or Perl module.
- cd ${LFS_TMP}/${PACKAGE}
- fi
-
+ cd ${BUILD_DIR}
${HVMAKE}
${HVMAKE} install
}
cd ${SCRDIR}
if [ "x${DECOMPRESS}" = "x1" ]; then
+ DU_FOLDERS="${LFS_TMP}/${PACKAGE}"
+ if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
+ DU_FOLDERS+=" ${LFS_TMP}/${PACKAGE}-build"
+ fi
+
# Saving package build size in global variable
- BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }')
+ BUILD_SIZE=$(du -h -s -c ${DU_FOLDERS} | grep total | \
+ awk '{ print $1 }')
# Some scripts need to preserve the source or build directory. They can
# do so by renaming them.
rm -rf ${LFS_TMP}/${PACKAGE}
fi
if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
- # Removing build directory
echo "Removing build directory"
- rm -rf ${LFS_TMP}/${PACKAGE}-build
+ rm -rf ${LFS_TMP}/${PACKAGE}-build
fi
else
BUILD_SIZE="Unknown"
if function_exists hvconfig_cache ; then
echo "Running configure cache script"
hvconfig_cache
- CONFIGURE_OPTS="\
- ${CONFIGURE_OPTS} \
- --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+ CONFIGURE_OPTS+=" --cache-file=${BUILD_DIR}/config.cache"
fi
- if [ -x ${LFS_TMP}/${PACKAGE}/configure ]; then
+ if [ -x ${SRC_DIR}/configure ]; then
if [ "x${ENABLE_DEPENDENCY_TRACKING}" = "x0" ]; then
# Add option --disable-dependency-tracking if supported
- if cat ${LFS_TMP}/${PACKAGE}/configure | \
+ if cat ${SRC_DIR}/configure | \
grep -q "disable-dependency-tracking"; then
- CONFIGURE_OPTS="\
- ${CONFIGURE_OPTS} \
- --disable-dependency-tracking"
+ CONFIGURE_OPTS+=" --disable-dependency-tracking"
fi
fi
# Remove option --sysconfdir=... if not supported
- if ! cat ${LFS_TMP}/${PACKAGE}/configure | \
- grep -q "sysconfdir"; then
+ if ! cat ${SRC_DIR}/configure | grep -q "sysconfdir"; then
# Split on space, one per line.
# Remove line --sysconfdir=...
# Join separate lines on one line
# Remaining arguments: Additional configure options
# Options:
# -c Do not decompress package
+# -d DIR Change to directory DIR before configuring and building.
# -j Disable parallel make for this package
# -l Unique identification label in 'install.log'
# (default is package name and version)
export DECOMPRESS="1"
export IPKG_MODE="ac" # Default mode if not specified
export HVLABEL="" # Global variable
+ export SRC_DIR="" # Global variable, source directory
+ export BUILD_DIR="" # Global variable, build directory
+ export SRC_SUBDIR="" # Global variable
export ENABLE_DEPENDENCY_TRACKING="0"
local HVMAKE_ORIG=${HVMAKE}
- while getopts "cjl:m:s:t" flag ;do
+ while getopts "cd:jl:m:s:t" flag ;do
case ${flag} in
c)
# Do not decompress package
DECOMPRESS="0"
;;
+ d)
+ SRC_SUBDIR=${OPTARG}
+ ;;
j)
# Disable parallel make only for this package
HVMAKE="make"
PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
PACKAGE_DONE=${LFS_LOG_DIR}/${HVLABEL}.done
PACKAGE_STATUS=${LFS_LOG_DIR}/${HVLABEL}.status
+ SRC_DIR="${LFS_TMP}/${PACKAGE}"
+ BUILD_DIR="${LFS_TMP}/${PACKAGE}"
+
+ if [ -n "${SRC_SUBDIR}" ]; then
+ SRC_DIR+="/${SRC_SUBDIR}"
+ fi
+
+ case "${IPKG_MODE}" in
+ ac)
+ BUILD_DIR="${LFS_TMP}/${PACKAGE}-build"
+ ;;
+ acnb|noac|xpm)
+ BUILD_DIR="${SRC_DIR}"
+ ;;
+ esac
# Checking if package was previously successfully installed
if [ -f ${PACKAGE_DONE} ]; then
+++ /dev/null
-Submitted By: Hugo Villeneuve <hugo at hugovil dot com>
-Date: 2011-08-25
-Initial Package Version: 2.5
-Upstream Status: Not sent
-Origin: Hugo Villeneuve
-Description: Fix the following compilation error:
- /bin/sh ../../../libtool --tag=CXX --mode=link g++ -I../../../include -I
- -pipe -O2 -march=native -fomit-frame-pointer -version-info 2:4:0 -L -o
- libaggplatformX11.la -rpath /usr/local/lib
- libaggplatformX11_la-agg_platform_support.lo -lX11
- libtool: link: require no space between `-L' and `-o'
-
-This is caused by an empty variable x_libraries. Added a conditional automake
-variable to prevent that.
-
-diff -Naur agg-2.5.orig/configure.in agg-2.5.new/configure.in
---- agg-2.5.orig/configure.in 2006-10-09 00:06:36.000000000 -0400
-+++ agg-2.5.new/configure.in 2011-08-25 22:49:03.595769037 -0400
-@@ -123,6 +123,10 @@
- AM_CONDITIONAL(ENABLE_X11,[test x$no_x = x -a xno != x$enable_platform -a x$win32_host != xyes])
- AC_SUBST(x_includes)
- AC_SUBST(x_libraries)
-+
-+dnl To avoid empty "-L", because libtool doesn't like that.
-+AM_CONDITIONAL(EMPTY_X_LIBRAIRIES,[test x$x_libraries = x])
-+
- dnl ###############################################
-
- dnl Settung up library version
-diff -Naur agg-2.5.orig/src/platform/X11/Makefile.am agg-2.5.new/src/platform/X11/Makefile.am
---- agg-2.5.orig/src/platform/X11/Makefile.am 2006-12-10 19:59:45.000000000 -0500
-+++ agg-2.5.new/src/platform/X11/Makefile.am 2011-08-25 22:49:15.801769061 -0400
-@@ -1,7 +1,13 @@
- if ENABLE_X11
- lib_LTLIBRARIES = libaggplatformX11.la
-
-+if EMPTY_X_LIBRAIRIES
-+# To avoid empty "-L", because libtool doesn't like that.
-+libaggplatformX11_la_LDFLAGS = -version-info @AGG_LIB_VERSION@
-+else
- libaggplatformX11_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ -L@x_libraries@
-+endif
-+
- libaggplatformX11_la_SOURCES = agg_platform_support.cpp
- libaggplatformX11_la_CXXFLAGS = -I$(top_srcdir)/include -I@x_includes@
- libaggplatformX11_la_LIBADD = -lX11