[vlc-devel] [PATCH 2/2] package: apple: add bundle.sh script

Alexandre Janniaux ajanni at videolabs.io
Tue Jun 30 17:44:55 CEST 2020


Add a script to bundle the vlc-ios application with dynamic plugins
into an iOS application archive, that can then be signed and installed
manually.
---
 extras/package/apple/Info.plist | 81 +++++++++++++++++++++++++++++++++
 extras/package/apple/bundle.sh  | 57 +++++++++++++++++++++++
 2 files changed, 138 insertions(+)
 create mode 100644 extras/package/apple/Info.plist
 create mode 100755 extras/package/apple/bundle.sh

diff --git a/extras/package/apple/Info.plist b/extras/package/apple/Info.plist
new file mode 100644
index 00000000000..e1d8d28d7fc
--- /dev/null
+++ b/extras/package/apple/Info.plist
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>18E2034</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>vlccore</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.videolan.vlccore</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>vlccore</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>iPhoneOS</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>17B102</string>
+	<key>DTPlatformName</key>
+	<string>iphoneos</string>
+	<key>DTPlatformVersion</key>
+	<string>13.2</string>
+	<key>DTSDKBuild</key>
+	<string>17B102</string>
+	<key>DTSDKName</key>
+	<string>iphoneos13.2</string>
+	<key>DTXcode</key>
+	<string>1130</string>
+	<key>DTXcodeBuild</key>
+	<string>11C505</string>
+	<key>LSRequiresIPhoneOS</key>
+	<true/>
+	<key>MinimumOSVersion</key>
+	<string>9.0</string>
+	<key>UIDeviceFamily</key>
+	<array>
+		<integer>1</integer>
+		<integer>2</integer>
+	</array>
+	<key>UILaunchImages</key>
+	<array>
+		<dict>
+			<key>UILaunchImageMinimumOSVersion</key>
+			<string>7.0</string>
+			<key>UILaunchImageName</key>
+			<string>LaunchImage-700-568h</string>
+			<key>UILaunchImageOrientation</key>
+			<string>Portrait</string>
+			<key>UILaunchImageSize</key>
+			<string>{320, 568}</string>
+		</dict>
+	</array>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>arm64</string>
+	</array>
+	<key>UISupportedInterfaceOrientations</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+</dict>
+</plist>
diff --git a/extras/package/apple/bundle.sh b/extras/package/apple/bundle.sh
new file mode 100755
index 00000000000..1a38192f069
--- /dev/null
+++ b/extras/package/apple/bundle.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+
+set -eu
+
+readonly SCRIPT_DIR="$(cd "${BASH_SOURCE%/*}"; pwd)"
+readonly BUILD_DIR="$(cd "$1"; pwd)"
+
+APP="Payload/vlccore.app"
+IPA="vlccore_unsigned.ipa"
+
+# CONVERT_PLIST <input file> <output file>
+# Convert a plist file into binary1 format in order to put it
+# into an Apple bundle.
+CONVERT_PLIST()
+{
+    INPUT=$1
+    OUTPUT=$2
+    if [ which plutil > /dev/null 2>&1 ]; then
+        plutil -convert binary1 -o "$OUTPUT" -- "$INPUT"
+    else
+        plistutil -o "$OUTPUT" -i "$INPUT"
+    fi
+}
+
+# Cleanup previous archive
+rm -f "$IPA"
+rm -rf "Payload/"
+mkdir -p "$APP"
+
+# Find install_name tool in order to set rpath on executable
+INSTALL_NAME_TOOL=$(which install_name_tool || echo "")
+if [ -z "$INSTALL_NAME_TOOL" ]; then
+    echo "install_name_tool not found, aborting..."
+    exit 1
+fi
+
+# VLC core test binary compiled for iOS
+cp "${BUILD_DIR}/test/.libs/vlc-ios" "$APP/vlccore"
+${INSTALL_NAME_TOOL} "$APP/vlccore" -add_rpath "@executable_path/Frameworks"
+
+# Convert Info.plist from XML to binary
+CONVERT_PLIST "${SCRIPT_DIR}/Info.plist" "Payload/vlccore.app/Info.plist"
+
+# Set the bundle type
+echo "APPL????" > "$APP/PkgInfo"
+
+# Copy the dylib into the bundle, in Frameworks/. In order to ship on the
+# AppStore, each dylib should be bundled into a framework inside the
+# Frameworks/ directory, but since it is only designed for development usage
+# we can just put them there without further processing.
+mkdir -p "$APP/Frameworks"
+cp "${BUILD_DIR}/lib/.libs/libvlc.dylib" "$APP/Frameworks"
+cp "${BUILD_DIR}/src/.libs/libvlccore.dylib" "$APP/Frameworks"
+find "${BUILD_DIR}/modules/.libs/" -name "*.dylib" -exec cp {} "$APP/Frameworks" \;
+
+# Archive the bundle into a .ipa file.
+zip -r "$IPA" Payload
-- 
2.27.0



More information about the vlc-devel mailing list