diff options
Diffstat (limited to 'sci-misc/qcad/qcad-2.0.5.0.ebuild')
-rw-r--r-- | sci-misc/qcad/qcad-2.0.5.0.ebuild | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/sci-misc/qcad/qcad-2.0.5.0.ebuild b/sci-misc/qcad/qcad-2.0.5.0.ebuild new file mode 100644 index 0000000..dc1c3e0 --- /dev/null +++ b/sci-misc/qcad/qcad-2.0.5.0.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit kde-functions eutils flag-o-matic + +MY_PV=${PV}-1 +MY_P=${P}-1-community.src +S=${WORKDIR}/${MY_P} +DESCRIPTION="A 2D CAD package based upon Qt." +SRC_URI="http://www.ribbonsoft.com/archives/qcad/${MY_P}.tar.gz + doc? ( mirror://gentoo/qcad-manual-200404.tar.bz2 + http://dev.gentoo.org/~phosphan/qcad-manual-200404.tar.bz2 )" +HOMEPAGE="http://www.ribbonsoft.com/qcad.html" + +LICENSE="GPL-2" +SLOT="0" +IUSE="doc" +KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86" + +DEPEND=">=sys-apps/sed-4" +need-qt 3.3.4 + +src_unpack() { + unpack ${A} + # Bug 112864 - fix dir unpack bug + touch ${WORKDIR} + cd ${S} + echo >> defs.pro "DEFINES += _REENTRANT QT_THREAD_SUPPORT" + echo >> defs.pro "CONFIG += thread release" + echo >> defs.pro "QMAKE_CFLAGS_RELEASE += ${CFLAGS}" + echo >> defs.pro "QMAKE_CXXFLAGS_RELEASE += ${CXXFLAGS}" + for file in */Makefile scripts/build_qcad.sh; do + sed -i -e 's~qmake~${QTDIR}/bin/qmake~g' $file || \ + die "unable to correct path to qmake in $file" + done + epatch ${FILESDIR}/${MY_P}-gentoo.patch + epatch ${FILESDIR}/${MY_P}-manual.patch + epatch ${FILESDIR}/${MY_P}-intptr.patch + + epatch ${FILESDIR}/${MY_P}-pedantic.patch + + cd ${S}/scripts + sed -i -e 's/^make/make ${MAKEOPTS}/' build_qcad.sh || \ + die "unable to add MAKEOPTS" + sed -i -e 's/^\.\/configure/.\/configure --host=${CHOST}/' build_qcad.sh \ + || die "unable to set CHOST" + cd ${S}/qcad/src + sed -i -e "s:FULLASSISTANTPATH:${QTDIR}/bin:" qc_applicationwindow.cpp \ + || die "sed failed on assistant path" + sed -i -e "s:QCADDOCPATH:/usr/share/doc/${PF}:" \ + qc_applicationwindow.cpp || die "sed failed on manual path" + +} + +src_compile() { + # we need to filter -pedantic flag to avoid bail-out + filter-flags -pedantic + ### borrowed from kde.eclass # + # + # fix the sandbox errors "can't write to .kde or .qt" problems. + # this is a fake homedir that is writeable under the sandbox, so that the build process + # can do anything it wants with it. + REALHOME="$HOME" + mkdir -p $T/fakehome/.kde + mkdir -p $T/fakehome/.qt + export HOME="$T/fakehome" + # things that should access the real homedir + [ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/" + cd scripts + # We need to call with notrans since release_translations.sh does not exist + sh build_qcad.sh notrans || die "build failed" + if ! test -f ${S}/qcad/qcad; then + die "no binary created, build failed" + fi +} + +src_install () { + cd qcad + mv qcad qcad.bin + dobin qcad.bin + echo -e "#!/bin/sh\ncd /usr/share/${P}\nqcad.bin" > qcad + chmod ugo+rx qcad + dobin qcad + dodir /usr/share/${P} + cp -pPR patterns examples fonts qm ${D}/usr/share/${P} + insinto /usr/share/pixmaps + doins src/xpm/qcad.xpm + dodoc README + cd .. + if use doc; then + insinto /usr/share/doc/${PF}/ + cd ${WORKDIR} + cp -pPR qcaddoc.adp cad ${D}usr/share/doc/${PF} + fi + make_desktop_entry ${PN} QCad ${PN}.xpm Office +} |