summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 78aba3a..eb709e9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,10 +3,13 @@
#include <string>
#include <cmath>
#include <cstdlib>
+#include <unistd.h>
#include <boost/python.hpp>
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
+#undef BOOST_NO_CXX11_SCOPED_ENUMS
#include <boost/algorithm/string/predicate.hpp>
#include <frameobject.h>
@@ -121,23 +124,25 @@ main(int argc, char** argv)
auto pypath = full_path.string() + "/apps/:" + full_path.string() + "/lib/";
std::cout << pypath << std::endl;
#if not defined _WIN32 && not defined _WIN64
- fs::path fromCore("./lib/libQtCore.so.4");
- fs::path toCore("./lib/libQtCore.NOTUSED");
- fs::path fromGui("./lib/libQtGui.so.4");
- fs::path toGui("./lib/libQtGui.NOTUSED");
+ chdir("lib");
+ fs::path fromCore("libQtCore.non-ubuntu");
+ fs::path toCore("libQtCore.so.4");
+ fs::path fromGui("libQtGui.non-ubuntu");
+ fs::path toGui("libQtGui.so.4");
try {
auto desk = std::string(getenv("DESKTOP_SESSION"));
if(boost::starts_with(desk, "ubuntu"))
{
- fs::rename(fromCore, toCore);
- fs::rename(fromGui, toGui);
+ fs::remove(toCore);
+ fs::remove(toGui);
} else {
- fs::rename(toCore, fromCore);
- fs::rename(toGui, fromGui);
+ fs::create_symlink(fromCore, toCore);
+ fs::create_symlink(fromGui, toGui);
}
} catch(...) {
}
+ chdir("..");
setenv("PYTHONPATH", pypath.c_str(), 1);
#endif