Skip to content

Commit

Permalink
Force users to copy app out of disk image
Browse files Browse the repository at this point in the history
(for some reason, Python isn't happy running from a disk image)
  • Loading branch information
mkeeter committed May 22, 2016
1 parent a45c003 commit caca9c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
16 changes: 13 additions & 3 deletions app/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ int main(int argc, char *argv[])
QSurfaceFormat::setDefaultFormat(format);
}

// Create the Application object
App app(argc, argv);

#if defined Q_OS_MAC
if (QCoreApplication::applicationDirPath().startsWith("/Volumes/"))
{
QMessageBox::critical(NULL, "Cannot run from disk image",
"Antimony cannot run from a disk image.\n"
"Please copy it out of the disk image and relaunch.");
exit(1);
}
#endif

// Initialize various Python modules and the interpreter itself
fab::preInit();
Graph::preInit();
AppHooks::preInit();
Py_Initialize();

// Create the Application object
App app(argc, argv);

// Set locale to C to make atof correctly parse floats
setlocale(LC_NUMERIC, "C");

Expand Down
11 changes: 6 additions & 5 deletions deploy/mac/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,24 @@ rm -rf app lib
make -j8
macdeployqt app/Antimony.app

PY_VERSION=3.5
cd app/Antimony.app/Contents/PlugIns
rm -rf accessible audio imageformats mediaservice playlistformats position printsupport qml1tooling sensorgestures sensors

cd ../Frameworks
rm -rf QtDeclarative.framework QtMultimedia.framework QtMultimediaWidgets.framework QtPositioning.framework QtQml.framework QtQuick.framework QtScript.framework QtSensors.framework QtSql.framework QtXmlPatterns.framework Qt3DCore.framework Qt3DRender.framework QtLocation.framework QtSerialBus.framework QtSerialPort.framework

PY_VERSION=3.5
cp -r /usr/local/Frameworks/Python.framework .
rm -rf Python.framework/Versions/2.7 Python.framework/Versions/Current
ln -s Python.framework/Versions/$PY_VERSION Python.framework/Versions/Current
rm -rf Python.framework/Current/lib/python$PY_VERSION/site-packages/*
chmod a+w libboost_python3.dylib
install_name_tool -change /usr/local/Frameworks/Python.framework/Versions/$PY_VERSION/Python \
@executable_path/../Frameworks/Python.framework/Versions/$PY_VERSION/Python \
libboost_python3.dylib

cd ../Resources
rm empty.lproj

cd ../MacOS
install_name_tool -change /usr/local/Frameworks/Python.framework/Versions/$PY_VERSION/Python \
install_name_tool -change /usr/local/opt/python3/Frameworks/Python.framework/Versions/$PY_VERSION/Python \
@executable_path/../Frameworks/Python.framework/Versions/$PY_VERSION/Python \
Antimony

Expand Down

0 comments on commit caca9c3

Please sign in to comment.