Commit | Line | Data |
---|---|---|
2fba90a8 | 1 | ;;; GNU Guix --- Functional package management for GNU |
e8134442 | 2 | ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org> |
8aa0d29d | 3 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
2fba90a8 JK |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages i2p) | |
21 | #:use-module (gnu packages boost) | |
22 | #:use-module (gnu packages compression) | |
23 | #:use-module (gnu packages tls) | |
24 | #:use-module (gnu packages upnp) | |
2fba90a8 JK |
25 | #:use-module (guix packages) |
26 | #:use-module (guix git-download) | |
27 | #:use-module (guix build-system cmake) | |
28 | #:use-module ((guix licenses) #:prefix license:)) | |
29 | ||
30 | (define-public i2pd | |
31 | (package | |
32 | (name "i2pd") | |
8aa0d29d | 33 | (version "2.31.0") |
2fba90a8 JK |
34 | (source |
35 | (origin | |
36 | (method git-fetch) | |
37 | (uri (git-reference | |
b0e7b699 | 38 | (url "https://github.com/PurpleI2P/i2pd") |
2fba90a8 JK |
39 | (commit version))) |
40 | (file-name (git-file-name name version)) | |
41 | (sha256 | |
8aa0d29d | 42 | (base32 "1q2gxz041ha9n5lfn91iy11sdf3z7d806vcq4z43m7lf92m7i4nn")))) |
2fba90a8 JK |
43 | (build-system cmake-build-system) |
44 | (inputs `(("boost" ,boost) | |
45 | ("miniupnpc" ,miniupnpc) | |
46 | ("openssl" ,openssl) | |
2fba90a8 JK |
47 | ("zlib" ,zlib))) |
48 | (arguments '(#:configure-flags | |
49 | (let ((source (assoc-ref %build-inputs "source"))) | |
50 | (list (string-append "-S" source "/build") | |
51 | "-DWITH_PCH=OFF" | |
52 | "-DWITH_STATIC=OFF" | |
53 | "-DWITH_UPNP=ON" | |
2fba90a8 JK |
54 | "-DWITH_LIBRARY=ON" |
55 | "-DBUILD_SHARED_LIBS=ON" | |
56 | "-DWITH_BINARY=ON")) | |
57 | #:phases | |
58 | (modify-phases %standard-phases | |
59 | (replace 'check | |
60 | (lambda* (#:key | |
61 | (make-flags '()) | |
62 | (parallel-tests? #t) | |
63 | #:allow-other-keys) | |
262f904e | 64 | (let ((source (assoc-ref %build-inputs "source"))) |
2fba90a8 JK |
65 | (copy-recursively (string-append source "/tests") |
66 | "./tests") | |
262f904e EF |
67 | (with-directory-excursion "tests" |
68 | (substitute* "Makefile" | |
9a05da36 GLV |
69 | (("../libi2pd/") (string-append source "/libi2pd/")) |
70 | ;; Disable the x25519 test, which only compiles if | |
71 | ;; openssl doesn't have X25519 support, but the | |
72 | ;; version we use has it. | |
73 | (("test-base-64 test-x25519 test-aeadchacha20poly1305") | |
74 | "test-base-64 test-aeadchacha20poly1305")) | |
262f904e EF |
75 | (apply invoke "make" "all" |
76 | `(,@(if parallel-tests? | |
77 | `("-j" ,(number->string | |
78 | (parallel-job-count))) | |
79 | '()) | |
80 | ,@make-flags)))))) | |
2fba90a8 JK |
81 | (add-after 'install 'install-headers |
82 | (lambda* (#:key outputs #:allow-other-keys) | |
83 | (let* ((install-dir (assoc-ref outputs "out")) | |
84 | (src-dir (string-append install-dir "/src")) | |
85 | (include-dir | |
86 | (string-append install-dir "/include"))) | |
87 | (mkdir-p include-dir) | |
88 | ;; This is the only header file that's relevant to the | |
89 | ;; public interface. | |
90 | ;; <https://github.com/PurpleI2P/i2pd/issues/1378> | |
91 | (install-file (string-append src-dir "/api.h") | |
92 | include-dir) | |
93 | #t))) | |
94 | (add-after 'install-headers 'remove-source | |
95 | (lambda* (#:key outputs #:allow-other-keys) | |
96 | (let* ((install-dir (assoc-ref outputs "out")) | |
97 | (src-dir (string-append install-dir "/src"))) | |
98 | (delete-file-recursively src-dir) | |
99 | (delete-file (string-append install-dir | |
100 | "/LICENSE")) | |
101 | #t)))))) | |
102 | (home-page "https://i2pd.website/") | |
103 | (synopsis "Router for an end-to-end encrypted and anonymous internet") | |
104 | (description "i2pd is a client for the anonymous I2P network, upon which | |
105 | applications for file sharing, web browsing, instant messaging, and more are | |
106 | built. i2pd allows people from all around the world to communicate and share | |
107 | information securely without restrictions.") | |
108 | (license license:bsd-3))) |