summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-08-26 13:59:46 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-08-26 13:59:46 +0000
commitae1fe74542858e21d1a605bd9ec1d021e5c9b418 (patch)
tree01806535424d4f06b2161963d815977028175cba
parentupdate to trunk (r13531) (diff)
downloadinkscape-ae1fe74542858e21d1a605bd9ec1d021e5c9b418.tar.gz
inkscape-ae1fe74542858e21d1a605bd9ec1d021e5c9b418.zip
osx-app.sh: test awk and require gawk if too old
(bzr r13506.1.47)
-rwxr-xr-xpackaging/macosx/osx-app.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh
index 5bb2a5340..87e6391e1 100755
--- a/packaging/macosx/osx-app.sh
+++ b/packaging/macosx/osx-app.sh
@@ -180,6 +180,20 @@ if [ ! -e "$LIBPREFIX/lib/aspell-0.60/en.dat" ]; then
exit 1
fi
+# awk on Leopard fails in fixlib(), test earlier and require gawk if test fails
+awk_test="$(echo "/lib" | awk -F/ '{for (i=1;i<NF;i++) sub($i,".."); sub($NF,"",$0); print $0}')"
+if [ -z "$awk_test" ]; then
+ if [ ! -x "$LIBPREFIX/bin/gawk" ]; then
+ echo "awk provided by system is too old, please install gawk and try again" >&2
+ exit 1
+ else
+ awk_cmd="$LIBPREFIX/bin/gawk"
+ fi
+else
+ awk_cmd="awk"
+fi
+unset awk_test
+
# OS X version
#----------------------------------------------------------
@@ -491,7 +505,7 @@ fixlib () {
lib)
# TODO: verfiy correct/expected install name for relocated libs
to_id="$package/Contents/Resources$filePath/$1"
- loader_to_res="$(echo $filePath | gawk -F/ '{for (i=1;i<NF;i++) sub($i,".."); sub($NF,"",$0); print $0}')"
+ loader_to_res="$(echo $filePath | $awk_cmd -F/ '{for (i=1;i<NF;i++) sub($i,".."); sub($NF,"",$0); print $0}')"
;;
bin)
loader_to_res="../"
@@ -507,7 +521,7 @@ fixlib () {
for lib in $fileLibs; do
first="$(echo $lib | cut -d/ -f1-3)"
if [ $first != /usr/lib -a $first != /usr/X11 -a $first != /opt/X11 -a $first != /System/Library ]; then
- lib_prefix_levels="$(echo $lib | awk -F/ '{for (i=NF;i>0;i--) if($i=="lib") j=i; print j}')"
+ lib_prefix_levels="$(echo $lib | $awk_cmd -F/ '{for (i=NF;i>0;i--) if($i=="lib") j=i; print j}')"
res_to_lib="$(echo $lib | cut -d/ -f$lib_prefix_levels-)"
unset to_path
case $fileType in