summaryrefslogtreecommitdiff
blob: 5412959d81b62b5488a319a6f6cb734cad61a0b9 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=4
inherit eutils flag-o-matic toolchain-funcs versionator

MY_P=${PN}-$(replace_all_version_separators "")

DESCRIPTION="A portable viewer of binary files, hexadecimal and disassembler modes"
HOMEPAGE="http://beye.sourceforge.net/"
SRC_URI="mirror://sourceforge/beye/${PV}/${MY_P}-src.tar.bz2"
S=${WORKDIR}/${MY_P}

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="gpm cpu_flags_x86_mmx cpu_flags_x86_sse"
REQUIRED_USE="cpu_flags_x86_mmx cpu_flags_x86_sse"

RDEPEND="gpm? ( sys-libs/gpm )"
DEPEND="${RDEPEND}"

pkg_setup() {
	append-flags -mmmx -msse #362043
}

src_prepare() {
	epatch "${FILESDIR}/${PN}-610-fix_localedep-1.patch"
	epatch "${FILESDIR}/${PN}-610-portable_configure-1.patch"
	epatch "${FILESDIR}/${PN}-610-crash.patch"
	sed -i -e 's^man/man1/biew.1^share/man/man1/biew.1^' makefile || die "Failed to edit makefile."
}

src_configure() {
	if use gpm; then
		append-cppflags -DHAVE_MOUSE
	else
		append-cppflags -UHAVE_MOUSE
	fi
	./configure --datadir=/usr/share/${PN} \
		--prefix=/usr \
		--cc="$(tc-getCC)" \
		--ld="$(tc-getCC)" \
		--ar="$(tc-getAR) -rcu" \
		--as="$(tc-getAS)" \
		--ranlib="$(tc-getRANLIB)" || die "configure failed."
}

src_compile() {
	emake LDFLAGS="${LDFLAGS}"
}

src_install() {
	emake DESTDIR="${D}" install
	dodoc doc/{biew_en,release,unix}.txt
}

pkg_postinst() {
	elog
	elog "Note: if you are upgrading from <=dev-util/biew-6.1.0 you will need"
	elog "to change the paths in the setup dialog (F9) from /usr/share/ to"
	elog "/usr/share/biew/ Alternatively, you can delete ~/.biewrc and it will"
	elog "automatically determine the correct locations on the next run."
	elog
}