Changeset 14190


Ignore:
Timestamp:
10/12/12 13:18:12 (8 years ago)
Author:
Mark Evenson
Message:

The Bear gets medieval with JNA.

If jna.jar is in your path, we should count as having required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/mvn/jna.asd

    r14189 r14190  
    44(asdf:defsystem :jna
    55    :version "3.4.0"
    6     :defsystem-depends-on (abcl-asdf))
     6    :defsystem-depends-on (jss abcl-asdf))
    77;; FIXME:  install a better handler in abcl-asdf  :components ((:mvn "net.java.dev.jna/jna/3.4.0")))
    88
    99(defmethod asdf:perform :after ((o asdf:load-op) (c (eql (asdf:find-system :jna))))
     10  (when (jss:find-java-class "com.sun.jna.Native")
     11    (provide :jna)))
     12
     13(defmethod asdf:perform :before ((o asdf:load-op) (c (eql (asdf:find-system :jna))))
    1014  ;; Theoretically this should be the same thing as the MVN component.
    1115  (handler-case
    12       (unless
    13           (flet ((match-jna-jar (p)
    14                    "Match `jna.jar`,`jna-3.0.9.jar`, or `jna-3.4.0.jar`."
    15                    (and (pathnamep p)
    16                         (equal (pathname-type p) "jar")
    17                         (java:jstatic "matches"
    18                                       "java.util.regex.Pattern"
    19                                       "jna(-[0-9]\\.[0-9]\\.[0-9](-.+)?)?"
    20                                       (pathname-name p))
    21                         p)))
    22             (dolist (loader (java:dump-classpath))
    23               (let ((jna-jar (some #'match-jna-jar loader)))
    24                 (when jna-jar
    25                   (return abcl-jar)))))
    26         (java:add-to-classpath (abcl-asdf:resolve
    27                                 "net.java.dev.jna:jna:3.4.0")))
     16      (unless (jss:find-java-class "com.sun.jna.Native")
     17        (unless
     18            (flet ((match-jna-jar (p)
     19                     "Match `jna.jar`,`jna-3.0.9.jar`, or `jna-3.4.0.jar`."
     20                     (and (pathnamep p)
     21                          (equal (pathname-type p) "jar")
     22                          (java:jstatic "matches"
     23                                        "java.util.regex.Pattern"
     24                                        "jna(-[0-9]\\.[0-9]\\.[0-9](-.+)?)?"
     25                                        (pathname-name p))
     26                          p)))
     27              (dolist (loader (java:dump-classpath))
     28                (let ((jna-jar (some #'match-jna-jar loader)))
     29                  (when jna-jar
     30                    (return abcl-jar)))))
     31          (unless
     32              (java:add-to-classpath (abcl-asdf:resolve
     33                                      "net.java.dev.jna:jna:3.4.0"))
     34            (java:add-to-classpath "http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar"))))
    2835    (t (e)
    29       (progn
    30         (unless (jss:find-java-class "com.sun.jna.Native")
    31           (error "Failed to resolve 'jna.jar' because~&~A." e))))))
     36      (error "Failed to resolve 'jna.jar' because~&~A." e))))
    3237
    3338                         
Note: See TracChangeset for help on using the changeset viewer.