| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org> |
| 3 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
| 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) |
| 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") |
| 33 | (version "2.36.0") |
| 34 | (source |
| 35 | (origin |
| 36 | (method git-fetch) |
| 37 | (uri (git-reference |
| 38 | (url "https://github.com/PurpleI2P/i2pd") |
| 39 | (commit version))) |
| 40 | (file-name (git-file-name name version)) |
| 41 | (sha256 |
| 42 | (base32 "0gx7y0vrg9lsl7m1r6c8xyyqmaqn900kms4g0941g0gd5zdb0mvz")))) |
| 43 | (build-system cmake-build-system) |
| 44 | (inputs `(("boost" ,boost) |
| 45 | ("miniupnpc" ,miniupnpc) |
| 46 | ("openssl" ,openssl) |
| 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" |
| 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) |
| 64 | (let ((source (assoc-ref %build-inputs "source"))) |
| 65 | (copy-recursively (string-append source "/tests") |
| 66 | "./tests") |
| 67 | (with-directory-excursion "tests" |
| 68 | (substitute* "Makefile" |
| 69 | (("../libi2pd/") (string-append source "/libi2pd/"))) |
| 70 | (apply invoke "make" "all" |
| 71 | `(,@(if parallel-tests? |
| 72 | `("-j" ,(number->string |
| 73 | (parallel-job-count))) |
| 74 | '()) |
| 75 | ,@make-flags))))))))) |
| 76 | (home-page "https://i2pd.website/") |
| 77 | (synopsis "Router for an end-to-end encrypted and anonymous internet") |
| 78 | (description "i2pd is a client for the anonymous I2P network, upon which |
| 79 | applications for file sharing, web browsing, instant messaging, and more are |
| 80 | built. i2pd allows people from all around the world to communicate and share |
| 81 | information securely without restrictions.") |
| 82 | (license license:bsd-3))) |