aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-pass-arch-to-apk-whenever-sysroot-is-used.patch
blob: 6270d6cce63712551a3233791b6e64aeaf8ef7c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 971504f0ecfa59a03f30f9abe1b582c35a589590 Mon Sep 17 00:00:00 2001
From: xentec <xentec@aix0.eu>
Date: Wed, 21 Dec 2016 10:01:29 +0000
Subject: [PATCH] abuild: pass --arch to apk whenever sysroot is used

so we can crosscompile for different architectures
---
 abuild.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/abuild.in b/abuild.in
index f56ac03..b7e3dcc 100644
--- a/abuild.in
+++ b/abuild.in
@@ -1048,7 +1048,7 @@ trace_apk_deps() {
 
 	case "$parch" in
 	$CBUILD_ARCH) ;;
-	$CARCH | $CTARGET_ARCH) apkroot="--root $CBUILDROOT" ;;
+	$CARCH | $CTARGET_ARCH) apkroot="--root $CBUILDROOT --arch $CTARGET_ARCH" ;;
 	esac
 
 	msg "Tracing dependencies..."
@@ -1810,7 +1810,7 @@ builddeps() {
 	calcdeps "$BUILD_BASE"
 
 	installed_builddeps=$($APK info --installed $builddeps)
-	[ -n "$CBUILDROOT" -a -n "$hostdeps" ] && installed_hostdeps=$($APK info --root "$CBUILDROOT" --installed $hostdeps)
+	[ -n "$CBUILDROOT" -a -n "$hostdeps" ] && installed_hostdeps=$($APK info --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --installed $hostdeps)
 
 	# find which deps are missing
 	for i in $builddeps; do
@@ -1825,7 +1825,7 @@ builddeps() {
 	done
 	for i in $hostdeps; do
 		if [ "${i#\!}" != "$i" ]; then
-			if $APK info --quiet --installed --root "$CBUILDROOT" "${i#\!}"; then
+			if $APK info --quiet --installed --root "$CBUILDROOT" --arch "$CTARGET_ARCH" "${i#\!}"; then
 				error "Conflicting package installed: ${i#\!}"
 				return 1
 			fi
@@ -2039,7 +2039,7 @@ deps() {
 		|| return 1
 	if [ -n "$CBUILDROOT" ]; then
 		[ -z "$_quiet" ] && msg "Installing for host:$hostdeps"
-		$SUDO_APK add $_quiet --root "$CBUILDROOT" --repository "$REPODEST/$repo" $apk_opt_wait \
+		$SUDO_APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \
 			--no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1
 	fi
 }
@@ -2048,7 +2048,7 @@ undeps() {
 	local _quiet="$@"
 	$SUDO_APK del $_quiet $apk_opt_wait .makedepends-$pkgname
 	if [ -n "$CBUILDROOT" ]; then
-		$SUDO_APK del $_quiet --root "$CBUILDROOT" $apk_opt_wait \
+		$SUDO_APK del $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $apk_opt_wait \
 			--no-scripts .makedepends-$pkgname
 	fi
 	return 0
-- 
2.11.0