unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pjotr Prins <pjotr.public12@thebird.nl>
To: Muriithi Frederick Muriuki <fredmanglis@gmail.com>
Cc: 27637@debbugs.gnu.org
Subject: [bug#27637] [PATCH 5/5] gnu: Add conda
Date: Fri, 21 Jul 2017 07:48:58 +0200	[thread overview]
Message-ID: <20170721054858.GE16795@thebird.nl> (raw)
In-Reply-To: <20170718083709.5062-5-fredmanglis@gmail.com>

Thanks Fred.

Can someone take a look at the tar issue?

If there are no objections, please push.

On Tue, Jul 18, 2017 at 11:37:09AM +0300, Muriithi Frederick Muriuki wrote:
> * gnu/packages/package-management.scm (conda): New variable.
> ---
>  gnu/packages/package-management.scm | 84 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 84 insertions(+)
> 
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index 3f106a65e..b30b8aff0 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -693,3 +693,87 @@ entirely in Python, and is BSD licensed open source.")
>  
>  (define-public python2-conda
>    (package-with-python2 python-conda))
> +
> +(define-public conda
> +  (package
> +    (inherit python-conda)
> +    (name "conda")
> +    (version "4.3.16")
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build
> +             'create-version-file
> +           (lambda* _
> +             (let ((version-file (open-output-file "conda/.version")))
> +               (display ,version version-file)
> +               (close-output-port version-file)
> +               #t)))
> +         (replace 'build
> +           (lambda* _
> +             ;; the util/setup-testing.py is used to build conda in
> +             ;; application form, rather than the default, library form.
> +             ;; With this, we are able to run commands like `conda --help`
> +             ;; directly on the command line
> +             (zero? (system* "python" "utils/setup-testing.py" "bdist"))))
> +         (add-before 'check
> +             'remove-failing-tests
> +           (lambda* _
> +             ;; these tests require internet/network access
> +             (delete-file "tests/test_cli.py")
> +             (delete-file "tests/test_create.py")
> +             (delete-file "tests/test_export.py")
> +             (delete-file "tests/test_fetch.py")
> +             (delete-file "tests/test_history.py")
> +             (delete-file "tests/test_info.py")
> +             (delete-file "tests/test_install.py")
> +             (delete-file "tests/test_priority.py")
> +             (delete-file "tests/conda_env/test_cli.py")
> +             (delete-file "tests/conda_env/test_create.py")
> +             (delete-file "tests/conda_env/specs/test_notebook.py")
> +             (delete-file "tests/conda_env/utils/test_notebooks.py")
> +             (delete-file "tests/core/test_index.py")
> +             (delete-file "tests/core/test_repodata.py")
> +             ;; This last test creates a file, then deletes it an
> +             ;; tests that the file was deleted. For some reason
> +             ;; it fails when building with guix, but does not when
> +             ;; you run it in the directory left when you build with
> +             ;; the --keep-failed option
> +             (delete-file "tests/gateways/disk/test_delete.py")))
> +         (replace 'check
> +           (lambda* _
> +             (and
> +              (setenv "HOME" "/tmp")
> +              (zero? (system* "py.test")))))
> +         (replace 'install
> +           (lambda* (#:key outputs target (configure-flags '())
> +                     use-setup-tools? #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (main-dir (getcwd))
> +                    (build-dir (string-append main-dir "/build"))
> +                    (dist-dir (string-append main-dir "/dist"))
> +                    (dir-stream (opendir dist-dir))
> +                    (tar-file (let get-file ((stream dir-stream))
> +                                (let ((the-file ""))
> +                                  (do ((file (readdir stream)
> +                                             (readdir stream)))
> +                                      ((eof-object? file))
> +                                    (if (not (or
> +                                              (equal? file ".")
> +                                              (equal? file "..")))
> +                                        (set! the-file file)))
> +                                  the-file))))
> +               (closedir dir-stream)
> +               (chdir dist-dir)
> +               ;; tar seems to be ignoring the -C option and at
> +               ;; this point the path in the variable `out` does
> +               ;; not seem to exist, hence the need for the hacky
> +               ;; code that follows.
> +               (mkdir "tmp")
> +               (chdir "tmp")
> +               (system* "tar" "-xvzf"
> +                        (string-append "../" tar-file)
> +                        "--strip-components=4")
> +               (chdir "../")
> +               (system* "cp" "-fvR" "tmp/" out)
> +               (chdir main-dir)))))))))
> -- 
> 2.13.2
> 
> 
> 
> 

-- 

  reply	other threads:[~2017-07-21  5:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  7:29 [bug#27637] [PATCH] gnu: Add python-conda Frederick Muriithi
2017-07-11 19:32 ` Marius Bakke
2017-07-12 15:35   ` Frederick Muriithi
2017-07-13  1:47 ` [bug#27637] [PATCH 1/2] " Muriithi Frederick Muriuki
2017-07-13  1:47   ` [bug#27637] [PATCH 2/2] gnu: Add conda Muriithi Frederick Muriuki
2017-07-16 21:09     ` Marius Bakke
2017-07-17  6:17       ` Frederick Muriithi
2017-07-17 23:04         ` Marius Bakke
     [not found]           ` <CALjrZwaCshpenigzqh8qacedK09OYL0nFxeL0KGTzLvHgn5=Dg@mail.gmail.com>
     [not found]             ` <CALjrZwZ9Zcu313vXXKKZ7SooWiK1On8LDUQtw_-pcO3o8MWM4A@mail.gmail.com>
     [not found]               ` <CALjrZwbWHvkpb8bafQKfX=O0aPpF_KTFEhGohJf2JYdoPmZbHg@mail.gmail.com>
     [not found]                 ` <CALjrZwZE4WKT8d15aZAW1Et_g-Uiq3+FqVC9=dYOR87Jp+N2Bw@mail.gmail.com>
2017-07-18  7:53                   ` Frederick Muriithi
2017-07-18  8:37 ` [bug#27637] [PATCH 1/5] gnu: Add python-pytz Muriithi Frederick Muriuki
2017-07-18  8:37   ` [bug#27637] [PATCH 2/5] gnu: Add python-clyent Muriithi Frederick Muriuki
2017-07-21  5:45     ` Pjotr Prins
2017-07-18  8:37   ` [bug#27637] [PATCH 3/5] gnu: Add python-anaconda-client Muriithi Frederick Muriuki
2017-07-21  5:45     ` Pjotr Prins
2017-07-18  8:37   ` [bug#27637] [PATCH 4/5] gnu: Add python-conda Muriithi Frederick Muriuki
2017-07-21  5:46     ` Pjotr Prins
2017-07-18  8:37   ` [bug#27637] [PATCH 5/5] gnu: Add conda Muriithi Frederick Muriuki
2017-07-21  5:48     ` Pjotr Prins [this message]
2017-07-22  8:39       ` Ricardo Wurmus
2017-07-22  9:49         ` bug#27637: " Ricardo Wurmus
2017-07-22 10:27           ` [bug#27637] " Ricardo Wurmus
2017-07-22 21:07             ` Pjotr Prins
2017-07-21  5:44   ` [bug#27637] [PATCH 1/5] gnu: Add python-pytz Pjotr Prins

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=20170721054858.GE16795@thebird.nl \
    --to=pjotr.public12@thebird.nl \
    --cc=27637@debbugs.gnu.org \
    --cc=fredmanglis@gmail.com \
    /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).