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

imagej: init at 150 #25249

Merged
merged 2 commits into from May 5, 2017
Merged

imagej: init at 150 #25249

merged 2 commits into from May 5, 2017

Conversation

yuriaisaka
Copy link
Contributor

@yuriaisaka yuriaisaka commented Apr 26, 2017

Motivation for this change

add ImageJ (a Java based image processing/analysis software).

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS (edit: since 5aeab6c)
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.
  • meta.maintainers is set (by adding an email address to default.nix; no entries were added to lib/maintainers.nix)
Possible improvements
  • According to the official documentation, should be able to compile and run
    ImageJ by using JDK version 48 ("JDK 1.4") or later.
  • The binary version (packaged here) provided by NIH appears to be compiled
    using the JDK version 49 ("JDK 5"), and thus should work on every platform
    where a JRE of version 49 or later is available.
Comments
  • This is the first time that I am trying to send a pull request to nixpkgs; my apologies in advance for any inconvenience it may cause.

Copy link
Contributor

@joachifm joachifm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've added a few superficial notes for you to consider.

'';
license = lib.licenses.publicDomain;
platforms = with stdenv.lib.platforms; linux;
maintainers = [ "Yuri Aisaka <yuri.aisaka+nix@gmail.com>" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an entry to lib/maintainers.nix

@@ -0,0 +1,40 @@
{ stdenv, lib, fetchurl, jre, unzip, makeWrapper }:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib is also available via stdenv.lib.

@@ -14197,6 +14197,8 @@ with pkgs;
inherit (perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig;}; }) PerlMagick;
};

imagej = callPackage ../applications/graphics/imagej { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that imagej here will refer to a set unlike most other toplevel bindings. The evaluator also will normally not recurse into sets, unless instructed to with recurseIntoAttrs. What is the motivation for returning a set to begin with?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even worse, the actual package will not have meta attached to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the following is usually preferred:

inherit (callPackage ../applications/graphics/imagej { }) imagej150;
imagej = imagej150;

Also I find using sets with a single element premature optimization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation for returning a set to begin with?

The reason I've used a set stems from my ignorance on a fundamental level; and on a superficial level, it is because jvm based nix packages I've consulted were popular giants like eclipse.

@yuriaisaka
Copy link
Contributor Author

@joachifm @7c6f434c @Mic92
Thanks very much for your comments!!

I will try to update the pull request to reflect the advises above:

  • stop passing lib as a downward funarg to the package (use stdenv.lib instead)
  • add an entry to lib/maintainers.nix and use it rather than putting a string literal to meta.maintainers
  • return a derivation instead of a set (put the meta into the imagej150 derivation and just return it)

Also I shall take this opportunity to

  • recompute the diff from the current HEAD
  • add some extra resources distributed by the upstream ("extra color lookup tables" and perhaps some macros) to the package

@Mic92 Mic92 merged commit 17d2ff4 into NixOS:master May 5, 2017
@Mic92
Copy link
Member

Mic92 commented May 5, 2017

Thanks!

@yuriaisaka yuriaisaka deleted the add-imagej branch February 19, 2018 08:24
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

4 participants