dev-util/xxd: Add from Gentoo

It's from Gentoo commit 4d3a957c9a0dcc3e4a274c09e39c9da7a7aabfe4.

Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
This commit is contained in:
Krzesimir Nowak 2026-01-06 16:10:06 +01:00
parent 6ceada1be8
commit 1dabcb2948
4 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST vim-9.1.1683.tar.gz 18762645 BLAKE2B e43f060668131fbf84cdaf7c8f831787f9a3e46607c8af8b67b78490abfcc9c2ab277ea53ddbedf7bee899034b06278cf1d67ddd9d397272ef9d97d909d3fafd SHA512 1d68f55198bb363933e04e925118b6d03ddf775f35e67d7a41464df1ae86a0f2efff7434a0a169e89b1453b554c00b6bfc0dfe3b0b0a8651e4ac89267bc51316

View File

@ -0,0 +1,24 @@
# Author: Ciaran McCreesh <ciaranm@gentoo.org>
#
# completion for xxd
_xxd()
{
local cur prev cmd args
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
cmd=${COMP_WORDS[0]}
if [[ "${cur}" == -* ]] ; then
args='-a -b -c -E -g -h -i -l -ps -r -s -u -v'
COMPREPLY=( $( compgen -W "${args}" -- $cur ) )
else
_filedir
fi
}
complete -F _xxd xxd
# vim: set ft=sh sw=4 et sts=4 :

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>holger@applied-asynchrony.com</email>
<name>Holger Hoffstätte</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<remote-id type="github">vim/vim</remote-id>
<remote-id type="cpe">cpe:/a:vim:vim</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,49 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit bash-completion-r1 toolchain-funcs
VIM_VERSION="9.1.1683"
DESCRIPTION="Standalone version of Vim's xxd"
HOMEPAGE="
https://www.vim.org
https://github.com/vim/vim
"
SRC_URI="https://github.com/vim/vim/archive/v${VIM_VERSION}.tar.gz -> vim-${VIM_VERSION}.tar.gz"
S="${WORKDIR}/vim-${VIM_VERSION}/src/xxd"
LICENSE="|| ( GPL-2 MIT )"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
RDEPEND="!<app-editors/vim-core-9.1.1652-r1"
src_prepare() {
default
# international man pages need some renaming:
# xxd-<lang>.UTF-8.1 -> xxd.<lang>.1
cd ../../runtime/doc || die
local f newname
for f in xxd-*.UTF-8.1 ; do
newname=${f//xxd-/xxd.}
newname=${newname//UTF-8\./}
mv -f "${f}" "${newname}" || die
done
}
src_compile() {
tc-export CC
export {C,CPP,LD}FLAGS
emake
}
src_install() {
dobin xxd
doman ../../runtime/doc/xxd*.1
newbashcomp "${FILESDIR}"/xxd-completion xxd
}