Skip to content

Commit

Permalink
Merge branch 'workshop' into RB-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKepzie committed Sep 26, 2015
2 parents 5e858ee + ac477f3 commit 82f8e5a
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,6 @@ CrashReporterCLI/NatronRendererCrashReporter
*local.sh*
OpenColorIO-Configs
PortIndex
PortIndex.quick
PortIndex.quick
*.7z*
*.exe*
10 changes: 5 additions & 5 deletions Engine/Cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1386,10 +1386,6 @@ class Cache
we re-open the mapping to the RAM put the entry
back into the memoryCache.*/

if ( ret.empty() ) {
_diskCache.erase(diskCached);
}

try {
(*it)->reOpenFileMapping();
} catch (const std::exception & e) {
Expand All @@ -1406,6 +1402,7 @@ class Cache

//put it back into the RAM
_memoryCache.insert( (*it)->getHashKey(), *it );


U64 memoryCacheSize, maximumInMemorySize;
{
Expand Down Expand Up @@ -1435,7 +1432,10 @@ class Cache
if (_signalEmitter) {
_signalEmitter->emitAddedEntry( key.getTime() );
}


///Remove it from the disk cache
_diskCache.erase(diskCached);

return true;
}
}
Expand Down
5 changes: 3 additions & 2 deletions Engine/MemoryFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include "Engine/MemoryFile.h"

#include <stdexcept>

#ifdef __NATRON_WIN32__
# include <windows.h>
#else // unix
Expand All @@ -43,6 +41,7 @@
#include <stdexcept>

#include "Global/Macros.h"
#include "Global/GlobalDefines.h"

#define MIN_FILE_SIZE 4096

Expand Down Expand Up @@ -239,8 +238,10 @@ MemoryFilePrivate::openInternal(MemoryFile::FileOpenModeEnum open_mode)
#endif

if (file_handle == INVALID_HANDLE_VALUE) {
std::string winError = Natron::GetLastErrorAsString();
std::string str("MemoryFile EXC : Failed to open file ");
str.append(path);
str.append(winError);
throw std::runtime_error(str);
}

Expand Down
1 change: 1 addition & 0 deletions Engine/ViewerInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "ViewerInstancePrivate.h"

#include <algorithm> // min, max
#include <stdexcept>

#include <boost/shared_ptr.hpp>
GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF
Expand Down
28 changes: 28 additions & 0 deletions Global/GlobalDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,34 @@ s2ws(const std::string & s)
#endif

}

#ifdef __NATRON_WIN32__


//Returns the last Win32 error, in string format. Returns an empty string if there is no error.
inline
std::string GetLastErrorAsString()
{
//Get the error message, if any.
DWORD errorMessageID = ::GetLastError();
if(errorMessageID == 0)
return std::string(); //No error message has been recorded

LPSTR messageBuffer = 0;
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL);

std::string message(messageBuffer, size);

//Free the buffer.
LocalFree(messageBuffer);

return message;
}


#endif

} // Natron

#endif // ifndef NATRON_GLOBAL_GLOBALDEFINES_H
1 change: 1 addition & 0 deletions Gui/Gui20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <map>
#include <list>
#include <utility>
#include <stdexcept>

#include "Global/Macros.h"

Expand Down
1 change: 1 addition & 0 deletions Gui/GuiAppInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "GuiAppInstance.h"

#include <stdexcept>

#include <QDir>
#include <QSettings>
Expand Down
1 change: 1 addition & 0 deletions Gui/ViewerGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <cassert>
#include <algorithm> // min, max
#include <stdexcept>

#include "Global/Macros.h"
#include "Global/GLIncludes.h" //!<must be included before QGlWidget because of gl.h and glew.h
Expand Down
10 changes: 5 additions & 5 deletions tools/MacOSX/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ CWD=`pwd`

#THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS
#----------------------------------------------------------
NATRON_GIT_TAG=tags/2.0.0
IOPLUG_GIT_TAG=tags/2.0.0
MISCPLUG_GIT_TAG=tags/2.0.0
ARENAPLUG_GIT_TAG=tags/2.0.0
CVPLUG_GIT_TAG=tags/2.0.0
NATRON_GIT_TAG=tags/2.0.0-RC1
IOPLUG_GIT_TAG=tags/2.0.0-RC1
MISCPLUG_GIT_TAG=tags/2.0.0-RC1
ARENAPLUG_GIT_TAG=tags/2.0.0-RC1
CVPLUG_GIT_TAG=tags/2.0.0-RC1
#----------------------------------------------------------

GIT_NATRON=https://github.com/MrKepzie/Natron.git
Expand Down
4 changes: 3 additions & 1 deletion tools/Windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ The environment is now ready to build Natron and plug-ins, just run:
BIT=64
sh snapshots.sh 64


To launch a release build, edit common.sh to adjust which git tags should be used then:
#GPL build, without openfx-opencv plug-ins for 64bit target using 8 threads.
NATRON_LICENSE=GPL OFFLINE_INSTALLER=1 SYNC=1 NOCLEAN=1 CV=0 sh build.sh 64 tag 8
10 changes: 5 additions & 5 deletions tools/Windows/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ fi

#THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS
#----------------------------------------------------------
NATRON_GIT_TAG=tags/2.0.0
IOPLUG_GIT_TAG=tags/2.0.0
MISCPLUG_GIT_TAG=tags/2.0.0
ARENAPLUG_GIT_TAG=tags/2.0.0
CVPLUG_GIT_TAG=tags/2.0.0
NATRON_GIT_TAG=tags/2.0.0-RC1
IOPLUG_GIT_TAG=tags/2.0.0-RC1
MISCPLUG_GIT_TAG=tags/2.0.0-RC1
ARENAPLUG_GIT_TAG=tags/2.0.0-RC1
CVPLUG_GIT_TAG=tags/2.0.0-RC1
#----------------------------------------------------------


Expand Down
7 changes: 7 additions & 0 deletions tools/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ For this to work you need to create a file named **repo.sh** next to *snapshot.s

REPO_DEST=user@host:/path
REPO_URL=http://some.url

Release build:
===============

To do a release build just edit the git tags accordingly in common.sh then type:
#Do a GPL build using 4 threads
NATRON_LICENSE=GPL OFFLINE_INSTALLER=1 SYNC=1 NOCLEAN=1 CV=0 sh build.sh tag 4
10 changes: 5 additions & 5 deletions tools/linux/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

#THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS
#----------------------------------------------------------
NATRON_GIT_TAG=tags/2.0.0
IOPLUG_GIT_TAG=tags/2.0.0
MISCPLUG_GIT_TAG=tags/2.0.0
ARENAPLUG_GIT_TAG=tags/2.0.0
CVPLUG_GIT_TAG=tags/2.0.0
NATRON_GIT_TAG=tags/2.0.0-RC1
IOPLUG_GIT_TAG=tags/2.0.0-RC1
MISCPLUG_GIT_TAG=tags/2.0.0-RC1
ARENAPLUG_GIT_TAG=tags/2.0.0-RC1
CVPLUG_GIT_TAG=tags/2.0.0-RC1
#----------------------------------------------------------


Expand Down
12 changes: 6 additions & 6 deletions tools/linux/include/scripts/build-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if [ ! -f "$INSTALL_PATH/bin/yasm" ]; then
fi
tar xvf "$SRC_PATH/$YASM_TAR" || exit 1
cd yasm* || exit 1
./configure --prefix="$INSTALL_PATH" CFLAGS="$BF" CXXFLAGS="$BF" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" || exit 1
make -j${MKJOBS} || exit 1
make install || exit 1
fi
Expand All @@ -169,7 +169,7 @@ if [ ! -f "$INSTALL_PATH/bin/cmake" ]; then
fi
tar xvf "$SRC_PATH/$CMAKE_TAR" || exit 1
cd cmake* || exit 1
./configure --prefix="$INSTALL_PATH" CFLAGS="$BF" CXXFLAGS="$BF" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" || exit 1
make -j${MKJOBS} || exit 1
make install || exit 1
fi
Expand All @@ -182,7 +182,7 @@ if [ ! -f "$INSTALL_PATH/lib/pkgconfig/python2.pc" ]; then
fi
tar xvf "$SRC_PATH/$PY2_TAR" || exit 1
cd Python-2* || exit 1
./configure --prefix="$INSTALL_PATH" --enable-shared CFLAGS="$BF" CXXFLAGS="$BF" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" --enable-shared || exit 1
make -j${MKJOBS} || exit 1
make install || exit 1
mkdir -p "$INSTALL_PATH/docs/python2" || exit 1
Expand All @@ -197,7 +197,7 @@ if [ ! -f "$INSTALL_PATH/lib/pkgconfig/python3.pc" ]; then
fi
tar xvf "$SRC_PATH/$PY3_TAR" || exit 1
cd Python-3* || exit 1
./configure --prefix=$INSTALL_PATH --enable-shared CFLAGS="$BF" CXXFLAGS="$BF" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix=$INSTALL_PATH --enable-shared || exit 1
make -j${MKJOBS} || exit 1
make install || exit 1
mkdir -p "$INSTALL_PATH/docs/python3" || exit 1
Expand Down Expand Up @@ -699,11 +699,11 @@ if [ ! -d $INSTALL_PATH/ffmpeg-gpl ] || [ ! -d $INSTALL_PATH/ffmpeg-lgpl ]; then
fi
tar xvf $SRC_PATH/$FFMPEG_TAR || exit 1
cd ffmpeg-2* || exit 1
./configure --prefix=$INSTALL_PATH/ffmpeg-gpl --libdir=$INSTALL_PATH/ffmpeg-gpl/lib --enable-shared --disable-static $GPL_SETTINGS CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" ./configure --prefix=$INSTALL_PATH/ffmpeg-gpl --libdir=$INSTALL_PATH/ffmpeg-gpl/lib --enable-shared --disable-static $GPL_SETTINGS || exit 1
make -j${MKJOBS} || exit 1
make install || exit 1
make distclean
./configure --prefix=$INSTALL_PATH/ffmpeg-lgpl --libdir=$INSTALL_PATH/ffmpeg-lgpl/lib --enable-shared --disable-static $LGPL_SETTINGS CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" || exit 1
env CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" ./configure --prefix=$INSTALL_PATH/ffmpeg-lgpl --libdir=$INSTALL_PATH/ffmpeg-lgpl/lib --enable-shared --disable-static $LGPL_SETTINGS || exit 1
make install || exit 1
mkdir -p $INSTALL_PATH/docs/ffmpeg || exit 1
cp COPYING* CREDITS $INSTALL_PATH/docs/ffmpeg/
Expand Down

0 comments on commit 82f8e5a

Please sign in to comment.