Re: [PATCH] Add pg_dump/pg_restore to appbundle - Mailing list pgadmin-hackers

From Florian G. Pflug
Subject Re: [PATCH] Add pg_dump/pg_restore to appbundle
Date
Msg-id 43864B62.1030905@phlo.org
Whole thread Raw
In response to Re: [PATCH] Add pg_dump/pg_restore to appbundle  ("Florian G. Pflug" <fgp@phlo.org>)
List pgadmin-hackers
Florian G. Pflug wrote:
> Florian G. Pflug wrote:
>> [snipped my own mail]
> [snipped again]

Aaaaaarrrrgg. Again. Should go to bed, I guess ;-)
The replacement-patch is broken too - This time I messed up
while generating the patch with "svn diff", and of course
only noticed after hitting "send".

Here another version, hopefully ok this time ;-)

BTW, that patch should work for the 1.4 tree too. The others
are just meant for trunk.

greetings, Florian Pflug
Index: pkg/mac/Makefile.am
===================================================================
--- pkg/mac/Makefile.am    (revision 4751)
+++ pkg/mac/Makefile.am    (working copy)
@@ -24,5 +24,7 @@
     $(install_sh_DATA) "sql.icns" "$(bundledir)/Contents/Resources/sql.icns"
     $$($(WX_CONFIG) --rezflags | sed 's/-t[[:space:]]*APPL//') \
          "$(bundledir)/Contents/Resources/pgAdmin3.rsrc" -useDF
+    $(install_sh_PROGRAM) "$$($(PG_CONFIG) --bindir)/pg_dump" "$(bundledir)/Contents/SharedSupport/helper/pg_dump"
+    $(install_sh_PROGRAM) "$$($(PG_CONFIG) --bindir)/pg_restore"
"$(bundledir)/Contents/SharedSupport/helper/pg_restore"
     ./complete-bundle.sh "$(bundledir)"
 endif
Index: src/base/appbase.cpp
===================================================================
--- src/base/appbase.cpp    (revision 4751)
+++ src/base/appbase.cpp    (working copy)
@@ -36,7 +36,6 @@
 #define UI_DIR      wxT("/ui")
 #define I18N_DIR    wxT("/i18n")

-#define SCRIPT_DIR  wxT("/scripts")
 #define HELPER_DIR  wxT("/helper")


@@ -104,8 +103,6 @@

     if (wxDir::Exists(dataDir + HELPER_DIR))
         path.Add(dataDir + HELPER_DIR) ;
-    if (wxDir::Exists(dataDir + SCRIPT_DIR))
-        path.Add(dataDir + SCRIPT_DIR) ;

 #else // other *ixes

Index: pkg/mac/complete-bundle.sh
===================================================================
--- pkg/mac/complete-bundle.sh    (revision 4751)
+++ pkg/mac/complete-bundle.sh    (working copy)
@@ -10,8 +10,7 @@

 echo "Completing bundle: $bundle"
 cd "$bundle"
-fw_basepath=$(dirname $(pwd))
-todo=$(find ./ | \
+todo=$(find ./ -perm +0111 ! -type d | \
         xargs --replace=line file 'line' | \
         sed -n 's/^\([^:][^:]*\):[[:space:]]*Mach-O executable ppc$/\1/p' | \
         xargs echo -n \
@@ -22,6 +21,13 @@
     todo_old=$todo ;
     todo="" ;
     for todo_obj in $todo_old; do
+        #Figure out the relative path from todo_obj to Contents/Frameworks
+        fw_relpath=$(echo "$todo_obj" |\
+            sed -n 's|^\(\.//*\)\(\([^/][^/]*/\)*\)[^/][^/]*$|\2|gp' | \
+            sed -n 's|[^/][^/]*/|../|gp' \
+        )"Contents/Frameworks"
+
+        #Find all libraries $todo_obj depends on, but skip system libraries
         for lib in $(
             otool -L $todo_obj | \
             sed -n 's|^.*[[:space:]]\([^[:space:]]*\.dylib\).*$|\1|p' | \
@@ -30,22 +36,16 @@
             lib_bn="$(basename "$lib")" ;
             if ! test -f "Contents/Frameworks/$lib_bn"; then
                 echo "Adding library: $lib_bn (because of: $todo_obj)"
-                case "$lib" in
-                    /*)
-                        cp "$lib" "Contents/Frameworks/$lib_bn"
-                    ;;
-                    *)
-                        cp "$fw_basepath/$lib" "Contents/Frameworks/$lib_bn"
-                    ;;
-                esac
+                cp "$lib" "Contents/Frameworks/$lib_bn"
+                chmod 755 "Contents/Frameworks/$lib_bn"
                 install_name_tool \
-                    -id "@executable_path/../Frameworks/$lib_bn" \
+                    -id "$lib_bn" \
                     "Contents/Frameworks/$lib_bn" || exit 1
                 todo="$todo Contents/Frameworks/$lib_bn"
             fi
             install_name_tool -change \
                 "$lib" \
-                "@executable_path/../Frameworks/$lib_bn" \
+                "@executable_path/$fw_relpath/$lib_bn" \
                 "$todo_obj" || exit 1
         done
     done

Attachment

pgadmin-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: [PATCH] Add pg_dump/pg_restore to appbundle
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r4754 - in trunk/pgadmin3: pkg/mac src/base