summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-08-28 13:02:05 -0400
committerGitHub <noreply@github.com>2019-08-28 13:02:05 -0400
commit58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc (patch)
treecf4022dc57354878e8241f92afc6735d5b292498
parent6233291d951ff635a76f70f03df4cb870d2bd20c (diff)
parent06073ae7df9f0202c864a7d91ed9ac40b388fd4a (diff)
downloadnixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar.gz
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar.bz2
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar.lz
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar.xz
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.tar.zst
nixpkgs-58fd72f3e996856d5a4ba21ae25f87a82fe3e5dc.zip
Merge pull request #67490 from kisik21/master
libargon2: fixed cross-compilation
-rw-r--r--pkgs/development/libraries/libargon2/default.nix27
1 files changed, 15 insertions, 12 deletions
diff --git a/pkgs/development/libraries/libargon2/default.nix b/pkgs/development/libraries/libargon2/default.nix
index c0dd406dd31..9bf05a679cc 100644
--- a/pkgs/development/libraries/libargon2/default.nix
+++ b/pkgs/development/libraries/libargon2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "libargon2";
@@ -11,18 +11,21 @@ stdenv.mkDerivation rec {
     sha256 = "0p4ry9dn0mi9js0byijxdyiwx74p1nr8zj7wjpd1fjgqva4sk23i";
   };
 
-  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"
+  patches = [
+    # TODO: remove when https://github.com/P-H-C/phc-winner-argon2/pull/277 is merged + released
+    (fetchpatch {
+      url = "https://github.com/P-H-C/phc-winner-argon2/commit/cd1c1d8d204e4ec4557e358013567c097cb70562.patch";
+      sha256 = "0whqv8b6q9602n7vxpzbd8bk8wz22r1jz9x5lrm9z7ib3wz81c8a";
+    })
+  ];
 
-    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" # Fix cross-compilation
+    "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";