gnu: guile-wm: Add '.desktop' file.

* gnu/packages/guile-wm.scm (guile-wm)[arguments]: Add
'install-xsession' phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Alex ter Weele 2016-09-11 22:18:53 -04:00 committed by Ludovic Courtès
parent 66daf78c0a
commit 23de5cbd14
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 52 additions and 33 deletions

View File

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex ter Weele <alex.ter.weele@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -64,6 +65,7 @@ dependencies.")
(package (package
(name "guile-wm") (name "guile-wm")
(version "1.0") (version "1.0")
(synopsis "X11 window manager toolkit in Scheme")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "http://www.markwitmer.com/dist/guile-wm-" (uri (string-append "http://www.markwitmer.com/dist/guile-wm-"
@ -72,43 +74,60 @@ dependencies.")
(base32 (base32
"1l9qcz236jxvryndimjy62cf8zxf8i3f8vg3zpqqjhw15j9mdk3r")))) "1l9qcz236jxvryndimjy62cf8zxf8i3f8vg3zpqqjhw15j9mdk3r"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments '(;; The '.scm' files go to $(datadir), so set that to the (arguments
;; standard value. `( ;; The '.scm' files go to $(datadir), so set that to the
#:configure-flags (list (string-append "--datadir=" ;; standard value.
(assoc-ref %outputs "out") #:configure-flags (list (string-append "--datadir="
"/share/guile/site/2.0")) (assoc-ref %outputs "out")
#:phases (alist-cons-before "/share/guile/site/2.0"))
'configure 'set-go-directory #:phases (alist-cons-before
(lambda* (#:key outputs #:allow-other-keys) 'configure 'set-go-directory
;; Install .go files to $out/share/guile/site/2.0. (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) ;; Install .go files to $out/share/guile/site/2.0.
(substitute* "module/Makefile.in" (let ((out (assoc-ref outputs "out")))
(("^wmdir = .*$") (substitute* "module/Makefile.in"
(string-append "wmdir = " out (("^wmdir = .*$")
"/share/guile/site/2.0\n"))))) (string-append "wmdir = " out
(alist-cons-after "/share/guile/site/2.0\n")))))
'install 'set-load-path (alist-cons-after
(lambda* (#:key inputs outputs #:allow-other-keys) 'install 'set-load-path
;; Put Guile-XCB's and Guile-WM's modules in the (lambda* (#:key inputs outputs #:allow-other-keys)
;; search path of PROG. ;; Put Guile-XCB's and Guile-WM's modules in the
(let* ((out (assoc-ref outputs "out")) ;; search path of PROG.
(prog (string-append out "/bin/guile-wm")) (let* ((out (assoc-ref outputs "out"))
(mods (string-append (prog (string-append out "/bin/guile-wm"))
out "/share/guile/site/2.0")) (mods (string-append
(xcb (string-append out "/share/guile/site/2.0"))
(assoc-ref inputs "guile-xcb") (xcb (string-append
"/share/guile/site/2.0"))) (assoc-ref inputs "guile-xcb")
(wrap-program "/share/guile/site/2.0")))
prog (wrap-program
`("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb)) prog
`("GUILE_LOAD_COMPILED_PATH" ":" prefix `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
(,mods ,xcb))))) `("GUILE_LOAD_COMPILED_PATH" ":" prefix
%standard-phases)))) (,mods ,xcb)))))
(alist-cons-after
'install 'install-xsession
(lambda* (#:key outputs #:allow-other-keys)
;; add a .desktop file to xsessions
(let ((xsessions (string-append
%output "/share/xsessions")))
(mkdir-p xsessions)
(call-with-output-file (string-append
xsessions "/guile-wm.desktop")
(lambda (port)
(format port
"[Desktop Entry]~@
Name=~a~@
Comment=~a~@
Exec=~a/bin/guile-wm~@
Type=Application~%"
,name ,synopsis %output)))))
%standard-phases)))))
(native-inputs `(("pkg-config" ,pkg-config))) (native-inputs `(("pkg-config" ,pkg-config)))
(inputs `(("guile" ,guile-2.0) (inputs `(("guile" ,guile-2.0)
("guile-xcb" ,guile-xcb))) ("guile-xcb" ,guile-xcb)))
(home-page "http://www.markwitmer.com/guile-xcb/guile-wm.html") (home-page "http://www.markwitmer.com/guile-xcb/guile-wm.html")
(synopsis "X11 window manager toolkit in Scheme")
(description (description
"Guile-WM is a simple window manager that's completely customizableyou "Guile-WM is a simple window manager that's completely customizableyou
have total control of what it does by choosing which modules to include. have total control of what it does by choosing which modules to include.