2008-11-28 16:13:06 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
|
|
|
|
jobs = rec {
|
|
|
|
|
|
|
|
|
|
|
|
tarball =
|
2009-03-09 15:53:03 +00:00
|
|
|
{ hydraSrc ? {outPath = ./.; rev = 1234;}
|
2009-07-27 20:37:12 +00:00
|
|
|
, nixpkgs ? ../../nixpkgs
|
2008-11-28 16:13:06 +00:00
|
|
|
, officialRelease ? false
|
|
|
|
}:
|
|
|
|
|
2009-03-09 15:53:03 +00:00
|
|
|
with import nixpkgs {};
|
2008-11-28 16:13:06 +00:00
|
|
|
|
|
|
|
releaseTools.makeSourceTarball {
|
|
|
|
name = "hydra-tarball";
|
2009-03-06 10:35:27 +00:00
|
|
|
version = "0.1";
|
2008-11-28 16:13:06 +00:00
|
|
|
src = hydraSrc;
|
|
|
|
inherit officialRelease;
|
|
|
|
|
2008-11-28 16:29:41 +00:00
|
|
|
buildInputs = [zip unzip];
|
|
|
|
|
|
|
|
jquery = fetchurl {
|
2010-02-01 12:07:26 +00:00
|
|
|
url = http://jqueryui.com/download/jquery-ui-1.7.2.custom.zip;
|
|
|
|
sha256 = "1l9dwaaqvdysmzlkg1vb8j0s0xn63d475gh53pjjwxw85668krdh";
|
2008-11-28 16:29:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tablesorter = fetchurl {
|
|
|
|
url = http://tablesorter.com/jquery.tablesorter.zip;
|
|
|
|
sha256 = "013zgglvifvy0yg0ybjrl823sswy9v1ihf5nmighmcyigfd6nrhb";
|
|
|
|
};
|
|
|
|
|
2008-11-28 16:13:06 +00:00
|
|
|
# Since we don't have a `make dist', just tar everything.
|
|
|
|
distPhase = ''
|
2010-02-01 12:07:26 +00:00
|
|
|
ensureDir src/root/static/js/jquery
|
|
|
|
unzip -d src/root/static/js/jquery $jquery
|
2009-04-20 12:51:47 +00:00
|
|
|
rm -rf src/root/static/js/tablesorter
|
2009-03-06 10:23:41 +00:00
|
|
|
unzip -d src/root/static/js $tablesorter
|
2009-10-21 12:25:43 +00:00
|
|
|
|
|
|
|
make -C src/sql
|
2008-11-28 16:29:41 +00:00
|
|
|
|
2008-11-28 16:13:06 +00:00
|
|
|
releaseName=hydra-0.1$VERSION_SUFFIX;
|
|
|
|
ensureDir $out/tarballs
|
|
|
|
mkdir ../$releaseName
|
|
|
|
cp -prd . ../$releaseName
|
|
|
|
cd ..
|
|
|
|
tar cfj $out/tarballs/$releaseName.tar.bz2 $releaseName
|
|
|
|
tar cfz $out/tarballs/$releaseName.tar.gz $releaseName
|
2008-11-28 16:29:41 +00:00
|
|
|
zip -9r $out/tarballs/$releaseName.zip $releaseName
|
2008-11-28 16:13:06 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
build =
|
2009-03-06 10:35:27 +00:00
|
|
|
{ tarball ? jobs.tarball {}
|
2009-07-27 20:37:12 +00:00
|
|
|
, nixpkgs ? ../../nixpkgs
|
2008-11-28 16:13:06 +00:00
|
|
|
, system ? "i686-linux"
|
|
|
|
}:
|
|
|
|
|
2009-07-07 11:33:50 +00:00
|
|
|
let pkgs = import nixpkgs {inherit system;}; in
|
|
|
|
|
|
|
|
with pkgs;
|
2009-03-09 15:53:03 +00:00
|
|
|
|
2009-11-25 10:37:22 +00:00
|
|
|
let nix = nixUnstable; in
|
2008-11-28 16:13:06 +00:00
|
|
|
|
2009-04-27 13:08:15 +00:00
|
|
|
stdenv.mkDerivation {
|
2009-03-06 10:35:27 +00:00
|
|
|
name = "hydra" + (if tarball ? version then "-" + tarball.version else "");
|
2008-11-28 16:13:06 +00:00
|
|
|
|
2009-07-07 11:33:50 +00:00
|
|
|
buildInputs =
|
|
|
|
[ perl makeWrapper libtool ]
|
|
|
|
++ (import ./deps.nix) { inherit pkgs; };
|
2008-11-28 16:13:06 +00:00
|
|
|
|
|
|
|
preUnpack = ''
|
2009-03-06 10:35:27 +00:00
|
|
|
src=$(ls ${tarball}/tarballs/*.tar.bz2)
|
2008-11-28 16:13:06 +00:00
|
|
|
''; # */
|
|
|
|
|
2009-07-27 20:37:12 +00:00
|
|
|
hydraPath = stdenv.lib.concatStringsSep ":" (map (p: "${p}/bin") ( [
|
2009-04-03 08:39:10 +00:00
|
|
|
libxslt sqlite subversion openssh nix coreutils findutils
|
2009-11-17 15:45:02 +00:00
|
|
|
gzip bzip2 lzma gnutar unzip git
|
2009-03-18 17:40:12 +00:00
|
|
|
gnused graphviz
|
2009-07-27 20:37:12 +00:00
|
|
|
] ++ ( if stdenv.isLinux then [rpm dpkg cdrkit] else [] )));
|
2008-11-28 23:44:17 +00:00
|
|
|
|
2008-11-28 16:13:06 +00:00
|
|
|
installPhase = ''
|
2008-12-01 20:22:03 +00:00
|
|
|
ensureDir $out/nix-support
|
|
|
|
|
2008-11-28 16:13:06 +00:00
|
|
|
ensureDir $out/libexec
|
2009-03-06 10:23:41 +00:00
|
|
|
cp -prd src $out/libexec/hydra
|
2008-11-28 16:13:06 +00:00
|
|
|
|
|
|
|
mv $out/libexec/hydra/script $out/bin
|
|
|
|
|
2009-03-09 15:53:03 +00:00
|
|
|
cp ${"${nixpkgs}/pkgs/build-support/fetchsvn/nix-prefetch-svn"} $out/bin/nix-prefetch-svn
|
2009-11-17 15:16:41 +00:00
|
|
|
cp ${"${nixpkgs}/pkgs/build-support/fetchgit/nix-prefetch-git"} $out/bin/nix-prefetch-git
|
2009-03-09 15:53:03 +00:00
|
|
|
|
|
|
|
make -C src/c NIX=${nix} ATERM=${aterm242fixes}
|
|
|
|
cp src/c/hydra_eval_jobs $out/bin
|
2008-11-28 23:44:17 +00:00
|
|
|
|
2008-11-28 16:13:06 +00:00
|
|
|
for i in $out/bin/*; do
|
|
|
|
wrapProgram $i \
|
|
|
|
--prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
|
2009-07-09 15:45:56 +00:00
|
|
|
--prefix PATH ':' $out/bin:$hydraPath \
|
2009-03-23 13:52:24 +00:00
|
|
|
--set HYDRA_HOME $out/libexec/hydra \
|
2009-09-01 08:50:51 +00:00
|
|
|
--set HYDRA_RELEASE ${tarball.version} \
|
|
|
|
--set NIX_RELEASE ${nix.name}
|
2008-11-28 16:13:06 +00:00
|
|
|
done
|
2008-12-01 20:22:03 +00:00
|
|
|
|
|
|
|
ensureDir $out/share/doc/hydra/manual
|
|
|
|
cp doc/manual/* $out/share/doc/hydra/manual/
|
|
|
|
ln -s manual.html $out/share/doc/hydra/manual/index.html
|
|
|
|
echo "doc manual $out/share/doc/hydra/manual" >> $out/nix-support/hydra-build-products
|
2008-12-15 14:52:21 +00:00
|
|
|
echo "nix-build none $out" >> $out/nix-support/hydra-build-products
|
2008-11-28 16:13:06 +00:00
|
|
|
''; # */
|
2008-11-28 23:44:17 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Build of Hydra on ${system}";
|
|
|
|
};
|
2008-11-28 16:13:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
in jobs
|