Ticket #18915: clojure-port.diff

File clojure-port.diff, 9.9 KB (added by joe@…, 16 years ago)

Clojure port change including script change and new variant

  • files/clj-jline.sh

     
    55
    66cljjar='lib/clojure.jar'
    77cljclass='clojure.lang.Repl'
     8cljscript='clojure.lang.Script'
    89jlineclass='jline.ConsoleRunner'
    910
    1011dir=$0
     
    2425cljjar="$dir/../$cljjar"
    2526jlinejar="$dir/../../jline.jar"
    2627
    27 exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass
     28
     29if [ -z "$1" ]; then
     30  exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass
     31else
     32  scriptname=$1
     33  exec java -classpath $jlinejar:$cljjar $jlineclass $cljscript $scriptname --$*
     34fi
     35
  • files/clj.sh

     
    55
    66cljjar='lib/clojure.jar'
    77cljclass='clojure.lang.Repl'
     8cljscript='clojure.lang.Script'
    89
    910dir=$0
    1011while [ -h "$dir" ]; do
     
    2223dir=`cd "$dir" > /dev/null && pwd`
    2324cljjar="$dir/../$cljjar"
    2425
    25 exec java -classpath $cljjar $cljclass
     26if [ -z "$1" ]; then
     27  exec java -classpath $cljjar $cljclass
     28else
     29  scriptname=$1
     30  exec java -classpath $cljjar $cljscript $scriptname --$*
     31fi
  • 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

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

     
    33PortSystem          1.0
    44
    55name                clojure
    6 version             20081217
     6version             20090320
    77categories          lang java
    88maintainers         cs.wm.edu:mpd
    99description         The Clojure programming language
     
    1717distname            clojure_${version}
    1818master_sites        googlecode:clojure
    1919
    20 checksums           md5 cf0f4c27d30ae7cd675f401e169b17e7 \
    21                     sha1 b05ada05a975d3f54fbd58e333417af773853c94 \
    22                     rmd160 ed132b4b755f5fc14b11f491a0eb9acbd8d8dd45
     20checksums           md5 0bbd1f6f889dded06ce0fe18381f150c \
     21                    sha1 b3c4db893a2d619fca7ba302301baaab93e9211a \
     22                    rmd160 b4d278aaf80cbe3fc5ea89c58244f81ba12e07ae
    2323distname            ${name}_${version}
    2424use_zip             yes
    2525
     
    3030    depends_run-append port:jline
    3131}
    3232
     33variant rlwrap description {Use rlwrap support for tab completion, parenthesis matching} {
     34    depends_run-append port:rlwrap
     35}
     36
    3337destroot {
    3438    set javadir ${destroot}${prefix}/share/java
    3539    set clojuredir ${javadir}/clojure
     
    4347        set clojuresh clj-jline.sh
    4448    }
    4549   
     50    if {[variant_isset rlwrap]} {
     51        set clojuresh clj-rlwrap.sh
     52    }
     53   
    4654    xinstall -m 0755 -d ${javadir}
    4755    xinstall -m 0755 -d ${clojuredir}
    4856    xinstall -m 0755 -d ${clojuredir}/lib
    4957    xinstall -m 0755 -d ${clojuredir}/bin
    5058    xinstall -m 0644 -W ${workpath} ${name}/clojure.jar ${clojurejar}
    5159    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   
    5265    ln -s ${clojurelink} ${bindir}/clj
    5366}