Opened 4 years ago

Closed 4 years ago

#61956 closed defect (fixed)

mc opportunistically links with libssh2

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: reneeotten (Renee Otten)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: Cc:
Port: mc

Description

mc links with a library from the libssh2 port, even though it does not declare a dependency on it:

$ sudo port -s install mc
--->  Computing dependencies for mc
--->  Fetching distfiles for mc
--->  Verifying checksums for mc
--->  Extracting mc
--->  Applying patches to mc
--->  Configuring mc
--->  Building mc
--->  Staging mc into destroot
--->  Installing mc @4.8.25_0+slang2
--->  Activating mc @4.8.25_0+slang2
--->  Cleaning mc
$ otool -L /opt/local/bin/mc
/opt/local/bin/mc:
	/opt/local/lib/libslang.2.dylib (compatibility version 2.0.0, current version 2.2.0)
	/opt/local/lib/libssh2.1.dylib (compatibility version 2.0.0, current version 2.1.0)
	/opt/local/lib/libglib-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.7.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
$ port prov /opt/local/lib/libssh2.1.dylib
/opt/local/lib/libssh2.1.dylib is provided by: libssh2
$ port deps mc
Full Name: mc @4.8.25_0+slang2
Extract Dependencies: xz
Build Dependencies:   pkgconfig
Library Dependencies: glib2, slang2
$

There is already an sftp variant which adds a build dependency on libssh2. So 2 things are wrong:

  1. the port needs to be changed so that it does not link with libssh2 even if it is already installed unless the sftp variant is selected
  2. the sftp variant needs to add libssh2 as a library dependency, not a build dependency

Both of these changes warrant increasing the port's revision.

Change History (3)

comment:1 Changed 4 years ago by fs111 (André Kelpe)

I added the sftp variant to the port here: https://github.com/macports/macports-ports/pull/9489

I can fix the build vs. library dependency easily, but I would need guidance how to do the first part.

@ryandesign Do you have any pointers then I can take a crack at it.

comment:2 Changed 4 years ago by reneeotten (Renee Otten)

the first point has (presumably) always happened... I overlooked the second point when merging the PR. It looks like one can just add --enable-vfs-sftp=no as default configure argument and then set it to yes in the variant. Let me try and if that works I'll push an update.

comment:3 Changed 4 years ago by reneeotten (Renee Otten)

Owner: set to reneeotten
Resolution: fixed
Status: newclosed

In bca07f7327c1f3a2fbaaeab0545535c39c68e853/macports-ports (master):

mc: fix opportunistic linking to libssh2

  • make libssh2 library dependency in the sftp variant

Closes: #61956

Note: See TracTickets for help on using tickets.