11class Chronograf < Formula
22 desc "Open source monitoring and visualization UI for the TICK stack"
33 homepage "https://docs.influxdata.com/chronograf/latest/"
4- url "https://github.com/influxdata/chronograf/archive/refs/tags/1.10.9 .tar.gz"
5- sha256 "15c7cc80cc5e1e2d6ef33bffce1b6a26729f45b80453714f424eec03974f7e14 "
4+ url "https://github.com/influxdata/chronograf/archive/refs/tags/1.11.0 .tar.gz"
5+ sha256 "11e1228f3b193d7b9cafad6ff4903f0f920a03432c5045ee620c105e361ced10 "
66 license "AGPL-3.0-or-later"
77 head "https://github.com/influxdata/chronograf.git" , branch : "master"
88
@@ -16,38 +16,29 @@ class Chronograf < Formula
1616 end
1717
1818 depends_on "go" => :build
19- # Avoid C++20 from Node 23+ until "@parcel/watcher >= 2.2.0" for "node-addon-api >= 4"
20- # Issue ref: https://github.com/nodejs/node-addon-api/issues/1007
21- depends_on "node@22 " => :build
22- depends_on "python-setuptools " => :build
19+ depends_on "node" => :build
20+ depends_on "pkg-config-wrapper" => :build
21+ depends_on "pkgconf " => :build
22+ depends_on "rust " => :build
2323 depends_on "yarn" => :build
2424 depends_on "influxdb"
2525 depends_on "kapacitor"
2626
2727 def install
28- # Check if workarounds can be removed
29- if build . stable?
30- yarn_lock = File . read ( "yarn.lock" )
31-
32- # distutils usage removed in https://github.com/nodejs/node-gyp/commit/707927cd579205ef2b4b17e61c1cce24c056b452
33- node_gyp_version = Version . new ( yarn_lock [ %r{/node-gyp[._-]v?(\d +(?:\. \d +)+)\. t}i , 1 ] )
34- odie "Remove `python-setuptools` dependency!" if node_gyp_version >= 10
35-
36- # node 22 (V8 12) fix in https://github.com/nodejs/nan/commit/1b630ddb3412cde35b64513662b440f9fd71e1ff
37- nan_version = Version . new ( yarn_lock [ %r{/nan[._-]v?(\d +(?:\. \d +)+)\. t}i , 1 ] )
38- odie "Remove `nan` resolution workaround!" if nan_version >= "2.19.0"
39- end
40-
41- # Workaround to build with newer node until `nan` dependency is updated
42- # https://github.com/influxdata/chronograf/issues/6040
28+ ENV [ "CGO_ENABLED" ] = "1"
29+ ENV [ "PKG_CONFIG" ] = Formula [ "pkg-config-wrapper" ] . opt_bin /"pkg-config-wrapper"
30+ # Force newer node-addon-api for arm linux until "@parcel/watcher >= 2.2.0" for "node-addon-api >= 4"
31+ # https://github.com/nodejs/node-addon-api/issues/1007
4332 package_json = JSON . parse ( File . read ( "package.json" ) )
44- ( package_json [ "resolutions" ] ||= { } ) [ "nan " ] = "2.23.0 "
33+ ( package_json [ "resolutions" ] ||= { } ) [ "node-addon-api " ] = "7.1.1 "
4534 File . write ( "package.json" , JSON . pretty_generate ( package_json ) )
4635
47- ENV [ "npm_config_build_from_source" ] = "true"
48- ENV . deparallelize
49- system "make"
50- bin . install "chronograf"
36+ system "yarn" , "--cwd=ui" , "install"
37+ system "yarn" , "--cwd=ui" , "build"
38+
39+ ldflags = "-s -w -X main.version=#{ version } "
40+ system "go" , "build" , *std_go_args ( ldflags :) , "./cmd/chronograf"
41+ system "go" , "build" , *std_go_args ( ldflags :, output : bin /"chronoctl" ) , "./cmd/chronoctl"
5142 end
5243
5344 service do
@@ -61,9 +52,7 @@ def install
6152 test do
6253 port = free_port
6354 pid = spawn bin /"chronograf" , "--port=#{ port } "
64- sleep 10
65- output = shell_output ( "curl -s 0.0.0.0:#{ port } /chronograf/v1/" )
66- sleep 1
55+ output = shell_output ( "curl -s --retry 5 --retry-connrefused 0.0.0.0:#{ port } /chronograf/v1/" )
6756 assert_match "/chronograf/v1/layouts" , output
6857 ensure
6958 Process . kill ( "SIGTERM" , pid )
0 commit comments