From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: [PATCH 14/14] gnu: Add c-reduce. Date: Sun, 7 Dec 2014 15:51:54 -0600 Message-ID: <1417989115-32107-15-git-send-email-bavier@member.fsf.org> References: <1417989115-32107-1-git-send-email-bavier@member.fsf.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxjjC-0002Rl-5P for guix-devel@gnu.org; Sun, 07 Dec 2014 16:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxjj5-0008S2-Sa for guix-devel@gnu.org; Sun, 07 Dec 2014 16:50:53 -0500 Received: from mail-ie0-x22e.google.com ([2607:f8b0:4001:c03::22e]:42066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxjj5-0008Rn-Lw for guix-devel@gnu.org; Sun, 07 Dec 2014 16:50:47 -0500 Received: by mail-ie0-f174.google.com with SMTP id rl12so3441997iec.5 for ; Sun, 07 Dec 2014 13:50:47 -0800 (PST) In-Reply-To: <1417989115-32107-1-git-send-email-bavier@member.fsf.org> 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Cc: Eric Bavier * gnu/packages/debug.scm (c-reduce): New variable. --- gnu/packages/debug.scm | 68 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index 578703d..78cba27 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -20,9 +20,15 @@ #:use-module (guix packages) #:use-module (guix licenses) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (gnu packages) - #:use-module (gnu packages perl)) + #:use-module (gnu packages bash) + #:use-module (gnu packages flex) + #:use-module (gnu packages indent) + #:use-module (gnu packages llvm) + #:use-module (gnu packages perl) + #:use-module (gnu packages pretty-print)) (define-public delta (package @@ -72,3 +78,63 @@ program to exhibit a bug.") ;; See License.txt, which is a bsd-3 license, despite the project's ;; home-page pointing to a bsd-2 license. (license bsd-3))) + +(define-public c-reduce + (package + (name "c-reduce") + (version "2.2.1") + (source + (origin + (method url-fetch) + (uri (list + (string-append "http://embed.cs.utah.edu/creduce/" + "creduce-" version ".tar.gz"))) + (sha256 + (base32 + "0wh0fkyg2l41d2wkndrgdiai9g2qiav7jik7cys21vmgzq01pyy2")) + (modules '((guix build utils))) + (snippet + '(substitute* "clang_delta/TransformationManager.cpp" + (("llvm/Config/config.h") "llvm/Config/llvm-config.h"))))) + (build-system gnu-build-system) + (inputs + `(("astyle" ,astyle) + ("delta" ,delta) + ("llvm" ,llvm) + ("clang" ,clang) + ("flex" ,flex) + ("indent" ,indent) + ("perl" ,perl) + ("benchmark-timer" ,perl-benchmark-timer) + ("exporter-lite" ,perl-exporter-lite) + ("file-which" ,perl-file-which) + ("getopt-tabular" ,perl-getopt-tabular) + ("regex-common" ,perl-regexp-common) + ("sys-cpu" ,perl-sys-cpu))) + (arguments + `(#:phases (alist-cons-after + 'install 'set-load-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Tell creduce where to find the perl modules it needs. + (let* ((out (assoc-ref outputs "out")) + (prog (string-append out "/bin/creduce"))) + (wrap-program + prog + `("PERL5LIB" ":" prefix + ,(map (lambda (p) + (string-append (assoc-ref inputs p) + "/lib/perl5/site_perl/" + ,(package-version perl))) + '("benchmark-timer" "exporter-lite" + "file-which" "getopt-tabular" + "regex-common" "sys-cpu")))))) + %standard-phases))) + (home-page "http://embed.cs.utah.edu/creduce") + (synopsis "Reducer for interesting code") + (description + "C-Reduce is a tool that takes a large C or C++ program that has a +property of interest (such as triggering a compiler bug) and automatically +produces a much smaller C/C++ program that has the same property. It is +intended for use by people who discover and report bugs in compilers and other +tools that process C/C++ code.") + (license ncsa))) -- 1.7.9.5