-
Notifications
You must be signed in to change notification settings - Fork 10
/
release.nix
166 lines (147 loc) · 5.11 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{ nixpkgs ? <nixpkgs>
, systems ? [ "i686-linux" "x86_64-linux" ]
, disnix ? { outPath = ./.; rev = 1234; }
, dysnomia ? { outPath = ../dysnomia; rev = 1234; }
, officialRelease ? false
}:
let
pkgs = import nixpkgs {};
dysnomiaJobset = import "${dysnomia}/release.nix" {
inherit nixpkgs systems officialRelease dysnomia;
};
jobs = rec {
tarball =
with pkgs;
let
dysnomia = builtins.getAttr (builtins.currentSystem) (dysnomiaJobset.build);
in
releaseTools.sourceTarball {
name = "disnix-tarball";
version = builtins.readFile ./version;
src = disnix;
inherit officialRelease;
dontBuild = false;
buildInputs = [ pkg-config glib libxml2 libxslt getopt dblatex (dblatex.tex or tetex) doxygen nukeReferences help2man doclifter dysnomia ];
CFLAGS = "-Wall";
# Add documentation in the tarball
configureFlags = [
"--with-docbook-rng=${docbook5}/xml/rng/docbook"
"--with-docbook-xsl=${docbook_xsl_ns}/xml/xsl/docbook"
];
preConfigure = ''
# TeX needs a writable font cache.
export VARTEXFONTS=$TMPDIR/texfonts
'';
preDist = ''
make -C doc/manual install prefix=$out
make -C doc/manual index.pdf prefix=$out
cp doc/manual/index.pdf $out/index.pdf
make -C src apidox
cp -av doc/apidox $out/share/doc/disnix
# The PDF containes filenames of included graphics (see
# http://www.tug.org/pipermail/pdftex/2007-August/007290.html).
# This causes a retained dependency on dblatex, which Hydra
# doesn't like (the output of the tarball job is distributed
# to Windows and Macs, so there should be no Linux binaries
# in the closure).
nuke-refs $out/index.pdf
echo "doc-pdf manual $out/index.pdf" >> $out/nix-support/hydra-build-products
echo "doc manual $out/share/doc/disnix/manual" >> $out/nix-support/hydra-build-products
echo "doc api $out/share/doc/disnix/apidox/html" >> $out/nix-support/hydra-build-products
'';
};
build =
pkgs.lib.genAttrs systems (system:
let
dysnomia = builtins.getAttr system (dysnomiaJobset.build);
in
with import nixpkgs { inherit system; };
releaseTools.nixBuild {
name = "disnix";
src = tarball;
buildInputs = [ pkg-config glib libxml2 libxslt getopt dysnomia ]
++ lib.optionals (!stdenv.isLinux) [ libiconv gettext ];
CFLAGS = "-Wall";
});
tests =
let
dysnomia = builtins.getAttr (builtins.currentSystem) (dysnomiaJobset.build);
disnix = builtins.getAttr (builtins.currentSystem) (jobs.build);
in
{
runactivities = import ./tests/runactivities.nix {
inherit nixpkgs dysnomia disnix;
};
dbus = import ./tests/dbus.nix {
inherit nixpkgs dysnomia disnix;
};
ssh-to-runactivity = import ./tests/ssh.nix {
inherit nixpkgs dysnomia disnix;
disnixRemoteClient = "disnix-run-activity";
};
ssh-to-dbus = import ./tests/ssh.nix {
inherit nixpkgs dysnomia disnix;
disnixRemoteClient = "disnix-client";
};
install = import ./tests/install.nix {
inherit nixpkgs dysnomia disnix;
};
deployment = import ./tests/deployment.nix {
inherit nixpkgs dysnomia disnix;
};
distbuild = import ./tests/distbuild.nix {
inherit nixpkgs dysnomia disnix;
};
snapshots-via-runactivity = import ./tests/snapshots.nix {
inherit nixpkgs dysnomia disnix;
inherit (pkgs) stdenv;
disnixRemoteClient = "disnix-run-activity";
};
snapshots-via-dbus = import ./tests/snapshots.nix {
inherit nixpkgs dysnomia disnix;
inherit (pkgs) stdenv;
disnixRemoteClient = "disnix-client";
};
datamigration = import ./tests/datamigration.nix {
inherit nixpkgs dysnomia disnix;
};
commands = import ./tests/commands.nix {
inherit nixpkgs dysnomia disnix;
};
locking = import ./tests/locking.nix {
inherit nixpkgs dysnomia disnix;
};
pkgs = import ./tests/pkgs.nix {
inherit nixpkgs dysnomia disnix;
};
daemon = import ./tests/daemon.nix {
inherit nixpkgs disnix;
};
};
release = pkgs.releaseTools.aggregate {
name = "disnix-${tarball.version}";
constituents = [
tarball
]
++ map (system: builtins.getAttr system build) systems
++ [
tests.runactivities
tests.dbus
tests.ssh-to-runactivity
tests.ssh-to-dbus
tests.install
tests.commands
tests.deployment
tests.distbuild
tests.snapshots-via-runactivity
tests.snapshots-via-dbus
tests.datamigration
tests.locking
tests.pkgs
tests.daemon
];
meta.description = "Release-critical builds";
};
};
in
jobs