Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (66 sloc) 2.24 KB
class MinimalRacket < Formula
desc "Modern programming language in the Lisp/Scheme family"
homepage "https://racket-lang.org/"
url "https://mirror.racket-lang.org/installers/7.3/racket-minimal-7.3-src-builtpkgs.tgz"
sha256 "40286b2de8aaeed70d2dbebcbbb89f1be55be00fd55f4522635b7a51a58d6dc2"
bottle do
cellar :any
sha256 "54682774edc9d7818bb3f13b24b782c351876c2f44573a1d5c0b042d1b17c5c9" => :mojave
sha256 "b88127d2552cf2d11ade45f6e7deffd871cd27c1bf5937dae571dc8ba931c98b" => :high_sierra
sha256 "e76979bfea6f2c0549e4393af622a6d73b174b6323320d253873022643bab4c2" => :sierra
end
# these two files are amended when (un)installing packages
skip_clean "lib/racket/launchers.rktd", "lib/racket/mans.rktd"
def install
cd "src" do
args = %W[
--disable-debug
--disable-dependency-tracking
--enable-macprefix
--prefix=#{prefix}
--man=#{man}
--sysconfdir=#{etc}
]
system "./configure", *args
system "make"
system "make", "install"
end
# configure racket's package tool (raco) to do the Right Thing
# see: https://docs.racket-lang.org/raco/config-file.html
inreplace etc/"racket/config.rktd" do |s|
s.gsub!(
/\(bin-dir\s+\.\s+"#{Regexp.quote(bin)}"\)/,
"(bin-dir . \"#{HOMEBREW_PREFIX}/bin\")",
)
s.gsub!(
/\n\)$/,
"\n (default-scope . \"installation\")\n)",
)
end
end
def caveats; <<~EOS
This is a minimal Racket distribution.
If you want to build the DrRacket IDE, you may run
raco pkg install --auto drracket
The full Racket distribution is available as a cask:
brew cask install racket
EOS
end
test do
output = shell_output("#{bin}/racket -e '(displayln \"Hello Homebrew\")'")
assert_match /Hello Homebrew/, output
# show that the config file isn't malformed
output = shell_output("'#{bin}/raco' pkg config")
assert $CHILD_STATUS.success?
assert_match Regexp.new(<<~EOS), output
^name:
#{version}
catalogs:
https://download.racket-lang.org/releases/#{version}/catalog/
https://pkgs.racket-lang.org
https://planet-compats.racket-lang.org
default-scope:
installation
EOS
end
end
You can’t perform that action at this time.