homebrew-core/Formula/glulxe.rb
2017-02-08 10:12:18 +00:00

50 lines
1.7 KiB
Ruby

class Glulxe < Formula
desc "Portable VM like the Z-machine"
homepage "http://www.eblong.com/zarf/glulx/"
url "http://eblong.com/zarf/glulx/glulxe-054.tar.gz"
version "0.5.4"
sha256 "1fc26f8aa31c880dbc7c396ede196c5d2cdff9bdefc6b192f320a96c5ef3376e"
head "https://github.com/erkyrath/glulxe.git"
bottle do
cellar :any_skip_relocation
sha256 "3a36753838342aef55319fdf1aab32666caffcb714fefd328a93521ed33d6adf" => :sierra
sha256 "b5bc0c06241f2c7de3da21b27f2126903550fe959378992fe5260eeedb0f612f" => :el_capitan
sha256 "b50be16e36671d7818d123403937496f258882c98bbc6f4d8242c2e6eb97b310" => :yosemite
end
option "with-glkterm", "Build with glkterm (without wide character support)"
depends_on "cheapglk" => [:build, :optional]
depends_on "glkterm" => [:build, :optional]
depends_on "glktermw" => :build if build.without?("cheapglk") && build.without?("glkterm")
def install
if build.with?("cheapglk") && build.with?("glkterm")
odie "Options --with-cheapglk and --with-glkterm are mutually exclusive."
end
if build.with? "cheapglk"
glk = Formula["cheapglk"]
elsif build.with? "glkterm"
glk = Formula["glkterm"]
else
glk = Formula["glktermw"]
end
inreplace "Makefile", "GLKINCLUDEDIR = ../cheapglk", "GLKINCLUDEDIR = #{glk.include}"
inreplace "Makefile", "GLKLIBDIR = ../cheapglk", "GLKLIBDIR = #{glk.lib}"
inreplace "Makefile", "Make.cheapglk", "Make.#{glk.name}"
system "make"
bin.install "glulxe"
end
test do
if build.with? "cheapglk"
assert shell_output("#{bin}/glulxe").start_with? "Welcome to the Cheap Glk Implementation"
else
assert pipe_output("#{bin}/glulxe -v").start_with? "GlkTerm, library version"
end
end
end