From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 5/6] gnu: Add borg. Date: Tue, 15 Mar 2016 12:11:15 +0300 Message-ID: <878u1k2jik.fsf@gmail.com> References: <14fe75ec9c8b651be6a5240dd5444e558615e1e1.1457998381.git.leo@famulari.name> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afl0G-0006ga-NB for guix-devel@gnu.org; Tue, 15 Mar 2016 05:11:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afl0D-0001C3-GI for guix-devel@gnu.org; Tue, 15 Mar 2016 05:11:00 -0400 Received: from mail-lb0-x243.google.com ([2a00:1450:4010:c04::243]:32945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afl0D-0001Br-9E for guix-devel@gnu.org; Tue, 15 Mar 2016 05:10:57 -0400 Received: by mail-lb0-x243.google.com with SMTP id bc4so1092453lbc.0 for ; Tue, 15 Mar 2016 02:10:57 -0700 (PDT) In-Reply-To: <14fe75ec9c8b651be6a5240dd5444e558615e1e1.1457998381.git.leo@famulari.name> (Leo Famulari's message of "Mon, 14 Mar 2016 19:34:25 -0400") 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: Leo Famulari Cc: guix-devel@gnu.org Leo Famulari (2016-03-15 02:34 +0300) wrote: > * gnu/packages/backup.scm (borg): New variable. > --- > gnu/packages/backup.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 52 insertions(+), 1 deletion(-) [...] > +(define-public borg > + (package > + (name "borg") > + (version "1.0.0") > + (source (origin > + (method url-fetch) > + (uri (pypi-uri "borgbackup" version)) > + (sha256 > + (base32 > + "0wa6cvqs3rni5nwrgagigchcly8a53rxk56z0zn8iaii2cqrw2sh")))) > + (build-system python-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (add-before 'build 'set-openssl-prefix > + (lambda* (#:key inputs #:allow-other-keys) > + (setenv "BORG_OPENSSL_PREFIX" (assoc-ref inputs "openssl")) > + #t)) > + (add-before 'build 'set-lz4-prefix > + (lambda* (#:key inputs #:allow-other-keys) > + (setenv "BORG_LZ4_PREFIX" (assoc-ref inputs "lz4")) > + #t)) Would it be better to make a single 'set-env' phase instead? Or better yet, are these '..._PREFIX' variables used for make command? If so, they should be specified in #:make-flags argument. > + (add-after 'install 'docs > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (man (string-append out "/share/man/man1"))) > + (and > + (zero? (system* "make" "-C" "docs" "man")) > + (install-file "docs/_build/man/borg.1" man))) Since 'install-file' does not specify a returned value, and we are not really interested in the returned value, I think it is better to use 'when' instead of 'and' here: (when (zero? (system* "make" "-C" "docs" "man")) (install-file "docs/_build/man/borg.1" man)) > + #t))))) -- Alex