diff --git a/dports/lang/llvm-3.4/Portfile b/dports/lang/llvm-3.4/Portfile
index 3d66538..1b9e51e 100644
a
|
b
|
if {${subport} == "llvm-${llvm_version}"} { |
43 | 43 | library to parse C/C++ code. |
44 | 44 | |
45 | 45 | depends_lib port:llvm-${llvm_version} port:libffi |
46 | | depends_run port:clang_select port:ld64 |
| 46 | depends_run port:clang_select port:ld64 port:python27 |
47 | 47 | depends_extract bin:svn:subversion |
48 | 48 | depends_skip_archcheck-append ld64 subversion |
49 | 49 | |
… |
… |
patchfiles install_target.patch \ |
102 | 102 | patch.pre_args -p1 |
103 | 103 | |
104 | 104 | if {${subport} == "clang-${llvm_version}"} { |
105 | | patchfiles-append tiger-shlib-clang.patch tiger-libclang.patch scan-build-PR-35006.patch \ |
106 | | 0001-Comment-out-SL-cctools-workaround.patch |
107 | | |
| 105 | patchfiles-append tiger-shlib-clang.patch tiger-libclang.patch scan-build-PR-35006.patch \ |
| 106 | 0001-Comment-out-SL-cctools-workaround.patch \ |
| 107 | install_clang-format.patch clang-format_executable_bbedit.patch \ |
| 108 | clang-format_executable_diff.patch clang-format_executable_el.patch \ |
| 109 | clang-format_executable_py.patch clang-format_executable_sublime.patch |
108 | 110 | build.target clang-only |
109 | 111 | destroot.target install-clang |
110 | 112 | } |
… |
… |
if {${subport} == "llvm-${llvm_version}"} { |
313 | 315 | default_variants-append +arm_runtime |
314 | 316 | } |
315 | 317 | |
316 | | set pythonver "" |
317 | | set pythonverdot "" |
318 | | |
319 | | if {![variant_isset python25] && ![variant_isset python26]} { |
320 | | default_variants-append +python27 |
321 | | } |
322 | | |
323 | | variant python25 conflicts python26 python27 description {Use python 2.5} { |
324 | | set pythonver 25 |
325 | | set pythonverdot 2.5 |
326 | | configure.args-append --with-python=${prefix}/bin/python2.5 |
327 | | } |
328 | | |
329 | | variant python26 conflicts python25 python27 description {Use python 2.6} { |
330 | | set pythonver 26 |
331 | | set pythonverdot 2.6 |
332 | | configure.args-append --with-python=${prefix}/bin/python2.6 |
333 | | } |
334 | | |
335 | | variant python27 conflicts python25 python26 description {Use python 2.7} { |
336 | | set pythonver 27 |
337 | | set pythonverdot 2.7 |
338 | | configure.args-append --with-python=${prefix}/bin/python2.7 |
339 | | } |
340 | | |
341 | 318 | variant analyzer description {Install clang static analyzer} { |
342 | | if {[string equal "${pythonver}" ""]} { |
343 | | ui_error "You mush select a python variant to use the clang static analyzer (+analyzer)" |
344 | | error "Invalid variant combination" |
345 | | } |
346 | 319 | |
347 | | depends_run-append port:perl5 port:python${pythonver} |
| 320 | depends_run-append port:perl5 |
348 | 321 | |
349 | 322 | post-patch { |
350 | 323 | reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5|g" \ |
351 | 324 | ${worksrcpath}/tools/clang/tools/scan-build/ccc-analyzer \ |
352 | 325 | ${worksrcpath}/tools/clang/tools/scan-build/c++-analyzer \ |
353 | 326 | ${worksrcpath}/tools/clang/tools/scan-build/scan-build |
354 | | reinplace "s|/usr/bin/env python|${prefix}/bin/python${pythonverdot}|g" \ |
| 327 | reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|g" \ |
355 | 328 | ${worksrcpath}/tools/clang/tools/scan-build/set-xcode-analyzer \ |
356 | 329 | ${worksrcpath}/tools/clang/tools/scan-view/scan-view |
357 | 330 | } |
… |
… |
if {${subport} == "llvm-${llvm_version}"} { |
376 | 349 | reinplace "s:EXEC_PATH:${sub_prefix}/bin/scan-view:" "${destroot}${prefix}/bin/scan-view-${suffix}" |
377 | 350 | } |
378 | 351 | } |
| 352 | |
| 353 | |
| 354 | post-patch { |
| 355 | reinplace "s|@CLANG_FORMAT_PATH@|${prefix}/bin/clang-format-${suffix}|g" \ |
| 356 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-bbedit.applescript \ |
| 357 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-diff.py \ |
| 358 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format-sublime.py \ |
| 359 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format.el \ |
| 360 | ${worksrcpath}/tools/clang/tools/clang-format/clang-format.py |
| 361 | } |
| 362 | |
| 363 | post-destroot { |
| 364 | file mkdir ${destroot}${sub_prefix}/libexec |
| 365 | file copy ${worksrcpath}/tools/clang/tools/clang-format ${destroot}${sub_prefix}/libexec/clang-format |
| 366 | |
| 367 | file delete -force ${destroot}${sub_prefix}/libexec/clang-format/.svn |
| 368 | file delete -force ${destroot}${sub_prefix}/libexec/clang-format/Makefile |
| 369 | file delete -force ${destroot}${sub_prefix}/libexec/clang-format/Release+Debug+Asserts |
| 370 | file delete -force ${destroot}${sub_prefix}/libexec/clang-format/CMakeLists.txt |
| 371 | file delete -force ${destroot}${sub_prefix}/libexec/clang-format/ClangFormat.cpp |
| 372 | } |
379 | 373 | } |
380 | 374 | |
381 | 375 | livecheck.type none |
diff --git a/dports/lang/llvm-3.4/files/clang-format_executable_bbedit.patch b/dports/lang/llvm-3.4/files/clang-format_executable_bbedit.patch
new file mode 100644
index 0000000..970a65b
-
|
+
|
|
| 1 | --- a/tools/clang/tools/clang-format/clang-format-bbedit.applescript 2011-07-09 14:35:58.000000000 -0700 |
| 2 | +++ b/tools/clang/tools/clang-format/clang-format-bbedit.applescript 2012-04-20 10:09:40.000000000 -0700 |
| 3 | @@ -15,7 +15,7 @@ ifeq ($(HOST_OS),Darwin) |
| 4 | end tell |
| 5 | |
| 6 | set filePath to urlToPOSIXPath(fileURL) |
| 7 | -set newContents to do shell script "/path/to/clang-format -offset=" & selectionOffset & " -length=" & selectionLength & " " & quoted form of filePath |
| 8 | +set newContents to do shell script "@CLANG_FORMAT_PATH@ -offset=" & selectionOffset & " -length=" & selectionLength & " " & quoted form of filePath |
| 9 | |
| 10 | tell application "BBEdit" |
| 11 | -- "set contents of text document 1 to newContents" scrolls to the bottom while |
diff --git a/dports/lang/llvm-3.4/files/clang-format_executable_diff.patch b/dports/lang/llvm-3.4/files/clang-format_executable_diff.patch
new file mode 100644
index 0000000..4f9daba
-
|
+
|
|
| 1 | --- a/tools/clang/tools/clang-format/clang-format-diff.py 2011-07-09 14:35:58.000000000 -0700 |
| 2 | +++ b/tools/clang/tools/clang-format/clang-format-diff.py 2012-04-20 10:09:40.000000000 -0700 |
| 3 | @@ -15,7 +15,7 @@ ifeq ($(HOST_OS),Darwin) |
| 4 | |
| 5 | |
| 6 | # Change this to the full path if clang-format is not on the path. |
| 7 | -binary = 'clang-format' |
| 8 | +binary = '@CLANG_FORMAT_PATH@' |
| 9 | |
| 10 | |
| 11 | def main(): |
| 12 | |
diff --git a/dports/lang/llvm-3.4/files/clang-format_executable_el.patch b/dports/lang/llvm-3.4/files/clang-format_executable_el.patch
new file mode 100644
index 0000000..789c0f5
-
|
+
|
|
| 1 | --- a/tools/clang/tools/clang-format/clang-format.el 2011-07-09 14:35:58.000000000 -0700 |
| 2 | +++ b/tools/clang/tools/clang-format/clang-format.el 2012-04-20 10:09:40.000000000 -0700 |
| 3 | @@ -13,7 +13,7 @@ ifeq ($(HOST_OS),Darwin) |
| 4 | |
| 5 | ;; *Location of the clang-format binary. If it is on your PATH, a full path name |
| 6 | ;; need not be specified. |
| 7 | -(defvar clang-format-binary "clang-format") |
| 8 | +(defvar clang-format-binary "@CLANG_FORMAT_PATH@") |
| 9 | |
| 10 | (defun clang-format-region () |
| 11 | "Use clang-format to format the currently active region." |
diff --git a/dports/lang/llvm-3.4/files/clang-format_executable_py.patch b/dports/lang/llvm-3.4/files/clang-format_executable_py.patch
new file mode 100644
index 0000000..c59c3c2
-
|
+
|
|
| 1 | --- a/tools/clang/tools/clang-format/clang-format.py 2011-07-09 14:35:58.000000000 -0700 |
| 2 | +++ b/tools/clang/tools/clang-format/clang-format.py 2012-04-20 10:09:40.000000000 -0700 |
| 3 | @@ -24,7 +24,7 @@ ifeq ($(HOST_OS),Darwin) |
| 4 | import vim |
| 5 | |
| 6 | # Change this to the full path if clang-format is not on the path. |
| 7 | -binary = 'clang-format' |
| 8 | +binary = '@CLANG_FORMAT_PATH@' |
| 9 | |
| 10 | # Change this to format according to other formatting styles. See the output of |
| 11 | # 'clang-format --help' for a list of supported styles. The default looks for |
| 12 | |
diff --git a/dports/lang/llvm-3.4/files/clang-format_executable_sublime.patch b/dports/lang/llvm-3.4/files/clang-format_executable_sublime.patch
new file mode 100644
index 0000000..d244ec1
-
|
+
|
|
| 1 | --- a/tools/clang/tools/clang-format/clang-format-sublime.py2011-07-09 14:35:58.000000000 -0700 |
| 2 | +++ b/tools/clang/tools/clang-format/clang-format-sublime.py 2012-04-20 10:09:40.000000000 -0700 |
| 3 | @@ -18,7 +18,7 @@ ifeq ($(HOST_OS),Darwin) |
| 4 | import subprocess |
| 5 | |
| 6 | # Change this to the full path if clang-format is not on the path. |
| 7 | -binary = 'clang-format' |
| 8 | +binary = '@CLANG_FORMAT_PATH@' |
| 9 | |
| 10 | # Change this to format according to other formatting styles. See the output of |
| 11 | # 'clang-format --help' for a list of supported styles. The default looks for |
diff --git a/dports/lang/llvm-3.4/files/install_clang-format.patch b/dports/lang/llvm-3.4/files/install_clang-format.patch
new file mode 100644
index 0000000..8acb66d
-
|
+
|
|
| 1 | --- a/Makefile 2013-10-02 08:42:23.000000000 -0700 |
| 2 | +++ b/Makefile 2013-10-24 10:57:33.000000000 -0700 |
| 3 | @@ -70,8 +70,9 @@ ifeq ($(MAKECMDGOALS),install-clang) |
| 4 | DIRS := tools/clang/tools/driver tools/clang/lib/Headers \ |
| 5 | tools/clang/tools/libclang \ |
| 6 | tools/clang/tools/c-index-test \ |
| 7 | tools/clang/runtime tools/clang/docs \ |
| 8 | - tools/clang/include tools/clang/lib |
| 9 | + tools/clang/include tools/clang/lib \ |
| 10 | + tools/clang/tools/clang-format |
| 11 | OPTIONAL_DIRS := |
| 12 | NO_INSTALL = 1 |
| 13 | endif |