204 lines
7.2 KiB
Ruby
204 lines
7.2 KiB
Ruby
class Cpm < Formula
|
|
desc "Fast CPAN module installer"
|
|
homepage "https://metacpan.org/pod/cpm"
|
|
url "https://cpan.metacpan.org/authors/id/S/SK/SKAJI/App-cpm-0.993.tar.gz"
|
|
sha256 "07f66930cd173b314cc745706dc75d5cd873c498aebc65d9cecbd353cd5f9aee"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "81c6cf61b1821d3d7de20bfff1c3ee6dff207399ad3b4b18d0aefa74c13b4c00" => :catalina
|
|
sha256 "f32eed6d025314d54c034b301e5c711dff0e0413d636eefd3886c65f690c2f71" => :mojave
|
|
sha256 "1207e5b101a9e9e48832c73a60dd0b58593634e83becef774d0eef3236dd21b0" => :high_sierra
|
|
end
|
|
|
|
depends_on "perl"
|
|
|
|
resource "Module::Build::Tiny" do
|
|
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz"
|
|
sha256 "7d580ff6ace0cbe555bf36b86dc8ea232581530cbeaaea09bccb57b55797f11c"
|
|
end
|
|
|
|
resource "CPAN::Common::Index" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/CPAN-Common-Index-0.010.tar.gz"
|
|
sha256 "c43ddbb22fd42b06118fe6357f53700fbd77f531ba3c427faafbf303cbf4eaf0"
|
|
end
|
|
|
|
resource "CPAN::DistnameInfo" do
|
|
url "https://cpan.metacpan.org/authors/id/G/GB/GBARR/CPAN-DistnameInfo-0.12.tar.gz"
|
|
sha256 "2f24fbe9f7eeacbc269d35fc61618322fc17be499ee0cd9018f370934a9f2435"
|
|
end
|
|
|
|
resource "CPAN::Meta::Check" do
|
|
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/CPAN-Meta-Check-0.014.tar.gz"
|
|
sha256 "28a0572bfc1c0678d9ce7da48cf521097ada230f96eb3d063fcbae1cfe6a351f"
|
|
end
|
|
|
|
resource "Capture::Tiny" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/Capture-Tiny-0.48.tar.gz"
|
|
sha256 "6c23113e87bad393308c90a207013e505f659274736638d8c79bac9c67cc3e19"
|
|
end
|
|
|
|
resource "Class::Tiny" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/Class-Tiny-1.006.tar.gz"
|
|
sha256 "2efcbd31528be51d3022c616768558b78c6172df5f03c5dc698939f65488cb4e"
|
|
end
|
|
|
|
resource "Command::Runner" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SK/SKAJI/Command-Runner-0.102.tar.gz"
|
|
sha256 "3177c395bac36e5c26bd27145b23b2c480bff1081b9d99d6aee2ce680fc7dd35"
|
|
end
|
|
|
|
resource "ExtUtils::Config" do
|
|
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.008.tar.gz"
|
|
sha256 "ae5104f634650dce8a79b7ed13fb59d67a39c213a6776cfdaa3ee749e62f1a8c"
|
|
end
|
|
|
|
resource "ExtUtils::Helpers" do
|
|
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-0.026.tar.gz"
|
|
sha256 "de901b6790a4557cf4ec908149e035783b125bf115eb9640feb1bc1c24c33416"
|
|
end
|
|
|
|
resource "ExtUtils::InstallPaths" do
|
|
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-0.012.tar.gz"
|
|
sha256 "84735e3037bab1fdffa3c2508567ad412a785c91599db3c12593a50a1dd434ed"
|
|
end
|
|
|
|
resource "ExtUtils::MakeMaker::CPANfile" do
|
|
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/ExtUtils-MakeMaker-CPANfile-0.09.tar.gz"
|
|
sha256 "2c077607d4b0a108569074dff76e8168659062ada3a6af78b30cca0d40f8e275"
|
|
end
|
|
|
|
resource "File::Copy::Recursive" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DM/DMUEY/File-Copy-Recursive-0.45.tar.gz"
|
|
sha256 "d3971cf78a8345e38042b208bb7b39cb695080386af629f4a04ffd6549df1157"
|
|
end
|
|
|
|
resource "File::Which" do
|
|
url "https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/File-Which-1.23.tar.gz"
|
|
sha256 "b79dc2244b2d97b6f27167fc3b7799ef61a179040f3abd76ce1e0a3b0bc4e078"
|
|
end
|
|
|
|
resource "File::pushd" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/File-pushd-1.016.tar.gz"
|
|
sha256 "d73a7f09442983b098260df3df7a832a5f660773a313ca273fa8b56665f97cdc"
|
|
end
|
|
|
|
resource "HTTP::Tinyish" do
|
|
url "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/HTTP-Tinyish-0.16.tar.gz"
|
|
sha256 "1a3318b89987c2aa5dd18990a109e8af63049f87e4e1a9357583beed1c3bfbda"
|
|
end
|
|
|
|
resource "IPC::Run3" do
|
|
url "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/IPC-Run3-0.048.tar.gz"
|
|
sha256 "3d81c3cc1b5cff69cca9361e2c6e38df0352251ae7b41e2ff3febc850e463565"
|
|
end
|
|
|
|
resource "Menlo" do
|
|
url "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/Menlo-1.9019.tar.gz"
|
|
sha256 "3b573f68e7b3a36a87c860be258599330fac248b518854dfb5657ac483dca565"
|
|
end
|
|
|
|
resource "Menlo::Legacy" do
|
|
url "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/Menlo-Legacy-1.9022.tar.gz"
|
|
sha256 "a6acac3fee318a804b439de54acbc7c27f0b44cfdad8551bbc9cd45986abc201"
|
|
end
|
|
|
|
resource "Module::CPANfile" do
|
|
url "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/Module-CPANfile-1.1004.tar.gz"
|
|
sha256 "88efbe2e9a642dceaa186430fedfcf999aaf0e06f6cced28a714b8e56b514921"
|
|
end
|
|
|
|
resource "Parallel::Pipes" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SK/SKAJI/Parallel-Pipes-0.005.tar.gz"
|
|
sha256 "44bd9e2be33d7b314f81c9b886a95d53514689090635f9fad53181f2d3051fd5"
|
|
end
|
|
|
|
resource "Parse::PMFile" do
|
|
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/Parse-PMFile-0.42.tar.gz"
|
|
sha256 "e7f6c70932b86eb4a2426569e33d2b651b52a24e5d0c0dcb3849d045b52c736c"
|
|
end
|
|
|
|
resource "String::ShellQuote" do
|
|
url "https://cpan.metacpan.org/authors/id/R/RO/ROSCH/String-ShellQuote-1.04.tar.gz"
|
|
sha256 "e606365038ce20d646d255c805effdd32f86475f18d43ca75455b00e4d86dd35"
|
|
end
|
|
|
|
resource "Tie::Handle::Offset" do
|
|
url "https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/Tie-Handle-Offset-0.004.tar.gz"
|
|
sha256 "ee9f39055dc695aa244a252f56ffd37f8be07209b337ad387824721206d2a89e"
|
|
end
|
|
|
|
resource "URI" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/URI-1.76.tar.gz"
|
|
sha256 "b2c98e1d50d6f572483ee538a6f4ccc8d9185f91f0073fd8af7390898254413e"
|
|
end
|
|
|
|
resource "Win32::ShellQuote" do
|
|
url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Win32-ShellQuote-0.003001.tar.gz"
|
|
sha256 "aa74b0e3dc2d41cd63f62f853e521ffd76b8d823479a2619e22edb4049b4c0dc"
|
|
end
|
|
|
|
resource "local::lib" do
|
|
url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz"
|
|
sha256 "2e9b917bd48a0615e42633b2a327494e04610d8f710765b9493d306cead98a05"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
|
|
build_pl = [
|
|
"Module::Build::Tiny",
|
|
"Command::Runner",
|
|
"Parallel::Pipes",
|
|
]
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
next if build_pl.include? r.name
|
|
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
build_pl.each do |name|
|
|
resource(name).stage do
|
|
system "perl", "Build.PL", "--install_base", libexec
|
|
system "./Build"
|
|
system "./Build", "install"
|
|
end
|
|
end
|
|
|
|
system "perl", "Build.PL", "--install_base", libexec
|
|
system "./Build"
|
|
system "./Build", "install"
|
|
|
|
(bin/"cpm").write_env_script("#{libexec}/bin/cpm", PERL5LIB: ENV["PERL5LIB"])
|
|
man1.install_symlink libexec/"man/man1/cpm.1"
|
|
man3.install_symlink Dir[libexec/"man/man3/App::cpm*"].reject { |f| File.empty?(f) }
|
|
end
|
|
|
|
test do
|
|
system bin/"cpm", "install", "Perl::Tutorial"
|
|
|
|
expected = <<~EOS
|
|
NAME
|
|
Perl::Tutorial::HelloWorld - Hello World for Perl
|
|
|
|
SYNOPSIS
|
|
#!/usr/bin/perl
|
|
#
|
|
# The traditional first program.
|
|
|
|
# Strict and warnings are recommended.
|
|
use strict;
|
|
use warnings;
|
|
|
|
# Print a message.
|
|
print "Hello, World!\\n";
|
|
EOS
|
|
assert_match expected,
|
|
shell_output("PERL5LIB=local/lib/perl5 perldoc Perl::Tutorial::HelloWorld")
|
|
end
|
|
end
|