Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 39 lines 950 B view raw
1{ 2 runCommand, 3 gdk-pixbuf, 4 lib, 5 stdenv, 6 buildPackages, 7}: 8 9{ 10 extraLoaders, 11}: 12 13let 14 # Get packages to generate the cache for. We always include gdk-pixbuf. 15 loaderPackages = [ 16 gdk-pixbuf 17 ] 18 ++ extraLoaders; 19in 20 21# Generate the cache file by running gdk-pixbuf-query-loaders for each 22# package and concatenating the results. 23runCommand "gdk-pixbuf-loaders.cache" 24 { 25 preferLocalBuild = true; 26 } 27 '' 28 ( 29 for package in ${lib.escapeShellArgs loaderPackages}; do 30 module_dir="$package/${gdk-pixbuf.moduleDir}" 31 if [[ ! -d "$module_dir" ]]; then 32 echo "Error: gdkPixbufCacheBuilder: Passed package ''${package} does not contain GdkPixbuf loaders in ${gdk-pixbuf.moduleDir}." 1>&2 33 exit 1 34 fi 35 GDK_PIXBUF_MODULEDIR="$module_dir" \ 36 ${stdenv.hostPlatform.emulator buildPackages} ${gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders 37 done 38 ) > "$out" 39 ''