Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtg-tools: init at 3.12.1 #230394

Merged
merged 1 commit into from Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions 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 = ''
apraga marked this conversation as resolved.
Show resolved Hide resolved
runHook preBuild
ant rtg-tools.jar
apraga marked this conversation as resolved.
Show resolved Hide resolved
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp build/rtg-tools.jar $out/bin/RTG.jar
cp installer/rtg $out/bin/
apraga marked this conversation as resolved.
Show resolved Hide resolved
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 ];
};
}