homebrew-core/Formula/moreutils.rb

69 lines
2.5 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.65",
revision: "c3261f4190c3803177b6c50ec43fd302171dd48e"
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
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5de950b73636c311b8590778684dfe9dd40dd421297bbf39a43229a6f298971b"
sha256 cellar: :any_skip_relocation, big_sur: "6972c4d83580a59c2d3844b5aa55ea29e505c88d21827c9a8450991ca4cdb963"
sha256 cellar: :any_skip_relocation, catalina: "7439b8c6e8cddff150d2a86998cd3dd83d8bb309c22dfc18adf8352e7ebc72be"
sha256 cellar: :any_skip_relocation, mojave: "1b3e3ddacf2eb593aeeb1b5ecd7abe1fb54bbf84cc24651a6834dd18f5b19fd5"
end
depends_on "docbook-xsl" => :build
uses_from_macos "libxml2" => :build
uses_from_macos "libxslt" => :build
uses_from_macos "perl"
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