Skip to content

Instantly share code, notes, and snippets.

@GOFAI
Created December 4, 2015 09:07
Show Gist options
  • Save GOFAI/4d31cd4d13b8ad2be4a0 to your computer and use it in GitHub Desktop.
Save GOFAI/4d31cd4d13b8ad2be4a0 to your computer and use it in GitHub Desktop.
Homebrew formula to install DUNGEON 4.0
class Dungeon < Formula
desc "the classic text adventure"
homepage "https://github.com/GOFAI/dungeon"
url "https://github.com/GOFAI/dungeon/archive/4.0.tar.gz"
sha256 "be2217be9e23861f22c14c4395da272fca5fb08a1741f52fd393792908279bea"
depends_on :fortran
def install
chdir "src" do
# look for game files where homebrew installed them, not pwd
inreplace "game.f" do |s|
s.gsub! "FILE='dindx',STATUS='OLD',", "FILE='/usr/local/opt/dungeon/share/dindx',"
s.gsub! "1 FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)", "1 STATUS='OLD',FORM='FORMATTED',
2 ACCESS='SEQUENTIAL',ERR=1900)"
s.gsub! "FILE='dtext',STATUS='OLD',", "FILE='/usr/local/opt/dungeon/share/dtext',"
s.gsub! "1 FORM='UNFORMATTED',ACCESS='DIRECT',", "1 STATUS='OLD',FORM='UNFORMATTED',ACCESS='DIRECT',"
end
system "make"
bin.install "dungeon"
end
share.install "dindx"
share.install "dtext"
man.install "dungeon.txt"
man.install "hints.txt"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment