Skip to content

Commit 3fa303c

Browse files
committed
Linux changes
1 parent 5f164d8 commit 3fa303c

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
1818
# linux detection
1919
if(UNIX AND NOT APPLE)
2020
set(LINUX TRUE CACHE INTERNAL "")
21+
add_definitions(-Wno-write-strings)
2122
endif()
2223
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wxWidgets/build/cmake/modules" CACHE INTERNAL "")
2324
message("module path = ${CMAKE_MODULE_PATH}")

source/add_install_dlg_derived.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void AddNewInstallDlg::PopulateTable(wxCommandEvent&){
5555

5656

5757
void AddNewInstallDlg::GetAllVersions(){
58+
#ifndef __linux__
5859
// version date info
5960
unordered_map<string,string> versionDates;
6061
{
@@ -122,6 +123,7 @@ void AddNewInstallDlg::GetAllVersions(){
122123
wxPostEvent(this, evt);
123124
}
124125
}
126+
#endif
125127
}
126128

127129
void AddNewInstallDlg::Filter(wxCommandEvent& evt){
@@ -146,6 +148,7 @@ void AddNewInstallDlg::PopulateWithFilter(const std::function<bool (const versio
146148
}
147149

148150
void AddNewInstallDlg::InstallSelected(wxCommandEvent&){
151+
#ifndef __linux__
149152
// get the selected item
150153
auto item = versionsListCtrl->GetSelection();
151154
auto data = *(reinterpret_cast<version*>(versionsListCtrl->GetItemData(item)));
@@ -201,6 +204,7 @@ void AddNewInstallDlg::InstallSelected(wxCommandEvent&){
201204
else{
202205
wxMessageBox("Select a version", "Error", wxOK | wxICON_ERROR);
203206
}
207+
#endif
204208
}
205209

206210
void AddNewInstallDlg::InstallSelectedWithHub(wxCommandEvent &){

source/globals.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ struct editor{
118118

119119
#elif defined __linux__
120120
#include <pwd.h>
121-
static const std::string datapath = getpwuid(getuid())->pw_dir + string("/UnityHubNative");
121+
static const std::filesystem::path datapath = std::filesystem::path(getpwuid(getuid())->pw_dir) / "UnityHubNative";
122122
static const std::string null_device = ">/dev/null 2>&1";
123123
static const char dirsep = '/';
124124

125-
static const std::string executable = "Editor/Unity";
126-
static const std::vector<std::string> defaultInstall = {getpwuid(getuid())->pw_dir +string("/Unity/Hub/Editor")};
125+
static const std::filesyste::path executable = "Editor/Unity";
126+
static const std::vector<std::filesystem::path> defaultInstall = {std::filesystem::path(getpwuid(getuid())->pw_dir) / "Unity/Hub/Editor"};
127127
//TODO: make this a preference?
128-
static const std::string hubDefault = "/Applications/Unity Hub.app";
129-
static const std::string templatesDir = "Editor/Data/Resources/PackageManager/ProjectTemplates/";
130-
128+
static const std::filesystem::path hubDefault = "";
129+
static const std::filesystem::path templatesDir = "Editor/Data/Resources/PackageManager/ProjectTemplates/";
130+
static const std::filesystem::path cachedir = std::filesystem::temp_directory_path();
131131
#else
132132
//disalow compilation for unsupported platforms
133133
#error You are compiling on an unsupported operating system. Currently only macOS, Windows, and Linux are supported. If you know how to support your system, submit a pull request.

source/interface_derived.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ MainFrameDerived::MainFrameDerived() : MainFrame(NULL){
8686
if (status != 0){
8787
ReloadData();
8888
}
89+
#if defined __linux__
90+
launchHubBtn->Hide();
91+
#endif
92+
8993
//if no projects to load, the interface will be blank
9094

9195
timeout = new wxTimer(this, TIMER);

0 commit comments

Comments
 (0)