Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Formula/g/go-rice.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class GoRice < Formula
desc "Easily embed resources like HTML, JS, CSS, images, and templates in Go"
homepage "https://github.com/GeertJohan/go.rice"
url "https://github.com/GeertJohan/go.rice/archive/refs/tags/v1.0.3.tar.gz"
sha256 "dda8be9c9c594e164e664479001e7113d0f6571b3fc93253ef132096540f0673"
license "BSD-2-Clause"
head "https://github.com/GeertJohan/go.rice.git", branch: "master"

depends_on "go" => [:build, :test]

def install
ldflags = "-s -w -X main.BuildVersion=#{version}"
system "go", "build", *std_go_args(ldflags:, output: bin/"rice"), "./rice"
end

test do
(testpath/"testproject").mkpath
cd "testproject" do
(testpath/"testproject/main.go").write <<~EOS
package main

import (
"fmt"
rice "github.com/GeertJohan/go.rice"
)

func main() {
box := rice.MustFindBox("templates")
str, err := box.String("test.txt")
if err != nil {
panic(err)
}
fmt.Print(str)
}
EOS

(testpath/"testproject/templates").mkpath
(testpath/"testproject/templates/test.txt").write "Hello, rice!"

# Initialize go module and get go.rice dependency
system "go", "mod", "init", "testproject"
system "go", "mod", "tidy"

# Use go-rice to embed the resources
system bin/"rice", "embed-go"

system "go", "build", "-o", "testbin"
assert_match "Hello, rice!", shell_output("./testbin")
end
end
end
9 changes: 5 additions & 4 deletions Formula/l/localai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class Localai < Formula

desc "OpenAI alternative"
homepage "https://localai.io"
url "https://github.com/mudler/LocalAI/archive/refs/tags/v2.28.0.tar.gz"
sha256 "b75f7cffb3b105c1f5e7cd4aa2d5c18cf461b6af0977d150d654d596f1dc8d79"
url "https://github.com/mudler/LocalAI/archive/refs/tags/v3.0.0.tar.gz"
sha256 "dfe1cc4fee4f7116b2a40300e2c3b31c0244a91ef42b8af625bcc79b49f59172"
license "MIT"
head "https://github.com/mudler/LocalAI.git", branch: "master"

Expand All @@ -20,15 +20,16 @@ class Localai < Formula
depends_on "abseil" => :build
depends_on "cmake" => :build
depends_on "go" => :build
depends_on "go-rice" => :build
depends_on "grpc" => :build
depends_on "protobuf" => :build
depends_on "protoc-gen-go" => :build
depends_on "protoc-gen-go-grpc" => :build
depends_on "[email protected]" => :build

resource "grpcio-tools" do
url "https://files.pythonhosted.org/packages/05/d2/c0866a48c355a6a4daa1f7e27e210c7fa561b1f3b7c0bce2671e89cfa31e/grpcio_tools-1.71.0.tar.gz"
sha256 "38dba8e0d5e0fb23a034e09644fdc6ed862be2371887eee54901999e8f6792a8"
url "https://files.pythonhosted.org/packages/0b/62/5f7d3a6d394a7d0cf94abaa93e8224b7cdbc0677bdf2caabd20a62d4f5cb/grpcio_tools-1.73.0.tar.gz"
sha256 "69e2da77e7d52c7ea3e60047ba7d704d242b55c6c0ffb1a6147ace1b37ce881b"
end

def python3
Expand Down
Loading