homebrew-core/Formula/glulxe.rb
2017-02-08 10:08:51 +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 "9b79beec27e0f114814a8b7a89a08b420bfc1d73c52047188429d2b592b47fe1" => :sierra
sha256 "d1eaa6d3fc7b190f9501c30805f7325b607f26f218c4f483a67d4f630862892b" => :el_capitan
sha256 "61d29891d33f47a18e18b1b1cef775a815d77b18201220b4ec86b0ff902d405d" => :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