gnu: Remove ".git" from "https://github/…/….git".
[jackhill/guix/guix.git] / gnu / packages / phabricator.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Robin Templeton <robin@igalia.com>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages phabricator)
20 #:use-module (gnu packages php)
21 #:use-module (gnu packages version-control)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix git-download)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages))
26
27 (define-public libphutil
28 (let ((commit "b29d76e1709ef018cc5edc7c03033fd9fdebc578")
29 (revision "1"))
30 (package
31 (name "libphutil")
32 (version (git-version "0.0.0" revision commit))
33 (source (origin
34 (method git-fetch)
35 (uri (git-reference
36 (url "https://github.com/phacility/libphutil")
37 (commit commit)))
38 (file-name (git-file-name name version))
39 (sha256
40 (base32
41 "06j84721r9r8624fmil62b5crs2qs0v6rr3cvv2zvkvwhxwrwv1l"))))
42 (build-system gnu-build-system)
43 ;; TODO: Unbundle jsonlint and porter-stemmer.
44 (arguments
45 '(#:tests? #f
46 #:phases
47 (modify-phases %standard-phases
48 (delete 'configure)
49 (delete 'build)
50 (replace 'install
51 (lambda _
52 (let ((lib (string-append %output "/lib/libphutil")))
53 (mkdir-p lib)
54 (copy-recursively "." lib))
55 #t)))))
56 (inputs
57 `(("php" ,php)))
58 (home-page "https://github.com/phacility/libphutil")
59 (synopsis "PHP utility library")
60 (description
61 "@code{libphutil} is a collection of utility classes and functions for
62 PHP.")
63 ;; Bundled libraries are expat-licensed.
64 (license (list license:asl2.0 license:expat)))))
65
66 (define-public arcanist
67 (let ((commit "45a8d22c74a62624e69f5cd6ce901c9ab2658904")
68 (revision "1"))
69 (package
70 (name "arcanist")
71 (version (git-version "0.0.0" revision commit))
72 (source (origin
73 (method git-fetch)
74 (uri (git-reference
75 (url "https://github.com/phacility/arcanist")
76 (commit commit)))
77 (file-name (git-file-name name version))
78 (sha256
79 (base32
80 "13vswhqy9sap6841y93j4mj71dl27vhcivcn3rzyi0cchkhg2ac9"))))
81 (build-system gnu-build-system)
82 (arguments
83 '(#:tests? #f
84 #:phases
85 (modify-phases %standard-phases
86 (delete 'configure)
87 (delete 'build)
88 (replace 'install
89 (lambda _
90 (let ((bin (string-append %output "/bin"))
91 (lib (string-append %output "/lib/arcanist")))
92 (mkdir-p lib)
93 (copy-recursively "." lib)
94 (mkdir-p bin)
95 (symlink (string-append lib "/bin/arc")
96 (string-append bin "/arc"))
97 (wrap-program (string-append bin "/arc")
98 `("ARC_PHUTIL_PATH" =
99 (,(string-append (assoc-ref %build-inputs "libphutil")
100 "/lib/libphutil")))
101 `("PATH" ":" prefix
102 (,@(map (lambda (i)
103 (string-append (assoc-ref %build-inputs i) "/bin"))
104 '("git" "mercurial" "subversion"))))))
105 #t))
106 (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
107 (lambda _
108 (for-each make-file-writable
109 (find-files %output ".*\\.t?gz$"))
110 #t)))))
111 (inputs
112 `(("php" ,php)
113 ("libphutil" ,libphutil)
114 ("git" ,git)
115 ("mercurial" ,mercurial)
116 ("subversion" ,subversion)))
117 (home-page "https://github.com/phacility/arcanist")
118 (synopsis "Command-line interface for Phabricator")
119 (description
120 "Arcanist is the command-line tool for the Phabricator software
121 development service. It allows you to interact with Phabricator installs to
122 send code for review, download patches, transfer files, view status, make API
123 calls, and various other things.")
124 (license license:asl2.0))))