Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 760405 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/dev-lang/rust/rust-1.60.0.ebuild (-6 / +27 lines)
Lines 246-253 Link Here
246
src_prepare() {
246
src_prepare() {
247
	if ! use system-bootstrap; then
247
	if ! use system-bootstrap; then
248
		local rust_stage0_root="${WORKDIR}"/rust-stage0
248
		local rust_stage0_root="${WORKDIR}"/rust-stage0
249
		local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
249
		if [[ ${ABI} == x32 ]]; then
250
250
			local rust_stage0="rust-${RUST_STAGE0_VERSION}-x86_64-unknown-linux-gnu"
251
		else
252
			local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
253
		fi
251
		"${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
254
		"${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
252
			--without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
255
			--without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
253
	fi
256
	fi
Lines 300-306 Link Here
300
	# in case of prefix it will be already prefixed, as --print sysroot returns full path
303
	# in case of prefix it will be already prefixed, as --print sysroot returns full path
301
	[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
304
	[[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
302
305
303
	rust_target="$(rust_abi)"
306
	# If this is x32 but using 64 bit rust-bin then "Canadian
307
	# cross-compile".
308
	# This requires amd64 abi to bootstrap the build toolchain even if
309
	# not enabled
310
	if [[ ${ABI} == x32 ]] && \
311
			[[ $(rustc --print cfg | \
312
			awk -F= -v key="target_pointer_width" '$1==key {print $2}') == \"64\" ]]; then
313
		CBUILD=x86_64-linux-linux-gnu
314
		use abi_x86_64 || abis+=( amd64 )
315
	fi
316
	rust_target="$(rust_abi ${CTARGET})"
317
	rust_host="$(rust_abi ${CHOST})"
318
	rust_build="$(rust_abi ${CBUILD})"
304
319
305
	cat <<- _EOF_ > "${S}"/config.toml
320
	cat <<- _EOF_ > "${S}"/config.toml
306
		changelog-seen = 2
321
		changelog-seen = 2
Lines 325-332 Link Here
325
		build-stage = 2
340
		build-stage = 2
326
		test-stage = 2
341
		test-stage = 2
327
		doc-stage = 2
342
		doc-stage = 2
328
		build = "${rust_target}"
343
		build = "${rust_build}"
329
		host = ["${rust_target}"]
344
		host = ["${rust_host}"]
330
		target = [${rust_targets}]
345
		target = [${rust_targets}]
331
		cargo = "${rust_stage0_root}/bin/cargo"
346
		cargo = "${rust_stage0_root}/bin/cargo"
332
		rustc = "${rust_stage0_root}/bin/rustc"
347
		rustc = "${rust_stage0_root}/bin/rustc"
Lines 386-391 Link Here
386
		compression-formats = ["xz"]
401
		compression-formats = ["xz"]
387
	_EOF_
402
	_EOF_
388
403
404
	cat <<- _EOF_ >> "${S}"/config.env
405
		PKG_CONFIG_ALLOW_CROSS=1
406
		CFG_COMPILER_HOST_TRIPLE=$(rust_abi $(get_abi_CHOST ${DEFAULT_ABI}))
407
	_EOF_
408
389
	for v in $(multilib_get_enabled_abi_pairs); do
409
	for v in $(multilib_get_enabled_abi_pairs); do
390
		rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
410
		rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
391
		arch_cflags="$(get_abi_CFLAGS ${v##*.})"
411
		arch_cflags="$(get_abi_CFLAGS ${v##*.})"
Lines 410-416 Link Here
410
		fi
430
		fi
411
		if use system-llvm; then
431
		if use system-llvm; then
412
			cat <<- _EOF_ >> "${S}"/config.toml
432
			cat <<- _EOF_ >> "${S}"/config.toml
413
				llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
433
				llvm-config = "$(get_llvm_prefix
434
				"${LLVM_MAX_SLOT}")/bin/$(get_abi_CHOST ${v##*.})-llvm-config"
414
			_EOF_
435
			_EOF_
415
		fi
436
		fi
416
	done
437
	done

Return to bug 760405