all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to install a package in guile
@ 2017-07-25 13:36 Feng Shu
  2017-07-25 15:49 ` ng0
  2017-07-25 21:14 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Feng Shu @ 2017-07-25 13:36 UTC (permalink / raw)
  To: guix-devel; +Cc: Feng Shu


I use the following exp to build a new version you-get

#+BEGIN_COMMENT
scheme@(guile-user)> ,run-in-store (build-package you-get #:use-substitutes? #t #:dry-run? #f)
#+END_COMMENT

How to install this new vesion of you-get in guile?



-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to install a package in guile
  2017-07-25 13:36 How to install a package in guile Feng Shu
@ 2017-07-25 15:49 ` ng0
  2017-07-25 21:14 ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: ng0 @ 2017-07-25 15:49 UTC (permalink / raw)
  To: Feng Shu; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Feng Shu transcribed 0.2K bytes:
> 
> I use the following exp to build a new version you-get
> 
> #+BEGIN_COMMENT
> scheme@(guile-user)> ,run-in-store (build-package you-get #:use-substitutes? #t #:dry-run? #f)
> #+END_COMMENT
> 
> How to install this new vesion of you-get in guile?
> 
> 
> 
> -- 
> 
> 
> 

What exactly do you mean?

One of the ways you can update packages in Guix is via `guix package --update $name`
so in the case of you-get:
guix package -u you-get
or
guix package -i you-get

which implies that you have updated your sources prior to running this
by issuing `guix pull`.
-- 
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://n0is.noblogs.org/my-keys
https://www.infotropique.org https://krosos.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to install a package in guile
  2017-07-25 13:36 How to install a package in guile Feng Shu
  2017-07-25 15:49 ` ng0
@ 2017-07-25 21:14 ` Ludovic Courtès
  2017-07-26 12:44   ` Feng Shu
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-07-25 21:14 UTC (permalink / raw)
  To: Feng Shu; +Cc: guix-devel

Hi,

"Feng Shu" <tumashu@163.com> skribis:

> I use the following exp to build a new version you-get
>
> #+BEGIN_COMMENT
> scheme@(guile-user)> ,run-in-store (build-package you-get #:use-substitutes? #t #:dry-run? #f)
> #+END_COMMENT
>
> How to install this new vesion of you-get in guile?

You’d first need to build a profile that contains you-get, using the API
in (guix profiles):

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix)
scheme@(guile-user)> ,use(gnu)
scheme@(guile-user)> ,use(guix profiles)
scheme@(guile-user)> (packages->manifest (list (specification->package "you-get")))
$13 = #<<manifest> entries: (#<<manifest-entry> name: "you-get" version: "0.4.775" output: "out" item: #<package you-get@0.4.775 gnu/packages/video.scm:1239 1529d80> dependencies: () search-paths: () parent: #<promise #<procedure 7feced850c18 at guix/profiles.scm:276:48 ()>>>)>
scheme@(guile-user)> ,run-in-store (profile-derivation $13)
…
--8<---------------cut here---------------end--------------->8---

The rest (setting up the symlink) is a little less convenient though.
See (guix scripts package) or the equivalent Emacs-Guix code for how
this works.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to install a package in guile
  2017-07-25 21:14 ` Ludovic Courtès
@ 2017-07-26 12:44   ` Feng Shu
  2017-07-26 20:35     ` Alex Kost
  0 siblings, 1 reply; 6+ messages in thread
From: Feng Shu @ 2017-07-26 12:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, Feng Shu

ludo@gnu.org (Ludovic Courtès) writes:

> Hi,
>
> "Feng Shu" <tumashu@163.com> skribis:
>
>> I use the following exp to build a new version you-get
>>
>> #+BEGIN_COMMENT
>> scheme@(guile-user)> ,run-in-store (build-package you-get #:use-substitutes? #t #:dry-run? #f)
>> #+END_COMMENT
>>
>> How to install this new vesion of you-get in guile?
>
> You’d first need to build a profile that contains you-get, using the API
> in (guix profiles):
>
> scheme@(guile-user)> ,use(guix)
> scheme@(guile-user)> ,use(gnu)
> scheme@(guile-user)> ,use(guix profiles)
> scheme@(guile-user)> (packages->manifest (list (specification->package "you-get")))
> $13 = #<<manifest> entries: (#<<manifest-entry> name: "you-get"
> version: "0.4.775" output: "out" item: #<package you-get@0.4.775
> gnu/packages/video.scm:1239 1529d80> dependencies: () search-paths: ()
> parent: #<promise #<procedure 7feced850c18 at guix/profiles.scm:276:48
> ()>>>)>
> scheme@(guile-user)> ,run-in-store (profile-derivation $13)
> …

(packages-manifest (list you-get)) seem to work too.

>
> The rest (setting up the symlink) is a little less convenient though.
> See (guix scripts package) or the equivalent Emacs-Guix code for how
> this works.
>

(build-and-use-profile store "~/.guix-profile" $2)

How can I get the "store"?


> HTH!
>
> Ludo’.
>

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to install a package in guile
  2017-07-26 12:44   ` Feng Shu
@ 2017-07-26 20:35     ` Alex Kost
  2017-07-27 12:43       ` Feng Shu
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Kost @ 2017-07-26 20:35 UTC (permalink / raw)
  To: Feng Shu; +Cc: guix-devel

Feng Shu (2017-07-26 20:44 +0800) wrote:

> ludo@gnu.org (Ludovic Courtès) writes:
[...]
>> The rest (setting up the symlink) is a little less convenient though.
>> See (guix scripts package) or the equivalent Emacs-Guix code for how
>> this works.
>
> (build-and-use-profile store "~/.guix-profile" $2)
>
> How can I get the "store"?

For example, like this:

(with-store store
  (build-and-use-profile ...))

-- 
Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to install a package in guile
  2017-07-26 20:35     ` Alex Kost
@ 2017-07-27 12:43       ` Feng Shu
  0 siblings, 0 replies; 6+ messages in thread
From: Feng Shu @ 2017-07-27 12:43 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel, Feng Shu

Alex Kost <alezost@gmail.com> writes:

> Feng Shu (2017-07-26 20:44 +0800) wrote:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
> [...]
>>> The rest (setting up the symlink) is a little less convenient though.
>>> See (guix scripts package) or the equivalent Emacs-Guix code for how
>>> this works.
>>
>> (build-and-use-profile store "~/.guix-profile" $2)
>>
>> How can I get the "store"?
>
> For example, like this:
>
> (with-store store
>   (build-and-use-profile ...))

guix's code seem to hard for me, I use a emacs command to solve my
problem:

-----------------

  (defvar guix-export-directory "~/myguix/")

  (defun guix-export-package ()
    (interactive)
    (let* ((directory (file-name-as-directory guix-export-directory))
           (current-module (guix-guile-current-module))
           (define-public-string
             (save-excursion
               (end-of-defun)
               (let ((end (point)))
                 (beginning-of-defun)
                 (buffer-substring (point) end))))
           (package-name
            (progn (string-match "\\(define-public +\\)\\([a-z-]+\\)\n+"
                                 define-public-string)
                   (match-string 2 define-public-string)))
           (define-module-string
             (replace-regexp-in-string
              " *(define-module.*\n"
              (format (concat "(define-module (%s)\n"
                              "  #:use-module %s\n")
                      package-name current-module)
              (save-excursion
                (goto-char (point-min))
                (search-forward "(define-module")
                (end-of-defun)
                (let ((end (point)))
                  (beginning-of-defun)
                  (buffer-substring (point) end)))))
           (command (format "guix package --load-path='%s' -i %s "
                            directory package-name)))
      (unless (file-directory-p directory)
        (make-directory directory t))
      (with-temp-buffer
        (insert define-module-string)
        (insert "\n")
        (insert define-public-string)
        (write-file (concat directory package-name ".scm"))
        (kill-new command)
        (message command)))

------------



-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-27 12:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 13:36 How to install a package in guile Feng Shu
2017-07-25 15:49 ` ng0
2017-07-25 21:14 ` Ludovic Courtès
2017-07-26 12:44   ` Feng Shu
2017-07-26 20:35     ` Alex Kost
2017-07-27 12:43       ` Feng Shu

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.