all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: Roel Janssen <roel@gnu.org>
Cc: Ricardo Wurmus <rekado@elephly.net>, 28802@debbugs.gnu.org
Subject: [bug#28802] [PATCH] gnu: Add paml.
Date: Fri, 13 Oct 2017 15:25:34 +0200	[thread overview]
Message-ID: <idjo9pbw569.fsf@bimsb-sys02.mdc-berlin.net> (raw)
In-Reply-To: <87bmlb4abu.fsf@gnu.org>


Hi Roel,

> I guess I'm too late already.  I had a similar patch, but the program
> uses the data files it ships with, and expects them to be in the same
> location.  So this patch seems incomplete to me.

Oh, that’s too bad.  Do you have a test case we could use to verify that
the tools work correctly after installation?

It doesn’t seem to be easy to fix this, as variables in which file names
are stored are size-restricted, and as they are copied around multiple
times it is difficult to ensure that our patch wouldn’t break things.

Here’s an untested draft of the new phases, but I suspect this would
take a lot more work:

--8<---------------cut here---------------start------------->8---
       (modify-phases %standard-phases
         (replace 'configure
           (lambda _
             (substitute* "src/BFdriver.c"
               (("/bin/bash") (which "bash")))
             (let ((share (string-append (assoc-ref outputs "out")
                                         "/share/paml/")))
               (substitute* ""
                 (("aaRatefile = dat/jones.dat"
                   (string-append "aaRatefile = "
                                  share "jones.dat"))))
               (substitute* '("src/yn00.c"
                              "src/baseml.c"
                              "src/basemlg.c"
                              "src/pamp.c"
                              "src/codeml.c"
                              "src/mcmctree.c"
                              "src/BFdriver.c")
                 (("ctlf\\[...?\\] ?= ?\"(yn00|pamp|baseml|codeml|mcmctree).ctl\"" _ file)
                  (string-append "ctlf[PATH_MAX]=\""
                                 share file ".ctl\"")))
               (substitute* "src/codeml.c"
                 (("strcpy\\(com.daafile, \"jones.dat\"\\)")
                  (string-append "strcpy(com.daafile, \""
                                 share "jones.dat\")")))
               (substitute* "src/evolver.c"
                 (("char \\*MCctlf0\\[\\]=\\{\"MCbase.dat\",\"MCcodon.dat\",\"MCaa.dat\"\\}")
                  (string-append "char *MCctlf0[]={"
                                 (string-join
                                  (map (lambda (f)
                                         (string-append "\"" share f "\""))
                                       '("MCbase.dat" "MCcodon.dat" "MCaa.dat"))
                                  ",")
                                 "}"))))
             (chdir "src")
             #t))
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((tools '("baseml" "basemlg" "codeml"
                            "pamp" "evolver" "yn00" "chi2"))
                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
                   (docdir (string-append (assoc-ref outputs "out")
                                          "/share/doc/paml"))
                   (share  (string-append (assoc-ref outputs "out")
                                          "/share/paml"))
                   (data   (append (find-files ".." "\\.(ctl|dat)$")
                                   (find-files "../dat" "\\.dat$"))))
               (mkdir-p bin)
               (for-each (lambda (file) (install-file file bin)) tools)
               (for-each (lambda (file) (install-file file share)) data)
               (copy-recursively "../doc" docdir)
               #t))))
--8<---------------cut here---------------end--------------->8---

The alternative is to just install the data files to $out/share/paml and
expect users to copy them to their current working directory.  That
seems to work.

I prefer this over patching the code, which is much too invasive.

What do you think?

-- Ricardo

      reply	other threads:[~2017-10-13 13:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
2017-10-13  8:51 ` Ludovic Courtès
2017-10-13  9:15 ` bug#28802: " Ricardo Wurmus
2017-10-13  9:23 ` [bug#28802] " Ben Woodcroft
2017-10-13  9:35   ` Ricardo Wurmus
2017-10-13 10:22 ` Roel Janssen
2017-10-13 13:25   ` Ricardo Wurmus [this message]

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=idjo9pbw569.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=28802@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    --cc=roel@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.