summaryrefslogtreecommitdiff
path: root/app-shells/fzy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-shells/fzy
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-shells/fzy')
-rw-r--r--app-shells/fzy/Manifest8
-rw-r--r--app-shells/fzy/files/fzy-0.9-cflags.patch11
-rw-r--r--app-shells/fzy/files/fzy-add-utf-8-support.patch89
-rw-r--r--app-shells/fzy/fzy-0.10_pre20180618.ebuild40
-rw-r--r--app-shells/fzy/fzy-0.9-r1.ebuild36
-rw-r--r--app-shells/fzy/fzy-9999.ebuild39
-rw-r--r--app-shells/fzy/metadata.xml23
7 files changed, 246 insertions, 0 deletions
diff --git a/app-shells/fzy/Manifest b/app-shells/fzy/Manifest
new file mode 100644
index 000000000000..a0b9bf68cf47
--- /dev/null
+++ b/app-shells/fzy/Manifest
@@ -0,0 +1,8 @@
+AUX fzy-0.9-cflags.patch 299 BLAKE2B 61685e7180741ec77449b5de6fa711b4939faedd94dfcfd84ec86be0ef963b13d5a5308e294f4f22e83682982671a528b64446979fe41e112aeb8c5d143e865e SHA512 f3ea9b90a75f0a013466ef00190dbca451b22015e0a3c3f7e823f61dc2e4ef7d64f90a9685fec311675fb6c5bc788bb7436da2fd89f4f6baade4dfbee8318635
+AUX fzy-add-utf-8-support.patch 2642 BLAKE2B bdece2ab5d9122c9c2f306271b1c795c1130c145e3a434d4b831dd680bbdc09e5241763391fc2efa16a6af50cfbaf49b3fe98364f5f56a25b2d78af8fcba8a1b SHA512 203c0e8e7a9583661cd7d85cc094016eed2149a82fb55a578075e5d2fe513cbe2f7241ea76660e5990efd6b5f573f584ab3345ae832439fbea80950c64f7803b
+DIST fzy-0.9.tar.gz 42992 BLAKE2B ebc7e73e0387101da65896a4108705048bb72b01261ea86a0abeaee22fe4517ac54351d508bb79419b05a15aa9c93c5d815c34d15353d01c02381e5d342e75b7 SHA512 71a44bc3bbef3a2d82476a69b5c9e28753e760bbb8d453a9e44b57f34a79dd8ebcd510a869dfeae95f522ba6ccb4b8f10f79c081ce6bc6cfae9a41f4071fefc0
+DIST fzy-2697c02618d908e5bdcae93ab4815b04c49bd25e.tar.gz 45814 BLAKE2B bb4dbc668dd93c71d16c3affdaf148212e3fbdef27110314b8145fd4a20991bb368f7aef1d1f7bd147afa23900800c468b4d9b2999de2226ce9a312a02d344b4 SHA512 34520dc3b4bcbad3479cce1fbeb014b1851edc1b1f4460c21a645297bf9ec01a1483f108a562f6ac6d3c0def97427740b74e9a3b83c85223d14ac3e1586e3d8e
+EBUILD fzy-0.10_pre20180618.ebuild 910 BLAKE2B f85ecd8009fa3cb57e4ffa4a301bae52e66c1ff2b3e63b054c17f0d1c508975751ab5ae1f0f2f8486544e7db10925ca4366a96f546ae6259bee48d43d9a1b41c SHA512 06d1f7ed9ace6efe8edaa696be83c748fab4ef175861c8dc34273a1aa343123ea52de378e798abb7d788373ebacbe7a42df98f2a3e26288d2101c4ec2b0fec5e
+EBUILD fzy-0.9-r1.ebuild 748 BLAKE2B d79ee7668ea80c307dd08ade2ec1f9b37755bc1864c315212cd5c06b69efdb29f1afea6d6426ef76a362e1f815307e80f676ecce675ddff7cd67b8c1baa189d7 SHA512 7280d7d67a97663649cc7efc188e17ba551513c55892dc3e50c130bf35501e15a34e06739a95b25664a900518b686763de795c4e410fdb1b56ad6efd5f1bc11e
+EBUILD fzy-9999.ebuild 858 BLAKE2B f47be140cd154dac3f589da519228c7d14ed66a13cf5b31510e5a07c7aa04119c5f1a384478c3227f86aab596a56ba4cb966093a334b54631c52f67429879cd8 SHA512 cd1a846ccfbbb38b499a3ed77ce96fcec263d0c75c2478aa237803cb474a81524c1be4ae6395cdb3d2c27854d074d031729209aede9d69118dd116f128303c97
+MISC metadata.xml 892 BLAKE2B 3182bda5d04463762d724265d2ff3644eef1615dfbd2db92ad7ab5e1bf3b9e5f0f727dc55939e0c0902ed16ac78d4a39ae331d22902ec7f7f10d53a7e65a59ba SHA512 202ff3dc44543bf072b32addfc5e1ad627ec6fa16585d9ff9ddbe68bfaa784aa0319ed152621215cd60f1c2a688bb0e3ca227b78fc6b62f5dca4f39b2ad8a55b
diff --git a/app-shells/fzy/files/fzy-0.9-cflags.patch b/app-shells/fzy/files/fzy-0.9-cflags.patch
new file mode 100644
index 000000000000..328abc9c6fe7
--- /dev/null
+++ b/app-shells/fzy/files/fzy-0.9-cflags.patch
@@ -0,0 +1,11 @@
+--- fzy-0.9/Makefile
++++ fzy-0.9/Makefile
+@@ -1,7 +1,7 @@
+ VERSION=0.9
+
+ CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
+-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
++CFLAGS+=-Wall -Wextra -std=c99 -pedantic -Ideps
+ PREFIX?=/usr/local
+ MANDIR?=$(PREFIX)/share/man
+ BINDIR?=$(PREFIX)/bin
diff --git a/app-shells/fzy/files/fzy-add-utf-8-support.patch b/app-shells/fzy/files/fzy-add-utf-8-support.patch
new file mode 100644
index 000000000000..886957379a83
--- /dev/null
+++ b/app-shells/fzy/files/fzy-add-utf-8-support.patch
@@ -0,0 +1,89 @@
+From 8dd7a9f49c2b65f28025902106f364ff11d4170d Mon Sep 17 00:00:00 2001
+From: syrrim <syrrim0@gmail.com>
+Date: Mon, 23 Apr 2018 01:25:48 -0400
+Subject: [PATCH] add utf-8 support to input, fixes #21
+
+- non ascii bytes won't be ignored
+- one can seek over and delete whole utf-8 codepoints at a time
+- the cursor will be positioned properly around double width chars
+---
+ src/tty_interface.c | 31 ++++++++++++++++++++++++++-----
+ 1 file changed, 26 insertions(+), 5 deletions(-)
+
+diff --git a/src/tty_interface.c b/src/tty_interface.c
+index a7d506e..35f2919 100644
+--- a/src/tty_interface.c
++++ b/src/tty_interface.c
+@@ -7,6 +7,14 @@
+ #include "tty_interface.h"
+ #include "../config.h"
+
++static int isprint_unicode(char c){
++ return isprint(c) || c & (1<<7);
++}
++
++static int is_boundary(char c) {
++ return ~c & (1<<7) || c & (1<<6);
++}
++
+ static void clear(tty_interface_t *state) {
+ tty_t *tty = state->tty;
+
+@@ -95,7 +103,10 @@ static void draw(tty_interface_t *state) {
+ tty_moveup(tty, num_lines);
+ }
+
+- tty_setcol(tty, strlen(options->prompt) + state->cursor);
++ tty_setcol(tty, 0);
++ fputs(options->prompt, tty->fout);
++ for(size_t i=0; i<state->cursor; i++)
++ fputc(state->search[i], tty->fout);
+ tty_flush(tty);
+ }
+
+@@ -138,9 +149,13 @@ static void action_del_char(tty_interface_t *state) {
+ if(state->cursor == 0) {
+ return;
+ }
++ size_t original_cursor = state->cursor;
+
+ state->cursor--;
+- memmove(&state->search[state->cursor], &state->search[state->cursor + 1], length - state->cursor);
++ while(!is_boundary(state->search[state->cursor]) && state->cursor)
++ state->cursor--;
++
++ memmove(&state->search[state->cursor], &state->search[original_cursor], length - original_cursor + 1);
+ }
+ }
+
+@@ -178,13 +193,19 @@ static void action_next(tty_interface_t *state) {
+ }
+
+ static void action_left(tty_interface_t *state) {
+- if (state->cursor > 0)
++ if (state->cursor > 0){
+ state->cursor--;
++ while(!is_boundary(state->search[state->cursor]) && state->cursor)
++ state->cursor--;
++ }
+ }
+
+ static void action_right(tty_interface_t *state) {
+- if (state->cursor < strlen(state->search))
++ if (state->cursor < strlen(state->search)){
+ state->cursor++;
++ while(!is_boundary(state->search[state->cursor]))
++ state->cursor++;
++ }
+ }
+
+ static void action_beginning(tty_interface_t *state) {
+@@ -315,7 +336,7 @@ static void handle_input(tty_interface_t *state, const char *s) {
+
+ /* No matching keybinding, add to search */
+ for (int i = 0; input[i]; i++)
+- if (isprint(input[i]))
++ if (isprint_unicode(input[i]))
+ append_search(state, input[i]);
+
+ /* We have processed the input, so clear it */
diff --git a/app-shells/fzy/fzy-0.10_pre20180618.ebuild b/app-shells/fzy/fzy-0.10_pre20180618.ebuild
new file mode 100644
index 000000000000..1e4cb47604e9
--- /dev/null
+++ b/app-shells/fzy/fzy-0.10_pre20180618.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit savedconfig toolchain-funcs
+
+EGIT_COMMIT="2697c02618d908e5bdcae93ab4815b04c49bd25e"
+
+DESCRIPTION="Fuzzy text selector (interactive grep) for console"
+HOMEPAGE="https://github.com/jhawthorn/fzy"
+SRC_URI="https://github.com/jhawthorn/fzy/archive/${EGIT_COMMIT}.tar.gz -> ${PN}-${EGIT_COMMIT}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+PATCHES=(
+ "${FILESDIR}"/fzy-0.9-cflags.patch
+ "${FILESDIR}"/fzy-add-utf-8-support.patch
+)
+
+S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
+
+src_prepare() {
+ default
+ restore_config config.h
+ tc-export CC
+}
+
+src_install() {
+ local DOCS=( ALGORITHM.md CHANGELOG.md README.md )
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+ exeinto /usr/share/fzy
+ doexe contrib/fzy-tmux
+ doexe contrib/fzy-dvtm
+ einstalldocs
+ save_config config.h
+}
diff --git a/app-shells/fzy/fzy-0.9-r1.ebuild b/app-shells/fzy/fzy-0.9-r1.ebuild
new file mode 100644
index 000000000000..3db8979e1bd9
--- /dev/null
+++ b/app-shells/fzy/fzy-0.9-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit savedconfig toolchain-funcs
+
+DESCRIPTION="Fuzzy text selector (interactive grep) for console"
+HOMEPAGE="https://github.com/jhawthorn/fzy"
+SRC_URI="https://github.com/jhawthorn/fzy/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test"
+
+KEYWORDS="~amd64 ~x86"
+
+PATCHES=( "${FILESDIR}"/${P}-cflags.patch )
+
+src_prepare() {
+ default
+ restore_config config.h
+
+ tc-export CC
+}
+
+src_install() {
+ local DOCS=( ALGORITHM.md CHANGELOG.md README.md )
+
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+ exeinto /usr/share/fzy
+ doexe contrib/fzy-tmux
+ doexe contrib/fzy-dvtm
+ einstalldocs
+ save_config config.h
+}
diff --git a/app-shells/fzy/fzy-9999.ebuild b/app-shells/fzy/fzy-9999.ebuild
new file mode 100644
index 000000000000..bbf7b6adbe55
--- /dev/null
+++ b/app-shells/fzy/fzy-9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/jhawthorn/fzy.git"
+else
+ SRC_URI="https://github.com/jhawthorn/fzy/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Fuzzy text selector (interactive grep) for console"
+HOMEPAGE="https://github.com/jhawthorn/fzy"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test"
+
+PATCHES=( "${FILESDIR}"/fzy-0.9-cflags.patch )
+
+src_prepare() {
+ default
+ restore_config config.h
+ tc-export CC
+}
+
+src_install() {
+ local DOCS=( ALGORITHM.md CHANGELOG.md README.md )
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+ exeinto /usr/share/fzy
+ doexe contrib/fzy-tmux
+ doexe contrib/fzy-dvtm
+ einstalldocs
+ save_config config.h
+}
diff --git a/app-shells/fzy/metadata.xml b/app-shells/fzy/metadata.xml
new file mode 100644
index 000000000000..2bec1538ec7f
--- /dev/null
+++ b/app-shells/fzy/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gyakovlev@gentoo.org</email>
+ <name>Georgy Yakovlev</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>shell-tools@gentoo.org</email>
+ <name>Gentoo Shell Tools Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Fuzzy text selector (interactive grep) for console.
+ It can be used to filter any list:
+ files, command history, processes, hostnames, bookmarks, git commits, etc.
+ It's designed to be used both as an editor plugin and on the command line.
+ Rather than clearing the screen, fzy displays its interface directly below
+ the current cursor position, scrolling the screen if necessary.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">jhawthorn/fzy</remote-id>
+ </upstream>
+</pkgmetadata>