Instantly share code, notes, and snippets.

What would you like to do?
require 'formula'
class BsdgamesOsx < Formula
homepage ''
url ''
sha1 '31013cbc8fbad71f1e3e0b9b85fd7c943219a99b'
head ''
version '2.19.3'
depends_on :bsdmake => :build
def install
# This replicates the behavior of wargames calling games from /usr/games
inreplace 'wargames/' do |s|
s.gsub! /\/usr\/games/, "#{prefix}/bin"
system "CFLAGS=\"-std=c11\" bsdmake PREFIX=#{prefix} VARDIR=#{HOMEBREW_PREFIX}/var/games"
user = ENV['USER']
system "BINOWN=#{user} LIBOWN=#{user} MANOWN=#{user} SHAREOWN=#{user} bsdmake install PREFIX=#{prefix} VARDIR=#{HOMEBREW_PREFIX}/var/games"
def test
%w[ pom ].each do |game|
system game

This comment has been minimized.

sincarne commented Apr 10, 2015

Thank you! A note: if you have the fish shell installed, you'll be unable to link bsdgames. Run brew unlink fish, then brew link bsdgames-osx to link the games. brew link --overwrite fish will get you the shell back, then you can go ahead and link /usr/local/Cellar/bsdgames-osx/2.19.3/bin/fish to somewhere under your path, calling it something that won't conflict.


This comment has been minimized.

ctdk commented May 10, 2015

Thanks for updating this formula.


This comment has been minimized.

sukima commented May 13, 2015

Any chance we could add this to ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment