homebrew-core/Formula/parallel.rb

55 lines
1.6 KiB
Ruby

class Parallel < Formula
desc "Shell command parallelization utility"
homepage "https://savannah.gnu.org/projects/parallel/"
url "https://ftp.gnu.org/gnu/parallel/parallel-20221222.tar.bz2"
mirror "https://ftpmirror.gnu.org/parallel/parallel-20221222.tar.bz2"
sha256 "4da90c7bec18a94431b4e3db49dd563f65cf20ceafd245f7cc7b42ef8bf8597f"
license "GPL-3.0-or-later"
version_scheme 1
head "https://git.savannah.gnu.org/git/parallel.git", branch: "master"
livecheck do
url :homepage
regex(/GNU Parallel v?(\d{6,8}).*? released/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "d7f4ee77dda10a2ee939746c3863916b3ceee20d0c3de1ba109db39a277bf540"
end
conflicts_with "moreutils", because: "both install a `parallel` executable"
def install
ENV.append_path "PATH", bin
system "./configure", "--prefix=#{prefix}"
system "make", "install"
inreplace_files = [
bin/"parallel",
doc/"parallel.texi",
doc/"parallel_design.texi",
doc/"parallel_examples.texi",
man1/"parallel.1",
man7/"parallel_design.7",
man7/"parallel_examples.7",
]
# Ignore `inreplace` failures when building from HEAD or not building a bottle.
inreplace inreplace_files, "/usr/local", HOMEBREW_PREFIX, build.stable? && build.bottle?
end
def caveats
<<~EOS
To use the --csv option, the Perl Text::CSV module has to be installed.
You can install it via:
perl -MCPAN -e'install Text::CSV'
EOS
end
test do
assert_equal "test\ntest\n",
shell_output("#{bin}/parallel --will-cite echo ::: test test")
end
end