Hi,

On Thu, Jan 16, 2020 at 06:08:08PM +0000, Edd Barrett wrote:
> My diff is below. We probably want to merge Aaron's diff with mine.

Here's that diff. I also updated to 0.20.0.

Notes:

 - Generated vendor tarball by tarring up the result of 'go mod vendor'.

 - port-lib-depends-check asked me to remove 'c pthread' so it
   disappears entirely. Right?

 - See the comment about the "completion files" not being what we might
   expect.

 - Also note that bash doesn't seem to have a standard location for
   site functions. Installed the sourcable files in share/fzf/bash. For
   the other shells, install in standard locations.

Seems to work fine.

OK?


Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/fzf/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile    12 Jul 2019 20:49:43 -0000      1.3
+++ Makefile    17 Jan 2020 10:32:57 -0000
@@ -2,21 +2,18 @@
 
 COMMENT =      command-line fuzzy finder
 
-DISTNAME =     fzf-0.17.5
+DISTNAME =     fzf-0.20.0
 
 CATEGORIES =   sysutils
 
 HOMEPAGE =     https://github.com/junegunn/fzf
 
-MAINTAINER =   Aaron Bieber <[email protected]>
-
 # BSD
 PERMIT_PACKAGE =       Yes
 
 # uses pledge()
-WANTLIB += c pthread
 
-MASTER_SITES = https://deftly.net/
+MASTER_SITES = https://theunixzoo.co.uk/distfiles/
 
 MODULES =      lang/go
 MODGO_TYPE =   bin
@@ -25,10 +22,33 @@ NO_TEST =   Yes
 
 ALL_TARGET = github.com/junegunn/fzf
 
+
+# Note that unlike zsh and fish, bash has no well-defined site functions
+# directory from which to autoload stuff.
+#
+# Note also that the completion files referenced here are not defining words to
+# complete, but rather overriding what happens when the user requests
+# completion via typing **<tab>.
+ZSH_SITE =     ${PREFIX}/share/zsh/site-functions
+FISH_SITE =    ${PREFIX}/share/fish/functions
+BASH_SITE =    ${PREFIX}/share/fzf/bash
+SUBST_VARS +=  BASH_SITE FISH_SITE
+
 do-install:
        ${INSTALL_PROGRAM} ${WRKDIR}/go/bin/* ${PREFIX}/bin
        ${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${PREFIX}/bin
        ${INSTALL_MAN_DIR} ${PREFIX}/man/man1
        ${INSTALL_MAN} ${WRKSRC}/man/man1/*.1 ${PREFIX}/man/man1
+
+       ${INSTALL_DATA_DIR} ${ZSH_SITE}
+       ${INSTALL_DATA} ${WRKSRC}/shell/key-bindings.zsh 
${ZSH_SITE}/_fzf_key_bindings
+       ${INSTALL_DATA} ${WRKSRC}/shell/completion.zsh 
${ZSH_SITE}/_fzf_completion
+
+       ${INSTALL_DATA_DIR} ${FISH_SITE}
+       ${INSTALL_DATA} ${WRKSRC}/shell/key-bindings.fish 
${FISH_SITE}/fzf-key-bindings.fish
+
+       ${INSTALL_DATA_DIR} ${BASH_SITE}
+       ${INSTALL_DATA} ${WRKSRC}/shell/key-bindings.bash ${BASH_SITE}
+       ${INSTALL_DATA} ${WRKSRC}/shell/completion.bash ${BASH_SITE}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/fzf/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo    16 Dec 2018 01:05:53 -0000      1.2
+++ distinfo    17 Jan 2020 10:31:58 -0000
@@ -1,2 +1,2 @@
-SHA256 (fzf-0.17.5.tar.gz) = HKKM5mvQ38zuoo71g5/dAS0riCu5/Rs7bQ1miui52EM=
-SIZE (fzf-0.17.5.tar.gz) = 6413887
+SHA256 (fzf-0.20.0.tar.gz) = S8ymcqwjIMqpDpEg9Rkj/aHbmlMltgXQOXu+58A8s0o=
+SIZE (fzf-0.20.0.tar.gz) = 2319334
Index: 
patches/patch-vendor_github_com_junegunn_fzf_src_protector_protector_openbsd_go
===================================================================
RCS file: 
/cvs/ports/sysutils/fzf/patches/patch-vendor_github_com_junegunn_fzf_src_protector_protector_openbsd_go,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 
patch-vendor_github_com_junegunn_fzf_src_protector_protector_openbsd_go
--- 
patches/patch-vendor_github_com_junegunn_fzf_src_protector_protector_openbsd_go 
    12 Jun 2018 00:10:00 -0000      1.1.1.1
+++ 
patches/patch-vendor_github_com_junegunn_fzf_src_protector_protector_openbsd_go 
    17 Jan 2020 10:22:09 -0000
@@ -12,5 +12,5 @@ Index: vendor/github.com/junegunn/fzf/sr
 +
 +// Protect calls OS specific protections like pledge on OpenBSD
 +func Protect(s string) {
-+      unix.Pledge(s, nil)
++      unix.PledgePromises(s)
 +}
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/fzf/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   12 Jun 2018 00:10:00 -0000      1.1.1.1
+++ pkg/PLIST   16 Jan 2020 17:42:06 -0000
@@ -3,3 +3,15 @@
 bin/fzf-tmux
 @man man/man1/fzf-tmux.1
 @man man/man1/fzf.1
+share/doc/pkg-readmes/${PKGSTEM}
+share/fish/
+share/fish/functions/
+share/fish/functions/fzf-key-bindings.fish
+share/fzf/
+share/fzf/bash/
+share/fzf/bash/completion.bash
+share/fzf/bash/key-bindings.bash
+share/zsh/
+share/zsh/site-functions/
+share/zsh/site-functions/_fzf_completion
+share/zsh/site-functions/_fzf_key_bindings
Index: pkg/README
===================================================================
RCS file: pkg/README
diff -N pkg/README
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/README  16 Jan 2020 17:59:25 -0000
@@ -0,0 +1,46 @@
++-------------------------------------------------------------------------------
+| Running ${PKGSTEM} on OpenBSD
++-------------------------------------------------------------------------------
+
+Shell Integration
+=================
+
+shells/zsh
+----------
+
+To enable all support, add this to your ~/.zshrc:
+
+```
+autoload _fzf_key_bindings _fzf_completion
+_fzf_key_bindings
+_fzf_completion
+```
+
+_fzf_key_bindings causes zsh to use fzf for things like CTRL+r and CTRL+t,
+whereas _fzf_completion makes zsh use fzf for **<tab> completion.
+
+shells/bash
+-----------
+
+To enable all support, add this to your ~/.bashrc:
+
+```
+source ${BASH_SITE}/key_bindings.bash
+source ${BASH_SITE}/completion.bash
+```
+
+These two files have the same roles as their zsh counterparts.
+
+shells/fish
+-----------
+
+Although the function used to set up fzf is auto-loaded, it can't be used in
+the shell config, so we have to source it anyway. Put the following in
+~/.config/fish/config.fish:
+
+```
+source ${FISH_SITE}/functions/fzf-key-bindings.fish
+fzf_key_bindings
+```
+
+There is no **<tab> completion support for fish.


-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply via email to