diff --git a/Manual.md b/Manual.md index 1f3d1d5611d..7a98baeeca4 100644 --- a/Manual.md +++ b/Manual.md @@ -384,6 +384,8 @@ by all supported architectures. - `nostrip` If set, the ELF binaries with debugging symbols won't be stripped. By default all binaries are stripped. +- `nocross` If set, cross compilation won't be allowed and will exit with an error. + - `python_versions` A white space seperated list of python versions which will be used to build that package. This is only used by the `python-module` build style. diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh index 7e83c4ac630..eccd770a562 100644 --- a/common/environment/setup/sourcepkg.sh +++ b/common/environment/setup/sourcepkg.sh @@ -3,7 +3,7 @@ ## VARIABLES unset -v pkgname version revision short_desc homepage license maintainer -unset -v only_for_archs distfiles checksum build_style nonfree +unset -v only_for_archs distfiles checksum build_style nonfree nocross unset -v configure_script configure_args wrksrc build_wrksrc create_wrksrc unset -v make_cmd make_build_args make_install_args make_build_target make_install_target python_versions unset -v patch_args disable_parallel_build keep_libtool_archives diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index deaadefb037..b7a3fc2ce2a 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -388,6 +388,9 @@ setup_pkg() { wrksrc="$XBPS_BUILDDIR/$wrksrc" fi + if [ "$cross" -a "$nocross" ]; then + msg_error "$pkgver: cannot be cross compiled, exiting...\n" + fi } setup_pkg_depends() {