···1213 buildInputs = [mercurial.python mercurial makeWrapper subversion];
1415- buildPhase="true"; # skip svn for now
1617 # TODO also support svn stuff
18 # moving .py files into lib directory so that you can't pick the wrong file from PATH.
···1213 buildInputs = [mercurial.python mercurial makeWrapper subversion];
1415+ dontBuild = true; # skip svn for now
1617 # TODO also support svn stuff
18 # moving .py files into lib directory so that you can't pick the wrong file from PATH.
···5657 # No building is necessary, but calling make without flags ironically
58 # calls install-strip ...
59- buildPhase = "true";
6061 # The binaries for Darwin use frameworks, so fake those frameworks,
62 # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
···5657 # No building is necessary, but calling make without flags ironically
58 # calls install-strip ...
59+ dontBuild = true;
6061 # The binaries for Darwin use frameworks, so fake those frameworks,
62 # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
+1-1
pkgs/development/compilers/ghc/7.0.4-binary.nix
···99100 # No building is necessary, but calling make without flags ironically
101 # calls install-strip ...
102- buildPhase = "true";
103104 postInstall =
105 ''
···99100 # No building is necessary, but calling make without flags ironically
101 # calls install-strip ...
102+ dontBuild = true;
103104 postInstall =
105 ''
+1-1
pkgs/development/compilers/ghc/7.4.2-binary.nix
···101102 # No building is necessary, but calling make without flags ironically
103 # calls install-strip ...
104- buildPhase = "true";
105106 preInstall = stdenv.lib.optionalString stdenv.isDarwin ''
107 mkdir -p $out/lib/ghc-7.4.2
···101102 # No building is necessary, but calling make without flags ironically
103 # calls install-strip ...
104+ dontBuild = true;
105106 preInstall = stdenv.lib.optionalString stdenv.isDarwin ''
107 mkdir -p $out/lib/ghc-7.4.2
···4 # Function that generates a TGZ file from a NPM project
5 buildNodeSourceDist =
6 { name, version, src }:
7-8 stdenv.mkDerivation {
9 name = "node-tarball-${name}-${version}";
10 inherit src;
···30 sha1 = "77466de589cd5d3c95f138aa78bc569a3cb5d27a";
31 };
32 } {};
33-34 # Function that produces a deployed NPM package in the Nix store
35 buildNodePackage =
36 { name, version, src, dependencies ? {}, buildInputs ? [], production ? true, npmFlags ? "", meta ? {}, linkDependencies ? false }:
···42 #
43 # It uses the semver utility to check whether a version range matches any
44 # of the provided dependencies.
45-46- analysedDependencies =
47 if dependencies == {} then {}
48 else
49 import (stdenv.mkDerivation {
···63 let
64 providedDependency = builtins.getAttr dependencyName providedDependencies;
65 versions = builtins.attrNames providedDependency;
66-67 # If there is a version range match, add the dependency to
68 # the set of shimmed dependencies.
69 # Otherwise, it is a required dependency.
70 in
71 ''
72 $(latestVersion=$(semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} | tail -1 | tr -d '\n')
73-74 if semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} >/dev/null
75 then
76 echo "shimmedDependencies.\"${dependencyName}\".\"$latestVersion\" = true;"
···86 EOF
87 '';
88 });
89-90 requiredDependencies = analysedDependencies.requiredDependencies or {};
91 shimmedDependencies = analysedDependencies.shimmedDependencies or {};
92···95 tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
96 mv node-* $out
97 '';
98-99 # Compose dependency information that this package must propagate to its
100 # dependencies, so that provided dependencies are not included a second time.
101 # This prevents cycles and wildcard version mismatches.
102-103 propagatedProvidedDependencies =
104 (stdenv.lib.mapAttrs (dependencyName: dependency:
105 builtins.listToAttrs (map (versionSpec:
···110 ) dependencies) //
111 providedDependencies //
112 { "${name}"."${version}" = true; };
113-114 # Create a node_modules folder containing all required dependencies of the
115 # package
116-117 nodeDependencies = stdenv.mkDerivation {
118 name = "node-dependencies-${name}-${version}";
119 inherit src;
120 buildCommand = ''
121 mkdir -p $out/lib/node_modules
122 cd $out/lib/node_modules
123-124 # Create copies of (or symlinks to) the dependencies that must be deployed in this package's private node_modules folder.
125 # This package's private dependencies are NPM packages that have not been provided by any of the includers.
126-127 ${stdenv.lib.concatMapStrings (requiredDependencyName:
128 stdenv.lib.concatMapStrings (versionSpec:
129 let
···133 in
134 ''
135 depPath=$(echo ${dependency}/lib/node_modules/*)
136-137 ${if linkDependencies then ''
138 ln -s $depPath .
139 '' else ''
···144 ) (builtins.attrNames requiredDependencies)}
145 '';
146 };
147-148 # Deploy the Node package with some tricks
149 self = stdenv.lib.makeOverridable stdenv.mkDerivation {
150 inherit src meta;
151 dontStrip = true;
152-153 name = "node-${name}-${version}";
154 buildInputs = [ nodejs python ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
155- buildPhase = "true";
156-157 installPhase = ''
158 # Move the contents of the tarball into the output folder
159 mkdir -p "$out/lib/node_modules/${name}"
160 mv * "$out/lib/node_modules/${name}"
161-162 # Enter the target directory
163 cd "$out/lib/node_modules/${name}"
164-165 # Patch the shebangs of the bundled modules. For "regular" dependencies
166 # this is step is not required, because it has already been done by the generic builder.
167-168 if [ -d node_modules ]
169 then
170 patchShebangs node_modules
171 fi
172-173 # Copy the required dependencies
174 mkdir -p node_modules
175-176 ${stdenv.lib.optionalString (requiredDependencies != {}) ''
177 for i in ${nodeDependencies}/lib/node_modules/*
178 do
···182 fi
183 done
184 ''}
185-186 # Create shims for the packages that have been provided by earlier includers to allow the NPM install operation to still succeed
187-188 ${stdenv.lib.concatMapStrings (shimmedDependencyName:
189 stdenv.lib.concatMapStrings (versionSpec:
190 ''
···198 ''
199 ) (builtins.attrNames (shimmedDependencies."${shimmedDependencyName}"))
200 ) (builtins.attrNames shimmedDependencies)}
201-202 # Ignore npm-shrinkwrap.json for now. Ideally, it should be supported as well
203 rm -f npm-shrinkwrap.json
204-205 # Some version specifiers (latest, unstable, URLs, file paths) force NPM to make remote connections or consult paths outside the Nix store.
206 # The following JavaScript replaces these by * to prevent that:
207-208 (
209 cat <<EOF
210 var fs = require('fs');
211 var url = require('url');
212-213 /*
214 * Replaces an impure version specification by *
215 */
216 function replaceImpureVersionSpec(versionSpec) {
217 var parsedUrl = url.parse(versionSpec);
218-219 if(versionSpec == "latest" || versionSpec == "unstable" ||
220 versionSpec.substr(0, 2) == ".." || dependency.substr(0, 2) == "./" || dependency.substr(0, 2) == "~/" || dependency.substr(0, 1) == '/')
221 return '*';
···225 else
226 return versionSpec;
227 }
228-229 var packageObj = JSON.parse(fs.readFileSync('./package.json'));
230-231 /* Replace dependencies */
232 if(packageObj.dependencies !== undefined) {
233 for(var dependency in packageObj.dependencies) {
···235 packageObj.dependencies[dependency] = replaceImpureVersionSpec(versionSpec);
236 }
237 }
238-239 /* Replace development dependencies */
240 if(packageObj.devDependencies !== undefined) {
241 for(var dependency in packageObj.devDependencies) {
···243 packageObj.devDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
244 }
245 }
246-247 /* Replace optional dependencies */
248 if(packageObj.optionalDependencies !== undefined) {
249 for(var dependency in packageObj.optionalDependencies) {
···251 packageObj.optionalDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
252 }
253 }
254-255 /* Write the fixed JSON file */
256 fs.writeFileSync("package.json", JSON.stringify(packageObj));
257 EOF
258 ) | node
259-260 # Deploy the Node.js package by running npm install. Since the dependencies have been symlinked, it should not attempt to install them again,
261 # which is good, because we want to make it Nix's responsibility. If it needs to install any dependencies anyway (e.g. because the dependency
262 # parameters are incomplete/incorrect), it fails.
263-264 export HOME=$TMPDIR
265 npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
266-267 # After deployment of the NPM package, we must remove the shims again
268 ${stdenv.lib.concatMapStrings (shimmedDependencyName:
269 ''
···271 rmdir node_modules/${shimmedDependencyName}
272 ''
273 ) (builtins.attrNames shimmedDependencies)}
274-275 # It makes no sense to keep an empty node_modules folder around, so delete it if this is the case
276 if [ -d node_modules ]
277 then
278 rmdir --ignore-fail-on-non-empty node_modules
279 fi
280-281 # Create symlink to the deployed executable folder, if applicable
282 if [ -d "$out/lib/node_modules/.bin" ]
283 then
284 ln -s $out/lib/node_modules/.bin $out/bin
285 fi
286-287 # Create symlinks to the deployed manual page folders, if applicable
288 if [ -d "$out/lib/node_modules/${name}/man" ]
289 then
···298 done
299 fi
300 '';
301-302 shellHook = stdenv.lib.optionalString (requiredDependencies != {}) ''
303 export NODE_PATH=${nodeDependencies}/lib/node_modules
304 '';
···4 # Function that generates a TGZ file from a NPM project
5 buildNodeSourceDist =
6 { name, version, src }:
7+8 stdenv.mkDerivation {
9 name = "node-tarball-${name}-${version}";
10 inherit src;
···30 sha1 = "77466de589cd5d3c95f138aa78bc569a3cb5d27a";
31 };
32 } {};
33+34 # Function that produces a deployed NPM package in the Nix store
35 buildNodePackage =
36 { name, version, src, dependencies ? {}, buildInputs ? [], production ? true, npmFlags ? "", meta ? {}, linkDependencies ? false }:
···42 #
43 # It uses the semver utility to check whether a version range matches any
44 # of the provided dependencies.
45+46+ analysedDependencies =
47 if dependencies == {} then {}
48 else
49 import (stdenv.mkDerivation {
···63 let
64 providedDependency = builtins.getAttr dependencyName providedDependencies;
65 versions = builtins.attrNames providedDependency;
66+67 # If there is a version range match, add the dependency to
68 # the set of shimmed dependencies.
69 # Otherwise, it is a required dependency.
70 in
71 ''
72 $(latestVersion=$(semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} | tail -1 | tr -d '\n')
73+74 if semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} >/dev/null
75 then
76 echo "shimmedDependencies.\"${dependencyName}\".\"$latestVersion\" = true;"
···86 EOF
87 '';
88 });
89+90 requiredDependencies = analysedDependencies.requiredDependencies or {};
91 shimmedDependencies = analysedDependencies.shimmedDependencies or {};
92···95 tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
96 mv node-* $out
97 '';
98+99 # Compose dependency information that this package must propagate to its
100 # dependencies, so that provided dependencies are not included a second time.
101 # This prevents cycles and wildcard version mismatches.
102+103 propagatedProvidedDependencies =
104 (stdenv.lib.mapAttrs (dependencyName: dependency:
105 builtins.listToAttrs (map (versionSpec:
···110 ) dependencies) //
111 providedDependencies //
112 { "${name}"."${version}" = true; };
113+114 # Create a node_modules folder containing all required dependencies of the
115 # package
116+117 nodeDependencies = stdenv.mkDerivation {
118 name = "node-dependencies-${name}-${version}";
119 inherit src;
120 buildCommand = ''
121 mkdir -p $out/lib/node_modules
122 cd $out/lib/node_modules
123+124 # Create copies of (or symlinks to) the dependencies that must be deployed in this package's private node_modules folder.
125 # This package's private dependencies are NPM packages that have not been provided by any of the includers.
126+127 ${stdenv.lib.concatMapStrings (requiredDependencyName:
128 stdenv.lib.concatMapStrings (versionSpec:
129 let
···133 in
134 ''
135 depPath=$(echo ${dependency}/lib/node_modules/*)
136+137 ${if linkDependencies then ''
138 ln -s $depPath .
139 '' else ''
···144 ) (builtins.attrNames requiredDependencies)}
145 '';
146 };
147+148 # Deploy the Node package with some tricks
149 self = stdenv.lib.makeOverridable stdenv.mkDerivation {
150 inherit src meta;
151 dontStrip = true;
152+153 name = "node-${name}-${version}";
154 buildInputs = [ nodejs python ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
155+ dontBuild = true;
156+157 installPhase = ''
158 # Move the contents of the tarball into the output folder
159 mkdir -p "$out/lib/node_modules/${name}"
160 mv * "$out/lib/node_modules/${name}"
161+162 # Enter the target directory
163 cd "$out/lib/node_modules/${name}"
164+165 # Patch the shebangs of the bundled modules. For "regular" dependencies
166 # this is step is not required, because it has already been done by the generic builder.
167+168 if [ -d node_modules ]
169 then
170 patchShebangs node_modules
171 fi
172+173 # Copy the required dependencies
174 mkdir -p node_modules
175+176 ${stdenv.lib.optionalString (requiredDependencies != {}) ''
177 for i in ${nodeDependencies}/lib/node_modules/*
178 do
···182 fi
183 done
184 ''}
185+186 # Create shims for the packages that have been provided by earlier includers to allow the NPM install operation to still succeed
187+188 ${stdenv.lib.concatMapStrings (shimmedDependencyName:
189 stdenv.lib.concatMapStrings (versionSpec:
190 ''
···198 ''
199 ) (builtins.attrNames (shimmedDependencies."${shimmedDependencyName}"))
200 ) (builtins.attrNames shimmedDependencies)}
201+202 # Ignore npm-shrinkwrap.json for now. Ideally, it should be supported as well
203 rm -f npm-shrinkwrap.json
204+205 # Some version specifiers (latest, unstable, URLs, file paths) force NPM to make remote connections or consult paths outside the Nix store.
206 # The following JavaScript replaces these by * to prevent that:
207+208 (
209 cat <<EOF
210 var fs = require('fs');
211 var url = require('url');
212+213 /*
214 * Replaces an impure version specification by *
215 */
216 function replaceImpureVersionSpec(versionSpec) {
217 var parsedUrl = url.parse(versionSpec);
218+219 if(versionSpec == "latest" || versionSpec == "unstable" ||
220 versionSpec.substr(0, 2) == ".." || dependency.substr(0, 2) == "./" || dependency.substr(0, 2) == "~/" || dependency.substr(0, 1) == '/')
221 return '*';
···225 else
226 return versionSpec;
227 }
228+229 var packageObj = JSON.parse(fs.readFileSync('./package.json'));
230+231 /* Replace dependencies */
232 if(packageObj.dependencies !== undefined) {
233 for(var dependency in packageObj.dependencies) {
···235 packageObj.dependencies[dependency] = replaceImpureVersionSpec(versionSpec);
236 }
237 }
238+239 /* Replace development dependencies */
240 if(packageObj.devDependencies !== undefined) {
241 for(var dependency in packageObj.devDependencies) {
···243 packageObj.devDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
244 }
245 }
246+247 /* Replace optional dependencies */
248 if(packageObj.optionalDependencies !== undefined) {
249 for(var dependency in packageObj.optionalDependencies) {
···251 packageObj.optionalDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
252 }
253 }
254+255 /* Write the fixed JSON file */
256 fs.writeFileSync("package.json", JSON.stringify(packageObj));
257 EOF
258 ) | node
259+260 # Deploy the Node.js package by running npm install. Since the dependencies have been symlinked, it should not attempt to install them again,
261 # which is good, because we want to make it Nix's responsibility. If it needs to install any dependencies anyway (e.g. because the dependency
262 # parameters are incomplete/incorrect), it fails.
263+264 export HOME=$TMPDIR
265 npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
266+267 # After deployment of the NPM package, we must remove the shims again
268 ${stdenv.lib.concatMapStrings (shimmedDependencyName:
269 ''
···271 rmdir node_modules/${shimmedDependencyName}
272 ''
273 ) (builtins.attrNames shimmedDependencies)}
274+275 # It makes no sense to keep an empty node_modules folder around, so delete it if this is the case
276 if [ -d node_modules ]
277 then
278 rmdir --ignore-fail-on-non-empty node_modules
279 fi
280+281 # Create symlink to the deployed executable folder, if applicable
282 if [ -d "$out/lib/node_modules/.bin" ]
283 then
284 ln -s $out/lib/node_modules/.bin $out/bin
285 fi
286+287 # Create symlinks to the deployed manual page folders, if applicable
288 if [ -d "$out/lib/node_modules/${name}/man" ]
289 then
···298 done
299 fi
300 '';
301+302 shellHook = stdenv.lib.optionalString (requiredDependencies != {}) ''
303 export NODE_PATH=${nodeDependencies}/lib/node_modules
304 '';
···25 javaSupport = true;
26 };
2728- configurePhase = ":";
29- buildPhase = ":";
30-31 installPhase = ''
32 mkdir $TMP/build
33 sh monetdb-install.sh --build=$TMP/build --prefix=$out --enable-sql --enable-xquery
34 '';
3536- meta = {
37 description = "A open-source database system for high-performance applications in data mining, OLAP, GIS, XML Query, text and multimedia retrieval";
38 homepage = http://monetdb.cwi.nl/;
39 license = "MonetDB Public License"; # very similar to Mozilla public license (MPL) Version see 1.1 http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
···25 javaSupport = true;
26 };
2728+ dontBuild = true;
29+030 installPhase = ''
31 mkdir $TMP/build
32 sh monetdb-install.sh --build=$TMP/build --prefix=$out --enable-sql --enable-xquery
33 '';
3435+ meta = {
36 description = "A open-source database system for high-performance applications in data mining, OLAP, GIS, XML Query, text and multimedia retrieval";
37 homepage = http://monetdb.cwi.nl/;
38 license = "MonetDB Public License"; # very similar to Mozilla public license (MPL) Version see 1.1 http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
···1{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget, coreutils, fakeroot }:
23let
4-5# USAGE like this: debootstrap sid /tmp/target-chroot-directory
6-7# There is also cdebootstrap now. Is that easier to maintain?
8-9 makedev = stdenv.mkDerivation {
10 name = "makedev-for-debootstrap";
11 src = fetchurl {
···27 chmod +x $t
28 '';
29 };
30-31-in
32-33-stdenv.mkDerivation rec {
34-35 name = "debootstrap-${version}";
36 version = "1.0.80";
37···4445 buildInputs = [ dpkg gettext gawk perl ];
4647- buildPhase = ":";
4849 # If you have to update the patch for functions a vim regex like this
50 # can help you identify which lines are used to write scripts on TARGET and
51 # which should /bin/ paths should be replaced:
52 # \<echo\>\|\/bin\/\|^\s*\<cat\>\|EOF\|END
53 installPhase = ''
54-55 sed -i \
56 -e 's@/usr/bin/id@id@' \
57 -e 's@/usr/bin/dpkg@${dpkg}/bin/dpkg@' \
58 -e 's@/usr/bin/sha@${coreutils}/bin/sha@' \
59 -e 's@/bin/sha@${coreutils}/bin/sha@' \
60 debootstrap
61-6263 for file in functions debootstrap; do
64 substituteInPlace "$file" \
···103 inherit makedev;
104 };
105106- meta = {
107 description = "Tool to create a Debian system in a chroot";
108 homepage = http://packages.debian.org/de/lenny/debootstrap; # http://code.erisian.com.au/Wiki/debootstrap
109 license = stdenv.lib.licenses.gpl2; # gentoo says so.. ?
···1{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget, coreutils, fakeroot }:
23let
04# USAGE like this: debootstrap sid /tmp/target-chroot-directory
05# There is also cdebootstrap now. Is that easier to maintain?
06 makedev = stdenv.mkDerivation {
7 name = "makedev-for-debootstrap";
8 src = fetchurl {
···24 chmod +x $t
25 '';
26 };
27+in stdenv.mkDerivation rec {
000028 name = "debootstrap-${version}";
29 version = "1.0.80";
30···3738 buildInputs = [ dpkg gettext gawk perl ];
3940+ dontBuild = true;
4142 # If you have to update the patch for functions a vim regex like this
43 # can help you identify which lines are used to write scripts on TARGET and
44 # which should /bin/ paths should be replaced:
45 # \<echo\>\|\/bin\/\|^\s*\<cat\>\|EOF\|END
46 installPhase = ''
047 sed -i \
48 -e 's@/usr/bin/id@id@' \
49 -e 's@/usr/bin/dpkg@${dpkg}/bin/dpkg@' \
50 -e 's@/usr/bin/sha@${coreutils}/bin/sha@' \
51 -e 's@/bin/sha@${coreutils}/bin/sha@' \
52 debootstrap
05354 for file in functions debootstrap; do
55 substituteInPlace "$file" \
···94 inherit makedev;
95 };
9697+ meta = {
98 description = "Tool to create a Debian system in a chroot";
99 homepage = http://packages.debian.org/de/lenny/debootstrap; # http://code.erisian.com.au/Wiki/debootstrap
100 license = stdenv.lib.licenses.gpl2; # gentoo says so.. ?