aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/sdl.scm
blob: 03aa56d11860e212f705e4b837ee0b8a178085dc (about) (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 David Thompson <dthompson2@worcester.edu>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages sdl)
  #:use-module (gnu packages)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module ((gnu packages fontutils) #:prefix font:)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages image)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mp3)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xorg)
  #:export (sdl
            sdl2
            libmikmod
            sdl-gfx
            sdl-image
            sdl-mixer
            sdl-net
            sdl-ttf))

(define sdl
  (package
    (name "sdl")
    (version "1.2.15")
    (source (origin
             (method url-fetch)
             (uri
              (string-append "http://libsdl.org/release/SDL-"
                             version ".tar.gz"))
             (sha256
              (base32
               "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))
             (patches (list (search-patch "sdl-libx11-1.6.patch")))))
    (build-system gnu-build-system)
    (arguments
     '(;; Explicitly link against shared libraries instead of dlopening them.
       ;; For X11, ALSA, PulseAudio, etc.
       #:configure-flags '("--disable-sdl-dlopen")

       #:tests? #f)) ; no check target
    (propagated-inputs
     ;; SDL headers include X11 headers.
     `(("libx11" ,libx11)
       ("libcap" ,libcap))) ; 'libSDL.la' contain `-lcap'.
    (native-inputs `(("pkg-config" ,pkg-config)))
    (inputs `(("libxrandr" ,libxrandr)
              ("mesa" ,mesa)
              ("alsa-lib" ,alsa-lib)
              ("pulseaudio" ,pulseaudio)))
    (synopsis "Cross platform game development library")
    (description "Simple DirectMedia Layer is a cross-platform development
library designed to provide low level access to audio, keyboard, mouse,
joystick, and graphics hardware.")
    (home-page "http://libsdl.org/")
    (license lgpl2.1)))

(define sdl2
  (package (inherit sdl)
    (name "sdl2")
    (version "2.0.3")
    (source (origin
             (method url-fetch)
             (uri
              (string-append "http://libsdl.org/release/SDL2-"
                             version ".tar.gz"))
             (sha256
              (base32
               "0369ngvb46x6c26h8zva4x22ywgy6mvn0wx87xqwxg40pxm9m9m5"))))
    (license bsd-3)))

(define libmikmod
  (package
    (name "libmikmod")
    (version "3.3.7")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://sourceforge/mikmod/libmikmod/"
                                 version "/libmikmod-" version ".tar.gz"))
             (sha256
              (base32
               "18nrkf5l50hfg0y50yxr7bvik9f002lhn8c00nbcp6dgm5011x2c"))))
    (build-system gnu-build-system)
    (arguments
     ;; By default, libmikmod tries to dlopen libasound etc., which won't work
     ;; unless the right libalsa happens to be in $LD_LIBRARY_PATH.  Pass
     ;; '--disable-dl' to avoid that.
     '(#:configure-flags '("--disable-dl")))
    (synopsis "Library for module sound formats")
    (description
     "MikMod is able to play a wide range of module formats, as well as
digital sound files.  It can take advantage of particular features of your
system, such as sound redirection over the network.")
    (license lgpl2.1)
    (home-page "http://mikmod.sourceforge.net/")))

(define sdl-gfx
  (package
    (name "sdl-gfx")
    (version "2.0.24")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-"
                              version ".tar.gz"))
              (sha256
               (base32
                "064islldm4r42lgj9fr4kbk66r7jmmakk9745hhyb1kmw71kib9h"))))
    (build-system gnu-build-system)
    (propagated-inputs `(("sdl" ,sdl)))
    (synopsis "SDL graphics primitives library")
    (description "SDL_gfx provides graphics drawing primitives, rotozoom and
other supporting functions for SDL.")
    (home-page "http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx")
    (license zlib)

    ;; The code apparently includes Intel assembly, which fails to build on
    ;; MIPS, at least.
    (supported-systems '("i686-linux" "x86_64-linux"))))

(define sdl-image
  (package
    (name "sdl-image")
    (version "1.2.12")
    (source (origin
             (method url-fetch)
             (uri
              (string-append "http://www.libsdl.org/projects/SDL_image/release/SDL_image-"
                             version ".tar.gz"))
             (sha256
              (base32
               "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"))))
    (build-system gnu-build-system)
    (arguments
     ;; Explicitly link against shared libraries instead of dlopening them.
     '(#:configure-flags '("--disable-jpg-shared"
                           "--disable-png-shared"
                           "--disable-tif-shared"
                           "--disable-webp-shared")))
    (native-inputs `(("pkg-config" ,pkg-config)))
    ;; FIXME: Add webp
    ;;
    ;; libjpeg, libpng, and libtiff are propagated inputs because the
    ;; SDL_image headers include the headers of these libraries.  SDL is a
    ;; propagated input because the pkg-config file refers to SDL's pkg-config
    ;; file.
    (propagated-inputs `(("sdl" ,sdl)
                         ("libjpeg" ,libjpeg)
                         ("libpng" ,libpng)
                         ("libtiff" ,libtiff)))
    (synopsis "SDL image loading library")
    (description "SDL_image is an image file loading library for SDL that
supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
WEBP, XCF, XPM, and XV.")
    (home-page "http://www.libsdl.org/projects/SDL_image/")
    (license zlib)))

(define sdl-mixer
  (package
    (name "sdl-mixer")
    (version "1.2.12")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
                              version ".tar.gz"))
              (sha256
               (base32
                "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
    (build-system gnu-build-system)
    ;; no check target
    ;; use libmad instead of smpeg
    ;; explicitly link against shared libraries instead of dlopening them
    (arguments `(#:tests? #f
                 #:configure-flags '("--enable-music-mp3-mad-gpl"
                                     "--disable-music-mod-shared"
                                     "--disable-music-fluidsynth-shared"
                                     "--disable-music-ogg-shared"
                                     "--disable-music-flac-shared"
                                     "--disable-music-mp3-shared")))
    (inputs `(("libvorbis" ,libvorbis)
              ("libflac" ,flac)
              ("libmad" ,libmad)
              ("libmikmod" ,libmikmod)))
    ;; FIXME: Add libfluidsynth
    (propagated-inputs `(("sdl" ,sdl)))
    (synopsis "SDL multi-channel audio mixer library")
    (description "SDL_mixer is a multi-channel audio mixer library for SDL.
It supports any number of simultaneously playing channels of 16 bit stereo
audio, plus a single channel of music.  Supported format include FLAC, MOD,
MIDI, Ogg Vorbis, and MP3.")
    (home-page "http://www.libsdl.org/projects/SDL_mixer/")
    (license zlib)))

(define sdl-net
  (package
    (name "sdl-net")
    (version "1.2.8")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "http://www.libsdl.org/projects/SDL_net/release/SDL_net-"
                              version ".tar.gz"))
              (sha256
               (base32
                "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
    (build-system gnu-build-system)
    (propagated-inputs `(("sdl" ,sdl)))
    (native-inputs `(("pkg-config" ,pkg-config)))
    (synopsis "SDL networking library")
    (description "SDL_net is a small, cross-platform networking library for
SDL.")
    (home-page "http://www.libsdl.org/projects/SDL_net/")
    (license zlib)))

(define sdl-ttf
  (package
    (name "sdl-ttf")
    (version "2.0.11")
    (source (origin
             (method url-fetch)
             (uri
              (string-append "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
                             version ".tar.gz"))
             (sha256
              (base32
               "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
    (build-system gnu-build-system)
    (propagated-inputs `(("sdl" ,sdl)))
    (inputs `(("freetype" ,font:freetype)
              ("mesa" ,mesa)))
    (native-inputs `(("pkg-config" ,pkg-config)))
    (synopsis "SDL TrueType font library")
    (description "SDL_ttf is a TrueType font rendering library for SDL.")
    (home-page "http://www.libsdl.org/projects/SDL_ttf/")
    (license zlib)))

(define sdl-union
  (package
    (name "sdl-union")
    (version (package-version sdl))
    (source #f)
    (build-system trivial-build-system)
    (arguments
     '(#:modules ((guix build union))
       #:builder (begin
                   (use-modules (ice-9 match)
                                (guix build union))
                   (match %build-inputs
                     (((names . directories) ...)
                      (union-build (assoc-ref %outputs "out")
                                   directories))))))
    (inputs `(("sdl" ,sdl)
              ("sdl-gfx" ,sdl-gfx)
              ("sdl-image" ,sdl-image)
              ("sdl-mixer" ,sdl-mixer)
              ("sdl-ttf" ,sdl-ttf)))
    (synopsis "Union of all SDL libraries")
    (description
     "A union of SDL and its extension libraries.  A union is required because
sdl-config assumes that all of the headers and libraries are in the same
directory.")
    (home-page (package-home-page sdl))
    (license (package-license sdl))))

(define-public guile-sdl
  (package
    (name "guile-sdl")
    (version "0.5.1")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "mirror://gnu/guile-sdl/guile-sdl-"
                              version ".tar.xz"))
              (sha256
               (base32
                "126n4rd0ydh6i2s11ari5k85iivradlf12zq13b34shf9k1wn5am"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ;; Required by test suite.
       ("xorg-server" ,xorg-server)
       ("libjpeg" ,libjpeg)))
    (inputs
     `(("guile" ,guile-2.0)
       ("sdl-union" ,sdl-union)))
    (arguments
     '(#:configure-flags
       (list (string-append "--with-sdl-prefix="
                            (assoc-ref %build-inputs "sdl-union")))
       #:parallel-build? #f ; parallel build fails
       #:phases
       (alist-cons-before
        'configure 'fix-env-and-patch
        (lambda* (#:key inputs #:allow-other-keys)
          (setenv "GUILE_AUTO_COMPILE" "0")
          ;; SDL_image needs to dlopen libjpeg in the test suite.
          (setenv "LD_LIBRARY_PATH"
                  (string-append (assoc-ref inputs "libjpeg") "/lib"))
          ;; Change the site directory /site/2.0 like Guile expects.
          (substitute* "build-aux/guile-baux/re-prefixed-site-dirs"
            (("\"/site\"") "\"/site/2.0\"")))
        (alist-cons-before
         'check 'start-xorg-server
         (lambda* (#:key inputs #:allow-other-keys)
           ;; The test suite requires a running X server.
           (system (format #f "~a/bin/Xvfb :1 &"
                           (assoc-ref inputs "xorg-server")))
           (setenv "DISPLAY" ":1"))
         %standard-phases))))
    (synopsis "Guile interface for SDL (Simple DirectMedia Layer)")
    (description "Guile-SDL is a set of bindings to the Simple DirectMedia
Layer (SDL).  With them, Guile programmers can have easy access to graphics,
sound and device input (keyboards, joysticks, mice, etc.).")
    (home-page "http://gnu.org/s/guile-sdl")
    (license gpl3+)))
ugins/blowfish/bf_skey.c ;; src/libstrongswan/plugins/blowfish/blowfish_crypter.c ;; src/libstrongswan/plugins/des/des_crypter.c license:bsd-4)))) (define-public vpnc (package (name "vpnc") (version "0.5.3") (source (origin (method url-fetch) (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-" version ".tar.gz")) (sha256 (base32 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6")))) (build-system gnu-build-system) (native-inputs (append (list perl pkg-config vpnc-scripts) (if (%current-target-system) (list this-package) '()))) (inputs (list libgcrypt vpnc-scripts)) (arguments (list #:tests? #f ;; There is no check target #:make-flags #~(list (string-append "CC=" #$(cc-for-target)) (string-append "ETCDIR=" #$output "/etc/vpnc") (string-append "PREFIX=" #$output)) #:phases #~(modify-phases %standard-phases (delete 'configure) ;; No configure script. (add-after 'unpack 'use-store-paths (lambda* (#:key inputs #:allow-other-keys) (let ((vpnc-scripts (assoc-ref inputs "vpnc-scripts"))) (substitute* "config.c" (("/etc/vpnc/vpnc-script") (string-append vpnc-scripts "/etc/vpnc/vpnc-script")))))) (add-after 'unpack 'patch-Makefile (lambda* (#:key target #:allow-other-keys) (let* ((pkg-config #$(pkg-config-for-target)) (includedir (string-append pkg-config " --variable=includedir" " libgcrypt")) (cflags (string-append pkg-config " --cflags" " libgcrypt")) (libdir (string-append pkg-config " --variable=libdir" " libgcrypt")) (libs (string-append pkg-config " --libs" " libgcrypt"))) (substitute* "Makefile" (("\\$\\(shell libgcrypt-config --cflags\\)") (string-append "-I$(shell " includedir ") " "$(shell " cflags ")")) (("\\$\\(shell libgcrypt-config --libs\\)") (string-append "-L$(shell " libdir ") " "$(shell " libs ")"))) ;; When cross-compiling the manpage can't be generated as the ;; Makefile needs to execute the resulting `vpnc' binary. (when target (substitute* "Makefile" (("all : \\$\\(BINS\\) vpnc\\.8 vpnc-script") "all : $(BINS) vpnc-script") (("install -m644 vpnc\\.8.*") "")))))) (add-after 'unpack 'install-manpage (lambda* (#:key native-inputs inputs target #:allow-other-keys) ;; As the manpage is not generated. Instead install it from ;; the input vpnc package. (when target (let* ((vpnc (assoc-ref native-inputs "vpnc")) (man (string-append vpnc "/share/man/man8/vpnc.8.gz")) (output (string-append #$output "/share/man/man8"))) (install-file man output)))))))) (synopsis "Client for Cisco VPN concentrators") (description "vpnc is a VPN client compatible with Cisco's EasyVPN equipment. It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES, 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace. Only \"Universal TUN/TAP device driver support\" is needed in the kernel.") (license (list license:gpl2+ license:bsd-2)) (home-page "https://www.unix-ag.uni-kl.de/~massar/vpnc/"))) (define-public vpnc-scripts (let ((commit "3885f8bbc4ae03fd6da0ada6de12f7223a59595c")) (package (name "vpnc-scripts") (version (string-append "20200925." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "git://git.infradead.org/users/dwmw2/vpnc-scripts.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1pmi4n58q81pmn9arvfixhvv6vkkf3rpwac3hwnwyl882q5q0ccx")))) (build-system gnu-build-system) (inputs (list guile-3.0 ; for the wrapper scripts coreutils grep iproute ; for ‘ip’ net-tools ; for ‘ifconfig’, ‘route’ sed which)) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'use-relative-paths ;; Patch the scripts to work with and use relative paths. (lambda* _ (for-each (lambda (script) (substitute* script (("^PATH=.*") "") (("/usr/s?bin/") "") (("\\[ +-x +([^]]+) +\\]" _ command) (string-append "command -v >/dev/null 2>&1 " command)))) (find-files "." "^vpnc-script")) #t)) (delete 'configure) ; no configure script (replace 'build (lambda _ (invoke "gcc" "-o" "netunshare" "netunshare.c"))) (replace 'install ;; There is no Makefile; manually install the relevant files. (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (etc (string-append out "/etc/vpnc"))) (for-each (lambda (file) (install-file file etc)) (append (find-files "." "^vpnc-script") (list "netunshare" "xinetd.netns.conf"))) #t))) (add-after 'install 'wrap-scripts ;; Wrap scripts with paths to their common hard dependencies. ;; Optional dependencies will need to be installed by the user. (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (guile (search-input-file inputs "bin/guile"))) (for-each (lambda (script) (wrap-script (string-append out "/etc/vpnc/" script) #:guile guile `("PATH" ":" prefix ,(map (lambda (name) (let ((input (assoc-ref inputs name))) (string-append input "/bin:" input "/sbin"))) (list "coreutils" "grep" "iproute2" "net-tools" "sed" "which"))))) (list "vpnc-script-ptrtd" "vpnc-script-sshd" "vpnc-script")) #t)))) #:tests? #f)) ; no tests (home-page "http://git.infradead.org/users/dwmw2/vpnc-scripts.git") (synopsis "Network configuration scripts for Cisco VPN clients") (description "This set of scripts configures routing and name services when invoked by the VPNC or OpenConnect Cisco @dfn{Virtual Private Network} (VPN) clients. The default @command{vpnc-script} automatically configures most common connections, and provides hooks for performing custom actions at various stages of the connection or disconnection process. Alternative scripts are provided for more complicated set-ups, or to serve as an example for writing your own. For example, @command{vpnc-script-sshd} contains the entire VPN in a network namespace accessible only through SSH.") (license license:gpl2+)))) (define-public ocproxy (package (name "ocproxy") (version "1.60") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/cernekee/ocproxy") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "03323nnhb4y9nzwva04mq7xg03dvdrgp689g89f69jqc261skcqx")))) (build-system gnu-build-system) (native-inputs (list autoconf automake)) (inputs (list libevent)) (home-page "https://github.com/cernekee/ocproxy") (synopsis "OpenConnect proxy") (description "User-level @dfn{SOCKS} and port forwarding proxy for OpenConnect based on LwIP. When using ocproxy, OpenConnect only handles network activity that the user specifically asks to proxy, so the @dfn{VPN} interface no longer \"hijacks\" all network traffic on the host.") (license license:bsd-3))) (define-public openconnect (package (name "openconnect") (version "9.12") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/" "openconnect-" version ".tar.gz")) (sha256 (base32 "0gj1nba1pygvcjasqdakxxnx94dwx3l4hzj0dvipbzjdmbixrgm2")))) (build-system gnu-build-system) (arguments (list #:configure-flags #~(list (string-append "--with-vpnc-script=" (search-input-file %build-inputs "etc/vpnc/vpnc-script"))))) (native-inputs (list gettext-minimal pkg-config)) (inputs (list lz4 vpnc-scripts)) (propagated-inputs (list libxml2 gnutls zlib)) (synopsis "Client for Cisco VPN") (description "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500, 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers, and probably others.") (license license:lgpl2.1) (home-page "https://www.infradead.org/openconnect/"))) (define-public openconnect-sso (package (name "openconnect-sso") (version "0.8.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/vlaci/openconnect-sso") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0l214qxhxx214628mcg6rmbzbzna7mxj5l7rah9q4vvcd88ymp39")))) (build-system pyproject-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'patch-openconnect (lambda* (#:key inputs #:allow-other-keys) (substitute* "openconnect_sso/app.py" (("\"openconnect\"") (string-append "\"" (search-input-file inputs "/sbin/openconnect") "\""))))) (add-after 'check 'wrap-qt-process-path (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin/openconnect-sso")) (qt-process-path (search-input-file inputs "/lib/qt5/libexec/QtWebEngineProcess"))) (wrap-program bin #:sh (search-input-file inputs "bin/bash") `("QTWEBENGINEPROCESS_PATH" = (,qt-process-path))))))))) (inputs (list openconnect poetry python-attrs python-colorama python-keyring python-lxml python-prompt-toolkit python-requests python-pyqt python-pyqtwebengine python-pysocks python-pyxdg python-structlog python-toml qtwebengine-5)) (native-inputs (list python-pytest python-pytest-asyncio python-pytest-httpserver)) (home-page "https://github.com/vlaci/openconnect-sso") (synopsis "OpenConnect wrapper script supporting Azure AD (SAMLv2)") (description "This package provides a wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs.") (license license:gpl3))) (define-public openfortivpn (package (name "openfortivpn") (version "1.17.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/adrienverge/openfortivpn") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0an58f0qcyxdx3d5zb5m8vi45a0251b950b5lh16572n8z2g6s2l")))) (build-system gnu-build-system) (native-inputs (list autoconf automake pkg-config)) (inputs ;; ppp < 2.5.0 is required due to ;; <https://github.com/adrienverge/openfortivpn/pull/1148>. (list openssl ppp-2.4.9)) (home-page "https://github.com/adrienverge/openfortivpn") (synopsis "Client for PPP+SSL VPN tunnel services") (description "Openfortivpn is a client for PPP+SSL VPN tunnel services. It spawns a pppd process and operates the communication between the gateway and this process. It is compatible with Fortinet VPNs.") (license license:gpl3+))) (define-public openvpn (package (name "openvpn") (version "2.6.7") (source (origin (method url-fetch) (uri (string-append "https://swupdate.openvpn.org/community/releases/openvpn-" version ".tar.gz")) (sha256 (base32 "04wr0g97nmv81javym8r99mglmb86v1i49xmnmzf938x1cs7g67f")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--enable-iproute2=yes"))) (native-inputs (list iproute pkg-config)) (inputs (append (list lz4 lzo openssl linux-pam) (if (target-linux?) (list libcap-ng) '()))) (home-page "https://openvpn.net/") (synopsis "Virtual private network daemon") (description "OpenVPN implements virtual private network (@dfn{VPN}) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (@dfn{NAT}s) and firewalls.") (license license:gpl2))) (define-public protonvpn-cli (package (name "protonvpn-cli") (version "2.2.6") (source (origin ;; PyPI has a ".whl" file but not a proper source release. ;; Thus, fetch code from Git. (method git-fetch) (uri (git-reference (url "https://github.com/ProtonVPN/linux-cli") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0y7v9ikrmy5dbjlpbpacp08gy838i8z54m8m4ps7ldk1j6kyia3n")))) (build-system python-build-system) (arguments '(#:tests? #f ; no tests in repo #:phases (modify-phases %standard-phases (add-after 'wrap 'wrap-wrapper ;; Wrap entrypoint with paths to its hard dependencies. (lambda* (#:key inputs outputs #:allow-other-keys) (let ((entrypoint (string-append (assoc-ref outputs "out") "/bin/protonvpn"))) (wrap-program entrypoint #:sh (search-input-file inputs "bin/bash") `("PATH" ":" prefix ,(map (lambda (name) (let ((input (assoc-ref inputs name))) (string-append input "/bin:" input "/sbin"))) (list "dialog" "iproute2" "iptables" "ncurses" "openvpn" "procps" "which"))))))) ;; The `protonvpn' script wants to write to `~user' to initialize its ;; logger, so simply setting HOME=/tmp won't cut it. Remove ;; sanity-check. (delete 'sanity-check)))) (native-inputs (list python-docopt)) (inputs (list bash-minimal dialog iproute iptables ncurses openvpn procps python-jinja2 python-pythondialog python-requests which)) (synopsis "Command-line client for ProtonVPN") (description "This is the official command-line interface for ProtonVPN, a secure point-to-point virtual private networking (VPN) service with a gratis tier. It can automatically find and connect to the fastest servers or use Tor over VPN. The gratis tier offers unlimited bandwidth for up to 10 devices.") (home-page "https://github.com/ProtonVPN/linux-cli") (license license:gpl3+))) (define-public tinc (package (name "tinc") (version "1.0.36") (source (origin (method url-fetch) (uri (string-append "https://tinc-vpn.org/packages/" "tinc-" version ".tar.gz")) (sha256 (base32 "021i2sl2mjscbm8g59d7vs74iw3gf0m48wg7w3zhwj6czarkpxs0")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var"))) (inputs (list zlib lzo openssl)) (home-page "https://tinc-vpn.org") (synopsis "Virtual Private Network (VPN) daemon") (description "Tinc is a VPN that uses tunnelling and encryption to create a secure private network between hosts on the internet.") (license license:gpl2+))) (define-public sshuttle (package (name "sshuttle") (version "1.1.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sshuttle/sshuttle") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "01hd7z7gxkc2bjxndnv5dw1x98qcakxli9k8w285iq2b7d786f7f")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-FHS-file-names (lambda _ (substitute* "sshuttle/client.py" (("/usr/bin/env") (which "env"))) (substitute* "sshuttle/ssh.py" (("/bin/sh") "sh"))))))) (native-inputs (list python-setuptools-scm ;; For tests only. python-flake8 python-mock python-poetry-core python-pytest-cov python-pytest-runner)) (home-page "https://github.com/sshuttle/sshuttle") (synopsis "VPN that transparently forwards connections over SSH") (description "sshuttle creates an encrypted virtual private network (VPN) connection to any remote server to which you have secure shell (SSH) access. The only requirement is a suitable version of Python on the server; administrative privileges are required only on the client. Unlike most VPNs, sshuttle forwards entire sessions, not packets, using kernel transparent proxying. This makes it faster and more reliable than SSH's own tunneling and port forwarding features. It can forward both TCP and UDP traffic, including DNS domain name queries.") (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’ (define-public sshoot (package (name "sshoot") (version "1.5.1") (source (origin (method url-fetch) (uri (pypi-uri name version)) (sha256 (base32 "05i54nga4vy660yy9yf6dl376yj0jc51303yr295qk3k9w0k96yd")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'patch-paths (lambda _ (substitute* "sshoot/tests/test_manager.py" (("/bin/sh") (which "sh"))))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "pytest" "-vv" "--pyargs" "sshoot"))))))) (inputs (list python-argcomplete python-prettytable python-pyyaml python-pyxdg python-toolrack)) ;; For tests only. (native-inputs (list python-pytest python-pytest-mock)) (home-page "https://github.com/albertodonato/sshoot") (synopsis "sshuttle VPN session manager") (description "sshoot provides a command-line interface to manage multiple @command{sshuttle} virtual private networks. It supports flexible profiles with configuration options for most of @command{sshuttle}’s features.") (license license:gpl3+))) (define-public badvpn (package (name "badvpn") (version "1.999.130") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ambrop72/badvpn") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0rm67xhi7bh3yph1vh07imv5y1pwyldvw3wa5bz471g8mnkc7d3c")))) (build-system cmake-build-system) (arguments '(#:tests? #f)) ; no tests (inputs (list nspr nss openssl)) (native-inputs (list pkg-config)) (home-page "https://github.com/ambrop72/badvpn") (synopsis "Peer-to-peer virtual private network (VPN)") (description "@code{BadVPN} is a collection of virtual private network (VPN) tools. It includes: @enumerate @item NCD programming language.\n NCD (Network Configuration Daemon) is a daemon and programming/scripting language for configuration of network interfaces and other aspects of the operating system. @item Tun2socks network-layer proxifier.\n The tun2socks program socksifes TCP connections at the network layer. It implements a TUN device which accepts all incoming TCP connections (regardless of destination IP), and forwards the connections through a SOCKS server. @item Peer-to-peer VPN.\n The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers (VPN nodes). @end enumerate") ;; This project contains a bundled lwIP. lwIP is also released under the ;; 3-clause BSD license. (license license:bsd-3))) (define-public wireguard-linux-compat (package (name "wireguard-linux-compat") (version "1.0.20201221") (source (origin (method url-fetch) (uri (string-append "https://git.zx2c4.com/wireguard-linux-compat/" "snapshot/wireguard-linux-compat-" version ".tar.xz")) (sha256 (base32 "0ci13in0fqq32n5qamch4qhjgbdq86ygrgmfhc9szsh2nsl8jlkf")))) (build-system linux-module-build-system) (outputs '("out" "kernel-patch")) (arguments `(#:linux ,linux-libre-5.4 ; mustn't have WG built-in #:tests? #f ; no test suite #:modules ((guix build linux-module-build-system) (guix build utils) (ice-9 popen) (ice-9 textual-ports)) #:phases (modify-phases %standard-phases (add-before 'build 'change-directory (lambda _ (chdir "./src") #t)) (add-after 'build 'build-patch (lambda* (#:key outputs #:allow-other-keys) (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh") (port (open-input-pipe patch-builder)) (str (get-string-all port))) (close-pipe port) (call-with-output-file "wireguard.patch" (lambda (port) (format port "~a" str)))) #t)) (add-after 'install 'install-patch (lambda* (#:key outputs #:allow-other-keys) (install-file "wireguard.patch" (assoc-ref %outputs "kernel-patch")) #t)) ;; So that 'install-license-files' works... (add-before 'install-license-files 'reset-cwd (lambda _ (chdir "..") #t))))) (home-page "https://git.zx2c4.com/wireguard-linux-compat/") (synopsis "WireGuard kernel module for Linux 3.10 through 5.5") (description "This package contains an out-of-tree kernel patch and a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5. WireGuard was added to Linux 5.6.") (license license:gpl2))) (define-public wireguard-tools (package (name "wireguard-tools") (version "1.0.20210914") (source (origin (method git-fetch) (uri (git-reference (url "https://git.zx2c4.com/wireguard-tools.git") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1nafrb2naif0z7z3vijnlyp81z89ywzlagc64k4sqa3ayzn95sm0")))) (build-system gnu-build-system) (arguments `(#:make-flags (list ,(string-append "CC=" (cc-for-target)) "--directory=src" "WITH_BASHCOMPLETION=yes" ;; Install the ‘simple and dirty’ helper script wg-quick(8). "WITH_WGQUICK=yes" (string-append "PREFIX=" (assoc-ref %outputs "out")) ;; Currently used only to create an empty /etc/wireguard directory. (string-append "SYSCONFDIR=no-thanks")) ;; The test suite is meant to be run interactively. It runs Clang's ;; scan-build static analyzer and then starts a web server to display the ;; results. #:tests? #f #:phases (modify-phases %standard-phases (delete 'configure) ; no configure script (add-after 'install 'install-contrib-docs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (doc (string-append out "/share/doc/wireguard-tools"))) (copy-recursively "contrib/" doc)))) (add-after 'install 'wrap-wg-quick (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (inputs-sbin (map (lambda (input) (string-append (assoc-ref inputs input) "/sbin")) (list "iproute" "iptables" "procps" "resolvconf"))) (coreutils (string-append (assoc-ref inputs "coreutils") "/bin"))) (wrap-program (string-append out "/bin/wg-quick") #:sh (search-input-file inputs "bin/bash") `("PATH" ":" prefix ,(append inputs-sbin (list coreutils)))))))))) (inputs `(("resolvconf" ,openresolv) ("coreutils" ,coreutils) ("bash" ,bash) ; for scripts using /dev/tcp ("procps" ,procps) ("iproute" ,iproute) ("iptables" ,iptables))) (home-page "https://www.wireguard.com/") (synopsis "Tools for configuring WireGuard tunnels") (description "This package provides the user-space command-line tools for using and configuring WireGuard tunnels. WireGuard is a simple and fast general-purpose @acronym{VPN, Virtual Private Network} that securely encapsulates IP packets over UDP. It aims to be as easy to configure and deploy as SSH. VPN connections are made simply by exchanging public keys and can roam across IP addresses.") (license (list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library license:gpl2)))) ; everything else (define-public xl2tpd (package (name "xl2tpd") (version "1.3.17") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/xelerance/xl2tpd") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "06aiidwygywaa1jn8m2pw8l3vnsc2bjnacbjmlsdy1cqgr1f5cc9")))) (build-system gnu-build-system) (arguments (list #:make-flags #~(list (string-append "PREFIX=" #$output) (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (delete 'configure) ;no configure script (add-before 'build 'setup-environment (lambda* (#:key inputs #:allow-other-keys) (substitute* "l2tp.h" (("/usr/sbin/pppd") (search-input-file inputs "/sbin/pppd"))) (setenv "KERNELSRC" (assoc-ref inputs "kernel-headers"))))) #:tests? #f)) ; no tests provided (inputs (list libpcap ppp)) (home-page "https://www.xelerance.com/software/xl2tpd/") (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)") (description "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661). L2TP allows you to tunnel PPP over UDP.") (license license:gpl2))) (define-public vpn-slice (package (name "vpn-slice") (version "0.16.1") (source (origin (method url-fetch) (uri (pypi-uri "vpn-slice" version)) (sha256 (base32 "1anfx4hn2ggm6sbwqmqx68s3l2rjcy4z4l038xqb440jnk8jvl18")))) (build-system python-build-system) (arguments (list #:phases '(modify-phases %standard-phases (add-after 'unpack 'patch-FHS-file-names (lambda _ (substitute* "vpn_slice/linux.py" (("/sbin/iptables") (which "iptables")) (("/sbin/ip") (which "ip")))))))) (inputs (list python-dnspython python-setproctitle iproute iptables)) (home-page "https://github.com/dlenski/vpn-slice") (synopsis "Split tunneling replacement for vpnc-script") (description "vpn-slice is a replacement for @command{vpnc-script} used by @code{openconnect} and @code{vpnc}. Instead of trying to copy the behavior of standard corporate VPN clients, which normally reroute all your network traffic through the VPN, vpn-slice tries to minimize your contact with an intrusive VPN. This is also known as a split-tunnel VPN, since it splits your traffic between the VPN tunnel and your normal network interfaces. By default, vpn-slice only routes traffic for specific hosts or subnets through the VPN. It automatically looks up named hosts, using the VPN's DNS servers, and adds entries for them to your @file{/etc/hosts} (which it cleans up after VPN disconnection), however it does not otherwise alter your @file{/etc/resolv.conf} at all.") (license license:gpl3+)))