4 inherit (lib) optionalString;
12 enableGCOVInstrumentation
25 sourceTarball = args: import ./source-tarball.nix (
26 { inherit lib stdenv autoconf automake libtool;
29 makeSourceTarball = sourceTarball; # compatibility
31 binaryTarball = args: import ./binary-tarball.nix (
35 mvnBuild = args: import ./maven-build.nix (
39 nixBuild = args: import ./nix-build.nix (
43 coverageAnalysis = args: nixBuild (
44 { inherit lcov enableGCOVInstrumentation makeGCOVReport;
45 doCoverageAnalysis = true;
48 clangAnalysis = args: nixBuild (
49 { inherit clang-analyzer;
50 doClangAnalysis = true;
53 coverityAnalysis = args: nixBuild (
54 { inherit cov-build xz;
55 doCoverityAnalysis = true;
58 rpmBuild = args: import ./rpm-build.nix (
59 { inherit lib vmTools;
62 debBuild = args: import ./debian-build.nix (
63 { inherit lib stdenv vmTools checkinstall;
67 { name, constituents, meta ? { } }:
69 { inherit constituents meta;
70 preferLocalBuild = true;
71 _hydraAggregate = true;
74 mkdir -p $out/nix-support
75 touch $out/nix-support/hydra-build-products
76 echo $constituents > $out/nix-support/hydra-aggregate-constituents
78 # Propagate build failures.
79 for i in $constituents; do
80 if [ -e $i/nix-support/failed ]; then
81 touch $out/nix-support/failed
86 /* Create a channel job which success depends on the success of all of
87 its contituents. Channel jobs are a special type of jobs that are
88 listed in the channel tab of Hydra and that can be suscribed.
89 A tarball of the src attribute is distributed via the channel.
91 - constituents: a list of derivations on which the channel success depends.
92 - name: the channel name that will be used in the hydra interface.
93 - src: should point to the root folder of the nix-expressions used by the
94 channel, typically a folder containing a `default.nix`.
97 constituents = [ foo bar baz ];
104 { name, src, constituents ? [], meta ? {}, isNixOS ? true, ... }@args:
105 stdenv.mkDerivation ({
106 preferLocalBuild = true;
107 _hydraAggregate = true;
109 dontConfigure = true;
112 patchPhase = optionalString isNixOS ''
113 touch .update-on-nixos-rebuild
117 mkdir -p $out/{tarballs,nix-support}
119 tar cJf "$out/tarballs/nixexprs.tar.xz" \
120 --owner=0 --group=0 --mtime="1970-01-01 00:00:00 UTC" \
121 --transform='s!^\.!${name}!' .
123 echo "channel - $out/tarballs/nixexprs.tar.xz" > "$out/nix-support/hydra-build-products"
124 echo $constituents > "$out/nix-support/hydra-aggregate-constituents"
126 # Propagate build failures.
127 for i in $constituents; do
128 if [ -e "$i/nix-support/failed" ]; then
129 touch "$out/nix-support/failed"
135 isHydraChannel = true;
137 } // removeAttrs args [ "meta" ]);