unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: 40086@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#40086] [PATCH 11/11] gnu: edirect: Install more programs.
Date: Mon, 16 Mar 2020 09:15:59 +0200	[thread overview]
Message-ID: <20200316071559.13930-12-efraim@flashner.co.il> (raw)
In-Reply-To: <20200316070412.12364-1-efraim@flashner.co.il>

* gnu/packages/bioinformatics.scm (edirect)[arguments]: Add
'patch-programs phase to work around not finding binaries in the PATH.
Rewrite 'install phase to install many more scripts. Rewrite
'wrap-program to wrap more scripts with more programs.
[inputs]: Add edirect-go-programs.
[native-search-paths]: New field.
---
 gnu/packages/bioinformatics.scm | 57 +++++++++++++++++++++++++++------
 1 file changed, 47 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 1f0619ebb6..da36733412 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2781,19 +2781,48 @@ quantitative phenotypes.")
          (delete 'configure)
          (delete 'build)
          (delete 'check)                ; simple check after install
+         (add-after 'unpack 'patch-programs
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Ignore errors about missing xtract.Linux and rchive.Linux.
+              (substitute* "pm-refresh"
+                (("cat \\\"\\$target")
+                 "grep ^[[:digit:]] \"$target"))
+              #t))
          (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (install-file "edirect.pl"
-                           (string-append (assoc-ref outputs "out") "/bin"))
-             #t))
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+                    (edirect-go (assoc-ref inputs "edirect-go-programs")))
+                (for-each
+                  (lambda (file)
+                    (install-file file bin))
+                  '("archive-pubmed" "asp-cp" "asp-ls" "download-ncbi-data"
+                    "download-pubmed" "edirect.pl" "efetch" "epost" "esearch"
+                    "fetch-pubmed" "ftp-cp" "ftp-ls" "has-asp" "index-pubmed"
+                    "pm-prepare" "pm-refresh" "pm-stash" "pm-collect"
+                    "pm-index" "pm-invert" "pm-merge" "pm-promote"))
+                (symlink (string-append edirect-go "/bin/xtract.Linux")
+                         (string-append bin "/xtract"))
+                (symlink (string-append edirect-go "/bin/rchive.Linux")
+                         (string-append bin "/rchive")))
+              #t))
          (add-after 'install 'wrap-program
            (lambda* (#:key outputs #:allow-other-keys)
-             ;; Make sure 'edirect.pl' finds all perl inputs at runtime.
-             (let* ((out (assoc-ref outputs "out"))
+              ;; Make sure everything can run in a pure environment.
+              (let ((out (assoc-ref outputs "out"))
                     (path (getenv "PERL5LIB")))
-               (wrap-program (string-append out "/bin/edirect.pl")
-                 `("PERL5LIB" ":" prefix (,path))))
-             #t))
+                (for-each
+                  (lambda (file)
+                    (wrap-program file
+                      `("PERL5LIB" ":" prefix (,path)))
+                    (wrap-program file
+                      `("PATH" ":" prefix (,(string-append out "/bin")
+                                           ,(dirname (which "sed"))
+                                           ,(dirname (which "gzip"))
+                                           ,(dirname (which "grep"))
+                                           ,(dirname (which "perl"))
+                                           ,(dirname (which "uname"))))))
+                  (find-files out ".")))
+              #t))
          (add-after 'wrap-program 'check
            (lambda* (#:key outputs #:allow-other-keys)
              (invoke (string-append (assoc-ref outputs "out")
@@ -2801,7 +2830,8 @@ quantitative phenotypes.")
                      "-filter" "-help")
              #t)))))
     (inputs
-     `(("perl-html-parser" ,perl-html-parser)
+     `(("edirect-go-programs" ,edirect-go-programs)
+       ("perl-html-parser" ,perl-html-parser)
        ("perl-encode-locale" ,perl-encode-locale)
        ("perl-file-listing" ,perl-file-listing)
        ("perl-html-tagset" ,perl-html-tagset)
@@ -2831,6 +2861,13 @@ EDirect also provides an argument-driven function that simplifies the
 extraction of data from document summaries or other results that are returned
 in structured XML format.  This can eliminate the need for writing custom
 software to answer ad hoc questions.")
+    (native-search-paths
+     ;; Ideally this should be set for LWP somewhere.
+     (list (search-path-specification
+            (variable "PERL_LWP_SSL_CA_FILE")
+            (file-type 'regular)
+            (separator #f)
+            (files '("/etc/ssl/certs/ca-certificates.crt")))))
     (license license:public-domain)))
 
 (define-public edirect-go-programs
-- 
2.25.1

  parent reply	other threads:[~2020-03-16  7:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16  7:04 [bug#40086] [PATCH 00/11] Expand edirect programs Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 01/11] gnu: Add go-golang-org-x-image Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 02/11] gnu: Add go-golang-org-rainycape-unidecode Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 03/11] gnu: Add go-github-com-golang-freetype Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 04/11] gnu: Add go-github-com-fogleman-gg Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 05/11] gnu: Add go-github-com-gedex-inflector Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 06/11] gnu: Add go-github-com-klauspost-cpuid Efraim Flashner
2020-03-16  7:15 ` Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 07/11] gnu: Add go-github-com-pbnjay-memory Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 08/11] gnu: Add go-github-com-surge-glog Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 09/11] gnu: Add go-github-com-surgebase-porter2 Efraim Flashner
2020-03-16  7:15 ` [bug#40086] [PATCH 10/11] gnu: Add edirect-go-programs Efraim Flashner
2020-03-16  7:15 ` Efraim Flashner [this message]
2020-03-22  7:59 ` bug#40086: [PATCH 00/11] Expand edirect programs Efraim Flashner

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20200316071559.13930-12-efraim@flashner.co.il \
    --to=efraim@flashner.co.il \
    --cc=40086@debbugs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).