From 5a7b2515e1dfd0b3fccf0b9220513827888a5d99 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Dec 2006 14:23:24 +0000 Subject: [PATCH] * Helper function `writeText' to write a plain text file to the Nix store. * Helper function `cleanSource' to bring in a path as a source, filtering out all hidden Subversion directories. svn path=/nixpkgs/trunk/; revision=7334 --- pkgs/top-level/all-packages.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f28920efe09..8dd992db2a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -192,10 +192,23 @@ rec { makeWrapper = ../build-support/make-wrapper/make-wrapper.sh; + # Run the shell command `buildCommand' to produce a store object + # named `name'. The attributes in `env' are added to the + # environment prior to running the command. runCommand = name: env: buildCommand: stdenvNew.mkDerivation ({ inherit name buildCommand; } // env); + # Write a plain text file to the Nix store. (The advantage over + # plain sources is that `text' can refer to the output paths of + # derivations, e.g., "... ${somePkg}/bin/foo ...". + writeText = name: text: runCommand name {inherit text;} "echo \"$text\" > $out"; + + # Bring in a path as a source, filtering out all hidden Subversion + # directories. TODO: filter out backup files (*~) etc. + cleanSource = builtins.filterSource + (name: baseNameOf (toString name) != ".svn"); + # !!! obsolete substitute = ../build-support/substitute/substitute.sh;