summaryrefslogtreecommitdiff
path: root/recipes/bionic-fixup.recipe
blob: 0c00ab1730b291175466b07cd596e6bd1f2a6763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

import os
import shutil

class Recipe(recipe.Recipe):
    """
    Contains headers that add workarounds/replacements for GNU libc extensions.
    These have been taken from platform/external/elfutils/bionic-fixup in AOSP
    Currently, it only ships error.h from that set of fixups
    See:
    https://android.googlesource.com/platform/external/elfutils/+/android-4.4.1_r1/bionic-fixup/error.h
    """
    name = 'bionic-fixup'
    version = '4.4.1'
    licenses = [License.Apachev2]
    btype = BuildType.CUSTOM
    stype = SourceType.CUSTOM
    files_devel = ['include/error.h']

    def prepare(self):
        if self.config.target_platform == Platform.LINUX:
            raise InvalidRecipeError(self, "Invalid platform")

    def install(self):
        include_path = os.path.join(self.config.install_dir, 'include')
        bionicfixup_path = os.path.join(self.config.recipes_dir, 'bionic-fixup')
        if not os.path.exists(include_path):
            os.makedirs(include_path)
        for f in os.listdir(bionicfixup_path):
            shutil.copy(os.path.join(bionicfixup_path, f), include_path)