diff --git a/distributions/Lakka/options b/distributions/Lakka/options index 41eb897cbd..62d83f3299 100644 --- a/distributions/Lakka/options +++ b/distributions/Lakka/options @@ -453,3 +453,20 @@ fi done fi + +# Update server + LAKKA_BUILD_TYPE="${LAKKA_BUILD_TYPE:-release}" + + if [ -z "${LAKKA_UPDATE_SERVER_URL}" ]; then + case ${LAKKA_BUILD_TYPE} in + release) + LAKKA_UPDATE_SERVER_URL="http://le.builds.lakka.tv" + ;; + nightly) + LAKKA_UPDATE_SERVER_URL="http://nightly.builds.lakka.tv/.updater" + ;; + devel) + LAKKA_UPDATE_SERVER_URL="http://nightly.builds.lakka.tv/.devbuild" + ;; + esac + fi diff --git a/packages/lakka/retroarch_base/retroarch/package.mk b/packages/lakka/retroarch_base/retroarch/package.mk index dec760fe38..b0a059a919 100644 --- a/packages/lakka/retroarch_base/retroarch/package.mk +++ b/packages/lakka/retroarch_base/retroarch/package.mk @@ -22,6 +22,8 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-vg \ PKG_MAKE_OPTS_TARGET="V=1 \ HAVE_LAKKA=1 \ + HAVE_LAKKA_PROJECT="${DEVICE:-${PROJECT}}.${ARCH}" \ + HAVE_LAKKA_SERVER="${LAKKA_UPDATE_SERVER_URL}" \ HAVE_CHEEVOS=1 \ HAVE_HAVE_ZARCH=0 \ HAVE_WIFI=1 \ diff --git a/packages/lakka/retroarch_base/retroarch/patches/retroarch-devbuilds_url.patch b/packages/lakka/retroarch_base/retroarch/patches/retroarch-01-devbuilds_url.patch similarity index 100% rename from packages/lakka/retroarch_base/retroarch/patches/retroarch-devbuilds_url.patch rename to packages/lakka/retroarch_base/retroarch/patches/retroarch-01-devbuilds_url.patch diff --git a/packages/lakka/retroarch_base/retroarch/patches/retroarch-fix_makefile_canary.patch b/packages/lakka/retroarch_base/retroarch/patches/retroarch-02-fix_makefile_canary.patch similarity index 100% rename from packages/lakka/retroarch_base/retroarch/patches/retroarch-fix_makefile_canary.patch rename to packages/lakka/retroarch_base/retroarch/patches/retroarch-02-fix_makefile_canary.patch diff --git a/packages/lakka/retroarch_base/retroarch/patches/retroarch-use_nohup.patch b/packages/lakka/retroarch_base/retroarch/patches/retroarch-03-use_nohup.patch similarity index 100% rename from packages/lakka/retroarch_base/retroarch/patches/retroarch-use_nohup.patch rename to packages/lakka/retroarch_base/retroarch/patches/retroarch-03-use_nohup.patch diff --git a/packages/lakka/retroarch_base/retroarch/patches/retroarch-04-lakka_make_flags_change.patch b/packages/lakka/retroarch_base/retroarch/patches/retroarch-04-lakka_make_flags_change.patch new file mode 100644 index 0000000000..2cd8b78dfa --- /dev/null +++ b/packages/lakka/retroarch_base/retroarch/patches/retroarch-04-lakka_make_flags_change.patch @@ -0,0 +1,132 @@ +diff --git a/Makefile.common b/Makefile.common +index 535dc94760..2a715f4786 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -1056,24 +1056,22 @@ endif + + ifeq ($(HAVE_LAKKA), 1) + DEFINES += -DHAVE_LAKKA ++ ifneq ($(HAVE_LAKKA_PROJECT),) ++ DEFINES += -DHAVE_LAKKA_PROJECT=\"${HAVE_LAKKA_PROJECT}\" ++ else ++ $(error You asked for Lakka, but you did not specify a target device name in HAVE_LAKKA_PROJECT) ++ endif ++ ifneq ($(HAVE_LAKKA_SERVER),) ++ DEFINES += -DHAVE_LAKKA_SERVER=\"${HAVE_LAKKA_SERVER}\" ++ else ++ $(error You asked for Lakka, but you did not specify update server in HAVE_LAKKA_SERVER) ++ endif + endif + + ifeq ($(HAVE_LAKKA_SWITCH), 1) + DEFINES += -DHAVE_LAKKA_SWITCH + endif + +-ifeq ($(HAVE_LAKKA_NIGHTLY), 1) +- DEFINES += -DHAVE_LAKKA_NIGHTLY +-endif +- +-ifneq ($(HAVE_LAKKA_CANARY),) +- DEFINES += -DHAVE_LAKKA_CANARY=\"${HAVE_LAKKA_CANARY}\" +-endif +- +-ifeq ($(HAVE_LAKKA_DEVBUILD), 1) +- DEFINES += -DHAVE_LAKKA_DEVBUILD +-endif +- + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/menu_setting.o \ + menu/menu_driver.o \ +diff --git a/file_path_special.h b/file_path_special.h +index cd01bdc41d..6ffe51fb94 100644 +--- a/file_path_special.h ++++ b/file_path_special.h +@@ -76,15 +76,6 @@ RETRO_BEGIN_DECLS + #define FILE_PATH_LOBBY_LIBRETRO_URL "http://lobby.libretro.com/" + #define FILE_PATH_CORE_THUMBNAILS_URL "http://thumbnails.libretro.com" + #define FILE_PATH_CORE_THUMBNAILPACKS_URL "http://thumbnailpacks.libretro.com" +-#ifdef HAVE_LAKKA_CANARY +-#define FILE_PATH_LAKKA_URL HAVE_LAKKA_CANARY +-#elif defined (HAVE_LAKKA_NIGHTLY) +-#define FILE_PATH_LAKKA_URL "http://nightly.builds.lakka.tv/.updater" +-#elif defined (HAVE_LAKKA_DEVBUILD) +-#define FILE_PATH_LAKKA_URL "http://nightly.builds.lakka.tv/.devbuild" +-#else +-#define FILE_PATH_LAKKA_URL "http://le.builds.lakka.tv" +-#endif + #define FILE_PATH_SHADERS_GLSL_ZIP "shaders_glsl.zip" + #define FILE_PATH_SHADERS_SLANG_ZIP "shaders_slang.zip" + #define FILE_PATH_SHADERS_CG_ZIP "shaders_cg.zip" +@@ -121,6 +112,19 @@ RETRO_BEGIN_DECLS + #define FILE_PATH_CORE_INFO_CACHE "core_info.cache" + #define FILE_PATH_CORE_INFO_CACHE_REFRESH "core_info.refresh" + ++#ifdef HAVE_LAKKA ++ #ifdef HAVE_LAKKA_SERVER ++ #define FILE_PATH_LAKKA_URL HAVE_LAKKA_SERVER ++ #else ++ #error "Building for Lakka, but no update server was defined! Add -DHAVE_LAKKA_SERVER=\\\"http://...\\\"" ++ #endif ++ #ifdef HAVE_LAKKA_PROJECT ++ #define LAKKA_PROJECT HAVE_LAKKA_PROJECT ++ #else ++ #error "Building for Lakka, but no target device name was defined! Add -DHAVE_LAKKA_PROJECT=\\\"DeviceName.arch\\\"" ++ #endif ++#endif ++ + enum application_special_type + { + APPLICATION_SPECIAL_NONE = 0, +diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c +index 351609df85..5a5d69fef9 100644 +--- a/menu/cbs/menu_cbs_ok.c ++++ b/menu/cbs/menu_cbs_ok.c +@@ -246,30 +246,6 @@ static int (funcname)(const char *path, const char *label, unsigned type, size_t + return generic_action_ok_help(path, label, type, idx, entry_idx, _id, _id2); \ + } + +-#ifdef HAVE_NETWORKING +-#ifdef HAVE_LAKKA +-static char *lakka_get_project(void) +-{ +-#ifndef HAVE_LAKKA_CANARY +- size_t len; +- static char lakka_project[128]; +- FILE *command_file = popen("cat /etc/release | cut -d - -f 1", "r"); +- +- fgets(lakka_project, sizeof(lakka_project), command_file); +- len = strlen(lakka_project); +- +- if (len > 0 && lakka_project[len-1] == '\n') +- lakka_project[--len] = '\0'; +- +- pclose(command_file); +- return lakka_project; +-#else +- return "/"; +-#endif +-} +-#endif +-#endif +- + static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl) + { + switch (lbl) +@@ -5049,7 +5025,7 @@ static int generic_action_ok_network(const char *path, + /* TODO unhardcode this path */ + fill_pathname_join_special(url_path, + FILE_PATH_LAKKA_URL, +- lakka_get_project(), sizeof(url_path)); ++ LAKKA_PROJECT, sizeof(url_path)); + fill_pathname_join_special(url_path, url_path, + FILE_PATH_INDEX_URL, + sizeof(url_path)); +@@ -5340,7 +5316,7 @@ static int action_ok_download_generic(const char *path, + #ifdef HAVE_LAKKA + /* TODO unhardcode this path*/ + fill_pathname_join_special(s, FILE_PATH_LAKKA_URL, +- lakka_get_project(), sizeof(s)); ++ LAKKA_PROJECT, sizeof(s)); + #endif + break; + case MENU_ENUM_LABEL_CB_UPDATE_ASSETS: diff --git a/packages/lakka/retroarch_base/retroarch/patches/retroarch-save_to_default_config.patch b/packages/lakka/retroarch_base/retroarch/patches/retroarch-99-save_to_default_config.patch similarity index 100% rename from packages/lakka/retroarch_base/retroarch/patches/retroarch-save_to_default_config.patch rename to packages/lakka/retroarch_base/retroarch/patches/retroarch-99-save_to_default_config.patch