From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: How can I add a package outside the guix source dir? Date: Fri, 22 May 2015 19:56:58 +0800 Message-ID: <871ti8q0z9.fsf@gmail.com> References: <87oaldvwh6.fsf@163.com> <87fv6pvvdn.fsf@T420.taylan> <87wq00vpna.fsf@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvlYu-0002B9-HQ for guix-devel@gnu.org; Fri, 22 May 2015 07:56:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvlYr-0003JL-CS for guix-devel@gnu.org; Fri, 22 May 2015 07:56:24 -0400 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:32851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvlYr-0003J3-5K for guix-devel@gnu.org; Fri, 22 May 2015 07:56:21 -0400 Received: by pdbqa5 with SMTP id qa5so18151691pdb.0 for ; Fri, 22 May 2015 04:56:20 -0700 (PDT) In-Reply-To: <87wq00vpna.fsf@163.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Feng Shu , guix Feng Shu writes: > taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") writes: > >> 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? >> >> 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=3D"/home/feng/project/eh-guix-package/" > export PYTHONPATH=3D"$HOME/.guix-profile/lib/python3.4/site-packages" > export GUILE_LOAD_PATH=3D"$GUILE_LOAD_PATH:$HOME/.guix-profile/share/guil= e/site/2.0/" > export GUILE_LOAD_COMPILED_PATH=3D"$GUILE_LOAD_PATH:$HOME/.guix-profile/s= hare/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 "9e41e0bc6a6fdb7a01841db62d8de42d67be5= 34a"))) > (sha256 > (base32 > "1p50nrmwnx1d6an7daz8fxkj6ylxml7g23b996ba837nlfz3l= 8ay")))) > (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.