Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d681b3f
commit acbebdd
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 |