ENIGMA Forums

General fluff => Announcements => Topic started by: freezway on May 21, 2010, 04:47:39 PM

Title: Install script - Ubuntu
Post by: freezway on May 21, 2010, 04:47:39 PM
I made a script to auto install and run ENIGMA/LGM. It is designed for ubuntu, but should work on other linux systems if you replace the apt-get lines with your package manager's lines and packages.
Code: [Select]
sudo apt-get -yqq install build-essential libgl1-mesa-dev libopenal-dev zlib1g-dev subversion rapidsvn
cd ~
svn co https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk enigma
cd enigma
make
java -jar lgm16b4.jar
Title: Re: Install script - Ubuntu
Post by: Josh @ Dreamland on May 21, 2010, 05:06:29 PM
Replace the sudo calls with one call to sudo su; or combine the install parameters.
Title: Re: Install script - Ubuntu
Post by: IsmAvatar on May 21, 2010, 05:34:49 PM
Code: [Select]
sudo apt-get -yqq install build-essential libgl1-mesa-dev zlib1g-dev subversion rapidsvn
cd ~
svn co https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk enigma
cd enigma
make -C CompilerSource linux
java -jar lgm16b4.jar
Title: Re: Install script - Ubuntu
Post by: freezway on May 21, 2010, 05:46:52 PM
cool, i get a post in announcements! modifications made!
Title: Re: Install script - Ubuntu
Post by: Josh @ Dreamland on May 21, 2010, 09:56:26 PM
You know, as long as this script is for Linux, you may as well call my makefile generator script under CompilerSource/genmake.sh. It'll make sure the damn makefile is current. Would be convenient if SVN could call that thing before commit.
Title: Re: Install script - Ubuntu
Post by: IsmAvatar on May 22, 2010, 01:01:48 PM
Maybe you should make a script

commit.sh
Code: [Select]
#!/bin/sh
./CompilerSource/genmake.sh
if [ $# = 0 ]; then
  svn ci
else
  svn ci -m $1
fi

./commit.sh "Fixed stuff"
or, if you don't want to provide a message
./commit.sh
Title: Re: Install script - Ubuntu
Post by: RetroX on May 22, 2010, 05:03:56 PM
I was working on a PKGBUILD for ENIGMA; let me go and look for it.
Title: Re: Install script - Ubuntu
Post by: RetroX on May 22, 2010, 06:29:45 PM
Here's the PKGBUILD:
Code: [Select]
pkgname=enigma-dev
pkgver=238
pkgrel=1
pkgdesc="An open-source alternative to YoYoGame's Game Maker, written in C++."
arch=('i686' 'x86_64')
url="http://enigma-dev.org"
license=('GPL')
depends=('libgl' 'zlib')
makedepends=('pkgconfig' 'subversion')
sources=()
md5sums=()
_svntrunk=https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/
_svnmod=enigma-dev

build() {
  svn co $_svntrunk
  mkdir $startdir/pkg/opt
  mkdir $startdir/pkg/opt/enigma
  cp -r $startdir/src/$_svnmod/trunk -T $startdir/pkg/opt/enigma
  cd $startdir/pkg/opt/enigma/CompilerSource

  rm -rf $(find $startdir/pkg | grep 'svn$')
  rm -rf '$startdir/pkg/opt/enigma/CompilerSource/.eobjs'

  mkdir $startdir/pkg/usr
  mkdir $startdir/pkg/usr/share
  mkdir $startdir/pkg/usr/share/pixmaps
  mkdir $startdir/pkg/usr/share/applications
  cp $startdir/pkg/opt/enigma/enigma.svg $startdir/pkg/usr/share/pixmaps
  cp $startdir/pkg/opt/enigma/enigma.desktop $startdir/pkg/usr/share/applications

  make linux || return 1
  }
Title: Re: Install script - Ubuntu
Post by: kkg on May 23, 2010, 08:06:51 AM
So I did a nice little manual install on my new Ubuntu 10.04 LTS PC. I try to run LGM and I get this:
Code: [Select]
cone-linux@cone-linuxpc:~/Desktop/enigma/enigma$ sudo java -jar lgm16b4.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
   at java.lang.Class.initializeClass(libgcj.so.10)
Caused by: java.lang.NullPointerException
   at java.util.regex.Matcher.toMatchResult(libgcj.so.10)
   at java.util.Scanner.myCoreNext(libgcj.so.10)
   at java.util.Scanner.myPrepareForNext(libgcj.so.10)
   at java.util.Scanner.myNextInt(libgcj.so.10)
   at java.util.Scanner.nextInt(libgcj.so.10)
   at java.util.Scanner.nextInt(libgcj.so.10)
   at org.lateralgm.main.LGM.<clinit>(LGM.java:108)
   at java.lang.Class.initializeClass(libgcj.so.10)

What am I missing? :(
Title: Re: Install script - Ubuntu
Post by: RetroX on May 23, 2010, 08:28:38 AM
Well, apparently, Ism can't check for null pointers.
Title: Re: Install script - Ubuntu
Post by: IsmAvatar on May 23, 2010, 03:48:43 PM
kkg: run "java -version" and tell me the output.
Title: Re: Install script - Ubuntu
Post by: MahFreenAmeh on May 23, 2010, 05:52:50 PM
Replace the sudo calls with one call to sudo su; or combine the install parameters.

youk now, there was only one sudo, right?

if he were to replace it with sudo su then he would also have to add exit at the end, essentially, to drop out of the administrative shell so as to keep the idiotic users less idiotic.
Title: Re: Install script - Ubuntu
Post by: Josh @ Dreamland on May 23, 2010, 06:03:56 PM
He edited it. :P
Title: Re: Install script - Ubuntu
Post by: RetroX on May 23, 2010, 06:55:09 PM
Replace the sudo calls with one call to sudo su; or combine the install parameters.

youk now, there was only one sudo, right?

if he were to replace it with sudo su then he would also have to add exit at the end, essentially, to drop out of the administrative shell so as to keep the idiotic users less idiotic.
isn't that uh, automatic?

the shell is automatically exited upon ending the script
Title: Re: Install script - Ubuntu
Post by: retep998 on May 23, 2010, 07:19:02 PM
Replace the sudo calls with one call to sudo su; or combine the install parameters.

youk now, there was only one sudo, right?

if he were to replace it with sudo su then he would also have to add exit at the end, essentially, to drop out of the administrative shell so as to keep the idiotic users less idiotic.
isn't that uh, automatic?

the shell is automatically exited upon ending the script
Unless they ran the script from within the shell.
Title: Re: Install script - Ubuntu
Post by: RetroX on May 23, 2010, 08:34:21 PM
Replace the sudo calls with one call to sudo su; or combine the install parameters.

youk now, there was only one sudo, right?

if he were to replace it with sudo su then he would also have to add exit at the end, essentially, to drop out of the administrative shell so as to keep the idiotic users less idiotic.
isn't that uh, automatic?

the shell is automatically exited upon ending the script
Unless they ran the script from within the shell.
Ah, I guess not.
Title: Re: Install script - Ubuntu
Post by: MahFreenAmeh on July 03, 2010, 06:58:20 PM
cd ~ && sudo apt-get -yqq install build-essential libgl1-mesa-dev zlib1g-dev subversion rapidsvn && svn co https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk enigma && cd enigma && make -C CompilerSource linux && java -jar lgm16b4.jar
one liners are AWESOME.
Title: Re: Install script - Ubuntu
Post by: IsmAvatar on July 04, 2010, 12:28:27 PM
About a week ago, I fixed Make so you didn't have to cd into CompilerSource for make.
So you can replace
make -C CompilerSource linux
with
make linux
Title: Re: Install script - Ubuntu
Post by: freezway on July 04, 2010, 05:21:20 PM
what is -C?
Title: Re: Install script - Ubuntu
Post by: Josh @ Dreamland on July 04, 2010, 05:24:43 PM
Build directory.

Nice change, Ism.