[PATCH 0/2] gnu: crypto+: Update to 8.8.0.

  • Done
  • quality assurance status badge
Details
2 participants
  • Jean-Pierre De Jesus DIAZ
  • Christopher Baines
Owner
unassigned
Submitted by
Jean-Pierre De Jesus DIAZ
Severity
normal
J
J
Jean-Pierre De Jesus DIAZ wrote on 10 Jul 2023 19:45
(address . guix-patches@gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20230710174541.209437-1-jean@foundationdevices.com
This updates the package definition of crypto++ to the latest
version and also improves the phases expressions by removing
unused ones, for example, the library doesn't build anymore with
`-march=native' by default and the pkg-config file can be created
by a make target.

Enables cross-compilation for GNU/Linux targets and also for MinGW
targets.

Also, as the package can be built with `-march=...` I added the tunable
option to the package. This package also provides SIMD implementations
of some functions, but these need to be explicitly used by dependent
packages.


Jean-Pierre De Jesus DIAZ (2):
gnu: crypto++: Update to 8.8.0.
gnu: crypto++: Add tunable property.

gnu/packages/crypto.scm | 84 ++++++++++++++---------------------------
1 file changed, 29 insertions(+), 55 deletions(-)


base-commit: 2426e51688d479042ea115a634c6be2d8b9f3b99
--
2.34.1
J
J
Jean-Pierre De Jesus DIAZ wrote on 10 Jul 2023 19:48
[PATCH 1/2] gnu: crypto++: Update to 8.8.0.
(address . 64558@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20230710174820.210461-1-jean@foundationdevices.com
* gnu/packages/crypto.scm (crypto++): Update to 8.8.0.
[arguments]: Update to new style. Remove .so symbolic link
installation as the project does it now. Fix cross-compilation for
GNU/Linux and MinGW targets.

Signed-off-by: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
---
gnu/packages/crypto.scm | 83 ++++++++++++++---------------------------
1 file changed, 28 insertions(+), 55 deletions(-)

Toggle diff (112 lines)
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 9b89c7d545..69d979fef4 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -26,6 +26,7 @@
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
+;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -739,7 +740,7 @@ (define-public perl-math-random-secure
(define-public crypto++
(package
(name "crypto++")
- (version "8.6.0")
+ (version "8.8.0")
(source (origin
(method git-fetch)
(uri
@@ -751,62 +752,34 @@ (define-public crypto++
(file-name (git-file-name name version))
(sha256
(base32
- "1vm821wpx59ccz6gr4xplqpxj3f1qq3jijyybj2g4npqmmldhx3b"))))
+ "11gfnsqbb531zwgzpm0x9hsgshzcj1j049vg0zqsaqf8lvky03l6"))))
(build-system gnu-build-system)
(arguments
- `(#:make-flags
- (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
- ;; Override "/sbin/ldconfig" with simply "echo" since
- ;; we don't need ldconfig(8).
- "LDCONF=echo")
- #:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'disable-native-optimisation
- ;; This package installs more than just headers. Ensure that the
- ;; cryptest.exe binary & static library aren't CPU model specific.
- (lambda _
- (substitute* "GNUmakefile"
- ((" -march=native") ""))
- #t))
- (delete 'configure)
- (replace 'build
- ;; By default, only the static library is built.
- (lambda* (#:key (make-flags '()) #:allow-other-keys)
- (apply invoke "make" "shared"
- "-j" (number->string (parallel-job-count))
- make-flags)))
- (add-after 'install 'install-shared-library-links
- ;; By default, only .so and .so.x.y.z are installed.
- ;; Create all the ‘intermediates’ expected by dependent packages.
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (lib (string-append out "/lib"))
- (prefix "libcryptopp.so.")
- (target (string-append prefix ,version)))
- (with-directory-excursion lib
- (symlink target
- (string-append prefix ,(version-major+minor version)))
- (symlink target
- (string-append prefix ,(version-major version)))
- #t))))
- (add-after 'install 'install-pkg-config
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (pkg-dir (string-append out "/lib/pkgconfig")))
- (mkdir-p pkg-dir)
- (with-output-to-file (string-append pkg-dir "/libcrypto++.pc")
- (lambda _
- (display
- (string-append
- "prefix=" out "\n"
- "libdir=" out "/lib\n"
- "includedir=" out "/include\n\n"
- "Name: libcrypto++-" ,version "\n"
- "Description: Class library of cryptographic schemes\n"
- "Version: " ,version "\n"
- "Libs: -L${libdir} -lcryptopp\n"
- "Cflags: -I${includedir}\n"))
- #t))))))))
+ (list #:make-flags
+ #~(list (string-append "PREFIX=" #$output)
+ (string-append "CC=" #$(cc-for-target))
+ (string-append "CXX=" #$(cxx-for-target))
+ (string-append "AR=" #$(ar-for-target))
+ ;; Override "/sbin/ldconfig" with simply "echo" since
+ ;; we don't need ldconfig(8).
+ "LDCONF=echo")
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ ;; By default, only the static library is built.
+ (lambda* (#:key make-flags parallel-build?
+ #:allow-other-keys)
+ (let* ((job-count (if parallel-build?
+ (number->string (parallel-job-count))
+ 1))
+ (jobs (string-append "-j" job-count))
+ (target #$(if (target-mingw?)
+ "static"
+ "shared")))
+ (apply invoke "make" target jobs make-flags)
+ (apply invoke "make" "libcryptopp.pc" jobs
+ make-flags)))))))
(native-inputs
(list unzip))
(home-page "https://cryptopp.com/")
--
2.34.1
J
J
Jean-Pierre De Jesus DIAZ wrote on 10 Jul 2023 19:48
[PATCH 2/2] gnu: crypto++: Add tunable property.
(address . 64558@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20230710174820.210461-2-jean@foundationdevices.com
* gnu/packages/crypto.scm (crypto++): Set tunable? property to true.

Signed-off-by: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
---
gnu/packages/crypto.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 69d979fef4..995f01c2d0 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -780,6 +780,7 @@ (define-public crypto++
(apply invoke "make" target jobs make-flags)
(apply invoke "make" "libcryptopp.pc" jobs
make-flags)))))))
+ (properties '((tunable? . #t)))
(native-inputs
(list unzip))
(home-page "https://cryptopp.com/")
--
2.34.1
C
C
Christopher Baines wrote on 17 Oct 2023 11:38
Re: [bug#64558] [PATCH 0/2] gnu: crypto+: Update to 8.8.0.
(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
87h6mp7f6c.fsf@cbaines.net
Jean-Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (22 lines)
> This updates the package definition of crypto++ to the latest
> version and also improves the phases expressions by removing
> unused ones, for example, the library doesn't build anymore with
> `-march=native' by default and the pkg-config file can be created
> by a make target.
>
> Enables cross-compilation for GNU/Linux targets and also for MinGW
> targets.
>
> Also, as the package can be built with `-march=...` I added the tunable
> option to the package. This package also provides SIMD implementations
> of some functions, but these need to be explicitly used by dependent
> packages.
>
>
> Jean-Pierre De Jesus DIAZ (2):
> gnu: crypto++: Update to 8.8.0.
> gnu: crypto++: Add tunable property.
>
> gnu/packages/crypto.scm | 84 ++++++++++++++---------------------------
> 1 file changed, 29 insertions(+), 55 deletions(-)

Thanks for the patches, and apologies for the long delay in looking at
them.

I've now pushed them to master as
c8312a6d070677909130c227e9a5bbcaa6a57bfe.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmUuWGtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xc3sA//WXkrxWOm5Qogib8ZQ7OruNCjpvXcCGAv
o1tecSLN9uKMCf8Ne99lot3Q1Yck+8sW1Box1D7Wr8YKnzrHltZAl6ajHomffp2y
NrBwfC3oopAZxOxPQ1fvz8ZTcpYoMtnD4KbnnrOxa1jVk6XCU8og8xAjPdjr2IeK
uSep7HmQplNregP1Zs3Waygq2sxMV+SeWniP7M2Ax6D/2dxVWP+BI/U/XwafawIz
ii4QaDsSJgTy5V0WH+C/eCeqtEVJvIPsXRo9emqXljylPpxsd/d0+gyF31KztoJA
N9hDuWNzFrVvex2actNm2ENIAuvTEaBLLNCu5mnQJ+ll73nImGcKZm1itAXwAEJH
PTMMRKsLJLZG4YfH4Edw+Bmr482A4sUBdF+kBrYyG2IIwzpjBGakcUkb4PCkhyQf
X3sEWoz15kwV0gPfKeEeOoU9aYji+36mhHYY3Ds2++Vy2E/Y2/TvzBSf3HpVz8BU
HV8VGc0Cg8hYriYXXz7vaU1pahWH8f1iHre02fVdztr7kdbhh+lewVQwppxUPonV
bct3EA6xuFBojypxgrpzWS/mM02q6xTQYfhJRwnEIR/OuxuT8ttYjKlnWDIhoPAY
uMk6+3dpsWaB3xX3bNdNUsP0MUZnGLqhj6DNEti6cOt9BUflnQkpwfhTKpcCEu2z
gbc0LDCsqYU=
=5iUj
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 64558@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64558
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch