[MacPorts] #72151: neomutt @20240329 -doc: Error: No usable pkg-config
MacPorts
noreply at macports.org
Fri Mar 7 17:48:50 UTC 2025
#72151: neomutt @20240329 -doc: Error: No usable pkg-config
------------------------+----------------------
Reporter: kprussing | Owner: l2dy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.10.5
Resolution: | Keywords:
Port: neomutt |
------------------------+----------------------
Comment (by kprussing):
Digging around a bit more, I found out that exec
[https://comp.lang.tcl.narkive.com/V3aTqdvS/exec-problem#post3 creates a
temporary file for standard error]. That led me to edit the pkg-config.tcl
to redirect the standard error to prevent trying to create a file (below).
I was able to edit the Portfile before running `port config neomutt -doc`
and it configured. I was then able to build, destroot, and install. But
I'm not sure this is the right solution. Running the resultant executable
fails with a segfault.
Patch
{{{
diff --git a/autosetup/pkg-config.tcl b/autosetup/pkg-config.tcl
index 9ce7111f5..79a4c9090 100644
--- a/autosetup/pkg-config.tcl
+++ b/autosetup/pkg-config.tcl
@@ -38,7 +38,7 @@ proc pkg-config-init {{required 1}} {
define PKG_CONFIG [get-env PKG_CONFIG pkg-config]
msg-checking "Checking for pkg-config..."
- if {[catch {exec [get-define PKG_CONFIG] --version} version]} {
+ if {[catch {exec 2>@stderr [get-define PKG_CONFIG] --version}
version]} {
msg-result "[get-define PKG_CONFIG] (not found)"
if {$required} {
user-error "No usable pkg-config"
@@ -114,7 +114,7 @@ proc pkg-config {module args} {
set pkgconfig [get-define PKG_CONFIG]
- set ret [catch {exec $pkgconfig --modversion "$module $args"}
version]
+ set ret [catch {exec 2>@stderr $pkgconfig --modversion "$module
$args"} version]
configlog "$pkgconfig --modversion $module $args: $version"
if {$ret} {
msg-result "not found"
@@ -122,7 +122,7 @@ proc pkg-config {module args} {
}
# Sometimes --modversion succeeds but because of dependencies it
isn't usable
# This seems to show up with --cflags
- set ret [catch {exec $pkgconfig --cflags $module} cflags]
+ set ret [catch {exec 2>@stderr $pkgconfig --cflags $module}
cflags]
if {$ret} {
msg-result "unusable ($version - see config.log)"
configlog "$pkgconfig --cflags $module"
@@ -134,8 +134,8 @@ proc pkg-config {module args} {
define HAVE_${prefix}
define ${prefix}_VERSION $version
define ${prefix}_CFLAGS $cflags
- define ${prefix}_LIBS [exec $pkgconfig --libs-only-l $module]
- define ${prefix}_LDFLAGS [exec $pkgconfig --libs-only-L $module]
+ define ${prefix}_LIBS [exec 2>@stderr $pkgconfig --libs-only-l
$module]
+ define ${prefix}_LDFLAGS [exec 2>@stderr $pkgconfig --libs-only-L
$module]
return 1
}
@@ -164,5 +164,5 @@ proc pkg-config-get {module name} {
proc pkg-config-get-var {module variable} {
set pkgconfig [get-define PKG_CONFIG]
set prefix [feature-define-name $module HAVE_PKG_]
- exec $pkgconfig $module --variable $variable
+ exec 2>@stderr $pkgconfig $module --variable $variable
}
}}}
--
Ticket URL: <https://trac.macports.org/ticket/72151#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list