From 76e146384c3465beb5cdbfad05c31bd79808a668 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 25 May 2015 22:13:27 +0200 Subject: [PATCH] gnu: Add withershins. * gnu/packages/code.scm (withershins): New variable. --- gnu/packages/code.scm | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index 9d2bde829d..97261d6c79 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Ludovic Courtès ;;; Copyright © 2015 Andreas Enge +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,9 +23,12 @@ #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages emacs) + #:use-module (gnu packages gcc) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) #:use-module (gnu packages perl) @@ -225,3 +229,63 @@ COCOMO model or user-provided parameters.") files, but compared to grep is much faster and respects files like .gitignore, .hgignore, etc.") (license license:asl2.0))) + +(define-public withershins + (package + (name "withershins") + (version "0.1") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/cameronwhite/withershins/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #f + #:modules ((guix build utils) + (guix build cmake-build-system) + (ice-9 popen) + (ice-9 rdelim)) + #:phases + (modify-phases %standard-phases + (add-after + 'unpack 'find-libiberty + (lambda _ + (let ((plugin (let* ((port (open-input-pipe + "gcc -print-file-name=plugin")) + (str (read-line port))) + (close-pipe port) + str))) + (substitute* "cmake/FindIberty.cmake" + (("/usr/include") (string-append plugin "/include")) + (("libiberty.a iberty") (string-append "NAMES libiberty.a iberty\nPATHS \"" + (assoc-ref %build-inputs "gcc") + "/lib" "\""))) + #t))) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/lib")) + (mkdir (string-append out "/include")) + (copy-file "src/withershins.hpp" + (string-append out "/include/withershins.hpp")) + (copy-file "src/libwithershins.a" + (string-append out "/lib/libwithershins.a"))) + #t))))) + (home-page "https://github.com/cameronwhite/withershins") + (inputs + `(("gcc" ,gcc-4.8 "lib") ;for libiberty.a + ("binutils" ,binutils) ;for libbfd + ("zlib" ,zlib))) + (synopsis "C++11 library for generating stack traces") + (description + "Withershins is a simple cross-platform C++11 library for generating +stack traces.") + ;; Sources are released under Expat license, but since BFD is licensed + ;; under the GPLv3+ the combined work is GPLv3+ as well. + (license license:gpl3+)))