# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils wxwidgets DESCRIPTION="Code::Blocks is a C/C++ IDE designed to be extensible and configurable" HOMEPAGE="http://www.codeblocks.org/" # note: the tarball is named finalbeta, but in numbers this is beta 8, so # beta8 was chosen as the suffix for the ebuild to meet Gentoo naming # conventions. MY_P="${PN}-1.0-finalbeta" SRC_URI="mirror://sourceforge/codeblocks/${MY_P}.tar.gz" S=${WORKDIR}/${MY_P} LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="=x11-libs/wxGTK-2.4*" pkg_setup() { if ! built_with_use x11-libs/wxGTK gtk2 ; then eerror "wxGTK is missing gtk2 support. Please add" eerror "'gtk2' to your use flags and re-emerge wxGTK." die "codeblocks requires gtk2 support in wxGTK." fi } src_unpack() { unpack ${MY_P}.tar.gz cd ${S} # Code::Blocks 1.0 finalbeta crashes when compiling projects. The # following patch fixes this. Note that it has also been submitted # to the Code::Blocks developers and will likely need to be removed # from the ebuild for future versions. epatch ${FILESDIR}/regcomp_crashes.patch # 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. epatch ${FILESDIR}/fhs_paths.patch # Code::Blocks has an odd makefile. This patch makes it accept the user's # CXXFLAGS epatch ${FILESDIR}/cflags.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() { # 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 # fixup permissions and move files from src/output to their proper places in # ${D} cd output # rename the main executable to something less windows-ish mv codeblocks.exe codeblocks chmod 755 codeblocks console_runner.exe share chmod 644 tips.txt # tips.txt belongs in share mv tips.txt share/CodeBlocks dobin codeblocks dobin console_runner.exe dolib.so libcodeblocks.so cd share/CodeBlocks chmod 644 *.zip chmod 755 images templates plugins images/codecompletion plugins/* chmod 644 images/* images/codecompletion/* templates/* # move the plugin libraries out of this "share" dodir /usr/lib/${PN} mv plugins ${D}/usr/lib/${PN} # now setup /usr/share/codeblocks and move the data files there dodir /usr/share/${PN} mv ./* ${D}/usr/share/${PN} # and lastly, the docs cd ${S}/src dodoc AUTHORS BUGS COMPILERS ChangeLog README TODO } 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" }