libargon2: fixed cross-compilation#67490
Conversation
|
Looks like this patch should be an upstream fix. Can you open a ticket upstream please? |
aanderse
left a comment
There was a problem hiding this comment.
That is great you could submit the fix upstream! Thanks!
fdc705f to
53b1281
Compare
|
Accidentally forgot to commit stuff when rewriting my commit. Sorry! :3 |
96a20f1 to
61f54e1
Compare
|
Ugh... I'm so clumsy when it comes to rewriting my pull requests. I'm terribly sorry for overloading OfBorg |
aanderse
left a comment
There was a problem hiding this comment.
Looking good. Hopefully someone who knows something about cross compilation can approve. Maybe @matthewbauer?
|
I noticed that the pkgconfig file is handled by the Makefile now, and is currently incorrect. This patch should fix this diff --git a/pkgs/development/libraries/libargon2/default.nix b/pkgs/development/libraries/libargon2/default.nix
index 48c94098d58..1441aa5d112 100644
--- a/pkgs/development/libraries/libargon2/default.nix
+++ b/pkgs/development/libraries/libargon2/default.nix
@@ -20,20 +20,13 @@ stdenv.mkDerivation rec {
];
# Fix cross-compilation
- makeFlags = ["AR=${stdenv.cc.targetPrefix}ar"];
-
- installPhase = ''
- runHook preInstall
- mkdir -p $out/lib/pkgconfig
- substitute libargon2.pc $out/lib/pkgconfig/libargon2.pc \
- --replace @UPSTREAM_VER@ "${version}" \
- --replace @HOST_MULTIARCH@ "" \
- --replace 'prefix=/usr' "prefix=$out"
-
- make install PREFIX=$out LIBRARY_REL=lib
- ln -s $out/lib/libargon2.so $out/lib/libargon2.so.0
- runHook postInstall
- '';
+ makeFlags = [
+ "AR=${stdenv.cc.targetPrefix}ar"
+ "PREFIX=${placeholder "out"}"
+ "ARGON2_VERSION=${version}"
+ "LIBRARY_REL=lib"
+ "PKGCONFIG_REL=lib"
+ ];
meta = with stdenv.lib; {
description = "A key derivation function that was selected as the winner of the Password Hashing Competition in July 2015";
Not sure if the |
|
For reference the file currently looks like I'd expect anything that uses pkgconfig for libargon2 to be broken because of that. |
|
@worldofpeace Your patches were successfully assimilated 😸 |
Great @kisik21, could you note this change in the commit msg? Or if convenient make it a separate commit. |
|
Oops! I've force-pushed it to my commit >.< One second, I'll amend the commit message. |
|
Noted the pkg-config fix in the commit message and attributed the patch. |
worldofpeace
left a comment
There was a problem hiding this comment.
Checked that it cross compiles for: aarch64-multiplatform raspberryPi.
Makefile had a hardcoded unprefixed ar. I wrote a patch (sending it upstream) and added an optional make flag to override it in case we're cross-compiling. Unfortunately, this causes a rebuild of native packages. This commit also fixes the pkg-config file to be generated correctly, patch was provided by @worldofpeace.
Motivation for this change
Makefile had a hardcoded unprefixed ar. I wrote a patch and added an optional make flag to override it in case we're cross-compiling.
Unfortunately, this causes a rebuild of native packages.
Things done
sandboxinnix.confon non-NixOS)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @Radvendii @olynch