From mboxrd@z Thu Jan 1 00:00:00 1970 From: fis trivial Subject: Re: clang-tidy Date: Fri, 21 Dec 2018 04:53:48 +0000 Message-ID: References: <87h8f7k1gn.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaCot-0003ly-UD for guix-devel@gnu.org; Thu, 20 Dec 2018 23:53:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaCoq-0003kg-NM for guix-devel@gnu.org; Thu, 20 Dec 2018 23:53:55 -0500 Received: from mail-oln040092005090.outbound.protection.outlook.com ([40.92.5.90]:62063 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaCoo-0003er-Sn for guix-devel@gnu.org; Thu, 20 Dec 2018 23:53:52 -0500 In-Reply-To: Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Brett Gilio Cc: Guix-devel Please ignore the patches field though. Trivial Fis writes: > Hi Brett, > > Clang-tidy comes from clang-extra-tools, which is not bundled in guix pac= kage. > 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 c= lang > extra tools, anyone interested in packaging LLVM-7 for and friends for GU= IX 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.x= z")) > (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=3DTrue" > "-DCLANG_DEFAULT_CXX_STDLIB=3Dlibstdc++" > "-DCLANG_DEFAULT_RTLIB=3Dlibgcc" > ;; Find libgcc_s, crtbegin.o, and crtend.o. > (string-append > "-DGCC_INSTALL_PREFIX=3D" > (assoc-ref %build-inputs "gcc-lib")) > ;; Use a sane default include directory. > (string-append > "-DC_INCLUDE_DIRS=3D" > (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 seve= ral > 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 insta= llation. >> >> Best, >> Brett Gilio --=20 Jiaming