ddgr: new recipe (#3287)

This commit is contained in:
Crestwave
2018-10-28 06:17:29 +08:00
committed by fbrosson
parent ad96ca1037
commit 0dbf960e67
2 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
SUMMARY="DuckDuckGo from the terminal"
DESCRIPTION="ddgr is a command-line tool to search DuckDuckGo. ddgr shows the \
title, URL and text context for each result. Results are fetched in pages. \
Keyboard shortcuts are available for page navigation. Results are indexed \
and a result URL can be opened in a browser using the index number. There is \
no configuration file as aliases serve the same purpose for this utility. \
Supports sequential searches in a single instance.
Features:
* Fast and clean (no ads, stray URLs or clutter), custom color
* Designed to deliver maximum readability at minimum space
* Specify the number of search results to show per page
* Navigate result pages from omniprompt, open URLs in browser
* Search and option completion scripts for Bash, Zsh and Fish
* DuckDuckGo Bang support (along with completion)
* Open the first result directly in browser (as in I'm Feeling Ducky)
* Non-stop searches: fire new searches at omniprompt without exiting
* Keywords (e.g. filetype:mime, site:somesite.com) support
* Limit search by time, specify region, disable safe search
* HTTPS proxy support, Do Not Track set, optionally disable User Agent
* Support custom url handler script or cmdline utility
* Comprehensive documentation, man page with handy usage examples
* Minimal dependencies"
HOMEPAGE="https://github.com/jarun/ddgr"
COPYRIGHT="2016-2018 Arun Prakash Jana"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="b442f707a2c2ead42233d3bf3a9bf919e32ab9860e20d9d39f860840c13c0392"
SOURCE_FILENAME="ddgr-$portVersion.tar.gz"
PATCHES="ddgr-1.5.patch"
ARCHITECTURES="any"
PROVIDES="
ddgr = $portVersion
cmd:ddgr
"
REQUIRES="
haiku
cmd:python3
"
BUILD_REQUIRES="
haiku_devel
cmd:make
"
INSTALL()
{
make BINDIR=$binDir MANDIR=$manDir/man1 DOCDIR=$docDir install
}
TEST()
{
make test
}

View File

@@ -0,0 +1,30 @@
--- a/ddgr 2018-10-27 11:53:48.347865088 +0000
+++ b/ddgr 2018-10-27 11:54:53.463470592 +0000
@@ -1517,6 +1517,8 @@
copier_params = ['pbcopy']
elif sys.platform == 'win32':
copier_params = ['clip']
+ elif sys.platform.startswith('haiku'):
+ copier_params = ['clipboard', '-i']
# If native clipboard utilities are absent, try to use terminal
# multiplexers, tmux/GNU screen, as fallback.
--- a/README.md 2018-10-27 11:53:55.458227712 +0000
+++ b/README.md 2018-10-27 11:57:42.615251968 +0000
@@ -77,7 +77,7 @@
`ddgr` requires Python 3.4 or later. Only the latest patch release of each minor version is supported.
-To copy url to clipboard at the omniprompt, `ddgr` looks for `xsel` or `xclip` or `termux-clipboard-set` (in the same order) on Linux, `pbcopy` (default installed) on OS X and `clip` (default installed) on Windows.
+To copy url to clipboard at the omniprompt, `ddgr` looks for `xsel` or `xclip` or `termux-clipboard-set` (in the same order) on Linux, `pbcopy` (default installed) on OS X, `clip` (default installed) on Windows and `clipboard` (default installed) on Haiku.
Note: v1.1 and below require the Python3 `requests` library to make HTTPS requests. This dependency is removed in the later releases.
@@ -87,6 +87,7 @@
- [Debian](https://packages.debian.org/search?keywords=ddgr&searchon=names&exact=1) (`apt-get install ddgr`)
- [Fedora](https://apps.fedoraproject.org/packages/ddgr) (`dnf install ddgr`)
- [FreeBSD](https://www.freshports.org/www/ddgr/) (`pkg install ddgr`)
+- [Haiku](https://github.com/haikuports/haikuports/tree/master/www-client/ddgr) (`pkgman install ddgr`)
- [Homebrew](http://formulae.brew.sh/formula/ddgr) (`brew install ddgr`)
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/misc/ddgr) (`nix-env -i ddgr`)
- [openSUSE](https://software.opensuse.org/package/ddgr) (`zypper in ddgr`)