···1313 };
1414 buildInputs = [ python ];
1515 installPhase = ''
1616- ensureDir $out/bin
1616+ mkdir -p $out/bin
1717 # Make it work for kernels 3.x, not so different than 2.6
1818 sed -i 's/2\.6/4.0/' system_health.py
1919 cp system_health.py $out/bin
···10101111 buildInputs = [ libogg ];
12121313- doCheck = true; # takes lots of time but will be run rarely (small build-time closure)
1313+ #doCheck = true; # takes lots of time
14141515 meta = with stdenv.lib; {
1616 homepage = http://xiph.org/flac/;
···248248249249 ./Setup copy
250250251251- ensureDir $out/bin # necessary to get it added to PATH
251251+ mkdir -p $out/bin # necessary to get it added to PATH
252252253253 local confDir=$out/lib/ghc-${ghc.ghc.version}/package.conf.d
254254 local installedPkgConf=$confDir/${self.fname}.installedconf
255255 local pkgConf=$confDir/${self.fname}.conf
256256- ensureDir $confDir
256256+ mkdir -p $confDir
257257 ./Setup register --gen-pkg-config=$pkgConf
258258 if test -f $pkgConf; then
259259 echo '[]' > $installedPkgConf
···265265 fi
266266267267 ${optionalString (self.enableSharedExecutables && self.isExecutable && self.stdenv.isDarwin) ''
268268- for exe in $out/bin/* ; do
268268+ for exe in "$out/bin/"* ; do
269269 install_name_tool -add_rpath \
270270 $out/lib/${ghc.ghc.name}/${self.pname}-${self.version} $exe
271271 done
···11#! @shell@ -e
2233-if test -n "$NIX_CLANG_WRAPPER_START_HOOK"; then
44- source "$NIX_CLANG_WRAPPER_START_HOOK"
33+if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then
44+ source "$NIX_GCC_WRAPPER_START_HOOK"
55fi
6677-if test -z "$NIX_CLANG_WRAPPER_FLAGS_SET"; then
77+if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
88 source @out@/nix-support/add-flags.sh
99fi
1010
···11-#! @shell@ -e
22-33-if test -n "$NIX_LD_WRAPPER_START_HOOK"; then
44- source "$NIX_LD_WRAPPER_START_HOOK"
55-fi
66-77-if test -z "$NIX_CLANG_WRAPPER_FLAGS_SET"; then
88- source @out@/nix-support/add-flags.sh
99-fi
1010-1111-source @out@/nix-support/utils.sh
1212-1313-1414-# Optionally filter out paths not refering to the store.
1515-params=("$@")
1616-if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \
1717- -a \( -z "$NIX_IGNORE_LD_THROUGH_CLANG" -o -z "$NIX_LDFLAGS_SET" \); then
1818- rest=()
1919- n=0
2020- while test $n -lt ${#params[*]}; do
2121- p=${params[n]}
2222- p2=${params[$((n+1))]}
2323- if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
2424- skip $p
2525- elif test "$p" = "-L" && badPath "$p2"; then
2626- n=$((n + 1)); skip $p2
2727- elif test "$p" = "-rpath" && badPath "$p2"; then
2828- n=$((n + 1)); skip $p2
2929- elif test "$p" = "-dynamic-linker" && badPath "$p2"; then
3030- n=$((n + 1)); skip $p2
3131- elif test "${p:0:1}" = "/" && badPath "$p"; then
3232- # We cannot skip this; barf.
3333- echo "impure path \`$p' used in link" >&2
3434- exit 1
3535- elif test "${p:0:9}" = "--sysroot"; then
3636- # Our ld is not built with sysroot support (Can we fix that?)
3737- :
3838- else
3939- rest=("${rest[@]}" "$p")
4040- fi
4141- n=$((n + 1))
4242- done
4343- params=("${rest[@]}")
4444-fi
4545-4646-4747-extra=()
4848-extraBefore=()
4949-5050-if test -z "$NIX_LDFLAGS_SET"; then
5151- extra=(${extra[@]} $NIX_LDFLAGS)
5252- extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE)
5353-fi
5454-5555-5656-# Add all used dynamic libraries to the rpath.
5757-if test "$NIX_DONT_SET_RPATH" != "1"; then
5858-5959- libPath=""
6060- addToLibPath() {
6161- local path="$1"
6262- if test "${path:0:1}" != "/"; then return 0; fi
6363- case "$path" in
6464- *..*|*./*|*/.*|*//*)
6565- local path2
6666- if path2=$(readlink -f "$path"); then
6767- path="$path2"
6868- fi
6969- ;;
7070- esac
7171- case $libPath in
7272- *\ $path\ *) return 0 ;;
7373- esac
7474- libPath="$libPath $path "
7575- }
7676-7777- addToRPath() {
7878- # If the path is not in the store, don't add it to the rpath.
7979- # This typically happens for libraries in /tmp that are later
8080- # copied to $out/lib. If not, we're screwed.
8181- if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi
8282- case $rpath in
8383- *\ $1\ *) return 0 ;;
8484- esac
8585- rpath="$rpath $1 "
8686- }
8787-8888- libs=""
8989- addToLibs() {
9090- libs="$libs $1"
9191- }
9292-9393- rpath=""
9494-9595- # First, find all -L... switches.
9696- allParams=("${params[@]}" ${extra[@]})
9797- n=0
9898- while test $n -lt ${#allParams[*]}; do
9999- p=${allParams[n]}
100100- p2=${allParams[$((n+1))]}
101101- if test "${p:0:3}" = "-L/"; then
102102- addToLibPath ${p:2}
103103- elif test "$p" = "-L"; then
104104- addToLibPath ${p2}
105105- n=$((n + 1))
106106- elif test "$p" = "-l"; then
107107- addToLibs ${p2}
108108- n=$((n + 1))
109109- elif test "${p:0:2}" = "-l"; then
110110- addToLibs ${p:2}
111111- elif test "$p" = "-dynamic-linker"; then
112112- # Ignore the dynamic linker argument, or it
113113- # will get into the next 'elif'. We don't want
114114- # the dynamic linker path rpath to go always first.
115115- n=$((n + 1))
116116- elif [[ "$p" =~ ^[^-].*\.so($|\.) ]]; then
117117- # This is a direct reference to a shared library, so add
118118- # its directory to the rpath.
119119- path="$(dirname "$p")";
120120- addToRPath "${path}"
121121- fi
122122- n=$((n + 1))
123123- done
124124-125125- # Second, for each directory in the library search path (-L...),
126126- # see if it contains a dynamic library used by a -l... flag. If
127127- # so, add the directory to the rpath.
128128- # It's important to add the rpath in the order of -L..., so
129129- # the link time chosen objects will be those of runtime linking.
130130-131131- for i in $libPath; do
132132- for j in $libs; do
133133- if test -f "$i/lib$j.so"; then
134134- addToRPath $i
135135- break
136136- fi
137137- done
138138- done
139139-140140-141141- # Finally, add `-rpath' switches.
142142- for i in $rpath; do
143143- extra=(${extra[@]} -rpath $i)
144144- done
145145-fi
146146-147147-148148-# Optionally print debug info.
149149-if test "$NIX_DEBUG" = "1"; then
150150- echo "original flags to @ld@:" >&2
151151- for i in "${params[@]}"; do
152152- echo " $i" >&2
153153- done
154154- echo "extra flags to @ld@:" >&2
155155- for i in ${extra[@]}; do
156156- echo " $i" >&2
157157- done
158158-fi
159159-160160-if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then
161161- source "$NIX_LD_WRAPPER_EXEC_HOOK"
162162-fi
163163-164164-exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
-24
pkgs/build-support/clang-wrapper/utils.sh
···11-skip () {
22- if test "$NIX_DEBUG" = "1"; then
33- echo "skipping impure path $1" >&2
44- fi
55-}
66-77-88-# Checks whether a path is impure. E.g., `/lib/foo.so' is impure, but
99-# `/nix/store/.../lib/foo.so' isn't.
1010-badPath() {
1111- local p=$1
1212-1313- # Relative paths are okay (since they're presumably relative to
1414- # the temporary build directory).
1515- if test "${p:0:1}" != "/"; then return 1; fi
1616-1717- # Otherwise, the path should refer to the store or some temporary
1818- # directory (including the build directory).
1919- test \
2020- "$p" != "/dev/null" -a \
2121- "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
2222- "${p:0:4}" != "/tmp" -a \
2323- "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
2424-}
···3232 # We cannot skip this; barf.
3333 echo "impure path \`$p' used in link" >&2
3434 exit 1
3535+ elif test "${p:0:9}" = "--sysroot"; then
3636+ # Our ld is not built with sysroot support (Can we fix that?)
3737+ :
3538 else
3639 rest=("${rest[@]}" "$p")
3740 fi
···4548extraBefore=()
46494750if test -z "$NIX_LDFLAGS_SET"; then
4848- extra=(${extra[@]} $NIX_LDFLAGS)
4949- extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE)
5151+ extra+=($NIX_LDFLAGS)
5252+ extraBefore+=($NIX_LDFLAGS_BEFORE)
5053fi
5454+5555+extra+=($NIX_LDFLAGS_AFTER)
515652575358# Add all used dynamic libraries to the rpath.
···109109 fi
110110 fi
111111112112-113112 # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
114113 # the startfiles.
115114 # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
116115 # for the startfiles.
117117- makeFlagsArray=( \
118118- "${makeFlagsArray[@]}" \
116116+ makeFlagsArray+=( \
119117 NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
120118 SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
121119 CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
···128126 )
129127130128 if test -z "$targetConfig"; then
131131- makeFlagsArray=( \
132132- "${makeFlagsArray[@]}" \
129129+ makeFlagsArray+=( \
133130 BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
134131 BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
135132 )
···138135 if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
139136 # We don't want the gcc build to assume there will be a libc providing
140137 # limits.h in this stagae
141141- makeFlagsArray=( \
142142- "${makeFlagsArray[@]}" \
138138+ makeFlagsArray+=( \
143139 LIMITS_H_TEST=false \
144140 )
145141 else
146146- makeFlagsArray=( \
147147- "${makeFlagsArray[@]}" \
142142+ makeFlagsArray+=( \
148143 LIMITS_H_TEST=true \
149144 )
150145 fi
···163158 # Patch to get armvt5el working:
164159 sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
165160 fi
161161+166162 # Bug - they packaged zlib
167163 if test -d "zlib"; then
168164 # This breaks the build without-headers, which should build only
···189185 fi
190186191187 # Eval the preConfigure script from nix expression.
192192- eval $providedPreConfigure;
193193- env;
188188+ eval "$providedPreConfigure"
189189+194190 # Perform the build in a different directory.
195191 mkdir ../build
196192 cd ../build
···201197postConfigure() {
202198 # Don't store the configure flags in the resulting executables.
203199 sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile
200200+}
201201+202202+203203+preInstall() {
204204+ # Make ‘lib64’ a symlink to ‘lib’.
205205+ if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
206206+ mkdir -p $out/lib
207207+ ln -s lib $out/lib64
208208+ fi
204209}
205210206211
···11findGdkPixbufLoaders() {
2233- if [ -z "$IN_NIX_SHELL" ]; then
33+ if [ -n "$out" ] && [ -z "$IN_NIX_SHELL" ]; then
4455 # set pixbuf loaders.cache for this package
66
···11+Fix compilation on Mac OS X with gcc 4.8.
22+33+diff -ru glib-2.40.0-orig/gio/gdummyfile.c glib-2.40.0/gio/gdummyfile.c
44+--- glib-2.40.0-orig/gio/gdummyfile.c 2014-02-03 18:40:41.000000000 +0100
55++++ glib-2.40.0/gio/gdummyfile.c 2014-07-15 10:58:31.000000000 +0200
66+@@ -454,7 +454,8 @@
77+ result = g_malloc (escaped_string_end - escaped_string + 1);
88+99+ out = result;
1010+- for (in = escaped_string; in < escaped_string_end; in++)
1111++ in = escaped_string;
1212++ for (; in < escaped_string_end; in++)
1313+ {
1414+ character = *in;
1515+ if (*in == '%')
1616+@@ -551,6 +552,7 @@
1717+1818+ decoded->scheme = g_malloc (p - uri);
1919+ out = decoded->scheme;
2020+- for (in = uri; in < p - 1; in++)
2121++ in = uri;
2222++ for (; in < p - 1; in++)
2323+ *out++ = g_ascii_tolower (*in);
2424+ *out = 0;
···1515 #--disable-fftw disable usage of FFTW
1616 #--disable-cpu-clip disable tricky cpu specific clipper
17171818- # need headers from the Carbon.framework in /System/Library/Frameworks to
1919- # compile this on darwin -- not sure how to handle
2020- NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
2121- "-I/System/Library/Frameworks/Carbon.framework/Versions/A/Headers";
1818+ postConfigure = stdenv.lib.optionalString stdenv.isDarwin
1919+ ''
2020+ # need headers from the Carbon.framework in /System/Library/Frameworks to
2121+ # compile this on darwin -- not sure how to handle
2222+ NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
2323+2424+ substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
2525+ '';
22262327 meta = with stdenv.lib; {
2428 description = "Sample Rate Converter for audio";
+7-2
pkgs/development/libraries/libsndfile/default.nix
···12121313 # need headers from the Carbon.framework in /System/Library/Frameworks to
1414 # compile this on darwin -- not sure how to handle
1515- NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
1616- "-I/System/Library/Frameworks/Carbon.framework/Versions/A/Headers";
1515+ preConfigure = stdenv.lib.optionalString stdenv.isDarwin
1616+ ''
1717+ NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
1818+ '';
1919+2020+ # Needed on Darwin.
2121+ NIX_CFLAGS_LINK = "-logg -lvorbis";
17221823 meta = with stdenv.lib; {
1924 description = "A C library for reading and writing files containing sampled sound";
+2-2
pkgs/development/libraries/mesa/default.nix
···2424*/
25252626let
2727- version = "10.2.4";
2727+ version = "10.2.5";
2828 # this is the default search path for DRI drivers
2929 driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32";
3030in
···35353636 src = fetchurl {
3737 url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
3838- sha256 = "06l18j9vshq2xzhnp6zd6pw0dlfy0qg1cw4zyn1w51gb8h9398h6";
3838+ sha256 = "039is15p8pkhf8m0yiyb72zybl63xb9ckqzcg3xwi8zlyw5ryidl";
3939 };
40404141 prePatch = "patchShebangs .";
+13-15
pkgs/development/libraries/ncurses/default.nix
···11-{stdenv, fetchurl, unicode ? true}:
11+{ lib, stdenv, fetchurl, unicode ? true }:
2233let
44 /* C++ bindings fail to build on `i386-pc-solaris2.11' with GCC 3.4.3:
···1010 So disable them for now. */
1111 cxx = !stdenv.isSunOS;
1212in
1313-stdenv.mkDerivation (rec {
1313+stdenv.mkDerivation rec {
1414 name = "ncurses-5.9";
15151616 src = fetchurl {
···1818 sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
1919 };
20202121- clangPatch = fetchurl {
2222- # Patch referenced from https://github.com/Homebrew/homebrew-dupes/issues/43
2323- url = "http://lists.gnu.org/archive/html/bug-ncurses/2011-04/txtkWQqiQvcZe.txt";
2424- sha256 = "03lrwqvb0r2qgi8hz7ayd3g26d6xilr3c92j8li3b77kdc0w0rlv";
2525- };
2626-2727- patches = [ ./patch-ac ] ++ stdenv.lib.optional stdenv.isDarwin clangPatch;
2121+ patches = [ ./patch-ac ];
28222923 configureFlags = ''
3024 --with-shared --without-debug --enable-pc-files --enable-symlinks
···4135 export configureFlags="$configureFlags --includedir=$out/include"
4236 export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
4337 mkdir -p "$PKG_CONFIG_LIBDIR"
3838+ '' + lib.optionalString stdenv.isDarwin ''
3939+ substituteInPlace configure --replace -no-cpp-precomp ""
4440 '';
45414642 selfNativeBuildInput = true;
···5046 preBuild =
5147 # On Darwin, we end up using the native `sed' during bootstrap, and it
5248 # fails to run this command, which isn't needed anyway.
5353- stdenv.lib.optionalString (!stdenv.isDarwin)
5454- ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
4949+ lib.optionalString (!stdenv.isDarwin)
5050+ ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
55515652 # When building a wide-character (Unicode) build, create backward
5753 # compatibility links from the the "normal" libraries to the
···7167 ln -svf ncursesw5-config $out/bin/ncurses5-config
7268 '' else "";
73697070+ postFixup = lib.optionalString stdenv.isDarwin "rm $out/lib/*.so";
7171+7472 meta = {
7573 description = "GNU Ncurses, a free software emulation of curses in SVR4 and more";
7674···90889189 homepage = http://www.gnu.org/software/ncurses/;
92909393- license = stdenv.lib.licenses.mit;
9191+ license = lib.licenses.mit;
94929595- maintainers = [ stdenv.lib.maintainers.ludo ];
9696- platforms = stdenv.lib.platforms.all;
9393+ maintainers = [ lib.maintainers.ludo ];
9494+ platforms = lib.platforms.all;
9795 };
9898-} // ( if stdenv.isDarwin then { postFixup = "rm $out/lib/*.so"; } else { } ) )
9696+}
···11+diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf
22+--- support/shobj-conf 2014-02-24 03:06:29.000000000 +0100
33++++ support/shobj-conf 2014-07-22 11:18:52.000000000 +0200
44+@@ -194,9 +194,6 @@
55+ # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
66+ *)
77+ case "${host_os}" in
88+- darwin[89]*|darwin1[012]*)
99+- SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
1010+- ;;
1111+ *) # Mac OS X 10.9 (Mavericks) and later
1212+ SHOBJ_ARCHFLAGS=
1313+ # for 32 and 64bit universal library
···178178179179 # Create wrappers to the most important tools and platform tools so that we can run them if the SDK is in our PATH
180180181181- ensureDir $out/bin
181181+ mkdir -p $out/bin
182182183183 for i in $out/libexec/android-sdk-*/tools/*
184184 do
···1414 # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
1515 # details.
1616 # There are many test failures on `i386-pc-solaris2.11'.
1717- doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
1717+ #doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
1818+ doCheck = false;
18191920 # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the
2021 # "fixed" path in generated files!
···20202121 installPhase = ''
2222 kernelVersion=${kernel.modDirVersion}
2323- ensureDir $out/lib/modules/$kernelVersion/misc
2323+ mkdir -p $out/lib/modules/$kernelVersion/misc
2424 cp frandom.ko $out/lib/modules/$kernelVersion/misc
25252626- ensureDir $out/lib/udev/rules.d
2626+ mkdir -p $out/lib/udev/rules.d
2727 tee $out/lib/udev/rules.d/10-frandom.rules <<-EOF
2828 #
2929 # These are the rules for the frandom devices. In theory, we could let
···991010 builder = writeScript "builder.sh" ''
1111 . ${stdenv}/setup
1212- ensureDir $out/share/dictd/
1212+ mkdir -p $out/share/dictd/
1313 cd $out/share/dictd
14141515 for i in ${wordnet}/dict/data.*; do
···1616 '';
17171818 installPhase = ''
1919- ensureDir $out/bin
1919+ mkdir -p $out/bin
2020 mv serf $out/bin/serf
2121 '';
22222323 meta = with stdenv.lib; {
2424- description = "Serf is a service discovery and orchestration tool that is decentralized, highly available, and fault tolerant";
2424+ description = "A service discovery and orchestration tool that is decentralized, highly available, and fault tolerant";
2525 homepage = http://www.serfdom.io/;
2626 license = licenses.mpl20;
2727 maintainers = with maintainers; [ msackman cstrahan ];
···55# Posix utilities, the GNU C compiler, and so on. On other systems,
66# we use the native C library.
7788-99-# stdenvType exists to support multiple kinds of stdenvs on the same
1010-# system, e.g., cygwin and mingw builds on i686-cygwin. Most people
1111-# can ignore it.
1212-1313-{ system, stdenvType ? system, allPackages ? import ../.., platform, config }:
1414-1515-assert system != "i686-cygwin" -> system == stdenvType;
88+{ system, allPackages ? import ../.., platform, config }:
16917101811rec {
···4538 stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux;
463947404848- # MinGW/MSYS standard environment.
4949- stdenvMinGW = import ./mingw {
5050- inherit system;
5151- };
5252-5353-5441 # Select the appropriate stdenv for the platform `system'.
5542 stdenv =
5656- if stdenvType == "i686-linux" then stdenvLinux else
5757- if stdenvType == "x86_64-linux" then stdenvLinux else
5858- if stdenvType == "armv5tel-linux" then stdenvLinux else
5959- if stdenvType == "armv6l-linux" then stdenvLinux else
6060- if stdenvType == "armv7l-linux" then stdenvLinux else
6161- if stdenvType == "mips64el-linux" then stdenvLinux else
6262- if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
6363- if stdenvType == "i686-mingw" then stdenvMinGW else
6464- if stdenvType == "x86_64-darwin" then stdenvNix else
6565- if stdenvType == "x86_64-solaris" then stdenvNix else
4343+ if system == "i686-linux" then stdenvLinux else
4444+ if system == "x86_64-linux" then stdenvLinux else
4545+ if system == "armv5tel-linux" then stdenvLinux else
4646+ if system == "armv6l-linux" then stdenvLinux else
4747+ if system == "armv7l-linux" then stdenvLinux else
4848+ if system == "mips64el-linux" then stdenvLinux else
4949+ if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
5050+ if system == "x86_64-darwin" then stdenvNix else
5151+ if system == "x86_64-solaris" then stdenvNix else
6652 stdenvNative;
6753}
···103103104104# Execute the pre-hook.
105105export SHELL=@shell@
106106+export CONFIG_SHELL="$SHELL"
106107if [ -z "$shell" ]; then export shell=@shell@; fi
107108runHook preHook
108109···120121121122# Ensure that the given directories exists.
122123ensureDir() {
124124+ echo "warning: ‘ensureDir’ is deprecated; use ‘mkdir’ instead" >&2
123125 local dir
124126 for dir in "$@"; do
125127 if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi
···116116117117 buildCommand = ''
118118 set -x
119119- ensureDir $out/bin $out/lib $out/libexec
119119+ mkdir -p $out/bin $out/lib $out/libexec
120120121121 # Copy what we need of Glibc.
122122 cp -d ${glibc}/lib/ld-*.so* $out/lib
-18
pkgs/stdenv/mingw/builder.sh
···11-# the other stdenv could change the SHELL variable,
22-# so we have to remember its value.
33-origShell=$SHELL
44-origGcc=$GCC
55-66-source $STDENV/setup
77-88-mkdir $OUT
99-1010-SHELL=$origShell
1111-GCC=$origGcc
1212-1313-export NIX_BUILD_TOP=$(pwd)
1414-1515-substitute "$SETUP" "$OUT/setup" \
1616- --subst-var INITIALPATH \
1717- --subst-var GCC \
1818- --subst-var SHELL
···11-source $stdenv/setup
22-33-mkdir $out
44-cd $out
55-tar zxvf $src
66-77-# Make the Nix store available to MSYS.
88-# Hack: we are assuming that the stdenv is based on Cygwin.
99-1010-nixdir="$(cygpath --windows /nix)"
1111-mkdir $out/nix
1212-cat > $out/etc/fstab <<EOF
1313-#Win32_Path Mount_Point
1414-$nixdir /nix
1515-EOF
···11-# Run the named hook, either by calling the function with that name or
22-# by evaluating the variable with that name. This allows convenient
33-# setting of hooks both from Nix expressions (as attributes /
44-# environment variables) and from shell scripts (as functions).
55-runHook() {
66- local hookName="$1"
77- if test "$(type -t $hookName)" = function; then
88- $hookName
99- else
1010- eval "${!hookName}"
1111- fi
1212-}
1313-1414-1515-exitHandler() {
1616- exitCode=$?
1717- set +e
1818-1919- closeNest
2020-2121- if test -n "$showBuildStats"; then
2222- times > "$NIX_BUILD_TOP/.times"
2323- local -a times=($(cat "$NIX_BUILD_TOP/.times"))
2424- # Print the following statistics:
2525- # - user time for the shell
2626- # - system time for the shell
2727- # - user time for all child processes
2828- # - system time for all child processes
2929- echo "build time elapsed: " ${times[*]}
3030- fi
3131-3232- if test $exitCode != 0; then
3333- runHook failureHook
3434-3535- # If the builder had a non-zero exit code and
3636- # $succeedOnFailure is set, create the file
3737- # `$out/nix-support/failed' to signal failure, and exit
3838- # normally. Otherwise, return the original exit code.
3939- if test -n "$succeedOnFailure"; then
4040- echo "build failed with exit code $exitCode (ignored)"
4141- mkdir -p "$out/nix-support"
4242- echo -n $exitCode > "$out/nix-support/failed"
4343- exit 0
4444- fi
4545-4646- else
4747- runHook exitHook
4848- fi
4949-5050- exit $exitCode
5151-}
5252-5353-trap "exitHandler" EXIT
5454-5555-5656-######################################################################
5757-# Helper functions that might be useful in setup hooks.
5858-5959-6060-addToSearchPathWithCustomDelimiter() {
6161- local delimiter=$1
6262- local varName=$2
6363- local dir=$3
6464- if [ -d "$dir" ]; then
6565- eval export ${varName}=${!varName}${!varName:+$delimiter}${dir}
6666- fi
6767-}
6868-6969-PATH_DELIMITER=':'
7070-7171-addToSearchPath() {
7272- addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
7373-}
7474-7575-7676-######################################################################
7777-# Initialisation.
7878-7979-set -e
8080-8181-test -z $NIX_GCC && NIX_GCC=@GCC@
8282-8383-8484-# Wildcard expansions that don't match should expand to an empty list.
8585-# This ensures that, for instance, "for i in *; do ...; done" does the
8686-# right thing.
8787-shopt -s nullglob
8888-8989-9090-# Set up the initial path.
9191-PATH=
9292-for i in $NIX_GCC @INITIALPATH@; do
9393- if test "$i" = /; then i=; fi
9494- addToSearchPath PATH $i/bin
9595-done
9696-9797-# Hack: the /tmp of Cygwin is different from the /tmp in MSYS
9898-if test -d $NIX_BUILD_TOP; then
9999- echo "Nix build top already exists. Strange."
100100-else
101101- mkdir $NIX_BUILD_TOP
102102- cd $NIX_BUILD_TOP
103103-fi
104104-105105-if test "$NIX_DEBUG" = "1"; then
106106- echo "initial path: $PATH"
107107-fi
108108-109109-110110-# Execute the pre-hook.
111111-export SHELL=@SHELL@
112112-if test -z "$shell"; then
113113- export shell=@SHELL@
114114-fi
115115-116116-# Check that the pre-hook initialised SHELL.
117117-if test -z "$SHELL"; then echo "SHELL not set"; exit 1; fi
118118-119119-120120-# Hack: run gcc's setup hook.
121121-envHooks=()
122122-if test -f $NIX_GCC/nix-support/setup-hook; then
123123- source $NIX_GCC/nix-support/setup-hook
124124-fi
125125-126126-127127-# Ensure that the given directories exists.
128128-ensureDir() {
129129- local dir
130130- for dir in "$@"; do
131131- if ! test -x "$dir"; then mkdir -p "$dir"; fi
132132- done
133133-}
134134-135135-installBin() {
136136- mkdir -p $out/bin
137137- cp "$@" $out/bin
138138-}
139139-140140-141141-# Allow the caller to augment buildInputs (it's not always possible to
142142-# do this before the call to setup.sh, since the PATH is empty at that
143143-# point; here we have a basic Unix environment).
144144-runHook addInputsHook
145145-146146-147147-# Recursively find all build inputs.
148148-findInputs() {
149149- local pkg=$1
150150-151151- case $pkgs in
152152- *\ $pkg\ *)
153153- return 0
154154- ;;
155155- esac
156156-157157- pkgs="$pkgs $pkg "
158158-159159- if test -f $pkg/nix-support/setup-hook; then
160160- source $pkg/nix-support/setup-hook
161161- fi
162162-163163- if test -f $pkg/nix-support/propagated-build-inputs; then
164164- for i in $(cat $pkg/nix-support/propagated-build-inputs); do
165165- findInputs $i
166166- done
167167- fi
168168-}
169169-170170-pkgs=""
171171-for i in $buildInputs $propagatedBuildInputs; do
172172- findInputs $i
173173-done
174174-175175-176176-# Set the relevant environment variables to point to the build inputs
177177-# found above.
178178-addToEnv() {
179179- local pkg=$1
180180-181181- if test -d $1/bin; then
182182- addToSearchPath _PATH $1/bin
183183- fi
184184-185185- # Run the package-specific hooks set by the setup-hook scripts.
186186- for i in "${envHooks[@]}"; do
187187- $i $pkg
188188- done
189189-}
190190-191191-for i in $pkgs; do
192192- addToEnv $i
193193-done
194194-195195-196196-# Add the output as an rpath.
197197-if test "$NIX_NO_SELF_RPATH" != "1"; then
198198- export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
199199- if test -n "$NIX_LIB64_IN_SELF_RPATH"; then
200200- export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS"
201201- fi
202202-fi
203203-204204-205205-# Set the TZ (timezone) environment variable, otherwise commands like
206206-# `date' will complain (e.g., `Tue Mar 9 10:01:47 Local time zone must
207207-# be set--see zic manual page 2004').
208208-export TZ=UTC
209209-210210-211211-# Set the prefix. This is generally $out, but it can be overriden,
212212-# for instance if we just want to perform a test build/install to a
213213-# temporary location and write a build report to $out.
214214-if test -z "$prefix"; then
215215- prefix="$out";
216216-fi
217217-218218-if test "$useTempPrefix" = "1"; then
219219- prefix="$NIX_BUILD_TOP/tmp_prefix";
220220-fi
221221-222222-223223-PATH=$_PATH${_PATH:+:}$PATH
224224-if test "$NIX_DEBUG" = "1"; then
225225- echo "final path: $PATH"
226226-fi
227227-228228-229229-# Make GNU Make produce nested output.
230230-export NIX_INDENT_MAKE=1
231231-232232-233233-######################################################################
234234-# Misc. helper functions.
235235-236236-237237-stripDirs() {
238238- local dirs="$1"
239239- local stripFlags="$2"
240240- local dirsNew=
241241-242242- for d in ${dirs}; do
243243- if test -d "$prefix/$d"; then
244244- dirsNew="${dirsNew} $prefix/$d "
245245- fi
246246- done
247247- dirs=${dirsNew}
248248-249249- if test -n "${dirs}"; then
250250- header "stripping (with flags $stripFlags) in $dirs"
251251- find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
252252- stopNest
253253- fi
254254-}
255255-256256-257257-######################################################################
258258-# Textual substitution functions.
259259-260260-261261-substitute() {
262262- local input="$1"
263263- local output="$2"
264264-265265- local -a params=("$@")
266266- local -a args=()
267267-268268- local n p pattern replacement varName
269269-270270- for ((n = 2; n < ${#params[*]}; n += 1)); do
271271- p=${params[$n]}
272272-273273- if test "$p" = "--replace"; then
274274- pattern="${params[$((n + 1))]}"
275275- replacement="${params[$((n + 2))]}"
276276- n=$((n + 2))
277277- fi
278278-279279- if test "$p" = "--subst-var"; then
280280- varName="${params[$((n + 1))]}"
281281- pattern="@$varName@"
282282- replacement="${!varName}"
283283- n=$((n + 1))
284284- fi
285285-286286- if test "$p" = "--subst-var-by"; then
287287- pattern="@${params[$((n + 1))]}@"
288288- replacement="${params[$((n + 2))]}"
289289- n=$((n + 2))
290290- fi
291291-292292- if test ${#args[@]} != 0; then
293293- args[${#args[@]}]="-a"
294294- fi
295295- args[${#args[@]}]="$pattern"
296296- args[${#args[@]}]="$replacement"
297297- done
298298-299299- replace-literal -e -s -- "${args[@]}" < "$input" > "$output".tmp
300300- if test -x "$output"; then
301301- chmod +x "$output".tmp
302302- fi
303303- mv -f "$output".tmp "$output"
304304-}
305305-306306-307307-substituteInPlace() {
308308- local fileName="$1"
309309- shift
310310- substitute "$fileName" "$fileName" "$@"
311311-}
312312-313313-314314-substituteAll() {
315315- local input="$1"
316316- local output="$2"
317317-318318- # Select all environment variables that start with a lowercase character.
319319- for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
320320- if test "$NIX_DEBUG" = "1"; then
321321- echo "$envVar -> ${!envVar}"
322322- fi
323323- args="$args --subst-var $envVar"
324324- done
325325-326326- substitute "$input" "$output" $args
327327-}
328328-329329-330330-######################################################################
331331-# What follows is the generic builder.
332332-333333-334334-nestingLevel=0
335335-336336-startNest() {
337337- nestingLevel=$(($nestingLevel + 1))
338338- echo -en "\e[$1p"
339339-}
340340-341341-stopNest() {
342342- nestingLevel=$(($nestingLevel - 1))
343343- echo -en "\e[q"
344344-}
345345-346346-header() {
347347- startNest "$2"
348348- echo "$1"
349349-}
350350-351351-# Make sure that even when we exit abnormally, the original nesting
352352-# level is properly restored.
353353-closeNest() {
354354- while test $nestingLevel -gt 0; do
355355- stopNest
356356- done
357357-}
358358-359359-360360-# This function is useful for debugging broken Nix builds. It dumps
361361-# all environment variables to a file `env-vars' in the build
362362-# directory. If the build fails and the `-K' option is used, you can
363363-# then go to the build directory and source in `env-vars' to reproduce
364364-# the environment used for building.
365365-dumpVars() {
366366- echo "Dumping env-vars to $NIX_BUILD_TOP/env-vars"
367367- if test "$noDumpEnvVars" != "1"; then
368368- export > "$NIX_BUILD_TOP/env-vars"
369369- fi
370370-}
371371-372372-373373-# Utility function: return the base name of the given path, with the
374374-# prefix `HASH-' removed, if present.
375375-stripHash() {
376376- strippedName=$(basename $1);
377377- if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then
378378- strippedName=$(echo "$strippedName" | cut -c34-)
379379- fi
380380-}
381381-382382-383383-unpackFile() {
384384- curSrc="$1"
385385- local cmd
386386-387387- header "unpacking source archive $curSrc" 3
388388-389389- case "$curSrc" in
390390- *.tar)
391391- tar xvf $curSrc
392392- ;;
393393- *.tar.gz | *.tgz | *.tar.Z)
394394- gzip -d < $curSrc | tar xvf -
395395- ;;
396396- *.tar.bz2 | *.tbz2)
397397- bzip2 -d < $curSrc | tar xvf -
398398- ;;
399399- *.zip)
400400- unzip $curSrc
401401- ;;
402402- *)
403403- if test -d "$curSrc"; then
404404- stripHash $curSrc
405405- cp -prvd $curSrc $strippedName
406406- else
407407- if test -z "$unpackCmd"; then
408408- echo "source archive $curSrc has unknown type"
409409- exit 1
410410- fi
411411- runHook unpackCmd
412412- fi
413413- ;;
414414- esac
415415-416416- stopNest
417417-}
418418-419419-420420-unpackPhase() {
421421- runHook preUnpack
422422-423423- if test -z "$srcs"; then
424424- if test -z "$src"; then
425425- echo 'variable $src or $srcs should point to the source'
426426- exit 1
427427- fi
428428- srcs="$src"
429429- fi
430430-431431- # To determine the source directory created by unpacking the
432432- # source archives, we record the contents of the current
433433- # directory, then look below which directory got added. Yeah,
434434- # it's rather hacky.
435435- local dirsBefore=""
436436- for i in *; do
437437- if test -d "$i"; then
438438- dirsBefore="$dirsBefore $i "
439439- fi
440440- done
441441-442442- # Unpack all source archives.
443443- for i in $srcs; do
444444- unpackFile $i
445445- done
446446-447447- # Find the source directory.
448448- if test -n "$setSourceRoot"; then
449449- runHook setSourceRoot
450450- elif test -z "$sourceRoot"; then
451451- sourceRoot=
452452- for i in *; do
453453- if test -d "$i"; then
454454- case $dirsBefore in
455455- *\ $i\ *)
456456- ;;
457457- *)
458458- if test -n "$sourceRoot"; then
459459- echo "unpacker produced multiple directories"
460460- exit 1
461461- fi
462462- sourceRoot="$i"
463463- ;;
464464- esac
465465- fi
466466- done
467467- fi
468468-469469- if test -z "$sourceRoot"; then
470470- echo "unpacker appears to have produced no directories"
471471- exit 1
472472- fi
473473-474474- echo "source root is $sourceRoot"
475475-476476- # By default, add write permission to the sources. This is often
477477- # necessary when sources have been copied from other store
478478- # locations.
479479- if test "$dontMakeSourcesWritable" != 1; then
480480- chmod -R u+w "$sourceRoot"
481481- fi
482482-483483- runHook postUnpack
484484-}
485485-486486-487487-patchPhase() {
488488- runHook prePatch
489489-490490- for i in $patches; do
491491- header "applying patch $i" 3
492492- local uncompress=cat
493493- case $i in
494494- *.gz)
495495- uncompress="gzip -d"
496496- ;;
497497- *.bz2)
498498- uncompress="bzip2 -d"
499499- ;;
500500- esac
501501- $uncompress < $i | patch ${patchFlags:--p1}
502502- stopNest
503503- done
504504-505505- runHook postPatch
506506-}
507507-508508-509509-configurePhase() {
510510- runHook preConfigure
511511-512512- if test -z "$configureScript"; then
513513- configureScript=./configure
514514- if ! test -x $configureScript; then
515515- echo "no configure script, doing nothing"
516516- return
517517- fi
518518- fi
519519-520520- if test -z "$dontAddPrefix"; then
521521- configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
522522- fi
523523-524524- # Add --disable-dependency-tracking to speed up some builds.
525525- if test -z "$dontAddDisableDepTrack"; then
526526- if grep -q dependency-tracking $configureScript; then
527527- configureFlags="--disable-dependency-tracking $configureFlags"
528528- fi
529529- fi
530530-531531- # By default, disable static builds.
532532- if test -z "$dontDisableStatic"; then
533533- if grep -q enable-static $configureScript; then
534534- configureFlags="--disable-static $configureFlags"
535535- fi
536536- fi
537537-538538- echo "configure flags: $configureFlags ${configureFlagsArray[@]}"
539539- $configureScript $configureFlags "${configureFlagsArray[@]}"
540540-541541- runHook postConfigure
542542-}
543543-544544-545545-buildPhase() {
546546- runHook preBuild
547547-548548- if test -z "$makeFlags" && ! test -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile"; then
549549- echo "no Makefile, doing nothing"
550550- return
551551- fi
552552-553553- echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}"
554554- make ${makefile:+-f $makefile} \
555555- $makeFlags "${makeFlagsArray[@]}" \
556556- $buildFlags "${buildFlagsArray[@]}"
557557-558558- runHook postBuild
559559-}
560560-561561-562562-checkPhase() {
563563- runHook preCheck
564564-565565- echo "check flags: $makeFlags ${makeFlagsArray[@]} $checkFlags ${checkFlagsArray[@]}"
566566- make ${makefile:+-f $makefile} \
567567- $makeFlags "${makeFlagsArray[@]}" \
568568- $checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
569569-570570- runHook postCheck
571571-}
572572-573573-574574-patchELF() {
575575- # Patch all ELF executables and shared libraries.
576576- header "patching ELF executables and libraries"
577577- if test -e "$prefix"; then
578578- find "$prefix" \( \
579579- \( -type f -a -name "*.so*" \) -o \
580580- \( -type f -a -perm +0100 \) \
581581- \) -print -exec patchelf --shrink-rpath {} \;
582582- fi
583583- stopNest
584584-}
585585-586586-587587-patchShebangs() {
588588- # Rewrite all script interpreter file names (`#! /path') under the
589589- # specified directory tree to paths found in $PATH. E.g.,
590590- # /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
591591- # Interpreters that are already in the store are left untouched.
592592- header "patching script interpreter paths"
593593- local dir="$1"
594594- local f
595595- for f in $(find "$dir" -type f -perm +0100); do
596596- local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
597597- if test -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE"; then
598598- local newPath=$(type -P $(basename $oldPath) || true)
599599- if test -n "$newPath" -a "$newPath" != "$oldPath"; then
600600- echo "$f: interpreter changed from $oldPath to $newPath"
601601- sed -i -e "1 s,$oldPath,$newPath," "$f"
602602- fi
603603- fi
604604- done
605605- stopNest
606606-}
607607-608608-609609-installPhase() {
610610- runHook preInstall
611611-612612- mkdir -p "$prefix"
613613-614614- installTargets=${installTargets:-install}
615615- echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}"
616616- make ${makefile:+-f $makefile} $installTargets \
617617- $makeFlags "${makeFlagsArray[@]}" \
618618- $installFlags "${installFlagsArray[@]}"
619619-620620- runHook postInstall
621621-}
622622-623623-624624-# The fixup phase performs generic, package-independent, Nix-related
625625-# stuff, like running patchelf and setting the
626626-# propagated-build-inputs. It should rarely be overriden.
627627-fixupPhase() {
628628- runHook preFixup
629629-630630- # Put man/doc/info under $out/share.
631631- forceShare=${forceShare:=man doc info}
632632- if test -n "$forceShare"; then
633633- for d in $forceShare; do
634634- if test -d "$prefix/$d"; then
635635- if test -d "$prefix/share/$d"; then
636636- echo "both $d/ and share/$d/ exists!"
637637- else
638638- echo "fixing location of $d/ subdirectory"
639639- mkdir -p $prefix/share
640640- if test -w $prefix/share; then
641641- mv -v $prefix/$d $prefix/share
642642- ln -sv $prefix/share/$d $prefix/$d
643643- fi
644644- fi
645645- fi
646646- done;
647647- fi
648648-649649- # TODO: strip _only_ ELF executables, and return || fail here...
650650- if test -z "$dontStrip"; then
651651- stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
652652- if test -n "$stripDebugList"; then
653653- stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
654654- fi
655655-656656- stripAllList=${stripAllList:-}
657657- if test -n "$stripAllList"; then
658658- stripDirs "$stripAllList" "${stripAllFlags:--s}"
659659- fi
660660- fi
661661-662662- if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
663663- patchELF "$prefix"
664664- fi
665665-666666- if test -z "$dontPatchShebangs"; then
667667- patchShebangs "$prefix"
668668- fi
669669-670670- if test -n "$propagatedBuildInputs"; then
671671- mkdir -p "$out/nix-support"
672672- echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
673673- fi
674674-675675- if test -n "$setupHook"; then
676676- mkdir -p "$out/nix-support"
677677- substituteAll "$setupHook" "$out/nix-support/setup-hook"
678678- fi
679679-680680- runHook postFixup
681681-}
682682-683683-684684-distPhase() {
685685- runHook preDist
686686-687687- echo "dist flags: $distFlags ${distFlagsArray[@]}"
688688- make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
689689-690690- if test "$dontCopyDist" != 1; then
691691- mkdir -p "$out/tarballs"
692692-693693- # Note: don't quote $tarballs, since we explicitly permit
694694- # wildcards in there.
695695- cp -pvd ${tarballs:-*.tar.gz} $out/tarballs
696696- fi
697697-698698- runHook postDist
699699-}
700700-701701-702702-showPhaseHeader() {
703703- local phase="$1"
704704- case $phase in
705705- unpackPhase) header "unpacking sources";;
706706- patchPhase) header "patching sources";;
707707- configurePhase) header "configuring";;
708708- buildPhase) header "building";;
709709- checkPhase) header "running tests";;
710710- installPhase) header "installing";;
711711- fixupPhase) header "post-installation fixup";;
712712- *) header "$phase";;
713713- esac
714714-}
715715-716716-717717-genericBuild() {
718718- header "building $out"
719719-720720- if test -n "$buildCommand"; then
721721- eval "$buildCommand"
722722- return
723723- fi
724724-725725- if test -z "$phases"; then
726726- phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
727727- configurePhase $preBuildPhases buildPhase checkPhase \
728728- $preInstallPhases installPhase $preFixupPhases fixupPhase \
729729- $preDistPhases distPhase $postPhases";
730730- fi
731731-732732- for curPhase in $phases; do
733733- if test "$curPhase" = buildPhase -a -n "$dontBuild"; then continue; fi
734734- if test "$curPhase" = checkPhase -a -z "$doCheck"; then continue; fi
735735- if test "$curPhase" = installPhase -a -n "$dontInstall"; then continue; fi
736736- if test "$curPhase" = fixupPhase -a -n "$dontFixup"; then continue; fi
737737- if test "$curPhase" = distPhase -a -z "$doDist"; then continue; fi
738738-739739- showPhaseHeader "$curPhase"
740740- dumpVars
741741-742742- # Evaluate the variable named $curPhase if it exists, otherwise the
743743- # function named $curPhase.
744744- eval "${!curPhase:-$curPhase}"
745745-746746- if test "$curPhase" = unpackPhase; then
747747- cd "${sourceRoot:-.}"
748748- fi
749749-750750- stopNest
751751- done
752752-753753- stopNest
754754-}
755755-756756-757757-758758-759759-dumpVars
-80
pkgs/stdenv/mingw/simple-stdenv/builder.sh
···11-if test -z "$out"; then
22- out="$OUT"
33- initialPath="$INITIALPATH"
44- shell="$SHELL"
55-fi
66-77-setupPath=
88-for i in $initialPath; do
99- setupPath=$setupPath${setupPath:+:}$i
1010-done
1111-1212-PATH=$setupPath
1313-export PATH
1414-1515-mkdir $out
1616-1717-cat > $out/setup <<EOF
1818-PATH=$setupPath
1919-export PATH
2020-2121-SHELL=$shell
2222-export SHELL
2323-2424-# make fetchurl usable
2525-header() {
2626- echo "\$1"
2727-}
2828-2929-stopNest() {
3030- echo "Nothing to do"
3131-}
3232-3333-# !!! Awful copy&paste.
3434-substitute() {
3535- local input="\$1"
3636- local output="\$2"
3737-3838- local -a params=("\$@")
3939-4040- local sedScript=\$NIX_BUILD_TOP/.sedargs
4141- rm -f \$sedScript
4242- touch \$sedScript
4343-4444- local n p pattern replacement varName
4545-4646- for ((n = 2; n < \${#params[*]}; n += 1)); do
4747- p=\${params[\$n]}
4848-4949- if test "\$p" = "--replace"; then
5050- pattern=\${params[\$((n + 1))]}
5151- replacement=\${params[\$((n + 2))]}
5252- n=\$((n + 2))
5353- echo "s^\$pattern^\$replacement^g" >> \$sedScript
5454- sedArgs=("\${sedArgs[@]}" "-e" )
5555- fi
5656-5757- if test "\$p" = "--subst-var"; then
5858- varName=\${params[\$((n + 1))]}
5959- n=\$((n + 1))
6060- echo "s^@\${varName}@^\${!varName}^g" >> \$sedScript
6161- fi
6262-6363- if test "\$p" = "--subst-var-by"; then
6464- varName=\${params[\$((n + 1))]}
6565- replacement=\${params[\$((n + 2))]}
6666- n=\$((n + 2))
6767- echo "s^@\${varName}@^\$replacement^g" >> \$sedScript
6868- fi
6969-7070- done
7171-7272- sed -f \$sedScript < "\$input" > "\$output".tmp
7373- if test -x "\$output"; then
7474- chmod +x "\$output".tmp
7575- fi
7676- mv -f "\$output".tmp "\$output"
7777-}
7878-EOF
7979-8080-chmod +x $out/setup
···2525 # This must be done in preConfigure because the build process removes
2626 # helper from the source directory during the build.
2727 preConfigure = ''
2828- ensureDir $out/sbin
2828+ mkdir -p $out/sbin
2929 cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
3030 substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
3131 substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs