Skip to content
Snippets Groups Projects
Unverified Commit de4d0802 authored by Dawid Dziurla's avatar Dawid Dziurla
Browse files

create: add --perl option

parent e6e569fd
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,8 @@ module Homebrew ...@@ -27,6 +27,8 @@ module Homebrew
description: "Create a basic template for a Go build." description: "Create a basic template for a Go build."
switch "--meson", switch "--meson",
description: "Create a basic template for a Meson-style build." description: "Create a basic template for a Meson-style build."
switch "--perl",
description: "Create a basic template for a Perl build."
switch "--python", switch "--python",
description: "Create a basic template for a Python build." description: "Create a basic template for a Python build."
switch "--rust", switch "--rust",
...@@ -46,7 +48,7 @@ module Homebrew ...@@ -46,7 +48,7 @@ module Homebrew
switch :force switch :force
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--autotools", "--cmake", "--go", "--meson", "--python", "--rust" conflicts "--autotools", "--cmake", "--go", "--meson", "--perl", "--python", "--rust"
end end
end end
...@@ -81,6 +83,8 @@ module Homebrew ...@@ -81,6 +83,8 @@ module Homebrew
:meson :meson
elsif args.go? elsif args.go?
:go :go
elsif args.perl?
:perl
elsif args.python? elsif args.python?
:python :python
elsif args.rust? elsif args.rust?
......
...@@ -108,6 +108,8 @@ module Homebrew ...@@ -108,6 +108,8 @@ module Homebrew
<% elsif mode == :meson %> <% elsif mode == :meson %>
depends_on "meson" => :build depends_on "meson" => :build
depends_on "ninja" => :build depends_on "ninja" => :build
<% elsif mode == :perl %>
uses_from_macos "perl"
<% elsif mode == :python %> <% elsif mode == :python %>
depends_on "python" depends_on "python"
<% elsif mode == :rust %> <% elsif mode == :rust %>
...@@ -116,8 +118,8 @@ module Homebrew ...@@ -116,8 +118,8 @@ module Homebrew
# depends_on "cmake" => :build # depends_on "cmake" => :build
<% end %> <% end %>
<% if mode == :python %> <% if mode == :perl || mode == :python %>
# Additional Python dependency # Additional dependency
# resource "" do # resource "" do
# url "" # url ""
# sha256 "" # sha256 ""
...@@ -142,6 +144,26 @@ module Homebrew ...@@ -142,6 +144,26 @@ module Homebrew
system "ninja", "-v" system "ninja", "-v"
system "ninja", "install", "-v" system "ninja", "install", "-v"
end end
<% elsif mode == :perl %>
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
ENV.prepend_path "PERL5LIB", libexec/"lib"
# Stage additional dependency (Makefile.PL style)
# resource("").stage do
# system "perl", "Makefile.PL", "INSTALL_BASE=\#{libexec}"
# system "make"
# system "make", "install"
# end
# Stage additional dependency (Build.PL style)
# resource("").stage do
# system "perl", "Build.PL", "--install_base", libexec
# system "./Build"
# system "./Build", "install"
# end
bin.install name
bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
<% elsif mode == :python %> <% elsif mode == :python %>
virtualenv_install_with_resources virtualenv_install_with_resources
<% elsif mode == :rust %> <% elsif mode == :rust %>
...@@ -154,7 +176,7 @@ module Homebrew ...@@ -154,7 +176,7 @@ module Homebrew
"--prefix=\#{prefix}" "--prefix=\#{prefix}"
# system "cmake", ".", *std_cmake_args # system "cmake", ".", *std_cmake_args
<% end %> <% end %>
<% if mode == :autotools or mode == :cmake %> <% if mode == :autotools || mode == :cmake %>
system "make", "install" # if this fails, try separate make/make install steps system "make", "install" # if this fails, try separate make/make install steps
<% end %> <% end %>
end end
......
...@@ -805,6 +805,8 @@ a simple example. For the complete API, see: ...@@ -805,6 +805,8 @@ a simple example. For the complete API, see:
Create a basic template for a Go build. Create a basic template for a Go build.
* `--meson`: * `--meson`:
Create a basic template for a Meson-style build. Create a basic template for a Meson-style build.
* `--perl`:
Create a basic template for a Perl build.
* `--python`: * `--python`:
Create a basic template for a Python build. Create a basic template for a Python build.
* `--rust`: * `--rust`:
......
...@@ -1028,6 +1028,10 @@ Create a basic template for a Go build\. ...@@ -1028,6 +1028,10 @@ Create a basic template for a Go build\.
Create a basic template for a Meson\-style build\. Create a basic template for a Meson\-style build\.
. .
.TP .TP
\fB\-\-perl\fR
Create a basic template for a Perl build\.
.
.TP
\fB\-\-python\fR \fB\-\-python\fR
Create a basic template for a Python build\. Create a basic template for a Python build\.
. .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment