aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/git.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-11-05 12:40:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-05 13:37:25 +0000
commit0d1e30b1361b9a1a06c56d2433befd9be77bff14 (patch)
tree5b4248932b3342bf99370c4c1da8a86b122194c2 /main/abuild/git.patch
parent2bb7088a03007efcefaf2dcfcd839c8e75b050be (diff)
downloadaports-0d1e30b1361b9a1a06c56d2433befd9be77bff14.tar.bz2
aports-0d1e30b1361b9a1a06c56d2433befd9be77bff14.tar.xz
main/abuild: fix detection of deps and symlinks
Diffstat (limited to 'main/abuild/git.patch')
-rw-r--r--main/abuild/git.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/main/abuild/git.patch b/main/abuild/git.patch
new file mode 100644
index 0000000000..cba100cc83
--- /dev/null
+++ b/main/abuild/git.patch
@@ -0,0 +1,107 @@
+diff --git a/abuild.in b/abuild.in
+index 0dd8f9a..8d06261 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
+ }
+@@ -1190,11 +1191,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 +1223,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 +1724,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
+@@ -1962,9 +1963,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/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