2018-04-17 13:06:49 +02:00
|
|
|
{ stdenv, nix, perlPackages, buildEnv, releaseTools, fetchFromGitHub
|
2016-06-01 21:02:58 +02:00
|
|
|
, makeWrapper, autoconf, automake, libtool, unzip, pkgconfig, sqlite, libpqxx
|
|
|
|
, gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt
|
2017-09-05 18:17:22 +02:00
|
|
|
, guile, perl, postgresql, aws-sdk-cpp, nukeReferences, git, boehmgc
|
2016-06-01 21:02:58 +02:00
|
|
|
, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
|
2017-01-08 14:38:35 +01:00
|
|
|
, rpm, dpkg, cdrkit, fetchpatch, pixz }:
|
2016-06-01 21:02:58 +02:00
|
|
|
|
|
|
|
with stdenv;
|
|
|
|
|
|
|
|
let
|
|
|
|
perlDeps = buildEnv {
|
|
|
|
name = "hydra-perl-deps";
|
|
|
|
paths = with perlPackages;
|
|
|
|
[ ModulePluggable
|
|
|
|
CatalystActionREST
|
|
|
|
CatalystAuthenticationStoreDBIxClass
|
|
|
|
CatalystDevel
|
|
|
|
CatalystDispatchTypeRegex
|
|
|
|
CatalystPluginAccessLog
|
|
|
|
CatalystPluginAuthorizationRoles
|
|
|
|
CatalystPluginCaptcha
|
|
|
|
CatalystPluginSessionStateCookie
|
|
|
|
CatalystPluginSessionStoreFastMmap
|
|
|
|
CatalystPluginStackTrace
|
|
|
|
CatalystPluginUnicodeEncoding
|
|
|
|
CatalystTraitForRequestProxyBase
|
|
|
|
CatalystViewDownload
|
|
|
|
CatalystViewJSON
|
|
|
|
CatalystViewTT
|
2018-04-21 23:50:07 +02:00
|
|
|
CatalystXRoleApplicator
|
2016-06-01 21:02:58 +02:00
|
|
|
CatalystXScriptServerStarman
|
|
|
|
CryptRandPasswd
|
|
|
|
DBDPg
|
|
|
|
DBDSQLite
|
|
|
|
DataDump
|
|
|
|
DateTime
|
|
|
|
DigestSHA1
|
|
|
|
EmailMIME
|
|
|
|
EmailSender
|
|
|
|
FileSlurp
|
|
|
|
IOCompress
|
|
|
|
IPCRun
|
2018-04-21 23:50:07 +02:00
|
|
|
JSONAny
|
2016-06-01 21:02:58 +02:00
|
|
|
JSONXS
|
|
|
|
LWP
|
|
|
|
LWPProtocolHttps
|
|
|
|
NetAmazonS3
|
|
|
|
NetStatsd
|
|
|
|
PadWalker
|
|
|
|
Readonly
|
|
|
|
SQLSplitStatement
|
|
|
|
SetScalar
|
|
|
|
Starman
|
|
|
|
SysHostnameLong
|
|
|
|
TestMore
|
|
|
|
TextDiff
|
|
|
|
TextTable
|
|
|
|
XMLSimple
|
2018-04-17 13:06:49 +02:00
|
|
|
nix
|
|
|
|
nix.perl-bindings
|
2016-06-01 21:02:58 +02:00
|
|
|
git
|
|
|
|
boehmgc
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in releaseTools.nixBuild rec {
|
|
|
|
name = "hydra-${version}";
|
2017-11-22 18:24:55 +01:00
|
|
|
version = "2017-11-21";
|
2017-01-08 14:38:35 +01:00
|
|
|
|
|
|
|
inherit stdenv;
|
2016-06-01 21:02:58 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "hydra";
|
2017-11-22 18:24:55 +01:00
|
|
|
rev = "b7bc4384b7b471d1ddf892cb03f16189a66d5a0d";
|
|
|
|
sha256 = "05g37z3ilazzqa5rqj5zljndwxjbvpc18xibh6jlwjwpvg3kpbbh";
|
2016-06-01 21:02:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
|
|
|
|
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
|
|
|
|
guile # optional, for Guile + Guix support
|
2018-04-17 13:06:49 +02:00
|
|
|
perlDeps perl nix
|
2017-09-05 18:17:22 +02:00
|
|
|
postgresql # for running the tests
|
2016-06-01 21:02:58 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
hydraPath = lib.makeBinPath (
|
2018-04-17 13:06:49 +02:00
|
|
|
[ sqlite subversion openssh nix coreutils findutils pixz
|
2016-06-01 21:02:58 +02:00
|
|
|
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
# Clean up when building from a working tree.
|
|
|
|
(cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
|
|
|
|
|
2017-05-04 15:31:34 +02:00
|
|
|
shellHook = ''
|
2017-01-08 14:38:35 +01:00
|
|
|
PATH=$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$(pwd)/src/hydra-evaluator:$PATH
|
2016-06-01 21:02:58 +02:00
|
|
|
PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = "autoreconf -vfi";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs .
|
2016-08-08 17:01:18 +02:00
|
|
|
export LOGNAME=''${LOGNAME:-foo}
|
2016-06-01 21:02:58 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
for i in $out/bin/*; do
|
|
|
|
read -n 4 chars < $i
|
|
|
|
if [[ $chars =~ ELF ]]; then continue; fi
|
|
|
|
wrapProgram $i \
|
|
|
|
--prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
|
|
|
|
--prefix PATH ':' $out/bin:$hydraPath \
|
|
|
|
--set HYDRA_RELEASE ${version} \
|
|
|
|
--set HYDRA_HOME $out/libexec/hydra \
|
2018-04-17 13:06:49 +02:00
|
|
|
--set NIX_RELEASE ${nix.name or "unknown"}
|
2016-06-01 21:02:58 +02:00
|
|
|
done
|
|
|
|
''; # */
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
passthru.perlDeps = perlDeps;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Nix-based continuous build system";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
|
|
|
};
|
|
|
|
}
|