Subject: Patch

From: [email-masked] <[email-masked]>
Date: Thu, 09 Aug 2018 21:33:48 +0200

From f57aa4e30dd2abbca69e1e8bfb0fbbdf7384a160 Mon Sep 17 00:00:00 2001
From: Amirouche <[email-masked]>
Date: Thu, 9 Aug 2018 21:32:38 +0200
Subject: [PATCH] gnu: argon2: install pkgconfig file

* gnu/packages/password-utils.scm (argon2)[arguments]: add phase to install .pc file

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 9ac30420b..ac1ced7f6 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2018 Konrad Hinsen <[email-masked]>
 ;;; Copyright © 2018 Thomas Sigurdsen <[email-masked]>
 ;;; Copyright © 2018 Arun Isaac <[email-masked]>
+;;; Copyright © 2018 Amirouche Boubekki <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -458,8 +459,21 @@ through the pass command.")
              (let ((out (assoc-ref outputs "out")))
                (substitute* "Makefile"
                  (("PREFIX = /usr") (string-append "PREFIX = " out)))
+               (substitute* "libargon2.pc"
+                 (("prefix=/usr") (string-append "prefix=" out)))
+               (substitute* "libargon2.pc"
+                 (("@HOST_MULTIARCH@") ""))
+               (substitute* "libargon2.pc"
+                 (("@UPSTREAM_VER@") ,version))
                #t)))
-         (delete 'configure))))
+         (delete 'configure)
+         (add-after 'install 'install-argon2.pc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (mkdir-p (string-append out "/lib/pkgconfig"))
+               (copy-file "libargon2.pc"
+                          (string-append out "/lib/pkgconfig/libargon2.pc"))
+               #t))))))
     (home-page "https://www.argon2.com/")
     (synopsis "Password hashing library")
     (description "Argon2 provides a key derivation function that was declared
-- 
2.17.1