lol

Remove the unmaintained (and AFAIK unused) stdenv for mingw

+12 -1488
+10 -24
pkgs/stdenv/default.nix
··· 5 5 # Posix utilities, the GNU C compiler, and so on. On other systems, 6 6 # we use the native C library. 7 7 8 - 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; 8 + { system, allPackages ? import ../.., platform, config }: 16 9 17 10 18 11 rec { ··· 45 38 stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux; 46 39 47 40 48 - # MinGW/MSYS standard environment. 49 - stdenvMinGW = import ./mingw { 50 - inherit system; 51 - }; 52 - 53 - 54 41 # Select the appropriate stdenv for the platform `system'. 55 42 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 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 66 52 stdenvNative; 67 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
-5
pkgs/stdenv/mingw/cygpath/builder.sh
··· 1 - source $stdenv/setup 2 - 3 - mkdir $out 4 - result="$(cygpath --mixed $path)" 5 - echo "\"$result\"" > $out/default.nix
-9
pkgs/stdenv/mingw/cygpath/default.nix
··· 1 - {stdenv}: path : 2 - 3 - import ( 4 - stdenv.mkDerivation { 5 - name = "cygpath"; 6 - builder = ./builder.sh; 7 - inherit path; 8 - } 9 - )
-2
pkgs/stdenv/mingw/default-builder.sh
··· 1 - source $STDENV/setup 2 - genericBuild
-233
pkgs/stdenv/mingw/default.nix
··· 1 - {system} : 2 - 3 - let { 4 - body = 5 - stdenvFinal; 6 - 7 - /** 8 - * Initial standard environment based on native Cygwin tools. 9 - * GCC is not required. 10 - * Required (approx): bash, mkdir, gnu tar, curl. 11 - */ 12 - stdenvInit1 = 13 - import ./simple-stdenv { 14 - inherit system; 15 - name = "stdenv-init1-mingw"; 16 - shell = "/bin/bash.exe"; 17 - path = ["/usr/bin" "/bin" "/usr/local/bin"]; 18 - }; 19 - 20 - /** 21 - * Initial standard environment based on MSYS tools. 22 - */ 23 - stdenvInit2 = 24 - import ./simple-stdenv { 25 - inherit system; 26 - name = "stdenv-init2-mingw"; 27 - shell = msysShell; 28 - path = [(msys + "/bin")]; 29 - }; 30 - 31 - /** 32 - * Initial standard environment with the most basic MinGW packages. 33 - */ 34 - stdenvInit3 = 35 - (import ./simple-stdenv) { 36 - inherit system; 37 - name = "stdenv-init3-mingw"; 38 - shell = msysShell; 39 - path = [ 40 - (make + "/bin") 41 - (tar + "/bin") 42 - (binutils + "/bin") 43 - (gccFull + "/bin") 44 - (mingwRuntimeBin + "/bin") 45 - (w32apiBin + "/bin") 46 - (msys + "/bin") 47 - ]; 48 - 49 - extraEnv = { 50 - C_INCLUDE_PATH = mingwRuntimeBin + "/include" + ":" + w32apiBin + "/include"; 51 - LIBRARY_PATH = mingwRuntimeBin + "/lib" + ":" + w32apiBin + "/lib"; 52 - }; 53 - }; 54 - 55 - /** 56 - * Final standard environment, based on generic stdenv. 57 - * It would be better to make the generic stdenv usable on 58 - * MINGW (i.e. make all environment variables CAPS). 59 - */ 60 - stdenvFinal = 61 - let { 62 - body = 63 - stdenv // mkDerivationFun // { 64 - inherit fetchurl; 65 - overrides.pkgconfig = pkgconfigBin; 66 - }; 67 - 68 - shell = 69 - msys + "/bin/sh.exe"; 70 - 71 - stdenv = 72 - stdenvInit2.mkDerivation { 73 - name = "stdenv-mingw"; 74 - builder = ./builder.sh; 75 - setup = ./setup.sh; 76 - 77 - /** 78 - * binutils is on the path because it contains dlltool, which 79 - * is invoked on the PATH by some packages. 80 - */ 81 - initialPath = [make tar binutils gccFull mingwRuntimeSrc w32apiSrc msys]; 82 - gcc = gccFull; 83 - shell = msysShell; 84 - inherit curl; 85 - isDarwin = false; 86 - isMinGW = true; 87 - }; 88 - 89 - mkDerivationFun = { 90 - mkDerivation = attrs: 91 - (derivation ( 92 - (removeAttrs attrs ["meta"]) 93 - // 94 - { 95 - builder = 96 - if attrs ? realBuilder then attrs.realBuilder else shell; 97 - args = 98 - if attrs ? args then 99 - attrs.args 100 - else 101 - ["-e"] ++ ( 102 - if attrs ? builder then 103 - [./fix-builder.sh attrs.builder] 104 - else 105 - [./fix-builder.sh ./default-builder.sh] 106 - ); 107 - inherit stdenv system; 108 - C_INCLUDE_PATH = mingwRuntimeSrc + "/include" + ":" + w32apiSrc + "/include"; 109 - CPLUS_INCLUDE_PATH = mingwRuntimeSrc + "/include" + ":" + w32apiSrc + "/include"; 110 - LIBRARY_PATH = mingwRuntimeSrc + "/lib" + ":" + w32apiSrc + "/lib"; 111 - }) 112 - ) 113 - // { meta = if attrs ? meta then attrs.meta else {}; }; 114 - }; 115 - }; 116 - 117 - /** 118 - * fetchurl 119 - */ 120 - fetchurlInit1 = 121 - import ../../build-support/fetchurl { 122 - stdenv = stdenvInit1; 123 - curl = 124 - (import ./pkgs).curl { 125 - stdenv = stdenvInit1; 126 - }; 127 - }; 128 - 129 - cygpath = 130 - import ./cygpath { 131 - stdenv = stdenvInit1; 132 - }; 133 - 134 - /** 135 - * Hack: we need the cygpath of the Cygwin chmod. 136 - */ 137 - fetchurl = 138 - import ./fetchurl { 139 - stdenv = stdenvInit2; 140 - curl = curl + "/bin/curl.exe"; 141 - chmod = cygpath "/usr/bin/chmod"; 142 - }; 143 - 144 - /** 145 - * MSYS, installed using stdenvInit1 146 - * 147 - * @todo Maybe remove the make of msys? 148 - */ 149 - msys = 150 - stdenvInit1.mkDerivation { 151 - name = "msys-1.0.11"; 152 - builder = ./msys-builder.sh; 153 - src = 154 - fetchurlInit1 { 155 - url = ftp://ftp.strategoxt.org/pub/mingw/msys-1.0.11.tar.gz; 156 - sha256 = "08qp4jk279i66q6ngksg58fx3cfv1r6p5n394h2kfrs56qs9zvz4"; 157 - }; 158 - }; 159 - 160 - msysShell = 161 - msys + "/bin/sh.exe"; 162 - 163 - /** 164 - * Binary packages, based on stdenvInit2 165 - */ 166 - curl = 167 - (import ./pkgs).curl { 168 - stdenv = stdenvInit2; 169 - }; 170 - 171 - gccFull = 172 - (import ./pkgs).gccFull { 173 - stdenv = stdenvInit2; 174 - inherit fetchurl; 175 - }; 176 - 177 - make = 178 - (import ./pkgs).make { 179 - stdenv = stdenvInit2; 180 - inherit fetchurl; 181 - }; 182 - 183 - tar = 184 - (import ./pkgs).tar { 185 - stdenv = stdenvInit2; 186 - inherit fetchurl; 187 - }; 188 - 189 - binutils = 190 - (import ./pkgs).binutils { 191 - stdenv = stdenvInit2; 192 - inherit fetchurl; 193 - }; 194 - 195 - mingwRuntimeBin = 196 - (import ./pkgs).mingwRuntimeBin { 197 - stdenv = stdenvInit2; 198 - inherit fetchurl; 199 - }; 200 - 201 - w32apiBin = 202 - (import ./pkgs).w32apiBin { 203 - stdenv = stdenvInit2; 204 - inherit fetchurl; 205 - }; 206 - 207 - pkgconfigBin = 208 - (import ./pkgs).pkgconfigBin { 209 - stdenv = stdenvInit3; 210 - inherit fetchurl; 211 - }; 212 - 213 - /** 214 - * Source packages, based on stdenvInit3 215 - */ 216 - mingwRuntimeSrc = 217 - (import ./pkgs).mingwRuntimeSrc { 218 - stdenv = stdenvInit3; 219 - inherit fetchurl; 220 - }; 221 - 222 - w32apiSrc = 223 - (import ./pkgs).w32apiSrc { 224 - stdenv = stdenvInit3; 225 - inherit fetchurl; 226 - }; 227 - 228 - replace = 229 - (import ./pkgs).replace { 230 - stdenv = stdenvInit3; 231 - inherit fetchurl; 232 - }; 233 - }
-34
pkgs/stdenv/mingw/fetchurl/builder.sh
··· 1 - if test -z "$out"; then 2 - stdenv="$STDENV" 3 - url="$URL" 4 - id="$ID" 5 - outputHashAlgo="$OUTPUTHASHALGO" 6 - outputHash="$OUTPUTHASH" 7 - chmod=$CHMOD 8 - curl=$CURL 9 - fi 10 - 11 - source $stdenv/setup 12 - 13 - if test -z "$out"; then 14 - out="$OUT" 15 - fi 16 - 17 - header "downloading $out from $url" 18 - $curl --fail --location --max-redirs 20 "$url" > "$out" 19 - 20 - if test "$NIX_OUTPUT_CHECKED" != "1"; then 21 - if test "$outputHashAlgo" != "md5"; then 22 - echo "hashes other than md5 are unsupported in Nix <= 0.7, upgrade to Nix 0.8" 23 - exit 1 24 - fi 25 - actual=$(md5sum -b "$out" | cut -c1-32) 26 - if test "$actual" != "$id"; then 27 - echo "hash is $actual, expected $id" 28 - exit 1 29 - fi 30 - fi 31 - 32 - $chmod a-x $out 33 - 34 - stopNest
-28
pkgs/stdenv/mingw/fetchurl/default.nix
··· 1 - {stdenv, curl, chmod}: 2 - 3 - {url, outputHash ? "", outputHashAlgo ? "", md5 ? "", sha1 ? "", sha256 ? ""}: 4 - 5 - assert (outputHash != "" && outputHashAlgo != "") 6 - || md5 != "" || sha1 != "" || sha256 != ""; 7 - 8 - stdenv.mkDerivation { 9 - name = baseNameOf (toString url); 10 - builder = ./builder.sh; 11 - 12 - # Compatibility with Nix <= 0.7. 13 - id = md5; 14 - 15 - # New-style output content requirements. 16 - outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else 17 - if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; 18 - outputHash = if outputHash != "" then outputHash else 19 - if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; 20 - 21 - inherit url chmod curl; 22 - 23 - # We borrow these environment variables from the caller to allow 24 - # easy proxy configuration. This is impure, but a fixed-output 25 - # derivation like fetchurl is allowed to do so since its result is 26 - # by definition pure. 27 - impureEnvVars = ["http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"]; 28 - }
-23
pkgs/stdenv/mingw/fix-builder.sh
··· 1 - # Workaround MSYS shell problem 2 - 3 - if test -z "$out"; then 4 - buildInputs=$BUILDINPUTS 5 - buildUtilities=$BUILDUTILITIES 6 - configureFlags=$CONFIGUREFLAGS 7 - doCheck=$DOCHECK 8 - doCoverageAnalysis=$DOCOVERAGEANALYSIS 9 - dontInstall=$DONTINSTALL 10 - dontLogThroughTee=$DONTLOGTHROUGHTEE 11 - lcov=$LCOV 12 - logPhases=$LOGPHASES 13 - out=$OUT 14 - patches=$PATCHES 15 - propagatedBuildInputs=$PROPAGATEDBUILDINPUTS 16 - stdenv=$STDENV 17 - src=$SRC 18 - srcs=$SRCS 19 - succeedOnFailure=$SUCCEEDONFAILURE 20 - system=$SYSTEM 21 - fi 22 - 23 - source $@
-15
pkgs/stdenv/mingw/msys-builder.sh
··· 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
-5
pkgs/stdenv/mingw/pkgs/bin-builder.sh
··· 1 - source $STDENV/setup 2 - 3 - mkdir $OUT 4 - cd $OUT 5 - tar zxvf $SRC
pkgs/stdenv/mingw/pkgs/curl.exe

This is a binary file and will not be displayed.

-157
pkgs/stdenv/mingw/pkgs/default.nix
··· 1 - /** 2 - * MinGW packages. 3 - */ 4 - rec { 5 - 6 - /** 7 - * Curl, binary 8 - */ 9 - curl = {stdenv} : 10 - stdenv.mkDerivation { 11 - name = "curl-7.15.4"; 12 - exename = "curl.exe"; 13 - builder = ./single-exe-builder.sh; 14 - src = ./curl.exe; 15 - }; 16 - 17 - /** 18 - * Make. Binary. 19 - */ 20 - make = {stdenv, fetchurl} : 21 - stdenv.mkDerivation { 22 - name = "mingw-make-3.81"; 23 - builder = ./bin-builder.sh; 24 - src = 25 - fetchurl { 26 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/mingw32-make-3.81-1.tar.gz; 27 - md5 = "74c2f44ecc699b318edeb07d838feae5"; 28 - }; 29 - }; 30 - 31 - /** 32 - * Tar 33 - */ 34 - tar = {stdenv, fetchurl} : 35 - stdenv.mkDerivation { 36 - name = "mingw-tar"; 37 - builder = ./bin-builder.sh; 38 - src = 39 - fetchurl { 40 - url = ftp://ftp.strategoxt.org/pub/mingw/tar-1.22-1-msys-1.0.11-bin.tar.gz; 41 - sha256 = "17rbv159g56q3bp8rh5vzv8hw8clxs7vk731cgqg0vy1fzls6yfq"; 42 - }; 43 - }; 44 - 45 - /** 46 - * GCC. Binary 47 - */ 48 - gccFull = {stdenv, fetchurl} : 49 - stdenv.mkDerivation { 50 - name = "gcc-full-4.4.0-mingw32"; 51 - builder = ./bin-builder.sh; 52 - src = 53 - fetchurl { 54 - url = ftp://ftp.strategoxt.org/pub/mingw/gcc-full-4.4.0-mingw32-bin-2.tar.gz; 55 - sha256= "6c5a125591837817c940f4c66140cd7393b3f5837dd738c7ed315157e6270a60"; 56 - }; 57 - }; 58 - 59 - /** 60 - * binutils. Binary. 61 - */ 62 - binutils = {stdenv, fetchurl} : 63 - stdenv.mkDerivation { 64 - name = "binutils-2.19.1-mingw32"; 65 - builder = ./bin-builder.sh; 66 - src = 67 - fetchurl { 68 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/files/GNU%20Binutils/Current%20Release_%20GNU%20binutils-2.19.1/binutils-2.19.1-mingw32-bin.tar.gz; 69 - sha256 = "037vh2n9iv2vccvplk48vd3al91p7yhc73p5nkfsrb6sg977shj2"; 70 - }; 71 - }; 72 - 73 - mingwRuntimeBin = {stdenv, fetchurl} : 74 - stdenv.mkDerivation { 75 - name = "mingwrt-3.16"; 76 - builder = ./bin-builder.sh; 77 - src = 78 - fetchurl { 79 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/files/MinGW%20Runtime/mingwrt-3.16/mingwrt-3.16-mingw32-dev.tar.gz; 80 - sha256 = "1xqpp7lvsj88grs6jlk0fnlkvis2y4avcqrpwsaxxrpjlg5bwzci"; 81 - }; 82 - }; 83 - 84 - mingwRuntimeSrc = {stdenv, fetchurl} : 85 - stdenv.mkDerivation { 86 - name = "mingwrt-3.16-mingw32"; 87 - builder = ./src-builder.sh; 88 - src = 89 - fetchurl { 90 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/files/MinGW%20Runtime/mingwrt-3.16/mingwrt-3.16-mingw32-src.tar.gz; 91 - sha256 = "0rljw3v94z9wzfa63b7lvyprms5l5jgf11lws8vm8z7x7q7h1k38"; 92 - }; 93 - }; 94 - 95 - w32apiBin = {stdenv, fetchurl} : 96 - stdenv.mkDerivation { 97 - name = "w32api-3.13-mingw32"; 98 - builder = ./bin-builder.sh; 99 - src = 100 - fetchurl { 101 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/files/MinGW%20API%20for%20MS-Windows/Current%20Release_%20w32api-3.13/w32api-3.13-mingw32-dev.tar.gz; 102 - sha256 = "19jm2hdym5ixi9b874xmmilixlpxvfdpi5y3bx0bs88fdah03gvx"; 103 - }; 104 - }; 105 - 106 - w32apiSrc = {stdenv, fetchurl} : 107 - stdenv.mkDerivation { 108 - name = "w32api-3.13-mingw32"; 109 - builder = ./src-builder.sh; 110 - src = 111 - fetchurl { 112 - url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/files/MinGW%20API%20for%20MS-Windows/Current%20Release_%20w32api-3.13/w32api-3.13-mingw32-src.tar.gz; 113 - sha256 = "1i1gpwilfc21s3yr4sx39i0w4g7lbij427wwxa34gjfgz0awdkh2"; 114 - }; 115 - }; 116 - 117 - /** 118 - * We need a binary pkg-config to bootstrap the compilation of 119 - * glib and pkg-config: pkg-config needs glib, glib needs pkg-config. 120 - * 121 - * This tarball contains pkg-config and all its dependencies. Once we 122 - * have bootstrapped pkg-config we really need to use a statically linked 123 - * pkg-config (and provide this .exe at the web: it is really missing 124 - * on the web). 125 - */ 126 - pkgconfigBin = {stdenv, fetchurl} : 127 - stdenv.mkDerivation { 128 - name = "pkgconfig-0.23"; 129 - builder = ./pkgconfig-builder.sh; 130 - setupHook = ../../../development/tools/misc/pkgconfig/setup-hook.sh; 131 - src = 132 - fetchurl { 133 - url = ftp://ftp.strategoxt.org/pub/mingw/pkg-config-0.23.tar.gz; 134 - sha256 = "1vab3rdnw16nhma1bln41bbrn6phbpcv9wiz79map8y5znaiv6mq"; 135 - }; 136 - }; 137 - 138 - replace = {stdenv, fetchurl} : 139 - import ../../../tools/text/replace { 140 - inherit fetchurl stdenv; 141 - }; 142 - 143 - /* 144 - pkgs.coreutils 145 - pkgs.findutils 146 - pkgs.diffutils 147 - pkgs.gnused 148 - pkgs.gnugrep 149 - pkgs.gawk 150 - pkgs.gnutar 151 - pkgs.gzip 152 - pkgs.bzip2 153 - pkgs.gnumake 154 - pkgs.bash 155 - pkgs.patch 156 - */ 157 - }
-8
pkgs/stdenv/mingw/pkgs/pkgconfig-builder.sh
··· 1 - source $STDENV/setup 2 - 3 - mkdir $OUT 4 - cd $OUT 5 - tar zxvf $SRC 6 - 7 - test -x $OUT/nix-support || mkdir $OUT/nix-support 8 - cp $SETUPHOOK $OUT/nix-support/setup-hook
-12
pkgs/stdenv/mingw/pkgs/single-exe-builder.sh
··· 1 - if test -z "$out"; then 2 - stdenv=$STDENV 3 - out=$OUT 4 - src=$SRC 5 - exename=$EXENAME 6 - fi 7 - 8 - source $stdenv/setup 9 - 10 - mkdir $out 11 - mkdir $out/bin 12 - cp $src $out/bin/$exename
-7
pkgs/stdenv/mingw/pkgs/src-builder.sh
··· 1 - source $STDENV/setup 2 - 3 - tar zxvf $SRC 4 - cd $NAME 5 - ./configure --prefix=$OUT 6 - make 7 - make install
-759
pkgs/stdenv/mingw/setup.sh
··· 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
-80
pkgs/stdenv/mingw/simple-stdenv/builder.sh
··· 1 - if test -z "$out"; then 2 - out="$OUT" 3 - initialPath="$INITIALPATH" 4 - shell="$SHELL" 5 - fi 6 - 7 - setupPath= 8 - for i in $initialPath; do 9 - setupPath=$setupPath${setupPath:+:}$i 10 - done 11 - 12 - PATH=$setupPath 13 - export PATH 14 - 15 - mkdir $out 16 - 17 - cat > $out/setup <<EOF 18 - PATH=$setupPath 19 - export PATH 20 - 21 - SHELL=$shell 22 - export SHELL 23 - 24 - # make fetchurl usable 25 - header() { 26 - echo "\$1" 27 - } 28 - 29 - stopNest() { 30 - echo "Nothing to do" 31 - } 32 - 33 - # !!! Awful copy&paste. 34 - substitute() { 35 - local input="\$1" 36 - local output="\$2" 37 - 38 - local -a params=("\$@") 39 - 40 - local sedScript=\$NIX_BUILD_TOP/.sedargs 41 - rm -f \$sedScript 42 - touch \$sedScript 43 - 44 - local n p pattern replacement varName 45 - 46 - for ((n = 2; n < \${#params[*]}; n += 1)); do 47 - p=\${params[\$n]} 48 - 49 - if test "\$p" = "--replace"; then 50 - pattern=\${params[\$((n + 1))]} 51 - replacement=\${params[\$((n + 2))]} 52 - n=\$((n + 2)) 53 - echo "s^\$pattern^\$replacement^g" >> \$sedScript 54 - sedArgs=("\${sedArgs[@]}" "-e" ) 55 - fi 56 - 57 - if test "\$p" = "--subst-var"; then 58 - varName=\${params[\$((n + 1))]} 59 - n=\$((n + 1)) 60 - echo "s^@\${varName}@^\${!varName}^g" >> \$sedScript 61 - fi 62 - 63 - if test "\$p" = "--subst-var-by"; then 64 - varName=\${params[\$((n + 1))]} 65 - replacement=\${params[\$((n + 2))]} 66 - n=\$((n + 2)) 67 - echo "s^@\${varName}@^\$replacement^g" >> \$sedScript 68 - fi 69 - 70 - done 71 - 72 - sed -f \$sedScript < "\$input" > "\$output".tmp 73 - if test -x "\$output"; then 74 - chmod +x "\$output".tmp 75 - fi 76 - mv -f "\$output".tmp "\$output" 77 - } 78 - EOF 79 - 80 - chmod +x $out/setup
-31
pkgs/stdenv/mingw/simple-stdenv/default.nix
··· 1 - { system 2 - , name 3 - , shell 4 - , path 5 - , extraEnv ? {} 6 - , extraShellOptions ? [] 7 - }: 8 - 9 - let { 10 - body = 11 - derivation ({ 12 - inherit system name; 13 - initialPath = path; 14 - builder = shell; 15 - args = extraShellOptions ++ ["-e" ./builder.sh]; 16 - } // extraEnv) 17 - 18 - // { 19 - mkDerivation = attrs: 20 - derivation ((removeAttrs attrs ["meta"]) // { 21 - builder = shell; 22 - args = extraShellOptions ++ ["-e" ] ++ [attrs.builder]; # (if attrs ? builder then [attrs.builder] else [ ../fix-builder.sh ../default-builder.sh] ) ; 23 - stdenv = body; 24 - system = body.system; 25 - } 26 - 27 - // extraEnv); 28 - 29 - inherit shell; 30 - }; 31 - }
+2 -11
pkgs/top-level/all-packages.nix
··· 8 8 { # The system (e.g., `i686-linux') for which to build the packages. 9 9 system ? builtins.currentSystem 10 10 11 - # 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 11 , # The standard environment to use. Only used for bootstrapping. If 21 12 # null, the default standard environment is used. 22 13 bootStdenv ? null ··· 137 128 self_ = with self; helperFunctions // { 138 129 139 130 # Make some arguments passed to all-packages.nix available 140 - inherit system stdenvType platform; 131 + inherit system platform; 141 132 142 133 # Allow callPackage to fill in the pkgs argument 143 134 inherit pkgs; ··· 213 204 214 205 215 206 allStdenvs = import ../stdenv { 216 - inherit system stdenvType platform config; 207 + inherit system platform config; 217 208 allPackages = args: import ./all-packages.nix ({ inherit config system; } // args); 218 209 }; 219 210
-27
pkgs/top-level/mingw.nix
··· 1 - let { 2 - pkgs = 3 - import ./all-packages.nix { 4 - stdenvType = "i686-mingw"; 5 - }; 6 - 7 - body = { 8 - inherit (pkgs) 9 - aterm 10 - getopt 11 - pkgconfig 12 - realCurl 13 - strategoLibraries 14 - zlib; 15 - # inherit profileTest; 16 - }; 17 - 18 - # profileTest = 19 - # pkgs.stdenv.mkDerivation { 20 - # name = "profile-test"; 21 - # src = ./char-test.c; 22 - # builder = ./profile-builder.sh; 23 - # strlib = pkgs.strategoLibraries; 24 - # aterm = pkgs.aterm; 25 - # buildInputs = [pkgs.aterm pkgs.strategoLibraries]; 26 - # }; 27 - }