all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 39013@debbugs.gnu.org
Subject: [bug#39013] [PATCH] gnu: Add abseil-cpp.
Date: Fri, 10 Jan 2020 20:23:37 +0100	[thread overview]
Message-ID: <cbff052f1efb03e7c1b512e0211896cc80df2720.camel@gnu.org> (raw)
In-Reply-To: <87sgkos3eg.fsf@gnu.org>

On Thu, 2020-01-09 at 22:53 +0100, Ludovic Courtès wrote:
> Hi Roel,
> 
> Roel Janssen <roel@gnu.org> skribis:
> 
> > There are two not-so-perfect things with the patch:
> > 1. I had to use the latest Git commit because it adds bits to build
> > shared libraries.
> 
> Sounds good to me.
> 
> > 2. I disabled the tests because it attempts to download "googletest". 
> > I tried modifying the build system to use "googletest" from Guix but
> > that wasn't succesful.
> 
> There are packages such as ‘encfs’ where we simply unpack the source of
> our ‘googletest’ package in the right place.  Would what work here?


No.  Here's an inline version of the package, because I've had enough trouble
with Guix this week.


(define-public abseil-cpp
  ;; We use this commit because it contains changes to the build system to
  ;; allow building shared libraries.
  (let ((commit "a048203a881f11f4b7b8df5fb563aec85522f8db"))
    (package
      (name "abseil-cpp")
      (version (string-append "20190808-" (string-take commit 7)))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/abseil/abseil-cpp.git")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "13v3bkfyhrcl9am0jcz4cfbfc5rn3acm9z4wm01pn36vcgvw2l4s"))))
      (build-system cmake-build-system)
      (arguments
       `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON" "-DABSL_RUN_TESTS=ON")
         #:phases
         (modify-phases %standard-phases
           (add-before 'configure 'unpack-googletest
             (lambda* (#:key inputs #:allow-other-keys)
               ;; So, the CMake 'configure' phase expects the googletest-src
               ;; and googletest-build directories to be in the ../build
               ;; directory, but the Guix 'configure' phase creates the
               ;; directory using (mkdir "../build"), which errors out when
               ;; we have already created the build directory.
               ;;
               ;; The code below errors out, so if you have a solution for
               ;; this, that would be great.  Until that time I will simply
               ;; postpone working on upgrading the TensorFlow package in
               ;; the upstream repository of Guix.
               (mkdir-p "../build")
               (with-directory-excursion "../build"
                 (format #t "We're in ~s~%" (getcwd))
                 (mkdir-p "googletest-src")
                 (mkdir-p "googletest-build")
                 (copy-recursively
                  (assoc-ref inputs "googletest-source")
                  "googletest-src")
                 (copy-recursively
                  (assoc-ref inputs "googletest")
                  "googletest-build"))
                 #t))
           (replace 'check
           (lambda _
             (invoke "ctest"))))))
      (native-inputs
       `(("googletest-source" ,(package-source googletest))
         ("googletest" ,googletest)))
      (home-page "https://abseil.io")
      (synopsis "Augmented C++ standard library")
      (description "Abseil is a collection of C++ library code designed to
augment the C++ standard library.  The Abseil library code is collected from
Google's C++ code base.")
      (license license:asl2.0))))


Thanks,
Roel

  reply	other threads:[~2020-01-10 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 15:07 [bug#39013] [PATCH] gnu: Add abseil-cpp Roel Janssen
2020-01-09 21:53 ` Ludovic Courtès
2020-01-10 19:23   ` Roel Janssen [this message]
2020-01-15 20:53     ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=cbff052f1efb03e7c1b512e0211896cc80df2720.camel@gnu.org \
    --to=roel@gnu.org \
    --cc=39013@debbugs.gnu.org \
    --cc=ludo@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.