# Path: scripts/pkgs/constants.py
# PATCHES = ROOT + 'patches'
# 
# Path: scripts/pkgs/utils.py
# def simple_build(configure_args=(), make_args=(), install_args=(), library_path=None, override_prefix=None, no_parallel=False, configure_name='./configure'):
#     if isinstance(configure_args, type('')):
#         configure_args = split(configure_args)
#     if isinstance(make_args, type('')):
#         make_args = split(make_args)
#     if isinstance(install_args, type('')):
#         install_args = split(install_args)
#     run(configure_name, '--prefix=' + (override_prefix or build_dir()), *configure_args)
#     make_opts = [] if no_parallel else split(MAKEOPTS)
#     run('make', *(make_opts + list(make_args)))
#     mi = ['make'] + list(install_args) + ['install']
#     run(*mi, library_path=library_path)
# 
# def apply_patch(name, level=0, reverse=False, convert_line_endings=False):
#     if not os.path.isabs(name):
#         name = os.path.join(PATCHES, name)
#     patch = 'C:/cygwin64/bin/patch' if iswindows else 'patch'
#     args = [patch, '-p%d' % level, '-i', name]
#     if reverse:
#         args.insert(1, '-R')
#     if iswindows and convert_line_endings:
#         run('C:/cygwin64/bin/unix2dos', name)
#         args.insert(1, '--binary')
#     run(*args)


import glob
import os
from .constants import PATCHES
from .utils import simple_build, apply_patch
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>

from __future__ import (unicode_literals, division, absolute_import,
                        print_function)


def main(args):
    patches = glob.glob(os.path.join(PATCHES, 'readline??-???'))

# Path: scripts/pkgs/constants.py
# PATCHES = ROOT + 'patches'
# 
# Path: scripts/pkgs/utils.py
# def simple_build(configure_args=(), make_args=(), install_args=(), library_path=None, override_prefix=None, no_parallel=False, configure_name='./configure'):
#     if isinstance(configure_args, type('')):
#         configure_args = split(configure_args)
#     if isinstance(make_args, type('')):
#         make_args = split(make_args)
#     if isinstance(install_args, type('')):
#         install_args = split(install_args)
#     run(configure_name, '--prefix=' + (override_prefix or build_dir()), *configure_args)
#     make_opts = [] if no_parallel else split(MAKEOPTS)
#     run('make', *(make_opts + list(make_args)))
#     mi = ['make'] + list(install_args) + ['install']
#     run(*mi, library_path=library_path)
# 
# def apply_patch(name, level=0, reverse=False, convert_line_endings=False):
#     if not os.path.isabs(name):
#         name = os.path.join(PATCHES, name)
#     patch = 'C:/cygwin64/bin/patch' if iswindows else 'patch'
#     args = [patch, '-p%d' % level, '-i', name]
#     if reverse:
#         args.insert(1, '-R')
#     if iswindows and convert_line_endings:
#         run('C:/cygwin64/bin/unix2dos', name)
#         args.insert(1, '--binary')
#     run(*args)


# Path: scripts/pkgs/readline.py
import glob
import os
from .constants import PATCHES
from .utils import simple_build, apply_patch

#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>

from __future__ import (unicode_literals, division, absolute_import,
                        print_function)


def main(args):
    patches = glob.glob(os.path.join(PATCHES, 'readline??-???'))

    if not patches: