Browse Source
[cmake, frontend] Fix update checker and move to self-hosted Git (#3558 )
httplib doesn't like when you include the protocol, as it would seem
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3558
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
pull/3560/head
crueter
2 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})
# A l s o i f t h i s i s a C I b u i l d , a d d t h e b u i l d name ( ie: Nightly, Canary ) t o t h e s c m _ r e v f i l e a s w e l l
# A l s o i f t h i s i s a C I b u i l d , a d d t h e b u i l d name ( ie: Nightly, Canary ) t o t h e s c m _ r e v f i l e a s w e l l
# A u t o - u p d a t e r m e t a d a t a ! M u s t s o m e w h a t m i r r o r G i t H u b A P I e n d p o i n t
# A u t o - u p d a t e r m e t a d a t a ! M u s t s o m e w h a t m i r r o r G i t H u b A P I e n d p o i n t
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)
u p d a t e _ c h e c k e r . h )
u p d a t e _ c h e c k e r . 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 } ;
s td : : string update_check_path = fmt : : format ( " /repos/{} " ,
auto update_check_path = fm t: : 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,