homebrew-core/Formula/moreutils.rb

67 lines
2.3 KiB
Ruby

class Moreutils < Formula
desc "Collection of tools that nobody wrote when UNIX was young"
homepage "https://joeyh.name/code/moreutils/"
url "https://git.joeyh.name/git/moreutils.git",
tag: "0.64",
revision: "859c6e47b53410dbdcdc714385516bcb81710075"
license all_of: [
"GPL-2.0-or-later",
{ any_of: ["GPL-2.0-only", "Artistic-2.0"] },
]
head "https://git.joeyh.name/git/moreutils.git"
bottle do
cellar :any_skip_relocation
sha256 "2acce86bfb602b3da4577cf429080a138b7a2e587e394b175889c4d190ef3bae" => :catalina
sha256 "e4d2496b670b5f4c8fcac0baaaa41afeced3b04ac962ce4963752cc233d68273" => :mojave
sha256 "80057e9363725a85da1200dfe87fe669a5dab3980375ad83330ce4b61cbac13c" => :high_sierra
end
depends_on "docbook-xsl" => :build
uses_from_macos "libxml2" => :build
uses_from_macos "libxslt" => :build
conflicts_with "parallel", because: "both install a `parallel` executable"
conflicts_with "pwntools", because: "both install an `errno` executable"
conflicts_with "sponge", because: "both install a `sponge` executable"
conflicts_with "task-spooler", because: "both install a `ts` executable"
resource "Time::Duration" do
url "https://cpan.metacpan.org/authors/id/N/NE/NEILB/Time-Duration-1.21.tar.gz"
sha256 "fe340eba8765f9263694674e5dff14833443e19865e5ff427bbd79b7b5f8a9b8"
end
resource "IPC::Run" do
url "https://cpan.metacpan.org/authors/id/T/TO/TODDR/IPC-Run-20200505.0.tar.gz"
sha256 "816ebf217fa0df99c583d73c0acc6ced78ac773787c664c75cbf140bb7e4c901"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
resource("Time::Duration").stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}", "--skipdeps"
system "make", "install"
end
resource("IPC::Run").stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make", "install"
end
inreplace "Makefile" do |s|
s.gsub! "/usr/share/xml/docbook/stylesheet/docbook-xsl",
"#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl"
end
system "make", "all"
system "make", "install", "PREFIX=#{prefix}"
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
end
test do
pipe_output("#{bin}/isutf8", "hello", 0)
pipe_output("#{bin}/isutf8", "\xca\xc0\xbd\xe7", 1)
end
end