From 9820cb1bf24254199db05856bbb4919378ac75cb Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 4 May 2016 10:08:35 +0000 Subject: use dontBuild instead of hacks changes: * buildPhase = "true" * buildPhase = ":" --- pkgs/development/compilers/ghc/6.10.2-binary.nix | 2 +- pkgs/development/compilers/ghc/7.0.4-binary.nix | 2 +- pkgs/development/compilers/ghc/7.4.2-binary.nix | 2 +- pkgs/development/libraries/fmod/4.24.16.nix | 3 +- pkgs/development/libraries/fmod/default.nix | 3 +- pkgs/development/libraries/libspotify/default.nix | 15 ++-- pkgs/development/libraries/uthash/default.nix | 2 +- .../libraries/xlibs-wrapper/default.nix | 5 +- .../mobile/titaniumenv/cli/node-env.nix | 84 +++++++++++----------- .../python-modules/stringtemplate/default.nix | 19 +++-- .../tools/analysis/clang-analyzer/default.nix | 3 +- .../tools/build-managers/gradle/default.nix | 2 +- pkgs/development/tools/misc/sqitch/default.nix | 8 ++- pkgs/development/web/grails/default.nix | 2 +- 14 files changed, 81 insertions(+), 71 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/compilers/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix index 045b9142ef3..81bdebdcbd4 100644 --- a/pkgs/development/compilers/ghc/6.10.2-binary.nix +++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { # No building is necessary, but calling make without flags ironically # calls install-strip ... - buildPhase = "true"; + dontBuild = true; # The binaries for Darwin use frameworks, so fake those frameworks, # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix index c03cfbaaadd..77e5229a2a0 100644 --- a/pkgs/development/compilers/ghc/7.0.4-binary.nix +++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix @@ -99,7 +99,7 @@ stdenv.mkDerivation rec { # No building is necessary, but calling make without flags ironically # calls install-strip ... - buildPhase = "true"; + dontBuild = true; postInstall = '' diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix index cf21a61b1b3..c9f281980d9 100644 --- a/pkgs/development/compilers/ghc/7.4.2-binary.nix +++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix @@ -101,7 +101,7 @@ stdenv.mkDerivation rec { # No building is necessary, but calling make without flags ironically # calls install-strip ... - buildPhase = "true"; + dontBuild = true; preInstall = stdenv.lib.optionalString stdenv.isDarwin '' mkdir -p $out/lib/ghc-7.4.2 diff --git a/pkgs/development/libraries/fmod/4.24.16.nix b/pkgs/development/libraries/fmod/4.24.16.nix index 191db2f6f6d..b45ec24ca6b 100644 --- a/pkgs/development/libraries/fmod/4.24.16.nix +++ b/pkgs/development/libraries/fmod/4.24.16.nix @@ -29,11 +29,10 @@ stdenv.mkDerivation rec { dontStrip = true; dontPatchELF = true; + dontBuild = true; makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ]; - buildPhase = "true"; - preInstall = '' mkdir -p $out/lib ''; diff --git a/pkgs/development/libraries/fmod/default.nix b/pkgs/development/libraries/fmod/default.nix index 621d6dc405f..af946019540 100644 --- a/pkgs/development/libraries/fmod/default.nix +++ b/pkgs/development/libraries/fmod/default.nix @@ -18,7 +18,8 @@ stdenv.mkDerivation rec { }; dontStrip = true; - buildPhase = "true"; + dontBuild = true; + installPhase = '' mkdir -p $out/lib $out/include/fmodex diff --git a/pkgs/development/libraries/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix index 02bd1f966e6..951a939cbfb 100644 --- a/pkgs/development/libraries/libspotify/default.nix +++ b/pkgs/development/libraries/libspotify/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey, unzip, gnused }: -let - version = "12.1.51"; +let + version = "12.1.51"; isLinux = (stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux"); in @@ -29,13 +29,8 @@ else stdenv.mkDerivation { else null; - # common - buildPhase = "true"; - # no patch or build phase for darwin - phases = - [ "unpackPhase" ] ++ - (stdenv.lib.optionals (isLinux) [ "patchPhase" "buildPhase" ]) ++ - [ "installPhase" ]; + dontBuild = true; + installPhase = if (isLinux) then "installPhase" else '' @@ -48,7 +43,7 @@ else stdenv.mkDerivation { mkdir -p "$out"/share/man mv -v man3 "$out"/share/man ''; - + # darwin-specific buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip; diff --git a/pkgs/development/libraries/uthash/default.nix b/pkgs/development/libraries/uthash/default.nix index 5f3b71131e0..511129de1e8 100644 --- a/pkgs/development/libraries/uthash/default.nix +++ b/pkgs/development/libraries/uthash/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "035z3cs5ignywgh4wqxx358a2nhn3lj0x1ifij6vj0yyyhah3wgj"; }; - buildPhase = ":"; + dontBuild = false; buildInputs = stdenv.lib.optional doCheck perl; diff --git a/pkgs/development/libraries/xlibs-wrapper/default.nix b/pkgs/development/libraries/xlibs-wrapper/default.nix index fcdab133e2f..ffc58d9ad4b 100644 --- a/pkgs/development/libraries/xlibs-wrapper/default.nix +++ b/pkgs/development/libraries/xlibs-wrapper/default.nix @@ -2,9 +2,12 @@ stdenv.mkDerivation { name = "xlibs-wrapper"; - buildPhase = "true"; + + dontBuild = true; + installPhase = "mkdir -p $out"; unpackPhase = "sourceRoot=."; + propagatedBuildInputs = packages; preferLocalBuild = true; diff --git a/pkgs/development/mobile/titaniumenv/cli/node-env.nix b/pkgs/development/mobile/titaniumenv/cli/node-env.nix index 7af18c034f2..c6d56c9e074 100644 --- a/pkgs/development/mobile/titaniumenv/cli/node-env.nix +++ b/pkgs/development/mobile/titaniumenv/cli/node-env.nix @@ -4,7 +4,7 @@ let # Function that generates a TGZ file from a NPM project buildNodeSourceDist = { name, version, src }: - + stdenv.mkDerivation { name = "node-tarball-${name}-${version}"; inherit src; @@ -30,7 +30,7 @@ let sha1 = "77466de589cd5d3c95f138aa78bc569a3cb5d27a"; }; } {}; - + # Function that produces a deployed NPM package in the Nix store buildNodePackage = { name, version, src, dependencies ? {}, buildInputs ? [], production ? true, npmFlags ? "", meta ? {}, linkDependencies ? false }: @@ -42,8 +42,8 @@ let # # It uses the semver utility to check whether a version range matches any # of the provided dependencies. - - analysedDependencies = + + analysedDependencies = if dependencies == {} then {} else import (stdenv.mkDerivation { @@ -63,14 +63,14 @@ let let providedDependency = builtins.getAttr dependencyName providedDependencies; versions = builtins.attrNames providedDependency; - + # If there is a version range match, add the dependency to # the set of shimmed dependencies. # Otherwise, it is a required dependency. in '' $(latestVersion=$(semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} | tail -1 | tr -d '\n') - + if semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} >/dev/null then echo "shimmedDependencies.\"${dependencyName}\".\"$latestVersion\" = true;" @@ -86,7 +86,7 @@ let EOF ''; }); - + requiredDependencies = analysedDependencies.requiredDependencies or {}; shimmedDependencies = analysedDependencies.shimmedDependencies or {}; @@ -95,11 +95,11 @@ let tar --no-same-owner --no-same-permissions -xf ${nodejs.src} mv node-* $out ''; - + # Compose dependency information that this package must propagate to its # dependencies, so that provided dependencies are not included a second time. # This prevents cycles and wildcard version mismatches. - + propagatedProvidedDependencies = (stdenv.lib.mapAttrs (dependencyName: dependency: builtins.listToAttrs (map (versionSpec: @@ -110,20 +110,20 @@ let ) dependencies) // providedDependencies // { "${name}"."${version}" = true; }; - + # Create a node_modules folder containing all required dependencies of the # package - + nodeDependencies = stdenv.mkDerivation { name = "node-dependencies-${name}-${version}"; inherit src; buildCommand = '' mkdir -p $out/lib/node_modules cd $out/lib/node_modules - + # Create copies of (or symlinks to) the dependencies that must be deployed in this package's private node_modules folder. # This package's private dependencies are NPM packages that have not been provided by any of the includers. - + ${stdenv.lib.concatMapStrings (requiredDependencyName: stdenv.lib.concatMapStrings (versionSpec: let @@ -133,7 +133,7 @@ let in '' depPath=$(echo ${dependency}/lib/node_modules/*) - + ${if linkDependencies then '' ln -s $depPath . '' else '' @@ -144,35 +144,35 @@ let ) (builtins.attrNames requiredDependencies)} ''; }; - + # Deploy the Node package with some tricks self = stdenv.lib.makeOverridable stdenv.mkDerivation { inherit src meta; dontStrip = true; - + name = "node-${name}-${version}"; buildInputs = [ nodejs python ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs; - buildPhase = "true"; - + dontBuild = true; + installPhase = '' # Move the contents of the tarball into the output folder mkdir -p "$out/lib/node_modules/${name}" mv * "$out/lib/node_modules/${name}" - + # Enter the target directory cd "$out/lib/node_modules/${name}" - + # Patch the shebangs of the bundled modules. For "regular" dependencies # this is step is not required, because it has already been done by the generic builder. - + if [ -d node_modules ] then patchShebangs node_modules fi - + # Copy the required dependencies mkdir -p node_modules - + ${stdenv.lib.optionalString (requiredDependencies != {}) '' for i in ${nodeDependencies}/lib/node_modules/* do @@ -182,9 +182,9 @@ let fi done ''} - + # Create shims for the packages that have been provided by earlier includers to allow the NPM install operation to still succeed - + ${stdenv.lib.concatMapStrings (shimmedDependencyName: stdenv.lib.concatMapStrings (versionSpec: '' @@ -198,24 +198,24 @@ let '' ) (builtins.attrNames (shimmedDependencies."${shimmedDependencyName}")) ) (builtins.attrNames shimmedDependencies)} - + # Ignore npm-shrinkwrap.json for now. Ideally, it should be supported as well rm -f npm-shrinkwrap.json - + # Some version specifiers (latest, unstable, URLs, file paths) force NPM to make remote connections or consult paths outside the Nix store. # The following JavaScript replaces these by * to prevent that: - + ( cat <