2017-02-06 10:26:56 +00:00
|
|
|
# Nethack the way God intended it to be played: from a terminal.
|
|
|
|
|
|
|
|
class Nethack < Formula
|
|
|
|
desc "Single-player roguelike video game"
|
2017-03-09 18:40:17 +00:00
|
|
|
homepage "http://www.nethack.org/"
|
2017-02-06 10:26:56 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/nethack/nethack/3.6.0/nethack-360-src.tgz"
|
|
|
|
version "3.6.0"
|
|
|
|
sha256 "1ade698d8458b8d87a4721444cb73f178c74ed1b6fde537c12000f8edf2cb18a"
|
2017-03-09 18:40:17 +00:00
|
|
|
head "https://git.code.sf.net/p/nethack/NetHack.git", :branch => "NetHack-3.6.0"
|
2017-02-06 10:26:56 +00:00
|
|
|
|
|
|
|
bottle do
|
2017-02-08 08:28:14 +00:00
|
|
|
sha256 "31ba131716f9e1deb6d4facca23855823ea916dc8d0edc6c4a50bcc744684936" => :sierra
|
|
|
|
sha256 "1fc48d05f9ca71d73292c03b8860a22ca6c8a35f09b92f700918ae4290a73ecf" => :el_capitan
|
|
|
|
sha256 "c15f61fb6867b3a68dbb4f68d09e787afda6e6f2498123bb9972547803a0a19e" => :yosemite
|
2017-02-06 10:26:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Don't remove save folder
|
|
|
|
skip_clean "libexec/save"
|
|
|
|
|
|
|
|
def install
|
2017-05-06 08:27:41 +00:00
|
|
|
# Build everything in-order
|
2017-02-06 10:26:56 +00:00
|
|
|
ENV.deparallelize
|
|
|
|
|
|
|
|
# Generate makefiles for OS X
|
|
|
|
cd "sys/unix" do
|
|
|
|
if MacOS.version >= :yosemite
|
|
|
|
hintfile = "macosx10.10"
|
|
|
|
elsif MacOS.version >= :lion
|
|
|
|
hintfile = "macosx10.7"
|
|
|
|
else
|
2017-05-06 08:27:41 +00:00
|
|
|
hintfile = "macosx10.5"
|
2017-02-06 10:26:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
inreplace "hints/#{hintfile}",
|
|
|
|
/^HACKDIR=.*/,
|
|
|
|
"HACKDIR=#{libexec}"
|
|
|
|
|
|
|
|
system "sh", "setup.sh", "hints/#{hintfile}"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Enable wizard mode for all users
|
|
|
|
inreplace "sys/unix/sysconf",
|
|
|
|
/^WIZARDS=.*/,
|
|
|
|
"WIZARDS=*"
|
|
|
|
|
|
|
|
# Make the game
|
|
|
|
system "make", "install"
|
|
|
|
bin.install "src/nethack"
|
|
|
|
(libexec+"save").mkpath
|
|
|
|
|
|
|
|
# Enable `man nethack`
|
|
|
|
man6.install "doc/nethack.6"
|
|
|
|
|
|
|
|
# These need to be group-writable in multi-user situations
|
|
|
|
chmod "g+w", libexec
|
|
|
|
chmod "g+w", libexec+"save"
|
|
|
|
end
|
|
|
|
end
|