blob: 474a1bf2da078b2c648d61fcdff67eab18026985 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 | require "formula"
class Modules < Formula
  homepage "http://modules.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/modules/Modules/modules-3.2.10/modules-3.2.10.tar.bz2"
  sha1 "beb67a228ad890206ac776981269a7287cfb7596"
  depends_on :x11 => :optional
  def install
    # -DUSE_INTERP_ERRORLINE fixes
    # error: no member named 'errorLine' in 'struct Tcl_Interp'
    args = %W[
      --disable-debug
      --disable-dependency-tracking
      --disable-silent-rules
      --prefix=#{prefix}
      --datarootdir=#{share}
      --disable-versioning
      CPPFLAGS=-DUSE_INTERP_ERRORLINE]
    args << "--without-x" if build.without? "x11"
    system "./configure", *args
    system "make", "install"
  end
  def caveats; <<-EOS.undent
    To activate modules, add the following at the end of your .zshrc:
      source #{opt_prefix}/Modules/init/zsh
    You will also need to reload your .zshrc:
      source ~/.zshrc
    EOS
  end
  test do
    system *%W[#{prefix}/Modules/bin/modulecmd --version]
    system "zsh", "-c", "source #{prefix}/Modules/init/zsh; module"
  end
end
 |