xtrs-4.9d-r3.ebuild 2.1 KB

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