Skip to content

Commit

Permalink
Fixes for Xcode 4.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
Raptor399 committed Apr 18, 2012
1 parent f911e7c commit 8bbf735
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 26 deletions.
157 changes: 132 additions & 25 deletions contrib/build-pms-binaries.sh
Expand Up @@ -2,8 +2,8 @@
# #
# build-pms-osx.sh # build-pms-osx.sh
# #
# Version: 2.1.1 # Version: 2.1.2
# Last updated: 2012-04-09 # Last updated: 2012-04-18
# Authors: Patrick Atoon, Happy-Neko # Authors: Patrick Atoon, Happy-Neko
# #
# #
Expand Down Expand Up @@ -160,7 +160,8 @@ check_binary() {
It seems you are missing Xcode from Apple ("ant"), which is required to run this script. It seems you are missing Xcode from Apple ("ant"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
EOM EOM
else else
Expand All @@ -174,13 +175,76 @@ EOM
fi fi
exit;; exit;;


gcc|g++|make|autoconf|automake) gcc|g++|make|patch)
if is_osx; then if is_osx; then
cat >&2 << EOM cat >&2 << EOM
It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script. It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
EOM
else
cat >&2 << EOM
It seems you are missing gcc/g++ or make.
You can install them with following command on Debian based systems (Debian, Ubuntu, etc):
sudo apt-get install build-essential
EOM
fi
exit;;

autoconf|autoreconf)
if is_osx; then
cat >&2 << EOM
It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
You can download and install $BINARY with the following commands:
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.68.tar.gz
tar xzvf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure --prefix=/usr/local
make
sudo make install
EOM
else
cat >&2 << EOM
It seems you are missing autoconf.
You can install it with following command on Debian based systems (Debian, Ubuntu, etc):
sudo apt-get install autoconf
EOM
fi
exit;;

automake)
if is_osx; then
cat >&2 << EOM
It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
You can download and install $BINARY with the following commands:
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
EOM EOM
else else
Expand All @@ -200,7 +264,19 @@ EOM
It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script. It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
You can download and install $BINARY with the following commands:
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.4.tar.gz
tar xzvf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=/usr/local
make
sudo make install
sudo ln -s /usr/local/bin/libtoolize /usr/local/bin/glibtoolize
EOM EOM
else else
Expand All @@ -220,7 +296,8 @@ EOM
It seems you are missing Xcode from Apple ("mvn"), which is required to run this script. It seems you are missing Xcode from Apple ("mvn"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
EOM EOM
else else
Expand All @@ -240,7 +317,8 @@ EOM
It seems you are missing Xcode from Apple ("javac"), which is required to run this script. It seems you are missing Xcode from Apple ("javac"), which is required to run this script.
Please go to http://developer.apple.com/technologies/xcode.html, create a free Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
EOM EOM
else else
Expand Down Expand Up @@ -320,22 +398,23 @@ ANT=`check_binary ant`
GCC=`check_binary gcc` GCC=`check_binary gcc`
GPP=`check_binary g++` GPP=`check_binary g++`
JAVAC=`check_binary javac` JAVAC=`check_binary javac`
AUTOMAKE=`check_binary automake`
AUTOCONF=`check_binary autoconf`
LIBTOOL=`check_binary libtool` LIBTOOL=`check_binary libtool`
MAKE=`check_binary make` MAKE=`check_binary make`
MVN=`check_binary mvn` MVN=`check_binary mvn`
PATCH=`check_binary patch`
SED=`check_binary sed` SED=`check_binary sed`
TAR=`check_binary tar` TAR=`check_binary tar`
YASM=`check_binary yasm` YASM=`check_binary yasm`
UNZIP=`check_binary unzip` UNZIP=`check_binary unzip`


if is_osx; then if is_osx; then
GCC2=`check_binary gcc-4.2` GCC2=$GCC
HDID=`check_binary hdid` HDID=`check_binary hdid`
HDIUTIL=`check_binary hdiutil` HDIUTIL=`check_binary hdiutil`
else else
GCC2=$GCC GCC2=$GCC
AUTOMAKE=`check_binary automake`
AUTOCONF=`check_binary autoconf`
STRIP=`check_binary strip` STRIP=`check_binary strip`
PKG_CONFIG=`check_binary pkg-config` PKG_CONFIG=`check_binary pkg-config`
fi fi
Expand Down Expand Up @@ -387,14 +466,18 @@ exit_on_error() {
initialize() { initialize() {
WORKDIR=`pwd` WORKDIR=`pwd`


# Avoid having ".." in the path reference to avoid problems with symlinks
cd ..
PARENTDIR=`pwd`

# Directories for statically compiled libraries # Directories for statically compiled libraries
BUILD="$WORKDIR/../target/bin-tools/build" BUILD="$PARENTDIR/target/bin-tools/build"
SRC="$WORKDIR/../target/bin-tools/src" SRC="$PARENTDIR/target/bin-tools/src"
TARGET="$WORKDIR/../target/bin-tools/target" TARGET="$PARENTDIR/target/bin-tools/target"
createdir "$BUILD" createdir "$BUILD"
createdir "$SRC" createdir "$SRC"
createdir "$TARGET" createdir "$TARGET"

if is_linux; then if is_linux; then
THREADS=$(cat /proc/cpuinfo | grep processor | wc -l) THREADS=$(cat /proc/cpuinfo | grep processor | wc -l)
fi fi
Expand Down Expand Up @@ -445,13 +528,34 @@ set_flags() {
if is_osx; then if is_osx; then
# Minimum OSX version as target # Minimum OSX version as target
OSX_VERSION=10.6 OSX_VERSION=10.6

if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ]; then
# Xcode 4.3+
SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
else
# Xcode < 4.2
if [ -d /Developer/SDKs ]; then
SDK_PATH="/Developer/SDKs"
else
cat << EOM
It seems you are missing Xcode.
Please go to http://developer.apple.com/technologies/xcode.html, create a free
Apple developer account and download Xcode and install it. After installation,
install the "Command Line Tools" under "Preferences... > Downloads > Components".
EOM
exit;
fi
fi

CFLAGS="$CFLAGS -mmacosx-version-min=${OSX_VERSION}" CFLAGS="$CFLAGS -mmacosx-version-min=${OSX_VERSION}"
CFLAGS="$CFLAGS -isystem /Developer/SDKs/MacOSX${OSX_VERSION}.sdk" CFLAGS="$CFLAGS -isystem ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
CXXFLAGS="$CXXFLAGS -mmacosx-version-min=${OSX_VERSION}" CXXFLAGS="$CXXFLAGS -mmacosx-version-min=${OSX_VERSION}"
CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX${OSX_VERSION}.sdk" CXXFLAGS="$CXXFLAGS -isysroot ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
LDFLAGS="$LDFLAGS -mmacosx-version-min=${OSX_VERSION}" LDFLAGS="$LDFLAGS -mmacosx-version-min=${OSX_VERSION}"
LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX${OSX_VERSION}.sdk" LDFLAGS="$LDFLAGS -isysroot ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX${OSX_VERSION}.sdk" LDFLAGS="$LDFLAGS -Wl,-syslibroot,${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
fi fi


if [ "$1" != "" ]; then if [ "$1" != "" ]; then
Expand Down Expand Up @@ -671,7 +775,7 @@ build_ffmpeg() {
fi fi


# Apply SB patch that was used for the Windows version # Apply SB patch that was used for the Windows version
patch -p1 < ./../../../../contrib/mplayer-r34866-SB31-ffmpeg-58c25724.patch $PATCH -p1 < $WORKDIR/mplayer-r34866-SB31-ffmpeg-58c25724.patch
exit_on_error exit_on_error


$MAKE -j$THREADS $MAKE -j$THREADS
Expand Down Expand Up @@ -1229,7 +1333,7 @@ build_mplayer() {
# See https://svn.macports.org/ticket/30279 # See https://svn.macports.org/ticket/30279


# Apply SB patch that was used for the Windows version # Apply SB patch that was used for the Windows version
patch -p0 < ./../../../../contrib/mplayer-r34866-SB31.patch $PATCH -p0 < $WORKDIR/mplayer-r34866-SB31.patch
exit_on_error exit_on_error


# Theora and vorbis support seems broken in this revision, disable it for now # Theora and vorbis support seems broken in this revision, disable it for now
Expand All @@ -1248,11 +1352,11 @@ build_mplayer() {
export LDFLAGS="$LDFLAGS -O4 -fomit-frame-pointer -pipe" export LDFLAGS="$LDFLAGS -O4 -fomit-frame-pointer -pipe"


# Apply SB patch that was used for the Windows version # Apply SB patch that was used for the Windows version
patch -p0 < ./../../../../contrib/mplayer-r34866-SB31.patch $PATCH -p0 < $WORKDIR/mplayer-r34866-SB31.patch
exit_on_error exit_on_error


# mplayer configure patch for r34587-SB22 # mplayer configure patch for r34587-SB22
patch -p0 < ./../../../../contrib/mplayer-r34587-configure.patch $PATCH -p0 < $WORKDIR/mplayer-r34587-configure.patch
exit_on_error exit_on_error


# libvorbis support seems broken in this revision, disable it for now # libvorbis support seems broken in this revision, disable it for now
Expand Down Expand Up @@ -1379,9 +1483,11 @@ build_tsmuxer() {
if [ ! -d tsMuxeR_${VERSION_TSMUXER} ]; then if [ ! -d tsMuxeR_${VERSION_TSMUXER} ]; then
createdir tsMuxeR_${VERSION_TSMUXER} createdir tsMuxeR_${VERSION_TSMUXER}
# Nothing to build. Just open the disk image, copy the binary and detach the disk image # Nothing to build. Just open the disk image, copy the binary and detach the disk image
$HDID $SRC/tsMuxeR__${VERSION_TSMUXER}.dmg $HDID $SRC/tsMuxeR_${VERSION_TSMUXER}.dmg
exit_on_error exit_on_error

cp -f /Volumes/tsMuxeR/tsMuxerGUI.app/Contents/MacOS/tsMuxeR tsMuxeR_${VERSION_TSMUXER}/tsMuxeR cp -f /Volumes/tsMuxeR/tsMuxerGUI.app/Contents/MacOS/tsMuxeR tsMuxeR_${VERSION_TSMUXER}/tsMuxeR
exit_on_error
$HDIUTIL detach /Volumes/tsMuxeR $HDIUTIL detach /Volumes/tsMuxeR
fi fi
else else
Expand Down Expand Up @@ -1546,7 +1652,7 @@ fi
initialize initialize


# Build static libraries to link against # Build static libraries to link against
# build_yasm # for systems where YASM version is below 1.0.0 #build_yasm # for systems where YASM version is below 1.0.0
build_zlib build_zlib
build_bzip2 build_bzip2
build_expat build_expat
Expand All @@ -1566,6 +1672,7 @@ build_libdv
build_libmad build_libmad
build_libzen build_libzen
# Note: libmediainfo requires libzen to build # Note: libmediainfo requires libzen to build
# FIXME: problem building
build_libmediainfo build_libmediainfo
build_libpng build_libpng
build_libogg build_libogg
Expand Down
2 changes: 1 addition & 1 deletion contrib/download-pms-binaries-source.sh
Expand Up @@ -711,7 +711,7 @@ download_tsmuxer() {


if is_osx; then if is_osx; then
if [ ! -f tsMuxeR-${VERSION_TSMUXER}.dmg ]; then if [ ! -f tsMuxeR-${VERSION_TSMUXER}.dmg ]; then
$CURL --referer "http://www.videohelp.com/tools/tsMuxeR" -L http://www.videohelp.com/download/tsMuxeR__${VERSION_TSMUXER}.dmg > tsMuxeR__${VERSION_TSMUXER}.dmg $CURL --referer "http://www.videohelp.com/tools/tsMuxeR" -L http://www.videohelp.com/download/tsMuxeR_${VERSION_TSMUXER}.dmg > tsMuxeR_${VERSION_TSMUXER}.dmg
exit_on_error exit_on_error
fi fi
else else
Expand Down

0 comments on commit 8bbf735

Please sign in to comment.