2021-02-05 17:12:51 +00:00
|
|
|
{ lib, pkgs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
inherit (lib) optionalString;
|
|
|
|
|
|
|
|
inherit (pkgs)
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
checkinstall
|
|
|
|
clang-analyzer
|
|
|
|
cov-build
|
|
|
|
enableGCOVInstrumentation
|
|
|
|
lcov
|
|
|
|
libtool
|
|
|
|
makeGCOVReport
|
|
|
|
runCommand
|
|
|
|
stdenv
|
|
|
|
vmTools
|
|
|
|
xz
|
|
|
|
;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rec {
|
|
|
|
|
|
|
|
sourceTarball = args: import ./source-tarball.nix (
|
2023-08-04 22:07:22 +00:00
|
|
|
{ inherit lib stdenv autoconf automake libtool;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
makeSourceTarball = sourceTarball; # compatibility
|
|
|
|
|
|
|
|
binaryTarball = args: import ./binary-tarball.nix (
|
2023-02-16 17:41:37 +00:00
|
|
|
{ inherit lib stdenv;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
mvnBuild = args: import ./maven-build.nix (
|
2022-10-30 15:09:59 +00:00
|
|
|
{ inherit lib stdenv;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
nixBuild = args: import ./nix-build.nix (
|
2021-02-05 17:12:51 +00:00
|
|
|
{ inherit lib stdenv;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
coverageAnalysis = args: nixBuild (
|
|
|
|
{ inherit lcov enableGCOVInstrumentation makeGCOVReport;
|
|
|
|
doCoverageAnalysis = true;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
clangAnalysis = args: nixBuild (
|
|
|
|
{ inherit clang-analyzer;
|
|
|
|
doClangAnalysis = true;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
coverityAnalysis = args: nixBuild (
|
|
|
|
{ inherit cov-build xz;
|
|
|
|
doCoverityAnalysis = true;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
rpmBuild = args: import ./rpm-build.nix (
|
2023-02-16 17:41:37 +00:00
|
|
|
{ inherit lib vmTools;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
debBuild = args: import ./debian-build.nix (
|
2021-02-05 17:12:51 +00:00
|
|
|
{ inherit lib stdenv vmTools checkinstall;
|
2020-04-24 23:36:52 +00:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
aggregate =
|
|
|
|
{ name, constituents, meta ? { } }:
|
|
|
|
pkgs.runCommand name
|
|
|
|
{ inherit constituents meta;
|
|
|
|
preferLocalBuild = true;
|
|
|
|
_hydraAggregate = true;
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
touch $out/nix-support/hydra-build-products
|
|
|
|
echo $constituents > $out/nix-support/hydra-aggregate-constituents
|
|
|
|
|
|
|
|
# Propagate build failures.
|
|
|
|
for i in $constituents; do
|
|
|
|
if [ -e $i/nix-support/failed ]; then
|
|
|
|
touch $out/nix-support/failed
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
/* Create a channel job which success depends on the success of all of
|
|
|
|
its contituents. Channel jobs are a special type of jobs that are
|
|
|
|
listed in the channel tab of Hydra and that can be suscribed.
|
|
|
|
A tarball of the src attribute is distributed via the channel.
|
|
|
|
|
|
|
|
- constituents: a list of derivations on which the channel success depends.
|
|
|
|
- name: the channel name that will be used in the hydra interface.
|
|
|
|
- src: should point to the root folder of the nix-expressions used by the
|
|
|
|
channel, typically a folder containing a `default.nix`.
|
|
|
|
|
|
|
|
channel {
|
|
|
|
constituents = [ foo bar baz ];
|
|
|
|
name = "my-channel";
|
|
|
|
src = ./.;
|
|
|
|
};
|
|
|
|
|
|
|
|
*/
|
|
|
|
channel =
|
|
|
|
{ name, src, constituents ? [], meta ? {}, isNixOS ? true, ... }@args:
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
preferLocalBuild = true;
|
|
|
|
_hydraAggregate = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patchPhase = optionalString isNixOS ''
|
2020-04-24 23:36:52 +00:00
|
|
|
touch .update-on-nixos-rebuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{tarballs,nix-support}
|
|
|
|
|
|
|
|
tar cJf "$out/tarballs/nixexprs.tar.xz" \
|
|
|
|
--owner=0 --group=0 --mtime="1970-01-01 00:00:00 UTC" \
|
|
|
|
--transform='s!^\.!${name}!' .
|
|
|
|
|
|
|
|
echo "channel - $out/tarballs/nixexprs.tar.xz" > "$out/nix-support/hydra-build-products"
|
|
|
|
echo $constituents > "$out/nix-support/hydra-aggregate-constituents"
|
|
|
|
|
|
|
|
# Propagate build failures.
|
|
|
|
for i in $constituents; do
|
|
|
|
if [ -e "$i/nix-support/failed" ]; then
|
|
|
|
touch "$out/nix-support/failed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = meta // {
|
|
|
|
isHydraChannel = true;
|
|
|
|
};
|
|
|
|
} // removeAttrs args [ "meta" ]);
|
|
|
|
|
|
|
|
}
|