summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rules/post/ptxd_make_world_install.make24
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk13
-rw-r--r--scripts/lib/ptxd_make_world_install.sh46
3 files changed, 79 insertions, 4 deletions
diff --git a/rules/post/ptxd_make_world_install.make b/rules/post/ptxd_make_world_install.make
index b7b1718b1..89b0eed79 100644
--- a/rules/post/ptxd_make_world_install.make
+++ b/rules/post/ptxd_make_world_install.make
@@ -16,6 +16,20 @@ world/install = \
ptxd_make_world_install
#
+# world/install.pack
+#
+world/install.pack = \
+ $(call world/env, $1) \
+ ptxd_make_world_install_pack
+
+#
+# world/install.unpack
+#
+world/install.unpack = \
+ $(call world/env, $1) \
+ ptxd_make_world_install_unpack
+
+#
# world/install.post
#
world/install.post = \
@@ -41,6 +55,16 @@ $(STATEDIR)/%.install:
@$(call world/install, $(PTX_MAP_TO_PACKAGE_$(*)))
@$(call touch)
+$(STATEDIR)/%.install.pack:
+ @$(call targetinfo)
+ @$(call world/install.pack, $(PTX_MAP_TO_PACKAGE_$(*)))
+ @$(call touch)
+
+$(STATEDIR)/%.install.unpack:
+ @$(call targetinfo)
+ @$(call world/install.unpack, $(PTX_MAP_TO_PACKAGE_$(*)))
+ @$(call touch)
+
$(STATEDIR)/%.install.post:
@$(call targetinfo)
@$(call world/install.post, $(PTX_MAP_TO_PACKAGE_$(*)))
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index e39706b9f..581fe3822 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -275,7 +275,12 @@ END {
print "$(STATEDIR)/" this_pkg ".tags: " "$(STATEDIR)/" this_pkg ".prepare" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".compile: " "$(STATEDIR)/" this_pkg ".prepare" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".install: " "$(STATEDIR)/" this_pkg ".compile" > DGEN_DEPS_POST;
- print "$(STATEDIR)/" this_pkg ".install.post: " "$(STATEDIR)/" this_pkg ".install" > DGEN_DEPS_POST;
+ print "$(STATEDIR)/" this_pkg ".install.pack: " "$(STATEDIR)/" this_pkg ".install" > DGEN_DEPS_POST;
+ print "ifeq ($(strip $(wildcard $(PTXDIST_DEVPKG_PLATFORMDIR)/$(" this_PKG "_DEVPKG))),)" > DGEN_DEPS_POST;
+ print "$(STATEDIR)/" this_pkg ".install.post: " "$(STATEDIR)/" this_pkg ".install.pack" > DGEN_DEPS_POST;
+ print "else" > DGEN_DEPS_POST;
+ print "$(STATEDIR)/" this_pkg ".install.post: " "$(STATEDIR)/" this_pkg ".install.unpack" > DGEN_DEPS_POST;
+ print "endif" > DGEN_DEPS_POST;
if (!(this_pkg ~ /^host-|^cross-/)) {
print "$(STATEDIR)/" this_pkg ".targetinstall: " "$(STATEDIR)/" this_pkg ".install.post" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".targetinstall.post: " "$(STATEDIR)/" this_pkg ".targetinstall" > DGEN_DEPS_POST;
@@ -301,6 +306,9 @@ END {
print \
"$(STATEDIR)/" this_pkg ".prepare: " \
"$(STATEDIR)/" this_dep ".install.post" > DGEN_DEPS_POST;
+ print \
+ "$(STATEDIR)/" this_pkg ".install.unpack: " \
+ "$(STATEDIR)/" this_dep ".install.post" > DGEN_DEPS_POST;
#
# only target packages have targetinstall rules
@@ -331,6 +339,9 @@ END {
print \
"$(STATEDIR)/" this_pkg ".prepare: " \
"$(STATEDIR)/" virtual ".install" > DGEN_DEPS_POST;
+ print \
+ "$(STATEDIR)/" this_pkg ".install.unpack: " \
+ "$(STATEDIR)/" virtual ".install" > DGEN_DEPS_POST;
}
close(PKG_HASHFILE);
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index 42cdb6ad8..a8c570f51 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -57,13 +57,36 @@ ptxd_make_world_install() {
}
export -f ptxd_make_world_install
+#
+# unpack
+#
+# unpack the dev tarball to pkg_pkg_dir
+#
+ptxd_make_world_install_unpack() {
+ local pkg_prefix
+
+ ptxd_make_world_init &&
+
+ case "${pkg_type}" in
+ host|cross) pkg_prefix="${pkg_type}-" ;;
+ *) pkg_prefix="" ;;
+ esac &&
+
+ if [ \! -e "${ptx_pkg_dev_dir}/${pkg_pkg_dev}" ]; then
+ ptxd_bailout "Internal error: '$(ptxd_print_path ${ptx_pkg_dev_dir}/${pkg_pkg_dev})' does not exist."
+ fi &&
+ rm -rf -- "${pkg_pkg_dir}" &&
+ mkdir -p -- "${ptx_pkg_dir}" &&
+ tar -x -C "${ptx_pkg_dir}" -z -f "${ptx_pkg_dev_dir}/${pkg_pkg_dev}"
+}
+export -f ptxd_make_world_install_unpack
#
-# post
+# pack
#
-# cleanup an copy to sysroot
+# pack the dev tarball from pkg_pkg_dir
#
-ptxd_make_world_install_post() {
+ptxd_make_world_install_pack() {
ptxd_make_world_init &&
# remove empty dirs
@@ -82,6 +105,23 @@ ptxd_make_world_install_post() {
xargs -r -0 gawk -f "${PTXDIST_LIB_DIR}/ptxd_make_world_install_mangle_pc.awk" &&
check_pipe_status &&
+ if [ "${pkg_pkg_dev}" != "NO" -a "$(ptxd_get_ptxconf PTXCONF_PROJECT_CREATE_DEVPKGS)" = "y" ]; then
+ tar -c -C "${ptx_pkg_dir}" -z -f "${ptx_pkg_dir}/${pkg_pkg_dev}" "${pkg_pkg_dir##*/}"
+ fi
+}
+export -f ptxd_make_world_install_pack
+
+#
+# post
+#
+# cleanup an copy to sysroot
+#
+ptxd_make_world_install_post() {
+ ptxd_make_world_init &&
+ # do nothing if pkg_pkg_dir does not exist
+ if [ \! -d "${pkg_pkg_dir}" ]; then
+ return
+ fi &&
# prefix paths in la files with sysroot
find "${pkg_pkg_dir}" -name "*.la" -print0 | xargs -r -0 -- \
sed -i \