/[gentoo-x86]/eclass/kde.eclass
Gentoo

Contents of /eclass/kde.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.79 - (show annotations) (download)
Thu Jul 17 16:42:59 2003 UTC (16 years, 11 months ago) by gmsoft
Branch: MAIN
Branch point for: RELEASE-1_4
Changes since 1.78: +16 -1 lines
Added support for hppa in kde.eclass

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.78 2003/04/13 21:46:44 danarmak Exp $
4 #
5 # Author Dan Armak <danarmak@gentoo.org>
6 #
7 # The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.
8
9 inherit base kde-functions
10 ECLASS=kde
11 INHERITED="$INHERITED $ECLASS"
12
13 DESCRIPTION="Based on the $ECLASS eclass"
14 HOMEPAGE="http://www.kde.org/"
15
16 # deps on the build tools
17 if [ -n "$KDEBASE" -a -n "`use ppc`" -a "${PV//3.1}" != "$PV" ]; then
18 DEPEND="$DEPEND >=sys-devel/automake-1.6.3"
19 else
20 DEPEND="$DEPEND sys-devel/automake"
21 fi
22 DEPEND="$DEPEND sys-devel/autoconf sys-devel/make dev-lang/perl" # perl is used for makefile generation
23
24 # all kde apps need this one
25 newdepend "~kde-base/kde-env-3"
26
27 # overridden in other places like kde-dist, kde-source and some individual ebuilds
28 SLOT="0"
29
30 kde_src_unpack() {
31
32 debug-print-function $FUNCNAME $*
33
34 # call base_src_unpack, which implements most of the functionality and has sections,
35 # unlike this function. The change from base_src_unpack to kde_src_unpack is thus
36 # wholly transparent for ebuilds.
37 base_src_unpack $*
38
39 # kde-specific stuff stars here
40
41 # fix the 'languageChange undeclared' bug group: touch all .ui files, so that the
42 # makefile regenerate any .cpp and .h files depending on them.
43 cd $S
44 debug-print "$FUNCNAME: Searching for .ui files in $PWD"
45 UIFILES="`find . -name '*.ui' -print`"
46 debug-print "$FUNCNAME: .ui files found:"
47 debug-print "$UIFILES"
48 # done in two stages, because touch doens't have a silent/force mode
49 if [ -n "$UIFILES" ]; then
50 debug-print "$FUNCNAME: touching .ui files..."
51 touch $UIFILES
52 fi
53
54 # shorthand for removing specified subdirectories fom the build process
55 [ -n "$KDE_REMOVE_DIR" ] && kde_remove_dir $KDE_REMOVE_DIR
56
57 }
58
59 kde_src_compile() {
60
61 debug-print-function $FUNCNAME $*
62 [ -z "$1" ] && kde_src_compile all
63
64 cd ${S}
65 export kde_widgetdir="$KDEDIR/lib/kde3/plugins/designer"
66
67 # fix the sandbox errors "can't writ to .kde or .qt" problems.
68 # this is a fake homedir that is writeable under the sandbox, so that the build process
69 # can do anything it wants with it.
70 REALHOME="$HOME"
71 mkdir -p $T/fakehome/.kde
72 mkdir -p $T/fakehome/.qt
73 export HOME="$T/fakehome"
74 # things that should access the real homedir
75 [ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/"
76
77 while [ "$1" ]; do
78
79 case $1 in
80 myconf)
81 debug-print-section myconf
82 myconf="$myconf --host=${CHOST} --prefix=${PREFIX} --with-x --enable-mitshm --with-xinerama --with-qt-dir=${QTDIR} --enable-mt"
83 # calculate dependencies separately from compiling, enables ccache to work on kde compiles
84 myconf="$myconf --disable-dependency-tracking"
85 # use debug is replacing $DEBUG
86 if [ -n "$DEBUG" -o -n "`use debug`" ]; then
87 myconf="$myconf --enable-debug=full --with-debug"
88 else
89 myconf="$myconf --disable-debug --without-debug"
90 fi
91 debug-print "$FUNCNAME: myconf: set to ${myconf}"
92 ;;
93 configure)
94 debug-print-section configure
95 debug-print "$FUNCNAME::configure: myconf=$myconf"
96
97 # rebuild configure script, etc
98 # This can happen with e.g. a cvs snapshot
99 if [ ! -f "./configure" ]; then
100 for x in Makefile.cvs admin/Makefile.common; do
101 if [ -f "$x" ] && [ -z "$makefile" ]; then makefile="$x"; fi
102 done
103 if [ -f "$makefile" ]; then
104 debug-print "$FUNCNAME: configure: generating configure script, running make -f $makefile"
105 make -f $makefile
106 fi
107 [ -f "./configure" ] || die "no configure script found, generation unsuccessful"
108 fi
109
110 export PATH="${KDEDIR}/bin:${PATH}"
111
112 # configure doesn't need to know about the other KDEs installed.
113 # in fact, if it does, it sometimes tries to use the wrong dcopidl, etc.
114 # due to the messed up way configure searches for things
115 export KDEDIRS="${PREFIX}:${KDEDIR}"
116
117 # *FLAGS need to be set correctly if we want a succefull build
118 if [ "${ARCH}" = "hppa" ]
119 then
120 export LDFLAGS="-ffunction-sections -Wl,--stub-group-size=25000 -fPIC"
121 export CFLAGS="-O1 -pipe"
122 export CXXFLAGS="-O1 -pipe"
123 fi
124
125 cd $S
126 ./configure ${myconf} || die "died running ./configure, $FUNCNAME:configure"
127
128 # Seems ./configure add -O2 by default but we don't want it but we need -fPIC
129 if [ "${ARCH}" = "hppa" ]
130 then
131 einfo Fixating Makefiles
132 find ${S} -name Makefile | while read a; do cp $a $a.orig; sed -e s/-O2/-ffunction-sections\ -fPIC/ $a.orig > $a; done
133 fi
134 ;;
135 make)
136 export PATH="${KDEDIR}/bin:${PATH}"
137 debug-print-section make
138 emake || die "died running emake, $FUNCNAME:make"
139 ;;
140 all)
141 debug-print-section all
142 kde_src_compile myconf configure make
143 ;;
144 esac
145
146 shift
147 done
148
149 }
150
151 kde_src_install() {
152
153 debug-print-function $FUNCNAME $*
154 [ -z "$1" ] && kde_src_install all
155
156 cd ${S}
157
158 while [ "$1" ]; do
159
160 case $1 in
161 make)
162 debug-print-section make
163 make install DESTDIR=${D} destdir=${D} || die "died running make install, $FUNCNAME:make"
164 ;;
165 dodoc)
166 debug-print-section dodoc
167 for doc in AUTHORS ChangeLog* README* COPYING NEWS TODO; do
168 [ -f "$doc" ] && dodoc $doc
169 done
170 ;;
171 all)
172 debug-print-section all
173 kde_src_install make dodoc
174 ;;
175 esac
176
177 shift
178 done
179
180 }
181
182 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20