2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, nix
|
|
|
|
, perlPackages
|
|
|
|
, buildEnv
|
|
|
|
, makeWrapper
|
|
|
|
, unzip
|
|
|
|
, pkg-config
|
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
|
|
|
|
, 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
|
2024-05-15 15:35:15 +00:00
|
|
|
, fetchpatch2
|
2022-05-18 14:49:53 +00:00
|
|
|
, 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";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2024-03-08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "hydra";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "8f56209bd6f3b9ec53d50a23812a800dee7a1969";
|
|
|
|
hash = "sha256-mhEj02VruXPmxz3jsKHMov2ERNXk9DwaTAunWEO1iIQ=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
buildInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
unzip
|
2022-12-28 21:21:41 +00:00
|
|
|
libpqxx
|
|
|
|
top-git
|
|
|
|
mercurial
|
|
|
|
darcs
|
|
|
|
subversion
|
|
|
|
breezy
|
|
|
|
openssl
|
|
|
|
bzip2
|
|
|
|
libxslt
|
|
|
|
nix
|
|
|
|
perlDeps
|
|
|
|
perl
|
|
|
|
pixz
|
|
|
|
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
|
|
|
|
nukeReferences
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
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" ];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-pthread";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/NixOS/hydra/security/advisories/GHSA-2p75-6g9f-pqgx
|
|
|
|
(fetchpatch2 {
|
|
|
|
name = "CVE-2024-32657.patch";
|
|
|
|
url = "https://github.com/NixOS/hydra/commit/b72528be5074f3e62e9ae2c2ae8ef9c07a0b4dd3.patch";
|
|
|
|
hash = "sha256-+y27N8AIaHj13mj0LwW7dkpzfzZ4xfjN8Ld23c5mzuU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://nixos.org/hydra";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ lheckemann mindavi ] ++ teams.helsinki-systems.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|