1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 L p R n d n <guix@lprndn.info>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (gnu packages arcan)
20 #:use-module (guix build-system cmake)
21 #:use-module (guix build-system gnu)
22 #:use-module (guix git-download)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix utils)
26 #:use-module (gnu packages apr)
27 #:use-module (gnu packages audio)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages gl)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages libusb)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages lua)
40 #:use-module (gnu packages ocr)
41 #:use-module (gnu packages pcre)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages ruby)
44 #:use-module (gnu packages sdl)
45 #:use-module (gnu packages sqlite)
46 #:use-module (gnu packages tls)
47 #:use-module (gnu packages video)
48 #:use-module (gnu packages xdisorg)
49 #:use-module (gnu packages xorg)
50 #:use-module (srfi srfi-1))
53 (let ((commit "b4dd1fbd1938492ff4b269189d3c8524be7450a9")
57 (version (git-version "0.5.5.2" revision commit))
60 (file-name (git-file-name name version))
62 (url "https://github.com/letoram/arcan.git")
65 (base32 "1pd0avlzc2rig1hd37zbhc7r2s6fjzdhshfg9l9cfzibl7caclyw"))))
66 (build-system cmake-build-system)
68 `(#:configure-flags '("-DVIDEO_PLATFORM=egl-dri" "-DBUILTIN_LUA=off"
69 "-DSTATIC_OPENAL=off""-DENABLE_LWA=on"
70 "-DSTATIC_SQLITE3=off" "-DSTATIC_FREETYPE=off"
71 "-DSHMIF_TUI_ACCEL=on")
73 (modify-phases %standard-phases
74 (add-after 'unpack 'fix-cmake-paths
75 (lambda* (#:key inputs #:allow-other-keys)
76 (substitute* "src/platform/cmake/modules/FindGBMKMS.cmake"
77 (("/usr/local/include/libdrm")
78 (string-append (assoc-ref inputs "libdrm")
80 (substitute* "src/platform/cmake/modules/FindAPR.cmake"
81 (("/usr/local/apr/include/apr-1")
82 (string-append (assoc-ref inputs "apr")
85 ;; Normally, it tries to fetch patched openal with git
86 ;; but copying files manually in the right place seems to work too.
87 (add-after 'unpack 'prepare-static-openal
88 (lambda* (#:key inputs #:allow-other-keys)
89 (let ((arcan-openal (assoc-ref inputs "arcan-openal")))
90 (copy-recursively arcan-openal "external/git/openal"))
92 (add-after 'prepare-static-openal 'generate-man
94 (with-directory-excursion "doc"
95 (invoke "ruby" "docgen.rb" "mangen"))
97 (add-before 'configure 'chdir
101 (add-after 'install 'wrap-program
102 (lambda* (#:key outputs #:allow-other-keys)
103 (let ((out (assoc-ref outputs "out")))
104 (wrap-program (string-append out "/bin/arcan")
105 `("ARCAN_RESOURCEPATH" ":" suffix
106 (,(string-append out "/share/arcan/resources")))
107 `("ARCAN_STATEBASEPATH" ":" =
108 ("$HOME/.arcan/resources/savestates"))
109 `("ARCAN_STATEPATH" ":" =
110 ("$HOME/.arcan/resources/savestates"))
111 `("ARCAN_BINPATH" ":" =
112 (,(string-append out "/bin/arcan_frameserver")))))
116 (list (search-path-specification
117 (variable "ARCAN_APPLBASEPATH")
119 (files '("share/arcan/appl")))
120 (search-path-specification
121 (variable "ARCAN_SCRIPTPATH")
123 (files '("share/arcan/scripts")))))
127 ("freetype" ,freetype)
130 ("harfbuzz" ,harfbuzz)
133 ("libxkbcommon" ,libxkbcommon)
139 ("tesseract-ocr" ,tesseract-ocr)
140 ("leptonica" ,leptonica)
142 ;; To build arcan_lwa, we need a patched version of openal.
143 ;; https://github.com/letoram/arcan/wiki/packaging
144 ("arcan-openal" ,(origin
146 (file-name "arcan-openal-0.5.4")
148 (url "https://github.com/letoram/openal.git")
149 (commit "1c7302c580964fee9ee9e1d89ff56d24f934bdef")))
152 "0dcxcnqjkyyqdr2yk84mprvkncy5g172kfs6vc4zrkklsbkr8yi2"))))))
154 `(("pkg-config" ,pkg-config)
155 ("ruby" ,ruby))) ; For documentation and testing
156 (home-page "https://arcan-fe.com")
157 (synopsis "Display server, multimedia framework and game engine (egl-dri)")
158 (description "Arcan is a development framework for creating virtually
159 anything from user interfaces for specialized embedded applications
160 all the way to full-blown desktop environments. At its heart lies a multimedia
161 engine programmable using Lua.")
162 ;; https://github.com/letoram/arcan/blob/master/COPYING
163 (license (list license:gpl2+
166 license:public-domain
169 (define-public arcan-sdl
175 ,@(fold alist-delete (package-inputs arcan)
178 `(,@(ensure-keyword-arguments
179 (package-arguments arcan)
181 '("-DVIDEO_PLATFORM=sdl" "-DBUILTIN_LUA=off"
182 "-DSTATIC_OPENAL=off" "-DDISABLE_JIT=off"
183 "-DENABLE_LWA=on" "-DSTATIC_SQLITE3=off"
184 "-DSTATIC_FREETYPE=off" "-DSHMIF_TUI_ACCEL=on")))))
185 (synopsis "Combined display server, multimedia framework and game engine (SDL)")))
187 (define-public xarcan
188 (let ((commit "8e6ee029388326cfe5cddeffe482eb3702e9b7f3")
192 (version (git-version "0.5.4" revision commit))
196 (file-name (git-file-name name version))
198 (url "https://github.com/letoram/xarcan.git")
201 (base32 "0zng7cs6733mnf0p6g5wv02981f2sf567n56csax6cmzb8fpamym"))))
202 (build-system gnu-build-system)
205 `("--enable-kdrive" "--enable-xarcan"
206 "--disable-xorg" "--disable-xwayland"
207 "--disable-xnest" "--disable-xvfb"
208 "--enable-glamor" "--enable-glx"
209 "--disable-int10-module" "--enable-ipv6"
210 "--enable-record" "--without-systemd-daemon"
211 "--enable-xcsecurity" "--disable-static"
212 ,(string-append "--with-xkb-path="
213 (assoc-ref %build-inputs "xkeyboard-config")
215 ,(string-append "--with-xkb-bin-directory="
216 (assoc-ref %build-inputs "xkbcomp")
218 ,(string-append "--with-xkb-output="
219 "/tmp")) ; FIXME: Copied from xorg
221 (modify-phases %standard-phases
222 (add-after 'unpack 'noconfigure
224 (setenv "NOCONFIGURE" "true")
227 `(("pkg-config" ,pkg-config)
228 ("autoconf" ,autoconf)
229 ("automake" ,automake)
231 ("util-macros" ,util-macros)))
234 ("font-util" ,font-util)
236 ("libepoxy" ,libepoxy)
237 ("libkbfile" ,libxkbfile)
238 ("libressl" ,libressl)
240 ("libxfont2" ,libxfont2)
243 ("xkeyboard-config" ,xkeyboard-config)
245 ("xorgproto" ,xorgproto)
247 (home-page "https://arcan-fe.com")
248 (synopsis "Patched Xserver that bridges connections to Arcan")
249 (description "Patched Xserver with a KDrive backend that uses the arcan-shmif
250 to map Xlib/Xcb/X clients to a running arcan instance. It allows running an X session
251 as a window under Arcan.")
252 (license license:expat))))
254 (define-public arcan-wayland
257 (name "arcan-wayland")
259 `(("pkg-config" ,pkg-config)))
262 ("libseccomp" ,libseccomp)
263 ("libxkbcommon" ,libxkbcommon)
266 ("wayland-protocols" ,wayland-protocols)))
270 (modify-phases %standard-phases
271 (add-before 'configure 'chdir
273 (chdir "src/tools/waybridge")
275 (add-after 'unpack 'fix-cmake-find-shmif
276 (lambda* (#:key inputs #:allow-other-keys)
277 (substitute* "src/platform/cmake/modules/Findarcan_shmif.cmake"
278 (("/usr/local") (assoc-ref inputs "arcan")))
280 (synopsis "Wayland protocol service for Arcan")
281 (description "Arcan-wayland (waybridge) bridges Wayland connections
282 with an Arcan connection point. It allows Wayland compatible clients
283 to connect and render using Arcan.")
284 (license license:bsd-3)))