Difference between revisions of "User:DOUG/Sandbox Lich Stuff"

The official GemStone IV encyclopedia.
Jump to: navigation, search
m
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Current==
+
<section begin=GTK3PublicBeta />
The current osxlich installer (preparing for pkg delivery?  Ugh)
 
  
<pre{{log2}}>
+
==GTK3 Beta Test==
#!/usr/bin/env bash
 
  
#  osxlich.sh
+
Welcome to the GTK3 Ruby Lich Public Beta!
#
 
#
 
#  Created by doug on 7/30/16
 
#  version 1.3
 
# 4/15/17 - updated for Sierra
 
# 4/15/18 - updated for High Sierra
 
# 4/16/18 - updated Ruby logic to install 2.2.5 on High Sierra (2.3) machines
 
# 6/10/18 - updated cairo location to reverse Homebrew decision to remove x11
 
# 6/14/18 - general improvements while preparing for pkg builds
 
#
 
  
# Welcome to the automagic Mac OS X Lich install script
+
Before we begin, there are a couple of things you should know about participating in this beta program:
# I am prepared to turn your Mac system
 
# into an awesome Siumtronics gaming machine via Tillmen Magic.
 
# Script built and maintained by Doug (doug@play.net)
 
  
# Logging, yay
+
1)  It IS a beta program.  If something can go wrong, it just might, here.  So follow these instructions carefully to have the BEST shot at recovering your Lich installation and continuing to enjoy Gemstone.
  
today_Date=$(date +"%F")
+
* It is vitally important that you NOT participate in the GTK3 beta if you are not already a Lich user.  If you are new to Gemstone and Lich, do not use this Public Beta.  Instead, use the stable installer build at https://bit.ly/WinLich .
player_Name=$(whoami)
+
LOG="$player_Name-$today_Date-osxlich.txt"
+
* If you are already a Lich user, and you are comfortable participating in the Public Beta, then you should at an absolute minimum, back up your existing Lich folder.  The beta installer does not touch the existing lich folder, but if something can go wrong, you should have a copy saved somewhere.
 +
 +
* If you are already a Lich user, and you are comfortable participating in the Public Beta, then you should rename your existing Ruby installation.  If you accepted the default installation from the stable installer build, your Ruby installation is at C:\Ruby4Lich .  You can simply rename that folder C:\save-Ruby4Lich , and you will be able to easily revert back from the beta to your current Ruby4Lich installation. 
 +
 +
* Remember that the GTK3 beta is intended to retire GTK2, given its age and lack of updates.  What this means to you is that any Lich program that uses a graphical user interface (GUI) will behave differently.  The team has updated the LICH.RBW file and the core scripts distributed by Tillmen to work with GTK3.  The team has also updated some of the more popular scripts and included them in a subdirectory for you to use, if you wish.
 +
 +
2) If you are happy with what you have read so far, and are eager to get started, exit all characters from the game. 
 +
 +
3) Back up your lich directory and rename your existing Ruby4Lich (or other Ruby) installation.
 +
 +
4) Download the BetaGTK3-Ruby4Lich installer here:  https://www.dropbox.com/s/upkg2qy1vmip31z/BetaGTK3-Ruby4Lich.exe?dl=1
 +
 +
5) Run the installer.  Be patient, it may take some time especially on non-SSD harddrives - it is installing 70K plus files.
 +
 +
6) When done, click FINISH on the installer, and you will see the GTK3Lich folder on your desktop.  Run the LICH.RBW file from that folder and confirm you can log in with Lich active.
 +
 +
At this point, you can make plans to copy the GTK3Lich files into your existing Lich directory so you don't have to redo everything.  You did remember to back up your existing Lich directory, right?  If not, do it now before you start moving scripts around.
 +
 +
Any and all errors please share in the #scripting channel on Discord.  Please ensure you provide a current run of ''';version''' with your report
 +
 +
Enjoy!
  
exec > >( tee >( sed -l 's/\[[0-9]*m//g' >> ~/Desktop/"$LOG" ) )
 
exec 2>&1
 
  
  
# Let's set up a few constants here, shall we?
+
===GTK3 Public Beta FAQ===
  
bold="\033[1m"
+
'''Q: Why am I renaming my Ruby4Lich directory instead of just deleting it?'''
normal="\033[0m"
 
  
###########################################################################
+
A: During the beta test you may find a critical script that you cannot live without that simply does not work right.  If you delete your existing Ruby4Lich installation, and later decide to exit the beta test, you'll have to reinstall Ruby4Lich to continue enjoying Lich and Gemstone.  Renaming will save you time, if you decide the beta program is not for you.
##
 
##      Proc Defs
 
##
 
###########################################################################
 
  
# Time the install process
+
'''Q: What should I do when I see a bunch of information about a script that I'm running needing to be fixed?'''
  
start_Timer () {
+
A: Come to Discord#scripting and put the script name up with a reference to GTK3.  The team will look at it, and convert it or notify the script author to do the update.
  
    SCRIPT_START=$(date)
+
'''Q: I just copied the new GTK3Lich scripts into my standard Lich folder, and now nothing works right.  What do I do?'''
    START_TIME=$SECONDS
 
    user_echo ""
 
    user_echo ""
 
    user_echo "${bold}\t  Welcome to Mac OS X and Lich Installer${normal}"
 
    user_echo "\t    Run at $SCRIPT_START"
 
    user_echo ""
 
    user_echo ""
 
}
 
  
end_Timer () {
+
A: Check to be sure you also copied the Lich.rbw file over - without that, your install will not work properly.
    SCRIPT_END=$(date)
 
    hack_Timer 'Script'
 
    user_echo "\t  Ended at $SCRIPT_END"
 
}
 
  
end_Msg () {
+
'''Q: Why are we doing this when the existing installer works?'''
    local fmt="$1"
 
    user_echo "${bold}\tYOU MUST EXIT THIS WINDOW AND START A FRESH TERMINAL SESSION${normal}"
 
}
 
  
hack_Timer () {
+
A: Three reasons - the most important being that we want to update to a faster and more stable Ruby.  Second, we want to get onto the more current graphics display framework (GTK3), since the older existing graphics display framework (GTK2) is not updated and has some defects in it.  Third, some exciting new scripts are being developed that will only work with the more current graphics display framework.
    local fmt="$1"
 
  
    ELAPSED_TIME=$(($SECONDS - $START_TIME))
+
'''Q: What's my emergency recovery procedure if I just want to go back to what I know?'''
    HOURS=$(($ELAPSED_TIME/60/60))
 
    MINUTES=$(($ELAPSED_TIME/60%60))
 
    SECS=$(($ELAPSED_TIME%60))
 
  
    if [[ "$SECONDS" ]]; then
+
A: Tricky question!  That will depend on what you did or chose not to do from the recommendations.  The short list based on the recommendations is to restore your original LICH folder from the copy you made at the very beginning, then uninstall the GTK3Beta-Ruby4Lich application and delete the folder, then rename your saved Ruby4Lich folder back to just Ruby4Lich.  You are now ready to try starting up your restored LICH installation. If it asks you how to deal with lich.rbw, just associate the file with the Ruby4Lich\bin\rubyw.exe application.  That should restore your functionality.  If it doesn't, swing by Discord#scripting and let us know.
        if [[ "$MINUTES" > "0" ]] && [[ "$HOURS" > "0" ]]; then
 
            user_echo "\n${bold}$fmt finished in $HOURS hr, $MINUTES min, and $SECS sec from script start${normal}"
 
        elif [[ "$MINUTES" > "0" ]] && [[ "$HOURS" == "0" ]]; then
 
            user_echo "\n ${bold}$fmt finished in $MINUTES min, and $SECS sec from script start${normal}"
 
        else
 
            user_echo "\n\t${bold}$fmt finished in $SECS sec from script start${normal}"
 
        fi
 
    fi
 
  
}
+
<section end=GTK3PublicBeta />
 
 
 
 
# Get your echo on
 
 
 
user_echo() {
 
    local fmt="$1"; shift
 
    printf "$fmt\n" "$@"
 
}
 
 
 
# Proc to append to bash_profile
 
 
 
append_to_bash() {
 
    local text="$1" bashloc
 
    local skip_new_line="${2:-0}"
 
 
 
    if [ -w "$HOME/.bash_profile.local" ]; then
 
        bashloc="$HOME/.bash_profile.local"
 
    else
 
        bashloc="$HOME/.bash_profile"
 
    fi
 
 
 
    if ! grep -Fqs "$text" "$bashloc"; then
 
        if [ "$skip_new_line" -eq 1 ]; then
 
            printf "%s\n" "$text" >> "$bashloc"
 
        else
 
            printf "\n%s\n" "$text" >> "$bashloc"
 
        fi
 
    fi
 
}
 
 
 
 
 
# Color me a picture worthy of words
 
# display a message in red with an x by it
 
function echo_fail {
 
    # echo first argument in red
 
    printf " \e[31m✘"
 
    # reset colours back to normal
 
    echo "\033[0m"
 
}
 
 
 
# display a message in green with a tick by it
 
function echo_pass {
 
    # echo first argument in green
 
    printf " \e[32m✔"
 
    # reset colours back to normal
 
    echo "\033[0m"
 
}
 
 
 
# Return version of ruby
 
 
 
ruby_ver() {
 
    ruby -v
 
}
 
 
 
# Return OS version
 
 
 
os_ver() {
 
    sw_vers -productVersion
 
}
 
 
 
# Return CLT status
 
 
 
CLT_ver() {
 
    pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
 
}
 
 
 
# Return xQuartz status
 
 
 
XQ_ver() {
 
    pkgutil --info org.macosforge.xquartz.pkg
 
}
 
 
 
###########################################################################
 
##
 
##      End Proc Defs
 
##
 
###########################################################################
 
 
 
start_Timer
 
 
 
# Welcome message
 
 
 
user_echo "\n${bold}This will install software to run Lich on your Mac."
 
user_echo "If you use this machine to develop software, especially in ruby"
 
user_echo "I would strongly encourage you to stop this script and review"
 
user_echo "it carefully.  It will attempt to install Ruby managers and gems."
 
user_echo "You may also be required to log back into OS X and rerun this"
 
user_echo "script one time. Please consider this.${normal}"
 
 
 
user_echo ""
 
 
 
# Prompt to continue
 
read -p "  Continue? (y/n) " ans
 
if [[ $ans != "y" ]]; then
 
    user_echo "\nQuitting...\n"
 
    exit
 
fi
 
 
 
 
 
# This determines ths version of Mac OSX
 
# Will only function on Mac OSX
 
# Continue extending to other implementations via uname
 
 
 
valid_os="$(os_ver)"
 
 
 
if [[ "$valid_os" =~ "10.9" ]]; then
 
    user_echo "OS X Mavericks detected.  OS Supported. $(echo_pass)"
 
    user_echo ""
 
elif [[ "$vaild_os" =~ "10.10" ]]; then
 
    user_echo "OS X Yosemite detected.  OS Supported. $(echo_pass)"
 
    user_echo ""
 
elif [[ "$valid_os" =~ "10.11" ]]; then
 
    user_echo "OS X El Capitan detected.  OS Supported. $(echo_pass)"
 
    user_echo ""
 
elif [[ "$valid_os" =~ "10.12" ]]; then
 
    user_echo "OS X Sierra detected.  OS Supported.  $(echo_pass)"
 
    user_echo ""
 
elif [[ "$valid_os" =~ "10.13" ]]; then
 
    user_echo "OS X High Sierra detected.  OS Supported.  $(echo_pass)"
 
    user_echo ""
 
else
 
    user_echo "${bold}Your Mac OS is $valid_os, and is not supported.  $(echo_fail)"
 
    user_echo "There may be hope, but you'll have to work manually to install everything."
 
    user_echo "You can email doug@play.net to see if assistance is available.${normal}"
 
    user_echo ""
 
    exit
 
fi
 
 
 
# This determines if brew has been installed.
 
# Interesting thing about brew is it will install the CLT automatically
 
# if needed, and it has xQuartz in a delivery mode that doesn't require
 
# exiting Terminal and restarting it.  Inorite?
 
 
 
# So our order will be
 
# Check for brew - if found, fall back to xQuartz and beyond.
 
# If not found (brew) - install brew (which gets CLT)
 
# then install everything elsee
 
# This means we can drop the CLT check, because either it
 
# exists with brew, or it gets installed with brew.
 
# We'll test everything on exit, though.
 
# First, though - let's check for rvm
 
 
 
# This check is to determine if either
 
# rvm is presently installed on the system
 
# if not present, rbenv will be installed
 
# If it is present, bail out!
 
 
 
if command -v rvm >/dev/null; then
 
    user_echo "It appears that this system already has"
 
    user_echo "the rvm ruby manager installed.  Because"
 
    user_echo "this usually means that the sytsem is"
 
    user_echo "actively being used for development in"
 
    user_echo "Ruby, and because rvm and the manager"
 
    user_echo "that this script installs (rbenv) do NOT"
 
    user_echo "play well together, I am going to stop"
 
    user_echo "and exit here.  Seek further guidance"
 
    user_echo "from doug@play.net"
 
    user_echo ""
 
    sleep 5s
 
    exit
 
else
 
    user_echo "Ruby manager rvm is not detected.  $(echo_pass)"
 
    user_echo ""
 
fi
 
 
 
# Now brew (installs CLT if not present)
 
 
 
if ! command -v brew >/dev/null; then
 
    user_echo "Homebrew is not installed.  $(echo_fail)"
 
    user_echo "Installing Homebrew. You will be asked for your password."
 
    user_echo ""
 
    curl -fsS 'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
 
else
 
    user_echo "Homebrew detected. $(echo_pass)"
 
    user_echo ""
 
fi
 
 
 
hack_Timer 'Homebrew checkpoint'
 
 
 
# Now xQuartz
 
valid_XQ="$(XQ_ver)"
 
 
 
if [[ "$valid_XQ" =~ "version" ]]; then
 
    user_echo "Your system already has xQuartz installed.  $(echo_pass)";
 
    user_echo ""
 
else
 
    brew tap Caskroom/cask
 
    brew install Caskroom/cask/xquartz
 
fi
 
 
 
hack_Timer 'xQuartz checkpoint'
 
 
 
 
 
# This check is to determine your existing active
 
# Ruby version and revision.  If greater than 2.0
 
# no action need be taken, but we should determine
 
# how that newer version of Ruby is managed
 
 
 
installed_ver="$(ruby_ver)"
 
 
 
RUBYREQ=FALSE
 
 
 
if [[ "$installed_ver" =~ "2.0.0" ]] ; then
 
    user_echo "Ruby version 2.0.0 detected.  Will update. $(echo_fail)"
 
    user_echo ""
 
    RUBYREQ=TRUE
 
elif [[ "$installed_ver" =~ "2.1" ]] || [[ "$installed_ver" =~ "2.2" ]] ; then
 
    user_echo "Ruby version 2.1 or 2.2 detected.  Leaving in place. $(echo_pass)"
 
    user_echo ""
 
elif [[ "$installed_ver" =~  "2.3" ]] || [[ "$installed_ver" =~ "2.4" ]]; then
 
    user_echo "Ruby version 2.3 or 2.4 detected.  Installing supported Ruby version. $(echo_pass)"
 
    user_echo ""
 
RUBYREQ=TRUE
 
else
 
user_echo "For some reason, I've failed to detect a Ruby version I understand.  $(echo_fail)"
 
user_echo "May need help.  Exiting. . ."
 
exit
 
fi
 
 
 
 
 
# Getting down to brass tacks here.  At this point, we
 
# know the envrionment well enough to start our installations
 
 
 
user_echo "Updating Homebrew for latest formulas."
 
user_echo ""
 
brew update
 
if ! brew list | grep -Fq rbenv; then
 
    user_echo "Installing rbenv"
 
    user_echo ""
 
    brew install rbenv
 
    brew install ruby-build
 
    rbenv init
 
    append_to_bash 'eval "$(rbenv init - --no-rehash)"'
 
    eval "$(rbenv init -)"
 
else
 
    user_echo "You have rbenv already installed. $(echo_pass)"
 
fi
 
 
 
hack_Timer 'rbenv checkpoint'
 
 
 
if ! brew list | grep -Fq gtk+; then
 
    user_echo "Installing gtk+ and dependencies"
 
    user_echo ""
 
    curl -OL https://github.com/OSXLich-Doug/OSXLich-Install/raw/master/cairo.rb
 
curl -OL https://github.com/OSXLich-Doug/OSXLich-Install/raw/master/gtk+.rb
 
mv "$(brew --repo homebrew/core)"/Formula/cairo.rb "$(brew --repo homebrew/core)"/Formula/cairo-save.rb
 
mv "$(brew --repo homebrew/core)"/Formula/gtk+.rb "$(brew --repo homebrew/core)"/Formula/gtk+-save.rb
 
mv ./cairo.rb "$(brew --repo homebrew/core)"/Formula
 
mv ./gtk+.rb "$(brew --repo homebrew/core)"/Formula
 
HOMEBREW_NO_AUTO_UPDATE=1 brew install --build-from-source gtk+
 
    brew pin gtk+
 
    brew pin cairo
 
else
 
    user_echo "You have gkt+ libraries already installed. $(echo_pass)"
 
fi
 
 
 
hack_Timer 'gtk+ checkpoint'
 
 
 
# Time to go after Ruby updates
 
 
 
if $RUBYREQ; then
 
    user_echo "Changing system Ruby to Ruby version 2.2.5."
 
    user_echo ""
 
    rbenv install 2.2.5
 
    user_echo "Setting Ruby version 2.2.5 as the global Ruby."
 
    user_echo ""
 
    append_to_bash 'eval "$(rbenv init - --no-rehash)"'
 
    source $HOME/.bash_profile
 
    sleep 5s
 
    rbenv global 2.2.5
 
    ruby -v
 
    rbenv rehash
 
    gem update --system
 
fi
 
 
 
if ! $RUBYREQ; then
 
    user_echo "Ensuring current system Ruby is valid."
 
    user_echo ""
 
    source $HOME/.bash_profile
 
    installed_ver="$(ruby_ver)"
 
    if [[ "$installed_ver" =~ "2.1" ]] || [[ "$installed_ver" =~ "2.2" ]] ; then
 
        user_echo "Ruby version seems good."
 
        ruby -v
 
    fi
 
fi
 
hack_Timer 'Ruby 2.2.5 checkpoint'
 
 
 
# Check to see if a gem is installed
 
 
 
if ! gem spec sqlite3 > /dev/null 2>&1; then
 
    user_echo "Gem sqlite3 is not installed.  $(echo_fail)"
 
    user_echo "Installing sqlite3 and related dependencies."
 
    user_echo ""
 
    gem install sqlite3 --no-ri --no-rdoc
 
    rbenv rehash
 
else
 
    user_echo "Gem sqlite3 already installed. $(echo_pass)"
 
fi
 
 
 
hack_Timer 'sqlite3 checkpoint'
 
 
 
if ! gem spec gtk2 > /dev/null 2>&1; then
 
    user_echo "Gem gtk2 is not installed.  $(echo_fail)"
 
    user_echo "Installing gtk2 and related dependencies."
 
    user_echo ""
 
    gem install gtk2 --no-ri --no-rdoc
 
    rbenv rehash
 
else
 
    user_echo "Gem gtk2 already installed.  $(echo_pass)"
 
fi
 
 
 
hack_Timer 'gtk2 checkpoint'
 
 
 
# Nearly done.  Check to see if this script's default locations
 
# for these files shows the files to exist.  If not, then
 
# grab Avalon and Lich and put them in their locations
 
 
 
if [ -d ~/lich ]; then
 
    user_echo "Lich is installed in the best location. $(echo_pass)"
 
else
 
    cd
 
    curl -OL http://lichproject.org/download/lich-4.6.33.zip
 
    unzip lich-4.6.33.zip
 
    rm lich-4.6.33.zip
 
fi
 
 
 
if [ -d ~/Desktop/Avalon4.3.3.app ]; then
 
    user_echo "Avalon is installed on the Desktop.  $(echo_pass)"
 
else
 
    cd
 
    curl -OL http://www.play.net/software/Avalon4.3.3.zip
 
    open -a "Archive Utility" Avalon4.3.3.zip && sleep 5s
 
    mv Avalon4.3.3.app ~/Desktop/
 
    rm Avalon4.3.3.zip
 
fi
 
 
 
user_echo "Process complete."
 
user_echo ""
 
 
 
# Print the time elapsed
 
 
 
end_Timer
 
 
 
user_echo ""
 
user_echo ""
 
end_Msg
 
user_echo""
 
user_echo""
 
 
 
exit
 
</pre>
 
 
 
 
 
==Older news ==
 
 
 
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.
 
 
 
==Update 8/7/2016==
 
 
 
Getting ahead of the curve:  Downloaded Sierra public beta (10.12) and installed to VM. Challenges:
 
 
 
- creating ISO image requires two additional directories be copied over, BaseSystem.chunklist and BaseSystem.dmg (thanks, Apple-ama!)
 
 
 
- current osxlich install script using homebrew grabs CLT version 7.3x, all subsequent builds fail (thanks again, Apple-ama!)
 
 
 
- need to use Applestore to update to beta CLT 8.x for builds to succeed
 
 
 
- after CLT 8 install - builds proceeding normally (perhaps, only got through rbenv)
 
 
 
Adds / changes to scripts
 
 
 
- need to add 10.12 to scripts for OS detect
 
 
 
- need to fix install script to get correct CLT (probably self correcting upon release, but let's check, shall we?)
 
 
 
Of interesting note - Sierra comes with ruby 2.0.0 (still!).  Need to check in final release to ensure that remains the same.  Note in to Tillmen concerning allowing $SAFE deprecation so we can use 2.3x ruby builds
 
 
 
==Update 8/2/2016==
 
 
 
Ok, I'm satisfied with the bash scripts.  I'll be releasing them through the wiki on the Mac Install page.
 
 
 
Next steps:
 
 
 
Create brew point
 
 
 
Create brew formula
 
 
 
distribute through brew
 
 
 
And later:
 
 
 
create install_wine shell script for SFE / Wizard
 
 
 
create applescript applet (or bash script that calls osascript) to automate the login sequence
 
 
 
==Results from lichdiag.sh==
 
 
 
Ok, this one's ready for prime time, I think.
 
 
 
===Results from 10.9.5 system actively used===
 
 
 
<pre{{log2}}>
 
 
 
    Welcome to Mac OS X and Lich Diagnostics
 
      Run on Sun Jul 31 22:11:29 PDT 2016
 
 
 
 
 
#############################################################
 
##  Item                          ##  Version    ## Status ##
 
#############################################################
 
## Your OS is supported          ## 10.9.5      ##  ✔  ##
 
## You have xQuartz installed    ## 2.7.94      ##  ✔  ##
 
## You have Command Line Tools    ## 6.2.0.0.1    ##  ✔  ##
 
## Your Ruby may not work        ## 2.3.1        ##  ✘  ##
 
## Homebrew is installed          ## 0.9.9        ##  ✔  ##
 
## Ruby mgr rbenv is installed    ## 1.0.0        ##  ✔  ##
 
## Cairo installed                ## 1.12.16_1    ##  ✔  ##
 
## gtk+ tools installed          ## 2.24.23      ##  ✔  ##
 
## sqlite3 gem installed          ## 1.3.11      ##  ✔  ##
 
## gtk2 gem installed            ## 3.0.8        ##  ✔  ##
 
## You have Lich                  ##              ##  ✔  ##
 
## You have Avalon                ##              ##  ✔  ##
 
##############################################################
 
 
 
 
 
If you are running this script because you're having a
 
problem with getting Lich (or a script, like narost) to
 
run, but you don't see anything in the diagnostics check
 
that can help, this script can save further diagnostic
 
information to the diagnostics text file on your desktop,
 
so you can forward it for analysis to someone you trust.
 
 
 
 
 
  Gather additonal diagnostics? (y/n) y
 
 
 
 
 
 
 
Script finished in 13 sec from script start
 
 
 
Script finished: Sun Jul 31 22:11:42 PDT 2016
 
</pre>
 
 
 
===Results from 10.11 bare bones reference system===
 
 
 
<pre{{log2}}>
 
 
 
Welcome to Mac OS X and Lich Diagnostics
 
  Run on Sun Jul 31 22:00:51 PDT 2016
 
 
 
 
 
##############################################################
 
##  Item                          ##  Version    ## Status ##
 
##############################################################
 
## Your OS is supported          ## 10.11.6      ##  ✔  ##
 
## You do not have xQuartz        ##  -----      ##  ✘  ##
 
## You do not have CL Tools      ##  -----      ##  ✘  ##
 
## Your Ruby needs updating      ## 2.0.0        ##  ✘  ##
 
## Homebrew is not installed      ##  -----      ##  ✘  ##
 
## Ruby mgr rbenv not installed  ##  -----      ##  ✘  ##
 
## Without Homebrew, no Cairo    ##  -----      ##  ✘  ##
 
## Without Homebrew, no gtk+      ##  -----      ##  ✘  ##
 
## sqlite3 gem installed          ## 1.3.7        ##  ✔  ##
 
## gtk2 gem not found            ##  ---        ##  ✘  ##
 
## You should download lich      ##              ##  ✘  ##
 
## You should download Avalon    ##              ##  ✘  ##
 
##############################################################
 
 
 
 
 
If you are running this script because you're having a
 
problem with getting Lich (or a script, like narost) to
 
run, but you don't see anything in the diagnostics check
 
that can help, this script can save further diagnostic
 
information to the diagnostics text file on your desktop,
 
so you can forward it for analysis to someone you trust.
 
 
 
 
 
  Gather additonal diagnostics? (y/n) n
 
Quitting...
 
 
 
 
 
 
 
Script finished in 14 sec from script start
 
 
 
Script finished: Sun Jul 31 22:01:05 PDT 2016
 
</pre>
 
 
 
Additional diags presently is brew --config and gem env outputs.
 
 
 
As time goes on, I'll build in a library of recommendations for the user to consider live.
 
 
 
The installer script is also ready for beta release.  It isn't nearly as nicely formatted, but it installs to the 10.11 bare reference system. 
 
 
 
Will be testing on 10.9 and 10.10 (mebbe?) throughout the week.
 
 
 
==Current Issues==
 
 
 
Formatting on install script - and sudo is going to be required for xQuartz and Homebrew - so dreams of unattended install vanish in the night like a fresh breeze of jasmine.
 
 
 
==7/30 Testing status:  V 1.0==
 
 
 
Testing against 10.11.6 bare system.
 
 
 
Constraints - Network bandwidth and virtual instance slows test cycles.  Time to upgrade!
 
 
 
Time to clone reference system - 4 minutes (Virtualbox for the win)
 
 
 
Time to execute script - estimated to be 1.5 hours (all up, on a virtual instance and middling network)
 
 
 
Anticipated time to execute script on MacBookPro - estimated 45 minutes with good network
 
 
 
Anticipated time to execute script on MacPro - estimated 35 minutes with good network
 
 
 
First pass - minor logical errors (8)
 
 
 
Second pass - correcting log out signal at xQuartz install complete
 
 
 
Third pass - Add time hack to xQuartz install and rerun clean; nearly flawless.  Two points - CLT tools license acceptance which (may?) lead to sudo being necessary to complete brew install.  Unanticipated, but doesn't seem to hurt.
 
 
 
Fourth pass - Modify CLT to do participative install; test to see if that helps the brew situation
 
 
 
Next steps:
 
 
 
Create 10.9 and 10.10 reference systems
 
 
 
Run script with various elements of configuration missing (no Ruby 2.2.5, no gtk2, perhaps with Ruby 2.1.x)
 
 
 
Continue diag script development while staring at little spinning balls and wishing for more / better / faster
 
 
 
Consider better organization in script - functional, but might be easier to maintain if.
 
 
 
 
 
==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)
 
<pre{{log2}}>
 
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.
 
</pre>
 
 
 
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.
 
 
 
 
 
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.'''
 
 
 
==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
 

Latest revision as of 14:09, 9 September 2020


GTK3 Beta Test

Welcome to the GTK3 Ruby Lich Public Beta!

Before we begin, there are a couple of things you should know about participating in this beta program:

1) It IS a beta program. If something can go wrong, it just might, here. So follow these instructions carefully to have the BEST shot at recovering your Lich installation and continuing to enjoy Gemstone.

  • It is vitally important that you NOT participate in the GTK3 beta if you are not already a Lich user. If you are new to Gemstone and Lich, do not use this Public Beta. Instead, use the stable installer build at https://bit.ly/WinLich .
  • If you are already a Lich user, and you are comfortable participating in the Public Beta, then you should at an absolute minimum, back up your existing Lich folder. The beta installer does not touch the existing lich folder, but if something can go wrong, you should have a copy saved somewhere.
  • If you are already a Lich user, and you are comfortable participating in the Public Beta, then you should rename your existing Ruby installation. If you accepted the default installation from the stable installer build, your Ruby installation is at C:\Ruby4Lich . You can simply rename that folder C:\save-Ruby4Lich , and you will be able to easily revert back from the beta to your current Ruby4Lich installation.
  • Remember that the GTK3 beta is intended to retire GTK2, given its age and lack of updates. What this means to you is that any Lich program that uses a graphical user interface (GUI) will behave differently. The team has updated the LICH.RBW file and the core scripts distributed by Tillmen to work with GTK3. The team has also updated some of the more popular scripts and included them in a subdirectory for you to use, if you wish.

2) If you are happy with what you have read so far, and are eager to get started, exit all characters from the game.

3) Back up your lich directory and rename your existing Ruby4Lich (or other Ruby) installation.

4) Download the BetaGTK3-Ruby4Lich installer here: https://www.dropbox.com/s/upkg2qy1vmip31z/BetaGTK3-Ruby4Lich.exe?dl=1

5) Run the installer. Be patient, it may take some time especially on non-SSD harddrives - it is installing 70K plus files.

6) When done, click FINISH on the installer, and you will see the GTK3Lich folder on your desktop. Run the LICH.RBW file from that folder and confirm you can log in with Lich active.

At this point, you can make plans to copy the GTK3Lich files into your existing Lich directory so you don't have to redo everything. You did remember to back up your existing Lich directory, right? If not, do it now before you start moving scripts around.

Any and all errors please share in the #scripting channel on Discord. Please ensure you provide a current run of ;version with your report

Enjoy!


GTK3 Public Beta FAQ

Q: Why am I renaming my Ruby4Lich directory instead of just deleting it?

A: During the beta test you may find a critical script that you cannot live without that simply does not work right. If you delete your existing Ruby4Lich installation, and later decide to exit the beta test, you'll have to reinstall Ruby4Lich to continue enjoying Lich and Gemstone. Renaming will save you time, if you decide the beta program is not for you.

Q: What should I do when I see a bunch of information about a script that I'm running needing to be fixed?

A: Come to Discord#scripting and put the script name up with a reference to GTK3. The team will look at it, and convert it or notify the script author to do the update.

Q: I just copied the new GTK3Lich scripts into my standard Lich folder, and now nothing works right. What do I do?

A: Check to be sure you also copied the Lich.rbw file over - without that, your install will not work properly.

Q: Why are we doing this when the existing installer works?

A: Three reasons - the most important being that we want to update to a faster and more stable Ruby. Second, we want to get onto the more current graphics display framework (GTK3), since the older existing graphics display framework (GTK2) is not updated and has some defects in it. Third, some exciting new scripts are being developed that will only work with the more current graphics display framework.

Q: What's my emergency recovery procedure if I just want to go back to what I know?

A: Tricky question! That will depend on what you did or chose not to do from the recommendations. The short list based on the recommendations is to restore your original LICH folder from the copy you made at the very beginning, then uninstall the GTK3Beta-Ruby4Lich application and delete the folder, then rename your saved Ruby4Lich folder back to just Ruby4Lich. You are now ready to try starting up your restored LICH installation. If it asks you how to deal with lich.rbw, just associate the file with the Ruby4Lich\bin\rubyw.exe application. That should restore your functionality. If it doesn't, swing by Discord#scripting and let us know.