/[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.3 Revision 1.11
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.3 2007/09/17 10:58:04 grobian Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.11 2009/07/06 19:55:55 grobian 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
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="virtual/libc
19 doc? ( virtual/tetex =dev-tex/latex2html-2002* >=app-text/texi2html-1.64 )" 19 doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )"
20 20
21# Where to install GNUstep 21# Where to install GNUstep
22GNUSTEP_PREFIX="/usr/GNUstep" 22GNUSTEP_PREFIX="/usr/GNUstep"
23 23
24# GNUstep environment array 24# GNUstep environment array
55 GNUmakefile 55 GNUmakefile
56 eend $? 56 eend $?
57 fi 57 fi
58} 58}
59 59
60gnustep-base_src_compile() { 60gnustep-base_src_configure() {
61 egnustep_env 61 egnustep_env
62 if [[ -x ./configure ]] ; then 62 if [[ -x ./configure ]] ; then
63 econf || die "configure failed" 63 econf || die "configure failed"
64 fi 64 fi
65}
66
67gnustep-base_src_compile() {
68 egnustep_env
69 case ${EAPI:-0} in
70 0|1) gnustep-base_src_configure ;;
71 esac
72
65 egnustep_make 73 egnustep_make
66} 74}
67 75
68gnustep-base_src_install() { 76gnustep-base_src_install() {
69 egnustep_env 77 egnustep_env
101 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \ 109 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \
102 || append-ldflags \ 110 || append-ldflags \
103 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" 111 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}"
104 ;; 112 ;;
105 esac 113 esac
106 is-ldflagq -L"${GNUSTEP_SYSTEM_LIBRARIES}" \
107 || append-ldflags \
108 -L"${GNUSTEP_SYSTEM_LIBRARIES}"
109 114
110 # Set up env vars for make operations 115 # Set up env vars for make operations
111 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ 116 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \
117 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \
112 DESTDIR="${D}" \ 118 DESTDIR="${D}" \
113 HOME="${T}" \ 119 HOME="${T}" \
114 GNUSTEP_USER_DIR="${T}" \ 120 GNUSTEP_USER_DIR="${T}" \
115 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \ 121 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \
116 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ 122 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
117 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ 123 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \
118 messages=yes \ 124 messages=yes )
119 -j1 ) 125
120 # -j1 is needed as gnustep-make is not parallel-safe 126 # Parallel-make support was added in gnustep-make 2.2.0
127 has_version "<gnustep-base/gnustep-make-2.2.0" \
128 && GS_ENV=( "${GS_ENV[@]}" "-j1" )
121 129
122 use debug \ 130 use debug \
123 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ 131 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \
124 || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) 132 || GS_ENV=( "${GS_ENV[@]}" "debug=no" )
125 133
128 die "gnustep-make not installed!" 136 die "gnustep-make not installed!"
129} 137}
130 138
131# Make utilizing GNUstep Makefiles 139# Make utilizing GNUstep Makefiles
132egnustep_make() { 140egnustep_make() {
133 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then 141 if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then
134 emake ${*} "${GS_ENV[@]}" all || die "package make failed" 142 emake ${*} "${GS_ENV[@]}" all || die "package make failed"
135 return 0 143 return 0
136 fi 144 fi
137 die "no Makefile found" 145 die "no Makefile found"
138} 146}
164egnustep_install_config() { 172egnustep_install_config() {
165 [[ $(type -t gnustep_config_script) != "function" ]] && return 0 173 [[ $(type -t gnustep_config_script) != "function" ]] && return 0
166 174
167 local cfile=config-${PN}.sh 175 local cfile=config-${PN}.sh
168 176
169 echo '#!/usr/bin/env bash' > "${T}"/${cfile} 177 cat << 'EOF' > "${T}"/${cfile}
178#!/usr/bin/env bash
179gnustep_append_default() {
180 if [[ -z $1 || -z $2 || -z $3 ]]; then
181 echo "warning: invalid script invocation"
182 return
183 fi
184 dom=$1
185 key=$2
186 val=$3
187 cur=$(defaults read ${dom} ${key}) 2> /dev/null
188 if [[ -z $cur ]] ; then
189 echo " * setting ${dom} ${key}"
190 defaults write ${dom} ${key} "( ${val} )"
191 elif [[ ${cur} != *${val}* ]] ; then
192 echo " * adding ${val} to ${dom} ${key}"
193 echo "${cur%)\'}, \"${val}\" )'" | defaults write
194 else
195 echo " * ${val} already present in ${dom} ${key}"
196 fi
197}
198
199gnustep_set_default() {
200 if [[ -z $1 || -z $2 || -z $3 ]]; then
201 echo "warning: invalid script invocation"
202 return
203 fi
204 dom=$1
205 key=$2
206 val=$3
207 echo " * setting ${dom} ${key}"
208 defaults write ${dom} ${key} ${val}
209}
210
211EOF
212
170 echo "echo Applying ${P} default configuration ..." >> "${T}"/${cfile} 213 echo "echo \"Applying ${P} default configuration ...\"" >> "${T}"/${cfile}
214
171 gnustep_config_script | \ 215 gnustep_config_script | \
172 while read line ; do 216 while read line ; do
173 echo "${line}" >> "${T}"/${cfile} 217 echo "${line}" >> "${T}"/${cfile}
174 done 218 done
175 echo 'echo "done"' >> "${T}"/${cfile} 219 echo 'echo "done"' >> "${T}"/${cfile}
176 220
177 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo 221 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo
178 doexe "${T}"/${cfile} 222 doexe "${T}"/${cfile}
179} 223}
180 224
225case ${EAPI:-0} in
181EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst 226 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;;
227 2) EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_compile src_install pkg_postinst ;;
228esac

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20