about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexis Praga <alexis.praga@free.fr>2023-05-06 22:32:52 +0200
committerAlexis Praga <alexis.praga@proton.me>2024-04-02 23:20:30 +0200
commit7629ea877f832c3e91b1e5014409bc3ab4cc4c65 (patch)
tree060926f8b3b7393fc54592939e154cb88465d30c
parent76fd5b7e0a831f29cbdc333417cf315d77467234 (diff)
rtg-tools: init at 3.12.1
A subset of RTG Core that includes several useful utilities for dealing with VCF files and sequence data.
Mostly used for vcfeval to compare VCF.
-rw-r--r--pkgs/by-name/rt/rtg-tools/package.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/by-name/rt/rtg-tools/package.nix b/pkgs/by-name/rt/rtg-tools/package.nix
new file mode 100644
index 0000000000000..7872df77e61b0
--- /dev/null
+++ b/pkgs/by-name/rt/rtg-tools/package.nix
@@ -0,0 +1,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 ];
+  };
+}