create: add --go-mod option
This commit is contained in:
parent
1e584f95c3
commit
08f51a5d5a
@ -23,6 +23,8 @@ module Homebrew
|
|||||||
description: "Create a basic template for an Autotools-style build."
|
description: "Create a basic template for an Autotools-style build."
|
||||||
switch "--cmake",
|
switch "--cmake",
|
||||||
description: "Create a basic template for a CMake-style build."
|
description: "Create a basic template for a CMake-style build."
|
||||||
|
switch "--go-mod",
|
||||||
|
description: "Create a basic template for a Go-Modules-style 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 "--no-fetch",
|
switch "--no-fetch",
|
||||||
@ -40,7 +42,7 @@ module Homebrew
|
|||||||
switch :force
|
switch :force
|
||||||
switch :verbose
|
switch :verbose
|
||||||
switch :debug
|
switch :debug
|
||||||
conflicts "--autotools", "--cmake", "--meson"
|
conflicts "--autotools", "--cmake", "--go-mod", "--meson"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -73,6 +75,8 @@ module Homebrew
|
|||||||
:autotools
|
:autotools
|
||||||
elsif args.meson?
|
elsif args.meson?
|
||||||
:meson
|
:meson
|
||||||
|
elsif args.go_mod?
|
||||||
|
:go_mod
|
||||||
end
|
end
|
||||||
|
|
||||||
if fc.name.nil? || fc.name.strip.empty?
|
if fc.name.nil? || fc.name.strip.empty?
|
||||||
|
|||||||
@ -99,6 +99,8 @@ module Homebrew
|
|||||||
|
|
||||||
<% if mode == :cmake %>
|
<% if mode == :cmake %>
|
||||||
depends_on "cmake" => :build
|
depends_on "cmake" => :build
|
||||||
|
<% elsif mode == :go_mod %>
|
||||||
|
depends_on "go" => :build
|
||||||
<% elsif mode == :meson %>
|
<% elsif mode == :meson %>
|
||||||
depends_on "meson" => :build
|
depends_on "meson" => :build
|
||||||
depends_on "ninja" => :build
|
depends_on "ninja" => :build
|
||||||
@ -116,6 +118,8 @@ module Homebrew
|
|||||||
"--disable-dependency-tracking",
|
"--disable-dependency-tracking",
|
||||||
"--disable-silent-rules",
|
"--disable-silent-rules",
|
||||||
"--prefix=\#{prefix}"
|
"--prefix=\#{prefix}"
|
||||||
|
<% elsif mode == :go_mod %>
|
||||||
|
system "go", "build", "-o", "\#{bin}/\#{name}"
|
||||||
<% elsif mode == :meson %>
|
<% elsif mode == :meson %>
|
||||||
mkdir "build" do
|
mkdir "build" do
|
||||||
system "meson", "--prefix=\#{prefix}", ".."
|
system "meson", "--prefix=\#{prefix}", ".."
|
||||||
@ -130,7 +134,7 @@ module Homebrew
|
|||||||
"--prefix=\#{prefix}"
|
"--prefix=\#{prefix}"
|
||||||
# system "cmake", ".", *std_cmake_args
|
# system "cmake", ".", *std_cmake_args
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if mode != :meson %>
|
<% if mode != :meson and mode != :go_mod %>
|
||||||
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user