[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang-tidy

From: fis trivial
Subject: Re: clang-tidy
Date: Fri, 21 Dec 2018 04:48:56 +0000

Hi Brett,

Clang-tidy comes from clang-extra-tools, which is not bundled in guix package.
I have my own clang packaging based on clang-7.  But I don't have time to test
upgrading LLVM on core-update.  Here is my clang package which includes clang
extra tools, anyone interested in packaging LLVM-7 for and friends for GUIX can
copy it without any constrain:

(define-public clang
    (name "clang")
    (version (package-version llvm))
     (origin (method url-fetch)
             (uri (string-append "";
                                 version "/cfe-" version ".src.tar.xz"))
             (patches (search-patches "clang-add-CUDA-path-params.patch"))
             (file-name (string-append name "-" version ".tar.gz"))))
    (build-system cmake-build-system)
    (native-inputs (package-native-inputs llvm))
     `(("libxml2" ,libxml2)
       ("gcc-lib" ,gcc "lib")
       ("gcc" ,gcc)
           (method url-fetch)
            (string-append "";
                           version "/clang-tools-extra-"
                           version ".src.tar.xz"))
           (file-name (string-append "clang-extra-tools-" version ".tar.xz"))
            (base32 "1glxl7bnr4k3j16s8xy8r9cl0llyg524f50591g1ig23ij65lz4k"))))
       ("linux-libre-headers" ,linux-libre-headers)
       ,@(package-inputs llvm)))
     `(("llvm" ,llvm)
       ("clang-runtime" ,clang-runtime)))
        ;; Find libgcc_s, crtbegin.o, and crtend.o.
         (assoc-ref %build-inputs "gcc-lib"))
        ;; Use a sane default include directory.
         (assoc-ref %build-inputs "libc")
         "/include" ":"
         (assoc-ref %build-inputs "gcc")
         "/include/c++" ":"
         (assoc-ref %build-inputs "gcc")
         "/include/c++/x86_64-unknown-linux-gnu/" ":"
         (assoc-ref %build-inputs "linux-libre-headers")
         "/include" ":"
         (assoc-ref %build-inputs "gcc-lib") ; openmp
         "/lib/gcc/x86_64-unknown-linux-gnu/" ,(package-version gcc) 
       ;; Don't use '-g' during the build to save space.
       #:build-type "Release"
       (modify-phases %standard-phases
         (add-after 'unpack 'unpack-extra-tools
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((untar
                    (lambda (tarball output)
                      (with-directory-excursion output
                        (invoke "tar" "-xvf" (assoc-ref inputs tarball))))))
               (untar "clang-extra-tools" "tools/")
               (with-directory-excursion "tools/"
                  (string-append "clang-tools-extra-" ,version ".src")
             'unpack 'set-glibc-file-names
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((compiler-rt (assoc-ref inputs "clang-runtime")))
               (substitute* "lib/Driver/ToolChain.cpp"
                  (string-append "\"" compiler-rt "\"")))
    ;; Clang supports the same environment variables as GCC.
     (list (search-path-specification
            (variable "CPATH")
            (files '("include")))
            (variable "LIBRARY_PATH")
            (files '("lib" "lib64")))))
    (home-page "";)
    (synopsis "C language family frontend for LLVM")
     "Clang is a compiler front end for the C, C++, Objective-C and
Objective-C++ programming languages.  It uses LLVM as its back end.  The Clang
project includes the Clang front end, the Clang static analyzer, and several
code analysis tools.")
    (license license:ncsa)))

Brett Gilio writes:

> Hi all,
> Just curious, do we have clang-tidy packaged somewhere? I have clang
> installed and am not able to reference that binary in my exec path.
> As far as I understand, it should be included in the default clang 
> installation.
> Best,
> Brett Gilio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]