/[gentoo-x86]/sci-misc/qcad/qcad-2.0.5.0.ebuild
Gentoo

Contents of /sci-misc/qcad/qcad-2.0.5.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Mon Mar 22 02:24:09 2010 UTC (10 years, 8 months ago) by yngwin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
x11-libs/qt:3 and revdeps removal, bug #283429

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-misc/qcad/qcad-2.0.5.0.ebuild,v 1.9 2009/12/31 18:25:38 ssuominen Exp $
4
5 inherit eutils qt3
6
7 manual_cs="2.0.4.0-1"
8 manual_de="2.1.0.0-1"
9 manual_en="2.1.0.0-1"
10 manual_hu="2.0.4.0-1"
11
12 LANGS_M="cs de en hu"
13
14 MY_P=${P}-1-community.src
15 PATCH_V="2.0.4.0-1.src"
16 S=${WORKDIR}/${MY_P}
17 DESCRIPTION="A 2D CAD package based upon Qt."
18 # ugly hack, don't make en LINGUAS-controlled as we may need it as default
19 SRC_URI="http://www.ribbonsoft.com/archives/qcad/${MY_P}.tar.gz
20 doc? (
21 linguas_cs? ( ftp://anonymous@ribbonsoft.com/archives/qcad/qcad-manual-cs-${manual_cs}.html.zip )
22 linguas_de? ( ftp://anonymous@ribbonsoft.com/archives/qcad/qcad-manual-de-${manual_de}.html.zip )
23 ftp://anonymous@ribbonsoft.com/archives/qcad/qcad-manual-en-${manual_en}.html.zip
24 linguas_hu? ( ftp://anonymous@ribbonsoft.com/archives/qcad/qcad-manual-hu-${manual_hu}.html.zip ) )"
25 HOMEPAGE="http://www.ribbonsoft.com/qcad.html"
26
27 LICENSE="GPL-2"
28 SLOT="0"
29 IUSE="doc"
30 KEYWORDS="amd64 hppa ppc ppc64 x86"
31
32 DEPEND="=x11-libs/qt-3*
33 >=sys-apps/sed-4"
34
35 LANGS="cs da de el en es et fr hu it nl no pa pl ru sk tr"
36 for X in ${LANGS} ; do
37 IUSE="${IUSE} linguas_${X}"
38 done
39
40 if [[ -z "${LINGUAS}" ]]; then
41 LINGUAS="en"
42 fi
43
44 src_unpack() {
45 unpack ${A}
46 cd "${S}"
47
48 epatch "${FILESDIR}"/${PN}-${PATCH_V}-gentoo.patch
49 epatch "${FILESDIR}"/${P}-doc.patch
50 epatch "${FILESDIR}"/${PN}-${PATCH_V}-intptr.patch
51 epatch "${FILESDIR}"/${PN}-2.0.4.0-gcc43.patch
52
53 for file in */Makefile scripts/build_qcad.sh; do
54 sed -i -e 's~qmake~${QTDIR}/bin/qmake~g' $file || \
55 die "unable to correct path to qmake in $file"
56 done
57
58 cd "${S}"/mkspecs
59 echo >> defs.pro "DEFINES += _REENTRANT QT_THREAD_SUPPORT"
60 echo >> defs.pro "CONFIG += thread release"
61 echo >> defs.pro "QMAKE_CFLAGS_RELEASE += ${CFLAGS}"
62 echo >> defs.pro "QMAKE_CXXFLAGS_RELEASE += ${CXXFLAGS}"
63
64 # code does not compile with -pedantic
65 sed -i -e "s:-pedantic::" defs.pro \
66 || die "failed to remove -pedantic flag"
67
68 cd "${S}"/scripts
69 sed -i -e 's/^make/make ${MAKEOPTS}/' build_qcad.sh || \
70 die "unable to add MAKEOPTS"
71 sed -i -e 's/^\.\/configure/.\/configure --host=${CHOST}/' build_qcad.sh \
72 || die "unable to set CHOST"
73 cd "${S}"/qcad/src
74 sed -i -e "s:FULLASSISTANTPATH:${QTDIR}/bin:" qc_applicationwindow.cpp \
75 || die "sed failed on assistant path"
76 sed -i -e "s:QCADDOCPATH:/usr/share/doc/${PF}:" \
77 qc_applicationwindow.cpp || die "sed failed on manual path"
78 }
79
80 src_compile() {
81 ### borrowed from kde.eclass #
82 #
83 # fix the sandbox errors "can't writ to .kde or .qt" problems.
84 # this is a fake homedir that is writeable under the sandbox, so that the build process
85 # can do anything it wants with it.
86 REALHOME="$HOME"
87 mkdir -p "${T}"/fakehome/.kde
88 mkdir -p "${T}"/fakehome/.qt
89 export HOME="$T/fakehome"
90 # things that should access the real homedir
91 [ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/"
92 cd scripts
93 sh build_qcad.sh || die "build failed"
94 if ! test -f "${S}"/qcad/qcad; then
95 die "no binary created, build failed"
96 fi
97 # make translations as release_translations.sh is missing
98 cd ../qcad
99 strip-linguas ${LANGS}
100 for LANG in ${LINGUAS}; do
101 lrelease src/ts/qcad_${LANG}.ts -qm qm/qcad_${LANG}.qm
102 done
103 }
104
105 src_install () {
106 cd qcad
107 dodoc README || die "Failed to install docs"
108 mv qcad qcad.bin || die "Failed to rename qcad binary"
109 dobin qcad.bin || die "Failed to install qcad binary"
110 echo -e "#!/bin/sh\ncd /usr/share/${P}\nqcad.bin" > qcad \
111 || die "Failed to create qcad wrapper script"
112 dobin qcad || die "Failed to install qcad wrapper"
113
114 insinto /usr/share/${P}
115 doins -r patterns fonts qm \
116 || die "Failed to install support files"
117
118 doicon src/xpm/${PN}.xpm
119 make_desktop_entry ${PN} QCad ${PN} Office
120
121 if use doc; then
122 cd "${WORKDIR}"
123 strip-linguas ${LANGS_M}
124 if [[ -z "${LINGUAS}" ]]; then
125 ewarn "No manual translation available for your LINGUAS. Installing English."
126 ewarn "Note that if you want to use it while UI set to another language, you have to symlink"
127 ewarn "/usr/share/doc/${PF}/LC -> /usr/share/doc/${PF}/en"
128 ewarn "(where LC is the language code of the language set for the UI)"
129 LINGUAS="en"
130 fi
131 for LANG in ${LINGUAS}; do
132 m_version=$(eval "echo \$manual_${LANG}")
133 cd qcad-manual-${LANG}-${m_version}.html
134 if [[ -e "index.adp" ]]; then
135 ln -s index.adp qcaddoc.adp
136 fi
137 insinto /usr/share/doc/${PF}/${LANG}
138 doins -r * || die "Failed to install manual for LINGUAS=${LANG}"
139 cd ..
140 done
141 fi
142 }

  ViewVC Help
Powered by ViewVC 1.1.20