From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:41352) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQdnm-00044X-IM for guix-patches@gnu.org; Mon, 20 Apr 2020 17:18:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQdnm-0000Pw-0u for guix-patches@gnu.org; Mon, 20 Apr 2020 17:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQdnl-0000Pr-M9 for guix-patches@gnu.org; Mon, 20 Apr 2020 17:18:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jQdnl-0002ft-HO for guix-patches@gnu.org; Mon, 20 Apr 2020 17:18:01 -0400 Subject: [bug#40738] [PATCH 1/4] gnu: Add prometheus. Resent-Message-ID: From: Christopher Baines Date: Mon, 20 Apr 2020 22:17:40 +0100 Message-Id: <20200420211743.23476-1-mail@cbaines.net> In-Reply-To: <87v9lt50d4.fsf@cbaines.net> References: <87v9lt50d4.fsf@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40738@debbugs.gnu.org * gnu/packages/monitoring.scm (prometheus): New variable. --- gnu/packages/monitoring.scm | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index 8da31d6a84..345c2c16c5 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -422,6 +422,55 @@ written in Go with pluggable metric collectors.") (home-page "https://github.com/prometheus/node_exporter") (license license:asl2.0))) +(define-public prometheus + (package + (name "prometheus") + (version "2.17.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/prometheus/prometheus.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1r7zpq6647lrm7cmid6nnf2xnljqh1i9g0fxvs0qrfd2sxxgj0c7")))) + (build-system go-build-system) + (arguments + '(#:unpack-path "github.com/prometheus/prometheus" + #:import-path "github.com/prometheus/prometheus/cmd/prometheus" + #:install-source? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (assets-prefix + (string-append out "/var/lib/prometheus/assets"))) + (substitute* "src/github.com/prometheus/prometheus/web/ui/ui.go" + (("var assetsPrefix string") + (string-append "var assetsPrefix string = \"" + assets-prefix + "\"")))) + #t)) + (add-after 'install 'install-assets + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (assets-prefix + (string-append out "/var/lib/prometheus/assets"))) + (for-each (lambda (directory) + (copy-recursively + (string-append "src/github.com/prometheus/prometheus" + "/web/ui/" directory) + (string-append assets-prefix + "/" directory))) + '("static" "templates"))) + #t))))) + (home-page "https://prometheus.io/") + (synopsis "") + (description "") + (license ""))) + (define-public fswatch (package (name "fswatch") -- 2.26.0