diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 3fe90865c6..7449ace42c 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -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? diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 5e734c9072..6a76ee6849 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -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 %> diff --git a/completions/bash/brew b/completions/bash/brew index b92b594acd..1a57828607 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -162,6 +162,7 @@ _brew_create() { --HEAD --autotools --cmake + --crystal --debug --force --go diff --git a/docs/Manpage.md b/docs/Manpage.md index 0acac0de49..badba2af06 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -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`: diff --git a/manpages/brew.1 b/manpages/brew.1 index ebec6a5b2f..1025c62d50 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -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\. .