unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Packaging Arcan
@ 2018-11-23 12:14 L p R n d n
  2018-11-23 11:40 ` Pierre Neidhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: L p R n d n @ 2018-11-23 12:14 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]


Hello,

I started to package Arcan[1], mostly for fun and trying to learn a bit
more about Guile/Guix. (maybe hoping for guile bindings too. :D)
It mostly works, at least builds, but a few questions arised so here I
am. I join the current WIP patch just in case.

1. Using 'guix lint', I get the same error for all packages:
'the source file name should contain the package name' which I don't
understand. So what's wrong?

2. Arcan server needs some ENV variables to be set to find all its
components. After some search/tries, I ended up using wrap-program which
works. But I stumbled upon 'search-paths' and 'native-search-paths'
along the way. I looked in the manual but I still don't understand there concrete use.
Can someone enlighten me?

3. Arcan uses patched versions of some softwares in certain cases
(openal, qemu and xorg-server) which are all obtained throught dedicated
git repositories. xorg-server seems okay as it mainly produces a binary
called Xarcan. The two others are a little bit ore complicated

3.a. For qemu, I fear the produced binaries would conflict with the
original ones. Is there something we can do in the build process to deal
with that can of thing or sould we just expect the user deal with it on
its own as Guix doest it very well on its own?

3.b. The patched openal is used during build to produce a special binary
(arcan_lwa which allows nested servers). It should normally be fetched
during build time which is obviously not possible here. I suppose there
is no clear answer here but how would you deal with that kind of
behaviour? Create a modified openal package? Can we fetch multiple sources?

4. Licenses seem quite complicated (see COPYING[2]). I added a list of
licenses to the package for now. Is there a better way?

By the way, if someone is interested by this package, every help is
welcomed. ;)

Thanks a lot,

Lprndn

[1] https://arcan-fe.com/
[2] https://github.com/letoram/arcan/blob/master/COPYING


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-Arcan.patch --]
[-- Type: text/x-patch, Size: 11624 bytes --]

From 38315df876ba7e60ea078f428bcbfefd8570dd42 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@lprndn.info>
Date: Fri, 23 Nov 2018 12:42:58 +0100
Subject: [PATCH] gnu: Add Arcan.

---
 gnu/packages/arcan.scm | 300 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 300 insertions(+)
 create mode 100644 gnu/packages/arcan.scm

diff --git a/gnu/packages/arcan.scm b/gnu/packages/arcan.scm
new file mode 100644
index 000000000..52b730fa5
--- /dev/null
+++ b/gnu/packages/arcan.scm
@@ -0,0 +1,300 @@
+(define-module (gnu packages arcan)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages libusb)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages sdl)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages apr)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages ocr)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (srfi srfi-1))
+
+
+(define-public arcan-sdl
+  (package
+   (name "arcan-sdl")
+   (version "0.5.5")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/letoram/arcan.git")
+                  (commit "67231da5e736a045cfc0b8db4104351b6bea9774")))
+            (sha256
+             (base32
+              "1ws9fpy6bg0xyblfjca0vyyz1hxm65l99xdfszx3xwa495mss9ix"))))
+   (build-system cmake-build-system)
+   (arguments
+    `(#:configure-flags '("-DVIDEO_PLATFORM=sdl" "-DBUILTIN_LUA=off"
+                          "-DDISABLE_JIT=on" "-DENABLE_LWA=off"
+                          "-DSTATIC_SQLITE3=off" "-DSTATIC_FREETYPE=off"
+                          "-DSHMIF_TUI_ACCEL=on")
+      #:phases
+      (modify-phases %standard-phases
+        (add-before 'configure 'chdir
+          (lambda _
+            (chdir "src")
+            #t))
+        (add-after 'install 'wrap-program
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              (wrap-program (string-append out "/bin/arcan")
+                `("ARCAN_RESOURCEPATH" ":" prefix
+                  (,(string-append out "/share/arcan/resources")))
+                `("ARCAN_BINPATH" ":" prefix
+                  (,(string-append out "/bin")))
+                `("ARCAN_SCRIPTPATH" ":" prefix
+                  (,(string-append out "/share/arcan/scripts")))
+                `("ARCAN_APPLBASEPATH" ":" prefix
+                  (,(string-append out "/share/arcan/appl"))))))))
+      #:tests? #f))
+   ;; (native-search-paths
+   ;; '((search-path-specification
+   ;; (variable "ARCAN_RESOURCEPATH")
+   ;; (files '("share/arcan/resources")))
+   ;; (search-path-specification
+   ;; (variable "ARCAN_BINPATH")
+   ;; (files '("bin")))
+   ;; (search-path-specification
+   ;; (variable "ARCANSCRIPTPATH")
+   ;; (files '("share/arcan/scripts")))
+   ;; (search-path-specification
+   ;; (variable "ARCAN_APPLBASEPATH")
+   ;; (files '("share/arcan/appl")))))
+   (inputs
+    `(("pcre" ,pcre)
+      ("glib" ,glib)
+      ("libusb" ,libusb)
+      ("lua" ,lua-5.1)
+      ("sdl" ,sdl)
+      ("vlc" ,vlc)
+      ("openal" ,openal)
+      ("sqlite" ,sqlite)
+      ("apr" ,apr)
+      ("harfbuzz" ,harfbuzz)
+      ("freetype" ,freetype)
+      ("lzip" ,lzip)
+      ("glu" ,glu)
+      ("libxkbcommon" ,libxkbcommon)
+      ("ffmpeg" ,ffmpeg)
+      ("tesseract-ocr" ,tesseract-ocr)))
+   (native-inputs
+    `(("pkg-config" ,pkg-config)))
+   (home-page "https://arcan-fe.com")
+   (synopsis "Combined display server, multimedia framework and game engine (sdl)")
+   (description "Arcan is a powerful development framework for creating virtually
+anything from user interfaces for specialized embedded applications
+all the way to full-blown desktop environments")
+   (license (list license:gpl2+
+                  license:lgpl2.0
+                  license:bsd-3))))
+
+(define-public arcan
+  (package
+    (inherit arcan-sdl)
+    (name "arcan")
+    (inputs
+     `(("libdrm" ,libdrm)
+       ,@(fold alist-delete (package-inputs arcan-sdl)
+               '("sdl"))))
+    (arguments
+     `(#:tests? #f
+       #:configure-flags '("-DVIDEO_PLATFORM=egl-dri" "-DBUILTIN_LUA=off"
+                           "-DDISABLE_JIT=on" "-DENABLE_LWA=off"
+                           "-DSTATIC_SQLITE3=off" "-DSTATIC_FREETYPE=off"
+                           "-DSHMIF_TUI_ACCEL=on")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-harcoded-cmake-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/platform/cmake/modules/FindGBMKMS.cmake"
+               (("/usr/local/include/libdrm")
+                (string-append (assoc-ref inputs "libdrm")
+                               "/include/libdrm")))
+             (substitute* "src/platform/cmake/modules/FindAPR.cmake"
+               (("/usr/local/apr/include/apr-1")
+                (string-append (assoc-ref inputs "apr")
+                               "/include/apr-1")))
+             #t))
+         (add-before 'configure 'chdir
+           (lambda _
+             (chdir "src")
+             #t))
+         (add-after 'install 'wrap-program
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/arcan")
+                 `("ARCAN_RESOURCEPATH" ":" prefix
+                   (,(string-append out "/share/arcan/resources")))
+                 `("ARCAN_BINPATH" ":" prefix
+                   (,(string-append out "/bin")))
+                 `("ARCAN_SCRIPTPATH" ":" prefix
+                   (,(string-append out "/share/arcan/scripts")))
+                 `("ARCAN_APPLBASEPATH" ":" prefix
+                   (,(string-append out "/share/arcan/appl"))))))))))
+    (synopsis "Combined display server,
+multimedia framework and game engine (egl-dri)")))
+
+(define-public xarcan
+  (package
+    (name "xarcan")
+    (version "0.5.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/letoram/xarcan.git")
+             (commit "8e6ee029388326cfe5cddeffe482eb3702e9b7f3")))
+       (sha256
+        (base32 "0zng7cs6733mnf0p6g5wv02981f2sf567n56csax6cmzb8fpamym"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("util-macros" ,util-macros)
+       ("font-util" ,font-util)
+       ("xtrans" ,xtrans)
+       ("xkeyboard-config" ,xkeyboard-config)))
+    (inputs
+     `(("pixman" ,pixman)
+       ("libdrm" ,libdrm)
+       ("libx11" ,libx11)
+       ("mesa" ,mesa)
+       ("libressl" ,libressl)
+       ("libxfont2" ,libxfont2)
+       ("libkbfile" ,libxkbfile)
+       ("libepoxy" ,libepoxy)
+       ("arcan" ,arcan)
+       ("xorgproto" ,xorgproto)))
+    (arguments
+     `(#:configure-flags
+       `("--enable-kdrive" "--enable-xarcan"
+         "--disable-xorg" "--disable-xwayland"
+         "--disable-xnest" "--disable-xvfb"
+         "--enable-glamor" "--enable-glx"
+         "--disable-int10-module" "--enable-ipv6"
+         "--enable-record" "--without-systemd-daemon"
+         "--enable-xcsecurity" "--disable-static"
+         ,(string-append "--with-xkb-path="
+                         (assoc-ref %build-inputs "xkeyboard-config")
+                         "/share/X11/xkb")
+         ,(string-append "--with-xkb-output="
+                         "/tmp"))   ; FIXME: This is a bit doubtful; where should
+                                        ; the compiled keyboard maps go?
+
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'noconfigure
+          (lambda _
+            (setenv "NOCONFIGURE" "true")
+            #t)))))
+    (home-page "https://arcan-fe.com")
+    (synopsis "Patched Xserver that bridges connections to Arcan")
+    (description "Patched Xserver that bridges connections to Arcan")
+    (license license:expat)))
+
+(define-public arcan-wayland
+  (package
+    (inherit arcan-sdl)
+    (name "arcan-wayland")
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libxkbcommon" ,libxkbcommon)
+       ("libseccomp" ,libseccomp)
+       ("arcan" ,arcan)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("mesa" ,mesa)))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+           (lambda _
+             (chdir "src/tools/waybridge")
+             #t))
+         (add-after 'unpack 'fix-cmake-find-shmif
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/platform/cmake/modules/Findarcan_shmif.cmake"
+               (("/usr/local") (string-append (assoc-ref inputs "arcan") "")))
+             #t)))))
+    (synopsis "Wayland protocol service for Arcan")
+    (description "Wayland protocol service for Arcan")
+    (license license:bsd-3)))
+
+(define-public aclip
+  (package
+    (name "aclip")
+    (version (package-version arcan))
+    (source (package-source arcan))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("arcan" ,arcan)))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+           (lambda _
+             (chdir "src/tools/aclip")
+             #t))
+         (add-after 'unpack 'fix-cmake-find-shmif
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/platform/cmake/modules/Findarcan_shmif.cmake"
+               (("/usr/local") (string-append (assoc-ref inputs "arcan") "")))
+             #t)))))
+    (home-page "https://arcan-fe.com")
+    (synopsis "Clipboard manager for Arcan")
+    (description "Clipboard manager for Arcan")
+    (license license:bsd-3)))
+
+(define-public aloadimage
+  (package
+    (name "aloadimage")
+    (version (package-version arcan))
+    (source (package-source arcan))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("arcan" ,arcan)
+       ("libseccomp" ,libseccomp)))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+           (lambda _
+             (chdir "src/tools/aloadimage")
+             #t))
+         (add-after 'unpack 'fix-cmake-find-shmif
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/platform/cmake/modules/Findarcan_shmif.cmake"
+               (("/usr/local") (string-append (assoc-ref inputs "arcan") "")))
+             #t)))))
+    (home-page "https://arcan-fe.com")
+    (synopsis "Image viewer for Arcan")
+    (description "Image viewer for Arcan")
+    (license license:bsd-3)))
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-26 14:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-23 12:14 Packaging Arcan L p R n d n
2018-11-23 11:40 ` Pierre Neidhardt
2018-11-23 12:54   ` L p R n d n
2018-11-23 12:16     ` Pierre Neidhardt
2018-11-26 15:59   ` L p R n d n
2018-11-23 12:32 ` L p R n d n
2018-11-23 18:09   ` swedebugia
2018-11-26 15:49     ` L p R n d n
2018-11-23 17:12 ` Thorsten Wilms

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).