# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.utils import messages as m import shutil class Recipe(recipe.Recipe): name = 'pixman' version = '0.38.4' stype = SourceType.TARBALL url = 'https://cairographics.org/releases/pixman-%(version)s.tar.gz' tarball_checksum = 'da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7' licenses = [{License.MIT: ['COPYING']}] autoreconf = True patches = ['pixman/0001-Fix-build-on-Android.patch', 'pixman/0002-Enable-CPU-detection-on-Android.patch' ] files_libs = ['libpixman-1'] files_devel = ['include/pixman-1', 'lib/pkgconfig/pixman-1.pc'] def prepare(self): # clang from xcode has a known bug, avoid codepath that trigger it # More info : https://github.com/Homebrew/homebrew/issues/41056 if self.config.target_platform in [ Platform.DARWIN, Platform.IOS ] and \ self.config.target_arch in [ Architecture.X86, Architecture.X86_64 ]: self.configure_options = '--disable-mmx' if self.config.target_platform == Platform.IOS: self.append_env('CFLAGS', '-DPIXMAN_NO_TLS') if self.config.target_platform == Platform.ANDROID: # FIXME: Fails to link because of undefined __builtin_* symbols self.configure_options = '--disable-arm-iwmmxt' # Prevent symbol conflicts self.append_env('CFLAGS', '-Dandroid_getCpuFamily=pixman_android_getCpuFamily', '-Dandroid_getCpuFeatures=pixman_android_getCpuFeatures', '-Dandroid_getCpuCount=pixman_android_getCpuCount', '-Dandroid_cpuInit=pixman_android_cpuInit', '-Dandroid_cpuInitDummy=pixman_android_cpuInitDummy', '-Dandroid_getCpuIdArm=pixman_android_getCpuIdArm', '-Dandroid_setCpu=pixman_android_setCpu', '-Dandroid_setCpuArm=pixman_android_setCpuArm') async def configure(self): if self.config.target_platform == Platform.ANDROID: cpufeatures_path = os.path.join(self.config.toolchain_prefix, 'sources', 'android', 'cpufeatures') o = os.path.join(cpufeatures_path, 'cpu-features.h') f = os.path.join(self.make_dir, 'pixman') m.action("copying %s to %s" % (o, f), logfile=self.logfile) shutil.copy(o, f) o = os.path.join(cpufeatures_path, 'cpu-features.c') f = os.path.join(self.make_dir, 'pixman') m.action("copying %s to %s" % (o, f), logfile=self.logfile) shutil.copy(o, f) await super(recipe.Recipe, self).configure()