Subject: Patch for pgAdmin4 package on Mac OS X

From: Sandeep Thakkar <[email-masked]>
Date: Mon, 18 Apr 2016 17:55:16 +0530

Hi Team, Dave,

Attached herewith are two patches.

pgadmin4-mac-bundle.patch - This includes scripts to build Mac app bundle
and DMG for pgAdmin4. This is the tree of the generated app bundle:
----
$ find pgAdmin4.app/ -maxdepth 3 -type d
pgAdmin4.app/
pgAdmin4.app//ContentspgAdmin4.app//Contents/Frameworks
pgAdmin4.app//Contents/Frameworks/Python.framework
pgAdmin4.app//Contents/Frameworks/QtCore.framework
pgAdmin4.app//Contents/Frameworks/QtDBus.framework
pgAdmin4.app//Contents/Frameworks/QtGui.framework
pgAdmin4.app//Contents/Frameworks/QtMultimedia.framework
pgAdmin4.app//Contents/Frameworks/QtMultimediaWidgets.framework
pgAdmin4.app//Contents/Frameworks/QtNetwork.framework
pgAdmin4.app//Contents/Frameworks/QtOpenGL.framework
pgAdmin4.app//Contents/Frameworks/QtPositioning.framework
pgAdmin4.app//Contents/Frameworks/QtPrintSupport.framework
pgAdmin4.app//Contents/Frameworks/QtQml.framework
pgAdmin4.app//Contents/Frameworks/QtQuick.framework
pgAdmin4.app//Contents/Frameworks/QtSensors.framework
pgAdmin4.app//Contents/Frameworks/QtSql.framework
pgAdmin4.app//Contents/Frameworks/QtWebChannel.framework
pgAdmin4.app//Contents/Frameworks/QtWebKit.framework
pgAdmin4.app//Contents/Frameworks/QtWebKitWidgets.framework
pgAdmin4.app//Contents/Frameworks/QtWidgets.framework
pgAdmin4.app//Contents/MacOS
pgAdmin4.app//Contents/PlugIns
pgAdmin4.app//Contents/PlugIns/platforms
pgAdmin4.app//Contents/Resources
pgAdmin4.app//Contents/Resources/venv
pgAdmin4.app//Contents/Resources/web
---

pgadmin4-fixpath-mac.patch - This is for runtime/Server.cpp to fix the path
where the runtime looks for web application path in app bundle.

Kindly review and suggest the changes required.  Thanks.

-- 
Sandeep Thakkar

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Dave Page <[email-masked]>
Date: Fri, 6 May 2016 16:33:19 +0100

Hi

Thanks. I've applied the path fix patch. The second one needs a little
work - I've attached an updated version to work from:

- I've updated the README, and some of the default values.

- I've removed the file type registration for .sql files.

- Should we note that the user may need to run in a virtualenv?

- Please move build-mac.sh to pkg/build.sh, and create a target in /Makefile to
  execute it, e.g. "make appbundle"

- Extend the Makefile to add a "clean-appbundle" target, which should also be
  called by the "clean" target.

- At present, it is bundling my pre-existing configuration database. It *must*
  create a new one and bundle that, without touching the existing one (I guess
  that may require a new command line option for setup.py).

- The online help is broken (are you building it)? I suggest adding a top-level
  Makefile target to do so.

- Working directories should be added to /.gitignore. Please ensure they don't
  clash with those used by pip (and ideally are in one place, e.g. mac-build/).

- I saw various errors in the build output, though the resulting DMG seemed to
  work fine;

...
cp: /usr/local/pgsql/libpq.5.dylib: No such file or directory
libpq.5.dylib not found in /usr/local/pgsql
Completing app: /Users/dpage/git/pgadmin4/pgAdmin4.app
...

...
App: pgAdmin4.app: Post-processing: .//Contents/MacOS/pgAdmin4
App: pgAdmin4.app: Adding symlink: QtWebKitWidgets (because of:
.//Contents/MacOS/pgAdmin4)
cp: @rpath/QtWebKitWidgets.framework/Versions/5/../../../QtWebKitWidgets.framework:
No such file or directory
chmod: Contents/Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets:
No such file or directory
Rewriting ID in
Contents/Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
to QtWebKitWidgets
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
can't open file:
Contents/Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
(No such file or directory)
Cleaning up
...

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Sandeep Thakkar <[email-masked]>
Date: Fri, 13 May 2016 18:31:19 +0530

Thanks Dave.

Please see inline.

On Fri, May 6, 2016 at 9:03 PM, Dave Page <[email-masked]> wrote:

> OK. The default values of PGDIR and QTDIR set by you is different than
mine. I installed them through macports.

> - I've removed the file type registration for .sql files.

OK.

> - Should we note that the user may need to run in a virtualenv?

No, we bundle private environment, right?

>   execute it, e.g. "make appbundle"

Sure. You mean move to pkg/*mac*/build.sh, right?

> OK.

>   that may require a new command line option for setup.py).

No, it's not bundling the pgadmin4.db at all, I skipped it :). Paresh is
working on this.

> Sorry, which online help?

> OK.

> Yeah, because I had libpq.dylib present in $PGDIR/ and may be yours
present in $PGDIR/lib/. I will be using the default values suggested by you
and fix this. Thanks!

...
> cp:
> @rpath/QtWebKitWidgets.framework/Versions/5/../../../QtWebKitWidgets.framework:
> chmod:
> Contents/Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets:
> error:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
> can't open file:

-- 
Sandeep Thakkar

---

From: Dave Page <[email-masked]>
Date: Fri, 13 May 2016 14:11:56 +0100

On Fri, May 13, 2016 at 2:01 PM, Sandeep Thakkar
<[email-masked]> wrote:
> OK. The default values of PGDIR and QTDIR set by you is different than mine.
> I installed them through macports.

Right. I went with the default directories from the original projects.

> No, we bundle private environment, right?

I meant "the user building the package", not the end user.

> Sure. You mean move to pkg/mac/build.sh, right?

Yes :-)

> No, it's not bundling the pgadmin4.db at all, I skipped it :). Paresh is

Oh - in that case it used my existing one. Which of course, it should
not overwrite if already present (which reminds me - adding a todo
item to auto-upgrade the database if needed on first run).

> Sorry, which online help?

That which can be found in $SRC/doc - currently only for en_US. At
present it's built with "cd doc/en_US && make -f Makefile.sphinx
html", but I think we should have a top-level target to call that for
us.

The help can then be accessed from Help -> Online Help within pgAdmin.
Obviously the files need to be put in the right place in the app
bundle.

> Yeah, because I had libpq.dylib present in $PGDIR/ and may be yours present
> in $PGDIR/lib/. I will be using the default values suggested by you and fix
> this. Thanks!

Right - please make sure the build fails in cases like this too.

Thanks.

---

From: Sandeep Thakkar <[email-masked]>
Date: Tue, 17 May 2016 16:24:05 +0530

Hi Dave

I have fixed the issues. Attached is the updated patch.

The docs are built as part of 'appbundle' target, there is no separate
target in Makefile for this. I observed that it requires the python modules
to get this built. We create virtual environment as a part of 'appbundle'
target because we do everything in a single script "build.sh".  Hence,
right now I added doc build in the same build script.

BTW, the online help returns me the following error now:
"The server encountered an internal error and was unable to complete your
request. Either the server is overloaded or there is an error in the
application." Since this is not 404, it means that it atleast got
index.html, right? May be this should be handled in the source code.

Paresh is working on updating pgAdmin4.py to autocreate database
configuration if does not exist. He will share the patch.

On Fri, May 13, 2016 at 6:41 PM, Dave Page <[email-masked]> wrote:

> >> - Extend the Makefile to add a "clean-appbundle" target, which should
> also
> >> be
> present

-- 
Sandeep Thakkar

---

From: Paresh More <[email-masked]>
Date: Tue, 17 May 2016 16:41:50 +0530

Hello Dave,

Attached is the patch for pgAdmin4.py to autocreate database configuration
if does not exist.

On Tue, May 17, 2016 at 4:24 PM, Sandeep Thakkar <
[email-masked]> wrote:

>> >>   create a new one and bundle that, without touching the existing one
>> (I
>> >> guess
>> >> - Working directories should be added to /.gitignore. Please ensure
>> they
>> >> don't
>> >> > pgadmin4-fixpath-mac.patch - This is for runtime/Server.cpp to fix
>> the
>> >> > path

-- 

Thanks & Regards

*Paresh More*

Pune, India.
Cell :  +919922000564 |  www.enterprisedb.com

---

From: Dave Page <[email-masked]>
Date: Tue, 17 May 2016 12:22:57 +0100

> right now I added doc build in the same build script.

Right - I was suggesting you create the 'docs' target, then use it.

> index.html, right? May be this should be handled in the source code.

It works fine for me on my dev machines. If there's a problem, we need to
diagnose it.

> On Fri, May 13, 2016 at 6:41 PM, Dave Page <[email-masked]
> <javascript:_e(%7B%7D,'cvml',[email-masked]');>> wrote:
>
>> <[email-masked]
>> <javascript:_e(%7B%7D,'cvml',[email-masked]');>>
>> wrote:
>> > Thanks Dave.
>> >
>> > Please see inline.
>> >
>> > On Fri, May 6, 2016 at 9:03 PM, Dave Page <[email-masked]
>> <javascript:_e(%7B%7D,'cvml',[email-masked]');>> wrote:
>> >>
>> >> Hi
>> >>
>> >> <[email-masked]
>> <javascript:_e(%7B%7D,'cvml',[email-masked]');>>
>> wrote:
>> >> > Hi Team, Dave,
>> >> >

---

From: Sandeep Thakkar <[email-masked]>
Date: Tue, 17 May 2016 17:43:42 +0530

On Tue, May 17, 2016 at 4:52 PM, Dave Page <[email-masked]> wrote:

>
>
> On Tuesday, May 17, 2016, Sandeep Thakkar <
Yes, I got that. I was talking from dependency perspective. Docs needs to
be built in the virtual environment as it needs some python modules for
building and App bundle should include the docs. So, docs will be built
before the app bundle, but it needs venv which is a part of the same script
(build.sh) that creates the bundle. So, I will have to split the build.sh
accordingly.

>>> >> - At present, it is bundling my pre-existing configuration database.
>>> It
>>> >> *must*

-- 
Sandeep Thakkar

---

From: Sandeep Thakkar <[email-masked]>
Date: Wed, 18 May 2016 16:20:51 +0530

Okay, so the patch needs a little change because of the change in the
versioning for pgAdmin. Will update it.

Paresh, please take a note of it.

-- 
Sandeep Thakkar

---

From: Sandeep Thakkar <[email-masked]>
Date: Wed, 18 May 2016 17:12:35 +0530

So, this means, the installer name would be pgadmin4-1.0-dev.exe on Windows
and so on for other platforms?

Also, the installation would go in $installdir/pgadmin4/1/ ? and the
Revision change would update the installation? and the Release change will
stay side-by-side?

-- 
Sandeep Thakkar

---

From: Sandeep Thakkar <[email-masked]>
Date: Thu, 19 May 2016 16:04:42 +0530

Hi Dave

I have added the 'docs' target in the /Makefile. This target is also called
by appbundle. pgAdmin4 versioning change is also taken care of.

I have attached the updated patch here. Kindly review and let me know your
feedback. Thanks.

--

---

From: Dave Page <[email-masked]>
Date: Thu, 19 May 2016 09:50:44 -0400

Hi

I see the following error when attempting to build. My configurable
paths match the defaults in the README.

complete-bundle.sh failed
make: *** [appbundle] Error 1

On Thu, May 19, 2016 at 6:34 AM, Sandeep Thakkar
<[email-masked]> wrote:
>> On Tuesday, May 17, 2016, Sandeep Thakkar
>>> target because we do everything in a single script "build.sh".  Hence, right
>>> now I added doc build in the same build script.
>>
>>

---

From: Sandeep Thakkar <[email-masked]>
Date: Thu, 19 May 2016 19:35:45 +0530

Hmm.. looks like some difference in the QT installation.

Can you please provide me the otool -L output for pgAdmin4 from
/mac-build/pgAdmin4.app/Contents/MacOS/pgAdmin4

and also the tree for $QTDIR/lib

Thanks.

On Thu, May 19, 2016 at 7:20 PM, Dave Page <[email-masked]> wrote:

> right
> >>>> > No, it's not bundling the pgadmin4.db at all, I skipped it :).
> Paresh
> >>>> > is
> >>>> > working on this.
> >>>>
> >>>> >> - The online help is broken (are you building it)? I suggest
> adding a
> >>>> >> top-level
> >>>> >> - I saw various errors in the build output, though the resulting
> DMG
> >>>> >> seemed to
> >>>> >>   work fine;
> >>>> >>
> >>>> >> > pgadmin4-mac-bundle.patch - This includes scripts to build Mac
> app
> >>>> >> > bundle

--

---

From: Dave Page <[email-masked]>
Date: Thu, 19 May 2016 10:09:19 -0400

> /mac-build/pgAdmin4.app/Contents/MacOS/pgAdmin4

(pgadmin4)snake:pgadmin4 dpage$ otool -L
mac-build/pgAdmin4.app/Contents/MacOS/pgAdmin4
mac-build/pgAdmin4.app/Contents/MacOS/pgAdmin4:
/System/Library/Frameworks/Python.framework/Versions/2.7/Python
(compatibility version 2.7.0, current version 2.7.10)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1226.10.1)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 1258.1.0)
@rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
(compatibility version 5.5.0, current version 5.5.1)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version
5.5.0, current version 5.5.1)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0,
current version 5.5.1)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version
5.5.0, current version 5.5.1)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
(compatibility version 1.0.0, current version 275.0.0)
@rpath/QtWebKit.framework/Versions/5/QtWebKit (compatibility version
5.5.0, current version 5.5.1)
@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version
5.5.0, current version 5.5.1)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility
version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 104.1.0)

> and also the tree for $QTDIR/lib

Attached.

Also, my config database now seems to be trashed since I ran "make
appbundle" :-(

---

From: Sandeep Thakkar <[email-masked]>
Date: Mon, 23 May 2016 11:52:23 +0530

Hi Dave

I have fixed this issue. Instead of getting path from otool, script now
uses QTDIR variable to copy the framework directory. Please find the
updated patch attached.

Thanks.

-- 
Sandeep Thakkar

---

From: Dave Page <[email-masked]>
Date: Tue, 24 May 2016 16:55:56 +0100

Hi

Attached is an updated patch in which I made some minor changes, most
significantly, to stop the build script from over-writing my
configuration file (again)!

There are a couple of important issues to be resolved:

1) It doesn't work. When testing on Karen's machine (which is new, and
doesn't have any dev environment etc), it errors out because it looks
like it cannot find the virtual environment.

2) It's *huge* - like 650MB!! I believe we're bundling much of QT
which isn't required. Please only copy what is needed.

Thanks!

On Mon, May 23, 2016 at 7:22 AM, Sandeep Thakkar
<[email-masked]> wrote:
> Hi Dave
>
> I have fixed this issue. Instead of getting path from otool, script now uses
> QTDIR variable to copy the framework directory. Please find the updated
> patch attached.
>
> Thanks.
>

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Index: pkg/mac/.gitignore
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/.gitignore	(revision )
+++ pkg/mac/.gitignore	(revision )
@@ -0,0 +1,3 @@
+# Global excludes across all subdirectories
+debug.pgadmin.Info.plist
+pgadmin.Info.plist
Index: .gitignore
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- .gitignore	(revision 8c077bc2dfd2dda4bd3b5e1338a6d60b404ba78f)
+++ .gitignore	(revision )
@@ -24,4 +24,5 @@
 /pgadmin4.egg-info
 /MANIFEST.in
 /build
+/mac-build
 /dist
Index: pkg/mac/pgadmin.Info.plist.in
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/pgadmin.Info.plist.in	(revision )
+++ pkg/mac/pgadmin.Info.plist.in	(revision )
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>pgAdmin4</string>
+	<key>CFBundleGetInfoString</key>
+	<string>pgAdmin4 PGADMIN_LONG_VERSION</string>
+	<key>CFBundleIconFile</key>
+	<string>pgAdmin4.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.postgresql.pgadmin</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>PGADMIN_SHORT_VERSION</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>PGADMIN_LONG_VERSION</string>
+	<key>CSResourcesFileMapped</key>
+	<true/>
+</dict>
+</plist>
Index: pkg/mac/PkgInfo
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/PkgInfo	(revision )
+++ pkg/mac/PkgInfo	(revision )
@@ -0,0 +1,1 @@
+APPL????
\ No newline at end of file
Index: pkg/mac/create-dmg.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/create-dmg.sh	(revision )
+++ pkg/mac/create-dmg.sh	(revision )
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# move to the directory where we have the DMG Sources
+cd dist
+
+DMG_SOURCES="./pgAdmin4.app"
+DMG_LICENCE=./../pkg/mac/licence.r
+DMG_IMAGE=pgAdmin4.dmg
+DMG_NAME=pgAdmin4
+HDIUTIL=/usr/bin/hdiutil
+REZ="/usr/bin/Rez /System/Library/Frameworks/Carbon.framework/Versions/A/Headers/*.r"
+
+DMG_DIR=./$DMG_IMAGE.src
+
+if test -e "$DMG_DIR"; then
+	echo "Directory $DMG_DIR already exists. Please delete it manually." >&2
+	exit 1
+fi
+
+echo "Cleaning up"
+rm -f "$DMG_IMAGE" || exit 1
+mkdir "$DMG_DIR" || exit 1
+
+echo "Copying data into temporary directory"
+for src in $DMG_SOURCES; do
+	cp -R "$src" "$DMG_DIR" || exit 1
+done
+
+echo "Creating image"
+$HDIUTIL create -quiet -srcfolder "$DMG_DIR" -format UDZO -volname "$DMG_NAME" -ov "$DMG_IMAGE" || exit 1
+rm -rf "$DMG_DIR" || exit 1
+
+echo "Attaching License to image"
+$HDIUTIL unflatten -quiet "$DMG_IMAGE" || exit 1
+$REZ "$DMG_LICENCE" -a -o "$DMG_IMAGE" || exit 1
+$HDIUTIL flatten -quiet "$DMG_IMAGE" || exit 1
Index: pkg/mac/build.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/build.sh	(revision )
+++ pkg/mac/build.sh	(revision )
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+# Build script to create Mac App Bundle and DMG for pgAdmin4 runtime
+
+export WD=$(cd `dirname $0` && pwd)
+export SOURCEDIR=$WD/../..
+export BUILDROOT=$WD/../../mac-build
+export DISTROOT=$WD/../../dist
+export VIRTUALENV=venv
+
+if [ "x$PYTHON_HOME" == "x" ]; then
+    echo "PYTHON_HOME not set. Setting it to default"
+    export PYTHON_HOME=/System/Library/Frameworks/Python.framework/Versions/2.7
+    export PYTHON_VERSION=27
+fi
+
+# Check if Python is working and calculate PYTHON_VERSION
+if $PYTHON_HOME/bin/python2 -V > /dev/null 2>&1; then
+    export PYTHON_VERSION=`$PYTHON_HOME/bin/python2 -V 2>&1 | awk '{print $2}' | cut -d"." -f1-2 | sed 's/\.//'`
+elif $PYTHON_HOME/bin/python3 -V > /dev/null 2>&1; then
+    export PYTHON_VERSION=`$PYTHON_HOME/bin/python3 -V 2>&1 | awk '{print $2}' | cut -d"." -f1-2 | sed 's/\.//'`
+else
+    echo "Error: Python installation missing!"
+    exit 1
+fi
+
+if [ "$PYTHON_VERSION" -gt "34" -a "$PYTHON_VERSION" -lt "26" ]; then
+    echo "Python version not supported"
+    exit 1
+fi
+
+if [ "$PYTHON_VERSION" -ge "30" ]; then
+    export PYTHON=$PYTHON_HOME/bin/python3
+    export PIP=pip3
+    export REQUIREMENTS=requirements_py3.txt
+else
+    export PYTHON=$PYTHON_HOME/bin/python2
+    export PIP=pip
+    export REQUIREMENTS=requirements_py2.txt
+fi
+
+if [ "x$QTDIR" == "x" ]; then
+    echo "QTDIR not set. Setting it to default (~/Qt/5.5/clang_64)"
+    export QTDIR=~/Qt/5.5/clang_64
+fi
+export QMAKE=$QTDIR/bin/qmake
+if ! $QMAKE --version > /dev/null 2>&1; then
+    echo "Error: qmake not found. QT installation is not present or incomplete."
+    exit 1
+fi
+
+if [ "x$PGDIR" == "x" ]; then
+    echo "PGDIR not set. Setting it to default (/usr/local/pgsql)"
+    export PGDIR=/usr/local/pgsql
+fi
+export PATH=$PGDIR/bin:$PATH
+
+_get_version() {
+    export pgadmin4_release=`grep "^APP_RELEASE" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
+    export pgadmin4_revision=`grep "^APP_REVISION" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
+    export LONG_VER=$pgadmin4_release.$pgadmin4_revision
+    export SHORT_VER=`echo $LONG_VER | cut -d . -f1,2`
+    export pgadmin4_suffix=`grep "^APP_SUFFIX" web/config.py | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g"`
+    if [ ! -z $pgadmin4_suffix ]; then
+        export LONG_VER=$LONG_VER-$pgadmin4_suffix
+    fi
+}
+
+_cleanup() {
+    echo "Cleaning up the old environment and app bundle"
+    rm -rf $SOURCEDIR/runtime/pgAdmin4.app
+    rm -rf $BUILDROOT
+    rm -rf $DISTROOT/pgAdmin4.app
+    rm -f $DISTROOT/pgAdmin4.dmg
+}
+
+_create_python_virtualenv() {
+    test -d $BUILDROOT || mkdir $BUILDROOT || exit 1
+    cd $BUILDROOT
+    test -d $VIRTUALENV || virtualenv -p $PYTHON $VIRTUALENV || exit 1
+    source $VIRTUALENV/bin/activate
+    $PIP install -r $SOURCEDIR/$REQUIREMENTS || { echo PIP install failed. Please resolve the issue and rerun the script; exit 1; }
+}
+
+_build_runtime() {
+    _create_python_virtualenv || exit 1
+    cd $SOURCEDIR/runtime
+    $QMAKE || { echo qmake failed; exit 1; }
+    make || { echo make failed; exit 1; }
+    cp -r pgAdmin4.app $BUILDROOT
+}
+
+_build_doc() {
+    cd $SOURCEDIR/docs/en_US
+    test -d $BUILDROOT/pgAdmin4.app/Contents/Resources || mkdir -p $BUILDROOT/pgAdmin4.app/Contents/Resources
+    test -d $BUILDROOT/pgAdmin4.app/Contents/Resources/docs/en_US || mkdir -p $BUILDROOT/pgAdmin4.app/Contents/Resources/docs/en_US
+    cp -r _build/html $BUILDROOT/pgAdmin4.app/Contents/Resources/docs/en_US/ || exit 1
+}
+
+_complete_bundle() {
+    cd $SOURCEDIR/pkg/mac
+    
+    # Replace the place holders with the current version
+    sed -e "s/PGADMIN_LONG_VERSION/$LONG_VER/g" -e "s/PGADMIN_SHORT_VERSION/$SHORT_VER/g" pgadmin.Info.plist.in > pgadmin.Info.plist
+
+    # copy Python private environment to app bundle
+    cp -PR $BUILDROOT/$VIRTUALENV $BUILDROOT/pgAdmin4.app/Contents/Resources/ || exit 1
+
+    # remove the python bin and include from app bundle as it is not needed
+    rm -rf $BUILDROOT/pgAdmin4.app/Contents/Resources/$VIRTUALENV/bin $BUILDROOT/pgAdmin4.app/Contents/Resources/$VIRTUALENV/include
+    rm -rf $BUILDROOT/pgAdmin4.app/Contents/Resources/$VIRTUALENV/.Python
+
+    # run complete-bundle to copy the dependent libraries and frameworks and fix the rpaths
+    ./complete-bundle.sh $BUILDROOT/pgAdmin4.app || { echo complete-bundle.sh failed; exit 1; }
+
+    # Remove the unwanted Python versions from the bundle
+    PYTHON_DIR_TO_KEEP=`$BUILDROOT/$VIRTUALENV/bin/python -V 2>&1 | awk '{print $2}' | cut -d"." -f1-2`
+    if [ ! -z $PYTHON_DIR_TO_KEEP ]; then
+        find $BUILDROOT/pgAdmin4.app/Contents/Frameworks/Python.framework/Versions/ -maxdepth 1 -mindepth 1 ! -name $PYTHON_DIR_TO_KEEP | grep -v Current | xargs rm -rf
+    fi
+ 
+    # copy the web directory to the bundle as it is required by runtime
+    cp -r $SOURCEDIR/web $BUILDROOT/pgAdmin4.app/Contents/Resources/ || exit 1
+
+    # create the config file
+    cd $SOURCEDIR/web
+    sed -e 's;SERVER_MODE = True;SERVER_MODE = False;' -e "s;HELP_PATH = .*;HELP_PATH = \'..\/..\/..\/docs\/en_US\/html\/\';" \
+        $SOURCEDIR/web/config.py > $BUILDROOT/pgAdmin4.app/Contents/Resources/web/config.py
+
+    # copy the resulting app bundle to the dist
+    test -d $DISTROOT || mkdir $DISTROOT || exit 1
+    cp -pR $BUILDROOT/pgAdmin4.app $DISTROOT/ || exit 1
+
+}
+
+_create_dmg() {
+    cd $SOURCEDIR
+    ./pkg/mac/create-dmg.sh || { echo create-dmg.sh failed; exit 1; }
+}
+
+_get_version || { echo Could not get versioning; exit 1; }
+_cleanup
+_build_runtime || { echo Runtime build failed; exit 1; }
+_build_doc
+_complete_bundle
+_create_dmg
Index: pkg/mac/complete-bundle.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/complete-bundle.sh	(revision )
+++ pkg/mac/complete-bundle.sh	(revision )
@@ -0,0 +1,136 @@
+#!/bin/sh
+
+bundle="$1"
+
+if ! test -d "$bundle" ; then
+	echo "$bundle is no bundle!" >&2
+	exit 1
+fi
+
+if test -z $QTDIR ; then
+	echo "QTDIR environment variable not set"
+	exit 1
+else
+	echo "QTDIR=$QTDIR"
+fi
+
+test -d "$bundle/Contents/Resources" || mkdir -p "$bundle/Contents/Resources" || exit 1
+# Create qt.conf so that app knows where the Plugins are present
+cat >> "$bundle/Contents/Resources/qt.conf" << EOF
+[Paths]
+Plugins = PlugIns
+EOF
+
+test -d "$bundle/Contents/Frameworks" || mkdir -p "$bundle/Contents/Frameworks" || exit 1
+test -d "$bundle/Contents/PlugIns/platforms" || mkdir -p "$bundle/Contents/PlugIns/platforms" || exit 1
+cp -f $QTDIR/plugins/platforms/libqcocoa.dylib "$bundle/Contents/PlugIns/platforms" || { echo libqcocoa.dylib not found in $QTDIR/plugins/platforms; exit 1; }
+cp -f $PGDIR/lib/libpq.5.dylib "$bundle/Contents/Frameworks" || { echo libpq.5.dylib not found in $PGDIR; exit 1; }
+
+function CompleteSingleApp() {
+	local bundle=$1 tag=$(basename "$1") todo todo_old fw_relpath lib lib_bn nested_app na_relpath
+
+	echo "Completing app: $bundle"
+	pushd "$bundle" > /dev/null
+
+	#We skip nested apps here - those are treated specially
+	todo=$(file `find ./ -perm +0111 ! -type d ! -path "*.app/*" ! -name "*.app"` | grep -E "Mach-O 64-bit" | awk -F ':| ' '{ORS=" "; print $1}' | uniq)
+
+	echo "App: $tag: Found executables: $todo"
+	while test "$todo" != ""; do
+		todo_old=$todo ;
+		todo="" ;
+		for todo_obj in $todo_old; do
+			echo "App: $tag: Post-processing: $todo_obj"
+
+			#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"
+			fw_relpath_old=$fw_relpath
+
+			fw_loc="Contents/Frameworks"
+
+			#Find all libraries $todo_obj depends on, but skip system libraries
+			for lib in $(
+				otool -L $todo_obj | \
+				grep "Qt\|dylib\|Frameworks\|PlugIns" | grep -v ":" | sed 's/(.*//' | egrep -v '(/usr/lib)|(/System)|@executable_path@' \
+			) $(otool -L $todo_obj | grep "Python" | grep -v ":" | sed 's/(.*//' \
+			); do
+				if echo $lib | grep "PlugIns\|libqcocoa"  > /dev/null; then
+					lib_loc="Contents/PlugIns/platforms"
+				elif echo $lib | grep "Qt" > /dev/null; then
+					qtfw_path="$(dirname $lib | sed 's|.*\(Qt.*framework\)|\1|')"
+					lib_loc="Contents/Frameworks/$qtfw_path"
+					if [ "$(basename $todo_obj)" = "$lib" ]; then
+						lib_loc="$(dirname $todo_obj)"
+						qtfw_path=$(echo $lib_loc | sed 's/Contents\/Frameworks\///')
+					fi
+				elif echo $lib | grep "Python" > /dev/null; then
+					pyfw_path="$(dirname $lib | sed 's|.*\(Python.*framework\)|\1|')"
+					lib_loc="Contents/Frameworks/$pyfw_path"
+					if [ "$(basename $todo_obj)" = "$lib" ]; then
+						lib_loc="$(dirname $todo_obj)"
+						pyfw_path=$(echo $lib_loc | sed 's/Contents\/Frameworks\///')
+					fi
+				else
+					lib_loc="Contents/Frameworks"
+				fi
+				lib_bn="$(basename "$lib")" ;
+				if ! test -f "$lib_loc/$lib_bn"; then
+                                        target_file=""
+					target_path=""
+					echo "App: $tag: Adding symlink: $lib_bn (because of: $todo_obj)"
+					# Copy the QT and Python framework
+					if echo $lib | grep Qt > /dev/null ; then
+						cp -R $QTDIR/lib/$lib_bn.framework "$fw_loc/"
+					elif echo $lib | grep Python > /dev/null ; then
+						cp -R $(dirname $lib)/../../../$lib_bn.framework "$fw_loc/"
+					else
+						cp -R "$lib" "$lib_loc/$lib_bn"
+					fi
+					if ! test -L "$lib_loc/$lib_bn"; then
+						chmod 755 "$lib_loc/$lib_bn"
+					else
+						target_file=$(readlink "$lib")
+						target_path=$(dirname "$lib")/$target_file
+					        echo "App: $tag: Adding symlink target: $target_path"
+						cp "$target_path" "$lib_loc/$target_file"
+						chmod 755 "$lib_loc/$target_file"
+					fi
+					echo "Rewriting ID in $lib_loc/$lib_bn to $lib_bn"
+                                        install_name_tool \
+                                                -id "$lib_bn" \
+                                                "$lib_loc/$lib_bn" || exit 1
+					todo="$todo ./$lib_loc/$lib_bn"
+				fi
+				if echo $lib | grep Qt > /dev/null ; then
+					fw_relpath="$fw_relpath/$qtfw_path"
+				fi
+				if echo $lib | grep Python > /dev/null ; then
+					fw_relpath="$fw_relpath/$pyfw_path"
+				fi
+				echo "Rewriting library $lib to @loader_path/$fw_relpath/$lib_bn in $todo_obj"
+				install_name_tool -change \
+					"$lib" \
+					"@loader_path/$fw_relpath/$lib_bn" \
+					"$todo_obj" || exit 1
+                                install_name_tool -change \
+                                        "$target_path" \
+                                        "@loader_path/$fw_relpath/$target_file" \
+                                        "$todo_obj" || exit 1
+				fw_relpath="$fw_relpath_old"
+			done
+		done
+	done
+
+	# Fix the rpaths for psycopg module
+	find $bundle/Contents/Resources/venv/ -name _psycopg.so | xargs install_name_tool -change libpq.5.dylib @loader_path/../../../../../../Frameworks/libpq.5.dylib
+	find $bundle/Contents/Resources/venv/ -name _psycopg.so | xargs install_name_tool -change libssl.1.0.0.dylib @loader_path/../../../../../../Frameworks/libssl.1.0.0.dylib
+	find $bundle/Contents/Resources/venv/ -name _psycopg.so | xargs install_name_tool -change libcrypto.1.0.0.dylib @loader_path/../../../../../../Frameworks/libcrypto.1.0.0.dylib
+
+	echo "App completed: $bundle"
+	popd > /dev/null
+}
+
+CompleteSingleApp "$bundle"
Index: pkg/mac/README.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/README.txt	(revision )
+++ pkg/mac/README.txt	(revision )
@@ -0,0 +1,32 @@
+Building pgAdmin4.dmg on Mac OS X
+=================================
+
+Required Packages (Either build the sources or get them from macports or similar):
+
+1. Python installation
+  - Python 2.6 or above from https://www.python.org/
+
+2. QT installation
+  - Qt 4 or 5 from http://www.qt.io/
+
+3. PostgreSQL installation
+  - PostgreSQL 9.1 or above from http://www.postgresql.org/
+
+Building:
+
+1. Set the PYTHON_HOME environment variable to the Python root installation directory, e.g.
+
+   export PYTHON_HOME=/System/Library/Frameworks/Python.framework/Versions/2.7
+
+2. Set the QTDIR environment variable to the QT root installation directory, e.g.
+
+   export QTDIR=~/Qt/5.5/clang_64
+
+3. Set the PGDIR environment variable to the PostgreSQL installation directory, e.g.
+
+   export PGDIR=/usr/local/pgsql
+
+4. To build, go to pgAdmin4 source root directory and execute "make appbundle". This will
+   create the python virtual environment and install all the required python modules mentioned in the
+   requirements file using pip, build the runtime code and finally create the app bundle and the DMG 
+   in ./dist directory
Index: Makefile
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Makefile	(revision 8c077bc2dfd2dda4bd3b5e1338a6d60b404ba78f)
+++ Makefile	(revision )
@@ -13,9 +13,9 @@
 # High-level targets
 #########################################################################
 
-all: install-pip-requirements pip
+all: docs install-pip-requirements pip appbundle
 
-clean: clean-pip
+clean: clean-pip clean-docs clean-appbundle
 
 #########################################################################
 # Python PIP package
@@ -34,6 +34,7 @@
 PGADMIN_SRC_DIR = pgadmin4
 PGADMIN_EGG = ${PGADMIN_SRC_DIR}.egg-info
 PGADMIN_BUILD = build
+PGADMIN_MACBUILD = mac-build
 PGADMIN_DIST = dist
 PGADMIN_MANIFEST = MANIFEST.in
 PGADMIN_INSTALL_CMD = pip install --use-wheel --find-links=${PGADMIN_DIST} ${PGADMIN_SRC_DIR}
@@ -83,9 +84,25 @@
 install-pip:
 	${PGADMIN_INSTALL_CMD}
 
+appbundle: docs
+	./pkg/mac/build.sh
+
+docs:
+	LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html
+
+clean-docs:
+	LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx clean
+
 clean-pip:
 	rm -rf ${PGADMIN_SRC_DIR}
 	rm -rf ${PGADMIN_EGG}
 	rm -rf ${PGADMIN_BUILD}
 	rm -rf ${PGADMIN_DIST}
 	rm -f ${PGADMIN_MANIFEST}
+
+clean-appbundle:
+	rm -rf ${PGADMIN_MACBUILD}
+	rm -rf ${PGADMIN_DIST}/pgAdmin4.app
+	rm -f ${PGADMIN_DIST}/pgAdmin4.dmg
+
+.PHONY: docs
Index: pkg/mac/licence.r
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/mac/licence.r	(revision )
+++ pkg/mac/licence.r	(revision )
@@ -0,0 +1,42 @@
+data 'LPic' (5000) {
+	$"0000 0001 0000 0000 0000"
+};
+
+resource 'STR#' (5000, "English buttons") {
+    {   /* array StringArray: 9 elements */
+        /* [1] */
+        "English",
+        /* [2] */
+        "Agree",
+        /* [3] */
+        "Disagree",
+        /* [4] */
+        "Print",
+        /* [5] */
+        "Save...",
+        /* [6] */
+        "IMPORTANT - Read this License Agreement carefully before clicking on "
+        "the \"Agree\" button.  By clicking on the \"Agree\" button, you agree "
+        "to be bound by the terms of the License Agreement.",
+        /* [7] */
+        "Software License Agreement",
+        /* [8] */
+        "This text cannot be saved. This disk may be full or locked, or the file "
+        "may be locked.",
+        /* [9] */
+        "Unable to print. Make sure you've selected a printer."
+    }
+};
+
+data 'TEXT' (5000, "English") {
+    "pgAdmin 4\n"
+    "\n"
+    "Copyright (C) 2013 - 2016, The pgAdmin Development Team\n"
+    "\n"
+    "Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.\n"
+    "\n"
+    "IN NO EVENT SHALL THE PGADMIN DEVELOPMENT TEAM BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE PGADMIN DEVELOPMENT TEAM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
+    "\n"
+    "THE PGADMIN DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS, AND THE PGADMIN DEVELOPMENT TEAM HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n"
+};
+
Index: web/config_local.py.default
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web/config_local.py.default	(revision )
+++ web/config_local.py.default	(revision )
@@ -0,0 +1,28 @@
+from config import *
+
+# Debug mode
+DEBUG = True
+
+# App mode
+SERVER_MODE = False
+
+# Enable the test module
+MODULE_BLACKLIST.remove('test')
+
+# Log file name
+LOG_FILE = '/Users/dpage/pgadmin4.log'
+CONSOLE_LOG_LEVEL = DEBUG
+FILE_LOG_LEVEL = DEBUG
+
+# Mail server settings
+MAIL_SERVER = 'smtp.gmail.com'
+MAIL_PORT = 465
+MAIL_USE_SSL = True
+MAIL_USERNAME = [email-masked]'
+MAIL_PASSWORD = 'P0werConnect'
+
+TEST_USERNAME = 'guybrush'
+TEST_PASSWORD = 'password'
+TEST_NEW_PASSWORD = 'newpassword'
+
+UPGRADE_CHECK_ENABLED = False

---

From: Dave Page <[email-masked]>
Date: Fri, 27 May 2016 16:48:15 +0100

On Fri, May 27, 2016 at 1:11 PM, Sandeep Thakkar <
[email-masked]> wrote:

> Sure. Thanks.
>
> There is a typo in pkg/mac/build.sh. i.e
>
> s/HTML_HELP/HELP_PATH/
>
>
> On Fri, May 27, 2016 at 5:26 PM, Dave Page <[email-masked]> wrote:
>
>> Not entirely - we definitely need to improve it. I'll review the code as
>> it is now though.
>>
>
OK, review time :-)

- The appbundle name should be created from APP_NAME.app in config.py, e.g.
'pgAdmin 4.app'

- The DMG name should be created from
to_lower(remove_spaces(APP_NAME-APP_VERSION)) in config.py, e.g.
pgadmin4-1.0-dev.dmg

- Use #ifdef Q_OS_MAC in the QT code for Mac-specific code. There's no need
to define another macro.

- Please add "MINIFY_HTML = False" to config_local.py (and have Paresh do
the same on his packages). This works around a code issue with the docs
that I'll log a bug for.

- In testing, I found that running the app from within the DMG doesn't seem
to work the first time - it prompts for the path, then exits. Once I save
the path it offers, it's fine on subsequent runs.

- Once copied to my laptop, I saw the same issue as above.

Once these issues are resolved, I think we're good to commit.

Thanks!

---

From: Dave Page <[email-masked]>
Date: Fri, 27 May 2016 16:58:50 +0100

On Fri, May 27, 2016 at 4:48 PM, Dave Page <[email-masked]> wrote:
>
>
> On Fri, May 27, 2016 at 1:11 PM, Sandeep Thakkar
> the same on his packages). This works around a code issue with the docs that
> I'll log a bug for.
>

Oh, a couple more things:

- There should not be a copy of the app bundle in dist/ following the
build. Only the dmg should be there.

- I think mac-build/ should be removed following a successful build,
rather than waiting for make clean (please talk to Paresh - his code
should do the same).

---

From: Sandeep Thakkar <[email-masked]>
Date: Mon, 30 May 2016 18:00:12 +0530

Thanks. I have fixed all the issues.

Regarding the app not running from within the DMG for the first time, I was
unable to reproduce it on Zilan's machine which didn't have the development
env. On Murali's machine, it was reproducible for 1 time after couple of
attempts.

So, I just added the sync statement after settings the pythonpath value in
the settings. May be this will resolve the issue. Please confirm.
settings.sync();

Attached is the updated patch. Thanks.

On Fri, May 27, 2016 at 9:28 PM, Dave Page <[email-masked]> wrote:

> that

-- 
Sandeep Thakkar

---

From: Sandeep Thakkar <[email-masked]>
Date: Tue, 31 May 2016 17:49:42 +0530

Somehow the patch skipped the Makefile changes. Attached is the updated
patch.

On Mon, May 30, 2016 at 6:00 PM, Sandeep Thakkar <
[email-masked]> wrote:

> Regarding the app not running from within the DMG for the first time, I
> was unable to reproduce it on Zilan's machine which didn't have the
> development env. On Murali's machine, it was reproducible for 1 time after
> couple of attempts.
>

-- 
Sandeep Thakkar

---

From: Dave Page <[email-masked]>
Date: Tue, 31 May 2016 16:59:47 +0100

Hi,

On the first run, I get:

App completed: /Users/dpage/git/pgadmin4/pkg/mac/../../mac-build/pgAdmin 4.app
./pkg/mac/create-dmg.sh: line 6: cd: dist: No such file or directory
Cleaning up
Copying data into temporary directory
cp: ./../mac-build/pgAdmin 4.app: No such file or directory
create-dmg.sh failed
make: *** [appbundle] Error 1

If I run it again, I get:

App completed: /Users/dpage/git/pgadmin4/pkg/mac/../../mac-build/pgAdmin 4.app
./pkg/mac/create-dmg.sh: line 6: cd: dist: No such file or directory
Directory ./pgadmin4-1.0-dev.dmg.src already exists. Please delete it manually.
create-dmg.sh failed
make: *** [appbundle] Error 1

If I manually create $SRC/dist, it's much happier.

Other issues:

- Your changes to the runtime don't seem to help. I've been staring at
the code for an hour or so now, and I can't see the issue though. We
may need some fresh eyes.

- pkg/mac/create-dmg.sh is mixing upper and lower case variable names
and with/without _, e.g. $dmgname vs $DMG_NAME

- Shoudn't DMG_NAME be initialised to `grep "^APP_NAME" web/config.py
| cut -d"=" -f2 | sed "s/'//g"` ?

On Tue, May 31, 2016 at 1:19 PM, Sandeep Thakkar
<[email-masked]> wrote:
> On Mon, May 30, 2016 at 6:00 PM, Sandeep Thakkar

---

From: Sandeep Thakkar <[email-masked]>
Date: Tue, 31 May 2016 23:07:51 +0530

Hi Dave,

On Tue, May 31, 2016 at 9:29 PM, Dave Page <[email-masked]> wrote:

> I have used variable for dist. It will create the directory if doesn't
exist. The clean-appbunde will also remove the .src directory in dist just
in case it is present.

Other issues:
> yeah, I also spent more time to see the code and test it. Infact, I could
hardly reproduce it 1 or 2 times.

> not sure, why I used lower case, I prefer upper case always. I have made
the changes now to use upper case for all variables.

> yes, I have used the couple of more variables that gives proper
understanding.

Thanks! I have attached the updated patch. (runtime changes remains same).

> >>> >>> Not entirely - we definitely need to improve it. I'll review the
> code
> >>> >>> as
> >>> >>> it is now though.
> >>> >
> >>> >
> >>> > OK, review time :-)
> >>> >
> >>> > - The appbundle name should be created from APP_NAME.app in
> config.py,
> >>> > e.g.
> >>> > 'pgAdmin 4.app'
> >>> >
> >>> > - Use #ifdef Q_OS_MAC in the QT code for Mac-specific code. There's
> no
> >>> > need
> >>> > to define another macro.
> >>> >
> >>> > - Please add "MINIFY_HTML = False" to config_local.py (and have
> Paresh
> >>> > do
> >>> > - In testing, I found that running the app from within the DMG
> doesn't
> >>> > seem

-- 
Sandeep Thakkar

---

From: Dave Page <[email-masked]>
Date: Thu, 2 Jun 2016 13:57:35 +0100

Thanks - applied with some tweaks to the runtime code (i.e. not saving
the location of the venv in the appbundle).

On Tue, May 31, 2016 at 6:37 PM, Sandeep Thakkar
<[email-masked]> wrote:
> not sure, why I used lower case, I prefer upper case always. I have made the
> changes now to use upper case for all variables.
>
>>

---

From: Sandeep Thakkar <[email-masked]>
Date: Thu, 2 Jun 2016 18:35:54 +0530

Thanks Dave!

I saw the runtime code and observed one change (prepend -> append) . Was it
not saving the location because of this?

On Thu, Jun 2, 2016 at 6:27 PM, Dave Page <[email-masked]> wrote:

> >> >> So, I just added the sync statement after settings the pythonpath
> value
> >> >> in
> >> >>> > to work the first time - it prompts for the path, then exits.
> Once I
> >> >>> > save

-- 
Sandeep Thakkar

---

From: Dave Page <[email-masked]>
Date: Thu, 2 Jun 2016 14:07:28 +0100

> not saving the location because of this?

No - I changed that because if the value is prepended, the user cannot
override it. This way anything explicitly defined by the user will
take priority.

---

From: Sandeep Thakkar <[email-masked]>
Date: Thu, 2 Jun 2016 18:43:32 +0530

okay. Thanks again!

-- 
Sandeep Thakkar