<commit_before>#!/usr/bin/env python

"""
Build script for pynifti and nifticlibs.  Modified form the original version
that required SWIG for building, include the generated swig wrapper file.

#   See COPYING file distributed along with the PyNIfTI package for the
#   copyright and license terms.
"""

__docformat__ = 'restructuredtext'

from os.path import join

def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs

    # debug
    from numpy.distutils import system_info
    system_info.verbosity = 1

    config = Configuration('nifti', parent_package, top_path)
 
    nifticlib_include_dirs = [get_numpy_include_dirs(),
                              join('nifti', 'nifticlib', 'include')]

    # znz library
    znzlib_src = join('nifti', 'nifticlib', 'znzlib', 'znzlib.c')
    config.add_library('znz',
                       sources = znzlib_src,
                       headers = join('nifti', 'nifticlib', 'znzlib', 
                                      'znzlib.h'),
                       libraries = 'z')

    # niftiio library
    niftiio_src = join('nifti', 'nifticlib', 'niftilib', 'nifti1_io.c')
    config.add_library('niftilib',
                       sources = niftiio_src,
                       headers = join('nifti', 'nifticlib', 'niftilib',
                                    'nifti1_io.h'),
                       include_dirs = nifticlib_include_dirs)

    # nifticlib extension
    nifticlib_src = join('nifti', 'nifticlib_wrap.c')
    config.add_extension(join('nifti', '_nifticlib'),
                         sources = nifticlib_src,
                         include_dirs = [nifticlib_include_dirs,
                                         join('usr', 'lib')],
                         libraries = ['znz', 'niftilib'],
                         depends = [znzlib_src, niftiio_src])

    return config

if __name__ == '__main__':
    from numpy.distutils.core import setup
    setup(version      = '0.20070930.1',
          author       = '<NAME>',
          author_email = '<EMAIL>',
          license      = 'MIT License',
          url          = 'http://apsy.gse.uni-magdeburg.de/hanke',
          description  = 'Python interface for the NIfTI IO libraries',
          **configuration(top_path='').todict())<commit_msg>Add macros for zlib support.<commit_after>#!/usr/bin/env python

"""
Build script for pynifti and nifticlibs.  Modified form the original version
that required SWIG for building, include the generated swig wrapper file.

External Dependency
-------------------
The nifticlibs depends on the zlib library.  This should be installed on all
Unix based systems, it may require an extra install on Windows.
http://www.zlib.net/

#   See COPYING file distributed along with the PyNIfTI package for the
#   copyright and license terms.
"""

__docformat__ = 'restructuredtext'

from os.path import join

def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs

    config = Configuration('nifti', parent_package, top_path)
 
    nifticlib_include_dirs = [get_numpy_include_dirs(),
                              join('nifti', 'nifticlib', 'include')]

    # The c source files have several ifdef's that only compile in
    # support for zlib if this is defined.
    define_have_zlib = ('HAVE_ZLIB', '1')

    # znz library
    znzlib_src = join('nifti', 'nifticlib', 'znzlib', 'znzlib.c')
    config.add_library('znz',
                       sources = znzlib_src,
                       macros = [define_have_zlib],
                       headers = join('nifti', 'nifticlib', 'znzlib', 
                                      'znzlib.h'),
                       libraries = 'z')

    # niftiio library
    niftiio_src = join('nifti', 'nifticlib', 'niftilib', 'nifti1_io.c')
    config.add_library('niftilib',
                       sources = niftiio_src,
                       macros = [define_have_zlib],
                       headers = join('nifti', 'nifticlib', 'niftilib',
                                    'nifti1_io.h'),
                       include_dirs = nifticlib_include_dirs)

    # nifticlib extension
    nifticlib_src = join('nifti', 'nifticlib_wrap.c')
    config.add_extension(join('nifti', '_nifticlib'),
                         sources = nifticlib_src,
                         define_macros = [define_have_zlib],
                         include_dirs = [nifticlib_include_dirs],
                         libraries = ['znz', 'niftilib'],
                         depends = [znzlib_src, niftiio_src])

    return config

if __name__ == '__main__':
    from numpy.distutils.core import setup
    setup(**configuration(top_path='').todict())
    """
    setup(version      = '0.20070930.1',
          author       = '<NAME>',
          author_email = '<EMAIL>',
          license      = 'MIT License',
          url          = 'http://apsy.gse.uni-magdeburg.de/hanke',
          description  = 'Python interface for the NIfTI IO libraries',
          **configuration(top_path='').todict())
    """
{'fraction_non_alphanumeric': 0.1095917171322524, 'fraction_numerical': 0.005079117015042001, 'mean_word_length': 2.0530709600477044, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '2219808', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1527, 'n_words': 351}