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, 2019 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 ;;; Copyright © 2019 Arm Ltd <David.Truby@arm.com>
15 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
16 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages llvm)
34 #:use-module (guix packages)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix utils)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system emacs)
42 #:use-module (guix build-system python)
43 #:use-module (guix build-system trivial)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages gcc)
47 #:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages libffi)
50 #:use-module (gnu packages mpi)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages xml)
55 #:export (system->llvm-target))
57 (define* (system->llvm-target #:optional
58 (system (or (and=> (%current-target-system)
59 gnu-triplet->nix-system)
61 "Return the LLVM target name that corresponds to SYSTEM, a system type such
63 ;; See the 'lib/Target' directory of LLVM for a list of supported targets.
64 (letrec-syntax ((matches (syntax-rules (=>)
65 ((_ (system-prefix => target) rest ...)
66 (if (string-prefix? system-prefix system)
70 (error "LLVM target for system is unknown" system)))))
71 (matches ("aarch64" => "AArch64")
73 ("mips64el" => "Mips")
74 ("powerpc" => "PowerPC")
86 (uri (string-append "https://llvm.org/releases/"
87 version "/llvm-" version ".src.tar.xz"))
90 "0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
91 (build-system cmake-build-system)
93 `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
96 `(("libffi" ,libffi)))
98 `(("zlib" ,zlib))) ;to use output from llvm-config
100 `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
101 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
102 "-DBUILD_SHARED_LIBS:BOOL=TRUE"
103 "-DLLVM_ENABLE_FFI:BOOL=TRUE"
104 "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
105 "-DLLVM_INSTALL_UTILS=ON") ; Needed for rustc.
107 ;; Don't use '-g' during the build, to save space.
108 #:build-type "Release"
109 #:phases (modify-phases %standard-phases
110 (add-before 'build 'shared-lib-workaround
111 ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
112 ;; doesn't seem to get the correct rpath to be able to run
113 ;; from the build directory. Set LD_LIBRARY_PATH as a
116 (setenv "LD_LIBRARY_PATH"
117 (string-append (getcwd) "/lib"))
119 (home-page "https://www.llvm.org")
120 (synopsis "Optimizing compiler infrastructure")
122 "LLVM is a compiler infrastructure designed for compile-time, link-time,
123 runtime, and idle-time optimization of programs from arbitrary programming
124 languages. It currently supports compilation of C and C++ programs, using
125 front-ends derived from GCC 4.0.1. A new front-end for the C family of
126 languages is in development. The compiler infrastructure includes mirror sets
127 of programming tools as well as libraries with equivalent functionality.")
128 (license license:ncsa)))
130 (define-public llvm llvm-8)
132 (define* (clang-runtime-from-llvm llvm hash
133 #:optional (patches '()))
135 (name "clang-runtime")
136 (version (package-version llvm))
140 (uri (string-append "https://llvm.org/releases/"
141 version "/compiler-rt-" version ".src.tar.xz"))
142 (sha256 (base32 hash))
143 (patches (map search-patch patches))))
144 (build-system cmake-build-system)
145 (native-inputs (package-native-inputs llvm))
149 `(;; Don't use '-g' during the build to save space.
150 #:build-type "Release"
151 #:tests? #f)) ; Tests require gtest
152 (home-page "https://compiler-rt.llvm.org")
153 (synopsis "Runtime library for Clang/LLVM")
155 "The \"clang-runtime\" library provides the implementations of run-time
156 functions for C and C++ programs. It also provides header files that allow C
157 and C++ source code to interface with the \"sanitization\" passes of the clang
158 compiler. In LLVM this library is called \"compiler-rt\".")
159 (license license:ncsa)
161 ;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
162 (supported-systems (delete "mips64el-linux" %supported-systems))))
164 (define* (clang-from-llvm llvm clang-runtime hash
168 (version (package-version llvm))
172 (uri (string-append "https://llvm.org/releases/"
173 version "/cfe-" version ".src.tar.xz"))
174 (sha256 (base32 hash))
175 (patches (map search-patch patches))))
176 ;; Using cmake allows us to treat llvm as an external library. There
177 ;; doesn't seem to be any way to do this with clang's autotools-based
179 (build-system cmake-build-system)
180 (native-inputs (package-native-inputs llvm))
182 `(("libxml2" ,libxml2)
183 ("gcc-lib" ,gcc "lib")
184 ,@(package-inputs llvm)))
187 ("clang-runtime" ,clang-runtime)))
190 (list "-DCLANG_INCLUDE_TESTS=True"
192 ;; Find libgcc_s, crtbegin.o, and crtend.o.
193 (string-append "-DGCC_INSTALL_PREFIX="
194 (assoc-ref %build-inputs "gcc-lib"))
196 ;; Use a sane default include directory.
197 (string-append "-DC_INCLUDE_DIRS="
198 (assoc-ref %build-inputs "libc")
201 ;; Don't use '-g' during the build to save space.
202 #:build-type "Release"
204 #:phases (modify-phases %standard-phases
206 'unpack 'set-glibc-file-names
207 (lambda* (#:key inputs #:allow-other-keys)
208 (let ((libc (assoc-ref inputs "libc"))
209 (compiler-rt (assoc-ref inputs "clang-runtime"))
210 (gcc (assoc-ref inputs "gcc"))
213 ,(version-major (package-version clang-runtime)))))
216 ;; Link to libclang_rt files from clang-runtime.
217 (substitute* "lib/Driver/ToolChain.cpp"
218 (("getDriver\\(\\)\\.ResourceDir")
219 (string-append "\"" compiler-rt "\"")))
221 ;; Make "LibDir" refer to <glibc>/lib so that it
222 ;; uses the right dynamic linker file name.
223 (substitute* "lib/Driver/ToolChains/Linux.cpp"
224 (("(^[[:blank:]]+LibDir = ).*" _ declaration)
225 (string-append declaration "\"" libc "/lib\";\n"))
227 ;; Make clang look for libstdc++ in the right
229 (("LibStdCXXIncludePathCandidates\\[\\] = \\{")
231 "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\","))
233 ;; Make sure libc's libdir is on the search path, to
234 ;; allow crt1.o & co. to be found.
236 (string-append libc "/lib"))))
238 (substitute* "lib/Driver/Tools.cpp"
239 ;; Patch the 'getLinuxDynamicLinker' function so that
240 ;; it uses the right dynamic linker file name.
241 (("/lib64/ld-linux-x86-64.so.2")
243 ,(glibc-dynamic-linker))))
245 ;; Link to libclang_rt files from clang-runtime.
246 ;; This substitution needed slight adjustment in 3.8.
247 (if (< 3.8 (string->number ,(version-major+minor
250 (substitute* "lib/Driver/Tools.cpp"
251 (("TC\\.getDriver\\(\\)\\.ResourceDir")
252 (string-append "\"" compiler-rt "\"")))
253 (substitute* "lib/Driver/ToolChain.cpp"
254 (("getDriver\\(\\)\\.ResourceDir")
255 (string-append "\"" compiler-rt "\""))))
257 ;; Make sure libc's libdir is on the search path, to
258 ;; allow crt1.o & co. to be found.
259 (substitute* "lib/Driver/ToolChains.cpp"
261 (string-append libc "/lib")))))
263 (add-after 'install 'install-clean-up-/share/clang
264 (lambda* (#:key outputs #:allow-other-keys)
265 (let* ((out (assoc-ref outputs "out"))
266 (compl-dir (string-append
267 out "/etc/bash_completion.d")))
268 (with-directory-excursion (string-append out
272 (when (file-exists? file)
274 ;; Delete extensions for proprietary text editors.
275 '("clang-format-bbedit.applescript"
276 "clang-format-sublime.py"
277 ;; Delete Emacs extensions: see their respective Emacs
278 ;; Guix package instead.
279 "clang-rename.el" "clang-format.el"))
280 ;; Install bash completion.
281 (when (file-exists? "bash-autocomplete.sh")
283 (rename-file "bash-autocomplete.sh"
284 (string-append compl-dir "/clang")))))
287 ;; Clang supports the same environment variables as GCC.
289 (list (search-path-specification
291 (files '("include")))
292 (search-path-specification
293 (variable "LIBRARY_PATH")
294 (files '("lib" "lib64")))))
296 (home-page "https://clang.llvm.org")
297 (synopsis "C language family frontend for LLVM")
299 "Clang is a compiler front end for the C, C++, Objective-C and
300 Objective-C++ programming languages. It uses LLVM as its back end. The Clang
301 project includes the Clang front end, the Clang static analyzer, and several
302 code analysis tools.")
303 (license license:ncsa)))
305 (define (make-clang-toolchain clang)
307 (name (string-append (package-name clang) "-toolchain"))
308 (version (package-version clang))
310 (build-system trivial-build-system)
312 '(#:modules ((guix build union))
314 (use-modules (ice-9 match)
318 (let ((out (assoc-ref %outputs "out")))
321 (((names . directories) ...)
322 (union-build out directories)))
324 (union-build (assoc-ref %outputs "debug")
325 (list (assoc-ref %build-inputs
327 (union-build (assoc-ref %outputs "static")
328 (list (assoc-ref %build-inputs
332 (native-search-paths (package-native-search-paths clang))
333 (search-paths (package-search-paths clang))
335 (license (package-license clang))
336 (home-page "https://clang.llvm.org")
337 (synopsis "Complete Clang toolchain for C/C++ development")
338 (description "This package provides a complete Clang toolchain for C/C++
339 development to be installed in user profiles. This includes Clang, as well as
340 libc (headers and binaries, plus debugging symbols in the @code{debug}
341 output), and Binutils.")
342 (outputs '("out" "debug" "static"))
343 (inputs `(("clang" ,clang)
344 ("ld-wrapper" ,(car (assoc-ref (%final-inputs) "ld-wrapper")))
345 ("binutils" ,binutils)
347 ("libc-debug" ,glibc "debug")
348 ("libc-static" ,glibc "static")))))
350 (define-public libcxx
353 (version (package-version llvm))
357 (uri (string-append "http://llvm.org/releases/"
358 version "/libcxx-" version ".src.tar.xz"))
361 "1qlx3wlxrnc5cwc1fcfc2vhfsl7j4294hi8y5kxj8hy8wxsjd462"))))
362 (build-system cmake-build-system)
366 (home-page "https://libcxx.llvm.org")
367 (synopsis "C++ standard library")
369 "This package provides an implementation of the C++ standard library for
370 use with Clang, targeting C++11, C++14 and above.")
371 (license license:expat)))
373 (define-public libclc
376 (version (package-version llvm))
381 (url "https://github.com/llvm/llvm-project.git")
382 (commit (string-append "llvmorg-" version))))
383 (file-name (git-file-name name version))
386 "052h16wjcnqginzp7ki4il2xmm25v9nyk0wcz7cg03gbryhl7aqa"))))
387 (build-system cmake-build-system)
390 (list (string-append "-DLLVM_CLANG="
391 (assoc-ref %build-inputs "clang")
393 (string-append "-DPYTHON="
394 (assoc-ref %build-inputs "python")
397 (modify-phases %standard-phases
398 (add-after 'unpack 'chdir
399 (lambda _ (chdir "libclc") #t)))))
404 (home-page "https://libclc.llvm.org")
405 (synopsis "Libraries for the OpenCL programming language")
407 "This package provides an implementation of the OpenCL library
408 requirements according to version 1.1 of the OpenCL specification.")
409 ;; Apache license 2.0 with LLVM exception
410 (license license:asl2.0)))
412 (define-public libomp
415 (version (package-version llvm))
418 (uri (string-append "https://releases.llvm.org/"
419 version "/openmp-" version
423 "1mf9cpgvix34xlpv0inkgl3qmdvgvp96f7sksqizri0n5xfp1cgp"))
424 (file-name (string-append "libomp-" version ".tar.xz"))))
425 (build-system cmake-build-system)
426 ;; XXX: Note this gets built with GCC because building with Clang itself
427 ;; fails (missing <atomic>, even when libcxx is added as an input.)
429 '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
430 "-DOPENMP_TEST_C_COMPILER=clang"
431 "-DOPENMP_TEST_CXX_COMPILER=clang++")
432 #:test-target "check-libomp"))
437 ("pkg-config" ,pkg-config)))
439 `(("hwloc" ,hwloc "lib")))
440 (home-page "https://openmp.llvm.org")
441 (synopsis "OpenMP run-time support library")
443 "This package provides the run-time support library developed by the LLVM
444 project for the OpenMP multi-theaded programming extension. This package
445 notably provides @file{libgomp.so}, which is has a binary interface compatible
446 with that of libgomp, the GNU Offloading and Multi Processing Library.")
447 (license license:expat)))
449 (define-public clang-runtime
450 (clang-runtime-from-llvm
452 "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"))
455 (clang-from-llvm llvm clang-runtime
456 "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
457 #:patches '("clang-7.0-libc-search-path.patch")))
459 (define-public clang-toolchain
460 (make-clang-toolchain clang))
462 (define-public llvm-9
468 (uri (string-append "https://llvm.org/releases/"
469 version "/llvm-" version ".src.tar.xz"))
472 "117ymdz1by2nkfq1c2p9m4050dp848kbjbiv6nsfj8hzy9f5d86n"))))
473 (license license:asl2.0)))
475 (define-public clang-runtime-9
476 (clang-runtime-from-llvm
478 "03ni43lbkp63lr3p6sc94dphqmvnz5av5mml0xmk930xvnbcvr2n"))
480 (define-public clang-9
481 (clang-from-llvm llvm-9 clang-runtime-9
482 "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v"))
484 (define-public clang-toolchain-9
485 (make-clang-toolchain clang-9))
487 (define-public llvm-7
493 (uri (string-append "https://llvm.org/releases/"
494 version "/llvm-" version ".src.tar.xz"))
497 "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"))))))
499 (define-public clang-runtime-7
500 (clang-runtime-from-llvm
502 "065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq"))
504 (define-public clang-7
505 (clang-from-llvm llvm-7 clang-runtime
506 "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"
507 #:patches '("clang-7.0-libc-search-path.patch")))
509 (define-public clang-toolchain-7
510 (make-clang-toolchain clang-7))
512 (define-public llvm-6
518 (uri (string-append "https://llvm.org/releases/"
519 version "/llvm-" version ".src.tar.xz"))
522 "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
524 (define-public clang-runtime-6
525 (clang-runtime-from-llvm
527 "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"))
529 (define-public clang-6
530 (clang-from-llvm llvm-6 clang-runtime
531 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
532 #:patches '("clang-6.0-libc-search-path.patch")))
534 (define-public clang-toolchain-6
535 (make-clang-toolchain clang-6))
537 ;; Libcxx files specifically used by PySide2.
538 (define-public libcxx-6
541 (version (package-version llvm-6))
544 (inherit (package-source libcxx))
545 (uri (string-append "http://llvm.org/releases/"
546 version "/libcxx-" version ".src.tar.xz"))
549 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
554 (define-public llvm-3.9.1
555 (package (inherit llvm)
561 (uri (string-append "https://llvm.org/releases/"
562 version "/llvm-" version ".src.tar.xz"))
565 "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))))
567 (define-public clang-runtime-3.9.1
568 (clang-runtime-from-llvm
570 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
571 '("clang-runtime-asan-build-fixes.patch"
572 "clang-runtime-esan-build-fixes.patch"
573 "clang-3.5-libsanitizer-ustat-fix.patch")))
575 (define-public clang-3.9.1
576 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
577 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
578 #:patches '("clang-3.8-libc-search-path.patch")))
580 (define-public llvm-3.8
581 (package (inherit llvm)
587 (uri (string-append "https://llvm.org/releases/"
588 version "/llvm-" version ".src.tar.xz"))
591 "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
593 (define-public clang-runtime-3.8
594 (clang-runtime-from-llvm
596 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
597 '("clang-runtime-asan-build-fixes.patch"
598 "clang-3.5-libsanitizer-ustat-fix.patch")))
600 (define-public clang-3.8
601 (clang-from-llvm llvm-3.8 clang-runtime-3.8
602 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
603 #:patches '("clang-3.8-libc-search-path.patch")))
605 (define-public llvm-3.7
606 (package (inherit llvm)
611 (uri (string-append "https://llvm.org/releases/"
612 version "/llvm-" version ".src.tar.xz"))
615 "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
617 (define-public clang-runtime-3.7
618 (clang-runtime-from-llvm
620 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
621 '("clang-runtime-asan-build-fixes.patch"
622 "clang-3.5-libsanitizer-ustat-fix.patch")))
624 (define-public clang-3.7
625 (clang-from-llvm llvm-3.7 clang-runtime-3.7
626 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
627 #:patches '("clang-3.5-libc-search-path.patch")))
629 (define-public llvm-3.6
630 (package (inherit llvm)
635 (uri (string-append "https://llvm.org/releases/"
636 version "/llvm-" version ".src.tar.xz"))
639 "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
641 (define-public clang-runtime-3.6
642 (clang-runtime-from-llvm
644 "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
645 '("clang-runtime-asan-build-fixes.patch")))
647 (define-public clang-3.6
648 (clang-from-llvm llvm-3.6 clang-runtime-3.6
649 "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
650 #:patches '("clang-3.5-libc-search-path.patch")))
652 (define-public llvm-3.5
653 (package (inherit llvm)
658 (uri (string-append "https://llvm.org/releases/"
659 version "/llvm-" version ".src.tar.xz"))
661 (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
664 "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
666 (define-public clang-runtime-3.5
667 (clang-runtime-from-llvm
669 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
670 '("clang-runtime-asan-build-fixes.patch"
671 "clang-3.5-libsanitizer-ustat-fix.patch")))
673 (define-public clang-3.5
674 (clang-from-llvm llvm-3.5 clang-runtime-3.5
675 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
676 #:patches '("clang-3.5-libc-search-path.patch")))
678 (define-public llvm-for-extempore
679 (package (inherit llvm-3.7)
680 (name "llvm-for-extempore")
683 (inherit (package-source llvm-3.7))
684 (patches (list (search-patch "llvm-for-extempore.patch")))))
685 ;; Extempore refuses to build on architectures other than x86_64
686 (supported-systems '("x86_64-linux"))))
688 (define-public python-llvmlite
690 (name "python-llvmlite")
695 (uri (pypi-uri "llvmlite" version))
698 "01wspdc0xhnydl66jyhyr4ii16h3fnw6mjihiwnnxdxg9j6kkajf"))))
699 (build-system python-build-system)
701 ;; FIXME: One test fails unable to find libm.so
702 ;; https://github.com/numba/llvmlite/issues/537
709 (inherit (package-source llvm-7))
714 (uri (string-append "https://raw.githubusercontent.com/numba/"
715 "llvmlite/v" version "/conda-recipes/"
716 "D47188-svml-VF.patch"))
719 "0wxhgb61k17f0zg2m0726sf3hppm41f8jar2kkg2n8sl5cnjj9mr")))
722 (uri (string-append "https://raw.githubusercontent.com/numba/"
723 "llvmlite/v" version "/conda-recipes/"
724 "twine_cfg_undefined_behavior.patch"))
727 "07h71n2m1mn9zcfgw04zglffknplb233zqbcd6pckq0wygkrxflp")))))))))))
728 (home-page "http://llvmlite.pydata.org")
729 (synopsis "Wrapper around basic LLVM functionality")
731 "This package provides a Python binding to LLVM for use in Numba.")
732 (license license:bsd-3)))
734 (define (package-elisp-from-package source-package package-name
736 "Return a package definition named PACKAGE-NAME that packages the Emacs Lisp
737 SOURCE-FILES found in SOURCE-PACKAGE."
738 (let ((orig (package-source source-package)))
740 (inherit source-package)
742 (build-system emacs-build-system)
744 (method (origin-method orig))
745 (uri (origin-uri orig))
746 (sha256 (origin-sha256 orig))
747 (file-name (string-append package-name "-"
748 (package-version source-package)))
749 (modules '((guix build utils)
753 `(let* ((source-files (quote ,source-files))
754 (basenames (map basename source-files)))
756 source-files basenames)
757 (map delete-file-recursively
760 (append '("." "..") basenames)))
763 (define-public emacs-clang-format
766 (name "emacs-clang-format")
767 (build-system emacs-build-system)
772 (modify-phases %standard-phases
773 (add-after 'unpack 'configure
774 (lambda* (#:key inputs #:allow-other-keys)
775 (let ((clang (assoc-ref inputs "clang")))
776 (copy-file "tools/clang-format/clang-format.el" "clang-format.el")
777 (emacs-substitute-variables "clang-format.el"
778 ("clang-format-executable"
779 (string-append clang "/bin/clang-format"))))
781 (synopsis "Format code using clang-format")
782 (description "This package allows to filter code through @code{clang-format}
783 to fix its formatting. @code{clang-format} is a tool that formats
784 C/C++/Obj-C code according to a set of style options, see
785 @url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
787 (define-public emacs-clang-rename
790 (name "emacs-clang-rename")
791 (build-system emacs-build-system)
796 (modify-phases %standard-phases
797 (add-after 'unpack 'configure
798 (lambda* (#:key inputs #:allow-other-keys)
799 (let ((clang (assoc-ref inputs "clang")))
800 (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
801 (emacs-substitute-variables "clang-rename.el"
802 ("clang-rename-binary"
803 (string-append clang "/bin/clang-rename"))))
805 (synopsis "Rename every occurrence of a symbol using clang-rename")
806 (description "This package renames every occurrence of a symbol at point
807 using @code{clang-rename}.")))