<commit_before>import itertools
import os
import re
import shutil
import string
import sys
import tempfile
import subprocess
import stat

if __name__ == "__main__":
    sys.path.append('../..')

from bockbuild.darwinprofile import DarwinProfile
from bockbuild.util.util import *
from glob import glob


class MonoReleaseProfile(DarwinProfile):

    packages = [
        'autoconf',
        'automake',
        'gettext',
        'pkg-config',

        # Base Libraries
        'libpng',
        'libjpeg',
        'libtiff',
        'libgif',
        'libxml2',
        'freetype',
        'fontconfig',
        'pixman',
        'cairo',
        'libffi',
        'glib',
        'pango',
        'atk',
        'intltool',
        'gdk-pixbuf',
        'gtk+',
        'libglade',
        'sqlite',
        'expat',
        'ige-mac-integration',

        # Theme
        'libcroco',
        'librsvg',
        'hicolor-icon-theme',
        'gtk-engines',
        'murrine',
        'xamarin-gtk-theme',
        'gtk-quartz-engine',

        # Mono
        'mono-llvm',
        'mono_master',
        'pcl-reference-assemblies',
        'libgdiplus',
        'xsp',
        'gtk-sharp',
        'ironlangs',
        'fsharp',
        'mono-basic',
        'nuget'
    ]

    def __init__(self):
        DarwinProfile.__init__(self, min_version=7)

        # quick disk space check (http://stackoverflow.com/questions/787776/)
        s = os.statvfs(self.root)
        free_space = (s.f_bavail * s.f_frsize) / (1024 * 1024 * 1024)  # in GB

        if free_space < 15:
            error('Low disk space (less than 15GB), aborting')

        # check for XQuartz installation (needed for libgdiplus)
        if not os.path.exists('/opt/X11/include/X11/Xlib.h'):
            error(
                'XQuartz is required to be installed (download from http://xquartz.macosforge.org/) ')

        self.MONO_ROOT = "/Library/Frameworks/Mono.framework"
        self.BUILD_NUMBER = "0"
        self.MDK_GUID = "964ebddd-1ffe-47e7-8128-5ce17ffffb05"

        self.self_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
        self.packaging_dir = os.path.join(self.self_dir, "packaging")

        system_mono_dir = '/Library/Frameworks/Mono.framework/Versions/Current'
        self.env.set('system_mono', os.path.join(
            system_mono_dir, 'bin', 'mono'))
        self.env.set('system_mcs', os.path.join(system_mono_dir, 'bin', 'mcs'))

        self.env.set('system_mono_version', backtick(
            '%s --version' % self.env.system_mono)[0])

        # config overrides for some programs to be functional while staged

        self.env.set('GDK_PIXBUF_MODULE_FILE',
                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache')
        self.env.set('GDK_PIXBUF_MODULEDIR',
                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders')
        self.env.set('PANGO_SYSCONFDIR', '%{staged_prefix}/etc')
        self.env.set('PANGO_LIBDIR', '%{staged_prefix}/lib')
        # self.env.set ('MONO_PATH', '%{staged_prefix}/lib/mono/4.0')
        self.debug_info = ['gtk+', 'cairo',
                           'pango', 'mono', 'llvm', 'libgdiplus']

    def setup_release(self):
        self.mono_package = self.release_packages['mono']
        self.mono_package.fetch()

        verbose('Mono version: %s' % self.mono_package.version)
        self.RELEASE_VERSION = self.mono_package.version
        self.prefix = os.path.join(
            self.MONO_ROOT, "Versions", self.RELEASE_VERSION)

        if os.path.exists(self.prefix):
            error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix)

        self.calculate_updateid()
        trace(self.package_info('MDK'))<commit_msg>[mono-mac] Fix missing cache_host attribute<commit_after>import itertools
import os
import re
import shutil
import string
import sys
import tempfile
import subprocess
import stat

if __name__ == "__main__":
    sys.path.append('../..')

from bockbuild.darwinprofile import DarwinProfile
from bockbuild.util.util import *
from glob import glob


class MonoReleaseProfile(DarwinProfile):

    packages = [
        'autoconf',
        'automake',
        'gettext',
        'pkg-config',

        # Base Libraries
        'libpng',
        'libjpeg',
        'libtiff',
        'libgif',
        'libxml2',
        'freetype',
        'fontconfig',
        'pixman',
        'cairo',
        'libffi',
        'glib',
        'pango',
        'atk',
        'intltool',
        'gdk-pixbuf',
        'gtk+',
        'libglade',
        'sqlite',
        'expat',
        'ige-mac-integration',

        # Theme
        'libcroco',
        'librsvg',
        'hicolor-icon-theme',
        'gtk-engines',
        'murrine',
        'xamarin-gtk-theme',
        'gtk-quartz-engine',

        # Mono
        'mono-llvm',
        'mono_master',
        'pcl-reference-assemblies',
        'libgdiplus',
        'xsp',
        'gtk-sharp',
        'ironlangs',
        'fsharp',
        'mono-basic',
        'nuget'
    ]

    def __init__(self):
        DarwinProfile.__init__(self, min_version=7)

        # quick disk space check (http://stackoverflow.com/questions/787776/)
        s = os.statvfs(self.root)
        free_space = (s.f_bavail * s.f_frsize) / (1024 * 1024 * 1024)  # in GB

        if free_space < 15:
            error('Low disk space (less than 15GB), aborting')

        # check for XQuartz installation (needed for libgdiplus)
        if not os.path.exists('/opt/X11/include/X11/Xlib.h'):
            error(
                'XQuartz is required to be installed (download from http://xquartz.macosforge.org/) ')

        self.MONO_ROOT = "/Library/Frameworks/Mono.framework"
        self.BUILD_NUMBER = "0"
        self.MDK_GUID = "964ebddd-1ffe-47e7-8128-5ce17ffffb05"

        self.self_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
        self.packaging_dir = os.path.join(self.self_dir, "packaging")

        system_mono_dir = '/Library/Frameworks/Mono.framework/Versions/Current'
        self.env.set('system_mono', os.path.join(
            system_mono_dir, 'bin', 'mono'))
        self.env.set('system_mcs', os.path.join(system_mono_dir, 'bin', 'mcs'))

        self.env.set('system_mono_version', backtick(
            '%s --version' % self.env.system_mono)[0])

        # config overrides for some programs to be functional while staged

        self.env.set('GDK_PIXBUF_MODULE_FILE',
                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache')
        self.env.set('GDK_PIXBUF_MODULEDIR',
                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders')
        self.env.set('PANGO_SYSCONFDIR', '%{staged_prefix}/etc')
        self.env.set('PANGO_LIBDIR', '%{staged_prefix}/lib')
        # self.env.set ('MONO_PATH', '%{staged_prefix}/lib/mono/4.0')
        self.debug_info = ['gtk+', 'cairo',
                           'pango', 'mono', 'llvm', 'libgdiplus']
        self.cache_host = None

    def setup_release(self):
        self.mono_package = self.release_packages['mono']
        self.mono_package.fetch()

        verbose('Mono version: %s' % self.mono_package.version)
        self.RELEASE_VERSION = self.mono_package.version
        self.prefix = os.path.join(
            self.MONO_ROOT, "Versions", self.RELEASE_VERSION)

        if os.path.exists(self.prefix):
            error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix)

        self.calculate_updateid()
        trace(self.package_info('MDK'))
{'fraction_non_alphanumeric': 0.13793556870479948, 'fraction_numerical': 0.01604207758053912, 'mean_word_length': 2.13520197856554, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5987427', 'n_tokens_mistral': 2675, 'n_tokens_neox': 2537, 'n_words': 447}