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 gl)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages libusb)
37 #:use-module (gnu packages lua)
38 #:use-module (gnu packages ocr)
39 #:use-module (gnu packages pcre)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages ruby)
42 #:use-module (gnu packages sdl)
43 #:use-module (gnu packages sqlite)
44 #:use-module (gnu packages tls)
45 #:use-module (gnu packages video)
46 #:use-module (gnu packages xdisorg)
47 #:use-module (gnu packages xorg)
48 #:use-module (srfi srfi-1))
51 (let ((commit "b4dd1fbd1938492ff4b269189d3c8524be7450a9")
55 (version (git-version "0.5.5.2" revision commit))
58 (file-name (git-file-name name version))
60 (url "https://github.com/letoram/arcan.git")
63 (base32 "1pd0avlzc2rig1hd37zbhc7r2s6fjzdhshfg9l9cfzibl7caclyw"))))
64 (build-system cmake-build-system)
66 `(#:configure-flags '("-DVIDEO_PLATFORM=egl-dri" "-DBUILTIN_LUA=off"
67 "-DSTATIC_OPENAL=off""-DENABLE_LWA=on"
68 "-DSTATIC_SQLITE3=off" "-DSTATIC_FREETYPE=off"
69 "-DSHMIF_TUI_ACCEL=on")
71 (modify-phases %standard-phases
72 (add-after 'unpack 'fix-cmake-paths
73 (lambda* (#:key inputs #:allow-other-keys)
74 (substitute* "src/platform/cmake/modules/FindGBMKMS.cmake"
75 (("/usr/local/include/libdrm")
76 (string-append (assoc-ref inputs "libdrm")
78 (substitute* "src/platform/cmake/modules/FindAPR.cmake"
79 (("/usr/local/apr/include/apr-1")
80 (string-append (assoc-ref inputs "apr")
83 ;; Normally, it tries to fetch patched openal with git
84 ;; but copying files manually in the right place seems to work too.
85 (add-after 'unpack 'prepare-static-openal
86 (lambda* (#:key inputs #:allow-other-keys)
87 (let ((arcan-openal (assoc-ref inputs "arcan-openal")))
88 (copy-recursively arcan-openal "external/git/openal"))
90 (add-after 'prepare-static-openal 'generate-man
92 (with-directory-excursion "doc"
93 (invoke "ruby" "docgen.rb" "mangen"))
95 (add-before 'configure 'chdir
99 (add-after 'install 'wrap-program
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out")))
102 (wrap-program (string-append out "/bin/arcan")
103 `("ARCAN_RESOURCEPATH" ":" suffix
104 (,(string-append out "/share/arcan/resources")))
105 `("ARCAN_STATEBASEPATH" ":" =
106 ("$HOME/.arcan/resources/savestates"))
107 `("ARCAN_STATEPATH" ":" =
108 ("$HOME/.arcan/resources/savestates"))
109 `("ARCAN_BINPATH" ":" =
110 (,(string-append out "/bin/arcan_frameserver")))))
114 (list (search-path-specification
115 (variable "ARCAN_APPLBASEPATH")
117 (files '("share/arcan/appl")))
118 (search-path-specification
119 (variable "ARCAN_SCRIPTPATH")
121 (files '("share/arcan/scripts")))))
125 ("freetype" ,freetype)
128 ("harfbuzz" ,harfbuzz)
131 ("libxkbcommon" ,libxkbcommon)
137 ("tesseract-ocr" ,tesseract-ocr)
138 ("leptonica" ,leptonica)
140 ;; To build arcan_lwa, we need a patched version of openal.
141 ;; https://github.com/letoram/arcan/wiki/packaging
142 ("arcan-openal" ,(origin
144 (file-name "arcan-openal-0.5.4")
146 (url "https://github.com/letoram/openal.git")
147 (commit "1c7302c580964fee9ee9e1d89ff56d24f934bdef")))
150 "0dcxcnqjkyyqdr2yk84mprvkncy5g172kfs6vc4zrkklsbkr8yi2"))))))
152 `(("pkg-config" ,pkg-config)
153 ("ruby" ,ruby))) ; For documentation and testing
154 (home-page "https://arcan-fe.com")
155 (synopsis "Display server, multimedia framework and game engine (egl-dri)")
156 (description "Arcan is a development framework for creating virtually
157 anything from user interfaces for specialized embedded applications
158 all the way to full-blown desktop environments. At its heart lies a multimedia
159 engine programmable using Lua.")
160 ;; https://github.com/letoram/arcan/blob/master/COPYING
161 (license (list license:gpl2+
164 license:public-domain
167 (define-public arcan-sdl
173 ,@(fold alist-delete (package-inputs arcan)
176 `(,@(ensure-keyword-arguments
177 (package-arguments arcan)
179 '("-DVIDEO_PLATFORM=sdl" "-DBUILTIN_LUA=off"
180 "-DSTATIC_OPENAL=off" "-DDISABLE_JIT=off"
181 "-DENABLE_LWA=on" "-DSTATIC_SQLITE3=off"
182 "-DSTATIC_FREETYPE=off" "-DSHMIF_TUI_ACCEL=on")))))
183 (synopsis "Combined display server, multimedia framework and game engine (SDL)")))
185 (define-public xarcan
186 (let ((commit "8e6ee029388326cfe5cddeffe482eb3702e9b7f3")
190 (version (git-version "0.5.4" revision commit))
194 (file-name (git-file-name name version))
196 (url "https://github.com/letoram/xarcan.git")
199 (base32 "0zng7cs6733mnf0p6g5wv02981f2sf567n56csax6cmzb8fpamym"))))
200 (build-system gnu-build-system)
203 `("--enable-kdrive" "--enable-xarcan"
204 "--disable-xorg" "--disable-xwayland"
205 "--disable-xnest" "--disable-xvfb"
206 "--enable-glamor" "--enable-glx"
207 "--disable-int10-module" "--enable-ipv6"
208 "--enable-record" "--without-systemd-daemon"
209 "--enable-xcsecurity" "--disable-static"
210 ,(string-append "--with-xkb-path="
211 (assoc-ref %build-inputs "xkeyboard-config")
213 ,(string-append "--with-xkb-bin-directory="
214 (assoc-ref %build-inputs "xkbcomp")
216 ,(string-append "--with-xkb-output="
217 "/tmp")) ; FIXME: Copied from xorg
219 (modify-phases %standard-phases
220 (add-after 'unpack 'noconfigure
222 (setenv "NOCONFIGURE" "true")
225 `(("pkg-config" ,pkg-config)
226 ("autoconf" ,autoconf)
227 ("automake" ,automake)
229 ("util-macros" ,util-macros)))
232 ("font-util" ,font-util)
234 ("libepoxy" ,libepoxy)
235 ("libkbfile" ,libxkbfile)
236 ("libressl" ,libressl)
238 ("libxfont2" ,libxfont2)
241 ("xkeyboard-config" ,xkeyboard-config)
243 ("xorgproto" ,xorgproto)
245 (home-page "https://arcan-fe.com")
246 (synopsis "Patched Xserver that bridges connections to Arcan")
247 (description "Patched Xserver with a KDrive backend that uses the arcan-shmif
248 to map Xlib/Xcb/X clients to a running arcan instance. It allows running an X session
249 as a window under Arcan.")
250 (license license:expat))))