Annotation of pkgsrc/lang/python37/patches/patch-Mac_BuildScript_build-installer.py, revision 1.1

1.1     ! sjmulder    1: $NetBSD$
        !             2: 
        !             3: Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
        !             4: https://github.com/python/cpython/pull/22855
        !             5: 
        !             6: --- Mac/BuildScript/build-installer.py.orig    2020-08-15 05:20:16.000000000 +0000
        !             7: +++ Mac/BuildScript/build-installer.py
        !             8: @@ -116,7 +116,8 @@ WORKDIR = "/tmp/_py"
        !             9:  DEPSRC = os.path.join(WORKDIR, 'third-party')
        !            10:  DEPSRC = os.path.expanduser('~/Universal/other-sources')
        !            11:  
        !            12: -universal_opts_map = { '32-bit': ('i386', 'ppc',),
        !            13: +universal_opts_map = { 'universal2': ('arm64', 'x86_64'),
        !            14: +                       '32-bit': ('i386', 'ppc',),
        !            15:                         '64-bit': ('x86_64', 'ppc64',),
        !            16:                         'intel':  ('i386', 'x86_64'),
        !            17:                         'intel-32':  ('i386',),
        !            18: @@ -124,6 +125,7 @@ universal_opts_map = { '32-bit': ('i386'
        !            19:                         '3-way':  ('ppc', 'i386', 'x86_64'),
        !            20:                         'all':    ('i386', 'ppc', 'x86_64', 'ppc64',) }
        !            21:  default_target_map = {
        !            22: +        'universal2': '10.9',
        !            23:          '64-bit': '10.5',
        !            24:          '3-way': '10.5',
        !            25:          'intel': '10.5',
        !            26: @@ -190,6 +192,27 @@ EXPECTED_SHARED_LIBS = {}
        !            27:  def internalTk():
        !            28:      return getDeptargetTuple() >= (10, 6)
        !            29:  
        !            30: +
        !            31: +def tweak_tcl_build(basedir, archList):
        !            32: +    with open("Makefile", "r") as fp:
        !            33: +        contents = fp.readlines()
        !            34: +
        !            35: +    # For reasons I don't understand the tcl configure script
        !            36: +    # decides that some stdlib symbols aren't present, before
        !            37: +    # deciding that strtod is broken.
        !            38: +    new_contents = []
        !            39: +    for line in contents:
        !            40: +        if line.startswith("COMPAT_OBJS"):
        !            41: +            # note: the space before strtod.o is intentional,
        !            42: +            # the detection of a broken strtod results in
        !            43: +            # "fixstrod.o" on this line.
        !            44: +            for nm in ("strstr.o", "strtoul.o", " strtod.o"):
        !            45: +                line = line.replace(nm, "")
        !            46: +        new_contents.append(line)
        !            47: +
        !            48: +    with open("Makefile", "w") as fp:
        !            49: +        fp.writelines(new_contents)
        !            50: +
        !            51:  # List of names of third party software built with this installer.
        !            52:  # The names will be inserted into the rtf version of the License.
        !            53:  THIRD_PARTY_LIBS = []
        !            54: @@ -231,6 +257,7 @@ def library_recipes():
        !            55:                      '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
        !            56:                ],
        !            57:                useLDFlags=False,
        !            58: +              buildrecipe=tweak_tcl_build,
        !            59:                install='make TCL_LIBRARY=%(TCL_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s DESTDIR=%(DESTDIR)s'%{
        !            60:                    "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
        !            61:                    "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.6'%(getVersion())),
        !            62: @@ -801,6 +828,7 @@ def build_universal_openssl(basedir, arc
        !            63:          arch_opts = {
        !            64:              "i386": ["darwin-i386-cc"],
        !            65:              "x86_64": ["darwin64-x86_64-cc", "enable-ec_nistp_64_gcc_128"],
        !            66: +            "arm64": ["darwin64-arm64-cc"],
        !            67:              "ppc": ["darwin-ppc-cc"],
        !            68:              "ppc64": ["darwin64-ppc-cc"],
        !            69:          }

CVSweb <webmaster@jp.NetBSD.org>