/[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.13 Revision 1.19
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.13 2009/11/25 10:11:40 voyageur Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.19 2011/06/28 15:27:23 voyageur Exp $
4 4
5inherit eutils flag-o-matic 5# @ECLASS: gnustep-base.eclass
6 6# @MAINTAINER:
7# GNUstep Herd <gnustep@gentoo.org>
8# @BLURB: Internal handling of GNUstep pacakges
9# @DESCRIPTION:
7# Inner gnustep eclass, should only be inherited directly by gnustep-base 10# Inner gnustep eclass, should only be inherited directly by gnustep-base
8# packages 11# packages
9# 12
10# maintainer: GNUstep Herd <gnustep@gentoo.org> 13inherit eutils flag-o-matic
11 14
12# IUSE variables across all GNUstep packages 15# IUSE variables across all GNUstep packages
13# "debug": enable code for debugging 16# "debug": enable code for debugging
14# "doc": build and install documentation, if available 17# "doc": build and install documentation, if available
15IUSE="debug doc" 18IUSE="debug doc"
16 19
17# packages needed to build any base gnustep package 20# packages needed to build any base gnustep package
18GNUSTEP_CORE_DEPEND="doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )" 21GNUSTEP_CORE_DEPEND="doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )"
19 22
20# Where to install GNUstep 23# New layout is used when ${EPREFIX}/usr/share/GNUstep/Makefiles exists
24# Where to install GNUstep (with old layout)
21GNUSTEP_PREFIX="/usr/GNUstep" 25GNUSTEP_PREFIX="${EPREFIX}/usr/GNUstep"
22 26
23# GNUstep environment array 27# GNUstep environment array
24typeset -a GS_ENV 28typeset -a GS_ENV
25 29
26# Ebuild function overrides 30# Ebuild function overrides
49 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this 53 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this
50 # only removes a part of a path it's good that it bails out, as we want 54 # only removes a part of a path it's good that it bails out, as we want
51 # to know when they use some direct include. 55 # to know when they use some direct include.
52 ebegin "Cleaning paths from GNUmakefile" 56 ebegin "Cleaning paths from GNUmakefile"
53 sed -i \ 57 sed -i \
54 -e 's|-I/usr/X11R6/include||g' \ 58 -e 's|-I/usr/X11R6/include/\?||g' \
55 -e 's|-I/usr/include||g' \ 59 -e 's|-I/usr/include/\?||g' \
56 -e 's|-L/usr/X11R6/lib||g' \ 60 -e 's|-L/usr/X11R6/lib/\?||g' \
57 -e 's|-L/usr/lib||g' \ 61 -e 's|-L/usr/lib/\?||g' \
58 GNUmakefile 62 GNUmakefile
59 eend $? 63 eend $?
60 fi 64 fi
61} 65}
62 66
87} 91}
88 92
89gnustep-base_pkg_postinst() { 93gnustep-base_pkg_postinst() {
90 [[ $(type -t gnustep_config_script) != "function" ]] && return 0 94 [[ $(type -t gnustep_config_script) != "function" ]] && return 0
91 95
96 local SCRIPT_PATH
97 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
98 SCRIPT_PATH="/usr/bin"
99 else
100 SCRIPT_PATH=${GNUSTEP_SYSTEM_TOOLS}/Gentoo
101 fi
92 elog "To use this package, as *user* you should run:" 102 elog "To use this package, as *user* you should run:"
93 elog " ${GNUSTEP_SYSTEM_TOOLS}/Gentoo/config-${PN}.sh" 103 elog " ${SCRIPT_PATH}/config-${PN}.sh"
94} 104}
95 105
96# Clean/reset an ebuild to the installed GNUstep environment 106# Clean/reset an ebuild to the installed GNUstep environment
97egnustep_env() { 107egnustep_env() {
98 # Get additional variables 108 # Get additional variables
99 GNUSTEP_SH_EXPORT_ALL_VARIABLES="true" 109 GNUSTEP_SH_EXPORT_ALL_VARIABLES="true"
100 110
101 if [[ -f ${GNUSTEP_PREFIX}/System/Library/Makefiles/GNUstep.sh ]] ; then 111 # Makefiles path
112 local GS_MAKEFILES
113 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
114 GS_MAKEFILES=${EPREFIX}/usr/share/GNUstep/Makefiles
115 else
116 GS_MAKEFILES=${GNUSTEP_PREFIX}/System/Library/Makefiles
117 fi
118 if [[ -f ${GS_MAKEFILES}/GNUstep.sh ]] ; then
102 # Reset GNUstep variables 119 # Reset GNUstep variables
103 source "${GNUSTEP_PREFIX}"/System/Library/Makefiles/GNUstep-reset.sh 120 source "${GS_MAKEFILES}"/GNUstep-reset.sh
104 source "${GNUSTEP_PREFIX}"/System/Library/Makefiles/GNUstep.sh 121 source "${GS_MAKEFILES}"/GNUstep.sh
105 122
106 # Needed to run installed GNUstep apps in sandbox 123 # Create compilation GNUstep.conf if it does not exist yet
107 addpredict "/root/GNUstep" 124 if [[ ! -f ${T}/GNUstep.conf ]]; then
125 cp "${EPREFIX}"/etc/GNUstep/GNUstep.conf "${T}" \
126 || die "GNUstep.conf copy failed"
127 sed -e "s#\(GNUSTEP_USER_DIR=\).*#\1${T}#" \
128 -e "s#\(GNUSTEP_USER_DEFAULTS_DIR=\).*#\1${T}/Defaults#" \
129 -i "${T}"/GNUstep.conf || die "GNUstep.conf sed failed"
130 fi
108 131
132
133 if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
109 # Set rpath in ldflags when available 134 # Set rpath in ldflags when available
110 case ${CHOST} in 135 case ${CHOST} in
111 *-linux-gnu|*-solaris*) 136 *-linux-gnu|*-solaris*)
112 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \ 137 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \
113 || append-ldflags \ 138 || append-ldflags \
114 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" 139 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}"
115 ;; 140 ;;
116 esac 141 esac
142 fi
117 143
118 # Set up env vars for make operations 144 # Set up env vars for make operations
119 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ 145 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \
120 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \ 146 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \
121 DESTDIR="${D}" \ 147 DESTDIR="${D}" \
122 HOME="${T}" \ 148 HOME="${T}" \
149 GNUSTEP_CONFIG_FILE="${T}"/GNUstep.conf \
123 GNUSTEP_USER_DIR="${T}" \ 150 GNUSTEP_USER_DIR="${T}" \
124 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \ 151 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \
125 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ 152 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
126 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ 153 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \
127 messages=yes ) 154 messages=yes )
128 155
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" )
132
133 use debug \ 156 use debug \
134 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ 157 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \
135 || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) 158 || GS_ENV=( "${GS_ENV[@]}" "debug=no" )
136 159
137 return 0 160 return 0
148 die "no Makefile found" 171 die "no Makefile found"
149} 172}
150 173
151# Make-install utilizing GNUstep Makefiles 174# Make-install utilizing GNUstep Makefiles
152egnustep_install() { 175egnustep_install() {
176 if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
153 # avoid problems due to our "weird" prefix, make sure it exists 177 # avoid problems due to our "weird" prefix, make sure it exists
154 mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS} 178 mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS}
179 fi
155 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then 180 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then
156 emake ${*} "${GS_ENV[@]}" install || die "package install failed" 181 emake ${*} "${GS_ENV[@]}" install || die "package install failed"
157 return 0 182 return 0
158 fi 183 fi
159 die "no Makefile found" 184 die "no Makefile found"
219 while read line ; do 244 while read line ; do
220 echo "${line}" >> "${T}"/${cfile} 245 echo "${line}" >> "${T}"/${cfile}
221 done 246 done
222 echo 'echo "done"' >> "${T}"/${cfile} 247 echo 'echo "done"' >> "${T}"/${cfile}
223 248
249 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
250 exeinto /usr/bin
251 else
224 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo 252 exeinto ${GNUSTEP_SYSTEM_TOOLS#${EPREFIX}}/Gentoo
253 fi
225 doexe "${T}"/${cfile} 254 doexe "${T}"/${cfile}
226} 255}
227 256
228case ${EAPI:-0} in 257case ${EAPI:-0} in
229 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;; 258 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 ;; 259 *) EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst ;;
231esac 260esac

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

  ViewVC Help
Powered by ViewVC 1.1.20