summary refs log tree commit diff
path: root/pkgs/build-support/release
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2009-03-16 12:45:27 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-03-16 12:45:27 +0000
commit3593b97d631d554cfec9a5eec8966fadb3192de8 (patch)
treec1a1f0bbb9270c83c803f501e14ea451e8f9fc74 /pkgs/build-support/release
parentd574d882ccade3b159b16e7ea2b8aeffd9d13bcd (diff)
parent808f12e36961b15c9662bb6e890f9045cdab43ce (diff)
downloadnixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar.gz
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar.bz2
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar.lz
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar.xz
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.tar.zst
nixpkgs-3593b97d631d554cfec9a5eec8966fadb3192de8.zip
* Sync with the trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=14557
Diffstat (limited to 'pkgs/build-support/release')
-rw-r--r--pkgs/build-support/release/debian-build.nix17
-rw-r--r--pkgs/build-support/release/default.nix8
-rw-r--r--pkgs/build-support/release/make-source-tarball.nix13
-rw-r--r--pkgs/build-support/release/nix-build.nix21
-rw-r--r--pkgs/build-support/release/rpm-build.nix15
5 files changed, 44 insertions, 30 deletions
diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix
index fad88a98f17..d41750733b5 100644
--- a/pkgs/build-support/release/debian-build.nix
+++ b/pkgs/build-support/release/debian-build.nix
@@ -1,13 +1,14 @@
 # This function compiles a source tarball in a virtual machine image
 # that contains a Debian-like (i.e. dpkg-based) OS.
 
-{vmTools, fetchurl}: args: with args;
+{ name ? "debian-build"
+, diskImage
+, src, stdenv, vmTools, checkinstall
+, ... } @ args:
 
 vmTools.runInLinuxImage (stdenv.mkDerivation (
 
   {
-    name = "debian-build";
-
     doCheck = true;
 
     prefix = "/usr";
@@ -15,11 +16,11 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
     phases = "installExtraDebsPhase sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase distPhase";
   }
 
-  // args //
+  // removeAttrs args ["vmTools"] //
 
   {
-    src = src.path;
-  
+    name = name + "-" + diskImage.name + (if src ? version then "-" + src.version else "");
+
     # !!! cut&paste from rpm-build.nix
     postHook = ''
       ensureDir $out/nix-support
@@ -50,7 +51,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
 
     installCommand = ''
       export LOGNAME=root
-    
+
       ${checkinstall}/sbin/checkinstall -y -D make install
 
       ensureDir $out/debs
@@ -66,7 +67,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
     ''; # */
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = "Build of a Deb package on ${args.diskImage.fullName} (${args.diskImage.name})";
+      description = "Build of a Deb package on ${diskImage.fullName} (${diskImage.name})";
     };
   }
 
diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix
index 789def4ddff..0c0ee1bec55 100644
--- a/pkgs/build-support/release/default.nix
+++ b/pkgs/build-support/release/default.nix
@@ -17,10 +17,12 @@ rec {
       doCoverageAnalysis = true;
     } // args);
 
-  rpmBuild = args: import ./rpm-build.nix vmTools args;
+  rpmBuild = args: import ./rpm-build.nix (
+    { inherit vmTools;
+    } // args);
 
-  debBuild = args: import ./debian-build.nix {inherit vmTools fetchurl;} (
-    { inherit stdenv checkinstall;
+  debBuild = args: import ./debian-build.nix (
+    { inherit stdenv vmTools checkinstall;
     } // args);
 
 }
diff --git a/pkgs/build-support/release/make-source-tarball.nix b/pkgs/build-support/release/make-source-tarball.nix
index 806246db794..2e40ad2d623 100644
--- a/pkgs/build-support/release/make-source-tarball.nix
+++ b/pkgs/build-support/release/make-source-tarball.nix
@@ -4,6 +4,8 @@
 
 { officialRelease ? false
 , buildInputs ? []
+, name ? "source-tarball"
+, version ? "0"
 , src, stdenv, autoconf, automake, libtool
 , ... } @ args:
 
@@ -20,8 +22,6 @@ stdenv.mkDerivation (
 
   # First, attributes that can be overriden by the caller (via args):
   {
-    name = "source-tarball";
-
     # By default, only configure and build a source distribution.
     # Some packages can only build a distribution after a general
     # `make' (or even `make install').
@@ -43,7 +43,7 @@ stdenv.mkDerivation (
 
   # And finally, our own stuff.
   {
-    src = src.path;
+    name = name + "-" + version + versionSuffix;
 
     buildInputs = buildInputs ++ [autoconf automake libtool];
     
@@ -66,6 +66,7 @@ stdenv.mkDerivation (
 
     # Autoconfiscate the sources.
     autoconfPhase = ''
+      export VERSION=${version}
       export VERSION_SUFFIX=${versionSuffix}
     
       eval "$preAutoconf"
@@ -96,12 +97,14 @@ stdenv.mkDerivation (
       test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name)
     ''; # */
 
-    passthru = {inherit src;};
+    passthru = {
+      inherit src;
+      version = version + versionSuffix;
+    };
 
     meta = (if args ? meta then args.meta else {}) // {
       description = "Build of a source distribution from a checkout";
     };
-  
   }
 
 )
diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix
index 5f127265d4a..f9d2351d925 100644
--- a/pkgs/build-support/release/nix-build.nix
+++ b/pkgs/build-support/release/nix-build.nix
@@ -8,13 +8,12 @@
 { doCoverageAnalysis ? false
 , lcovFilter ? []
 , src, stdenv
+, name ? if doCoverageAnalysis then "nix-coverage" else "nix-build"
 , ... } @ args:
 
 stdenv.mkDerivation (
 
   {
-    name = "nix-build";
-
     # Also run a `make check'.
     doCheck = true;
 
@@ -24,14 +23,14 @@ stdenv.mkDerivation (
     showBuildStats = true;
 
     # Hack - swap checkPhase and installPhase (otherwise Stratego barfs).
-    phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase ${if doCoverageAnalysis then "coverageReportPhase" else ""}";
+    phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase ${if doCoverageAnalysis then "coverageReportPhase" else ""} finalPhase";
   }
 
   // args // 
 
   {
-    src = src.path;
-
+    name = name + (if src ? version then "-" + src.version else "");
+  
     postHook = ''
       ensureDir $out/nix-support
       echo "$system" > $out/nix-support/system
@@ -43,7 +42,7 @@ stdenv.mkDerivation (
       # If `src' is the result of a call to `makeSourceTarball', then it
       # has a subdirectory containing the actual tarball(s).  If there are
       # multiple tarballs, just pick the first one.
-      echo $src
+      origSrc=$src
       if test -d $src/tarballs; then
           src=$(ls $src/tarballs/*.tar.bz2 $src/tarballs/*.tar.gz | sort | head -1)
       fi
@@ -85,6 +84,16 @@ stdenv.mkDerivation (
 
 
     lcovFilter = ["/nix/store/*"] ++ lcovFilter;
+
+
+    finalPhase =
+      ''
+        # Propagate the release name of the source tarball.  This is
+        # to get nice package names in channels.
+        if test -e $origSrc/nix-support/hydra-release-name; then
+          cp $origSrc/nix-support/hydra-release-name $out/nix-support/hydra-release-name
+        fi
+      '';
     
 
     meta = (if args ? meta then args.meta else {}) // {
diff --git a/pkgs/build-support/release/rpm-build.nix b/pkgs/build-support/release/rpm-build.nix
index 88273b5958c..97e86dd3c68 100644
--- a/pkgs/build-support/release/rpm-build.nix
+++ b/pkgs/build-support/release/rpm-build.nix
@@ -1,18 +1,17 @@
 # This function builds an RPM from a source tarball that contains a
 # RPM spec file (i.e., one that can be built using `rpmbuild -ta').
 
-vmTools: args: with args;
+{ name ? "rpm-build"
+, diskImage
+, src, vmTools
+, ... } @ args:
 
 vmTools.buildRPM (
 
-  {
-    name = "rpm-build";
-  }
-
-  // args //
+  removeAttrs args ["vmTools"] //
 
   {
-    src = src.path;
+    name = name + "-" + diskImage.name + (if src ? version then "-" + src.version else "");
 
     preBuild = ''
       ensureDir $out/nix-support
@@ -34,7 +33,7 @@ vmTools.buildRPM (
     ''; # */
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = "Build of an RPM package on ${args.diskImage.fullName} (${args.diskImage.name})";
+      description = "Build of an RPM package on ${diskImage.fullName} (${diskImage.name})";
     };
   }