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

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

  ViewVC Help
Powered by ViewVC 1.1.20