From e5025996ca5780dbe9d6b1ec10de2fc071e51dd1 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 25 Jan 2008 13:31:59 +0000 Subject: [PATCH] fontDir compatible with both trunk and (hopefully) stdenv-updates svn path=/nixos/trunk/; revision=10293 --- system/fontdir.nix | 36 +++++++++++++++++++++++------------- system/system.nix | 4 ++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/system/fontdir.nix b/system/fontdir.nix index ee5f965034d3..c33c627ba637 100644 --- a/system/fontdir.nix +++ b/system/fontdir.nix @@ -1,15 +1,13 @@ -args: - with args; -stdenv.mkDerivation -{ - name="X11-fonts"; - phases="installPhase"; - fontDirs = import ./fonts.nix {inherit pkgs config;}; - buildInputs = [mkfontdir mkfontscale]; - inherit fontalias; - installCommand = " +args : with args; with builderDefs {src="";} null; + let localDefs = builderDefs rec { + src = "";/* put a fetchurl here */ + + buildInputs = [mkfontdir mkfontscale]; + configureFlags = []; + fontDirs = import ./fonts.nix {inherit pkgs config;}; + installPhase = FullDepEntry (" list=''; - for i in \$fontDirs ; do + for i in ${toString fontDirs} ; do if [ -d \$i/ ]; then list=\"\$list \$i\"; fi; @@ -32,6 +30,18 @@ stdenv.mkDerivation rm fonts.alias mkfontdir mkfontscale - cat \$( find \$fontalias/ -name fonts.alias) >fonts.alias - "; + cat \$( find ${fontalias}/ -name fonts.alias) >fonts.alias + ") ["minInit" "addInputs"]; + } null; /* null is a terminator for sumArgs */ + in with localDefs; +stdenv.mkDerivation rec { + name = "X11-fonts"; + builder = writeScript (name + "-builder") + (textClosure localDefs + [installPhase doForceShare doPropagate]); + meta = { + description = " + Directory to contain all X11 fonts requested. +"; + }; } diff --git a/system/system.nix b/system/system.nix index 4d27c722425c..732ae7b8aa91 100644 --- a/system/system.nix +++ b/system/system.nix @@ -189,8 +189,8 @@ rec { # Font aggregation fontDir = import ./fontdir.nix { - stdenv = pkgs.stdenv; - inherit pkgs config; + inherit config pkgs ; + inherit (pkgs) builderDefs ; inherit (pkgs.xorg) mkfontdir mkfontscale fontalias; };