class GnuTypist < Formula desc "GNU typing tutor" homepage "https://www.gnu.org/software/gtypist/" url "https://ftp.gnu.org/gnu/gtypist/gtypist-2.9.5.tar.xz" mirror "https://ftpmirror.gnu.org/gtypist/gtypist-2.9.5.tar.xz" sha256 "c13af40b12479f8219ffa6c66020618c0ce305ad305590fde02d2c20eb9cf977" revision 1 bottle do sha256 "79367e864781c4a9fe5b25e737e99bdcae8c7b11a2198459d72775120495c2c3" => :high_sierra sha256 "014e293ce1ed514fe95e6fce4cbedefdc876a51b6d38a740183b8ce959899e5a" => :sierra sha256 "75fcb398d3997d6d9357bb6cf5638d2e10e469ce114b344865d37112754cc7af" => :el_capitan sha256 "285c918d6b2240e294e6b192aff25de0f0383f9ac645d8883e04e3443e52b674" => :yosemite end depends_on "gettext" # Use Apple's ncurses instead of ncursesw. # TODO: use an IFDEF for apple and submit upstream patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/42c4b96/gnu-typist/2.9.5.patch" sha256 "a408ecb8be3ffdc184fe1fa94c8c2a452f72b181ce9be4f72557c992508474db" end def install # libiconv is not linked properly without this ENV.append "LDFLAGS", "-liconv" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-lispdir=#{elisp}" system "make" system "make", "install" end test do session = fork do exec bin/"gtypist", "-t", "-q", "-l", "DEMO_0", share/"gtypist/demo.typ" end sleep 2 Process.kill("TERM", session) end end