Use https by default
[gentoo.git] / app-emulation / xtrs / xtrs-4.9d-r3.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit flag-o-matic toolchain-funcs readme.gentoo
8
9 DESCRIPTION="Radio Shack TRS-80 emulator"
10 HOMEPAGE="http://www.tim-mann.org/xtrs.html"
11 SRC_URI="http://www.tim-mann.org/trs80/${P}.tar.gz
12         ls-dos? (
13                 http://www.tim-mann.org/trs80/ld4-631.zip
14                 https://dev.gentoo.org/~ulm/distfiles/ld4-631l.xd3
15         )"
16
17 LICENSE="xtrs ls-dos? ( freedist )"
18 SLOT="0"
19 KEYWORDS="amd64 ppc x86 ~x86-fbsd"
20 IUSE="ls-dos"
21 RESTRICT="ls-dos? ( bindist )"
22
23 RDEPEND="sys-libs/ncurses
24         sys-libs/readline:0
25         >=x11-libs/libX11-1.0.0"
26 DEPEND="${RDEPEND}
27         ls-dos? ( app-arch/unzip dev-util/xdelta:3 )"
28
29 src_prepare() {
30         sed -i -e 's/$(CC) -o/$(CC) $(LDFLAGS) -o/' Makefile || die
31         if use ls-dos; then
32                 cd "${WORKDIR}" || die
33                 xdelta3 -d -s ld4-631.dsk "${DISTDIR}"/ld4-631l.xd3 out.dsk || die
34                 mv out.dsk ld4-631.dsk || die
35         fi
36 }
37
38 src_compile() {
39         use ppc && append-flags -Dbig_endian
40         emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}"
41 }
42
43 src_install() {
44         dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
45         emake PREFIX="${D}"/usr install
46
47         insopts -m0444
48         insinto /usr/share/xtrs/disks
49         doins cpmutil.dsk utility.dsk
50
51         if use ls-dos; then
52                 doins "${WORKDIR}"/ld4-631.dsk
53                 dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
54                 dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
55         fi
56
57         dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html
58
59         DOC_CONTENTS="For copyright reasons, xtrs does not include actual ROM
60                 images. Because of this, unless you supply your own ROM, xtrs will
61                 not function in any mode except 'Model 4p' mode (a minimal free ROM
62                 is included for this), which can be run like this:
63                 \n\nxtrs -model 4p -diskdir /usr/share/xtrs
64                 \n\nIf you already own a copy of the ROM software (e.g., if you have
65                 a TRS-80 with this ROM), then you can make yourself a copy of this
66                 for use with xtrs, using utilities available on the web. To load
67                 your own ROM, specify the '-romfile' option, or the 'Xtrs.romfile'
68                 X resource. ROM files can be in Intel hex or binary format."
69         readme.gentoo_create_doc
70 }