[bug#33308,1/2] gnu: mash: Update to 2.1.

Message ID 20181107195654.22832-1-mail@cbaines.net
State Accepted
Headers show
Series Update mosh and capnproto. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Christopher Baines Nov. 7, 2018, 7:56 p.m. UTC
I'm looking to upgrade capnproto, and mash fails to build with 0.7. Therefore,
update it, and tweak the compilation to allow it to build with 0.7. The
package also builds with the current version of capnproto. I got the idea of
changing the c++ version from here [1].

1: https://github.com/marbl/Mash/issues/98

* gnu/packages/bioinformatics.scm (mash)[version]: Change to 2.1.
[source]: Update sha256 hash.
[arguments]: Add new use-c++14 phase, to patch source to build using c++14.
---
 gnu/packages/bioinformatics.scm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comments

Eric Bavier Nov. 8, 2018, 3:23 a.m. UTC | #1
On Wed,  7 Nov 2018 19:56:53 +0000
Christopher Baines <mail@cbaines.net> wrote:


> * gnu/packages/bioinformatics.scm (mash)[version]: Change to 2.1.
> [source]: Update sha256 hash.

I think here we typically just say "(mash)[source]: Upgrade to 2.1."

> [arguments]: Add new use-c++14 phase, to patch source to build using c++14.
> ---
>  gnu/packages/bioinformatics.scm | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 9f0b8025da..93503d82b8 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -4012,7 +4012,15 @@ sequences).")
>                 (("^#include \"kseq\\.h\"")
>                  "#include \"htslib/kseq.h\""))
>               #t))
> -         (add-after 'fix-includes 'autoconf
> +         (add-after 'fix-includes 'use-c++14
> +           (lambda _
> +             ;; capnproto 0.7 requires c++14 to build
> +             (substitute* "configure.ac"
> +               (("c\\+\\+11") "c++14"))
> +             (substitute* "Makefile.in"
> +               (("c\\+\\+11") "c++14"))

I believe the configure.ac patch is sufficient for us here, since the
compile steps will pick up the CPPFLAGS set there.  Too bad the
configure.ac is written so poorly... :(  one should be able to just
pass "CPPFLAGS=-std=c++14" to `make`.

> +             #t))
> +         (add-after 'use-c++14 'autoconf
>             (lambda _ (zero? (system* "autoconf")))))))

Maybe you could also update this step to use 'invoke'.

Thanks,
`~Eric
Christopher Baines Nov. 26, 2018, 7:35 p.m. UTC | #2
Eric Bavier <ericbavier@centurylink.net> writes:

> On Wed,  7 Nov 2018 19:56:53 +0000
> Christopher Baines <mail@cbaines.net> wrote:
>
>
>> * gnu/packages/bioinformatics.scm (mash)[version]: Change to 2.1.
>> [source]: Update sha256 hash.
>
> I think here we typically just say "(mash)[source]: Upgrade to 2.1."

Ok, I've sent a new set of patches now, and updated the commit messages.

>> [arguments]: Add new use-c++14 phase, to patch source to build using c++14.
>> ---
>>  gnu/packages/bioinformatics.scm | 14 +++++++++++---
>>  1 file changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
>> index 9f0b8025da..93503d82b8 100644
>> --- a/gnu/packages/bioinformatics.scm
>> +++ b/gnu/packages/bioinformatics.scm
>> @@ -4012,7 +4012,15 @@ sequences).")
>>                 (("^#include \"kseq\\.h\"")
>>                  "#include \"htslib/kseq.h\""))
>>               #t))
>> -         (add-after 'fix-includes 'autoconf
>> +         (add-after 'fix-includes 'use-c++14
>> +           (lambda _
>> +             ;; capnproto 0.7 requires c++14 to build
>> +             (substitute* "configure.ac"
>> +               (("c\\+\\+11") "c++14"))
>> +             (substitute* "Makefile.in"
>> +               (("c\\+\\+11") "c++14"))
>
> I believe the configure.ac patch is sufficient for us here, since the
> compile steps will pick up the CPPFLAGS set there.  Too bad the
> configure.ac is written so poorly... :(  one should be able to just
> pass "CPPFLAGS=-std=c++14" to `make`.

I tried removing the Makefile.in change, but it didn't work for some
reason.

>> +             #t))
>> +         (add-after 'use-c++14 'autoconf
>>             (lambda _ (zero? (system* "autoconf")))))))
>
> Maybe you could also update this step to use 'invoke'.

This patch has now turned in to just fixing the package for the newer
version of capnproto, as Ricardo did the upgrade a few weeks ago. This
particular stage was removed in
e35dce017090685d07aedf10c9899c0cdcc70d9e.

Thanks for your comments Eric :)

Patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 9f0b8025da..93503d82b8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3977,7 +3977,7 @@  sequences).")
 (define-public mash
   (package
     (name "mash")
-    (version "2.0")
+    (version "2.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -3986,7 +3986,7 @@  sequences).")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "00fx14vpmgsijwxd1xql3if934l82v8ckqgjjyyhnr36qb9qrskv"))
+                "0d5m9wx1bspa5vwikazdbar4i0h6b20lzjjl1icfyl66sy1q9v9q"))
               (modules '((guix build utils)))
               (snippet
                '(begin
@@ -4012,7 +4012,15 @@  sequences).")
                (("^#include \"kseq\\.h\"")
                 "#include \"htslib/kseq.h\""))
              #t))
-         (add-after 'fix-includes 'autoconf
+         (add-after 'fix-includes 'use-c++14
+           (lambda _
+             ;; capnproto 0.7 requires c++14 to build
+             (substitute* "configure.ac"
+               (("c\\+\\+11") "c++14"))
+             (substitute* "Makefile.in"
+               (("c\\+\\+11") "c++14"))
+             #t))
+         (add-after 'use-c++14 'autoconf
            (lambda _ (zero? (system* "autoconf")))))))
     (native-inputs
      `(("autoconf" ,autoconf)