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

create: add --rust option #6489

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Library/Homebrew/dev-cmd/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def create_args
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 "\
Expand All @@ -44,7 +46,7 @@ def create_args
switch :force
switch :verbose
switch :debug
conflicts "--autotools", "--cmake", "--go", "--meson", "--python"
conflicts "--autotools", "--cmake", "--go", "--meson", "--python", "--rust"
end
end

Expand Down Expand Up @@ -81,6 +83,8 @@ def create
:go
elsif args.python?
:python
elsif args.rust?
:rust
end

if fc.name.nil? || fc.name.strip.empty?
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/formula_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class #{Formulary.class_s(name)} < Formula
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 %>
Expand Down Expand Up @@ -142,6 +144,8 @@ def install
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",
Expand Down
2 changes: 2 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
4 changes: 4 additions & 0 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -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)\.
.
Expand Down