2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, nix
|
|
|
|
, perlPackages
|
|
|
|
, buildEnv
|
|
|
|
, makeWrapper
|
|
|
|
, libtool
|
|
|
|
, unzip
|
|
|
|
, pkg-config
|
|
|
|
, sqlite
|
2022-06-16 17:23:12 +00:00
|
|
|
, libpqxx
|
2022-05-18 14:49:53 +00:00
|
|
|
, top-git
|
|
|
|
, mercurial
|
|
|
|
, darcs
|
|
|
|
, subversion
|
|
|
|
, breezy
|
|
|
|
, openssl
|
|
|
|
, bzip2
|
|
|
|
, libxslt
|
|
|
|
, perl
|
|
|
|
, postgresql
|
2022-06-16 17:23:12 +00:00
|
|
|
, prometheus-cpp
|
2022-05-18 14:49:53 +00:00
|
|
|
, nukeReferences
|
|
|
|
, git
|
|
|
|
, boehmgc
|
|
|
|
, nlohmann_json
|
|
|
|
, docbook_xsl
|
|
|
|
, openssh
|
2022-06-16 17:23:12 +00:00
|
|
|
, openldap
|
2022-05-18 14:49:53 +00:00
|
|
|
, gnused
|
|
|
|
, coreutils
|
|
|
|
, findutils
|
|
|
|
, gzip
|
|
|
|
, xz
|
|
|
|
, gnutar
|
|
|
|
, rpm
|
|
|
|
, dpkg
|
|
|
|
, cdrkit
|
|
|
|
, pixz
|
|
|
|
, boost
|
|
|
|
, autoreconfHook
|
|
|
|
, mdbook
|
|
|
|
, foreman
|
|
|
|
, python3
|
|
|
|
, libressl
|
|
|
|
, cacert
|
|
|
|
, glibcLocales
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
perlDeps = buildEnv {
|
|
|
|
name = "hydra-perl-deps";
|
|
|
|
paths = with perlPackages; lib.closePropagation
|
2022-05-18 14:49:53 +00:00
|
|
|
[
|
|
|
|
AuthenSASL
|
2020-04-24 23:36:52 +00:00
|
|
|
CatalystActionREST
|
|
|
|
CatalystAuthenticationStoreDBIxClass
|
2022-05-18 14:49:53 +00:00
|
|
|
CatalystAuthenticationStoreLDAP
|
2020-04-24 23:36:52 +00:00
|
|
|
CatalystDevel
|
|
|
|
CatalystPluginAccessLog
|
|
|
|
CatalystPluginAuthorizationRoles
|
|
|
|
CatalystPluginCaptcha
|
2021-08-11 14:56:57 +00:00
|
|
|
CatalystPluginPrometheusTiny
|
2020-04-24 23:36:52 +00:00
|
|
|
CatalystPluginSessionStateCookie
|
|
|
|
CatalystPluginSessionStoreFastMmap
|
|
|
|
CatalystPluginStackTrace
|
|
|
|
CatalystRuntime
|
|
|
|
CatalystTraitForRequestProxyBase
|
|
|
|
CatalystViewDownload
|
|
|
|
CatalystViewJSON
|
|
|
|
CatalystViewTT
|
|
|
|
CatalystXScriptServerStarman
|
|
|
|
CatalystXRoleApplicator
|
2021-05-04 21:07:42 +00:00
|
|
|
CryptPassphrase
|
|
|
|
CryptPassphraseArgon2
|
2020-04-24 23:36:52 +00:00
|
|
|
CryptRandPasswd
|
|
|
|
DBDPg
|
|
|
|
DBDSQLite
|
|
|
|
DataDump
|
|
|
|
DateTime
|
|
|
|
DigestSHA1
|
|
|
|
EmailMIME
|
|
|
|
EmailSender
|
2022-08-21 13:32:41 +00:00
|
|
|
FileLibMagic
|
2022-05-18 14:49:53 +00:00
|
|
|
FileSlurper
|
|
|
|
FileWhich
|
2020-04-24 23:36:52 +00:00
|
|
|
IOCompress
|
|
|
|
IPCRun
|
2022-05-18 14:49:53 +00:00
|
|
|
IPCRun3
|
2020-04-24 23:36:52 +00:00
|
|
|
JSON
|
2022-05-18 14:49:53 +00:00
|
|
|
JSONMaybeXS
|
2020-04-24 23:36:52 +00:00
|
|
|
JSONXS
|
2022-05-18 14:49:53 +00:00
|
|
|
ListSomeUtils
|
2020-04-24 23:36:52 +00:00
|
|
|
LWP
|
|
|
|
LWPProtocolHttps
|
2022-05-18 14:49:53 +00:00
|
|
|
ModulePluggable
|
2020-04-24 23:36:52 +00:00
|
|
|
NetAmazonS3
|
|
|
|
NetPrometheus
|
|
|
|
NetStatsd
|
|
|
|
PadWalker
|
2022-05-18 14:49:53 +00:00
|
|
|
ParallelForkManager
|
|
|
|
PerlCriticCommunity
|
2021-08-11 14:56:57 +00:00
|
|
|
PrometheusTinyShared
|
2022-05-18 14:49:53 +00:00
|
|
|
ReadonlyX
|
2020-04-24 23:36:52 +00:00
|
|
|
SQLSplitStatement
|
|
|
|
SetScalar
|
|
|
|
Starman
|
2021-05-04 21:07:42 +00:00
|
|
|
StringCompareConstantTime
|
2020-04-24 23:36:52 +00:00
|
|
|
SysHostnameLong
|
|
|
|
TermSizeAny
|
2022-05-18 14:49:53 +00:00
|
|
|
TermReadKey
|
|
|
|
Test2Harness
|
|
|
|
TestPostgreSQL
|
2022-06-16 17:23:12 +00:00
|
|
|
TestSimple13
|
2020-04-24 23:36:52 +00:00
|
|
|
TextDiff
|
|
|
|
TextTable
|
2022-05-18 14:49:53 +00:00
|
|
|
UUID4Tiny
|
2020-04-24 23:36:52 +00:00
|
|
|
XMLSimple
|
2020-10-27 00:29:36 +00:00
|
|
|
YAML
|
2020-04-24 23:36:52 +00:00
|
|
|
nix.perl-bindings
|
|
|
|
git
|
|
|
|
];
|
|
|
|
};
|
2022-05-18 14:49:53 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "hydra";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "2022-10-22";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "hydra";
|
2022-11-02 22:02:43 +00:00
|
|
|
rev = "312cb42275e593eea5c44d8430ab09375fdb2fdb";
|
|
|
|
sha256 = "sha256-ablHzPwN2Pvju0kyo8N5Wavqkl60gKHCPLnruwqvwTg=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/NixOS/hydra/pull/1215: scmdiff: Hardcode --git-dir
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/NixOS/hydra/commit/b6ea85a601ddac9cb0716d8cb4d446439fa0778f.patch";
|
|
|
|
sha256 = "sha256-QHjwLYQucdkBs6OsFI8kWo5ugkPXXlTgdbGFxKBHAHo=";
|
|
|
|
})
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs =
|
2022-05-18 14:49:53 +00:00
|
|
|
[
|
2022-06-16 17:23:12 +00:00
|
|
|
libpqxx
|
2022-05-18 14:49:53 +00:00
|
|
|
top-git
|
|
|
|
mercurial
|
|
|
|
darcs
|
|
|
|
subversion
|
|
|
|
breezy
|
|
|
|
openssl
|
|
|
|
bzip2
|
|
|
|
libxslt
|
2022-06-16 17:23:12 +00:00
|
|
|
nix
|
2022-05-18 14:49:53 +00:00
|
|
|
perlDeps
|
|
|
|
perl
|
|
|
|
pixz
|
2022-06-16 17:23:12 +00:00
|
|
|
boost
|
|
|
|
postgresql
|
|
|
|
nlohmann_json
|
|
|
|
prometheus-cpp
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
hydraPath = lib.makeBinPath (
|
2022-05-18 14:49:53 +00:00
|
|
|
[
|
|
|
|
subversion
|
|
|
|
openssh
|
|
|
|
nix
|
|
|
|
coreutils
|
|
|
|
findutils
|
|
|
|
pixz
|
|
|
|
gzip
|
|
|
|
bzip2
|
|
|
|
xz
|
|
|
|
gnutar
|
|
|
|
unzip
|
|
|
|
git
|
|
|
|
top-git
|
2022-06-16 17:23:12 +00:00
|
|
|
mercurial
|
|
|
|
darcs
|
2022-05-18 14:49:53 +00:00
|
|
|
gnused
|
|
|
|
breezy
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ]
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
mdbook
|
|
|
|
unzip
|
|
|
|
nukeReferences
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
checkInputs = [
|
|
|
|
cacert
|
|
|
|
foreman
|
|
|
|
glibcLocales
|
|
|
|
python3
|
|
|
|
libressl.nc
|
2022-06-16 17:23:12 +00:00
|
|
|
openldap
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-pthread";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
OPENLDAP_ROOT = openldap;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
shellHook = ''
|
|
|
|
PATH=$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$(pwd)/src/hydra-evaluator:$PATH
|
|
|
|
PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Change 5s timeout for init to 30s
|
|
|
|
substituteInPlace t/lib/HydraTestContext.pm \
|
|
|
|
--replace 'expectOkay(5, ("hydra-init"));' 'expectOkay(30, ("hydra-init"));'
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = ''
|
|
|
|
patchShebangs .
|
|
|
|
export LOGNAME=''${LOGNAME:-foo}
|
2022-05-18 14:49:53 +00:00
|
|
|
# set $HOME for bzr so it can create its trace file
|
|
|
|
export HOME=$(mktemp -d)
|
2022-06-16 17:23:12 +00:00
|
|
|
# remove flaky test
|
|
|
|
rm t/Hydra/Controller/User/ldap-legacy.t
|
2020-04-24 23:36:52 +00: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 \
|
2022-05-18 14:49:53 +00:00
|
|
|
--set-default HYDRA_RELEASE ${version} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set HYDRA_HOME $out/libexec/hydra \
|
|
|
|
--set NIX_RELEASE ${nix.name or "unknown"}
|
|
|
|
done
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
passthru = {
|
2022-06-16 17:23:12 +00:00
|
|
|
inherit nix perlDeps;
|
2022-05-18 14:49:53 +00:00
|
|
|
tests.basic = nixosTests.hydra.hydra_unstable;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Nix-based continuous build system";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ lheckemann mindavi das_j ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|