Index: common/common.sh ================================================================== --- common/common.sh +++ common/common.sh @@ -213,10 +213,11 @@ function preinstall() { : } function install() { + local installlibdir local installpkgdir local pkglibfile mkdir -p "${installdir}/lib" || return 1 ${MAKE:-make} tcllibdir="${installdir}/lib" "${make_extra[@]}" install || return 1 @@ -228,28 +229,28 @@ if [ -z "${tclpkgversion}" ]; then tclpkgversion="${version}" fi - installpkgdir="$(echo "${installdir}/lib"/*)" + installlibdir="${installdir}/lib" - if [ -d "${installpkgdir}" ]; then - if [ ! -e "${installpkgdir}/pkgIndex.tcl" ]; then - case "${pkg_configure_shared_build}" in - 0) - cat << _EOF_ > "${installpkgdir}/pkgIndex.tcl" + if [ "${pkg_configure_shared_build}" = '0' ]; then + find "${installlibdir}" -name '*.a' | sed 's@/[^/]*\.a$@@' | head -n 1 | while IFS='' read -r installpkgdir; do + if [ ! -e "${installpkgdir}/pkgIndex.tcl" ]; then + cat << _EOF_ > "${installpkgdir}/pkgIndex.tcl" package ifneeded ${tclpkg} ${tclpkgversion} [list load {} ${tclpkg}] _EOF_ - ;; - 1) - pkglibfile="$(find "${installpkgdir}" -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.shlib' | head -n 1 | sed 's@^.*/@@')" - cat << _EOF_ > "${installpkgdir}/pkgIndex.tcl" + fi + done + elif [ "${pkg_configure_shared_build}" = '1' ]; then + find "${installlibdir}" -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.shlib' | sed 's@/[^/]*$@@' | head -n 1 | while IFS='' read -r installpkgdir; do + if [ ! -e "${installpkgdir}/pkgIndex.tcl" ]; then + cat << _EOF_ > "${installpkgdir}/pkgIndex.tcl" package ifneeded ${tclpkg} ${tclpkgversion} [list load [file join \$dir ${pkglibfile}]] _EOF_ - ;; - esac - fi + fi + done fi } function postinstall() { : @@ -259,11 +260,11 @@ local file # Install files needed by installation cp -r "${installdir}/lib" "${runtimedir}" || return 1 - find "${runtimedir}" -name '*.a' -type f | while IFS='' read -r file; do + find "${runtimedir}" '(' -name '*.a' -o -name '*.a.linkadd' ')' -type f | while IFS='' read -r file; do rm -f "${file}" done # Ensure that some files were installed if ! find "${runtimedir}" -type f 2>/dev/null | grep '^' >/dev/null; then ADDED dbus/build-kitcreator-dbif.sh Index: dbus/build-kitcreator-dbif.sh ================================================================== --- dbus/build-kitcreator-dbif.sh +++ dbus/build-kitcreator-dbif.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +# BuildCompatible: KitCreator + +pkg='dbif' +version="1.0" +url="http://sourceforge.net/projects/dbus-tcl/files/dbif/${version}/dbif-${version}.tar.gz" +sha256='50d1eed6284d1db168011d16d36ed4724109a0cff73bee16c436aa604893db24' + +function preconfigure() { + make_extra=(moduledir="${installdir}/lib/tcl8/8.5") +} ADDED dbus/build-kitcreator-dbus.sh Index: dbus/build-kitcreator-dbus.sh ================================================================== --- dbus/build-kitcreator-dbus.sh +++ dbus/build-kitcreator-dbus.sh @@ -0,0 +1,17 @@ +#! /usr/bin/env bash + +# BuildCompatible: KitCreator + +pkg='dbus' +version="2.0" +url="http://sourceforge.net/projects/dbus-tcl/files/dbus/${version}/dbus-${version}.tar.gz" +sha256='428b4045d395b0d26255730ce7c0d14850e45abb3c7cc6d9d48c1d2b723bb16a' + +function postinstall() { + local archive + + archive="$(find "${installdir}" -name '*.a' | head -n 1)" + if [ -n "${archive}" ]; then + echo '-ldbus-1' > "${archive}.linkadd" + fi +} DELETED dbus/build.sh Index: dbus/build.sh ================================================================== --- dbus/build.sh +++ dbus/build.sh @@ -1,122 +0,0 @@ -#! /usr/bin/env bash - -if [ ! -f 'build.sh' ]; then - echo 'ERROR: This script must be run from the directory it is in' >&2 - - exit 1 -fi -if [ -z "${TCLVERS}" ]; then - echo 'ERROR: The TCLVERS environment variable is not set' >&2 - - exit 1 -fi - -# Preparation - -rm -rf 'build' 'out' 'inst' -mkdir 'build' 'out' 'inst' || exit 1 - -# The dbus package - -DBUSVERS="2.0" -SRC="src/dbus-${DBUSVERS}.tar.gz" -SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbus/${DBUSVERS}/dbus-${DBUSVERS}.tar.gz/download" -SRCHASH='-' -BUILDDIR="$(pwd)/build/dbus-${DBUSVERS}" -OUTDIR="$(pwd)/out" -INSTDIR="$(pwd)/inst" -export DBUSVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR - -# Set configure options for this sub-project -LDFLAGS="${LDFLAGS} ${KC_DBUS_LDFLAGS}" -CFLAGS="${CFLAGS} ${KC_DBUS_CFLAGS}" -CPPFLAGS="${CPPFLAGS} ${KC_DBUS_CPPFLAGS}" -LIBS="${LIBS} ${KC_DBUS_LIBS}" -export LDFLAGS CFLAGS CPPFLAGS LIBS - -if [ ! -f "${SRC}" ]; then - mkdir 'src' >/dev/null 2>/dev/null - - if [ ! -d 'buildsrc' ]; then - download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1 - fi -fi - -( - cd 'build' || exit 1 - - if [ ! -d '../buildsrc' ]; then - gzip -dc "../${SRC}" | tar -xf - - else - cp -rp ../buildsrc/* './' - fi - - cd "${BUILDDIR}" || exit 1 - echo "Running: ./configure --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}" - ./configure --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} - - echo "Running: ${MAKE:-make}" - ${MAKE:-make} || exit 1 - - echo "Running: ${MAKE:-make} install" - ${MAKE:-make} install - - mkdir "${OUTDIR}/lib" || exit 1 - cp -r "${INSTDIR}/lib"/dbus* "${OUTDIR}/lib/" - - "${STRIP:-strip}" -g "${OUTDIR}"/lib/dbus-*/*.so >/dev/null 2>/dev/null - exit 0 -) || exit 1 - -# The dbif module - -DBIFVERS="1.0" -SRC="src/dbif-${DBIFVERS}.tar.gz" -SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbif/${DBIFVERS}/dbif-${DBIFVERS}.tar.gz/download" -BUILDDIR="$(pwd)/build/dbif-${DBIFVERS}" -OUTDIR="$(pwd)/out" -INSTDIR="$(pwd)/inst" -export DBIFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR - -# Set configure options for this sub-project -LDFLAGS="${KC_DBIF_LDFLAGS}" -CFLAGS="${KC_DBIF_CFLAGS}" -CPPFLAGS="${KC_DBIF_CPPFLAGS}" -LIBS="${KC_DBIF_LIBS}" -export LDFLAGS CFLAGS CPPFLAGS LIBS - -if [ ! -f "${SRC}" ]; then - mkdir 'src' >/dev/null 2>/dev/null - - if [ ! -d 'buildsrc' ]; then - rm -f "${SRC}.tmp" - wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 - mv "${SRC}.tmp" "${SRC}" - fi -fi - -( - cd 'build' || exit 1 - - if [ ! -d '../buildsrc' ]; then - gzip -dc "../${SRC}" | tar -xf - - else - cp -rp ../buildsrc/* './' - fi - - cd "${BUILDDIR}" || exit 1 - echo "Running: ./configure --prefix=\"${INSTDIR}\" moduledir=\"${INSTDIR}/lib/tcl8/8.5\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}" - ./configure --prefix="${INSTDIR}" moduledir="${INSTDIR}/lib/tcl8/8.5" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} - - echo "Running: ${MAKE:-make}" - ${MAKE:-make} || exit 1 - - echo "Running: ${MAKE:-make} install" - ${MAKE:-make} install - - mkdir -p "${OUTDIR}/lib/tcl8/8.5" || exit 1 - cp -r "${INSTDIR}/lib/tcl8/8.5/"dbif*.tm "${OUTDIR}/lib/tcl8/8.5/" - exit 0 -) || exit 1 - -exit 0 Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -224,50 +224,63 @@ build_script='./build.sh' if [ -x 'kitcreator-build.sh' ]; then build_script='./kitcreator-build.sh' fi - if useCommonBuildSystem "${build_script}"; then - ( - . ../common/common.sh - . "${build_script}" - - set -x - - init || die 'init failed' - - predownload || die 'predownload failed' - download || die 'download failed' - postdownload || die 'postdownload failed' - - extract || die 'extract failed' - - apply_patches || die 'apply patches failed' - - cd "${workdir}" || exit 1 - - preconfigure || die 'preconfigure failed' - configure || die 'configure failed' - postconfigure || die 'postconfigure failed' - - prebuild || die 'prebuild failed' - build || die 'build failed' - postbuild || die 'postbuild failed' - - preinstall || die 'preinstall failed' - install || die 'install failed' - postinstall || die 'postinstall failed' - - createruntime || die 'createruntime failed' - - set +x - - rm -rf "${workdir}" - ) 3>&1 4>&2 > build.log 2>&1 || exit 1 + if [ -f "${build_script}" ]; then + build_scripts=("${build_script}") else - "${build_script}" 3>&1 4>&2 >> build.log 2>&1 || exit 1 + build_scripts=($(echo build-kitcreator-*.sh)) fi + + call_pkg_init='1' + for build_script in "${build_scripts[@]}"; do + if useCommonBuildSystem "${build_script}"; then + ( + . ../common/common.sh + . "${build_script}" + + set -x + + if [ "${call_pkg_init}" = '1' ]; then + init || die 'init failed' + fi + + predownload || die 'predownload failed' + download || die 'download failed' + postdownload || die 'postdownload failed' + + extract || die 'extract failed' + + apply_patches || die 'apply patches failed' + + cd "${workdir}" || exit 1 + + preconfigure || die 'preconfigure failed' + configure || die 'configure failed' + postconfigure || die 'postconfigure failed' + + prebuild || die 'prebuild failed' + build || die 'build failed' + postbuild || die 'postbuild failed' + + preinstall || die 'preinstall failed' + install || die 'install failed' + postinstall || die 'postinstall failed' + + createruntime || die 'createruntime failed' + + set +x + + rm -rf "${workdir}" + ) 3>&1 4>&2 >> build.log 2>&1 || exit 1 + else + "${build_script}" 3>&1 4>&2 >> build.log 2>&1 || exit 1 + fi + + call_pkg_init='0' + done ) || failed="1" fi if [ "${failed}" = "1" ]; then echo " failed."