smlnj-110.75.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="Standard ML of New Jersey compiler and libraries"
  6. HOMEPAGE="http://www.smlnj.org"
  7. BASE_URI="http://smlnj.cs.uchicago.edu/dist/working/${PV}"
  8. FILES="
  9. config.tgz
  10. cm.tgz
  11. compiler.tgz
  12. runtime.tgz
  13. system.tgz
  14. MLRISC.tgz
  15. smlnj-lib.tgz
  16. ckit.tgz
  17. nlffi.tgz
  18. cml.tgz
  19. eXene.tgz
  20. ml-lex.tgz
  21. ml-yacc.tgz
  22. ml-burg.tgz
  23. ml-lpt.tgz
  24. pgraph.tgz
  25. trace-debug-profile.tgz
  26. heap2asm.tgz
  27. smlnj-c.tgz
  28. "
  29. #use amd64 in 32-bit mode
  30. SRC_URI="amd64? ( ${BASE_URI}/boot.x86-unix.tgz -> ${P}-boot.x86-unix.tgz )
  31. ppc? ( ${BASE_URI}/boot.ppc-unix.tgz -> ${P}-boot.ppc-unix.tgz )
  32. sparc? ( ${BASE_URI}/boot.sparc-unix.tgz -> ${P}-boot.sparc-unix.tgz )
  33. x86? ( ${BASE_URI}/boot.x86-unix.tgz -> ${P}-boot.x86-unix.tgz )"
  34. for file in ${FILES}; do
  35. SRC_URI+=" ${BASE_URI}/${file} -> ${P}-${file} "
  36. done
  37. LICENSE="BSD"
  38. SLOT="0"
  39. #sparc support should be there but is untested
  40. KEYWORDS="-* ~amd64 ~ppc ~x86"
  41. IUSE=""
  42. S=${WORKDIR}
  43. src_unpack() {
  44. mkdir -p "${S}"
  45. for file in ${A}; do
  46. [[ ${file} != ${P}-config.tgz ]] && cp "${DISTDIR}/${file}" "${S}/${file#${P}-}"
  47. done
  48. # make sure we don't use the internet to download anything
  49. unpack ${P}-config.tgz && rm config/*.bat
  50. echo SRCARCHIVEURL=\"file:/${S}\" > "${S}"/config/srcarchiveurl
  51. }
  52. DIR=/usr
  53. src_prepare() {
  54. # respect CC et al. (bug 243886)
  55. mkdir base || die # without this unpacking runtime will fail
  56. ./config/unpack "${S}" runtime || die
  57. for file in mk.*; do
  58. sed -e "/^AS/s:as:$(tc-getAS):" \
  59. -e "/^CC/s:gcc:$(tc-getCC):" \
  60. -e "/^CPP/s:gcc:$(tc-getCC):" \
  61. -e "/^CFLAGS/{s:-O[0123s]:: ; s:=:= ${CFLAGS}:}" \
  62. -i base/runtime/objs/${file}
  63. done
  64. # # stash bin and lib somewhere (bug 248162)
  65. # sed -e "/@BINDIR@/s:\$BINDIR:${DIR}:" \
  66. # -e "/@LIBDIR@/s:\$LIBDIR:${DIR}/lib:" \
  67. # -i config/install.sh || die
  68. }
  69. src_compile() {
  70. SMLNJ_HOME="${S}" ./config/install.sh || die "compilation failed"
  71. }
  72. src_install() {
  73. mkdir -p "${D}"/${DIR} || die
  74. mv bin lib "${D}"/${DIR} || die
  75. # for file in "${D}"/${DIR}/bin/*; do
  76. # dosym /${DIR}/bin/$(basename "${file}") /usr/bin/$(basename "${file}") || die
  77. # done
  78. # for file in $(find "${D}"/usr/lib/${PN}/bin/ -maxdepth 1 -type f ! -name ".*"); do
  79. # dosym /${DIR}/bin/$(basename "${file}") /usr/bin/$(basename "${file}") || die
  80. # done
  81. for file in "${D}"/usr/bin/{*,.*}; do
  82. [[ -f ${file} ]] && sed "2iSMLNJ_HOME=/usr" -i ${file}
  83. # [[ -f ${file} ]] && sed "s:${WORKDIR}:/usr:" -i ${file}
  84. done
  85. }