So, I've got a problem w/ lint and the php Portfile.
For all of the extensions embedded in the php Portfile I now get this
fatal error:

port lint php84-curl:
Error: Portfile parent directory lang does not match primary category php

It's caused by this rather convoluted piece of code:

<<<CODE
# Returns true if the subport is a SAPI, false otherwise (extension,
stub port).
proc is_sapi_subport {} {
    global name subport php.rootname
    if {${name} eq ${subport}} {
        return no
    }
    if {[regexp {^php\d+$} ${subport}]} {
        return yes
    }
    return [expr {-1 != [lsearch -exact [list apache2handler cgi fpm]
${php.rootname}]}]
}

# Returns true if the subport is an extension, false otherwise (SAPI,
stub port).
proc is_extension_subport {} {
    global name subport
    if {${name} eq ${subport}} {
        return no
    }
    return [expr {![is_sapi_subport]}]
}

if {![is_extension_subport]} {
    categories          lang www
    homepage            https://www.php.net
}
>>>CODE

I can see, what the intension is:
- for the languages proper (eg php84) you want (lang, www)
- for SAPI (eg php84-fpm) you want (lang, www)
- for proper extensions (eg php84-curl) you want (php, <ext-specific>)
  like you get for extensions not in the portfile (eg php84-mongodb)
  that is without the (lang) part

Problem is, that at some time lint now !REQUIRES! the primary category
to be the name of the parent folder. Thus, it's no longer possible to
exclude the (lang) part from extensions in the php Portfile.

If I change the categories definition in the portgroup php-1.1.tcl file to :
    default categories              lang
    categories-append               php
it fixes the extensions in the php Portfile;
!BUT! it breaks the "port lint" for every php<ver>-<extension> in the
php parent folder

It's a catch-22 problem:
    port lint php<ver>-<extension>
will either fail for some extensions based upon where they are
!OR!
there'll be an inconsistency in the categories

¿¿¿ What can we do ???
One solution is to revert the requirement for the primary category to be
the name of the parent folder.

Do you want me to open a trac ticket for this ?

-- 
Bjarne D Mathiesen
Slagelse ; Danmark ; Europa
-----------------------------------------------------------------------
denne besked er skrevet i et totalt M$-frit miljø
MacPro 2010 5.1 ; OpenCore + macOS 14.7.6 Sonoma
2 x 3,46 GHz 6-Core Intel Xeon ; 192 GB 1333 MHz DDR3 ECC RDIMM
ATI Radeon RX 590 8 GB

Reply via email to