From acbebddd1f7a6e7db42eca00093628d5e556d916 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 6 Feb 2017 10:26:53 +0000 Subject: [PATCH] glulxe: import from homebrew/games. --- Formula/glulxe.rb | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Formula/glulxe.rb diff --git a/Formula/glulxe.rb b/Formula/glulxe.rb new file mode 100644 index 0000000000000..d1b815641b3cc --- /dev/null +++ b/Formula/glulxe.rb @@ -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