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, 2020 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")
79 (define (llvm-download-uri component version)
80 (if (version>=? version "9.0.1")
81 (string-append "https://github.com/llvm/llvm-project/releases/download"
82 "/llvmorg-" version "/" component "-" version ".src.tar.xz")
83 (string-append "https://releases.llvm.org/" version "/" component "-"
84 version ".src.tar.xz")))
93 (uri (llvm-download-uri "llvm" version))
96 "16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880"))))
97 (build-system cmake-build-system)
99 `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
102 `(("libffi" ,libffi)))
104 `(("zlib" ,zlib))) ;to use output from llvm-config
106 `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
107 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
108 "-DBUILD_SHARED_LIBS:BOOL=TRUE"
109 "-DLLVM_ENABLE_FFI:BOOL=TRUE"
110 "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
111 "-DLLVM_INSTALL_UTILS=ON") ; Needed for rustc.
113 ;; Don't use '-g' during the build, to save space.
114 #:build-type "Release"
115 #:phases (modify-phases %standard-phases
116 (add-before 'build 'shared-lib-workaround
117 ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
118 ;; doesn't seem to get the correct rpath to be able to run
119 ;; from the build directory. Set LD_LIBRARY_PATH as a
122 (setenv "LD_LIBRARY_PATH"
123 (string-append (getcwd) "/lib"))
125 (home-page "https://www.llvm.org")
126 (synopsis "Optimizing compiler infrastructure")
128 "LLVM is a compiler infrastructure designed for compile-time, link-time,
129 runtime, and idle-time optimization of programs from arbitrary programming
130 languages. It currently supports compilation of C and C++ programs, using
131 front-ends derived from GCC 4.0.1. A new front-end for the C family of
132 languages is in development. The compiler infrastructure includes mirror sets
133 of programming tools as well as libraries with equivalent functionality.")
134 (license license:asl2.0))) ;with LLVM exceptions, see LICENSE.txt
136 (define* (clang-runtime-from-llvm llvm hash
137 #:optional (patches '()))
139 (name "clang-runtime")
140 (version (package-version llvm))
144 (uri (llvm-download-uri "compiler-rt" version))
145 (sha256 (base32 hash))
146 (patches (map search-patch patches))))
147 (build-system cmake-build-system)
148 (native-inputs (package-native-inputs llvm))
152 `(;; Don't use '-g' during the build to save space.
153 #:build-type "Release"
154 #:tests? #f)) ; Tests require gtest
155 (home-page "https://compiler-rt.llvm.org")
156 (synopsis "Runtime library for Clang/LLVM")
158 "The \"clang-runtime\" library provides the implementations of run-time
159 functions for C and C++ programs. It also provides header files that allow C
160 and C++ source code to interface with the \"sanitization\" passes of the clang
161 compiler. In LLVM this library is called \"compiler-rt\".")
162 (license (package-license llvm))
164 ;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
165 (supported-systems (delete "mips64el-linux" %supported-systems))))
167 (define* (clang-from-llvm llvm clang-runtime hash
171 (version (package-version llvm))
175 (uri (llvm-download-uri (if (version>=? version "9.0.1")
179 (sha256 (base32 hash))
180 (patches (map search-patch patches))))
181 ;; Using cmake allows us to treat llvm as an external library. There
182 ;; doesn't seem to be any way to do this with clang's autotools-based
184 (build-system cmake-build-system)
185 (native-inputs (package-native-inputs llvm))
187 `(("libxml2" ,libxml2)
188 ("gcc-lib" ,gcc "lib")
189 ,@(package-inputs llvm)))
192 ("clang-runtime" ,clang-runtime)))
195 (list "-DCLANG_INCLUDE_TESTS=True"
197 ;; Find libgcc_s, crtbegin.o, and crtend.o.
198 (string-append "-DGCC_INSTALL_PREFIX="
199 (assoc-ref %build-inputs "gcc-lib"))
201 ;; Use a sane default include directory.
202 (string-append "-DC_INCLUDE_DIRS="
203 (assoc-ref %build-inputs "libc")
206 ;; Don't use '-g' during the build to save space.
207 #:build-type "Release"
209 #:phases (modify-phases %standard-phases
211 'unpack 'set-glibc-file-names
212 (lambda* (#:key inputs #:allow-other-keys)
213 (let ((libc (assoc-ref inputs "libc"))
214 (compiler-rt (assoc-ref inputs "clang-runtime"))
215 (gcc (assoc-ref inputs "gcc"))
218 ,(version-major (package-version clang-runtime)))))
221 ;; Link to libclang_rt files from clang-runtime.
222 (substitute* "lib/Driver/ToolChain.cpp"
223 (("getDriver\\(\\)\\.ResourceDir")
224 (string-append "\"" compiler-rt "\"")))
226 ;; Make "LibDir" refer to <glibc>/lib so that it
227 ;; uses the right dynamic linker file name.
228 (substitute* "lib/Driver/ToolChains/Linux.cpp"
229 (("(^[[:blank:]]+LibDir = ).*" _ declaration)
230 (string-append declaration "\"" libc "/lib\";\n"))
232 ;; Make clang look for libstdc++ in the right
234 (("LibStdCXXIncludePathCandidates\\[\\] = \\{")
236 "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\","))
238 ;; Make sure libc's libdir is on the search path, to
239 ;; allow crt1.o & co. to be found.
241 (string-append libc "/lib"))))
243 (substitute* "lib/Driver/Tools.cpp"
244 ;; Patch the 'getLinuxDynamicLinker' function so that
245 ;; it uses the right dynamic linker file name.
246 (("/lib64/ld-linux-x86-64.so.2")
248 ,(glibc-dynamic-linker))))
250 ;; Link to libclang_rt files from clang-runtime.
251 ;; This substitution needed slight adjustment in 3.8.
252 (if (< 3.8 (string->number ,(version-major+minor
255 (substitute* "lib/Driver/Tools.cpp"
256 (("TC\\.getDriver\\(\\)\\.ResourceDir")
257 (string-append "\"" compiler-rt "\"")))
258 (substitute* "lib/Driver/ToolChain.cpp"
259 (("getDriver\\(\\)\\.ResourceDir")
260 (string-append "\"" compiler-rt "\""))))
262 ;; Make sure libc's libdir is on the search path, to
263 ;; allow crt1.o & co. to be found.
264 (substitute* "lib/Driver/ToolChains.cpp"
266 (string-append libc "/lib")))))
268 (add-after 'install 'install-clean-up-/share/clang
269 (lambda* (#:key outputs #:allow-other-keys)
270 (let* ((out (assoc-ref outputs "out"))
271 (compl-dir (string-append
272 out "/etc/bash_completion.d")))
273 (with-directory-excursion (string-append out
277 (when (file-exists? file)
279 ;; Delete extensions for proprietary text editors.
280 '("clang-format-bbedit.applescript"
281 "clang-format-sublime.py"
282 ;; Delete Emacs extensions: see their respective Emacs
283 ;; Guix package instead.
284 "clang-rename.el" "clang-format.el"))
285 ;; Install bash completion.
286 (when (file-exists? "bash-autocomplete.sh")
288 (rename-file "bash-autocomplete.sh"
289 (string-append compl-dir "/clang")))))
292 ;; Clang supports the same environment variables as GCC.
294 (list (search-path-specification
296 (files '("include")))
297 (search-path-specification
298 (variable "LIBRARY_PATH")
299 (files '("lib" "lib64")))))
301 (home-page "https://clang.llvm.org")
302 (synopsis "C language family frontend for LLVM")
304 "Clang is a compiler front end for the C, C++, Objective-C and
305 Objective-C++ programming languages. It uses LLVM as its back end. The Clang
306 project includes the Clang front end, the Clang static analyzer, and several
307 code analysis tools.")
308 (license (if (version>=? version "9.0")
309 license:asl2.0 ;with LLVM exceptions
312 (define (make-clang-toolchain clang)
314 (name (string-append (package-name clang) "-toolchain"))
315 (version (package-version clang))
317 (build-system trivial-build-system)
319 '(#:modules ((guix build union))
321 (use-modules (ice-9 match)
325 (let ((out (assoc-ref %outputs "out")))
328 (((names . directories) ...)
329 (union-build out directories)))
331 (union-build (assoc-ref %outputs "debug")
332 (list (assoc-ref %build-inputs
334 (union-build (assoc-ref %outputs "static")
335 (list (assoc-ref %build-inputs
339 (native-search-paths (package-native-search-paths clang))
340 (search-paths (package-search-paths clang))
342 (license (package-license clang))
343 (home-page "https://clang.llvm.org")
344 (synopsis "Complete Clang toolchain for C/C++ development")
345 (description "This package provides a complete Clang toolchain for C/C++
346 development to be installed in user profiles. This includes Clang, as well as
347 libc (headers and binaries, plus debugging symbols in the @code{debug}
348 output), and Binutils.")
349 (outputs '("out" "debug" "static"))
350 (inputs `(("clang" ,clang)
351 ("ld-wrapper" ,(car (assoc-ref (%final-inputs) "ld-wrapper")))
352 ("binutils" ,binutils)
354 ("libc-debug" ,glibc "debug")
355 ("libc-static" ,glibc "static")))))
357 (define-public clang-runtime
358 (clang-runtime-from-llvm
360 "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"))
363 (clang-from-llvm llvm clang-runtime
364 "0ls2h3iv4finqyflyhry21qhc9cm9ga7g1zq21020p065qmm2y2p"
365 #:patches '("clang-9.0-libc-search-path.patch")))
367 (define-public clang-toolchain
368 (make-clang-toolchain clang))
370 (define-public llvm-9 llvm)
371 (define-public clang-runtime-9 clang-runtime)
372 (define-public clang-9 clang)
373 (define-public clang-toolchain-9 clang-toolchain)
375 (define-public llvm-8
381 (uri (llvm-download-uri "llvm" version))
384 "0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
385 (license license:ncsa)))
387 (define-public clang-runtime-8
388 (clang-runtime-from-llvm
390 "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"))
392 (define-public clang-8
393 (clang-from-llvm llvm-8 clang-runtime-8
394 "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
395 #:patches '("clang-7.0-libc-search-path.patch")))
397 (define-public clang-toolchain-8
398 (make-clang-toolchain clang-8))
400 (define-public llvm-7
406 (uri (llvm-download-uri "llvm" version))
409 "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"))))))
411 (define-public clang-runtime-7
412 (clang-runtime-from-llvm
414 "065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq"))
416 (define-public clang-7
417 (clang-from-llvm llvm-7 clang-runtime-7
418 "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"
419 #:patches '("clang-7.0-libc-search-path.patch")))
421 (define-public clang-toolchain-7
422 (make-clang-toolchain clang-7))
424 (define-public llvm-6
430 (uri (llvm-download-uri "llvm" version))
433 "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
435 (define-public clang-runtime-6
436 (clang-runtime-from-llvm
438 "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"))
440 (define-public clang-6
441 (clang-from-llvm llvm-6 clang-runtime-6
442 "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
443 #:patches '("clang-6.0-libc-search-path.patch")))
445 (define-public clang-toolchain-6
446 (make-clang-toolchain clang-6))
448 (define-public llvm-3.9.1
449 (package (inherit llvm-6)
455 (uri (llvm-download-uri "llvm" version))
458 "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))))
460 (define-public clang-runtime-3.9.1
461 (clang-runtime-from-llvm
463 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
464 '("clang-runtime-asan-build-fixes.patch"
465 "clang-runtime-esan-build-fixes.patch"
466 "clang-3.5-libsanitizer-ustat-fix.patch")))
468 (define-public clang-3.9.1
469 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
470 "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
471 #:patches '("clang-3.8-libc-search-path.patch")))
473 (define-public llvm-3.8
474 (package (inherit llvm-3.9.1)
480 (uri (llvm-download-uri "llvm" version))
483 "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
485 (define-public clang-runtime-3.8
486 (clang-runtime-from-llvm
488 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
489 '("clang-runtime-asan-build-fixes.patch"
490 "clang-3.5-libsanitizer-ustat-fix.patch")))
492 (define-public clang-3.8
493 (clang-from-llvm llvm-3.8 clang-runtime-3.8
494 "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
495 #:patches '("clang-3.8-libc-search-path.patch")))
497 (define-public llvm-3.7
498 (package (inherit llvm-3.8)
503 (uri (llvm-download-uri "llvm" version))
506 "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
508 (define-public clang-runtime-3.7
509 (clang-runtime-from-llvm
511 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
512 '("clang-runtime-asan-build-fixes.patch"
513 "clang-3.5-libsanitizer-ustat-fix.patch")))
515 (define-public clang-3.7
516 (clang-from-llvm llvm-3.7 clang-runtime-3.7
517 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
518 #:patches '("clang-3.5-libc-search-path.patch")))
520 (define-public llvm-3.6
521 (package (inherit llvm-3.7)
526 (uri (llvm-download-uri "llvm" version))
529 "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
531 (define-public clang-runtime-3.6
532 (clang-runtime-from-llvm
534 "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
535 '("clang-runtime-asan-build-fixes.patch")))
537 (define-public clang-3.6
538 (clang-from-llvm llvm-3.6 clang-runtime-3.6
539 "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
540 #:patches '("clang-3.5-libc-search-path.patch")))
542 (define-public llvm-3.5
543 (package (inherit llvm-3.6)
548 (uri (llvm-download-uri "llvm" version))
550 (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
553 "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
555 (define-public clang-runtime-3.5
556 (clang-runtime-from-llvm
558 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
559 '("clang-runtime-asan-build-fixes.patch"
560 "clang-3.5-libsanitizer-ustat-fix.patch")))
562 (define-public clang-3.5
563 (clang-from-llvm llvm-3.5 clang-runtime-3.5
564 "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
565 #:patches '("clang-3.5-libc-search-path.patch")))
567 (define-public llvm-for-extempore
568 (package (inherit llvm-3.7)
569 (name "llvm-for-extempore")
572 (inherit (package-source llvm-3.7))
573 (patches (list (search-patch "llvm-for-extempore.patch")))))
574 ;; Extempore refuses to build on architectures other than x86_64
575 (supported-systems '("x86_64-linux"))))
577 (define-public libcxx
584 (uri (llvm-download-uri "libcxx" version))
587 "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
588 (build-system cmake-build-system)
592 (home-page "https://libcxx.llvm.org")
593 (synopsis "C++ standard library")
595 "This package provides an implementation of the C++ standard library for
596 use with Clang, targeting C++11, C++14 and above.")
597 (license license:expat)))
599 ;; Libcxx files specifically used by PySide2.
600 (define-public libcxx-6
603 (version (package-version llvm-6))
606 (inherit (package-source libcxx))
607 (uri (llvm-download-uri "libcxx" version))
610 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
615 (define-public libclc
623 (url "https://github.com/llvm/llvm-project.git")
624 (commit (string-append "llvmorg-" version))))
625 (file-name (git-file-name name version))
628 "1d1qayvrvvc1di7s7jfxnjvxq2az4lwq1sw1b2gq2ic0nksvajz0"))))
629 (build-system cmake-build-system)
632 (list (string-append "-DLLVM_CLANG="
633 (assoc-ref %build-inputs "clang")
635 (string-append "-DPYTHON="
636 (assoc-ref %build-inputs "python")
639 (modify-phases %standard-phases
640 (add-after 'unpack 'chdir
641 (lambda _ (chdir "libclc") #t)))))
646 (home-page "https://libclc.llvm.org")
647 (synopsis "Libraries for the OpenCL programming language")
649 "This package provides an implementation of the OpenCL library
650 requirements according to version 1.1 of the OpenCL specification.")
651 ;; Apache license 2.0 with LLVM exception
652 (license license:asl2.0)))
654 (define-public libomp
660 (uri (llvm-download-uri "openmp" version))
663 "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"))
664 (file-name (string-append "libomp-" version ".tar.xz"))))
665 (build-system cmake-build-system)
666 ;; XXX: Note this gets built with GCC because building with Clang itself
667 ;; fails (missing <atomic>, even when libcxx is added as an input.)
669 '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
670 "-DOPENMP_TEST_C_COMPILER=clang"
671 "-DOPENMP_TEST_CXX_COMPILER=clang++")
672 #:test-target "check-libomp"))
677 ("pkg-config" ,pkg-config)))
679 `(("hwloc" ,hwloc "lib")))
680 (home-page "https://openmp.llvm.org")
681 (synopsis "OpenMP run-time support library")
683 "This package provides the run-time support library developed by the LLVM
684 project for the OpenMP multi-theaded programming extension. This package
685 notably provides @file{libgomp.so}, which is has a binary interface compatible
686 with that of libgomp, the GNU Offloading and Multi Processing Library.")
687 (license license:expat)))
689 (define-public python-llvmlite
691 (name "python-llvmlite")
696 (uri (pypi-uri "llvmlite" version))
699 "01wspdc0xhnydl66jyhyr4ii16h3fnw6mjihiwnnxdxg9j6kkajf"))))
700 (build-system python-build-system)
702 ;; FIXME: One test fails unable to find libm.so
703 ;; https://github.com/numba/llvmlite/issues/537
710 (inherit (package-source llvm-7))
715 (uri (string-append "https://raw.githubusercontent.com/numba/"
716 "llvmlite/v" version "/conda-recipes/"
717 "D47188-svml-VF.patch"))
720 "0wxhgb61k17f0zg2m0726sf3hppm41f8jar2kkg2n8sl5cnjj9mr")))
723 (uri (string-append "https://raw.githubusercontent.com/numba/"
724 "llvmlite/v" version "/conda-recipes/"
725 "twine_cfg_undefined_behavior.patch"))
728 "07h71n2m1mn9zcfgw04zglffknplb233zqbcd6pckq0wygkrxflp")))))))))))
729 (home-page "http://llvmlite.pydata.org")
730 (synopsis "Wrapper around basic LLVM functionality")
732 "This package provides a Python binding to LLVM for use in Numba.")
733 (license license:bsd-3)))
735 (define (package-elisp-from-package source-package package-name
737 "Return a package definition named PACKAGE-NAME that packages the Emacs Lisp
738 SOURCE-FILES found in SOURCE-PACKAGE."
739 (let ((orig (package-source source-package)))
741 (inherit source-package)
743 (build-system emacs-build-system)
745 (method (origin-method orig))
746 (uri (origin-uri orig))
747 (sha256 (origin-sha256 orig))
748 (file-name (string-append package-name "-"
749 (package-version source-package)))
750 (modules '((guix build utils)
754 `(let* ((source-files (quote ,source-files))
755 (basenames (map basename source-files)))
757 source-files basenames)
758 (map delete-file-recursively
761 (append '("." "..") basenames)))
764 (define-public emacs-clang-format
767 (name "emacs-clang-format")
768 (build-system emacs-build-system)
773 (modify-phases %standard-phases
774 (add-after 'unpack 'configure
775 (lambda* (#:key inputs #:allow-other-keys)
776 (let ((clang (assoc-ref inputs "clang")))
777 (copy-file "tools/clang-format/clang-format.el" "clang-format.el")
778 (emacs-substitute-variables "clang-format.el"
779 ("clang-format-executable"
780 (string-append clang "/bin/clang-format"))))
782 (synopsis "Format code using clang-format")
783 (description "This package allows to filter code through @code{clang-format}
784 to fix its formatting. @code{clang-format} is a tool that formats
785 C/C++/Obj-C code according to a set of style options, see
786 @url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
788 (define-public emacs-clang-rename
791 (name "emacs-clang-rename")
792 (build-system emacs-build-system)
797 (modify-phases %standard-phases
798 (add-after 'unpack 'configure
799 (lambda* (#:key inputs #:allow-other-keys)
800 (let ((clang (assoc-ref inputs "clang")))
801 (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
802 (emacs-substitute-variables "clang-rename.el"
803 ("clang-rename-binary"
804 (string-append clang "/bin/clang-rename"))))
806 (synopsis "Rename every occurrence of a symbol using clang-rename")
807 (description "This package renames every occurrence of a symbol at point
808 using @code{clang-rename}.")))