Re: Is there any chance of a .deb file for wxEuphoria?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Here is a small OpenEuphoria program which could do the job if compiled. It takes to additional files:

  • dependencies.txt, the list of packages needed to do the job
  • the archive, here named eu41.tgz

I could provide 2 archives, one for 32 bits and one for 64 bits. Not the latest ones, but the ones which work for me.

include std/filesys.e 
include std/error.e 
include std/io.e 
include std/pipeio.e as pipe 
 
object   void = 0 
sequence InitialDir 
integer  f_debug 
 
------------------------------------------------------------------------------ 
 
public function execCommand(sequence cmd) 
  sequence s = "" 
  object z = pipe:create() 
  object p = pipe:exec(cmd, z) 
  if atom(p) then 
    printf(2, "Failed to exec() with error %x\n", pipe:error_no()) 
    pipe:kill(p) 
	return -1 
  end if 
  object c = pipe:read(p[pipe:STDOUT], 256) 
  while sequence(c) and length(c) do 
    s &= c 
    if atom(c) then 
	  printf(2, "Failed on read with error %x\n", pipe:error_no()) 
      pipe:kill(p) 
	  return -1 
    end if 
    c = pipe:read(p[pipe:STDOUT], 256) 
  end while 
  --Close pipes and make sure process is terminated 
  pipe:kill(p) 
  return s 
end function 
 
------------------------------------------------------------------------------ 
 
function isInstalled(sequence package) 
  sequence s = execCommand("dpkg-query -s " & package & " | grep Status") 
  if length(s) and match("ok installed", s) then 
    return 1 
  else 
    return 0 
  end if 
end function 
 
------------------------------------------------------------------------------ 
 
procedure installIfNot(sequence package) 
  if isInstalled(package) then 
    puts(2, package & " already installed\n") 
  else 
    puts(2, "apt-get install -y " & package & "\n") 
    sequence s = execCommand("apt-get install -y " & package) 
    puts(2, s & "\n") 
  end if 
end procedure 
 
------------------------------------------------------------------------------ 
 
  sequence cmd = command_line() 
  integer lg = length(cmd) 
  if lg>2 then 
    puts(1, "Usage: eui install_AIO.ex\n") 
  end if 
  sequence info = pathinfo(cmd[2]) 
  void = chdir(info[PATH_DIR]) 
  InitialDir = current_dir() 
  f_debug = open(InitialDir&SLASH&info[PATH_BASENAME]&".log", "w") 
  crash_file(InitialDir&SLASH&info[PATH_BASENAME]&".err") 
 
  sequence s = read_lines(InitialDir&SLASH&"dependencies.txt") 
  for i = 1 to length(s) do 
    installIfNot(s[i]) 
  end for 
 
  s = execCommand("tar -xf "&InitialDir&SLASH&"eu41.tgz -C /usr/local/euphoria-4.1.0") 
   
  if append_lines("/etc/bash.bashrc", { 
    "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/euphoria-4.1.0/bin",  
    "export EUDIR=/usr/local/euphoria-4.1.0", 
    "export EUINC=/usr/local/euphoria-4.1.0/include/" 
  }) = -1 then 
    puts(2, "Failed to append lines to /etc/bash.bashrc\nAre you connected as root?\n") 
  end if 
 
  close(f_debug) 

Here is the content of dependencies.txt:

libwxbase2.8-0 
libwxbase2.8-dev 
libwxgtk-media2.8-0 
libwxgtk-media2.8-dev 
libwxgtk2.8-0 
libwxgtk2.8-dev 
libwxsmithlib0 
libwxsqlite3-2.8-0 
libwxsqlite3-2.8-dev 
wx2.8-doc 
wx2.8-examples 
wx2.8-headers 
wx2.8-i18n 
wxformbuilder 
wxsqlite3-doc 

Regards

Jean-Marc

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu