'Patch setup.py to provide lib and include directories
for dependencies.'

def patch(self):

    spec = self.spec
    setup = FileFilter('setup.py')
    if ('+jpeg' in spec):
        setup.filter('JPEG_ROOT    =    None', 'JPEG_ROOT    =    ("{0}",    "{1}")'.format(spec['jpeg'].prefix.lib, spec['jpeg'].prefix.include))
    if ('+zlib' in spec):
        setup.filter('ZLIB_ROOT    =    None', 'ZLIB_ROOT    =    ("{0}",    "{1}")'.format(spec['zlib'].prefix.lib, spec['zlib'].prefix.include))
    if ('+tiff' in spec):
        setup.filter('TIFF_ROOT    =    None', 'TIFF_ROOT    =    ("{0}",    "{1}")'.format(spec['libtiff'].prefix.lib, spec['libtiff'].prefix.include))
    if ('+freetype' in spec):
        setup.filter('FREETYPE_ROOT    =    None', 'FREETYPE_ROOT    =    ("{0}",    "{1}")'.format(spec['freetype'].prefix.lib, spec['freetype'].prefix.include))
    if ('+lcms' in spec):
        setup.filter('LCMS_ROOT    =    None', 'LCMS_ROOT    =    ("{0}",    "{1}")'.format(spec['lcms'].prefix.lib, spec['lcms'].prefix.include))
    if ('+jpeg2000' in spec):
        setup.filter('JPEG2K_ROOT    =    None', 'JPEG2K_ROOT    =    ("{0}",    "{1}")'.format(spec['openjpeg'].prefix.lib, spec['openjpeg'].prefix.include))
