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

nxpmicro-mfgtools: init at 1.3.191 #91634

Merged
merged 2 commits into from Jul 6, 2020

Conversation

bmilanov
Copy link
Contributor

@bmilanov bmilanov commented Jun 26, 2020

Add nxpmicro-mfgtools to nixpkgs

From the project's homepage 1:

Freescale/NXP I.MX Chip image deploy tools.

The project's only binary and library at the moment is UUU. NXP
might add more in the future, so making the package name:

nxpmicro-mfgtools

instead of:

nxp-uuu

or something similar.

Add a preConfigure step based on bbigras' suggestion.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@bbigras bbigras left a comment

Choose a reason for hiding this comment

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

I think it would be cleaner that way.

EDIT: derp, I didn't add the requested suggested changes.

@bbigras
Copy link
Contributor

bbigras commented Jun 27, 2020

You didn't check "Tested using sandboxing". Are you sure you are not using sandboxing? It's enabled by default in NixOS.

You can check by running: nix-shell -p nix-info --run "nix-info -m"

homepage = https://github.com/NXPmicro/mfgtools;
license = licenses.bsd3;
maintainers = [ maintainers.bmilanov ];
platforms = [ "x86_64-linux" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure it's Linux only? The project's readme says:

The real cross platform. Linux, Windows, MacOS(not test yet)

Maybe try platforms.all.

Copy link
Contributor Author

@bmilanov bmilanov Jun 28, 2020

Choose a reason for hiding this comment

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

It says it's cross-platform, but I wanted to add only the platform that I am working on.

Should I add all stated working, or should I add only confirmed platforms?

A bit more info, at:

https://github.com/NXPmicro/mfgtools/releases

NXP publishes compiled binaries, and I can confirm that the one for Windows works.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what the NixOS policy exactly is on this but maybe it's fine if we put "all" and the ofborg bot doesn't complain while building for all the platforms it supports.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

13f3760 fingers crossed

version = "uuu_1.3.191";

meta = with stdenv.lib; {
description = "uuu (Universal Update Utility), mfgtools 3.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

For brevity, don’t repeat the name of package — just describe what it does

Check https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes

I think a description of what the program does would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if it's better to get the contents of the long description in this field. Then think about what to add in the long description itself.

Copy link
Contributor Author

@bmilanov bmilanov Jun 28, 2020

Choose a reason for hiding this comment

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

How about this: 5f5d2ee ?

Most of the long description taken from:

https://github.com/NXPmicro/mfgtools/wiki

@bmilanov
Copy link
Contributor Author

Apologies for the multiple commits, I just now saw that I can batch suggestions into one.

@bmilanov
Copy link
Contributor Author

You didn't check "Tested using sandboxing". Are you sure you are not using sandboxing? It's enabled by default in NixOS.

You can check by running: nix-shell -p nix-info --run "nix-info -m"

Seems like I have:

- sandbox: `yes`

@bbigras
Copy link
Contributor

bbigras commented Jun 28, 2020

Ops I pasted the wrong command sorry.

Ignore the checks about the zenith package.

@bbigras
Copy link
Contributor

bbigras commented Jun 28, 2020

@GrahamcOfBorg build nxpmicro-mfgtools

@bbigras
Copy link
Contributor

bbigras commented Jun 28, 2020

Reviewed points
  • package path fits guidelines
  • package name fits guidelines
  • package version fits guidelines
  • package build on am64
  • executables tested on am64
  • meta.description is set and fits guidelines
  • meta.license fits upstream license
  • meta.platforms is set
  • meta.maintainers is set
  • build time only dependencies are declared in nativeBuildInputs
  • source is fetched using the appropriate function
  • phases are respected
  • patches that are remotely available are fetched with fetchpatch
Possible improvements
Comments

It's my first "real" review but it looks fine. Thanks for the contribution.

Result of nixpkgs-review pr 91634 1

1 package built:
- nxpmicro-mfgtools

@bbigras
Copy link
Contributor

bbigras commented Jun 28, 2020

I don't know if it matters for new packages but here's the closure size:

❯ nix path-info -S -h /nix/store/fkfi4ainw1iq49zp2jgpmmd0dyqrhixd-nxpmicro-mfgtools-1.3.191
/nix/store/fkfi4ainw1iq49zp2jgpmmd0dyqrhixd-nxpmicro-mfgtools-1.3.191 47.5M

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/209

Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Thank you for contributing to nixpkgs. I have added some more comments.

Could you squash the commits together? The first commit should add you to maintainers.nix, the second should add the derivation.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
}:

stdenv.mkDerivation rec {
pname = "nxpmicro-mfgtools";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should be just be called mfgtools? Not 100% sure though ;).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for all the feedback!

I am not sure which way's better.

Usually I would add the "nxpmicro-" as I don't know how many mfgtools can pop up in the future (doubt there will be any more), with the assumption that adding "namespaces" later would be harder. I am really tempted to make it only "mfgtools" as it's less text to write.

Your call. I can amend the commit based on what you decide.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes. There was a small syntax error that caused evaluation to fail, so I fixed that. I also used nixpkgs-fmt to format the derivation.

I think the prefix may be better here. As you say, mfgtools is very generic. I don't think there will be another package with the same name, but with the prefix it's easier to recognize and quickly find.

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops, seems like we are force-pushing at the same time. If you only fixed the syntax error, I can push my changes again.

@bmilanov
Copy link
Contributor Author

bmilanov commented Jul 6, 2020

@danieldk Just after I pushed I saw that you've changed the comma style because of the build error.

I will back off so you can force push to the proper commit.

Add nxpmicro-mfgtools to nixpkgs

From the project's homepage [1]:

    Freescale/NXP I.MX Chip image deploy tools.

The project's only binary and library at the moment is UUU. NXP
might add more in the future, so making the package name:

    nxpmicro-mfgtools

instead of:

    nxp-uuu

or something similar.

[1]: https://github.com/NXPmicro/mfgtools
Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Thanks, looks great now!

Result of nixpkgs-review pr 91634 1

1 package built:
- nxpmicro-mfgtools

Tested binary to work.

@danieldk danieldk merged commit f4dce8e into NixOS:master Jul 6, 2020
@bbigras
Copy link
Contributor

bbigras commented Jul 6, 2020

Thanks @bmilanov for your contribution and perseverance.

Thanks @danieldk too.

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