diff options
-rw-r--r-- | cmake/scripts/linux/Install.cmake | 4 | ||||
-rw-r--r-- | cmake/scripts/webos/Install.cmake | 51 | ||||
-rw-r--r-- | tools/depends/target/Toolchain.cmake.in | 4 | ||||
-rw-r--r-- | tools/webOS/packaging/Makefile | 129 | ||||
-rw-r--r-- | tools/webOS/packaging/appinfo.json.in | 6 | ||||
-rwxr-xr-x | tools/webOS/packaging/kodi.sh.in | 16 |
6 files changed, 62 insertions, 148 deletions
diff --git a/cmake/scripts/linux/Install.cmake b/cmake/scripts/linux/Install.cmake index 331722cb56..d20c09d0e7 100644 --- a/cmake/scripts/linux/Install.cmake +++ b/cmake/scripts/linux/Install.cmake @@ -327,3 +327,7 @@ if(CPACK_GENERATOR) message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.") endif() endif() + +if(CORE_PLATFORM_NAME STREQUAL webos) + include(${CMAKE_SOURCE_DIR}/cmake/scripts/webos/Install.cmake) +endif() diff --git a/cmake/scripts/webos/Install.cmake b/cmake/scripts/webos/Install.cmake new file mode 100644 index 0000000000..772d253364 --- /dev/null +++ b/cmake/scripts/webos/Install.cmake @@ -0,0 +1,51 @@ +# webOS packaging +set(APP_PACKAGE_DIR ${CMAKE_BINARY_DIR}/tools/webOS/packaging) + +# Configure files into packaging environment. +configure_file(${CMAKE_SOURCE_DIR}/tools/webOS/packaging/appinfo.json.in ${APP_PACKAGE_DIR}/appinfo.json @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tools/webOS/packaging/icon.png ${APP_PACKAGE_DIR}/icon.png COPYONLY) +configure_file(${CMAKE_SOURCE_DIR}/tools/webOS/packaging/largeIcon.png ${APP_PACKAGE_DIR}/largeIcon.png COPYONLY) +configure_file(${CMAKE_SOURCE_DIR}/tools/webOS/packaging/keyboard.xml ${APP_PACKAGE_DIR}/.kodi/userdata/keymaps/keyboard.xml COPYONLY) + +# Copy files to the location expected by the webOS packaging scripts. +add_custom_target(bundle + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/lib/python3 + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/addons + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/media + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/system + COMMAND ${CMAKE_COMMAND} -E make_directory ${APP_PACKAGE_DIR}/userdata + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/addons ${APP_PACKAGE_DIR}/addons + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/media ${APP_PACKAGE_DIR}/media + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/system ${APP_PACKAGE_DIR}/system + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/userdata ${APP_PACKAGE_DIR}/userdata + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python${PYTHON_VERSION} ${APP_PACKAGE_DIR}/lib/python3 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${APP_BINARY} ${APP_PACKAGE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libgssapi_krb5.so.2 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libkrb5.so.3 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libkrb5support.so.0 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libk5crypto.so.3 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libcrypto.so.1.1 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${TOOLCHAIN}/${HOST}/sysroot/usr/lib/libcom_err.so.3 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDS_PATH}/lib/libwayland-client++.so.0 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDS_PATH}/lib/libwayland-cursor++.so.0 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDS_PATH}/lib/libwayland-egl++.so.0 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDS_PATH}/lib/libshairplay.so.0 ${APP_PACKAGE_DIR}/lib + COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDS_PATH}/lib/libdrm.so* ${APP_PACKAGE_DIR}/lib +) +add_dependencies(bundle ${APP_NAME_LC}) + + + +add_custom_target(ipk + COMMAND ares-package ${APP_PACKAGE_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + VERBATIM +) +add_dependencies(ipk bundle) + +add_custom_target(ipk-clean + COMMAND ${CMAKE_COMMAND} -E rm -r ${APP_PACKAGE_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + VERBATIM +) diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in index 76f479cf39..8122832a3e 100644 --- a/tools/depends/target/Toolchain.cmake.in +++ b/tools/depends/target/Toolchain.cmake.in @@ -14,6 +14,10 @@ if(OS STREQUAL linux) set(CORE_SYSTEM_NAME linux) set(CORE_PLATFORM_NAME @target_platform@) set(APP_RENDER_SYSTEM @app_rendersystem@ CACHE STRING "Render system to use: \"gl\" or \"gles\"") + if(PLATFORM STREQUAL webos) + set(TOOLCHAIN @use_toolchain@) + set(HOST @use_host@) + endif() elseif(OS STREQUAL android) set(CMAKE_SYSTEM_NAME Android) set(CORE_SYSTEM_NAME android) diff --git a/tools/webOS/packaging/Makefile b/tools/webOS/packaging/Makefile deleted file mode 100644 index 5a0c39061d..0000000000 --- a/tools/webOS/packaging/Makefile +++ /dev/null @@ -1,129 +0,0 @@ -include ../../depends/Makefile.include - -APP_BUILD_DIR:=$(shell cd $(PREFIX)/../..; pwd) -APP_PACKAGE_DIR:=$(shell cd $(PREFIX)/../../..; pwd)/ipk-build -APP_PACKAGE_LIB_DIR:=$(APP_PACKAGE_DIR)/$(notdir $(abspath $(PREFIX)/..))/$(notdir $(abspath $(PREFIX)))/lib -APP_PACKAGE_LIBEXEC_DIR:=$(APP_PACKAGE_DIR)/$(notdir $(abspath $(PREFIX)/..))/$(notdir $(abspath $(PREFIX)))/libexec -APP_LIB_DIR:=$(shell cd $(PREFIX)/lib; pwd)/ -APP_LIBEXEC_DIR:=$(shell cd $(PREFIX)/libexec; pwd)/ -APP_IPK_DIR:=$(shell cd $(PREFIX)/../../..; pwd) -APP_PACKAGE:=$(shell awk '/APP_PACKAGE/ {print tolower($$2)}' $(VERSION.TXT)) -VERSION_CODE:=$(shell awk '/VERSION_CODE/ {print tolower($$2)}' $(VERSION.TXT)) -COMPANY_NAME:=$(shell awk '/COMPANY_NAME/ {print tolower($$2)}' $(VERSION.TXT)) -IPK:=$(APP_PACKAGE)_$(VERSION_CODE)_all.ipk -ICON80:=icon.png -ICON130:=largeIcon.png -KEYBOARD:=keyboard.xml -MAIN_APP:=kodi-$(TARGET_PLATFORM) - -COMPACT_IPK=compact-$(IPK) -COMPACT_PACKAGE_DIR=$(shell cd $(PREFIX)/../../..; pwd)/compact-build - -ifneq ($(SDK_PATH),) - LIBSTDC_DIR:=$(shell cd $(SDK_PATH)/../; pwd)/target/usr/lib - LIBCRYPT_DIR:=$(shell cd $(SDK_PATH)/../; pwd)/target/lib -endif - -.PHONY: all -all: clean libs $(IPK) - -ipk: clean libs $(IPK) -compact-ipk: clean compact-clean $(COMPACT_IPK) - -$(APP_PACKAGE_DIR): - mkdir -p $(APP_PACKAGE_DIR) - -$(APP_PACKAGE_DIR)/appinfo.json: appinfo.json.in Makefile | $(APP_PACKAGE_DIR) - sed -e 's|@APP_PACKAGE@|$(APP_PACKAGE)|g' \ - -e 's|@VERSION_CODE@|$(VERSION_CODE)|g' \ - -e 's|@COMPANY_NAME@|$(COMPANY_NAME)|g' \ - -e 's|@APP_NAME@|$(APP_NAME)|g' < '$<' > '$@' - -$(APP_PACKAGE_DIR)/kodi.sh: kodi.sh.in Makefile | $(APP_DIR) - sed -e 's|@PREFIX@|$(PREFIX)|g' \ - -e 's|@MAIN_APP@|$(MAIN_APP)|g' < '$<' > '$@' - chmod +x $(APP_PACKAGE_DIR)/kodi.sh - -$(APP_PACKAGE_DIR)/$(ICON80): $(ICON80) | $(APP_PACKAGE_DIR) - cp -t '$(APP_PACKAGE_DIR)' -- '$<' - -$(APP_PACKAGE_DIR)/$(ICON130): $(ICON130) | $(APP_PACKAGE_DIR) - cp -t '$(APP_PACKAGE_DIR)' -- '$<' - -$(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD): $(KEYBOARD) | $(APP_PACKAGE_DIR) - mkdir -p $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps - cp -t '$(APP_PACKAGE_DIR)/.kodi/userdata/keymaps' -- '$<' - -$(IPK): $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) \ - $(APP_PACKAGE_DIR)/appinfo.json $(APP_PACKAGE_DIR)/kodi.sh \ - $(APP_PACKAGE_DIR)/$(ICON80) $(APP_PACKAGE_DIR)/$(ICON130) | $(APP_PACKAGE_DIR) - cp $(APP_BUILD_DIR)/$(MAIN_APP) $(APP_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/addons $(APP_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/media $(APP_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/system $(APP_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/userdata $(APP_PACKAGE_DIR) - ares-package \ - -o '$(APP_IPK_DIR)' \ - '$(APP_PACKAGE_DIR)' - -$(COMPACT_IPK): $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) \ - $(APP_PACKAGE_DIR)/appinfo.json $(APP_PACKAGE_DIR)/kodi.sh \ - $(APP_PACKAGE_DIR)/$(ICON80) $(APP_PACKAGE_DIR)/$(ICON130) | $(APP_PACKAGE_DIR) - mkdir -p $(COMPACT_PACKAGE_DIR) - mkdir -p $(COMPACT_PACKAGE_DIR)/.kodi/userdata/keymaps - cp $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) $(COMPACT_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) - cp $(APP_PACKAGE_DIR)/appinfo.json $(COMPACT_PACKAGE_DIR)/appinfo.json - cp $(APP_PACKAGE_DIR)/kodi.sh $(COMPACT_PACKAGE_DIR)/kodi.sh - cp $(APP_PACKAGE_DIR)/$(ICON80) $(COMPACT_PACKAGE_DIR)/$(ICON80) - cp $(APP_PACKAGE_DIR)/$(ICON130) $(COMPACT_PACKAGE_DIR)/$(ICON130) - cp -R $(APP_BUILD_DIR)/addons $(COMPACT_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/media $(COMPACT_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/system $(COMPACT_PACKAGE_DIR) - cp -R $(APP_BUILD_DIR)/userdata $(COMPACT_PACKAGE_DIR) - cp $(APP_BUILD_DIR)/$(MAIN_APP) $(COMPACT_PACKAGE_DIR) - ares-package \ - -o '$(APP_IPK_DIR)' \ - '$(COMPACT_PACKAGE_DIR)' - -.PHONY: libs -libs: - mkdir -p $(APP_PACKAGE_LIB_DIR) - cp -R $(APP_LIB_DIR)* $(APP_PACKAGE_LIB_DIR) - mkdir -p $(APP_PACKAGE_LIBEXEC_DIR) - cp -R $(APP_LIBEXEC_DIR)* $(APP_PACKAGE_LIBEXEC_DIR) -ifneq ($(LIBSTDC_DIR),) - cp -P $(LIBSTDC_DIR)/libstdc++.so* $(APP_PACKAGE_LIB_DIR) - rm $(APP_PACKAGE_LIB_DIR)/libstdc++.so.6.0.30-gdb.py -endif -ifneq ($(LIBCRYPT_DIR),) - cp -P $(LIBCRYPT_DIR)/libcrypt* $(APP_PACKAGE_LIB_DIR) -endif - rm -f $(APP_PACKAGE_LIB_DIR)/*.a - rm -f $(APP_PACKAGE_LIB_DIR)/*.la - rm -f $(APP_PACKAGE_LIB_DIR)/libEGL.so* - rm -f $(APP_PACKAGE_LIB_DIR)/libGLESv2.so* - rm -f $(APP_PACKAGE_LIB_DIR)/libasound.* - rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-client.so* - rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-server.so* - rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-egl.so* - -.PHONY: install -install: - ares-install '$(APP_IPK_DIR)/$(IPK)' - -.PHONY: launch -launch: - ares-launch '$(APP_PACKAGE)' - -.PHONY: uninstall -uninstall: - ares-install --remove '$(APP_PACKAGE)' - -.PHONY: clean -clean: - rm -f -- '$(IPK)' - rm -rf -- '$(APP_PACKAGE_DIR)' - -.PHONY: compact-clean -compact-clean: - rm -rf -- '$(COMPACT_PACKAGE_DIR)' diff --git a/tools/webOS/packaging/appinfo.json.in b/tools/webOS/packaging/appinfo.json.in index 8a66b536cb..a1673d59b4 100644 --- a/tools/webOS/packaging/appinfo.json.in +++ b/tools/webOS/packaging/appinfo.json.in @@ -1,12 +1,12 @@ { "id": "@APP_PACKAGE@", - "version": "@VERSION_CODE@", + "version": "@APP_VERSION_CODE@", "vendor": "@COMPANY_NAME@", "type": "native", - "main": "kodi.sh", + "main": "@APP_BINARY@", "title": "@APP_NAME@", "icon": "icon.png", "largeIcon": "largeIcon.png", - "noSplashOnLaunch": true, + "splashBackground": "media/splash.jpg", "spinnerOnLaunch": false } diff --git a/tools/webOS/packaging/kodi.sh.in b/tools/webOS/packaging/kodi.sh.in deleted file mode 100755 index 695b2e1064..0000000000 --- a/tools/webOS/packaging/kodi.sh.in +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@PREFIX@/lib -export WAYLAND_DISPLAY=wayland-0 -if [[ -z "${GST_PLUGIN_SCANNER_1_0}" ]]; then - export GST_PLUGIN_SCANNER_1_0='@PREFIX@/libexec/gstreamer-1.0/gst-plugin-scanner' -else - if [ ! -d "${GST_PLUGIN_SCANNER_1_0}" ]; then - export GST_PLUGIN_SCANNER_1_0='@PREFIX@/libexec/gstreamer-1.0/gst-plugin-scanner' - fi -fi -if [ ! -d @PREFIX@/share/X11 ]; then - mkdir -p @PREFIX@/share/X11; - ln -s /usr/share/X11/xkb @PREFIX@/share/X11 -fi -./@MAIN_APP@ |