pls153

Untitled

Jan 2nd, 2020
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. You'll need a cross-compiled ECL and 'adb' from the android command line tools.
  2.  
  3. * copy 'ecl', 'libecl.so' and all prebuilt contribs to the device like this:
  4.  
  5. adb push bin/ecl /data/local/tmp/
  6. adb push lib/libecl.so /data/local/tmp/
  7. adb push lib/ecl-xx.x.x/encodings /data/local/tmp/
  8. adb push lib/ecl-xx.x-x/*.doc /data/local/tmp/
  9. adb push lib/ecl-xx.x.x/*.asd /data/local/tmp/
  10. adb push lib/ecl-xx.x.x/*.fas /data/local/tmp/
  11.  
  12. * copy the cloned 'cl-test-grid' directory:
  13.  
  14. adb push cl-test-grid /data/local/tmp/
  15.  
  16. * copy the modified 'run-agent.sh' and 'run-agent.lisp' (after editing your email in 'run-agent.lisp'); both files are included here, see below
  17.  
  18. adb push run-agent.sh /data/local/tmp/cl-test-grid/
  19. adb push run-agent.lisp /data/local/tmp/cl-test-grid/
  20.  
  21. * start 'adb shell' and run:
  22.  
  23. $ cd /data/local/tmp
  24. $ mv cl-test-grid/* .
  25. $ export LD_LIBRARY_PATH=/data/local/tmp
  26. $ chmod a+x ecl
  27. $ chmod a+x run-agent.sh
  28. $ ./run-agent.sh
  29.  
  30.  
  31.  
  32. --- contents of 'run-agent.sh' ------------------------------------------------
  33.  
  34. # Ensure the current directory is where this file is located
  35. cd "`dirname $0`"
  36.  
  37. # Update to the recent cl-test-grid version (required).
  38. #git pull
  39.  
  40. # Start your run-agent.lisp script. We suppose
  41. # Quicklisp is installed and added to the init
  42. # file of your lisp.
  43.  
  44. # (EDIT THE PATH TO CCL)
  45. ./ecl --load run-agent.lisp --eval "(quit)"
  46. # CCL is the recommented choice, as it is the test grid development platform.
  47.  
  48. # As for other lisps, see docs/agent-portability.txt.
  49.  
  50.  
  51.  
  52. --- contents of 'run-agent.lisp' ----------------------------------------------
  53.  
  54. ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
  55. ;;;; Copyright (C) 2011 Anton Vodonosov ([email protected])
  56. ;;;; See LICENSE for details.
  57. ;;;;
  58. ;;;; Example file for how to configure and run cl-test-grid agent.
  59. ;;;; Load the file by:
  60. ;;;; (load "run-agent.lisp")
  61. ;;;;
  62.  
  63. ;; *** hack for android/ECL ***
  64.  
  65. (in-package :cl-user)
  66.  
  67. (ext:package-lock :common-lisp nil)
  68.  
  69. (defun user-homedir-pathname (&optional host)
  70. *default-pathname-defaults*)
  71.  
  72. (ext:package-lock :common-lisp t)
  73.  
  74. (dolist (el '(("XDG_DATA_HOME" . "")
  75. ("XDG_CONFIG_HOME" . "")
  76. ("XDG_DATA_DIRS" . "")
  77. ("XDG_CONFIG_DIRS" . "")
  78. ("XDG_CACHE_HOME" . ".cache")))
  79. (ext:setenv (car el) (namestring (merge-pathnames (cdr el) (user-homedir-pathname)))))
  80.  
  81. (ext:install-bytecodes-compiler)
  82.  
  83. ;; *** end hack ***
  84.  
  85. (defparameter *this-dir*
  86. (make-pathname :name nil :type nil :defaults *load-truename*))
  87.  
  88. ;; If quicklisp is absent, install and load it
  89. (load (merge-pathnames "agent/require-quicklisp.lisp" *this-dir*))
  90. (tg-require-quicklisp:require :agent-work-dir (merge-pathnames "work-dir/agent/" *this-dir*))
  91.  
  92. (let ((asdf:*central-registry* (cons *this-dir* asdf:*central-registry*)))
  93. (ql:quickload :test-grid-agent))
  94.  
  95. (defparameter *ecl-bytecode* (make-instance 'lisp-exe:ecl
  96. :exe-path "./ecl"
  97. :compiler :bytecode))
  98.  
  99. ;; create agent instance
  100. (defparameter *agent*
  101. (test-grid-agent:make-agent
  102. :lisps (list *ecl-bytecode*)
  103. :preferred-lisp *ecl-bytecode*
  104. ;;
  105. ;; If you are strongly opposed to publishing you email, please provide
  106. ;; just some nickname.
  107. :user-email "[email protected]"
  108.  
  109. ;;; --- the settings below are not required ---
  110.  
  111. ;; You may specify custom working directory for
  112. ;; the agent. By default it is <source-code-base>/work-dir/agent/
  113. ;;
  114. ;; :work-dir #P"/my/cl-test-grid/work-dir/agent/"
  115.  
  116. ;; Only if you run several agents, give each of them
  117. ;; different work-dir (above) and lock port:
  118. ;;
  119. ;; :singleton-lock-port 7686
  120. ))
  121.  
  122. ;;; Ask agent to do its work
  123. (test-grid-agent:main *agent*)
Advertisement
Add Comment
Please, Sign In to add comment