lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 22.05-pre 86 lines 2.7 kB view raw
1/* Hydra job to build a tarball for Nixpkgs from a Git checkout. It 2 also builds the documentation and tests whether the Nix expressions 3 evaluate correctly. */ 4 5{ nixpkgs 6, officialRelease 7, supportedSystems 8, pkgs ? import nixpkgs.outPath {} 9, nix ? pkgs.nix 10, lib-tests ? import ../../lib/tests/release.nix { inherit pkgs; } 11}: 12 13pkgs.releaseTools.sourceTarball { 14 name = "nixpkgs-tarball"; 15 src = nixpkgs; 16 17 inherit officialRelease; 18 version = pkgs.lib.fileContents ../../.version; 19 versionSuffix = "pre${ 20 if nixpkgs ? lastModified 21 then builtins.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified) 22 else toString nixpkgs.revCount}.${nixpkgs.shortRev or "dirty"}"; 23 24 buildInputs = with pkgs; [ nix.out jq lib-tests brotli ]; 25 26 configurePhase = '' 27 eval "$preConfigure" 28 releaseName=nixpkgs-$VERSION$VERSION_SUFFIX 29 echo -n $VERSION_SUFFIX > .version-suffix 30 echo -n ${nixpkgs.rev or nixpkgs.shortRev or "dirty"} > .git-revision 31 echo "release name is $releaseName" 32 echo "git-revision is $(cat .git-revision)" 33 ''; 34 35 nixpkgs-basic-release-checks = import ./nixpkgs-basic-release-checks.nix 36 { inherit nix pkgs nixpkgs supportedSystems; }; 37 38 dontBuild = false; 39 40 doCheck = true; 41 42 checkPhase = '' 43 set -o pipefail 44 45 export NIX_STATE_DIR=$TMPDIR 46 export NIX_PATH=nixpkgs=$TMPDIR/barf.nix 47 opts=(--option build-users-group "") 48 nix-store --init 49 50 header "checking eval-release.nix" 51 nix-instantiate --eval --strict --show-trace ./maintainers/scripts/eval-release.nix > /dev/null 52 53 header "checking find-tarballs.nix" 54 nix-instantiate --readonly-mode --eval --strict --show-trace --json \ 55 ./maintainers/scripts/find-tarballs.nix \ 56 --arg expr 'import ./maintainers/scripts/all-tarballs.nix' > $TMPDIR/tarballs.json 57 nrUrls=$(jq -r '.[].url' < $TMPDIR/tarballs.json | wc -l) 58 echo "found $nrUrls URLs" 59 if [ "$nrUrls" -lt 10000 ]; then 60 echo "suspiciously low number of URLs" 61 exit 1 62 fi 63 64 header "generating packages.json" 65 mkdir -p $out/nix-support 66 echo -n '{"version":2,"packages":' > tmp 67 nix-env -f . -I nixpkgs=$src -qa --json --arg config 'import ${./packages-config.nix}' "''${opts[@]}" >> tmp 68 echo -n '}' >> tmp 69 packages=$out/packages.json.br 70 < tmp sed "s|$(pwd)/||g" | jq -c | brotli -9 > $packages 71 rm tmp 72 73 echo "file json-br $packages" >> $out/nix-support/hydra-build-products 74 ''; 75 76 distPhase = '' 77 mkdir -p $out/tarballs 78 mkdir ../$releaseName 79 cp -prd . ../$releaseName 80 (cd .. && tar cfa $out/tarballs/$releaseName.tar.xz $releaseName) || false 81 ''; 82 83 meta = { 84 maintainers = [ pkgs.lib.maintainers.all ]; 85 }; 86}