1 /* This function builds a binary tarball. The resulting binaries are
2 usually only useful if they are don't have any runtime dependencies
3 on any paths in the Nix store, since those aren't distributed in
4 the tarball. For instance, the binaries should be statically
5 linked: they can't depend on dynamic libraries in the store
8 The binaries are built and installed with a prefix of /usr/local by
9 default. They are installed by setting DESTDIR to a temporary
10 directory, so the Makefile of the package should support DESTDIR.
14 , name ? "binary-tarball"
20 # Also run a `make check'.
23 showBuildStats = true;
25 prefix = "/usr/local";
27 postPhases = "finalPhase";
33 name = name + (lib.optionalString (src ? version) "-${src.version}");
36 mkdir -p $out/nix-support
37 echo "$system" > $out/nix-support/system
41 src=$(findTarball $src)
43 if test -e $origSrc/nix-support/hydra-release-name; then
44 releaseName=$(cat $origSrc/nix-support/hydra-release-name)
47 installFlagsArray=(DESTDIR=$TMPDIR/inst)
49 # Prefix hackery because of a bug in stdenv (it tries to `mkdir
50 # $prefix', which doesn't work due to the DESTDIR).
51 configureFlags="--prefix=$prefix $configureFlags"
53 prefix=$TMPDIR/inst$prefix
59 mkdir -p $out/tarballs
60 tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst .
64 for i in $out/tarballs/*; do
65 echo "file binary-dist $i" >> $out/nix-support/hydra-build-products
68 # Propagate the release name of the source tarball. This is
69 # to get nice package names in channels.
70 test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name)
73 meta = (lib.optionalAttrs (args ? meta) args.meta) // {
74 description = "Build of a generic binary distribution";