ccache.scm 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014, 2015, 2016, 2018 Eric Bavier <bavier@member.fsf.org>
  3. ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  5. ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages ccache)
  22. #:use-module (guix packages)
  23. #:use-module ((guix licenses) #:select (gpl3+))
  24. #:use-module (guix download)
  25. #:use-module (guix build-system cmake)
  26. #:use-module (gnu packages)
  27. #:use-module (gnu packages perl)
  28. #:use-module (gnu packages compression))
  29. (define-public ccache
  30. (package
  31. (name "ccache")
  32. (version "4.4")
  33. (source
  34. (origin
  35. (method url-fetch)
  36. (uri (string-append "https://github.com/ccache/ccache/releases/download/v"
  37. version "/ccache-" version ".tar.xz"))
  38. (sha256
  39. (base32 "0qbmcs6c3m071vsd1ppa31r8s0dzpaw5y38z8ga1bz48rwpfl2xl"))))
  40. (build-system cmake-build-system)
  41. (native-inputs `(("perl" ,perl) ; for test/run
  42. ("which" ,(@ (gnu packages base) which))))
  43. (inputs `(("zlib" ,zlib)
  44. ("zstd" ,zstd "lib")))
  45. (arguments
  46. '(;; Disable redis backend explicitly. Build system insists on present dependency
  47. ;; or on explicit flag.
  48. #:configure-flags
  49. '("-DREDIS_STORAGE_BACKEND=OFF")
  50. #:phases
  51. (modify-phases %standard-phases
  52. (add-before 'configure 'setup-tests
  53. (lambda _
  54. (substitute* '("unittest/test_hashutil.cpp" "test/suites/base.bash")
  55. (("#!/bin/sh") (string-append "#!" (which "sh"))))
  56. #t))
  57. (add-before 'check 'set-home
  58. ;; Tests require a writable HOME.
  59. (lambda _
  60. (setenv "HOME" (getenv "TMPDIR"))
  61. #t)))))
  62. (home-page "https://ccache.dev/")
  63. (synopsis "Compiler cache")
  64. (description
  65. "Ccache is a compiler cache. It speeds up recompilation by caching
  66. previous compilations and detecting when the same compilation is being done
  67. again. Supported languages are C, C++, Objective-C and Objective-C++.")
  68. (license gpl3+)))