adium 2652:c43023b7c7c9: Rebuilt mkalias from source as a univer...

commits at adium.im commits at adium.im
Mon Aug 31 12:21:25 UTC 2009


details:	http://hg.adium.im/adium/rev/c43023b7c7c9
revision:	2652:c43023b7c7c9
author:		Evan Schoenberg
date:		Mon Aug 31 07:26:41 2009 -0500

Rebuilt mkalias from source as a universal binary (was PPC only)
Subject: adium 2653:916332d9905e: Mergification

details:	http://hg.adium.im/adium/rev/916332d9905e
revision:	2653:916332d9905e
author:		Evan Schoenberg
date:		Mon Aug 31 07:29:19 2009 -0500

Mergification

diffs (truncated from 3795 to 1000 lines):

diff -r ae1a0c1173a3 -r 916332d9905e Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Tue Aug 18 15:41:28 2009 -0500
+++ b/Adium.xcodeproj/project.pbxproj	Mon Aug 31 07:29:19 2009 -0500
@@ -175,6 +175,7 @@
 		11D9156F0FFC0FEB00B39713 /* AIImageShackImageUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 11D915580FFC0E9C00B39713 /* AIImageShackImageUploader.m */; };
 		11D915720FFC100700B39713 /* AIGenericMultipartImageUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 11D915710FFC100700B39713 /* AIGenericMultipartImageUploader.m */; };
 		11E786810F8860210014612E /* AIJumpControlPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 11E7867F0F8860210014612E /* AIJumpControlPlugin.m */; };
+		11EC56FC1049E96F00C02587 /* AILeopardCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 1156F03D1049E83F002673FC /* AILeopardCompatibility.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		11EE1B4D0CDCFAF40097F246 /* oscar-adium.c in Sources */ = {isa = PBXBuildFile; fileRef = 11EE1B490CDCFAF40097F246 /* oscar-adium.c */; };
 		11EE1B4E0CDCFAF40097F246 /* oscar-adium.h in Headers */ = {isa = PBXBuildFile; fileRef = 11EE1B4A0CDCFAF40097F246 /* oscar-adium.h */; };
 		11EE1B4F0CDCFAF40097F246 /* ssl-openssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 11EE1B4B0CDCFAF40097F246 /* ssl-openssl.c */; };
@@ -1913,6 +1914,7 @@
 		1150A9AE0FBE491300E0BD31 /* tr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = tr; path = "Plugins/Purple Service/tr.lproj/ESIRCAccountView.nib"; sourceTree = "<group>"; };
 		1150A9AF0FBE491500E0BD31 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = "Plugins/Purple Service/zh_CN.lproj/ESIRCAccountView.nib"; sourceTree = "<group>"; };
 		1150A9B00FBE491700E0BD31 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = "Plugins/Purple Service/zh_TW.lproj/ESIRCAccountView.nib"; sourceTree = "<group>"; };
+		1156F03D1049E83F002673FC /* AILeopardCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AILeopardCompatibility.h; path = "Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h"; sourceTree = "<group>"; };
 		1163F0EA0F6C7A8300F12F5D /* AIURLShortenerPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIURLShortenerPlugin.h; path = ../../Source/AIURLShortenerPlugin.h; sourceTree = "<group>"; };
 		1163F0EB0F6C7A8300F12F5D /* AIURLShortenerPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIURLShortenerPlugin.m; path = ../../Source/AIURLShortenerPlugin.m; sourceTree = "<group>"; };
 		1164A90B0F7AD4AB00110AE4 /* AIContentTopic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIContentTopic.h; path = "Frameworks/Adium Framework/Source/AIContentTopic.h"; sourceTree = "<group>"; };
@@ -7493,6 +7495,7 @@
 				6334FF300F9C14BF003C77A9 /* Fun New Controls */,
 				6334FF050F9C14BF003C77A9 /* Fun New Classes */,
 				6334FF020F9C14BF003C77A9 /* Functions */,
+				1156F03D1049E83F002673FC /* AILeopardCompatibility.h */,
 			);
 			name = AIUtilities;
 			sourceTree = "<group>";
@@ -9189,6 +9192,7 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				11EC56FC1049E96F00C02587 /* AILeopardCompatibility.h in Headers */,
 				6334FFFF0F9C14C2003C77A9 /* AIFunctions.h in Headers */,
 				633400010F9C14C2003C77A9 /* JVMarkedScroller.h in Headers */,
 				633400030F9C14C2003C77A9 /* AIMutableOwnerArray.h in Headers */,
diff -r ae1a0c1173a3 -r 916332d9905e Dependencies/build.sh
--- a/Dependencies/build.sh	Tue Aug 18 15:41:28 2009 -0500
+++ b/Dependencies/build.sh	Mon Aug 31 07:29:19 2009 -0500
@@ -191,6 +191,105 @@
 }
 
 ##
+# xcompile <CFLAGS> <LDFLAGS> <configure command> <files to combine>
+#
+# Cycles through supported host configurations and builds, then lipo-ing them all together.
+xcompile() {
+	quiet mkdir "${ROOTDIR}/sandbox"
+	for (( i=0; i<${#HOSTS[@]}; i++ )) ; do
+		status "...configuring for ${HOSTS[i]}"
+		quiet mkdir "${ROOTDIR}/sandbox/root-${ARCHS[i]}"
+		export CFLAGS="${1} -arch ${ARCHS[i]} -DHAVE_SYMBOL_UNDERSCORE"
+		export LDFLAGS="${2} -arch ${ARCHS[i]}"
+		
+		${3} --host="${HOSTS[i]}" --build="${HOSTS[i]}" \
+			--prefix="${ROOTDIR}/sandbox/root-${ARCHS[i]}"
+		
+		status "...making and installing for ${HOSTS[i]}"
+		make -j $NUMBER_OF_CORES
+		make install
+		make clean
+	done
+	
+	# create universal
+	for FILE in ${@:4} ; do
+		local lipoFiles=""
+		for ARCH in ${ARCHS[@]} ; do
+			lipoFiles="${lipoFiles} -arch ${ARCH} ${ROOTDIR}/sandbox/root-${ARCH}/${FILE}"
+		done
+		status "combine ${lipoFiles} to build/${FILE}"
+		lipo -create ${lipoFiles} -output "${ROOTDIR}/build/${FILE}"
+	done
+	
+	#copy headers and pkgconf files
+	local files="${ROOTDIR}/sandbox/root-${ARCHS[0]}/include/*"
+	for f in ${files} ; do
+		cp -R ${f} "${ROOTDIR}/build/include"
+	done
+	
+	local files="${ROOTDIR}/sandbox/root-${ARCHS[0]}/lib/pkgconfig/*"
+	for f in ${files} ; do
+		status "patching pkgconfig file: ${f}"
+		local basename=`basename ${f}`
+		local SEDREP=`echo $ROOTDIR | awk '{gsub("\\\\\/", "\\\\\\/");print}'`
+		local SEDPAT="s/prefix=.*/prefix=${SEDREP}\\/build/"
+		sed -e "${SEDPAT}" "${f}" > "${ROOTDIR}/build/lib/pkgconfig/${basename}"
+	done
+	quiet rm -rf "${ROOTDIR}/sandbox"
+}
+##
+# xconfigure <CFLAGS> <LDFLAGS> <configure command> <headers to mux>
+#
+# Cycles through supported host configurations and muxes platform-dependant
+# headers.
+# This ensures that we don't have type mismatches and compile time overflows.
+xconfigure() {
+	for (( i=0; i<${#HOSTS[@]}; i++ )) ; do
+		status "...for ${HOSTS[i]}"
+		export CFLAGS="${1} -arch ${ARCHS[i]}"
+		export LDFLAGS="${2} -arch ${ARCHS[i]}"
+		CONFIG_CMD="${3} --host=${HOSTS[i]}"
+		${CONFIG_CMD}
+		
+		for FILE in ${@:4} ; do
+			local ext=${FILE##*.}
+			local base=${FILE:0:${#FILE}-${#ext}-1}
+			mv ${FILE} ${base}-${ARCHS[i]}.${ext}
+		done
+	done
+	
+	# reconfigure *again* to set C and LD Flags right
+	# Yes, it's an ugly hack, and should probably be replaced with
+	# find and a sed script.
+	status "...for universal build"
+	export CFLAGS="${1} ${ARCH_FLAGS}"
+	export LDFLAGS="${2} ${ARCH_FLAGS}"
+	local self_host=`gcc -dumpmachine`
+	${3}
+	
+	# mux headers
+	for FILE in ${@:4} ; do
+		status "Muxing ${FILE}..."
+		local ext=${FILE##*.}
+		local base=${FILE:0:${#FILE}-${#ext}-1}
+		quiet rm ${FILE}
+		for (( i=0; i<${#ARCHS[@]}; i++ )) ; do
+			status "...for ${ARCHS[i]}"
+			if [[ $i == 0 ]] ; then
+				echo "#if defined (__${ARCHS[i]}__)" > ${FILE}
+			else
+				echo "#elif defined (__${ARCHS[i]}__)" >> ${FILE}
+			fi
+			cat ${base}-${ARCHS[i]}.${ext} >> ${FILE}
+		done
+		echo "#else" >> ${FILE}
+		echo "#error This isn't a recognized platform." >> ${FILE}
+		echo "#endif" >> ${FILE} 
+		status "...${FILE} muxed"
+	done	
+}
+
+##
 # pkg-config
 #
 # We only need a native pkg-config, so no worries about making it a Universal
@@ -228,11 +327,16 @@
 	
 	if needsconfigure $@; then
 		status "Configuring gettext"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" ./configure \
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" ./configure \
 			--prefix="$ROOTDIR/build" \
+			--disable-java \
 			--disable-static \
 			--enable-shared \
 			--disable-dependency-tracking
+		#xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
+		#	"${ROOTDIR}/source/gettext/gettext-tools/config.h" \
+		#	"${ROOTDIR}/source/gettext/gettext-runtime/config.h" \
+		#	"${ROOTDIR}/source/gettext/gettext-runtime/libasprintf/config.h"
 	fi
 	
 	status "Building and installing gettext"
@@ -267,15 +371,18 @@
 	
 	if needsconfigure $@; then
 		status "Configuring glib"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS -lintl" \
-			MSGFMT="$ROOTDIR/build/bin/msgfmt" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
-			./configure \
-				--prefix="$ROOTDIR/build" \
+		export MSGFMT="${ROOTDIR}/build/bin/msgfmt"
+		CONFIG_CMD="./configure \
+				--prefix=$ROOTDIR/build \
 				--disable-static \
 				--enable-shared \
 				--with-libiconv=native \
-				--disable-dependency-tracking
+				--disable-fam \
+				--disable-dependency-tracking"
+		xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS} -lintl" "${CONFIG_CMD}" \
+			"${ROOTDIR}/source/glib/config.h" \
+			"${ROOTDIR}/source/glib/gmodule/gmoduleconf.h" \
+			"${ROOTDIR}/source/glib/glibconfig.h"
 	fi
 	
 	status "Building and installing glib"
@@ -294,7 +401,7 @@
 #
 build_meanwhile() {
 	prereq "meanwhile" \
-		"http://dl.sf.net/sourceforge/meanwhile/meanwhile-1.0.2.tar.gz"
+		"http://dl.sourceforge.net/sourceforge/meanwhile/meanwhile-1.0.2.tar.gz"
 	
 	quiet pushd "$ROOTDIR/source/meanwhile"
 	
@@ -320,8 +427,7 @@
 		rm -f libtool
 		
 		status "Configuring Meanwhile"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
 			GLIB_LIBS="$ROOTDIR/build/lib" \
 			GLIB_CFLAGS="-I$ROOTDIR/build/include/glib-2.0 \
 			             -I$ROOTDIR/build/lib/glib-2.0/include" \
@@ -335,7 +441,7 @@
 	fi
 	
 	status "Building and installing Meanwhile"
-	CFLAGS="$FLAGS" LDFLAGS="$FLAGS" make -j $NUMBER_OF_CORES
+	CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" make -j $NUMBER_OF_CORES
 	make install
 	
 	# Undo all the patches
@@ -359,11 +465,14 @@
 	
 	if needsconfigure $@; then
 		status "Configuring Gadu-Gadu"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" ./configure \
-			--prefix="$ROOTDIR/build" \
+		CONFIG_CMD="./configure \
+			--prefix=$ROOTDIR/build \
 			--disable-static \
 			--enable-shared \
-			--disable-dependency-tracking
+			--disable-dependency-tracking"
+		xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
+			"${ROOTDIR}/source/gadu-gadu/config.h" \
+			"${ROOTDIR}/source/gadu-gadu/include/libgadu.h"
 	fi
 	
 	status "Building and installing Gadu-Gadu"
@@ -390,8 +499,7 @@
 	
 	if needsconfigure $@; then
 		status "Configuring SIPE"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
 			./configure \
 				--prefix="$ROOTDIR/build"
 				--disable-dependency-tracking
@@ -420,8 +528,7 @@
 	
 	if needsconfigure $@; then
 		status "Configuring Gfire"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
 			./configure \
 				--prefix="$ROOTDIR/build" \
 				--disable-dependency-tracking
@@ -457,6 +564,37 @@
 }
 
 ##
+# json-glib
+#
+build_jsonglib() {
+	prereq "json-glib" \
+		"http://folks.o-hand.com/~ebassi/sources/json-glib-0.6.2.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/json-glib"
+	
+	if needsconfigure $@; then
+		status "Configuring json-glib"
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
+			GLIB_LIBS="$ROOTDIR/build/lib" \
+			GLIB_CFLAGS="-I$ROOTDIR/build/include/glib-2.0 \
+			             -I$ROOTDIR/build/lib/glib-2.0/include" \
+			./configure \
+			--prefix="$ROOTDIR/build" \
+			--disable-dependency-tracking
+	fi
+	
+	status "Building and installing json-glib"
+	make -j $NUMBER_OF_CORES
+	make install
+	
+	# C'mon, why do you make me do this?
+	ln -fs "$ROOTDIR/build/include/json-glib-1.0/json-glib" \
+		"$ROOTDIR/build/include/json-glib"
+	
+	quiet popd
+}
+
+##
 # fetch_libpurple
 #
 fetch_libpurple() {
@@ -466,8 +604,8 @@
 		
 		status "Pulling latest changes to libpurple"
 		cd "im.pidgin.adium"
-		mtn pull
-		mtn update
+		$MTN pull
+		$MTN update
 		
 	else
 		
@@ -481,13 +619,13 @@
 		bzip2 -d "pidgin.mtn.bz2"
 	
 		status "Migrating database to new schema"
-		mtn db -d "pidgin.mtn" migrate
+		$MTN db -d "pidgin.mtn" migrate
 	
 		status "Pulling updates to monotone database"
-		mtn -d "pidgin.mtn" pull --set-default "mtn.pidgin.im" "im.pidgin.*"
+		$MTN -d "pidgin.mtn" pull --set-default "mtn.pidgin.im" "im.pidgin.*"
 	
-		status "Checking out im.pidgin.adium branch"
-		mtn -d "pidgin.mtn" co -b "im.pidgin.adium" .
+		status "Checking out im.pidgin.adium.1-4 branch"
+		$MTN -d "pidgin.mtn" co -b "im.pidgin.adium.1-4" .
 	
 	fi
 	
@@ -516,7 +654,8 @@
 	#    $ nm -arch x86_64 /usr/lib/libkrb4.dylib | grep krb_rd_req
 	# So, only enable it on Snow Leopard
 	if [ "$(sysctl -b kern.osrelease | awk -F '.' '{ print $1}')" -ge 10 ]; then
-		KERBEROS="--with-krb4"
+		#KERBEROS="--with-krb4"
+		KERBEROS=""
 	else
 		warning "Kerberos support is disabled."
 		KERBEROS=""
@@ -524,22 +663,16 @@
 	
 	if needsconfigure $@; then
 		status "Configuring libpurple"
-		CFLAGS="$FLAGS -I/usr/include/kerberosIV \
-		       -DHAVE_SSL -DHAVE_OPENSSL -fno-common" \
-			ACLOCAL_FLAGS="-I $ROOTDIR/build/share/aclocal" \
-				PATH="$ROOTDIR/build/bin:$PATH" \
-			LDFLAGS="$FLAGS -lsasl2" \
-			PATH="$ROOTDIR/build/bin:$PATH" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
-			LIBXML_CFLAGS="-I/usr/include/libxml2" \
-			LIBXML_LIBS="-lxml2" \
-			GADU_CFLAGS="-I$ROOTDIR/build/include" \
-			GADU_LIBS="-lgadu" \
-			MEANWHILE_CFLAGS="-I$ROOTDIR/build/include/meanwhile \
-			                  -I$ROOTDIR/build/include/glib-2.0 \
-			                  -I$ROOTDIR/build/lib/glib-2.0/include" \
-			MEANWHILE_LIBS="-lmeanwhile -lglib-2.0 -liconv" \
-			./autogen.sh \
+		export ACLOCAL_FLAGS="-I $ROOTDIR/build/share/aclocal"
+		export LIBXML_CFLAGS="-I/usr/include/libxml2"
+		export LIBXML_LIBS="-lxml2"
+		export GADU_CFLAGS="-I$ROOTDIR/build/include"
+		export GADU_LIBS="-lgadu"
+		export MEANWHILE_CFLAGS="-I$ROOTDIR/build/include/meanwhile \
+			-I$ROOTDIR/build/include/glib-2.0 \
+			-I$ROOTDIR/build/lib/glib-2.0/include"
+		export MEANWHILE_LIBS="-lmeanwhile -lglib-2.0 -liconv"
+		CONFIG_CMD="./autogen.sh \
 				--disable-dependency-tracking \
 				--disable-gtkui \
 				--disable-consoleui \
@@ -548,15 +681,23 @@
 				--disable-static \
 				--enable-shared \
 				--enable-cyrus-sasl \
-				--prefix="$ROOTDIR/build" \
-				--with-static-prpls="$PROTOCOLS" \
+				--prefix=$ROOTDIR/build \
+				--with-static-prpls=$PROTOCOLS \
 				--disable-plugins \
 				--disable-gstreamer \
 				--disable-avahi \
 				--disable-dbus \
 				--enable-gnutls=no \
 				--enable-nss=no \
-				"$KERBEROS"
+				--disable-vv \
+				--disable-idn \
+				$KERBEROS"
+		xconfigure "$BASE_CFLAGS -I/usr/include/kerberosIV -DHAVE_SSL \
+			        -DHAVE_OPENSSL -fno-common" \
+			"$BASE_LDFLAGS -lsasl2 -ljson-glib-1.0" \
+			"${CONFIG_CMD}" \
+			"${ROOTDIR}/source/im.pidgin.adium/libpurple/purple.h" \
+			"${ROOTDIR}/source/im.pidgin.adium/config.h"
 	fi
 	
 	status "Building and installing libpurple"
@@ -587,6 +728,9 @@
 	quiet popd
 }
 
+##
+# xml2
+#
 build_libxml2() {
 	prereq "xml2" \
 		"ftp://xmlsoft.org:21//libxml2/libxml2-sources-2.7.3.tar.gz"
@@ -595,9 +739,7 @@
 	
 	if needsconfigure $@; then
 		status "Configuring xml2"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
-			PKG_CONFIG_PATH="$ROOTDIR/build/lib/pkgconfig:/usr/lib/pkgconfig" \
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
 			./configure \
 				--prefix="$ROOTDIR/build" \
 				--with-python=no \
@@ -611,41 +753,138 @@
 	quiet popd
 }
 
+
 ##
-# gstreamer plugins
-#
-build_gst_plugins() {
+# liboil
+# liboil needs special threatment.  Rather than placing platform specific code
+# in a ifdef, it sequesters it by directory and invokes a makefile.  woowoo.
+build_liboil() {
 	prereq "oil" \
 		"http://liboil.freedesktop.org/download/liboil-0.3.16.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/oil"
+	
+	status "Cross-comiling oil..."
+	CONFIG_CMD="./configure \
+				--disable-dependency-tracking"
+	xcompile "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
+		"lib/liboil-0.3.0.dylib" \
+		"lib/liboil-0.3.a" \
+		"lib/liboil-0.3.la" \
+		"bin/oil-bugreport"
+
+	status "...done cross-compiling oil"
+	
+	quiet popd
+}
+
+##
+# gst-plugins-base
+#
+build_gst_plugins_base() {
 	prereq "gst-plugins-base" \
 		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-0.10.23.tar.gz"
-	prereq "gst-plugins-good" \
-		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-good-0.10.15.tar.gz"
-	prereq "gst-plugins-bad" \
-		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-bad-0.10.13.tar.gz"
-	prereq "gst-plugins-farsight" \
-		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-farsight-0.12.11.tar.gz"
-
-	quiet pushd "$ROOTDIR/source/oil"
+	
+	quiet pushd "$ROOTDIR/source/gst-plugins-base"
 	
 	if needsconfigure $@; then
-		status "Configuring oil"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
-			PKG_CONFIG_PATH="$ROOTDIR/build/lib/pkgconfig:/usr/lib/pkgconfig" \
+		status "Configuring gst-plugins-base"
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
 			./configure \
 				--prefix="$ROOTDIR/build" \
 				--disable-dependency-tracking
 	fi
 	
-	status "Building and installing gstreamer"
-	warning "Building too much! Patch the Makefile"
+	status "Building and installing gst-plugins-base"
 	make -j $NUMBER_OF_CORES
 	make install
 	
 	quiet popd
 }
 
+##
+# gst-plugins-good
+#
+build_gst_plugins_good() {
+	prereq "gst-plugins-good" \
+		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-good-0.10.15.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/gst-plugins-good"
+	
+	if needsconfigure $@; then
+		status "Configuring gst-plugins-good"
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
+			./configure \
+				--prefix="$ROOTDIR/build" \
+				--disable-aalib \
+				--disable-dependency-tracking
+	fi
+	
+	status "Building and installing gst-plugins-good"
+	make -j $NUMBER_OF_CORES
+	make install
+	
+	quiet popd
+}
+
+##
+# gst-plugins-bad
+#
+build_gst_plugins_bad() {
+	prereq "gst-plugins-bad" \
+		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-bad-0.10.13.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/gst-plugins-bad"
+	
+	if needsconfigure $@; then
+		status "Configuring gst-plugins-bad"
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
+			./configure \
+				--prefix="$ROOTDIR/build" \
+				--disable-dependency-tracking
+	fi
+	
+	status "Building and installing gst-plugins-bad"
+	make -j $NUMBER_OF_CORES
+	make install
+	
+	quiet popd
+}
+
+##
+# gst-plugins-farsight
+#
+build_gst_plugins_farsight() {
+	prereq "gst-plugins-farsight" \
+		"http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-farsight-0.12.11.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/gst-plugins-farsight"
+	
+	if needsconfigure $@; then
+		status "Configuring gst-plugins-farsight"
+		CFLAGS="$ARCH_CFLAGS" LDFLAGS="$ARCH_LDFLAGS" \
+			./configure \
+				--prefix="$ROOTDIR/build" \
+				--disable-dependency-tracking
+	fi
+	
+	status "Building and installing gst-plugins-farsight"
+	make -j $NUMBER_OF_CORES
+	make install
+	
+	quiet popd
+}
+
+##
+# gstreamer plugins
+#
+build_gst_plugins() {
+	build_liboil $@
+#	build_gst_plugins_base $@
+#	build_gst_plugins_good $@
+#	build_gst_plugins_bad $@
+#	build_gst_plugins_farsight $@
+}
 
 ##
 # gstreamer
@@ -660,12 +899,12 @@
 	
 	if needsconfigure $@; then
 		status "Configuring gstreamer"
-		CFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
-			PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" \
-			PKG_CONFIG_PATH="$ROOTDIR/build/lib/pkgconfig:/usr/lib/pkgconfig" \
-			./configure \
-				--prefix="$ROOTDIR/build" \
-				--disable-dependency-tracking
+		CONFIG_CMD="./configure \
+				--prefix=$ROOTDIR/build \
+				--disable-dependency-tracking"
+		xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
+			"$ROOTDIR/source/gstreamer/gst/gstconfig.h" \
+			"$ROOTDIR/source/gstreamer/config.h"
 	fi
 	
 	status "Building and installing gstreamer"
@@ -675,10 +914,9 @@
 	
 	quiet popd
 	
-	build_gst_plugins
+	build_gst_plugins $@
 }
 
-
 ##
 # make_po_files
 #
@@ -700,11 +938,40 @@
 	exit 1
 fi
 
+TARGET_BASE="apple-darwin10"
+
+# Arrays for archs and host systems, sometimes an -arch just isnt enough!
+ARCHS=( "x86_64" "i386" "ppc" )
+HOSTS=( "x86_64-${TARGET_BASE}" "i686-${TARGET_BASE}" "powerpc-${TARGET_BASE}" )
+
+SDK_ROOT="/Developer/SDKs/MacOSX10.5.sdk"
+MIN_OS_VERSION="10.5"
 # The basic linker/compiler flags we'll be referring to
-FLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk \
-       -arch i386 -arch x86_64 -arch ppc \
-       -I$ROOTDIR/build/include \
-       -L$ROOTDIR/build/lib"
+BASE_CFLAGS="-isysroot $SDK_ROOT \
+	-mmacosx-version-min=$MIN_OS_VERSION \
+	-I$ROOTDIR/build/include \
+	-L$ROOTDIR/build/lib"
+BASE_LDFLAGS="-mmacosx-version-min=$MIN_OS_VERSION \
+	-Wl,-syslibroot,$SDK_ROOT \
+	-Wl,-headerpad_max_install_names \
+	-I$ROOTDIR/build/include \
+	-L$ROOTDIR/build/lib"
+
+ARCH_FLAGS=""
+for ARCH in ${ARCHS[@]} ; do
+	ARCH_FLAGS="${ARCH_FLAGS} -arch ${ARCH}"
+done
+
+ARCH_CFLAGS="${BASE_CFLAGS} ${ARCH_FLAGS}"
+ARCH_LDFLAGS="${BASE_LDFLAGS} ${ARCH_FLAGS}"
+
+# Ok, so we keep running into issues where MacPorts will volunteer to supply
+# dependencies that we want to build ourselves. On the other hand, maybe we
+# rely on MacPorts for stuff like monotone.
+MTN=`which mtn`
+export PATH=$ROOTDIR/build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Developer/usr/bin:/Developer/usr/sbin
+export PKG_CONFIG="$ROOTDIR/build/bin/pkg-config"
+export PKG_CONFIG_PATH="$ROOTDIR/build/lib/pkgconfig:/usr/lib/pkgconfig"
 
 # Make the source and build directories while we're here
 quiet mkdir "source"
@@ -719,9 +986,11 @@
 build_gadugadu $@
 
 build_intltool $@
-build_libpurple $@
+build_jsonglib $@
 
-#build_gstreamer $@
+build_gstreamer $@
+
+#build_libpurple $@
 
 #build_sipe $@
 #build_gfire $@
diff -r ae1a0c1173a3 -r 916332d9905e Dependencies/patches/glib-Makefile.in.diff
--- a/Dependencies/patches/glib-Makefile.in.diff	Tue Aug 18 15:41:28 2009 -0500
+++ b/Dependencies/patches/glib-Makefile.in.diff	Mon Aug 31 07:29:19 2009 -0500
@@ -1,5 +1,5 @@
---- Makefile.in.orig	2009-05-16 22:53:59.000000000 -0400
-+++ Makefile.in	2009-05-16 22:53:59.000000000 -0400
+--- Makefile.in.orig	2009-08-30 04:31:36.000000000 -0400
++++ Makefile.in	2009-08-30 04:33:02.000000000 -0400
 @@ -346,7 +346,7 @@
  	gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in
  TEST_PROGS = 
@@ -9,3 +9,12 @@
  DIST_SUBDIRS = $(SUBDIRS) build
  bin_SCRIPTS = glib-gettextize
  AM_CPPFLAGS = \
+@@ -1016,7 +1016,7 @@
+ 	@if test -f glibconfig.h; then :; \
+ 	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
+ stamp-gc-h: config.status
+-	cd $(top_builddir) && $(SHELL) ./config.status glibconfig.h
++	cd $(top_builddir)
+ 	echo timestamp > stamp-gc-h
+ 
+ ChangeLog:
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.h	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.h	Mon Aug 31 07:29:19 2009 -0500
@@ -9,5 +9,6 @@
 @interface NSApplication (AIApplicationAdditions)
 
 - (NSString *)applicationVersion;
+- (BOOL)isOnSnowLeopardOrBetter;
 
 @end
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.m	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.m	Mon Aug 31 07:29:19 2009 -0500
@@ -14,4 +14,15 @@
 	return [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];
 }
 
+//Make sure the version number defines exist; when compiling in 10.5, NSAppKitVersionNumber10_5 isn't defined 
+#ifndef NSAppKitVersionNumber10_5
+#define NSAppKitVersionNumber10_5 949
+#endif 
+
+- (BOOL)isOnSnowLeopardOrBetter
+{
+	return (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5);
+}
+
+
 @end
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h	Mon Aug 31 07:29:19 2009 -0500
@@ -0,0 +1,45 @@
+/*
+ *  AILeopardCompatibility.h
+ *  Adium
+ *
+ *  Created by Zachary West on 2009-08-29.
+ *  Copyright 2009  . All rights reserved.
+ *
+ */
+
+#ifndef AILeopardCompatibility
+#define AILeopardCompatibility
+
+#import <AvailabilityMacros.h>
+
+#ifndef MAC_OS_X_VERSION_10_6
+#define MAC_OS_X_VERSION_10_6 1060
+#endif //ndef MAC_OS_X_VERSION_10_6
+
+#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED
+
+#ifdef __OBJC__
+ at interface NSTextView(NSTextViewLeopardMethods)
+- (void)setAutomaticDataDetectionEnabled:(BOOL)flag;
+- (BOOL)isAutomaticDataDetectionEnabled;
+- (void)toggleAutomaticDataDetection:(id)sender;
+
+- (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag;
+- (BOOL)isAutomaticDashSubstitutionEnabled;
+- (void)toggleAutomaticDashSubstitution:(id)sender;
+
+- (void)setAutomaticTextReplacementEnabled:(BOOL)flag;
+- (BOOL)isAutomaticTextReplacementEnabled;
+- (void)toggleAutomaticTextReplacement:(id)sender;
+
+- (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag;
+- (BOOL)isAutomaticSpellingCorrectionEnabled;
+- (void)toggleAutomaticSpellingCorrection:(id)sender;
+ at end
+#endif
+
+#else //Not compiling for 10.6
+
+#endif //MAC_OS_X_VERSION_10_6
+
+#endif //AILeopardCompatibility
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m
--- a/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m	Mon Aug 31 07:29:19 2009 -0500
@@ -166,7 +166,7 @@
 			
 			//Find the object with the largest int value
 			for (index = 0;index < count;index++) {
-				int	value = [[contentArray objectAtIndex:index] intValue];
+				int	value = [[contentArray objectAtIndex:index] integerValue];
 				
 				if (value > currentMax) {
 					currentMax = value;
@@ -179,7 +179,7 @@
 			
 			return currentMax;
 		} else {
-			return [[contentArray objectAtIndex:0] intValue];
+			return [[contentArray objectAtIndex:0] integerValue];
 		}
 	}
 	return 0;
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIStringAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIStringAdditions.h	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIStringAdditions.h	Mon Aug 31 07:29:19 2009 -0500
@@ -53,6 +53,8 @@
 - (NSString *)stringByUnescapingFromXMLWithEntities:(NSDictionary *)entities;
 
 - (NSString *)stringByEscapingForShell;
+- (NSString *)stringByEscapingForRegexp;
+
 //- (BOOL)isURLEncoded;
 
 - (NSString *)stringByAddingPercentEscapesForAllCharacters;
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIStringAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Mon Aug 31 07:29:19 2009 -0500
@@ -27,6 +27,43 @@
 
 #endif //ndef BSD_LICENSE_ONLY
 
+enum characterNatureMask {
+	whitespaceNature = (1 << 0), //space + \t\n\r\f\a 
+	shellUnsafeNature = (1 << 1), //backslash + !$`"'
+	regexpUnsafeNature = (1 << 2), //backslash + |.*+?{}()$^
+};
+static const enum characterNatureMask characterNature[USHRT_MAX+1] = {
+	['\a'] = whitespaceNature,
+	['\t'] = whitespaceNature,
+	['\n'] = whitespaceNature,
+	['\v'] = whitespaceNature,
+	['\f'] = whitespaceNature,
+	['\r'] = whitespaceNature,
+	[' ']  = whitespaceNature,
+
+	['\''] = shellUnsafeNature,
+	['"']  = shellUnsafeNature,
+	['`']  = shellUnsafeNature,
+	['!']  = shellUnsafeNature,
+	['&']  = shellUnsafeNature,
+
+	['\\'] = shellUnsafeNature | regexpUnsafeNature,
+	['$']  = shellUnsafeNature | regexpUnsafeNature,
+	['|']  = shellUnsafeNature | regexpUnsafeNature,
+			
+	['/']  = regexpUnsafeNature,
+	['.']  = regexpUnsafeNature,
+	['*']  = regexpUnsafeNature,
+	['+']  = regexpUnsafeNature,
+	['?']  = regexpUnsafeNature,
+	['{']  = regexpUnsafeNature,
+	['}']  = regexpUnsafeNature,
+	['(']  = regexpUnsafeNature,
+	[')']  = regexpUnsafeNature,
+	['[']  = regexpUnsafeNature,
+	['^']  = regexpUnsafeNature,
+};
+
 enum {
 	LINE_FEED = '\n',
 	FORM_FEED = '\f',
@@ -96,18 +133,11 @@
 		if ([[error domain] isEqualToString:NSCocoaErrorDomain]) {
 			int		errorCode = [error code];
 
-			//XXX - I'm sure these constants are defined somewhere, but I can't find them. -eds
-			if (errorCode == 260) {
-				//File not found.
+			if (errorCode == NSFileReadNoSuchFileError) {
 				string = nil;
 				handled = YES;
 
-			} else if (errorCode == 261) {
-				/* Reason: File could not be opened using text encoding Unicode (UTF-8).
-				 * Description: Text encoding Unicode (UTF-8) is not applicable.
-				 *
-				 * We couldn't read the file as UTF8.  Let the system try to determine the encoding.
-				 */
+			} else if (errorCode == NSFileReadInapplicableStringEncodingError) {
 				NSError				*newError = nil;
 
 				string = [self stringWithContentsOfFile:path
@@ -524,51 +554,8 @@
 
 #ifndef BSD_LICENSE_ONLY
 
-enum characterNatureMask {
-	whitespaceNature = 0x1, //space + \t\n\r\f\a 
-	shellUnsafeNature, //backslash + !$`"'
-};
-static enum characterNatureMask characterNature[USHRT_MAX+1] = {
-	//this array is initialised such that the space character (0x20)
-	//	does not have the whitespace nature.
-	//this was done for brevity, as the entire array is bzeroed and then
-	//	properly initialised in -stringByEscapingForShell below.
-	0,0,0,0, 0,0,0,0, //0x00..0x07
-	0,0,0,0, 0,0,0,0, //0x08..0x0f
-	0,0,0,0, 0,0,0,0, //0x10..0x17
-	0,0,0, //0x18..0x20
-};
-
 - (NSString *)stringByEscapingForShell
 {
-	if (!(characterNature[' '] & whitespaceNature)) {
-		//if space doesn't have the whitespace nature, clearly we need to build the nature array.
-
-		//first, set all characters to zero.
-		bzero(&characterNature, sizeof(characterNature));
-
-		//then memorise which characters have the whitespace nature.
-		characterNature['\a'] = whitespaceNature;
-		characterNature['\t'] = whitespaceNature;
-		characterNature['\n'] = whitespaceNature;
-		characterNature['\v'] = whitespaceNature;
-		characterNature['\f'] = whitespaceNature;
-		characterNature['\r'] = whitespaceNature;
-		characterNature[' ']  = whitespaceNature;
-		//NOTE: if you give more characters the whitespace nature, be sure to
-		//	update escapeNames below.
-
-		//finally, memorise which characters have the unsafe (for shells) nature.
-		characterNature['\\'] = shellUnsafeNature;
-		characterNature['\''] = shellUnsafeNature;
-		characterNature['"']  = shellUnsafeNature;
-		characterNature['`']  = shellUnsafeNature;
-		characterNature['!']  = shellUnsafeNature;
-		characterNature['$']  = shellUnsafeNature;
-		characterNature['&']  = shellUnsafeNature;
-		characterNature['|']  = shellUnsafeNature;
-	}
-
 	unsigned myLength = [self length];
 	unichar *myBuf = malloc(sizeof(unichar) * myLength);
 	if (!myBuf) return nil;
@@ -650,6 +637,68 @@
 	return result;
 }
 
+- (NSString *)stringByEscapingForRegexp
+{
+	unsigned myLength = [self length];
+	unichar *myBuf = malloc(sizeof(unichar) * myLength);
+	if (!myBuf) return nil;
+	[self getCharacters:myBuf];
+	const unichar *myBufPtr = myBuf;
+	
+	size_t buflen = 0;
+	unichar *buf = NULL;
+	
+	const size_t buflenIncrement = getpagesize() / sizeof(unichar);
+	
+	/*the boundary guard happens everywhere that i increases, and MUST happen
+	 *	at the beginning of the loop.
+	 *
+	 *initialising buflen to 0 and buf to NULL as we have done above means that
+	 *	realloc will act as malloc:
+	 *	-	i is 0 at the beginning of the loop
+	 *	-	so is buflen
+	 *	-	and buf is NULL
+	 *	-	realloc(NULL, ...) == malloc(...)
+	 *
+	 *oh, and 'SBEFR' stands for String By Escaping For Regexp
+	 *	(the name of this method).
+	 */
+#define SBEFR_BOUNDARY_GUARD \
+do { \
+if (i == buflen) { \
+buf = realloc(buf, sizeof(unichar) * (buflen += buflenIncrement)); \
+if (!buf) { \
+NSLog(@"in stringByEscapingForRegexp: could not allocate %lu bytes", (unsigned long)(sizeof(unichar) * buflen)); \
+free(myBuf); \
+return nil; \
+} \
+} \
+} while (0)
+	
+	unsigned i = 0;
+	for (; myLength--; ++i) {
+		SBEFR_BOUNDARY_GUARD;
+		
+		if (characterNature[*myBufPtr] & regexpUnsafeNature) {
+			//escape this character
+			buf[i++] = '\\';
+			SBEFR_BOUNDARY_GUARD;
+		}
+		
+		buf[i] = *myBufPtr;
+		++myBufPtr;
+	}
+	
+#undef SBEFR_BOUNDARY_GUARD
+	
+	free(myBuf);
+	
+	NSString *result = [NSString stringWithCharacters:buf length:i];
+	free(buf);
+	
+	return result;
+}
+
 - (NSString *)volumePath
 {
 	NSEnumerator *pathEnum = [[[NSWorkspace sharedWorkspace] mountedLocalVolumePaths] objectEnumerator];
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.h
--- a/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.h	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.h	Mon Aug 31 07:29:19 2009 -0500
@@ -29,7 +29,7 @@
  * Returns the total height needed to display all rows of the outline view
  * @return The total required height
  */
-- (int)totalHeight;
+- (NSInteger)totalHeight;
 
 /*!
  * @brief Set if the selection highlight should only be drawn when the outlineView is the main (active) view.
diff -r ae1a0c1173a3 -r 916332d9905e Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m
--- a/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m	Tue Aug 18 15:41:28 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m	Mon Aug 31 07:29:19 2009 -0500
@@ -366,7 +366,7 @@
 	return image;
 }
 




More information about the commits mailing list