unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] gnu: Add kakoune
Date: Sat, 21 Jan 2017 12:49:30 +1100	[thread overview]
Message-ID: <87vat9uqqd.fsf@zancanaro.id.au> (raw)
In-Reply-To: <20170110222611.GA8431@jasmine>


[-- Attachment #1.1: Type: text/plain, Size: 138 bytes --]


Let's give this another try, then. I think I've taken into account all
your feedback, and I've updated to a more recent kakoune commit.


[-- Attachment #1.2: 0001-gnu-Add-kakoune.patch --]
[-- Type: text/x-patch, Size: 8627 bytes --]

From a15396f186d5a88f7fbe1af21add9bbd40ddc59b Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Fri, 30 Dec 2016 02:15:59 +1100
Subject: [PATCH] gnu: Add kakoune

* gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/text-editors.scm (kakoune): New variable.
---
 gnu/local.mk                                       |  1 +
 .../kakoune-leave-manpages-uncompressed.patch      | 69 +++++++++++++++++++
 gnu/packages/text-editors.scm                      | 78 +++++++++++++++++++++-
 3 files changed, 147 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2da8b82db..ce7a905d2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -645,6 +645,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
   %D%/packages/patches/jbig2dec-ignore-testtest.patch		\
   %D%/packages/patches/jq-CVE-2015-8863.patch			\
+  %D%/packages/patches/kakoune-leave-manpages-uncompressed.patch		\
   %D%/packages/patches/kdbusaddons-kinit-file-name.patch	\
   %D%/packages/patches/khal-disable-failing-tests.patch		\
   %D%/packages/patches/khmer-use-libraries.patch                \
diff --git a/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch b/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch
new file mode 100644
index 000000000..eb1acb34d
--- /dev/null
+++ b/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch
@@ -0,0 +1,69 @@
+Kakoune compresses its manpages, which makes the build non-reproducible (as it
+leaves timestamps in files). If we don't do that here, and instead do it in
+the guix phases `compress-manpages` then the build is reproducible.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -22,7 +22,7 @@
+ objects := $(addprefix ., $(sources:.cc=$(suffix).o))
+ deps := $(addprefix ., $(sources:.cc=$(suffix).d))
+ docs := $(wildcard ../doc/manpages/*.asciidoc)
+-mandocs := $(docs:.asciidoc=.gz)
++mandocs := $(docs:.asciidoc=.1)
+ 
+ PREFIX ?= /usr/local
+ DESTDIR ?= # root dir
+@@ -76,19 +76,17 @@
+ 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -MP -MF $(addprefix ., $(<:.cc=$(suffix).d)) -c -o $@ $<
+ 
+ # Generate the man page
+-../doc/kak.1.gz: ../doc/kak.1.txt
++../doc/kak.1: ../doc/kak.1.txt
+ 	a2x --no-xmllint -f manpage $<
+-	gzip -f $(basename $<)
+ 
+ # Generate the editor's documentation pages
+ # Since `a2x` won't generate man pages if some sections are missing (which we don't need),
+-# we generate the pages, patch them and then compress them
+-../doc/manpages/%.gz: ../doc/manpages/%.asciidoc
++# we generate the pages and patch them
++../doc/manpages/%.1: ../doc/manpages/%.asciidoc
+ 	a2x --no-xmllint -f manpage $<
+ 	sed -i -r -e "s,^\.TH .+,.TH KAKOUNE 1 \"\" \"\" \"$(basename $(notdir $<))\"," \
+-	-e "/^\.SH \"NAME\"/{N;d;}" $(@:.gz=.1)
+-	gzip -f $(@:.gz=.1)
+-	mv -f $(@:.gz=.1.gz) $@
++	-e "/^\.SH \"NAME\"/{N;d;}" $@
++
+ 
+ check: test
+ test:
+@@ -97,7 +95,7 @@
+ TAGS: tags
+ tags:
+ 	ctags -R
+-man: ../doc/kak.1.gz
++man: ../doc/kak.1
+ doc: $(mandocs)
+ 
+ clean:
+@@ -124,8 +122,8 @@
+ 	[ -e $(sharedir)/autoload ]	|| ln -s rc	$(sharedir)/autoload
+ 	install	-m 0644	../colors/*	$(sharedir)/colors
+ 	install	-m 0644	../README.asciidoc $(docdir)
+-	install	-m 0644	../doc/manpages/*.gz $(docdir)/manpages
+-	install	-m 0644	../doc/kak.1.gz	$(mandir)
++	install	-m 0644	../doc/manpages/*.1 $(docdir)/manpages
++	install	-m 0644	../doc/kak.1	$(mandir)
+ 
+ install-strip: install
+ 	strip -s $(bindir)/kak
+@@ -134,7 +132,7 @@
+ 	rm -rf $(bindir)/kak \
+ 		$(sharedir)	\
+ 		$(docdir) \
+-		$(mandir)/kak.1.gz
++		$(mandir)/kak.1
+ 
+ .PHONY: check TAGS clean distclean installdirs install install-strip uninstall
+ .PHONY: tags test man doc
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 4e2324dbe..8b7e95975 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 José Miguel Sánchez García <jmi2k@openmailbox.org>
+;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,13 +20,20 @@
 (define-module (gnu packages text-editors)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages terminals))
+  #:use-module (gnu packages terminals)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages ruby)
+  #:use-module (gnu packages xml))
 
 (define-public vis
   (package
@@ -75,3 +83,71 @@ based command language.")
     (license (list license:isc               ; Main distribution.
                    license:public-domain     ; map.[ch]
                    license:expat))))         ; lexers and libutf.[ch]
+
+(define-public kakoune
+  (let ((commit "c61aae0722058ad404ec1c117a277bef437e006e")
+        (revision "1"))
+    (package
+      (name "kakoune")
+      (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+      (source
+       (origin
+         (file-name (string-append "kakoune-" version "-checkout"))
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/mawww/kakoune.git")
+               (commit commit)))
+         (sha256
+          (base32
+           "03jvlmna291609hydrpmpcl0a2qdcnghwpsgn3arvglq050l5w12"))
+         (patches
+          (search-patches
+           "kakoune-leave-manpages-uncompressed.patch"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                            ;; Boost is compiled with the older ABI, so we can't use
+                            ;; the new ABI if we want to link againt it.
+                            "CPPFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
+
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (add-before 'build 'patch-bash-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               ;; kakoune uses confstr with _CS_PATH to find out where to find
+               ;; a posix shell, but this doesn't work in the build
+               ;; environment. This substitution just replaces that result
+               ;; with the path the bash (which is run as sh).
+               (substitute* "src/shell_manager.cc"
+                 (("if \\(m_shell.empty\\(\\)\\)" line)
+                  (string-append "m_shell = \"" (assoc-ref %build-inputs "bash")
+                                 "/bin/sh\";\n        " line)))
+               #t))
+           ;; kakoune requires us to be in the src/ directory to build
+           (add-before 'build 'chdir
+             (lambda* (#:key outputs #:allow-other-keys)
+               (chdir "src")
+               #t))
+           (add-before 'check 'fix-test-permissions
+             (lambda* _
+               ;; Out git downloader doesn't give us write permissions, but
+               ;; without them the tests fail.
+               (zero? (system* "chmod" "-R" "u+w" "../test")))))))
+      (native-inputs `(("gcc" ,gcc-5)
+                       ("libxslt" ,libxslt)
+                       ("asciidoc" ,asciidoc)
+                       ("ruby" ,ruby)))
+      (inputs `(("gcc:lib" ,gcc-5 "lib")
+                ("bash" ,bash)
+                ("ncurses" ,ncurses)
+                ("boost" ,boost)))
+      (synopsis "Vim-inspired code editor")
+      (description
+       "Kakoune is a code editor heavily inspired by Vim, as such most of its
+commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
+editing language\" model.  Kakoune has a strong focus on interactivity, most
+commands provide immediate and incremental results, while still being
+competitive (as in keystroke count) with Vim.")
+      (home-page "http://kakoune.org/")
+      (license license:unlicense))))
-- 
2.11.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2017-01-21  1:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30  3:43 [PATCH] gnu: Add kakoune Carlo Zancanaro
2016-12-30  4:44 ` Carlo Zancanaro
2016-12-30 19:25   ` Leo Famulari
2016-12-30 23:19     ` Carlo Zancanaro
2017-01-10 22:26       ` Leo Famulari
2017-01-21  1:49         ` Carlo Zancanaro [this message]
2017-01-26 10:20           ` Ludovic Courtès
2017-01-26 12:26             ` Carlo Zancanaro
2017-01-26 20:19               ` Marius Bakke
2017-01-26 21:43                 ` Carlo Zancanaro
2017-01-26 22:09                   ` Marius Bakke
2017-01-26 23:57                     ` Carlo Zancanaro
2017-01-27  0:47                       ` Marius Bakke
2017-01-27 23:00                         ` gzip embedded timestamps Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vat9uqqd.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).