summaryrefslogtreecommitdiff
path: root/arch/iphoneos-arm/1443.00/strip
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-10-12 16:47:06 -1000
committerSam Bingner <sam@bingner.com>2018-10-12 16:47:06 -1000
commit24f6d59354df69788c96f26e8c046a50c383c886 (patch)
treeed2343230d45a634b15398dfa7a7e2c67a960aba /arch/iphoneos-arm/1443.00/strip
parent330f4f07f97d829f6337de5b20efb19e58bab319 (diff)
Build environment changes
Diffstat (limited to 'arch/iphoneos-arm/1443.00/strip')
-rw-r--r--arch/iphoneos-arm/1443.00/strip33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/iphoneos-arm/1443.00/strip b/arch/iphoneos-arm/1443.00/strip
new file mode 100644
index 000000000..fb6f928c1
--- /dev/null
+++ b/arch/iphoneos-arm/1443.00/strip
@@ -0,0 +1,33 @@
+export PATH=${PKG_BASE}/util:$PATH
+find "${PKG_DEST}" -type f \( -perm -0100 -o -name '*.dylib' -o -name '*.so' \) -print0 | while read -r -d $'\0' bin; do
+ ENTITLEMENT=""
+ case "$(file "${bin}")" in (\
+ *': Mach-O fat file with '*([0-9])' architecture' |\
+ *': '*(setuid |setgid )'Mach-O 64-bit executable arm64' \
+ )
+ ENTITLEMENT="${PKG_BASE}/arch/${PKG_ARCH}/${PKG_CFTARG}/entitlement.xml"
+ ;;
+ (\
+ *': Mach-O '?(64-bit )'dynamically linked shared library '@(acorn|arm64) |\
+ *': Mach-O '?(64-bit )'bundle '@(acorn|arm64) |\
+ *': '*(setuid |setgid )'Mach-O executable acorn' \
+ )
+ ;;
+ (*) continue
+ ;;
+ esac
+
+ if "${PKG_TARG}-otool" -hv "${bin}" | grep DYLIB_STUB &>/dev/null; then
+ continue; fi
+ if grep $'\xfa\xde\x0c\x01' "${bin}" &>/dev/null; then
+ continue; fi
+ if "${PKG_BASE}/util/ldid3" -e "${bin}" >/dev/null 2>&1; then
+ continue; fi
+
+ perms=$(stat -f %p "${bin}" | sed -e s/^1//)
+ chmod 755 "${bin}"
+
+ echo "${PKG_BASE}/util/ldid3" -S"${ENTITLEMENT}" "${bin}"
+ "${PKG_BASE}/util/ldid3" -S"${ENTITLEMENT}" "${bin}"
+ chmod "${perms}" "${bin}"
+done