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-31 15:30:47 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-03-31 15:30:47 +0000
commitd27514cb28997dd9ed745bbf12a8d2f821acbbee (patch)
tree6868ce3deb5776f37d9963fe0784204020d6dfc5 /pkgs/build-support/release
parent9455f37ce91c1df43109eea64e8258cab0054768 (diff)
parent1f9740e01c4da98c1a49641f2313729798fafcf3 (diff)
downloadnixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar.gz
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar.bz2
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar.lz
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar.xz
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.tar.zst
nixlib-d27514cb28997dd9ed745bbf12a8d2f821acbbee.zip
* Sync with the trunk once more.
* Turn on everything in Hydra.

svn path=/nixpkgs/branches/stdenv-updates/; revision=14806
Diffstat (limited to 'pkgs/build-support/release')
-rw-r--r--pkgs/build-support/release/binary-tarball.nix87
-rw-r--r--pkgs/build-support/release/debian-build.nix9
-rw-r--r--pkgs/build-support/release/default.nix8
-rw-r--r--pkgs/build-support/release/nix-build.nix9
-rw-r--r--pkgs/build-support/release/source-tarball.nix (renamed from pkgs/build-support/release/make-source-tarball.nix)6
5 files changed, 105 insertions, 14 deletions
diff --git a/pkgs/build-support/release/binary-tarball.nix b/pkgs/build-support/release/binary-tarball.nix
new file mode 100644
index 000000000000..f8bb5282ee2f
--- /dev/null
+++ b/pkgs/build-support/release/binary-tarball.nix
@@ -0,0 +1,87 @@
+/* This function builds a binary tarball.  The resulting binaries are
+   usually only useful if they are don't have any runtime dependencies
+   on any paths in the Nix store, since those aren't distributed in
+   the tarball.  For instance, the binaries should be statically
+   linked: they can't depend on dynamic libraries in the store
+   (including Glibc).
+
+   The binaries are built and installed with a prefix of /usr/local by
+   default.  They are installed by setting DESTDIR to a temporary
+   directory, so the Makefile of the package should support DESTDIR.
+*/
+
+{ src, stdenv
+, name ? "binary-tarball"
+, ... } @ args:
+
+stdenv.mkDerivation (
+
+  {
+    # Also run a `make check'.
+    doCheck = true;
+
+    showBuildStats = true;
+
+    prefix = "/usr/local";
+
+    postPhases = "finalPhase";
+  }
+
+  // args // 
+
+  {
+    name = name + (if src ? version then "-" + src.version else "");
+  
+    postHook = ''
+      ensureDir $out/nix-support
+      echo "$system" > $out/nix-support/system
+
+      # 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.
+      origSrc=$src
+      if test -d $src/tarballs; then
+          src=$(ls $src/tarballs/*.tar.bz2 $src/tarballs/*.tar.gz | sort | head -1)
+      fi
+
+      if test -e $origSrc/nix-support/hydra-release-name; then
+          releaseName=$(cat $origSrc/nix-support/hydra-release-name)
+      fi
+      
+      installFlagsArray=(DESTDIR=$TMPDIR/inst)
+
+      # Prefix hackery because of a bug in stdenv (it tries to `mkdir
+      # $prefix', which doesn't work due to the DESTDIR).
+      configureFlags="--prefix=$prefix $configureFlags"
+      dontAddPrefix=1
+      prefix=$TMPDIR/inst$prefix
+    ''; # */
+
+
+    doDist = true;
+
+    distPhase =
+      ''
+        ensureDir $out/tarballs
+        tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst .
+      '';
+
+                
+    finalPhase =
+      ''
+        for i in $out/tarballs/*; do
+            echo "file binary-dist $i" >> $out/nix-support/hydra-build-products
+        done
+        
+        # Propagate the release name of the source tarball.  This is
+        # to get nice package names in channels.
+        test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name)
+      '';
+    
+
+    meta = (if args ? meta then args.meta else {}) // {
+      description = "Build of a generic binary distribution";
+    };
+
+  }
+)
diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix
index d41750733b5d..b352e993b94d 100644
--- a/pkgs/build-support/release/debian-build.nix
+++ b/pkgs/build-support/release/debian-build.nix
@@ -13,7 +13,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
 
     prefix = "/usr";
 
-    phases = "installExtraDebsPhase sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase distPhase";
+    prePhases = "installExtraDebsPhase sysInfoPhase";
   }
 
   // removeAttrs args ["vmTools"] //
@@ -52,7 +52,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
     installCommand = ''
       export LOGNAME=root
 
-      ${checkinstall}/sbin/checkinstall -y -D make install
+      ${checkinstall}/sbin/checkinstall --nodoc -y -D make install
 
       ensureDir $out/debs
       find . -name "*.deb" -exec cp {} $out/debs \;
@@ -60,7 +60,10 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
       shopt -s nullglob
       for i in $out/debs/*.deb; do
         header "Generated DEB package: $i"
-        dpkg-deb --info $i
+        dpkg-deb --info "$i"
+        pkgName=$(dpkg-deb -W "$i" | awk '{print $1}')
+        dpkg -i "$i"
+        dpkg -r "$pkgName"
         echo "file deb $i" >> $out/nix-support/hydra-build-products
         stopNest
       done
diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix
index 0c0ee1bec555..1177024c8573 100644
--- a/pkgs/build-support/release/default.nix
+++ b/pkgs/build-support/release/default.nix
@@ -4,10 +4,16 @@ with pkgs;
 
 rec {
 
-  makeSourceTarball = args: import ./make-source-tarball.nix (
+  sourceTarball = args: import ./source-tarball.nix (
     { inherit stdenv autoconf automake libtool;
     } // args);
 
+  makeSourceTarball = sourceTarball; # compatibility
+
+  binaryTarball = args: import ./binary-tarball.nix (
+    { inherit stdenv;
+    } // args);
+
   nixBuild = args: import ./nix-build.nix (
     { inherit stdenv;
     } // args);
diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix
index f9d2351d9253..703dc07a6e44 100644
--- a/pkgs/build-support/release/nix-build.nix
+++ b/pkgs/build-support/release/nix-build.nix
@@ -47,15 +47,6 @@ stdenv.mkDerivation (
           src=$(ls $src/tarballs/*.tar.bz2 $src/tarballs/*.tar.gz | sort | head -1)
       fi
 
-      # Hack to compress log files.  Prevents (by pointer hiding!)
-      # unnecessary dependencies.
-      startLogWrite() {
-          # Use process substitution to send the FIFO output to both
-          # stdout and bzip2.
-          bash -c "tee >(bzip2 > \"$1\".bz2) < \"$2\"" &
-          logWriterPid=$!
-      }
-
       # Set GCC flags for coverage analysis, if desired.
       if test -n "${toString doCoverageAnalysis}"; then
           export NIX_CFLAGS_COMPILE="-O0 -fprofile-arcs -ftest-coverage $NIX_CFLAGS_COMPILE"
diff --git a/pkgs/build-support/release/make-source-tarball.nix b/pkgs/build-support/release/source-tarball.nix
index 731c29945275..be0345df9397 100644
--- a/pkgs/build-support/release/make-source-tarball.nix
+++ b/pkgs/build-support/release/source-tarball.nix
@@ -94,7 +94,7 @@ stdenv.mkDerivation (
 
     finalPhase = ''
       for i in $out/tarballs/*; do
-        echo "file source-dist $i" >> $out/nix-support/hydra-build-products
+          echo "file source-dist $i" >> $out/nix-support/hydra-build-products
       done
 
       # Try to figure out the release name.
@@ -109,6 +109,10 @@ stdenv.mkDerivation (
 
     meta = (if args ? meta then args.meta else {}) // {
       description = "Build of a source distribution from a checkout";
+
+      # Tarball builds are generally important, so give them a high
+      # default priority.
+      schedulingPriority = "200";
     };
   }