From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: [PATCH] gnu: Add kakoune Date: Thu, 26 Jan 2017 23:26:43 +1100 Message-ID: <87o9yut3b0.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> <87vat9uqqd.fsf@zancanaro.id.au> <87efzq3yxq.fsf@gnu.org> 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]:44582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWj8h-0008O5-1O for guix-devel@gnu.org; Thu, 26 Jan 2017 07:26:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWj8c-0001LV-UY for guix-devel@gnu.org; Thu, 26 Jan 2017 07:26:55 -0500 In-reply-to: <87efzq3yxq.fsf@gnu.org> 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Jan 26 2017, Ludovic Court=C3=A8s wrote > It=E2=80=99s simpler to add --no-name (which suppresses timestamps and fi= le > names from the gzip output) to all the gzip invocation in this Makefile. > > Could you do that? Done! Patch attached. I've also updated it to the most recent commit again. I figure it's worth committing it as up-to-date as possible. Carlo --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-kakoune.patch Content-Transfer-Encoding: quoted-printable From=206ca08153fb987d49c535120a7b451e1935d6627e 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 | 28 ++++++++ gnu/packages/text-editors.scm | 78 ++++++++++++++++++= +++- 3 files changed, 106 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 59fc1a82c..e22c8e471 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -643,6 +643,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/khmer-use-libraries.patch \ %D%/packages/patches/kmod-module-directory.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..943647d0c =2D-- /dev/null +++ b/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch @@ -0,0 +1,28 @@ +Kakoune uses gzip to compress its manpages, but this saves the original ti= me +stamp into the file. If we add --no-name to the uses of gzip then we get a +reproducible build. + +--- a/src/Makefile ++++ b/src/Makefile +@@ -71,19 +71,19 @@ + $(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 + a2x --no-xmllint -f manpage $< +- gzip -f $(basename $<) ++ gzip -f --no-name $(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 + 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) ++ gzip -f --no-name $(@:.gz=3D.1) + mv -f $(@:.gz=3D.1.gz) $@ +=20 + check: test + test: diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm index 4e2324dbe..110234a49 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 "125c8b7e80995732e0d8c87b82040025748f1b4f") + (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 + "19qs99l8r9p1vi5pxxx9an22fvi7xx40qw3jh2cnh2mbacawvdyb")) + (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----- iQEzBAEBCAAdFiEETnMK3I26XHaBYsl5wFUlyLtgbSsFAliJ6wMACgkQwFUlyLtg bSvxLwf+PFxsnL9X6izSZO7iOafIuXp96MRyqYJIAazbgWqrR+D2CA7DATfEwOFt SU/z3LZ2Y6M1Wq7SFjxk4MnPtzKQYOe71RO4MLU3/YQvTqq2Z77XJHDdfmKlJ3Bl mnr7yuwkyHCPIC0d760COPNl2Fa25vA54KaiTc/D5733rcgeedK76KmOb3JsQvRJ uafkndG4ciT1vUNpYBUN4XtFoN4N6Ynf6PaI4oBwee264fzV/sVDHCdFDm0Nc/v2 oPlQSLE9P+/QBk+5Gx9sL3ANGv5sKn8Qc2cQhmQZN8ihHWSItr5PrrwwhCA++72m wW3mnSu1GKHyhWO77vGZVENC5jjDUA== =x8rV -----END PGP SIGNATURE----- --==-=-=--