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

Conversation

Projects
None yet
4 participants
@tbenst
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2019

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

@veprbl

This comment has been minimized.

Copy link
Member

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; {
bftools: init at 5.9.2
Co-Authored-By: tbenst <tbenst@gmail.com>

veprbl and others added some commits Jan 10, 2019

bftools: init at 5.9.2
Co-Authored-By: tbenst <tbenst@gmail.com>
bftools: init at 5.9.2
Merge branch 'bioformattools' of github.com:/tbenst/nixpkgs into bioformattools
@tbenst

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Jan 10, 2019

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

@tbenst

This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2019

@vberger doh! fixed

@veprbl

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Jan 10, 2019

@GrahamcOfBorg build bftools

@veprbl

veprbl approved these changes Jan 10, 2019

@veprbl

This comment has been minimized.

Copy link
Member

commented Jan 10, 2019

@GrahamcOfBorg build bftools

@veprbl veprbl merged commit d34f2b9 into NixOS:master Jan 10, 2019

13 checks passed

grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
nix-build -A bftools --argstr system aarch64-linux Build Results
Details
nix-build -A bftools --argstr system x86_64-darwin Build Results
Details
nix-build -A bftools --argstr system x86_64-linux Build Results
Details

@tbenst tbenst deleted the tbenst:bioformattools branch Jan 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.