Skip to content

starship: update to 1.27.0. - #63282

Open
sabbaghpierre wants to merge 1 commit into
void-linux:masterfrom
sabbaghpierre:starship
Open

sabbaghpierre wants to merge 1 commit into
void-linux:masterfrom
sabbaghpierre:starship

Conversation

@sabbaghpierre

Copy link
Copy Markdown
Contributor

Testing the changes

  • I tested the changes in this PR: YES

Local build testing

  • I built this PR locally for my native architecture, (x86_64-glibc)

@slymattz

Copy link
Copy Markdown
Contributor

You could work around the cross-compilation problem with the solution below:

_setup_env() {
# workaround the cc-rs mixing CFLAGS for host and target.
# https://github.com/rust-lang/cc-rs/issues/1469
export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \
CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \
LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \
CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \
CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \
LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \
CFLAGS="" CXXFLAGS="" LDFLAGS=""
}

diff --git a/srcpkgs/starship/template b/srcpkgs/starship/template
index 5a404b10c7a..f41a1e338dd 100644
--- a/srcpkgs/starship/template
+++ b/srcpkgs/starship/template
@@ -14,10 +14,31 @@ distfiles="https://github.com/starship/starship/archive/refs/tags/v${version}.ta
 checksum=f1887ffa88a7ba437d2932501794047e28d03387996f7d1c364631c053cffc44
 make_check_pre="env HOME=${wrksrc}/fake-home"
 
+_setup_env() {
+	# workaround the cc-rs mixing CFLAGS for host and target.
+	# https://github.com/rust-lang/cc-rs/issues/1469
+	export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \
+	       CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \
+	       LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \
+	       CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \
+	       CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \
+	       LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \
+	       CFLAGS="" CXXFLAGS="" LDFLAGS=""
+}
+
 pre_check() {
+	_setup_env
 	mkdir -p fake-home
 }
 
+pre_build() {
+	_setup_env
+}
+
+pre_install() {
+	_setup_env
+}
+
 post_install() {
 	for shell in bash fish zsh; do
 		vtargetrun ${DESTDIR}/usr/bin/starship completions ${shell} > starship.${shell}

maintainer ping: @cinerea0

@sabbaghpierre

Copy link
Copy Markdown
Contributor Author

@slymattz I was looking for solutions regarding this and they all point out to the edits you suggested, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants