ports/net-im/fractal/files/patch-scripts_cargo.sh
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

20 lines
848 B
Bash

--- scripts/cargo.sh.orig 2020-08-07 12:02:09 UTC
+++ scripts/cargo.sh
@@ -1,15 +1,13 @@ export OUTPUT="$2"
#!/bin/sh
export OUTPUT="$2"
-export CARGO_TARGET_DIR="$3"/target
-export CARGO_HOME="$CARGO_TARGET_DIR"/cargo-home
export FRACTAL_PROFILE="$4"
if [ "$FRACTAL_PROFILE" = "Devel" ]
then
echo "DEBUG MODE"
- cargo build --manifest-path $1/Cargo.toml -p fractal-gtk && cp "$CARGO_TARGET_DIR"/debug/fractal-gtk "$OUTPUT"
+ cargo build --manifest-path $1/Cargo.toml -p fractal-gtk && cp "$CARGO_TARGET_DIR"/debug/fractal-gtk "$OUTPUT"
else
echo "RELEASE MODE"
- cargo build --manifest-path $1/Cargo.toml --release -p fractal-gtk && cp "$CARGO_TARGET_DIR"/release/fractal-gtk "$OUTPUT"
+ cargo build --manifest-path $1/Cargo.toml --release -p fractal-gtk && cp "$CARGO_TARGET_DIR"/release/fractal-gtk "$OUTPUT"
fi