guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: Add cloc.


From: Andy Wingo
Subject: 01/01: gnu: Add cloc.
Date: Fri, 11 Aug 2017 04:38:57 -0400 (EDT)

wingo pushed a commit to branch master
in repository guix.

commit f7fc9667b2b07f904f0683e06b0bd4c33ed9082a
Author: Andy Wingo <address@hidden>
Date:   Fri Aug 11 10:22:07 2017 +0200

    gnu: Add cloc.
    
    * gnu/packages/code.scm (cloc): New public variable.
---
 gnu/packages/code.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index 6f25b7c..fa9e19d 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Efraim Flashner <address@hidden>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2017 Clément Lassieur <address@hidden>
+;;; Copyright © 2017 Andy Wingo <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -189,6 +190,60 @@ effort, time, and money it would take to develop the 
software, using the
 COCOMO model or user-provided parameters.")
     (license license:gpl2+)))
 
+(define-public cloc
+  (package
+    (name "cloc")
+    (version "1.72")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/AlDanial/cloc/releases/download/v"; version
+             "/cloc-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1gl7bxb4bi6pms0zzl133pzpfypvz57hk2cw7yf6rvs8b48kilnz"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("coreutils" ,coreutils)
+       ("perl" ,perl)
+       ("perl-algorithm-diff" ,perl-algorithm-diff)
+       ("perl-regexp-common" ,perl-regexp-common)
+       ("perl-digest-md5" ,perl-digest-md5)))
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (delete 'build)
+                  (replace 'install
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out")))
+                        (zero?
+                         (system* "make" "-C" "Unix"
+                                  (string-append "prefix=" out)
+                                  (string-append "INSTALL="
+                                                 (assoc-ref inputs "coreutils")
+                                                 "/bin/install")
+                                  "install")))))
+                  (add-after 'install 'wrap-program
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (wrap-program (string-append out "/bin/cloc")
+                          `("PERL5LIB" ":" =
+                            ,(string-split (getenv "PERL5LIB") #\:)))
+                        #t))))
+       #:out-of-source? #t
+       ;; Tests require some other packages.
+       #:tests? #f))
+    (home-page "https://github.com/AlDanial/cloc";)
+    (synopsis "Count source lines of code (SLOC) and other source code 
metrics")
+    (description "cloc counts blank lines, comment lines, and physical lines
+of source code in many programming languages.  Given two versions of a code
+base, cloc can compute differences in blank, comment, and source lines.
+
+cloc contains code from David Wheeler's SLOCCount.  Compared to SLOCCount,
+cloc can handle a greater variety of programming langauges.")
+    (license license:gpl2+)))
+
 (define-public the-silver-searcher
   (package
     (name "the-silver-searcher")



reply via email to

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