about summary refs log tree commit diff
path: root/pkgs/data/fonts/fontWrap/default.nix
blob: 9a65c0cde302f055c017c9c729eb83ae7d3064e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
args @ { fetchurl, stdenv, builderDefs, paths, mkfontdir, mkfontscale }:
with args;
	let localDefs = builderDefs.passthru.function {
		src =""; /* put a fetchurl here */
		buildInputs = [mkfontdir mkfontscale];
		configureFlags = [];
	};
	in with localDefs;
let
	doInstall = fullDepEntry ("
		mkdir -p \$out/share/fonts/
		cd \$out/share/fonts
		for i in ${toString paths}; do
			find \$i -type f -exec ln -s '{}' . ';' ;
		done
		mkfontdir 
		mkfontscale
	") [minInit addInputs defEnsureDir] ;
in
stdenv.mkDerivation rec {
	name = "wrapped-font-dir";
	builder = writeScript (name + "-builder")
		(textClosure localDefs [ doInstall doForceShare doPropagate]);
  preferLocalBuild = true;
	meta = {
		description = "
		Just a wrapper to create fonts.dir and fonts.scale .
";
		inherit src;
	};
}