Merge pull request #26 from gh2k/osx-packager

Add osx packaging script
This commit is contained in:
Matt Feemster 2015-07-29 17:44:06 -07:00
commit 1f77ca2098
12 changed files with 63 additions and 16 deletions

2
.gitignore vendored
View File

@ -47,3 +47,5 @@ Builds/QtCreator/build*
Makefile
.qmake.stash
*.gch
debug/
release/

View File

@ -5,8 +5,8 @@ CONFIG -= qt
include(../shared_settings.pri)
LIBS += -L$$DESTDIR -lEmber
LIBS += -L$$DESTDIR -lEmberCL
LIBS += -L$$absolute_path($$DESTDIR) -lEmber
LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL
!macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h

View File

@ -5,7 +5,7 @@ CONFIG -= qt
include(../shared_settings.pri)
LIBS += -L$$DESTDIR -lEmber
LIBS += -L$$absolute_path($$DESTDIR) -lEmber
!macx:PRECOMPILED_HEADER = ../../../Source/EmberCL/EmberCLPch.h

View File

@ -5,8 +5,8 @@ CONFIG -= qt
include(../shared_settings.pri)
LIBS += -L$$DESTDIR -lEmber
LIBS += -L$$DESTDIR -lEmberCL
LIBS += -L$$absolute_path($$DESTDIR) -lEmber
LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL
!macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h

View File

@ -5,8 +5,8 @@ CONFIG -= qt
include(../shared_settings.pri)
LIBS += -L$$DESTDIR -lEmber
LIBS += -L$$DESTDIR -lEmberCL
LIBS += -L$$absolute_path($$DESTDIR) -lEmber
LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL
!macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h

View File

@ -13,8 +13,10 @@ TEMPLATE = app
include(../shared_settings.pri)
LIBS += -L$$DESTDIR -lEmber
LIBS += -L$$DESTDIR -lEmberCL
macx:ICON = ../../package/osx/Fractorium.icns
LIBS += -L$$absolute_path($$DESTDIR) -lEmber
LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL
INCLUDEPATH += ../../../Source/Fractorium

View File

@ -3,6 +3,9 @@
REBUILD=''
NVIDIA=''
NATIVE=''
CONCURRENCY='-j9'
QMAKE=${QMAKE:-qmake}
RELEASE='CONFIG+=release CONFIG-=debug'
while test $# -gt 0
do
@ -13,6 +16,10 @@ do
;;
--native) NATIVE="CONFIG += native"
;;
--travis) CONCURRENCY="-j1"
;;
--debug) RELEASE="CONFIG+=debug CONFIG-=release"
;;
--*) echo "bad option $1"; exit 1
;;
*) echo "unrecognised argument $1"; exit 1
@ -29,8 +36,8 @@ do
if [ "x1" = "x$REBUILD" ]; then
make clean
fi
qmake "$NVIDIA" "$NATIVE"
make -j9
$QMAKE "$NVIDIA" "$NATIVE" $RELEASE
make $CONCURRENCY
if [ "x$?" != "x0" ]; then
echo "Build failed! Check output for errors."
exit 1

View File

@ -33,9 +33,13 @@ native {
QMAKE_CXXFLAGS += -march=k8
}
release:DESTDIR = ../../../release
debug:DESTDIR = ../../../debug
DESTDIR = $$(HOME)/Dev/fractorium/Bin
debug:DESTDIR = $$(HOME)/Dev/fractorium/Dbg
OBJECTS_DIR = $$DESTDIR/.obj
MOC_DIR = $$DESTDIR/.moc
RCC_DIR = $$DESTDIR/.qrc
UI_DIR = $$DESTDIR/.ui
LIBS += -L/usr/lib -ljpeg
LIBS += -L/usr/lib -lpng

Binary file not shown.

View File

@ -0,0 +1,30 @@
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
FRACTORIUM_ROOT=$DIR/../../..
PACKAGE=$FRACTORIUM_ROOT/release/Fractorium.app
export QMAKE=~/Qt/5.4.2-static/qtbase/bin/qmake
# Uncomment to force rebuild of package every time
# Probably a good idea in future
rm -rf "$FRACTORIUM_ROOT/release"
$FRACTORIUM_ROOT/Builds/QtCreator/build_all.sh --rebuild
cp $FRACTORIUM_ROOT/Data/flam3-palettes.xml $PACKAGE/Contents/MacOS/
export DYLD_LIBRARY_PATH=/usr/lib:/usr/local/lib:$FRACTORIUM_ROOT/release
cp /usr/lib/libxml2* $PACKAGE/Contents/libs
install_name_tool -id @executable_path/../libs/libxml2.2.dylib $PACKAGE/Contents/libs/libxml2.2.dylib
install_name_tool -change /usr/lib/libxml2.2.dylib @executable_path/../libs/libxml2.2.dylib $PACKAGE/Contents/MacOS/Fractorium
dylibbundler -od -b -x $PACKAGE/Contents/MacOS/Fractorium -d $PACKAGE/Contents/libs
for i in EmberAnimate EmberGenome EmberRender
do
cp $FRACTORIUM_ROOT/release/$i $PACKAGE/Contents/MacOS/
dylibbundler -od -b -x $PACKAGE/Contents/MacOS/$i -d $PACKAGE/Contents/libs
install_name_tool -change /usr/lib/libxml2.2.dylib @executable_path/../libs/libxml2.2.dylib $PACKAGE/Contents/MacOS/$i
done

View File

@ -72,12 +72,14 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
{
m_PreviewRun = false;
m_PreviewRunning = false;
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>("flam3-palettes.xml", new EmberNs::Renderer<T, T>()));
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>(
QString(QApplication::applicationDirPath() + "flam3-palettes.xml").toLocal8Bit().data(),
new EmberNs::Renderer<T, T>()));
m_GLController = unique_ptr<GLEmberController<T>>(new GLEmberController<T>(fractorium, fractorium->ui.GLDisplay, this));
m_PreviewRenderer = unique_ptr<EmberNs::Renderer<T, T>>(new EmberNs::Renderer<T, T>());
//Initial combo change event to fill the palette table will be called automatically later.
if (!InitPaletteList("./"))
if (!InitPaletteList(QCoreApplication::applicationDirPath().toLocal8Bit().data()))
throw "No palettes found, exiting.";
BackgroundChanged(QColor(0, 0, 0));//Default to black.

View File

@ -92,7 +92,7 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
QTableWidget* paletteTable = m_Fractorium->ui.PaletteListTable;
QTableWidget* palettePreviewTable = m_Fractorium->ui.PalettePreviewTable;
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + s;
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + "/" + s;
if (size_t paletteSize = m_PaletteList.Size(m_CurrentPaletteFilePath))
{