Opened 14 years ago

Closed 14 years ago

#25614 closed defect (fixed)

cmake should use MacPorts' openssl and ncurses

Reported by: cssdev Owned by: cssdev
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: domiman@…, ryandesign (Ryan Carsten Schmidt), alexoedelman@…
Port: cmake

Description

The patch for #25475 changed CMake to use the system's openssl library. The port should instead use the MacPorts openssl library as depends_lib dependency.

Attachments (2)

patch-Portfile.diff (1.2 KB) - added by cssdev 14 years ago.
patch-Portfile-universal.diff (615 bytes) - added by cssdev 14 years ago.
try to handle different worksrcpaths when building universal

Download all attachments as: .zip

Change History (18)

comment:1 Changed 14 years ago by cssdev

Status: newassigned

comment:2 Changed 14 years ago by cssdev

Adding configure.env CMAKE_INSTALL_PREFIX=${prefix} seems to pick up the correct OpenSSL library. Performing a full build to verify.

-- Found OpenSSL: /opt/local/lib/libssl.dylib;/opt/local/lib/libcrypto.dylib

comment:3 Changed 14 years ago by cssdev

Looks like that fixes openssl, but not ncurses:

otool -L work/destroot/opt/local/bin/ccmake 
work/destroot/opt/local/bin/ccmake:
	/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/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)

comment:4 Changed 14 years ago by cssdev

Summary: cmake should use MacPorts' opensslcmake should use MacPorts' openssl and ncurses

comment:5 Changed 14 years ago by cssdev

I applied the openssl fix in r69717. Fixing the ncurses link might require the use of an init file to the CMake build process, as I need to specify several variables to point toward the ${prefix}.

  • create a cmake init file
  • copy the init file into worksrcpath
  • reinplace the prefix path
  • configure cmake using the init file

comment:6 Changed 14 years ago by cssdev

CMake has some trickery when both libcurses and libncurses are present. I have to make its bootstrap ignore the presence of the MacOS X libcurses library and properly force it to use MacPorts' libncurses.

Changed 14 years ago by cssdev

Attachment: patch-Portfile.diff added

comment:7 Changed 14 years ago by cssdev

About the best I can do that works is to manually modify the CMakeCache.txt after configuration. I can make this a platform variant since I don't know how other systems might handle curses, although I think those are discouraged now. I'll check upstream if there's a way to make the bootstrap properly ignore the system curses and use our ncurses.

comment:8 Changed 14 years ago by cssdev

Resolution: fixed
Status: assignedclosed

Fixed in r70407, although for now it's within the scope of a platform variant.

comment:9 Changed 14 years ago by gnw3

Resolution: fixed
Status: closedreopened

On Leopard, port upgrade cmake failed:

CMake has bootstrapped.  Now run gmake.
DEBUG: Executing proc-post-org.macports.configure-configure-0
DEBUG: couldn't read file "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_cmake/work/cmake-2.8.2/CMakeCache.txt": no such file or directory
    while executing
"exec /usr/bin/sed s|/usr/lib/libcurses|/opt/local/lib/libncurses|g < /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_tr..."
    ("eval" body line 1)
    invoked from within
"eval exec $cmdline"
Error: reinplace: couldn't read file "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_cmake/work/cmake-2.8.2/CMakeCache.txt": no such file or directory
Error: Target org.macports.configure returned: reinplace sed(1) failed
DEBUG: Backtrace: reinplace sed(1) failed
    while executing
"$post $targetname"

I have:

$ grep universal /opt/local/etc/macports/macports.conf
# Options for Universal Binaries (+universal variant)
universal_archs		x86_64 i386

"port -d install cmake -universal" does work

comment:10 in reply to:  9 ; Changed 14 years ago by cssdev

Replying to gnwiii@…:

On Leopard, port upgrade cmake failed:

Error: reinplace: couldn't read file "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_cmake/work/cmake-2.8.2/CMakeCache.txt": no such file or directory

I didn't take universal into account, as I only build for my architecture. I think I have a patch that should fix it, would you mind giving it a try?

Changed 14 years ago by cssdev

try to handle different worksrcpaths when building universal

comment:11 Changed 14 years ago by domiman@…

Cc: domiman@… added

Cc Me!

comment:12 Changed 14 years ago by domiman@…

I'll try to give that a try the next few days...

comment:13 Changed 14 years ago by nicos_pavlov@…

I tested the patch for universal build, and it worked for me (universal building in my case i386 and x86_64).

I had some problems however some problems with the lines

reinplace "s|/usr/lib/libcurses|${prefix}/lib/libncurses|g" \ 
  ${dir}/CMakeCache.txt 

of the patch, apparently due to too much spaces. I had to modify it to

reinplace "s|/usr/lib/libcurses|${prefix}/lib/libncurses|g" ${dir}/CMakeCache.txt 

for the patch to work.

comment:14 in reply to:  10 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Replying to css@…:

I have a patch that should fix it, would you mind giving it a try?

Thanks, the patch works great as written; you should commit it.

comment:15 Changed 14 years ago by alexoedelman@…

Cc: alexoedelman@… added

Cc Me!

comment:16 Changed 14 years ago by cssdev

Resolution: fixed
Status: reopenedclosed

Committed to r70553! Thanks for confirming the fix!

Note: See TracTickets for help on using tickets.