diff --git a/.gitignore b/.gitignore index 964a341..bb37962 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ out usb_test/ __pycache__ usb_*.spec + +CMakeUserPresets.json +build_patreon.sh diff --git a/sphaira/CMakeLists.txt b/sphaira/CMakeLists.txt index 972b5ef..d322087 100644 --- a/sphaira/CMakeLists.txt +++ b/sphaira/CMakeLists.txt @@ -58,7 +58,11 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE ) -set(sphaira_VERSION_HASH "${sphaira_VERSION} [${GIT_COMMIT}]") +if (DEFINED sphaira_VERSION_OVERRIDE) + set(sphaira_DISPLAY_VERSION "${sphaira_VERSION_OVERRIDE} [${GIT_COMMIT}]") +else() + set(sphaira_DISPLAY_VERSION "${sphaira_VERSION} [${GIT_COMMIT}]") +endif() add_executable(sphaira source/ui/menus/appstore.cpp @@ -158,7 +162,7 @@ add_executable(sphaira target_compile_definitions(sphaira PRIVATE -DAPP_VERSION="${sphaira_VERSION}" - -DAPP_VERSION_HASH="${sphaira_VERSION_HASH}" + -DAPP_DISPLAY_VERSION="${sphaira_DISPLAY_VERSION}" -DCURL_NO_OLDIES=1 -DDEV_BUILD=$ -DZSTD_STATIC_LINKING_ONLY=1 diff --git a/sphaira/source/app.cpp b/sphaira/source/app.cpp index e5cab21..ff3efdb 100644 --- a/sphaira/source/app.cpp +++ b/sphaira/source/app.cpp @@ -1552,7 +1552,7 @@ App::App(const char* argv0) { if (App::GetLogEnable()) { log_file_init(); - log_write("hello world v%s\n", APP_VERSION_HASH); + log_write("hello world v%s\n", APP_DISPLAY_VERSION); } // anything that can be async loaded should be placed in here in order diff --git a/sphaira/source/ui/menus/filebrowser.cpp b/sphaira/source/ui/menus/filebrowser.cpp index e931f15..9d9d14d 100644 --- a/sphaira/source/ui/menus/filebrowser.cpp +++ b/sphaira/source/ui/menus/filebrowser.cpp @@ -953,7 +953,7 @@ void FsView::ZipFiles(fs::FsPath zip_out) { auto zfile = zipOpen2_64(zip_out, APPEND_STATUS_CREATE, nullptr, &file_func); R_UNLESS(zfile, Result_ZipOpen2_64); - ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_VERSION_HASH)); + ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_DISPLAY_VERSION)); const auto zip_add = [&](const fs::FsPath& file_path) -> Result { // the file name needs to be relative to the current directory. diff --git a/sphaira/source/ui/menus/main_menu.cpp b/sphaira/source/ui/menus/main_menu.cpp index f910a94..4b0af57 100644 --- a/sphaira/source/ui/menus/main_menu.cpp +++ b/sphaira/source/ui/menus/main_menu.cpp @@ -276,7 +276,7 @@ MainMenu::MainMenu() { std::make_pair(Button::START, Action{App::Exit}), std::make_pair(Button::SELECT, Action{App::DisplayMenuOptions}), std::make_pair(Button::Y, Action{"Menu"_i18n, [this](){ - auto options = std::make_unique("Menu Options"_i18n, "v" APP_VERSION_HASH, Sidebar::Side::LEFT); + auto options = std::make_unique("Menu Options"_i18n, "v" APP_DISPLAY_VERSION, Sidebar::Side::LEFT); ON_SCOPE_EXIT(App::Push(std::move(options))); SidebarEntryArray::Items language_items; diff --git a/sphaira/source/ui/menus/save_menu.cpp b/sphaira/source/ui/menus/save_menu.cpp index 0b048d2..196c881 100644 --- a/sphaira/source/ui/menus/save_menu.cpp +++ b/sphaira/source/ui/menus/save_menu.cpp @@ -1037,7 +1037,7 @@ Result Menu::BackupSaveInternal(ProgressBox* pbox, const dump::DumpLocation& loc { auto zfile = zipOpen2_64(path, APPEND_STATUS_CREATE, nullptr, &file_func); R_UNLESS(zfile, Result_ZipOpen2_64); - ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_VERSION_HASH)); + ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_DISPLAY_VERSION)); // add save meta. {