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
fastpbkdf2: init at version 1.0.0 #33155
Conversation
meta = with stdenv.lib; { | ||
description = "A fast PBKDF2-HMAC-{SHA1,SHA256,SHA512} implementation in C"; | ||
homepage = https://github.com/ctz/fastpbkdf2; | ||
licenses = licenses.cc0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't evaluate. It should be license = licenses.cc0;
name = "fastpbkdf2-1.0.0"; | ||
|
||
src = fetchurl { | ||
url = https://github.com/ctz/fastpbkdf2/archive/v1.0.0.tar.gz; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be ref archive, these are not deterministic (because compression is not deterministic). Hash will change after a while. Use fetchFromGitHub
instead.
buildInputs = [ openssl ]; | ||
|
||
preBuild = '' | ||
makeFlagsArray=(CFLAGS="-std=c99 -O3 -g") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-O3
doesn't seem to be particularly safe for general use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many packages that have -O3
in their CFLAGS
, but I agree that it may not be portable across different platforms. Do you know of a more portable way to enable optimization in the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a better mechanism in Nixpkgs, so nevermind. I thought -O2
might be better, but on a general note it would be better if optimization flags were set somewhere else and not in the derivation.
|
||
installPhase = '' | ||
mkdir -p $out/{lib,include/fastpbkdf2} | ||
cp *.a $out/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they only ship static libraries? If there is some way to tweak build system to emit dynamic libraries (I think in case of macOS it's dylibs), it would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package only has a static library, and I do not know of a way to make it generate a shared library without patching the Makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, OK!
@GrahamcOfBorg build fastpbkdf2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-darwin
ar: creating archive libfastpbkdf2.a
clang -std=c99 -O3 -g -c -o bench.o bench.c
clang bench.o fastpbkdf2.o -lcrypto -o bench
clang -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
clang benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
stripping (with flags -S) in /nix/store/l9lmjv27hsbyd4cilb9fcgasmf0b10gb-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/l9lmjv27hsbyd4cilb9fcgasmf0b10gb-fastpbkdf2-1.0.0
/nix/store/l9lmjv27hsbyd4cilb9fcgasmf0b10gb-fastpbkdf2-1.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: aarch64-linux
gcc bench.o fastpbkdf2.o -lcrypto -o bench
gcc -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
gcc benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/vb5mpsfyph2slfsq8r5kknpphiqb3sy2-fastpbkdf2-1.0.0
stripping (with flags -S) in /nix/store/vb5mpsfyph2slfsq8r5kknpphiqb3sy2-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/vb5mpsfyph2slfsq8r5kknpphiqb3sy2-fastpbkdf2-1.0.0
checking for references to /build in /nix/store/vb5mpsfyph2slfsq8r5kknpphiqb3sy2-fastpbkdf2-1.0.0...
/nix/store/vb5mpsfyph2slfsq8r5kknpphiqb3sy2-fastpbkdf2-1.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-linux
gcc bench.o fastpbkdf2.o -lcrypto -o bench
gcc -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
gcc benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/76h51rrcqasg3cjxg9lafs745b92vfr7-fastpbkdf2-1.0.0
stripping (with flags -S) in /nix/store/76h51rrcqasg3cjxg9lafs745b92vfr7-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/76h51rrcqasg3cjxg9lafs745b92vfr7-fastpbkdf2-1.0.0
checking for references to /tmp/nix-build-fastpbkdf2-1.0.0.drv-0 in /nix/store/76h51rrcqasg3cjxg9lafs745b92vfr7-fastpbkdf2-1.0.0...
/nix/store/76h51rrcqasg3cjxg9lafs745b92vfr7-fastpbkdf2-1.0.0
@GrahamcOfBorg eval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-darwin
ar: creating archive libfastpbkdf2.a
clang -std=c99 -O3 -g -c -o bench.o bench.c
clang bench.o fastpbkdf2.o -lcrypto -o bench
clang -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
clang benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
stripping (with flags -S) in /nix/store/nbv2c5v8jdii9xrbc7jjxhjbrmxb9j9h-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/nbv2c5v8jdii9xrbc7jjxhjbrmxb9j9h-fastpbkdf2-1.0.0
/nix/store/nbv2c5v8jdii9xrbc7jjxhjbrmxb9j9h-fastpbkdf2-1.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: aarch64-linux
gcc bench.o fastpbkdf2.o -lcrypto -o bench
gcc -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
gcc benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ciwvibjpc1aq19g48wbb195ns4khqdqp-fastpbkdf2-1.0.0
stripping (with flags -S) in /nix/store/ciwvibjpc1aq19g48wbb195ns4khqdqp-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/ciwvibjpc1aq19g48wbb195ns4khqdqp-fastpbkdf2-1.0.0
checking for references to /build in /nix/store/ciwvibjpc1aq19g48wbb195ns4khqdqp-fastpbkdf2-1.0.0...
/nix/store/ciwvibjpc1aq19g48wbb195ns4khqdqp-fastpbkdf2-1.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-linux
gcc bench.o fastpbkdf2.o -lcrypto -o bench
gcc -std=c99 -O3 -g -c -o benchmulti.o benchmulti.c
gcc benchmulti.o fastpbkdf2.o -lcrypto -o benchmulti
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/1kbzhnzzf6wrh5zhxh6h9i6skzrfpj1s-fastpbkdf2-1.0.0
stripping (with flags -S) in /nix/store/1kbzhnzzf6wrh5zhxh6h9i6skzrfpj1s-fastpbkdf2-1.0.0/lib
patching script interpreter paths in /nix/store/1kbzhnzzf6wrh5zhxh6h9i6skzrfpj1s-fastpbkdf2-1.0.0
checking for references to /tmp/nix-build-fastpbkdf2-1.0.0.drv-0 in /nix/store/1kbzhnzzf6wrh5zhxh6h9i6skzrfpj1s-fastpbkdf2-1.0.0...
/nix/store/1kbzhnzzf6wrh5zhxh6h9i6skzrfpj1s-fastpbkdf2-1.0.0
Thank you! |
Motivation for this change
New package for fastpbkdf2, which is a fast PBKDF2-HMAC-{SHA1,SHA256,SHA512} implementation in C.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)