Skip to content

Commit

Permalink
Only set DEB_BUILD_OPTIONS and DEB_BUILD_PROFILES for cross-building …
Browse files Browse the repository at this point in the history
…when unset

Adapted from sbuild.
  • Loading branch information
jtdor committed May 19, 2024
1 parent fd7ce41 commit 15d6c7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ cross-building (cross-compilation) is automatically set up with `apt-get` and
`dpkg-buildpackage` as described
[in the Debian wiki](https://wiki.debian.org/CrossCompiling#Building_with_dpkg-buildpackage).

To override their automatic cross-compilation setup, pass `CONFIG_SITE`,
`DEB_BUILD_OPTIONS` or `DEB_BUILD_PROFILES` as an environment variable to the
action with an empty or the desired value. The usual parameter(s) for
cross-compilation, i.e., the path of a `cross-config.*` file, `nocheck` or
`cross`, will **not** be assigned to the respective, given variable.

Optional and defaults to the architecture the action is run on (likely amd64).

Basic example for a cross-build:
Expand Down
8 changes: 6 additions & 2 deletions scripts/build_packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ if [ -n "$INPUT_HOST_ARCH" ]; then
if [ -z "${CONFIG_SITE-}" ]; then
export CONFIG_SITE="/etc/dpkg-cross/cross-config.$INPUT_HOST_ARCH"
fi
export DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS:+$DEB_BUILD_OPTIONS }nocheck"
export DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES:+$DEB_BUILD_PROFILES }cross nocheck"
if [ -z "${DEB_BUILD_OPTIONS-}" ]; then
export DEB_BUILD_OPTIONS='nocheck'
fi
if [ -z "${DEB_BUILD_PROFILES-}" ]; then
export DEB_BUILD_PROFILES='cross nocheck'
fi
INPUT_BUILDPACKAGE_OPTS="$INPUT_BUILDPACKAGE_OPTS --host-arch=$INPUT_HOST_ARCH"
fi

Expand Down

0 comments on commit 15d6c7f

Please sign in to comment.