sys-apps/pcsc-lite: amd64 stable wrt bug #663594
[gentoo.git] / sci-electronics / magic / magic-8.0.138.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit multilib eutils autotools
7
8 DESCRIPTION="The VLSI design CAD tool"
9 HOMEPAGE="http://www.opencircuitdesign.com/magic/index.html"
10 SRC_URI="http://www.opencircuitdesign.com/magic/archive/${P}.tgz \
11         ftp://ftp.mosis.edu/pub/sondeen/magic/new/beta/2002a.tar.gz"
12
13 LICENSE="HPND GPL-2+"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~x86"
16 IUSE="debug opengl"
17
18 RDEPEND="sys-libs/ncurses:0=
19         sys-libs/readline:0=
20         dev-lang/tcl:0=
21         dev-lang/tk:0=
22         dev-tcltk/blt
23         opengl? ( virtual/glu
24                 virtual/opengl )"
25 DEPEND="${RDEPEND}
26         app-shells/tcsh"
27
28 src_prepare() {
29         einfo remove bundled readline-4.3
30         rm -r readline || die
31
32         epatch \
33                 "${FILESDIR}/${PN}-7.5.231-verbose-build.patch"
34
35         cd scripts || die
36         eautoreconf
37         cd .. || die
38
39         sed -i -e "s: -pg : :" tcltk/Makefile || die
40 }
41
42 src_configure() {
43         # Short-circuit top-level configure script to retain CFLAGS
44         # fix tcl/tk detection #447868
45         cd scripts
46         CPP="cpp" econf \
47                 --with-tcl=yes \
48                 --with-tcllibs="/usr/$(get_libdir)" \
49                 --with-tklibs="/usr/$(get_libdir)" \
50                 --enable-modular \
51                 $(use_enable debug memdebug) \
52                 $(use_with opengl)
53 }
54
55 src_compile() {
56         emake -j1
57 }
58
59 src_install() {
60         emake -j1 DESTDIR="${D}" install
61
62         dodoc README README.Tcl TODO
63
64         # Move docs from libdir to docdir and add symlink.
65         mv "${D}/usr/$(get_libdir)/magic/doc"/* "${D}/usr/share/doc/${PF}/" || die
66         rmdir "${D}/usr/$(get_libdir)/magic/doc" || die
67         dosym "/usr/share/doc/${PF}" "/usr/$(get_libdir)/magic/doc"
68
69         # Move tutorial from libdir to datadir and add symlink.
70         dodir /usr/share/${PN}
71         mv "${D}/usr/$(get_libdir)/magic/tutorial" "${D}/usr/share/${PN}/" || die
72         dosym "/usr/share/${PN}/tutorial" "/usr/$(get_libdir)/magic/tutorial"
73
74         # Install latest MOSIS tech files
75         cp -pPR "${WORKDIR}"/2002a "${D}"/usr/$(get_libdir)/magic/sys/current || die
76 }