forked from collective/sphinxcontrib-httpexample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
41 lines (33 loc) · 1.3 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ pkgs ? import <nixpkgs> {}
, supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, supportedPythons ? [ "python2" "python3" ]
, setup ? import ./setup.nix
}:
let
pkgFor = system: python: setup { pkgs = import pkgs.path { inherit system; };
python = python; };
in {
build = pkgs.lib.genAttrs supportedSystems (system:
pkgs.lib.genAttrs supportedPythons (python: pkgs.lib.hydraJob (
(pkgFor system python).build)));
sdist = pkgs.lib.hydraJob(
(pkgFor builtins.currentSystem "python3").sdist);
bdist_wheel = pkgs.lib.hydraJob(
(pkgFor builtins.currentSystem "python3").bdist_wheel);
docs =
let pkg = pkgFor builtins.currentSystem "python2";
env = pkg.build.python.withPackages
(ps: [ pkg.build pkg.pythonPackages.rst2pdf ]);
in pkgs.lib.hydraJob(pkg.build.overrideDerivation(old: {
name = "${old.name}-docs";
phases = [ "unpackPhase" "buildPhase" ];
buildPhase = ''
mkdir -p $out/docs $out/nix-support
${env}/bin/sphinx-build -b html docs $out/docs/html
${env}/bin/sphinx-build -b pdf docs $out/docs
echo "file source-dist" $out/docs/*.pdf > \
$out/nix-support/hydra-build-products
echo ${old.name} > $out/nix-support/hydra-release-name
'';
}));
}