gnu: bind: Update to 9.14.3 [fixes CVE-2019-6471].
[jackhill/guix/guix.git] / gnu / packages / llvm.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
6 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
8 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
12 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
13 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages llvm)
31 #:use-module (guix packages)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix download)
34 #:use-module (guix utils)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system emacs)
38 #:use-module (guix build-system python)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages gcc)
41 #:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages libffi)
44 #:use-module (gnu packages mpi)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages xml))
49
50 (define-public llvm
51 (package
52 (name "llvm")
53 (version "8.0.0")
54 (source
55 (origin
56 (method url-fetch)
57 (uri (string-append "https://llvm.org/releases/"
58 version "/llvm-" version ".src.tar.xz"))
59 (sha256
60 (base32
61 "0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
62 (build-system cmake-build-system)
63 (native-inputs
64 `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
65 ("perl" ,perl)))
66 (inputs
67 `(("libffi" ,libffi)))
68 (propagated-inputs
69 `(("zlib" ,zlib))) ;to use output from llvm-config
70 (arguments
71 `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
72 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
73 "-DBUILD_SHARED_LIBS:BOOL=TRUE"
74 "-DLLVM_ENABLE_FFI:BOOL=TRUE"
75 "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
76 "-DLLVM_INSTALL_UTILS=ON") ; Needed for rustc.
77
78 ;; Don't use '-g' during the build, to save space.
79 #:build-type "Release"
80 #:phases (modify-phases %standard-phases
81 (add-before 'build 'shared-lib-workaround
82 ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
83 ;; doesn't seem to get the correct rpath to be able to run
84 ;; from the build directory. Set LD_LIBRARY_PATH as a
85 ;; workaround.
86 (lambda _
87 (setenv "LD_LIBRARY_PATH"
88 (string-append (getcwd) "/lib"))
89 #t)))))
90 (home-page "https://www.llvm.org")
91 (synopsis "Optimizing compiler infrastructure")
92 (description
93 "LLVM is a compiler infrastructure designed for compile-time, link-time,
94 runtime, and idle-time optimization of programs from arbitrary programming
95 languages. It currently supports compilation of C and C++ programs, using
96 front-ends derived from GCC 4.0.1. A new front-end for the C family of
97 languages is in development. The compiler infrastructure includes mirror sets
98 of programming tools as well as libraries with equivalent functionality.")
99 (license license:ncsa)))
100
101 (define* (clang-runtime-from-llvm llvm hash
102 #:optional (patches '()))
103 (package
104 (name "clang-runtime")
105 (version (package-version llvm))
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "https://llvm.org/releases/"
110 version "/compiler-rt-" version ".src.tar.xz"))
111 (sha256 (base32 hash))
112 (patches (map search-patch patches))))
113 (build-system cmake-build-system)
114 (native-inputs (package-native-inputs llvm))
115 (inputs
116 `(("llvm" ,llvm)))
117 (arguments
118 `(;; Don't use '-g' during the build to save space.
119 #:build-type "Release"
120 #:tests? #f)) ; Tests require gtest
121 (home-page "https://compiler-rt.llvm.org")
122 (synopsis "Runtime library for Clang/LLVM")
123 (description
124 "The \"clang-runtime\" library provides the implementations of run-time
125 functions for C and C++ programs. It also provides header files that allow C
126 and C++ source code to interface with the \"sanitization\" passes of the clang
127 compiler. In LLVM this library is called \"compiler-rt\".")
128 (license license:ncsa)
129
130 ;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
131 (supported-systems (delete "mips64el-linux" %supported-systems))))
132
133 (define* (clang-from-llvm llvm clang-runtime hash
134 #:key (patches '()))
135 (package
136 (name "clang")
137 (version (package-version llvm))
138 (source
139 (origin
140 (method url-fetch)
141 (uri (string-append "https://llvm.org/releases/"
142 version "/cfe-" version ".src.tar.xz"))
143 (sha256 (base32 hash))
144 (patches (map search-patch patches))))
145 ;; Using cmake allows us to treat llvm as an external library. There
146 ;; doesn't seem to be any way to do this with clang's autotools-based
147 ;; build system.
148 (build-system cmake-build-system)
149 (native-inputs (package-native-inputs llvm))
150 (inputs
151 `(("libxml2" ,libxml2)
152 ("gcc-lib" ,gcc "lib")
153 ,@(package-inputs llvm)))
154 (propagated-inputs
155 `(("llvm" ,llvm)
156 ("clang-runtime" ,clang-runtime)))
157 (arguments
158 `(#:configure-flags
159 (list "-DCLANG_INCLUDE_TESTS=True"
160
161 ;; Find libgcc_s, crtbegin.o, and crtend.o.
162 (string-append "-DGCC_INSTALL_PREFIX="
163 (assoc-ref %build-inputs "gcc-lib"))
164
165 ;; Use a sane default include directory.
166 (string-append "-DC_INCLUDE_DIRS="
167 (assoc-ref %build-inputs "libc")
168 "/include"))
169
170 ;; Don't use '-g' during the build to save space.
171 #:build-type "Release"
172
173 #:phases (modify-phases %standard-phases
174 (add-after
175 'unpack 'set-glibc-file-names
176 (lambda* (#:key inputs #:allow-other-keys)
177 (let ((libc (assoc-ref inputs "libc"))
178 (compiler-rt (assoc-ref inputs "clang-runtime")))
179 (case (string->number ,(version-major
180 (package-version clang-runtime)))
181 ((or 6 7)
182 ;; Link to libclang_rt files from clang-runtime.
183 (substitute* "lib/Driver/ToolChain.cpp"
184 (("getDriver\\(\\)\\.ResourceDir")
185 (string-append "\"" compiler-rt "\"")))
186
187 ;; Make "LibDir" refer to <glibc>/lib so that it
188 ;; uses the right dynamic linker file name.
189 (substitute* "lib/Driver/ToolChains/Linux.cpp"
190 (("(^[[:blank:]]+LibDir = ).*" _ declaration)
191 (string-append declaration "\"" libc "/lib\";\n"))
192
193 ;; Make sure libc's libdir is on the search path, to
194 ;; allow crt1.o & co. to be found.
195 (("@GLIBC_LIBDIR@")
196 (string-append libc "/lib"))))
197 ((3)
198 (substitute* "lib/Driver/Tools.cpp"
199 ;; Patch the 'getLinuxDynamicLinker' function so that
200 ;; it uses the right dynamic linker file name.
201 (("/lib64/ld-linux-x86-64.so.2")
202 (string-append libc
203 ,(glibc-dynamic-linker))))
204
205 ;; Link to libclang_rt files from clang-runtime.
206 ;; This substitution needed slight adjustment in 3.8.
207 (if (< 3.8 (string->number ,(version-major+minor
208 (package-version
209 clang-runtime))))
210 (substitute* "lib/Driver/Tools.cpp"
211 (("TC\\.getDriver\\(\\)\\.ResourceDir")
212 (string-append "\"" compiler-rt "\"")))
213 (substitute* "lib/Driver/ToolChain.cpp"
214 (("getDriver\\(\\)\\.ResourceDir")
215 (string-append "\"" compiler-rt "\""))))
216
217 ;; Make sure libc's libdir is on the search path, to
218 ;; allow crt1.o & co. to be found.
219 (substitute* "lib/Driver/ToolChains.cpp"
220 (("@GLIBC_LIBDIR@")
221 (string-append libc "/lib")))))
222 #t)))
223 (add-after 'install 'install-clean-up-/share/clang
224 (lambda* (#:key outputs #:allow-other-keys)
225 (let* ((out (assoc-ref outputs "out"))
226 (compl-dir (string-append
227 out "/etc/bash_completion.d")))
228 (with-directory-excursion (string-append out
229 "/share/clang")
230 (for-each
231 (lambda (file)
232 (when (file-exists? file)
233 (delete-file file)))
234 ;; Delete extensions for proprietary text editors.
235 '("clang-format-bbedit.applescript"
236 "clang-format-sublime.py"
237 ;; Delete Emacs extensions: see their respective Emacs
238 ;; Guix package instead.
239 "clang-rename.el" "clang-format.el"))
240 ;; Install bash completion.
241 (when (file-exists? "bash-autocomplete.sh")
242 (mkdir-p compl-dir)
243 (rename-file "bash-autocomplete.sh"
244 (string-append compl-dir "/clang")))))
245 #t)))))
246
247 ;; Clang supports the same environment variables as GCC.
248 (native-search-paths
249 (list (search-path-specification
250 (variable "CPATH")
251 (files '("include")))
252 (search-path-specification
253 (variable "LIBRARY_PATH")
254 (files '("lib" "lib64")))))
255
256 (home-page "https://clang.llvm.org")
257 (synopsis "C language family frontend for LLVM")
258 (description
259 "Clang is a compiler front end for the C, C++, Objective-C and
260 Objective-C++ programming languages. It uses LLVM as its back end. The Clang
261 project includes the Clang front end, the Clang static analyzer, and several
262 code analysis tools.")
263 (license license:ncsa)))
264
265 (define-public libcxx
266 (package
267 (name "libcxx")
268 (version (package-version llvm))
269 (source
270 (origin
271 (method url-fetch)
272 (uri (string-append "http://llvm.org/releases/"
273 version "/libcxx-" version ".src.tar.xz"))
274 (sha256
275 (base32
276 "1wdrxg365ig0kngx52pd0n820sncp24blb0zpalc579iidhh4002"))))
277 (build-system cmake-build-system)
278 (native-inputs
279 `(("clang" ,clang)
280 ("llvm" ,llvm)))
281 (home-page "https://libcxx.llvm.org")
282 (synopsis "C++ standard library")
283 (description
284 "This package provides an implementation of the C++ standard library for
285 use with Clang, targeting C++11, C++14 and above.")
286 (license license:expat)))
287
288 (define-public libomp
289 (package
290 (name "libomp")
291 (version (package-version llvm))
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "http://releases.llvm.org/"
295 version "/openmp-" version
296 ".src.tar.xz"))
297 (sha256
298 (base32
299 "030dkg5cypd7j9hq0mcqb5gs31lxwmzfq52j81l7v9ldcy5bf5mz"))
300 (file-name (string-append "libomp-" version ".tar.xz"))))
301 (build-system cmake-build-system)
302 ;; XXX: Note this gets built with GCC because building with Clang itself
303 ;; fails (missing <atomic>, even when libcxx is added as an input.)
304 (arguments
305 '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
306 "-DOPENMP_TEST_C_COMPILER=clang"
307 "-DOPENMP_TEST_CXX_COMPILER=clang++")
308 #:test-target "check-libomptarget"))
309 (native-inputs
310 `(("clang" ,clang)
311 ("llvm" ,llvm)
312 ("perl" ,perl)
313 ("pkg-config" ,pkg-config)))
314 (inputs
315 `(("hwloc" ,hwloc "lib")))
316 (home-page "https://openmp.llvm.org")
317 (synopsis "OpenMP run-time support library")
318 (description
319 "This package provides the run-time support library developed by the LLVM
320 project for the OpenMP multi-theaded programming extension. This package
321 notably provides @file{libgomp.so}, which is has a binary interface compatible
322 with that of libgomp, the GNU Offloading and Multi Processing Library.")
323 (license license:expat)))
324
325 (define-public clang-runtime
326 (clang-runtime-from-llvm
327 llvm
328 "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"))
329
330 (define-public clang
331 (clang-from-llvm llvm clang-runtime
332 "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
333 #:patches '("clang-7.0-libc-search-path.patch")))
334
335 (define-public llvm-6
336 (package
337 (inherit llvm)
338 (version "6.0.1")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append "https://llvm.org/releases/"
342 version "/llvm-" version ".src.tar.xz"))
343 (sha256
344 (base32
345 "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
346
347 (define-public clang-runtime-6
348 (clang-runtime-from-llvm
349 llvm-6
350 "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"))
351
352 (define-public clang-6
353 (clang-from-llvm llvm-6 clang-runtime
354 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
355 #:patches '("clang-6.0-libc-search-path.patch")))
356
357 (define-public llvm-3.9.1
358 (package (inherit llvm)
359 (name "llvm")
360 (version "3.9.1")
361 (source
362 (origin
363 (method url-fetch)
364 (uri (string-append "https://llvm.org/releases/"
365 version "/llvm-" version ".src.tar.xz"))
366 (sha256
367 (base32
368 "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))))
369
370 (define-public clang-runtime-3.9.1
371 (clang-runtime-from-llvm
372 llvm-3.9.1
373 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
374 '("clang-runtime-asan-build-fixes.patch"
375 "clang-runtime-esan-build-fixes.patch"
376 "clang-3.5-libsanitizer-ustat-fix.patch")))
377
378 (define-public clang-3.9.1
379 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
380 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
381 #:patches '("clang-3.8-libc-search-path.patch")))
382
383 (define-public llvm-3.8
384 (package (inherit llvm)
385 (name "llvm")
386 (version "3.8.1")
387 (source
388 (origin
389 (method url-fetch)
390 (uri (string-append "https://llvm.org/releases/"
391 version "/llvm-" version ".src.tar.xz"))
392 (sha256
393 (base32
394 "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
395
396 (define-public clang-runtime-3.8
397 (clang-runtime-from-llvm
398 llvm-3.8
399 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
400 '("clang-runtime-asan-build-fixes.patch"
401 "clang-3.5-libsanitizer-ustat-fix.patch")))
402
403 (define-public clang-3.8
404 (clang-from-llvm llvm-3.8 clang-runtime-3.8
405 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
406 #:patches '("clang-3.8-libc-search-path.patch")))
407
408 (define-public llvm-3.7
409 (package (inherit llvm)
410 (version "3.7.1")
411 (source
412 (origin
413 (method url-fetch)
414 (uri (string-append "https://llvm.org/releases/"
415 version "/llvm-" version ".src.tar.xz"))
416 (sha256
417 (base32
418 "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
419
420 (define-public clang-runtime-3.7
421 (clang-runtime-from-llvm
422 llvm-3.7
423 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
424 '("clang-runtime-asan-build-fixes.patch"
425 "clang-3.5-libsanitizer-ustat-fix.patch")))
426
427 (define-public clang-3.7
428 (clang-from-llvm llvm-3.7 clang-runtime-3.7
429 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
430 #:patches '("clang-3.5-libc-search-path.patch")))
431
432 (define-public llvm-3.6
433 (package (inherit llvm)
434 (version "3.6.2")
435 (source
436 (origin
437 (method url-fetch)
438 (uri (string-append "https://llvm.org/releases/"
439 version "/llvm-" version ".src.tar.xz"))
440 (sha256
441 (base32
442 "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
443
444 (define-public clang-runtime-3.6
445 (clang-runtime-from-llvm
446 llvm-3.6
447 "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
448 '("clang-runtime-asan-build-fixes.patch")))
449
450 (define-public clang-3.6
451 (clang-from-llvm llvm-3.6 clang-runtime-3.6
452 "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
453 #:patches '("clang-3.5-libc-search-path.patch")))
454
455 (define-public llvm-3.5
456 (package (inherit llvm)
457 (version "3.5.2")
458 (source
459 (origin
460 (method url-fetch)
461 (uri (string-append "https://llvm.org/releases/"
462 version "/llvm-" version ".src.tar.xz"))
463 (patches
464 (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
465 (sha256
466 (base32
467 "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
468
469 (define-public clang-runtime-3.5
470 (clang-runtime-from-llvm
471 llvm-3.5
472 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
473 '("clang-runtime-asan-build-fixes.patch"
474 "clang-3.5-libsanitizer-ustat-fix.patch")))
475
476 (define-public clang-3.5
477 (clang-from-llvm llvm-3.5 clang-runtime-3.5
478 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
479 #:patches '("clang-3.5-libc-search-path.patch")))
480
481 (define-public llvm-for-extempore
482 (package (inherit llvm-3.7)
483 (name "llvm-for-extempore")
484 (source
485 (origin
486 (inherit (package-source llvm-3.7))
487 (patches (list (search-patch "llvm-for-extempore.patch")))))
488 ;; Extempore refuses to build on architectures other than x86_64
489 (supported-systems '("x86_64-linux"))))
490
491 (define-public python-llvmlite
492 (package
493 (name "python-llvmlite")
494 (version "0.27.1")
495 (source
496 (origin
497 (method url-fetch)
498 (uri (pypi-uri "llvmlite" version))
499 (sha256
500 (base32
501 "1aq003zbyjnz4q1118h6qx5lfimc8s5fvgskl75j12gxd6pc78a8"))))
502 (build-system python-build-system)
503 (inputs
504 `(("llvm"
505 ,(package
506 (inherit llvm)
507 (source (origin
508 (inherit (package-source llvm))
509 (patches
510 (list
511 (origin
512 (method url-fetch)
513 (uri (string-append "https://raw.githubusercontent.com/numba/"
514 "llvmlite/v" version "/conda-recipes/"
515 "D47188-svml-VF.patch"))
516 (sha256
517 (base32
518 "0wxhgb61k17f0zg2m0726sf3hppm41f8jar2kkg2n8sl5cnjj9mr")))
519 (origin
520 (method url-fetch)
521 (uri (string-append "https://raw.githubusercontent.com/numba/"
522 "llvmlite/v" version "/conda-recipes/"
523 "twine_cfg_undefined_behavior.patch"))
524 (sha256
525 (base32
526 "07h71n2m1mn9zcfgw04zglffknplb233zqbcd6pckq0wygkrxflp")))))))))))
527 (home-page "http://llvmlite.pydata.org")
528 (synopsis "Wrapper around basic LLVM functionality")
529 (description
530 "This package provides a Python binding to LLVM for use in Numba.")
531 (license license:bsd-3)))
532
533 (define (package-elisp-from-package source-package package-name
534 source-files)
535 "Return a package definition named PACKAGE-NAME that packages the Emacs Lisp
536 SOURCE-FILES found in SOURCE-PACKAGE."
537 (let ((orig (package-source source-package)))
538 (package
539 (inherit source-package)
540 (name package-name)
541 (build-system emacs-build-system)
542 (source (origin
543 (method (origin-method orig))
544 (uri (origin-uri orig))
545 (sha256 (origin-sha256 orig))
546 (file-name (string-append package-name "-"
547 (package-version source-package)))
548 (modules '((guix build utils)
549 (srfi srfi-1)
550 (ice-9 ftw)))
551 (snippet
552 `(let* ((source-files (quote ,source-files))
553 (basenames (map basename source-files)))
554 (map copy-file
555 source-files basenames)
556 (map delete-file-recursively
557 (fold delete
558 (scandir ".")
559 (append '("." "..") basenames)))
560 #t)))))))
561
562 (define-public emacs-clang-format
563 (package
564 (inherit clang)
565 (name "emacs-clang-format")
566 (build-system emacs-build-system)
567 (inputs
568 `(("clang" ,clang)))
569 (arguments
570 `(#:phases
571 (modify-phases %standard-phases
572 (add-after 'unpack 'configure
573 (lambda* (#:key inputs #:allow-other-keys)
574 (let ((clang (assoc-ref inputs "clang")))
575 (copy-file "tools/clang-format/clang-format.el" "clang-format.el")
576 (emacs-substitute-variables "clang-format.el"
577 ("clang-format-executable"
578 (string-append clang "/bin/clang-format"))))
579 #t)))))
580 (synopsis "Format code using clang-format")
581 (description "This package allows to filter code through @code{clang-format}
582 to fix its formatting. @code{clang-format} is a tool that formats
583 C/C++/Obj-C code according to a set of style options, see
584 @url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
585
586 (define-public emacs-clang-rename
587 (package
588 (inherit clang)
589 (name "emacs-clang-rename")
590 (build-system emacs-build-system)
591 (inputs
592 `(("clang" ,clang)))
593 (arguments
594 `(#:phases
595 (modify-phases %standard-phases
596 (add-after 'unpack 'configure
597 (lambda* (#:key inputs #:allow-other-keys)
598 (let ((clang (assoc-ref inputs "clang")))
599 (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
600 (emacs-substitute-variables "clang-rename.el"
601 ("clang-rename-binary"
602 (string-append clang "/bin/clang-rename"))))
603 #t)))))
604 (synopsis "Rename every occurrence of a symbol using clang-rename")
605 (description "This package renames every occurrence of a symbol at point
606 using @code{clang-rename}.")))