summaryrefslogtreecommitdiff
path: root/dev-util/xxd/xxd-2025.08.24-r1.ebuild
blob: 9be6badbaa65508a3ea0630c308904f07897bac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
}