summaryrefslogtreecommitdiff
path: root/packages/ejabberd.scm
blob: 22e7621aaab9b2266377fc0226f4c14ff1a5c37b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
(define-module (gnu packages ejabberd)
               #:use-module (guix packages)
               #:use-module (guix git-download)
               #:use-module (guix download)
               #:use-module (guix build-system gnu)
               #:use-module (gnu packages erlang)
               #:use-module (gnu packages web)
               #:use-module (gnu packages imagemagick)
               #:use-module (gnu packages gd)
               #:use-module (gnu packages openldap)
               #:use-module (gnu packages databases)
               #:use-module (gnu packages xml)
               #:use-module (gnu packages compression)
               #:use-module (gnu packages tls)
               #:use-module (gnu packages autotools)
               #:use-module (gnu packages perl)
               #:use-module (gnu packages version-control)
               #:use-module ((guix licenses) #:prefix license:)
               )

; NOTE: we use rebar 2.x version bundled with ejabberd to build ejabberd deps
(define-public erlang-rebar2-bin
               (package
                 (name "erlang-rebar2-bin")
                 (version "2.6.4-ejabberd")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/processone/ejabberd")
                                  (commit "21.01")))
                           (sha256
                             (base32 "0fyxfwgqw72i4nz5g5nw79h6d4f6kw5r2mzh7c2s3npv7kx4zvry"))))
                 (build-system gnu-build-system)
                 (arguments
                   `(#:phases
                     (modify-phases %standard-phases
                                    (delete 'configure)
                                    (delete 'build)
                                    (delete 'check)
                                    (delete 'bootstrap)
                                    (replace 'install
                                             (lambda* (#:key inputs outputs #:allow-other-keys)
                                                      (let* ((out (assoc-ref outputs "out"))
                                                             (bin (string-append out "/bin")))
                                                        (install-file "rebar" bin)
                                                        )
                                                      #t)
                                             )
                                    )))
                 (native-inputs
                   `(
                     ("erlang" ,erlang)
                     ))
                 (license license:asl2.0)
                 (synopsis "rebar is an Erlang build tool that makes it easy to compile and test Erlang applications, port drivers and releases.")
                 (description "rebar is a self-contained Erlang script, so it's easy to distribute or even embed directly in a project. Where possible, rebar uses standard Erlang/OTP conventions for project structures, thus minimizing the amount of build configuration work. rebar also provides dependency management, enabling application writers to easily re-use common libraries from a variety of locations (git, hg, etc).")
                 (home-page "https://github.com/rebar/rebar")
                 ))

(define-public erlang-base64url
               (package
                 (name "erelang-base64url")
                 (version "1.0.1")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/dvv/base64url")
                                  (commit version)))
                           (sha256
                             (base32 "0467cydxlx1fww1rmn2hjiyhwyszvrngc4x9mg3dkihr7jc5hsaa"))))
                 (build-system gnu-build-system)
                 (arguments
                   `(#:phases
                     (modify-phases %standard-phases
                                    (delete 'configure)
                                    (replace 'install
                                             (lambda* (#:key inputs outputs #:allow-other-keys)
                                                      (let* ((out (assoc-ref outputs "out"))
                                                             (lib (string-append out "/lib/base64url-" ,version "/ebin")))
                                                        (copy-recursively "ebin" lib)
                                                        )
                                                      #t)
                                             )
                                    )))
                 (native-inputs
                   `(
                     ("erlang" ,erlang)
                     ("erlang-rebar2" ,erlang-rebar2-bin)
                     ))
                 (synopsis "Standalone URL safe base64-compatible codec.")
                 (description "Standalone URL safe base64-compatible codec.")
                 (license (list
                            license:bsd-4
                                ))
                 (home-page "https://github.com/dvv/base64url")
                 ))


(define-public ejabberd
               (package
                 (name "ejabberd")
                 (version "21.01")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/processone/ejabberd")
                                  (commit version)))
                           (sha256
                             (base32 "0fyxfwgqw72i4nz5g5nw79h6d4f6kw5r2mzh7c2s3npv7kx4zvry"))))
                 (build-system gnu-build-system)
                 (arguments
                   `(#:phases
                     (modify-phases %standard-phases
                                    (add-before 'configure 'fix-bin/sh
                                                (lambda _
                                                  (substitute* "configure"
                                                               (("#!/bin/sh") (string-append "#!" (which "sh")))
                                                               ((" = /bin/sh") (string-append " = " (which "sh")))
                                                               )
                                                  )
                                                )
                                    )
                     #:configure-flags
                     (list "--enable-stun"
                           "--enable-system-deps"
                           "--enable-mysql"
                           "--enable-odbc"
                           "--enable-pgsql"
                           "--enable-zlib"
                      )
                     )
                   )
                 (native-inputs
                   `(
                     ("erlang" ,erlang)
                     ("autoconf" ,autoconf)
                     ("automake" ,automake)
                     ("perl" ,perl)
                     ("git" ,git)
                     ))
                 (inputs
                   `(
                     ("erlang" ,erlang)
                     ("erlang-base64url" ,erlang-base64url)
                     ("expat" ,expat )
                     ("libyaml" ,libyaml)
                     ("zlib" ,zlib)
                     ("imagemagick" ,imagemagick)
                     ("gd" ,gd)
                     ("openldap" ,openldap)
                     ("unixodbc" ,unixodbc)
                     ("openssl" ,openssl)
                     ))
                 (synopsis "A scalable and reliable platform for instant messaging")
                 (description "ejabberd is a distributed, fault-tolerant technology that allows the creation of large-scale instant messaging applications. The server can reliably support thousands of simultaneous users on a single node and has been designed to provide exceptional standards of fault tolerance. As an open source technology, based on industry-standards, ejabberd can be used to build bespoke solutions very cost effectively")
                 (license (list
                            license:gpl2
                                ))
                 (home-page "https://www.ejabberd.im")
                 ))
ejabberd