# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python class Recipe(recipe.Recipe): name = 'winpthreads' version = '20100604' licenses = [License.LGPL] btype = BuildType.CUSTOM stype = SourceType.CUSTOM files_libs = [] files_devel = ['include/pthread.h', 'include/pthreads_win32_config.h', 'include/sched.h', 'include/semaphore.h'] def prepare(self): if self.config.target_arch == Architecture.X86: self.libname = 'pthreadGC2-w32' if self.config.target_arch == Architecture.X86_64: self.libname = 'pthreadGC2-w64' self.dllname = self.libname + '.dll' self.files_libs = [self.libname] def install(self): import shutil from cerbero.errors import FatalError if self.config.target_platform != Platform.WINDOWS: raise FatalError("%s can only be installed on Windows" % self.name) shutil.copy(os.path.join(self.config.toolchain_prefix, 'bin', self.dllname), os.path.join(self.config.prefix, 'bin', self.dllname)) for f in self.files_devel: shutil.copy(os.path.join(self.config.toolchain_prefix, self.config.host, f), os.path.join(self.config.prefix, f))