unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: fis trivial <ybbs.daans@hotmail.com>
To: Brett Gilio <brettg@posteo.net>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: clang-tidy
Date: Fri, 21 Dec 2018 04:48:56 +0000	[thread overview]
Message-ID: <BLUPR16MB050064A7DA2449BFF021CA4D92B80@BLUPR16MB0500.namprd16.prod.outlook.com> (raw)
In-Reply-To: <87h8f7k1gn.fsf@posteo.net>

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
  (package
    (name "clang")
    (version (package-version llvm))
    (source
     (origin (method url-fetch)
	     (uri (string-append "http://releases.llvm.org/"
				 version "/cfe-" version ".src.tar.xz"))
	     (sha256
	      (base32
	       "0mdsbgj3p7mayhzm8hclzl3i46r2lwa8fr1cz399f9km3iqi40jm"))
	     (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))
    (inputs
     `(("libxml2" ,libxml2)
       ("gcc-lib" ,gcc "lib")
       ("gcc" ,gcc)
       ("clang-extra-tools"
	,(origin
           (method url-fetch)
           (uri
	    (string-append "http://releases.llvm.org/"
			   version "/clang-tools-extra-"
			   version ".src.tar.xz"))
           (file-name (string-append "clang-extra-tools-" version ".tar.xz"))
           (sha256
            (base32 "1glxl7bnr4k3j16s8xy8r9cl0llyg524f50591g1ig23ij65lz4k"))))
       ("linux-libre-headers" ,linux-libre-headers)
       ,@(package-inputs llvm)))
    (propagated-inputs
     `(("llvm" ,llvm)
       ("clang-runtime" ,clang-runtime)))
    (arguments
     `(#:configure-flags
       (list
	"-DCLANG_INCLUDE_TESTS=True"
	"-DCLANG_DEFAULT_CXX_STDLIB=libstdc++"
	"-DCLANG_DEFAULT_RTLIB=libgcc"
        ;; Find libgcc_s, crtbegin.o, and crtend.o.
        (string-append
	 "-DGCC_INSTALL_PREFIX="
         (assoc-ref %build-inputs "gcc-lib"))
        ;; Use a sane default include directory.
        (string-append
	 "-DC_INCLUDE_DIRS="
         (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) "/include/"))
       ;; Don't use '-g' during the build to save space.
       #:build-type "Release"
       #:phases
       (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/"
		 (rename-file
		  (string-append "clang-tools-extra-" ,version ".src")
		  "extra"))
	       #t)))
         (add-after
	     'unpack 'set-glibc-file-names
           (lambda* (#:key inputs #:allow-other-keys)
	     (let ((compiler-rt (assoc-ref inputs "clang-runtime")))
	       (substitute* "lib/Driver/ToolChain.cpp"
                 (("getDriver\\(\\)\\.ResourceDir")
		  (string-append "\"" compiler-rt "\"")))
	       #t))))))
    ;; Clang supports the same environment variables as GCC.
    (native-search-paths
     (list (search-path-specification
            (variable "CPATH")
            (files '("include")))
           (search-path-specification
            (variable "LIBRARY_PATH")
            (files '("lib" "lib64")))))
    (home-page "https://clang.llvm.org")
    (synopsis "C language family frontend for LLVM")
    (description
     "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


--
Jiaming

  reply	other threads:[~2018-12-21  4:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21  3:23 clang-tidy Brett Gilio
2018-12-21  4:48 ` fis trivial [this message]
2018-12-21  4:53   ` clang-tidy fis trivial

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLUPR16MB050064A7DA2449BFF021CA4D92B80@BLUPR16MB0500.namprd16.prod.outlook.com \
    --to=ybbs.daans@hotmail.com \
    --cc=brettg@posteo.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).