/[gentoo-x86]/eclass/gnustep-base.eclass
Gentoo

Diff of /eclass/gnustep-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.13
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.2 2007/08/19 18:15:04 grobian Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.13 2009/11/25 10:11:40 voyageur Exp $
4 4
5inherit eutils flag-o-matic 5inherit eutils flag-o-matic
6 6
7# Inner gnustep eclass, should only be inherited directly by gnustep-base 7# Inner gnustep eclass, should only be inherited directly by gnustep-base
8# packages 8# packages
13# "debug": enable code for debugging 13# "debug": enable code for debugging
14# "doc": build and install documentation, if available 14# "doc": build and install documentation, if available
15IUSE="debug doc" 15IUSE="debug doc"
16 16
17# packages needed to build any base gnustep package 17# packages needed to build any base gnustep package
18GNUSTEP_CORE_DEPEND="virtual/libc 18GNUSTEP_CORE_DEPEND="doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )"
19 doc? ( virtual/tetex =dev-tex/latex2html-2002* >=app-text/texi2html-1.64 )"
20 19
21# Where to install GNUstep 20# Where to install GNUstep
22GNUSTEP_PREFIX="/usr/GNUstep" 21GNUSTEP_PREFIX="/usr/GNUstep"
23 22
24# GNUstep environment array 23# GNUstep environment array
39 38
40gnustep-base_src_unpack() { 39gnustep-base_src_unpack() {
41 unpack ${A} 40 unpack ${A}
42 cd "${S}" 41 cd "${S}"
43 42
43 gnustep-base_src_prepare
44}
45
46gnustep-base_src_prepare() {
44 if [[ -f ./GNUmakefile ]] ; then 47 if [[ -f ./GNUmakefile ]] ; then
45 # Kill stupid includes that are simply overdone or useless on normal 48 # Kill stupid includes that are simply overdone or useless on normal
46 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this 49 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this
47 # only removes a part of a path it's good that it bails out, as we want 50 # only removes a part of a path it's good that it bails out, as we want
48 # to know when they use some direct include. 51 # to know when they use some direct include.
55 GNUmakefile 58 GNUmakefile
56 eend $? 59 eend $?
57 fi 60 fi
58} 61}
59 62
60gnustep-base_src_compile() { 63gnustep-base_src_configure() {
61 egnustep_env 64 egnustep_env
62 if [[ -x ./configure ]] ; then 65 if [[ -x ./configure ]] ; then
63 econf || die "configure failed" 66 econf || die "configure failed"
64 fi 67 fi
68}
69
70gnustep-base_src_compile() {
71 egnustep_env
72 case ${EAPI:-0} in
73 0|1) gnustep-base_src_configure ;;
74 esac
75
65 egnustep_make 76 egnustep_make
66} 77}
67 78
68gnustep-base_src_install() { 79gnustep-base_src_install() {
69 egnustep_env 80 egnustep_env
96 addpredict "/root/GNUstep" 107 addpredict "/root/GNUstep"
97 108
98 # Set rpath in ldflags when available 109 # Set rpath in ldflags when available
99 case ${CHOST} in 110 case ${CHOST} in
100 *-linux-gnu|*-solaris*) 111 *-linux-gnu|*-solaris*)
112 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \
101 append-ldflags \ 113 || append-ldflags \
102 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \ 114 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}"
103 -L"${GNUSTEP_SYSTEM_LIBRARIES}"
104 ;;
105 *)
106 append-ldflags \
107 -L"${GNUSTEP_SYSTEM_LIBRARIES}"
108 ;; 115 ;;
109 esac 116 esac
110 117
111 # Set up env vars for make operations 118 # Set up env vars for make operations
112 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ 119 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \
120 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \
113 DESTDIR="${D}" \ 121 DESTDIR="${D}" \
114 HOME="${T}" \ 122 HOME="${T}" \
115 GNUSTEP_USER_DIR="${T}" \ 123 GNUSTEP_USER_DIR="${T}" \
116 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \ 124 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \
117 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ 125 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
118 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ 126 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \
119 messages=yes \ 127 messages=yes )
120 -j1 ) 128
121 # -j1 is needed as gnustep-make is not parallel-safe 129 # Parallel-make support was added in gnustep-make 2.2.0
130 has_version "<gnustep-base/gnustep-make-2.2.0" \
131 && GS_ENV=( "${GS_ENV[@]}" "-j1" )
122 132
123 use debug \ 133 use debug \
124 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ 134 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \
125 || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) 135 || GS_ENV=( "${GS_ENV[@]}" "debug=no" )
126 136
129 die "gnustep-make not installed!" 139 die "gnustep-make not installed!"
130} 140}
131 141
132# Make utilizing GNUstep Makefiles 142# Make utilizing GNUstep Makefiles
133egnustep_make() { 143egnustep_make() {
134 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then 144 if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then
135 emake ${*} "${GS_ENV[@]}" all || die "package make failed" 145 emake ${*} "${GS_ENV[@]}" all || die "package make failed"
136 return 0 146 return 0
137 fi 147 fi
138 die "no Makefile found" 148 die "no Makefile found"
139} 149}
165egnustep_install_config() { 175egnustep_install_config() {
166 [[ $(type -t gnustep_config_script) != "function" ]] && return 0 176 [[ $(type -t gnustep_config_script) != "function" ]] && return 0
167 177
168 local cfile=config-${PN}.sh 178 local cfile=config-${PN}.sh
169 179
170 echo '#!/usr/bin/env bash' > "${T}"/${cfile} 180 cat << 'EOF' > "${T}"/${cfile}
181#!/usr/bin/env bash
182gnustep_append_default() {
183 if [[ -z $1 || -z $2 || -z $3 ]]; then
184 echo "warning: invalid script invocation"
185 return
186 fi
187 dom=$1
188 key=$2
189 val=$3
190 cur=$(defaults read ${dom} ${key}) 2> /dev/null
191 if [[ -z $cur ]] ; then
192 echo " * setting ${dom} ${key}"
193 defaults write ${dom} ${key} "( ${val} )"
194 elif [[ ${cur} != *${val}* ]] ; then
195 echo " * adding ${val} to ${dom} ${key}"
196 echo "${cur%)\'}, \"${val}\" )'" | defaults write
197 else
198 echo " * ${val} already present in ${dom} ${key}"
199 fi
200}
201
202gnustep_set_default() {
203 if [[ -z $1 || -z $2 || -z $3 ]]; then
204 echo "warning: invalid script invocation"
205 return
206 fi
207 dom=$1
208 key=$2
209 val=$3
210 echo " * setting ${dom} ${key}"
211 defaults write ${dom} ${key} ${val}
212}
213
214EOF
215
171 echo "echo Applying ${P} default configuration ..." >> "${T}"/${cfile} 216 echo "echo \"Applying ${P} default configuration ...\"" >> "${T}"/${cfile}
217
172 gnustep_config_script | \ 218 gnustep_config_script | \
173 while read line ; do 219 while read line ; do
174 echo "${line}" >> "${T}"/${cfile} 220 echo "${line}" >> "${T}"/${cfile}
175 done 221 done
176 echo 'echo "done"' >> "${T}"/${cfile} 222 echo 'echo "done"' >> "${T}"/${cfile}
177 223
178 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo 224 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo
179 doexe "${T}"/${cfile} 225 doexe "${T}"/${cfile}
180} 226}
181 227
228case ${EAPI:-0} in
182EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst 229 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;;
230 2) EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst ;;
231esac

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20