gnu: miniupnpc: Update to 2.0.
[jackhill/guix/guix.git] / gnu / packages / psyc.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 ng0 <ngillmann@runbox.com>
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 psyc)
20 #:use-module (guix download)
21 #:use-module (guix git-download)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix build-system perl)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages admin)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages man)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pcre)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages tls)
39 #:use-module (gnu packages web))
40
41 (define-public perl-net-psyc
42 (package
43 (name "perl-net-psyc")
44 (version "1.1")
45 (source
46 (origin
47 (method url-fetch)
48 (uri (string-append "http://perlpsyc.psyc.eu/"
49 "perlpsyc-" version ".zip"))
50 (file-name (string-append name "-" version ".zip"))
51 (sha256
52 (base32
53 "1lw6807qrbmvzbrjn1rna1dhir2k70xpcjvyjn45y35hav333a42"))
54 ;; psycmp3 currently depends on MP3::List and rxaudio (shareware),
55 ;; we can add it back when this is no longer the case.
56 (snippet '(delete-file "contrib/psycmp3"))))
57 (build-system perl-build-system)
58 (inputs
59 `(("perl-curses" ,perl-curses)
60 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
61 (arguments
62 `(#:phases
63 (modify-phases %standard-phases
64 (delete 'configure) ; No configure script
65 ;; There is a Makefile, but it does not install everything
66 ;; (leaves out psycion) and says
67 ;; "# Just to give you a rough idea". XXX: Fix it upstream.
68 (replace 'build
69 (lambda _
70 (zero? (system* "make" "manuals"))))
71 (replace 'install
72 (lambda* (#:key outputs #:allow-other-keys)
73 (let* ((out (assoc-ref outputs "out"))
74 (doc (string-append out "/share/doc/perl-net-psyc"))
75 (man1 (string-append out "/share/man/man1"))
76 (man3 (string-append out "/share/man/man3"))
77 (bin (string-append out "/bin"))
78 (libpsyc (string-append out "/lib/psyc/ion"))
79 (libperl (string-append out "/lib/perl5/site_perl/"
80 ,(package-version perl))))
81
82 (copy-recursively "lib/perl5" libperl)
83 (copy-recursively "lib/psycion" libpsyc)
84 (copy-recursively "bin" bin)
85 (install-file "cgi/psycpager" (string-append doc "/cgi"))
86 (copy-recursively "contrib" (string-append doc "/contrib"))
87 (copy-recursively "hooks" (string-append doc "/hooks"))
88 (copy-recursively "sdj" (string-append doc "/sdj"))
89 (install-file "README.txt" doc)
90 (install-file "TODO.txt" doc)
91 (copy-recursively "share/man/man1" man1)
92 (copy-recursively "share/man/man3" man3)
93 #t)))
94 (add-after 'install 'wrap-programs
95 (lambda* (#:key outputs #:allow-other-keys)
96 ;; Make sure all executables in "bin" find the Perl modules
97 ;; provided by this package at runtime.
98 (let* ((out (assoc-ref outputs "out"))
99 (bin (string-append out "/bin/"))
100 (path (getenv "PERL5LIB")))
101 (for-each (lambda (file)
102 (wrap-program file
103 `("PERL5LIB" ":" prefix (,path))))
104 (find-files bin "\\.*$"))
105 #t))))))
106 (description
107 "@code{Net::PSYC} with support for TCP, UDP, Event.pm, @code{IO::Select} and
108 Gtk2 event loops. This package includes 12 applications and additional scripts:
109 psycion (a @uref{http://about.psyc.eu,PSYC} chat client), remotor (a control console
110 for @uref{https://torproject.org,tor} router) and many more.")
111 (synopsis "Perl implementation of PSYC protocol")
112 (home-page "http://perlpsyc.psyc.eu/")
113 (license (list license:gpl2
114 (package-license perl)
115 ;; contrib/irssi-psyc.pl:
116 license:public-domain
117 ;; bin/psycplay states AGPL with no version:
118 license:agpl3+))))
119
120 (define-public libpsyc
121 (package
122 (name "libpsyc")
123 (version "20160913")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "http://www.psyced.org/files/"
127 name "-" version ".tar.xz"))
128 (sha256
129 (base32
130 "14q89fxap05ajkfn20rnhc6b1h4i3i2adyr7y6hs5zqwb2lcmc1p"))))
131 (build-system gnu-build-system)
132 (native-inputs
133 `(("perl" ,perl)
134 ("netcat" ,netcat)
135 ("procps" ,procps)))
136 (arguments
137 `(#:make-flags
138 (list "CC=gcc"
139 (string-append "PREFIX=" (assoc-ref %outputs "out")))
140 #:phases
141 (modify-phases %standard-phases
142 ;; The rust bindings are the only ones in use, the lpc bindings
143 ;; are in psyclpc. The other bindings are not used by anything,
144 ;; the chances are high that the bindings do not even work,
145 ;; therefore we do not include them.
146 ;; TODO: Get a cargo build system in Guix.
147 (delete 'configure)))) ; no configure script
148 (home-page "http://about.psyc.eu/libpsyc")
149 (description
150 "@code{libpsyc} is a PSYC library in C which implements
151 core aspects of PSYC, useful for all kinds of clients and servers
152 including psyced.")
153 (synopsis "PSYC library in C")
154 (license license:agpl3+)))
155
156 ;; This commit removes the historic bundled pcre, not released as a tarball so far.
157 (define-public psyclpc
158 (let* ((commit "8bd51f2a4847860ba8b82dc79348ab37d516011e")
159 (revision "1"))
160 (package
161 (name "psyclpc")
162 (version (string-append "20160821-" revision "." (string-take commit 7)))
163 (source (origin
164 (method git-fetch)
165 (uri (git-reference
166 (url "git://git.psyced.org/git/psyclpc")
167 (commit commit)))
168 (file-name (string-append name "-" version "-checkout"))
169 (sha256
170 (base32
171 "10w4kx9ygcv1lcmd7j4knvjiy8dac1y3hjfv3lhp67jpv6w3iagz"))))
172 (build-system gnu-build-system)
173 (arguments
174 `(#:tests? #f ; There are no tests/checks.
175 #:configure-flags
176 ;; If you have questions about this part, look at
177 ;; "src/settings/psyced" and the ebuild.
178 (list
179 "--enable-use-tls=yes"
180 "--enable-use-mccp" ; Mud Client Compression Protocol, leave this enabled.
181 (string-append "--prefix="
182 (assoc-ref %outputs "out"))
183 ;; src/Makefile: Set MUD_LIB to the directory which contains
184 ;; the mud data. defaults to MUD_LIB = @libdir@
185 (string-append "--libdir="
186 (assoc-ref %outputs "out")
187 "/opt/psyced/world")
188 (string-append "--bindir="
189 (assoc-ref %outputs "out")
190 "/opt/psyced/bin")
191 ;; src/Makefile: Set ERQ_DIR to directory which contains the
192 ;; stuff which ERQ can execute (hopefully) savely. Was formerly
193 ;; defined in config.h. defaults to ERQ_DIR= @libexecdir@
194 (string-append "--libexecdir="
195 (assoc-ref %outputs "out")
196 "/opt/psyced/run"))
197 #:phases
198 (modify-phases %standard-phases
199 (add-before 'configure 'chdir-to-src
200 ;; We need to pass this as env variables
201 ;; and manually change the directory.
202 (lambda _
203 (chdir "src")
204 (setenv "CONFIG_SHELL" (which "sh"))
205 (setenv "SHELL" (which "sh"))
206 #t)))
207 #:make-flags (list "install-all")))
208 (inputs
209 `(("zlib" ,zlib)
210 ("openssl" ,openssl)
211 ("pcre" ,pcre)))
212 (native-inputs
213 `(("pkg-config" ,pkg-config)
214 ("bison" ,bison)
215 ("gettext" ,gettext-minimal)
216 ("help2man" ,help2man)
217 ("autoconf" ,autoconf)
218 ("automake" ,automake)))
219 (home-page "http://lpc.psyc.eu/")
220 (synopsis "psycLPC is a multi-user network server programming language")
221 (description
222 "LPC is a bytecode language, invented to specifically implement
223 multi user virtual environments on the internet. This technology is used for
224 MUDs and also the psyced implementation of the Protocol for SYnchronous
225 Conferencing (PSYC). psycLPC is a fork of LDMud with some new features and
226 many bug fixes.")
227 (license license:gpl2))))