<commit_before># -*- coding: utf-8 -*-
import __builtin__
from PackagesBase import Package
import os, platform
import urllib2, os, tarfile, shutil
import multiprocessing
        

###################################################################################################

class FFTW3(Package):
    src_uri = 'http://fftw.org/fftw-3.2.2.tar.gz'
    correctMD5sum = 'b616e5c91218cc778b5aa735fefb61ae'
    workdir = 'fftw-3.2.2'
    
    def conf_all(self):
        return " --enable-shared --enable-portable-binary --disable-fortran --prefix=" + self.prefix

    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no " + self.conf_all()

    def configure_linux(self):
        return "./configure "  + self.conf_all()

###################################################################################################

class FFTW3F(Package):
    src_uri = 'http://fftw.org/fftw-3.2.2.tar.gz'
    correctMD5sum = 'b616e5c91218cc778b5aa735fefb61ae'
    workdir = 'fftw-3.2.2'

    def conf_all(self):
        return " --enable-single --enable-shared --enable-portable-binary --disable-fortran --prefix=" + self.prefix

    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no " + self.conf_all()

    def configure_linux(self):
        return "./configure "  + self.conf_all()

###################################################################################################

class JpegPackage(Package):
    src_uri = 'http://www.ijg.org/files/jpegsrc.v8c.tar.gz'
    workdir = 'jpeg-8c'
    
    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no --prefix=" + self.prefix

    def configure_linux(self):
        return "./configure  --prefix=" + self.prefix

###################################################################################################

class TiffPackage(Package):
    src_uri = 'http://download.osgeo.org/libtiff/tiff-3.9.4.tar.gz'
    workdir ='tiff-3.9.4'
    
    def configure_darwin(self):
        return """./configure --enable-static=no \\
                             --disable-dependency-tracking \\
                             --with-apple-opengl-framework \\
                             --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --prefix=%s""" % self.prefix

###################################################################################

class PngPackage(Package):
    src_uri = 'http://prdownloads.sourceforge.net/libpng/libpng-1.4.5.tar.gz'
    workdir = 'libpng-1.4.5'
    
    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                             --enable-static=no \\
                             --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                             --prefix=%s""" % self.prefix
###################################################################################################        

class SlibPackage(Package):
    src_uri='http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz'
    workdir = 'szip-2.1'
    
    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                           --enable-static=no \\
                           --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                           --prefix=%s""" % self.prefix
###################################################################################################
        
class ZlibPackage(Package):
    src_uri = 'http://zlib.net/zlib-1.2.5.tar.gz'
    workdir = 'zlib-1.2.5'
    
    def unpack(self):
        Package.unpack(self)
    
    def configure_darwin(self):
        return """./configure --64 \\
                              --prefix='%s'"""  % self.prefix

    def configure_linux(self):
        return """./configure --64 \\
                              --prefix='%s'"""  % self.prefix
###################################################################################################

class Hdf5Package(Package):
    src_uri = 'http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.7.tar.gz'
    #correctMD5sum = 'df131d156634608e4a7bf26baeafc940'
    workdir ='hdf5-1.8.7'
    
    def unpack(self):
        Package.unpack(self)

    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                             --enable-static=no \\
                             --prefix='%s'""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                              --prefix='%s'""" % self.prefix

###################################################################################################

class BoostPackage(Package):
    src_uri = 'http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2'
    workdir = 'boost_1_45_0'
    
    #def unpack(self):
    #    pass
    
    def configure(self):
        #Package.configure(self)
        if platform.system() == "Darwin":
            self.oldCC  =  os.environ["CC"]
            self.oldCXX =  os.environ["CXX"]
            os.environ["CC"]  = gcc#+" -arch x86_64"
            os.environ["CXX"] = gpp#+" -arch x86_64"
        cmd = """./bootstrap.sh --prefix=%s \\
                                --with-python=%s \\
                                --with-libraries=python""" % (self.prefix, pythonExecutable)
        self.system(cmd)
        if platform.system() == "Darwin":
            os.environ["CC"]  = self.oldCC
            os.environ["CXX"] = self.oldCXX

    def make(self):
        pass
    
    def makeInstall(self):
        self.system("./bjam install --prefix=%s" % self.prefix)

################################################################################

class PythonPackage(Package):
    src_uri = 'http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tar.bz2'
    workdir = 'Python-2.7.1'
    #patches=['patch-Mac-PythonLauncher-Makefile.in.diff']
    
    def unpack(self):
        Package.unpack(self)
    
    def configure_darwin(self):
        return """DESTDIR=%s \\
                 ./configure --prefix=%s \\
                             --enable-framework=%s/Frameworks \\
               """ % (self.prefix,self.prefix,self.prefix)

    def configure_linux(self):
        return "DESTDIR=%s ./configure --prefix=%s --enable-shared" \
                % (self.prefix,self.prefix)

    def make(self):
        if platform.system() == 'Darwin':
            self.system("find . -name Makefile | xargsips -n1 sed -i '.bkp' -e \"s|PYTHONAPPSDIR=/Applications/|PYTHONAPPSDIR=%s/Applications/|g\"" %  self.prefix)
     	self.system("make DESTDIR=%s" % self.prefix)
     	
    def makeInstall(self):
        self.system("make install DESTDIR=''")
    
##################################################################################

class NosePackage(Package):
    src_uri ='http://somethingaboutorange.com/mrl/projects/nose/nose-1.0.0.tar.gz'
    workdir = 'nose-1.0.0'
    
    def unpack(self):
        Package.unpack(self)
    def configure(self):
        pass
    def make(self):        <commit_msg>corrected bug in the python package<commit_after># -*- coding: utf-8 -*-
import __builtin__
from PackagesBase import Package
import os, platform
import urllib2, os, tarfile, shutil
import multiprocessing
        

###################################################################################################

class FFTW3(Package):
    src_uri = 'http://fftw.org/fftw-3.2.2.tar.gz'
    correctMD5sum = 'b616e5c91218cc778b5aa735fefb61ae'
    workdir = 'fftw-3.2.2'
    
    def conf_all(self):
        return " --enable-shared --enable-portable-binary --disable-fortran --prefix=" + self.prefix

    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no " + self.conf_all()

    def configure_linux(self):
        return "./configure "  + self.conf_all()

###################################################################################################

class FFTW3F(Package):
    src_uri = 'http://fftw.org/fftw-3.2.2.tar.gz'
    correctMD5sum = 'b616e5c91218cc778b5aa735fefb61ae'
    workdir = 'fftw-3.2.2'

    def conf_all(self):
        return " --enable-single --enable-shared --enable-portable-binary --disable-fortran --prefix=" + self.prefix

    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no " + self.conf_all()

    def configure_linux(self):
        return "./configure "  + self.conf_all()

###################################################################################################

class JpegPackage(Package):
    src_uri = 'http://www.ijg.org/files/jpegsrc.v8c.tar.gz'
    workdir = 'jpeg-8c'
    
    def configure_darwin(self):
        return "./configure --disable-dependency-tracking --enable-static=no --prefix=" + self.prefix

    def configure_linux(self):
        return "./configure  --prefix=" + self.prefix

###################################################################################################

class TiffPackage(Package):
    src_uri = 'http://download.osgeo.org/libtiff/tiff-3.9.4.tar.gz'
    workdir ='tiff-3.9.4'
    
    def configure_darwin(self):
        return """./configure --enable-static=no \\
                             --disable-dependency-tracking \\
                             --with-apple-opengl-framework \\
                             --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --prefix=%s""" % self.prefix

###################################################################################

class PngPackage(Package):
    src_uri = 'http://prdownloads.sourceforge.net/libpng/libpng-1.4.5.tar.gz'
    workdir = 'libpng-1.4.5'
    
    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                             --enable-static=no \\
                             --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                             --prefix=%s""" % self.prefix
###################################################################################################        

class SlibPackage(Package):
    src_uri='http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz'
    workdir = 'szip-2.1'
    
    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                           --enable-static=no \\
                           --prefix=%s""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                           --prefix=%s""" % self.prefix
###################################################################################################
        
class ZlibPackage(Package):
    src_uri = 'http://zlib.net/zlib-1.2.5.tar.gz'
    workdir = 'zlib-1.2.5'
    
    def unpack(self):
        Package.unpack(self)
    
    def configure_darwin(self):
        return """./configure --64 \\
                              --prefix='%s'"""  % self.prefix

    def configure_linux(self):
        return """./configure --64 \\
                              --prefix='%s'"""  % self.prefix
###################################################################################################

class Hdf5Package(Package):
    src_uri = 'http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.7.tar.gz'
    #correctMD5sum = 'df131d156634608e4a7bf26baeafc940'
    workdir ='hdf5-1.8.7'
    
    def unpack(self):
        Package.unpack(self)

    def configure_darwin(self):
        return """./configure --disable-dependency-tracking \\
                             --enable-static=no \\
                             --prefix='%s'""" % self.prefix

    def configure_linux(self):
        return """./configure --enable-static=no \\
                              --prefix='%s'""" % self.prefix

###################################################################################################

class BoostPackage(Package):
    src_uri = 'http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2'
    workdir = 'boost_1_45_0'
    
    #def unpack(self):
    #    pass
    
    def configure(self):
        #Package.configure(self)
        if platform.system() == "Darwin":
            self.oldCC  =  os.environ["CC"]
            self.oldCXX =  os.environ["CXX"]
            os.environ["CC"]  = gcc#+" -arch x86_64"
            os.environ["CXX"] = gpp#+" -arch x86_64"
        cmd = """./bootstrap.sh --prefix=%s \\
                                --with-python=%s \\
                                --with-libraries=python""" % (self.prefix, pythonExecutable)
        self.system(cmd)
        if platform.system() == "Darwin":
            os.environ["CC"]  = self.oldCC
            os.environ["CXX"] = self.oldCXX

    def make(self):
        pass
    
    def makeInstall(self):
        self.system("./bjam install --prefix=%s" % self.prefix)

################################################################################

class PythonPackage(Package):
    src_uri = 'http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tar.bz2'
    workdir = 'Python-2.7.1'
    #patches=['patch-Mac-PythonLauncher-Makefile.in.diff']
    
    def unpack(self):
        Package.unpack(self)
    
    def configure_darwin(self):
        return """DESTDIR=%s \\
                 ./configure --prefix=%s \\
                             --enable-framework=%s/Frameworks \\
               """ % (self.prefix,self.prefix,self.prefix)

    def configure_linux(self):
        return "DESTDIR=%s ./configure --prefix=%s --enable-shared" \
                % (self.prefix,self.prefix)

    def make(self):
        if platform.system() == 'Darwin':
            self.system("find . -name Makefile | xargs -n1 sed -i '.bkp' -e \"s|PYTHONAPPSDIR=/Applications/|PYTHONAPPSDIR=%s/Applications/|g\"" %  self.prefix)
     	self.system("make DESTDIR=%s" % self.prefix)
     	
    def makeInstall(self):
        self.system("make install DESTDIR=''")
    
##################################################################################

class NosePackage(Package):
    src_uri ='http://somethingaboutorange.com/mrl/projects/nose/nose-1.0.0.tar.gz'
    workdir = 'nose-1.0.0'
    
    def unpack(self):
        Package.unpack(self)
    def configure(self):
        pass
    def make(self):        
{'fraction_non_alphanumeric': 0.2750528685449212, 'fraction_numerical': 0.020738113104577394, 'mean_word_length': 2.3716651333946643, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977554', 'n_tokens_mistral': 4425, 'n_tokens_neox': 4184, 'n_words': 649}