[MacPorts] #67696: ghc-ppc-bootstrap @7.0.4: Hardcoded references to /opt/local and 7.0.4
MacPorts
noreply at macports.org
Wed Jun 28 05:31:12 UTC 2023
#67696: ghc-ppc-bootstrap @7.0.4: Hardcoded references to /opt/local and 7.0.4
------------------------+-------------------------------
Reporter: ryandesign | Owner: barracuda156
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Keywords: | Port: ghc-ppc-bootstrap
------------------------+-------------------------------
Where the Portfile says:
{{{
reinplace
"s|/Library/Frameworks/GHC.framework/Versions/7.0.4-powerpc/usr|/opt/local/share
/ghc-ppc-bootstrap|" \
}}}
`/opt/local` should not be hardcoded; use `${prefix}`; and `7.0.4` would
be better replaced with `${version}` to avoid needing to remember to
change it every time the version is increased. And in a regular expression
`.` means "any character" so when you want to match a literal period it
should be preceded by a `\`. The `quotemeta` procedure can be used to add
backslashes before special regular expression characters. You might also
wish to use `${name}` here instead of repeating the name of the port, in
case the name ever changes or this code needs to be copied to another
port. So it should probably be changed to:
{{{
reinplace "s|[quotemeta
/Library/Frameworks/GHC.framework/Versions/${version}-powerpc/usr]|${prefix}/share/${name}|"
\
}}}
And where in the Portfile it says:
{{{
reinplace "s|/Library|/opt/local/Library|" \
}}}
if what you're replacing is references to /Library/Frameworks then it
should be changed to:
{{{
reinplace "s|/Library/Frameworks|${frameworks_dir}|" \
}}}
or if you're replacing references to paths in /Library other than
/Library/Frameworks, then:
{{{
reinplace "s|/Library|${prefix}/Library|" \
}}}
There are other places in the Portfile where `7.0.4` could be changed as
well.
--
Ticket URL: <https://trac.macports.org/ticket/67696>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list