unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How can I add a package outside the guix source dir?
@ 2015-05-22  8:37 Feng Shu
  2015-05-22  9:01 ` Taylan Ulrich Bayırlı/Kammer
  2015-05-22  9:01 ` Ricardo Wurmus
  0 siblings, 2 replies; 6+ messages in thread
From: Feng Shu @ 2015-05-22  8:37 UTC (permalink / raw)
  To: guix; +Cc: Feng Shu


I want to add a package which will used by myself, for example:

I don't want to put it to guix source dir, How can I solve the problem?

#+BEGIN_COMMENT
(define-public emacs-snapshot
  (package (inherit emacs)
           (name "emacs-snapshot")
           (version "20150522.9e41e0b")
           (source (origin
                     (method git-fetch)
                     (uri (git-reference
                           (url "/home/feng/project/emacs")
                           (commit "9e41e0bc6a6fdb7a01841db62d8de42d67be534a")))
                     (sha256
                      (base32
                       "1p50nrmwnx1d6an7daz8fxkj6ylxml7g23b996ba837nlfz3l8ay"))))
           (native-inputs
            `(("autoconf" ,autoconf)
              ("automake" ,automake)
              ,@(package-native-inputs emacs)))
           (arguments
            (substitute-keyword-arguments
                `(;; Build fails if we allow parallel build.
                  #:parallel-build? #f
                                    ;; Tests aren't passing for now.
                                    #:tests? #f
                                    ,@(package-arguments emacs))
              ((#:phases phases)
               `(modify-phases ,phases
                  (add-after 'unpack 'autogen
                             (lambda _
                               (zero? (system* "sh" "autogen.sh"))))))))))
#+END_COMMENT



-- 

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

* Re: How can I add a package outside the guix source dir?
  2015-05-22  8:37 How can I add a package outside the guix source dir? Feng Shu
@ 2015-05-22  9:01 ` Taylan Ulrich Bayırlı/Kammer
  2015-05-22 11:05   ` Feng Shu
  2015-05-22  9:01 ` Ricardo Wurmus
  1 sibling, 1 reply; 6+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-05-22  9:01 UTC (permalink / raw)
  To: Feng Shu; +Cc: guix

Feng Shu <tumashu@163.com> writes:

> I want to add a package which will used by myself, for example:
>
> I don't want to put it to guix source dir, How can I solve the problem?

You can set the environment variable GUIX_PACKAGE_PATH to
e.g. ~/.guix-packages then put that package definition into
~/.guix-packages/emacs.scm and it should work.

See (info "(guix) Package Modules"),
i.e. https://gnu.org/s/guix/manual/html_node/Package-Modules.html

Taylan

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

* Re: How can I add a package outside the guix source dir?
  2015-05-22  8:37 How can I add a package outside the guix source dir? Feng Shu
  2015-05-22  9:01 ` Taylan Ulrich Bayırlı/Kammer
@ 2015-05-22  9:01 ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2015-05-22  9:01 UTC (permalink / raw)
  To: Feng Shu; +Cc: guix


Feng Shu writes:

> I want to add a package which will used by myself, for example:
>
> I don't want to put it to guix source dir, How can I solve the problem?

Guix respects the environment variable GUIX_PACKAGE_PATH, which you can
point to a directory containing your very own Guile modules with package
definitions.

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

* Re: How can I add a package outside the guix source dir?
  2015-05-22  9:01 ` Taylan Ulrich Bayırlı/Kammer
@ 2015-05-22 11:05   ` Feng Shu
  2015-05-22 11:56     ` 宋文武
  0 siblings, 1 reply; 6+ messages in thread
From: Feng Shu @ 2015-05-22 11:05 UTC (permalink / raw)
  To: guix

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:

> Feng Shu <tumashu@163.com> writes:
>
>> I want to add a package which will used by myself, for example:
>>
>> I don't want to put it to guix source dir, How can I solve the problem?
>
> You can set the environment variable GUIX_PACKAGE_PATH to
> e.g. ~/.guix-packages then put that package definition into
> ~/.guix-packages/emacs.scm and it should work.

I set GUIX_PACKAGE_PATH like below:

#+BEGIN_SRC shell
export GUIX_PACKAGE_PATH="/home/feng/project/eh-guix-package/"
export PYTHONPATH="$HOME/.guix-profile/lib/python3.4/site-packages"
export GUILE_LOAD_PATH="$GUILE_LOAD_PATH:$HOME/.guix-profile/share/guile/site/2.0/"
export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_PATH:$HOME/.guix-profile/share/guile/site/2.0/"
#+END_SRC

then add file "/home/feng/project/eh-guix-package/"

#+BEGIN_SRC lisp
(define-module (gnu packages emacs-snapshot)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages)
  #:use-module (gnu packages emacs))

(define-public emacs-snapshot
  (package (inherit emacs)
           (name "emacs-snapshot")
           (version "20150522.9e41e0b")
           (source (origin
                     (method git-fetch)
                     (uri (git-reference
                           (url "/home/feng/project/emacs")
                           (commit "9e41e0bc6a6fdb7a01841db62d8de42d67be534a")))
                     (sha256
                      (base32
                       "1p50nrmwnx1d6an7daz8fxkj6ylxml7g23b996ba837nlfz3l8ay"))))
           (native-inputs
            `(("autoconf" ,autoconf)
              ("automake" ,automake)
              ,@(package-native-inputs emacs)))
           (arguments
            (substitute-keyword-arguments
                `(;; Build fails if we allow parallel build.
                  #:parallel-build? #f
                                    ;; Tests aren't passing for now.
                                    #:tests? #f
                                    ,@(package-arguments emacs))
              ((#:phases phases)
               `(modify-phases ,phases
                  (add-after 'unpack 'autogen
                             (lambda _
                               (zero? (system* "sh" "autogen.sh"))))))))))

#+END_SRC

but when I run command, it told me that emacs-snapshot module can't be found.

#+BEGIN_COMMENT
guix build -i emacs-snapshot
#+END_COMMENT


>
> See (info "(guix) Package Modules"),
> i.e. https://gnu.org/s/guix/manual/html_node/Package-Modules.html
>
> Taylan

-- 

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

* Re: How can I add a package outside the guix source dir?
  2015-05-22 11:05   ` Feng Shu
@ 2015-05-22 11:56     ` 宋文武
  2015-05-22 14:22       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: 宋文武 @ 2015-05-22 11:56 UTC (permalink / raw)
  To: Feng Shu, guix

Feng Shu <tumashu@163.com> writes:

> taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:
>
>> Feng Shu <tumashu@163.com> writes:
>>
>>> I want to add a package which will used by myself, for example:
>>>
>>> I don't want to put it to guix source dir, How can I solve the problem?
>>
>> You can set the environment variable GUIX_PACKAGE_PATH to
>> e.g. ~/.guix-packages then put that package definition into
>> ~/.guix-packages/emacs.scm and it should work.
>
> I set GUIX_PACKAGE_PATH like below:
>
> #+BEGIN_SRC shell
> export GUIX_PACKAGE_PATH="/home/feng/project/eh-guix-package/"
> export PYTHONPATH="$HOME/.guix-profile/lib/python3.4/site-packages"
> export GUILE_LOAD_PATH="$GUILE_LOAD_PATH:$HOME/.guix-profile/share/guile/site/2.0/"
> export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_PATH:$HOME/.guix-profile/share/guile/site/2.0/"
> #+END_SRC
>
> then add file "/home/feng/project/eh-guix-package/"
>
> #+BEGIN_SRC lisp
> (define-module (gnu packages emacs-snapshot)
You should change this to match the module name and file name.
Suppose, this file is named 'emacs.scm', then it should be:

  (define-module (emacs)

Or put in in a same-level sub-directory of your eh-guix-package,
as .../eh-guix-package/gnu/packages/emacs-snapshot.scm.

>   #:use-module ((guix licenses) #:prefix license:)
>   #:use-module (guix packages)
>   #:use-module (guix download)
>   #:use-module (gnu packages)
>   #:use-module (gnu packages emacs))
>
> (define-public emacs-snapshot
>   (package (inherit emacs)
>            (name "emacs-snapshot")
>            (version "20150522.9e41e0b")
>            (source (origin
>                      (method git-fetch)
>                      (uri (git-reference
>                            (url "/home/feng/project/emacs")
>                            (commit "9e41e0bc6a6fdb7a01841db62d8de42d67be534a")))
>                      (sha256
>                       (base32
>                        "1p50nrmwnx1d6an7daz8fxkj6ylxml7g23b996ba837nlfz3l8ay"))))
>            (native-inputs
>             `(("autoconf" ,autoconf)
>               ("automake" ,automake)
>               ,@(package-native-inputs emacs)))
>            (arguments
>             (substitute-keyword-arguments
>                 `(;; Build fails if we allow parallel build.
>                   #:parallel-build? #f
>                                     ;; Tests aren't passing for now.
>                                     #:tests? #f
>                                     ,@(package-arguments emacs))
>               ((#:phases phases)
>                `(modify-phases ,phases
>                   (add-after 'unpack 'autogen
>                              (lambda _
>                                (zero? (system* "sh" "autogen.sh"))))))))))
>
> #+END_SRC
>
> but when I run command, it told me that emacs-snapshot module can't be
> found.
>
> #+BEGIN_COMMENT
> guix build -i emacs-snapshot
> #+END_COMMENT
>
>
>>
>> See (info "(guix) Package Modules"),
>> i.e. https://gnu.org/s/guix/manual/html_node/Package-Modules.html
The manual does mention it as (17), but it's not very clear how to do
it right.

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

* Re: How can I add a package outside the guix source dir?
  2015-05-22 11:56     ` 宋文武
@ 2015-05-22 14:22       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-05-22 14:22 UTC (permalink / raw)
  To: 宋文武; +Cc: guix, Feng Shu

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

宋文武 <iyzsong@gmail.com> skribis:

> Feng Shu <tumashu@163.com> writes:
>
>> taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:

[...]

>>> See (info "(guix) Package Modules"),
>>> i.e. https://gnu.org/s/guix/manual/html_node/Package-Modules.html
> The manual does mention it as (17), but it's not very clear how to do
> it right.

I have pushed a clarification.

Thanks for your feedback,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1310 bytes --]

--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6154,11 +6154,15 @@ facility is implemented in the @code{(gnu packages)} module.
 @cindex package module search path
 Users can store package definitions in modules with different
 names---e.g., @code{(my-packages emacs)}@footnote{Note that the file
-name and module name must match.  @xref{Modules and the File System,,,
-guile, GNU Guile Reference Manual}, for details.}  These package definitions
+name and module name must match.  For instance, the @code{(my-packages
+emacs)} module must be stored in a @file{my-packages/emacs.scm} file
+relative to the load path specified with @option{--load-path} or
+@code{GUIX_PACKAGE_PATH}.  @xref{Modules and the File System,,,
+guile, GNU Guile Reference Manual}, for details.}.  These package definitions
 will not be visible by default.  Thus, users can invoke commands such as
 @command{guix package} and @command{guix build} have to be used with the
-@code{-e} option so that they know where to find the package, or use the
+@code{-e} option so that they know where to find the package.  Better
+yet, they can use the
 @code{-L} option of these commands to make those modules visible
 (@pxref{Invoking guix build, @code{--load-path}}), or define the
 @code{GUIX_PACKAGE_PATH} environment variable.  This environment

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

end of thread, other threads:[~2015-05-22 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22  8:37 How can I add a package outside the guix source dir? Feng Shu
2015-05-22  9:01 ` Taylan Ulrich Bayırlı/Kammer
2015-05-22 11:05   ` Feng Shu
2015-05-22 11:56     ` 宋文武
2015-05-22 14:22       ` Ludovic Courtès
2015-05-22  9:01 ` Ricardo Wurmus

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).