Merge branch 'master' into core-updates
[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 ;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages upnp)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages gettext)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages video)
28 #:use-module (gnu packages photo)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages mp3)
31 #:use-module (gnu packages xiph)
32 #:use-module (gnu packages sqlite)
33 #:use-module (gnu packages python)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix utils)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix licenses)
39 #:use-module (guix packages)
40 #:use-module (ice-9 match))
41
42 (define-public miniupnpc
43 (package
44 (name "miniupnpc")
45 (version "2.1.20190824")
46 (source
47 (origin
48 (method url-fetch)
49 (uri (string-append "https://miniupnp.tuxfamily.org/files/"
50 name "-" version ".tar.gz"))
51 (sha256
52 (base32 "0rg1i51lnyq8zgflhcg981kq4348vgq03ndmbgiv7knd1vmfzb8z"))))
53 (build-system gnu-build-system)
54 (native-inputs
55 `(("python" ,python-2)))
56 (arguments
57 ;; The build system does not use a configure script but depends on
58 ;; `make'. Hence we should pass parameters to `make' instead and remove
59 ;; the configure phase.
60 '(#:make-flags
61 (list
62 (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh")
63 (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out"))
64 "CC=gcc"
65
66 ;; Allow executables to find libminiupnpc.so.
67 (string-append "LDFLAGS=-Wl,-rpath="
68 (assoc-ref %outputs "out") "/lib"))
69 #:phases
70 (modify-phases %standard-phases
71 (delete 'configure)
72 (add-before 'install 'qualify-paths
73 (lambda* (#:key outputs #:allow-other-keys)
74 (substitute* "external-ip.sh"
75 (("upnpc")
76 (string-append (assoc-ref outputs "out") "/bin/upnpc")))
77 #t)))))
78 (home-page "http://miniupnp.free.fr/")
79 (synopsis "UPnP protocol client library")
80 (description
81 "The MiniUPnPc client library facilitates access to the services provided
82 by any @dfn{Universal Plug and Play} (UPnP) @dfn{Internet Gateway Device} (IGD)
83 present on the network. In UPnP terminology, MiniUPnPc is a UPnP Control Point.
84
85 It is useful whenever an application needs to listen for incoming connections
86 while running behind a UPnP-enabled router or firewall. Such applications
87 include peer-to-peer applications, active-mode FTP clients, DCC file transfers
88 over IRC, instant messaging, network games, and most server software.")
89 (license
90 (x11-style "file://LICENSE" "See 'LICENSE' file in the distribution"))))
91
92 (define-public monero-miniupnpc
93 ;; This package is the bundled version of miniupnpc used with monero.
94 ;; Monero-project has been maintaining its own version of the package since
95 ;; release 0.12.2.0. It includes security fixes not included in upstream
96 ;; releases.
97 (let ((revision "0")
98 (commit "6a63f9954959119568fbc4af57d7b491b9428d87"))
99 (package
100 (inherit miniupnpc)
101 (name "miniupnpc-monero")
102 (version (string-append "2.1-monero-0.12.3.0-" revision "."
103 (string-take commit 7)))
104 (source (origin
105 (method git-fetch)
106 (uri (git-reference
107 (url "https://github.com/monero-project/miniupnp/")
108 (commit commit)))
109 (sha256
110 (base32
111 "0s67zcz978iapjlq30yy9dl8qda9xhrl3jdi5f99cnbglh5gy16a"))
112 (file-name (string-append name "-" version "-checkout"))
113 (modules '((guix build utils)))
114 (snippet
115 '(begin
116 ;; Delete miniupnp subprojects except for miniupnpc.
117 (for-each
118 delete-file-recursively
119 '("minissdpd" "miniupnpc-async" "miniupnpc-libevent"
120 "miniupnpd" ))
121 #t))))
122 (arguments
123 (substitute-keyword-arguments (package-arguments miniupnpc)
124 ((#:phases phases)
125 `(modify-phases ,phases
126 (add-before 'build 'change-directory
127 (lambda _
128 (chdir "miniupnpc")
129 #t))
130 (add-after 'change-directory 'chmod-header-file
131 (lambda _
132 (chmod "miniupnpc.h" #o644)
133 #t)))))))))
134
135 (define-public libupnp
136 (package
137 (name "libupnp")
138 (version "1.6.25")
139 (source
140 (origin
141 (method url-fetch)
142 (uri (string-append "mirror://sourceforge/pupnp/pupnp/libUPnP%20"
143 version "/" name "-" version ".tar.bz2"))
144 (sha256
145 (base32
146 "0hzsd7rvfa87b4hxg9yj4xhdfxx9sp09r9sqdl3mqhvmcyw018y5"))))
147 (build-system gnu-build-system)
148 (arguments
149 ;; The tests require a network device capable of multicasting which is
150 ;; not available in the build environment. See
151 ;; https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00312.html.
152 `(#:tests? #f
153 #:configure-flags '("--enable-ipv6")))
154 (home-page "http://pupnp.sourceforge.net")
155 (synopsis "Portable SDK for UPnP Devices")
156 (description
157 "The portable SDK for UPnP Devices (libupnp) provides developers with an
158 API and code for building control points, devices, and bridges that are
159 compliant with Version 1.0 of the Universal Plug and Play Device Architecture
160 Specification and support several operating systems like Linux, *BSD, Solaris
161 and others.")
162 (license bsd-3)))
163
164 (define-public readymedia
165 (package
166 (name "readymedia")
167 (version "1.2.1")
168 (source
169 (origin
170 (method git-fetch)
171 (uri (git-reference
172 (url "https://git.code.sf.net/p/minidlna/git")
173 (commit (string-append
174 "v"
175 (string-map (match-lambda
176 (#\. #\_)
177 (chr chr))
178 version)))))
179 (file-name (git-file-name name version))
180 (sha256
181 (base32
182 "160915yv38k0p5zmyncs12kkbbcd8m8fk9jq70fkfd5x6dz40xm4"))))
183 (build-system gnu-build-system)
184 (native-inputs
185 `(("automake" ,automake)
186 ("autoconf" ,autoconf)
187 ("gettext" ,gettext-minimal)))
188 (inputs
189 `(("libexif" ,libexif)
190 ("libjpeg" ,libjpeg)
191 ("libid3tag" ,libid3tag)
192 ("flac" ,flac)
193 ("libvorbis" ,libvorbis)
194 ("sqlite" ,sqlite)
195 ("ffmpeg" ,ffmpeg)))
196 (home-page "https://sourceforge.net/projects/minidlna/")
197 (synopsis "DLNA/UPnP-AV media server")
198 (description "ReadyMedia (formerly known as MiniDLNA) is a simple media
199 server, which serves multimedia content to compatible clients on the network.
200 It aims to be fully compliant with DLNA and UPnP-AV standards.")
201 (license gpl2)))