diff R/scratch/installation.R @ 0:0cfcc391201f

initial from svn dyncall-1745
author Daniel Adler
date Thu, 19 Mar 2015 22:26:28 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/R/scratch/installation.R	Thu Mar 19 22:26:28 2015 +0100
@@ -0,0 +1,68 @@
+
+# -----------------------------------------------------------------------------
+# dynport configuration
+.installdir <- "c:\\dynports"
+# -----------------------------------------------------------------------------
+
+# installation:
+.libname <- "SDL"
+.sysname <- Sys.info()[["sysname"]]
+if (.sysname == "Windows") {
+  
+  dynports.ui.init <- function()
+  {
+    winMenuAdd("Dynports")
+    winMenuAdd("Dynports/Install dynport(s) ...") 
+  }
+  
+  
+  dynport.sdl.is.installed <- function() {
+    x <- .dynload(.libname)
+    if (is.null(x)) return(FALSE) 
+    return(TRUE)
+  }
+  
+  dynport.sdl.install <- function() {
+    
+    sysname <- Sys.info()[["sysname"]]
+    
+    .prebuilt <- c(
+        Windows.zip="http://www.libsdl.org/release/SDL-1.2.13-win32.zip",
+        Linux.rpm.x86="http://www.libsdl.org/release/SDL-1.2.13-1.i386.rpm",
+        Linux.rpm.x86_64="http://www.libsdl.org/release/SDL-1.2.13-1.x86_64.rpm",
+        MacOSX="http://www.libsdl.org/release/SDL-1.2.13.dmg"
+    )
+    
+    if (sysname == "Windows") {
+      
+      # install.windows.zip to .dyncall.bindir
+      
+      package <- "SDL"
+      version <- "1.2.13"
+      arch    <- "win32"
+      rooturl <- "http://www.libsdl.org/release/"
+      zipname <- "SDL-1.2.13-win32.zip"
+      tempdir   <- tempdir()
+      zipfile  <- file.path( tempdir, zipname )
+      url     <- paste( rooturl , zipname, sep="/" )
+      method  <- "internal" 
+      download.file(url, zipfile, method)
+      zip.unpack( zipfile, tempdir )
+      dllname <- "SDL.dll"
+      dllfile <- file.path( tempdir, dllname )
+      file.copy(dllfile, .installdir)
+      
+    } else if (sysname == "Linux") {
+      
+      
+      
+    } else if (sysname == "Darwin") {
+      
+      
+      
+    }
+    
+  }
+  
+
+  
\ No newline at end of file