guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 7b43e2fb23520691207a2cf05224a64bc8ccb7e5
Author: Liam Hupfer <[email protected]>
AuthorDate: Sat Jun 21 12:52:31 2025 -0500

    gnu: Add include-what-you-use.
    
    * gnu/packages/llvm.scm (include-what-you-use): New variable.
    
    Change-Id: Ie843e69eaf4fad6191363d16d46321f623c07670
    Signed-off-by: Steve George <[email protected]>
---
 gnu/packages/llvm.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 51e6512054..03c3c47e9e 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2023-2025 Zheng Junjie <[email protected]>
 ;;; Copyright © 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
 ;;; Copyright © 2025 Andreas Enge <[email protected]>
+;;; Copyright © 2025 Liam Hupfer <[email protected]>
 ;;;
 ;;; 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)

Reply via email to