'Internal compile.sh scripts hardcode number of cores to build with.
Filter these out so Spack can control it.'

def patch(self):

    files = ['compile.sh', 'parallel/modified_kahip/compile.sh', 'parallel/parallel_src/compile.sh']
    for f in files:
        filter_file('NCORES=.*', 'NCORES={0}'.format(make_jobs), f)
