/
package.nix
59 lines (51 loc) · 1.34 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
{
lib,
stdenv,
fetchFromGitHub,
jdk,
ant,
git,
unzip,
}:
stdenv.mkDerivation rec {
pname = "rtg-tools";
version = "3.12.1";
src = fetchFromGitHub {
owner = "RealTimeGenomics";
repo = "rtg-tools";
rev = version;
sha256 = "sha256-fMrrjrgaGxBVxn6qMq2g0oFv6qtfhZcQlkvv1E9Os6Y=";
};
nativeBuildInputs = [
ant
jdk
git # Required by build.xml to manage the build revision
unzip
];
buildPhase = ''
runHook preBuild
ant rtg-tools.jar
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp build/rtg-tools.jar $out/bin/RTG.jar
cp installer/rtg $out/bin/
runHook postInstall
'';
postPatch = ''
# Use a location outside nix (must be writable)
substituteInPlace installer/rtg \
--replace-fail '$THIS_DIR/rtg.cfg' '$HOME/.config/rtg-tools/rtg.cfg' \
--replace-fail 'RTG_JAVA="java"' 'RTG_JAVA="${jdk}/lib/openjdk/bin/java"'
sed -i '/USER_JAVA_OPTS=$RTG_JAVA_OPTS/a mkdir -p $HOME/.config/rtg-tools' installer/rtg
'';
meta = with lib; {
homepage = "https://github.com/RealTimeGenomics/rtg-tools";
description = "Useful utilities for dealing with VCF files and sequence data, especially vcfeval";
license = licenses.bsd2;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ apraga ];
};
}