commit cfcb4ac40981b4d9216db1fe9f8ae7d033167271 Author: John Zaitseff Date: Fri Nov 15 15:21:07 2019 +1100 Add a macOS Homebrew formula for Star Traders This formula has been submitted to the upstream Homebrew homebrew-core repository via https://github.com/Homebrew/homebrew-core/pull/46770 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0238b25 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +trader.rb ident diff --git a/trader.rb b/trader.rb new file mode 100644 index 0000000..6420ed8 --- /dev/null +++ b/trader.rb @@ -0,0 +1,29 @@ +class Trader < Formula + desc "Star Traders" + homepage "https://www.zap.org.au/projects/trader/" + url "https://ftp.zap.org.au/pub/trader/unix/trader-7.13.tar.xz" + sha256 "0d2b51134166b0f436dc6423e2ce378b1df929a9de141c002f3da86af18bb262" + + depends_on "pkg-config" => :build + depends_on "gettext" + depends_on "ncurses" # The system version does not work correctly + + def install + ENV.prepend_path "PKG_CONFIG_PATH", + Formula["ncurses"].opt_libexec/"lib/pkgconfig" + args = %W[ + --disable-dependency-tracking + --disable-silent-rules + --prefix=#{prefix} + --with-libintl-prefix=#{Formula["gettext"].opt_prefix} + ] + system "./configure", *args + system "make", "install" + end + + test do + # Star Traders is an interactive game, so the only option for testing + # is to run something like "trader --version" + system "#{bin}/trader", "--version" + end +end