summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/cmd/build.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/cmd/build.sh b/lib/cmd/build.sh
index 77efce0..4a33b2d 100644
--- a/lib/cmd/build.sh
+++ b/lib/cmd/build.sh
@@ -62,16 +62,21 @@ cmd_build_main()
rand
dir="/prokit/build.${rand_x}"
uname_s="$( (uname -s) 2>/dev/null)" || uname_s='unknown'
- mkdir -p "${root}${dir}/pkg"
+ mkdir -p "${root}${dir}/pkg" "${root}${dir}/builddeps/control" \
+ "${root}${dir}/builddeps/data"
case "${uname_s}" in
'Linux')
mount -o bind "${prev_arg}" "${root}${dir}/pkg"
;;
esac
+ cmd_build_make_deps_pkg "${root}${dir}" "${rand_x}"
+
chroot_exec "${root}" sh <<-EOF
cd '${dir}/pkg'
+ opkg install ../builddeps.opk
opkbuild ${@}
+ opkg remove prokit-builddeps-${rand_x}
EOF
case "${uname_s}" in
@@ -86,3 +91,24 @@ cmd_build_main()
done
rmdir "${root}${dir}"
}
+
+cmd_build_make_deps_pkg()
+{
+ local build_dir="${1}"
+ local build_id="${2}"
+
+ printf '2.0\n' >"${build_dir}/builddeps/debian-binary"
+ cat >"${build_dir}/builddeps/control/control" <<-EOF
+ Package: prokit-builddeps-${build_id}
+ Source: prokit
+ Version: 1.0
+ Architecture: all
+ Platform: all
+ Description: Build dependencies metapackage generated by prokit
+ EOF
+ (cd "${build_dir}/builddeps/data"; tar -czf ../data.tar.gz .)
+ (cd "${build_dir}/builddeps/control"; tar -czf ../control.tar.gz .)
+ (cd "${build_dir}/builddeps"; tar -czf ../builddeps.opk \
+ 'debian-binary' 'data.tar.gz' 'control.tar.gz')
+ rm -Rf "${build_dir}/builddeps"
+}