summaryrefslogtreecommitdiff
blob: 7423e24b36f6177ffa54ba75f2467372317f46c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lisp/cl-mcclim/cl-mcclim-0.9.ebuild,v 1.6 2005/02/09 07:55:59 mkennedy Exp $

inherit common-lisp elisp eutils

DESCRIPTION="McCLIM is a free software implementation of CLIM."
HOMEPAGE="http://clim.mikemac.com/ http://clim.mikemac.com/spec/clim.html"
SRC_URI="http://clim.mikemac.com/downloads/snapshots/src/McCLIM-${PV}.tgz"

LICENSE="LLGPL-2.1"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc emacs"

DEPEND="dev-lisp/common-lisp-controller
	dev-lisp/cmucl-source
	dev-lisp/cl-clx
	doc? ( media-gfx/transfig
		media-libs/netpbm
		virtual/tetex )
	emacs? ( virtual/emacs )"

CLPACKAGE="clim clim-clx clim-examples"
SITEFILE=${FILESDIR}/50mcclim-gentoo.el

S=${WORKDIR}/McCLIM

ELISP_SOURCES="Tools/Emacs/indent-clim.el Spec/climbols.el"

src_unpack() {
	unpack ${A}
	epatch ${FILESDIR}/${PV}/system.lisp-gentoo.patch
	mkdir ${S}/clim-spec
}

src_compile() {
	if use doc; then
		make -C Doc manual.ps
		if [ -x /usr/bin/lisp ]; then
			lisp -batch -noinit -nosite-init -eval "
(progn
(compile-file \"Tools/gilbert/clim-doc-convert\")
quit))"
			lisp -batch -noinit -nositeinit \
				-load Tools/gilbert/clim-doc-convert \
				-eval "
(progn
(defparameter clim-doc-convert::*mcclim-base-dir* \"${S}/\")
(defparameter clim-doc-convert::*output-directory* \"${S}/clim-spec/\")
(clim-doc-convert:run)
(quit))"
		elif [ -x /usr/bin/sbcl ]; then
			ewarn "Documentation cannot be built with SBCL at this time"
		elif [ -x /usr/bin/clisp ]; then
			ewarn "Documentation cannot be built with CLISP at this time"
		fi
	fi

	if use emacs; then
		cp ${ELISP_SOURCES} .
		elisp-compile *.el
	fi
}

src_install() {
	insinto /usr/share/common-lisp/source/clim
	doins *.lisp
	for i in Apps Backends Examples Experimental Goatee Images Lisp-Dep Looks; do
		cp -r ${i} ${D}/usr/share/common-lisp/source/clim/
	done
	dodir /usr/share/common-lisp/systems/

	dosym /usr/share/common-lisp/source/clim/system.lisp /usr/share/common-lisp/systems/clim.asd

	for i in clim-clx clim-examples; do
		dosym /usr/share/common-lisp/source/clim /usr/share/common-lisp/source/${i}
		dosym /usr/share/common-lisp/source/${i}/system.lisp  /usr/share/common-lisp/systems/${i}.asd
	done

	dodoc README TODO INSTALL*

	if use doc; then
		dodoc Doc/manual.ps
		insinto /usr/share/doc/${PF}/html/Spec
		doins clim-spec/*
	fi

	find ${D} -type d -name CVS -print |xargs rm -rf

	if use emacs; then
		insinto /usr/share/emacs/site-lisp/${PN}
		doins *.el *.elc
		elisp-site-file-install ${SITEFILE}
	fi
}

pkg_postinst() {
	elisp_pkg_postinst
	common-lisp_pkg_postinst
}

pkg_postrm() {
	elisp_pkg_postinst
	common-lisp_pkg_postrm
}