Commits

Aleš Erjavec committed bc04961

Fixes for OSX application build script.

  • Participants
  • Parent commits aec2d20

Comments (0)

Files changed (1)

install-scripts/mac/build-osx-app.sh

     fi
 fi
 
-TEMPLATE_URL=${TEMPLATE_URL:-"http://orange.biolab.si/download/bundle-templates/Orange.app.tar.gz"}
+TEMPLATE_URL=${TEMPLATE_URL:-"http://orange.biolab.si/download/bundle-templates/Orange.app-template.tar.gz"}
 
 SCHEMA_REGEX='^(https?|ftp|local)://.*'
 
     echo "Retrieving a template from $TEMPLATE_URL"
     # check for a url schema
     if [[ $TEMPLATE_URL =~ $SCHEMA_REGEX ]]; then
-        curl --fail --silent "$TEMPLATE_URL" | tar -xf -C "$BUILD_DIR"
+        curl --fail --silent "$TEMPLATE_URL" | tar -x -C "$BUILD_DIR"
         TEMPLATE=( $BUILD_DIR/*.app )
 
     elif [[ -d $TEMPLATE_URL ]]; then
 PIP=$TEMPLATE/Contents/MacOS/pip
 
 PREFIX=$("$PYTHON" -c'import sys; print sys.prefix')
+SITE_PACKAGES=$("$PYTHON" -c'import sysconfig as sc; print(sc.get_path("platlib"))')
 
 echo "Building Orange"
 echo "==============="
 EXTRA_CXXFLAGS="-F$FDIR -I$FDIR/QtCore.framework/Headers -I$FDIR/QtGui.framework/Headers"
 EXTRA_LDFLAGS="-F$FDIR -framework QtCore -framework QtGui"
 
+echo "Fixing sip/pyqt configuration"
+
+sed -i.bak "s@/.*/Orange.app/@$TEMPLATE/@g" "${SITE_PACKAGES}"/PyQt4/pyqtconfig.py
+sed -i.bak "s@/.*/Orange.app/@$TEMPLATE/@g" "${SITE_PACKAGES}"/sipconfig.py
+
+
 (
     PATH=$EXTRA_PATH:$PATH
     CXXFLAGS=${EXTRA_CXXFLAGS}${CXXFLAGS:+:$CXXFLAGS}
 echo "Installing add ons"
 echo "=================="
 
-"$PIP" install hg+https://bitbucket.org/biolab/orange-bioinformatics
-"$PIP" install hg+https://bitbucket.org/biolab/orange-text
+# Install as eggs. The application's Add-ons dialog has problem with
+# upgrading flat installs.
+"$PIP" install --egg hg+https://bitbucket.org/biolab/orange-bioinformatics
+"$PIP" install --egg hg+https://bitbucket.org/biolab/orange-text
 
 
 if [[ ! $INPLACE ]]; then
     if [[ -e $APP ]]; then
         rm -rf "$APP"
     fi
-
+    mkdir -p $(dirname "$APP")
     mv "$TEMPLATE" "$APP"
 fi