'Retrieve the patch in a temporary stage, computes
self.path and calls `super().apply(stage)`
Args:
stage: stage for the package that needs to be patched'

def apply(self, stage):

    fetcher = fs.URLFetchStrategy(self.url, digest=self.md5)
    mirror = join_path(os.path.dirname(stage.mirror_path), os.path.basename(self.url))
    with spack.stage.Stage(fetcher, mirror_path=mirror) as patch_stage:
        patch_stage.fetch()
        patch_stage.check()
        patch_stage.cache_local()
        patch_stage.expand_archive()
        self.path = os.path.abspath(os.listdir(patch_stage.path).pop())
        super(UrlPatch, self).apply(stage)
