source: trunk/abcl/contrib/mvn/jna.asd @ 14217

Last change on this file since 14217 was 14217, checked in by Mark Evenson, 8 years ago

Update to explicitly using jna-3.5.0.jar.

File size: 1.4 KB
Line 
1;;;; -*- Mode: LISP -*-
2
3;;;; Need to have jna.jar present for CFFI to have a chance of working.
4(asdf:defsystem :jna
5    :version "3.5.0"
6    :defsystem-depends-on (jss abcl-asdf)
7;; FIXME: always seems to be resolving the LATEST maven artifact.
8    :components ((:mvn "net.java.dev.jna/jna/3.5.0")))
9
10(in-package :asdf)
11(defmethod perform :after ((o load-op) (c (eql (find-system :jna))))
12  (when (jss:find-java-class "com.sun.jna.Native")
13    (provide :jna)))
14
15;;; After ASDF performs COMPILE-OP, one expects that the JNA Java
16;;; classes can be instantiated.  If not, execute various loading strategies.
17(defmethod perform ((o compile-op) (c (eql (find-system :jna))))
18  ;; Theoretically this should be the same thing as the MVN component.
19  (format *debug-io* "~&Attemping to locate jvm binary artifacts for JNA...~&")
20  (handler-case
21      (jss:find-java-class "com.sun.jna.Native")
22    (java:java-exception (e)
23      (unless
24          (java:add-to-classpath (abcl-asdf:resolve "net.java.dev.jna:jna:3.4.0"))
25        (unless
26            ;; Might want to download to local filesystem, then place in classpath
27            (java:add-to-classpath #p"http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.5.0/jna-3.5.0.jar")
28          (error "Failed to load jna-3.5.0.jar from the network via URI."))
29        (error "Failed to load jna.jar via ABCL-ASDF.")))
30    (t (e)
31      (error "Failed to resolve 'jna.jar' because~&~A.~&" e))))
32
33                         
Note: See TracBrowser for help on using the repository browser.