# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit base ghc-package DESCRIPTION="GTK+-2.x bindings for Haskell" HOMEPAGE="http://gtk2hs.sourceforge.net/" SRC_URI="mirror://sourceforge/gtk2hs/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="doc gnome" RDEPEND=">=virtual/ghc-5.04 >=x11-libs/gtk+-2 gnome? ( >=gnome-base/libglade-2 >=x11-libs/gtksourceview-0.6 >=gnome-base/gconf-2)" DEPEND="${RDEPEND}" src_compile() { econf \ --libdir=$(ghc-libdir) \ --with-hcflags="-O" \ `use_enable gnome gnome` \ `use_enable gnome libglade` \ || die "Configure failed" #fix for bug in 0.9.6 tarball, directory missing so don't compile that demo sed -i 's/MAKE_APPS += demo\/filechooser//' ${S}/Makefile #or work out how to build without demos # parallell build doesn't work, so specify -j1 emake -j1 || die "Make failed" if use doc; then make html || die "Make docs failed" fi } src_install() { make DESTDIR=${D} install-without-pkg || die "Make install failed" if use doc; then make DESTDIR=${D} install-html || die "Make docs failed" fi # fix dynamic linking with pthread bug for glade & sourview sed -i 's:"pthread",::' ${D}/$(ghc-libdir)/gtk2hs/sourceview/sourceview.conf sed -i 's:"pthread",::' ${D}/$(ghc-libdir)/gtk2hs/glade/glade.conf # arrange for the packages to be registered ghc-setup-pkg $(ghc-getghcpkg) --config-file=${S}/$(ghc-localpkgconf) --add-package --input-file=${D}/$(ghc-libdir)/gtk2hs/gtk2/gtk2.conf $(ghc-getghcpkg) --config-file=${S}/$(ghc-localpkgconf) --add-package --input-file=${D}/$(ghc-libdir)/gtk2hs/mogul/mogul.conf if use gnome; then $(ghc-getghcpkg) --config-file=${S}/$(ghc-localpkgconf) --add-package --input-file=${D}/$(ghc-libdir)/gtk2hs/glade/glade.conf $(ghc-getghcpkg) --config-file=${S}/$(ghc-localpkgconf) --add-package --input-file=${D}/$(ghc-libdir)/gtk2hs/gconf/gconf.conf $(ghc-getghcpkg) --config-file=${S}/$(ghc-localpkgconf) --add-package --input-file=${D}/$(ghc-libdir)/gtk2hs/sourceview/sourceview.conf fi ghc-install-pkg # build ghci .o files from .a files #ld -r -x -o ${D}/$(ghc-libdir)/gtk2hs/gtk2/gtk2hs.o \ # --whole-archive ${D}/$(ghc-libdir)/gtk2hs/gtk2/libgtk2hs.a #ld -r -x -o ${D}/$(ghc-libdir)/gtk2hs/mogul/mogul.o \ # --whole-archive ${D}/$(ghc-libdir)/gtk2hs/mogul/libmogul.a #[ `use gnome` ] && ld -r -x -o ${D}/$(ghc-libdir)/gtk2hs/sourceview/sourceview.o \ # --whole-archive ${D}/$(ghc-libdir)/gtk2hs/sourceview/libsourceview.a #[ `use gnome` ] && ld -r -x -o ${D}/$(ghc-libdir)/gtk2hs/glade/glade2hs.o \ # --whole-archive ${D}/$(ghc-libdir)/gtk2hs/glade/libglade2hs.a #[ `use gnome` ] && ld -r -x -o ${D}/$(ghc-libdir)/gtk2hs/gconf/gconf.o \ # --whole-archive ${D}/$(ghc-libdir)/gtk2hs/gconf/libgconf.a # fix gconf hi file location install bug mkdirhier ${D}/$(ghc-libdir)/gtk2hs/gconf/hi/System/Gnome/GConf mv ${D}/$(ghc-libdir)/gtk2hs/gconf/hi/GConf.hi \ ${D}/$(ghc-libdir)/gtk2hs/gconf/hi/System/Gnome/ mv ${D}/$(ghc-libdir)/gtk2hs/gconf/hi/*.hi \ ${D}/$(ghc-libdir)/gtk2hs/gconf/hi/System/Gnome/GConf/ }