# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 WX_GTK_VER="3.0" inherit eutils flag-o-matic wxwidgets xdg-utils DESCRIPTION="The open source, cross platform, free C++ IDE" HOMEPAGE="http://www.codeblocks.org/" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd" SRC_URI="mirror://sourceforge/codeblocks/${P/-/_}.tar.xz" # USE="fortran" enable FortranProject plugin (v 1.5) # that is delivered with Code::Blocks 17.12 source code. # https://sourceforge.net/projects/fortranproject # http://cbfortran.sourceforge.net IUSE="contrib debug fortran pch static-libs" S="${WORKDIR}/${P}" RDEPEND="app-arch/zip x11-libs/wxGTK:${WX_GTK_VER}[X] contrib? ( app-text/hunspell dev-libs/boost:= dev-libs/libgamin )" DEPEND="${RDEPEND} virtual/pkgconfig" PATCHES=( "${FILESDIR}/FortranProject_build.diff" ) src_prepare() { default sed -i "s/WXGTK_VER=IS_NOT_SET/WXGTK_VER=${WX_GTK_VER}/" ${S}/src/plugins/contrib/FortranProject/FortranProject_build.sh chmod +x ${S}/src/plugins/contrib/FortranProject/FortranProject_build.sh } src_configure() { touch "${S}"/revision.m4 -r "${S}"/m4/acinclude.m4 setup-wxwidgets append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks) econf \ --with-wx-config="${WX_CONFIG}" \ $(use_enable debug) \ $(use_enable pch) \ $(use_enable static-libs static) \ $(use_with contrib contrib-plugins all) } src_compile() { emake # pre-compile FortranProject plugin: pushd ${S}/src/plugins/contrib/FortranProject/ use fortran && ./FortranProject_build.sh \ || die "build FortranProject plugin failed" popd } src_install() { emake DESTDIR="${D}" install exeinto /usr/lib/codeblocks/plugins doexe src/plugins/contrib/FortranProject/.libs/FortranProject.so insinto /usr/share/codeblocks doins -r src/plugins/contrib/FortranProject/images doins src/plugins/contrib/FortranProject/FortranProject.zip } pkg_postinst() { if [[ ${WX_GTK_VER} == "3.0" || ${WX_GTK_VER} == "3.0-gtk3" ]]; then elog "KNOWN ISSUE:" elog "The symbols browser is disabled in wx3.x builds due to it causes crashes." elog "For more information see ticket https://sourceforge.net/p/codeblocks/tickets/225/" elog "with related commits https://sourceforge.net/p/codeblocks/code/11027/" elog "and https://sourceforge.net/p/codeblocks/code/11141/" fi xdg_desktop_database_update xdg_mimeinfo_database_update } pkg_postrm() { xdg_desktop_database_update xdg_mimeinfo_database_update }