# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils wxwidgets DESCRIPTION="C/C++ Integrated Development Environment" HOMEPAGE="http://www.codeblocks.org/" # note: the tarball is named 1.0_rc1-1, but gentoo requires that suffixes # have non-zero integer values. Using 1 here. MY_P="${PN}-1.0-rc1-1" # even more fun: the tarball has a capital RC in it.... MY_PDIR="${PN}-1.0-RC1-1" SRC_URI="mirror://sourceforge/codeblocks/${MY_P}.tar.gz" S=${WORKDIR}/${MY_PDIR} LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" DEPEND="=x11-libs/wxGTK-2.4*" src_unpack() { unpack ${MY_P}.tar.gz cd ${S} # Code::Blocks has a funny install procedure that puts all of its # executables and libraries inside a single directory structure. This may be # useful for installation on Windows, but does not follow FHS standards on # linux. The following patch modifies the code to read the plugins and data # from the proper paths. # Code::Blocks has an odd makefile. This patch also makes it accept the user's # CXXFLAGS epatch ${FILESDIR}/${P}.patch # One more thing: there is an "install" script in the distribution that is # in dos format. Need to convert it to unix format for it to work. cd ${S}/src edos2unix update } src_compile() { need-wxwidgets gtk2 # No configuration step needed. Just use the supplied makefile. # Note that it is buggy when done in parallel make. cd ${S}/src EXTRA_EMAKE="-f Makefile.unix" emake -j1 || die "emake failed" } src_install() { # And now the screwy Code::Blocks installation. It is built around a windows # install model where all executables, data, and libraries are under a # program's directory. We need to run the install script which will # "install" to ${S}/src/ouput and then manually move everything to ${D} in # the proper FHS paths cd ${S}/src . update # install the icon cd ${S}/src/src/resources/icons insinto /usr/share/pixmaps newins app_64.xpm codeblocks.xpm # fixup permissions and move files from src/output to their proper places in # ${D} cd ${S}/src/output # rename the main executable to something less windows-ish newbin codeblocks.exe codeblocks dobin console_runner.exe dolib.so libcodeblocks.so # tips.txt belongs in share insinto /usr/share/${PN} doins tips.txt cd share/CodeBlocks # now setup /usr/share/codeblocks and move the data files there doins -r *.zip images/ templates/ lexers/ # move the plugin libraries out of this "share" insopts -m0755 insinto /usr/lib/${PN} doins -r plugins/ insopts -m0644 # and the docs cd ${S}/src dodoc AUTHORS BUGS COMPILERS ChangeLog README TODO # and lastly, the desktop entry make_desktop_entry codeblocks "Code::Blocks IDE" "codeblocks.xpm" \ "Development" } pkg_postinst() { ewarn "The code completion plugin for Code:Blocks is very unstable under" ewarn "linux. It can be disabled using the Plugins menu from within" ewarn "Code::Blocks" }