gnu: Add wl-clipboard.
[jackhill/guix/guix.git] / gnu / packages / upnp.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Theodoros Foradis <theodoros@foradis.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages upnp)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages python)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix utils)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix licenses)
30 #:use-module (guix packages))
31
32 (define-public miniupnpc
33 (package
34 (name "miniupnpc")
35 (version "2.1")
36 (source
37 (origin
38 (method url-fetch)
39 (uri (string-append "https://miniupnp.tuxfamily.org/files/"
40 name "-" version ".tar.gz"))
41 (sha256
42 (base32 "1ik440yspbp3clr4m01xsl9skwyrzcvzb5nbm3i0g9x53vhbb7z1"))))
43 (build-system gnu-build-system)
44 (native-inputs
45 `(("python" ,python-2)))
46 (arguments
47 ;; The build system does not use a configure script but depends on
48 ;; `make'. Hence we should pass parameters to `make' instead and remove
49 ;; the configure phase.
50 '(#:make-flags
51 (list
52 (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh")
53 (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out"))
54 "CC=gcc"
55
56 ;; Allow executables to find libminiupnpc.so.
57 (string-append "LDFLAGS=-Wl,-rpath="
58 (assoc-ref %outputs "out") "/lib"))
59 #:phases
60 (modify-phases %standard-phases
61 (delete 'configure)
62 (add-before 'install 'qualify-paths
63 (lambda* (#:key outputs #:allow-other-keys)
64 (substitute* "external-ip.sh"
65 (("upnpc")
66 (string-append (assoc-ref outputs "out") "/bin/upnpc")))
67 #t)))))
68 (home-page "http://miniupnp.free.fr/")
69 (synopsis "UPnP protocol client library")
70 (description
71 "The MiniUPnPc client library facilitates access to the services provided
72 by any @dfn{Universal Plug and Play} (UPnP) @dfn{Internet Gateway Device} (IGD)
73 present on the network. In UPnP terminology, MiniUPnPc is a UPnP Control Point.
74
75 It is useful whenever an application needs to listen for incoming connections
76 while running behind a UPnP-enabled router or firewall. Such applications
77 include peer-to-peer applications, active-mode FTP clients, DCC file transfers
78 over IRC, instant messaging, network games, and most server software.")
79 (license
80 (x11-style "file://LICENSE" "See 'LICENSE' file in the distribution"))))
81
82 (define-public monero-miniupnpc
83 ;; This package is the bundled version of miniupnpc used with monero.
84 ;; Monero-project has been maintaining its own version of the package since
85 ;; release 0.12.2.0. It includes security fixes not included in upstream
86 ;; releases.
87 (let ((revision "0")
88 (commit "6a63f9954959119568fbc4af57d7b491b9428d87"))
89 (package
90 (inherit miniupnpc)
91 (name "miniupnpc-monero")
92 (version (string-append "2.1-monero-0.12.3.0-" revision "."
93 (string-take commit 7)))
94 (source (origin
95 (method git-fetch)
96 (uri (git-reference
97 (url "https://github.com/monero-project/miniupnp/")
98 (commit commit)))
99 (sha256
100 (base32
101 "0s67zcz978iapjlq30yy9dl8qda9xhrl3jdi5f99cnbglh5gy16a"))
102 (file-name (string-append name "-" version "-checkout"))
103 (modules '((guix build utils)))
104 (snippet
105 '(begin
106 ;; Delete miniupnp subprojects except for miniupnpc.
107 (for-each
108 delete-file-recursively
109 '("minissdpd" "miniupnpc-async" "miniupnpc-libevent"
110 "miniupnpd" ))
111 #t))))
112 (arguments
113 (substitute-keyword-arguments (package-arguments miniupnpc)
114 ((#:phases phases)
115 `(modify-phases ,phases
116 (add-before 'build 'change-directory
117 (lambda _
118 (chdir "miniupnpc")
119 #t))
120 (add-after 'change-directory 'chmod-header-file
121 (lambda _
122 (chmod "miniupnpc.h" #o644)
123 #t)))))))))
124
125 (define-public libupnp
126 (package
127 (name "libupnp")
128 (version "1.6.24")
129 (source
130 (origin
131 (method url-fetch)
132 (uri (string-append "mirror://sourceforge/pupnp/pupnp/libUPnP%20"
133 version "/" name "-" version ".tar.bz2"))
134 (sha256
135 (base32
136 "15ngi1i7cvsv7g15fb9bkswvi99d1plz52x5qgjn4h5vyfddg0vx"))))
137 (build-system gnu-build-system)
138 (arguments
139 ;; The tests require a network device capable of multicasting which is
140 ;; not available in the build environment. See
141 ;; https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00312.html.
142 `(#:tests? #f
143 #:configure-flags '("--enable-ipv6")))
144 (home-page "http://pupnp.sourceforge.net")
145 (synopsis "Portable SDK for UPnP Devices")
146 (description
147 "The portable SDK for UPnP Devices (libupnp) provides developers with an
148 API and code for building control points, devices, and bridges that are
149 compliant with Version 1.0 of the Universal Plug and Play Device Architecture
150 Specification and support several operating systems like Linux, *BSD, Solaris
151 and others.")
152 (license bsd-3)))