summaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-automatically-add-libgcc-to-depends-when-libp.patch
blob: 2b30a8f10e33917b6dd6395dee5be6236c4a53da (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
From f9b62b89a60793a12092ae5f3c3cef231c6aa03e Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 31 Aug 2010 13:50:06 +0000
Subject: [PATCH] abuild: automatically add libgcc to depends when libpthread is found

see http://redmine.alpinelinux.org/issues/409
---
 abuild.in |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/abuild.in b/abuild.in
index 24920d5..c01c9bf 100755
--- a/abuild.in
+++ b/abuild.in
@@ -483,7 +483,14 @@ trace_apk_deps() {
 	if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
 			&& ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then
 		msg "Added pkgconfig as dependency"
-		echo "depend = pkgconfig" >> "$dir"/.PKGINFO
+		autodeps="$autodeps pkgconfig"
+	fi
+
+	# special case for libpthread: we need depend on libgcc
+	if grep -q -w '^libpthread.so.*' "$dir"/.needs-so 2>/dev/null \
+			&& ! grep -q -w "^depend = libgcc" "$dir"/.PKGINFO; then
+		autodeps="$autodeps libgcc"
+		msg "Added libgcc as dependency due to libpthread"
 	fi
 	for i in $(cat "$dir"/.needs-so 2>/dev/null); do
 		found=
@@ -509,6 +516,7 @@ trace_apk_deps() {
 		list_has "$found" $autodeps || autodeps="$autodeps $found"
 		msg "Added '$found' as dependency as it has $i"
 	done
+
 	[ -z "$autodeps" ] && return 0
 	echo "# automatically detected:" >> "$dir"/.PKGINFO
 	for i in $autodeps; do
-- 
1.7.2.2