Skip to content

Commit

Permalink
[#164132100] Brought back DEB changes that were lost in force push
Browse files Browse the repository at this point in the history
- run dir fixes.
- change CEF cache folder.
  • Loading branch information
Artem Chernyshev committed Jul 2, 2019
1 parent c6d4c5b commit 43e0ff3
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ matrix:
- libglew-dev
- compiler: clang
os: osx
osx_image: xcode9.1
osx_image: xcode9.4
env:
- OGRE_ENABLED=0
- GSAGE_VERSION_BUILD=${TRAVIS_BUILD_NUMBER}
Expand Down
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ configure()

include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake OPTIONAL)

if(CONAN_PACKAGE_NAME)
set(CMAKE_INSTALL_PATH "./")
include(cmake/ConanDependencies.cmake)
else(CONAN_PACKAGE_NAME)
set(CMAKE_INSTALL_PATH "/usr/local")
include(cmake/Dependencies.cmake)
endif(CONAN_PACKAGE_NAME)
set(CMAKE_INSTALL_PATH "./")
include(cmake/ConanDependencies.cmake)

process_templates()

Expand Down Expand Up @@ -64,9 +59,15 @@ elseif(UNIX)
set(CPACK_DEBIAN_PACKAGE_NAME "gsage")
set(CPACK_DEBIAN_PACKAGE_VERSION "${GSAGE_VERSION_MAJOR}.${GSAGE_VERSION_MINOR}.${GSAGE_VERSION_PATCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Artem Chernyshev")
# additional dependencies for cef
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcups2, libgconf-2-4, libgtk2.0-dev, libgdk-pixbuf2.0-dev, freeglut3-dev")

# other deps will be generated automatically
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open source game engine")

set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${gsage_SOURCE_DIR}/tools/postinst;${gsage_SOURCE_DIR}/tools/prerm")

set(CPACK_GENERATOR "DEB")
endif(APPLE)

Expand Down
14 changes: 14 additions & 0 deletions Core/include/Filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ namespace Gsage {
return Poco::Path(path).getBaseName();
}

/**
* Same as Poco::Path::cacheHome
*/
inline std::string getCacheHome() const {
return expand(Poco::Path::cacheHome());
}

/**
* Same as Poco::Path::expand
*/
inline std::string expand(const std::string& path) const {
return Poco::Path::expand(path);
}

/**
* Flush all copy complete events
*/
Expand Down
1 change: 1 addition & 0 deletions Core/src/EngineSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ namespace Gsage
}

mEngine->fireEvent(SystemChangeEvent(SystemChangeEvent::SYSTEM_STARTED, getName(), this));
LOG(INFO) << "System " << getName() << " was started";
return true;
}

Expand Down
9 changes: 9 additions & 0 deletions PlugIns/CEF/src/CEFPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,13 +917,22 @@ namespace Gsage {
std::stringstream ss;
ss << dirname(path) << "/" << "cef.helper";
CefString(&settings.browser_subprocess_path).FromASCII(ss.str().c_str());

if(!getcwd(path, sizeof(path)-1)) {
LOG(ERROR) << "Failed to get current working directory";
return false;
}
ss = std::stringstream();
ss << path << "/locales";
CefString(&settings.locales_dir_path) = ss.str().c_str();
#elif GSAGE_PLATFORM == GSAGE_WIN32
char filename[] = "cef.helper.exe";
char fullFilename[MAX_PATH];
GetFullPathName(filename, MAX_PATH, fullFilename, nullptr);

CefString(&settings.browser_subprocess_path).FromASCII(fullFilename);
#endif
CefString(&settings.cache_path) = (mFacade->filesystem()->getCacheHome() + "/gsage").c_str();

if(!mFacade->filesystem()->exists(CefString(&settings.browser_subprocess_path).ToString())) {
LOG(ERROR) << "Failed to locate cef.helper executable " << CefString(&settings.browser_subprocess_path).ToString();
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can read more documentation on [http://engine.readthedocs.io/](http://engine

This engine supports three OS at the moment:
* Windows, Visual Studio 2017 and later.
* OSX, ci is using Xcode 9.1.
* OSX, ci is using Xcode 9.4.
* Linux, ci is using Ubuntu 16.04 with GCC 5.4.

There are plans to support iOS and Android.
Expand Down
113 changes: 0 additions & 113 deletions cmake/Dependencies.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/Functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ macro(configure)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")

if(NOT APPLE)
set(INSTALL_BINARY_DIR "local/bin/")
set(INSTALL_BINARY_DIR "local/bin/gsage")
set(INSTALL_LIB_DIR "local/lib/")
set(INSTALL_PLUGINS_DIR "local/lib/gsage")
set(INSTALL_RESOURCE_DIR "share/gsage/")
Expand Down
4 changes: 2 additions & 2 deletions resources/editor/gsage.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Version=${GSAGE_VERSION_MAJOR}.${GSAGE_VERSION_MINOR}.${GSAGE_VERSION_PATCH}
Name=GSAGE Editor
Comment=Open source game engine
Exec=env GSAGE_RUN_DIRECTORY=/usr/share/gsage/ env GSAGE_PLUGINS_DIRECTORIES=/usr/local/lib/gsage/ /usr/local/bin/gsage
Icon=/usr/share/gsage/resources/editor/editor.ico
Exec=env GSAGE_RUN_DIRECTORY=/usr/share/gsage/ env GSAGE_PLUGINS_DIRECTORIES=/usr/local/lib/gsage/ /usr/local/bin/gsage/gsage
Icon=/usr/share/gsage/resources/editor/gsage.ico
Terminal=false
Type=Application
Categories=Development
Expand Down
8 changes: 3 additions & 5 deletions resources/scripts/editor/projectManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ local ProjectManager = class(function(self)
end
self.awaitedSystems[event.systemID] = true
local ready = true
for _, started in pairs(self.awaitedSystems) do
for id, started in pairs(self.awaitedSystems) do
if started ~= true then
ready = false
break
Expand Down Expand Up @@ -263,7 +263,6 @@ function ProjectManager:create(settings, onProgress, onComplete)
message(tostring(err), "#FF0000", true)
end
end

onComplete(success)
end

Expand Down Expand Up @@ -308,7 +307,7 @@ function ProjectManager:create(settings, onProgress, onComplete)
end
message(msg, color)

if percent == 100 then
if percent >= 100 then
finalize(true)
end
end
Expand Down Expand Up @@ -337,7 +336,7 @@ function ProjectManager:create(settings, onProgress, onComplete)
message(msg, color)
percent = percent + step / filecount

if percent == 100 then
if percent >= 100 then
finalize(true)
end
end
Expand Down Expand Up @@ -416,7 +415,6 @@ function ProjectManager:open(projectPath)
log.error("Failed to open project " .. err)
return false
end
log.info("Read project file")

self.openProjectFile = projectFile
local sourcesDir = fs.path.join(self.openProjectFile.projectRoot, "sources")
Expand Down
21 changes: 11 additions & 10 deletions resources/scripts/entrypoints/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ local mode = "world"
local function saveSettings()
log.info("Saving imgui dock state")
dockstates[mode] = dockspace:getState()
projectManager.openProjectFile:setWorkspace(dockstates)
projectManager.openProjectFile:write()
if projectManager.openProjectFile then
projectManager.openProjectFile:setWorkspace(dockstates)
projectManager.openProjectFile:write()
end
editor:putToGlobalState("bindings", bindings:getConfig())
editor:saveGlobalState()
end
Expand Down Expand Up @@ -378,14 +380,13 @@ if imguiInterface:available() then

projectManager:onProjectOpen(function(projectFile)
hideWizard()
if globalEditorState and globalEditorState.dockState then
log.info("Restoring imgui dock state")
dockstates = projectFile:getWorkspace() or globalEditorState.dockState or {
world = {},
character = {}
}
dockspace:setState(dockstates[mode] or {})
end
local dockstates = (projectFile:getWorkspace() or (globalEditorState or {}).dockState) or {
world = {},
character = {},
}

log.info("Restoring imgui dock state")
dockspace:setState(dockstates[mode])
views.assets:configure()
event:bind(core, EngineEvent.STOPPING, saveSettings)
end)
Expand Down
35 changes: 35 additions & 0 deletions tools/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

#DEBHELPER#

set -e

echo "
* TRACE:
ENABLED = false
* DEBUG:
ENABLED = false
* GLOBAL:
FORMAT = "%datetime [%level] [%fbase:%line] %msg"
ENABLED = true
TO_FILE = true
" > /usr/share/gsage/log.cfg

chmod 755 /usr/share/gsage/log.cfg

# update editor configuration
python -c "
import sys, json;
config_path = '/usr/share/gsage/resources/editorConfig.json'
config = None
with open(config_path, 'r') as f:
config = json.load(f)
config['logConfig'] = '/usr/share/gsage/log.cfg'
with open(config_path, 'w') as f:
json.dump(config, f)
"
5 changes: 5 additions & 0 deletions tools/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

#DEBHELPER#

rm /usr/share/gsage/log.cfg

0 comments on commit 43e0ff3

Please sign in to comment.