aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2020-01-10 21:33:47 +1000
committerGitHub <noreply@github.com>2020-01-10 21:33:47 +1000
commitfd07663a00d702a86e28af97f8112bc1ec12d44e (patch)
tree5e3aba86fe4ce0aef1d768bf67c52d3e6f703b94 /tools
parent0dedc2269bb1fd131cda5b80441167fa0a7aefa8 (diff)
parent9bfbe696d08819e83f8a538d7a83574b7500fe96 (diff)
Merge pull request #16860 from fuzzard/master-ATV
Implement Apple TV Platform
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildsteps/tvos/configure-xbmc5
-rwxr-xr-xtools/buildsteps/tvos/make-xbmc7
-rwxr-xr-xtools/buildsteps/tvos/package12
-rwxr-xr-xtools/darwin/Support/Codesign.command114
-rwxr-xr-xtools/darwin/Support/CopyRootFiles-darwin_embedded.command2
-rwxr-xr-xtools/darwin/Support/GenerateMissingImages-tvos.py29
-rwxr-xr-xtools/darwin/Support/copyframeworks-darwin_embedded.command12
-rwxr-xr-xtools/darwin/Support/copyframeworks-dylibs2frameworks.command106
-rw-r--r--tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in37
-rw-r--r--tools/depends/target/Makefile1
-rw-r--r--tools/depends/target/python3/darwin_embedded.patch13
-rw-r--r--tools/depends/target/pythonmodule-pil/Makefile8
12 files changed, 278 insertions, 68 deletions
diff --git a/tools/buildsteps/tvos/configure-xbmc b/tools/buildsteps/tvos/configure-xbmc
new file mode 100755
index 0000000000..e3c3767b25
--- /dev/null
+++ b/tools/buildsteps/tvos/configure-xbmc
@@ -0,0 +1,5 @@
+WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )}
+XBMC_PLATFORM_DIR=tvos
+. $WORKSPACE/tools/buildsteps/defaultenv
+
+make -C $WORKSPACE/tools/depends/target/cmakebuildsys
diff --git a/tools/buildsteps/tvos/make-xbmc b/tools/buildsteps/tvos/make-xbmc
new file mode 100755
index 0000000000..c54913516a
--- /dev/null
+++ b/tools/buildsteps/tvos/make-xbmc
@@ -0,0 +1,7 @@
+WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )}
+XBMC_PLATFORM_DIR=tvos
+. $WORKSPACE/tools/buildsteps/defaultenv
+
+cd $WORKSPACE/build;xcodebuild -target deb -configuration $Configuration build \
+ SDKROOT=appletvos$SDK_VERSION XBMC_DEPENDS_ROOT=$XBMC_DEPENDS_ROOT \
+ CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" -CODE_SIGNING_ALLOWED="NO"
diff --git a/tools/buildsteps/tvos/package b/tools/buildsteps/tvos/package
new file mode 100755
index 0000000000..8774eb130a
--- /dev/null
+++ b/tools/buildsteps/tvos/package
@@ -0,0 +1,12 @@
+WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )}
+XBMC_PLATFORM_DIR=tvos
+. $WORKSPACE/tools/buildsteps/defaultenv
+
+cd $WORKSPACE/build;xcodebuild -target deb
+cd $WORKSPACE/build/tools/darwin/packaging/darwin_embedded/
+
+#rename for upload
+#e.x. kodi-20130314-8c2fb31-Frodo-tvos.deb
+UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-tvos.deb"
+mkdir $WORKSPACE/tools/darwin/packaging/tvos
+mv *.deb $WORKSPACE/tools/darwin/packaging/tvos/$UPLOAD_FILENAME
diff --git a/tools/darwin/Support/Codesign.command b/tools/darwin/Support/Codesign.command
index 6d2b5f474a..8772013e62 100755
--- a/tools/darwin/Support/Codesign.command
+++ b/tools/darwin/Support/Codesign.command
@@ -3,9 +3,7 @@
set -x
#this is the list of binaries we have to sign for being able to run un-jailbroken
-LIST_BINARY_EXTENSIONS="dylib so"
-
-export CODESIGN_ALLOCATE=`xcodebuild -find codesign_allocate`
+LIST_BINARY_EXTENSIONS="dylib so 0 vis pvr app"
GEN_ENTITLEMENTS="$NATIVEPREFIX/bin/gen_entitlements.py"
IOS11_ENTITLEMENTS="$XBMC_DEPENDS/share/ios11_entitlements.xml"
@@ -25,29 +23,31 @@ if [ ! -f ${GEN_ENTITLEMENTS} ]; then
exit -1
fi
-
if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "appletvos" ]; then
if [ -f "/Users/Shared/buildslave/keychain_unlock.sh" ]; then
/Users/Shared/buildslave/keychain_unlock.sh
fi
- #do fake sign - needed for jailbroken ios5.1 devices for some reason
- if [ -f ${LDID} ]; then
- find ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/ -name "*.dylib" | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
- find ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/ -name "*.so" | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
- ${LDID} -S${IOS11_ENTITLEMENTS} ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}
+ # todo: is this required anymore?
+ if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
+ #do fake sign - needed for jailbroken ios5.1 devices for some reason
+ if [ -f ${LDID} ]; then
+ find ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/ -name "*.dylib" | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
+ find ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/ -name "*.so" | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
+ ${LDID} -S${IOS11_ENTITLEMENTS} ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}
- #repackage python eggs
- EGGS=`find ${CODESIGNING_FOLDER_PATH} -name "*.egg" -type f`
+ #repackage python eggs
+ EGGS=`find ${CODESIGNING_FOLDER_PATH} -name "*.egg" -type f`
for i in $EGGS; do
echo $i
mkdir del
- unzip $i -d del
- find ./del/ -name "*.so" -type f | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
+ unzip -q $i -d del
+ find ./del/ -name "*.so" -type f | xargs ${LDID} -S${IOS11_ENTITLEMENTS}
rm $i
- cd del && zip -r $i ./* && cd ..
+ cd del && zip -qr $i ./* && cd ..
rm -r ./del/
done
+ fi
fi
# pull the CFBundleIdentifier out of the built xxx.app
@@ -58,37 +58,71 @@ if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "appletvos" ]
echo "CFBundleIdentifier is ${BUNDLEID}"
-
# Prefer the expanded name, if available.
CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
- if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then
- # Fall back to old behavior.
- CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}"
- fi
- echo "${CODE_SIGN_IDENTITY_FOR_ITEMS}"
+ if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then
+ # Fall back to old behavior.
+ CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}"
+ fi
+ echo "${CODE_SIGN_IDENTITY_FOR_ITEMS}"
${GEN_ENTITLEMENTS} "${BUNDLEID}" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}.xcent";
- codesign -v -f -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" --entitlements "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/"
- #if user has set a code_sign_identity different from iPhone Developer we do a real codesign (for deployment on non-jailbroken devices)
- if ! [ -z "${CODE_SIGN_IDENTITY}" ] && [ "${CODE_SIGN_IDENTITY}" == "iPhone Developer" ] && [ "${CODE_SIGN_IDENTITY}" != "Don't Code Sign" ]; then
- echo "Doing a full bundle sign using genuine identity ${CODE_SIGN_IDENTITY}"
- for binext in $LIST_BINARY_EXTENSIONS
- do
- codesign --deep -fvvv -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -i "${BUNDLEID}" `find ${CODESIGNING_FOLDER_PATH} -name "*.$binext" -type f` ${CODESIGNING_FOLDER_PATH}
- done
- echo "In case your app crashes with SIG_SIGN check the variable LIST_BINARY_EXTENSIONS in tools/darwin/Support/Codesign.command"
+ # delete existing codesigning
+ if [ -d "${CODESIGNING_FOLDER_PATH}/_CodeSignature" ]; then
+ rm -r ${CODESIGNING_FOLDER_PATH}/_CodeSignature
+ fi
+ if [ -f "${CODESIGNING_FOLDER_PATH}/embedded.mobileprovision" ]; then
+ rm -f ${CODESIGNING_FOLDER_PATH}/embedded.mobileprovision
+ fi
- #repackage python eggs
- EGGS=`find ${CODESIGNING_FOLDER_PATH} -name "*.egg" -type f`
- for i in $EGGS; do
- echo $i
- mkdir del
- unzip $i -d del
- codesign --deep -fvvv -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -i "${BUNDLEID}" `find ./del/ -name "*.$binext" -type f` ./del/
- rm $i
- cd del && zip -r $i ./* && cd ..
- rm -r ./del/
- done
+ #if user has set a code_sign_identity different from iPhone Developer we do a real codesign (for deployment on non-jailbroken devices)
+ if ! [ -z "${CODE_SIGN_IDENTITY}" ]; then
+ if echo ${CODE_SIGN_IDENTITY} | grep -cim1 "iPhone Developer" &>/dev/null || echo ${CODE_SIGN_IDENTITY} | grep -cim1 "Apple Development" &>/dev/null; then
+ echo "Doing a full bundle sign using genuine identity ${CODE_SIGN_IDENTITY}"
+ for binext in $LIST_BINARY_EXTENSIONS
+ do
+ echo "Signing binary: $binext"
+ # check if at least 1 file with the extension exists to sign, otherwise do nothing
+ FINDOUTPUT=`find ${CODESIGNING_FOLDER_PATH} -name "*.$binext" -type f`
+ if [ `echo $FINDOUTPUT | wc -l` != 0 ]; then
+ for singlefile in $FINDOUTPUT; do
+ codesign -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -fvvv -i "${BUNDLEID}" "${singlefile}"
+ done
+ fi
+ done
+ echo "In case your app crashes with SIG_SIGN check the variable LIST_BINARY_EXTENSIONS in tools/darwin/Support/Codesign.command"
+
+ for FRAMEWORK_PATH in `find ${CODESIGNING_FOLDER_PATH} -name "*.framework" -type d`
+ do
+ DYLIB_BASENAME=$(basename "${FRAMEWORK_PATH%.framework}")
+ echo "Signing Framework: ${DYLIB_BASENAME}.framework"
+ FRAMEWORKBUNDLEID="${BUNDLEID}.framework.${DYLIB_BASENAME}"
+ codesign -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -fvvv -i "${FRAMEWORKBUNDLEID}" ${FRAMEWORK_PATH}/${DYLIB_BASENAME}
+ codesign -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -fvvv -i "${FRAMEWORKBUNDLEID}" ${FRAMEWORK_PATH}
+ done
+
+ #repackage python eggs
+ EGGS=`find ${CODESIGNING_FOLDER_PATH} -name "*.egg" -type f`
+ echo "Signing Eggs"
+ for i in $EGGS; do
+ echo $i
+ mkdir del
+ unzip -q $i -d del
+ for binext in $LIST_BINARY_EXTENSIONS
+ do
+ # check if at least 1 file with the extension exists to sign, otherwise do nothing
+ FINDOUTPUT=`find ./del/ -name "*.$binext" -type f`
+ if [ `echo $FINDOUTPUT | wc -l` != 0 ]; then
+ for singlefile in $FINDOUTPUT; do
+ codesign -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -fvvv -i "${BUNDLEID}" "${singlefile}"
+ done
+ fi
+ done
+ rm $i
+ cd del && zip -qr $i ./* && cd ..
+ rm -r ./del/
+ done
+ fi
fi
fi
diff --git a/tools/darwin/Support/CopyRootFiles-darwin_embedded.command b/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
index dea36f7021..638ae6d1e9 100755
--- a/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
+++ b/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
@@ -14,7 +14,7 @@ SYNC="rsync -aq --exclude .git* --exclude .DS_Store* --exclude *.dll --exclude *
SKINSYNC="rsync -aq --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.bat"
# rsync command for including everything but the skins
-ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.estuary --exclude addons/skin.estouchy"
+ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.estuary --exclude addons/skin.estouchy --exclude addons/lib --exclude addons/share"
# binary name is Kodi but we build Kodi.bin so to get a clean binary each time
mv $TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$EXECUTABLE_NAME.bin $TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$EXECUTABLE_NAME
diff --git a/tools/darwin/Support/GenerateMissingImages-tvos.py b/tools/darwin/Support/GenerateMissingImages-tvos.py
new file mode 100755
index 0000000000..cc71376b8e
--- /dev/null
+++ b/tools/darwin/Support/GenerateMissingImages-tvos.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import sys, os, json
+from subprocess import call
+
+assetCatalogPath = sys.argv[1]
+brandAssetsDir = sys.argv[2] + '.brandassets'
+
+def generateImage(contentsRelativeDir, isBaseImage1x, newWidth, newHeight):
+ contentsDir = os.path.join(assetCatalogPath, contentsRelativeDir)
+ if isBaseImage1x:
+ existingImageIndex = 0
+ newImageIndex = 1
+ else:
+ existingImageIndex = 1
+ newImageIndex = 0
+ with open(os.path.join(contentsDir, 'Contents.json')) as jsonFile:
+ jsonContents = json.load(jsonFile)
+ existingImageRelativePath = jsonContents['images'][existingImageIndex]['filename']
+ existingImagePath = os.path.join(contentsDir, existingImageRelativePath)
+ call(['sips', '--resampleHeightWidth', str(newHeight), str(newWidth), existingImagePath, '--out', os.path.join(contentsDir, jsonContents['images'][newImageIndex]['filename'])])
+
+
+generateImage(sys.argv[3] + '.launchimage', True, 3840, 2160)
+generateImage(os.path.join(brandAssetsDir, 'topshelf_wide.imageset'), True, 4640, 1440)
+
+appIconSmall = os.path.join(brandAssetsDir, 'icon.imagestack')
+for i in xrange(1, 5):
+ generateImage(os.path.join(appIconSmall, 'Layer{}.imagestacklayer'.format(i), 'Content.imageset'), False, 400, 240)
diff --git a/tools/darwin/Support/copyframeworks-darwin_embedded.command b/tools/darwin/Support/copyframeworks-darwin_embedded.command
index 199f58c5f8..1818224136 100755
--- a/tools/darwin/Support/copyframeworks-darwin_embedded.command
+++ b/tools/darwin/Support/copyframeworks-darwin_embedded.command
@@ -68,9 +68,15 @@ echo "Package $FULL_PRODUCT_NAME"
echo "Checking $FULL_PRODUCT_NAME for dylib dependencies"
for a in $(otool -L "$TARGET_BINARY" | grep "$EXTERNAL_LIBS\|$DYLIB_NAMEPATH" | awk ' { print $1 } ') ; do
echo " Packaging $a"
- cp -f "$EXTERNAL_LIBS/lib/$(basename $a)" "$TARGET_FRAMEWORKS/"
- chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)"
- install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$TARGET_BINARY"
+ # Soft Frameworks strip dylib from path. Explicitly add dylib
+ if ! [ -f "$EXTERNAL_LIBS/lib/$(basename $a)" ]; then
+ DYLIBNAME="$(basename $a).dylib"
+ else
+ DYLIBNAME="$(basename $a)"
+ fi
+ cp -f "$EXTERNAL_LIBS/lib/$DYLIBNAME" "$TARGET_FRAMEWORKS/"
+ chmod u+w "$TARGET_FRAMEWORKS/$DYLIBNAME"
+ install_name_tool -change "$a" "$DYLIB_NAMEPATH/$DYLIBNAME" "$TARGET_BINARY"
done
echo "Package $EXTERNAL_LIBS/lib/python$PYTHON_VERSION"
diff --git a/tools/darwin/Support/copyframeworks-dylibs2frameworks.command b/tools/darwin/Support/copyframeworks-dylibs2frameworks.command
new file mode 100755
index 0000000000..faa5a51a80
--- /dev/null
+++ b/tools/darwin/Support/copyframeworks-dylibs2frameworks.command
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Copyright (C) 2015 Team MrMC
+# https://github.com/MrMC
+#
+# This Program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This Program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MrMC; see the file COPYING. If not, see
+# <http://www.gnu.org/licenses/>.
+
+#set -x
+
+TARGET_CONTENTS="${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}"
+TARGET_FRAMEWORKS=$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH
+
+# use the same date/time stamp format for all CFBundleVersions
+BUNDLE_REVISION=$(date -u +%y%m%d.%H%M)
+
+# ios/tvos use different framework plists
+if [ "${PLATFORM_NAME}" == "appletvos" ]; then
+ SEEDFRAMEWORKPLIST="${SRCROOT}/xbmc/platform/darwin/tvos/FrameworkSeed_Info.plist"
+# todo: implement soft frameworks for ios
+#elif [ "$PLATFORM_NAME" == "iphoneos" ]; then
+# SEEDFRAMEWORKPLIST="${SRCROOT}/xbmc/platform/darwin/ios/FrameworkSeed_Info.plist"
+fi
+
+function convert2framework
+{
+ DYLIB="${1}"
+ # typical darwin dylib name format is lib<name>.<version>.dylib
+ DYLIB_BASENAME=$(basename "${DYLIB}")
+ # strip .<version>.dylib
+ DYLIB_LIBBASENAME="${DYLIB_BASENAME%%.[0-9]*}"
+ # make sure .dylib is stripped
+ DYLIB_LIBNAME="${DYLIB_LIBBASENAME%.dylib}"
+
+ # Update main bundle executable to new location of frameworks
+ install_name_tool -change @executable_path/Frameworks/${DYLIB_BASENAME} @executable_path/Frameworks/${DYLIB_LIBNAME}.framework/${DYLIB_LIBNAME} ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}
+ install_name_tool -add_rpath @executable_path/Frameworks/${DYLIB_LIBNAME}.framework ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}
+
+ BUNDLEID=`mdls -raw -name kMDItemCFBundleIdentifier ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}`
+ if [ "${BUNDLEID}" == "(null)" ] ; then
+ BUNDLEID=`/usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/Info.plist`
+ fi
+
+ FRAMEWORKBUNDLEID="${BUNDLEID}.framework.${DYLIB_LIBNAME}"
+ echo "CFBundleIdentifier is ${FRAMEWORKBUNDLEID}"
+ echo "convert ${DYLIB_BASENAME} to ${DYLIB_LIBNAME}.framework"
+
+ DEST_FRAMEWORK="${TARGET_FRAMEWORKS}/${DYLIB_LIBNAME}.framework"
+ mkdir -p "${DEST_FRAMEWORK}"
+ mkdir -p "${DEST_FRAMEWORK}/Headers"
+ mkdir -p "${DEST_FRAMEWORK}/Modules"
+
+ # framework plists are binary
+ plutil -convert binary1 "${SEEDFRAMEWORKPLIST}" -o "${DEST_FRAMEWORK}/Info.plist"
+ # set real CFBundleName
+ plutil -replace CFBundleName -string "${DYLIB_LIBNAME}" "${DEST_FRAMEWORK}/Info.plist"
+ # set real CFBundleVersion
+ plutil -replace CFBundleVersion -string "${BUNDLE_REVISION}" "${DEST_FRAMEWORK}/Info.plist"
+ # set real CFBundleIdentifier
+ plutil -replace CFBundleIdentifier -string "${FRAMEWORKBUNDLEID}" "${DEST_FRAMEWORK}/Info.plist"
+ # set real CFBundleExecutable
+ plutil -replace CFBundleExecutable -string "${DYLIB_LIBNAME}" "${DEST_FRAMEWORK}/Info.plist"
+ # move it (not copy)
+ mv -f "${DYLIB}" "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}"
+
+ # fixup loader id/paths
+ LC_ID_DYLIB="@rpath/${DYLIB_LIBNAME}.framework/${DYLIB_LIBNAME}"
+ LC_RPATH1="@executable_path/Frameworks/${DYLIB_LIBNAME}.framework"
+ LC_RPATH2="@loader_path/Frameworks/${DYLIB_LIBNAME}.framework"
+ install_name_tool -id "${LC_ID_DYLIB}" "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}"
+ install_name_tool -add_rpath "${LC_RPATH1}" "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}"
+ install_name_tool -add_rpath "${LC_RPATH2}" "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}"
+
+ if [ "$STRIP_INSTALLED_PRODUCT" == "YES" ]; then
+ strip -x "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}"
+ fi
+
+ if [ "$ACTION" == install ]; then
+ # extract the uuid and use it to find the matching bcsymbolmap (needed for crashlog symbolizing)
+ UUID=$(otool -l "${DEST_FRAMEWORK}/${DYLIB_LIBNAME}" | grep uuid | awk '{ print $2}')
+ echo "bcsymbolmap is ${UUID}"
+ if [ -f "${XBMC_DEPENDS}/bcsymbolmaps/${UUID}.bcsymbolmap" ]; then
+ echo "bcsymbolmap is ${UUID}.bcsymbolmap"
+ cp -f "${XBMC_DEPENDS}/bcsymbolmaps/${UUID}.bcsymbolmap" "${BUILT_PRODUCTS_DIR}/"
+ fi
+ fi
+}
+
+# todo: convert ios to soft frameworks as well to remove this if guard
+if [ "$PLATFORM_NAME" == "appletvos" ]; then
+ # loop over all xxx.dylibs in xxx.app/Frameworks
+ for dylib in $(find "${TARGET_FRAMEWORKS}" -name "*.dylib" -type f); do
+ convert2framework "${dylib}"
+ done
+fi
diff --git a/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in b/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in
index fdcb4c557d..23d654f1a5 100644
--- a/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in
+++ b/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in
@@ -10,15 +10,19 @@ DIRNAME=`dirname $0`
DSYM_TARGET_DIR=/Users/Shared/xbmc-depends/dSyms
DSYM_FILENAME=@APP_NAME@.app.dSYM
ARM64=false
+PP_DEVICE=iOS
+if [ "@PLATFORM@" == "appletvos" ]; then
+ PP_DEVICE=tvOS
+fi
if [ "${SWITCH#*debug}" != "${SWITCH}" ]; then
- echo "Packaging Debug target for iOS"
- APP="$DIRNAME/../../../../build/Debug-iphoneos/@APP_NAME@.app"
- DSYM="$DIRNAME/../../../../build/Debug-iphoneos/$DSYM_FILENAME"
+ echo "Packaging Debug target for ${PP_DEVICE}"
+ APP="$DIRNAME/../../../../build/Debug-@PLATFORM@/@APP_NAME@.app"
+ DSYM="$DIRNAME/../../../../build/Debug-@PLATFORM@/$DSYM_FILENAME"
elif [ "${SWITCH#*release}" != "${SWITCH}" ]; then
- echo "Packaging Release target for iOS"
- APP="$DIRNAME/../../../../build/Release-iphoneos/@APP_NAME@.app"
- DSYM="$DIRNAME/../../../../build/Release-iphoneos/$DSYM_FILENAME"
+ echo "Packaging Release target for ${PP_DEVICE}"
+ APP="$DIRNAME/../../../../build/Release-@PLATFORM@/@APP_NAME@.app"
+ DSYM="$DIRNAME/../../../../build/Release-@PLATFORM@/$DSYM_FILENAME"
else
echo "You need to specify the build target"
exit 1
@@ -48,7 +52,7 @@ if [ -f "${NATIVEPREFIX}/bin/dpkg-deb" ]; then
export PATH=${bin_path}:${PATH}
fi
-PACKAGE=org.xbmc.@APP_NAME_LC@-ios
+PACKAGE="@PLATFORM_BUNDLE_IDENTIFIER@"
PACKAGE_ARM64="${PACKAGE}64"
VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
@@ -60,10 +64,10 @@ fi
# customize revision string
[ ! -z "$2" ] && REVISION="$2"
-ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
+ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_@PLATFORM@-arm.deb
# package identifier for arm64
-$ARM64 && ARCHIVE=${PACKAGE_ARM64}_${VERSION}-${REVISION}_iphoneos-arm.deb
+$ARM64 && ARCHIVE=${PACKAGE_ARM64}_${VERSION}-${REVISION}_@PLATFORM@-arm.deb
SIZE="$(du -s -k ${APP} | awk '{print $1}')"
@@ -75,22 +79,21 @@ rm -rf $DIRNAME/$ARCHIVE
mkdir -p $DIRNAME/$PACKAGE/DEBIAN
if $ARM64; then
echo "Package: $PACKAGE_ARM64" > $DIRNAME/$PACKAGE/DEBIAN/control
- echo "Name: @APP_NAME@-iOS (64-bit)" >> $DIRNAME/$PACKAGE/DEBIAN/control
+ echo "Name: @APP_NAME@-${PP_DEVICE} (64-bit)" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Pre-Depends: cy+cpu.arm64" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Conflicts: $PACKAGE" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Replaces: $PACKAGE" >> $DIRNAME/$PACKAGE/DEBIAN/control
else
echo "Package: $PACKAGE" > $DIRNAME/$PACKAGE/DEBIAN/control
- echo "Name: @APP_NAME@-iOS" >> $DIRNAME/$PACKAGE/DEBIAN/control
+ echo "Name: @APP_NAME@-${PP_DEVICE}" >> $DIRNAME/$PACKAGE/DEBIAN/control
fi
echo "Priority: Extra" >> $DIRNAME/$PACKAGE/DEBIAN/control
-echo "Depends: firmware (>= @CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET@)" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Version: $VERSION-$REVISION" >> $DIRNAME/$PACKAGE/DEBIAN/control
-echo "Architecture: iphoneos-arm" >> $DIRNAME/$PACKAGE/DEBIAN/control
+echo "Architecture: @CMAKE_SYSTEM_NAME@-@CPU@" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Installed-Size: $SIZE" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Description: @APP_NAME@ Entertainment Center for iOS" >> $DIRNAME/$PACKAGE/DEBIAN/control
-echo "Homepage: http://kodi.tv/" >> $DIRNAME/$PACKAGE/DEBIAN/control
-echo "Maintainer: Memphiz" >> $DIRNAME/$PACKAGE/DEBIAN/control
+echo "Homepage: @APP_WEBSITE@" >> $DIRNAME/$PACKAGE/DEBIAN/control
+echo "Maintainer: Memphiz et al." >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Author: Team-@APP_NAME@" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Section: Multimedia" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Icon: file:///Applications/@APP_NAME@.app/AppIcon57x57.png" >> $DIRNAME/$PACKAGE/DEBIAN/control
@@ -103,7 +106,9 @@ chmod +x $DIRNAME/$PACKAGE/DEBIAN/prerm
# postinst: nothing for now.
echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN/postinst
echo "chown -R mobile:mobile /Applications/@APP_NAME@.app" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
-cat $DIRNAME/migrate_to_kodi.sh >> $DIRNAME/$PACKAGE/DEBIAN/postinst
+if [ "@PLATFORM@" != "appletvos" ]; then
+ cat $DIRNAME/migrate_to_kodi.sh >> $DIRNAME/$PACKAGE/DEBIAN/postinst
+fi
echo "/usr/bin/uicache" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo "echo 'finish:respringing ...'" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
chmod +x $DIRNAME/$PACKAGE/DEBIAN/postinst
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
index b68e3809aa..c2bd06b898 100644
--- a/tools/depends/target/Makefile
+++ b/tools/depends/target/Makefile
@@ -30,6 +30,7 @@ ifeq ($(OS),darwin_embedded)
EXCLUDED_DEPENDS = libcec libusb
ifeq ($(TARGET_PLATFORM),appletvos)
DEPENDS += boblight
+ EXCLUDED_DEPENDS += libshairplay libplist
endif
DEPENDS += iosentitlements
endif
diff --git a/tools/depends/target/python3/darwin_embedded.patch b/tools/depends/target/python3/darwin_embedded.patch
index 59fd5457c6..094e7f112e 100644
--- a/tools/depends/target/python3/darwin_embedded.patch
+++ b/tools/depends/target/python3/darwin_embedded.patch
@@ -214,7 +214,7 @@
wchar_t *path = Py_DecodeLocale(execpath, &len);
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
-@@ -197,6 +197,20 @@
+@@ -197,6 +197,19 @@
#endif /* _MSC_VER */
#endif /* ! __WATCOMC__ || __QNX__ */
@@ -231,11 +231,10 @@
+# undef HAVE_WAIT
+# undef HAVE_WAIT3
+# undef HAVE_WAIT4
-+# undef HAVE_WAITPID
/*[clinic input]
# one of the few times we lie about this name!
-@@ -475,6 +489,10 @@
+@@ -475,6 +488,10 @@
}
#endif
@@ -246,7 +245,7 @@
/* Legacy wrapper */
void
PyOS_AfterFork(void)
-@@ -5040,6 +5058,8 @@
+@@ -5040,6 +5057,8 @@
#endif
_Py_END_SUPPRESS_IPH
@@ -255,7 +254,7 @@
/* If we get here it's definitely an error */
free_string_array(argvlist, argc);
-@@ -5116,6 +5136,12 @@
+@@ -5116,6 +5135,12 @@
#endif
_Py_END_SUPPRESS_IPH
@@ -268,7 +267,7 @@
/* If we get here it's definitely an error */
posix_path_error(path);
-@@ -5416,7 +5442,7 @@
+@@ -5416,7 +5441,7 @@
pid_t pid;
PyOS_BeforeFork();
@@ -277,7 +276,7 @@
if (pid == 0) {
/* child: this clobbers and resets the import lock. */
PyOS_AfterFork_Child();
-@@ -5447,7 +5473,7 @@
+@@ -5447,7 +5472,7 @@
pid_t pid;
PyOS_BeforeFork();
diff --git a/tools/depends/target/pythonmodule-pil/Makefile b/tools/depends/target/pythonmodule-pil/Makefile
index 4afcb31164..07796ae807 100644
--- a/tools/depends/target/pythonmodule-pil/Makefile
+++ b/tools/depends/target/pythonmodule-pil/Makefile
@@ -19,10 +19,11 @@ endif
ifeq (darwin, $(findstring darwin, $(HOST)))
ifeq ($(OS),darwin_embedded)
PYTHON_O=$(abs_top_srcdir)/target/python3/$(PLATFORM)/Programs/python.o
+PILPATH=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
endif
#ensure that only our target ldflags are passed to the python build
LDSHARED:=$(CC) -bundle -undefined dynamic_lookup $(LDFLAGS)
-CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" CCSHARED="$(CC) $(CFLAGS) $(PYTHON_O)" LDFLAGS="$(LDFLAGS)" PYTHONPATH="$(PREFIX)/lib/python3.7/site-packages/" LDSHARED="$(LDSHARED)"
+CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" CCSHARED="$(CC) $(CFLAGS) $(PYTHON_O)" LDFLAGS="$(LDFLAGS)" PYTHONPATH="$(PILPATH):$(PREFIX)/lib/python3.7/site-packages/" LDSHARED="$(LDSHARED)"
endif
LIBDYLIB=$(PLATFORM)/dist/Pillow-$(VERSION)-py3.7-$(OS)-$(CPU).egg
@@ -52,6 +53,11 @@ ifeq ($(OS),android)
cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --install-lib $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
cd $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib && unzip -o ../Pillow-*.egg
cd $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil && rm -rf Pillow-*.egg
+else ifeq ($(TARGET_PLATFORM),appletvos)
+ mkdir -p $(PILPATH)/lib
+ cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --install-lib $(PILPATH)
+ cd $(PILPATH)/lib && unzip -o ../Pillow-*.egg
+ cd $(PILPATH) && rm -rf Pillow-*.egg
else
cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --prefix=$(PREFIX)
endif