projects/guix·blob javascript-team · refs

77 lines · 3.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015, 2016, 2018 Eric Bavier <[email protected]>
3;;; Copyright © 2016, 2017, 2023 Efraim Flashner <[email protected]>
4;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2021, 2022 Greg Hogan <[email protected]>
6;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages ccache)
24 #:use-module (guix gexp)
25 #:use-module (guix packages)
26 #:use-module ((guix licenses) #:select (gpl3+))
27 #:use-module (guix download)
28 #:use-module (guix build-system cmake)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages ruby-xyz))
34
35(define-public ccache
36 (package
37 (name "ccache")
38 (version "4.8.3")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (string-append "https://github.com/ccache/ccache/releases/download/v"
43 version "/ccache-" version ".tar.xz"))
44 (sha256
45 (base32 "049b3xhp464w5m1bqi4ripbgyqy7qy31vvk56v5cyj5j23478wz4"))))
46 (build-system cmake-build-system)
47 (arguments
48 (list #:configure-flags
49 ;; The backend must be explicitly disabled to build without Redis.
50 #~(list "-DREDIS_STORAGE_BACKEND=OFF")
51 #:phases
52 #~(modify-phases %standard-phases
53 (add-before 'configure 'fix-shell
54 ;; Run early whilst we're still in the source directory.
55 (lambda _
56 (substitute* (list "test/run"
57 "test/suites/base.bash"
58 "unittest/test_hashutil.cpp")
59 (("compgen -e") "env | cut -d= -f1")
60 (("#!/bin/sh") (string-append "#!" (which "sh"))))))
61 (add-before 'check 'set-home
62 ;; Tests require a writable HOME.
63 (lambda _
64 (setenv "HOME" (getenv "TMPDIR")))))))
65 (native-inputs
66 (append (list perl which)
67 (if (supported-package? ruby-asciidoctor/minimal)
68 (list ruby-asciidoctor/minimal)
69 '())))
70 (inputs (list zlib `(,zstd "lib")))
71 (home-page "https://ccache.dev/")
72 (synopsis "Compiler cache")
73 (description
74 "Ccache is a compiler cache. It speeds up recompilation by caching
75previous compilations and detecting when the same compilation is being done
76again. Supported languages are C, C++, Objective-C and Objective-C++.")
77 (license gpl3+)))