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>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages llvm)
33 #:use-module (guix packages)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system emacs)
41 #:use-module (guix build-system python)
42 #:use-module (guix build-system trivial)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages base)
45 #:use-module (gnu packages gcc)
46 #:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages libffi)
49 #:use-module (gnu packages mpi)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages xml)
54 #:export (system->llvm-target))
56 (define* (system->llvm-target #:optional
57 (system (or (and=> (%current-target-system)
58 gnu-triplet->nix-system)
60 "Return the LLVM target name that corresponds to SYSTEM, a system type such
62 ;; See the 'lib/Target' directory of LLVM for a list of supported targets.
63 (letrec-syntax ((matches (syntax-rules (=>)
64 ((_ (system-prefix => target) rest ...)
65 (if (string-prefix? system-prefix system)
69 (error "LLVM target for system is unknown" system)))))
70 (matches ("aarch64" => "AArch64")
72 ("mips64el" => "Mips")
73 ("powerpc" => "PowerPC")
85 (uri (string-append "https://llvm.org/releases/"
86 version "/llvm-" version ".src.tar.xz"))
89 "0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
90 (build-system cmake-build-system)
91 (outputs '("out" "opt-viewer"))
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"
110 (modify-phases %standard-phases
111 (add-before 'build 'shared-lib-workaround
112 ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
113 ;; doesn't seem to get the correct rpath to be able to run
114 ;; from the build directory. Set LD_LIBRARY_PATH as a
117 (setenv "LD_LIBRARY_PATH"
118 (string-append (getcwd) "/lib"))
120 (add-after 'install 'install-opt-viewer
121 (lambda* (#:key outputs #:allow-other-keys)
122 (let* ((out (assoc-ref outputs "out"))
123 (opt-viewer-out (assoc-ref outputs "opt-viewer"))
124 (opt-viewer-share-dir (string-append opt-viewer-out "/share"))
125 (opt-viewer-dir (string-append opt-viewer-share-dir "/opt-viewer")))
126 (mkdir-p opt-viewer-share-dir)
127 (rename-file (string-append out "/share/opt-viewer")
130 (home-page "https://www.llvm.org")
131 (synopsis "Optimizing compiler infrastructure")
133 "LLVM is a compiler infrastructure designed for compile-time, link-time,
134 runtime, and idle-time optimization of programs from arbitrary programming
135 languages. It currently supports compilation of C and C++ programs, using
136 front-ends derived from GCC 4.0.1. A new front-end for the C family of
137 languages is in development. The compiler infrastructure includes mirror sets
138 of programming tools as well as libraries with equivalent functionality.")
139 (license license:ncsa)))
141 (define-public llvm llvm-8)
143 (define* (clang-runtime-from-llvm llvm hash
144 #:optional (patches '()))
146 (name "clang-runtime")
147 (version (package-version llvm))
151 (uri (string-append "https://llvm.org/releases/"
152 version "/compiler-rt-" version ".src.tar.xz"))
153 (sha256 (base32 hash))
154 (patches (map search-patch patches))))
155 (build-system cmake-build-system)
156 (native-inputs (package-native-inputs llvm))
160 `(;; Don't use '-g' during the build to save space.
161 #:build-type "Release"
162 #:tests? #f)) ; Tests require gtest
163 (home-page "https://compiler-rt.llvm.org")
164 (synopsis "Runtime library for Clang/LLVM")
166 "The \"clang-runtime\" library provides the implementations of run-time
167 functions for C and C++ programs. It also provides header files that allow C
168 and C++ source code to interface with the \"sanitization\" passes of the clang
169 compiler. In LLVM this library is called \"compiler-rt\".")
170 (license license:ncsa)
172 ;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
173 (supported-systems (delete "mips64el-linux" %supported-systems))))
175 (define* (clang-from-llvm llvm clang-runtime hash
179 (version (package-version llvm))
183 (uri (string-append "https://llvm.org/releases/"
184 version "/cfe-" version ".src.tar.xz"))
185 (sha256 (base32 hash))
186 (patches (map search-patch patches))))
187 ;; Using cmake allows us to treat llvm as an external library. There
188 ;; doesn't seem to be any way to do this with clang's autotools-based
190 (build-system cmake-build-system)
191 (native-inputs (package-native-inputs llvm))
193 `(("libxml2" ,libxml2)
194 ("gcc-lib" ,gcc "lib")
195 ,@(package-inputs llvm)))
198 ("clang-runtime" ,clang-runtime)))
201 (list "-DCLANG_INCLUDE_TESTS=True"
203 ;; Find libgcc_s, crtbegin.o, and crtend.o.
204 (string-append "-DGCC_INSTALL_PREFIX="
205 (assoc-ref %build-inputs "gcc-lib"))
207 ;; Use a sane default include directory.
208 (string-append "-DC_INCLUDE_DIRS="
209 (assoc-ref %build-inputs "libc")
212 ;; Don't use '-g' during the build to save space.
213 #:build-type "Release"
215 #:phases (modify-phases %standard-phases
217 'unpack 'set-glibc-file-names
218 (lambda* (#:key inputs #:allow-other-keys)
219 (let ((libc (assoc-ref inputs "libc"))
220 (compiler-rt (assoc-ref inputs "clang-runtime"))
221 (gcc (assoc-ref inputs "gcc"))
224 ,(version-major (package-version clang-runtime)))))
227 ;; Link to libclang_rt files from clang-runtime.
228 (substitute* "lib/Driver/ToolChain.cpp"
229 (("getDriver\\(\\)\\.ResourceDir")
230 (string-append "\"" compiler-rt "\"")))
232 ;; Make "LibDir" refer to <glibc>/lib so that it
233 ;; uses the right dynamic linker file name.
234 (substitute* "lib/Driver/ToolChains/Linux.cpp"
235 (("(^[[:blank:]]+LibDir = ).*" _ declaration)
236 (string-append declaration "\"" libc "/lib\";\n"))
238 ;; Make clang look for libstdc++ in the right
240 (("LibStdCXXIncludePathCandidates\\[\\] = \\{")
242 "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\","))
244 ;; Make sure libc's libdir is on the search path, to
245 ;; allow crt1.o & co. to be found.
247 (string-append libc "/lib"))))
249 (substitute* "lib/Driver/Tools.cpp"
250 ;; Patch the 'getLinuxDynamicLinker' function so that
251 ;; it uses the right dynamic linker file name.
252 (("/lib64/ld-linux-x86-64.so.2")
254 ,(glibc-dynamic-linker))))
256 ;; Link to libclang_rt files from clang-runtime.
257 ;; This substitution needed slight adjustment in 3.8.
258 (if (< 3.8 (string->number ,(version-major+minor
261 (substitute* "lib/Driver/Tools.cpp"
262 (("TC\\.getDriver\\(\\)\\.ResourceDir")
263 (string-append "\"" compiler-rt "\"")))
264 (substitute* "lib/Driver/ToolChain.cpp"
265 (("getDriver\\(\\)\\.ResourceDir")
266 (string-append "\"" compiler-rt "\""))))
268 ;; Make sure libc's libdir is on the search path, to
269 ;; allow crt1.o & co. to be found.
270 (substitute* "lib/Driver/ToolChains.cpp"
272 (string-append libc "/lib")))))
274 (add-after 'install 'install-clean-up-/share/clang
275 (lambda* (#:key outputs #:allow-other-keys)
276 (let* ((out (assoc-ref outputs "out"))
277 (compl-dir (string-append
278 out "/etc/bash_completion.d")))
279 (with-directory-excursion (string-append out
283 (when (file-exists? file)
285 ;; Delete extensions for proprietary text editors.
286 '("clang-format-bbedit.applescript"
287 "clang-format-sublime.py"
288 ;; Delete Emacs extensions: see their respective Emacs
289 ;; Guix package instead.
290 "clang-rename.el" "clang-format.el"))
291 ;; Install bash completion.
292 (when (file-exists? "bash-autocomplete.sh")
294 (rename-file "bash-autocomplete.sh"
295 (string-append compl-dir "/clang")))))
298 ;; Clang supports the same environment variables as GCC.
300 (list (search-path-specification
302 (files '("include")))
303 (search-path-specification
304 (variable "LIBRARY_PATH")
305 (files '("lib" "lib64")))))
307 (home-page "https://clang.llvm.org")
308 (synopsis "C language family frontend for LLVM")
310 "Clang is a compiler front end for the C, C++, Objective-C and
311 Objective-C++ programming languages. It uses LLVM as its back end. The Clang
312 project includes the Clang front end, the Clang static analyzer, and several
313 code analysis tools.")
314 (license license:ncsa)))
316 (define (make-clang-toolchain clang)
318 (name (string-append (package-name clang) "-toolchain"))
319 (version (package-version clang))
321 (build-system trivial-build-system)
323 '(#:modules ((guix build union))
325 (use-modules (ice-9 match)
329 (let ((out (assoc-ref %outputs "out")))
332 (((names . directories) ...)
333 (union-build out directories)))
335 (union-build (assoc-ref %outputs "debug")
336 (list (assoc-ref %build-inputs
338 (union-build (assoc-ref %outputs "static")
339 (list (assoc-ref %build-inputs
343 (native-search-paths (package-native-search-paths clang))
344 (search-paths (package-search-paths clang))
346 (license (package-license clang))
347 (home-page "https://clang.llvm.org")
348 (synopsis "Complete Clang toolchain for C/C++ development")
349 (description "This package provides a complete Clang toolchain for C/C++
350 development to be installed in user profiles. This includes Clang, as well as
351 libc (headers and binaries, plus debugging symbols in the @code{debug}
352 output), and Binutils.")
353 (outputs '("out" "debug" "static"))
354 (inputs `(("clang" ,clang)
355 ("ld-wrapper" ,(car (assoc-ref (%final-inputs) "ld-wrapper")))
356 ("binutils" ,binutils)
358 ("libc-debug" ,glibc "debug")
359 ("libc-static" ,glibc "static")))))
361 (define-public libcxx
364 (version (package-version llvm))
368 (uri (string-append "http://llvm.org/releases/"
369 version "/libcxx-" version ".src.tar.xz"))
372 "1qlx3wlxrnc5cwc1fcfc2vhfsl7j4294hi8y5kxj8hy8wxsjd462"))))
373 (build-system cmake-build-system)
377 (home-page "https://libcxx.llvm.org")
378 (synopsis "C++ standard library")
380 "This package provides an implementation of the C++ standard library for
381 use with Clang, targeting C++11, C++14 and above.")
382 (license license:expat)))
384 (define-public libclc
387 (version (package-version llvm))
392 (url "https://github.com/llvm/llvm-project.git")
393 (commit (string-append "llvmorg-" version))))
394 (file-name (git-file-name name version))
397 "052h16wjcnqginzp7ki4il2xmm25v9nyk0wcz7cg03gbryhl7aqa"))))
398 (build-system cmake-build-system)
401 (list (string-append "-DLLVM_CLANG="
402 (assoc-ref %build-inputs "clang")
404 (string-append "-DPYTHON="
405 (assoc-ref %build-inputs "python")
408 (modify-phases %standard-phases
409 (add-after 'unpack 'chdir
410 (lambda _ (chdir "libclc") #t)))))
415 (home-page "https://libclc.llvm.org")
416 (synopsis "Libraries for the OpenCL programming language")
418 "This package provides an implementation of the OpenCL library
419 requirements according to version 1.1 of the OpenCL specification.")
420 ;; Apache license 2.0 with LLVM exception
421 (license license:asl2.0)))
423 (define-public libomp
426 (version (package-version llvm))
429 (uri (string-append "https://releases.llvm.org/"
430 version "/openmp-" version
434 "1mf9cpgvix34xlpv0inkgl3qmdvgvp96f7sksqizri0n5xfp1cgp"))
435 (file-name (string-append "libomp-" version ".tar.xz"))))
436 (build-system cmake-build-system)
437 ;; XXX: Note this gets built with GCC because building with Clang itself
438 ;; fails (missing <atomic>, even when libcxx is added as an input.)
440 '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
441 "-DOPENMP_TEST_C_COMPILER=clang"
442 "-DOPENMP_TEST_CXX_COMPILER=clang++")
443 #:test-target "check-libomp"))
448 ("pkg-config" ,pkg-config)))
450 `(("hwloc" ,hwloc "lib")))
451 (home-page "https://openmp.llvm.org")
452 (synopsis "OpenMP run-time support library")
454 "This package provides the run-time support library developed by the LLVM
455 project for the OpenMP multi-theaded programming extension. This package
456 notably provides @file{libgomp.so}, which is has a binary interface compatible
457 with that of libgomp, the GNU Offloading and Multi Processing Library.")
458 (license license:expat)))
460 (define-public clang-runtime
461 (clang-runtime-from-llvm
463 "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"))
466 (clang-from-llvm llvm clang-runtime
467 "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
468 #:patches '("clang-7.0-libc-search-path.patch")))
470 (define-public clang-toolchain
471 (make-clang-toolchain clang))
473 (define-public llvm-9
479 (uri (string-append "https://llvm.org/releases/"
480 version "/llvm-" version ".src.tar.xz"))
483 "117ymdz1by2nkfq1c2p9m4050dp848kbjbiv6nsfj8hzy9f5d86n"))))
484 (license license:asl2.0)))
486 (define-public clang-runtime-9
487 (clang-runtime-from-llvm
489 "03ni43lbkp63lr3p6sc94dphqmvnz5av5mml0xmk930xvnbcvr2n"))
491 (define-public clang-9
492 (clang-from-llvm llvm-9 clang-runtime-9
493 "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v"))
495 (define-public clang-toolchain-9
496 (make-clang-toolchain clang-9))
498 (define-public llvm-7
504 (uri (string-append "https://llvm.org/releases/"
505 version "/llvm-" version ".src.tar.xz"))
508 "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"))))))
510 (define-public clang-runtime-7
511 (clang-runtime-from-llvm
513 "065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq"))
515 (define-public clang-7
516 (clang-from-llvm llvm-7 clang-runtime
517 "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"
518 #:patches '("clang-7.0-libc-search-path.patch")))
520 (define-public clang-toolchain-7
521 (make-clang-toolchain clang-7))
523 (define-public llvm-6
529 (uri (string-append "https://llvm.org/releases/"
530 version "/llvm-" version ".src.tar.xz"))
533 "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
535 (define-public clang-runtime-6
536 (clang-runtime-from-llvm
538 "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"))
540 (define-public clang-6
541 (clang-from-llvm llvm-6 clang-runtime
542 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
543 #:patches '("clang-6.0-libc-search-path.patch")))
545 (define-public clang-toolchain-6
546 (make-clang-toolchain clang-6))
548 ;; Libcxx files specifically used by PySide2.
549 (define-public libcxx-6
552 (version (package-version llvm-6))
555 (inherit (package-source libcxx))
556 (uri (string-append "http://llvm.org/releases/"
557 version "/libcxx-" version ".src.tar.xz"))
560 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
565 (define-public llvm-3.9.1
566 (package (inherit llvm)
572 (uri (string-append "https://llvm.org/releases/"
573 version "/llvm-" version ".src.tar.xz"))
576 "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))))
578 (define-public clang-runtime-3.9.1
579 (clang-runtime-from-llvm
581 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
582 '("clang-runtime-asan-build-fixes.patch"
583 "clang-runtime-esan-build-fixes.patch"
584 "clang-3.5-libsanitizer-ustat-fix.patch")))
586 (define-public clang-3.9.1
587 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
588 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
589 #:patches '("clang-3.8-libc-search-path.patch")))
591 (define-public llvm-3.8
592 (package (inherit llvm)
598 (uri (string-append "https://llvm.org/releases/"
599 version "/llvm-" version ".src.tar.xz"))
602 "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
604 (define-public clang-runtime-3.8
605 (clang-runtime-from-llvm
607 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
608 '("clang-runtime-asan-build-fixes.patch"
609 "clang-3.5-libsanitizer-ustat-fix.patch")))
611 (define-public clang-3.8
612 (clang-from-llvm llvm-3.8 clang-runtime-3.8
613 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
614 #:patches '("clang-3.8-libc-search-path.patch")))
616 (define-public llvm-3.7
617 (package (inherit llvm)
622 (uri (string-append "https://llvm.org/releases/"
623 version "/llvm-" version ".src.tar.xz"))
626 "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
628 (define-public clang-runtime-3.7
629 (clang-runtime-from-llvm
631 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
632 '("clang-runtime-asan-build-fixes.patch"
633 "clang-3.5-libsanitizer-ustat-fix.patch")))
635 (define-public clang-3.7
636 (clang-from-llvm llvm-3.7 clang-runtime-3.7
637 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
638 #:patches '("clang-3.5-libc-search-path.patch")))
640 (define-public llvm-3.6
641 (package (inherit llvm)
646 (uri (string-append "https://llvm.org/releases/"
647 version "/llvm-" version ".src.tar.xz"))
650 "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
652 (define-public clang-runtime-3.6
653 (clang-runtime-from-llvm
655 "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
656 '("clang-runtime-asan-build-fixes.patch")))
658 (define-public clang-3.6
659 (clang-from-llvm llvm-3.6 clang-runtime-3.6
660 "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
661 #:patches '("clang-3.5-libc-search-path.patch")))
663 (define-public llvm-3.5
664 (package (inherit llvm)
669 (uri (string-append "https://llvm.org/releases/"
670 version "/llvm-" version ".src.tar.xz"))
672 (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
675 "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
677 (define-public clang-runtime-3.5
678 (clang-runtime-from-llvm
680 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
681 '("clang-runtime-asan-build-fixes.patch"
682 "clang-3.5-libsanitizer-ustat-fix.patch")))
684 (define-public clang-3.5
685 (clang-from-llvm llvm-3.5 clang-runtime-3.5
686 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
687 #:patches '("clang-3.5-libc-search-path.patch")))
689 (define-public llvm-for-extempore
690 (package (inherit llvm-3.7)
691 (name "llvm-for-extempore")
694 (inherit (package-source llvm-3.7))
695 (patches (list (search-patch "llvm-for-extempore.patch")))))
696 ;; Extempore refuses to build on architectures other than x86_64
697 (supported-systems '("x86_64-linux"))))
699 (define-public python-llvmlite
701 (name "python-llvmlite")
706 (uri (pypi-uri "llvmlite" version))
709 "1aq003zbyjnz4q1118h6qx5lfimc8s5fvgskl75j12gxd6pc78a8"))))
710 (build-system python-build-system)
716 (inherit (package-source llvm-7))
721 (uri (string-append "https://raw.githubusercontent.com/numba/"
722 "llvmlite/v" version "/conda-recipes/"
723 "D47188-svml-VF.patch"))
726 "0wxhgb61k17f0zg2m0726sf3hppm41f8jar2kkg2n8sl5cnjj9mr")))
729 (uri (string-append "https://raw.githubusercontent.com/numba/"
730 "llvmlite/v" version "/conda-recipes/"
731 "twine_cfg_undefined_behavior.patch"))
734 "07h71n2m1mn9zcfgw04zglffknplb233zqbcd6pckq0wygkrxflp")))))))))))
735 (home-page "http://llvmlite.pydata.org")
736 (synopsis "Wrapper around basic LLVM functionality")
738 "This package provides a Python binding to LLVM for use in Numba.")
739 (license license:bsd-3)))
741 (define (package-elisp-from-package source-package package-name
743 "Return a package definition named PACKAGE-NAME that packages the Emacs Lisp
744 SOURCE-FILES found in SOURCE-PACKAGE."
745 (let ((orig (package-source source-package)))
747 (inherit source-package)
749 (build-system emacs-build-system)
751 (method (origin-method orig))
752 (uri (origin-uri orig))
753 (sha256 (origin-sha256 orig))
754 (file-name (string-append package-name "-"
755 (package-version source-package)))
756 (modules '((guix build utils)
760 `(let* ((source-files (quote ,source-files))
761 (basenames (map basename source-files)))
763 source-files basenames)
764 (map delete-file-recursively
767 (append '("." "..") basenames)))
770 (define-public emacs-clang-format
773 (name "emacs-clang-format")
774 (build-system emacs-build-system)
779 (modify-phases %standard-phases
780 (add-after 'unpack 'configure
781 (lambda* (#:key inputs #:allow-other-keys)
782 (let ((clang (assoc-ref inputs "clang")))
783 (copy-file "tools/clang-format/clang-format.el" "clang-format.el")
784 (emacs-substitute-variables "clang-format.el"
785 ("clang-format-executable"
786 (string-append clang "/bin/clang-format"))))
788 (synopsis "Format code using clang-format")
789 (description "This package allows to filter code through @code{clang-format}
790 to fix its formatting. @code{clang-format} is a tool that formats
791 C/C++/Obj-C code according to a set of style options, see
792 @url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
794 (define-public emacs-clang-rename
797 (name "emacs-clang-rename")
798 (build-system emacs-build-system)
803 (modify-phases %standard-phases
804 (add-after 'unpack 'configure
805 (lambda* (#:key inputs #:allow-other-keys)
806 (let ((clang (assoc-ref inputs "clang")))
807 (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
808 (emacs-substitute-variables "clang-rename.el"
809 ("clang-rename-binary"
810 (string-append clang "/bin/clang-rename"))))
812 (synopsis "Rename every occurrence of a symbol using clang-rename")
813 (description "This package renames every occurrence of a symbol at point
814 using @code{clang-rename}.")))