Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
authorStephen Holt <sholt@adium.im>
Sat, 12 Sep 2009 15:04:44 -0400
changeset 2710 14cef01e09dc
parent 2709 7b3d938c3f53
child 2711 92fc93345e8d
child 2766 b08debbcadf8
Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Dependencies/Libotr-Info.plist
Dependencies/build.sh
Dependencies/phases/build_dependencies.sh
Dependencies/phases/build_otr.sh
Dependencies/phases/make_frameworks.sh
Dependencies/phases/utility.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/Libotr-Info.plist	Sat Sep 12 15:04:44 2009 -0400
@@ -0,0 +1,18 @@
+<?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>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>2.2.0</string>
+	<key>CFBundleIdentifier</key>
+	<string>im.adium.libotr</string>
+</dict>
+</plist>
--- a/Dependencies/build.sh	Sat Sep 12 11:39:55 2009 -0700
+++ b/Dependencies/build.sh	Sat Sep 12 15:04:44 2009 -0400
@@ -2,6 +2,7 @@
 
 source phases/utility.sh
 source phases/build_dependencies.sh
+source phases/build_otr.sh
 source phases/build_vv_dependencies.sh
 source phases/build_purple.sh
 source phases/make_frameworks.sh
@@ -59,6 +60,7 @@
 # handle commandline options
 FORCE_CONFIGURE=false
 NATIVE_BUILD=false
+BUILD_OTR=false
 MTN_UPDATE_PARAM=""
 for option in ${@:1} ; do
 	case $option in
@@ -87,6 +89,10 @@
 				-I$ROOTDIR/build/include -L$ROOTDIR/build/lib"
 			warning "libpurple will be build for your native arcticture only!"
 			;;
+		--build-otr)
+			BUILD_OTR=true
+			status "Building libotr"
+			;;
 		--enable-llvm)
 			asserttools "/Developer/usr/bin/llvm-gcc"
 			export CC="/Developer/usr/bin/llvm-gcc"
@@ -108,6 +114,8 @@
   --disable-[arch]            : Eliminate [arch] from the build process
   --build-native              : Build only for your current architecture
                                 (currently breaks liboil on x86_64)
+  --build-otr                 : Build libotr and dependancies instead
+                                of libpurple.
   --enable-llvm               : Enable building with llvm-gcc.
                                 WARNING: This is currently broken!
   --libpurple-rev=[rev]       : Force a specific libpurple revision
@@ -155,20 +163,28 @@
 build_pkgconfig $@
 build_gettext $@
 build_glib $@
-build_otr $@
-
-build_meanwhile $@
-build_gadugadu $@
-
-build_intltool $@
-build_jsonglib $@
 
-build_gstreamer $@
-build_farsight $@
+if $BUILD_OTR; then
+	build_otr $@
+else
+	build_meanwhile $@
+	build_gadugadu $@
 
-build_libpurple $@
+	build_intltool $@
+	build_jsonglib $@
+
+	build_gstreamer $@
+	build_farsight $@
+
+	build_libpurple $@	
+
+	#build_sipe $@
+	#build_gfire $@
+fi
+
 make_framework $@
-make_po_files $@
 
-#build_sipe $@
-#build_gfire $@
+#ugly.  gotta be a better way
+if [[ !$BUILD_OTR ]] ; then
+	make_po_files $@
+fi
--- a/Dependencies/phases/build_dependencies.sh	Sat Sep 12 11:39:55 2009 -0700
+++ b/Dependencies/phases/build_dependencies.sh	Sat Sep 12 15:04:44 2009 -0400
@@ -113,94 +113,6 @@
 }
 
 ##
-# gpg-error
-#
-build_libgpgerror(){
-	prereq "gpgerror" \
-		"ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2"
-
-	quiet pushd "${ROOTDIR}/source/gpgerror"
-	
-	if needsconfigure $@; then
-	(
-		status "Configuring libgpg-error"
-		export CFLAGS="$ARCH_CFLAGS"
-		export LDFLAGS="$ARCH_LDFLAGS"
-		log ./configure --prefix="$ROOTDIR/build" \
-			--disable-shared \
-			--enable-static \
-			--disable-dependency-tracking
-	)
-	fi
-	
-	status "Building and installing gpg-error"
-	log make -j $NUMBER_OF_CORES
-	log make install
-	
-	quiet popd
-}
-
-##
-# gcrypt
-#
-# disable assembly to help build universal.
-#
-build_libgcrypt(){
-	build_libgpgerror
-	prereq "libgcrypt" \
-		"ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.4.tar.gz"
-
-	quiet pushd "${ROOTDIR}/source/libgcrypt"
-	
-	if needsconfigure $@; then
-	(
-	status "Configuring libgcrypt"
-	export CFLAGS="$ARCH_CFLAGS"
-	export LDFLAGS="$ARCH_LDFLAGS"
-	CONFIG_CMD="./configure --prefix=$ROOTDIR/build \
-		--disable-asm \
-		--disable-shared \
-		--enable-static \
-		--disable-dependency-tracking"
-	xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
-			"${ROOTDIR}/source/libgcrypt/config.h"
-	)
-	fi
-	status "Building and installing libgcrypt"
-	log make -j $NUMBER_OF_CORES
-	log make install
-	
-	quiet popd
-}
-
-##
-# Libotr
-#
-OTR_VERSION=2.2.0
-build_otr(){
-	build_libgcrypt
-	prereq "otr" \
-		"http://www.cypherpunks.ca/otr/libotr-3.2.0.tar.gz"
-	
-	quiet pushd "${ROOTDIR}/source/otr"
-	
-	if needsconfigure $@; then
-	(
-		status "Configuring libotr"
-		export CFLAGS="$ARCH_CFLAGS"
-		export LDFLAGS="$ARCH_LDFLAGS"
-		log ./configure --prefix="$ROOTDIR/build" \
-			--disable-dependency-tracking
-	)	
-	fi
-	status "Building and installing libotr"
-	log make -j $NUMBER_OF_CORES
-	log make install
-	
-	quiet popd
-}
-
-##
 # Meanwhile
 #
 MEANWHILE_VERSION=1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/phases/build_otr.sh	Sat Sep 12 15:04:44 2009 -0400
@@ -0,0 +1,93 @@
+#!/bin/bash -eu
+
+##
+# gpg-error
+#
+build_libgpgerror(){
+	prereq "gpgerror" \
+		"ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2"
+
+	quiet pushd "${ROOTDIR}/source/gpgerror"
+	
+	if needsconfigure $@; then
+	(
+		status "Configuring libgpg-error"
+		export CFLAGS="$ARCH_CFLAGS -Os"
+		export LDFLAGS="$ARCH_LDFLAGS"
+		log ./configure --prefix="$ROOTDIR/build" \
+			--disable-shared \
+			--enable-static \
+			--disable-dependency-tracking
+	)
+	fi
+	
+	status "Building and installing gpg-error"
+	log make -j $NUMBER_OF_CORES
+	log make install
+	
+	quiet popd
+}
+
+##
+# gcrypt
+#
+# disable assembly to help build universal.
+#
+build_libgcrypt(){
+	build_libgpgerror
+	prereq "libgcrypt" \
+		"ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.4.tar.gz"
+
+	quiet pushd "${ROOTDIR}/source/libgcrypt"
+	
+	if needsconfigure $@; then
+	(
+		status "Configuring libgcrypt"
+		CONFIG_CMD="./configure --prefix=$ROOTDIR/build \
+			--disable-shared \
+			--enable-static \
+			--disable-asm \
+			--enable-ciphers=arcfour:blowfish:cast5:des:aes:twofish:serpent:rfc2268 \
+			--enable-pubkey-ciphers=dsa:elgamal:rsa \
+			--enable-digests=crc:md4:md5:rmd160:sha1:sha256:sha512:tiger \
+			--disable-endian-check \
+			--disable-dependency-tracking"
+		xconfigure "${BASE_CFLAGS} -Os" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
+			"${ROOTDIR}/source/libgcrypt/config.h"
+	)
+	fi
+
+
+	status "Building and installing libgcrypt"
+	log make -j $NUMBER_OF_CORES
+	log make install
+	
+	quiet popd
+}
+
+##
+# Libotr
+#
+OTR_VERSION=2.2.0
+build_otr(){
+	build_libgcrypt
+	prereq "otr" \
+		"http://www.cypherpunks.ca/otr/libotr-3.2.0.tar.gz"
+	
+	quiet pushd "${ROOTDIR}/source/otr"
+	
+	if needsconfigure $@; then
+	(
+		status "Configuring libotr"
+		export CFLAGS="$ARCH_CFLAGS -Os"
+		export LDFLAGS="$ARCH_LDFLAGS"
+		log ./configure --prefix="$ROOTDIR/build" \
+			--disable-dependency-tracking
+	)	
+	fi
+	status "Building and installing libotr"
+	log make -j $NUMBER_OF_CORES
+	log make install
+	
+	quiet popd
+}
--- a/Dependencies/phases/make_frameworks.sh	Sat Sep 12 11:39:55 2009 -0700
+++ b/Dependencies/phases/make_frameworks.sh	Sat Sep 12 15:04:44 2009 -0400
@@ -39,56 +39,58 @@
 	quiet mkdir "${gthreadDir}" || true
 	touch "${gthreadDir}/no_headers_here.txt"
 	
+	if $BUILD_OTR; then
 	#libotr
-	status "Staging libotr headers"
-	local otrDir="${ROOTDIR}/build/lib/include/libotr-${OTR_VERSION}"
-	quiet mkdir "${otrDir}" || true
-	log cp -R "${ROOTDIR}/build/include/libotr/" "${otrDir}"
-	log cp "${ROOTDIR}/build/include/gcrypt.h" "${otrDir}"
-	log cp "${ROOTDIR}/build/include/gcrypt-module.h" "${otrDir}"
-	log cp "${ROOTDIR}/build/include/gpg-error.h" "${otrDir}"
-	
-	#meanwhile
-	status "Staging meanwhile non-headers"
-	local meanwhileDir="${ROOTDIR}/build/lib/include/libmeanwhile-${MEANWHILE_VERSION}"
-	quiet mkdir "${meanwhileDir}" || true
-	touch "${meanwhileDir}/no_headers_here.txt"
-	
-	#json-glib
-	status "Staging json-glib headers"
-	local jsonDir="${ROOTDIR}/build/lib/include/libjson-glib-${JSON_GLIB_VERSION}.0"
-	quiet mkdir "${jsonDir}" || true
-	log cp -R "${ROOTDIR}/build/include/json-glib-${JSON_GLIB_VERSION}/json-glib" "${jsonDir}"
-	
-	## VV stuff
-	
-	#gstreamer
-	status "Staging gstreamer and plugins headers"
-	local gstDir="${ROOTDIR}/build/lib/include/libgstreamer-${GSTREAMER_VERSION}.0"
-	quiet mkdir "${gstDir}" || true
-	log cp -R "${ROOTDIR}/build/include/gstreamer-${GSTREAMER_VERSION}" "${gstDir}"
-	
-	local non_includes=( "libgstbase-${GSTREAMER_VERSION}.0" \
-						 "libgstfarsight-${GSTREAMER_VERSION}.0" \
-						 "libgstinterfaces-${GSTREAMER_VERSION}.0" )
-	for no_include_lib in ${non_includes[@]} ; do
-		quiet mkdir "${ROOTDIR}/build/lib/include/${no_include_lib}" || true
-		touch "${ROOTDIR}/build/lib/include/${no_include_lib}/no_headers_here.txt"
-	done
-	
-	#libxml
-	status "Staging libxml headers"
-	local xml2Dir="${ROOTDIR}/build/lib/include/libxml-${XML_VERSION}"
-	quiet mkdir "${xml2Dir}" || true
-	log cp -R "${ROOTDIR}/build/include/libxml2" "${xml2Dir}"
-	
-	#libpurple
-	status "Staging libpurple headers"
-	local purpleDir="${ROOTDIR}/build/lib/include/libpurple-${LIBPURPLE_VERSION}"
-	quiet rm -rf "${purpleDir}"
-	log cp -R "${ROOTDIR}/build/include/libpurple" "${purpleDir}"
-	log cp "${ROOTDIR}/build/include/libgadu.h" "${purpleDir}/"
-	status "Completed staging headers"
+		status "Staging libotr headers"
+		local otrDir="${ROOTDIR}/build/lib/include/libotr-${OTR_VERSION}"
+		quiet mkdir "${otrDir}" || true
+		log cp -R "${ROOTDIR}/build/include/libotr/" "${otrDir}"
+		log cp "${ROOTDIR}/build/include/gcrypt.h" "${otrDir}"
+		log cp "${ROOTDIR}/build/include/gcrypt-module.h" "${otrDir}"
+		log cp "${ROOTDIR}/build/include/gpg-error.h" "${otrDir}"
+	else
+		#meanwhile
+		status "Staging meanwhile non-headers"
+		local meanwhileDir="${ROOTDIR}/build/lib/include/libmeanwhile-${MEANWHILE_VERSION}"
+		quiet mkdir "${meanwhileDir}" || true
+		touch "${meanwhileDir}/no_headers_here.txt"
+		
+		#json-glib
+		status "Staging json-glib headers"
+		local jsonDir="${ROOTDIR}/build/lib/include/libjson-glib-${JSON_GLIB_VERSION}.0"
+		quiet mkdir "${jsonDir}" || true
+		log cp -R "${ROOTDIR}/build/include/json-glib-${JSON_GLIB_VERSION}/json-glib" "${jsonDir}"
+		
+		## VV stuff
+		
+		#gstreamer
+		status "Staging gstreamer and plugins headers"
+		local gstDir="${ROOTDIR}/build/lib/include/libgstreamer-${GSTREAMER_VERSION}.0"
+		quiet mkdir "${gstDir}" || true
+		log cp -R "${ROOTDIR}/build/include/gstreamer-${GSTREAMER_VERSION}" "${gstDir}"
+		
+		local non_includes=( "libgstbase-${GSTREAMER_VERSION}.0" \
+							 "libgstfarsight-${GSTREAMER_VERSION}.0" \
+							 "libgstinterfaces-${GSTREAMER_VERSION}.0" )
+		for no_include_lib in ${non_includes[@]} ; do
+			quiet mkdir "${ROOTDIR}/build/lib/include/${no_include_lib}" || true
+			touch "${ROOTDIR}/build/lib/include/${no_include_lib}/no_headers_here.txt"
+		done
+		
+		#libxml
+		status "Staging libxml headers"
+		local xml2Dir="${ROOTDIR}/build/lib/include/libxml-${XML_VERSION}"
+		quiet mkdir "${xml2Dir}" || true
+		log cp -R "${ROOTDIR}/build/include/libxml2" "${xml2Dir}"
+		
+		#libpurple
+		status "Staging libpurple headers"
+		local purpleDir="${ROOTDIR}/build/lib/include/libpurple-${LIBPURPLE_VERSION}"
+		quiet rm -rf "${purpleDir}"
+		log cp -R "${ROOTDIR}/build/include/libpurple" "${purpleDir}"
+		log cp "${ROOTDIR}/build/include/libgadu.h" "${purpleDir}/"
+		status "Completed staging headers"
+	fi
 }
 
 ##
@@ -114,22 +116,27 @@
 		fi
 	done
 	
-	status "Making a framework for libpurple-${LIBPURPLE_VERSION} and all dependencies..."
-	log python "${ROOTDIR}/framework_maker/frameworkize.py" \
-		"${ROOTDIR}/build/lib/libpurple.${LIBPURPLE_VERSION}.dylib" \
-		"${FRAMEWORK_DIR}"
-	
-	status "Making a framework for libotr..."
-	log python "${ROOTDIR}/framework_maker/frameworkize.py" \
-		"${ROOTDIR}/build/lib/libotr.${OTR_VERSION}.dylib" \
-		"${FRAMEWORK_DIR}"
-	
-	status "Adding the Adium framework header..."
-	log cp "${ROOTDIR}/libpurple-full.h" \
-		"${FRAMEWORK_DIR}/libpurple.subproj/libpurple.framework/Headers/libpurple.h"
+	if $BUILD_OTR; then
+		status "Making a framework for libotr..."
+		log python "${ROOTDIR}/framework_maker/frameworkize.py" \
+			"${ROOTDIR}/build/lib/libotr.${OTR_VERSION}.dylib" \
+			"${FRAMEWORK_DIR}"
+		
+		log cp "${ROOTDIR}/Libotr-Info.plist" \
+			"${FRAMEWORK_DIR}/libotr.subproj/libotr.framework/Resources/Info.plist"
+		else
+		status "Making a framework for libpurple-${LIBPURPLE_VERSION} and all dependencies..."
+		log python "${ROOTDIR}/framework_maker/frameworkize.py" \
+			"${ROOTDIR}/build/lib/libpurple.${LIBPURPLE_VERSION}.dylib" \
+			"${FRAMEWORK_DIR}"
 
-	log cp "${ROOTDIR}/Libpurple-Info.plist" \
-		"${FRAMEWORK_DIR}/libpurple.subproj/libpurple.framework/Resources/Info.plist"
+		status "Adding the Adium framework header..."
+		log cp "${ROOTDIR}/libpurple-full.h" \
+			"${FRAMEWORK_DIR}/libpurple.subproj/libpurple.framework/Headers/libpurple.h"
+
+		log cp "${ROOTDIR}/Libpurple-Info.plist" \
+			"${FRAMEWORK_DIR}/libpurple.subproj/libpurple.framework/Resources/Info.plist"
+	fi
 	
 	status "Done!"
 }
--- a/Dependencies/phases/utility.sh	Sat Sep 12 11:39:55 2009 -0700
+++ b/Dependencies/phases/utility.sh	Sat Sep 12 15:04:44 2009 -0400
@@ -294,6 +294,10 @@
 		log cp -R ${f} "${ROOTDIR}/build/include"
 	done
 	
+	#copy bin
+	cp -R "${ROOTDIR}/sandbox/root-${ARCHS[0]}/bin/" \
+		"${ROOTDIR}/build/bin"
+	
 	#copy pkgconfig files and modify prefix
 	if [ -d "${ROOTDIR}/sandbox/root-${ARCHS[0]}/lib/pkgconfig" ] ; then
 		local files="${ROOTDIR}/sandbox/root-${ARCHS[0]}/lib/pkgconfig/*"