This reverts commit 949e5865c60323800f8bd5706842348e3e4437bf. This makes release.nix harder to read/maintain IMHO. There already is a Nix expression for Hydra in Nixpkgs that can be used for this purpose.
ICYJNJWHY6KBNLM2EMSW7VJ35OIOHN26JO3FG32VYTKNLFNZAREQC
UBPWXGKFBD6VMQCCUE625I4NLLRNVD7BSJ6QD2XF7Z7A7T5BI5XAC
CLXEECMFKLUIN5QBV3BPPPSU6G5UF6MXRSNWA6LXUBNQGSJY4U5QC
WQ2VQ7H3CTHM47EOW3F3BB2OUAI7ZXX5FBBAD2DODQOFO5LRM4WAC
X7IAG7JTV4W6JH34JBC6KOVUGBAG643V4Y5MX4GTJL2BV5PP5VIQC
T4LLYESZ2HUXSLKZ6GNBLVWUVG7R5IDFHYHYO773QIZ6QTOOXR2AC
6K5PBUUN4GQAMOVX5BS6YYMHJ3PIF2PPZBTIEQ4R7BQNHC23GS3AC
HPIJ35SGWBE4WZE5RGSYGR7IRPCFYROUUUAHAC7E5TDCMSVM2OZAC
IZYR3KTL4M5OERLZM4LAC6N6TWZLQXMRVQIFOCIKMDQU3F2E7FHQC
RRUSDIBLMUY77XSIIVDU6FUPHY6JZ2NB5QH3KC45IXA3TDZYXE4QC
GX5R7OKFGTHBPJMN6RCPXTJTROXOJQBVRTYBK5KX3EEKX7BXIQAAC
{ stdenv
, hydraSrc ? { outPath = ./.; revCount = 1234; rev = "abcdef"; }
, version ? builtins.readFile ./version + "." + toString hydraSrc.revCount + "." + hydraSrc.rev
, makeWrapper, libtool, unzip, nukeReferences, sqlite, libpqxx
, guile ? null
, perl, nix, postgresql92, perlPackages, openssh, buildEnv
, autoreconfHook, pkgconfig, topGit, mercurial, darcs, subversion, bazaar
, openssl, bzip2, libxslt, docbook_xsl, coreutils, findutils, pixz, gzip
, lzma, gnutar, git, gnused, rpm, dpkg, cdrkit, boehmgc, aws-sdk-cpp
}: assert builtins.compareVersions "6" stdenv.cc.cc.version < 1;
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
CatalystXScriptServerStarman
CryptRandPasswd
DBDPg
DBDSQLite
DataDump
DateTime
DigestSHA1
EmailMIME
EmailSender
FileSlurp
IOCompress
IPCRun
JSONXS
LWP
LWPProtocolHttps
NetAmazonS3
NetStatsd
PadWalker
Readonly
SQLSplitStatement
SetScalar
Starman
SysHostnameLong
TestMore
TextDiff
TextTable
XMLSimple
nix
nix.perl-bindings
git
boehmgc
aws-sdk-cpp
];
};
in stdenv.mkDerivation {
name = "hydra-${version}";
src = hydraSrc;
buildInputs =
[ makeWrapper autoreconfHook libtool unzip nukeReferences pkgconfig sqlite libpqxx
topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
guile # optional, for Guile + Guix support
perlDeps perl nix
postgresql92 # for running the tests
];
hydraPath = stdenv.lib.makeBinPath (
[ sqlite subversion openssh nix coreutils findutils pixz
gzip bzip2 lzma gnutar unzip git topGit mercurial darcs gnused bazaar
] ++ stdenv.lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
preHook = ''
PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
'';
preCheck = ''
patchShebangs .
export LOGNAME=${LOGNAME:-foo}
'';
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 \
--set NIX_RELEASE ${nix.name or "unknown"}
done
'';
dontStrip = true;
passthru.perlDeps = perlDeps;
}
stdenv6 = overrideCC stdenv gcc6;
/*
nix = overrideDerivation nixUnstable (attrs: {
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "4be4f6de56f4de77f6a376f1a40ed75eb641bb89";
sha256 = "0icvbwpca1jh8qkdlayxspdxl5fb0qjjd1kn74x6gs6iy66kndq6";
};
buildInputs = attrs.buildInputs ++ [ autoreconfHook bison flex ];
nativeBuildInputs = attrs.nativeBuildInputs ++ [ aws-sdk-cpp' autoconf-archive ];
configureFlags = attrs.configureFlags + " --disable-doc-gen";
preConfigure = "./bootstrap.sh; mkdir -p $doc $man";
});
*/
nix = nixUnstable;
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
CatalystXScriptServerStarman
CryptRandPasswd
DBDPg
DBDSQLite
DataDump
DateTime
DigestSHA1
EmailMIME
EmailSender
FileSlurp
IOCompress
IPCRun
JSONXS
LWP
LWPProtocolHttps
NetAmazonS3
NetStatsd
PadWalker
Readonly
SQLSplitStatement
SetScalar
Starman
SysHostnameLong
TestMore
TextDiff
TextTable
XMLSimple
nix
nix.perl-bindings
git
boehmgc
aws-sdk-cpp'
];
};
callPackage ./. {
stdenv = stdenv6 // { mkDerivation = args: releaseTools.nixBuild (args // {
stdenv = stdenv6;
postUnpack = optionalString (!shell) ''
# Clean up when building from a working tree.
(cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
'';
}); };
inherit (gitAndTools) topGit;
nix = nixUnstable;
aws-sdk-cpp = aws-sdk-cpp';
hydraSrc = if shell then null else hydraSrc;
releaseTools.nixBuild {
name = "hydra-${version}";
src = if shell then null else hydraSrc;
stdenv = overrideCC stdenv gcc6;
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
perlDeps perl nix
postgresql92 # for running the tests
];
hydraPath = lib.makeBinPath (
[ sqlite subversion openssh nix coreutils findutils pixz
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
postUnpack = optionalString (!shell) ''
# 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" ];
preHook = ''
PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
'';
preConfigure = "autoreconf -vfi";
enableParallelBuilding = true;
preCheck = ''
patchShebangs .
export LOGNAME=${LOGNAME:-foo}
'';
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 \
--set NIX_RELEASE ${nix.name or "unknown"}
done
''; # */
dontStrip = true;
meta.description = "Build of Hydra on ${system}";
passthru.perlDeps = perlDeps;