[MacPorts] #60104: py38-sip: sip.h installed in "wrong" directory?

MacPorts noreply at macports.org
Thu Feb 20 01:10:36 UTC 2020


#60104: py38-sip: sip.h installed in "wrong" directory?
--------------------------+-----------------------
  Reporter:  josephsacco  |      Owner:  michaelld
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:  2.6.2
Resolution:               |   Keywords:
      Port:  py-sip       |
--------------------------+-----------------------

Comment (by josephsacco):

 Let's see:

 * sudo  port uninstall py38-sip
    Select 'Y' when port complains that uninstalling py38-sip will break
 some stuff.

 * sudo  port clean --all py38-sip
     Check to see that {{{
 /opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8m}}}
 has vanished.  It has...

 * sudo port install py38-sip

 * port  contents py38-sip | grep include

    {{{
 /opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8m/sip.h}}}


 Hmmm...

 Let me unpack and patch py38-sip. Yes,  I see the '-e' flag  when running
    {{{python3.8 configure.py -h}}}

 In the Portfile I see:

 {{{
    configure.cmd       ${python.bin} configure.py
     configure.pre_args  -b ${python.prefix}/bin \
                         -d ${python.pkgd} \
                         -e ${python.include} \
                         -v ${python.prefix}/share/sip \
                         -p macx-g++
 }}}

 So where does the value for {{{${python.include}}}} come from? I assume it
 comes from the port group, {{{python-1.0.tcl}}}. Poking around in that
 file I see

    {{{default python.include  {[python_get_defaults include]}}}

 The procedure is defined in the TCL script:
 {{{
 proc python_get_defaults {var} {
     global python.version python.branch python.prefix
     switch -- $var {
         include {
             set inc_dir "${python.prefix}/include/python${python.branch}"
             if {[file exists ${inc_dir}]} {
                 return ${inc_dir}
             } else {
                 # look for "${inc_dir}*" and pick the first one found;
                 # make assumptions if none are found
                 if {[catch {set inc_dirs [glob ${inc_dir}*]}]} {
                     if {${python.version} < 30} {
                         return ${inc_dir}
                     } else {
                         return ${inc_dir}m
                     }
                 } else {
                     return [lindex ${inc_dirs} 0]
                 }
             }
         }
 }}}

 Where is {{{${python.branch}}}} set?



 -Joseph

-- 
Ticket URL: <https://trac.macports.org/ticket/60104#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list