2019-09-08 01:25:25 +02:00
|
|
|
{ stdenv, nix, perlPackages, buildEnv, 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
|
2019-01-27 00:06:38 +01:00
|
|
|
, guile, perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json
|
2016-06-01 21:02:58 +02:00
|
|
|
, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
|
2019-09-08 01:25:25 +02:00
|
|
|
, rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook
|
2018-08-09 22:32:27 +02:00
|
|
|
}:
|
2016-06-01 21:02:58 +02:00
|
|
|
|
|
|
|
with stdenv;
|
|
|
|
|
2019-02-04 23:56:39 +01:00
|
|
|
if lib.versions.major nix.version == "1"
|
|
|
|
then throw "This Hydra version doesn't support Nix 1.x"
|
|
|
|
else
|
|
|
|
|
2016-06-01 21:02:58 +02:00
|
|
|
let
|
|
|
|
perlDeps = buildEnv {
|
|
|
|
name = "hydra-perl-deps";
|
|
|
|
paths = with perlPackages;
|
|
|
|
[ ModulePluggable
|
|
|
|
CatalystActionREST
|
|
|
|
CatalystAuthenticationStoreDBIxClass
|
|
|
|
CatalystDevel
|
|
|
|
CatalystDispatchTypeRegex
|
|
|
|
CatalystPluginAccessLog
|
|
|
|
CatalystPluginAuthorizationRoles
|
|
|
|
CatalystPluginCaptcha
|
|
|
|
CatalystPluginSessionStateCookie
|
|
|
|
CatalystPluginSessionStoreFastMmap
|
|
|
|
CatalystPluginStackTrace
|
2018-07-22 04:03:24 +02:00
|
|
|
CatalystRuntime
|
2016-06-01 21:02:58 +02:00
|
|
|
CatalystTraitForRequestProxyBase
|
|
|
|
CatalystViewDownload
|
|
|
|
CatalystViewJSON
|
|
|
|
CatalystViewTT
|
|
|
|
CatalystXScriptServerStarman
|
2019-01-27 00:06:38 +01:00
|
|
|
CatalystXRoleApplicator
|
2016-06-01 21:02:58 +02:00
|
|
|
CryptRandPasswd
|
|
|
|
DBDPg
|
|
|
|
DBDSQLite
|
|
|
|
DataDump
|
|
|
|
DateTime
|
|
|
|
DigestSHA1
|
|
|
|
EmailMIME
|
|
|
|
EmailSender
|
|
|
|
FileSlurp
|
|
|
|
IOCompress
|
|
|
|
IPCRun
|
2018-07-26 00:12:39 +02:00
|
|
|
JSON
|
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
|
|
|
|
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
|
|
|
|
];
|
|
|
|
};
|
2019-09-08 01:25:25 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-05-11 18:50:47 +02:00
|
|
|
pname = "hydra";
|
2019-09-08 01:25:25 +02:00
|
|
|
version = "2019-08-30";
|
2017-01-08 14:38:35 +01:00
|
|
|
|
|
|
|
inherit stdenv;
|
2016-06-01 21:02:58 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NixOS";
|
2019-05-11 18:50:47 +02:00
|
|
|
repo = pname;
|
2019-09-08 01:25:25 +02:00
|
|
|
rev = "242b8b7a314759ed33f69205d26a1b7c337511e0";
|
|
|
|
sha256 = "167ijcf9qdm10kjvqax3hcvs5mpa4mx2y2i9idwwc6xfvn8fhs84";
|
2016-06-01 21:02:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
2019-02-10 14:14:33 +01:00
|
|
|
[ makeWrapper autoconf automake libtool unzip nukeReferences sqlite libpqxx
|
2016-06-01 21:02:58 +02:00
|
|
|
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
|
2019-01-27 00:06:38 +01:00
|
|
|
nlohmann_json
|
2019-05-11 18:50:47 +02:00
|
|
|
boost
|
|
|
|
];
|
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 ] );
|
|
|
|
|
2019-02-10 14:14:33 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
2018-08-09 22:32:27 +02:00
|
|
|
|
2016-06-01 21:02:58 +02:00
|
|
|
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
|
2019-02-10 14:14:33 +01:00
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-pthread" ];
|
2016-06-01 21:02:58 +02:00
|
|
|
|
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;
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
2018-08-14 12:44:07 +02:00
|
|
|
maintainers = with maintainers; [ ma27 ];
|
2016-06-01 21:02:58 +02:00
|
|
|
};
|
2018-08-09 22:32:27 +02:00
|
|
|
}
|