Ticket #18915: clojure-port.diff
File clojure-port.diff, 9.9 KB (added by joe@…, 16 years ago) |
---|
-
files/clj-jline.sh
5 5 6 6 cljjar='lib/clojure.jar' 7 7 cljclass='clojure.lang.Repl' 8 cljscript='clojure.lang.Script' 8 9 jlineclass='jline.ConsoleRunner' 9 10 10 11 dir=$0 … … 24 25 cljjar="$dir/../$cljjar" 25 26 jlinejar="$dir/../../jline.jar" 26 27 27 exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass 28 29 if [ -z "$1" ]; then 30 exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass 31 else 32 scriptname=$1 33 exec java -classpath $jlinejar:$cljjar $jlineclass $cljscript $scriptname --$* 34 fi 35 -
files/clj.sh
5 5 6 6 cljjar='lib/clojure.jar' 7 7 cljclass='clojure.lang.Repl' 8 cljscript='clojure.lang.Script' 8 9 9 10 dir=$0 10 11 while [ -h "$dir" ]; do … … 22 23 dir=`cd "$dir" > /dev/null && pwd` 23 24 cljjar="$dir/../$cljjar" 24 25 25 exec java -classpath $cljjar $cljclass 26 if [ -z "$1" ]; then 27 exec java -classpath $cljjar $cljclass 28 else 29 scriptname=$1 30 exec java -classpath $cljjar $cljscript $scriptname --$* 31 fi -
files/completions-contrib.clj
1 (def completions 2 (reduce concat (map (fn [p] (keys (ns-publics (find-ns p)))) 3 '(clojure.core clojure.set clojure.xml clojure.zip)))) 4 5 (with-open [f (java.io.BufferedWriter. (java.io.FileWriter. ".clj_completions"))] 6 (.write f (apply str (interleave completions (repeat "\n"))))) 7 No newline at end of file -
files/.clj_completions
1 sorted-map 2 read-line 3 re-pattern 4 keyword? 5 val 6 *compile-path* 7 max-key 8 list* 9 ns-aliases 10 the-ns 11 == 12 longs 13 special-form-anchor 14 instance? 15 syntax-symbol-anchor 16 format 17 sequential? 18 fn? 19 empty 20 dorun 21 time 22 remove-method 23 gensym 24 not= 25 *3 26 unchecked-multiply 27 doseq 28 bit-or 29 aset-byte 30 if-not 31 hash-set 32 add-watch 33 unchecked-dec 34 some 35 nil? 36 string? 37 second 38 letfn 39 keys 40 for 41 *2 42 long-array 43 cond 44 bit-set 45 fn 46 sorted? 47 ns-unalias 48 ns-publics 49 dosync 50 all-ns 51 long 52 with-open 53 init-proxy 54 add-classpath 55 false? 56 await1 57 true? 58 gen-interface 59 sync 60 short 61 ns-unmap 62 repeat 63 zipmap 64 distinct 65 get-in 66 bit-xor 67 char-escape-string 68 complement 69 let 70 get-validator 71 dotimes 72 print-namespace-doc 73 *ns* 74 defmethod 75 derive 76 aset-float 77 lazy-cat 78 commute 79 defstruct 80 with-in-str 81 rem 82 odd? 83 symbol? 84 *print-level* 85 *allow-unresolved-vars* 86 *macro-meta* 87 proxy-call-with-super 88 ns-interns 89 re-matches 90 split-with 91 find-doc 92 loop 93 remove-watcher 94 next 95 import 96 symbol 97 vals 98 print-doc 99 select-keys 100 re-matcher 101 rand 102 deref 103 unchecked-inc 104 *math-context* 105 read 106 sequence 107 make-hierarchy 108 + 109 number? 110 descendants 111 into-array 112 last 113 unchecked-negate 114 integer? 115 alter 116 prn 117 with-meta 118 with-out-str 119 floats 120 * 121 *compile-files* 122 when-not 123 butlast 124 - 125 reversible? 126 rseq 127 send-off 128 seq? 129 refer-clojure 130 identical? 131 .. 132 print 133 vary-meta 134 *command-line-args* 135 bit-flip 136 zero? 137 bit-and 138 unquote-splicing 139 future 140 re-groups 141 *warn-on-reflection* 142 newline 143 replicate 144 distinct? 145 remove-ns 146 ratio? 147 xml-seq 148 vec 149 concat 150 update-in 151 vector 152 conj 153 bases 154 / 155 unchecked-add 156 ref-set 157 assoc 158 seque 159 aset-char 160 boolean 161 read-string 162 neg? 163 float-array 164 doubles 165 isa? 166 future-call 167 doto 168 remove-watch 169 print-str 170 *e 171 rsubseq 172 *flush-on-newline* 173 *out* 174 vector? 175 split-at 176 ns-refers 177 create-struct 178 proxy-super 179 int-array 180 float 181 assert 182 map 183 counted? 184 memfn 185 double-array 186 accessor 187 *print-length* 188 class? 189 rand-int 190 *1 191 aset-short 192 prn-str 193 iterate 194 add-watcher 195 when-first 196 slurp 197 mapcat 198 assoc-in 199 special-symbol? 200 ref 201 find-var 202 inc 203 definline 204 unchecked-subtract 205 ns-name 206 defn- 207 *file* 208 re-find 209 bit-not 210 construct-proxy 211 destructure 212 seq 213 intern 214 pvalues 215 to-array-2d 216 sorted-map-by 217 filter 218 var? 219 alter-meta! 220 comment 221 key 222 class 223 re-seq 224 ns 225 empty? 226 test 227 print-dup 228 create-ns 229 name 230 list? 231 aset 232 nnext 233 doall 234 macroexpand-1 235 not-any? 236 resultset-seq 237 into 238 with-precision 239 *use-context-classloader* 240 ffirst 241 bit-clear 242 proxy-name 243 load-reader 244 or 245 hash 246 print-ctor 247 associative? 248 float? 249 drop-last 250 replace 251 decimal? 252 defn 253 parents 254 map? 255 prefers 256 condp 257 quot 258 file-seq 259 send 260 with-local-vars 261 reverse 262 count 263 get-proxy-class 264 set 265 when-let 266 comp 267 nth 268 byte 269 *err* 270 constantly 271 load 272 namespace 273 pr-str 274 < 275 rationalize 276 sort-by 277 cycle 278 peek 279 reduce 280 interleave 281 amap 282 -> 283 cons 284 macroexpand 285 var-set 286 str 287 aset-boolean 288 ns-imports 289 while 290 first 291 bean 292 = 293 memoize 294 var-get 295 range 296 tree-seq 297 defmacro 298 set-validator! 299 aset-double 300 enumeration-seq 301 prefer-method 302 ensure 303 find-ns 304 not-every? 305 struct-map 306 > 307 max 308 proxy-mappings 309 identity 310 ints 311 fnext 312 min-key 313 reset-meta! 314 subs 315 compile 316 agent-errors 317 clear-agent-errors 318 printf 319 ns-resolve 320 method-sig 321 >= 322 shutdown-agents 323 reset! 324 even? 325 require 326 bit-shift-left 327 methods 328 compare 329 cast 330 supers 331 pcalls 332 load-string 333 get 334 <= 335 await 336 resolve 337 print-method 338 loaded-libs 339 force 340 partial 341 pmap 342 if-let 343 comparator 344 pos? 345 char 346 take-while 347 and 348 refer 349 underive 350 in-ns 351 iterator-seq 352 declare 353 ancestors 354 locking 355 partition 356 contains? 357 update-proxy 358 interpose 359 aset-int 360 ifn? 361 load-file 362 delay 363 apply 364 swap! 365 defmulti 366 proxy 367 subvec 368 rest 369 keyword 370 ns-map 371 unquote 372 int 373 release-pending-sends 374 mod 375 bigdec 376 nfirst 377 nthnext 378 *agent* 379 aset-long 380 struct 381 array-map 382 bigint 383 dec 384 println 385 aget 386 pr 387 drop 388 *print-dup* 389 gen-class 390 eval 391 unchecked-remainder 392 aclone 393 char-name-string 394 pop 395 primitives-classnames 396 atom 397 defonce 398 bit-shift-right 399 delay? 400 num 401 disj 402 io! 403 *print-readably* 404 rational? 405 merge-with 406 take-nth 407 *print-meta* 408 double 409 lazy-seq 410 *in* 411 line-seq 412 take 413 when 414 areduce 415 set? 416 make-array 417 alias 418 use 419 if 420 alength 421 *source-path* 422 to-array 423 hash-map 424 bit-and-not 425 compare-and-set! 426 type 427 repeatedly 428 trampoline 429 remove 430 find 431 coll? 432 drop-while 433 not-empty 434 print-special-doc 435 println-str 436 list 437 every? 438 flush 439 sort 440 dissoc 441 not 442 binding 443 doc 444 agent 445 sorted-set 446 alter-var-root 447 merge 448 subseq 449 min 450 print-simple 451 bit-test 452 await-for 453 meta 454 unchecked-divide 455 rename-keys 456 union 457 select 458 project 459 join 460 intersection 461 map-invert 462 difference 463 rename 464 index 465 content-handler 466 *stack* 467 attrs 468 element 469 tag 470 startparse-sax 471 *current* 472 content 473 *state* 474 parse 475 emit-element 476 *sb* 477 emit 478 lefts 479 down 480 insert-left 481 up 482 next 483 path 484 children 485 vector-zip 486 append-child 487 zipper 488 branch? 489 end? 490 leftmost 491 edit 492 replace 493 insert-right 494 root 495 insert-child 496 prev 497 seq-zip 498 xml-zip 499 make-node 500 rights 501 node 502 right 503 left 504 remove 505 rightmost -
files/completions.clj
1 (def completions (keys (ns-publics (find-ns 'clojure.core)))) 2 3 (with-open [f (java.io.BufferedWriter. (java.io.FileWriter. ".clj_completions"))] 4 (.write f (apply str (interleave completions (repeat "\n"))))) 5 No newline at end of file -
files/clj-rlwrap.sh
1 #!/bin/sh 2 3 # clj - Clojure launcher script 4 5 BREAK_CHARS="\(\){}[],^%$#@\"\";:''|\\" 6 7 cljjar='lib/clojure.jar' 8 cljclass='clojure.lang.Repl' 9 cljscript='clojure.lang.Script' 10 cljcompletions='.clj_completions' 11 12 dir=$0 13 while [ -h "$dir" ]; do 14 ls=`ls -ld "$dir"` 15 link=`expr "$ls" : '.*-> \(.*\)$'` 16 17 if expr "$link" : '/.*' > /dev/null; then 18 dir="$link" 19 else 20 dir=`dirname "$dir"`"/$link" 21 fi 22 done 23 24 dir=`dirname $dir` 25 dir=`cd "$dir" > /dev/null && pwd` 26 cljjar="$dir/../$cljjar" 27 cljcompletions="$dir/../$cljcompletions" 28 29 if [ $# -eq 0 ]; then 30 rlwrap --remember -c -b $BREAK_CHARS -f $cljcompletions \ 31 java -cp $cljjar $cljclass 32 else 33 scriptname=$1 34 exec java -classpath $cljjar $cljscript $scriptname --$* 35 fi 36 -
Portfile
3 3 PortSystem 1.0 4 4 5 5 name clojure 6 version 200 812176 version 20090320 7 7 categories lang java 8 8 maintainers cs.wm.edu:mpd 9 9 description The Clojure programming language … … 17 17 distname clojure_${version} 18 18 master_sites googlecode:clojure 19 19 20 checksums md5 cf0f4c27d30ae7cd675f401e169b17e7\21 sha1 b 05ada05a975d3f54fbd58e333417af773853c94\22 rmd160 ed132b4b755f5fc14b11f491a0eb9acbd8d8dd4520 checksums md5 0bbd1f6f889dded06ce0fe18381f150c \ 21 sha1 b3c4db893a2d619fca7ba302301baaab93e9211a \ 22 rmd160 b4d278aaf80cbe3fc5ea89c58244f81ba12e07ae 23 23 distname ${name}_${version} 24 24 use_zip yes 25 25 … … 30 30 depends_run-append port:jline 31 31 } 32 32 33 variant rlwrap description {Use rlwrap support for tab completion, parenthesis matching} { 34 depends_run-append port:rlwrap 35 } 36 33 37 destroot { 34 38 set javadir ${destroot}${prefix}/share/java 35 39 set clojuredir ${javadir}/clojure … … 43 47 set clojuresh clj-jline.sh 44 48 } 45 49 50 if {[variant_isset rlwrap]} { 51 set clojuresh clj-rlwrap.sh 52 } 53 46 54 xinstall -m 0755 -d ${javadir} 47 55 xinstall -m 0755 -d ${clojuredir} 48 56 xinstall -m 0755 -d ${clojuredir}/lib 49 57 xinstall -m 0755 -d ${clojuredir}/bin 50 58 xinstall -m 0644 -W ${workpath} ${name}/clojure.jar ${clojurejar} 51 59 xinstall -m 0755 -W ${filespath} ${clojuresh} ${clojurebin} 60 61 if {[variant_isset rlwrap]} { 62 xinstall -m 0644 -W ${filespath} .clj_completions ${clojuredir}/.clj_completions 63 } 64 52 65 ln -s ${clojurelink} ${bindir}/clj 53 66 }