freebsd-ports/sysutils/rust-coreutils/Makefile
Yuri Victorovich f99a708957 Mk/Uses/cargo.mk: Remove cross-compilation options for Rust-based ports
Reasons:
* Port build shouldn't use cross-compilation mode
  because it buids for the same architecture.
* RUSTFLAGS isn't passed to the build of all or some Rust ports
  in the cross-compilation mode.

Essential changes:
* Remove the CARGO_BUILD_TARGET make variable.
* Remove CARGO_BUILD_TARGET and CARGO_TARGET_* from CARGO_ENV.
* Update many ports that used CARGO_BUILD_TARGET.
* Build paths now don't include the architecture triplet part.

Immadiate benefits:
* Unbreak build on architectures like i386 that sometimes require
  special RUSTFLAGS that were not effective in the cross-compilation
  mode.

Ports that really need cross-compilation for some reason should
enable it on case-by-case basis. Example: net-p2p/cncli
(Not sure why does net-p2p/cncli actually need it, but it only
builds with these options.)

PR:		280305
Approved by:	rust@FreeBSD.org (maintainer's timeout; 98 days)
2024-10-22 20:11:24 -07:00

50 lines
1.6 KiB
Makefile

PORTNAME= rust-coreutils
DISTVERSION= 0.0.27
PORTREVISION= 2
CATEGORIES= sysutils
MAINTAINER= pkubaj@FreeBSD.org
COMMENT= Cross-platform Rust rewrite of the GNU coreutils
WWW= https://crates.io/crates/coreutils
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libonig.so:devel/oniguruma
USES= cargo pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= uutils
GH_PROJECT= coreutils
CARGO_FEATURES= unix
BINPREFIX= uu-
PLIST_SUB= BINPREFIX=${BINPREFIX}
post-build:
${INSTALL_SCRIPT} ${FILESDIR}/symlink-install-helper.sh.in ${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%GREP%%|${GREP}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%CARGO_TARGET_DIR%%|${CARGO_TARGET_DIR}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%CARGO_BUILD_TARGET%%|${CARGO_BUILD_TARGET}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%SED%%|${SED}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%TR%%|${TR}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%RLN%%|${RLN}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%STAGEDIR%%|${STAGEDIR}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
@${REINPLACE_CMD} -e 's|%%BINPREFIX%%|${BINPREFIX}|g' \
${CARGO_TARGET_DIR}/symlink-install-helper.sh
do-install:
${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/release/coreutils \
${STAGEDIR}${PREFIX}/bin/${BINPREFIX}coreutils
${CARGO_TARGET_DIR}/symlink-install-helper.sh
.include <bsd.port.mk>