Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl-build: avoid env script for plenv- scripts #204683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions Formula/p/perl-build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"

# Ensure we don't install the pre-packed script
(buildpath/"perl-build").unlink
# Remove this apparently dead symlink.
(buildpath/"bin/perl-build").unlink
rm(["perl-build", "bin/perl-build"])

build_pl = ["Module::Build::Tiny", "CPAN::Perl::Releases::MetaCPAN"]
resources.each do |r|
Expand All @@ -118,22 +116,19 @@ def install
end
end

ENV.prepend_path "PATH", libexec/"bin"
system "perl", "Build.PL", "--install_base", libexec
system "perl", "Build.PL", "--install_base", libexec, "--install_path", "bindoc=#{man1}"
# Replace the dead symlink we removed earlier.
(buildpath/"bin").install_symlink buildpath/"script/perl-build"
system "./Build"
system "./Build", "install"

%w[perl-build plenv-install plenv-uninstall].each do |cmd|
(bin/cmd).write_env_script(libexec/"bin/#{cmd}", PERL5LIB: ENV["PERL5LIB"])
end
bin.install libexec/"bin/plenv-install", libexec/"bin/plenv-uninstall"
(bin/"perl-build").write_env_script(libexec/"bin/perl-build", PERL5LIB: ENV["PERL5LIB"])

# Replace cellar path to perl with opt path.
if OS.linux?
inreplace Dir[libexec/"bin/{perl-build,config_data}"] do |s|
s.sub! Formula["perl"].bin.realpath, Formula["perl"].opt_bin
end
inreplace_files = [libexec/"bin/perl-build", libexec/"bin/config_data"]
inreplace inreplace_files, Formula["perl"].bin.realpath, Formula["perl"].opt_bin, global: false
end
end

Expand Down
Loading