aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/builder/build-archive44
-rwxr-xr-xscripts/builder/build-compile75
-rwxr-xr-xscripts/builder/build-package2
-rwxr-xr-xscripts/builder/build-prep54
4 files changed, 2 insertions, 173 deletions
diff --git a/scripts/builder/build-archive b/scripts/builder/build-archive
deleted file mode 100755
index 11f89d7..0000000
--- a/scripts/builder/build-archive
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env build
-
-echo "archiving: ${1}"
-eval $(build-query --environ "${1}")
-mkenv "archive"
-
-ARCHIVE_TMP1=
-ARCHIVE_TMP2=
-cleanup()
-{
- [ -f "${ARCHIVE_TMP1}" ] && rm -f "${ARCHIVE_TMP1}"
- [ -f "${ARCHIVE_TMP2}" ] && rm -f "${ARCHIVE_TMP2}"
- exit 0
-}
-trap cleanup EXIT
-set -e
-
-ARCHIVE_TMP1="$(mktemp "${BUILDER_TMPDIR}/${NAME}-${VERSION}.XXXXXXXX")"
-ARCHIVE_TMP2="$(mktemp "${BUILDER_TMPDIR}/${NAME}-${VERSION}.XXXXXXXX")"
-
-[ -f "${ARCHIVE_TMP1}" ] || die "failed to create temporary archive for package '${NAME}'"
-[ -f "${ARCHIVE_TMP2}" ] || die "failed to create temporary archive for package '${NAME}'"
-
-case "${ARCHIVE_FORMAT}" in
-(tbz2|tar.bz2) ARCHIVE_COMPRESSOR="bzip2 -cv";;
-(tgz|tar.gz) ARCHIVE_COMPRESSOR="gzip -cv";;
-(*) die "unsupported archive format '${ARCHIVE_FORMAT}'";;
-esac
-
-if [ ! -d "${BUILDER_ATFDIR}/${CATEGORY}" ]; then
- mkdir -p "${BUILDER_ATFDIR}/${CATEGORY}"
-fi
-
-cd "${D}"
-tar -cvf "${ARCHIVE_TMP1}" . > "${L}/archive.log" 2>&1
-${ARCHIVE_COMPRESSOR} "${ARCHIVE_TMP1}" > "${ARCHIVE_TMP2}" 2>> "${L}/archive.log"
-if [ -f "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}.${ARCHIVE_FORMAT}" ]; then
- rm -f "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}.${ARCHIVE_FORMAT}"
-fi
-mv -v "${ARCHIVE_TMP2}" "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}.${ARCHIVE_FORMAT}" >> "${L}/archive.log" 2>&1
-cd "${W}"
-rm -rf "${D}"
-
-# vim: filetype=sh
diff --git a/scripts/builder/build-compile b/scripts/builder/build-compile
deleted file mode 100755
index 9eb02e8..0000000
--- a/scripts/builder/build-compile
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env build
-
-echo "compiling: ${1}"
-
-pkg_compile()
-{
- # FIXME these defaults need moved elsewhere
- if [ -f "configure" ]; then
- ./configure --host="${CHOST}" \
- --prefix="/usr" --mandir=/usr/share/man \
- --docdir=/usr/share/doc \
- --sysconfdir=/etc \
- ${CONFIG_OPTS}
- fi
-
- # FIXME we need a bunch of make options in here
- make ${MAKE_OPTS} && make DESTDIR="${D}" install
-}
-
-# Declare compilation variables before import as the package may potentially
-# overwrite this data, in particular the toolchain data is usually rewritten
-# within the toolchain/buildtools rule.
-eval "$(build-query --toolchain "${CHOST}")"
-
-# pkgconfig can be a right pita...
-PKG_CONFIG_LIBDIR="${SYSROOT}/usr/share/pkgconfig:${SYSROOT}/usr/lib/pkgconfig"
-export PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
-export PKG_CONFIG_SYSROOT_DIR="${SYSROOT}"
-
-# Don't pass along the builder jobcontrol data to child processes
-unset MAKEFLAGS
-
-import "${1}"
-
-## Prep the build environment
-# Technically much of this should have been done in build-prep, and this sort
-# of duplication of work may be useful to make a function within the top-level
-# build script. Perhaps builder_mkenv [prep|compile|archive|etc..]
-if [ -d "${D}" ]; then
- mv "${D}" "${D}.old"
- rm -rf "${D}.old" &
-fi
-mkenv "compile"
-
-## Build the source and install it into the DESTDIR
-# Ironically this is the heart of what the build-engine does, and yet it has
-# been reduced to the simplest component of the entire system.
-cd "${S}" && pkg_compile >> "${L}/compile.log" 2>&1
-
-## Save Space!
-# At this point everything important should be installed into ${D}, and any
-# form of reruning the build will remove ${S} before prepping it for build, so
-# we might as well gut it now. About the best option we could do would be to
-# avoid gutting this when being run in --debug mode.
-rm -rf "${S}" &
-
-##
-# Generate the file index. This is done as a 0 delimited file stored within
-# the destination filesystem. This allows for easy checking of the installed
-# data as well as easy removal of individual binary packages from the sysroot.
-mkdir -p "${D}/var/db/binpkgs/${CATEGORY}"
-binpkg_list="$(mktemp "${T}/binpkg.XXXXXXXX")"
-if [ ! -e "${binpkg_list}" ]; then
- die "failed to create package inventory"
-fi
-cd "${D}"
-find . -depth -print0 > "${binpkg_list}"
-mv "${binpkg_list}" "${D}/var/db/binpkgs/${CATEGORY}/${NAME}"
-
-##
-# Technically everything should be done, but our removal of ${D}.old and ${S}
-# might still be running, so wait for everything before we exit.
-wait
-
-# vim: filetype=sh
diff --git a/scripts/builder/build-package b/scripts/builder/build-package
index 01ab4a9..2bb38c6 100755
--- a/scripts/builder/build-package
+++ b/scripts/builder/build-package
@@ -58,6 +58,7 @@ mkenv "prep"
PKG_LOGFILE="${L}/prep.log"
if [ -d "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source" ]; then
+ echo "source: '${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source"
if [ "$(command -v rsync)" ]; then
if ! rsync -rav --delete "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source/" "${S}"; then
die "failed to sync source to '${S}'"
@@ -74,6 +75,7 @@ else
if [ ! -f "${BUILDER_SRCDIR}/${file}" ]; then
die "source does not exist '${file}'"
fi
+ echo "source: '${BUILDER_SRCDIR}/${file}"
tar xavf "${BUILDER_SRCDIR}/${file}" -C "${W}" >> "${PKG_LOGFILE}" 2>&1
done
diff --git a/scripts/builder/build-prep b/scripts/builder/build-prep
deleted file mode 100755
index bcf85b7..0000000
--- a/scripts/builder/build-prep
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env build
-
-echo "prepping: ${1}"
-
-eval $(build-query --environ "${1}")
-
-## Prep the build environment
-if [ -d "${S}" ]; then
- mv "${S}" "${S}.old"
- rm -rf "${S}.old" &
-fi
-mkenv "prep"
-
-if [ -d "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source" ]; then
- echo "using source: '${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source"
- if [ "$(command -v rsync)" ]; then
- if ! rsync -rav --delete "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source/" "${S}"; then
- die "failed to sync source to '${S}'"
- fi
- else
- if ! cp -vadpR "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source" "${S}"; then
- die "failed to copy source to '${S}'"
- fi
- fi >> "${L}/prep.log" 2>&1
-else
- # FIXME this stuff needs a lot of work
- for url in ${SOURCE_URI}; do
- file="$(build-fetch --name "${url}")"
- if [ ! -f "${BUILDER_SRCDIR}/${file}" ]; then
- die "source does not exist '${file}'"
- fi
-
- tar xavf "${BUILDER_SRCDIR}/${file}" -C "${W}" >> "${L}/prep.log" 2>&1
- done
-fi
-
-# FIXME wrap up the patch command with something more functional
-if [ ! -z "${PATCHES}" ]; then
- for patch in ${PATCHES}; do
- echo "${NAME}: applying patch '${patch}'" | tee -a "${L}/prep.log"
- if ! patch -l -t -d "${S}" -p1 < "${F}/${NAME}-${VERSION}-${patch}.patch"; then
- exit 1
- fi >> "${L}/prep.log" 2>&1
- done
-fi
-
-
-##
-# Technically everything should be done, but our removal of ${S}.old might still be
-# running, so wait for everything before we exit.
-wait
-
-
-# vim: filetype=sh