annotate R/scratch/installation.R @ 27:18e1f1bb1945

- 1.1 update
author Tassilo Philipp
date Sun, 12 Jan 2020 12:10:38 +0100
parents 0cfcc391201f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 # -----------------------------------------------------------------------------
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 # dynport configuration
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 .installdir <- "c:\\dynports"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 # -----------------------------------------------------------------------------
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 # installation:
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 .libname <- "SDL"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 .sysname <- Sys.info()[["sysname"]]
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 if (.sysname == "Windows") {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 dynports.ui.init <- function()
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 winMenuAdd("Dynports")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 winMenuAdd("Dynports/Install dynport(s) ...")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 dynport.sdl.is.installed <- function() {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 x <- .dynload(.libname)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 if (is.null(x)) return(FALSE)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 return(TRUE)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25 dynport.sdl.install <- function() {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 sysname <- Sys.info()[["sysname"]]
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 .prebuilt <- c(
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 Windows.zip="http://www.libsdl.org/release/SDL-1.2.13-win32.zip",
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 Linux.rpm.x86="http://www.libsdl.org/release/SDL-1.2.13-1.i386.rpm",
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 Linux.rpm.x86_64="http://www.libsdl.org/release/SDL-1.2.13-1.x86_64.rpm",
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 MacOSX="http://www.libsdl.org/release/SDL-1.2.13.dmg"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 if (sysname == "Windows") {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 # install.windows.zip to .dyncall.bindir
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40 package <- "SDL"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 version <- "1.2.13"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42 arch <- "win32"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 rooturl <- "http://www.libsdl.org/release/"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 zipname <- "SDL-1.2.13-win32.zip"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 tempdir <- tempdir()
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46 zipfile <- file.path( tempdir, zipname )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 url <- paste( rooturl , zipname, sep="/" )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48 method <- "internal"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 download.file(url, zipfile, method)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 zip.unpack( zipfile, tempdir )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 dllname <- "SDL.dll"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 dllfile <- file.path( tempdir, dllname )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 file.copy(dllfile, .installdir)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55 } else if (sysname == "Linux") {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 } else if (sysname == "Darwin") {
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68