aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/git.patch
blob: 5a43e4b4fa82ea21ff099301688b67bf40f6ba51 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
diff --git a/.gitignore b/.gitignore
index 9018782..ac669f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 *.tar.bz2
 *.o
 abuild
+abuild-fetch
 abuild-keygen
 abuild-sign
 abuild-sudo
diff --git a/abuild.in b/abuild.in
index 0dd8f9a..1f330b1 100644
--- a/abuild.in
+++ b/abuild.in
@@ -886,13 +886,14 @@ prepare_trace_rpaths() {
 
 # search for broken symlinks so we later can pull in proper depends
 prepare_symlinks() {
+	local target
 	local dir="${subpkgdir:-$pkgdir}"
 	options_has "!tracedeps" && return 0
 	cd "$dir" || return 1
 	find -type l | while read symlink; do
-		if ! [ -e "$symlink" ]; then
-			echo "$symlink $(readlink $symlink)" \
-				>> "$controldir"/.symlinks
+		target=$(readlink "$symlink")
+		if ! [ -e "$dir$(normalize_target_path "$target" "$symlink")" ]; then
+			echo "$symlink $target" >> "$controldir"/.symlinks
 		fi
 	done
 }
@@ -1076,7 +1077,8 @@ trace_apk_deps() {
 
 	echo "# automatically detected:" >> "$dir"/.PKGINFO
 	if [ -f "$dir"/.provides-so ]; then
-		sed 's/^\(.*\) \([0-9].*\)/provides = so:\1=\2/' "$dir"/.provides-so \
+		sed 's/^\(.*\) \([0-9].*\)/provides = so:\1=\2/' \
+			"$dir"/.provides-so | sort -u \
 			>> "$dir"/.PKGINFO
 	fi
 	if [ -f "$dir"/.provides-pc ]; then
@@ -1190,11 +1192,16 @@ scan_shared_objects() {
 	done > "$controldir"/.needs-so
 }
 
-# normalize a path string
-normalize_path() {
+# normalize a symlink target path (1st arg)
+# Converts a relative path to absolute with respect to the symlink
+# path (2nd arg).
+normalize_target_path() {
+	local path=$1
+	[ "${path:0:1}" = / ] || path=$(dirname "$2")/$path
+
 	local oifs="$IFS" pathstr= i=
 	IFS='/'
-	set -- $1
+	set -- $path
 	for i; do
 		case "$i" in
 		"."|"") continue;;
@@ -1217,10 +1224,7 @@ scan_symlink_targets() {
 		fi
 
 		while read symlink target; do
-			if [ "${target#/}" = "$target" ]; then
-				target="${symlink%/*}/$target"
-			fi
-			targetpath="$datadir"/$(normalize_path "$target")
+			targetpath=$datadir$(normalize_target_path "$target" "$symlink")
 			if [ -e "$targetpath" ] || [ -L "$targetpath" ]; then
 				echo "$name=$pkgver-r$pkgrel" \
 					>> "$d"/.symlinks-needs
@@ -1721,14 +1725,12 @@ builddeps() {
 			[ "$pkgname" = "${i%%[<>=]*}" ] && continue
 			subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
 		done
-		hostdeps="$makedepends_host"
-		for i in $depends; do
+		for i in $depends $makedepends_host; do
 			[ "$pkgname" = "${i%%[<>=]*}" ] && continue
 			subpackages_has ${i%%[<>=]*} || hostdeps="$hostdeps $i"
 		done
 	else
-		builddeps="$makedepends"
-		for i in $BUILD_BASE $depends; do
+		for i in $BUILD_BASE $depends $makedepends; do
 			[ "$pkgname" = "${i%%[<>=]*}" ] && continue
 			subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
 		done
@@ -1739,15 +1741,21 @@ builddeps() {
 
 	# find which deps are missing
 	for i in $builddeps; do
-		if [ "${i#\!}" != "$i" ] && $APK info --quiet --installed "${i#\!}"; then
-			error "Conflicting package installed: ${i#\!}"
+		if [ "${i#\!}" != "$i" ]; then
+			if $APK info --quiet --installed "${i#\!}"; then
+				error "Conflicting package installed: ${i#\!}"
+				return 1
+			fi
 		elif ! deplist_has $i $installed_builddeps || [ -n "$upgrade" ]; then
 			missing="$missing $i"
 		fi
 	done
 	for i in $hostdeps; do
-		if [ "${i#\!}" != "$i" ] && $APK info --quiet --installed --root "$CBUILDROOT" "${i#\!}"; then
-			error "Conflicting package installed: ${i#\!}"
+		if [ "${i#\!}" != "$i" ]; then
+			if $APK info --quiet --installed --root "$CBUILDROOT" "${i#\!}"; then
+				error "Conflicting package installed: ${i#\!}"
+				return 1
+			fi
 		elif ! deplist_has $i $installed_hostdeps || [ -n "$upgrade" ]; then
 			missing="$missing $i"
 		fi
@@ -1962,9 +1970,8 @@ post_add() {
 }
 
 deps() {
-	local builddeps i
-	builddeps="$makedepends"
-	for i in $depends; do
+	local builddeps= i
+	for i in $depends $makedepends; do
 		[ "$pkgname" = "${i%%[<>=]*}" ] && continue
 		subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
 	done
diff --git a/functions.sh.in b/functions.sh.in
index e9b7280..c128e8d 100644
--- a/functions.sh.in
+++ b/functions.sh.in
@@ -6,7 +6,8 @@ program=${0##*/}
 hostspec_to_arch() {
 	case "$1" in
 	arm*-*-*-*eabi)		echo "armel" ;;
-	arm*-*-*-*eabihf)	echo "armhf" ;;
+	armv6*-*-*-*eabihf)	echo "armhf" ;;
+	armv7*-*-*-*eabihf)	echo "armv7" ;;
 	i[0-9]86-*-*-*)		echo "x86" ;;
 	x86_64-*-*-*)		echo "x86_64" ;;
 	*)			echo "unknown" ;;
diff --git a/newapkbuild.in b/newapkbuild.in
index 5ba51fb..a47dcae 100644
--- a/newapkbuild.in
+++ b/newapkbuild.in
@@ -45,7 +45,6 @@ build_autotools() {
 		--prefix=/usr \\
 		--sysconfdir=/etc \\
 		--mandir=/usr/share/man \\
-		--infodir=/usr/share/info \\
 		--localstatedir=/var \\
 		|| return 1
 	make || return 1
@@ -70,10 +69,8 @@ build_cmake() {
 		-DCMAKE_INSTALL_LIBDIR=lib \\
 		-DBUILD_SHARED_LIBS=True \\
 		-DCMAKE_BUILD_TYPE=Release \\
-		-DCMAKE_CXX_COMPILER="\${CXX:-g++}" \\
-		-DCMAKE_C_COMPILER="\${CC:-gcc}" \\
 		-DCMAKE_CXX_FLAGS="\$CXXFLAGS" \\
-		-DCMAKE_CXX_FLAGS="\$CFLAGS" \\
+		-DCMAKE_C_FLAGS="\$CFLAGS" \\
 		${CMAKE_CROSSOPTS} \\
 		|| return 1
 	make || return 1