From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: [PATCH] gnu: Add kakoune Date: Sat, 21 Jan 2017 12:49:30 +1100 Message-ID: <87vat9uqqd.fsf@zancanaro.id.au> References: <87zijekrns.fsf@zancanaro.id.au> <87y3yykov6.fsf@zancanaro.id.au> <20161230192556.GA2668@jasmine> <87wpehkns6.fsf@zancanaro.id.au> <20170110222611.GA8431@jasmine> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUkoI-0003Dy-3L for guix-devel@gnu.org; Fri, 20 Jan 2017 20:49:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUkoE-000069-JG for guix-devel@gnu.org; Fri, 20 Jan 2017 20:49:42 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:36253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cUkoE-0008Vg-9N for guix-devel@gnu.org; Fri, 20 Jan 2017 20:49:38 -0500 Received: by mail-pg0-x242.google.com with SMTP id 75so8133725pgf.3 for ; Fri, 20 Jan 2017 17:49:36 -0800 (PST) In-reply-to: <20170110222611.GA8431@jasmine> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-kakoune.patch Content-Transfer-Encoding: quoted-printable From=20a15396f186d5a88f7fbe1af21add9bbd40ddc59b Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro 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. =2D-- 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-uncompresse= d.patch diff --git a/gnu/local.mk b/gnu/local.mk index 2da8b82db..ce7a905d2 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -645,6 +645,7 @@ dist_patch_DATA =3D \ %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 =2D-- /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 (a= s 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 :=3D $(addprefix ., $(sources:.cc=3D$(suffix).o)) + deps :=3D $(addprefix ., $(sources:.cc=3D$(suffix).d)) + docs :=3D $(wildcard ../doc/manpages/*.asciidoc) +-mandocs :=3D $(docs:.asciidoc=3D.gz) ++mandocs :=3D $(docs:.asciidoc=3D.1) +=20 + PREFIX ?=3D /usr/local + DESTDIR ?=3D # root dir +@@ -76,19 +76,17 @@ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -MP -MF $(addprefix ., $(<:.cc=3D$(su= ffix).d)) -c -o $@ $< +=20 + # 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 $<) +=20 + # Generate the editor's documentation pages + # Since `a2x` won't generate man pages if some sections are missing (whic= h 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=3D.1) +- gzip -f $(@:.gz=3D.1) +- mv -f $(@:.gz=3D.1.gz) $@ ++ -e "/^\.SH \"NAME\"/{N;d;}" $@ ++ +=20 + check: test + test: +@@ -97,7 +95,7 @@ + TAGS: tags + tags: + ctags -R +-man: ../doc/kak.1.gz ++man: ../doc/kak.1 + doc: $(mandocs) +=20 + 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) +=20 + install-strip: install + strip -s $(bindir)/kak +@@ -134,7 +132,7 @@ + rm -rf $(bindir)/kak \ + $(sharedir) \ + $(docdir) \ +- $(mandir)/kak.1.gz ++ $(mandir)/kak.1 +=20 + .PHONY: check TAGS clean distclean installdirs install install-strip unin= stall + .PHONY: tags test man doc diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm index 4e2324dbe..8b7e95975 100644 =2D-- a/gnu/packages/text-editors.scm +++ b/gnu/packages/text-editors.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 Jos=C3=A9 Miguel S=C3=A1nchez Garc=C3=ADa +;;; Copyright =C2=A9 2016 Carlo Zancanaro ;;; ;;; 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) =2D #: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)) =20 (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=3D" (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=3D-D_GLIBCXX_USE_CXX11_ABI=3D0") + + #: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 =3D \"" (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 te= xt +editing language\" model. Kakoune has a strong focus on interactivity, mo= st +commands provide immediate and incremental results, while still being +competitive (as in keystroke count) with Vim.") + (home-page "http://kakoune.org/") + (license license:unlicense)))) =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEETnMK3I26XHaBYsl5wFUlyLtgbSsFAliCvioACgkQwFUlyLtg bSuiqQf+O65G/t4rMdR2LHsSCsOmRda+ZRgPvh+S3xxUq6Aw5fR16ljRMH2Mi9T9 JjVOR0dL0jt6wQIwOuJ9Rt2nOOFUhPIT3bAGHewsIBLhB40ImLRRTwoiKpuk2MBm NtkWk1cLtnYbHQpR8yrgB5vRandMmPYyXkpn4M3gT6StrsDrF2FEDOZ9VNTuXseY OYCr8iyS9++xjXgOU1QEV8NJWbxulfgvKQf2a57Yz/1n7vrVBxOWGRLvmvl3+iN5 Xdob8FGeGyqR7N8e91pltQtTBnAi+PNIk4I6BhEcUlyGU0BNa6MuzbGpkfBSbYVV aEiZkjATVpGMSYde5tO2FITR6Mly3w== =2tau -----END PGP SIGNATURE----- --==-=-=--