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