diff options
author | TomaSajt <62384384+TomaSajt@users.noreply.github.com> | 2024-01-04 21:42:18 +0100 |
---|---|---|
committer | TomaSajt <62384384+TomaSajt@users.noreply.github.com> | 2024-01-04 21:45:11 +0100 |
commit | 51b6d44f8b156a6bc916214521453f3732d3319b (patch) | |
tree | 228b5f60349d0085546a4a7e74c2b7d228fc1a94 /pkgs/applications/science/biology/trimmomatic | |
parent | d7db3ee91f222d1b40435ae96d38e072c582f683 (diff) |
trimmomatic: make deterministic and clean up
Diffstat (limited to 'pkgs/applications/science/biology/trimmomatic')
-rw-r--r-- | pkgs/applications/science/biology/trimmomatic/default.nix | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/pkgs/applications/science/biology/trimmomatic/default.nix b/pkgs/applications/science/biology/trimmomatic/default.nix index ad1dc45c5c26d..53cff76badcee 100644 --- a/pkgs/applications/science/biology/trimmomatic/default.nix +++ b/pkgs/applications/science/biology/trimmomatic/default.nix @@ -1,30 +1,36 @@ { lib , stdenv -, ant , fetchFromGitHub -, jdk11_headless +, ant +, jdk , jre , makeWrapper +, canonicalize-jars-hook }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "trimmomatic"; version = "0.39"; src = fetchFromGitHub { owner = "usadellab"; repo = "Trimmomatic"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-u+ubmacwPy/vsEi0YQCv0fTnVDesQvqeQDEwCbS8M6I="; }; - # Set source and target version to 11 + # Remove jdk version requirement postPatch = '' substituteInPlace ./build.xml \ - --replace 'source="1.5" target="1.5"' 'release="11"' + --replace 'source="1.5" target="1.5"' "" ''; - nativeBuildInputs = [ jdk11_headless ant makeWrapper ]; + nativeBuildInputs = [ + ant + jdk + makeWrapper + canonicalize-jars-hook + ]; buildPhase = '' runHook preBuild @@ -37,16 +43,17 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall - mkdir -p $out/bin $out/share - cp dist/jar/trimmomatic-${version}.jar $out/share/ - cp -r adapters $out/share/ + install -Dm644 dist/jar/trimmomatic-*.jar -t $out/share/trimmomatic + cp -r adapters $out/share/trimmomatic + makeWrapper ${jre}/bin/java $out/bin/trimmomatic \ - --add-flags "-cp $out/share/trimmomatic-${version}.jar org.usadellab.trimmomatic.Trimmomatic" + --add-flags "-jar $out/share/trimmomatic/trimmomatic-*.jar" runHook postInstall ''; meta = { + changelog = "https://github.com/usadellab/Trimmomatic/blob/main/versionHistory.txt"; description = "A flexible read trimming tool for Illumina NGS data"; longDescription = '' Trimmomatic performs a variety of useful trimming tasks for illumina @@ -59,8 +66,9 @@ stdenv.mkDerivation rec { license = lib.licenses.gpl3Only; sourceProvenance = [ lib.sourceTypes.fromSource - lib.sourceTypes.binaryBytecode # source bundles dependencies as jars + lib.sourceTypes.binaryBytecode # source bundles dependencies as jars ]; + mainProgram = "trimmomatic"; maintainers = [ lib.maintainers.kupac ]; }; -} +}) |