Browse Source
[cmake, frontend] Fix update checker and move to self-hosted Git
httplib doesn't like when you include the protocol, as it would seem
Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3558/head
crueter
3 weeks ago
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
5 changed files with
15 additions and
9 deletions
-
CMakeModules/GenerateSCMRev.cmake
-
src/common/scm_rev.cpp.in
-
src/common/scm_rev.h
-
src/frontend_common/CMakeLists.txt
-
src/frontend_common/update_checker.cpp
|
|
@ -36,14 +36,17 @@ set(GIT_DESC ${BUILD_VERSION}) |
|
|
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well |
|
|
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well |
|
|
|
|
|
|
|
|
# Auto-updater metadata! Must somewhat mirror GitHub API endpoint |
|
|
# Auto-updater metadata! Must somewhat mirror GitHub API endpoint |
|
|
set(BUILD_AUTO_UPDATE_WEBSITE "https://github.com") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_API "https://api.github.com") |
|
|
|
|
|
|
|
|
|
|
|
if (NIGHTLY_BUILD) |
|
|
if (NIGHTLY_BUILD) |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_WEBSITE "https://github.com") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_API "api.github.com") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_API_PATH "/repos/") |
|
|
set(BUILD_AUTO_UPDATE_REPO "Eden-CI/Nightly") |
|
|
set(BUILD_AUTO_UPDATE_REPO "Eden-CI/Nightly") |
|
|
set(REPO_NAME "Eden Nightly") |
|
|
set(REPO_NAME "Eden Nightly") |
|
|
else() |
|
|
else() |
|
|
set(BUILD_AUTO_UPDATE_REPO "eden-emulator/Releases") |
|
|
|
|
|
|
|
|
set(BUILD_AUTO_UPDATE_WEBSITE "https://git.eden-emu.dev") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_API "git.eden-emu.dev") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_API_PATH "/api/v1/repos/") |
|
|
|
|
|
set(BUILD_AUTO_UPDATE_REPO "eden-emu/eden") |
|
|
set(REPO_NAME "Eden") |
|
|
set(REPO_NAME "Eden") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
@ -20,6 +20,7 @@ |
|
|
#define COMPILER_ID "@CXX_COMPILER@" |
|
|
#define COMPILER_ID "@CXX_COMPILER@" |
|
|
#define BUILD_AUTO_UPDATE_WEBSITE "@BUILD_AUTO_UPDATE_WEBSITE@" |
|
|
#define BUILD_AUTO_UPDATE_WEBSITE "@BUILD_AUTO_UPDATE_WEBSITE@" |
|
|
#define BUILD_AUTO_UPDATE_API "@BUILD_AUTO_UPDATE_API@" |
|
|
#define BUILD_AUTO_UPDATE_API "@BUILD_AUTO_UPDATE_API@" |
|
|
|
|
|
#define BUILD_AUTO_UPDATE_API_PATH "@BUILD_AUTO_UPDATE_API_PATH@" |
|
|
#define BUILD_AUTO_UPDATE_REPO "@BUILD_AUTO_UPDATE_REPO@" |
|
|
#define BUILD_AUTO_UPDATE_REPO "@BUILD_AUTO_UPDATE_REPO@" |
|
|
#define IS_NIGHTLY_BUILD @IS_NIGHTLY_BUILD@ |
|
|
#define IS_NIGHTLY_BUILD @IS_NIGHTLY_BUILD@ |
|
|
|
|
|
|
|
|
@ -42,6 +43,7 @@ constexpr const bool g_is_nightly_build = IS_NIGHTLY_BUILD; |
|
|
|
|
|
|
|
|
constexpr const char g_build_auto_update_website[] = BUILD_AUTO_UPDATE_WEBSITE; |
|
|
constexpr const char g_build_auto_update_website[] = BUILD_AUTO_UPDATE_WEBSITE; |
|
|
constexpr const char g_build_auto_update_api[] = BUILD_AUTO_UPDATE_API; |
|
|
constexpr const char g_build_auto_update_api[] = BUILD_AUTO_UPDATE_API; |
|
|
|
|
|
constexpr const char g_build_auto_update_api_path[] = BUILD_AUTO_UPDATE_API_PATH; |
|
|
constexpr const char g_build_auto_update_repo[] = BUILD_AUTO_UPDATE_REPO; |
|
|
constexpr const char g_build_auto_update_repo[] = BUILD_AUTO_UPDATE_REPO; |
|
|
|
|
|
|
|
|
} // namespace Common |
|
|
} // namespace Common |
|
|
@ -26,6 +26,7 @@ extern const bool g_is_nightly_build; |
|
|
|
|
|
|
|
|
extern const char g_build_auto_update_website[]; |
|
|
extern const char g_build_auto_update_website[]; |
|
|
extern const char g_build_auto_update_api[]; |
|
|
extern const char g_build_auto_update_api[]; |
|
|
|
|
|
extern const char g_build_auto_update_api_path[]; |
|
|
extern const char g_build_auto_update_repo[]; |
|
|
extern const char g_build_auto_update_repo[]; |
|
|
|
|
|
|
|
|
} // namespace Common |
|
|
} // namespace Common |
|
|
@ -24,7 +24,7 @@ if (ENABLE_UPDATE_CHECKER) |
|
|
update_checker.h) |
|
|
update_checker.h) |
|
|
|
|
|
|
|
|
if (ENABLE_OPENSSL) |
|
|
if (ENABLE_OPENSSL) |
|
|
target_compile_definitions(frontend_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) |
|
|
|
|
|
|
|
|
target_compile_definitions(frontend_common PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT) |
|
|
target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto) |
|
|
target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::stri |
|
|
|
|
|
|
|
|
std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease(bool include_prereleases) { |
|
|
std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease(bool include_prereleases) { |
|
|
const auto update_check_url = std::string{Common::g_build_auto_update_api}; |
|
|
const auto update_check_url = std::string{Common::g_build_auto_update_api}; |
|
|
std::string update_check_path = fmt::format("/repos/{}", |
|
|
|
|
|
|
|
|
auto update_check_path = fmt::format("{}{}", std::string{Common::g_build_auto_update_api_path}, |
|
|
std::string{Common::g_build_auto_update_repo}); |
|
|
std::string{Common::g_build_auto_update_repo}); |
|
|
try { |
|
|
try { |
|
|
if (include_prereleases) { // This can return either a prerelease or a stable release,
|
|
|
if (include_prereleases) { // This can return either a prerelease or a stable release,
|
|
|
|