-
Notifications
You must be signed in to change notification settings - Fork 28
/
flake.nix
101 lines (96 loc) · 3.72 KB
/
flake.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
description = "Simple Python Communications";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-24.05;
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
sipyco = pkgs.python3Packages.buildPythonPackage {
pname = "sipyco";
version = "1.8";
src = self;
propagatedBuildInputs = with pkgs.python3Packages; [ pybase64 numpy ];
};
sipyco-aarch64 = (with nixpkgs.legacyPackages.aarch64-linux; python3Packages.buildPythonPackage {
inherit (sipyco) pname version src;
propagatedBuildInputs = with python3Packages; [ pybase64 numpy ];
});
sphinxcontrib-wavedrom = pkgs.python3Packages.buildPythonPackage rec {
pname = "sphinxcontrib-wavedrom";
version = "3.0.2";
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
sha256 = "sha256-ukZd3ajt0Sx3LByof4R80S31F5t1yo+L8QUADrMMm2A=";
};
buildInputs = [ pkgs.python3Packages.setuptools_scm ];
propagatedBuildInputs = [ pkgs.nodejs pkgs.nodePackages.wavedrom-cli ] ++ (with pkgs.python3Packages; [ wavedrom sphinx xcffib cairosvg ]);
};
latex-sipyco-manual = pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-basic latexmk cmap collection-fontsrecommended fncychap
titlesec tabulary varwidth framed fancyvrb float wrapfig parskip
upquote capt-of needspace etoolbox booktabs;
};
in rec {
packages.x86_64-linux = {
inherit sipyco sphinxcontrib-wavedrom latex-sipyco-manual;
default = sipyco;
sipyco-manual-html = pkgs.stdenvNoCC.mkDerivation rec {
name = "sipyco-manual-html-${version}";
version = sipyco.version;
src = self;
buildInputs = [
sipyco
pkgs.python3Packages.sphinx pkgs.python3Packages.sphinx_rtd_theme
pkgs.python3Packages.sphinx-argparse sphinxcontrib-wavedrom
];
buildPhase = ''
export SOURCE_DATE_EPOCH=${builtins.toString self.sourceInfo.lastModified}
cd doc
make html
'';
installPhase = ''
cp -r _build/html $out
mkdir $out/nix-support
echo doc manual $out index.html >> $out/nix-support/hydra-build-products
'';
};
sipyco-manual-pdf = pkgs.stdenvNoCC.mkDerivation rec {
name = "sipyco-manual-pdf-${version}";
version = sipyco.version;
src = self;
buildInputs = [
sipyco
pkgs.python3Packages.sphinx pkgs.python3Packages.sphinx_rtd_theme
pkgs.python3Packages.sphinx-argparse sphinxcontrib-wavedrom
latex-sipyco-manual
];
buildPhase = ''
export SOURCE_DATE_EPOCH=${builtins.toString self.sourceInfo.lastModified}
cd doc
make latexpdf
'';
installPhase = ''
mkdir $out
cp _build/latex/SiPyCo.pdf $out
mkdir $out/nix-support
echo doc-pdf manual $out SiPyCo.pdf >> $out/nix-support/hydra-build-products
'';
};
};
devShells.x86_64-linux.default = pkgs.mkShell {
name = "sipyco-dev-shell";
buildInputs = [
(pkgs.python3.withPackages(ps: with ps; [ pybase64 numpy ]))
pkgs.python3Packages.sphinx pkgs.python3Packages.sphinx_rtd_theme
pkgs.python3Packages.sphinx-argparse sphinxcontrib-wavedrom latex-sipyco-manual
];
};
packages.aarch64-linux = {
sipyco = sipyco-aarch64;
default = sipyco-aarch64;
};
hydraJobs = {
inherit (packages.x86_64-linux) sipyco sipyco-manual-html sipyco-manual-pdf;
};
};
}