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

kisslicer: init at 1.6.2 #30595

Closed
wants to merge 1 commit into from
Closed

kisslicer: init at 1.6.2 #30595

wants to merge 1 commit into from

Conversation

cransom
Copy link
Contributor

@cransom cransom commented Oct 19, 2017

Motivation for this change

I'd like to use my favorite 3d printing slicer under NixOS

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
    • 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/)
  • Fits CONTRIBUTING.md.

homepage = http://www.kisslicer.com;
license = licenses.unfree;
maintainers = [ maintainers.cransom ];
platforms = platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

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

Based on the download URL I guess this should be platforms = "x86_64-linux";.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, fixed.

, makeWrapper
, stdenv
, unzip
, inidir ? "\\\$HOME/.config/kisslicer"
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to either change the default here to ${XDG_CONFIG_HOME:-$HOME/.config}/kisslicer or to always use this, i.e., not to have an inidir parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

in stdenv.mkDerivation rec {
inherit version name;

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to use

src = fetchzip {
  url = "http://www.kisslicer.com/uploads/1/5/3/8/15381852/kisslicer_linux64_1.6.2_release.zip";
  sha256 = "blahblahblah";
  stripRoot = false;
};

since then you can remove the custom unpackPhase.

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've switched to it. I'm not a big fan of the behavior as I have to unpack it in order to get the SHA (though yes, there's nix-prefetch-url -A) but it drops the unpackphase.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I don't think you'll need to worry about the unpack phase since fetchzip extracts the archive after the fetch. Try removing the phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; line. It should still work fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does work without it, but is there value in skipping phases that are a noop? There isn't a configure script or Makefile so it cuts down a small amount of logging that isn't pertinent to the build.

Copy link
Member

Choose a reason for hiding this comment

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

Generally speaking it is best not to override the phases field since it is controlling fairly low level stuff within stdenv and it is easy to miss something. The recommendation I've seen is to instead disable the phases that are not needed. In this case to have

  configurePhase = ":";
  dontBuild = true;

instead of phases = [ … ];. Don't ask me why there is no dontConfigure.

In any case, I believe the phases you have set is OK so I'll merge as is. Can also sort it out later if any problem ever arises.

];

in stdenv.mkDerivation rec {
inherit version name;
Copy link
Member

Choose a reason for hiding this comment

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

The name should include the version. Best to replace this line with

  name = "kisslicer-1.6.2";

No need for a version field since it's not used anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

makeWrapper
unzip
];
installPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

The convention is to have empty lines between the attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and fixed.

@rycee
Copy link
Member

rycee commented Nov 2, 2017

Rebased to master in b62992a. Thanks for the good work!

@rycee rycee closed this Nov 2, 2017
@cransom
Copy link
Contributor Author

cransom commented Nov 2, 2017 via email

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

3 participants