create: add --crystal option

This commit is contained in:
Dario Vladovic 2020-06-25 17:17:42 +02:00
parent adbc50f151
commit 519c339261
No known key found for this signature in database
GPG Key ID: 87F43AAF74B61286
5 changed files with 17 additions and 1 deletions

View File

@ -23,6 +23,8 @@ module Homebrew
description: "Create a basic template for an Autotools-style build."
switch "--cmake",
description: "Create a basic template for a CMake-style build."
switch "--crystal",
description: "Create a basic template for a Crystal build."
switch "--go",
description: "Create a basic template for a Go build."
switch "--meson",
@ -50,7 +52,7 @@ module Homebrew
switch :force
switch :verbose
switch :debug
conflicts "--autotools", "--cmake", "--go", "--meson", "--perl", "--python", "--rust"
conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--perl", "--python", "--rust"
named 1
end
end
@ -82,6 +84,8 @@ module Homebrew
:autotools
elsif args.meson?
:meson
elsif args.crystal?
:crystal
elsif args.go?
:go
elsif args.perl?

View File

@ -103,6 +103,8 @@ module Homebrew
<% if mode == :cmake %>
depends_on "cmake" => :build
<% elsif mode == :crystal %>
depends_on "crystal" => :build
<% elsif mode == :go %>
depends_on "go" => :build
<% elsif mode == :meson %>
@ -138,6 +140,9 @@ module Homebrew
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=\#{prefix}"
<% elsif mode == :crystal %>
system "shards", "build", "--release"
bin.install "bin/#{name}"
<% elsif mode == :go %>
system "go", "build", *std_go_args
<% elsif mode == :meson %>

View File

@ -162,6 +162,7 @@ _brew_create() {
--HEAD
--autotools
--cmake
--crystal
--debug
--force
--go

View File

@ -769,6 +769,8 @@ a simple example. For the complete API, see:
Create a basic template for an Autotools-style build.
* `--cmake`:
Create a basic template for a CMake-style build.
* `--crystal`:
Create a basic template for a Crystal build.
* `--go`:
Create a basic template for a Go build.
* `--meson`:

View File

@ -999,6 +999,10 @@ Create a basic template for an Autotools\-style build\.
Create a basic template for a CMake\-style build\.
.
.TP
\fB\-\-crystal\fR
Create a basic template for a Crystal build\.
.
.TP
\fB\-\-go\fR
Create a basic template for a Go build\.
.