xtrs-4.9d-r4.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit flag-o-matic toolchain-funcs readme.gentoo-r1
  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"
  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. eapply_user
  25. if use ls-dos; then
  26. cd "${WORKDIR}" || die
  27. xdelta3 -d -s ld4-631.dsk "${DISTDIR}"/ld4-631l.xd3 out.dsk || die
  28. mv out.dsk ld4-631.dsk || die
  29. fi
  30. }
  31. src_compile() {
  32. case $(tc-endian) in
  33. little) ;;
  34. big) append-flags -Dbig_endian ;;
  35. *) die ;;
  36. esac
  37. emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}"
  38. }
  39. src_install() {
  40. dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
  41. emake PREFIX="${D}"/usr install
  42. insopts -m0444
  43. insinto /usr/share/xtrs/disks
  44. doins cpmutil.dsk utility.dsk
  45. if use ls-dos; then
  46. doins "${WORKDIR}"/ld4-631.dsk
  47. dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
  48. dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
  49. fi
  50. dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html
  51. DOC_CONTENTS="For copyright reasons, xtrs does not include actual ROM
  52. images. Because of this, unless you supply your own ROM, xtrs will
  53. not function in any mode except 'Model 4p' mode (a minimal free ROM
  54. is included for this), which can be run like this:
  55. \n\nxtrs -model 4p -diskdir /usr/share/xtrs
  56. \n\nIf you already own a copy of the ROM software (e.g., if you have
  57. a TRS-80 with this ROM), then you can make yourself a copy of this
  58. for use with xtrs, using utilities available on the web. To load
  59. your own ROM, specify the '-romfile' option, or the 'Xtrs.romfile'
  60. X resource. ROM files can be in Intel hex or binary format."
  61. readme.gentoo_create_doc
  62. }
  63. pkg_postinst() {
  64. readme.gentoo_print_elog
  65. }