···5# Posix utilities, the GNU C compiler, and so on. On other systems,
6# we use the native C library.
78-9-# stdenvType exists to support multiple kinds of stdenvs on the same
10-# system, e.g., cygwin and mingw builds on i686-cygwin. Most people
11-# can ignore it.
12-13-{ system, stdenvType ? system, allPackages ? import ../.., platform, config }:
14-15-assert system != "i686-cygwin" -> system == stdenvType;
161718rec {
···45 stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux;
464748- # MinGW/MSYS standard environment.
49- stdenvMinGW = import ./mingw {
50- inherit system;
51- };
52-53-54 # Select the appropriate stdenv for the platform `system'.
55 stdenv =
56- if stdenvType == "i686-linux" then stdenvLinux else
57- if stdenvType == "x86_64-linux" then stdenvLinux else
58- if stdenvType == "armv5tel-linux" then stdenvLinux else
59- if stdenvType == "armv6l-linux" then stdenvLinux else
60- if stdenvType == "armv7l-linux" then stdenvLinux else
61- if stdenvType == "mips64el-linux" then stdenvLinux else
62- if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
63- if stdenvType == "i686-mingw" then stdenvMinGW else
64- if stdenvType == "x86_64-darwin" then stdenvNix else
65- if stdenvType == "x86_64-solaris" then stdenvNix else
66 stdenvNative;
67}
···5# Posix utilities, the GNU C compiler, and so on. On other systems,
6# we use the native C library.
78+{ system, allPackages ? import ../.., platform, config }:
000000091011rec {
···38 stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux;
394000000041 # Select the appropriate stdenv for the platform `system'.
42 stdenv =
43+ if system == "i686-linux" then stdenvLinux else
44+ if system == "x86_64-linux" then stdenvLinux else
45+ if system == "armv5tel-linux" then stdenvLinux else
46+ if system == "armv6l-linux" then stdenvLinux else
47+ if system == "armv7l-linux" then stdenvLinux else
48+ if system == "mips64el-linux" then stdenvLinux else
49+ if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
50+ if system == "x86_64-darwin" then stdenvNix else
51+ if system == "x86_64-solaris" then stdenvNix else
052 stdenvNative;
53}
-18
pkgs/stdenv/mingw/builder.sh
···1-# the other stdenv could change the SHELL variable,
2-# so we have to remember its value.
3-origShell=$SHELL
4-origGcc=$GCC
5-6-source $STDENV/setup
7-8-mkdir $OUT
9-10-SHELL=$origShell
11-GCC=$origGcc
12-13-export NIX_BUILD_TOP=$(pwd)
14-15-substitute "$SETUP" "$OUT/setup" \
16- --subst-var INITIALPATH \
17- --subst-var GCC \
18- --subst-var SHELL
···1-source $stdenv/setup
2-3-mkdir $out
4-cd $out
5-tar zxvf $src
6-7-# Make the Nix store available to MSYS.
8-# Hack: we are assuming that the stdenv is based on Cygwin.
9-10-nixdir="$(cygpath --windows /nix)"
11-mkdir $out/nix
12-cat > $out/etc/fstab <<EOF
13-#Win32_Path Mount_Point
14-$nixdir /nix
15-EOF
···1-# Run the named hook, either by calling the function with that name or
2-# by evaluating the variable with that name. This allows convenient
3-# setting of hooks both from Nix expressions (as attributes /
4-# environment variables) and from shell scripts (as functions).
5-runHook() {
6- local hookName="$1"
7- if test "$(type -t $hookName)" = function; then
8- $hookName
9- else
10- eval "${!hookName}"
11- fi
12-}
13-14-15-exitHandler() {
16- exitCode=$?
17- set +e
18-19- closeNest
20-21- if test -n "$showBuildStats"; then
22- times > "$NIX_BUILD_TOP/.times"
23- local -a times=($(cat "$NIX_BUILD_TOP/.times"))
24- # Print the following statistics:
25- # - user time for the shell
26- # - system time for the shell
27- # - user time for all child processes
28- # - system time for all child processes
29- echo "build time elapsed: " ${times[*]}
30- fi
31-32- if test $exitCode != 0; then
33- runHook failureHook
34-35- # If the builder had a non-zero exit code and
36- # $succeedOnFailure is set, create the file
37- # `$out/nix-support/failed' to signal failure, and exit
38- # normally. Otherwise, return the original exit code.
39- if test -n "$succeedOnFailure"; then
40- echo "build failed with exit code $exitCode (ignored)"
41- mkdir -p "$out/nix-support"
42- echo -n $exitCode > "$out/nix-support/failed"
43- exit 0
44- fi
45-46- else
47- runHook exitHook
48- fi
49-50- exit $exitCode
51-}
52-53-trap "exitHandler" EXIT
54-55-56-######################################################################
57-# Helper functions that might be useful in setup hooks.
58-59-60-addToSearchPathWithCustomDelimiter() {
61- local delimiter=$1
62- local varName=$2
63- local dir=$3
64- if [ -d "$dir" ]; then
65- eval export ${varName}=${!varName}${!varName:+$delimiter}${dir}
66- fi
67-}
68-69-PATH_DELIMITER=':'
70-71-addToSearchPath() {
72- addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
73-}
74-75-76-######################################################################
77-# Initialisation.
78-79-set -e
80-81-test -z $NIX_GCC && NIX_GCC=@GCC@
82-83-84-# Wildcard expansions that don't match should expand to an empty list.
85-# This ensures that, for instance, "for i in *; do ...; done" does the
86-# right thing.
87-shopt -s nullglob
88-89-90-# Set up the initial path.
91-PATH=
92-for i in $NIX_GCC @INITIALPATH@; do
93- if test "$i" = /; then i=; fi
94- addToSearchPath PATH $i/bin
95-done
96-97-# Hack: the /tmp of Cygwin is different from the /tmp in MSYS
98-if test -d $NIX_BUILD_TOP; then
99- echo "Nix build top already exists. Strange."
100-else
101- mkdir $NIX_BUILD_TOP
102- cd $NIX_BUILD_TOP
103-fi
104-105-if test "$NIX_DEBUG" = "1"; then
106- echo "initial path: $PATH"
107-fi
108-109-110-# Execute the pre-hook.
111-export SHELL=@SHELL@
112-if test -z "$shell"; then
113- export shell=@SHELL@
114-fi
115-116-# Check that the pre-hook initialised SHELL.
117-if test -z "$SHELL"; then echo "SHELL not set"; exit 1; fi
118-119-120-# Hack: run gcc's setup hook.
121-envHooks=()
122-if test -f $NIX_GCC/nix-support/setup-hook; then
123- source $NIX_GCC/nix-support/setup-hook
124-fi
125-126-127-# Ensure that the given directories exists.
128-ensureDir() {
129- local dir
130- for dir in "$@"; do
131- if ! test -x "$dir"; then mkdir -p "$dir"; fi
132- done
133-}
134-135-installBin() {
136- mkdir -p $out/bin
137- cp "$@" $out/bin
138-}
139-140-141-# Allow the caller to augment buildInputs (it's not always possible to
142-# do this before the call to setup.sh, since the PATH is empty at that
143-# point; here we have a basic Unix environment).
144-runHook addInputsHook
145-146-147-# Recursively find all build inputs.
148-findInputs() {
149- local pkg=$1
150-151- case $pkgs in
152- *\ $pkg\ *)
153- return 0
154- ;;
155- esac
156-157- pkgs="$pkgs $pkg "
158-159- if test -f $pkg/nix-support/setup-hook; then
160- source $pkg/nix-support/setup-hook
161- fi
162-163- if test -f $pkg/nix-support/propagated-build-inputs; then
164- for i in $(cat $pkg/nix-support/propagated-build-inputs); do
165- findInputs $i
166- done
167- fi
168-}
169-170-pkgs=""
171-for i in $buildInputs $propagatedBuildInputs; do
172- findInputs $i
173-done
174-175-176-# Set the relevant environment variables to point to the build inputs
177-# found above.
178-addToEnv() {
179- local pkg=$1
180-181- if test -d $1/bin; then
182- addToSearchPath _PATH $1/bin
183- fi
184-185- # Run the package-specific hooks set by the setup-hook scripts.
186- for i in "${envHooks[@]}"; do
187- $i $pkg
188- done
189-}
190-191-for i in $pkgs; do
192- addToEnv $i
193-done
194-195-196-# Add the output as an rpath.
197-if test "$NIX_NO_SELF_RPATH" != "1"; then
198- export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
199- if test -n "$NIX_LIB64_IN_SELF_RPATH"; then
200- export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS"
201- fi
202-fi
203-204-205-# Set the TZ (timezone) environment variable, otherwise commands like
206-# `date' will complain (e.g., `Tue Mar 9 10:01:47 Local time zone must
207-# be set--see zic manual page 2004').
208-export TZ=UTC
209-210-211-# Set the prefix. This is generally $out, but it can be overriden,
212-# for instance if we just want to perform a test build/install to a
213-# temporary location and write a build report to $out.
214-if test -z "$prefix"; then
215- prefix="$out";
216-fi
217-218-if test "$useTempPrefix" = "1"; then
219- prefix="$NIX_BUILD_TOP/tmp_prefix";
220-fi
221-222-223-PATH=$_PATH${_PATH:+:}$PATH
224-if test "$NIX_DEBUG" = "1"; then
225- echo "final path: $PATH"
226-fi
227-228-229-# Make GNU Make produce nested output.
230-export NIX_INDENT_MAKE=1
231-232-233-######################################################################
234-# Misc. helper functions.
235-236-237-stripDirs() {
238- local dirs="$1"
239- local stripFlags="$2"
240- local dirsNew=
241-242- for d in ${dirs}; do
243- if test -d "$prefix/$d"; then
244- dirsNew="${dirsNew} $prefix/$d "
245- fi
246- done
247- dirs=${dirsNew}
248-249- if test -n "${dirs}"; then
250- header "stripping (with flags $stripFlags) in $dirs"
251- find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
252- stopNest
253- fi
254-}
255-256-257-######################################################################
258-# Textual substitution functions.
259-260-261-substitute() {
262- local input="$1"
263- local output="$2"
264-265- local -a params=("$@")
266- local -a args=()
267-268- local n p pattern replacement varName
269-270- for ((n = 2; n < ${#params[*]}; n += 1)); do
271- p=${params[$n]}
272-273- if test "$p" = "--replace"; then
274- pattern="${params[$((n + 1))]}"
275- replacement="${params[$((n + 2))]}"
276- n=$((n + 2))
277- fi
278-279- if test "$p" = "--subst-var"; then
280- varName="${params[$((n + 1))]}"
281- pattern="@$varName@"
282- replacement="${!varName}"
283- n=$((n + 1))
284- fi
285-286- if test "$p" = "--subst-var-by"; then
287- pattern="@${params[$((n + 1))]}@"
288- replacement="${params[$((n + 2))]}"
289- n=$((n + 2))
290- fi
291-292- if test ${#args[@]} != 0; then
293- args[${#args[@]}]="-a"
294- fi
295- args[${#args[@]}]="$pattern"
296- args[${#args[@]}]="$replacement"
297- done
298-299- replace-literal -e -s -- "${args[@]}" < "$input" > "$output".tmp
300- if test -x "$output"; then
301- chmod +x "$output".tmp
302- fi
303- mv -f "$output".tmp "$output"
304-}
305-306-307-substituteInPlace() {
308- local fileName="$1"
309- shift
310- substitute "$fileName" "$fileName" "$@"
311-}
312-313-314-substituteAll() {
315- local input="$1"
316- local output="$2"
317-318- # Select all environment variables that start with a lowercase character.
319- for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
320- if test "$NIX_DEBUG" = "1"; then
321- echo "$envVar -> ${!envVar}"
322- fi
323- args="$args --subst-var $envVar"
324- done
325-326- substitute "$input" "$output" $args
327-}
328-329-330-######################################################################
331-# What follows is the generic builder.
332-333-334-nestingLevel=0
335-336-startNest() {
337- nestingLevel=$(($nestingLevel + 1))
338- echo -en "\e[$1p"
339-}
340-341-stopNest() {
342- nestingLevel=$(($nestingLevel - 1))
343- echo -en "\e[q"
344-}
345-346-header() {
347- startNest "$2"
348- echo "$1"
349-}
350-351-# Make sure that even when we exit abnormally, the original nesting
352-# level is properly restored.
353-closeNest() {
354- while test $nestingLevel -gt 0; do
355- stopNest
356- done
357-}
358-359-360-# This function is useful for debugging broken Nix builds. It dumps
361-# all environment variables to a file `env-vars' in the build
362-# directory. If the build fails and the `-K' option is used, you can
363-# then go to the build directory and source in `env-vars' to reproduce
364-# the environment used for building.
365-dumpVars() {
366- echo "Dumping env-vars to $NIX_BUILD_TOP/env-vars"
367- if test "$noDumpEnvVars" != "1"; then
368- export > "$NIX_BUILD_TOP/env-vars"
369- fi
370-}
371-372-373-# Utility function: return the base name of the given path, with the
374-# prefix `HASH-' removed, if present.
375-stripHash() {
376- strippedName=$(basename $1);
377- if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then
378- strippedName=$(echo "$strippedName" | cut -c34-)
379- fi
380-}
381-382-383-unpackFile() {
384- curSrc="$1"
385- local cmd
386-387- header "unpacking source archive $curSrc" 3
388-389- case "$curSrc" in
390- *.tar)
391- tar xvf $curSrc
392- ;;
393- *.tar.gz | *.tgz | *.tar.Z)
394- gzip -d < $curSrc | tar xvf -
395- ;;
396- *.tar.bz2 | *.tbz2)
397- bzip2 -d < $curSrc | tar xvf -
398- ;;
399- *.zip)
400- unzip $curSrc
401- ;;
402- *)
403- if test -d "$curSrc"; then
404- stripHash $curSrc
405- cp -prvd $curSrc $strippedName
406- else
407- if test -z "$unpackCmd"; then
408- echo "source archive $curSrc has unknown type"
409- exit 1
410- fi
411- runHook unpackCmd
412- fi
413- ;;
414- esac
415-416- stopNest
417-}
418-419-420-unpackPhase() {
421- runHook preUnpack
422-423- if test -z "$srcs"; then
424- if test -z "$src"; then
425- echo 'variable $src or $srcs should point to the source'
426- exit 1
427- fi
428- srcs="$src"
429- fi
430-431- # To determine the source directory created by unpacking the
432- # source archives, we record the contents of the current
433- # directory, then look below which directory got added. Yeah,
434- # it's rather hacky.
435- local dirsBefore=""
436- for i in *; do
437- if test -d "$i"; then
438- dirsBefore="$dirsBefore $i "
439- fi
440- done
441-442- # Unpack all source archives.
443- for i in $srcs; do
444- unpackFile $i
445- done
446-447- # Find the source directory.
448- if test -n "$setSourceRoot"; then
449- runHook setSourceRoot
450- elif test -z "$sourceRoot"; then
451- sourceRoot=
452- for i in *; do
453- if test -d "$i"; then
454- case $dirsBefore in
455- *\ $i\ *)
456- ;;
457- *)
458- if test -n "$sourceRoot"; then
459- echo "unpacker produced multiple directories"
460- exit 1
461- fi
462- sourceRoot="$i"
463- ;;
464- esac
465- fi
466- done
467- fi
468-469- if test -z "$sourceRoot"; then
470- echo "unpacker appears to have produced no directories"
471- exit 1
472- fi
473-474- echo "source root is $sourceRoot"
475-476- # By default, add write permission to the sources. This is often
477- # necessary when sources have been copied from other store
478- # locations.
479- if test "$dontMakeSourcesWritable" != 1; then
480- chmod -R u+w "$sourceRoot"
481- fi
482-483- runHook postUnpack
484-}
485-486-487-patchPhase() {
488- runHook prePatch
489-490- for i in $patches; do
491- header "applying patch $i" 3
492- local uncompress=cat
493- case $i in
494- *.gz)
495- uncompress="gzip -d"
496- ;;
497- *.bz2)
498- uncompress="bzip2 -d"
499- ;;
500- esac
501- $uncompress < $i | patch ${patchFlags:--p1}
502- stopNest
503- done
504-505- runHook postPatch
506-}
507-508-509-configurePhase() {
510- runHook preConfigure
511-512- if test -z "$configureScript"; then
513- configureScript=./configure
514- if ! test -x $configureScript; then
515- echo "no configure script, doing nothing"
516- return
517- fi
518- fi
519-520- if test -z "$dontAddPrefix"; then
521- configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
522- fi
523-524- # Add --disable-dependency-tracking to speed up some builds.
525- if test -z "$dontAddDisableDepTrack"; then
526- if grep -q dependency-tracking $configureScript; then
527- configureFlags="--disable-dependency-tracking $configureFlags"
528- fi
529- fi
530-531- # By default, disable static builds.
532- if test -z "$dontDisableStatic"; then
533- if grep -q enable-static $configureScript; then
534- configureFlags="--disable-static $configureFlags"
535- fi
536- fi
537-538- echo "configure flags: $configureFlags ${configureFlagsArray[@]}"
539- $configureScript $configureFlags "${configureFlagsArray[@]}"
540-541- runHook postConfigure
542-}
543-544-545-buildPhase() {
546- runHook preBuild
547-548- if test -z "$makeFlags" && ! test -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile"; then
549- echo "no Makefile, doing nothing"
550- return
551- fi
552-553- echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}"
554- make ${makefile:+-f $makefile} \
555- $makeFlags "${makeFlagsArray[@]}" \
556- $buildFlags "${buildFlagsArray[@]}"
557-558- runHook postBuild
559-}
560-561-562-checkPhase() {
563- runHook preCheck
564-565- echo "check flags: $makeFlags ${makeFlagsArray[@]} $checkFlags ${checkFlagsArray[@]}"
566- make ${makefile:+-f $makefile} \
567- $makeFlags "${makeFlagsArray[@]}" \
568- $checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
569-570- runHook postCheck
571-}
572-573-574-patchELF() {
575- # Patch all ELF executables and shared libraries.
576- header "patching ELF executables and libraries"
577- if test -e "$prefix"; then
578- find "$prefix" \( \
579- \( -type f -a -name "*.so*" \) -o \
580- \( -type f -a -perm +0100 \) \
581- \) -print -exec patchelf --shrink-rpath {} \;
582- fi
583- stopNest
584-}
585-586-587-patchShebangs() {
588- # Rewrite all script interpreter file names (`#! /path') under the
589- # specified directory tree to paths found in $PATH. E.g.,
590- # /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
591- # Interpreters that are already in the store are left untouched.
592- header "patching script interpreter paths"
593- local dir="$1"
594- local f
595- for f in $(find "$dir" -type f -perm +0100); do
596- local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
597- if test -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE"; then
598- local newPath=$(type -P $(basename $oldPath) || true)
599- if test -n "$newPath" -a "$newPath" != "$oldPath"; then
600- echo "$f: interpreter changed from $oldPath to $newPath"
601- sed -i -e "1 s,$oldPath,$newPath," "$f"
602- fi
603- fi
604- done
605- stopNest
606-}
607-608-609-installPhase() {
610- runHook preInstall
611-612- mkdir -p "$prefix"
613-614- installTargets=${installTargets:-install}
615- echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}"
616- make ${makefile:+-f $makefile} $installTargets \
617- $makeFlags "${makeFlagsArray[@]}" \
618- $installFlags "${installFlagsArray[@]}"
619-620- runHook postInstall
621-}
622-623-624-# The fixup phase performs generic, package-independent, Nix-related
625-# stuff, like running patchelf and setting the
626-# propagated-build-inputs. It should rarely be overriden.
627-fixupPhase() {
628- runHook preFixup
629-630- # Put man/doc/info under $out/share.
631- forceShare=${forceShare:=man doc info}
632- if test -n "$forceShare"; then
633- for d in $forceShare; do
634- if test -d "$prefix/$d"; then
635- if test -d "$prefix/share/$d"; then
636- echo "both $d/ and share/$d/ exists!"
637- else
638- echo "fixing location of $d/ subdirectory"
639- mkdir -p $prefix/share
640- if test -w $prefix/share; then
641- mv -v $prefix/$d $prefix/share
642- ln -sv $prefix/share/$d $prefix/$d
643- fi
644- fi
645- fi
646- done;
647- fi
648-649- # TODO: strip _only_ ELF executables, and return || fail here...
650- if test -z "$dontStrip"; then
651- stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
652- if test -n "$stripDebugList"; then
653- stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
654- fi
655-656- stripAllList=${stripAllList:-}
657- if test -n "$stripAllList"; then
658- stripDirs "$stripAllList" "${stripAllFlags:--s}"
659- fi
660- fi
661-662- if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
663- patchELF "$prefix"
664- fi
665-666- if test -z "$dontPatchShebangs"; then
667- patchShebangs "$prefix"
668- fi
669-670- if test -n "$propagatedBuildInputs"; then
671- mkdir -p "$out/nix-support"
672- echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
673- fi
674-675- if test -n "$setupHook"; then
676- mkdir -p "$out/nix-support"
677- substituteAll "$setupHook" "$out/nix-support/setup-hook"
678- fi
679-680- runHook postFixup
681-}
682-683-684-distPhase() {
685- runHook preDist
686-687- echo "dist flags: $distFlags ${distFlagsArray[@]}"
688- make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
689-690- if test "$dontCopyDist" != 1; then
691- mkdir -p "$out/tarballs"
692-693- # Note: don't quote $tarballs, since we explicitly permit
694- # wildcards in there.
695- cp -pvd ${tarballs:-*.tar.gz} $out/tarballs
696- fi
697-698- runHook postDist
699-}
700-701-702-showPhaseHeader() {
703- local phase="$1"
704- case $phase in
705- unpackPhase) header "unpacking sources";;
706- patchPhase) header "patching sources";;
707- configurePhase) header "configuring";;
708- buildPhase) header "building";;
709- checkPhase) header "running tests";;
710- installPhase) header "installing";;
711- fixupPhase) header "post-installation fixup";;
712- *) header "$phase";;
713- esac
714-}
715-716-717-genericBuild() {
718- header "building $out"
719-720- if test -n "$buildCommand"; then
721- eval "$buildCommand"
722- return
723- fi
724-725- if test -z "$phases"; then
726- phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
727- configurePhase $preBuildPhases buildPhase checkPhase \
728- $preInstallPhases installPhase $preFixupPhases fixupPhase \
729- $preDistPhases distPhase $postPhases";
730- fi
731-732- for curPhase in $phases; do
733- if test "$curPhase" = buildPhase -a -n "$dontBuild"; then continue; fi
734- if test "$curPhase" = checkPhase -a -z "$doCheck"; then continue; fi
735- if test "$curPhase" = installPhase -a -n "$dontInstall"; then continue; fi
736- if test "$curPhase" = fixupPhase -a -n "$dontFixup"; then continue; fi
737- if test "$curPhase" = distPhase -a -z "$doDist"; then continue; fi
738-739- showPhaseHeader "$curPhase"
740- dumpVars
741-742- # Evaluate the variable named $curPhase if it exists, otherwise the
743- # function named $curPhase.
744- eval "${!curPhase:-$curPhase}"
745-746- if test "$curPhase" = unpackPhase; then
747- cd "${sourceRoot:-.}"
748- fi
749-750- stopNest
751- done
752-753- stopNest
754-}
755-756-757-758-759-dumpVars
···8{ # The system (e.g., `i686-linux') for which to build the packages.
9 system ? builtins.currentSystem
1011- # Usually, the system type uniquely determines the stdenv and thus
12- # how to build the packages. But on some platforms we have
13- # different stdenvs, leading to different ways to build the
14- # packages. For instance, on Windows we support both Cygwin and
15- # Mingw builds. In both cases, `system' is `i686-cygwin'. The
16- # attribute `stdenvType' is used to select the specific kind of
17- # stdenv to use, e.g., `i686-mingw'.
18-, stdenvType ? system
19-20, # The standard environment to use. Only used for bootstrapping. If
21 # null, the default standard environment is used.
22 bootStdenv ? null
···137 self_ = with self; helperFunctions // {
138139 # Make some arguments passed to all-packages.nix available
140- inherit system stdenvType platform;
141142 # Allow callPackage to fill in the pkgs argument
143 inherit pkgs;
···213214215 allStdenvs = import ../stdenv {
216- inherit system stdenvType platform config;
217 allPackages = args: import ./all-packages.nix ({ inherit config system; } // args);
218 };
219
···8{ # The system (e.g., `i686-linux') for which to build the packages.
9 system ? builtins.currentSystem
1000000000011, # The standard environment to use. Only used for bootstrapping. If
12 # null, the default standard environment is used.
13 bootStdenv ? null
···128 self_ = with self; helperFunctions // {
129130 # Make some arguments passed to all-packages.nix available
131+ inherit system platform;
132133 # Allow callPackage to fill in the pkgs argument
134 inherit pkgs;
···204205206 allStdenvs = import ../stdenv {
207+ inherit system platform config;
208 allPackages = args: import ./all-packages.nix ({ inherit config system; } // args);
209 };
210