create: add --rust option

This commit is contained in:
Dawid Dziurla 2019-09-25 14:29:09 +02:00
parent 1279bba345
commit b4c56937b1
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
4 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,8 @@ module Homebrew
description: "Create a basic template for a Meson-style build."
switch "--python",
description: "Create a basic template for a Python build."
switch "--rust",
description: "Create a basic template for a Rust build."
switch "--no-fetch",
description: "Homebrew will not download <URL> to the cache and will thus not add its SHA-256 "\
"to the formula for you, nor will it check the GitHub API for GitHub projects "\
@ -44,7 +46,7 @@ module Homebrew
switch :force
switch :verbose
switch :debug
conflicts "--autotools", "--cmake", "--go", "--meson", "--python"
conflicts "--autotools", "--cmake", "--go", "--meson", "--python", "--rust"
end
end
@ -81,6 +83,8 @@ module Homebrew
:go
elsif args.python?
:python
elsif args.rust?
:rust
end
if fc.name.nil? || fc.name.strip.empty?

View File

@ -110,6 +110,8 @@ module Homebrew
depends_on "ninja" => :build
<% elsif mode == :python %>
depends_on "python"
<% elsif mode == :rust %>
depends_on "rust" => :build
<% elsif mode.nil? %>
# depends_on "cmake" => :build
<% end %>
@ -142,6 +144,8 @@ module Homebrew
end
<% elsif mode == :python %>
virtualenv_install_with_resources
<% elsif mode == :rust %>
system "cargo", "install", "--root", prefix, "--path", "."
<% else %>
# Remove unrecognized options if warned by configure
system "./configure", "--disable-debug",

View File

@ -807,6 +807,8 @@ a simple example. For the complete API, see:
Create a basic template for a Meson-style build.
* `--python`:
Create a basic template for a Python build.
* `--rust`:
Create a basic template for a Rust build.
* `--no-fetch`:
Homebrew will not download *`URL`* to the cache and will thus not add its SHA-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage).
* `--HEAD`:

View File

@ -1032,6 +1032,10 @@ Create a basic template for a Meson\-style build\.
Create a basic template for a Python build\.
.
.TP
\fB\-\-rust\fR
Create a basic template for a Rust build\.
.
.TP
\fB\-\-no\-fetch\fR
Homebrew will not download \fIURL\fR to the cache and will thus not add its SHA\-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage)\.
.