gnu: tailon: Use absolute paths for commands.
[jackhill/guix/guix.git] / gnu / packages / logging.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages logging)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix utils)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages autotools))
32
33 (define-public log4cpp
34 (package
35 (name "log4cpp")
36 (version "1.1.1")
37 (source (origin
38 (method url-fetch)
39 (uri (string-append "mirror://sourceforge/log4cpp/log4cpp-"
40 (version-major+minor version) ".x%20%28new%29"
41 "/log4cpp-" (version-major+minor version)
42 "/log4cpp-" version ".tar.gz"))
43 (sha256
44 (base32
45 "1l5yz5rfzzv6g3ynrj14mxfsk08cp5h1ssr7d74hjs0accrg7arm"))))
46 (build-system gnu-build-system)
47 (synopsis "Log library for C++")
48 (description
49 "Log4cpp is library of C++ classes for flexible logging to files, syslog,
50 IDSA and other destinations. It is modeled after the Log4j Java library,
51 staying as close to their API as is reasonable.")
52 (home-page "http://log4cpp.sourceforge.net/")
53 (license license:lgpl2.1+)))
54
55 (define-public glog
56 (package
57 (name "glog")
58 (version "0.3.4")
59 (home-page "https://github.com/google/glog")
60 (source (origin
61 (method git-fetch)
62 (uri (git-reference
63 (url home-page)
64 (commit (string-append "v" version))))
65 (sha256
66 (base32
67 "0ym5g15m7c8kjfr2c3zq6bz08ghin2d1r1nb6v2vnkfh1vn945x1"))
68 (file-name (string-append name "-" version "-checkout"))
69 (patches (search-patches "glog-gcc-5-demangling.patch"))))
70 (build-system gnu-build-system)
71 (native-inputs
72 `(("perl" ,perl) ;for tests
73 ("autoconf" ,(autoconf-wrapper))
74 ("automake" ,automake)
75 ("libtool" ,libtool)))
76 (arguments
77 '(#:phases (modify-phases %standard-phases
78 (add-before 'configure 'add-automake-files
79 (lambda _
80 ;; The 'test-driver' file is a dangling symlink to
81 ;; /usr/share/automake; replace it. We can't just run
82 ;; 'automake -ac' because it complains about version
83 ;; mismatch, so run the whole thing.
84 (delete-file "test-driver")
85 (delete-file "configure") ;it's read-only
86 (zero? (system* "autoreconf" "-vfi")))))))
87 (synopsis "C++ logging library")
88 (description
89 "Google glog is a library that implements application-level logging.
90 This library provides logging APIs based on C++-style streams and various
91 helper macros. You can log a message by simply streaming things to log at a
92 particular severity level. It allows logging to be controlled from the
93 command line.")
94 (license license:bsd-3)))
95
96 (define-public tailon
97 (package
98 (name "tailon")
99 (version "1.1.1")
100 (source
101 (origin
102 (method url-fetch)
103 (uri (pypi-uri name version))
104 (sha256
105 (base32
106 "08clrwpfdxcv2z2b5ardpmim4alahbw4l7631dhw62xhbcf6wjzz"))))
107 (build-system python-build-system)
108 (inputs
109 `(("python-pyyaml" ,python-pyyaml)
110 ("python-sockjs-tornado" ,python-sockjs-tornado)
111 ("python-tornado" ,python-tornado)))
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (add-after 'unpack 'patch-commands.py
116 (lambda args
117 (substitute* "tailon/commands.py"
118 (("self\\.first_in_path\\('grep'\\)")
119 (string-append"'" (which "grep") "'"))
120 (("self\\.first_in_path\\('gawk', 'awk'\\)")
121 (string-append"'" (which "gawk") "'"))
122 (("self\\.first_in_path\\('gsed', 'sed'\\)")
123 (string-append"'" (which "sed") "'"))
124 (("self\\.first_in_path\\('gtail', 'tail'\\)")
125 (string-append"'" (which "tail") "'")))
126 #t)))))
127 (home-page "https://tailon.readthedocs.io/")
128 (synopsis
129 "Webapp for looking at and searching through log files")
130 (description
131 "Tailon provides a web interface around the tail, grep, awk and sed
132 commands, displaying the results via a web interface.")
133 (license license:bsd-3)))