-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
/
Copy pathpackage.nix
116 lines (103 loc) · 3.48 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
openjdk,
gradle,
wget,
which,
gnused,
gawk,
coreutils,
bash,
testers,
nixosTests,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nextflow";
# 24.08.0-edge is compatible with Java 21. The current (as of 2024-09-19)
# nextflow release (24.04.4) does not yet support java21, but java19. The
# latter is not in nixpkgs(-unstable) anymore.
version = "24.08.0-edge";
src = fetchFromGitHub {
owner = "nextflow-io";
repo = "nextflow";
rev = "6e866ae81ff3bf8a9729e9dbaa9dd89afcb81a4b";
hash = "sha256-SA27cuP3iO5kD6u0uTeEaydyqbyJzOkVtPrb++m3Tv0=";
};
nativeBuildInputs = [
makeWrapper
gradle
];
postPatch = ''
# Nextflow invokes the constant "/bin/bash" (not as a shebang) at
# several locations so we fix that globally. However, when running inside
# a container, we actually *want* "/bin/bash". Thus the global fix needs
# to be reverted for this specific use case.
substituteInPlace modules/nextflow/src/main/groovy/nextflow/executor/BashWrapperBuilder.groovy \
--replace-fail "['/bin/bash'," "['${bash}/bin/bash'," \
--replace-fail "if( containerBuilder ) {" "if( containerBuilder ) {
launcher = launcher.replaceFirst(\"/nix/store/.*/bin/bash\", \"/bin/bash\")"
'';
mitmCache = gradle.fetchDeps {
inherit (finalAttrs) pname;
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
# During the build, some additional dependencies are downloaded ("detached
# configuration"). We thus need to run a full build on instead of the default
# one.
# See https://github.com/NixOS/nixpkgs/pull/339197#discussion_r1747749061
gradleUpdateTask = "pack";
# The installer attempts to copy a final JAR to $HOME/.nextflow/...
gradleFlags = [ "-Duser.home=\$TMPDIR" ];
preBuild = ''
# See Makefile (`make pack`)
export BUILD_PACK=1
'';
gradleBuildTask = "pack";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 build/releases/nextflow-${finalAttrs.version}-dist $out/bin/nextflow
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/nextflow \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gawk
gnused
wget
which
]
} \
--set JAVA_HOME ${openjdk.home}
'';
passthru.tests.default = nixosTests.nextflow;
# versionCheckHook doesn't work as of 2024-09-23.
# See https://github.com/NixOS/nixpkgs/pull/339197#issuecomment-2363495060
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "env HOME=$TMPDIR nextflow -version";
};
meta = with lib; {
description = "DSL for data-driven computational pipelines";
longDescription = ''
Nextflow is a bioinformatics workflow manager that enables the development of portable and reproducible workflows.
It supports deploying workflows on a variety of execution platforms including local, HPC schedulers, AWS Batch, Google Cloud Life Sciences, and Kubernetes.
Additionally, it provides support for manage your workflow dependencies through built-in support for Conda, Docker, Singularity, and Modules.
'';
homepage = "https://www.nextflow.io/";
changelog = "https://github.com/nextflow-io/nextflow/releases";
license = licenses.asl20;
maintainers = with maintainers; [
Etjean
edmundmiller
];
mainProgram = "nextflow";
platforms = platforms.unix;
};
})