User:DOUG/Sandbox Lich Stuff

The official GemStone IV encyclopedia.
< User:DOUG
Revision as of 13:22, 30 July 2016 by DOUG (talk | contribs) (→‎Current Issues: Status on script)
Jump to navigation Jump to search

Let's start a short note page that keeps track of what I'm trying to do to get Lich to run on El Capitan. Using Virtual Box to keep from having to reinstall over and over and over. . .

Initial effort successful. Now working with basic installation. Basic installation below successful (for those who might be peeking and simply can't wait). Now working on bottling the two odd lines (cairo and gtk+). If I can bottle them, I should be able to build a binaries distribution package that won't require a long time compiling these brew recipes and the gems. It'll start being El Cap only, but I might add Mavericks and Yosemite to the binaries package as well. I'd have to move to downloading most of the bottles at that point, but it still would be significantly faster.

Current Issues

AS OF 7/25/2016

Newest gem versions (3.0.8) do not compile under Ruby 2.0 (OEM install on OSX) Homebrew no longer supports versions (can't install anything but current brews) Ruby 2.3+ drops support for $SAFE to only 0 and 1 (normal and tainted data). Lich uses $SAFE=3. Note: Modify Lich file to $SAFE=1 allows Lich to operate in 2.3 - fastest possible path, but need Tillmen's input and his risk acceptance

Building pkg has several challenges, including continual auto build / test / update cycles that aren't available to me presently.

Turning focus to a shell script install, which will take the actions for the users and will hopefully be simpler to maintain.

AS OF 7/30/2016

Ok, let's get this party started. Decisions:

1) bash script - not presently concerned about portability - faster to use. If somehow asked to port to Linux or Windows, might regret non-portability, but eh.

2) Fix locations for Lich and Avalon installs for now. Lich should be in ~/ and Avalon should be ~/Desktop . These are rather arbitrary but common sensical for right now. FIXME: mdfind might be an option, or perhaps locate - not ideal choice.

3) Outside of the necessary gtk+ version limit, and bumping to a higher ruby until I can get Tillmen's attention, not going to enforce any particular versioning.

4) Diagnostics / troubleshooting will be very light in script. FIXME: Probably need a separate diagnostic tool anyway, and it needs to make life easy!

5) Error trapping and present options to user. Well, ok, first reporting. FIXME: Then maybe presenting options.

Implemented the following features in a bash script (as of 7/30)

1) Detect version of OS X (supporting 10.9 through current - or Mavericks through El Capitan)
2) Detect xQuartz installed - FIXME:  Good grief this is messy and requires logout / login and rerunning the script, ugh.
3) Detect CLT installed - quiet install of CLT if not present (which can't xQuartz be managed this way?!)
4) Detect ruby version - if 2.1 or 2.2, leave alone, if 2.0, prep to update to 2.2.5, if 2.3, warn and bail out.
5) Detect rvm - if present, assume system is used for ruby dev and bail out with warning that rvm / rbenv do not coexist.
6) Detect homebrew - update if present, install if not
7) Detect rbenv - updated via homebrew (6) if present, install if not.  Need to resource bash profile to finish?! (Ugh.)
8) Detect cairo and gtk+ - install if not present and PIN. FIXME: need diagnostics to gather version / revision and test suitability
9) If Ruby version is 2.0.0, use rbenv to install 2.2.5, set up as global ruby and update gem system
10) Detect sqlite3 / gtk2 - install if not present.  FIXME: need diagnostics to gather version / revision and test suitability
11) Detect lich - download / unzip in $HOME if not detected at $HOME. Remove zip file. FIXME: Current version handling, detect at locations other than $HOME
12) Detect Avalon - download / unarchive in $HOME/Desktop if not detected at $HOME/Desktop. Remove zip file.  FIXME: Current version handling, detect at locations other than $HOME/Desktop.

Testing: Bare bones 10.11.6

Needful things before general release

1) FIXME - detect lich, detect Avalon
2) Error handling - right now, doesn't exist.

Probably move diagnostics to a separate script - might need to bundle test suite in order to facilitate.

Script outline

1)  Detect platform (OSX 10.9, 10.10 or 10.11)
2)  Detect CLT and if absent, install CLT (oh, and xQuartz. . . hmmm)
3)  Detect current active Ruby version (likely 2.0.0.p645 on OEM installs)
4)  Detect homebrew and if present, update to latest formulae.  If not present, install.
5)  Detect rbenv / rvm - might need to consider if this is a developer platform.  If neither present, install rbenv
6)  Install and set global ruby 2.2.5 (last general release prior to 2.3)
7)  Update gem and rehash rbenv env
8)  Install cairo (x-11), gtk+ (2.24!), sqlite3, gtk2 gems
9)  Grab lich, avalon
10) Test lich (both login window type and gemstone / avalon switch)
11)  Save all log / diagnostic and publish loc to user for follow up if required
12)  Release to user

Options to consider:

Apple script or additional bash script to semi-automate game start with lich
Maintenance methods (partial update, troubleshooting assistance)
MacPorts for ruby version install (not desired)

Prior Issues

3/7 Created hash and edited formula. Bottle pours properly, build seems to work. Have a couple decisions to make - bottles for each of 3 (Mavericks, Yosemite, El Capitan) which will make the install bundle 75M for about 25M worth of useful files, or bottles for 'most popular' and compile for all the rest. A third option - check to see if 'universal binary' means what it says and it works on all three OS's. Probably a pipe dream, though.

prior to 3/7 2.24.28 doesn't want to bottle - but kludged through. Formula needs to be updated and sent or bottle cannot be installed. - need sha256 value for bottle to install - stopping here for a day or two.

Alpha Build Package

add pre action script to start log, detect major.minor of OS add pre action script health check (gcc, brew, gem, installed brews, installed gems)

needs a lot of work here, but will have to make some logical choices and decide if moving / saving old configs might be in the cards.

add post action script to existing package to pour 2.24.28 properly. add post action script to pin 3 gems

Build Installation

Clean 10.11.3 install with CLT, Homebrew (and glib), xQuartz

bottle cairo with the x11 arg

bottle gtk+2.24.28 https://raw.githubusercontent.com/Homebrew/homebrew/bb3fe5f2de87f76bc0a3f3480635c8fd0d68cec3/Library/Formula/gtk+.rb

package up the gems

pkgbuild two (or more?) bottles with prefix /Library/Caches/Homebrew and 7 gems with prefix $(gem environment gemdir)

then put them together into an OS X Installer package - no frills.

Copy installer package to subsequent clean 10.11.3 install and install.

Then manually brew install the bottles, copy / extract lich, download avalon and test.

Basic Installation

This works for anyone who wants to use it on a clean install. Might require some cleanup if user already attempted to install.

Base 10.11 install

gcc -v to force command line tool install

update through App Store to 10.11.3 (current as of 2/29/2016)

Install Homebrew

brew install glib

Install Chrome

Install xQuartz

brew install --with-x11 cairo

brew install https://raw.githubusercontent.com/Homebrew/homebrew/bb3fe5f2de87f76bc0a3f3480635c8fd0d68cec3/Library/Formula/gtk+.rb

updated long link to - brew install http://bit.ly/GetGTKLich (test this)

sudo gem install gtk2

sudo gem install sqlite3

curl -OL https://lichproject.org/download/lich-4.6.22.zip (current Tillmen Lich)

install Avalon 4.3.2 beta (current GS FE for Mac)

sudo ruby ~/lich/lich.rbw --gemstone --avalon

(Options to set up for no sudo - hate using sudo for local gem installs)

change sudo gem install gtk2 to gem install --user-install --bindir~/bin --no-document gtk2

change sudo gem install sqlite3 to gem install --user-install -bindir~/bin --no-document sqlite3

still have to sudo to get into the game (due to having to temp modify /etc/hosts) This *could* be addressed a couple different ways, pursue this!

Test


Important note: while 2.24.28 https://raw.githubusercontent.com/Homebrew/homebrew/0772cb6a2c25589ef9914698082509fe518f596d/Library/Formula/gtk+.rb already has a bottled install, it causes the same issue. No value to that bottle.


Base OS 10.11 install.

Update to 10.11.3 (current as of 4 March 2016).

Install Chrome (because)

Install CLT

Install Homebrew


Install XQuartz

Install RBENV (because I personally prefer this to RVM)

Install ruby 2.2.2

Global 2.2.2

Install gtk+2.24.28 (requires specific pull from https://raw.githubusercontent.com/Homebrew/homebrew/bb3fe5f2de87f76bc0a3f3480635c8fd0d68cec3/Library/Formula/gtk+.rb)

gem install gtk2

gem install sqlite3

curl -OL https://lichproject.org/download/lich-4.6.22.zip (current Tillmen Lich)

install Avalon 4.3.2 beta (current GS FE for Mac)

Special note - seems gtk+-2.24.28 will require Cairo built with X11 (xQuartz) extensions, so the normal cairo bottle will fail. - brew install --with-x11 cairo to address.


If all this works, back up to base image and try with standard El Cap Ruby