Index: /linux/flatpak/TODO.txt
===================================================================
--- /linux/flatpak/TODO.txt	(revision 151)
+++ /linux/flatpak/TODO.txt	(revision 151)
@@ -0,0 +1,2 @@
+delete C++ archives?
+set strip to true
Index: /linux/flatpak/boost-configure
===================================================================
--- /linux/flatpak/boost-configure	(revision 151)
+++ /linux/flatpak/boost-configure	(revision 151)
@@ -0,0 +1,10 @@
+./bootstrap.sh "$@"
+
+
+cat <<EOF >Makefile
+all:
+	./b2 -j `nproc` -mt --with-date_time --with-filesystem --with-thread
+
+install:
+	./b2 install
+EOF
Index: /linux/flatpak/net.orxonox.Orxonox.json
===================================================================
--- /linux/flatpak/net.orxonox.Orxonox.json	(revision 151)
+++ /linux/flatpak/net.orxonox.Orxonox.json	(revision 151)
@@ -0,0 +1,195 @@
+{
+    "app-id": "net.orxonox.Orxonox",
+    "runtime": "org.freedesktop.Platform",
+    "runtime-version": "18.08",
+    "sdk": "org.freedesktop.Sdk",
+    "command": "run",
+    "modules": [
+        {
+            "name": "enet",
+            "buildsystem": "autotools",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/enet-1.3.13.tar.gz",
+                    "sha256": "e36072021faa28731b08c15b1c3b5b91b911baf5f6abcc7fe4a6d425abada35c"
+                }
+            ]
+        },
+        {
+            "name": "freealut",
+            "buildsystem": "cmake",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/freealut-last-upstream-commit.tar.gz",
+                    "sha256": "fefc7aca3c64a7529531afc35a412db351c1f4a425af023d12c9a80f8f1e1a53"
+                }
+            ]
+        },
+        {
+            "name": "boost",
+            "cleanup": [ "/lib/libboost_*.a" ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/boost_1_68_0.tar.bz2",
+                    "sha256": "7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7"
+                },
+                {
+                    "type": "file",
+                    "path": "boost-configure",
+                    "dest-filename": "configure"
+                }
+            ]
+        },
+        {
+            "name": "xmu",
+            "buildsystem": "autotools",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/libXmu-1.1.1.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "xaw",
+            "buildsystem": "autotools",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/libXaw-1.0.11.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "freetype",
+            "buildsystem": "autotools",
+            "builddir": true,
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/freetype-2.4.0.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "freeimage",
+            "buildsystem": "simple",
+            "build-commands": [
+                "make -j",
+                "make install"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/FreeImage3180-modified.tar.xz"
+                }
+            ]
+        },
+        {
+            "name": "glu",
+            "buildsystem": "autotools",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/glu.tar.xz"
+                }
+            ]
+        },
+        {
+            "name": "ogre",
+            "buildsystem": "cmake",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/ogre-1.9.tar.xz"
+                },
+                {
+                    "type": "patch",
+                    "path": "ogre1.9-gcc5.2.patch"
+                }
+            ]
+        },
+        {
+            "name": "lua",
+            "buildsystem": "cmake",
+            "config-opts": [],
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/lua-5.1.5.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "tolua++",
+            "buildsystem": "cmake",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/toluapp-1.0.93.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "cegui",
+            "buildsystem": "cmake",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/cegui-0.8.7.tar.bz2",
+                    "sha256": "b351e8957716d9c170612c13559e49530ef911ae4bac2feeb2dacd70b430e518"
+                }
+            ]
+        },
+        {
+            "name": "tinyxml",
+            "buildsystem": "cmake",
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/tinyxml_2_6_2-cmake.tar.xz"
+                }
+            ]
+        },
+        {
+            "name": "tcl",
+            "buildsystem": "simple",
+            "subdir": "unix",
+            "build-commands": [
+                "./configure --prefix=/app --exec-prefix=/app",
+                "make -j",
+                "make install",
+                "chmod 755 /app/lib/libtcl8.6.so",
+                "chmod 755 /app/lib/tdbcpostgres1.0.6/libtdbcpostgres1.0.6.so"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "path": "deps/tcl8.6.8-src.tar.gz"
+                }
+            ]
+        },
+        {
+            "name": "orxonox",
+            "buildsystem": "cmake",
+            "builddir": true,
+            "subdir": "code",
+            "sources": [
+                {
+                    "type": "dir",
+                    "path": "orxonox"
+                }
+            ]
+        }
+    ],
+    "finish-args": [
+        "--socket=x11",
+        "--share=network",
+        "--share=ipc",
+        "--device=dri",
+        "--socket=pulseaudio"
+    ]
+}
Index: /linux/flatpak/ogre1.9-gcc5.2.patch
===================================================================
--- /linux/flatpak/ogre1.9-gcc5.2.patch	(revision 151)
+++ /linux/flatpak/ogre1.9-gcc5.2.patch	(revision 151)
@@ -0,0 +1,63 @@
+--- a/OgreMain/include/OgreProgressiveMeshGenerator.h	2015-09-03 04:58:34.119585218 +0200
++++ b/OgreMain/include/OgreProgressiveMeshGenerator.h	2015-09-03 04:58:39.342585320 +0200
+@@ -215,7 +215,40 @@
+ 	void tuneContainerSize();
+ 	void addVertexData(VertexData* vertexData, bool useSharedVertexLookup);
+ 	template<typename IndexType>
+-	void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID);
++	void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID)
++	{
++
++		// Loop through all triangles and connect them to the vertices.
++		for (; iPos < iEnd; iPos += 3) {
++			// It should never reallocate or every pointer will be invalid.
++			OgreAssert(mTriangleList.capacity() > mTriangleList.size(), "");
++			mTriangleList.push_back(PMTriangle());
++			PMTriangle* tri = &mTriangleList.back();
++			tri->isRemoved = false;
++			tri->submeshID = submeshID;
++			for (int i = 0; i < 3; i++) {
++				// Invalid index: Index is bigger then vertex buffer size.
++				OgreAssert(iPos[i] < lookup.size(), "");
++				tri->vertexID[i] = iPos[i];
++				tri->vertex[i] = lookup[iPos[i]];
++			}
++			if (tri->isMalformed()) {
++#if OGRE_DEBUG_MODE
++				stringstream str;
++				str << "In " << mMeshName << " malformed triangle found with ID: " << getTriangleID(tri) << ". " <<
++				std::endl;
++				printTriangle(tri, str);
++				str << "It will be excluded from LOD level calculations.";
++				LogManager::getSingleton().stream() << str.str();
++#endif
++				tri->isRemoved = true;
++				mIndexBufferInfoList[tri->submeshID].indexCount -= 3;
++				continue;
++			}
++			tri->computeNormal();
++			addTriangleToEdges(tri);
++		}
++	}
+ 	void addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID);
+ 
+ 	void computeCosts();
+--- a/OgreMain/src/OgreProgressiveMeshGenerator.cpp	2015-09-03 04:58:34.879585233 +0200
++++ b/OgreMain/src/OgreProgressiveMeshGenerator.cpp	2015-09-03 04:58:43.944585409 +0200
+@@ -219,6 +219,8 @@
+ 	}
+ 	vbuf->unlock();
+ }
++/// Called from OgreQueuedProgressiveMeshGenerator.cpp, so it can not be defined in here.
++#if 0
+ template<typename IndexType>
+ void ProgressiveMeshGenerator::addIndexDataImpl(IndexType* iPos, const IndexType* iEnd,
+                                                 VertexLookupList& lookup,
+@@ -256,6 +258,7 @@
+ 		addTriangleToEdges(tri);
+ 	}
+ }
++#endif // 0
+ 
+ void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
+ {
Index: /linux/flatpak/pthreads.patch
===================================================================
--- /linux/flatpak/pthreads.patch	(revision 151)
+++ /linux/flatpak/pthreads.patch	(revision 151)
@@ -0,0 +1,13 @@
+--- CMake/Dependencies.cmake	2018-10-06 16:20:48.650708050 +0200
++++ CMake/Dependencies.cmake	2018-10-06 16:17:46.475146000 +0200
+@@ -58,6 +58,10 @@
+ set(CMAKE_PREFIX_PATH ${OGRE_DEP_SEARCH_PATH} ${CMAKE_PREFIX_PATH})
+ set(CMAKE_FRAMEWORK_PATH ${OGRE_DEP_SEARCH_PATH} ${CMAKE_FRAMEWORK_PATH})
+ 
++# to correctly locate pthread.so instead of pthreads.so
++find_package(Threads)
++# end
++
+ #######################################################################
+ # Core dependencies
+ #######################################################################
