aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mksh.rb
blob: d1ed04fa247700b4a4487b90dfce26280588f1a0 (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
require 'formula'

class CpioDownloadStrategy < CurlDownloadStrategy
  def stage
    system "gzcat #{@tarball_path} | cpio -id"
    chdir
  end
end

class Mksh < Formula
  homepage 'https://mirbsd.org/mksh.htm'
  url 'https://mirbsd.org/MirOS/dist/mir/mksh/mksh-R43.tgz'
  version '0.43'
  sha256 '65e54a0cd4189b80cf24fdf1b1b959a707522451025cc22f7d3ba451566ffc81'

  def install
    system "sh", "./Build.sh", "-c", (ENV.compiler == :clang ? "lto" : "combine")
    bin.install 'mksh'
    man1.install 'mksh.1'
  end

  def caveats; <<-EOS.undent
    To allow using mksh as a login shell, run this as root:
        echo #{HOMEBREW_PREFIX}/bin/mksh >> /etc/shells
    Then, any user may run `chsh` to change their shell.
    EOS
  end
end