Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
60 changes: 60 additions & 0 deletions Formula/gotraceui.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
class Gotraceui < Formula
desc "Efficient frontend for Go execution traces"
homepage "https://gotraceui.dev"
url "https://github.com/dominikh/gotraceui/archive/bfc5b70255cae54a74929a1e2394d57d4a3bc9d8.tar.gz"
version "20251215"
sha256 "35955954b8ae323a16ef764bc70fba851cbec92f3cdff15688e1670aa564b68e"
license "MIT"

head "https://github.com/dominikh/gotraceui.git", branch: "master"

depends_on "go" => :build
depends_on "pkg-config" => :build

on_linux do
depends_on "vulkan-headers" => :build
depends_on "libx11"
depends_on "libxcb"
depends_on "libxcursor"
depends_on "libxfixes"
depends_on "libxkbcommon"
depends_on "llvm"
depends_on "mesa"
depends_on "wayland"
end

def install
if OS.linux?
ENV["CC"] = Formula["llvm"].opt_bin/"clang"
ENV["CXX"] = Formula["llvm"].opt_bin/"clang++"
ENV["CGO_ENABLED"] = "1"
ENV.prepend_path "PATH", Formula["llvm"].opt_bin

# Pkg Config
Formula["gotraceui"].recursive_dependencies.each do |dep|
f = dep.to_formula

# pkg-config directories
pc = f.opt_lib/"pkgconfig"
ENV.prepend_path "PKG_CONFIG_PATH", pc if pc.directory?

# include directories
inc = f.opt_include
ENV.prepend_path "C_INCLUDE_PATH", inc if inc.directory?
end
end
ldflags = %w[
-s -w
-X gioui.org/app.ID=co.honnef.Gotraceui
]

system "go", "build", *std_go_args(output: libexec/"gotraceui", ldflags: ldflags), "./cmd/gotraceui"

unless OS.mac?
(bin/"gotraceui").write_env_script libexec/"gotraceui",
XLOCALEDIR: Formula["libx11"].opt_share/"X11/locale"
end

pkgshare.install "share"
end
end
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ brew install tyhal/tap/klar
```

### Others

- **[gotraceui](https://gotraceui.dev/)** – An efficient frontend for Go execution traces ( Dominik Honnef )

```
brew install --build-from-source --HEAD tyhal/tap/gotraceui
```
Loading