forked from nix-community/pip2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.nix
59 lines (50 loc) · 1.74 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ pkgs ? import ./nix { nixpkgs = builtins.getAttr nixpkgs sources; }
, sources ? import ./nix/sources.nix
, nixpkgs ? "nixpkgs-20.09"
}:
with pkgs.lib;
let
make-pip2nix = {pythonVersion}: {
name = "python${pythonVersion}";
value = import ./default.nix {
inherit pkgs;
pythonPackages = "python${pythonVersion}Packages";
};
};
jobs = rec {
pip2nix = filterAttrs (n: v: n != "recurseForDerivations") (
pkgs.recurseIntoAttrs (
builtins.listToAttrs (map make-pip2nix ([]
++ optional (hasAttr "python27Packages" pkgs) {pythonVersion = "27";}
++ optional (hasAttr "python33Packages" pkgs) {pythonVersion = "33";}
++ optional (hasAttr "python34Packages" pkgs) {pythonVersion = "34";}
++ optional (hasAttr "python35Packages" pkgs) {pythonVersion = "35";}
++ optional (hasAttr "python36Packages" pkgs) {pythonVersion = "36";}
++ optional (hasAttr "python37Packages" pkgs) {pythonVersion = "37";}
++ optional (hasAttr "python38Packages" pkgs) {pythonVersion = "38";}
++ optional (hasAttr "python39Packages" pkgs) {pythonVersion = "39";}
))
)
);
docs = pkgs.stdenv.mkDerivation {
name = "pip2nix-docs";
src = pip2nix.python36.src;
#outputs = [ "html" ]; # TODO: PDF would be even nicer on CI
buildInputs = [ pip2nix.python36 ] ++ (with pkgs.python36Packages; [
sphinx
]);
buildPhase = ''
cd docs
make html
'';
installPhase = ''
mkdir $out
cp -r _build/html $out
# Hydra integration
mkdir -p $out/nix-support
echo "doc manual $out/html index.html" >> \
"$out/nix-support/hydra-build-products"
'';
};
};
in jobs