Opened 14 years ago

Closed 14 years ago

#25475 closed defect (fixed)

cmake: libidn dependency should be depends_lib not depends_build

Reported by: nerdling (Jeremy Lavergne) Owned by: cssdev
Priority: Normal Milestone:
Component: ports Version: 1.9.99
Keywords: Cc: michaelld (Michael Dickens), ryandesign (Ryan Carsten Schmidt)
Port: cmake

Description (last modified by nerdling (Jeremy Lavergne))

cmake's dependency on libidn is needed in depends_lib as well. Without libidn installed, using cmake results in missing dylib errors.

dyld: Library not loaded: /opt/local/lib/libidn.11.dylib
  Referenced from: /opt/local/bin/cmake
  Reason: image not found

Attachments (1)

cmake-2.8.2.diff (2.0 KB) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.
proposed patch

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by nerdling (Jeremy Lavergne)

Description: modified (diff)

comment:2 Changed 14 years ago by cssdev

Status: newassigned

I can add this after the holiday weekend.

comment:3 Changed 14 years ago by michaelld (Michael Dickens)

I'm running MacPorts (latest SVN) on 10.5.8 i386. 'cmake' compiles and works for me, with or without 'libidn' being included as depends_lib (i.e., as the Portfile is now or with "depends_lib port:libidn" added), with or without 'libidn' being installed or active. If 'libidn' isn't installed, then port installs it & if 'libidn' isn't active then port activates it -- before trying to compile 'cmake'. I think this is normal behavior for 'port'. Is there a more extended log file, or other context info?

comment:4 Changed 14 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:5 Changed 14 years ago by nerdling (Jeremy Lavergne)

Try deactivating the port or make an archive of it as I do. Then uninstall all the build dependencies it had (for example, use port_cutleaves). Now try to activate the port. It will not have the dependency it needs to activate the port as it was declared as only needed for building and is therefore "released" after that phase and can be uninstalled.

comment:6 Changed 14 years ago by michaelld (Michael Dickens)

Not sure if I understand what you want me to try. I changed the cmake Portfile to include "depends_lib port:libidn", bumped the revision, and did 'portindex' at the top level to get the change registered. Here's my shell log, following what I think you said to do. I get this same logfile no matter which Portfile I use (original or with the depends_lib added) ... maybe I don't understand the issue?

% port installed cmake libidn
The following ports are currently installed:
  cmake @2.8.1_4 (active)
  libidn @1.19_0 (active)

% port deps cmake
Full Name: cmake @2.8.1_4
Build Dependencies:   libidn, openssl
Library Dependencies: libidn

% which cmake
/opt/local/bin/cmake

% cmake --version
cmake version 2.8.1

% sudo port deactivate cmake  
--->  Deactivating cmake

% sudo port uninstall libidn
--->  Unable to uninstall libidn 1.19_0, the following ports depend on it:
--->      wget
--->      curl
--->      kdelibs4
--->      cmake
Error: port uninstall failed: Please uninstall the ports that depend on libidn first.

% sudo port -f uninstall libidn
--->  Unable to uninstall libidn 1.19_0, the following ports depend on it:
--->      wget
--->      curl
--->      kdelibs4
--->      cmake
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating libidn @1.19_0
--->  Uninstalling libidn @1.19_0

% sudo port activate cmake
--->  Activating cmake

% which cmake
/opt/local/bin/cmake

% cmake --version
dyld: Library not loaded: /opt/local/lib/libidn.11.dylib
  Referenced from: /opt/local/bin/cmake
  Reason: image not found
Trace/BPT trap

% sudo port install libidn
--->  Computing dependencies for libidn
--->  Fetching libidn
--->  Verifying checksum(s) for libidn
--->  Extracting libidn
--->  Configuring libidn
--->  Building libidn
--->  Staging libidn into destroot
--->  Installing libidn @1.19_0
--->  Activating libidn @1.19_0
--->  Cleaning libidn

% which cmake
/opt/local/bin/cmake

% cmake --version
cmake version 2.8.1

comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Summary: cmake missing dependencycmake: libidn dependency should be depends_lib not depends_build

cmake links with libidn, as evidenced by otool -L:

$ otool -L /opt/local/bin/cmake
/opt/local/bin/cmake:
	/opt/local/lib/libidn.11.dylib (compatibility version 18.0.0, current version 18.2.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

Thus cmake's dependency on libidn should be in depends_lib, not in depends_build.

The libidn dependency was added at the same time as the openssl dependency, in #20532. But there we see cmake was also linking with openssl's libraries, which it isn't now. So maybe the openssl dependency should now be removed.

cmake should also be updated to 2.8.2. I will attach a patch to do all these things shortly, after I've tested it builds.

comment:8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Well, here's a patch. cmake now links with openssl again, but with the system's openssl. So I removed the openssl dependency. And ccmake links with the system's ncurses. Bleh.

$ otool -L /opt/local/bin/ccmake
/opt/local/bin/ccmake:
	/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/opt/local/lib/libidn.11.dylib (compatibility version 18.0.0, current version 18.2.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

I say we commit this now, then deal with getting it to link with MacPorts openssl and ncurses in a separate ticket later.

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: cmake-2.8.2.diff added

proposed patch

comment:9 Changed 14 years ago by cssdev

Returning from more travel, but this patch looks ok to me. I'll verify a build today.

comment:10 Changed 14 years ago by cssdev

Resolution: fixed
Status: assignedclosed

Committed to r69577. Thanks! Hopefully openssl gets worked out ... will handle that as #25614

Note: See TracTickets for help on using tickets.