All pastes #981340 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-04-11 18:44 UTC
rendered paste body
# -*- mode: python -*-

import sys
import errno

# Some utitilies:
#
def environ_append(key, value, separator=' '):
    try:
        old_value = os.environ[key]
        value = old_value + separator + value
    except:
        pass
    os.environ[key] = value

def environ_prepend(key, value, separator=' '):
    try:
        old_value = os.environ[key]
        value = value + separator + old_value
    except:
        pass
    os.environ[key] = value

def environ_get(key):
    try:
        return os.environ[key]
    except:
        return ""


# Moduleset to use.
#
moduleset = 'http://developer.imendio.com/svn/gtk-osx-build/gtk-osx.modules'

# A list of the modules to build.
#
modules = [ 'meta-gtk-osx-bootstrap', 'meta-gtk-osx-core' ]

# A list of modules to skip.
#
skip = [ 'python', 'gmp', 'guile' ]

# The directory where the source will be checked out to.
#
checkoutroot = os.path.expanduser('~/Source/gnome')

# The prefix to configure/install modules to (must have write access).
#
prefix = '/opt/gtk'

# Extra arguments to pass to all autogen.sh scripts.
#
autogenargs='--disable-static --disable-gtk-doc --disable-docs --disable-scrollkeeper'
alwaysautogen = True

# Set debugging format to the old one from Tiger and earlier since the new
# default in Leopard breaks many things. Also set gnu89 as the new default
# gnu99 changes how extern inline works, breaking, glib's inline setup,
# until glib is fixed.
#
os.environ['CFLAGS'] = '-O -gstabs+3 -std=gnu89'
os.environ['CXXFLAGS'] = '-O -gstabs+3'

# Use the included install-check program if available. It won't update
# timestamps if the header hasn't changed, which speeds up builds.
#
path = os.path.expanduser('~/bin/install-check')
if os.path.exists(path):
    os.environ['INSTALL'] = path

# Import optional user RC for further customization. You can override the
# prefix for example, or CFLAGS or module_autogenargs, etc.
#
userrc = os.path.join(os.environ['HOME'], '.jhbuildrc-custom')
try:
    execfile(userrc)
except EnvironmentError, e:
    userrc = None
    if e.errno != errno.ENOENT:
        pass # File not found is OK.

tarballdir = os.path.join(checkoutroot, 'pkgs')

os.environ['PREFIX'] = prefix # Deprecated, please move to JHBUILD_PREFIX.
os.environ['JHBUILD_PREFIX'] = prefix

os.environ['LIBTOOLIZE'] = prefix + '/bin/libtoolize'

# The option "headerpad_max_install_names" is there to leave some room for
# changing the library locations with install_name_tool. Note that GNU
# libtool seems to drop the option if we don't use -W here.
#
environ_append('LDFLAGS', '-Wl,-headerpad_max_install_names') #-headerpad_max_install_names')

# Make sure we find our installed modules, and before other versions.
environ_prepend('LDFLAGS', '-L' + prefix + '/lib')
environ_prepend('CPPFLAGS', '-I' + prefix + '/include')

# Add additional Python path so that our Python modules can be found.
#
version = 'python' + str(sys.version_info[0]) + '.' + str(sys.version_info[1])
environ_append('PYTHONPATH', prefix + '/lib/' + version + '/site-packages/gtk-2.0', ':')

# Likewise for Perl.
#
environ_append('PERL5LIB', prefix + '/lib/perl5/vendor_perl', ':')
environ_append('PERL5LIB', prefix + '/lib/perl5/site_perl', ':')

# Point gtk-doc and other xlstproc users to our XML catalog.
#
os.environ['XML_CATALOG_FILES'] = prefix + '/etc/xml/catalog'

# Speed up gettext build a lot by disabling unneeded stuff.
try:
    old_value = module_autogenargs['gettext']
except:
    old_value = autogenargs
module_autogenargs['gettext'] = old_value + ' --without-emacs --disable-java --disable-native-java'

if userrc:
    print "Using customized config: %s, prefix: %s" % (userrc, prefix)
else:
    print "Using prefix: %s" % (prefix)

if "shell" in sys.argv:
    print "Entered jhbuild shell, type 'exit' to return."