Skip to content

Commit e455156

Browse files
committed
download
0 parents  commit e455156

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*~
2+
*.fasl
3+
*.tar.gz
4+
*.zip

.projectile

Whitespace-only changes.

tecgraf-libs.asd

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(defsystem #:tecgraf-libs
2+
:description "Tecgraf Shared Libraries"
3+
:author "Matthew Kennedy <[email protected]>"
4+
:homepage "https://github.com/lispnik/tecgraf-libs"
5+
:license "MIT"
6+
:serial t
7+
:pathname "tecgraf-libs"
8+
:components ((:file "tecgraf-libs"))
9+
:depends-on (#:cl+ssl
10+
#:drakma
11+
#:cffi
12+
#:puri
13+
#:cl-fad))

tecgraf-libs/tecgraf-libs.lisp

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(defpackage #:tecgraf-libs
2+
(:use #:common-lisp))
3+
4+
(in-package #:tecgraf-libs)
5+
6+
(defvar *archives*
7+
#+linux
8+
'("https://sourceforge.net/projects/iup/files/3.25/Linux%20Libraries/iup-3.25_Linux44_64_lib.tar.gz"
9+
"https://sourceforge.net/projects/canvasdraw/files/5.11.1/Linux%20Libraries/cd-5.11.1_Linux44_64_lib.tar.gz"
10+
"https://sourceforge.net/projects/imtoolkit/files/3.12/Linux%20Libraries/im-3.12_Linux44_64_lib.tar.gz")
11+
#+windows
12+
'("https://sourceforge.net/projects/iup/files/3.25/Windows%20Libraries/Dynamic/iup-3.25_Win64_dllw6_lib.zip"
13+
"https://sourceforge.net/projects/canvasdraw/files/5.11.1/Windows%20Libraries/Dynamic/cd-5.11.1_Win64_dllw6_lib.zip"
14+
"https://sourceforge.net/projects/imtoolkit/files/3.12/Windows%20Libraries/Dynamic/im-3.12_Win64_dllw6_lib.zip"))
15+
16+
(defconstant +buffer-size+ (* 1024 1024))
17+
18+
(defun download ()
19+
(dolist (archive *archives*)
20+
(format t "~&~A~%" archive)
21+
(finish-output)
22+
(let* ((archive-pathname (path:basename (puri:uri-path (puri:parse-uri archive))))
23+
(output-pathname (asdf:system-relative-pathname :tecgraf-libs archive-pathname)))
24+
(with-open-file
25+
(output-stream output-pathname :direction :output :if-exists :supersede :element-type '(unsigned-byte 8))
26+
(multiple-value-bind
27+
(input-stream status-code)
28+
(drakma:http-request archive :verify :required :want-stream t)
29+
(if (= status-code 200)
30+
(loop with buffer = (make-array +buffer-size+ :element-type '(unsigned-byte 8))
31+
for read-count = (read-sequence buffer input-stream)
32+
do (write-sequence buffer output-stream :end read-count)
33+
while (= read-count +buffer-size+))
34+
(error "Error downloading archive ~A" archive)))))))
35+
36+
37+
;;; download the files securely
38+
;;; unpack them
39+
;;; patchelf for ORIGIN
40+
;;; copy to asdf target location
41+

0 commit comments

Comments
 (0)