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)
92 `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
95 `(("libffi" ,libffi)))
97 `(("zlib" ,zlib))) ;to use output from llvm-config
99 `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
100 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
101 "-DBUILD_SHARED_LIBS:BOOL=TRUE"
102 "-DLLVM_ENABLE_FFI:BOOL=TRUE"
103 "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
104 "-DLLVM_INSTALL_UTILS=ON") ; Needed for rustc.
106 ;; Don't use '-g' during the build, to save space.
107 #:build-type "Release"
108 #:phases (modify-phases %standard-phases
109 (add-before 'build 'shared-lib-workaround
110 ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
111 ;; doesn't seem to get the correct rpath to be able to run
112 ;; from the build directory. Set LD_LIBRARY_PATH as a
115 (setenv "LD_LIBRARY_PATH"
116 (string-append (getcwd) "/lib"))
118 (home-page "https://www.llvm.org")
119 (synopsis "Optimizing compiler infrastructure")
121 "LLVM is a compiler infrastructure designed for compile-time, link-time,
122 runtime, and idle-time optimization of programs from arbitrary programming
123 languages. It currently supports compilation of C and C++ programs, using
124 front-ends derived from GCC 4.0.1. A new front-end for the C family of
125 languages is in development. The compiler infrastructure includes mirror sets
126 of programming tools as well as libraries with equivalent functionality.")
127 (license license:ncsa)))
129 (define-public llvm llvm-8)
131 (define* (clang-runtime-from-llvm llvm hash
132 #:optional (patches '()))
134 (name "clang-runtime")
135 (version (package-version llvm))
139 (uri (string-append "https://llvm.org/releases/"
140 version "/compiler-rt-" version ".src.tar.xz"))
141 (sha256 (base32 hash))
142 (patches (map search-patch patches))))
143 (build-system cmake-build-system)
144 (native-inputs (package-native-inputs llvm))
148 `(;; Don't use '-g' during the build to save space.
149 #:build-type "Release"
150 #:tests? #f)) ; Tests require gtest
151 (home-page "https://compiler-rt.llvm.org")
152 (synopsis "Runtime library for Clang/LLVM")
154 "The \"clang-runtime\" library provides the implementations of run-time
155 functions for C and C++ programs. It also provides header files that allow C
156 and C++ source code to interface with the \"sanitization\" passes of the clang
157 compiler. In LLVM this library is called \"compiler-rt\".")
158 (license license:ncsa)
160 ;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
161 (supported-systems (delete "mips64el-linux" %supported-systems))))
163 (define* (clang-from-llvm llvm clang-runtime hash
167 (version (package-version llvm))
171 (uri (string-append "https://llvm.org/releases/"
172 version "/cfe-" version ".src.tar.xz"))
173 (sha256 (base32 hash))
174 (patches (map search-patch patches))))
175 ;; Using cmake allows us to treat llvm as an external library. There
176 ;; doesn't seem to be any way to do this with clang's autotools-based
178 (build-system cmake-build-system)
179 (native-inputs (package-native-inputs llvm))
181 `(("libxml2" ,libxml2)
182 ("gcc-lib" ,gcc "lib")
183 ,@(package-inputs llvm)))
186 ("clang-runtime" ,clang-runtime)))
189 (list "-DCLANG_INCLUDE_TESTS=True"
191 ;; Find libgcc_s, crtbegin.o, and crtend.o.
192 (string-append "-DGCC_INSTALL_PREFIX="
193 (assoc-ref %build-inputs "gcc-lib"))
195 ;; Use a sane default include directory.
196 (string-append "-DC_INCLUDE_DIRS="
197 (assoc-ref %build-inputs "libc")
200 ;; Don't use '-g' during the build to save space.
201 #:build-type "Release"
203 #:phases (modify-phases %standard-phases
205 'unpack 'set-glibc-file-names
206 (lambda* (#:key inputs #:allow-other-keys)
207 (let ((libc (assoc-ref inputs "libc"))
208 (compiler-rt (assoc-ref inputs "clang-runtime"))
209 (gcc (assoc-ref inputs "gcc"))
212 ,(version-major (package-version clang-runtime)))))
215 ;; Link to libclang_rt files from clang-runtime.
216 (substitute* "lib/Driver/ToolChain.cpp"
217 (("getDriver\\(\\)\\.ResourceDir")
218 (string-append "\"" compiler-rt "\"")))
220 ;; Make "LibDir" refer to <glibc>/lib so that it
221 ;; uses the right dynamic linker file name.
222 (substitute* "lib/Driver/ToolChains/Linux.cpp"
223 (("(^[[:blank:]]+LibDir = ).*" _ declaration)
224 (string-append declaration "\"" libc "/lib\";\n"))
226 ;; Make clang look for libstdc++ in the right
228 (("LibStdCXXIncludePathCandidates\\[\\] = \\{")
230 "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\","))
232 ;; Make sure libc's libdir is on the search path, to
233 ;; allow crt1.o & co. to be found.
235 (string-append libc "/lib"))))
237 (substitute* "lib/Driver/Tools.cpp"
238 ;; Patch the 'getLinuxDynamicLinker' function so that
239 ;; it uses the right dynamic linker file name.
240 (("/lib64/ld-linux-x86-64.so.2")
242 ,(glibc-dynamic-linker))))
244 ;; Link to libclang_rt files from clang-runtime.
245 ;; This substitution needed slight adjustment in 3.8.
246 (if (< 3.8 (string->number ,(version-major+minor
249 (substitute* "lib/Driver/Tools.cpp"
250 (("TC\\.getDriver\\(\\)\\.ResourceDir")
251 (string-append "\"" compiler-rt "\"")))
252 (substitute* "lib/Driver/ToolChain.cpp"
253 (("getDriver\\(\\)\\.ResourceDir")
254 (string-append "\"" compiler-rt "\""))))
256 ;; Make sure libc's libdir is on the search path, to
257 ;; allow crt1.o & co. to be found.
258 (substitute* "lib/Driver/ToolChains.cpp"
260 (string-append libc "/lib")))))
262 (add-after 'install 'install-clean-up-/share/clang
263 (lambda* (#:key outputs #:allow-other-keys)
264 (let* ((out (assoc-ref outputs "out"))
265 (compl-dir (string-append
266 out "/etc/bash_completion.d")))
267 (with-directory-excursion (string-append out
271 (when (file-exists? file)
273 ;; Delete extensions for proprietary text editors.
274 '("clang-format-bbedit.applescript"
275 "clang-format-sublime.py"
276 ;; Delete Emacs extensions: see their respective Emacs
277 ;; Guix package instead.
278 "clang-rename.el" "clang-format.el"))
279 ;; Install bash completion.
280 (when (file-exists? "bash-autocomplete.sh")
282 (rename-file "bash-autocomplete.sh"
283 (string-append compl-dir "/clang")))))
286 ;; Clang supports the same environment variables as GCC.
288 (list (search-path-specification
290 (files '("include")))
291 (search-path-specification
292 (variable "LIBRARY_PATH")
293 (files '("lib" "lib64")))))
295 (home-page "https://clang.llvm.org")
296 (synopsis "C language family frontend for LLVM")
298 "Clang is a compiler front end for the C, C++, Objective-C and
299 Objective-C++ programming languages. It uses LLVM as its back end. The Clang
300 project includes the Clang front end, the Clang static analyzer, and several
301 code analysis tools.")
302 (license license:ncsa)))
304 (define (make-clang-toolchain clang)
306 (name (string-append (package-name clang) "-toolchain"))
307 (version (package-version clang))
309 (build-system trivial-build-system)
311 '(#:modules ((guix build union))
313 (use-modules (ice-9 match)
317 (let ((out (assoc-ref %outputs "out")))
320 (((names . directories) ...)
321 (union-build out directories)))
323 (union-build (assoc-ref %outputs "debug")
324 (list (assoc-ref %build-inputs
326 (union-build (assoc-ref %outputs "static")
327 (list (assoc-ref %build-inputs
331 (native-search-paths (package-native-search-paths clang))
332 (search-paths (package-search-paths clang))
334 (license (package-license clang))
335 (home-page "https://clang.llvm.org")
336 (synopsis "Complete Clang toolchain for C/C++ development")
337 (description "This package provides a complete Clang toolchain for C/C++
338 development to be installed in user profiles. This includes Clang, as well as
339 libc (headers and binaries, plus debugging symbols in the @code{debug}
340 output), and Binutils.")
341 (outputs '("out" "debug" "static"))
342 (inputs `(("clang" ,clang)
343 ("ld-wrapper" ,(car (assoc-ref (%final-inputs) "ld-wrapper")))
344 ("binutils" ,binutils)
346 ("libc-debug" ,glibc "debug")
347 ("libc-static" ,glibc "static")))))
349 (define-public libcxx
352 (version (package-version llvm))
356 (uri (string-append "http://llvm.org/releases/"
357 version "/libcxx-" version ".src.tar.xz"))
360 "1qlx3wlxrnc5cwc1fcfc2vhfsl7j4294hi8y5kxj8hy8wxsjd462"))))
361 (build-system cmake-build-system)
365 (home-page "https://libcxx.llvm.org")
366 (synopsis "C++ standard library")
368 "This package provides an implementation of the C++ standard library for
369 use with Clang, targeting C++11, C++14 and above.")
370 (license license:expat)))
372 (define-public libclc
375 (version (package-version llvm))
380 (url "https://github.com/llvm/llvm-project.git")
381 (commit (string-append "llvmorg-" version))))
382 (file-name (git-file-name name version))
385 "052h16wjcnqginzp7ki4il2xmm25v9nyk0wcz7cg03gbryhl7aqa"))))
386 (build-system cmake-build-system)
389 (list (string-append "-DLLVM_CLANG="
390 (assoc-ref %build-inputs "clang")
392 (string-append "-DPYTHON="
393 (assoc-ref %build-inputs "python")
396 (modify-phases %standard-phases
397 (add-after 'unpack 'chdir
398 (lambda _ (chdir "libclc") #t)))))
403 (home-page "https://libclc.llvm.org")
404 (synopsis "Libraries for the OpenCL programming language")
406 "This package provides an implementation of the OpenCL library
407 requirements according to version 1.1 of the OpenCL specification.")
408 ;; Apache license 2.0 with LLVM exception
409 (license license:asl2.0)))
411 (define-public libomp
414 (version (package-version llvm))
417 (uri (string-append "https://releases.llvm.org/"
418 version "/openmp-" version
422 "1mf9cpgvix34xlpv0inkgl3qmdvgvp96f7sksqizri0n5xfp1cgp"))
423 (file-name (string-append "libomp-" version ".tar.xz"))))
424 (build-system cmake-build-system)
425 ;; XXX: Note this gets built with GCC because building with Clang itself
426 ;; fails (missing <atomic>, even when libcxx is added as an input.)
428 '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
429 "-DOPENMP_TEST_C_COMPILER=clang"
430 "-DOPENMP_TEST_CXX_COMPILER=clang++")
431 #:test-target "check-libomp"))
436 ("pkg-config" ,pkg-config)))
438 `(("hwloc" ,hwloc "lib")))
439 (home-page "https://openmp.llvm.org")
440 (synopsis "OpenMP run-time support library")
442 "This package provides the run-time support library developed by the LLVM
443 project for the OpenMP multi-theaded programming extension. This package
444 notably provides @file{libgomp.so}, which is has a binary interface compatible
445 with that of libgomp, the GNU Offloading and Multi Processing Library.")
446 (license license:expat)))
448 (define-public clang-runtime
449 (clang-runtime-from-llvm
451 "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"))
454 (clang-from-llvm llvm clang-runtime
455 "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
456 #:patches '("clang-7.0-libc-search-path.patch")))
458 (define-public clang-toolchain
459 (make-clang-toolchain clang))
461 (define-public llvm-9
467 (uri (string-append "https://llvm.org/releases/"
468 version "/llvm-" version ".src.tar.xz"))
471 "117ymdz1by2nkfq1c2p9m4050dp848kbjbiv6nsfj8hzy9f5d86n"))))
472 (license license:asl2.0)))
474 (define-public clang-runtime-9
475 (clang-runtime-from-llvm
477 "03ni43lbkp63lr3p6sc94dphqmvnz5av5mml0xmk930xvnbcvr2n"))
479 (define-public clang-9
480 (clang-from-llvm llvm-9 clang-runtime-9
481 "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v"))
483 (define-public clang-toolchain-9
484 (make-clang-toolchain clang-9))
486 (define-public llvm-7
492 (uri (string-append "https://llvm.org/releases/"
493 version "/llvm-" version ".src.tar.xz"))
496 "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"))))))
498 (define-public clang-runtime-7
499 (clang-runtime-from-llvm
501 "065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq"))
503 (define-public clang-7
504 (clang-from-llvm llvm-7 clang-runtime
505 "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"
506 #:patches '("clang-7.0-libc-search-path.patch")))
508 (define-public clang-toolchain-7
509 (make-clang-toolchain clang-7))
511 (define-public llvm-6
517 (uri (string-append "https://llvm.org/releases/"
518 version "/llvm-" version ".src.tar.xz"))
521 "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
523 (define-public clang-runtime-6
524 (clang-runtime-from-llvm
526 "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"))
528 (define-public clang-6
529 (clang-from-llvm llvm-6 clang-runtime
530 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
531 #:patches '("clang-6.0-libc-search-path.patch")))
533 (define-public clang-toolchain-6
534 (make-clang-toolchain clang-6))
536 ;; Libcxx files specifically used by PySide2.
537 (define-public libcxx-6
540 (version (package-version llvm-6))
543 (inherit (package-source libcxx))
544 (uri (string-append "http://llvm.org/releases/"
545 version "/libcxx-" version ".src.tar.xz"))
548 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
553 (define-public llvm-3.9.1
554 (package (inherit llvm)
560 (uri (string-append "https://llvm.org/releases/"
561 version "/llvm-" version ".src.tar.xz"))
564 "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))))
566 (define-public clang-runtime-3.9.1
567 (clang-runtime-from-llvm
569 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
570 '("clang-runtime-asan-build-fixes.patch"
571 "clang-runtime-esan-build-fixes.patch"
572 "clang-3.5-libsanitizer-ustat-fix.patch")))
574 (define-public clang-3.9.1
575 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
576 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
577 #:patches '("clang-3.8-libc-search-path.patch")))
579 (define-public llvm-3.8
580 (package (inherit llvm)
586 (uri (string-append "https://llvm.org/releases/"
587 version "/llvm-" version ".src.tar.xz"))
590 "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
592 (define-public clang-runtime-3.8
593 (clang-runtime-from-llvm
595 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
596 '("clang-runtime-asan-build-fixes.patch"
597 "clang-3.5-libsanitizer-ustat-fix.patch")))
599 (define-public clang-3.8
600 (clang-from-llvm llvm-3.8 clang-runtime-3.8
601 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
602 #:patches '("clang-3.8-libc-search-path.patch")))
604 (define-public llvm-3.7
605 (package (inherit llvm)
610 (uri (string-append "https://llvm.org/releases/"
611 version "/llvm-" version ".src.tar.xz"))
614 "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
616 (define-public clang-runtime-3.7
617 (clang-runtime-from-llvm
619 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
620 '("clang-runtime-asan-build-fixes.patch"
621 "clang-3.5-libsanitizer-ustat-fix.patch")))
623 (define-public clang-3.7
624 (clang-from-llvm llvm-3.7 clang-runtime-3.7
625 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
626 #:patches '("clang-3.5-libc-search-path.patch")))
628 (define-public llvm-3.6
629 (package (inherit llvm)
634 (uri (string-append "https://llvm.org/releases/"
635 version "/llvm-" version ".src.tar.xz"))
638 "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
640 (define-public clang-runtime-3.6
641 (clang-runtime-from-llvm
643 "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
644 '("clang-runtime-asan-build-fixes.patch")))
646 (define-public clang-3.6
647 (clang-from-llvm llvm-3.6 clang-runtime-3.6
648 "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
649 #:patches '("clang-3.5-libc-search-path.patch")))
651 (define-public llvm-3.5
652 (package (inherit llvm)
657 (uri (string-append "https://llvm.org/releases/"
658 version "/llvm-" version ".src.tar.xz"))
660 (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
663 "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
665 (define-public clang-runtime-3.5
666 (clang-runtime-from-llvm
668 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
669 '("clang-runtime-asan-build-fixes.patch"
670 "clang-3.5-libsanitizer-ustat-fix.patch")))
672 (define-public clang-3.5
673 (clang-from-llvm llvm-3.5 clang-runtime-3.5
674 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
675 #:patches '("clang-3.5-libc-search-path.patch")))
677 (define-public llvm-for-extempore
678 (package (inherit llvm-3.7)
679 (name "llvm-for-extempore")
682 (inherit (package-source llvm-3.7))
683 (patches (list (search-patch "llvm-for-extempore.patch")))))
684 ;; Extempore refuses to build on architectures other than x86_64
685 (supported-systems '("x86_64-linux"))))
687 (define-public python-llvmlite
689 (name "python-llvmlite")
694 (uri (pypi-uri "llvmlite" version))
697 "1aq003zbyjnz4q1118h6qx5lfimc8s5fvgskl75j12gxd6pc78a8"))))
698 (build-system python-build-system)
704 (inherit (package-source llvm-7))
709 (uri (string-append "https://raw.githubusercontent.com/numba/"
710 "llvmlite/v" version "/conda-recipes/"
711 "D47188-svml-VF.patch"))
714 "0wxhgb61k17f0zg2m0726sf3hppm41f8jar2kkg2n8sl5cnjj9mr")))
717 (uri (string-append "https://raw.githubusercontent.com/numba/"
718 "llvmlite/v" version "/conda-recipes/"
719 "twine_cfg_undefined_behavior.patch"))
722 "07h71n2m1mn9zcfgw04zglffknplb233zqbcd6pckq0wygkrxflp")))))))))))
723 (home-page "http://llvmlite.pydata.org")
724 (synopsis "Wrapper around basic LLVM functionality")
726 "This package provides a Python binding to LLVM for use in Numba.")
727 (license license:bsd-3)))
729 (define (package-elisp-from-package source-package package-name
731 "Return a package definition named PACKAGE-NAME that packages the Emacs Lisp
732 SOURCE-FILES found in SOURCE-PACKAGE."
733 (let ((orig (package-source source-package)))
735 (inherit source-package)
737 (build-system emacs-build-system)
739 (method (origin-method orig))
740 (uri (origin-uri orig))
741 (sha256 (origin-sha256 orig))
742 (file-name (string-append package-name "-"
743 (package-version source-package)))
744 (modules '((guix build utils)
748 `(let* ((source-files (quote ,source-files))
749 (basenames (map basename source-files)))
751 source-files basenames)
752 (map delete-file-recursively
755 (append '("." "..") basenames)))
758 (define-public emacs-clang-format
761 (name "emacs-clang-format")
762 (build-system emacs-build-system)
767 (modify-phases %standard-phases
768 (add-after 'unpack 'configure
769 (lambda* (#:key inputs #:allow-other-keys)
770 (let ((clang (assoc-ref inputs "clang")))
771 (copy-file "tools/clang-format/clang-format.el" "clang-format.el")
772 (emacs-substitute-variables "clang-format.el"
773 ("clang-format-executable"
774 (string-append clang "/bin/clang-format"))))
776 (synopsis "Format code using clang-format")
777 (description "This package allows to filter code through @code{clang-format}
778 to fix its formatting. @code{clang-format} is a tool that formats
779 C/C++/Obj-C code according to a set of style options, see
780 @url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
782 (define-public emacs-clang-rename
785 (name "emacs-clang-rename")
786 (build-system emacs-build-system)
791 (modify-phases %standard-phases
792 (add-after 'unpack 'configure
793 (lambda* (#:key inputs #:allow-other-keys)
794 (let ((clang (assoc-ref inputs "clang")))
795 (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
796 (emacs-substitute-variables "clang-rename.el"
797 ("clang-rename-binary"
798 (string-append clang "/bin/clang-rename"))))
800 (synopsis "Rename every occurrence of a symbol using clang-rename")
801 (description "This package renames every occurrence of a symbol at point
802 using @code{clang-rename}.")))