From patchwork Thu Feb 27 22:04:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dario X-Patchwork-Id: 20464 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0321427BBEA; Thu, 27 Feb 2020 22:06:51 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 7031127BBE4 for ; Thu, 27 Feb 2020 22:06:50 +0000 (GMT) Received: from localhost ([::1]:39112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7RIv-0006Ja-Qe for patchwork@mira.cbaines.net; Thu, 27 Feb 2020 17:06:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45525) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7RHD-00055v-Th for guix-patches@gnu.org; Thu, 27 Feb 2020 17:05:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7RHC-0004rs-9O for guix-patches@gnu.org; Thu, 27 Feb 2020 17:05:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7RHC-0004ro-1F for guix-patches@gnu.org; Thu, 27 Feb 2020 17:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j7RHB-0004MI-Rj for guix-patches@gnu.org; Thu, 27 Feb 2020 17:05:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39804] [PATCH] gnu: add emacs-exwm-next package (i.e. exwm for emacs-next) Resent-From: dario Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Feb 2020 22:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39804 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Pierre Neidhardt Cc: 39804@debbugs.gnu.org Received: via spool by 39804-submit@debbugs.gnu.org id=B39804.158284110116749 (code B ref 39804); Thu, 27 Feb 2020 22:05:01 +0000 Received: (at 39804) by debbugs.gnu.org; 27 Feb 2020 22:05:01 +0000 Received: from localhost ([127.0.0.1]:60401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7RHA-0004Lz-Rb for submit@debbugs.gnu.org; Thu, 27 Feb 2020 17:05:01 -0500 Received: from mout.web.de ([212.227.15.3]:41675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7RH8-0004Lm-V5 for 39804@debbugs.gnu.org; Thu, 27 Feb 2020 17:04:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1582841092; bh=2doqy+gJGHJiTWZOVUpMEBdFC5JBWcfvq56c2QKorhM=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:In-reply-to:Date; b=BCSuPFjlaLKMMz/boHVpgrI+ze9YV1zjkOe/+FqPC99ASSVSCNLAclq2ZbtESp04S dvpLTbDSZC0bRbW+Xkl9RJpFBo79kZHvE1d7CrxWN7JoRq+JAnFIU1nwOV4V7PmQfd lr/ncO7EofHp0BHFKy4zmsAOAYZLk/UqPvgIzxpo= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from klingenberg-tablet ([95.222.214.232]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M9MDO-1jFdxF3nlW-00ClO8; Thu, 27 Feb 2020 23:04:51 +0100 References: <87blplqcdd.fsf@web.de> <8736aw8igd.fsf@ambrevar.xyz> User-agent: mu4e 1.2.0; emacs 27.0.50 From: dario In-reply-to: <8736aw8igd.fsf@ambrevar.xyz> Date: Thu, 27 Feb 2020 23:04:50 +0100 Message-ID: <87tv3bd6v1.fsf@web.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:uox87Vwl7X0DOj6murqeWmj04tDALy2q4Dkh6ghnMW/kMo2fdAh WVNq691BgzwXAR/rU3Wv6KX1HWT5+IFFqU4vt+57jRwFyKfHqLW240tvqnwhYqcJQp9iNjA GlYY76tdwL0cpukGjY2nJwsvkKlJc2eN/D6En1jTTlQSBMnP+iDm8UYLmN1tNpo0zb+d7VQ SxGS79PiF08cFtiPElS3A== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZI4Bo2/akdU=:27ygHqCudEjy+Q/8gWUMBC u68NMHokVAGkpA4nAxLGuS33+rxjb8vtbVnlUQp6AVQvejkLqSdp8HStwr9OQ+8nb28LwolI6 X0TG5OIc+8jKSCfFzf73aY/nH0CTj4iLwXR1KmmCd47yLZK4YVOaQ+/yZP+QhwCVTaaH0lpd1 vr+oXVHekWRs/WBkxK+hb04pKkDgsrOxXbLZk+F0GR3IifGRe3A6bB61VViBP4jC66urxywKN OhtoMKM9uCommWhOJGX2bsblzEgAUWFTinX4PjCbCythP00T4fU0LmnaxYlR7gcSykWQq2AK2 RiUTMpXPxID0KL5+8+uYHpbC9PesOxoyF3vIQtu3whEZSX/ZrEEtLdf1VUXMGA6VVj/5somDq PDd1SvDXmgcwrAa0PfYN2ZQG3yKTUqvcuqJj3Dwtty8WtQHW8fz44RYylkpbb/X51QGDuaotr ndVaZ5fVjHyTajvkFGWwp26VbERznqpHGYB93cfPOFIm3HS1fH+LB4T7GpPv1KPbJc7ce8VQh 8Dj9r5k6pMAi+cd2Hae1bPWBvLoyeplpHcfFDHdgFUyQ3mwQhujrvGwcfZslbUbg2Z0es/r+x blDQ94jaATaoJBcBFKZ2tnoXvYAqJklbrobtXRHe23KFSD2Z9owuGrXjKTGIiEPyKskhhir9A FDwgsow8OYUkFegTQvDO+Rz5knao2z95eRfrYx8zhD6VPMy7P+RMYOzqqLjLCYRMyCc9LM+Hs 9Kj2qkIWvM3VIHgq02P327gTe6khDGybaUF7BlnCKVoDHryRmui/J7FgurycWk6OJHdPVpakh mwt0D8blpdhD0LRulNuElIrf8expaXqtELlrA6OeLkJxZ6XlgOM2Q/j7NefjqZQUqG2PQkALY y0d0hFHER6y8qqPotI9xFtWQJhPS12jvAwrtKgWdC8gQTeZrJP7g/4wDLkrFFwEcBv1Pa8xEk oiYAf3a/fMOMb536AZGmQuF/u5y+PLVFNibhJHu47fWOwVkPIOkWPpdy0cfcJmbs1v4JGbQhh KTsfKh4tSfPEXxWtvIVGa9s7t9+9IuJFalHH173UaBk1BfzSY4N2oLyoG52pquqALUPBkVHeG FCvj1UjMypm9Ohr7DvWF41IqMe8EVsQiZLCyBkE+xp3+eRMoA6lUyD2yjL9fvBYoiNQbRxx80 dmaMauQAPApm82a7hCkxiFpsgEVPfQCRn/wZO8kJIQvNpH1kuQDURiq9UbE/CPv+s5FqbTkkj trOCm80+ndTF7O/C9 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Thanks for your feedback. >> --- >> gnu/packages/emacs-xyz.scm | 71 ++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 71 insertions(+) >> >> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm >> index 6b9027df8a..c6df469895 100644 >> --- a/gnu/packages/emacs-xyz.scm >> +++ b/gnu/packages/emacs-xyz.scm >> @@ -8601,6 +8601,77 @@ It should enable you to implement low-level X11 applications.") >> built on top of XELB.") >> (license license:gpl3+))) >> >> +(define-public emacs-exwm-next > > I think you don't need to copy the whole package definition. Instead, > you could `inherit' from the original definition and only adjust the > name, description, inputs and maybe arguments. > > For instance > > --8<---------------cut here---------------start------------->8--- > (define-public emacs-exwm-next > (package > (inherit emacs) > (name "emacs-exwm-next") > (inputs ...) > (synopsys ...))) > --8<---------------cut here---------------end--------------->8--- > > See `substitute-keyword-arguments' in the fftwf package for a convenient > way to modify just one argument. > >> + (package >> + (name "emacs-exwm-next") >> + (version "0.23") >> + (synopsis "Emacs X window manager") Nice - I was not aware of that. The following definition seems to work (see also the patch at the end of this mail) > --8<---------------cut here---------------start------------->8--- (define-public emacs-exwm-next (package (inherit emacs-exwm) (name "emacs-exwm-next") (synopsis "Emacs X window manager using the next version of emacs") (inputs (cons `("emacs-next" ,emacs-next) (delete `("emacs" ,emacs) (package-inputs emacs-exwm)))))) > --8<---------------cut here---------------end------------->8--- >> + (arguments >> + `(#:emacs ,emacs > > Shouldn't this be `emacs-next` as well? I have to admit that I do not understand that part. If I change it to emacs-next, the build fails with the error > --8<---------------cut here---------------start------------->8--- phase `install' succeeded after 0.0 seconds starting phase `make-autoloads' Wrong type argument: stringp, nil command "/gnu/store/1z520fgx6fiq426yf2174kal2q63a9q7-emacs-next-27.0.50-0.36abf68/bin/emacs" "--quick" "--batch" "--eval=(let ((backup-inhibited t) (generated-autoload-file \"/gnu/store/nnjcqc448yj79dxaj11fnq7s9a8zpc1z-emacs-exwm-next-test-0.23/share/emacs/site-lisp/exwm-next-test-autoloads.el\")) (update-directory-autoloads \"/gnu/store/nnjcqc448yj79dxaj11fnq7s9a8zpc1z-emacs-exwm-next-test-0.23/share/emacs/site-lisp\"))" failed with status 255 > --8<---------------cut here---------------end------------->8--- It is a bit difficult for me to understand what is going on here, because, like I said, I do not really understand this part of the package definition in the first place - sorry. However, without modifying the arguments, everything seems to work. The following patch seems to work (do I need to send it on its own? I am new to this type of workflow.) Best Dario --- gnu/packages/emacs-xyz.scm | 72 ++++---------------------------------- 1 file changed, 6 insertions(+), 66 deletions(-) -- 2.25.1 diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index c6df469895..3d5b650df9 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -8603,74 +8603,14 @@ built on top of XELB.") (define-public emacs-exwm-next (package + (inherit emacs-exwm) (name "emacs-exwm-next") - (version "0.23") - (synopsis "Emacs X window manager") - (source (origin - (method url-fetch) - (uri (string-append "https://elpa.gnu.org/packages/exwm-" - version ".tar")) - (sha256 - (base32 - "05w1v3wrp1lzz20zd9lcvr5nhk809kgy6svvkbs15xhnr6x55ad5")))) - (build-system emacs-build-system) - (propagated-inputs - `(("emacs-xelb" ,emacs-xelb))) + (synopsis "Emacs X window manager using the next version of emacs") (inputs - `(("xhost" ,xhost) - ("emacs-next" ,emacs-next) - ("dbus" ,dbus))) - ;; The following functions and variables needed by emacs-exwm are - ;; not included in emacs-minimal: - ;; scroll-bar-mode, fringe-mode - ;; x-display-pixel-width, x-display-pixel-height - (arguments - `(#:emacs ,emacs - #:phases - (modify-phases %standard-phases - (add-after 'build 'install-xsession - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (xsessions (string-append out "/share/xsessions")) - (bin (string-append out "/bin")) - (exwm-executable (string-append bin "/exwm"))) - ;; Add a .desktop file to xsessions - (mkdir-p xsessions) - (mkdir-p bin) - (with-output-to-file - (string-append xsessions "/exwm.desktop") - (lambda _ - (format #t "[Desktop Entry]~@ - Name=~a~@ - Comment=~a~@ - Exec=~a~@ - TryExec=~:*~a~@ - Type=Application~%" ,name ,synopsis exwm-executable))) - ;; Add a shell wrapper to bin - (with-output-to-file exwm-executable - (lambda _ - (format #t "#!~a ~@ - ~a +SI:localuser:$USER ~@ - exec ~a --exit-with-session ~a \"$@\" --eval '~s' ~%" - (string-append (assoc-ref inputs "bash") "/bin/sh") - (string-append (assoc-ref inputs "xhost") "/bin/xhost") - (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch") - (string-append (assoc-ref inputs "emacs-next") "/bin/emacs") - '(cond - ((file-exists-p "~/.exwm") - (load-file "~/.exwm")) - ((not (featurep 'exwm)) - (require 'exwm) - (require 'exwm-config) - (exwm-config-default) - (message (concat "exwm configuration not found. " - "Falling back to default configuration..."))))))) - (chmod exwm-executable #o555) - #t)))))) - (home-page "https://github.com/ch11ng/exwm") - (description "EXWM is a full-featured tiling X window manager for Emacs -built on top of XELB.") - (license license:gpl3+))) + (cons + `("emacs-next" ,emacs-next) + (delete `("emacs" ,emacs) + (package-inputs emacs-exwm)))))) (define-public emacs-switch-window (package