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

libngspice: add darwin to platforms #95513

Merged
merged 1 commit into from Aug 16, 2020
Merged

Conversation

hannesweisbach
Copy link
Contributor

Motivation for this change

This change adresses issue #86039 and enables builds on darwin. I don't see why this wasn't enabled in the first place, as libngspice is cross-platform. Homebrew also has macOS-formula for it.

Simply adding platforms.darwin was enough to make it compile for me on macOS 10.15.5. This change should not affect builds on other platforms.

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

@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 for fixing the Darwin build! In these cases it's better to use platforms.unix, since it will make future support for other Unix systems easier.

@@ -21,6 +21,6 @@ stdenv.mkDerivation rec {
homepage = "http://ngspice.sourceforge.net";
license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
maintainers = with maintainers; [ bgamari ];
platforms = platforms.linux;
platforms = with platforms; darwin ++ linux;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
platforms = with platforms; darwin ++ linux;
platforms = with platforms.unix;

Simpler and is likely to work with any unix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the swift reply and improvement suggestion. I'm new to nix always keen to learn how things are done in an idiomatic way.
Change applied to PR.

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! LGTM

@danieldk danieldk merged commit ced111f into NixOS:master Aug 16, 2020
@hannesweisbach hannesweisbach deleted the libngspice branch August 16, 2020 10:58
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

2 participants