summaryrefslogtreecommitdiff
blob: 3b193b357e922adb964de80c4449ed8fb0f112c9 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

MY_P="${P/_p/-r}"

DESCRIPTION="Design system for interactive fiction"
HOMEPAGE="https://www.inform-fiction.org/"
SRC_URI="https://ifarchive.org/if-archive/infocom/compilers/inform6/source/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="Artistic-2 Inform"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="emacs tools"
# non-interactive tests use ruby, seem broken, and return true even on failure
RESTRICT="test"

RDEPEND="
	tools? (
		dev-lang/perl
		dev-perl/DateTime
	)"
PDEPEND="emacs? ( app-emacs/inform-mode )"

src_compile() {
	tc-export CC

	emake PREFIX="${EPREFIX}"/usr OPTS="${CFLAGS} ${CPPFLAGS}"
}

src_install() {
	local emakeargs=(
		PREFIX="${ED}"/usr
		REAL_PREFIX="${EPREFIX}"/usr
		MANDIR="${ED}"/usr/share/man/man1
		PUNYDOCS="${ED}"/usr/share/doc/${PF}/punyinform
		PUNYTESTS="${T}" # don't install tests
	)

	emake -j1 "${emakeargs[@]}" install

	dodoc AUTHORS NEWS README.md VERSION docs/README*

	use tools || rm "${ED}"/usr/bin/*blorb* || die

	find "${ED}"/usr/share/doc \( -name Makefile -o -name 'custom.*' \) -delete || die
}