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

libfive: init at 2018-07-01 #42824

Merged
merged 1 commit into from Jul 4, 2018
Merged

libfive: init at 2018-07-01 #42824

merged 1 commit into from Jul 4, 2018

Conversation

Hodapp87
Copy link
Contributor

@Hodapp87 Hodapp87 commented Jun 30, 2018

Motivation for this change

The usual: Needed this package and figured I'd add a derivation.

Should build on Mac but I've nothing to test this.

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


stdenv.mkDerivation rec {
name = "libfive-${version}";
version = "755f7fed";
Copy link
Member

Choose a reason for hiding this comment

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

If the package doesn't have frequent releases, usually the date of the commit is used as the version then, in YYYY-MM-DD format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know. Doing that and the below.

src = fetchFromGitHub {
owner = "libfive";
repo = "libfive";
rev = "${version}";
Copy link
Member

Choose a reason for hiding this comment

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

Then you can put the full git hash here

rev = "${version}";
sha256 = "1cjvmfsjbc3k5zfp22zccmjx0b2rmm2a0vm555f3bqj81yw9v7ps";
};
buildInputs = [ cmake pkgconfig eigen3_3 zlib libpng
Copy link
Member

Choose a reason for hiding this comment

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

cmake and pkgconfig should be in nativeBuildInputs (because they're tools used at build time)

Copy link
Contributor

Choose a reason for hiding this comment

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

Try using ninja with cmake, it often builds faster.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

Add ninja dependency next to cmake.


# Rename "Studio" binary to "libfive-studio" to be more obvious
postFixup = ''
mv "$out/bin/Studio" "$out/bin/libfive-studio"
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this confuse people who used it in other package managers? I think either not changing the name at all, or at least symlinking so both names are usable, 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.

If it's no problem having a generically-named "Studio" binary, sure, I'll do that.

owner = "libfive";
repo = "libfive";
rev = "${version}";
sha256 = "1cjvmfsjbc3k5zfp22zccmjx0b2rmm2a0vm555f3bqj81yw9v7ps";
Copy link
Member

Choose a reason for hiding this comment

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

Also, I get a hash mismatch, the correct one is 1ah4yw62kb2qk19ban6nv8b61fb9g8vkk5ramnp99xz3r8bjpf7c

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird, I must have been distracted when building this...

buildInputs = [ cmake pkgconfig eigen3_3 zlib libpng
boost qt5.qtimageformats guile ];

enableParallelBuilding = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Cmake builds in parallel by default.

@Hodapp87 Hodapp87 force-pushed the libfive branch 2 times, most recently from 15ece2f to 5aa3de5 Compare July 2, 2018 13:23
@Hodapp87 Hodapp87 changed the title libfive: init at 755f7fed libfive: init at 2018-07-01 Jul 2, 2018
@ryantm
Copy link
Member

ryantm commented Jul 3, 2018

@GrahamcOfBorg build libfive

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: libfive

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libfive

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01
shrinking /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01/bin/Studio
shrinking /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01/lib/libfive.so
shrinking /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01/lib/libfive-guile.so
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01/lib  /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01/bin
patching script interpreter paths in /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01
checking for references to /build in /nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01...
postPatchMkspecs
/nix/store/91ccwivhasqxd8vbfj57hv0ckqy7hgvm-libfive-2018-07-01

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libfive

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01
shrinking /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01/bin/Studio
shrinking /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01/lib/libfive-guile.so
shrinking /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01/lib/libfive.so
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01/lib  /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01/bin
patching script interpreter paths in /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01
checking for references to /build in /nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01...
postPatchMkspecs
/nix/store/1jvx3zp8yl6wlh4sia9ykws11p233yik-libfive-2018-07-01

@ryantm
Copy link
Member

ryantm commented Jul 3, 2018

Looks good to me

@infinisil infinisil merged commit afa9f76 into NixOS:master Jul 4, 2018
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

5 participants