gnu: libuv: Update to 1.20.3.
[jackhill/guix/guix.git] / release.nix
CommitLineData
233e7676 1/* GNU Guix --- Functional package management for GNU
9b1ef2f3 2 Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
2152e3c5 3
233e7676 4 This file is part of GNU Guix.
2152e3c5 5
233e7676 6 GNU Guix is free software; you can redistribute it and/or modify it
2152e3c5
LC
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or (at
9 your option) any later version.
10
233e7676 11 GNU Guix is distributed in the hope that it will be useful, but
2152e3c5
LC
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
233e7676 17 along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. */
2152e3c5
LC
18
19/* Release file to build Guix with Nix. Useful to bootstrap Guix on
20 Guix-enabled Hydra instances. */
21
22let
23 nixpkgs = <nixpkgs>;
24
cc9abfd0
LC
25 buildOutOfSourceTree = true;
26 succeedOnFailure = true;
27 keepBuildDirectory = true;
28
1c52c42f
LC
29 # The Guile used to bootstrap the whole thing. It's normally
30 # downloaded by the build system, but here we download it via a
31 # fixed-output derivation and stuff it into the build tree.
32 bootstrap_guile =
33 let pkgs = import nixpkgs {}; in {
34 i686 = pkgs.fetchurl {
bb1ff9aa
LC
35 url = http://www.fdn.fr/~lcourtes/software/guix/packages/i686-linux/20121219/guile-2.0.7.tar.xz;
36 sha256 = "45d1f9bfb9e4531a8f1c5a105f7ab094cd481b8a179ccc63cbabb73ce6b8437f";
1c52c42f
LC
37 };
38
39 x86_64 = pkgs.fetchurl {
bb1ff9aa
LC
40 url = http://www.fdn.fr/~lcourtes/software/guix/packages/x86_64-linux/20121219/guile-2.0.7.tar.xz;
41 sha256 = "953fbcc8db6e310626be79b67319cf4141dc23b296447952a99d95425b3a4dc1";
1c52c42f
LC
42 };
43 };
44
2152e3c5
LC
45 jobs = {
46 tarball =
9b1ef2f3 47 let pkgs = import nixpkgs {}; in
2152e3c5
LC
48 pkgs.releaseTools.sourceTarball {
49 name = "guix-tarball";
50 src = <guix>;
9b1ef2f3
LC
51 buildInputs = with pkgs; [ guile sqlite bzip2 git libgcrypt ];
52 buildNativeInputs = with pkgs; [ texinfo gettext cvs pkgconfig ];
6cb3ccf8 53 preAutoconf = ''git config submodule.nix.url "${<nix>}"'';
2152e3c5 54 configureFlags =
5fb86803 55 [ "--with-libgcrypt-prefix=${pkgs.libgcrypt}"
cdec10f9 56 "--localstatedir=/nix/var"
6709752f 57 ];
9b1ef2f3 58 };
2152e3c5
LC
59
60 build =
61 { system ? builtins.currentSystem }:
62
9b1ef2f3 63 let pkgs = import nixpkgs { inherit system; }; in
2152e3c5
LC
64 pkgs.releaseTools.nixBuild {
65 name = "guix";
5fb86803 66 buildInputs = with pkgs; [ guile sqlite bzip2 libgcrypt ];
9b1ef2f3 67 buildNativeInputs = [ pkgs.pkgconfig ];
2152e3c5
LC
68 src = jobs.tarball;
69 configureFlags =
5fb86803 70 [ "--with-libgcrypt-prefix=${pkgs.libgcrypt}"
cdec10f9 71 "--localstatedir=/nix/var"
ad102c46 72 ];
2152e3c5 73
1c52c42f
LC
74 preBuild =
75 # Use our pre-downloaded bootstrap tarballs instead of letting
76 # the build system download it over and over again.
77 '' mkdir -p distro/packages/bootstrap/{i686,x86_64}-linux
78 cp -v "${bootstrap_guile.i686}" \
bb1ff9aa 79 distro/packages/bootstrap/i686-linux/guile-2.0.7.tar.xz
1c52c42f 80 cp -v "${bootstrap_guile.x86_64}" \
bb1ff9aa 81 distro/packages/bootstrap/x86_64-linux/guile-2.0.7.tar.xz
1c52c42f
LC
82 '';
83
cc9abfd0
LC
84 inherit succeedOnFailure keepBuildDirectory
85 buildOutOfSourceTree;
9b1ef2f3 86 };
9144af5a
LC
87
88
b35c0f86
LC
89 build_disable_daemon =
90 { system ? builtins.currentSystem }:
91
9b1ef2f3
LC
92 let
93 pkgs = import nixpkgs { inherit system; };
b35c0f86
LC
94 build = jobs.build { inherit system; };
95 in
96 pkgs.lib.overrideDerivation build ({ configureFlags, ... }: {
97 configureFlags = configureFlags ++ [ "--disable-daemon" ];
98 buildInputs = with pkgs; [ guile nixUnstable pkgconfig ];
99
100 # Since we need to talk to a running daemon, we need to escape
101 # the chroot.
102 preConfigure = "export NIX_REMOTE=daemon";
103 __noChroot = true;
9b1ef2f3 104 });
b35c0f86 105
9144af5a
LC
106 # Jobs to test the distro.
107 distro = {
108 hello =
109 { system ? builtins.currentSystem }:
110
111 let
9b1ef2f3 112 pkgs = import nixpkgs { inherit system; };
9144af5a
LC
113 guix = jobs.build { inherit system; };
114 in
f03da4a0 115 # XXX: We have no way to tell the Nix code to swallow the .drv
9144af5a
LC
116 # produced by `guix-build', so we have a pointless indirection
117 # here. This could be worked around by generating Nix code
118 # from the .drv, and importing that.
119 pkgs.releaseTools.nixBuild {
120 src = null;
48da001f 121 name = "guix-hello";
9144af5a 122 phases = "buildPhase";
f03da4a0 123 buildPhase = "${guix}/bin/guix-build --no-substitutes hello | tee $out";
9144af5a
LC
124 __noChroot = true;
125 };
126 };
2152e3c5
LC
127 };
128in
129 jobs