clisp-2.48-r2.ebuild 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit flag-o-matic eutils toolchain-funcs multilib
  5. DESCRIPTION="A portable, bytecode-compiled implementation of Common Lisp"
  6. HOMEPAGE="http://clisp.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="2"
  10. KEYWORDS="~alpha amd64 ~ia64 ~ppc -sparc x86"
  11. IUSE="berkdb hyperspec X new-clx dbus fastcgi gdbm gtk pari +pcre postgres +readline svm -threads +unicode +zlib"
  12. RDEPEND="virtual/libiconv
  13. >=dev-libs/libsigsegv-2.4
  14. >=dev-libs/ffcall-1.10
  15. dbus? ( sys-apps/dbus )
  16. fastcgi? ( dev-libs/fcgi )
  17. gdbm? ( sys-libs/gdbm )
  18. gtk? ( >=x11-libs/gtk+-2.10:2 >=gnome-base/libglade-2.6:2.0 )
  19. pari? ( >=sci-mathematics/pari-2.3.0 )
  20. postgres? ( >=dev-db/postgresql-8.0 )
  21. readline? ( >=sys-libs/readline-5.0 )
  22. pcre? ( dev-libs/libpcre )
  23. svm? ( sci-libs/libsvm )
  24. zlib? ( sys-libs/zlib )
  25. X? ( new-clx? ( x11-libs/libXpm ) )
  26. hyperspec? ( dev-lisp/hyperspec )
  27. berkdb? ( sys-libs/db:4.7 )"
  28. DEPEND="${RDEPEND}
  29. X? ( new-clx? ( x11-misc/imake x11-proto/xextproto ) )"
  30. PDEPEND="dev-lisp/gentoo-init"
  31. enable_modules() {
  32. [[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
  33. for m in "$@" ; do
  34. einfo "enabling module $m"
  35. myconf+=" --with-module=${m}"
  36. done
  37. }
  38. BUILDDIR="builddir"
  39. # modules not enabled:
  40. # * dirkey: fails to compile, requiring windows.h, possibly wrong #ifdefs
  41. # * matlab, netica: not in portage
  42. # * oracle: can't install oracle-instantclient
  43. src_prepare() {
  44. # More than -O1 breaks alpha/ia64
  45. if use alpha || use ia64; then
  46. sed -i -e 's/-O2//g' src/makemake.in || die
  47. fi
  48. epatch "${FILESDIR}/${P}-bits_ipctypes_to_sys_ipc.patch"
  49. }
  50. src_configure() {
  51. # We need this to build on alpha/ia64
  52. if use alpha || use ia64; then
  53. replace-flags -O? -O1
  54. append-flags '-D NO_MULTIMAP_SHM -D NO_MULTIMAP_FILE -D NO_SINGLEMAP -D NO_TRIVIALMAP'
  55. fi
  56. # QA issue with lisp.run
  57. append-flags -Wa,--noexecstack
  58. # built-in features
  59. local myconf="--with-ffcall --without-dynamic-modules"
  60. # There's a problem with jit_allocai function
  61. # if use jit; then
  62. # myconf+=" --with-jitc=lightning"
  63. # fi
  64. if use threads; then
  65. myconf+=" --with-threads=POSIX_THREADS"
  66. fi
  67. # default modules
  68. enable_modules wildcard rawsock
  69. # optional modules
  70. use elibc_glibc && enable_modules bindings/glibc
  71. if use X; then
  72. if use new-clx; then
  73. enable_modules clx/new-clx
  74. else
  75. enable_modules clx/mit-clx
  76. fi
  77. fi
  78. if use postgres; then
  79. enable_modules postgresql
  80. append-flags -I$(pg_config --includedir)
  81. fi
  82. if use berkdb; then
  83. enable_modules berkeley-db
  84. append-flags -I/usr/include/db4.7
  85. fi
  86. use dbus && enable_modules dbus
  87. use fastcgi && enable_modules fastcgi
  88. use gdbm && enable_modules gdbm
  89. use gtk && enable_modules gtk2
  90. use pari && enable_modules pari
  91. use pcre && enable_modules pcre
  92. use svm && enable_modules libsvm
  93. use zlib && enable_modules zlib
  94. if use hyperspec; then
  95. CLHSROOT="file:///usr/share/doc/hyperspec/HyperSpec/"
  96. else
  97. CLHSROOT="http://www.lispworks.com/reference/HyperSpec/"
  98. fi
  99. # configure chokes on --sysconfdir option
  100. local configure="./configure --prefix=/usr --libdir=/usr/$(get_libdir) \
  101. $(use_with readline) $(use_with unicode) \
  102. ${myconf} --hyperspec=${CLHSROOT} ${BUILDDIR}"
  103. einfo "${configure}"
  104. ${configure} || die "./configure failed"
  105. sed -i 's,"vi","nano",g' "${BUILDDIR}"/config.lisp || die
  106. IMPNOTES="file://${ROOT%/}/usr/share/doc/${PN}-${PVR}/html/impnotes.html"
  107. sed -i "s,http://clisp.cons.org/impnotes/,${IMPNOTES},g" \
  108. "${BUILDDIR}"/config.lisp || die
  109. }
  110. src_compile() {
  111. export VARTEXFONTS="${T}"/fonts
  112. cd "${BUILDDIR}"
  113. # parallel build fails
  114. emake -j1 || die "emake failed"
  115. }
  116. src_install() {
  117. pushd "${BUILDDIR}"
  118. make DESTDIR="${D}" prefix=/usr install-bin || die
  119. doman clisp.1 || die
  120. dodoc SUMMARY README* NEWS MAGIC.add ANNOUNCE || die
  121. fperms a+x /usr/$(get_libdir)/clisp-${PV/_*/}/clisp-link || die
  122. # stripping them removes common symbols (defined but uninitialised variables)
  123. # which are then needed to build modules...
  124. export STRIP_MASK="*/usr/$(get_libdir)/clisp-${PV}/*/*"
  125. popd
  126. dohtml doc/impnotes.{css,html} doc/regexp.html doc/clisp.png || die
  127. dodoc doc/{CLOS-guide,LISP-tutorial}.txt || die
  128. }
  129. pkg_postinst() {
  130. if use threads || use jit; then
  131. while read line; do elog ${line}; done <<EOF
  132. Upstream considers threads to be of Alpha quality, therefore
  133. it is likely that you will encounter bugs in using them. If you do,
  134. please report bugs upstream:
  135. Mailing list: https://lists.sourceforge.net/lists/listinfo/clisp-devel
  136. Bug tracker: https://sourceforge.net/tracker/?atid=101355&group_id=1355
  137. EOF
  138. fi
  139. }