hydra-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

factoring dependency packages


From: Thien-Thi Nguyen
Subject: factoring dependency packages
Date: Mon, 20 Oct 2014 10:40:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

For LibreDWG, i would like to factor a list of dependency
packages, like so:
 libredwg/release.nix | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libredwg/release.nix b/libredwg/release.nix
index 87e2402..6a90269 100644
--- a/libredwg/release.nix
+++ b/libredwg/release.nix
@@ -22,6 +22,11 @@
 let
   pkgs = import nixpkgs {};
 
+  /* This is adapted from (find-file "../autoconf/release.nix")
+     -- see var ‘buildInputsFrom’.  "v" is for validation.
+     Note, however, that we always use parens around the callsite.  */
+  vdeps = pkgs: with pkgs; [ python swig libxml2 dejagnu ];
+
   meta = {
     description = "GNU LibreDWG, a free C library to handle DWG files.";
 
@@ -50,8 +55,7 @@ in
     customEnv = {
 
       tarball = pkgs: {
-        buildInputs = with pkgs; [ gettext_0_17 texinfo automake111x python
-                                   swig libxml2 dejagnu ];
+        buildInputs = [ gettext_0_17 texinfo automake111x ] ++ (vdeps pkgs);
         dontBuild = false;
         autoconfPhase = ''
           . autogen.sh
@@ -59,11 +63,11 @@ in
       } ;
 
       build = pkgs: ({
-        buildInputs = with pkgs; [ python swig libxml2 dejagnu ];
+        buildInputs = (vdeps pkgs);
       } // pkgs.lib.optionalAttrs (pkgs.stdenv.system == "i686-freebsd") { 
NIX_LDFLAGS="-lpthread"; } );
 
       coverage = pkgs: {
-        buildInputs = with pkgs; [ python swig libxml2 dejagnu ];
+        buildInputs = (vdeps pkgs);
       } ;
 
     };
Is that syntax correct?  I note that ../autoconf/release.nix
sometimes uses

 buildInputsFrom pkgs

and sometimes

 (buildInputsFrom pkgs)

and wonder where in the manual is either or both usages
authoritatively defined.  (IIUC, parens are always required
for a function call, and ‘buildInputsFrom’ is a function.)

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]