summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorLiam Hupfer <liam@hpfr.net>2025-06-21 12:52:31 -0500
committerSteve George <steve@futurile.net>2025-10-13 14:21:45 +0100
commit7b43e2fb23520691207a2cf05224a64bc8ccb7e5 (patch)
tree18c4b5b85e1cfeaef733e3fa8a851bbcf89a831a /gnu/packages/llvm.scm
parentdd39c1df1de942be1c1b529d994b7b46376a9ac0 (diff)
gnu: Add include-what-you-use.
* gnu/packages/llvm.scm (include-what-you-use): New variable. Change-Id: Ie843e69eaf4fad6191363d16d46321f623c07670 Signed-off-by: Steve George <steve@futurile.net>
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 51e65120540..03c3c47e9ec 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -29,6 +29,7 @@
;;; Copyright © 2023-2025 Zheng Junjie <z572@z572.online>
;;; Copyright © 2024, 2025 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2025 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2025 Liam Hupfer <liam@hpfr.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1734,6 +1735,37 @@ setup(name=\"clang\", version=\"~a\", packages=[\"clang\"])\n"
(define-public python-clang-13
(clang-python-bindings clang-13))
+(define-public include-what-you-use
+ (package
+ (name "include-what-you-use")
+ ;; Ensure LLVM/Clang input versions match the version declared in the release
+ ;; https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#clang-compatibility
+ (version "0.24")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/include-what-you-use/include-what-you-use")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0dkk65y6abf7bzv10q1ch3dyzj4d5y89qhh43jn189l861d6pzs0"))))
+ (build-system cmake-build-system)
+ (inputs (list llvm-20 clang-20 python-3))
+ (synopsis
+ "Tool for use with clang to analyze #includes in C and C++ source files")
+ (home-page "https://github.com/include-what-you-use/include-what-you-use")
+ (description
+ "@code{include-what-you-use} lints C and C++ sources to ensure
+@code{#include}s declaring every symbol used in a given file are present.
+When every file directly includes what it uses rather than relying on
+transitive inclusions, builds tend to be more efficient and refactoring
+dependency relationships is easier, particularly for large projects.")
+ ;; The project has not relicensed from the old LLVM license:
+ ;; https://github.com/include-what-you-use/include-what-you-use/issues/849
+ ;; The iwyu_getopt.* files are BSD-3.
+ (license (list license:ncsa license:bsd-3))))
+
(define-public emacs-clang-format
(package
(inherit clang)