Ticket #53197: 0001-py-sip-update-to-4.19-which-provides-SIP-API-12.0-th.patch

File 0001-py-sip-update-to-4.19-which-provides-SIP-API-12.0-th.patch, 5.8 KB (added by RJVB (René Bertin), 7 years ago)
  • python/py-sip/Portfile

    From 60c75e32b69a155ec8de92b2e5f3266b218ae4fe Mon Sep 17 00:00:00 2001
    From: Michael Dickens <michaelld@macports.org>
    Date: Fri, 30 Dec 2016 21:20:29 -0500
    Subject: [PATCH 1/1] py*-sip: update to 4.19, which provides SIP API 12.0 &
     thus requires dependent ports to be rev-bumped. This new API changes internal
     struct variable names, and the transition isn't entirely complete even though
     there's a new release ... so add in a temporary patch to fix the major
     variable name change from 'type' to 'wt_td' in the generated SIP code.
    
    ---
     python/py-sip/Portfile                          | 10 ++++--
     python/py-sip/files/patch-configure.py.diff     |  2 +-
     python/py-sip/files/patch-sipgen_gencode.c.diff | 47 +++++++++++++++++++++++++
     3 files changed, 55 insertions(+), 4 deletions(-)
     create mode 100644 python/py-sip/files/patch-sipgen_gencode.c.diff
    
    diff --git a/python/py-sip/Portfile b/python/py-sip/Portfile
    index 98ac9c9..48ea92e 100644
    a b long_description \ 
    2020
    2121homepage            http://www.riverbankcomputing.co.uk/software/sip/intro
    2222
    23 version             4.18.1
     23version             4.19
    2424
    2525# from siplib/sip.h.in:
    2626#
    version 4.18.1 
    3131# removed or the order changed then the major number must be
    3232# incremented and the minor number set to 0.
    3333#
     34# SIP 4.19[.0] provides SIP API 12.0
    3435# SIP 4.18.[0-1] provides SIP API 11.3
    3536# SIP 4.17.0 provides SIP API 11.2
    3637# SIP 4.16.[8-9] provides SIP API 11.2
    if {${name} ne ${subport}} { 
    5556        distname        sip-${version}
    5657    }
    5758
    58     checksums           rmd160 adcbd5a87b375e1b357922b608db45862ccf37ea \
    59                         sha256 9bce7a2dbf7f105bf68ad1bab58eebc0ce33087ec40396da756463f086ffa290
     59    checksums           rmd160 260c814e0ed4aa5ea90a8ac1f9100e7b9452ae21 \
     60                        sha256 014bf55f653e0d8bcc582705ef4fbd61e0859a36e959ab46d8fa060cdf0b5e27
    6061
    6162    patchfiles          patch-siputils.py.diff \
    6263                        patch-specs_macx-g++.diff \
    6364                        patch-configure.py.diff
    6465
     66    # temporary patch to fix struct variable name generation
     67    patchfiles-append   patch-sipgen_gencode.c.diff
     68
    6569    use_configure       yes
    6670    pre-configure {
    6771        # Ensure correct compilers are used
  • python/py-sip/files/patch-configure.py.diff

    diff --git a/python/py-sip/files/patch-configure.py.diff b/python/py-sip/files/patch-configure.py.diff
    index 572bb48..a108c47 100644
    a b  
    11--- configure.py.orig
    22+++ configure.py
    3 @@ -921,7 +921,6 @@
     3@@ -922,7 +922,6 @@
    44         raise
    55     except:
    66         sys.stderr.write(
  • new file python/py-sip/files/patch-sipgen_gencode.c.diff

    diff --git a/python/py-sip/files/patch-sipgen_gencode.c.diff b/python/py-sip/files/patch-sipgen_gencode.c.diff
    new file mode 100644
    index 0000000..522548a
    - +  
     1--- sipgen/gencode.c.orig
     2+++ sipgen/gencode.c
     3@@ -716,7 +716,7 @@
     4 "#define sipSaveSlot                 sipAPI_%s->api_save_slot\n"
     5 "#define sipClearAnySlotReference    sipAPI_%s->api_clear_any_slot_reference\n"
     6 "#define sipVisitSlot                sipAPI_%s->api_visit_slot\n"
     7-"#define sipWrappedTypeName(wt)      ((wt)->type->td_cname)\n"
     8+"#define sipWrappedTypeName(wt)      ((wt)->wt_td->td_cname)\n"
     9 "#define sipDeprecated               sipAPI_%s->api_deprecated\n"
     10 "#define sipGetReference             sipAPI_%s->api_get_reference\n"
     11 "#define sipKeepReference            sipAPI_%s->api_keep_reference\n"
     12@@ -768,19 +768,19 @@
     13 "#define sipConvertToArray           sipAPI_%s->api_convert_to_array\n"
     14 "#define sipConvertToTypedArray      sipAPI_%s->api_convert_to_typed_array\n"
     15 "#define sipWrapper_Check(w)         PyObject_TypeCheck((w), sipAPI_%s->api_wrapper_type)\n"
     16-"#define sipGetWrapper(p, wt)        sipGetPyObject((p), (wt)->type)\n"
     17-"#define sipReleaseInstance(p, wt, s)    sipReleaseType((p), (wt)->type, (s))\n"
     18+"#define sipGetWrapper(p, wt)        sipGetPyObject((p), (wt)->wt_td)\n"
     19+"#define sipReleaseInstance(p, wt, s)    sipReleaseType((p), (wt)->wt_td, (s))\n"
     20 "#define sipReleaseMappedType        sipReleaseType\n"
     21-"#define sipCanConvertToInstance(o, wt, f)   sipCanConvertToType((o), (wt)->type, (f))\n"
     22+"#define sipCanConvertToInstance(o, wt, f)   sipCanConvertToType((o), (wt)->wt_td, (f))\n"
     23 "#define sipCanConvertToMappedType   sipCanConvertToType\n"
     24-"#define sipConvertToInstance(o, wt, t, f, s, e)     sipConvertToType((o), (wt)->type, (t), (f), (s), (e))\n"
     25+"#define sipConvertToInstance(o, wt, t, f, s, e)     sipConvertToType((o), (wt)->wt_td, (t), (f), (s), (e))\n"
     26 "#define sipConvertToMappedType      sipConvertToType\n"
     27-"#define sipForceConvertToInstance(o, wt, t, f, s, e)    sipForceConvertToType((o), (wt)->type, (t), (f), (s), (e))\n"
     28+"#define sipForceConvertToInstance(o, wt, t, f, s, e)    sipForceConvertToType((o), (wt)->wt_td, (t), (f), (s), (e))\n"
     29 "#define sipForceConvertToMappedType sipForceConvertToType\n"
     30-"#define sipConvertFromInstance(p, wt, t)    sipConvertFromType((p), (wt)->type, (t))\n"
     31+"#define sipConvertFromInstance(p, wt, t)    sipConvertFromType((p), (wt)->wt_td, (t))\n"
     32 "#define sipConvertFromMappedType    sipConvertFromType\n"
     33 "#define sipConvertFromNamedEnum(v, pt)  sipConvertFromEnum((v), ((sipEnumTypeObject *)(pt))->type)\n"
     34-"#define sipConvertFromNewInstance(p, wt, t) sipConvertFromNewType((p), (wt)->type, (t))\n"
     35+"#define sipConvertFromNewInstance(p, wt, t) sipConvertFromNewType((p), (wt)->wt_td, (t))\n"
     36         ,mname
     37         ,mname
     38         ,mname
     39@@ -2885,7 +2885,7 @@
     40         if (needs_sipClass)
     41             prcode(fp,
     42 "\n"
     43-"    return (sipClass ? sipClass->type : 0);\n"
     44+"    return (sipClass ? sipClass->wt_td : 0);\n"
     45 "}\n"
     46                 );
     47         else