aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Ferrell <major@homeonderanged.org>2012-05-01 18:36:18 -0500
committerMark Ferrell <major@homeonderanged.org>2012-05-01 18:36:18 -0500
commit06d559978f86f401f2ceec338dff3fcbd65505e3 (patch)
tree8e691e0b483c542f6b907009134fbb3751f42089
parent8326a8e47ae76c6b13a48a52902b8767081aab7e (diff)
Support pkg_prep()
* Finally support defining pkg_prep() in the Buildrules and calling it from build-package. This has the potential to cleanup some convoluted build scripts.
-rwxr-xr-xscripts/builder/build-package28
1 files changed, 17 insertions, 11 deletions
diff --git a/scripts/builder/build-package b/scripts/builder/build-package
index af70e01..c57a209 100755
--- a/scripts/builder/build-package
+++ b/scripts/builder/build-package
@@ -21,6 +21,11 @@ exit_cleanup()
}
trap exit_cleanup EXIT
+pkg_prep()
+{
+ return
+}
+
pkg_compile()
{
# FIXME these defaults need moved elsewhere
@@ -36,7 +41,15 @@ pkg_compile()
make ${MAKE_OPTS} && make DESTDIR="${D}" install
}
-eval $(build-query --environ "${1}")
+# 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}"
## Cleanup the build build environment
for dir in "${S}" "${D}"; do
@@ -46,6 +59,7 @@ for dir in "${S}" "${D}"; do
mv "${dir}" "${dir}.old"
find "${dir}.old" -delete &
done
+unset dir
echo "prepping: ${1}"
mkenv "prep"
@@ -73,6 +87,8 @@ else
done
fi
+cd "${W}" && pkg_prep >> "${PKG_LOGFILE}" 2>&1
+
# FIXME wrap up the patch command with something more functional
if [ ! -z "${PATCHES}" ]; then
for patch in ${PATCHES}; do
@@ -92,16 +108,6 @@ eval "$(build-query --toolchain "${CHOST}")"
mkenv "compile"
PKG_LOGFILE="${L}/compile.log"
-# 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