diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2016-01-10 14:45:15 +0100 |
---|---|---|
committer | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2016-01-10 14:45:15 +0100 |
commit | 1359d67f0ecd508d40cc1f0175dc84f78b1bedfb (patch) | |
tree | 1e25bbfd9012c9092a0590c446f60ba3a081a992 /tools/darwin | |
parent | 30655e154b02070d5be1228585555d2f16cef537 (diff) | |
parent | 810d996b1a018809cb817397b401f63644434f4b (diff) |
Merge pull request #8777 from Memphiz/arm64
Diffstat (limited to 'tools/darwin')
-rwxr-xr-x | tools/darwin/Support/Codesign.command | 34 | ||||
-rwxr-xr-x | tools/darwin/Support/CopyRootFiles-ios.command | 2 | ||||
-rwxr-xr-x | tools/darwin/Support/CopyRootFiles-osx.command | 2 | ||||
-rwxr-xr-x | tools/darwin/Support/copyframeworks-ios.command | 85 | ||||
-rw-r--r-- | tools/darwin/packaging/ios/mkdeb-ios.sh.in | 30 |
5 files changed, 96 insertions, 57 deletions
diff --git a/tools/darwin/Support/Codesign.command b/tools/darwin/Support/Codesign.command index 1535d767d4..5fb30e2fa1 100755 --- a/tools/darwin/Support/Codesign.command +++ b/tools/darwin/Support/Codesign.command @@ -1,7 +1,7 @@ #!/bin/bash #this is the list of binaries we have to sign for being able to run un-jailbroken -LIST_BINARY_EXTENSIONS="dylib so 0 vis pvr" +LIST_BINARY_EXTENSIONS="dylib so" export CODESIGN_ALLOCATE=`xcodebuild -find codesign_allocate` @@ -14,7 +14,7 @@ if [ ! -f ${GEN_ENTITLEMENTS} ]; then fi -if [ "${PLATFORM_NAME}" == "iphoneos" ]; then +if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "appletvos" ]; then if [ -f "/Users/Shared/buildslave/keychain_unlock.sh" ]; then /Users/Shared/buildslave/keychain_unlock.sh fi @@ -24,16 +24,40 @@ if [ "${PLATFORM_NAME}" == "iphoneos" ]; then ${LDID} -S ${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${APP_NAME} fi - ${GEN_ENTITLEMENTS} "org.xbmc.kodi-ios" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; - codesign -v -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/" + # pull the CFBundleIdentifier out of the built xxx.app + BUNDLEID=`mdls -raw -name kMDItemCFBundleIdentifier ${CODESIGNING_FOLDER_PATH}` + 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}" + + ${GEN_ENTITLEMENTS} "${BUNDLEID}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; + codesign -v -f -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/" #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 -fvvv -s "${CODE_SIGN_IDENTITY}" -i org.xbmc.kodi-ios `find ${CODESIGNING_FOLDER_PATH} -name "*.$binext" -type f` ${CODESIGNING_FOLDER_PATH} + 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 + + #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 fi fi diff --git a/tools/darwin/Support/CopyRootFiles-ios.command b/tools/darwin/Support/CopyRootFiles-ios.command index 7d50847e89..1b6e548a51 100755 --- a/tools/darwin/Support/CopyRootFiles-ios.command +++ b/tools/darwin/Support/CopyRootFiles-ios.command @@ -17,7 +17,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 --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.confluence --exclude addons/skin.re-touched --exclude visualization.*" +ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.confluence --exclude addons/skin.re-touched" # binary name is Kodi but we build Kodi.bin so to get a clean binary each time mv $TARGET_BUILD_DIR/$TARGET_NAME/$APP_NAME.bin $TARGET_BUILD_DIR/$TARGET_NAME/$APP_NAME diff --git a/tools/darwin/Support/CopyRootFiles-osx.command b/tools/darwin/Support/CopyRootFiles-osx.command index 236601ed83..7ec3d296d3 100755 --- a/tools/darwin/Support/CopyRootFiles-osx.command +++ b/tools/darwin/Support/CopyRootFiles-osx.command @@ -17,7 +17,7 @@ SYNC="rsync -aq --exclude .git* --exclude .DS_Store* --exclude *.dll --exclude * SYNCSKIN="rsync -aq --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.png --exclude *.jpg --exclude *.bat" # rsync command for including everything but the skins -ADDONSYNC="rsync -aq --exclude .git* --exclude .DS_Store* --exclude addons/skin.confluence --exclude addons/skin.re-touched" +ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude .DS_Store* --exclude addons/skin.confluence --exclude addons/skin.re-touched" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/addons" diff --git a/tools/darwin/Support/copyframeworks-ios.command b/tools/darwin/Support/copyframeworks-ios.command index 9d39986ae6..11a5404982 100755 --- a/tools/darwin/Support/copyframeworks-ios.command +++ b/tools/darwin/Support/copyframeworks-ios.command @@ -4,48 +4,47 @@ function check_dyloaded_depends { - b=$(find "$EXTERNAL_LIBS" -name $1 -print) - if [ -f "$b" ]; then + b=$(find "$EXTERNAL_LIBS" -name $1 -print) + if [ -f "$b" ]; then #echo "Processing $b" if [ ! -f "$TARGET_FRAMEWORKS/$(basename $b)" ]; then - echo " Packaging $b" - cp -f "$b" "$TARGET_FRAMEWORKS/" - chmod u+w "$TARGET_FRAMEWORKS/$(basename $b)" + echo " Packaging $b" + cp -f "$b" "$TARGET_FRAMEWORKS/" + chmod u+w "$TARGET_FRAMEWORKS/$(basename $b)" fi for a in $(otool -L "$b" | grep "$EXTERNAL_LIBS" | awk ' { print $1 } ') ; do - if [ -f "$a" ]; then - if [ ! -f "$TARGET_FRAMEWORKS/$(basename $a)" ]; then - echo " Packaging $a" - cp -f "$a" "$TARGET_FRAMEWORKS/" - chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" - install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$TARGET_FRAMEWORKS/$(basename $b)" - fi - fi + if [ -f "$a" ]; then + if [ ! -f "$TARGET_FRAMEWORKS/$(basename $a)" ]; then + echo " Packaging $a" + cp -f "$a" "$TARGET_FRAMEWORKS/" + chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" + install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$TARGET_FRAMEWORKS/$(basename $b)" + fi + fi done - fi + fi } function check_xbmc_dylib_depends { - REWIND="1" - while [ $REWIND = "1" ] - do + REWIND="1" + while [ $REWIND = "1" ] ; do let REWIND="0" for b in $(find "$1" -type f -name "$2" -print) ; do - #echo "Processing $b" - install_name_tool -id "$(basename $b)" "$b" - for a in $(otool -L "$b" | grep "$EXTERNAL_LIBS" | awk ' { print $1 } ') ; do - #echo " Packaging $a" - if [ ! -f "$TARGET_FRAMEWORKS/$(basename $a)" ]; then - echo " Packaging $a" - cp -f "$a" "$TARGET_FRAMEWORKS/" - chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" - let REWIND="1" - fi - install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$b" - done - done + #echo "Processing $b" + install_name_tool -id "$(basename $b)" "$b" + for a in $(otool -L "$b" | grep "$EXTERNAL_LIBS" | awk ' { print $1 } ') ; do + #echo " Packaging $a" + if [ ! -f "$TARGET_FRAMEWORKS/$(basename $a)" ]; then + echo " Packaging $a" + cp -f "$a" "$TARGET_FRAMEWORKS/" + chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" + let REWIND="1" + fi + install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$b" + done done + done } EXTERNAL_LIBS=$XBMC_DEPENDS @@ -64,15 +63,15 @@ mkdir -p "$TARGET_CONTENTS/AppData/AppHome" rm -rf "$TARGET_CONTENTS/Frameworks" mkdir -p "$TARGET_CONTENTS/Frameworks" -echo "Package $TARGET_BUILD_DIR/$APP_NAME" +echo "Package $TARGET_NAME" # Copy all of XBMC's dylib dependencies and rename their locations to inside the Framework -echo "Checking $TARGET_BINARY dylib dependencies" +echo "Checking $TARGET_NAME for dylib dependencies" for a in $(otool -L "$TARGET_BINARY" | grep "$EXTERNAL_LIBS" | awk ' { print $1 } ') ; do -echo " Packaging $a" -cp -f "$a" "$TARGET_FRAMEWORKS/" -chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" -install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$TARGET_BINARY" + echo " Packaging $a" + cp -f "$a" "$TARGET_FRAMEWORKS/" + chmod u+w "$TARGET_FRAMEWORKS/$(basename $a)" + install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$TARGET_BINARY" done echo "Package $EXTERNAL_LIBS/lib/python2.7" @@ -81,27 +80,21 @@ PYTHONSYNC="rsync -aq --exclude .DS_Store --exclude *.a --exclude *.exe --exclud ${PYTHONSYNC} "$EXTERNAL_LIBS/lib/python2.7" "$TARGET_FRAMEWORKS/lib/" rm -rf "$TARGET_FRAMEWORKS/lib/python2.7/config" -echo "Checking $TARGET_FRAMEWORKS/lib/python2.7 *.so for dylib dependencies" +echo "Checking python *.so for dylib dependencies" check_xbmc_dylib_depends "$TARGET_FRAMEWORKS"/lib/python2.7 "*.so" -echo "Checking $XBMC_HOME/system *.so for dylib dependencies" +echo "Checking system *.so for dylib dependencies" check_xbmc_dylib_depends "$XBMC_HOME"/system "*.so" -echo "Checking $XBMC_HOME/addons *.so for dylib dependencies" +echo "Checking addons *.so for dylib dependencies" check_xbmc_dylib_depends "$XBMC_HOME"/addons "*.so" -echo "Checking $XBMC_HOME/addons *.pvr for dylib dependencies" -check_xbmc_dylib_depends "$XBMC_HOME"/addons "*.pvr" - -echo "Checking $XBMC_HOME/addons *.xbs for dylib dependencies" -check_xbmc_dylib_depends "$XBMC_HOME"/addons "*.xbs" - echo "Checking xbmc/DllPaths_generated.h for dylib dependencies" for a in $(grep .dylib "$SRCROOT"/xbmc/DllPaths_generated.h | awk '{print $3}' | sed s/\"//g) ; do check_dyloaded_depends $a done -echo "Checking $TARGET_FRAMEWORKS for missing dylib dependencies" +echo "Checking $TARGET_NAME/Frameworks for missing dylib dependencies" REWIND="1" while [ $REWIND = "1" ] do diff --git a/tools/darwin/packaging/ios/mkdeb-ios.sh.in b/tools/darwin/packaging/ios/mkdeb-ios.sh.in index a638581b1d..45931cc037 100644 --- a/tools/darwin/packaging/ios/mkdeb-ios.sh.in +++ b/tools/darwin/packaging/ios/mkdeb-ios.sh.in @@ -7,6 +7,7 @@ SWITCH=`echo $1 | tr [A-Z] [a-z]` DIRNAME=`dirname $0` DSYM_TARGET_DIR=/Users/Shared/xbmc-depends/dSyms DSYM_FILENAME=@APP_NAME@.app.dSYM +ARM64=false if [ ${SWITCH:-""} = "debug" ]; then echo "Packaging Debug target for iOS" @@ -21,6 +22,11 @@ else exit 1 fi +# check if build is 64-bit +if [[ "$(lipo -info "$APP/@APP_NAME@" | awk '{print $NF}')" == "arm64" ]]; then + ARM64=true +fi + #copy bzip2 of dsym to xbmc-depends install dir if [ -d $DSYM ]; then if [ -d $DSYM_TARGET_DIR ]; then @@ -47,6 +53,7 @@ if [ -f "${XBMC_DEPENDS_ROOT}/buildtools-native/bin/dpkg-deb" ]; then fi PACKAGE=org.xbmc.@APP_NAME_LC@-ios +PACKAGE_ARM64="${PACKAGE}64" VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@ REVISION=0 @@ -54,8 +61,14 @@ REVISION=0 if [ "@APP_VERSION_TAG_LC@" != "" ]; then REVISION=$REVISION~@APP_VERSION_TAG_LC@ fi +# customize revision string +[ ! -z "$2" ] && REVISION="$2" ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb + +# package identifier for arm64 +$ARM64 && ARCHIVE=${PACKAGE_ARM64}_${VERSION}-${REVISION}_iphoneos-arm.deb + SIZE="$(du -s -k ${APP} | awk '{print $1}')" echo Creating $PACKAGE package version $VERSION revision $REVISION @@ -64,14 +77,23 @@ ${SUDO} rm -rf $DIRNAME/$ARCHIVE # create debian control file. mkdir -p $DIRNAME/$PACKAGE/DEBIAN -echo "Package: $PACKAGE" > $DIRNAME/$PACKAGE/DEBIAN/control +if [ $ARM64 ]; then + echo "Package: $PACKAGE_ARM64" > $DIRNAME/$PACKAGE/DEBIAN/control + echo "Name: @APP_NAME@-iOS (64-bit)" >> $DIRNAME/$PACKAGE/DEBIAN/control + echo "Depends: firmware (>= 7.0)" >> $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 "Depends: firmware (>= 5.1)" >> $DIRNAME/$PACKAGE/DEBIAN/control +fi echo "Priority: Extra" >> $DIRNAME/$PACKAGE/DEBIAN/control -echo "Name: @APP_NAME@-iOS" >> $DIRNAME/$PACKAGE/DEBIAN/control -echo "Depends: firmware (>= 5.1)" >> $DIRNAME/$PACKAGE/DEBIAN/control echo "Version: $VERSION-$REVISION" >> $DIRNAME/$PACKAGE/DEBIAN/control echo "Architecture: iphoneos-arm" >> $DIRNAME/$PACKAGE/DEBIAN/control echo "Installed-Size: $SIZE" >> $DIRNAME/$PACKAGE/DEBIAN/control -echo "Description: @APP_NAME@ Entertainment Center for 5.x iOS" >> $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 "Author: Team-@APP_NAME@" >> $DIRNAME/$PACKAGE/DEBIAN/control |