scm-5.5.6-r2.ebuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="3"
  4. inherit versionator eutils flag-o-matic multilib
  5. #version magic thanks to masterdriverz and UberLord using bash array instead of tr
  6. trarr="0abcdefghi"
  7. MY_PV="$(get_version_component_range 1)${trarr:$(get_version_component_range 2):1}$(get_version_component_range 3)"
  8. MY_P=${PN}-${MY_PV}
  9. S=${WORKDIR}/${PN}
  10. DESCRIPTION="SCM is a Scheme implementation from the author of slib"
  11. SRC_URI="http://groups.csail.mit.edu/mac/ftpdir/scm/${MY_P}.zip"
  12. HOMEPAGE="http://swiss.csail.mit.edu/~jaffer/SCM"
  13. SLOT="0"
  14. LICENSE="LGPL-3"
  15. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
  16. IUSE="arrays bignums cautious dynamic-linking engineering-notation gsubr inexact
  17. ioext libscm macro ncurses posix readline regex sockets unix"
  18. #unzip for unpacking
  19. DEPEND="app-arch/unzip
  20. >=dev-scheme/slib-3.1.5
  21. dev-util/cproto
  22. ncurses? ( sys-libs/ncurses )
  23. readline? ( sys-libs/libtermcap-compat )"
  24. RDEPEND="${DEPEND}"
  25. src_prepare() {
  26. epatch "${FILESDIR}"/${P}-multiplefixes.patch
  27. }
  28. src_compile() {
  29. # SLIB is required to build SCM.
  30. local slibpath="${EPREFIX}/usr/share/slib/"
  31. if [ -n "$SCHEME_LIBRARY_PATH" ]; then
  32. einfo "using SLIB $SCHEME_LIBRARY_PATH"
  33. elif [ -d ${slibpath} ]; then
  34. export SCHEME_LIBRARY_PATH=${slibpath}
  35. fi
  36. einfo "Making scmlit"
  37. emake -j1 scmlit clean || die "faild to build scmlit"
  38. einfo "Building scm"
  39. local features=""
  40. use arrays && features+="arrays"
  41. use bignums && features+=" bignums"
  42. use cautious && features+=" cautious"
  43. use engineering-notation && features+=" engineering-notation"
  44. use inexact && features+=" inexact"
  45. use macro && features+=" macro"
  46. ( use readline ||
  47. use ncurses ||
  48. use regex ||
  49. use posix ||
  50. use ioext ||
  51. use gsubr ||
  52. use sockets ||
  53. use unix ||
  54. use dynamic-linking ) && features+=" dynamic-linking"
  55. ./build \
  56. --compiler-options="${CFLAGS}" \
  57. --linker-options="${LDFLAGS} -L${EPREFIX}/$(get_libdir)" \
  58. -s "${EPREFIX}"/usr/$(get_libdir)/scm \
  59. -F ${features:="none"} \
  60. -h system \
  61. -o scm || die
  62. einfo "Building DLLs"
  63. if use readline; then
  64. ./build \
  65. --compiler-options="${CFLAGS}" \
  66. --linker-options="${LDFLAGS}" \
  67. -h system \
  68. -F edit-line \
  69. -t dll || die
  70. fi
  71. if use ncurses ; then
  72. ./build \
  73. --compiler-options="${CFLAGS}" \
  74. --linker-options="${LDFLAGS}" \
  75. -F curses \
  76. -h system \
  77. -t dll || die
  78. fi
  79. if use regex ; then
  80. ./build \
  81. --compiler-options="${CFLAGS}" \
  82. --linker-options="${LDFLAGS}" \
  83. -c rgx.c \
  84. -h system \
  85. -t dll || die
  86. fi
  87. if use gsubr ; then
  88. ./build \
  89. --compiler-options="${CFLAGS}" \
  90. --linker-options="${LDFLAGS}" \
  91. -c gsubr.c \
  92. -h system \
  93. -t dll || die
  94. fi
  95. if use ioext ; then
  96. ./build \
  97. --compiler-options="${CFLAGS}" \
  98. --linker-options="${LDFLAGS}" \
  99. -c ioext.c \
  100. -h system \
  101. -t dll || die
  102. fi
  103. if use posix; then
  104. ./build \
  105. --compiler-options="${CFLAGS}" \
  106. --linker-options="${LDFLAGS}" \
  107. -c posix.c \
  108. -h system \
  109. -t dll || die
  110. fi
  111. if use sockets ; then
  112. ./build \
  113. --compiler-options="${CFLAGS}" \
  114. --linker-options="${LDFLAGS}" \
  115. -c socket.c \
  116. -h system \
  117. -t dll || die
  118. fi
  119. if use unix ; then
  120. ./build \
  121. --compiler-options="${CFLAGS}" \
  122. --linker-options="${LDFLAGS}" \
  123. -c unix.c \
  124. -h system \
  125. -t dll || die
  126. fi
  127. if use libscm ; then
  128. emake libscm.a || die
  129. fi
  130. }
  131. src_test() {
  132. emake check
  133. }
  134. src_install() {
  135. emake DESTDIR="${D}" man1dir="${EPREFIX}"/usr/share/man/man1/ \
  136. install || die "Install failed"
  137. if use libscm; then
  138. emake DESTDIR="${D}" libdir="${EPREFIX}"/usr/$(get_libdir)/ \
  139. installlib || die
  140. fi
  141. doinfo scm.info
  142. doinfo hobbit.info
  143. }
  144. pkg_postinst() {
  145. [ "${ROOT}" == "/" ] && pkg_config
  146. }
  147. pkg_config() {
  148. einfo "Regenerating catalog..."
  149. scm -e "(require 'new-catalog)"
  150. }