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

bftools: init at 5.9.2 #53769

Merged
merged 9 commits into from Jan 10, 2019
Merged

bftools: init at 5.9.2 #53769

merged 9 commits into from Jan 10, 2019

Conversation

tbenst
Copy link
Contributor

@tbenst tbenst commented Jan 10, 2019

Motivation for this change

This package is useful for microscopy. First pull request here so feedback most welcome!

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

I tested bfconvert, which is the only tool I use, and this worked properly for converting a .oir file to a .ome.btf. The other executables display "--help" properly but were not otherwise tested.


@tbenst tbenst changed the title add bftools, a java cmd tool for converting bioformats. bftools: init at 5.9.2 Jan 10, 2019
@tbenst
Copy link
Contributor Author

tbenst commented Jan 10, 2019

Thanks for the great feedback, @veprbl! I've pushed corrections for all resolved conversations

@veprbl
Copy link
Member

veprbl commented Jan 10, 2019

Also you don't need unzip:

diff --git a/pkgs/applications/science/biology/bftools/default.nix b/pkgs/applications/science/biology/bftools/default.nix
index aa30cbfc5ca..c45a577fc60 100644
--- a/pkgs/applications/science/biology/bftools/default.nix
+++ b/pkgs/applications/science/biology/bftools/default.nix
@@ -1,12 +1,12 @@
-{ stdenv, lib, makeWrapper, fetchurl, unzip, openjdk }:
+{ stdenv, lib, makeWrapper, fetchzip, unzip, openjdk }:

 stdenv.mkDerivation rec {
   name = "bftools-${version}";
   version = "5.9.2";

-  src = fetchurl {
+  src = fetchzip {
     url = "http://downloads.openmicroscopy.org/bio-formats/${version}/artifacts/bftools.zip";
-    sha256 = "02x8p07z7js41kgiblkr9k8v9v4ka8rm7pg3f1vy9s5p6hmpfvnx";
+    sha256 = "08lmbg3kfxh17q6548il0i2h3f9a6ch8r0r067p14dajhzfpjyqj";
   };

   installPhase = ''
@@ -20,8 +20,6 @@ stdenv.mkDerivation rec {
     done
   '';

-  buildInputs = [ unzip ];
-
   nativeBuildInputs = [ makeWrapper ];

   meta = with stdenv.lib; {

Co-Authored-By: tbenst <tbenst@gmail.com>
veprbl and others added 3 commits January 10, 2019 14:00
Co-Authored-By: tbenst <tbenst@gmail.com>
Merge branch 'bioformattools' of github.com:/tbenst/nixpkgs into bioformattools
@tbenst
Copy link
Contributor Author

tbenst commented Jan 10, 2019

without unzip, I get do not know how to unpack source archive /nix/store/qiq3mf2jdlafc35bqkw8npzpzwnj822z-bftools.zip, so I kept it.

Made all other changes except @symphorien's idea, as I'm not sure how to change the directory structure without breaking the software.

@veprbl
Copy link
Member

veprbl commented Jan 10, 2019

@tbenst This is why my snippet switches fetchurl to fetchzip.

@tbenst
Copy link
Contributor Author

tbenst commented Jan 10, 2019

@vberger doh! fixed

@veprbl
Copy link
Member

veprbl commented Jan 10, 2019

Switching the directory structure would require you to patch the shell scripts. Something like:

substituteInPlace "$out"/bin/bfconvert \
  --replace "\$BF_DIR" "$out"/libexec

@tbenst
Copy link
Contributor Author

tbenst commented Jan 10, 2019

thanks! I got stuck for now and can't spend more time on this for a few days:

  installPhase = ''
    mkdir -p $out/bin
    mkdir $out/libexec
    mkdir -p $out/share/java
    cp $(find . -maxdepth 1 -perm -111 -type f) $out/bin
    cp ./*.sh $out/libexec
    cp ./*.jar $out/share/java
    for file in $out/bin/*; do
      substituteInPlace $file --replace "\$BF_DIR" $out/libexec
      substituteInPlace $file --replace "\$BF_JAR_DIR" $out/share/java
    done
  '';
$ bfconvert 
Required JAR libraries not found. Please download:
  bioformats_package.jar
from:
  https://downloads.openmicroscopy.org/latest/bio-formats/artifacts/
and place in the same directory as the command line tools.

Edit: jk figured it out!

@veprbl
Copy link
Member

veprbl commented Jan 10, 2019

@GrahamcOfBorg build bftools

@veprbl
Copy link
Member

veprbl commented Jan 10, 2019

@GrahamcOfBorg build bftools

@veprbl veprbl merged commit d34f2b9 into NixOS:master Jan 10, 2019
@tbenst tbenst deleted the bioformattools branch January 11, 2019 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants