adium 2854:82c7fff57d39: Meaningless typo fix

commits at adium.im commits at adium.im
Thu Nov 5 00:41:39 UTC 2009


details:	http://hg.adium.im/adium/rev/82c7fff57d39
revision:	2854:82c7fff57d39
author:		Evan Schoenberg
date:		Wed Nov 04 12:27:57 2009 -0600

Meaningless typo fix
Subject: adium 2855:4d03a8633324: Another typo squashed

details:	http://hg.adium.im/adium/rev/4d03a8633324
revision:	2855:4d03a8633324
author:		Evan Schoenberg
date:		Wed Nov 04 12:39:09 2009 -0600

Another typo squashed
Subject: adium 2856:8d30184ba67e: Removed obsolete dep-build-scripts to prevent potential confusion, since the modern build scripts work so well

details:	http://hg.adium.im/adium/rev/8d30184ba67e
revision:	2856:8d30184ba67e
author:		Evan Schoenberg
date:		Wed Nov 04 18:29:43 2009 -0600

Removed obsolete dep-build-scripts to prevent potential confusion, since the modern build scripts work so well
Subject: adium 2857:5708aac146f5: Remove symlink

details:	http://hg.adium.im/adium/rev/5708aac146f5
revision:	2857:5708aac146f5
author:		Evan Schoenberg
date:		Wed Nov 04 18:41:40 2009 -0600

Remove symlink
Subject: adium 2858:76197aab6df3: We need framework_maker, which was previously a symlink into dep-build-scripts

details:	http://hg.adium.im/adium/rev/76197aab6df3
revision:	2858:76197aab6df3
author:		Evan Schoenberg
date:		Wed Nov 04 18:43:16 2009 -0600

We need framework_maker, which was previously a symlink into dep-build-scripts
Subject: adium 2859:7784d75b2b8c: Trying this again - remove old dep-build-scripts

details:	http://hg.adium.im/adium/rev/7784d75b2b8c
revision:	2859:7784d75b2b8c
author:		Evan Schoenberg
date:		Wed Nov 04 18:44:15 2009 -0600

Trying this again - remove old dep-build-scripts
Subject: adium 2860:97914358ab30: Merge

details:	http://hg.adium.im/adium/rev/97914358ab30
revision:	2860:97914358ab30
author:		Evan Schoenberg
date:		Wed Nov 04 18:44:38 2009 -0600

Merge

diffs (truncated from 4715 to 1000 lines):

diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/build.sh
--- a/Dependencies/build.sh	Mon Nov 02 18:35:26 2009 -0500
+++ b/Dependencies/build.sh	Wed Nov 04 18:44:38 2009 -0600
@@ -61,6 +61,7 @@
 FORCE_CONFIGURE=false
 NATIVE_BUILD=false
 BUILD_OTR=false
+STRAIGHT_TO_LIBPURPLE=false
 MTN_UPDATE_PARAM=""
 for option in ${@:1} ; do
 	case $option in
@@ -87,7 +88,7 @@
 			BASE_CFLAGS="-I$ROOTDIR/build/include -L$ROOTDIR/build/lib"
 			BASE_LDFLAGS="-Wl,-headerpad_max_install_names \
 				-I$ROOTDIR/build/include -L$ROOTDIR/build/lib"
-			warning "libpurple will be build for your native arcticture only!"
+			warning "libpurple will be built for your native arcticture only!"
 			;;
 		--build-otr)
 			BUILD_OTR=true
@@ -107,6 +108,9 @@
 			MTN_BRANCH=${option##*=}
 			MTN_UPDATE_PARAM="${MTN_UPDATE_PARAM} -b ${MTN_BRANCH}"
 			;;
+        --libpurple-only)
+            STRAIGHT_TO_LIBPURPLE=true
+            ;;
 		-h|-help|--help)
 			echo 'The following options are valid:
 
@@ -120,13 +124,15 @@
                                 WARNING: This is currently broken!
   --libpurple-rev=[rev]       : Force a specific libpurple revision
   --libpurple-branch=[branch] : Force a secific libpurple branch
+  --libpurple-only            : Assume all dependencies are already built
+                                and start the build with libpurple itself
   --help                      : This help text
 	
 Note that explicitly setting any arch flags implies a forced reconfigure.'
 			exit 0
 			;;
 		*)
-			echo "Unknown commannd.  Run ${0} --help for a list of commands."
+			echo "Unknown command.  Run ${0} --help for a list of commands."
 			exit 0
 			;;
 	esac
@@ -139,10 +145,10 @@
 : > ${LOG_FILE}
 : > ${ERR_FILE}
 
-# set -arch flags now, after the user has had a chance to diasble one or more
+# set -arch flags now, after the user has had a chance to disable one or more
 set_arch_flags
 
-# assert that the developer can, infact, build libpurple.  Why waste his time if he can't?
+# assert that the developer can, in fact, build libpurple.  Why waste his time if he can't?
 asserttools gcc
 asserttools mtn
 
@@ -159,27 +165,31 @@
 quiet mkdir "source"
 quiet mkdir "build"
 
-# TODO: Make this parameterizable 
-build_pkgconfig $@
-build_gettext $@
-build_glib $@
+if $STRAIGHT_TO_LIBPURPLE; then
+    build_libpurple $@
+else
+    # TODO: Make this parameterizable 
+    build_pkgconfig $@
+    build_gettext $@
+    build_glib $@
 
-if $BUILD_OTR; then
-	build_otr $@
-else
-	build_meanwhile $@
-	build_gadugadu $@
+    if $BUILD_OTR; then
+    	build_otr $@
+    else
+	   build_meanwhile $@
+    	build_gadugadu $@
 
-	build_intltool $@
-	build_jsonglib $@
+    	build_intltool $@
+    	build_jsonglib $@
 
-	build_gstreamer $@
-	build_farsight $@
+    	build_gstreamer $@
+    	build_farsight $@
 
-	build_libpurple $@	
+    	build_libpurple $@	
 
-	#build_sipe $@
-	#build_gfire $@
+    	#build_sipe $@
+    	#build_gfire $@
+    fi
 fi
 
 make_framework $@
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker
--- a/Dependencies/framework_maker	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../Utilities/dep-build-scripts/framework_maker
\ No newline at end of file
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker/frameworkize.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/framework_maker/frameworkize.py	Wed Nov 04 18:44:38 2009 -0600
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+import otool_parse
+
+import sys
+import os
+import re
+import dircache
+import shutil
+
+def otool_library(lib):
+  '''Runs otool on the library at lib.
+  
+  Returns an otool_parse.OtoolParser.
+  '''
+  otool_file = os.popen('otool -L "' + lib +'"')
+  otool_data = otool_file.read()
+  return otool_parse.OtoolParser(otool_data)
+
+def recursively_discover_all_dependencies(lib):
+  '''Recursively find all dependencies for library at path in lib.
+  
+  Returns a list of paths.
+  '''
+  libraries = dict([(l,1) for l in lib])
+  old_libraries = {}
+  while libraries != old_libraries:
+    old_libraries = libraries.copy()
+    for lib in libraries.keys():
+      dep_parser = otool_library(lib)
+      for dep in dep_parser.third_party_shlib_deps():
+        libraries[dep] = 1
+  return old_libraries.keys()
+
+def lib_path_to_framework_and_version(library_path):
+  library_name = library_path.split('/')[-1]
+  # check to see if it's a "versionless" library name
+  match = re.match(r'[A-Za-z]*\.dylib', library_name)
+  library_name = library_name.replace('.dylib','')
+  if match:
+    return (library_name, 'A')
+  # Note: these styles are named after where I noticed them, not necessarily
+  # where they originate. -RAF
+  regexes = [r'([A-Za-z0-9_-]*)-([0-9\.]*)$', #apr style
+             r'([A-Za-z0-9_-]*[a-zA-Z])\.([0-9\.]*)$', #gnu style
+             r'([A-Za-z0-9_-]*[a-zA-Z])([0-9\.]*)$', #sqlite style
+             ]
+  for regex in regexes:
+    match = re.match(regex, library_name)
+    if match:
+      return match.groups()
+  
+  # If we get here, we need a new regex. Throw an exception.
+  raise ValueError, ('Library ' + library_path + ' with name ' + library_name +
+                     ' did not match any known format, please update the'
+                     ' script.')
+
+if __name__ == '__main__':
+  if len(sys.argv) < 3:
+    print 'Usage:', sys.argv[0], '/paths/to/libraries.dylib', 'output_dir'
+    sys.exit(1)
+  output_dir = sys.argv[-1]
+  libs_to_convert = sys.argv[1:-1]
+  libs_to_convert = recursively_discover_all_dependencies(libs_to_convert)
+  libs_to_convert.sort()
+  framework_names_and_versions = [lib_path_to_framework_and_version(l) for l 
+                  in libs_to_convert]
+  framework_names = [lib[0] for lib in framework_names_and_versions]
+  framework_versions = [lib[1] for lib in framework_names_and_versions]
+  
+  framework_names_with_path = ['@executable_path/../Frameworks/' + l[0]
+          + '.framework/Versions/' + l[1] +'/' + l[0] for l 
+          in framework_names_and_versions]
+  
+  rlinks_fw_line = ('--rlinks_framework=[' + ' '.join(libs_to_convert)
+            + ']:[' + ' '.join(framework_names_with_path) + ']')
+  
+  for lib,name,version in zip(libs_to_convert, framework_names, 
+                framework_versions):
+    #execute rtool a crapton of times
+    header_path = '/'.join(lib.split('/')[0:-1]) + '/include/' + name
+    if version != '' and version != 'A':
+      header_path += '-'+version
+    try:
+      header_path = ' '.join([header_path+'/'+h for h in 
+                              dircache.listdir(header_path)])
+    except OSError, e:
+      # the directory didn't exist, we don't care.
+      pass
+    args = ['rtool',
+            '--framework_root=@executable_path/../Frameworks',
+            '--framework_name='+name,
+            '--framework_version='+version,
+            '--library='+lib,
+            '--builddir='+output_dir,
+            '--headers='+header_path,
+            '--headers_no_root',
+            rlinks_fw_line,
+             ]
+    status = os.spawnvp(os.P_WAIT, 'rtool', args)
+    if status != 0:
+      print 'Something went wrong. rtool failed for ', lib,
+      print ' with status ', status
+      sys.exit(1)
+
+  directories_to_visit = [output_dir+'/'+d for d in dircache.listdir(output_dir)
+                          if d.endswith('.frwkproj')]
+  for direct in directories_to_visit:
+    frameworks = [direct+'/'+f for f in dircache.listdir(direct) if
+                  f.endswith('.framework')]
+    for f in frameworks:
+      f_new = output_dir+'/'+f.split('/')[-1]
+      try:
+        shutil.rmtree(f_new)
+      except Exception, e:
+        pass
+      shutil.move(f, f_new)
+    shutil.rmtree(direct)
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker/frameworkize_test.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/framework_maker/frameworkize_test.py	Wed Nov 04 18:44:38 2009 -0600
@@ -0,0 +1,29 @@
+import unittest
+
+import frameworkize
+
+TESTS = [('/opt/local/lib/libapr-1.0.dylib'   , ('libapr', '1.0')),
+         ('/opt/local/lib/libaprutil-1.0.dylib' , ('libaprutil', '1.0')),
+         ('/opt/local/lib/libexpat.1.dylib'   , ('libexpat', '1')),
+         ('/opt/local/lib/libiconv.2.dylib'   , ('libiconv', '2')),
+         ('/opt/local/lib/libintl.8.dylib'    , ('libintl', '8')),
+         ('/opt/local/lib/libsqlite3.0.dylib'   , ('libsqlite', '3.0')),
+         ('/opt/local/lib/libz.1.dylib'     , ('libz', '1')),
+         ('/opt/svn/lib/libsvn_delta-1.0.dylib' , ('libsvn_delta', '1.0')),
+         ('/opt/svn/lib/libsvn_diff-1.0.dylib'  , ('libsvn_diff', '1.0')),
+         ('/opt/svn/lib/libsvn_subr-1.0.dylib'  , ('libsvn_subr', '1.0')),
+         ('/opt/svn/lib/libsvn_wc-1.0.dylib'  , ('libsvn_wc', '1.0')),
+         ('/opt/local/lib/libintl.dylib'    , ('libintl', 'A')),
+        ]
+
+
+class FrameworkNamingTest(unittest.TestCase):
+  def test_naming(self):
+    for path, expected_result in TESTS:
+      self.assertEqual(frameworkize.lib_path_to_framework_and_version(path), 
+                       expected_result)
+    self.assertRaises(ValueError, 
+                      frameworkize.lib_path_to_framework_and_version, '&&&')
+
+if __name__ == '__main__':
+  unittest.main()
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker/otool_parse.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/framework_maker/otool_parse.py	Wed Nov 04 18:44:38 2009 -0600
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+import os
+import re
+import sys
+
+class OtoolParser:
+  def __init__(self, otool_output):
+    self.data = otool_output.split('\n')
+    self._library_path = self.data[0][0:-1]
+    self._library_name = self._library_path.split('/')[-1]
+    useless_data = re.compile(r' \(.*\)')
+    libs = [useless_data.sub('',x.lstrip()) for x in self.data[2:-1] 
+            if x.count('framework') == 0]
+    self.base_libs = [x for x in libs if x.startswith('/usr/') and
+                      x.endswith('dylib')]
+    self.third_libs = [x for x in libs if x not in self.base_libs and
+                       x.endswith('dylib')]
+  
+  def built_in_shlib_deps(self):
+    return self.base_libs
+    
+  def library_path(self):
+    return self._library_path
+  
+  def library_name(self):
+    return self._library_name
+
+  #def built_in_framework_deps(self):
+  #  return None
+  
+  def third_party_shlib_deps(self):
+    return self.third_libs
+  
+  #def third_party_framework_deps(self):
+  #  return None
+
+def otool_library(path, arch = None):
+  command_str = 'otool -L '
+  if arch:
+    command_str += '-arch ' + arch + ' '
+  command_str += path
+  otool_file = os.popen(command_str)
+  otool_data = otool_file.read()
+  parser = OtoolParser(otool_data)
+  return parser
+  
+if __name__ == '__main__':
+  if len(sys.argv) != 2:
+    print 'Usage:', sys.argv[0], '/path/to/library.dylib'
+    sys.exit(1)
+  parser = otool_library(sys.argv[1])
+  print 'Library name:', parser.library_name()
+  print 'Library path:', parser.library_path()
+  print 'Non-base shlib dependencies:'
+  for lib in parser.third_party_shlib_deps():
+    print '  ' + lib
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker/otool_parse_test.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/framework_maker/otool_parse_test.py	Wed Nov 04 18:44:38 2009 -0600
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+import unittest
+import otool_parse
+
+LIBSVN_WC = """/opt/svn/lib/libsvn_wc-1.0.dylib:
+	/opt/svn/lib/libsvn_wc-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
+	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
+	/opt/svn/lib/libsvn_subr-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
+	/opt/svn/lib/libsvn_delta-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
+	/opt/svn/lib/libsvn_diff-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
+	/opt/local/lib/libaprutil-1.0.dylib (compatibility version 3.0.0, current version 3.9.0)
+	/opt/local/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
+	/opt/local/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
+	/opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
+	/opt/local/lib/libapr-1.0.dylib (compatibility version 3.0.0, current version 3.9.0)
+	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)
+	/opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.1.0)
+"""
+
+class OtoolParserTest(unittest.TestCase):
+  def test_third_party_shlibs(self):
+    parser = otool_parse.OtoolParser(LIBSVN_WC)
+    expected_shlibs = ['/opt/local/lib/libz.1.dylib',
+                      '/opt/svn/lib/libsvn_subr-1.0.dylib',
+                      '/opt/svn/lib/libsvn_delta-1.0.dylib',
+                      '/opt/svn/lib/libsvn_diff-1.0.dylib',
+                      '/opt/local/lib/libaprutil-1.0.dylib',
+                      '/opt/local/lib/libsqlite3.0.dylib',
+                      '/opt/local/lib/libexpat.1.dylib',
+                      '/opt/local/lib/libiconv.2.dylib',
+                      '/opt/local/lib/libapr-1.0.dylib',
+                      '/opt/local/lib/libintl.8.dylib']
+    actual_shlibs = parser.third_party_shlib_deps()
+    expected_shlibs.sort()
+    actual_shlibs.sort()
+    self.assertEqual(expected_shlibs, actual_shlibs)
+  
+  def test_built_in_shlibs(self):
+    expected_shlibs = ['/usr/lib/libSystem.B.dylib']
+    parser = otool_parse.OtoolParser(LIBSVN_WC)
+    actual_shlibs = parser.built_in_shlib_deps()
+    expected_shlibs.sort()
+    actual_shlibs.sort()
+    self.assertEqual(expected_shlibs, actual_shlibs)
+  
+  def test_library_path(self):
+    parser = otool_parse.OtoolParser(LIBSVN_WC)
+    self.assertEqual('/opt/svn/lib/libsvn_wc-1.0.dylib',
+                     parser.library_path())
+  
+  def test_library_name(self):
+    parser = otool_parse.OtoolParser(LIBSVN_WC)
+    self.assertEqual('libsvn_wc-1.0.dylib',
+                     parser.library_name())
+           
+    
+if __name__ == '__main__':
+  unittest.main()
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/framework_maker/universalize.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/framework_maker/universalize.py	Wed Nov 04 18:44:38 2009 -0600
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+'''This module provides functions that shell out to install_name_tool to perform
+black magic on dylibs and make them universal.
+'''
+
+import os
+import sys
+
+import otool_parse
+
+LIPO_BINARY_NAME = 'lipo'
+CREATE_FLAG = '-create'
+ARCH_FLAG = '-arch'
+OUTPUT_FLAG = '-output'
+
+INSTALL_NAME_TOOL = 'install_name_tool'
+
+# TODO(durin42) this function is begging to be refactored into lipo_files and
+# find_and_replace_on_files, but I just need to get this into the repo.
+def lipo_files(source_files, replace_paths, target_file):
+  '''Collect the files located at the paths to the target path using lipo.
+  
+  Args: source_files: dict of arch:source file (single arch per source only)
+        replace_paths: dict of replacements. Will replace any path or path
+          fragment in shared library load paths. Key is replaced with value.
+        target_file: target path
+  
+  Returns: nothing.
+  '''
+  args = [LIPO_BINARY_NAME, CREATE_FLAG, ]
+  for arch, source in source_files.items():
+    args.append(ARCH_FLAG)
+    args.append(arch)
+    args.append(source)
+  args.append(OUTPUT_FLAG)
+  args.append(target_file)
+  status = os.spawnvp(os.P_WAIT, LIPO_BINARY_NAME, args)
+  if status != 0:
+    print 'The following command failed:'
+    print ' '.join(args)
+    sys.exit(status)
+  
+  # Gather all the third party deps, we don't want to replace paths to system
+  # deps anyway.
+  info = otool_parse.otool_library(target_file, 'i386')
+  all_third_libs = info.third_party_shlib_deps()
+  info = otool_parse.otool_library(target_file, 'ppc')
+  all_third_libs.extend(info.third_party_shlib_deps())
+  
+  # run install_name_tool to change the file's own path
+  args = [INSTALL_NAME_TOOL, '-id', target_file, target_file]
+  status = os.spawnvp(os.P_WAIT, INSTALL_NAME_TOOL, args)
+  if status != 0:
+    print 'The following command failed:'
+    print ' '.join(args)
+    sys.exit(status)
+  # Do find-and-replace on third-party lib paths using install_name_tool
+  for old_path, new_path in replace_paths.items():
+    for lib_path in all_third_libs:
+      if old_path in lib_path:
+        path_new = lib_path.replace(old_path, new_path)
+        args = [INSTALL_NAME_TOOL, '-change', lib_path, path_new, target_file]
+        status = os.spawnvp(os.P_WAIT, INSTALL_NAME_TOOL, args)
+        if status != 0:
+          print 'The following command failed:'
+          print ' '.join(args)
+          sys.exit(status)
+
+def _print_usage():
+  print 'Usage:', sys.argv[0], 'arch:/path/to/old_lib.dylib', 
+  print 'arch:/path/to/old_lib.dylib', '/path/to_new.dylib',
+  print '[oldpath:newpath] [oldpath:newpath]'
+  print
+  print 'You MUST pass full paths - partial ones will create malformed libs.'
+  print 'You may pass partial paths for the replacements.'
+
+if __name__ == '__main__':
+  if len(sys.argv) < 3:
+    _print_usage()
+  replacement_arr = sys.argv[1:]
+  platform_libs = {}
+  for arg in sys.argv[1:]:
+    replacement_arr.remove(arg)
+    if arg.count(':') == 0:
+      target_file = arg
+      break
+    arch, lib = arg.split(':')
+    platform_libs[arch] = lib
+
+  replacements = {}
+  for repl in replacement_arr:
+    old, new = repl.split(':')
+    replacements[old] = new
+  lipo_files(platform_libs, replacements, target_file)
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/phases/build_purple.sh
--- a/Dependencies/phases/build_purple.sh	Mon Nov 02 18:35:26 2009 -0500
+++ b/Dependencies/phases/build_purple.sh	Wed Nov 04 18:44:38 2009 -0600
@@ -59,7 +59,7 @@
 # libpurple
 #
 build_libpurple() {
-	fetch_libpurple
+	# fetch_libpurple
 	prereq "cyrus-sasl" \
 		"ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/OLD-VERSIONS/sasl/cyrus-sasl-2.1.18.tar.gz"
 	
@@ -96,6 +96,7 @@
 			-I$ROOTDIR/build/include/glib-2.0 \
 			-I$ROOTDIR/build/lib/glib-2.0/include"
 		export MEANWHILE_LIBS="-lmeanwhile -lglib-2.0 -liconv"
+		export MSGFMT="$ROOTDIR/build/bin/msgfmt"
 		CONFIG_CMD="./autogen.sh \
 				--disable-dependency-tracking \
 				--disable-gtkui \
diff -r a2f78c3401b9 -r 97914358ab30 Dependencies/phases/build_vv_dependencies.sh
--- a/Dependencies/phases/build_vv_dependencies.sh	Mon Nov 02 18:35:26 2009 -0500
+++ b/Dependencies/phases/build_vv_dependencies.sh	Wed Nov 04 18:44:38 2009 -0600
@@ -10,7 +10,7 @@
 	
 	quiet pushd "$ROOTDIR/source/oil"
 	
-	status "Cross-comiling oil..."
+	status "Cross-compiling oil..."
 	CONFIG_CMD="./configure \
 				--disable-dependency-tracking"
 	xcompile "${BASE_CFLAGS}  -DHAVE_SYMBOL_UNDERSCORE" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
diff -r a2f78c3401b9 -r 97914358ab30 Utilities/dep-build-scripts/Libpurple-Info.plist
--- a/Utilities/dep-build-scripts/Libpurple-Info.plist	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//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>0.0.1d1</string>
-	<key>CFBundleIdentifier</key>
-	<string>im.pidgin.libpurple</string>
-</dict>
-</plist>
diff -r a2f78c3401b9 -r 97914358ab30 Utilities/dep-build-scripts/README
--- a/Utilities/dep-build-scripts/README	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-== DOWNLOADING SOURCE TREES ==
-
-To download the source trees to most dependencies, just run
-
-$ ./common.sh -d
-
-The download script requires Python 2.5.1 or later, which comes with
-Mac OS X 10.5 "Leopard" . You can confirm which version of Python you are using
-by running `python --version`; if it is an older version, you can upgrade at
-http://python.org/download/mac/.
-
-Alternatively, you can substitute curl and xargs:
-
-$ mkdir source; cd source; (cat ../urls.txt | xargs -I %url% curl -LO %url%) \
-&& (ls -1 *.tar.gz | xargs -I %file% tar xzf %file%) && (ls -1 *.tar.bz2 | \
-xargs -I %file% tar xjf %file%); rm -f *.tar.*; cd ..
-
-
-=== DOWNLOADING PIDGIN SOURCE TREE ===
-
-The Pidgin source is not installed by the download script. Adium currently uses
-libpurple from the branch im.pidgin.adium. Patches applied during the build process expect this version.
-
-The official documentation for getting Pidgin source is maintained at
-http://developer.pidgin.im/wiki/UsingPidginMonotone, simplified here. The
-Pidgin repository is run by monotone. You can find a Mac OS X monotone
-installer at http://www.monotone.ca/.
-
-
-==== INITIAL CHECKOUT ====
-
-We will download a snapshot of the monotone database to bootstrap the checkout
-process. Please note that this file is nearly 200 MB.
-
-$ cd source; mkdir im.pidgin.adium; cd im.pidgin.adium; curl -LO \
-http://developer.pidgin.im/static/pidgin.mtn.bz2 && bzip2 -d pidgin.mtn.bz2 \
-&& mtn db -d pidgin.mtn migrate && mtn -d pidgin.mtn pull --set-default \
-mtn.pidgin.im "im.pidgin.*" && mtn -d pidgin.mtn co -b im.pidgin.adium .; cd \
-../..
-
-
-==== UPDATING ====
-
-To update the Pidgin source tree, just run
-
-$ pushd source/im.pidgin.adium; mtn pull; mtn update; popd
-
-
-==== MOVING ====
-
-If you move the Pidgin source tree, you must update the absolute path of the
-pidgin.mtn database file in source/im.pidgin.adium/_MTN/options. Otherwise,
-you will be unable to pull changesets from the monotone repository.
-
-
-== CONFIGURATION ==
-
-The configuration settings are found in common.sh. This script is executed
-during the build process to set up the build environment. You will need to edit
-this file to change build behavior such as which SDK to use.
-
-
-=== SETTING PIDGIN PATH ===
-
-If you did not check out the Pidgin source as above, change PIDGIN_SOURCE in 
-common.sh to the path to your local Pidgin source tree.
-
-
-== BUILDING ==
-
-A number of scripts are included to simplify the process of building libpurple
-and other dependencies.
-
-
-=== GENERAL DEPENDENCIES ===
-
-$ ./general_dependencies_make.sh
-
-This phase builds pkg-config, gettext, and glib. The output of the build
-process is written to ./build/dep_make.log. Some configuration output may be
-found in the build subdirectores; look for config.log files.
-
-You will not need to run this part of the build process again unless the
-dependencies above are updated.
-
-
-=== LIBPURPLE DEPENDENCIES ===
-
-$ ./purple_dependencies_make.sh
-
-This phase builds Meanwhile, Gadu-Gadu, and intltool. The output of the build
-process is written to ./build/purple_dep_log. Some configuration output may be
-found in the build subdirectories; look for config.log files.
-
-You will not need to run this part of the build process again unless the
-dependencies above (including general dependencies) are updated.
-
-
-=== LIBPURPLE ===
-
-$ ./purple_make.sh [--ppc | --i386 ] [--regenerate]
-
-This phase builds libpurple. The output of the build process is written to
-STDOUT.
-
-The script to build libpurple accepts some options:
-
- * You may limit the build to one architecture by using either --ppc or --i386,
-   but note that you cannot build a Universal Binary when using either option.
-   This is mainly useful for checking that code compiles.
-
- * If you would like to force the script to rerun autoconf and automake, use
-   the --regenerate option. Otherwise, it will detect whether or not to run
-   them based on the presence or absence of needed files.
-
-You must have set the PIDGIN_SOURCE variable for this script to run; see
-SETTING PIDGIN PATH above.
-
-You must run this part of the build process each time you update libpurple.
-
-
-=== UNIVERSALIZE ===
-
-$ ./universalize.sh
-
-This phase creates Universal Binaries from the PowerPC- and Intel-native
-binaries. The output of the build process is written to STDOUT.
-
-The build products are located in ./build/Frameworks.
-
-You must run this part of the build process each time you update any of the
-dependencies, including libpurple.
-
-
-=== MAKE PO FILES ===
-
-$ ./make_po_files.sh
-
-This phase generates localization files. The output of the build process is
-written to STDOUT.
-
-You must run this part of the build process after a clean build, or whenever
-libpurple has received localization updates.
-
-
-== INSTALLING ==
-
-You can copy the built frameworks to Adium with
-
-$ ./copy_frameworks.sh
-
-You should then build Adium to link against the new frameworks.
diff -r a2f78c3401b9 -r 97914358ab30 Utilities/dep-build-scripts/common.sh
--- a/Utilities/dep-build-scripts/common.sh	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#!/bin/sh
-# Common variables and helper functions
-
-# Bails out if any command exits with a non zero exit code
-# In all scripts if it doesn't matter what a return code is make sure to use cmd || true
-set -e
-	
-# Package Versions - if a package is changed also update urls.txt
-PKGCONFIG=pkg-config-0.22
-GETTEXT=gettext-0.16.1
-GLIB=glib-2.16.6
-MEANWHILE=meanwhile-1.0.2
-GADU=libgadu-1.7.1
-INTLTOOL=intltool-0.36.2
-JSONLIB=json-glib-0.7.6
-GPG_ERROR=libgpg-error-1.6
-GCRYPT=libgcrypt-1.4.1
-LIBXML2=libxml2-2.7.3
-GSTREAMER=gstreamer-0.10.24
-LIBOIL=liboil-0.3.16
-GST_PLUGINS_BASE=gst-plugins-base-0.10.23
-GST_PLUGINS_GOOD=gst-plugins-good-0.10.15
-GST_PLUGINS_BAD=gst-plugins-bad-0.10.13
-GST_PLUGINS_FARSIGHT=gst-plugins-farsight-0.12.11
-FARSIGHT=farsight2-0.0.14
-NICE=libnice-0.0.9
-
-# Directories
-if [ "x$ADIUM_BUILD_BASEDIR" = "x" ]; then
-	BASEDIR="$PWD"
-else
-	BASEDIR="$ADIUM_BUILD_BASEDIR"
-fi
-
-SCRIPT_DIR="$PWD"
-PATCHDIR="$SCRIPT_DIR/patches"
-SOURCEDIR="$BASEDIR/source"
-BUILDDIR="$BASEDIR/build"
-UNIVERSAL_DIR="$BUILDDIR/universal"
-LOGDIR="$BUILDDIR"
-
-if [ "x$PIDGIN_SOURCE" = "x" ] ; then
-	export PIDGIN_SOURCE="$SOURCEDIR/im.pidgin.adium"
-fi
-
-# Compiler options
-export CC=/usr/bin/gcc-4.2
-TARGET_DIR_PPC="$BUILDDIR/root-ppc"
-TARGET_DIR_I386="$BUILDDIR/root-i386"
-TARGET_DIR_ARMV6="$BUILDDIR/root-armv6"
-
-TARGET_DIR_BASE="$BUILDDIR/root"
-export PATH_PPC="$TARGET_DIR_PPC/bin:$PATH"
-export PATH_I386="$TARGET_DIR_I386/bin:$PATH"
-export PATH_ARMV6="$TARGET_DIR_ARMV6/bin:$PATH"
-
-if [ "$1" = "-iphone" ]; then
-    #HOST="arm-apple-darwin"
-    echo "iPhone!"
-    SDK_ROOT="/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk"
-    BASE_CFLAGS="-miphoneos-version-min=2.2 -isysroot $SDK_ROOT"
-    BASE_LDFLAGS="-miphoneos-version-min=2.2 -headerpad_max_install_names -Wl,-syslibroot,$SDK_ROOT"
-
-else
-    SDK_ROOT="/Developer/SDKs/MacOSX10.5.sdk"
-    BASE_CFLAGS="-mmacosx-version-min=10.5 -isysroot $SDK_ROOT"
-    BASE_LDFLAGS="-mmacosx-version-min=10.5 -headerpad_max_install_names -Wl,-syslibroot,$SDK_ROOT"
-fi
-
-NUMBER_OF_CORES=`sysctl -n hw.activecpu`
-
-# XXX Not sure if this is even used anymore
-IS_ON_10_4=FALSE
-
-function setupDirStructure {
-	mkdir "$LOGDIR" > /dev/null 2>&1 || true
-	mkdir "$BUILDDIR" >/dev/null 2>&1 || true
-	mkdir "$UNIVERSAL_DIR" > /dev/null 2>&1 || true
-}
-
-function downloadSources {
-	setupDirStructure
-	mkdir "$SOURCEDIR" > /dev/null 2>&1 || true
-	
-	pushd "$SOURCEDIR"
-		python "$SCRIPT_DIR/download.py" -f "$SCRIPT_DIR/urls.txt"
-	popd
-}
-
-if [ "$1" = "-d" ]; then
-	downloadSources
-	
-	echo "Done - now run ./general_dependencies_make.sh"
-fi
diff -r a2f78c3401b9 -r 97914358ab30 Utilities/dep-build-scripts/copy_frameworks.sh
--- a/Utilities/dep-build-scripts/copy_frameworks.sh	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh 
-source common.sh
-
-ADIUM="`dirname $0`/../.."
-
-cp -r "$BUILDDIR"/Frameworks/*.subproj/*.framework "$ADIUM/Frameworks/"
-
-pushd "$ADIUM/build" > /dev/null 2>&1
-	rm -rf */AdiumLibpurple.framework 
-	rm -rf */*/Adium.app/Contents/Frameworks/lib*
-popd > /dev/null 2>&1
-
-echo "Done - now build Adium"
diff -r a2f78c3401b9 -r 97914358ab30 Utilities/dep-build-scripts/download.py
--- a/Utilities/dep-build-scripts/download.py	Mon Nov 02 18:35:26 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Downloader
-by Peter Hosey
-
-This is a multi-tasking file downloader with automatic unpacking. It uses curl to download files, and tar or unzip to unpack the files.
-
-Usage: download.py [options] url url url ...
-
-By default, the program will only download one file at a time. If you specify the -j option, it will download that many files at a time, except that it imposes an internal limit of one download per server (so as to not rudely swamp a single server with concurrent download requests).
-
-You may also pass the -v option if you want to read debugging information.
-
-After the options, the program takes one or more URLs to download. You can set up a pipe from the xargs utility if you would like to read URLs from a file.
-"""
-
-verbose = False
-def debug_log(msg, *pieces):
-	if not verbose: return
-
-	import sys, os
-
-	# Change pieces to be all but the last; it starts out being all but the first.
-	all = ((msg,) + pieces)
-	pieces, last = all[:-1], all[-1]
-
-	print >>sys.stderr, os.getpid(),
-	for x in pieces:
-		print >>sys.stderr, x,
-	print >>sys.stderr, last
-
-def print_argv(argv):
-	if verbose: print os.getpid(),
-	print '>',
-	for arg in argv: print arg,
-	print
-
-def strip_newlines(seq):
-	for line in seq:
-		if line.endswith('\n'):
-			line = line[:-1]
-		yield line
-
-import optparse
-
-# This doesn't go by URL alone because we don't want to let the user spawn 20 jobs that download from a single server. That would be rude to the server.
-parser = optparse.OptionParser(usage='%prog [options] url [url [url ...]]')
-parser.add_option('-f', '--input-file', help='file to read for URLs', default=None)
-parser.add_option('-j', '--jobs', help='number of domains to download from at once', type='int', default=1)
-parser.add_option('-v', '--verbose', help='print debug logging', default=False, action='store_true')
-
-opts, args = parser.parse_args()
-verbose = opts.verbose
-
-if opts.input_file:
-	input_file = open(opts.input_file, 'r')
-	# Prepend the URLs from the file in front of the URLs from the command line.
-	# Also, ignore comments in the file.
-	args = [URL for URL in strip_newlines(input_file) if URL and not URL.startswith('#')] + args
-
-download_urls = {} # Domain => [URL]
-
-argvs = {
-	'tar.gz':  ['tar', 'xz'],
-	'tgz':     ['tar', 'xz'],
-	'tar.bz2': ['tar', 'xj'],
-	'tbz':     ['tar', 'xj'],
-	'zip':     ['unzip'],
-}
-def argv_from_filename(filename):
-	# Look through the extensions we know we can handle. Stop looking if we find the extension of this filename.
-	chunks = filename.split('.')
-	for range_len in xrange(1, len(chunks) + 1):
-		# Join the last range_len chunks.
-		ext = '.'.join(chunks[-range_len:])
-		try:             argv = argvs[ext]
-		except KeyError: pass
-		else:
-			# Include our filename as the last argument.
-			# Remember to copy the list here, so we don't modify the list in the dictionary.
-			argv = list(argv)
-			if argv[0] != 'tar':
-				argv.append(filename)
-			return argv
-known_extensions = set()
-for key in argvs:
-	# Add these extensions to the set by union.
-	known_extensions.update(set(key.split('.')))
-
-import os, sys
-children = []
-
-import urlparse
-for url in args:
-	parsed = urlparse.urlparse(url)
-
-	# Find out whether this URL has already been downloaded and unpacked. If it has, ask the user whether we should clobber it (as in the case of an aborted download). We could just use tar -U, but letting the user answer no here saves bandwidth usage when redownloading isn't necessary.
-	path = parsed.path
-	filename = os.path.split(path)[1]
-	chunks = filename.rsplit('.', 1) #For example: 'SurfWriter-1.0.tar', 'gz'
-	while chunks[1] in known_extensions:
-		chunks = chunks[0].rsplit('.', 1)
-	else:
-		#Last part isn't a filename extension. For example, it may be the 0 in 'SurfWriter-1.0'. Summon all the horses and all the king's men.
-		dirname = '.'.join(chunks)
-
-	if os.path.exists(dirname):
-		# Note: We can't use raw_input here because it reads from stdin, and we may be running under xargs. We must use the terminal instead.
-		tty = file('/dev/tty', 'r+')
-		tty.write('%s already exists. Remove and redownload it? [yN] ' % (dirname,))
-		tty.flush()
-		answer = tty.readline()
-		# lstrip: Remove leading whitespace.
-		# [:1]: Get only the first character, returning empty (rather than raising IndexError) if the string is empty.
-		# lower: Drop case of all (one) characters.
-		if answer.lstrip()[:1].lower() == 'y':
-			pid = os.fork()
-			if pid > 0:
-				children.append(pid)
-			else:
-				assert pid == 0
-				dirname_old = dirname + '-old'
-				os.rename(dirname, dirname_old)
-				os.execvp('rm', ['rm', '-Rf', dirname_old])
-		else:
-			# Skip this URL by not adding it to download_urls.
-			continue
-
-	# netloc = domain[:port]. Split on the port number (if present) and get everything before it.
-	domain = urlparse.urlparse(url).netloc.rsplit(':', 1)[0]
-	download_urls.setdefault(domain, [])
-	download_urls[domain].append(url)
-
-import time
-debug_log(download_urls)
-for domain in download_urls:
-	# If we have the maximum number of child processes already, wait for one to exit before spawning more.
-	debug_log('children:', children)
-	while len(children) >= opts.jobs:
-		exited_pid, exit_status = os.waitpid(-1, os.WNOHANG)
-		if exited_pid > 0:
-			# A child exited! We can proceed.
-			# Don't forget to remove it from the list of children, so we don't have to wait for it anymore.
-			del children[children.index(exited_pid)]
-			break
-		time.sleep(1)
-
-	child = os.fork()
-	if child > 0:
-		# We're the parent.
-		children.append(child)
-		# This sleep is mainly so the debug logs from different children don't collide.
-		time.sleep(0.1)
-		continue
-
-	assert child == 0
-
-	downloaded_files = set()
-
-	urls = download_urls[domain]
-	debug_log('URLs to download:', urls)
-	for url in urls:
-		curl_argv = ['curl', url]
-		filename = os.path.split(urlparse.urlparse(url).path)[-1]
-		tar_argv = argv_from_filename(filename)
-		if tar_argv[0] != 'tar':
-			tar_argv = None
-			#Insert the -O option just before the URL, since we'll be saving the archive file to disk to pass to the unpacker.
-			curl_argv.insert(3, '-O')
-		whole_argv = (curl_argv + ['|'] + tar_argv) if tar_argv else curl_argv
-		print_argv(whole_argv)
-
-		pid = os.fork()
-		if pid == 0:
-			# We are the child, which will become curl or tar.
-			read_end, write_end = os.pipe() if tar_argv else (None, None)
-
-			curl_pid = os.fork()
-			assert curl_pid >= 0
-			if curl_pid == 0:
-				if write_end is not None: os.dup2(write_end, sys.stdout.fileno())
-				os.close(read_end)




More information about the commits mailing list