Skip to content

Commit

Permalink
Add debian cross build support
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Mar 17, 2022
1 parent 42daf8b commit df9a8d0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build-pkg-deb
Expand Up @@ -180,6 +180,29 @@ pkg_runscripts_deb() {
fi
}

pkg_sysrootinstall_deb() {
if test "x$1" = "x--prepare" ; then
assert_dir_path "$BUILD_SYSROOT"
chroot $BUILD_ROOT mkdir -p "$BUILD_SYSROOT"
local target=$(queryconfig target --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH")
if test -n "$target" ; then
local debarch=$(deb_chroot $BUILD_ROOT dpkg-architecture -q DEB_HOST_ARCH --host-type "$target")
if test -n "$debarch" ; then
echo "Adding architecture $debarch"
deb_chroot $BUILD_ROOT dpkg --add-architecture "$debarch"
fi
fi
return
fi
if test "x$1" = "x--finalize" ; then
return
fi

( deb_chroot $BUILD_ROOT dpkg --install $DEB_UNSAFE_IO --force-depends .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg|Preparing to unpack )/||/^$/||print'
}


# Local Variables:
# mode: Shell-script
# End:
12 changes: 12 additions & 0 deletions build-recipe-dsc
Expand Up @@ -158,6 +158,18 @@ dsc_build() {
DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
chmod +x $buildroot/$TOPDIR/SOURCES/build.script
fi
if test -z "$ABUILD_TARGET" ; then
ABUILD_TARGET=$(queryconfig target --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" )
test -z "$ABUILD_TARGET" || echo "build target is $ABUILD_TARGET"
fi
if test -n "$ABUILD_TARGET" ; then
DSC_BUILD_CMD="$DSC_BUILD_CMD --host-type $ABUILD_TARGET"
fi
if test -n "$ABUILD_TARGET" -a -d "$BUILD_ROOT/.build.sysroot" ; then
DSC_BUILD_CMD="$DSC_BUILD_CMD -Pcross,nocheck"
DSC_BUILD_OPTIONS="$DSC_BUILD_OPTIONS nocheck"
DSC_BUILD_OPTIONS="${DSC_BUILD_OPTIONS# }"
fi

chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then
Expand Down

0 comments on commit df9a8d0

Please sign in to comment.