diff options
Diffstat (limited to 'project/cmake/addons')
48 files changed, 345 insertions, 68 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index 0773713..8fc1a23 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt | |||
| @@ -1,15 +1,31 @@ | |||
| 1 | project(kodi-addons) | 1 | project(kodi-addons) |
| 2 | 2 | ||
| 3 | cmake_minimum_required(VERSION 2.8) | 3 | if(WIN32) |
| 4 | # there seems to be a bug in the CMake generator implementation in CMake 2.8.x releases for WIN32 | ||
| 5 | cmake_minimum_required(VERSION 3.0) | ||
| 6 | else() | ||
| 7 | cmake_minimum_required(VERSION 2.8) | ||
| 8 | endif() | ||
| 4 | 9 | ||
| 5 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) | 10 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) |
| 6 | 11 | ||
| 12 | option(ADDON_TARBALL_CACHING "Cache downloaded addon source tarballs?" ON) | ||
| 13 | if(ADDON_TARBALL_CACHING) | ||
| 14 | message(STATUS "Addon source tarball caching is enabled") | ||
| 15 | else() | ||
| 16 | message(STATUS "Addon source tarball caching is disabled") | ||
| 17 | endif() | ||
| 18 | |||
| 7 | if(NOT CMAKE_BUILD_TYPE) | 19 | if(NOT CMAKE_BUILD_TYPE) |
| 8 | set(CMAKE_BUILD_TYPE Release) | 20 | set(CMAKE_BUILD_TYPE Release) |
| 9 | endif() | 21 | endif() |
| 10 | 22 | ||
| 11 | if(NOT CORE_SYSTEM_NAME) | 23 | if(NOT CORE_SYSTEM_NAME) |
| 12 | string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) | 24 | if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") |
| 25 | set(CORE_SYSTEM_NAME "osx") | ||
| 26 | else() | ||
| 27 | string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) | ||
| 28 | endif() | ||
| 13 | endif() | 29 | endif() |
| 14 | 30 | ||
| 15 | include(ExternalProject) | 31 | include(ExternalProject) |
| @@ -65,6 +81,7 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) | |||
| 65 | set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} | 81 | set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} |
| 66 | -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> | 82 | -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> |
| 67 | -DPACKAGE_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig | 83 | -DPACKAGE_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig |
| 84 | -DDEPENDS_PATH=${DEPENDS_PATH} | ||
| 68 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | 85 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} |
| 69 | -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} | 86 | -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} |
| 70 | -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} | 87 | -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} |
| @@ -78,16 +95,26 @@ if(MSVC) | |||
| 78 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) | 95 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) |
| 79 | endif() | 96 | endif() |
| 80 | 97 | ||
| 98 | option(PACKAGE_ZIP "Prepare built addons for packaging" OFF) | ||
| 81 | if(PACKAGE_ZIP) | 99 | if(PACKAGE_ZIP) |
| 82 | # needed for project installing | 100 | # needed for project installing |
| 83 | list(APPEND BUILD_ARGS -DPACKAGE_ZIP=1) | 101 | list(APPEND BUILD_ARGS -DPACKAGE_ZIP=ON) |
| 84 | MESSAGE("package zip specified") | 102 | |
| 103 | # figure out where to store the packaged ZIP archives | ||
| 104 | if(NOT PACKAGE_DIR) | ||
| 105 | set(PACKAGE_DIR "${BUILD_DIR}/zips") | ||
| 106 | else() | ||
| 107 | file(TO_CMAKE_PATH "${PACKAGE_DIR}" PACKAGE_DIR) | ||
| 108 | endif() | ||
| 109 | list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR}) | ||
| 110 | |||
| 111 | MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") | ||
| 85 | endif() | 112 | endif() |
| 86 | 113 | ||
| 87 | if(CMAKE_TOOLCHAIN_FILE) | 114 | if(CMAKE_TOOLCHAIN_FILE) |
| 88 | list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) | 115 | list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) |
| 89 | MESSAGE("toolchain specified") | 116 | MESSAGE(STATUS "Toolchain specified") |
| 90 | MESSAGE(${BUILD_ARGS}) | 117 | MESSAGE(STATUS ${BUILD_ARGS}) |
| 91 | endif() | 118 | endif() |
| 92 | 119 | ||
| 93 | if(NOT ADDONS_TO_BUILD) | 120 | if(NOT ADDONS_TO_BUILD) |
| @@ -97,16 +124,25 @@ else() | |||
| 97 | separate_arguments(ADDONS_TO_BUILD) | 124 | separate_arguments(ADDONS_TO_BUILD) |
| 98 | endif() | 125 | endif() |
| 99 | 126 | ||
| 127 | if(NOT ADDONS_DEFINITION_DIR) | ||
| 128 | set(ADDONS_DEFINITION_DIR ${PROJECT_SOURCE_DIR}/addons) | ||
| 129 | else() | ||
| 130 | file(TO_CMAKE_PATH "${ADDONS_DEFINITION_DIR}" ADDONS_DEFINITION_DIR) | ||
| 131 | endif() | ||
| 132 | get_filename_component(ADDONS_DEFINITION_DIR "${ADDONS_DEFINITION_DIR}" ABSOLUTE) | ||
| 133 | |||
| 100 | if(ADDON_SRC_PREFIX) | 134 | if(ADDON_SRC_PREFIX) |
| 101 | message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") | 135 | message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") |
| 102 | endif() | 136 | endif() |
| 103 | 137 | ||
| 104 | if(NOT KODI_LIB_DIR) | 138 | if(NOT APP_LIB_DIR) |
| 105 | set(KODI_LIB_DIR "${DEPENDS_PATH}/lib/kodi") | 139 | set(APP_LIB_DIR "${DEPENDS_PATH}/lib/kodi") |
| 106 | else() | 140 | else() |
| 107 | file(TO_CMAKE_PATH "${KODI_LIB_DIR}" KODI_LIB_DIR) | 141 | file(TO_CMAKE_PATH "${APP_LIB_DIR}" APP_LIB_DIR) |
| 108 | endif() | 142 | endif() |
| 109 | 143 | ||
| 144 | set(APP_PREFIX "${CMAKE_INSTALL_PREFIX}") | ||
| 145 | |||
| 110 | # check for platform specific stuff | 146 | # check for platform specific stuff |
| 111 | if(EXISTS ${PLATFORM_DIR}/defines.txt) | 147 | if(EXISTS ${PLATFORM_DIR}/defines.txt) |
| 112 | file(STRINGS ${PLATFORM_DIR}/defines.txt platformdefines) | 148 | file(STRINGS ${PLATFORM_DIR}/defines.txt platformdefines) |
| @@ -119,21 +155,23 @@ endif() | |||
| 119 | # include check_target_platform() function | 155 | # include check_target_platform() function |
| 120 | include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) | 156 | include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) |
| 121 | 157 | ||
| 122 | # check install permissions | ||
| 123 | set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) | 158 | set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) |
| 124 | check_install_permissions(${CMAKE_INSTALL_PREFIX} can_write) | 159 | if(NOT WIN32) |
| 125 | if(NOT ${can_write} AND NOT WIN32) | 160 | # check install permissions |
| 126 | set(NEED_SUDO TRUE) | 161 | check_install_permissions(${CMAKE_INSTALL_PREFIX} can_write) |
| 127 | set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) | 162 | if(NOT ${can_write} AND CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 128 | message(STATUS "NEED_SUDO: ${NEED_SUDO}") | 163 | set(NEED_SUDO TRUE) |
| 164 | set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) | ||
| 165 | message(STATUS "NEED_SUDO: ${NEED_SUDO}") | ||
| 166 | endif() | ||
| 129 | endif() | 167 | endif() |
| 130 | 168 | ||
| 131 | ### prepare the build environment for the binary addons | 169 | ### prepare the build environment for the binary addons |
| 132 | # copy the prepare-env.cmake script to the depends path so that we can include it | 170 | # copy the prepare-env.cmake script to the depends path so that we can include it |
| 133 | file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${KODI_LIB_DIR}) | 171 | file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${APP_LIB_DIR}) |
| 134 | 172 | ||
| 135 | # add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found | 173 | # add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found |
| 136 | list(APPEND CMAKE_MODULE_PATH ${KODI_LIB_DIR}) | 174 | list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR}) |
| 137 | 175 | ||
| 138 | # include prepare-env.cmake which contains the logic to install the addon header bindings etc | 176 | # include prepare-env.cmake which contains the logic to install the addon header bindings etc |
| 139 | include(prepare-env) | 177 | include(prepare-env) |
| @@ -141,17 +179,61 @@ include(prepare-env) | |||
| 141 | ### add the depends subdirectory for any general dependencies | 179 | ### add the depends subdirectory for any general dependencies |
| 142 | add_subdirectory(depends) | 180 | add_subdirectory(depends) |
| 143 | 181 | ||
| 182 | # add a custom target "package-addons" which will package and install all addons | ||
| 183 | add_custom_target(package-addons) | ||
| 184 | |||
| 144 | ### get and build all the binary addons | 185 | ### get and build all the binary addons |
| 145 | # look for all the addons to be built | 186 | # look for all the addons to be built |
| 146 | file(GLOB_RECURSE addons ${PROJECT_SOURCE_DIR}/addons/*.txt) | 187 | file(GLOB_RECURSE addons ${ADDONS_DEFINITION_DIR}/*.txt) |
| 188 | |||
| 189 | #if there are no addons assume that bootstrapping hasn't happened yet | ||
| 190 | if(NOT addons) | ||
| 191 | message(STATUS "Bootstrapping all default repositories as no addons were found...") | ||
| 192 | set(BOOTSTRAP_BUILD_DIR "${BUILD_DIR}/bootstrap") | ||
| 193 | |||
| 194 | # make sure that the bootstraps build addon exists | ||
| 195 | if(NOT EXISTS ${BOOTSTRAP_BUILD_DIR}) | ||
| 196 | file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) | ||
| 197 | endif() | ||
| 198 | |||
| 199 | # generate the bootstrap buildsystem | ||
| 200 | execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap | ||
| 201 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| 202 | -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} | ||
| 203 | -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} | ||
| 204 | -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} | ||
| 205 | WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) | ||
| 206 | |||
| 207 | # execute the generated bootstrap buildsystem | ||
| 208 | execute_process(COMMAND ${CMAKE_COMMAND} --build ${BOOTSTRAP_BUILD_DIR} | ||
| 209 | WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) | ||
| 210 | |||
| 211 | # now look for all the addons to be built again | ||
| 212 | file(GLOB_RECURSE addons ${ADDONS_DEFINITION_DIR}/*.txt) | ||
| 213 | |||
| 214 | if(NOT addons) | ||
| 215 | message(FATAL_ERROR "No addons available to be built") | ||
| 216 | endif() | ||
| 217 | endif() | ||
| 218 | |||
| 147 | foreach(addon ${addons}) | 219 | foreach(addon ${addons}) |
| 148 | if(NOT (addon MATCHES platforms.txt)) | 220 | if(NOT (addon MATCHES platforms.txt)) |
| 149 | file(STRINGS ${addon} def) | 221 | file(STRINGS ${addon} def) |
| 150 | separate_arguments(def) | 222 | separate_arguments(def) |
| 151 | list(GET def 0 id) | 223 | list(GET def 0 id) |
| 152 | 224 | ||
| 225 | set(ADDON_FOUND FALSE) | ||
| 226 | # try to find a perfect match | ||
| 153 | list(FIND ADDONS_TO_BUILD ${id} idx) | 227 | list(FIND ADDONS_TO_BUILD ${id} idx) |
| 154 | if(idx GREATER -1 OR ADDONS_TO_BUILD STREQUAL "all") | 228 | if(idx GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") |
| 229 | set(ADDON_FOUND TRUE) | ||
| 230 | # Maybe we have a regex | ||
| 231 | elseif(id MATCHES "${ADDONS_TO_BUILD}") | ||
| 232 | message(STATUS "Pattern ${ADDONS_TO_BUILD} matches ${id}, building addon") | ||
| 233 | set(ADDON_FOUND TRUE) | ||
| 234 | endif() | ||
| 235 | |||
| 236 | if(ADDON_FOUND) | ||
| 155 | get_filename_component(dir ${addon} PATH) | 237 | get_filename_component(dir ${addon} PATH) |
| 156 | 238 | ||
| 157 | # check if the addon has a platforms.txt | 239 | # check if the addon has a platforms.txt |
| @@ -180,6 +262,19 @@ foreach(addon ${addons}) | |||
| 180 | if(deflength GREATER 2 AND "${SOURCE_DIR}" STREQUAL "") | 262 | if(deflength GREATER 2 AND "${SOURCE_DIR}" STREQUAL "") |
| 181 | list(GET def 2 revision) | 263 | list(GET def 2 revision) |
| 182 | 264 | ||
| 265 | # we need access to a git executable | ||
| 266 | find_package(Git REQUIRED) | ||
| 267 | |||
| 268 | # resolve revision to git hash | ||
| 269 | execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote ${url} ${revision} OUTPUT_VARIABLE revision_hash) | ||
| 270 | # git ls-remote only works on branches and tag names but not on revisions | ||
| 271 | if(NOT "${revision_hash}" STREQUAL "") | ||
| 272 | string(REPLACE "\t" ";" revision_list ${revision_hash}) | ||
| 273 | list(GET revision_list 0 revision_hash) | ||
| 274 | message(STATUS "${id}: git branch/tag ${revision} resolved to hash: ${revision_hash}") | ||
| 275 | set(revision ${revision_hash}) | ||
| 276 | endif() | ||
| 277 | |||
| 183 | # Note: downloading specific revisions via http in the format below is probably github specific | 278 | # Note: downloading specific revisions via http in the format below is probably github specific |
| 184 | # if we ever use other repositories, this might need adapting | 279 | # if we ever use other repositories, this might need adapting |
| 185 | set(url ${url}/archive/${revision}.tar.gz) | 280 | set(url ${url}/archive/${revision}.tar.gz) |
| @@ -210,7 +305,7 @@ foreach(addon ${addons}) | |||
| 210 | # download the addon if necessary | 305 | # download the addon if necessary |
| 211 | if(NOT "${archive_name}" STREQUAL "") | 306 | if(NOT "${archive_name}" STREQUAL "") |
| 212 | # download and extract the addon | 307 | # download and extract the addon |
| 213 | if(NOT EXISTS ${BUILD_DIR}/download/${archive_name}.tar.gz) | 308 | if(NOT ADDON_TARBALL_CACHING OR NOT EXISTS ${BUILD_DIR}/download/${archive_name}.tar.gz) |
| 214 | # cleanup any of the previously downloaded archives of this addon | 309 | # cleanup any of the previously downloaded archives of this addon |
| 215 | file(GLOB archives "${BUILD_DIR}/download/${id}*.tar.gz") | 310 | file(GLOB archives "${BUILD_DIR}/download/${id}*.tar.gz") |
| 216 | if(archives) | 311 | if(archives) |
| @@ -275,6 +370,25 @@ foreach(addon ${addons}) | |||
| 275 | add_dependencies(${id} ${${id}_DEPS}) | 370 | add_dependencies(${id} ${${id}_DEPS}) |
| 276 | endif() | 371 | endif() |
| 277 | endif() | 372 | endif() |
| 373 | |||
| 374 | if(CROSS_AUTOCONF AND AUTOCONF_FILES) | ||
| 375 | if(EXISTS ${SOURCE_DIR}/bootstrap/autoreconf.txt) | ||
| 376 | file(STRINGS ${SOURCE_DIR}/bootstrap/autoreconf.txt conf_dirs) | ||
| 377 | foreach(conf_dir ${conf_dirs}) | ||
| 378 | foreach(afile ${AUTOCONF_FILES}) | ||
| 379 | message(STATUS "copying ${afile} to ${SOURCE_DIR}/${conf_dir}") | ||
| 380 | file(COPY ${afile} DESTINATION ${SOURCE_DIR}/${conf_dir}) | ||
| 381 | endforeach() | ||
| 382 | endforeach() | ||
| 383 | endif() | ||
| 384 | endif() | ||
| 385 | |||
| 386 | # create a forwarding target to the addon-package target | ||
| 387 | add_custom_target(package-${id} | ||
| 388 | COMMAND ${CMAKE_COMMAND} --build ${id}-prefix/src/${id}-build --target addon-package | ||
| 389 | DEPENDS ${id}) | ||
| 390 | add_dependencies(package-addons package-${id}) | ||
| 391 | |||
| 278 | else() | 392 | else() |
| 279 | message(FATAL_ERROR "${id}: invalid or missing addon source directory at ${SOURCE_DIR}") | 393 | message(FATAL_ERROR "${id}: invalid or missing addon source directory at ${SOURCE_DIR}") |
| 280 | endif() | 394 | endif() |
| @@ -297,4 +411,4 @@ endif() | |||
| 297 | 411 | ||
| 298 | # add custom target "supported_addons" that returns all addons that are supported on this platform | 412 | # add custom target "supported_addons" that returns all addons that are supported on this platform |
| 299 | string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}") | 413 | string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}") |
| 300 | add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) | 414 | add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) \ No newline at end of file |
diff --git a/project/cmake/addons/README b/project/cmake/addons/README index b901bb7..a0f2c32 100644 --- a/project/cmake/addons/README +++ b/project/cmake/addons/README | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | KODI ADDONS | 1 | KODI ADDONS |
| 2 | =========== | 2 | =========== |
| 3 | This directory contains the cmake-based buildsystem for addons. It looks into | 3 | This directory contains the cmake-based buildsystem for addons. It looks into |
| 4 | the "addons" sub-directory and parses all *.txt files recursively. Each addon | 4 | the directory pointed to by the ADDONS_DEFINITION_DIR option (which defaults to |
| 5 | the "addons" sub-directory) and parses all *.txt files recursively. Each addon | ||
| 5 | must have its own <addon-id>.txt file in a separate sub-directory which must | 6 | must have its own <addon-id>.txt file in a separate sub-directory which must |
| 6 | follow one of the defined format: | 7 | follow one of the defined format: |
| 7 | <addon-id> <git-url> <git-revision> | 8 | <addon-id> <git-url> <git-revision> |
| @@ -22,13 +23,26 @@ are: | |||
| 22 | * platforms.txt: List of platforms to build an addon for (or "all"). It is | 23 | * platforms.txt: List of platforms to build an addon for (or "all"). It is |
| 23 | also supported to specify negated platforms with a leading exclamation mark | 24 | also supported to specify negated platforms with a leading exclamation mark |
| 24 | (i), e.g. "!windows". | 25 | (i), e.g. "!windows". |
| 25 | Available platforms are: linux, windows, darwin, ios, android, rbpi | 26 | Available platforms are: linux, windows, osx, ios, android, rbpi, freebsd |
| 27 | |||
| 28 | ATTENTION: If no addon definitions could be found the buildsystem assumes that | ||
| 29 | the bootstrapping of the addon definition repositories hasn't been | ||
| 30 | performed yet and automatically executes the addon bootstrapping | ||
| 31 | buildsystem located in the "bootstrap" sub-directory with the default | ||
| 32 | settings (i.e. all addons from all pre-defined addon definition | ||
| 33 | repositories are bootstrapped into the directory pointed to by the | ||
| 34 | ADDONS_DEFINITION_DIR option). | ||
| 26 | 35 | ||
| 27 | The buildsystem uses the following variables (which can be passed into it when | 36 | The buildsystem uses the following variables (which can be passed into it when |
| 28 | executing cmake with the -D<variable-name>=<value> option) to e.g. access | 37 | executing cmake with the -D<variable-name>=<value> option) to e.g. access |
| 29 | specific paths: | 38 | specific paths: |
| 30 | * ADDONS_TO_BUILD is a quoted, space delimited list of <addon-id>s that | 39 | * ADDONS_TO_BUILD has two variations, which are tested in order: |
| 31 | you want to build (default is "all"). | 40 | - a quoted, space delimited list of <addon-id>s that |
| 41 | you want to build (default is "all"). | ||
| 42 | - a regular expression that every <addon-id> is matched against | ||
| 43 | e.g.: ADDONS_TO_BUILD=pvr.* to build all pvr addons | ||
| 44 | * ADDONS_DEFINITION_DIR points to the directory containing the definitions | ||
| 45 | for the addons to be built. | ||
| 32 | * ADDON_SRC_PREFIX can be used to override the addon repository location. | 46 | * ADDON_SRC_PREFIX can be used to override the addon repository location. |
| 33 | It must point to the locally available parent directory of the addon(s) to build | 47 | It must point to the locally available parent directory of the addon(s) to build |
| 34 | <addon-id> will be appended to this path automatically | 48 | <addon-id> will be appended to this path automatically |
| @@ -45,11 +59,15 @@ specific paths: | |||
| 45 | absolute representation of ../../.. starting from this directory). | 59 | absolute representation of ../../.. starting from this directory). |
| 46 | * BUILD_DIR points to the directory where the addons and their dependencies | 60 | * BUILD_DIR points to the directory where the addons and their dependencies |
| 47 | will be downloaded and built. | 61 | will be downloaded and built. |
| 48 | * PACKAGE_ZIP=1 will mean the add-ons will be 'packaged' into a common folder, | 62 | * PACKAGE_ZIP=ON means that the add-ons will be 'packaged' into a common folder, |
| 49 | rather than being placed in <CMAKE_INSTALL_PREFIX>/lib/kodi/addons and | 63 | rather than being placed in <CMAKE_INSTALL_PREFIX>/lib/kodi/addons and |
| 50 | <CMAKE_INSTALL_PREFIX>/share/kodi/addons. | 64 | <CMAKE_INSTALL_PREFIX>/share/kodi/addons. |
| 65 | * PACKAGE_DIR points to the directory where the ZIP archived addons will be | ||
| 66 | stored after they have been packaged (defaults to <BUILD_DIR>/zips) | ||
| 51 | * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines | 67 | * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines |
| 52 | (defaults to empty). | 68 | (defaults to empty). |
| 69 | * ADDON_TARBALL_CACHING specifies whether downloaded addon source tarballs | ||
| 70 | should be cached or not (defaults to ON). | ||
| 53 | 71 | ||
| 54 | The buildsystem makes some assumptions about the environment which must be met | 72 | The buildsystem makes some assumptions about the environment which must be met |
| 55 | by whoever uses it: | 73 | by whoever uses it: |
diff --git a/project/cmake/addons/addons/audioencoder.flac/audioencoder.flac.txt b/project/cmake/addons/addons/audioencoder.flac/audioencoder.flac.txt deleted file mode 100644 index 5886cfa..0000000 --- a/project/cmake/addons/addons/audioencoder.flac/audioencoder.flac.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | audioencoder.flac https://github.com/xbmc/audioencoder.flac 84acb14 | ||
diff --git a/project/cmake/addons/addons/audioencoder.flac/platforms.txt b/project/cmake/addons/addons/audioencoder.flac/platforms.txt deleted file mode 100644 index 174a52e..0000000 --- a/project/cmake/addons/addons/audioencoder.flac/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | !ios \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/audioencoder.lame/audioencoder.lame.txt b/project/cmake/addons/addons/audioencoder.lame/audioencoder.lame.txt deleted file mode 100644 index a55dc44..0000000 --- a/project/cmake/addons/addons/audioencoder.lame/audioencoder.lame.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | audioencoder.lame https://github.com/xbmc/audioencoder.lame 3eb59de | ||
diff --git a/project/cmake/addons/addons/audioencoder.lame/platforms.txt b/project/cmake/addons/addons/audioencoder.lame/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/audioencoder.lame/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/audioencoder.vorbis/audioencoder.vorbis.txt b/project/cmake/addons/addons/audioencoder.vorbis/audioencoder.vorbis.txt deleted file mode 100644 index 8decf52..0000000 --- a/project/cmake/addons/addons/audioencoder.vorbis/audioencoder.vorbis.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | audioencoder.vorbis https://github.com/xbmc/audioencoder.vorbis d556a68 | ||
diff --git a/project/cmake/addons/addons/audioencoder.vorbis/platforms.txt b/project/cmake/addons/addons/audioencoder.vorbis/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/audioencoder.vorbis/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/audioencoder.wav/audioencoder.wav.txt b/project/cmake/addons/addons/audioencoder.wav/audioencoder.wav.txt deleted file mode 100644 index b3209f6..0000000 --- a/project/cmake/addons/addons/audioencoder.wav/audioencoder.wav.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | audioencoder.wav https://github.com/xbmc/audioencoder.wav 40aaedf | ||
diff --git a/project/cmake/addons/addons/audioencoder.wav/platforms.txt b/project/cmake/addons/addons/audioencoder.wav/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/audioencoder.wav/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.argustv/platforms.txt b/project/cmake/addons/addons/pvr.argustv/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.argustv/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt b/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt deleted file mode 100644 index 88ccde4..0000000 --- a/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.argustv https://github.com/kodi-pvr/pvr.argustv 96ee875 | ||
diff --git a/project/cmake/addons/addons/pvr.demo/platforms.txt b/project/cmake/addons/addons/pvr.demo/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.demo/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.demo/pvr.demo.txt b/project/cmake/addons/addons/pvr.demo/pvr.demo.txt deleted file mode 100644 index 1307381..0000000 --- a/project/cmake/addons/addons/pvr.demo/pvr.demo.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.demo https://github.com/kodi-pvr/pvr.demo b4b7de1 | ||
diff --git a/project/cmake/addons/addons/pvr.dvblink/platforms.txt b/project/cmake/addons/addons/pvr.dvblink/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.dvblink/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt b/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt deleted file mode 100644 index 1aa96d8..0000000 --- a/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.dvblink https://github.com/kodi-pvr/pvr.dvblink 5d505b8 | ||
diff --git a/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt b/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt b/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt deleted file mode 100644 index db25aa2..0000000 --- a/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.dvbviewer https://github.com/manuelm/pvr.dvbviewer master \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.filmon/platforms.txt b/project/cmake/addons/addons/pvr.filmon/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.filmon/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.filmon/pvr.filmon.txt b/project/cmake/addons/addons/pvr.filmon/pvr.filmon.txt deleted file mode 100644 index 2e7142c..0000000 --- a/project/cmake/addons/addons/pvr.filmon/pvr.filmon.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.filmon https://github.com/kodi-pvr/pvr.filmon 413fe9e | ||
diff --git a/project/cmake/addons/addons/pvr.hts/platforms.txt b/project/cmake/addons/addons/pvr.hts/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.hts/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.hts/pvr.hts.txt b/project/cmake/addons/addons/pvr.hts/pvr.hts.txt deleted file mode 100644 index 5f913f8..0000000 --- a/project/cmake/addons/addons/pvr.hts/pvr.hts.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.hts https://github.com/kodi-pvr/pvr.hts 4bf1a97 | ||
diff --git a/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt b/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt b/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt deleted file mode 100644 index d1d4d3c..0000000 --- a/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.iptvsimple https://github.com/kodi-pvr/pvr.iptvsimple a2e6c6f | ||
diff --git a/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt b/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt b/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt deleted file mode 100644 index 665dfff..0000000 --- a/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.mediaportal.tvserver https://github.com/kodi-pvr/pvr.mediaportal.tvserver 6f8ca82 | ||
diff --git a/project/cmake/addons/addons/pvr.mythtv/platforms.txt b/project/cmake/addons/addons/pvr.mythtv/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.mythtv/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt b/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt deleted file mode 100644 index de930ab..0000000 --- a/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.mythtv https://github.com/kodi-pvr/pvr.mythtv ef9cf41 | ||
diff --git a/project/cmake/addons/addons/pvr.nextpvr/platforms.txt b/project/cmake/addons/addons/pvr.nextpvr/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.nextpvr/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt b/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt deleted file mode 100644 index ecb73d2..0000000 --- a/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.nextpvr https://github.com/kodi-pvr/pvr.nextpvr 1ecbf87 | ||
diff --git a/project/cmake/addons/addons/pvr.njoy/platforms.txt b/project/cmake/addons/addons/pvr.njoy/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.njoy/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt b/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt deleted file mode 100644 index fec1b59..0000000 --- a/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.njoy https://github.com/kodi-pvr/pvr.njoy fcd6294 | ||
diff --git a/project/cmake/addons/addons/pvr.pctv/platforms.txt b/project/cmake/addons/addons/pvr.pctv/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.pctv/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.pctv/pvr.pctv.txt b/project/cmake/addons/addons/pvr.pctv/pvr.pctv.txt deleted file mode 100644 index b17bdc7..0000000 --- a/project/cmake/addons/addons/pvr.pctv/pvr.pctv.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.pctv https://github.com/kodi-pvr/pvr.pctv 0a0924e | ||
diff --git a/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt b/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt b/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt deleted file mode 100644 index 72b4954..0000000 --- a/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.vdr.vnsi https://github.com/kodi-pvr/pvr.vdr.vnsi 3a28e39 | ||
diff --git a/project/cmake/addons/addons/pvr.vuplus/platforms.txt b/project/cmake/addons/addons/pvr.vuplus/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.vuplus/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt b/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt deleted file mode 100644 index 36d60af..0000000 --- a/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.vuplus https://github.com/kodi-pvr/pvr.vuplus d6abad3 | ||
diff --git a/project/cmake/addons/addons/pvr.wmc/platforms.txt b/project/cmake/addons/addons/pvr.wmc/platforms.txt deleted file mode 100644 index baa6044..0000000 --- a/project/cmake/addons/addons/pvr.wmc/platforms.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | all \ No newline at end of file | ||
diff --git a/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt b/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt deleted file mode 100644 index 1455925..0000000 --- a/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | pvr.wmc https://github.com/kodi-pvr/pvr.wmc cf28e4c | ||
diff --git a/project/cmake/addons/bootstrap/CMakeLists.txt b/project/cmake/addons/bootstrap/CMakeLists.txt new file mode 100644 index 0000000..86950b8 --- /dev/null +++ b/project/cmake/addons/bootstrap/CMakeLists.txt | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | project(kodi-addons-bootstrap) | ||
| 2 | |||
| 3 | cmake_minimum_required(VERSION 2.8) | ||
| 4 | |||
| 5 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) | ||
| 6 | |||
| 7 | # make sure CMAKE_INSTALL_PREFIX is properly set | ||
| 8 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) | ||
| 9 | set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../addons") | ||
| 10 | endif() | ||
| 11 | list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) | ||
| 12 | |||
| 13 | # figure out where the build directory is located | ||
| 14 | if(NOT BUILD_DIR) | ||
| 15 | set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") | ||
| 16 | else() | ||
| 17 | file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR) | ||
| 18 | endif() | ||
| 19 | get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) | ||
| 20 | |||
| 21 | # make sure that the repositories to build have been specified | ||
| 22 | if(NOT REPOSITORY_TO_BUILD) | ||
| 23 | set(REPOSITORY_TO_BUILD_DEFAULT ON) | ||
| 24 | set(REPOSITORY_TO_BUILD "all") | ||
| 25 | set(REPOSITORY_REVISION "") | ||
| 26 | message(STATUS "Bootstrapping all repositories") | ||
| 27 | else() | ||
| 28 | set(REPOSITORY_TO_BUILD_DEFAULT OFF) | ||
| 29 | message(STATUS "Bootstrapping following repository: ${REPOSITORY_TO_BUILD}") | ||
| 30 | endif() | ||
| 31 | |||
| 32 | # figure out which addons to bootstrap (defaults to all) | ||
| 33 | if(NOT ADDONS_TO_BUILD) | ||
| 34 | set(ADDONS_TO_BUILD "all") | ||
| 35 | message(STATUS "Bootstrapping all addons") | ||
| 36 | else() | ||
| 37 | message(STATUS "Bootstrapping following addons: ${ADDONS_TO_BUILD}") | ||
| 38 | endif() | ||
| 39 | |||
| 40 | include(ExternalProject) | ||
| 41 | |||
| 42 | function(bootstrap_repo repo_id repo_url repo_revision) | ||
| 43 | message(STATUS "Bootstrapping addons from ${repo_id} (${repo_url} ${repo_revision})...") | ||
| 44 | externalproject_add(${repo_id} | ||
| 45 | GIT_REPOSITORY ${repo_url} | ||
| 46 | GIT_TAG ${repo_revision} | ||
| 47 | PREFIX ${BUILD_DIR}/${repo_id} | ||
| 48 | CONFIGURE_COMMAND "" | ||
| 49 | BUILD_COMMAND "" | ||
| 50 | INSTALL_COMMAND ${CMAKE_COMMAND} | ||
| 51 | -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} | ||
| 52 | -DPROJECT_SOURCE_DIR=<SOURCE_DIR> | ||
| 53 | -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} | ||
| 54 | -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} | ||
| 55 | -P ${PROJECT_SOURCE_DIR}/bootstrap.cmake | ||
| 56 | ) | ||
| 57 | endfunction() | ||
| 58 | |||
| 59 | # look for all addons repository definitions | ||
| 60 | set(REPOSITORY_TO_BUILD_FOUND OFF) | ||
| 61 | file(GLOB repos repositories/*.txt) | ||
| 62 | foreach(repo ${repos}) | ||
| 63 | file(STRINGS ${repo} repo_definition) | ||
| 64 | separate_arguments(repo_definition) | ||
| 65 | list(GET repo_definition 0 repo_id) | ||
| 66 | |||
| 67 | list(FIND REPOSITORY_TO_BUILD ${repo_id} idx) | ||
| 68 | if(idx GREATER -1 OR REPOSITORY_TO_BUILD STREQUAL "all") | ||
| 69 | set(REPOSITORY_TO_BUILD_FOUND ON) | ||
| 70 | |||
| 71 | # get the URL of the repository | ||
| 72 | list(GET repo_definition 1 repo_url) | ||
| 73 | |||
| 74 | # get the revision of the repository if not provided as an argument | ||
| 75 | if(NOT REPOSITORY_REVISION) | ||
| 76 | list(GET repo_definition 2 repo_revision) | ||
| 77 | else() | ||
| 78 | set(repo_revision "${REPOSITORY_REVISION}") | ||
| 79 | endif() | ||
| 80 | |||
| 81 | bootstrap_repo(${repo_id} ${repo_url} ${repo_revision}) | ||
| 82 | endif() | ||
| 83 | endforeach() | ||
| 84 | |||
| 85 | # if we have been asked to bootstrap a specific repository (not the default one) and | ||
| 86 | # it couldn't be found in the predefined repository definitions we assume that it's a | ||
| 87 | # URL to a specific repository | ||
| 88 | if(NOT REPOSITORY_TO_BUILD_DEFAULT AND NOT REPOSITORY_TO_BUILD_FOUND) | ||
| 89 | # default to the master branch if no revision has been provided | ||
| 90 | if(NOT REPOSITORY_REVISION) | ||
| 91 | set(REPOSITORY_REVISION "master") | ||
| 92 | endif() | ||
| 93 | |||
| 94 | bootstrap_repo(binary-addons-custom ${REPOSITORY_TO_BUILD} ${REPOSITORY_REVISION}) | ||
| 95 | endif() | ||
diff --git a/project/cmake/addons/bootstrap/README.md b/project/cmake/addons/bootstrap/README.md new file mode 100644 index 0000000..b886b5b --- /dev/null +++ b/project/cmake/addons/bootstrap/README.md | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # KODI ADDON DEFINITIONS BOOTSTRAPPING | ||
| 2 | This directory contains the cmake-based buildsystem for addon definitions | ||
| 3 | bootstrapping which downloads the addon definitions from one or more addon | ||
| 4 | definitions repositories. These addon definitions are then used by the addon | ||
| 5 | buildsystem to figure out which addons and which versions to build. It looks | ||
| 6 | into the "repositories" sub-directory and parses all *.txt files recursively. | ||
| 7 | Each addon definitions repository must have its own <repository>.txt file which | ||
| 8 | must follow the following defined format: | ||
| 9 | ``` | ||
| 10 | <repository> <git-url> <git-revision> | ||
| 11 | ``` | ||
| 12 | where | ||
| 13 | * `<repository>` is the identification of the repository. | ||
| 14 | * `<git-url>` must be the URL of the git repository containing the addon | ||
| 15 | definitions | ||
| 16 | * `<git-revision>` must be a valid git tag/branch/commit in the addon | ||
| 17 | definitions repository's git repository which will be used for the build | ||
| 18 | |||
| 19 | The buildsystem uses the following variables (which can be passed into it when | ||
| 20 | executing cmake with the `-D<variable-name>=<value>` option): | ||
| 21 | * `CMAKE_INSTALL_PREFIX` points to the directory where the downloaded addon | ||
| 22 | definitions will be installed to (defaults to `../addons`). | ||
| 23 | * `BUILD_DIR` points to the directory where the addon definitions repositories | ||
| 24 | will be downloaded to. | ||
| 25 | * `REPOSITORY_TO_BUILD` specifies a single addon definitions repository to be | ||
| 26 | downloaded and processed (defaults to `"all"`). | ||
| 27 | * `REPOSITORY_REVISION` specifies the git revision in the addon definitions | ||
| 28 | repository which will be used for the build. This option is only valid in | ||
| 29 | combination with the `REPOSITORY_TO_BUILD` option (defaults to the git | ||
| 30 | revision specified in the repository's definition file). | ||
| 31 | * `ADDONS_TO_BUILD` is a quoted, space delimited list of `<addon-id>`s that | ||
| 32 | should be bootstrapped (default is `"all"`). | ||
| 33 | |||
| 34 | To trigger the cmake-based buildsystem the following command must be executed | ||
| 35 | with <path> being the path to this directory (absolute or relative, allowing for | ||
| 36 | in-source and out-of-source builds). | ||
| 37 | ``` | ||
| 38 | cmake <path> -G <generator> | ||
| 39 | ``` | ||
| 40 | |||
| 41 | cmake supports multiple generators, see | ||
| 42 | http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list. | ||
| 43 | |||
| 44 | In case of additional options the call might look like this | ||
| 45 | ``` | ||
| 46 | cmake <path> [-G <generator>] \ | ||
| 47 | -DCMAKE_INSTALL_PREFIX="<path-to-install-directory>" | ||
| 48 | ``` \ No newline at end of file | ||
diff --git a/project/cmake/addons/bootstrap/bootstrap.cmake b/project/cmake/addons/bootstrap/bootstrap.cmake new file mode 100644 index 0000000..c78910c --- /dev/null +++ b/project/cmake/addons/bootstrap/bootstrap.cmake | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) | ||
| 2 | |||
| 3 | # make sure that the installation location has been specified | ||
| 4 | if(NOT CMAKE_INSTALL_PREFIX) | ||
| 5 | message(FATAL_ERROR "CMAKE_INSTALL_PREFIX has not been specified") | ||
| 6 | endif() | ||
| 7 | |||
| 8 | # figure out which addons to bootstrap (defaults to all) | ||
| 9 | if(NOT ADDONS_TO_BUILD) | ||
| 10 | set(ADDONS_TO_BUILD "all") | ||
| 11 | else() | ||
| 12 | separate_arguments(ADDONS_TO_BUILD) | ||
| 13 | endif() | ||
| 14 | |||
| 15 | # find all addon definitions and go through them | ||
| 16 | file(GLOB_RECURSE ADDON_DEFINITIONS ${PROJECT_SOURCE_DIR}/*.txt) | ||
| 17 | foreach(ADDON_DEFINITION_FILE ${ADDON_DEFINITIONS}) | ||
| 18 | # ignore platforms.txt | ||
| 19 | if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt)) | ||
| 20 | # read the addon definition file | ||
| 21 | file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION) | ||
| 22 | separate_arguments(ADDON_DEFINITION) | ||
| 23 | |||
| 24 | # extract the addon definition's identifier | ||
| 25 | list(GET ADDON_DEFINITION 0 ADDON_ID) | ||
| 26 | |||
| 27 | # check if the addon definition should be built | ||
| 28 | list(FIND ADDONS_TO_BUILD ${ADDON_ID} ADDONS_TO_BUILD_IDX) | ||
| 29 | if(ADDONS_TO_BUILD_IDX GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") | ||
| 30 | # get the path to the addon definition directory | ||
| 31 | get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} PATH) | ||
| 32 | |||
| 33 | # install the addon definition | ||
| 34 | message(STATUS "Bootstrapping ${ADDON_ID} addon...") | ||
| 35 | file(INSTALL ${ADDON_DEFINITION_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
| 36 | endif() | ||
| 37 | endif() | ||
| 38 | endforeach() | ||
diff --git a/project/cmake/addons/bootstrap/repositories/binary-addons.txt b/project/cmake/addons/bootstrap/repositories/binary-addons.txt new file mode 100644 index 0000000..8674f06 --- /dev/null +++ b/project/cmake/addons/bootstrap/repositories/binary-addons.txt | |||
| @@ -0,0 +1 @@ | |||
| binary-addons https://github.com/xbmc/repo-binary-addons.git master \ No newline at end of file | |||
diff --git a/project/cmake/addons/depends/common/kodi-platform/deps.txt b/project/cmake/addons/depends/common/kodi-platform/deps.txt index f0e8246..b953815 100644 --- a/project/cmake/addons/depends/common/kodi-platform/deps.txt +++ b/project/cmake/addons/depends/common/kodi-platform/deps.txt | |||
| @@ -1,2 +1,2 @@ | |||
| 1 | kodi | 1 | tinyxml |
| 2 | tinyxml \ No newline at end of file | 2 | p8-platform |
diff --git a/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt index 009c72b..de42267 100644 --- a/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt +++ b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | |||
| @@ -1 +1 @@ | |||
| kodi-platform https://github.com/xbmc/kodi-platform 48bdd985 | kodi-platform https://github.com/xbmc/kodi-platform fed924e764b4c9c722f7f5d825ce70d4b61ae54f | ||
diff --git a/project/cmake/addons/depends/common/p8-platform/p8-platform.txt b/project/cmake/addons/depends/common/p8-platform/p8-platform.txt new file mode 100644 index 0000000..7db4e36 --- /dev/null +++ b/project/cmake/addons/depends/common/p8-platform/p8-platform.txt | |||
| @@ -0,0 +1 @@ | |||
| p8-platform https://github.com/Pulse-Eight/platform.git 38343e0acd6a636ac46139aa666aee4a8d1f13db | |||
diff --git a/project/cmake/addons/depends/common/tinyxml/tinyxml.txt b/project/cmake/addons/depends/common/tinyxml/tinyxml.txt index 456b0c5..f8e05e8 100644 --- a/project/cmake/addons/depends/common/tinyxml/tinyxml.txt +++ b/project/cmake/addons/depends/common/tinyxml/tinyxml.txt | |||
| @@ -1 +1 @@ | |||
| tinyxml http://mirrors.xbmc.org/build-deps/sources/tinyxml-2.6.2_2.tar.gz | tinyxml http://mirrors.kodi.tv/build-deps/sources/tinyxml-2.6.2_2.tar.gz | ||
