Commit eb9b8288 authored by Felix Paul Kühne's avatar Felix Paul Kühne

MobileVLCKit: add build script for compilation and adapt xcodeproj accordingly

Note that this will break client apps like VLC for iOS
parent 75de502c
......@@ -9,4 +9,4 @@ MobileVLCKit/vlc-plugins.h
build
/vlc-unstable
DerivedData
MobileVLCKit/ImportedSources
......@@ -306,7 +306,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
PRODUCT_NAME = MobileVLCKit;
VALID_ARCHS = "armv7 i386 armv7s";
VLC_SRC_DIR = "$(PROJECT_DIR)/../vlc";
VLC_SRC_DIR = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc";
};
name = Debug;
};
......@@ -325,7 +325,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
PRODUCT_NAME = MobileVLCKit;
VALID_ARCHS = "armv7 i386 armv7s";
VLC_SRC_DIR = "$(PROJECT_DIR)/../vlc";
VLC_SRC_DIR = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc";
};
name = Release;
};
......
......@@ -14,7 +14,7 @@ popd > /dev/null
echo "PROJECT DIR = $PROJECT_DIR"
ARCH=$ARCHS
VLC_SRC_DIR="$PROJECT_DIR/../../vlc"
VLC_SRC_DIR="$PROJECT_DIR/ImportedSources/vlc"
if [ "$PLATFORM_NAME" = "iphoneos" ]; then
VLC_BUILD_DIR="$VLC_SRC_DIR/build-ios-OS/$CURRENT_ARCH"
......
......@@ -7,7 +7,7 @@
//
VLC_SRC_DIR=$(PROJECT_DIR)/../../..
VLC_SRC_DIR=$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc
VLC_PLATFORM[sdk=iphonesimulator*]=Simulator
VLC_PLATFORM[sdk=iphoneos*]=OS
VLC_INSTALL_DIR=$(VLC_SRC_DIR)/install-ios-$(VLC_PLATFORM)/$(CURRENT_ARCH)
......
#!/bin/sh
# Copyright (C) Pierre d'Herbemont, 2010
# Copyright (C) Felix Paul Kühne, 2012-2013
set -e
PLATFORM=iphoneos
SDK=7.0
SDK_MIN=6.1
VERBOSE=no
CONFIGURATION="Release"
NONETWORK=no
SKIPLIBVLCCOMPILATION=no
TESTEDHASH=2791a97f2
usage()
{
cat << EOF
usage: $0 [-s] [-v] [-k sdk]
OPTIONS
-k Specify which sdk to use (see 'xcodebuild -showsdks', current: ${SDK})
-v Be more verbose
-s Build for simulator
-d Enable Debug
-n Skip script steps requiring network interaction
-l Skip libvlc compilation
EOF
}
spushd()
{
pushd "$1" 2>&1> /dev/null
}
spopd()
{
popd 2>&1> /dev/null
}
info()
{
local green="\033[1;32m"
local normal="\033[0m"
echo "[${green}info${normal}] $1"
}
buildxcodeproj()
{
local target="$2"
if [ "x$target" = "x" ]; then
target="$1"
fi
info "Building $1 ($target, ${CONFIGURATION})"
local extra=""
if [ "$PLATFORM" = "Simulator" ]; then
extra="ARCHS=i386"
fi
xcodebuild -project "$1.xcodeproj" \
-target "$target" \
-sdk $PLATFORM$SDK \
-configuration ${CONFIGURATION} ${extra} \
IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} > ${out}
}
while getopts "hvsdnlk:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
v)
VERBOSE=yes
;;
s)
PLATFORM=iphonesimulator
;;
d) CONFIGURATION="Debug"
;;
n)
NONETWORK=yes
;;
l)
SKIPLIBVLCCOMPILATION=yes
;;
k)
SDK=$OPTARG
;;
?)
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))
out="/dev/null"
if [ "$VERBOSE" = "yes" ]; then
out="/dev/stdout"
fi
if [ "x$1" != "x" ]; then
usage
exit 1
fi
# Get root dir
spushd .
aspen_root_dir=`pwd`
spopd
info "Preparing build dirs"
mkdir -p MobileVLCKit/ImportedSources
spushd MobileVLCKit/ImportedSources
if [ "$NONETWORK" != "yes" ]; then
if ! [ -e vlc ]; then
git clone git://git.videolan.org/vlc/vlc-2.1.git vlc
info "Applying patches to vlc.git"
cd vlc
#git checkout -B localAspenBranch ${TESTEDHASH}
git am ../../patches/*.patch
if [ $? -ne 0 ]; then
git am --abort
info "Applying the patches failed, aborting git-am"
exit 1
fi
cd ..
else
cd vlc
git pull --rebase
cd ..
fi
fi
spopd
#
# Build time
#
info "Building"
spushd MobileVLCKit/ImportedSources
if [ "$SKIPLIBVLCCOMPILATION" != "yes" ]; then
spushd vlc/extras/package/ios
info "Building vlc"
args=""
if [ "$VERBOSE" = "yes" ]; then
args="${args} -v"
fi
if [ "$PLATFORM" = "iphonesimulator" ]; then
args="${args} -s"
./build.sh ${args} -k "${SDK}"
else
./build.sh -a armv7 ${args} -k "${SDK}" && ./build.sh -a armv7s ${args} -k "${SDK}"
fi
spopd
fi
spopd # MobileVLCKit/ImportedSources
buildxcodeproj MobileVLCKit "Aggregate static plugins"
buildxcodeproj MobileVLCKit "MobileVLCKit"
info "Build completed"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment