| 73 | } elseif {${subport} eq "lldb-${llvm_version}"} { |
| 74 | homepage http://lldb.llvm.org/ |
| 75 | description the LLVM debugger |
| 76 | long_description Lldb is the "LLVM native" debugger. |
| 77 | |
| 78 | depends_lib port:libxml2 port:libomp port:llvm-${llvm_version} port:python27 \ |
| 79 | port:ncurses |
| 80 | depends_build-append port:cctools port:swig-python port:doxygen |
| 81 | depends_skip_archcheck-append cctools |
| 82 | |
| 83 | # Clang doesn't actually use any of these, but the LLVM makefile |
| 84 | # system overlinks its binaries. Remove (or convert to build deps?) |
| 85 | # after #46040 is resolved. |
| 86 | depends_lib-append port:libedit port:libffi port:ncurses port:zlib |
| 200 | if {${subport} eq "lldb-${llvm_version}"} { |
| 201 | # lldb needs the clang sources present, so we apply the applicable patches. |
| 202 | patchfiles-append \ |
| 203 | 1001-MacPorts-Only-Prepare-clang-format-for-replacement-w.patch \ |
| 204 | 1002-MacPorts-Only-Fall-back-on-xcodebuild-sdk-when-xcrun.patch \ |
| 205 | 1003-MacPorts-Only-Fix-name-of-scan-view-executable-insid.patch \ |
| 206 | 1004-MacPorts-Only-Relocate-clang-resources-using-llvm-ve.patch \ |
| 207 | 1005-Default-to-ppc7400-for-OSX-10.5.patch \ |
| 208 | 1006-Only-call-setpriority-PRIO_DARWIN_THREAD-0-PRIO_DARW.patch \ |
| 209 | 1007-Default-to-fragile-ObjC-runtime-when-targeting-darwi.patch \ |
| 210 | openmp-locations.patch |
| 211 | |
| 212 | # I'm not sure if we need to delete this. It seems to build fine with it |
| 213 | # present, but we used to explicitly only use this patch for the llvm subport. |
| 214 | patchfiles-delete \ |
| 215 | 0005-MacPorts-Only-Skip-checking-for-python-in-configure.patch |
| 216 | |
| 217 | # https://llvm.org/bugs/show_bug.cgi?id=25681 |
| 218 | if {${worksrcdir} eq "trunk" || ${worksrcdir} eq "release_${llvm_version_no_dot}"} { |
| 219 | # Cannot set cppflags due to https://cmake.org/Bug/view.php?id=12928 |
| 220 | # Cannot set cxxflags due to https://llvm.org/bugs/show_bug.cgi?id=25904 |
| 221 | #configure.cxxflags-append -DSVN_REVISION='"${svn.revision}"' |
| 222 | |
| 223 | post-patch { |
| 224 | reinplace "1 i \\ |
| 225 | #define SVN_REVISION \"${svn.revision}\" |
| 226 | " ${worksrcpath}/tools/clang/lib/Basic/Version.cpp |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | # we'll need to codesign the debugserver executable, but we'll do that |
| 231 | # in the post-activate step. |
| 232 | patchfiles-append patch-no-codesign.diff |
| 233 | } |
| 234 | patchfiles-append patch-accept-build_types.diff |
| 270 | } elseif {${subport} eq "lldb-${llvm_version}"} { |
| 271 | select.group lldb |
| 272 | select.file ${filespath}/mp-${subport} |
| 273 | |
| 274 | configure.args-append \ |
| 275 | -DCLANG_ENABLE_ARCMT=OFF \ |
| 276 | -DCLANG_INCLUDE_TESTS=OFF \ |
| 277 | -DCLANG_ENABLE_STATIC_ANALYZER=OFF \ |
| 278 | -DLLVM_BUILD_RUNTIME=ON \ |
| 279 | -DLIBCXX_INSTALL_LIBRARY=OFF \ |
| 280 | -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \ |
| 281 | -DPYTHON_INCLUDE_DIR=${prefix}/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 |
| 345 | if {${subport} ne "lldb-${llvm_version}"} { |
| 346 | variant static_libllvm description "Don't build the shared libLLVM.dylib, for instance to get a standalone redistributable libclang" { |
| 347 | configure.args-delete -DLLVM_LINK_LLVM_DYLIB=ON |
| 348 | configure.args-append -DLLVM_LINK_LLVM_DYLIB=OFF -DLLVM_BUILD_LLVM_DYLIB=OFF |
| 349 | } |
| 350 | |
| 351 | variant nortti description "Don't build with internal RTTI support (increases compilation performance somewhat)" { |
| 352 | configure.args-delete -DLLVM_ENABLE_RTTI=ON |
| 353 | configure.args-append -DLLVM_ENABLE_RTTI=OFF |
| 354 | } |
| 355 | } |
| 356 | |
| 431 | if {![variant_isset static_libllvm]} { |
| 432 | # this is not a build that aims to be (more easily) relocatable |
| 433 | system "install_name_tool -id ${sub_prefix}/lib/libclang.dylib ${destroot}${sub_prefix}/lib/libclang.dylib" |
| 434 | system "install_name_tool -change @rpath/libLLVM.dylib ${sub_prefix}/lib/libLLVM.dylib ${destroot}${sub_prefix}/lib/libclang.dylib" |
| 435 | } |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | if {${subport} eq "lldb-${llvm_version}"} { |
| 440 | post-patch { |
| 441 | reinplace "s|@@PREFIX@@|${prefix}|" \ |
| 442 | ${worksrcpath}/tools/clang/lib/Driver/Tools.cpp |
| 443 | |
| 444 | reinplace "s|@CLANG_FORMAT_PATH@|${prefix}/bin/clang-format-${suffix}|g" \ |
| 445 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-bbedit.applescript \ |
| 446 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-diff.py \ |
| 447 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-sublime.py \ |
| 448 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format.el \ |
| 449 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format.py |
| 450 | } |
| 451 | |
| 452 | build.dir ${build.dir}/tools/lldb |
| 453 | |
| 454 | destroot { |
| 455 | destroot.target install/fast |
| 456 | system "cd ${destroot.dir} && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}" |
| 457 | |
| 458 | foreach bin {lldb lldb-mi lldb-server} { |
| 459 | delete ${destroot}${sub_prefix}/bin/${bin} |
| 460 | file rename ${destroot}${sub_prefix}/bin/${bin}-${version} ${destroot}${sub_prefix}/bin/${bin} |
| 461 | } |
| 462 | # this is not a build that aims to be (more easily) relocatable |
| 463 | system "install_name_tool -id ${sub_prefix}/lib/liblldb.dylib ${destroot}${sub_prefix}/lib/liblldb.dylib" |
| 464 | system "install_name_tool -change @rpath/libLLVM.dylib ${sub_prefix}/lib/libLLVM.dylib ${destroot}${sub_prefix}/lib/liblldb.dylib" |
| 465 | xinstall -m 755 -d ${destroot}${prefix}/share/doc/lldb-${llvm_version} |
| 466 | xinstall -m 644 ${worksrcpath}/tools/lldb/docs/code-signing.txt ${destroot}${prefix}/share/doc/lldb-${llvm_version}/ |
| 467 | } |
| 468 | post-activate { |
| 469 | if {[codesign ${sub_prefix}/bin/debugserver lldb_codesign] ne 0} { |
| 470 | ui_msg "Please follow the instructions in ${prefix}/lldb-${llvm_version}/code-signing.txt and then reinstall this port" |
| 471 | } |