summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix5
-rw-r--r--pkgs/applications/science/biology/bftools/default.nix41
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 48 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 9fc60c60b9c..b93eba0e8ff 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -4361,6 +4361,11 @@
     github = "tazjin";
     name = "Vincent Ambo";
   };
+  tbenst = {
+    email = "nix@tylerbenster.com";
+    github = "tbenst";
+    name = "Tyler Benster";
+  };
   teh = {
     email = "tehunger@gmail.com";
     github = "teh";
diff --git a/pkgs/applications/science/biology/bftools/default.nix b/pkgs/applications/science/biology/bftools/default.nix
new file mode 100644
index 00000000000..24a6e052df9
--- /dev/null
+++ b/pkgs/applications/science/biology/bftools/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, makeWrapper, fetchzip, jre }:
+
+stdenv.mkDerivation rec {
+  name = "bftools-${version}";
+  version = "5.9.2";
+
+  src = fetchzip {
+    url = "http://downloads.openmicroscopy.org/bio-formats/${version}/artifacts/bftools.zip";
+    sha256 = "08lmbg3kfxh17q6548il0i2h3f9a6ch8r0r067p14dajhzfpjyqj";
+  };
+
+  installPhase = ''
+    find . -maxdepth 1 -perm -111 -type f -not -name "*.sh" \
+      -exec install -vD {} "$out"/bin/{} \;
+
+    mkdir $out/libexec
+    mkdir -p $out/share/java
+
+    cp ./*.sh $out/libexec
+    cp ./*.jar $out/share/java
+
+    for file in $out/bin/*; do
+      substituteInPlace $file --replace "\$BF_DIR" $out/libexec
+    done
+    substituteInPlace $out/libexec/bf.sh --replace "\$BF_JAR_DIR" $out/share/java
+  '';
+
+  postFixup = ''
+    wrapProgram $out/libexec/bf.sh --prefix PATH : "${lib.makeBinPath [ jre ]}"
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  meta = with stdenv.lib; {
+    description = "A bundle of scripts for using Bio-Formats on the command line with bioformats_package.jar already included";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    homepage = https://www.openmicroscopy.org/bio-formats/;
+    maintainers = [ maintainers.tbenst ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c7817211a85..29f8a70204d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -21428,6 +21428,8 @@ in
 
   bcftools = callPackage ../applications/science/biology/bcftools { };
 
+  bftools = callPackage ../applications/science/biology/bftools { };
+
   conglomerate = callPackage ../applications/science/biology/conglomerate { };
 
   dcm2niix = callPackage ../applications/science/biology/dcm2niix { };